diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-13 17:46:45 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-13 17:46:45 +0000 |
commit | ece80595836be086201629824bceeae05892cd55 (patch) | |
tree | 9171c63c657bd4a511f8f1e4474eef96418d71f8 /mod/sitepages/start.php | |
parent | 2ac6d8f4d1738d299dab4fc5ac0cd28f7c3c00b5 (diff) | |
download | elgg-ece80595836be086201629824bceeae05892cd55.tar.gz elgg-ece80595836be086201629824bceeae05892cd55.tar.bz2 |
Removed ECML from Site Pages.
git-svn-id: http://code.elgg.org/elgg/trunk@5721 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/sitepages/start.php')
-rw-r--r-- | mod/sitepages/start.php | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/mod/sitepages/start.php b/mod/sitepages/start.php index a1a9f6978..bacad75fa 100644 --- a/mod/sitepages/start.php +++ b/mod/sitepages/start.php @@ -12,16 +12,11 @@ * @link http://elgg.org/ * * @todo - * Check for SQL injection problems. - * Force [[login_box]] in the logged out view. * Make sure this stuff doesn't show up in search. - * Check entity keyword views against fullview. Force to FALSE? * DRY up actions and views - * Implement sticky forms * Use $entity->view to redirect to url of page. * The tool settings view is probably not needed as it can be added to the front page edit tab. * You can say pg/sitepages/edit|read/any_page_i_want and it will let you. - * Clean up and probably move the docs for keywords. */ /** @@ -48,24 +43,9 @@ function sitepages_init() { register_plugin_hook('index', 'system', 'sitepages_custom_index'); } - // parse views for keywords - register_plugin_hook('display', 'view', 'sitepages_parse_view'); - - // register the views we want to parse for the keyword replacement - // right now this is just the custom front page, but we can - // expand it to the other pages later. - $CONFIG->sitepages_parse_views = array( - 'sitepages/custom_frontpage' - ); - - // an example of how to register and respond to the get_keywords trigger - register_plugin_hook('get_keywords', 'sitepages', 'sitepages_keyword_hook'); - - // grab the list of keywords and their views from plugins - if ($keywords = trigger_plugin_hook('get_keywords', 'sitepages', NULL, array())) { - ksort($keywords); - $CONFIG->sitepages_keywords = $keywords; - } + // define our own ecml keywords and views + register_plugin_hook('get_keywords', 'ecml', 'sitepages_ecml_keyword_hook'); + register_plugin_hook('get_views', 'ecml', 'sitepages_ecml_views_hook'); register_action("sitepages/add", FALSE, $CONFIG->pluginspath . "sitepages/actions/add.php"); register_action("sitepages/addfront", FALSE, $CONFIG->pluginspath . "sitepages/actions/addfront.php"); @@ -205,24 +185,38 @@ function sitepages_parse_view($hook, $entity_type, $return_value, $params) { * @param unknown_type $params * @return unknown_type */ -function sitepages_keyword_hook($hook, $entity_type, $return_value, $params) { +function sitepages_ecml_keyword_hook($hook, $entity_type, $return_value, $params) { $return_value['login_box'] = array( 'view' => 'account/forms/login', - 'description' => elgg_echo('sitepages:keywords:login_box') + 'description' => elgg_echo('sitepages:ecml:keywords:login_box') ); $return_value['user_list'] = array( 'view' => 'sitepages/keywords/user_list', - 'description' => elgg_echo('sitepages:keywords:user_list') + 'description' => elgg_echo('sitepages:ecml:keywords:user_list') ); $return_value['site_stats'] = array( 'view' => 'sitepages/keywords/site_stats', - 'description' => elgg_echo('sitepages:keywords:site_stats') + 'description' => elgg_echo('sitepages:ecml:keywords:site_stats') ); return $return_value; } +/** + * Register the frontpage with ECML. + * + * @param unknown_type $hook + * @param unknown_type $entity_type + * @param unknown_type $return_value + * @param unknown_type $params + */ +function sitepages_ecml_views_hook($hook, $entity_type, $return_value, $params) { + $return_value['sitepages/custom_frontpage'] = elgg_echo('sitepages:ecml:views:custom_frontpage'); + + return $return_value; +} + register_elgg_event_handler('init', 'system', 'sitepages_init'); register_elgg_event_handler('pagesetup', 'system', 'sitepages_pagesetup');
\ No newline at end of file |