__construct() public method

Construct the (base) controller. This happens when a real controller is constructed, like in the constructor of IndexController when it says: parent::__construct();
public __construct ( )
 function __construct()
 {
     global $basePath;
     $respons = array();
     parent::__construct();
     $parts = $this->getUrlParts();
     $this->startSession();
     $this->auth($parts[3]);
     if ($parts[4] === "schema") {
         $dir = $basePath . "tmp/" . $parts[3] . "/" . $parts[5] . ".*";
         //echo $dir;
     } else {
         $dir = $basePath . "tmp/" . $parts[3] . "/" . $parts[4];
     }
     $dir = str_replace("..", "", $dir);
     //$dirReal = realpath($dir); // Do not work on *
     if ($dir) {
         exec("rm -R {$dir}");
         $respons['success'] = true;
         $respons['message'] = "Tile cache invalidated";
     } else {
         $respons['success'] = false;
         $respons['message'] = "No tile cache to invalidate.";
     }
     echo $this->toJSON($respons);
 }
示例#2
0
 public function __construct($module = null, $action = null)
 {
     parent::__construct($module, $action);
     $this->_templateobject = new TicketAttachment();
     $this->uses($this->_templateobject);
     $this->view->set('controller', 'Attachments');
 }
示例#3
0
 function __construct()
 {
     parent::__construct($this->params);
     $this->conf = Registry::getInstance();
     $this->model = new mandroid();
     $this->view = new vandroid();
 }
示例#4
0
 function __construct($Request)
 {
     parent::__construct($Request);
     $this->addActionHandler('index', 'doIndex');
     $this->addActionHandler('delete', 'doDelete');
     $this->addActionHandler('install', 'doSave');
 }
示例#5
0
 function __construct()
 {
     parent::__construct();
     // Instantiate content model
     $this->loadModel('content', false);
     $this->contentModel = new Content_Model();
 }
 function __construct()
 {
     parent::__construct();
     if (Session::get('user_login')) {
         echo '<script type="text/javascript"> window.location.replace("' . URL . 'dashboard") </script>';
     }
 }
示例#7
0
 public function __construct()
 {
     if ($this->resource_type == null) {
         throw new Exception("@todo ERROR_MISSING_RESOURCE_TYPE");
     }
     parent::__construct();
 }
示例#8
0
 public function __construct($id, $module = null)
 {
     parent::__construct($id, $module);
     if ($this->_facebook === null) {
         $this->_facebook = new Facebook(array('appId' => Yii::app()->params['fbAppId'], 'secret' => Yii::app()->params['fbAppSecret'], 'cookie' => true));
     }
 }
 public function __construct($module = null, $action = null)
 {
     parent::__construct($module, $action);
     $this->_templateobject = DataObjectFactory::Factory('ModuleComponent');
     $this->uses('ModuleDefault', false);
     $this->uses($this->_templateobject);
 }
示例#10
0
 public function __construct()
 {
     parent::__construct();
     Config::set('auth.driver', 'adminauth');
     Asset::add('bootstrap', 'bundles/adminify/css/bootstrap.min.css');
     Asset::add('style', 'bundles/adminify/css/style.css');
 }
示例#11
0
 public function __construct($request = null, $response = null)
 {
     if (CAKEAPP_ENV == 'development') {
         $this->components['DebugKit.Toolbar'] = array();
     }
     parent::__construct($request, $response);
 }
示例#12
0
 public function __construct($request, $response)
 {
     /*{{{*/
     parent::__construct($request, $response);
     $clients = array('auditorClient', 'threadCateClient', 'userClient', 'spaceClient', 'doctorClient', 'hospitalClient', 'hospitalFacultyClient', 'PatientClient', 'DoctorPatientPostClient', 'inspectClient');
     foreach ($clients as $client) {
         $this->{$client} = new ClientProxy($client);
     }
     $userId = UserClient::getInstance()->getCheckedSeed('id');
     if ($userId) {
         $this->curUser = DAL::get()->find('user', $userId);
     } else {
         $this->curUser = new NullEntity();
     }
     $response->curUser = $this->curUser;
     $response->staticUrl = 'http://i1.hdfimg.com/in/case';
     $response->leftWidth = '40%';
     //$response->leftWidth = '43%';
     $response->controller = $request->controller;
     $response->action = $request->action;
     $response->showContent = $request->showContent;
     $this->user = $response->user;
     $this->curInspector = $response->curInspector;
     $this->auditor = $response->auditor;
     if (false == $this->auditor instanceof Auditor) {
         $auditor = $this->curInspector->getAuditorEntity4auditfront();
         $this->auditor = $auditor;
     }
     $response->args = array();
     $response->isAjax = $request->ajax_status;
 }
 public function __construct()
 {
     parent::__construct();
     if (isset($_GET['f']) and !empty($_GET['f']) and $_GET['f'] != 'show' and $_GET['f'] != 'showOneGroup' and $_GET['f'] != 'showOneTeacher' and $_GET['f'] != 'showOneRoom' and $_GET['f'] != 'checkTitle' and $_GET['f'] != 'checkTeachers' and $_GET['f'] != 'checkRoom' and $_GET['f'] != 'create_comm' and $_GET['f'] != 'create_comm_teacher' and $_GET['f'] != 'check_create_comm' and $_GET['f'] != 'heck_create_comm_teacher' and $_GET['f'] != 'delete') {
         header("Location: " . URL . '?c=showTimeTable&f=show');
     }
 }
