Example #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');
 }
Example #2
0
 function comments()
 {
     $this->data['page_title'] = "Comments";
     $this->data['sub_title'] = "Recent";
     $this->data['navigation'] = $this->load->view(config_item('dashboard_theme') . '/partials/navigation_comments.php', $this->data, true);
     $comments = $this->social_tools->get_comments(config_item('site_id'), $this->session->userdata('user_id'), $this->uri->segment(3));
     $comments_view = NULL;
     $this->data['feed_type'] = 'comments';
     $this->data['item_verb'] = item_type($this->lang->line('object_types'), 'comment');
     if (empty($comments)) {
         $comments_view = '<li>No comments to show!</li>';
     } else {
         foreach ($comments as $comment) {
             // Item
             $this->data['item_id'] = $comment->comment_id;
             $this->data['item_type'] = item_type_class($comment->type);
             $this->data['item_viewed'] = item_viewed('item', $comment->viewed);
             // Contributor
             $this->data['item_avatar'] = $this->social_igniter->profile_image($comment->user_id, $comment->image, $comment->gravatar);
             $this->data['item_contributor'] = $comment->name;
             $this->data['item_profile'] = base_url() . 'profile/' . $comment->username;
             // Activity
             if ($comment->title) {
                 $this->data['item_article'] = '';
                 $this->data['item_object'] = $comment->title;
             } else {
                 $this->data['item_article'] = item_type($this->lang->line('object_articles'), $comment->type);
                 $this->data['item_object'] = $comment->type;
             }
             $this->data['item_text'] = item_linkify($comment->comment);
             $this->data['item_date'] = format_datetime(config_item('comments_date_style'), $comment->created_at);
             $this->data['item_approval'] = $comment->approval;
             // Alerts
             $this->data['item_alerts'] = item_alerts_comment($comment);
             // Actions
             $this->data['item_view'] = base_url() . $comment->module . '/view/' . $comment->content_id . '/' . $comment->comment_id;
             $this->data['item_reply'] = base_url() . $comment->module . '/reply/id/' . $comment->content_id . '/' . $comment->comment_id;
             $this->data['item_approve'] = base_url() . 'api/comments/approve/id/' . $comment->comment_id;
             $this->data['item_delete'] = base_url() . 'api/comments/destroy/id/' . $comment->comment_id;
             // Load Partial For Items
             $comments_view .= $this->load->view(config_item('dashboard_theme') . '/partials/item_comments.php', $this->data, true);
         }
     }
     $this->data['comments_view'] = $comments_view;
     $this->render();
 }