Esempio n. 1
0
 /**
  * Construct the object
  * @param string
  * @param array
  */
 public function __construct($strName, $arrFiles)
 {
     parent::__construct();
     $this->import('Isotope');
     $this->name = $strName;
     $this->files = $arrFiles;
 }
Esempio n. 2
0
 /**
  * Initialize the object
  * @param object
  */
 public function __construct($objElement)
 {
     parent::__construct();
     // Store the parent element (see #4556)
     if ($objElement instanceof \Model) {
         $this->objParent = $objElement;
     } elseif ($objElement instanceof \Model\Collection) {
         $this->objParent = $objElement->current();
     }
     if ($this->strKey == '' || $this->strTable == '') {
         return;
     }
     $strModelClass = $this->getModelClassFromTable($this->strTable);
     // Load the model
     if (class_exists($strModelClass)) {
         $objHybrid = $strModelClass::findByPk($objElement->{$this->strKey});
         if ($objHybrid === null) {
             return;
         }
         $this->objModel = $objHybrid;
     } else {
         $objHybrid = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?")->limit(1)->execute($objElement->{$this->strKey});
         if ($objHybrid->numRows < 1) {
             return;
         }
     }
     $this->arrData = $objHybrid->row();
     // Get space and CSS ID from the parent element (!)
     $this->space = deserialize($objElement->space);
     $this->cssID = deserialize($objElement->cssID, true);
     $this->typePrefix = $objElement->typePrefix;
     $arrHeadline = deserialize($objElement->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
 }
Esempio n. 3
0
 public function __construct($objModule, $objCurrent)
 {
     if ($objModule instanceof \Model) {
         $this->objModel = $objModule;
     } elseif ($objModule instanceof \Model\Collection) {
         $this->objModel = $objModule->current();
     }
     parent::__construct();
     $this->objCurrent = $objCurrent;
     $this->arrData = $objModule->row();
     $this->space = deserialize($objModule->space);
     $this->cssID = deserialize($objModule->cssID, true);
     if ($this->customTpl != '' && TL_MODE == 'FE') {
         $this->strTemplate = $this->customTpl;
     }
     $arrHeadline = deserialize($objModule->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
     $this->setDefaultButtons($this->arrData['type']);
     $arrButtons = deserialize($this->arrData['share_buttons'], true);
     // overwrite buttons
     if (!empty($arrButtons)) {
         $this->pdfButton = false;
         $this->printButton = false;
         $this->facebook = false;
         $this->twitter = false;
         $this->gplus = false;
         foreach ($arrButtons as $key => $strType) {
             $this->{$strType} = true;
         }
     }
 }
Esempio n. 4
0
 /**
  * Initialize the object (do not remove)
  */
 public function __construct()
 {
     parent::__construct();
     // See #4099
     define('BE_USER_LOGGED_IN', false);
     define('FE_USER_LOGGED_IN', false);
 }
 public function __construct($submitted)
 {
     parent::__construct();
     $this->submitted = $submitted;
     $this->loadLanguageFile('tl_subscribe_plus');
     $this->loadDataContainer('tl_subscribe_plus');
 }
 public function __construct($strTemplate = '', $active = null)
 {
     parent::__construct();
     $this->loadLanguageFile('imagemapster');
     $this->strTemplate = $strTemplate;
     $this->active = $active;
 }
Esempio n. 7
0
 public function __construct()
 {
     parent::__construct();
     $this->load->helper('tools');
     $this->load->library('user_agent');
     $this->load->model('comments_model');
 }
Esempio n. 8
0
 public function __construct()
 {
     // Set the item from the auto_item parameter
     if (!isset($_GET['store']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('store', \Input::get('auto_item'));
     }
     parent::__construct();
 }
 /**
  * initialize controller
  */
 public function __construct()
 {
     $this->import('BackendUser', 'User');
     parent::__construct();
     $this->loadLanguageFile('default');
     $this->loadLanguageFile('modules');
     $this->setStaticUrls();
 }
Esempio n. 10
0
 /**
  * Initialize the object
  * @param integer
  */
 public function __construct($intPoll)
 {
     parent::__construct();
     $objPoll = \Database::getInstance()->prepare($this->getPollQuery('tl_poll'))->limit(1)->execute($intPoll);
     if ($objPoll->numRows) {
         $this->objPoll = $objPoll;
     }
 }
 public function __construct()
 {
     parent::__construct();
     define('BE_USER_LOGGED_IN', $this->getLoginStatus('BE_USER_AUTH'));
     define('FE_USER_LOGGED_IN', $this->getLoginStatus('FE_USER_AUTH'));
     \Controller::setStaticUrls('TL_FILES_URL', $GLOBALS['TL_CONFIG']['staticFiles']);
     \Controller::setStaticUrls('TL_SCRIPT_URL', $GLOBALS['TL_CONFIG']['staticSystem']);
     \Controller::setStaticUrls('TL_PLUGINS_URL', $GLOBALS['TL_CONFIG']['staticPlugins']);
 }
Esempio n. 12
0
 public function __construct()
 {
     global $objPage;
     $this->isActive = true;
     #$this->isActive = $this->getLoginStatus('BE_USER_AUTH');
     $this->strIgnoreClasses = str_ireplace(array(',', '-'), array('|', '\\-'), $GLOBALS['TL_CONFIG']['frontendEditorIgnoreClasses']);
     $this->arrIgnoreContent = explode(',', $GLOBALS['TL_CONFIG']['frontendEditorIgnoreContent'] . ',autoLayoutStart,autoLayoutSeparator,autoLayoutStop');
     parent::__construct();
 }
Esempio n. 13
0
 /**
  * Initialize the object
  * @param object
  * @return string
  */
 public function __construct(Database_Result $objElement)
 {
     parent::__construct();
     $this->arrData = $objElement->row();
     $this->space = deserialize($objElement->space);
     $this->cssID = deserialize($objElement->cssID, true);
     $arrHeadline = deserialize($objElement->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
 }
 public function __construct($objModel)
 {
     if ($objModel instanceof \Model) {
         $this->objModel = $objModel;
     } elseif ($objModel instanceof \Model\Collection) {
         $this->objModel = $objModel->current();
     }
     parent::__construct();
     $this->arrData = $objModel->row();
 }
Esempio n. 15
0
 /**
  * Initialize the object
  */
 public function __construct()
 {
     // Try to read from cache
     $this->outputFromCache();
     // Load user object before calling the parent constructor
     $this->import('FrontendUser', 'User');
     parent::__construct();
     // Check whether a user is logged in
     define('BE_USER_LOGGED_IN', $this->getLoginStatus('BE_USER_AUTH'));
     define('FE_USER_LOGGED_IN', $this->getLoginStatus('FE_USER_AUTH'));
 }
Esempio n. 16
0
 public function __construct()
 {
     $objPersistant = null;
     if ($this->blnUseSession) {
         $objPersistant = \Session::getInstance();
     }
     if ($objPersistant !== null && $objPersistant->get('fontsize')) {
         $this->intCurrentFontsize = $objPersistant->get('fontsize');
     }
     parent::__construct();
 }
Esempio n. 17
0
 /**
  * Initialize the object
  * @param array
  */
 public function __construct($arrRow)
 {
     parent::__construct();
     $this->import('Isotope');
     $this->loadLanguageFile('payment');
     $arrRow['allowed_cc_types'] = deserialize($arrRow['allowed_cc_types']);
     if (is_array($arrRow['allowed_cc_types'])) {
         $arrRow['allowed_cc_types'] = array_intersect($this->getAllowedCCTypes(), $arrRow['allowed_cc_types']);
     }
     $this->arrData = $arrRow;
 }
 public function __construct()
 {
     $objPersistant = null;
     if ($this->blnUseSession) {
         $objPersistant = \Session::getInstance();
     }
     if ($objPersistant !== null && $objPersistant->get('style')) {
         $this->strCurrentStyle = $objPersistant->get('style');
     }
     parent::__construct();
 }
Esempio n. 19
0
 /**
  * Initialize the object
  * @param Database_Result
  * @param string
  */
 public function __construct(Database_Result $objModule, $strColumn = 'main')
 {
     parent::__construct();
     $this->arrData = $objModule->row();
     $this->space = deserialize($objModule->space);
     $this->cssID = deserialize($objModule->cssID, true);
     $arrHeadline = deserialize($objModule->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
     $this->strColumn = $strColumn;
 }
Esempio n. 20
0
 public function __construct()
 {
     parent::__construct();
     $this->import('Database');
     $this->import('String');
     // Types of form fields with storable data
     $this->arrFFstorable = array('sessionText', 'sessionOption', 'sessionCalculator', 'hidden', 'text', 'calendar', 'xdependentcalendarfields', 'password', 'textarea', 'select', 'efgImageSelect', 'conditionalselect', 'countryselect', 'fp_preSelectMenu', 'efgLookupSelect', 'radio', 'efgLookupRadio', 'checkbox', 'efgLookupCheckbox', 'upload', 'fileTree');
     if (is_array($GLOBALS['EFG']['storable_fields']) && count($GLOBALS['EFG']['storable_fields'])) {
         $this->arrFFstorable = array_unique(array_merge($this->arrFFstorable, $GLOBALS['EFG']['storable_fields']));
     }
     $this->getStoreForms();
 }
 public function __construct(\Model\Collection $objCss, $arrReturn = array(), $blnCache)
 {
     parent::__construct();
     $this->start = microtime(true);
     $this->cache = $blnCache;
     $this->loadDataContainer('tl_extcss');
     while ($objCss->next()) {
         $this->arrData[] = $objCss->row();
     }
     $this->variablesSrc = 'variables-' . $this->title . '.less';
     $this->mode = $this->cache ? 'none' : 'static';
     $this->arrReturn = $arrReturn;
     $this->objUserCssFile = new \File($this->getSrc($this->title . '.css'));
     // rewrite if group css is empty or created/updated recently
     if ($this->objUserCssFile->size == 0 || $this->lastUpdate > $this->objUserCssFile->mtime) {
         $this->rewrite = true;
         $this->rewriteBootstrap = true;
         $this->cache = false;
     }
     $this->uriRoot = (TL_ASSETS_URL ? TL_ASSETS_URL : \Environment::get('url')) . '/assets/css/';
     $this->arrLessOptions = array('compress' => !\Config::get('bypassCache'), 'cache_dir' => TL_ROOT . '/assets/css/lesscache');
     if (!$this->cache) {
         $this->objLess = new \Less_Parser($this->arrLessOptions);
         $this->addBootstrapVariables();
         $this->addFontAwesomeVariables();
         $this->addFontAwesomeCore();
         $this->addFontAwesomeMixins();
         $this->addFontAwesome();
         $this->addBootstrapMixins();
         $this->addBootstrapAlerts();
         $this->addBootstrap();
         $this->addBootstrapUtilities();
         $this->addBootstrapType();
         if ($this->addElegantIcons) {
             $this->addElegantIconsVariables();
             $this->addElegantIcons();
         }
         // HOOK: add custom assets
         if (isset($GLOBALS['TL_HOOKS']['addCustomAssets']) && is_array($GLOBALS['TL_HOOKS']['addCustomAssets'])) {
             foreach ($GLOBALS['TL_HOOKS']['addCustomAssets'] as $callback) {
                 $this->import($callback[0]);
                 $this->{$callback}[0]->{$callback}[1]($this->objLess, $this->arrData, $this);
             }
         }
         $this->addCustomLessFiles();
         $this->addCssFiles();
     } else {
         // remove custom less files as long as we can not provide mixins and variables in cache mode
         unset($GLOBALS['TL_USER_CSS']);
         // always add bootstrap
         $this->addBootstrap();
     }
 }
 /**
  * Initialize the object
  * @param object
  * @return string
  */
 public function __construct($objElement)
 {
     parent::__construct();
     $this->arrData = $objElement->row();
     // Get space and CSS ID from the parent element (!)
     $this->space = deserialize($objElement->space);
     $this->cssID = deserialize($objElement->cssID, true);
     $this->typePrefix = $objElement->typePrefix;
     $arrHeadline = deserialize($objElement->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
 }
Esempio n. 23
0
 /**
  * Initialize the object
  *
  * @param ContentModel|ModuleModel|FormModel $objElement
  * @param string                             $strColumn
  */
 public function __construct($objElement, $strColumn = 'main')
 {
     parent::__construct();
     // Store the parent element (see #4556)
     if ($objElement instanceof Model || $objElement instanceof Model\Collection) {
         /** @var ContentModel|ModuleModel|FormModel $objModel */
         $objModel = $objElement;
         if ($objModel instanceof Model\Collection) {
             $objModel = $objModel->current();
         }
         $this->objParent = $objModel;
     }
     if ($this->strKey == '' || $this->strTable == '') {
         return;
     }
     /** @var Model $strModelClass */
     $strModelClass = \Model::getClassFromTable($this->strTable);
     // Load the model
     if (class_exists($strModelClass)) {
         $objHybrid = $strModelClass::findByPk($objElement->{$this->strKey});
         if ($objHybrid === null) {
             return;
         }
         $this->objModel = $objHybrid;
     } else {
         $objHybrid = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?")->limit(1)->execute($objElement->{$this->strKey});
         if ($objHybrid->numRows < 1) {
             return;
         }
     }
     $cssID = array();
     $this->arrData = $objHybrid->row();
     // Get the CSS ID from the parent element (!)
     $this->cssID = \StringUtil::deserialize($objElement->cssID, true);
     if (isset($objHybrid->attributes)) {
         $cssID = \StringUtil::deserialize($objHybrid->attributes, true);
     }
     // Override the CSS ID (see #305)
     if (!empty($this->cssID[0])) {
         $cssID[0] = $this->cssID[0];
     }
     // Merge the CSS classes (see #6011)
     if (!empty($this->cssID[1])) {
         $cssID[1] = trim($cssID[1] . ' ' . $this->cssID[1]);
     }
     $this->cssID = $cssID;
     $this->typePrefix = $objElement->typePrefix;
     $arrHeadline = \StringUtil::deserialize($objElement->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
     $this->strColumn = $strColumn;
 }
Esempio n. 24
0
 /**
  * Initialize the object
  * @param object
  */
 public function __construct($objElement)
 {
     if ($objElement instanceof \Model || $objElement instanceof \Model_Collection) {
         $this->objModel = $objElement;
     }
     parent::__construct();
     $this->arrData = $objElement->row();
     $this->space = deserialize($objElement->space);
     $this->cssID = deserialize($objElement->cssID, true);
     $arrHeadline = deserialize($objElement->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
 }
Esempio n. 25
0
 /**
  * Initialize the object
  * @param object
  * @param string
  */
 public function __construct($objModule, $strColumn = 'main')
 {
     if ($objModule instanceof \Model || $objModule instanceof \Model_Collection) {
         $this->objModel = $objModule;
     }
     parent::__construct();
     $this->arrData = $objModule->row();
     $this->space = deserialize($objModule->space);
     $this->cssID = deserialize($objModule->cssID, true);
     $arrHeadline = deserialize($objModule->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
     $this->strColumn = $strColumn;
 }
Esempio n. 26
0
 /**
  * Initialize the object
  */
 public function __construct()
 {
     // Try to read from cache
     $this->outputFromCache();
     // Redirect to the install tool
     if (!Config::getInstance()->isComplete()) {
         $this->redirect('contao/install.php');
     }
     // Load the user object before calling the parent constructor
     $this->import('FrontendUser', 'User');
     parent::__construct();
     // Check whether a user is logged in
     define('BE_USER_LOGGED_IN', $this->getLoginStatus('BE_USER_AUTH'));
     define('FE_USER_LOGGED_IN', $this->getLoginStatus('FE_USER_AUTH'));
 }
Esempio n. 27
0
 public function __construct()
 {
     parent::__construct();
     // Types of form fields with storable data
     $this->arrFFstorable = array('sessionText', 'sessionOption', 'sessionCalculator', 'hidden', 'text', 'calendar', 'xdependentcalendarfields', 'password', 'textarea', 'select', 'efgImageSelect', 'condition', 'conditionalselect', 'countryselect', 'fp_preSelectMenu', 'efgLookupSelect', 'radio', 'efgLookupRadio', 'cm_alternative', 'checkbox', 'efgLookupCheckbox', 'upload', 'fileTree');
     if (!empty($GLOBALS['EFG']['storable_fields'])) {
         $this->arrFFstorable = array_filter(array_unique(array_merge($this->arrFFstorable, $GLOBALS['EFG']['storable_fields'])));
     }
     // Mapping of frontend form fields to backend widgets for not identical types
     $this->arrMapTL_FFL = array('hidden' => 'text', 'upload' => 'fileTree', 'efgImageSelect' => 'fileTree', 'sessionText' => 'text', 'sessionOption' => 'checkbox', 'sessionCalculator' => 'text', 'condition' => 'checkbox', 'conditionalselect' => 'select', 'countryselect' => 'select', 'fp_preSelectMenu' => 'select');
     if (!empty($GLOBALS['EFG']['BE_FFL'])) {
         foreach ($GLOBALS['EFG']['BE_FFL'] as $strTL_FFL => $strBE_FFL) {
             $this->arrMapTL_FFL[$strTL_FFL] = $strBE_FFL;
         }
     }
     $this->getStoringForms();
     $this->arrBaseFields = array_filter(array_diff(\Database::getInstance()->getFieldNames('tl_formdata'), array('PRIMARY')));
 }
Esempio n. 28
0
 /**
  * Initialize the object
  * @param object
  * @return string
  */
 public function __construct(Database_Result $objElement)
 {
     parent::__construct();
     if ($this->strKey == '' || $this->strTable == '') {
         return;
     }
     $objHybrid = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?")->limit(1)->execute($objElement->{$this->strKey});
     if ($objHybrid->numRows < 1) {
         return;
     }
     $this->arrData = $objHybrid->row();
     // Get space and CSS ID from the parent element (!)
     $this->space = deserialize($objElement->space);
     $this->cssID = deserialize($objElement->cssID, true);
     $this->typePrefix = $objElement->typePrefix;
     $arrHeadline = deserialize($objElement->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
 }
Esempio n. 29
0
 /**
  * Initialize the object
  * @param object
  * @param string
  */
 public function __construct($objModule, $strColumn = 'main')
 {
     if ($objModule instanceof \Model) {
         $this->objModel = $objModule;
     } elseif ($objModule instanceof \Model\Collection) {
         $this->objModel = $objModule->current();
     }
     parent::__construct();
     $this->arrData = $objModule->row();
     $this->space = deserialize($objModule->space);
     $this->cssID = deserialize($objModule->cssID, true);
     if ($this->customTpl != '' && TL_MODE == 'FE') {
         $this->strTemplate = $this->customTpl;
     }
     $arrHeadline = deserialize($objModule->headline);
     $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
     $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
     $this->strColumn = $strColumn;
 }
Esempio n. 30
0
 /**
  * Initialize the object
  */
 public function __construct()
 {
     // Load the user object before calling the parent constructor
     \FrontendUser::getInstance();
     parent::__construct();
     // Check whether a user is logged in
     define('BE_USER_LOGGED_IN', $this->getLoginStatus('BE_USER_AUTH'));
     define('FE_USER_LOGGED_IN', $this->getLoginStatus('FE_USER_AUTH'));
     // No back end user logged in
     if (!$_SESSION['DISABLE_CACHE']) {
         // Maintenance mode (see #4561 and #6353)
         if (\Config::get('maintenanceMode')) {
             header('HTTP/1.1 503 Service Unavailable');
             die_nicely('be_unavailable', 'This site is currently down for maintenance. Please come back later.');
         }
         // Disable the debug mode (see #6450)
         \Config::set('debugMode', false);
     }
 }