Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $db = Config::get('database.default');
     if ($db != null) {
         View::share('navLinks', Admin_Menu::menuGenerator());
         View::share('sidebar', Navigator::sidebar());
         View::share('breadcrumb', Navigator::breadcrumb());
     }
     $class = get_called_class();
     if (!Request::ajax()) {
         switch ($class) {
             case 'Home_Controller':
                 $this->filter('before', 'nonauth');
                 break;
             case 'Setup_Controller':
                 $this->filter('before', 'nonauth');
                 break;
             case 'Admin_Auth_Controller':
                 $this->filter('before', 'auth')->except(array('authenticate', 'verifyupdate', 'logout'));
                 break;
             default:
                 $this->filter('before', 'auth');
                 break;
         }
     }
 }
 /**
  * breadcrumb function
  * Create breadcrumb
  * @return string
  * @author joharijumali
  **/
 public static function breadcrumb()
 {
     $Menu = Admin_Menu::menuGenerator();
     $butternbread = array();
     foreach ($Menu as $floor => $packet) {
         foreach ($packet->page->action as $key => $action) {
             if ($packet->packet == Str::lower(URI::segment(1)) && $packet->controller->name == Str::lower(URI::segment(2)) && $action->name == Str::lower(URI::segment(3)) || URI::segment(3) == NULL && $action->name == $packet->controller->name && Str::lower(URI::segment(2)) == $packet->controller->name) {
                 $butternbread[Str::upper($packet->controller->alias)] = '#';
                 array_push($butternbread, Str::title($action->alias));
             }
         }
     }
     return Breadcrumb::create($butternbread);
 }