Пример #1
0
 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Authenticate the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     // Redirect to the install tool
     if (!Config::getInstance()->isComplete()) {
         $this->redirect('install.php');
     }
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     // Password change required
     if ($this->User->pwChange) {
         $objSession = $this->Database->prepare("SELECT su FROM tl_session WHERE sessionID=? AND pid=?")->execute(session_id(), $this->User->id);
         if (!$objSession->su) {
             $this->redirect('contao/password.php');
         }
     }
     // Front end redirect
     if (Input::get('do') == 'feRedirect') {
         $this->redirectToFrontendPage(Input::get('page'), Input::get('article'));
     }
     // Safe mode off
     if (Input::get('smo') && $this->User->isAdmin) {
         $this->Config->update("\$GLOBALS['TL_CONFIG']['coreOnlyMode']", false);
         $this->redirect($this->getReferer());
     }
     $this->loadLanguageFile('default');
     $this->loadLanguageFile('modules');
 }
 public function __construct()
 {
     parent::__construct();
     $this->loadLanguageFile("tl_settings");
     $this->import('BackendUser', 'User');
     $this->import('Environment');
 }
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->import('AvisotaBase', 'Base');
     $this->import('AvisotaNewsletterContent', 'Content');
     $this->import('AvisotaStatic', 'Static');
     $this->import('Database');
     // force all URLs absolute
     $GLOBALS['TL_CONFIG']['forceAbsoluteDomainLink'] = true;
     // load default translations
     $this->loadLanguageFile('default');
     // HOTFIX Remove isotope frontend hook
     if (isset($GLOBALS['TL_HOOKS']['parseTemplate']) && is_array($GLOBALS['TL_HOOKS']['parseTemplate'])) {
         foreach ($GLOBALS['TL_HOOKS']['parseTemplate'] as $k => $v) {
             if ($v[0] == 'IsotopeFrontend') {
                 unset($GLOBALS['TL_HOOKS']['parseTemplate'][$k]);
             }
         }
     }
     // HOTFIX Remove catalog frontend hook
     if (isset($GLOBALS['TL_HOOKS']['parseFrontendTemplate']) && is_array($GLOBALS['TL_HOOKS']['parseFrontendTemplate'])) {
         foreach ($GLOBALS['TL_HOOKS']['parseFrontendTemplate'] as $k => $v) {
             if ($v[0] == 'CatalogExt') {
                 unset($GLOBALS['TL_HOOKS']['parseFrontendTemplate'][$k]);
             }
         }
     }
 }
 /**
  * Import the back end user object
  */
 public function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
     $this->loadLanguageFile('orm_avisota_recipient');
     $this->loadDataContainer('orm_avisota_recipient');
 }
Пример #5
0
	/**
	 * Import String library
	 */
	public function __construct()
	{
		parent::__construct();

		$this->import('String');
		$this->import('Files');
	}
Пример #6
0
 public function __construct()
 {
     parent::__construct();
     $category_config = array('table' => $this->table_categories, 'field_id' => 'category_id', 'field_title' => 'category_name', 'field_slug' => 'category_slug');
     $this->load->library('slug');
     $this->slug->set_config($category_config);
 }
Пример #7
0
 /**
  * Constructor
  */
 public function __construct()
 {
     // Import
     $this->import("BackendUser");
     $this->import("String");
     // Parent
     parent::__construct();
     // Language
     $this->loadLanguageFile("default");
     $this->loadLanguageFile('tl_synccto_clients');
     // Instance a list for regex from the blacklist for folders.
     $this->arrPreparedBlacklistFolder = array();
     foreach ($this->getBlacklistFolder() as $key => $value) {
         $this->arrPreparedBlacklistFolder[$key] = str_replace($this->arrSearch, $this->arrReplace, $value);
     }
     // Instance a list for regex from the blacklist for files.
     $this->arrPreparedBlacklistFiles = array();
     foreach ($this->getBlacklistFile() as $key => $value) {
         $this->arrPreparedBlacklistFiles[$key] = str_replace($this->arrSearch, $this->arrReplace, $value);
     }
     // Instance a list for regex from the hidden table list.
     $this->arrPreparedHiddenTablePlaceholder = array();
     foreach ($this->getHiddenTablePlaceholder() as $key => $value) {
         $this->arrPreparedHiddenTablePlaceholder[$key] = str_replace($this->arrSearch, $this->arrReplace, $value);
     }
     // Replace some elements in TL_ROOT for regex.
     $this->strPreparedTlRoot = str_replace('\\', '\\\\', TL_ROOT);
 }
