コード例 #1
0
 /**
  * Checkout item
  * @return Response
  */
 public function get_checkout($id = null)
 {
     if (!Auth::can('add_checkout')) {
         Vsession::cadd('y', __('site.not_allowed'))->cflash('status');
         return Redirect::to_action('item@list');
     }
     // Generating buttons
     $this->item_buttons = Navigation::item_buttons()->add_item_button(array('icon' => 'icon-arrow-down', 'link' => 'item@checkin', 'text' => __('site.check_in_item')))->add_item_button(array('icon' => 'icon-arrow-up', 'link' => 'item@checkout', 'text' => __('site.check_out_item')))->get_item_buttons();
     Asset::style('jquicss', 'app/assets/css/jquery-ui-1.10.2.custom.min.css', 'jquery');
     Asset::script('jquijs', 'app/assets/js/jquery-ui-1.10.2.custom.js', 'jquery');
     Asset::script('datepicker', 'app/assets/js/jquery.ui.datepicker-' . Config::get('application.language') . '.js', 'jquery');
     if ($id != null) {
         $id = trim(filter_var($id, FILTER_SANITIZE_NUMBER_INT));
         $item = $this->fetch_item('id', $id);
     } else {
         $item = null;
     }
     return View::make('layout.index')->nest('header', 'layout.blocks.header', array('submenu' => $this->submenu))->nest('main', 'item.checkout', array('item' => $item, 'status' => $this->status, 'item_buttons' => $this->item_buttons));
 }
コード例 #2
0
 /**
  * Test the Asset::__callStatic method.
  *
  * @group laravel
  */
 public function testContainerMethodsCanBeDynamicallyCalled()
 {
     Asset::style('common', 'common.css');
     $this->assertEquals('common.css', Asset::container()->assets['style']['common']['source']);
 }
コード例 #3
0
ファイル: xtatic.php プロジェクト: SerdarSanri/Laravel-Xtatic
 /**
  * Head
  *
  * Assemble and return HTML head components - namely meta tags, CSS and
  * JavaScript files - derived from the configuration file.
  *
  * @access	public
  * @return 	string		HTML head components
  */
 public static function head()
 {
     $html = '';
     // Register CSS assets from Xtatic config file
     foreach (Config::get('xtatic::xtatic.css') as $css) {
         $name = $css['name'];
         $source = $css['source'];
         $dependencies = !empty($css['dependencies']) ? $css['dependencies'] : array();
         $attributes = !empty($css['attributes']) ? $css['attributes'] : array();
         Asset::style($name, $source, $dependencies, $attributes);
     }
     // Register JS assets from Xtatic config file
     foreach (Config::get('xtatic::xtatic.js') as $js) {
         $name = $js['name'];
         $source = $js['source'];
         $dependencies = !empty($js['dependencies']) ? $js['dependencies'] : array();
         $attributes = !empty($js['attributes']) ? $js['attributes'] : array();
         Asset::container(Config::get('xtatic::xtatic.header_asset_container'))->script($name, $source, $dependencies, $attributes);
     }
     // Assemble <meta> tags
     switch (TRUE) {
         case !Config::get('xtatic::xtatic.allow_search_engines_to_index'):
             $html .= static::meta_tag(array('robots' => 'noindex,nofollow'));
             break;
         case !empty(static::$page_meta['meta_robots']):
             $html .= static::meta_tag(array('robots' => static::$page_meta['meta_robots']));
             break;
         default:
             //
     }
     if (!empty(static::$page_meta['meta_description'])) {
         $html .= static::meta_tag(array('description' => static::$page_meta['meta_description']));
     }
     if (!empty(static::$page_meta['meta_keywords'])) {
         $html .= static::meta_tag(array('keywords' => static::$page_meta['meta_keywords']));
     }
     // Get CSS styles
     $html .= Asset::styles();
     // Get JS scripts
     $html .= Asset::container(Config::get('xtatic::xtatic.header_asset_container'))->scripts();
     // Get Google Analytics tracking code
     $html .= static::javascript(static::google_analytics());
     $html .= Asset::scripts();
     // Get inline JS
     $html .= static::javascript(static::$js_in_head);
     return $html;
 }
コード例 #4
0
ファイル: routes.php プロジェクト: eliasyanni/bugs
    Asset::script('swf', '/app/assets/js/uploadify/swfobject.js', 'app');
    Asset::script('uploadify', '/app/assets/js/uploadify/jquery.uploadify.v2.1.4.min.js', 'app');
    Asset::script('project', '/app/assets/js/project.js', 'uploadify');
    if (!isset($view->sidebar)) {
        $view->with('sidebar', View::make('project.sidebar'));
    }
    $view->active = 'projects';
});
View::composer('todo.index', function ($view) {
    Asset::script('app', 'app/assets/js/todo.js', 'jquery');
});
View::composer('user.issues', function ($view) {
    Asset::script('app', 'app/assets/js/todo-issues.js', 'jquery');
});
View::composer('layouts.login', function ($view) {
    Asset::style('login', 'app/assets/css/login.css');
});
Event::listen('404', function () {
    return Response::error('404');
});
Event::listen('500', function () {
    return Response::error('500');
});
/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
*/
Route::filter('before', function () {
});
Route::filter('after', function ($response) {
コード例 #5
0
ファイル: composers.php プロジェクト: rebelnz/rebelcms
<?php

return array('layouts.admin.default' => array('name' => 'admin_layout', function ($view) {
    Asset::script('jquery', 'js/jquery-1.7.1.js');
    Asset::script('twipsy', 'js/twipsy.js');
    Asset::script('admin', 'js/admin.js');
    Asset::style('bootstrap', 'css/bootstrap.css');
    Asset::style('admin', 'css/admin.css');
    $view->nest('header', 'partials.header');
    $view->nest('footer', 'partials.footer');
}), 'layouts.site.default' => array('name' => 'site_layout', function ($view) {
    Asset::script('jquery', 'js/jquery-1.7.1.js');
    Asset::script('site', 'js/site.js');
    Asset::style('bootstrap', 'css/bootstrap.css');
    Asset::style('site', 'css/site.css');
    $view->nest('header', 'partials.header');
    $view->nest('nav', 'partials.nav');
    $view->nest('footer', 'partials.footer');
}));
コード例 #6
0
$role->save();

// Assign the Permission to the Role
$role->permissions()->sync(array($permission->id));
*/
/*
|--------------------------------------------------------------------------
| Composing
|--------------------------------------------------------------------------
*/
View::composer('layout.index', function ($view) {
    Asset::style('bootstrapcss', 'app/assets/css/bootstrap.min.css');
    Asset::style('datatablescss', 'app/assets/css/jquery.dataTables.css');
    Asset::style('apprisecss', 'app/assets/css/apprise-v2.css');
    Asset::style('style', 'app/assets/css/style.css');
    Asset::style('bs_css', 'app/assets/css/bootstrap-tagsinput.css');
    Asset::script('jquery', 'app/assets/js/jquery-1.9.1.min.js');
    Asset::script('bootstrap', 'app/assets/js/bootstrap.min.js');
    Asset::script('datatables', 'app/assets/js/jquery.dataTables.min.js');
    Asset::script('apprise', 'app/assets/js/apprise-v2.min.js', 'jquery');
    Asset::script('bs_input_script', 'app/assets/js/bootstrap-tagsinput.js');
});
/*
|--------------------------------------------------------------------------
| Application 404 & 500 Error Handlers
|--------------------------------------------------------------------------
|
| To centralize and simplify 404 handling, Laravel uses an awesome event
| system to retrieve the response. Feel free to modify this function to
| your tastes and the needs of your application.
|