diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-06 19:16:23 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-06 19:16:23 +0000 |
commit | c2d82db47ccdbd388658433d1f703c560d7fb84b (patch) | |
tree | 0bb352e9f7f9b6f676a5a7b608c18b2fe363b39b /mod/pages/start.php | |
parent | 562900f1b36820843a28d7b68f2f0f3e55e04dbf (diff) | |
download | elgg-c2d82db47ccdbd388658433d1f703c560d7fb84b.tar.gz elgg-c2d82db47ccdbd388658433d1f703c560d7fb84b.tar.bz2 |
Fixes #2853 pages plugin uses the icon url plugin hook and fixes delete action
git-svn-id: http://code.elgg.org/elgg/trunk@8044 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/start.php')
-rw-r--r-- | mod/pages/start.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mod/pages/start.php b/mod/pages/start.php index efbf243d6..4a48368ec 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -68,6 +68,9 @@ function pages_init() { elgg_register_plugin_hook_handler('permissions_check', 'object', 'pages_write_permission_check'); elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'pages_container_permission_check'); + // icon url override + elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'pages_icon_url_override'); + // register ecml views to parse elgg_register_plugin_hook_handler('get_views', 'ecml', 'pages_ecml_views_hook'); } @@ -173,6 +176,26 @@ function pages_revision_url($annotation) { } /** + * Override the default entity icon for pages + * + * @return string Relative URL + */ +function pages_icon_url_override($hook, $type, $returnvalue, $params) { + $entity = $params['entity']; + if (elgg_instanceof($entity, 'object', 'page_top') || + elgg_instanceof($entity, 'object', 'page')) { + switch ($params['size']) { + case 'small': + return 'mod/pages/images/pages.gif'; + break; + case 'medium': + return 'mod/pages/images/pages_lrg.gif'; + break; + } + } +} + +/** * Add a menu item to the user ownerblock */ function pages_owner_block_menu($hook, $type, $return, $params) { |