Пример #8
0
 public function __construct()
 {
     parent::__construct();
     $page_config = array('table' => $this->table_pages, 'field_id' => 'page_id', 'field_title' => 'page_title', 'field_slug' => 'page_slug');
     $this->load->library('slug');
     $this->slug->set_config($page_config);
 }
 public function __construct($objModel)
 {
     if ($objModel instanceof \Model) {
         $this->objModel = $objModel;
     } elseif ($objModel instanceof \Model\Collection) {
         $this->objModel = $objModel->current();
     }
     parent::__construct();
     if ($objModel->purgeBeforeImport && !$this->dryRun) {
         $this->purgeBeforeImport($objModel);
     }
     $this->arrData = $objModel->row();
     $this->objParentModel = EntityImportModel::findByPk($this->objModel->pid);
     $this->Database = Database::getInstance($this->objParentModel->row());
     $this->arrDbSourceFields = $this->Database->listFields($this->dbSourceTable);
     $this->arrDbTargetFields = \Database::getInstance()->listFields($this->dbTargetTable);
     $this->arrDbFileFields = \Database::getInstance()->listFields('tl_files');
     $this->arrMapping = $this->getFieldsMapping(deserialize($this->dbFieldMapping, true), $this->arrDbSourceFields, $this->arrDbTargetFields);
     $this->arrFileMapping = $this->getFieldsMapping(deserialize($this->dbFieldFileMapping, true), $this->arrDbSourceFields, $this->arrDbFileFields);
     $arrNamedMapping = $this->arrMapping;
     // name fields
     array_walk($arrNamedMapping, function (&$value, $index) {
         $value = $value . ' as ' . $index;
     });
     $this->arrNamedMapping = $arrNamedMapping;
 }
 public function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
     $this->loadLanguageFile('tl_subscribe_plus');
     $this->loadDataContainer('tl_subscribe_plus');
 }
Пример #11
0
 /**
  * Construct.
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 public function __construct()
 {
     parent::__construct();
     $this->eventDispatcher = $GLOBALS['container']['event-dispatcher'];
     $this->typeManager = $GLOBALS['container']['bootstrap.config-type-manager'];
     $this->loadLanguageFile('bootstrap_config_types');
 }
Пример #12
0
 /**
  * Add the mooRainbow scripts to the page
  */
 public function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
     $GLOBALS['TL_CSS'][] = 'plugins/mootools/rainbow.css?' . MOO_RAINBOW . '|screen';
     $GLOBALS['TL_JAVASCRIPT'][] = 'plugins/mootools/rainbow.js?' . MOO_RAINBOW;
 }
 /**
  * Construct.
  */
 public function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
     $this->languageEditor = LanguageEditor::getInstance();
     $this->loadTranslationKeys();
 }
Пример #14
0
 /**
  * Initialize the controller
  *
  * 1. Import the user
  * 2. Call the parent constructor
  * 3. Authenticate the user
  * 4. Load the language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     $this->loadLanguageFile('default');
 }
Пример #15
0
 /**
  * AbstractWebRunner constructor.
  */
 public function __construct()
 {
     // preserve object initialisation order
     \BackendUser::getInstance();
     \Database::getInstance();
     parent::__construct();
 }
 /**
  * Import CSS and script for the color picker component
  */
 public function __construct()
 {
     parent::__construct();
     if (version_compare(VERSION, '2.11', '<')) {
         $GLOBALS['TL_CSS'][] = 'plugins/mootools/rainbow.css?' . MOO_RAINBOW . '|screen';
         $GLOBALS['TL_JAVASCRIPT'][] = 'plugins/mootools/rainbow.js?' . MOO_RAINBOW;
     }
 }
 /**
  * Initialize the controller.
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     // load default translations
     $this->loadLanguageFile('default');
     $this->loadLanguageFile('avisotaCompatibilityController');
 }
Пример #18
0
 /**
  * Initialize the controller.
  *
  * The workflow is:
  * 1. Import user.
  * 2. Call parent constructor
  * 3. Authenticate user
  * 4. Load language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->User = \BackendUser::getInstance();
     parent::__construct();
     $this->User->authenticate();
     $this->loadLanguageFile('default');
     $this->loadLanguageFile('modules');
 }
Пример #19
0
 public function __construct()
 {
     parent::__construct();
     if ($_POST['saveNcreate'] && $this->Input->post('FORM_SUBMIT') && $this->Input->post('SUBMIT_TYPE') != 'auto' && !$_SESSION['export_table']) {
         unset($_POST['saveNcreate']);
         $this->initExport();
     }
 }
Пример #20
0
 /**
  * Prevent constructing the object (Singleton)
  */
 protected function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
     $this->_objDatabase = ClipboardDatabase::getInstance();
     $this->_objString = String::getInstance();
     $this->_setPageType();
 }
Пример #21
0
 /**
  * Get the current action
  * @throws Exception
  */
 public function __construct($strAction)
 {
     if (!$strAction) {
         throw new Exception('Missing Ajax action');
     }
     $this->strAction = $strAction;
     parent::__construct();
 }
