Ejemplo n.º 1
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  * @param  string $template view to use as template
  * @return void           
  */
 public function before($template = NULL)
 {
     Theme::checker();
     $this->maintenance();
     if ($this->auto_render === TRUE) {
         // Load the template
         $this->template = $template === NULL ? 'oc-panel/main' : $template;
         $this->template = View::factory($this->template);
         // Initialize empty values
         $this->template->title = __('Panel') . ' - ' . core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copywrite = 'Open Classifieds ' . Core::version;
         $this->template->header = View::factory('oc-panel/header');
         $this->template->content = '';
         $this->template->footer = View::factory('oc-panel/footer');
         $this->template->styles = array();
         $this->template->scripts = array();
         $this->template->user = Auth::instance()->get_user();
         //other color
         if (Theme::get('admin_theme') != 'bootstrap' and Theme::get('admin_theme') != '') {
             Theme::$styles = array('http://netdna.bootstrapcdn.com/bootswatch/3.0.0/' . Theme::get('admin_theme') . '/bootstrap.min.css' => 'screen', 'http://cdn.jsdelivr.net/bootstrap/2.3.2/css/bootstrap-responsive.min.css' => 'screen', 'http://cdn.jsdelivr.net/chosen/1.0.0/chosen.css' => 'screen', 'http://cdn.jsdelivr.net/sceditor/1.4.3/themes/default.min.css' => 'screen', 'css/admin-styles.css' => 'screen');
         } else {
             Theme::$styles = array('http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css' => 'screen', 'http://cdn.jsdelivr.net/sceditor/1.4.3/themes/default.min.css' => 'screen', 'http://cdn.jsdelivr.net/chosen/1.0.0/chosen.css' => 'screen', 'css/admin-styles.css' => 'screen');
         }
         Theme::$scripts['footer'] = array('http://code.jquery.com/jquery-1.10.2.min.js', 'js/jquery.sceditor.min.js', 'http://netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js', 'http://cdn.jsdelivr.net/chosen/1.0.0/chosen.jquery.min.js', 'js/oc-panel/theme.init.js?v=2.1', 'js/oc-panel/sidebar.js');
     }
 }
