Esempio n. 1
0
 /**
  * Initialize the object
  *
  * @param string  $strTable
  * @param integer $intPid
  */
 public function __construct($strTable, $intPid)
 {
     $this->import('Database');
     parent::__construct();
     $this->strTable = $strTable;
     $this->intPid = $intPid;
     // Store the path if it is an editable file
     if ($strTable == 'tl_files') {
         $objFile = \FilesModel::findByPk($intPid);
         if ($objFile !== null && in_array($objFile->extension, \StringUtil::trimsplit(',', strtolower(\Config::get('editableFiles'))))) {
             $this->strPath = $objFile->path;
         }
     }
 }
Esempio n. 2
0
 /**
  * Initialize the object
  *
  * @param array $arrAttributes An optional attributes array
  */
 public function __construct($arrAttributes = null)
 {
     parent::__construct();
     // Override the output format in the front end
     if (TL_MODE == 'FE') {
         /** @var PageModel $objPage */
         global $objPage;
         if ($objPage->outputFormat != '') {
             $this->strFormat = $objPage->outputFormat;
         }
     }
     $this->addAttributes($arrAttributes);
 }
Esempio n. 3
0
 /**
  * Create a new template object
  *
  * @param string $strTemplate    The template name
  * @param string $strContentType The content type (defaults to "text/html")
  */
 public function __construct($strTemplate = '', $strContentType = 'text/html')
 {
     parent::__construct();
     $this->strTemplate = $strTemplate;
     $this->strContentType = $strContentType;
 }
Esempio n. 4
0
 /**
  * Load the database object
  */
 protected function __construct()
 {
     parent::__construct();
     $this->import('Database');
     $this->setStaticUrls();
 }
Esempio n. 5
0
 public function __construct()
 {
     parent::__construct();
     $this->import('Config');
 }
Esempio n. 6
0
 /**
  * Load or create the extract
  *
  * @param string $strTable The table name
  *
  * @throws \Exception If $strTable is empty
  */
 protected function __construct($strTable)
 {
     if ($strTable == '') {
         throw new \Exception('The table name must not be empty');
     }
     parent::__construct();
     $this->strTable = $strTable;
     $strFile = \System::getContainer()->getParameter('kernel.cache_dir') . '/contao/sql/' . $strTable . '.php';
     // Try to load from cache
     if (file_exists($strFile)) {
         include $strFile;
     } else {
         $this->createExtract();
     }
 }
Esempio n. 7
0
 /**
  * Load the database object
  *
  * Make the constructor public, so pages can be instantiated (see #6182)
  */
 public function __construct()
 {
     parent::__construct();
     $this->import('Database');
 }
Esempio n. 8
0
 /**
  * Make the constructor public
  */
 public function __construct()
 {
     parent::__construct();
 }