コード例 #1
0
 function __construct()
 {
     parent::__construct();
     // Include default library class
     include_once LIBPATH . '/Html.php';
     include_once LIBPATH . '/Enqueue.php';
     include_once LIBPATH . '/Modules.php';
     include_once LIBPATH . '/UI.php';
     include_once LIBPATH . '/SimpleFileManager.php';
     // get system lang
     $this->lang->load('system');
     // Load Modules
     Modules::load(MODULESPATH);
     // if is installed, setup is always loaded
     if ($this->setup->is_installed()) {
         /**
          * Load Session, Database and Options
          **/
         $this->load->library('session');
         $this->load->database();
         $this->load->model('options');
         // internal config
         $this->events->add_action('after_app_init', array($this, 'loader'), 2);
         // Get Active Modules and load it
         Modules::init('actives');
         $this->events->do_action('after_app_init');
     } else {
         if ($this->uri->segment(1) === 'tendoo-setup' && $this->uri->segment(2) === 'database') {
             $this->events->add_action('before_setting_tables', function () {
                 // this hook let modules being called during tendoo installation
                 // Only when site name is being defined
                 Modules::init('all');
             });
         }
     }
     // if is reserved controllers only
     if (in_array($this->uri->segment(1), $this->config->item('reserved_controllers'))) {
         $this->load->library('notice');
     }
     // Checks system status
     if (in_array($this->uri->segment(1), $this->config->item('reserved_controllers')) || $this->uri->segment(1) === null) {
         // there are some section which need tendoo to be installed. Before getting there, tendoo controller checks if for those
         // section tendoo is installed. If segment(1) returns null, it means the current section is index. Even for index,
         // installation is required
         if ((in_array($this->uri->segment(1), $this->config->item('controllers_requiring_installation')) || $this->uri->segment(1) === null) && !$this->setup->is_installed()) {
             redirect(array('tendoo-setup'));
         }
         // force user to be connected for certain controller
         if (in_array($this->uri->segment(1), $this->config->item('controllers_requiring_logout')) && $this->setup->is_installed()) {
             $this->events->do_action('is_connected');
         }
         // loading assets for reserved controller
         Enqueue::enqueue_css('bootstrap.min');
         Enqueue::enqueue_css('AdminLTE.min');
         Enqueue::enqueue_css('skins/_all-skins.min');
         Enqueue::enqueue_css('font-awesome-4.3.0');
         Enqueue::enqueue_css('../plugins/iCheck/square/blue');
         /**
          * 	Enqueueing Js
          **/
         Enqueue::enqueue_js('../plugins/jQuery/jQuery-2.1.4.min');
         Enqueue::enqueue_js('bootstrap.min');
         Enqueue::enqueue_js('../plugins/iCheck/icheck.min');
         Enqueue::enqueue_js('app.min');
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: roycefu/MIT-Mobile-Web
<?php
$docRoot = getenv("DOCUMENT_ROOT");

require_once $docRoot . "/mobi-config/mobi_web_constants.php";
require_once WEBROOT . "page_builder/page_header.php";
require_once WEBROOT . "home/Modules.php";
require_once WEBROOT . "customize/customize_lib.php";

if ($page->branch == 'Webkit') {
  $template = $page->delta_file('index', 'html');
} else {
  $template = "$page->branch/index.html";
}

Modules::init($page->branch, $page->certs, $page->platform);

// iphone can customize without reloading
if($page->delta == 'iphone') {
  $modules = Modules::$default_order;

} else {
  $modules = getModuleOrder();
  $activemodules = getActiveModules();

  // Process the various possible actions
  if($_REQUEST['action'] == 'swap') {
    $module_1 = $_REQUEST['module1'];
    $module_2 = $_REQUEST['module2'];
    $position_1 = intval($_REQUEST['position1']);
    $position_2 = intval($_REQUEST['position2']);
コード例 #3
0
ファイル: kernel.php プロジェクト: r3c130n/scriptacid
}
header('Content-Type: text/html; charset=' . CHARSET);
// Задаем свой обработич всех ошибок РНР.
ErrorHandlers::setErrorHandler();
//Debug
if (DEBUG_MODE === true) {
    require_once CORE_PATH_FULL . "/debug.php";
}
//require_once 'StaticStorageTest.php';
require_once CORE_PATH_FULL . "/session.php";
/**
 * Классы будут подключены или сразу или будут подключаться автоматически (__autoload)
 * в зависимости от константы DIRECT_LOAD_CLASSES
 * Если не определена, то false;
 */
Modules::init(DIRECT_LOAD_CLASSES);
/**
 * В режиме прямой загрузки класов
 * файлы будут подключаться сразу в вызове Modules::setAutoloadClasses()
 * Если мы имеем зависимости (extends) классов,
 * то все зависимости необходимо указать тут,
 * поскольку билиотка, в которой могут лежить зависимости,
 * инициализируется позже.
 * 
 *  В последних двух параметрах `Modules::setAutoloadClasses` 
 *  `Modules::global_set` можно не указывать. Они по дефолту им и равны. 
 */
//echo "<b>MAIN MODULE: SET AUTOLOAD CLASSES PATH LIST:</b><br />";
Modules::setAutoloadClasses(false, array("Lang" => CORE_PATH . "/lib/lib.lang.php"), true, Modules::global_set);
$DB_TYPE = strtolower(DB_TYPE);
Modules::setAutoloadClasses(false, array("Application" => CORE_PATH . "/lib/class.Application.php", "AbstractDatabase" => CORE_PATH . "/lib/lib.AbstractDatabase.php", "AbstractDBResult" => CORE_PATH . "/lib/lib.AbstractDatabase.php", "AbstractSQuery" => CORE_PATH . "/lib/lib.AbstractDatabase.php", "DatabasePostgreSQL" => CORE_PATH . "/lib/lib.postgresql.php", "DBResultPostgreSQL" => CORE_PATH . "/lib/lib.postgresql.php", "SQueryPostgreSQL" => CORE_PATH . "/lib/lib.postgresql.php", "DatabaseMySQL" => CORE_PATH . "/lib/lib.mysql.php", "DBResultMySQL" => CORE_PATH . "/lib/lib.mysql.php", "SQueryMySQL" => CORE_PATH . "/lib/lib.mysql.php", "Database" => CORE_PATH . "/lib/inc.Database." . $DB_TYPE . ".php", "DBResult" => CORE_PATH . "/lib/inc.Database." . $DB_TYPE . ".php", "SQuery" => CORE_PATH . "/lib/inc.Database." . $DB_TYPE . ".php", "Table" => CORE_PATH . "/lib/lib.visual.php"), Modules::global_set, Modules::global_set);
コード例 #4
0
ファイル: Dashboard.php プロジェクト: eboominathan/tendoo-cms
 /**
  * Module List and management controller
  *
  *
  * @access       public
  * @author       Blair Jersyer
  * @copyright    name date
  * @param        string $page
  * @param		  string $arg2
  * @since        3.0.1
  */
 function modules($page = 'list', $arg2 = null)
 {
     if ($page === 'list') {
         $this->events->add_filter('gui_page_title', function ($title) {
             return '<section class="content-header"><h1>' . strip_tags($title) . ' <a class="btn btn-primary btn-sm pull-right" href="' . site_url(array('dashboard', 'modules', 'install_zip')) . '">' . __('Upload a zip file') . '</a></h1></section>';
         });
         $this->events->add_action('displays_dashboard_errors', function () {
             if (isset($_GET['extra'])) {
                 echo tendoo_error(__('An error occured during module installation. There was a file conflict during module installation process.<br>This file seems to be already installed : ' . $_GET['extra']));
             }
         });
         $this->gui->set_title(sprintf(__('Module List &mdash; %s'), get('core_signature')));
         $this->load->view('dashboard/modules/list');
     } else {
         if ($page === 'install_zip') {
             $this->events->add_filter('gui_page_title', function ($title) {
                 return '<section class="content-header"><h1>' . strip_tags($title) . ' <a class="btn btn-primary btn-sm pull-right" href="' . site_url(array('dashboard', 'modules')) . '">' . __('Back to modules list') . '</a></h1></section>';
             });
             if (isset($_FILES['extension_zip'])) {
                 $notice = Modules::install('extension_zip');
                 // it means that module has been installed
                 if (is_array($notice)) {
                     // redirecting
                     redirect(array('dashboard', 'modules', 'list?highlight=' . $notice['namespace'] . '&notice=' . $notice['msg'] . (isset($notice['extra']) ? '&extra=' . $notice['extra'] : '') . '#module-' . $notice['namespace']));
                 } else {
                     $this->notice->push_notice($this->lang->line($notice));
                 }
             }
             $this->gui->set_title(sprintf(__('Add a new extension &mdash; %s'), get('core_signature')));
             $this->load->view('dashboard/modules/install');
         } else {
             if ($page === 'enable') {
                 /**
                  * Module should be enabled before trigger this action
                  **/
                 Modules::enable($arg2);
                 // Enabling recently active module
                 Modules::init('unique', $arg2);
                 // Run the action
                 $this->events->do_action('do_enable_module', $arg2);
                 redirect(array('dashboard', 'modules?notice=' . $this->events->apply_filters('module_activation_status', 'module-enabled')));
             } else {
                 if ($page === 'disable') {
                     $this->events->add_action('do_disable_module', function ($arg2) {
                         Modules::disable($arg2);
                     });
                     //
                     $this->events->do_action('do_disable_module', $arg2);
                     redirect(array('dashboard', 'modules?notice=' . $this->events->apply_filters('module_disabling_status', 'module-disabled')));
                 } else {
                     if ($page === 'remove') {
                         $this->events->add_action('do_remove_module', function ($arg2) {
                             Modules::uninstall($arg2);
                             redirect(array('dashboard', 'modules?notice=module-removed'));
                         });
                         $this->events->do_action('do_remove_module', $arg2);
                     } else {
                         if ($page === 'extract') {
                             $this->events->add_action('do_extract_module', function ($arg2) {
                                 Modules::extract($arg2);
                             });
                             $this->events->do_action('do_extract_module', $arg2);
                         }
                     }
                 }
             }
         }
     }
 }