diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2008-12-08 06:14:34 +0000 | 
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-08 06:14:34 +0000 | 
| commit | b878ed174d9e8628098931156d526b3fc028d905 (patch) | |
| tree | ae355456ce164d46a36d1a01b93f9c46a758d780 /modules/user/helpers | |
| parent | 655581f3c996a6404f07486ade64d30cab335e8e (diff) | |
Refactor Menu code to create allow you to create menus using a
chainable factory interface and retrieve them by ids.  Streamlined the
HTML creation code a little bit in the process, moved the basic menu
functionality into Theme_View and created the option to have different
menus other than site_navigation().
Diffstat (limited to 'modules/user/helpers')
| -rw-r--r-- | modules/user/helpers/user_menu.php | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/modules/user/helpers/user_menu.php b/modules/user/helpers/user_menu.php index d6769513..0f25527a 100644 --- a/modules/user/helpers/user_menu.php +++ b/modules/user/helpers/user_menu.php @@ -17,14 +17,15 @@   * along with this program; if not, write to the Free Software   * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.   */ -  class user_menu_Core { -  public static function items($menus, $theme) { -    $user = Session::instance()->get('user', null); +  public static function site_navigation($menu, $theme) { +    $user = Session::instance()->get("user", null);      if ($user) { -      $admin_menu = $menus->get(_("ADMIN")); -      $admin_menu->append( new Menu_Dialog(_("Edit Profile"), "users/form/edit/{$user->id}")); +      $menu->get("admin_menu")->append( +        Menu::Factory("dialog") +        ->id("edit_profile") +        ->label(_("Edit Profile")) +        ->url(url::site("users/form/edit/$user->id")));      }    } -  } | 
