<?php # user login page $p = new \User\LoginPage(array('path' => page_login(), 'title' => 'User authentication')); $p->register(); # dashboard page $p = new \App\Dashboard(array('path' => page_home(), 'title' => 'Home')); $p->menu = new \Meta\Menu\Item(array('icon' => 'glyphicon-home')); $p->restrict = true; $p->register(); # user profile page $p = new \Meta\Page(array('path' => page_profile(), 'title' => 'Edit profile')); $p->add(new \User\ProfileForm()); $p->register(); # manage menu root $p = new \Meta\Page(array('path' => 'manage', 'title' => 'Manage')); $p->menu = new \Meta\Menu\Item(array('icon' => 'glyphicon-cog')); $p->restrict = true; $p->register(); # users crud $p = new \Meta\Page\Crud(array('path' => 'admin-users', 'title' => 'Users', 'table' => 'users')); $p->menu = new \Meta\Menu\Item(array('icon' => 'glyphicon-user', 'parent' => 'manage')); $p->restrict = true; $p->form = new \User\UsersForm(); $p->view->query->searchFields = array('login', 'name', 'mail'); $p->register(); # groups crud $p = new \Meta\Page\Crud(array('path' => 'admin-groups', 'title' => 'Groups', 'table' => 'groups')); $p->menu = new \Meta\Menu\Item(array('icon' => 'glyphicon-tasks', 'parent' => 'manage')); $p->restrict = true; $p->form = new \User\GroupsForm();
<!-- /.navbar-header --> <?php if ($user) { ?> <ul class="nav navbar-top-links navbar-right"> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i> <?php echo $user->login; ?> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="<?php echo url(page_profile()); ?> "><i class="fa fa-user fa-fw"></i> My profile</a> </li> <!-- <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a> </li>--> <li class="divider"></li> <li><a href="<?php echo url(page_login(), array('action' => 'logout')); ?> "><i class="fa fa-sign-out fa-fw"></i> <?php echo t('Logout'); ?> </a> </li> </ul>