/**
  * sidebar function
  * Create sidebar
  * @return string
  * @author joharijumali
  **/
 public static function sidebar()
 {
     // $Menu = Header::navigationdata();
     $flow = URI::segment(3) == 'step' ? true : false;
     $navValue = array(array(Navigation::HEADER, Str::upper(Lang::line('admin.monitor')->get())), array(Lang::line('admin.dashboard')->get(), url('admin/home/dashboard'), false, false, null, 'tasks'), array(Navigation::HEADER, Str::upper(Lang::line('admin.sysmgmt')->get())), array(Lang::line('admin.configmanagement')->get(), url('admin/system/sysConfig'), false, false, null, 'chevron-right'), array(Lang::line('admin.datamanagement')->get(), url('admin/data/board'), false, false, null, 'chevron-right'), array(Lang::line('admin.pagemanagement')->get(), url('admin/modul/page'), false, false, null, 'chevron-right'), array(Lang::line('admin.flowmanagement')->get(), url('admin/modul/flow'), $flow, false, null, 'chevron-right'), array(Lang::line('admin.navsetup')->get(), url('admin/system/navigate'), false, false, null, 'chevron-right'), array(Lang::line('admin.log')->get(), url('admin/system/logger'), false, false, null, 'chevron-right'), array(Navigation::HEADER, Str::upper(Lang::line('admin.sysuser')->get())), array(Lang::line('admin.navuserlist')->get(), url('admin/user/list'), false, false, null, 'chevron-right'), array(Lang::line('admin.navuserrole')->get(), url('admin/user/role'), false, false, null, 'chevron-right'), array(Navigation::HEADER, Lang::line('global.logout')->get()), array(Lang::line('global.logout')->get(), url('admin/login/logout'), false, false, null, 'off'));
     return Navigation::lists(Navigation::links($navValue));
 }
Example #2
0
 public static function laravel_init()
 {
     // Load AutoLoad Aliases
     \Laravel\Autoloader::alias('\\Cloudmanic\\WarChest\\Libraries\\LaravelAuth', 'LaravelAuth');
     \Laravel\Autoloader::alias('\\Cloudmanic\\WarChest\\Libraries\\Me', 'Me');
     // Extend the Laravel Auth library to use our own custom driver.
     \Auth::extend('cloudmanic_auth', function () {
         return new LaravelAuth();
     });
     // Set Api auth filter.
     \Laravel\Routing\Route::filter('api_auth', function () {
         return CloudAuth::sessioninit();
     });
     // Build a micro for activating a class or not. We use this in a main navigation
     // to set the html class to active or not.
     \Laravel\HTML::macro('is_active', function ($name, $home = false, $class = 'active') {
         $base = \Laravel\URI::segment(1);
         // Is the the default route?
         if ($home && empty($base)) {
             return $class;
         }
         // Compare the segment.
         if ($base == $name) {
             return $class;
         }
         return '';
     });
 }
Example #3
0
 /**
  * Dump the results of the currently established route.
  *
  * @return void
  */
 protected function route()
 {
     // We'll call the router using the method and URI specified by
     // the developer on the CLI. If a route is found, we will not
     // run the filters, but simply dump the result.
     $route = Router::route(Request::method(), URI::current());
     if (!is_null($route)) {
         var_dump($route->response());
     } else {
         echo '404: Not Found';
     }
 }
Example #4
0
 /**
  * Get the URI for the current request.
  *
  * @return string
  */
 public static function uri()
 {
     return URI::current();
 }
Example #5
0
 /**
  * Get the full URL for the current request.
  *
  * @return string
  */
 public static function current()
 {
     return static::to(URI::current());
 }
Example #6
0
File: url.php Project: ajb/rfpez
 /**
  * Get the full URL for the current request.
  *
  * @return string
  */
 public static function current()
 {
     return static::to(URI::current(), null, false, false);
 }
Example #7
0
 /**
  * Determine the appropriate action parameter to use for a form.
  *
  * If no action is specified, the current request URI will be used.
  *
  * @param  string   $action
  * @param  bool     $https
  * @return string
  */
 protected static function action($action, $https)
 {
     $uri = is_null($action) ? URI::current() : $action;
     return HTML::entities(URL::to($uri, $https));
 }
 /**
  * Get the pattern filters for the route.
  *
  * @return array
  */
 protected function patterns()
 {
     $filters = array();
     // We will simply iterate through the registered patterns and
     // check the URI pattern against the URI for the route and
     // if they match we'll attach the filter.
     foreach (Filter::$patterns as $pattern => $filter) {
         if (URI::is($pattern, $this->uri)) {
             $filters[] = $filter;
         }
     }
     return (array) $filters;
 }
Example #9
0
 /**
  * Flow Step Managment function
  * Component : step, stepinfo, resetstepdata,  deletestep
  * Method : ajax post get
  * @return void
  * @author joharijumali@gmail.com
  **/
 public function get_step()
 {
     $data['flow'] = Str::title(Flow::find(URI::segment(5))->flowname);
     $data['steplist'] = Menu::flowtree(URI::segment(5));
     $data['allrole'] = Role::arrayRoles();
     $data['pagelist'] = $listpage = Page::listSteppages();
     return View::make('admin::modul.step', $data);
 }
Example #10
0
 public static function to_language($language, $reset = false)
 {
     $url = $reset ? URL::home() : URL::to(URI::current());
     if (!in_array($language, Config::get('application.languages'))) {
         return $url;
     }
     $from = '/' . Config::get('application.language') . '/';
     $to = '/' . $language . '/';
     return str_replace($from, $to, $url);
 }
Example #11
0
| If the URI starts with one of the supported languages, we will set
| the default lagnauge to match that URI segment and shorten the
| URI we'll pass to the router to not include the lang segment.
|
*/
foreach ($languages as $language) {
    if (preg_match("#^{$language}(?:\$|/)#i", $uri)) {
        Config::set('application.language', $language);
        $uri = trim(substr($uri, strlen($language)), '/');
        break;
    }
}
if ($uri == '') {
    $uri = '/';
}
URI::$uri = $uri;
/*
|--------------------------------------------------------------------------
| Route The Incoming Request
|--------------------------------------------------------------------------
|
| Phew! We can finally route the request to the appropriate route and
| execute the route to get the response. This will give an instance
| of the Response object that we can send back to the browser
|
*/
Request::$route = Router::route(Request::method(), $uri);
$response = Request::$route->call();
/*
|--------------------------------------------------------------------------
| "Render" The Response
Example #12
0
 /**
  * Get the URL to switch language, keeping the current page or not
  *
  * @param  string  $language  The new language
  * @param  boolean $reset     Whether navigation should be reset
  * @return string             An URL
  */
 public static function to_language($language, $reset = false)
 {
     // Get the url to use as base
     $url = $reset ? URL::home() : URL::to(URI::current());
     // Validate the language
     if (!in_array($language, Config::get('application.languages'))) {
         return $url;
     }
     // Get the language we're switching from and the one we're going to
     $from = '/' . Config::get('application.language') . '/';
     $to = '/' . $language . '/';
     return str_replace($from, $to, $url);
 }
Example #13
0
 public function search()
 {
     return Form::open(URI::current(), 'GET') . Form::text('q', null, array('class' => 'search')) . Form::close();
 }