/** * @param string $view */ function getView($view, $args = null) { global $aecConfig; $db = JFactory::getDBO(); $user = JFactory::getUser(); $metaUser = null; if ($user->id) { $userid = $user->id; $metaUser = new metaUser($user->id); } else { $userid = aecGetParam('userid', 0, true, array('word', 'int')); $metaUser = new metaUser($userid); } $app = JFactory::getApplication(); $option = 'com_acctexp'; $dbtmpl = new configTemplate(); $dbtmpl->loadDefault(); $tmpl = $dbtmpl->template; if (!empty($dbtmpl->settings)) { $tmpl->cfg = array_merge($aecConfig->cfg, $dbtmpl->settings); } else { $tmpl->cfg = $aecConfig->cfg; } $tmpl->option = 'com_acctexp'; $tmpl->metaUser = $metaUser; if (strpos(JPATH_BASE, '/administrator')) { if (defined('JPATH_MANIFESTS')) { $query = 'SELECT `template`' . ' FROM #__template_styles' . ' WHERE `home` = 1 AND `client_id` = 0'; $db->setQuery($query); $tmpl->system_template = $db->loadResult(); } else { $query = 'SELECT `template`' . ' FROM #__templates_menu' . ' WHERE `menu_id` = 0 AND `client_id` = 0'; $db->setQuery($query); $tmpl->system_template = $db->loadResult(); } } else { $tmpl->system_template = $app->getTemplate(); } $tmpl->template = $dbtmpl->name; $tmpl->view = $view; $tmpl->paths['base'] = JPATH_SITE . '/components/com_acctexp/tmpl'; $tmpl->paths = array('default' => $tmpl->paths['base'] . '/default', 'current' => $tmpl->paths['base'] . '/' . $tmpl->template, 'site' => JPATH_SITE . '/templates/' . $tmpl->system_template . '/html/com_acctexp'); $hphp = '/' . $view . '/html.php'; $tphp = '/' . $view . '/tmpl/' . $view . '.php'; if (!empty($args)) { foreach ($args as $n => $v) { ${$n} = $v; } } if (file_exists($tmpl->paths['site'] . $hphp)) { include $tmpl->paths['site'] . $hphp; } elseif (file_exists($tmpl->paths['current'] . $hphp)) { include $tmpl->paths['current'] . $hphp; } elseif (file_exists($tmpl->paths['default'] . $hphp)) { include $tmpl->paths['default'] . $hphp; } elseif (file_exists($tmpl->paths['site'] . $tphp)) { include $tmpl->paths['site'] . $tphp; } elseif (file_exists($tmpl->paths['current'] . $tphp)) { include $tmpl->paths['current'] . $tphp; } elseif (file_exists($tmpl->paths['default'] . $tphp)) { include $tmpl->paths['default'] . $tphp; } return true; }
public function initTemplate() { // Set up new template for new installs $template = new configTemplate(); $template->loadDefault(); if (!empty($template->id)) { return; } $template->name = 'etacarinae'; $template->default = 1; $template->storeload(); }
public function save($coupon = null) { global $aecConfig; $this->confirmed = 1; $this->loadPlanObject(); $add =& $this; $exchange = $silent = null; $this->triggerMIs('before_invoice_confirm', $exchange, $add, $silent); if (empty($this->userid)) { if (!empty($aecConfig->cfg['skip_registration'])) { if (!$this->reCaptchaCheck()) { return false; } } $dbtmpl = new configTemplate(); $dbtmpl->loadDefault(); if (!empty($dbtmpl->settings['tos'])) { $tos = aecGetParam('tos', 0, true, array('bool')); if (!$tos) { $this->confirmed = 0; return $this->confirm(); } } if (!empty($this->plan)) { if (!isset($this->plan->params['override_activation'])) { $this->plan->params['override_activation'] = false; } if (!isset($this->plan->params['override_regmail'])) { $this->plan->params['override_regmail'] = false; } $this->userid = aecRegistration::saveUserRegistration($this->passthrough, false, $this->plan->params['override_activation'], $this->plan->params['override_regmail']); } else { $this->userid = aecRegistration::saveUserRegistration($this->passthrough); } if (!$this->userid) { $errors = JError::getErrors(); aecErrorAlert(JText::_('COM_USERS_REGISTRATION_SAVE_FAILED')); } } $this->loadMetaUser(true); $this->metaUser->setTempAuth(); if (!empty($this->plan)) { if ($this->verifyMIForms($this->plan) === false) { $this->confirmed = 0; return $this->confirm(); } } elseif (!empty($this->cart)) { $check = true; foreach ($this->cart as $ci) { if ($this->verifyMIForms($ci['obj']) === false) { $check = false; } } if (!$check) { $this->confirmed = 0; return $this->confirm(); } } return $this->checkout(0, null, $coupon); }