示例#14
0
 public function __construct($registry)
 {
     parent::__construct($registry);
     Journal2DBUpgrade::check();
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->data['base'] = HTTPS_CATALOG;
     } else {
         $this->data['base'] = HTTP_CATALOG;
     }
     $this->data['base_href'] = $this->url->link('module/journal2', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['export_href'] = $this->url->link('module/journal2/rest/data/export', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['import_href'] = $this->url->link('tool/backup', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['export_csv'] = $this->url->link('module/journal2/rest/newsletter/export_csv', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['transition_gallery_href'] = $this->url->link('module/journal2/transition_gallery', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['journal2_config'] = array();
     $this->data['journal2_config']['token'] = $this->session->data['token'];
     $this->data['journal2_config']['version'] = defined('JOURNAL_VERSION') ? JOURNAL_VERSION : null;
     $this->data['journal2_config']['user_id'] = $this->user->getId();
     $this->data['journal2_config']['items_per_page'] = 20;
     if (!property_exists('Front', 'IS_OC2')) {
         echo '
             <h3>Journal Installation Error</h3>
             <p>Make sure you have uploaded all Journal files to your server and successfully replaced <b>system/engine/front.php</b> file.</p>
             <p>You can find more information <a href="http://docs.digital-atelier.com/opencart/journal/#/settings/install" target="_blank">here</a>.</p>
         ';
         exit;
     }
     $this->data['journal2_config']['oc2'] = Front::$IS_OC2;
 }
示例#15
0
 public function __construct($id, $module = null)
 {
     if (Yii::app()->request->isAjaxRequest) {
         $this->layout = false;
     }
     parent::__construct($id, $module);
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Admin") {
         $this->template = new Template();
         $this->signatorialList_model = new SignatorialList_Model();
         $this->department_model = new Department_Model();
         $this->template->setPageName('Signatorial List for Graduate');
         $this->template->set_username(Session::get_user());
         $this->template->set_surname(Session::get_Surname());
         $this->template->set_firstname(Session::get_Firstname());
         $this->template->set_middlename(Session::get_Middlename());
         $this->template->set_account_type(Session::get_Account_type());
         $this->template->assign('Dept_name', Session::get_DepartmentName());
         $this->template->assign('Dept_desc', $this->department_model->getDescription(Session::get_DepartmentName()));
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('signatorialList.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->assign('assign_sign', '');
         $filename = "../Excel_File/student_current_enroll.xls";
         if (file_exists($filename)) {
             $this->template->assign('excel_file', 'true');
         }
         $this->displayTable('', 1, "default");
     } else {
         header('Location: ' . HOST);
     }
 }
示例#17
0
文件: fetch.php 项目: eagle/my-git
 public function __construct()
 {
     parent::__construct();
     // This must be included
     $this->session = Session::instance();
     $this->profiler = new Profiler();
 }
示例#18
0
 function __construct()
 {
     Session::init();
     Session::set('active', "services");
     Session::set('title', "Услуги");
     parent::__construct();
 }
示例#19
0
 function __construct()
 {
     parent::__construct();
     Document::setTitle('Giới thiệu');
     Document::setCss(array('style'));
     $this->view->setLayout('main_layout');
 }
示例#20
0
 function __construct()
 {
     parent::__construct();
     $this->view->setLayout('main_layout');
     Document::setCss(array('style'));
     Document::setJs(array('article'));
 }
示例#21
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->load->model('Users_model');
     $this->load->model('Menu_model');
     $this->Menu_model->set_menu_active_item('admin_menu', 'users_menu_item');
 }
示例#22
0
 function __construct($params = null)
 {
     parent::__construct($params);
     $this->conf = Registry::getInstance();
     $this->model = new mUser();
     $this->view = new vUser();
 }
示例#23
0
 function __construct($params)
 {
     parent::__construct($params);
     $this->model = new mAnuncio();
     $this->view = new vAnuncio();
     //echo 'Hello controller!';
 }
示例#24
0
 /**
  * @param Request $request: an instance of the request
  * @param API $api: an api wrapper instance
  */
 public function __construct($api, $request)
 {
     parent::__construct($api, $request);
     // this will set the current navigation entry of the app, use this only
     // for normal HTML requests and not for AJAX requests
     $this->api->activateNavigationEntry();
 }
示例#25
0
 public function __construct()
 {
     parent::__construct();
     # initialize the auth controller
     $this->req_id = isset($this->req_id) ? $this->req_id : '';
     $this->_model = new Auth_LDAP();
 }
示例#26
0
 public function __construct()
 {
     parent::__construct();
     if (isset($this->session->user)) {
         header("Location:" . Router::url("connexion", "disconnect"));
     }
 }
示例#27
0
 public function __construct()
 {
     parent::__construct();
     $this->model = Report_Model::instance();
     $this->privacys = array(1 => '所有好友可见', 3 => '仅自己可见', 5 => '仅指定群可见');
     //$this->user_id = 10614401;
 }
 function __construct()
 {
     parent::__construct();
     if (Session::get("logged_in")) {
         header("Location: " . URL . "index");
     }
 }
示例#29
0
 public function __construct()
 {
     parent::__construct();
     $this->_view->setTemplate('sigace');
     $this->_view->setWidgetOptions('menu-top', array('top', 'top', true));
     $this->_post = $this->loadModel('post');
 }