Ejemplo n.º 1
0
 function manage()
 {
     if ($this->session->userdata('user_level_id') > 3) {
         redirect(base_url() . 'home');
     }
     $content_module = $this->social_igniter->get_content_view('module', $this->uri->segment(2), 'all', 150);
     $manage_view = NULL;
     $filter_categories = array('none' => 'By Category');
     $filter_users = array('none' => 'By User');
     $filter_details = array('none' => 'By Details');
     // Title Stuff
     $this->data['page_title'] = ucwords($this->uri->segment(2));
     $this->data['sub_title'] = 'Manage';
     if (!empty($content_module)) {
         foreach ($content_module as $content) {
             $this->data['content'] = $content;
             $this->data['item_id'] = $content->content_id;
             $this->data['item_type'] = $content->type;
             $this->data['item_viewed'] = item_viewed('item_manage', $content->viewed);
             $this->data['title'] = item_title($content->title, $content->type);
             $this->data['title_link'] = base_url() . $content->module . '/view/' . $content->content_id;
             $this->data['comments_count'] = manage_comments_count($content->comments_count);
             $this->data['publish_date'] = manage_published_date($content->created_at, $content->updated_at);
             // MAKE FOR CHECK RELVANT TO USER_LEVEL
             $this->data['item_status'] = display_content_status($content->status);
             $this->data['item_approval'] = $content->approval;
             // Alerts
             $this->data['item_alerts'] = item_alerts_content($content);
             // Actions
             $this->data['item_approve'] = base_url() . 'api/content/approve/id/' . $content->content_id;
             $this->data['item_edit'] = base_url() . 'home/' . $content->module . '/manage/' . $content->content_id;
             $this->data['item_delete'] = base_url() . 'api/content/destroy/id/' . $content->content_id;
             // View
             $manage_view .= $this->load->view(config_item('dashboard_theme') . '/partials/item_manage.php', $this->data, true);
             // Build Filter Values
             $filter_categories[$content->category_id] = $content->category_id;
             $filter_users[$content->user_id] = $content->name;
             $filter_details[$content->details] = $content->details;
         }
     } else {
         $manage_view = '<li>Nothing to manage from anyone!</li>';
     }
     // Final Output
     $this->data['timeline_view'] = $manage_view;
     $this->data['module'] = ucwords($this->uri->segment(2));
     $this->data['all_categories'] = $this->social_tools->get_categories_view('module', $this->uri->segment(2));
     $this->data['filter_categories'] = $filter_categories;
     $this->data['filter_users'] = $filter_users;
     $this->data['filter_details'] = $filter_details;
     $this->render('dashboard_wide');
 }
Ejemplo n.º 2
0
 function categories()
 {
     $this->data['sub_title'] = 'Categories';
     $categories = $this->social_tools->get_categories_view('module', $this->uri->segment(2));
     $categories_view = NULL;
     if (!empty($categories)) {
         foreach ($categories as $category) {
             $this->data['item_id'] = $category->category_id;
             $this->data['item_type'] = $category->type;
             $this->data['title'] = $category->category;
             $this->data['title_link'] = base_url() . $category->module . '/view/' . $category->category_id;
             $this->data['contents_count'] = manage_contents_count($category->contents_count);
             $this->data['publish_date'] = manage_published_date($category->created_at, $category->updated_at);
             // Alerts
             $this->data['item_alerts'] = '';
             // Actions
             $this->data['item_edit'] = base_url() . 'settings/' . $category->module . '/categories/' . $category->category_id;
             $this->data['item_delete'] = base_url() . 'api/categories/destroy/id/' . $category->category_id;
             // View
             $categories_view .= $this->load->view(config_item('dashboard_theme') . '/partials/item_categories.php', $this->data, true);
         }
     } else {
         $categories_view = '<li>There are no ' . ucwords($this->uri->segment(2)) . ' Categories</li>';
     }
     // Final Output
     $this->data['categories_view'] = $categories_view;
     $this->render('dashboard_wide');
 }