Exemple #1
0
 public function getImageUrlAttribute()
 {
     if ($this->image_file_name) {
         return URL::to($this->image->url());
     } else {
         return URL::to(moduleAsset('system', 'images/no-photo.jpg'));
     }
 }
Exemple #2
0
 public function register()
 {
     Widget::register('mainBanner', __NAMESPACE__ . '\\Widgets\\MainBanner');
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('banner', 'images/icon_banner.png'), 'Banner'), route('admin.banner_item.index'));
     });
 }
Exemple #3
0
 public function register()
 {
     $banner = Banner::first();
     $listBackground = array('banner_bg1.png', 'banner_bg2.png', 'banner_bg3.png', 'banner_bg4.png');
     $getBackgroundByPos = function ($pos) use($listBackground) {
         return moduleAsset('banner', 'images/' . $listBackground[$pos % count($listBackground)]);
     };
     return View::make('banner::widgets.mainBanner.mainBanner', compact('banner', 'getBackgroundByPos'));
 }
Exemple #4
0
 public function register()
 {
     // registra os widgets
     Widget::register('newsBoxList', __NAMESPACE__ . '\\Widgets\\NewsBoxList');
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('news', 'images/icon_news.png'), 'Notícias'), route('admin.news.index'));
     });
 }
Exemple #5
0
 public function register()
 {
     $this->app->bind('backup.zippy', function () {
         return Zippy::load();
     });
     \Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('backup', 'images/icon_backup.png'), 'Backup'), route('admin.backup.index'));
     });
 }
Exemple #6
0
 public function register()
 {
     $this->app->register('Cviebrock\\EloquentSluggable\\SluggableServiceProvider');
     $this->app->register('Codesleeve\\LaravelStapler\\LaravelStaplerServiceProvider');
     Widget::register('specialPage', __NAMESPACE__ . '\\Widgets\\SpecialPage');
     Widget::register('pageList', __NAMESPACE__ . '\\Widgets\\PageList');
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('page', 'images/icon_page.png'), 'Páginas'), route('admin.page.index'));
     });
 }
Exemple #7
0
 public function register()
 {
     $app = $this->app;
     // registramos o menu do container
     $this->app->singleton('admin::dashboardMenu', function () use($app) {
         return Menu::make('dashboardMenu', function ($menu) use($app) {
             $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
             $menu->add(sprintf($format, moduleAsset('admin', '/images/icon_home.png'), 'Visão Geral'), 'admin');
             Event::fire('admin::menu.load', array($menu));
         });
     });
 }
 public function register()
 {
     Event::listen('admin::menu.load', function ($menu) {
         $format = '<img src="%s" class="fa" />&nbsp;&nbsp;<span>%s</span>';
         $menu->add(sprintf($format, moduleAsset('product', 'images/icon_category.png'), 'Categorias'), route('admin.product_category.index'));
         $menu->add(sprintf($format, moduleAsset('product', 'images/icon_product.png'), 'Produtos'), route('admin.product.index'));
     });
     Event::listen('front::menu.load', function ($menu) {
         $menu->add('Produtos', route('product.index'));
     });
     // registra os widgets
     Widget::register('productCarousel', __NAMESPACE__ . '\\Widgets\\Carousel');
     Widget::register('productBox', __NAMESPACE__ . '\\Widgets\\ProductBox');
     // Using class based composers...
     View::composer('product::partials.categories', __NAMESPACE__ . '\\ViewComposers\\CategoriesComposer');
 }
Exemple #9
0
Form::macro('decimal', function ($attributeName, $value, $options) {
    foreach (['js/plugins/input-mask/jquery.inputmask.js', 'js/plugins/input-mask/jquery.inputmask.numeric.extensions.js'] as $file) {
        $jsFilename = moduleAsset('admin', $file);
        if (!in_array($jsFilename, @Asset::$js['footer'] ?: array())) {
            Asset::add($jsFilename);
        }
    }
    $options['data-inputmask'] = "'alias': 'decimal', 'radixPoint': ','";
    $script = "\$('*[data-inputmask]').inputmask();";
    if (!in_array($script, @Asset::$scripts['footer'] ?: array())) {
        Asset::addScript($script);
    }
    $value = str_replace('.', ',', $value);
    return Form::text($attributeName, $value, $options);
});
/**
 * Creates a Html Editor
 */
Form::macro('editor', function ($attributeName, $value = null, $options = array()) {
    Asset::add(moduleAsset('system', 'js/ckeditor/ckeditor.js'));
    Asset::addScript("\n        CKEDITOR.config.allowedContent = true;\n        var editor = CKEDITOR.replace('{$attributeName}', {\n            filebrowserBrowseUrl : '" . URL::to(moduleAsset('system', 'ckfinder/ckfinder.html')) . "',\n            filebrowserImageBrowseUrl : '" . URL::to(moduleAsset('system', 'ckfinder/ckfinder.html?type=Images')) . "',\n            filebrowserFlashBrowseUrl : '" . URL::to(moduleAsset('system', 'ckfinder/ckfinder.html?type=Flash')) . "',\n            filebrowserUploadUrl : '" . URL::to(moduleAsset('system', 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files')) . "',\n            filebrowserImageUploadUrl : '" . URL::to(moduleAsset('system', 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images')) . "',\n            filebrowserFlashUploadUrl : '" . URL::to(moduleAsset('system', 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash')) . "'\n        });\n        CKFinder.setupCKEditor( editor, '../' );\n    ", 'ready');
    return Form::textArea($attributeName, $value, $options);
});
/**
 * Validates a Recaptcha input
 * Obs: Recapctha package already provide a "captcha" macro to form.
 */
Form::macro('makeCaptchaValidator', function ($input) {
    $v = Validator::make($input, ['g-recaptcha-response' => 'required|recaptcha'])->setAttributeNames(['g-recaptcha-response' => 'Recaptcha']);
    return $v;
});
Exemple #10
0
 /**
  * Return user image
  * @return string
  */
 public function getImageAttribute()
 {
     return moduleAsset('user', '/images/user.png');
 }