public function main() { $session = $this->container->session; if ($session->isStorageWorking()) { $this->setRedirect('index.php?view=main'); return; } parent::main(); }
public function main() { $session = ASession::getInstance(); if ($session->isStorageWorking()) { $this->setRedirect('index.php?view=main'); return; } parent::main(); }
public function main() { /** @var AngieModelMauticConfiguration $config */ $config = AModel::getAnInstance('Configuration', 'AngieModel', array(), $this->container); // These values are stored inside the session, after the setup step $old_url = $config->get('old_live_site'); $new_url = $config->get('live_site'); // If we are restoring to the same URL we don't need to replace any data if ($old_url == $new_url) { $this->setRedirect('index.php?view=finalise'); return; } parent::main(); }
/** * @param int $order_id * @param AController $that */ private function _load_releax_order_data($order_id, $that) { //data already loaded, return if ($this->r_data) { return null; } //load realex data $that->loadModel('extension/default_realex'); $this->r_data = $that->model_extension_default_realex->getRealexOrder($order_id); if (!empty($this->r_data)) { $this->r_data['total_captured'] = $that->model_extension_default_realex->getTotalCaptured($this->r_data['realex_order_id']); $this->r_data['total_formatted'] = $that->currency->format($this->r_data['total'], $this->r_data['currency_code'], 1); $this->r_data['total_captured_formatted'] = $that->currency->format($this->r_data['total_captured'], $this->r_data['currency_code'], 1); } }
public function main() { /** @var AngieModelWordpressConfiguration $config */ $config = AModel::getAnInstance('Configuration', 'AngieModel', array(), $this->container); // These values are stored inside the session, after the setup step $old_url = $config->get('oldurl'); $new_url = $config->get('homeurl'); // If we are restoring to the same URL we don't need to replace any data if ($old_url == $new_url) { $this->setRedirect('index.php?view=finalise'); return; } if ($this->input->getBool('force', false)) { $session = $this->container->session; $session->set('dataReplacements', null); } parent::main(); }
public function __construct($registry, $instance_id, $controller, $parent_controller = '') { parent::__construct($registry, $instance_id, $controller, $parent_controller); $this->attribute_manager = new AAttribute_Manager(); $this->loadLanguage('catalog/attribute'); }
public function __construct($registry, $instance_id, $controller, $parent_controller = '') { parent::__construct($registry, $instance_id, $controller, $parent_controller); //load available groups for settings $this->groups = $this->config->groups; }
/** * The main code of the Dispatcher. It spawns the necessary controller and * runs it. * * @return null * * @throws Exception */ public function dispatch() { if (!$this->onBeforeDispatch()) { // For json, don't use normal 403 page, but a json encoded message if ($this->input->get('format', '') == 'json') { echo json_encode(array('code' => '403', 'error' => $this->getError())); exit; } throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } // Get and execute the controller $defaultApp = $this->container->application->getName(); $option = $this->input->getCmd('option', $defaultApp); $view = $this->input->getCmd('view', $this->defaultView); $task = $this->input->getCmd('task', 'default'); if (empty($task)) { $task = $this->getTask($view); } $this->input->set('view', $view); $this->input->set('task', $task); $config = $this->config; $config['input'] = $this->input; $controller = AController::getTmpInstance($option, $view, $config, $this->container); $status = $controller->execute($task); if ($status === false) { throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } if (!$this->onAfterDispatch()) { throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } // Issue the redirect only if we're not in JSON format if ($this->input->getCmd('format', '') != 'json') { $controller->redirect(); } }
public function accessRules() { parent::accessRules(); return array(array('allow', 'actions' => array('index', 'detail', 'add', 'edit', 'delete'), 'roles' => array('admin', 'manager')), array('allow', 'actions' => array('index', 'detail', 'add', 'edit', 'delete'), 'roles' => array('storeadmin', 'storemanager')), array('deny', 'users' => array('*'))); }
public function __construct($registry, $instance_id, $controller, $parent_controller = '') { parent::__construct($registry, $instance_id, $controller, $parent_controller); $this->rest = new ARest(); }
public function someOptionalArgumentsAction($arg1, $arg2 = 'optionalValue') { self::$optionalValue = $arg2; self::$nonOptionalValue = $arg1; return new ModelAndView('main'); }
function __construct($config = ['autoescape' => false, 'cache' => 'cache']) { parent::__construct($config); }
public function accessRules() { parent::accessRules(); return array(array('allow', 'actions' => array('index', 'checkCode', 'listStore', 'administrator', 'detail', 'add', 'addAjax', 'edit', 'status', 'delete'), 'roles' => array('admin', 'manager')), array('allow', 'actions' => array('index', 'checkCode', 'detail', 'add', 'edit', 'delete', 'status'), 'roles' => array('storeadmin', 'storemanager')), array('deny', 'users' => array('*'))); }
function beforeAction($action) { $this->cate = Cate::model()->findByPk($this->get('cid')); return parent::beforeAction($action); }
public function __construct($id, $module = null) { parent::__construct($id, $module); $this->menu = array(); }