Exemplo n.º 1
0
 public function __construct()
 {
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     parent::__construct();
     __extends($this);
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $this->instance = get_instance();
     $this->load->library('form_validation');
     $this->load->library('installation');
     $this->load->library('file');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $this->file->css_push('font');
     /**
     		$this->file->css_push('font');
     		$this->file->css_push('app.v2');
     		$this->file->css_push('fuelux');
     		// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     		$this->file->js_push('jquery');
     		$this->file->js_push('app.min.vtendoo');
     		$this->file->js_push('tendoo_app');
     		**/
     css_push_if_not_exists('../admin-lte/bootstrap/css/bootstrap.min');
     css_push_if_not_exists('../admin-lte/font-awesome/font-awesome.4.3.0.min');
     css_push_if_not_exists('../admin-lte/dist/css/AdminLTE.min');
     css_push_if_not_exists('../admin-lte/plugins/iCheck/square/blue');
     js_push_if_not_exists('../admin-lte/plugins/jQuery/jQuery-2.1.3.min');
     js_push_if_not_exists('../admin-lte/bootstrap/js/bootstrap.min');
     js_push_if_not_exists('../admin-lte/plugins/iCheck/icheck.min');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $this->instance = get_instance();
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $this->load->library('users_global');
     $this->load->library('file');
     $this->load->library('pagination');
     $this->load->library('form_validation');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     css_push_if_not_exists('font');
     css_push_if_not_exists('../admin-lte/bootstrap/css/bootstrap.min');
     css_push_if_not_exists('../admin-lte/font-awesome/font-awesome.4.3.0.min');
     css_push_if_not_exists('../admin-lte/dist/css/AdminLTE.min');
     css_push_if_not_exists('../admin-lte/plugins/iCheck/square/blue');
     js_push_if_not_exists('../admin-lte/plugins/jQuery/jQuery-2.1.3.min');
     js_push_if_not_exists('../admin-lte/bootstrap/js/bootstrap.min');
     js_push_if_not_exists('../admin-lte/plugins/iCheck/icheck.min');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     // Has admin ?
     $this->users_global->hasAdmin() === FALSE ? $this->url->redirect(array('registration', 'superAdmin')) : false;
     // is Connected ?
     $this->users_global->isConnected() === TRUE ? $this->url->redirect(array('index')) : false;
     $this->options = get_meta('all');
     set_core_vars('tendoo_notices', trigger_filters('declare_notices', array(get_core_vars('default_notices'))));
     // @since 1.4
 }
Exemplo n.º 3
0
 public function index($arg = '')
 {
     css_push_if_not_exists('font');
     css_push_if_not_exists('../admin-lte/bootstrap/css/bootstrap.min');
     css_push_if_not_exists('../admin-lte/font-awesome/font-awesome.4.3.0.min');
     css_push_if_not_exists('../admin-lte/dist/css/AdminLTE.min');
     css_push_if_not_exists('../admin-lte/plugins/iCheck/square/blue');
     js_push_if_not_exists('../admin-lte/plugins/jQuery/jQuery-2.1.3.min');
     js_push_if_not_exists('../admin-lte/bootstrap/js/bootstrap.min');
     js_push_if_not_exists('../admin-lte/plugins/iCheck/icheck.min');
     set_page('title', __('Welcome on') . ' ' . get('core_version'));
     set_core_vars('body', $this->load->the_view('tendoo_index_body', true));
     $this->load->the_view('header');
     $this->load->the_view('global_body');
 }
Exemplo n.º 4
0
 public function code($e)
 {
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     set_core_vars('code', notice('push', fetch_notice_output($e)));
     set_core_vars('body', $this->load->view('error/inner_body', $this->data, TRUE));
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     set_page('title', translate('Error - Tendoo'));
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     css_push_if_not_exists('font');
     css_push_if_not_exists('../admin-lte/bootstrap/css/bootstrap.min');
     css_push_if_not_exists('../admin-lte/font-awesome/font-awesome.4.3.0.min');
     css_push_if_not_exists('../admin-lte/dist/css/AdminLTE.min');
     css_push_if_not_exists('../admin-lte/plugins/iCheck/square/blue');
     js_push_if_not_exists('../admin-lte/plugins/jQuery/jQuery-2.1.3.min');
     js_push_if_not_exists('../admin-lte/bootstrap/js/bootstrap.min');
     js_push_if_not_exists('../admin-lte/plugins/iCheck/icheck.min');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     $this->load->view('header', $this->data);
     $this->load->view('error/global_body', $this->data);
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 }
Exemplo n.º 5
0
 public function themes($e = 'main', $a = 1)
 {
     current_user()->cannot('system@manage_themes') ? $this->url->redirect(array('admin', 'index?notice=accessDenied')) : false;
     redirect_if_webapp_is_enabled();
     if ($e == 'main') {
         js_push_if_not_exists('jtransit/jquery.transit.min');
         set_page('title', translate('Manage themes - Tendoo'));
         set_core_vars('ttThemes', $ttThemes = count(get_themes()), 'read_only');
         set_core_vars('paginate', $paginate = $this->tendoo->paginate(10, $ttThemes, 1, "bg-color-blue fg-color-white", "bg-color-white fg-color-blue", $a, $this->url->site_url(array('admin', 'modules', 'main')) . '/'), 'read_only');
         // Pagination
         set_core_vars('themes_list', get_themes('list_all', $paginate[1], $paginate[2]), 'read_only');
         $this->load->the_view('admin/themes/main');
     } else {
         if ($e == 'manage') {
             $this->load->library('form_validation');
             $this->form_validation->set_rules('action', translate('Set as active theme'));
             $this->form_validation->set_rules('theme_namespace', translate('theme id'), 'required');
             if ($this->form_validation->run()) {
                 if ($this->input->post('action') == 'ADMITSETDEFAULT') {
                     if (active_theme($this->input->post('theme_namespace'))) {
                         echo json_encode(array('status' => 'success', 'alertType' => 'notice', 'message' => translate('The theme has been set as active'), 'response' => 'theme_set'));
                         return;
                     }
                     echo json_encode(array('status' => 'warning', 'alertType' => 'modal', 'message' => translate('Error occured, this theme can\'t been set as active'), 'response' => 'theme_set_failure'));
                     return;
                 }
             }
             $this->form_validation->set_rules('action', translate('Delete theme'));
             $this->form_validation->set_rules('theme_namespace', translate('Theme id'), 'required');
             if ($this->form_validation->run()) {
                 if ($this->input->post('action') == 'ADMITDELETETHEME') {
                     $status = uninstall_theme($this->input->post('theme_namespace'));
                     if ($status) {
                         echo json_encode(array('status' => 'success', 'alertType' => 'notice', 'message' => translate('The theme has been deleted'), 'response' => 'theme_deleted'));
                         return;
                     }
                     echo json_encode(array('status' => 'warning', 'alertType' => 'modal', 'message' => translate('Error occured, this theme can\'t be deleted'), 'response' => 'theme_deletion_failure'));
                     return;
                 }
             }
         } else {
             $this->url->redrect(array('error', 'code', 'page-404'));
         }
     }
 }
