From 18c0fa7df85207606084e845c8556f01ff6baf55 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 5 Jan 2010 13:13:11 +0000 Subject: [PATCH] more documentation, and set some extensions to be hidden from the user docs list --- contrib/home/main.php | 1 + contrib/log_db/main.php | 1 + contrib/site_description/main.php | 1 + contrib/wiki/main.php | 2 ++ ext/alias_editor/main.php | 4 ++-- ext/comment/main.php | 3 +-- ext/ext_manager/main.php | 8 +++++++- ext/ext_manager/theme.php | 2 ++ ext/handle_404/main.php | 1 + ext/image/main.php | 1 + ext/index/main.php | 2 +- ext/setup/main.php | 1 + ext/upgrade/main.php | 1 + 13 files changed, 22 insertions(+), 6 deletions(-) diff --git a/contrib/home/main.php b/contrib/home/main.php index 70f5a4ab..380357e8 100644 --- a/contrib/home/main.php +++ b/contrib/home/main.php @@ -3,6 +3,7 @@ * Name: Home Page * Author: Bzchan * License: GPLv2 +* Visibility: admin * Description: Displays a front page with logo, search box and image count * Documentation: * Once enabled, the page will show up at the URL "home", so if you want diff --git a/contrib/log_db/main.php b/contrib/log_db/main.php index 86dc9ad8..f9c869eb 100644 --- a/contrib/log_db/main.php +++ b/contrib/log_db/main.php @@ -3,6 +3,7 @@ * Name: Logging (Database) * Author: Shish * Description: Keep a record of SCore events + * Visibility: admin */ class LogDatabase extends SimpleExtension { diff --git a/contrib/site_description/main.php b/contrib/site_description/main.php index 0eeed863..faccde49 100644 --- a/contrib/site_description/main.php +++ b/contrib/site_description/main.php @@ -3,6 +3,7 @@ * Name: Site Description * Author: Shish * License: GPLv2 + * Visibility: admin * Description: A description for search engines * Documentation: * This extension sets the "description" meta tag in the header diff --git a/contrib/wiki/main.php b/contrib/wiki/main.php index 895dbde9..2955e4e9 100644 --- a/contrib/wiki/main.php +++ b/contrib/wiki/main.php @@ -4,6 +4,8 @@ * Author: Shish * License: GPLv2 * Description: A simple wiki, for those who don't want the hugeness of mediawiki + * Documentation: + * Standard formatting APIs are used (This will be BBCode by default) */ class WikiUpdateEvent extends Event { diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php index fb9135c4..9916c713 100644 --- a/ext/alias_editor/main.php +++ b/ext/alias_editor/main.php @@ -6,8 +6,8 @@ * License: GPLv2 * Description: Edit the alias list * Documentation: - * The list is visible at $site/alias/list; only site admins can edit it, - * other people can view and download it + * The list is visible at /alias/list; only + * site admins can edit it, other people can view and download it */ class AddAliasEvent extends Event { diff --git a/ext/comment/main.php b/ext/comment/main.php index 5ba3047c..bf6907ad 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -6,8 +6,7 @@ * License: GPLv2 * Description: Allow users to make comments on images * Documentation: - * Formatting is done with BBCode, as interpreted by the - * BBCode extension + * Formatting is done with the standard formatting API (normally BBCode) */ require_once "lib/akismet.class.php"; diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php index 7c7a6455..a4bc6918 100644 --- a/ext/ext_manager/main.php +++ b/ext/ext_manager/main.php @@ -4,6 +4,7 @@ * Author: Shish * Link: http://code.shishnet.org/shimmie2/ * License: GPLv2 + * Visibility: admin * Description: A thing for point & click extension management * Documentation: * Allows the admin to view a list of all extensions and enable or @@ -18,7 +19,8 @@ function __extman_extcmp(ExtensionInfo $a, ExtensionInfo $b) { /** @private */ class ExtensionInfo { - var $ext_name, $name, $link, $author, $email, $description, $documentation, $version; + var $ext_name, $name, $link, $author, $email; + var $description, $documentation, $version, $visibility; function ExtensionInfo($main) { $matches = array(); @@ -33,6 +35,9 @@ class ExtensionInfo { if(preg_match("/Name: (.*)/", $line, $matches)) { $this->name = $matches[1]; } + if(preg_match("/Visibility: (.*)/", $line, $matches)) { + $this->visibility = $matches[1]; + } if(preg_match("/Link: (.*)/", $line, $matches)) { $this->link = $matches[1]; if($this->link[0] == "/") { @@ -66,6 +71,7 @@ class ExtensionInfo { $this->documentation .= " ".substr($lines[$i+1], $start_len); $i++; } + $this->documentation = str_replace('$site', make_http(get_base_href()), $this->documentation); } if(preg_match("/\*\//", $line, $matches)) { break; diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php index db8b5548..3a8e383c 100644 --- a/ext/ext_manager/theme.php +++ b/ext/ext_manager/theme.php @@ -18,6 +18,8 @@ class ExtManagerTheme extends Themelet { "; $n = 0; foreach($extensions as $extension) { + if(!$editable && $extension->visibility == "admin") continue; + $ext_name = $extension->ext_name; $h_name = empty($extension->name) ? $ext_name : html_escape($extension->name); $h_description = html_escape($extension->description); diff --git a/ext/handle_404/main.php b/ext/handle_404/main.php index 88b48163..f5baf731 100644 --- a/ext/handle_404/main.php +++ b/ext/handle_404/main.php @@ -4,6 +4,7 @@ * Author: Shish * Link: http://code.shishnet.org/shimmie2/ * License: GPLv2 + * Visibility: admin * Description: Shows an error message when the user views a page with no content */ diff --git a/ext/image/main.php b/ext/image/main.php index c639987d..643e5419 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -3,6 +3,7 @@ * Name: Image Manager * Author: Shish * Description: Handle the image database + * Visibility: admin */ /* diff --git a/ext/index/main.php b/ext/index/main.php index 75f46e4a..c94e8903 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -1,6 +1,6 @@ * Link: http://code.shishnet.org/shimmie2/ * License: GPLv2 diff --git a/ext/setup/main.php b/ext/setup/main.php index 57970646..17647c61 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -2,6 +2,7 @@ /* * Name: Board Config * Author: Shish + * Visibility: admin * Description: Allows the site admin to configure the board to his or her taste */ diff --git a/ext/upgrade/main.php b/ext/upgrade/main.php index 1c99af56..71250776 100644 --- a/ext/upgrade/main.php +++ b/ext/upgrade/main.php @@ -3,6 +3,7 @@ * Name: Database Upgrader * Author: Shish * Description: Keeps things happy behind the scenes + * Visibility: admin */ class Upgrade implements Extension {