Ejemplo n.º 2
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  * @param  string $template view to use as template
  * @return void           
  */
 public function before($template = NULL)
 {
     Theme::checker();
     $this->maintenance();
     $this->private_site();
     if ($this->auto_render === TRUE) {
         // Load the template
         $this->template = $template === NULL ? 'oc-panel/main' : $template;
         //if its and ajx request I want only the content
         if (Core::get('rel') == 'ajax') {
             $this->template = 'oc-panel/content';
         }
         $this->template = View::factory($this->template);
         // Initialize empty values
         $this->template->title = __('Panel') . ' - ' . core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copyright = 'Open Classifieds ' . Core::VERSION;
         $this->template->header = '';
         $this->template->content = '';
         $this->template->footer = '';
         $this->template->styles = array();
         $this->template->scripts = array();
         $this->template->user = Auth::instance()->get_user();
         //non ajax request
         if (Core::get('rel') != 'ajax') {
             $this->template->header = View::factory('oc-panel/header');
             $this->template->footer = View::factory('oc-panel/footer');
             /**
              * custom options for the theme
              * @var array
              */
             Theme::$options = Theme::get_options();
             //we load earlier the theme since we need some info
             Theme::load();
             if (Theme::get('cdn_files') == FALSE) {
                 //other color
                 if (Theme::get('admin_theme') != 'bootstrap' and Theme::get('admin_theme') != '') {
                     $theme_css = array('css/' . Theme::get('admin_theme') . '-bootstrap.min.css' => 'screen');
                 } else {
                     $theme_css = array('css/style.css' => 'screen');
                 }
                 $common_css = array('css/other.css' => 'screen');
                 Theme::$styles = array_merge($common_css, $theme_css);
                 Theme::$scripts['footer'] = array('js/jquery.min.js', 'js/jquery.cookie.min.js', 'js/iconPicker.min.js', 'js/jquery.sceditor.bbcode.min.js', 'js/summernote.min.js', 'js/bootstrap.min.js', 'js/chosen.jquery.min.js', 'js/mousetrap.min.js', 'js/bootstrap-tour.min.js', Route::url('jslocalization', array('controller' => 'jslocalization', 'action' => 'bstour')), 'js/oc-panel/tour.js', Route::url('jslocalization', array('controller' => 'jslocalization', 'action' => 'chosen')), 'http://' . (Kohana::$environment !== Kohana::DEVELOPMENT ? 'market.' . Core::DOMAIN . '' : 'eshop.lo') . '/embed.js', 'js/sweet-alert.min.js', 'js/favico.min.js', '//maps.google.com/maps/api/js?sensor=false&libraries=geometry&v=3.7', '//cdn.jsdelivr.net/gmaps/0.4.15/gmaps.min.js', 'js/bootstrap-colorpicker.min.js', 'js/jquery.bootgrid.min.js', 'js/query.bootgrid.fa.min.js', 'js/oc-panel/metismenu.min.js', 'js/oc-panel/fastclick.min.js', 'js/oc-panel/theme.init.js?v=' . Core::VERSION, 'js/oc-panel/sidebar.js?v=' . Core::VERSION);
             } else {
                 //other color
                 if (Theme::get('admin_theme') != 'bootstrap' and Theme::get('admin_theme') != '') {
                     $theme_css = array('//cdn.jsdelivr.net/bootswatch/3.3.6/' . Theme::get('admin_theme') . '/bootstrap.min.css' => 'screen');
                 } else {
                     $theme_css = array('css/style.css' => 'screen');
                 }
                 $common_css = array('css/other.css' => 'screen');
                 Theme::$styles = array_merge($theme_css, $common_css);
                 Theme::$scripts['footer'] = array('//cdn.jsdelivr.net/jquery/1.12.3/jquery.min.js', '//cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js', 'js/iconPicker.min.js', 'js/jquery.sceditor.bbcode.min.js', '//cdn.jsdelivr.net/summernote/0.8.1/summernote.min.js', '//cdn.jsdelivr.net/bootstrap/3.3.6/js/bootstrap.min.js', '//cdn.jsdelivr.net/chosen/1.0.0/chosen.jquery.min.js', '//cdn.jsdelivr.net/mousetrap/1.6.0/mousetrap.min.js', 'js/bootstrap-tour.min.js', Route::url('jslocalization', array('controller' => 'jslocalization', 'action' => 'bstour')), 'js/oc-panel/tour.js', Route::url('jslocalization', array('controller' => 'jslocalization', 'action' => 'chosen')), 'http://' . (Kohana::$environment !== Kohana::DEVELOPMENT ? 'market.' . Core::DOMAIN . '' : 'eshop.lo') . '/embed.js', 'js/sweet-alert.min.js', 'js/favico.min.js', '//maps.google.com/maps/api/js?sensor=false&libraries=geometry&v=3', '//cdn.jsdelivr.net/gmaps/0.4.15/gmaps.min.js', 'js/bootstrap-colorpicker.min.js', 'js/jquery.bootgrid.min.js', 'js/query.bootgrid.fa.min.js', 'js/oc-panel/metismenu.min.js', 'js/oc-panel/fastclick.min.js', 'js/oc-panel/theme.init.js?v=' . Core::VERSION, 'js/oc-panel/sidebar.js?v=' . Core::VERSION);
             }
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  */
 public function before($template = NULL)
 {
     parent::before();
     Theme::checker();
     $this->maintenance();
     /**
      * selected category
      */
     if ($this->request->param('category', NULL) != 'all') {
         $slug_cat = new Model_Category();
         $seo_cat = $slug_cat->where('seoname', '=', $this->request->param('category'))->limit(1)->cached()->find();
         if ($seo_cat->loaded()) {
             self::$category = $seo_cat;
         }
     }
     /**
      * selected location
      */
     if ($this->request->param('location', NULL) != NULL || $this->request->param('location') != 'all') {
         $slug_loc = new Model_Location();
         $seo_loc = $slug_loc->where('seoname', '=', $this->request->param('location'))->limit(1)->cached()->find();
         if ($seo_loc->loaded()) {
             self::$location = $seo_loc;
         }
     }
     if ($this->auto_render === TRUE) {
         // Load the template
         if ($template !== NULL) {
             $this->template = $template;
         }
         $this->template = View::factory($this->template);
         // Initialize template values
         $this->template->title = core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copywrite = 'Open Classifieds ' . Core::version;
         $this->template->content = '';
         $this->template->styles = array();
         $this->template->scripts = array();
         //we can not cache this view since theres dynamic parts
         //$this->template->header  = View::factory('header');
         //setting inner views try to get from fragment
         // if (Auth::instance()->logged_in())
         //     $this->template->header  = View::fragment('header_front_login','header');
         // else
         $this->template->header = View::factory('header');
         //             $this->template->header  = View::fragment('header_front','header');
         //no fragment since CSRF gets cached :(
         $this->template->footer = View::fragment('footer_front', 'footer');
     }
 }
Ejemplo n.º 4
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  */
 public function before($template = NULL)
 {
     parent::before();
     Theme::checker();
     $this->maintenance();
     $this->private_site();
     /**
      * selected category
      */
     self::$category = Model_Category::current();
     /**
      * selected location
      */
     self::$location = Model_Location::current();
     //Gets a coupon if selected
     Model_Coupon::current();
     if ($this->auto_render === TRUE) {
         // Load the template
         if ($template !== NULL) {
             $this->template = $template;
         }
         $this->template = View::factory($this->template);
         // Initialize template values
         $this->template->title = core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copyright = 'Open Classifieds ' . Core::VERSION;
         $this->template->meta_copywrite = $this->template->meta_copyright;
         //legacy for old themes
         $this->template->content = '';
         $this->template->styles = array();
         $this->template->scripts = array();
         $this->template->amphtml = NULL;
         $this->template->header = View::factory('header');
         $this->template->footer = View::factory('footer');
         // header_front_login fragment since CSRF gets cached :(
         // possible workaround ? @see http://kohanaframework.org/3.0/guide/kohana/fragments
         // if (Auth::instance()->logged_in())
         //     $this->template->header  = View::fragment('header_front_login','header');
         // else
         //     $this->template->header  = View::fragment('header_front','header');
         //$this->template->footer = View::fragment('footer_front','footer');
     }
 }
Ejemplo n.º 5
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  * @param  string $template view to use as template
  * @return void           
  */
 public function before($template = NULL)
 {
     Theme::checker();
     $this->maintenance();
     //Gets a coupon if selected
     Model_Coupon::current();
     if ($this->auto_render === TRUE) {
         // Load the template
         $this->template = $template === NULL ? 'oc-panel/main' : $template;
         //if its and ajx request I want only the content
         if (Core::get('rel') == 'ajax') {
             $this->template = 'oc-panel/content';
         }
         $this->template = View::factory($this->template);
         // Initialize empty values
         $this->template->title = __('Panel') . ' - ' . core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copyright = 'Open eShop ' . Core::VERSION;
         $this->template->header = '';
         $this->template->content = '';
         $this->template->footer = '';
         $this->template->styles = array();
         $this->template->scripts = array();
         $this->template->user = Auth::instance()->get_user();
         //non ajax request
         if (Core::get('rel') != 'ajax') {
             if (core::get('print') == 1) {
                 $this->template->header = '';
                 $this->template->footer = '';
             } else {
                 $this->template->header = View::factory('oc-panel/header');
                 $this->template->footer = View::factory('oc-panel/footer');
             }
             //other color
             if (Theme::get('admin_theme') == 'bootstrap') {
                 Theme::$styles = array('//cdn.jsdelivr.net/bootswatch/3.3.6/paper/bootstrap.min.css' => 'screen', '//cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css?v=print' => 'print', '//cdn.jsdelivr.net/chosen/1.0.0/chosen.css' => 'screen', '//cdn.jsdelivr.net/bootstrap.tagsinput/0.3.9/bootstrap-tagsinput.css' => 'screen', '//cdn.jsdelivr.net/sweetalert/1.1.3/sweetalert.css' => 'screen', 'css/jquery.sceditor.default.theme.min.css' => 'screen', 'css/loadingbar.css' => 'screen', 'css/icon-picker.min.css' => 'screen', 'css/font-awesome.min.css' => 'screen', 'css/summernote.css' => 'screen', 'css/admin-styles.css?v=' . Core::VERSION => 'screen');
             } else {
                 Theme::$styles = array('//cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css' => 'screen', '//cdn.jsdelivr.net/bootstrap/3.3.6/css/bootstrap.min.css?v=print' => 'print', '//cdn.jsdelivr.net/bootswatch/3.3.6/' . Theme::get('admin_theme', 'cerulean') . '/bootstrap.min.css' => 'screen', '//cdn.jsdelivr.net/chosen/1.0.0/chosen.css' => 'screen', '//cdn.jsdelivr.net/bootstrap.tagsinput/0.3.9/bootstrap-tagsinput.css' => 'screen', '//cdn.jsdelivr.net/sweetalert/1.1.3/sweetalert.css' => 'screen', 'css/jquery.sceditor.default.theme.min.css' => 'screen', 'css/loadingbar.css' => 'screen', 'css/icon-picker.min.css' => 'screen', 'css/font-awesome.min.css' => 'screen', 'css/summernote.css' => 'screen', 'css/admin-styles.css?v=' . Core::VERSION => 'screen');
             }
             Theme::$scripts['footer'] = array('//code.jquery.com/jquery-1.10.2.min.js', '//cdn.jsdelivr.net/bootstrap/3.3.6/js/bootstrap.min.js', '//cdn.jsdelivr.net/chosen/1.0.0/chosen.jquery.min.js', Route::url('jslocalization', array('controller' => 'jslocalization', 'action' => 'chosen')), (Kohana::$environment !== Kohana::DEVELOPMENT ? 'market.' . Core::DOMAIN . '' : 'eshop.lo') . '/embed.js', 'js/oc-panel/theme.init.js?v=' . Core::VERSION, 'js/jquery.sceditor.bbcode.min.js', 'js/summernote.min.js', 'js/summernote-ext-video.js', 'js/jquery.validate.min.js', Route::url('jslocalization', array('controller' => 'jslocalization', 'action' => 'validate')), 'js/jquery.cookie.min.js', 'js/iconPicker.min.js', 'js/oc-panel/sidebar.js?v=' . Core::VERSION, '//cdn.jsdelivr.net/bootstrap.tagsinput/0.3.9/bootstrap-tagsinput.min.js', '//cdn.jsdelivr.net/sweetalert/1.1.3/sweetalert.min.js', 'js/jquery.bootgrid.min.js', 'js/query.bootgrid.fa.min.js', 'js/form.js?v=' . Core::VERSION);
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  */
 public function before($template = NULL)
 {
     parent::before();
     Theme::checker();
     $this->maintenance();
     $this->private_site();
     //get category, deprecated, to keep backwards compatibility with themes
     self::$category = Model_Category::current();
     //Gets a coupon if selected
     self::$coupon = Model_Coupon::current();
     //get the affiliate if any
     Model_Affiliate::current();
     if ($this->auto_render === TRUE) {
         // Load the template
         if ($template !== NULL) {
             $this->template = $template;
         }
         $this->template = View::factory($this->template);
         // Initialize template values
         $this->template->title = core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copyright = 'Open eShop ' . Core::VERSION;
         $this->template->content = '';
         $this->template->styles = array();
         $this->template->scripts = array();
         //we can not cache this view since theres dynamic parts
         //$this->template->header  = View::factory('header');
         //setting inner views try to get from fragment
         // if (Auth::instance()->logged_in())
         //     $this->template->header  = View::fragment('header_front_login','header');
         // else
         $this->template->header = View::factory('header');
         //no fragment since CSRF gets cached :(
         $this->template->footer = View::fragment('footer_front', 'footer');
     }
 }