]> gitweb.fluxo.info Git - lorea/saravea_theme.git/commitdiff
Made page icons smaller.
authorSem <sembrestels@riseup.net>
Mon, 20 Aug 2012 19:45:36 +0000 (21:45 +0200)
committerSem <sembrestels@riseup.net>
Mon, 20 Aug 2012 19:45:36 +0000 (21:45 +0200)
_graphics/pages_icons/pages_small.gif [new file with mode: 0644]
_graphics/pages_icons/pages_tiny.gif [new file with mode: 0644]
start.php

diff --git a/_graphics/pages_icons/pages_small.gif b/_graphics/pages_icons/pages_small.gif
new file mode 100644 (file)
index 0000000..902bff5
Binary files /dev/null and b/_graphics/pages_icons/pages_small.gif differ
diff --git a/_graphics/pages_icons/pages_tiny.gif b/_graphics/pages_icons/pages_tiny.gif
new file mode 100644 (file)
index 0000000..f7349fa
Binary files /dev/null and b/_graphics/pages_icons/pages_tiny.gif differ
index c7dae0e89e57edd097e6e7787278f99566d75977..4ffdb47111f1b42aa7b7fe0c7383d38e77b2d184 100644 (file)
--- a/start.php
+++ b/start.php
@@ -12,6 +12,11 @@ function n1_theme_init() {
        \r
        elgg_register_simplecache_view('n1_theme/landing');\r
        elgg_register_css('n1:landing_page', elgg_get_simplecache_url('css', 'n1_theme/landing'));\r
+       \r
+       if (elgg_is_active_plugin('pages')) {\r
+               // pages icon url override\r
+               elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'n1_theme_pages_icon_url_override');\r
+       }\r
 }\r
 \r
 function n1_theme_topbar_menu($hook, $type, $returnvalue, $params){\r
@@ -22,3 +27,27 @@ function n1_theme_front_page($hook, $type, $returnvalue, $params) {
        include(elgg_get_plugins_path() . 'n1_theme/index.php');\r
        return true;\r
 }\r
+\r
+/**\r
+ * Override the default entity icon for pages\r
+ *\r
+ * @return string Relative URL\r
+ */\r
+function n1_theme_pages_icon_url_override($hook, $type, $returnvalue, $params) {\r
+       $entity = $params['entity'];\r
+       if (elgg_instanceof($entity, 'object', 'page_top') ||\r
+               elgg_instanceof($entity, 'object', 'page')) {\r
+               switch ($params['size']) {\r
+                       case 'topbar':\r
+                       case 'tiny':\r
+                               return 'mod/n1_theme/_graphics/pages_icons/pages_tiny.gif';\r
+                               break;\r
+                       case 'small':\r
+                               return 'mod/n1_theme/_graphics/pages_icons/pages_small.gif';\r
+                               break;\r
+                       default:\r
+                               return 'mod/pages/images/pages_lrg.gif';\r
+                               break;\r
+               }\r
+       }\r
+}
\ No newline at end of file