Example #1
0
<?php

if ($title) {
    navigation_stack()->add($title);
}
$stack = navigation_stack()->get_current_stack();
if (count($stack) > 1) {
    ?>
	<nav id="breadcrumbs">
		<?php 
    foreach ($stack as $breadcrumb) {
        ?>
			<a class="breadcrumb<?php 
        echo $breadcrumb == end($stack) ? ' active" onclick="return false;' : '';
        ?>
" href="<?php 
        echo $breadcrumb['url'];
        ?>
"><span><?php 
        echo $breadcrumb['title'];
        ?>
</span></a>
		<?php 
    }
    ?>
	</nav>
<?php 
}
Example #2
0
 private static function handle_page($structure, $segments)
 {
     $data = get_row('>' . $structure['stack']);
     if ($structure['parent_type'] == 'site') {
         $site = current_site();
         self::$parent = array('site_id' => $site['id']);
     }
     if (count($segments)) {
         self::$parent = array($structure['name'] . '_id' => $data->id);
         return self::handle_item($segments, $data);
     } else {
         // Clear breadcrumbs
         navigation_stack()->clear();
         self::edit_object($structure, $data);
         return true;
     }
 }