public function __construct($name, $module, array $params = NULL)
 {
     parent::__construct($name, $module, $params);
     $this->setType(self::COMPONENT_TYPE_FORM_ADD);
     /*@todo create smth like StateConfig - descendant of SimpleXML*/
     $this->setAction((string) $this->config->getStateConfig('subscribe')->uri_patterns->pattern, true);
 }
Exemplo n.º 2
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     parent::__construct($name, $params);
     if (!AdsManager::isActive()) {
         $this->disable();
     }
 }
Exemplo n.º 3
0
 public function __construct($name, $module, array $params = NULL)
 {
     $params['active'] = false;
     parent::__construct($name, $module, $params);
     $this->setParam('recordsPerPage', NULL);
     $this->setBuilder(new SimpleBuilder());
     $this->setType(self::COMPONENT_TYPE_LIST);
 }
Exemplo n.º 4
0
 /**
  * @copydoc DBDataSet::__construct
  */
 public function __construct($name, array $params = NULL)
 {
     parent::__construct($name, $params);
     $bindComponentName = $this->getParam('bind') ? $this->getParam('bind') : self::DEFAULT_LINK_TO;
     $this->cp = E()->getDocument()->componentManager->getBlockByName($bindComponentName);
     if (!$this->cp || $this->cp && $this->cp->getState() != 'view') {
         $this->disable();
     }
     $this->setParam('recordsPerPage', false);
 }
Exemplo n.º 5
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     if (!isset($params['state'])) {
         $params['state'] = E()->getDocument()->user->isAuthenticated() ? 'showLogoutForm' : 'showLoginForm';
     }
     parent::__construct($name, $params);
     $this->setTitle($this->translate('TXT_LOGIN_FORM'));
     $base = E()->getSiteManager()->getCurrentSite()->base;
     if (strpos($currDomain = E()->getSiteManager()->getCurrentSite()->host, Primitive::getConfigValue('site.domain')) === false) {
         $base = 'http://' . Primitive::getConfigValue('site.domain') . '/';
     }
     $this->setAction($base . 'auth.php' . (isset($_SERVER['HTTP_REFERER']) ? '' : '?return=' . (($return = $this->getParam('successAction')) ? $return : E()->getRequest()->getURI())), true);
 }
Exemplo n.º 6
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = NULL)
 {
     parent::__construct($name, $params);
     $this->setType(self::COMPONENT_TYPE_LIST);
     $this->addTranslation('TXT_HOME');
     if ($this->getParam('site') == 'default') {
         $this->setParam('site', E()->getSiteManager()->getDefaultSite()->id);
     } elseif ($this->getParam('site') == 'current') {
         $this->setParam('site', E()->getSiteManager()->getCurrentSite()->id);
     }
     if ($this->getParam('id') == self::ALL_PAGES) {
         $this->setParam('recursive', false);
     }
 }
Exemplo n.º 7
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     parent::__construct($name, $params);
     /**
      * @todo Не забыть убрать $_REQUEST или переделать чтобы для режима отладки  -_REQUEST а так  - _POST
      *
      */
     $this->isEditable = $this->document->isEditable();
     $this->tableName = 'share_textblocks';
     if ($this->isEditable) {
         $this->addWYSIWYGTranslations();
         //выставляем свойство указывающее на то что блок находится в режиме редактирования
         $this->setProperty('editable', 'editable');
     }
 }
Exemplo n.º 8
0
 public function __construct($name, array $params = NULL)
 {
     parent::__construct($name, $params);
     $this->setProperty('exttype', 'comments');
     $this->setType(self::COMPONENT_TYPE_LIST);
     $commentTable = $this->dbh->tableExists($this->getParam('table_name') . '_comment');
     $this->isTree = $this->getParam('is_tree');
     $this->setProperty('is_tree', $this->isTree);
     $right = $this->document->getRights();
     $this->setProperty('is_editable', (int) ($right > 1));
     // добавлять и править/удалять своё
     $this->setProperty('is_admin', (int) ($right > 2));
     // godmode
     if (E()->getUser()->isAuthenticated()) {
         $this->document->setProperty('CURRENT_UID', E()->getUser()->getID());
     }
     $this->targetIds = $this->getParam('target_ids');
     $this->comments = new Comments($commentTable, $this->isTree);
 }
Exemplo n.º 9
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = NULL)
 {
     // если комментарии скрыты то бессмысленно показывать форму
     if (!isset($params['show_comments']) or !$params['show_comments']) {
         $params['show_form'] = 0;
     }
     parent::__construct($name, $params);
     $this->commentTable = $this->getParam('comment_tables');
     $this->targetTable = substr($this->commentTable, 0, strrpos($this->commentTable, '_'));
     $this->bindComponent = $this->document->componentManager->getBlockByName($this->getParam('bind'));
     $this->isTree = $this->getParam('is_tree');
     $this->setProperty('limit', $this->getParam('textLimit'));
     $this->setProperty('is_anonymous', (string) (!$this->document->user->isAuthenticated()));
     $this->setProperty('use_captcha', (string) $this->getParam('use_captcha'));
     $this->addTranslation('TXT_ENTER_CAPTCHA');
 }
Exemplo n.º 10
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     $params['active'] = true;
     parent::__construct($name, $params);
     $this->setProperty('recordsPerPage', false);
 }
Exemplo n.º 11
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     parent::__construct($name, $params);
     $this->setType(self::COMPONENT_TYPE_LIST);
     $this->setBuilder(new SimpleBuilder());
 }
Exemplo n.º 12
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = NULL)
 {
     parent::__construct($name, $params);
     $this->setType(self::COMPONENT_TYPE_LIST);
 }
Exemplo n.º 13
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     parent::__construct($name, $params);
     $this->setType(self::COMPONENT_TYPE_LIST);
     $this->setProperty('site', E()->getSiteManager()->getCurrentSite()->name);
 }
Exemplo n.º 14
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     parent::__construct($name, $params);
     E()->getResponse()->setHeader('Content-Type', 'text/plain; charset=utf-8');
 }
Exemplo n.º 15
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     parent::__construct($name, $params);
     $this->setProperty('exttype', 'calendar');
 }
Exemplo n.º 16
0
 /**
  * @copydoc DataSet::__construct
  */
 public function __construct($name, array $params = null)
 {
     parent::__construct($name, $params);
     $this->setAction('send');
 }