Exemplo n.º 1
0
 public function action_index()
 {
     $category_uri = $this->request->param('category_uri');
     $news_category = new News_Category();
     $category_list = $news_category->get_list($this->page_id);
     if (empty($category_list)) {
         throw new HTTP_Exception_404();
     }
     $category_orm = $news_category->by_uri($category_list, $category_uri);
     $orm = ORM::factory('news')->where('category_id', 'IN', array_keys($category_list));
     if ($category_orm) {
         $orm->where('category_id', '=', $category_orm->id);
         $properties = $news_category->get_properties(array($category_orm));
         $properties = reset($properties);
         $this->title = $category_orm->title;
         $this->breadcrumbs[] = array('title' => $category_orm->title);
     } else {
         $orm_helper = ORM_Helper::factory('page', $this->page_id);
         $properties = $orm_helper->property_list();
     }
     $paginator_orm = clone $orm;
     $paginator = new Paginator('layout/paginator');
     $paginator->per_page($this->limit)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all()->as_array();
     $titlebar_title = Arr::path($properties, 'Title.value');
     if (empty($titlebar_title)) {
         $titlebar_title = __('Blog');
     }
     $this->template->set_filename('modules/news/list')->set('list', $list)->set('paginator', $paginator)->set('categories', $category_list)->set('properties', $properties)->set('titlebar_title', $titlebar_title);
 }
Exemplo n.º 2
0
 public function action_index()
 {
     $this->_parse_uri();
     $category_id = (int) $this->category->id;
     $list_categories = ORM::factory('catalog_Category')->where('category_id', '=', $category_id)->find_all()->as_array();
     $elements_orm = ORM::factory('catalog_Element')->where('category_id', '=', $category_id);
     $paginator_orm = clone $elements_orm;
     $paginator = new Paginator('layout/paginator');
     $paginator->per_page($this->limit)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $elements_orm->paginator($paginator)->find_all()->as_array();
     $properties = array();
     if (!empty($category_id)) {
         $property_helper = ORM_Helper::factory('catalog_Category', $category_id)->property_helper();
         $property_helper->set_owner_id($category_id);
         $properties = $property_helper->get_list();
         $titlebar_title = Arr::path($properties, 'Title.value');
         if (empty($titlebar_title)) {
             $titlebar_title = $this->category->title;
         }
     } else {
         $orm_helper = ORM_Helper::factory('page', $this->page_id);
         $properties = $orm_helper->property_list();
         $titlebar_title = Arr::path($properties, 'Title.value');
         if (empty($titlebar_title)) {
             $titlebar_title = __('Categories of goods');
         }
     }
     $this->template->set_filename('modules/catalog/list')->set('list_categories', $list_categories)->set('list', $list)->set('paginator', $paginator)->set('properties', $properties)->set('titlebar_title', $titlebar_title);
 }
Exemplo n.º 3
0
 public function action_index()
 {
     $orm = ORM::factory('video');
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/video/element/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('filter_type_options', $this->filter_type_options)->set('paginator', $paginator);
     $this->left_menu_element_add();
     $this->sub_title = __('List');
 }
Exemplo n.º 4
0
 public function action_index()
 {
     $orm = ORM::factory('news_Category')->where('page_id', '=', $this->module_page_id);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/news/category/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('not_deleted_categories', $this->not_deleted_categories)->set('paginator', $paginator);
     $this->left_menu_category_add($orm);
     $this->left_menu_category_fix($orm);
     $this->title = __('Categories');
 }
Exemplo n.º 5
0
 public function action_index()
 {
     $orm = ORM::factory('site');
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('sites/list')->set('paginator', $paginator)->set('list', $list);
     $this->title = __('Sites list');
     if ($this->acl->is_allowed($this->user, $orm, 'edit')) {
         $this->left_menu_site_add();
     }
 }
Exemplo n.º 6
0
 public function action_index()
 {
     $orm = ORM::factory('photo_Album')->where('group', '=', $this->group_key);
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/photo/album/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('not_deleted_albums', $this->not_deleted_albums)->set('paginator', $paginator)->set('filter_type_options', $this->filter_type_options);
     $this->left_menu_album_add($orm);
     $this->title = __('Photo albums');
     $this->sub_title = __('List');
 }
