/**
  * @param int|string $formID Form ID.
  */
 public function __construct($formID)
 {
     parent::__construct();
     $this->fDBName = FormConstructor::getDatabase();
     $this->tableName = QAL::getFQTableName($this->fDBName . '.' . self::TABLE_PREFIX . $formID);
     $this->dbh->modify('CREATE TABLE IF NOT EXISTS ' . $this->tableName . ' (pk_id int(10) unsigned NOT NULL AUTO_INCREMENT,form_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`pk_id`), INDEX(form_date)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ');
 }
Exemple #2
0
 public function __construct()
 {
     parent::__construct();
     $this->user = E()->getUser();
     $this->language = E()->getLanguage();
     $this->lang = $this->language->getCurrent();
     $this->sitemap = E()->getMap();
     $this->request = E()->getRequest();
     $segments = $this->request->getPath();
     $this->componentManager = new ComponentManager($this);
     // получаем идентификатор документа
     if (isset($segments[0]) && $segments[0] == self::SINGLE_SEGMENT) {
         $segments = [];
     }
     $this->id = $this->sitemap->getIDByURI($segments);
     if (empty($this->id)) {
         throw new SystemException('ERR_404', SystemException::ERR_404);
     }
     // получаем права пользователя на документ
     $this->rights = $this->sitemap->getDocumentRights($this->getID(), $this->user->getGroups());
     if ($this->getRights() == ACCESS_NONE) {
         throw new SystemException('ERR_403', SystemException::ERR_403);
     }
     // получаем информацию о документе
     $this->documentInfo = $this->sitemap->getDocumentInfo($this->getID());
     //Если его нет в перечне страниц значит он IsDisabled
     if (!$this->documentInfo) {
         throw new SystemException('ERR_404', SystemException::ERR_404);
     }
     //Если URL редиректа не пустой  - осуществляем редирект по нему
     if (!empty($this->documentInfo['RedirectUrl'])) {
         E()->getResponse()->setStatus('301');
         E()->getResponse()->setRedirect($this->documentInfo['RedirectUrl']);
     }
     // загружаем компоненты страницы
     //$this->loadComponents($this->documentInfo['templateID']);
     // устанавливаем свойства документа
     if ($this->documentInfo['MetaKeywords']) {
         $this->setProperty('keywords', $this->documentInfo['MetaKeywords']);
     }
     if ($this->documentInfo['MetaDescription']) {
         $this->setProperty('description', $this->documentInfo['MetaDescription']);
     }
     if ($this->documentInfo['MetaRobots']) {
         $this->setProperty('robots', implode(',', $this->documentInfo['MetaRobots']));
     }
     $this->setProperty('template', $this->request->getPath(Request::PATH_TEMPLATE, true));
     $this->setProperty('ID', $this->getID());
     $this->setProperty('default', $this->sitemap->getDefault() == $this->getID());
 }
Exemple #3
0
 public function __construct()
 {
     parent::__construct();
 }
Exemple #4
0
 /**
  * @param string $commentTable Table name with comments.
  * @param bool $isTree Are comments tree-like?
  */
 public function __construct($commentTable, $isTree = false)
 {
     $this->commentTable = $commentTable;
     $this->isTree = $isTree;
     parent::__construct();
 }