Beispiel #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');
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 }
Beispiel #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
 }
 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');
 }
Beispiel #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);
     // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 }
Beispiel #5
0
 public function controllers($e = '', $f = '')
 {
     redirect_if_webapp_is_enabled();
     current_user()->cannot('system@manage_controllers') ? $this->url->redirect(array('admin', 'index?notice=accessDenied')) : false;
     if ($e == '') {
         if (isset($_POST['controller'])) {
             $result = $this->tendoo_admin->createControllers($_POST['controller']);
             if ($result) {
                 $ttError = 0;
                 foreach ($result as $r) {
                     if ($r != "controler_created") {
                         $ttError++;
                     }
                 }
                 if ($ttError > 0) {
                     notice('push', tendoo_error($ttError . ' ' . translate('errors founded, some controllers has been dismissed')));
                 }
                 notice('push', fetch_notice_output('controllers_updated'));
             }
         }
         css_push_if_not_exists('controller_style');
         js_push_if_not_exists('jquery.nestable');
         js_push_if_not_exists('tendoo_controllersScripts');
         // ControllersSripts
         // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         set_core_vars('get_pages', $this->controller->get());
         set_core_vars('get_mod', $modules = get_modules('filter_active_unapp'));
         // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         set_page('title', translate('Manage controllers - Tendoo'));
         // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         set_core_vars('body', $this->load->view('admin/pages/body', $this->data, true, false), 'ready_only');
         // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
         $this->load->view('admin/header', $this->data, null, false);
         $this->load->view('admin/global_body', $this->data, false, false);
     }
 }
Beispiel #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);
 }
/**
 *
 **/