Exemplo n.º 7
0
 public function action_index()
 {
     $orm = ORM::factory('form');
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('forms/structure/list')->set('list', $list)->set('paginator', $paginator);
     if ($this->acl->is_allowed($this->user, $orm, 'add')) {
         $this->left_menu_form_add();
     }
     $this->title = __('Forms (structure)');
     $this->sub_title = __('List');
 }
Exemplo n.º 8
0
 public function action_index()
 {
     $blog_orm = ORM::factory('blog')->where('group', '=', $this->group_key)->and_where('id', '=', $this->blog_id)->find();
     if (!$blog_orm->loaded()) {
         throw new HTTP_Exception_404();
     }
     $orm = ORM::factory('blog_Post')->where('blog_id', '=', $this->blog_id);
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/blog/element/list')->set('list', $list)->set('hided_list', $this->get_hided_list($orm->object_name()))->set('filter_type_options', $this->filter_type_options)->set('paginator', $paginator);
     $this->left_menu_blog_add($blog_orm);
     $this->left_menu_element_list();
     $this->left_menu_element_add();
     $this->title = __('List');
 }
Exemplo n.º 9
0
 public function action_index()
 {
     $orm = ORM::factory('admin')->where('delete_bit', '=', 0)->and_where('username', 'NOT IN', $this->_exclude_admins);
     if (in_array($this->user->role, array('main', 'super'))) {
         $orm->where('site_id', '=', SITE_ID);
     } else {
         $orm->where('site_id', '=', $this->user->site_id);
     }
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(10)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('admins/list')->set('list', $list)->set('roles', $this->acl_roles())->set('paginator', $paginator);
     $this->title = __('Admin list');
     if ($this->acl->is_allowed($this->user, $orm, 'edit')) {
         $this->left_menu_user_add();
     }
 }
Exemplo n.º 10
0
 public function action_index()
 {
     $album_orm = ORM::factory('photo_Album')->where('group', '=', $this->group_key)->and_where('id', '=', $this->album_id)->find();
     if (!$album_orm->loaded()) {
         throw new HTTP_Exception_404();
     }
     $orm = ORM::factory('photo')->where('owner', '=', $album_orm->object_name())->where('owner_id', '=', $this->album_id);
     $this->_apply_filter($orm);
     $paginator_orm = clone $orm;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm->paginator($paginator)->find_all();
     $this->template->set_filename('modules/photo/element/list')->set('list', $list)->set('filter_type_options', $this->filter_type_options)->set('paginator', $paginator)->set('acl_album_can_edit', $this->acl->is_allowed($this->user, $album_orm, 'edit'));
     $this->left_menu_album_add($album_orm);
     $this->left_menu_element_list();
     $this->left_menu_element_add($album_orm);
     $this->left_menu_element_fix($orm);
     $this->title = __('List');
 }
Exemplo n.º 11
0
 public function action_form()
 {
     $id = (int) Request::current()->param('id');
     $orm_form = ORM::factory('form', $id);
     if (!$orm_form->loaded()) {
         throw new HTTP_Exception_404();
     }
     $paginator_orm = clone $orm_form->responses;
     $paginator = new Paginator('admin/layout/paginator');
     $paginator->per_page(20)->count($paginator_orm->count_all());
     unset($paginator_orm);
     $list = $orm_form->responses->paginator($paginator)->find_all();
     $this->template->set_filename('forms/responses/form')->set('orm_form', $orm_form)->set('list', $list)->set('paginator', $paginator);
     if ($this->acl->is_allowed($this->user, $orm_form, 'add')) {
         $this->left_menu_form_add();
     }
     if ($this->acl->is_allowed($this->user, $orm_form, 'export_csv')) {
         $this->left_menu_csv_export($orm_form->id);
     }
     $this->title = __('Messages');
     $this->sub_title = __('Form') . ' [ ' . $orm_form->title . ' ]';
     $this->breadcrumbs[] = array('title' => $this->title);
 }