/** * * @param String $idAba Parametro responsável pela identificação do conjunto de abas * @param Array $aba contem um array que vai identificar o lobel da aba, a página que vai ser carregada na aba e o link caso a requisição seja ajax * @param int $abaAtiva Identifica a aba que está ativa * @param string $paginaAba Identifica a página que vai ser carregada na aba * @param MY_Loader $load Objeto responsável por carregar as páginas '$this->load' * @return string retorna o html das abas. * * Esse método tem a função de retornar um conjunto de abas para a visão. */ public function getAba($idAba, $aba = array(), $abaAtiva = 1, $paginaAba = '', $load) { if (empty($aba)) { return ''; } $i = 1; $str = '<div id="' . $idAba . '" class="aba"><ul class="linkAba">'; foreach ($aba as $key => $value) { $str .= ' <li class="' . ($abaAtiva == $i ? 'linkAbaAtivo' : 'linkAbaInativo') . '"><a data-conteudo="aba' . $i . '" ' . (isset($value['href']) && $value['href'] != '' ? 'href="' . $value['href'] . '"' : 'href="#"') . '>' . $value['label'] . '</a></li> '; $i++; } $str .= '</ul>'; $i = 1; foreach ($aba as $key => $value) { $str .= ' <div class="conteudoAba"> <div class="conteudo_aba' . $i . ' ' . ($abaAtiva == $i ? 'conteudoAtivo' : 'conteudoInativo') . '"> ' . $load->view($paginaAba != '' && $abaAtiva == $i ? $paginaAba : $value['pagina'], '', true) . ' </div> </div> '; $i++; } $str .= '</div>'; return $str; }
public function __construct() { parent::__construct(); self::$APP = get_instance(); self::$APP->config = new MX_Config(); self::$APP->lang = new MX_Language(); $this->_module = self::$APP->router->fetch_module(); }
function __construct() { parent::__construct(); $this->load->helper('ssl'); // we are in the frontend define("_FRONTEND", "TRUE"); // set current theme $this->config->set_item('current_theme', setting('theme')); // load Smarty template engine and configure it $this->load->library('smarty'); $this->smarty->initialize(); // init hooks $this->load->library('app_hooks'); // load all modules with control panel to build navigation, etc. $modules = $this->module_model->get_module_folders(); // first, reset module definitions so that we run them all as a "frontend" call and their preloads get called $this->module_definitions = new stdClass(); foreach ($modules as $module) { MY_Loader::define_module($module . '/'); } // load caching for the frontend $this->load->driver('cache'); // if we don't have a theme, we'll setup the default theme // we do it after Smarty because some module definitions reference the Smarty library // we won't do this if it's a cron load though - that's too awkward if ($this->uri->segment(1) != 'cron' and setting('theme') == FALSE and setting('default_theme')) { $this->settings_model->update_setting('theme', setting('default_theme')); // install the default theme $install_file = FCPATH . 'themes/' . setting('default_theme') . '/install.php'; if (file_exists($install_file)) { include $install_file; } // redirect to home page redirect('/'); die; } }
/** * Load View * * This function is used to load a "view" file. It has three parameters: * * 1. The name of the "view" file to be included. * 2. An associative array of data to be extracted for use in the view. * 3. TRUE/FALSE - whether to return the data or load it. In * some cases it's advantageous to be able to return data so that * a developer can process it in some way. * * @param string * @param array * @param bool * @return void */ public function view($view, $vars = array(), $return = FALSE) { if ($return === TRUE) { return parent::view($view, $vars, $return); } $output = $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => TRUE)); $CI =& get_instance(); $CI->output->add_output($output); }
function __construct() { parent::__construct(); // by defining _CONTROLPANEL, certain functionality can be modified to be appropriate to this context define("_CONTROLPANEL", "TRUE"); // load the SSL helper, and redirect to HTTPS if necessary (or to HTTP) $this->load->helper('ssl'); // load notices library (display success/error messages at top of screen) $this->load->library('notices'); $this->load->helper('admincp/get_notices'); // are they logged in? and an administrator? if ($this->user_model->logged_in() and !$this->user_model->is_admin()) { $this->notices->SetError('You are logged in but do not have control panel privileges.'); redirect(site_url('admincp/login')); die; } elseif (!$this->user_model->logged_in() and $this->router->fetch_class() != 'login') { redirect(site_url('admincp/login')); die; } // store dynamically-generated navigation $this->load->library('admin_navigation'); // add basic navigation categories $this->admin_navigation->parent_link('dashboard', 'Dashboard'); $this->admin_navigation->parent_link('publish', 'Publish'); if (module_installed('store') or module_installed('billing') or module_installed('coupons')) { $this->admin_navigation->parent_link('storefront', 'Storefront'); } $this->admin_navigation->parent_link('members', 'Members'); $this->admin_navigation->parent_link('reports', 'Reports'); $this->admin_navigation->parent_link('design', 'Design'); $this->admin_navigation->parent_link('configuration', 'Configuration'); $this->admin_navigation->child_link('dashboard', 1, 'Dashboard', site_url('admincp')); // admin-specific loading $this->load->helper('admincp/dataset_link'); $this->load->helper('directory'); $this->load->helper('form'); $this->load->helper('admincp/admin_link'); // load assets library (include stylesheets and javascript files dynamically) $this->load->library('head_assets'); // load caching library $this->load->driver('cache'); // init hooks $this->load->library('app_hooks'); // load all modules with control panel to build navigation, etc. $modules = $this->module_model->get_module_folders(); // first, reset module definitions so that we run them all as a "backend" call and their preloads get called $this->module_definitions = new stdClass(); foreach ($modules as $module) { MY_Loader::define_module($module . '/'); } // define WYSIWYG session variables for file uploading @session_start(); $_SESSION['KCFINDER'] = array(); $_SESSION['KCFINDER']['disabled'] = FALSE; // Safari base_href fix $url = parse_url(base_url()); $this->load->library('user_agent'); // if they are using Safari and don't have Hero installed in a sub-folder, this prefix "/" fixes the problem if (stripos($this->agent->browser(), 'safari') !== FALSE and trim($url['path'], '/') == '') { $prefix = '/'; } else { $prefix = ''; } $_SESSION['KCFINDER']['uploadURL'] = $prefix . str_replace(FCPATH, '', setting('path_editor_uploads')); $_SESSION['KCFINDER']['uploadDir'] = rtrim(setting('path_editor_uploads'), '/'); // check cronjob is active! if (setting('cron_last_update') == FALSE or time() - strtotime(setting('cron_last_update')) > 60 * 60 * 24) { $this->notices->SetError('WARNING! Your cronjob is not running properly. <a href="' . site_url('admincp/reports/cronjob') . '">Click here for details</a>'); } }