function output($element)
{
    $instance = get_instance();
    if ($element == 'css') {
        echo $instance->file->css_load();
    } else {
        if ($element == 'js') {
            echo $instance->file->js_load();
        } else {
            if ($element == 'notice') {
                echo notice('parse');
            } else {
                if ($element == 'headers') {
                    // Including new UserBar css
                    css_push_if_not_exists('tendoo_userbar', $instance->url->main_url() . '/tendoo-assets/css/');
                    // Ouputing CSS and JS
                    output('css');
                    output('js');
                } else {
                    if ($element == 'content-header') {
                        ?>
            <section class="content-header">
                <h1>
                    <?php 
                        echo get_page('title');
                        ?>
                    <!--<small><?php 
                        echo get_page('description');
                        ?>
</small>-->
                </h1>
                <!--
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li class="active">Widgets</li>
                </ol>
                -->
            </section>
            <?php 
                    } else {
                        if ($element == 'content-card') {
                            return;
                            // disabled for now
                            ?>
            <div class="row">
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-aqua">
                                <div class="inner">
                                    <h3>
                                        150
                                    </h3>
                                    <p>
                                        New Orders
                                    </p>
                                </div>
                                <div class="icon">
                                    <i class="ion ion-bag"></i>
                                </div>
                                <a href="#" class="small-box-footer">
                                    More info <i class="fa fa-arrow-circle-right"></i>
                                </a>
                            </div>
                        </div><!-- ./col -->
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-green">
                                <div class="inner">
                                    <h3>
                                        53<sup style="font-size: 20px">%</sup>
                                    </h3>
                                    <p>
                                        Bounce Rate
                                    </p>
                                </div>
                                <div class="icon">
                                    <i class="ion ion-stats-bars"></i>
                                </div>
                                <a href="#" class="small-box-footer">
                                    More info <i class="fa fa-arrow-circle-right"></i>
                                </a>
                            </div>
                        </div><!-- ./col -->
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-yellow">
                                <div class="inner">
                                    <h3>
                                        44
                                    </h3>
                                    <p>
                                        User Registrations
                                    </p>
                                </div>
                                <div class="icon">
                                    <i class="ion ion-person-add"></i>
                                </div>
                                <a href="#" class="small-box-footer">
                                    More info <i class="fa fa-arrow-circle-right"></i>
                                </a>
                            </div>
                        </div><!-- ./col -->
                        <div class="col-lg-3 col-xs-6">
                            <!-- small box -->
                            <div class="small-box bg-red">
                                <div class="inner">
                                    <h3>
                                        65
                                    </h3>
                                    <p>
                                        Unique Visitors
                                    </p>
                                </div>
                                <div class="icon">
                                    <i class="ion ion-pie-graph"></i>
                                </div>
                                <a href="#" class="small-box-footer">
                                    More info <i class="fa fa-arrow-circle-right"></i>
                                </a>
                            </div>
                        </div><!-- ./col -->
                    </div>
            <?php 
                        } else {
                            if ($element == 'content-widgets') {
                                ?>
            <?php 
                                echo fetch_notice_from_url();
                                ?>
            <div class="row">
                <?php 
                                ouput_admin_widgets();
                                ?>
            </div>
            <?php 
                                return;
                                // disabled for now
                                ?>
            <div class="row">
                <div class="col-md-4">
                    <!-- Default box -->
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">Default Box (button tooltip)</h3>
                            <div class="box-tools pull-right">
                                <button class="btn btn-default btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse"><i class="fa fa-minus"></i></button>
                                <button class="btn btn-default btn-sm" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>
                            </div>
                        </div>
                        <div class="box-body">
                            Box class: <code>.box</code>
                            <p>
                                amber, microbrewery abbey hydrometer, brewpub ale lauter tun saccharification oxidized barrel.
                                berliner weisse wort chiller adjunct hydrometer alcohol aau!
                                sour/acidic sour/acidic chocolate malt ipa ipa hydrometer.
                            </p>
                        </div><!-- /.box-body -->
                        <div class="box-footer">
                            <code>.box-footer</code>
                        </div><!-- /.box-footer-->
                    </div><!-- /.box -->
                </div><!-- /.col -->

                <div class="col-md-4">
                    <!-- Primary box -->
                    <div class="box box-primary">
                        <div class="box-header" data-toggle="tooltip" title="Header tooltip">
                            <h3 class="box-title">Primary Box (header tooltip)</h3>
                            <div class="box-tools pull-right">
                                <button class="btn btn-primary btn-xs" data-widget="collapse"><i class="fa fa-minus"></i></button>
                                <button class="btn btn-primary btn-xs" data-widget="remove"><i class="fa fa-times"></i></button>
                            </div>
                        </div>
                        <div class="box-body">
                            Box class: <code>.box.box-primary</code>
                            <p>
                                amber, microbrewery abbey hydrometer, brewpub ale lauter tun saccharification oxidized barrel.
                                berliner weisse wort chiller adjunct hydrometer alcohol aau!
                                sour/acidic sour/acidic chocolate malt ipa ipa hydrometer.
                            </p>
                        </div><!-- /.box-body -->
                        <div class="box-footer">
                            <code>.box-footer</code>
                        </div><!-- /.box-footer-->
                    </div><!-- /.box -->
                </div><!-- /.col -->

                <div class="col-md-4">
                    <!-- Info box -->
                    <div class="box box-info">
                        <div class="box-header">
                            <h3 class="box-title">Info Box</h3>
                            <div class="box-tools pull-right">
                                <div class="label bg-aqua">Label</div>
                            </div>
                        </div>
                        <div class="box-body">
                            Box class: <code>.box.box-info</code>
                            <p>
                                amber, microbrewery abbey hydrometer, brewpub ale lauter tun saccharification oxidized barrel.
                                berliner weisse wort chiller adjunct hydrometer alcohol aau!
                                sour/acidic sour/acidic chocolate malt ipa ipa hydrometer.
                            </p>
                        </div><!-- /.box-body -->
                        <div class="box-footer">
                            <code>.box-footer</code>
                        </div><!-- /.box-footer-->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->

            <div class="row">
                <div class="col-md-4">
                    <!-- Danger box -->
                    <div class="box box-danger">
                        <div class="box-header">
                            <h3 class="box-title">Danger Box (Loading state)</h3>
                            <div class="box-tools pull-right">
                                <button class="btn btn-danger btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                                <button class="btn btn-danger btn-sm" data-widget="remove"><i class="fa fa-times"></i></button>
                            </div>
                        </div>
                        <div class="box-body">
                            Box class: <code>.box.box-danger</code>
                            <p>
                                amber, microbrewery abbey hydrometer, brewpub ale lauter tun saccharification oxidized barrel.
                                berliner weisse wort chiller adjunct hydrometer alcohol aau!
                                sour/acidic sour/acidic chocolate malt ipa ipa hydrometer.
                            </p>
                        </div><!-- /.box-body -->
                        <!-- Loading (remove the following to stop the loading)-->
                        <div class="overlay"></div>
                        <div class="loading-img"></div>
                        <!-- end loading -->
                    </div><!-- /.box -->
                </div><!-- /.col -->

                <div class="col-md-4">
                    <!-- Success box -->
                    <div class="box box-success">
                        <div class="box-header">
                            <h3 class="box-title">Success Box (toggle buttons)</h3>
                            <div class="box-tools pull-right">
                                <div class="btn-group" data-toggle="btn-toggle">
                                    <button type="button" class="btn btn-success btn-xs active" data-toggle="on">Left</button>
                                    <button type="button" class="btn btn-success btn-xs" data-toggle="off">Right</button>
                                </div>
                            </div>
                        </div>
                        <div class="box-body">
                            Box class: <code>.box.box-success</code>
                            <p>
                                amber, microbrewery abbey hydrometer, brewpub ale lauter tun saccharification oxidized barrel.
                                berliner weisse wort chiller adjunct hydrometer alcohol aau!
                                sour/acidic sour/acidic chocolate malt ipa ipa hydrometer.
                            </p>
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->

                <div class="col-md-4">
                    <!-- Warning box -->
                    <div class="box box-warning">
                        <div class="box-header">
                            <h3 class="box-title">Warning Box</h3>
                            <div class="box-tools pull-right">
                                <ul class="pagination pagination-sm inline">
                                    <li><a href="#">&laquo;</a></li>
                                    <li><a href="#">1</a></li>
                                    <li><a href="#">2</a></li>
                                    <li><a href="#">&raquo;</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="box-body">
                            Box class: <code>.box.box-warning</code>
                            <p>
                                amber, microbrewery abbey hydrometer, brewpub ale lauter tun saccharification oxidized barrel.
                                berliner weisse wort chiller adjunct hydrometer alcohol aau!
                                sour/acidic sour/acidic chocolate malt ipa ipa hydrometer.
                            </p>
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
            <?php 
                            } else {
                                if ($element == 'content-left-menu') {
                                    echo get_core_vars('lmenu');
                                } else {
                                    if ($element == 'headers_css') {
                                        // Including new UserBar css
                                        css_push_if_not_exists('tendoo_userbar', $instance->url->main_url() . '/tendoo-assets/css/');
                                        // Ouputing CSS and JS
                                        output('css');
                                    } else {
                                        if ($element == 'footers') {
                                        } else {
                                            if (function_exists('ouput_' . $element)) {
                                                eval('ouput_' . $element . '();');
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}