public function get_edit($id)
 {
     //SORTING
     Asset::container('footer')->add('sortable', 'bundles/cms/js/jquery.sortable.js', 'jquery');
     Asset::container('footer')->add('serialize', 'bundles/cms/js/jquery.serializetree.js', 'sortable');
     //LOAD FANCYBOX LIBS
     Asset::container('header')->add('fancyboxcss', 'bundles/cms/css/fancybox.css', 'main');
     Asset::container('footer')->add('fancybox', 'bundles/cms/js/jquery.fancybox.js', 'jquery');
     //DATETIME PICKER
     Asset::container('header')->add('jqueryuicss', 'bundles/cms/css/jquery.ui.css', 'main');
     if (LANG !== 'en') {
         Asset::container('footer')->add('local', 'bundles/cms/js/i18n/jquery.ui.datepicker-' . LANG . '.js', 'jquery');
     }
     Asset::container('footer')->add('datepicker', 'bundles/cms/js/jquery.datepicker.js', 'local');
     //LOAD JS LIBS
     Asset::container('footer')->add('form', 'bundles/cms/js/jquery.form.js', 'jquery');
     Asset::container('footer')->add('banner', 'bundles/cms/js/sections/banner_edit.js', 'cms');
     $this->layout->header_data = array('title' => LL('cms::title.banner_edit', CMSLANG));
     $this->layout->top_data = array('search' => false);
     //GET BANNER DATA
     $banner = CmsBanner::with(array('files'))->find($id);
     //GET FILE DATA
     $files = CmsFile::where_is_image(1)->where_is_valid(1)->order_by('name', 'asc')->order_by('id', 'asc')->paginate(Config::get('cms::settings.pag'));
     $this->layout->content = View::make('cms::interface.pages.banner_new_edit')->with('title', LL('cms::title.banner_edit', CMSLANG))->with('banner_id', $id)->with('banner_lang', $banner->lang)->with('banner_name', $banner->name)->with('files', $files)->with('files_select', $banner->files);
 }
 /**
  * Size of media based on Db
  *
  * @param  string $path
  * @return int
  */
 public static function mediasize($image = 1, $type = '')
 {
     if (CACHE) {
         $size = Cache::remember('size_' . $image, function () use($image) {
             $sum = CmsFile::where_is_image($image)->sum('size');
             return $sum;
         }, 60);
     } else {
         $size = CmsFile::where_is_image($image)->sum('size');
     }
     if (empty($type)) {
         return $size;
     }
     return MEDIA_SIZE($size, $type);
 }
Exemplo n.º 3
0
 public function get_edit($id)
 {
     //SORTING
     Asset::container('footer')->add('sortable', 'bundles/cms/js/jquery.sortable.js', 'jquery');
     Asset::container('footer')->add('serialize', 'bundles/cms/js/jquery.serializetree.js', 'sortable');
     //LOAD JS LIBS
     Asset::container('footer')->add('form', 'bundles/cms/js/jquery.form.js', 'jquery');
     Asset::container('footer')->add('files', 'bundles/cms/js/sections/download_edit.js', 'cms');
     $this->layout->header_data = array('title' => LL('cms::title.download_edit', CMSLANG));
     $this->layout->top_data = array('search' => false);
     //GET DOWNLOAD DATA
     $download = CmsDownload::with(array('files'))->find($id);
     //GET FILE DATA
     $files = CmsFile::where_is_image(0)->where_is_valid(1)->order_by('name', 'asc')->order_by('id', 'asc')->paginate(Config::get('cms::settings.pag'));
     $this->layout->content = View::make('cms::interface.pages.download_new_edit')->with('title', LL('cms::title.download_edit', CMSLANG))->with('download_id', $id)->with('download_name', $download->name)->with('files', $files)->with('files_select', $download->files);
 }
Exemplo n.º 4
0
 public function get_edit($id)
 {
     //SORTING
     Asset::container('footer')->add('sortable', 'bundles/cms/js/jquery.sortable.js', 'jquery');
     Asset::container('footer')->add('serialize', 'bundles/cms/js/jquery.serializetree.js', 'sortable');
     //LOAD FANCYBOX LIBS
     Asset::container('header')->add('fancyboxcss', 'bundles/cms/css/fancybox.css', 'main');
     Asset::container('footer')->add('fancybox', 'bundles/cms/js/jquery.fancybox.js', 'jquery');
     //LOAD JS LIBS
     Asset::container('footer')->add('form', 'bundles/cms/js/jquery.form.js', 'jquery');
     Asset::container('footer')->add('files', 'bundles/cms/js/sections/gallery_edit.js', 'cms');
     $this->layout->header_data = array('title' => LL('cms::title.gallery_edit', CMSLANG));
     $this->layout->top_data = array('search' => false);
     //GET GALLERY DATA
     $gallery = CmsGallery::with(array('files'))->find($id);
     //GET FILE DATA
     $files = CmsFile::where_is_image(1)->where_is_valid(1)->order_by('name', 'asc')->order_by('id', 'asc')->paginate(Config::get('cms::settings.pag'));
     $this->layout->content = View::make('cms::interface.pages.gallery_new_edit')->with('title', LL('cms::title.gallery_edit', CMSLANG))->with('gallery_id', $id)->with('gallery_name', $gallery->name)->with('gallery_thumb', $gallery->thumb)->with('gallery_thumbs', CmsGallery::select_thumb())->with('files', $files)->with('files_select', $gallery->files);
 }