Exemplo n.º 1
0
 /**
  * @param string $key
  * @return $this
  */
 public static function getInstance($key = 'images')
 {
     if (!ModuleManager::moduleExists('images') || !ModuleManager::moduleExists('gallery')) {
         error('Module Gallery and module Images are required for ColumnGallery');
     }
     $res = new self($key);
     $res->allowHtml();
     return $res;
 }
 public function __settings_form($data = NULL)
 {
     /** @var CustomSetting $data */
     $form_array = ['title' => $data ? __('Edit custom setting') : __('Add custom setting'), 'data' => $data, 'action' => '?p=' . P . '&do=_add', 'button' => 'Add', 'fields' => ['module' => ['type' => 'datalist', 'options' => ModuleManager::getListOfCustomModuleNames()], 'key' => ['required' => true], 'input_type' => ['options' => SQL::getEnumPairs(ModuleSettings::$tables['settings'], 'input_type')], 'input_options' => ['type' => 'checkbox_list', 'options' => ['editor_wysiwyg' => 'Wysiwyg', 'editor_files' => 'Filemanager', 'editor_pages' => 'Pages', 'require' => 'Required', 'is_digit' => 'Digit', 'alphanum' => 'Alphanumeric', 'url' => 'URL', 'email' => 'email']]]];
     return CmsFormHelper::outputForm(ModuleSettings::$tables['settings'], $form_array);
 }