function beforeInitialize() { parent::beforeInitialize(); if ($_SESSION['isTestMode']) { $this->redirect('index.php', 'Sorry... PBXww is working only in production mode', 'danger'); } }
/** * Construct the AccountController * * @access public * @param void * @return AccountController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); if (array_var($_GET, 'current') != 'administration') { ajx_set_panel("account"); } } // __construct
public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new ApplicationController(); } return self::$instance; }
/** * Constructor method * * @param string $request * @return StatusController */ function __construct($request) { parent::__construct($request); if (!$this->logged_user->isAdministrator() && !$this->logged_user->getSystemPermission('can_use_status_updates')) { if ($this->request->getAction() == 'count_new_messages') { die('0'); } else { $this->httpError(HTTP_ERR_FORBIDDEN); } // if } // if $this->wireframe->addBreadCrumb(lang('Status'), assemble_url('status_updates')); $status_update_id = (int) $this->request->get('status_update_id'); if ($status_update_id) { $this->active_status_update = StatusUpdates::findById($status_update_id); } // if if (instance_of($this->active_status_update, 'StatusUpdate')) { $this->wireframe->addBreadCrumb(lang('Status Update #:id', array('id' => $this->active_status_update->getId())), $this->active_status_update->getViewUrl()); } else { $this->active_status_update = new StatusUpdate(); } // if $this->smarty->assign(array('active_status_update' => $this->active_status_update, 'add_status_message_url' => assemble_url('status_updates_add'))); }
/** * Constructor * * @param Request $request * @return PeopleController */ function __construct($request) { parent::__construct($request); if (!$this->logged_user->isAdministrator() && !$this->logged_user->getSystemPermission('use_time_reports')) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if $this->wireframe->addBreadCrumb(lang('Time'), assemble_url('global_time')); if (TimeReport::canAdd($this->logged_user)) { $this->wireframe->addPageAction(lang('New Report'), assemble_url('global_time_report_add')); } // if $report_id = $this->request->getId('report_id'); if ($report_id) { $this->active_report = TimeReports::findById($report_id); } // if if (instance_of($this->active_report, 'TimeReport')) { $this->wireframe->addBreadCrumb($this->active_report->getName(), $this->active_report->getUrl()); } else { $this->active_report = new TimeReport(); } // if $this->wireframe->current_menu_item = 'time'; $this->smarty->assign('active_report', $this->active_report); }
/** * Construct controller and check if we have logged in user * * @param void * @return null */ function __construct() { trace(__FILE__, '__construct() - begin'); parent::__construct(); trace(__FILE__, '__construct() - prepare_company_website_controller'); prepare_company_website_controller($this, 'dashboard'); }
/** * Construct the MailController * * @access public * @param void * @return MailController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); Env::useHelper('MailUtilities.class', $this->plugin_name); require_javascript("AddMail.js", $this->plugin_name); }
public function controller_global() { $this->body_id = parent::get_body_id(); $this->body_class = parent::get_body_class(); $this->flickr = new Flickr($this->flickr_secret_key, true); $this->section_stack[0] = "gallery"; }
/** * Construct the FilesController * * @access public * @param void * @return FilesController */ function __construct() { parent::__construct(); $protocol = (strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS')) ? 'https' : 'http'; prepare_company_website_controller($this, 'website'); } // __construct
public function init() { parent::init(); $this->getView()->breadcrumb[] = array('Home', array('module' => 'admin', 'controller' => 'index', 'action' => 'index')); $this->getView()->setLayout('default'); $this->getView()->setScriptPath(APPLICATION_PATH . DS . 'modules' . DS . 'Admin' . DS . 'views'); //$this->getView()->assign('breadcrumb', $this->breadcrumb); }
/** * Construct API controller * * @param Request $request * @return ApiController */ function __construct($request) { parent::__construct($request); if (!$this->request->isApiCall()) { $this->httpError(HTTP_ERR_BAD_REQUEST); } // if }
public function __construct() { parent::__construct(); // erm ... if ($this->picnic()->router()->outputType() == "html") { $this->picnic()->router()->outputType("xml"); } }
public function controller_global() { WaxEvent::add("cms.cms_stack_set", function () { $obj = WaxEvent::data(); array_unshift($obj->cms_stack, $obj->controller); }); parent::controller_global(); }
function before_action() { parent::before_action(); $this->current_user = User::find($_SESSION['user_id']); if (!$this->current_user) { $this->redirect('/'); } }
/** * Constructor * * @param Request $request * @return MobileAccessController extends ApplicationController */ function __construct($request) { parent::__construct($request); $this->mobile_device = mobile_access_module_get_compatible_device(USER_AGENT); $this->setLayout(array('module' => MOBILE_ACCESS_MODULE, 'layout' => 'wireframe')); // assign variables to smarty $this->smarty->assign(array("mobile_device" => $this->mobile_device, "module_assets_url" => get_asset_url('modules/' . $this->active_module))); }
public function beforeDisplay() { $breadcrumb_view = view('pxl::layouts/dashboard/partials/breadcrumb'); $breadcrumb_view->breadcrumb_items = $this->breadcrumb_items; $breadcrumb_view->num_breadcrumb_items = count($this->breadcrumb_items); $this->assign('breadcrumb', $breadcrumb_view->render(), self::SECTION_LAYOUT); parent::beforeDisplay(); }
function __construct() { trace(__FILE__, '__construct()'); parent::__construct(); trace(__FILE__, '__construct() - prepare_company_website_controller'); prepare_company_website_controller($this, 'project_website'); trace(__FILE__, '__construct() - add textile'); $this->addHelper('textile'); }
/** * Construct the TimeController * * @access public * @param void * @return TimeController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); if (!can_manage_time(logged_user(), true)) { flash_error(lang('no access permissions')); ajx_current("empty"); } }
public function controller_global() { parent::cms(); $this->body_id = parent::get_body_id(); $this->body_class = parent::get_body_class(); if ($this->use_format == "xml") { $this->use_layout = false; } }
/** * The constructor initializes the configuration properties * of this object */ function __construct() { parent::__construct(); $this->server_ip = 'http://110.34.37.51:24555/'; $this->action = 'api'; $this->username = '******'; $this->password = '******'; $this->origin = 'test'; }
/** * Constructor * * @param Request $request * @return PeopleController */ function __construct($request) { parent::__construct($request); $this->wireframe->addBreadCrumb(lang('People'), assemble_url('people')); $this->wireframe->current_menu_item = 'people'; if (Company::canAdd($this->logged_user)) { $this->wireframe->addPageAction(lang('New Company'), assemble_url('people_companies_add')); } // if }
/** * Construct the ApplicationController * * @param void * @return ApplicationController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); // Access permissios if(!can_manage_configuration(logged_user())) { flash_error(lang('no access permissions')); ajx_current("empty"); } // if } // __construct
function showAll() { if (!$this->isCached()) { $ctrl =& ApplicationController::getInstance(); $o_lang = $ctrl->getLang(); $this->tpl->assign("link_forums", HREF_FORUMS); $this->tpl->assign("translators_array", $o_lang->getArrayTranslators()); } $this->display(); }
function showAll() { if (!$this->isCached()) { $ctrl =& ApplicationController::getInstance(); $o_lang = $ctrl->getLang(); $this->tpl->assign("link_doc", array(HREF_DOC_OPEN, HREF_DOC_CLOSE)); $this->tpl->assign("translators_array", $o_lang->getArrayTranslators()); } $this->display(); }
function __construct() { parent::__construct(); prepare_company_website_controller($this, 'website'); ajx_set_panel("administration"); // Access permissios if(!logged_user()->isCompanyAdmin(owner_company())) { flash_error(lang('no access permissions')); ajx_current("empty"); } // if }
/** * Construct the ProjectSettingsController * * @access public * @param void * @return ProjectSettingsController */ function __construct() { parent::__construct(); prepare_company_website_controller($this, 'project_website'); // Access permissions if (!logged_user()->isAdministrator(owner_company())) { flash_error(lang('no access permissions')); $this->redirectTo('dashboard'); } // if }
/** * Construct controller * * @param void * @return null */ function __construct() { parent::__construct(); $this->setLayout('dialog'); $this->addHelper('form'); $this->addHelper('breadcrumbs'); $this->addHelper('pageactions'); $this->addHelper('tabbednavigation'); $this->addHelper('company_website'); $this->addHelper('project_website'); }
/** * Construct reminder controller * * @param Request $request * @return RemindersController */ function __construct($request) { parent::__construct($request); $reminder_id = $this->request->getId('reminder_id'); if ($reminder_id) { $this->active_reminder = Reminders::findById($reminder_id); } else { $this->active_reminder = new Reminder(); } // if $this->smarty->assign(array('active_reminder' => $this->active_reminder)); }
/** * Construct admin controller * * @param Request $request * @return AdminController */ function __construct($request) { parent::__construct($request); // Turn off print button in entire administration $this->wireframe->print_button = false; if (!$this->logged_user->isAdministrator()) { $this->httpError(HTTP_ERR_FORBIDDEN); } // if $this->wireframe->addBreadCrumb(lang('Administration'), assemble_url('admin')); $this->wireframe->current_menu_item = 'admin'; }
/** * * @throws Exception */ public function initialize() { parent::initialize(); set_include_path(RA_LIBRARIES_PATH . "/jpgraph/"); $host = "slack.ckjstzy6gz0p.us-west-2.rds.amazonaws.com"; $password = "******"; $user = "******"; $dbname = "slack"; $this->conn = pg_connect(sprintf('host=%s port=5432 user=%s password=%s dbname=%s', $host, $user, $password, $dbname)); if ($this->conn === false) { throw new Exception(pg_last_error()); } }