本文整理汇总了PHP中Backend::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::__construct方法的具体用法?PHP Backend::__construct怎么用?PHP Backend::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend
的用法示例。
在下文中一共展示了Backend::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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');
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->loadLanguageFile("tl_settings");
$this->import('BackendUser', 'User');
$this->import('Environment');
}
示例3: __construct
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]);
}
}
}
}
示例4: __construct
/**
* 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: __construct
/**
* Import String library
*/
public function __construct()
{
parent::__construct();
$this->import('String');
$this->import('Files');
}
示例6: __construct
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: __construct
/**
* 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: __construct
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);
}
示例9: __construct
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;
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->import('BackendUser', 'User');
$this->loadLanguageFile('tl_subscribe_plus');
$this->loadDataContainer('tl_subscribe_plus');
}
示例11: __construct
/**
* 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: __construct
/**
* 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;
}
示例13: __construct
/**
* Construct.
*/
public function __construct()
{
parent::__construct();
$this->import('BackendUser', 'User');
$this->languageEditor = LanguageEditor::getInstance();
$this->loadTranslationKeys();
}
示例14: __construct
/**
* 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: __construct
/**
* AbstractWebRunner constructor.
*/
public function __construct()
{
// preserve object initialisation order
\BackendUser::getInstance();
\Database::getInstance();
parent::__construct();
}