Esempio n. 1
0
 private static function display_create($errors = NULL, $values = NULL)
 {
     /*
     // TESTING
     include Kohana::find_file('vendor','CMBase');
     $apikey = '298b597d3b08736948706029b4300aaa';
     $client_id = 'f8ae20928188efa9b99b7be44c5bf4f4';
     $cm = new CampaignMonitor($apikey);
       
     //This is the actual call to the method
     $result = $cm->clientGetDetail($client_id);
     echo kohana::debug($result);
     die();
     */
     /*
         include Kohana::find_file('vendor','CMBase');
         $company  = 'get it right';    
         $name    = 'yahboi';
         $email    = '*****@*****.**';
         $country  = 'United States of America';
         $timezone  = '(GMT-08:00) Pacific Time (US & Canada)';
     
         $cm = new CampaignMonitor;
         $result = $cm->clientCreate($company, $name, $email, $country, $timezone);
         
         echo kohana::debug($result);
         die();        
     */
     if (empty($values)) {
         $values = array('site_name' => strtolower(text::random('alpha', 5)), 'beta' => '', 'theme' => '');
     }
     $view = new View('plusjade_home');
     $view->errors = $errors;
     $view->values = $values;
     $view->themes = ORM::factory('theme')->where('enabled', 'yes')->find_all();
     $view->request_js_files('easing/jquery.easing.1.3.js');
     $view->request_js_files('cycle_lite/jquery.cycle.all.min.js');
     return $view;
 }
Esempio n. 2
0
 private function gallery($album, $images)
 {
     $view = new View('public_album/images/gallery');
     $view->images = $images;
     # toggle the gallery elements
     $toggle = explode('|', $album->toggle);
     $view->has_panels = 'no' == $toggle[0] ? FALSE : TRUE;
     $view->has_filmstrip = (!empty($toggle[1]) and 'no' == $toggle[1]) ? FALSE : TRUE;
     $view->img_path = $this->assets->assets_url();
     # request javascript file
     $view->request_js_files('gallery/gallery.js');
     return $view;
 }
Esempio n. 3
0
 private function items_category($page_name, $showroom, $category_id)
 {
     # get the parent to determine the view.
     if (!is_object($showroom)) {
         $showroom = ORM::factory('showroom', $showroom);
     }
     # get the category
     $category = ORM::factory('showroom_cat')->where(array('fk_site' => $this->site_id, 'showroom_id' => $showroom->id))->find($category_id);
     if (!$category->loaded) {
         return '<div class="not_found">Invalid category</div>';
     }
     # get any sub categories ...
     $sub_cats = ORM::factory('showroom_cat')->where(array('fk_site' => $this->site_id, 'showroom_id' => $showroom->id, 'lft >=' => "{$category->lft}", 'lft <=' => "{$category->rgt}"))->find_all();
     # create array from the cat and sub_cats
     $cat_ids = array();
     foreach ($sub_cats as $cat) {
         $cat_ids[] = $cat->id;
     }
     # get all the items.
     $items = ORM::factory('showroom_cat_item')->where(array('fk_site' => $this->site_id))->in('showroom_cat_id', $cat_ids)->find_all();
     if (0 == $items->count()) {
         return '<div class="not_found">No items. Check back soon!</div>';
     }
     $view = new View("public_showroom/display/{$showroom->view}");
     # do view stuff
     if ('gallery' == $showroom->view) {
         # request javascript file
         $view->request_js_files('lightbox/lightbox.js');
         # parse the params.
         $params = explode('|', $showroom->params);
         $view->columns = (isset($params[1]) and is_numeric($params[1])) ? $params[1] : 2;
         $view->thumb_size = (isset($params[2]) and is_numeric($params[2])) ? $params[2] : 75;
     }
     # get the path to this category
     $path = ORM::factory('showroom_cat')->where(array('fk_site' => $this->site_id, 'showroom_id' => $showroom->id, 'lft <' => $category->lft, 'rgt >' => $category->rgt, 'local_parent !=' => 0))->orderby(array('lft' => 'asc'))->find_all();
     $view->path = $path;
     $view->category = $category;
     $view->sub_categories = Tree::display_tree('showroom', $sub_cats, $page_name);
     $view->page_name = $page_name;
     $view->img_path = $this->assets->assets_url();
     $view->items = $items;
     return $view;
 }