public function create() { $this->load->library('form_validation'); $this->form_validation->set_rules('page_title', __('Page Title'), 'trim|required'); $this->form_validation->set_rules('page_description', __('Page Description'), 'trim|required'); $this->form_validation->set_rules('page_content', __('The content field'), 'trim|required'); if ($this->form_validation->run()) { $post_page = $this->lib->set_page($this->input->post('page_title'), $this->input->post('page_content'), $this->input->post('page_description'), $this->input->post('page_parent') ? $this->input->post('page_parent') : 0, $this->input->post('page_controller_id') ? $this->input->post('page_controller_id') : 0, $process_type = 'create', $this->input->post('page_status') ? 1 : 0); module_location(array('edit', $post_page['ID'] . '?notice=page_created')); } set_page('title', __('Page Creator > Create a new page')); set_core_vars('available_controllers', $this->lib->get_available_controllers()); set_core_vars('available_pages', $this->lib->get_pages('all_available')); $this->visual_editor->loadEditor(1); $this->load->view($this->opened_module['uri_path'] . 'views/create', $this->data, false, TRUE); }
public function manage($id) { if (!current_user_can('tendoo_contents@upload_media')) { $this->url->redirect(array('admin', 'index?notice=accessDenied')); } $this->file->js_url = $this->url->main_url() . $this->data['module_dir'] . '/js/'; $this->file->css_url = $this->url->main_url() . $this->data['module_dir'] . '/css/'; $this->file->js_push('jquery.Jcrop.min'); $this->file->css_push('jquery.Jcrop.min'); $this->load->library('form_validation'); if ($this->input->post('delete_file')) { if (!current_user_can('tendoo_contents@delete_media')) { $this->url->redirect(array('admin', 'index?notice=accessDenied')); } $this->form_validation->set_rules('delete_file', '', 'trim|required'); $this->form_validation->set_rules('content_id', '', 'trim|required|is_numeric'); if ($this->form_validation->run()) { $query = $this->file_contentAdmin->fileDrop($this->input->post('content_id')); if ($query) { $this->url->redirect(array('admin', 'open', 'modules', $this->opened_module['namespace'] . '?notice=done')); } else { $this->notice->push_notice(fetch_notice_output('error-occured')); } } } if ($this->input->post('edit_file')) { $this->load->library('form_validation'); $this->form_validation->set_rules('file_name', 'Le nom du fichier', 'trim|required|min_length[5]|max_length[40]'); $this->form_validation->set_rules('file_description', 'La description du fichier', 'trim|required|min_length[5]|max_length[200]'); $this->form_validation->set_rules('content_id', '', 'trim|required|min_length[1]'); $this->form_validation->set_rules('edit_file', '', 'trim|required|min_length[1]'); if ($this->form_validation->run()) { $query = $this->file_contentAdmin->editFile($this->input->post('content_id'), $this->input->post('file_name'), $this->input->post('file_description')); if ($query) { module_location(array('manage', $this->input->post('content_id') . '?notice=done')); } else { $this->notice->push_notice(fetch_notice_output('error-occured')); } } } if ($this->input->post('overwrite_file')) { $this->load->library('form_validation'); $this->form_validation->set_rules('overwrite_file', 'Ecraser l\'image', 'trim|required|min_length[5]|max_length[40]'); $this->form_validation->set_rules('x1', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('y1', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('x2', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('y2', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('w', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('h', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('image_id', 'Index de l\'image', 'trim|required|min_length[1]'); if ($this->form_validation->run()) { $query = $this->lib->overwrite_image($this->input->post('image_id'), $this->input->post('x1'), $this->input->post('y1'), $this->input->post('x2'), $this->input->post('y2'), $this->input->post('w'), $this->input->post('h')); if ($query) { $this->notice->push_notice(fetch_notice_output('done')); } else { $this->notice->push_notice(fetch_notice_output('error-occured')); } } } if ($this->input->post('change_file')) { $this->load->library('form_validation'); $this->form_validation->set_rules('content_id', 'cordonnée', 'trim|required|min_length[1]'); if ($this->form_validation->run()) { $query = $this->lib->fileReplace($this->input->post('content_id'), 'new_file'); $this->notice->push_notice(fetch_notice_output($query)); } } if ($this->input->post('create_new_file')) { $this->load->library('form_validation'); $this->form_validation->set_rules('create_new_file', 'Ecraser l\'image', 'trim|required|min_length[5]|max_length[40]'); $this->form_validation->set_rules('x1', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('y1', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('x2', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('y2', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('w', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('h', 'cordonnée', 'trim|required|min_length[1]'); $this->form_validation->set_rules('image_id', 'Index de l\'image', 'trim|required|min_length[1]'); if ($this->form_validation->run()) { $query = $this->lib->create_new_image($this->input->post('image_id'), $this->session->userdata('fileNewName'), $this->input->post('x1'), $this->input->post('y1'), $this->input->post('x2'), $this->input->post('y2'), $this->input->post('w'), $this->input->post('h')); $this->notice->push_notice(fetch_notice_output($query)); } } set_page('title', __('Editing Media')); $this->data['fileNewName'] = $this->lib->getName(); $this->session->set_userdata('fileNewName', $this->data['fileNewName']); $this->data['getFile'] = $this->file_contentAdmin->getUploadedFiles($id); if (count($this->data['getFile']) == 0) { $this->url->redirect(array('error', 'code', 'page-404')); } $this->data['id'] = $id; $this->data['loadSection'] = 'manage'; $this->data['body'] = $this->load->view(MODULES_DIR . $this->opened_module['encrypted_dir'] . '/views/manage', $this->data, true, TRUE); return $this->data['body']; }
public function tags($tags_name = '', $page = 1) { $this->data['keyWords'] = $this->news->keyWordExists($tags_name, 'filter_url_title'); if (!$this->data['keyWords']) { module_location(array('index?notice=unknowKeyWord')); } $this->data['countArticles'] = count($this->news->getKeyWordsArticles($this->data['keyWords'][0]['ID'], null, null, 'filter_id')); $this->data['paginate'] = pagination_helper(10, $this->data['countArticles'], $page, module_url(array('tags')), $RedirectUrl = array('error', 'code', 'page-404')); $this->data['tagArticles'] = $this->data['news']->getKeyWordsArticles($this->data['keyWords'][0]['URL_TITLE'], $this->data['paginate']['start'], $this->data['paginate']['end'], 'filter_url_title'); // $title = $this->data['page'][0]['PAGE_TITLE'] . ' » ' . $this->data['keyWords'][0]['TITLE'] . ' (mot-clé)'; $description = strip_tags($this->data['keyWords'][0]['DESCRIPTION']); // Fetching KeyWords Description // set_page('title', $title); set_page('description', $description); // get_core_vars('active_theme_object')->definePageTitle($title); get_core_vars('active_theme_object')->definePageDescription($description); // if ($this->data['tagArticles'] == false) { $this->data['tagArticles'] = array(array('TITLE' => 'Aucune publication disponible', 'CONTENT' => 'Aucune publication n\'est disponible pour ce mot-clé', 'AUTEUR' => '1', 'DATE' => get_instance()->date->datetime(), 'THUMB' => $this->url->img_url('hub_back.png'), 'IMAGE' => $this->url->img_url('hub_back.png'), 'ID' => 0)); } $this->data['section'] = 'keywords'; set_core_vars('module_content', $this->load->view(MODULES_DIR . $this->data['module']['encrypted_dir'] . '/views/common_keywords', $this->data, true, TRUE)); // ----------------------------------------------------------------------------------------------------------------------------------// get_core_vars('active_theme_object')->head($this->data); get_core_vars('active_theme_object')->body($this->data); }
public function tags($action = 'index', $page = 1) { if (current_user_can('blogster_manage_tags@blogster')) { // Get All keyWords $this->data['totalKeyWords'] = count($this->news->getAllPopularKeyWords('all')); // Starting Pagination $_elPP = isset($_GET['limit']) ? $_GET['limit'] : 10; $this->data['paginate'] = pagination_helper($_elPP, $this->data['totalKeyWords'], $page, module_url(array('tags', 'index'))); // Get KeyWord Using Page Pagination $this->data['getKeywords'] = $this->news->getAllPopularKeyWords('limitedTo', $this->data['paginate']['start'], $this->data['paginate']['end']); // Set Page Title set_page('title', __('Blogster - Manage Tags')); $this->data['body'] = $this->load->view(MODULES_DIR . $this->opened_module['encrypted_dir'] . '/views/keywords_main', $this->data, true, TRUE, $this); return $this->data['body']; } else { module_location('?notice=accessDenied'); } }