Пример #1
0
 /**
  * Is being loader after active modules has been loaded
  **/
 function init()
 {
     global $Options, $User_Options;
     $Options = $this->options = $this->get(NULL, NULL, TRUE);
     // Only when aauth is enabled
     if (Modules::is_active('aauth')) {
         $User_Options = $this->user_options = $this->get(NULL, $this->events->apply_filters('user_id', 0));
     }
 }
Пример #2
0
 function loader()
 {
     if (!Modules::is_active('post_type')) {
         $this->events->add_filter('ui_notices', function ($notices) {
             $notices[] = array('msg' => __('Post Type module is not enabled...'), 'icon' => 'times', 'type' => 'warning');
             return $notices;
         });
     }
 }
Пример #3
0
 /**
  * After options init
  *
  * @return void
  **/
 function after_session_starts()
 {
     if (Modules::is_active('dashboard')) {
         // load user model
         $this->load->model('users_model', 'users');
         // If there is no master user , redirect to master user creation if current controller isn't tendoo-setup
         if (!$this->users->master_exists() && $this->uri->segment(1) !== 'tendoo-setup') {
             redirect(array('tendoo-setup', 'site'));
         }
         // force user to be connected for certain controller
         if (in_array($this->uri->segment(1), $this->config->item('controllers_requiring_login')) && $this->setup->is_installed()) {
             if (!$this->users->is_connected()) {
                 redirect(array($this->config->item('default_login_route')));
             }
         }
     }
 }
Пример #4
0
 function loader()
 {
     if (!Modules::is_active('aauth')) {
         $this->events->add_filter('ui_notices', function ($notices) {
             $notices[] = array('msg' => __('Aauth Module is required, please install or enable it'), 'type' => 'warning', 'icon' => 'users', 'href' => site_url(array('dashboard', 'modules')));
             return $notices;
         });
     }
     if (Modules::is_active('aauth')) {
         $this->load->language('blog_lang');
         // including CustomQuery.php library file
         include_once LIBPATH . '/CustomQuery.php';
         include_once dirname(__FILE__) . '/inc/setup.php';
         $this->events->add_action('load_dashboard', array($this, '__register_page'));
         // Load Post Types
         $this->events->do_action('load_post_types', 15);
     }
 }
Пример #5
0
        ?>
</h3>
         </div>
         <div class="box-body" style="height:100px;"><?php 
        echo isset($_module['application']['details']['description']) ? $_module['application']['details']['description'] : '';
        ?>
 </div>
         <div class="box-footer">
           	<?php 
        echo 'v' . (isset($_module['application']['details']['version']) ? $_module['application']['details']['version'] : 0.1);
        ?>
             <div class="box-tools pull-right">
            <?php 
        if (isset($_module['application']['details']['main'])) {
            // if the module has a main file, it can be activated
            if (!Modules::is_active($module_namespace)) {
                ?>
					  <a href="<?php 
                echo site_url(array('dashboard', 'modules', 'enable', $module_namespace));
                ?>
" class="btn btn-sm btn-default btn-box-tool" data-action="enable"><i style="font-size:20px;" class="fa fa-toggle-on"></i> Enable</a>
					<?php 
            } else {
                ?>
					  <a href="<?php 
                echo site_url(array('dashboard', 'modules', 'disable', $module_namespace));
                ?>
" class="btn btn-sm btn-default btn-box-tool" data-action="disable"><i style="font-size:20px;" class="fa fa-toggle-off"></i> Disable</a>
					<?php 
            }
        }