]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3358. Renamed menu's class to link_class and documented possible problems...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 18 Apr 2011 21:11:00 +0000 (21:11 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 18 Apr 2011 21:11:00 +0000 (21:11 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@9005 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggMenuItem.php
engine/lib/navigation.php
views/default/page/layouts/content/header.php

index bf6cf2edc2fb2de3f4083e928412c8f26f40a901..61dbf539e0e906e5e53a65fe9c0954747878a935 100644 (file)
@@ -123,9 +123,9 @@ class ElggMenuItem {
                        unset($options['context']);
                }
 
-               if (isset($options['class'])) {
-                       $item->setLinkClass($options['class']);
-                       unset($options['class']);
+               if (isset($options['link_class'])) {
+                       $item->setLinkClass($options['link_class']);
+                       unset($options['link_class']);
                }
 
                if (isset($options['item_class'])) {
@@ -459,7 +459,7 @@ class ElggMenuItem {
                if ($this->href) {
                        $vars['href'] = $this->href;
                }
-               
+
                if ($this->linkClass) {
                        $vars['class'] = $this->getLinkClass();
                }
index 953bbe59abc46fab183ac4fee539d88e2d88df33..b51c63b492c771732a8720eb90b5339dd8a62ea6 100644 (file)
  * @param mixed  $menu_item A ElggMenuItem object or an array of options in format:
  *                          name        => STR  Menu item identifier (required)
  *                          text        => STR  Menu item display text (required)
- *                          href        => STR  Menu item URL (required) (false for non-links)
+ *                          href        => STR  Menu item URL (required) (false for non-links.
+ *                                              @warning If you disable the href the <a> tag will
+ *                                              not appear, so the link_class will not apply. If you
+ *                                              put <a> tags in manually through the 'text' option
+ *                                              the default CSS selector .elgg-menu-$menu > li > a
+ *                                              may affect formatting. Wrap in a <span> if it does.)
  *                          contexts    => ARR  Page context strings
  *                          section     => STR  Menu section identifier
  *                          title       => STR  Menu item tooltip
  *                          selected    => BOOL Is this menu item currently selected
  *                          parent_name => STR  Identifier of the parent menu item
+ *                          link_class  => STR  A class or classes for the <a> tag
+ *                          item_class  => STR  A class or classes for the <li> tag
  *
  *                          Custom options can be added as key value pairs.
  *
@@ -269,7 +276,7 @@ function elgg_river_menu_setup($hook, $type, $return, $params) {
                                        'href' => "#comments-add-$object->guid",
                                        'text' => elgg_view_icon('speech-bubble'),
                                        'title' => elgg_echo('comment:this'),
-                                       'class' => "elgg-toggler",
+                                       'link_class' => "elgg-toggler",
                                        'priority' => 50,
                                );
                                $return[] = ElggMenuItem::factory($options);
index 4c63009f47d78f96c4470e3358aea0b5df05f4d4..403da8a0a3dd9de5fa171fbe97a3e686f429d08d 100644 (file)
@@ -37,7 +37,7 @@ if ($context) {
                                        'name' => 'add',
                                        'href' => elgg_extract('new_link', $vars, "$context/add/$guid"),
                                        'text' => elgg_echo("$context:add"),
-                                       'class' => 'elgg-button elgg-button-action',
+                                       'link_class' => 'elgg-button elgg-button-action',
                                ));
                        }
                }