(optional) */ // // Authenticated menus… // $main_nav = array( array( 'title' => _("Dashboard"), 'url' => '/', 'aco' => null, ), array( 'title' => _("Triggers"), 'url' => '/triggers.php', 'url+' => null, 'aco' => 'trigger', ), array( 'title' => _("Surveys"), 'url' => '/surveys.php', 'url+' => '/surveys.php?op=add', 'aco' => 'survey', 'children' => array( array( 'title' => _("Questions"), 'url' => '/questions.php', 'url+' => '/questions.php?op=add', 'aco' => 'question', ), array( 'title' => _("Participants"), 'url' => '/participants.php', 'url+' => '/participants.php?op=add', 'aco' => 'participant', ), array( 'title' => _("Responses"), 'url' => '/report-responses.php', 'url+' => null, 'aco' => 'report:response', ), ) ), array( 'title' => _("System"), 'url' => '#', 'aco' => 'system', 'children' => array( array( 'title' => _("Accounts"), 'url' => '/accounts.php', 'aco' => 'account', ), array( 'title' => _("Users"), 'url' => '/users.php', 'url+' => '/users.php?op=add', 'aco' => 'user', ), array( 'title' => _("Payments"), 'url' => '/payments.php', 'url+' => '/payments.php?op=add', 'aco' => 'payment', ), ) ), ); $secondary_nav = array( array( 'title' => sprintf(_("Hi %s!"), ('' != $auth->get('first_name') ? $auth->get('first_name') : $auth->get('username'))), 'attr' => sprintf('class="hello show-for-medium-up"', _("Settings")), 'url' => sprintf('/users.php?op=edit&user_id=%s', $auth->get('user_id')), 'aco' => null, ), array( 'title' => '', 'attr' => sprintf('data-tooltip aria-haspopup="true" class="has-tip" title="%s"', _("Settings")), 'url' => '/settings.php', 'aco' => null, ), array( 'title' => '', 'attr' => sprintf('data-tooltip aria-haspopup="true" class="has-tip" title="%s"', _("Help")), 'url' => '/help.php', 'aco' => null, ), array( 'title' => '', 'attr' => sprintf('data-tooltip aria-haspopup="true" class="has-tip" title="%s"', _("Log out")), 'url' => '/logout.php', 'aco' => null, ), ); // // Unauthenticated menus… // $main_nav_noauth = array( array( 'title' => _("About"), 'url' => '/about.php', 'aco' => null, ), array( 'title' => _("Pricing"), 'url' => '/pricing.php', 'aco' => null, ), array( 'title' => _("Contact"), 'url' => '/contact.php', 'aco' => null, ), ); $secondary_nav_noauth = array( array( 'title' => _("Create an account"), 'attr' => sprintf('data-tooltip aria-haspopup="true" class="has-tip" title="%s"', _("It’s free to begin, and only takes a minute to get setup.")), 'url' => '/signup.php', 'aco' => null, ), array( 'title' => '', 'attr' => sprintf('data-tooltip aria-haspopup="true" class="has-tip" title="%s"', _("Log in")), 'url' => '/login.php', 'aco' => null, ), array( 'title' => '', 'attr' => sprintf('data-tooltip aria-haspopup="true" class="has-tip" title="%s"', _("Help")), 'url' => '/help.php', 'aco' => null, ), ); // $secondary_nav = array( // array( // 'title' => '', // 'attr' => '', // 'children' => array( // array( // 'title' => _("Settings"), // 'url' => '/settings.php', // 'aco' => null, // ), // array( // 'title' => _("Logout"), // 'url' => '/logout.php', // 'aco' => null, // ), // ) // ), // array( // 'title' => '', // 'attr' => sprintf('data-tooltip aria-haspopup="true" class="has-tip" title="%s"', _("Help")), // 'url' => '/help.php', // 'aco' => null, // ), // ); /* * Prints a Foundation-style nested top-bar navigation. * http://foundation.zurb.com/docs/components/topbar.html * * @access public * @param array $nav_options Array of options to use when printing menu. * @return void * @author Quinn Comendant * @version 1.0 * @since 13 Sep 2014 14:13:48 * * Example of use: ----------------------------------------------------------------- ----------------------------------------------------------------- */ function printNav($nav_options) { global $app, $nav, $acl, $auth; foreach ($nav_options as $n) { if (isset($n['aco']) && !$acl->check('user_id:' . $auth->get('user_id'), $n['aco'])) { // Skip this item if an ACO is specified for it and the user doesn't have access. continue; } if (isset($n['children'])) { $url = '#'; $classes = isset($n['class']) ? array($n['class']) : array(); if (isset($n['url'])) { $classes[] = $nav->currentPage($n['url'], 'active', null); foreach ($n['children'] as $c) { $classes[] = $nav->currentPage($c['url'], 'active', null); } unset($c); $url = $n['url']; } ?>
  • >
  • currentPage($n['url'], 'active', null); $print_class = empty($classes) ? '' : sprintf(' class="%s"', join(' ', array_unique($classes))); ?>>>