예제 #1
0
 public static function getConfigOptions(Context $ctx)
 {
     $list = TypeNode::getDictionaries();
     if (empty($list)) {
         throw new ForbiddenException(t('Не определён ни один справочник.'));
     }
     return array('type' => array('type' => 'EnumControl', 'label' => t('Справочник'), 'required' => true, 'options' => $list));
 }
예제 #2
0
 public function getExtraSettings()
 {
     $fields = array('dictionary' => array('type' => 'EnumControl', 'label' => t('Справочник'), 'options' => TypeNode::getDictionaries(), 'weight' => 4, 'default_label' => t('(не использовать)')));
     return $fields;
 }
예제 #3
0
 /**
  * Дополнительные настройки поля.
  */
 public function getExtraSettings()
 {
     $fields = array('dictionary' => array('type' => 'EnumControl', 'label' => t('Справочник'), 'required' => true, 'options' => TypeNode::getDictionaries(), 'weight' => 4), 'mode' => array('type' => 'EnumControl', 'label' => t('Режим работы'), 'options' => array('select' => t('один — выпадающий список'), 'radio' => t('один — радио'), 'enter' => t('один — текстовое поле'), 'set' => t('много — галки')), 'required' => true), 'details' => array('type' => 'EnumControl', 'label' => t('Объём данных'), 'options' => array('less' => t('id + название'), 'more' => t('полный XML')), 'required' => true));
     return $fields;
 }
 /**
  * @mcms_message ru.molinos.cms.module.settings.subscription
  */
 public static function on_get_settings(Context $ctx)
 {
     return new Schema(array('types' => array('type' => 'SetControl', 'label' => t('Типы рассылаемых документов'), 'options' => TypeNode::getAccessible(null), 'store' => true), 'sections' => array('type' => 'SectionsControl', 'label' => t('Рассылать новости из разделов'), 'group' => t('Разделы'), 'store' => true), 'stylesheet' => array('type' => 'TextLineControl', 'label' => t('Шаблон'), 'default' => os::path('lib', 'modules', 'subscription', 'message.xsl'), 'description' => t('За помощью в написании шаблона обратитесь к документации.')), 'subject' => array('type' => 'TextLineControl', 'label' => t('Заголовок сообщения'), 'default' => 'Новости сайта %host')));
 }
 protected function getNodeFilter()
 {
     $filter = array();
     if (null !== $this->deleted) {
         $filter['deleted'] = $this->deleted;
     }
     if (null !== $this->published) {
         $filter['published'] = $this->published;
     }
     if (null !== $this->types) {
         $filter['class'] = $this->types;
     } else {
         $filter['-class'] = 'trash' != $this->preset ? TypeNode::getInternal() : array();
         $filter['#public'] = true;
     }
     if (!empty($this->sort)) {
         $filter['#sort'] = $this->sort;
     } else {
         $filter['#sort'] = '-id';
     }
     if (null !== ($tmp = $this->ctx->get('search'))) {
         $filter['#search'] = $tmp;
     }
     if (count($tmp = explode(',', $this->ctx->get('filter'))) == 2) {
         switch ($tmp[0]) {
             case 'section':
                 $filter['tags'] = $tmp[1];
                 break;
             default:
                 $filter[$tmp[0]] = $tmp[1];
                 break;
         }
     }
     if ('pages' == $this->preset) {
         $filter['parent_id'] = null;
     }
     if (array_key_exists('class', $filter) and empty($filter['class'])) {
         unset($filter['class']);
     }
     $filter['deleted'] = !empty($this->deleted);
     if ($tmp = Context::last()->get('author')) {
         $filter['uid'] = $tmp;
     }
     // $q = new Query($filter); mcms::debug($q, $q->getSelect());
     return $filter;
 }