Exemplo n.º 6
0
 public function edit($e)
 {
     js_push_if_not_exists('jquery-ui-1.10.4.custom.min');
     css_push_if_not_exists('jquery-ui-1.10.4.custom.min');
     if (!current_user_can('blogster@edit_posts')) {
         $this->url->redirect(array('admin', 'index?notice=accessDenied'));
     }
     set_core_vars('categories', $this->news->getCat());
     if (count(get_core_vars('categories')) == 0) {
         $this->url->redirect(array('admin', 'open', 'modules', $this->opened_module['namespace'], 'category', 'create?notice=noCategoryCreated'));
     }
     // Control Sended Form Datas
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert"><i class="icon-remove"></i></button><i style="font-size:18px;margin-right:5px;" class="icon-warning-sign"></i>', '</div>');
     $this->form_validation->set_rules('news_name', 'Intitulé de l\'article', 'trim|max_length[200]');
     $this->form_validation->set_rules('news_content', 'Contenu de l\'article', 'trim|max_length[20000]');
     $this->form_validation->set_rules('push_directly', 'Choix de l\'action', 'trim|max_length[10]');
     $this->form_validation->set_rules('image_link', 'Lien de l\'image', 'trim|max_length[1000]');
     $this->form_validation->set_rules('thumb_link', 'Lien de l\'image', 'trim|max_length[1000]');
     // $this->form_validation->set_rules('category','Cat&eacute;gorie','trim|min_length[1]|max_length[200]');
     $this->form_validation->set_rules('article_id', 'Identifiant de l\'article', 'required|min_length[1]');
     if ($this->form_validation->run()) {
         $this->data['result'] = $this->news->edit($this->input->post('article_id'), $this->input->post('news_name'), $this->input->post('news_content'), $this->input->post('push_directly'), $this->input->post('image_link'), $this->input->post('thumb_link'), isset($_POST['category']) ? $_POST['category'] : array(1), isset($_POST['artKeyWord']) ? $_POST['artKeyWord'] : false, $this->input->post('scheduledDate'), $this->input->post('scheduledTime'));
         if ($this->data['result']) {
             notice('push', tendoo_success(__('Post updated.')));
         } else {
             notice('push', fetch_notice_output('error'));
         }
     }
     // Retreiving News Data
     set_core_vars('getSpeNews', $this->news->getSpeNews($e));
     if (get_core_vars('getSpeNews') == false) {
         module_location(array('index?notice=unknowArticle'));
     }
     // Récupération des mots clés de l'article.
     set_core_vars('getKeyWords', $this->news->getNewsKeyWords($e));
     //		var_dump($this->data['getKeyWords']);
     set_core_vars('getNewsCategories', $this->news->getArticlesRelatedCategory($e));
     // Définition du titre
     set_page('title', __('Blogster - Edit a post'));
     // Chargement de l'éditeur
     $this->instance->visual_editor->loadEditor(1);
     // Ajout des fichier du plugin bootstrap mutiselect
     $this->file->js_url = $this->url->main_url();
     js_push_if_not_exists(MODULES_DIR . $this->opened_module['encrypted_dir'] . '/js/bootstrap-multiselect');
     $this->file->css_url = $this->url->main_url();
     css_push_if_not_exists(MODULES_DIR . $this->opened_module['encrypted_dir'] . '/css/bootstrap-multiselect');
     // Loading Bloster Script
     $this->file->js_url = $this->url->main_url();
     js_push_if_not_exists(MODULES_DIR . $this->opened_module['encrypted_dir'] . '/js/blogster.script');
     $this->load->view(MODULES_DIR . $this->opened_module['encrypted_dir'] . '/views/edit', $this->data, false, TRUE, $this);
 }
Exemplo n.º 7
0
function theme_jpush($url)
{
    $instance = get_instance();
    return js_push_if_not_exists(theme_assets_url($url), $instance->url->main_url());
}