Example #1
0
/**
 * render_navigation()
 */
function render_navigation($depth = -1, $tree = NULL, &$html = '', $level = 0, $preroute = '')
{
    $html .= $level > 0 ? '<ul class="sub l' . $level . '">' : '<ul>';
    if (is_null($tree)) {
        $tree = Lang::get('routes');
    }
    foreach ($tree as $route => $item) {
        if (isset($item['nav']) && $item['nav'] != NULL) {
            $active = $route == Route::currentRouteName();
            if ($route == 'news' && substr(Route::currentRouteName(), 0, 5) == 'news.') {
                $active = true;
            }
            $html .= '<li>';
            $html .= '<a href="' . route($route) . ($route == 'home' ? '/' : '') . '"' . ($active ? ' class="active"' : '') . '>' . $item['nav'] . '</a>';
            if (isset($item['sub']) && is_array($item['sub'])) {
                if ($depth == -1 || $level < $depth) {
                    render_navigation($depth, $item['sub'], $html, $level + 1, $preroute . $route . '.sub.');
                }
            }
            $html .= '</li>';
        }
    }
    $html .= '</ul>';
    return $html;
}
<h3><?php 
render_navigation($db);
?>
 &raquo; <?php 
hm("create_collection_full");
?>
</h3>

<?php 
if (isset($message)) {
    ?>
<p class="message">
<?php 
    h($message);
    ?>
</p>
<script language="javascript">
window.parent.frames["left"].location.reload();
</script>
<?php 
}
?>

<form method="post">
<?php 
hm("name");
?>
:<br/>
<input type="text" name="name" value="<?php 
h($name);
?>
Example #3
0
<h3><?php 
render_navigation($db, $realName, false);
?>
 &raquo; <?php 
hm("rename");
?>
</h3>

<?php 
if (isset($error)) {
    ?>
<p class="error"><?php 
    h($error);
    ?>
</p>
<?php 
}
if (isset($message)) {
    ?>
<p class="message"><?php 
    h($message);
    ?>
</p>
<?php 
}
?>

<form method="post">
<input type="hidden" name="oldname" value="<?php 
h_escape($realName);
?>
    ?>
currentFields.push("<?php 
    h(addslashes($field));
    ?>
");
<?php 
}
?>

$(function() {
	$("input[name='field[]']").autocomplete({ source:currentFields, delay:100 });
});
</script>

<h3><?php 
render_navigation($db, $collection);
?>
 &raquo; <a href="<?php 
h(url("collection.collectionIndexes", array("db" => $db, "collection" => $collection)));
?>
"><?php 
hm("indexes");
?>
</a> &raquo; <?php 
hm("create");
?>
</h3>
			
