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'); }
function pages_editor() { if ($this->uri->segment(3) == 'manage' && $this->uri->segment(4)) { // Need is valid & access and such $page = $this->social_igniter->get_content($this->uri->segment(4)); if (!$page) { redirect(base_url() . 'home/error'); } // Non Form Fields $this_page_id = $page->content_id; $this->data['sub_title'] = $page->title; $this->data['form_url'] = base_url() . 'api/content/modify/id/' . $this->uri->segment(4); // Form Fields $this->data['title'] = $page->title; $this->data['title_url'] = $page->title_url; if ($page->details == 'site') { $this->data['slug_pre'] = base_url() . 'pages/'; } else { $this->data['slug_pre'] = base_url() . ''; } $this->data['wysiwyg_value'] = $page->content; $this->data['parent_id'] = $page->parent_id; $this->data['details'] = $page->details; $this->data['access'] = $page->access; $this->data['comments_allow'] = $page->comments_allow; $this->data['geo_lat'] = $page->geo_lat; $this->data['geo_long'] = $page->geo_long; $this->data['status'] = display_content_status($page->status, $page->approval); } else { // Non Form Fields $this_page_id = 0; $this->data['sub_title'] = 'Create'; $this->data['form_url'] = base_url() . 'api/content/create'; // Form Fields $this->data['title'] = ''; $this->data['title_url'] = ''; $this->data['slug_pre'] = base_url() . 'pages'; $this->data['layouts'] = ''; $this->data['wysiwyg_value'] = $this->input->post('content'); $this->data['parent_id'] = ''; $this->data['details'] = 'site'; $this->data['access'] = 'E'; $this->data['comments_allow'] = ''; $this->data['geo_lat'] = ''; $this->data['geo_long'] = ''; $this->data['status'] = display_content_status('U'); } // WYSIWYG for 'pages' if ($this->data['details'] == 'site') { $this->data['wysiwyg_name'] = 'content'; $this->data['wysiwyg_id'] = 'wysiwyg_content'; $this->data['wysiwyg_class'] = 'wysiwyg_norm_full'; $this->data['wysiwyg_width'] = 640; $this->data['wysiwyg_height'] = 300; $this->data['wysiwyg_resize'] = TRUE; $this->data['wysiwyg_media'] = TRUE; $this->data['wysiwyg'] = $this->load->view($this->config->item('dashboard_theme') . '/partials/wysiwyg', $this->data, true); } // Not currently working // Don't know where to store layout value $this->data['layouts'] = $this->social_igniter->scan_layouts(config_item('site_theme')); $this->data['layout_selected'] = 'sidebar'; $this->data['form_module'] = 'pages'; $this->data['form_type'] = 'page'; $this->data['form_name'] = 'pages_editor'; $this->data['parent_pages'] = $this->social_igniter->make_pages_dropdown($this_page_id); $this->data['content_publisher'] = $this->social_igniter->make_content_publisher($this->data, 'form'); $this->render('dashboard_wide'); }