Пример #22
0
 /**
  * Initialize the controller
  *
  * 1. Import user
  * 2. Call parent constructor
  * 3. Authenticate user
  * 4. Load language files
  * DO NOT CHANGE THIS ORDER!
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->User->authenticate();
     $this->loadLanguageFile('default');
     $this->strFile = preg_replace('@^/+@', '', str_replace('%20', ' ', $this->Input->get('src', true)));
 }
 public function __construct()
 {
     parent::__construct();
     if (isset($_POST['saveNcreate']) && $this->Input->post('FORM_SUBMIT') && $this->Input->post('SUBMIT_TYPE') != 'auto' && !$_SESSION['import_from_csv']) {
         unset($_POST['saveNcreate']);
         $this->initImport();
     }
 }
Пример #24
0
 public function __construct()
 {
     parent::__construct();
     $this->loadDataContainer('tl_form_field');
     $this->import('FormData');
     // Types of form fields with storable data
     $this->arrFFstorable = $this->FormData->arrFFstorable;
 }
Пример #25
0
 /**
  * Initialize the object
  */
 public function __construct()
 {
     \BackendUser::getInstance()->authenticate();
     parent::__construct();
     $this->loadLanguageFile('default');
     $this->objSyncCtoHelper = SyncCtoHelper::getInstance();
     $this->initGetParams();
 }
Пример #26
0
 protected function __construct()
 {
     parent::__construct();
     $this->strFileDebug = "system/tmp/CtoComDebug.txt";
     $this->strFileMeasurement = "system/tmp/CtoComMeasurement.txt";
     $this->booDebug = false;
     $this->booMeasurement = false;
 }
Пример #27
0
 public function __construct()
 {
     parent::__construct();
     $this->import('DomainLink');
     $this->import('BackendUser', 'User');
     $this->import('AvisotaBase', 'Base');
     $this->loadLanguageFile('orm_avisota_message');
 }
 public function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
     $this->import('Files');
     //relativer Pfad zum Upload-Dir fuer safe-mode-hack
     $this->uploadPath = GALLERY_CREATOR_UPLOAD_PATH;
     //parse Backend Template Hook registrieren
     $GLOBALS['TL_HOOKS']['parseBackendTemplate'][] = array('tl_gallery_creator_pictures', 'myParseBackendTemplate');
     // set the referer when redirecting from import files from the filesystem
     if (\Input::get('filesImported')) {
         $this->import('Session');
         $session = $this->Session->get('referer');
         $session[TL_REFERER_ID]['current'] = 'contao/main.php?do=gallery_creator';
         $this->Session->set('referer', $session);
     }
     switch (Input::get('mode')) {
         case 'imagerotate':
             $objPic = GalleryCreatorPicturesModel::findById(Input::get('imgId'));
             $objFile = FilesModel::findByUuid($objPic->uuid);
             if ($objFile !== null) {
                 // Rotate image anticlockwise
                 $angle = 270;
                 GalleryCreator\GcHelpers::imageRotate($objFile->path, $angle);
                 Dbafs::addResource($objFile->path, true);
                 $this->redirect('contao/main.php?do=gallery_creator&table=tl_gallery_creator_pictures&id=' . Input::get('id'));
             }
             break;
         default:
             break;
     }
     //end switch
     switch (Input::get('act')) {
         case 'create':
             //Neue Bilder können ausschliesslich über einen Bildupload realisiert werden
             $this->Redirect('contao/main.php?do=gallery_creator&table=tl_gallery_creator_pictures&id=' . Input::get('pid'));
             break;
         case 'select':
             if (!$this->User->isAdmin) {
                 // only list pictures where user is owner
                 if (!$GLOBALS['TL_CONFIG']['gc_disable_backend_edit_protection']) {
                     $GLOBALS['TL_DCA']['tl_gallery_creator_pictures']['list']['sorting']['filter'] = array(array('owner=?', $this->User->id));
                 }
             }
             break;
         default:
             break;
     }
     //end switch
     // get the source album when cuting pictures from one album to an other
     if (Input::get('act') == 'paste' && Input::get('mode') == 'cut') {
         $objPicture = GalleryCreatorPicturesModel::findByPk(Input::get('id'));
         if ($objPicture !== null) {
             $_SESSION['gallery_creator']['SOURCE_ALBUM_ID'] = $objPicture->pid;
         }
     }
 }
Пример #29
0
 /**
  * Prevent constructing the object (Singleton)
  */
 protected function __construct()
 {
     parent::__construct();
     $this->import('BackendUser', 'User');
     $this->_objHelper = ClipboardHelper::getInstance();
     $this->_objCbXml = ClipboardXml::getInstance();
     $this->_objDatabase = ClipboardDatabase::getInstance();
     $this->_objString = String::getInstance();
 }
Пример #30
0
 public function __construct()
 {
     parent::__construct();
     // melakukan inisiasi load model yang akan digunakan.
     // banyak model yang digunakan pada perhitungan c45 nya.
     // model adalah function yang disusun untuk memperoleh data dari
     // database sesuai kondisi yang diperlukan
     $this->load->model(array('c45_mining_model', 'c45_tree_model', 'product_model', 'product_rule_model', 'product_rule_ct_model'));
 }