<?php 
if (isset($message)) {
    ?>
Example #5
0
h(filemtime("js/collection.js"));
?>
"></script>
<script language="javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
<link rel="stylesheet" href="<?php 
render_theme_path();
?>
/css/collection.css" media="all"/>
<link rel="stylesheet" href="<?php 
render_theme_path();
?>
/css/jquery-ui-1.8.4.smoothness.css" media="all"/>

<a name="page_top"></a>
<h3><?php 
render_navigation($db, $collection, false);
?>
</h3>
<div class="operation">
	<strong><?php 
hm("query");
?>
</strong>[<a href="<?php 
h($arrayLink);
?>
" <?php 
if (x("format") == "array") {
    ?>
style="text-decoration:underline"<?php 
}
?>
Example #6
0
} elseif (tpl_getConf('sidebar') == 'right') {
    ?>

      <?php 
    if (!tpl_sidebar_hide()) {
        ?>
        <div class="left-page">
 <div id="page"><?php 
        $notoc ? tpl_content(false) : tpl_content();
        ?>
</div>
        </div>
        <div class="right-sidebar">
			<div class="menu">
		  		<?php 
        render_navigation(":menu");
        ?>
			</div>
          <?php 
        tpl_sidebar('right');
        ?>
        </div>
      <?php 
    } else {
        ?>
        <div id="page" class="page">
          <?php 
        tpl_content();
        ?>
 
Example #7
0
function render_navigation($data, $classname = 'nav')
{
    global $user, $module, $submodule, $method, $page;
    ?>
				<ul class="<?php 
    echo $classname;
    ?>
">
<?php 
    foreach ($data as $link) {
        $path = (isset($link['module']) ? $link['module'] : '') . (isset($link['module']) && isset($link['method']) ? '/' : '') . (isset($link['method']) ? $link['method'] : '');
        if (!isset($link['module'])) {
            $link['module'] = 'index';
        }
        if (!isset($link['method'])) {
            $link['method'] = 'index';
        }
        if (!function_exists('checkIfAuthorized') || checkIfAuthorized($user, $link['module']) !== false) {
            ?>
					<li<?php 
            echo ($module == $link['module'] || $module . '/' . $submodule == $link['module']) && ($method == $link['method'] || $page == $link['method']) ? ' class="current"' : '';
            ?>
>
<?php 
            if (isset($link['submenu'])) {
                ?>
						<label>
							<?php 
                echo isset($link['icon']) ? '<i class="fa ' . $link['icon'] . '"></i> ' : '';
                ?>
<input type="checkbox" class="nav-chk" name="<?php 
                echo str_replace('/', '-', $path);
                ?>
"><?php 
                echo $link['title'];
                ?>
						</label>
<?php 
                render_navigation($link['submenu']);
            } else {
                ?>
						<a href="<?php 
                echo BASE_URL . $path;
                ?>
"><?php 
                echo isset($link['icon']) ? '<i class="fa ' . $link['icon'] . '"></i> ' : '';
                echo $link['title'];
                ?>
</a>
<?php 
            }
            ?>
					</li>
<?php 
        }
    }
    ?>
				</ul>
<?php 
}
Example #8
0
" /></a></li>
<?php 
}
?>
				</ul>
<?php 
$navigation = array();
$navigation[] = array('title' => 'Users', 'icon' => 'fa-user', 'module' => 'admin', 'method' => 'users');
$navigation[] = array('title' => 'Groups', 'icon' => 'fa-users', 'module' => 'admin', 'method' => 'groups');
$navigation[] = array('title' => 'Errors', 'icon' => 'fa-exclamation-triangle', 'module' => 'admin', 'method' => 'errors');
$navigation[] = array('title' => 'Database', 'icon' => 'fa-database', 'module' => 'admin/developer', 'method' => 'database');
$navigation[] = array('title' => 'Version Control', 'icon' => 'fa-upload', 'module' => 'admin/developer', 'method' => 'vcs');
$navigation[] = array('title' => 'Inquiry', 'icon' => 'fa-envelope-o', 'module' => 'admin', 'method' => 'inquiry');
$navigation[] = array('title' => 'Pages', 'icon' => 'fa-newspaper-o', 'module' => 'admin', 'method' => 'pages');
$navigation[] = array('title' => 'View Site', 'icon' => 'fa-globe', 'module' => 'index');
render_navigation($navigation);
?>
			</div>
		</nav>
		<main class="container">
<?php 
flash_message_dump();
echo $yield;
?>
		</main>
		<script src="<?php 
echo BASE_URL_STATIC;
?>
js/script.js"></script>
	</body>
</html>
Example #9
0
/**
* Renders the navbar template with the specified navbits
*
* @param	array	Array of navbit information
*
* @return	string	Navbar HTML
*/
function render_navbar_template($navbits)
{
    // VB API doesn't require rendering navbar.
    if (defined('VB_API') and VB_API === true) {
        return true;
    }
    $navigation = render_navigation();
    $templater = vB_Template::create('navbar');
    $templater->register('navigation', $navigation);
    $templater->register('ad_location', $GLOBALS['ad_location']);
    $templater->register('foruminfo', $GLOBALS['foruminfo']);
    $templater->register('navbar_reloadurl', $GLOBALS['navbar_reloadurl']);
    $templater->register('navbits', $navbits);
    $templater->register('notices', $GLOBALS['notices']);
    $templater->register('notifications_menubits', $GLOBALS['notifications_menubits']);
    $templater->register('notifications_total', $GLOBALS['notifications_total']);
    $templater->register('pmbox', $GLOBALS['pmbox']);
    $templater->register('return_link', $GLOBALS['return_link']);
    $templater->register('template_hook', $GLOBALS['template_hook']);
    return $templater->render();
}