aboutsummaryrefslogtreecommitdiff
path: root/mod/categories/start.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-16 01:56:18 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-16 01:56:18 +0000
commitfc5ef85ec2fa45afb44795109899d93329f7b2c4 (patch)
tree8d8f958ca42012c2ea753136859f54eda7796ab7 /mod/categories/start.php
parentf29b327342068543b8a2a3f0f487953468f3c9a5 (diff)
downloadelgg-fc5ef85ec2fa45afb44795109899d93329f7b2c4.tar.gz
elgg-fc5ef85ec2fa45afb44795109899d93329f7b2c4.tar.bz2
Merged [5623]:head from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5760 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/categories/start.php')
-rw-r--r--mod/categories/start.php135
1 files changed, 72 insertions, 63 deletions
diff --git a/mod/categories/start.php b/mod/categories/start.php
index 1a8e686fe..dd6da16d5 100644
--- a/mod/categories/start.php
+++ b/mod/categories/start.php
@@ -1,70 +1,79 @@
<?php
- /**
- * Elgg categories plugin
- *
- * @package ElggCategories
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- /**
- * Initialise categories actions etc
- *
- */
- function categories_init() {
-
- // Get config
- global $CONFIG;
-
- elgg_extend_view('css', 'categories/css');
-
- // Register action
- register_action('categories/save',false,$CONFIG->pluginspath . 'categories/actions/save.php',true);
-
- }
-
- /**
- * Set up menu items
- *
- */
- function categories_pagesetup()
- {
- if (get_context() == 'admin' && isadminloggedin()) {
- global $CONFIG;
- add_submenu_item(elgg_echo('categories:settings'), $CONFIG->wwwroot . 'mod/categories/settings.php');
- }
- }
-
- /**
- * Save categories
- *
- */
- function categories_save($event, $object_type, $object) {
+/**
+ * Elgg categories plugin
+ *
+ * @package ElggCategories
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+/**
+ * Initialise categories plugin
+ *
+ */
+function categories_init() {
+
+ global $CONFIG;
+
+ elgg_extend_view('css', 'categories/css');
+
+ register_action('categories/save',false,$CONFIG->pluginspath . 'categories/actions/save.php',true);
+
+ register_page_handler('categories', 'categories_page_handler');
+
+}
+
+/**
+ * Set up admin menu item
+ *
+ */
+function categories_pagesetup() {
+ if (get_context() == 'admin' && isadminloggedin()) {
+ global $CONFIG;
+ add_submenu_item(elgg_echo('categories:settings'), $CONFIG->wwwroot . 'mod/categories/settings.php');
+ }
+}
+
+/**
+ * Page handler
+ *
+ */
+function categories_page_handler() {
+
+ include(dirname(__FILE__) . "/listing.php");
+ return true;
+}
+
+/**
+ * Save site categories
+ *
+ */
+function categories_save($event, $object_type, $object) {
+
+ if ($object instanceof ElggEntity) {
+
+ $marker = get_input('universal_category_marker');
+
+ if ($marker == 'on') {
+
+ $categories = get_input('universal_categories_list');
- if ($object instanceof ElggEntity) {
-
- $marker = get_input('universal_category_marker');
- if ($marker == 'on') {
-
- $categories = get_input('universal_categories_list');
- if (empty($categories)) $categories = array();
-
- $object->universal_categories = $categories;
-
- }
-
+ if (empty($categories)) {
+ $categories = array();
}
- return true;
-
+
+ $object->universal_categories = $categories;
}
-
+ }
+
+ return true;
+}
- register_elgg_event_handler('init','system','categories_init');
- register_elgg_event_handler('pagesetup','system','categories_pagesetup');
- register_elgg_event_handler('update','all','categories_save');
- register_elgg_event_handler('create','all','categories_save');
-?> \ No newline at end of file
+register_elgg_event_handler('init','system','categories_init');
+register_elgg_event_handler('pagesetup','system','categories_pagesetup');
+register_elgg_event_handler('update','all','categories_save');
+register_elgg_event_handler('create','all','categories_save');