コード例 #1
0
ファイル: admin.php プロジェクト: vazahat/dudex
 /**
  * Class constructor
  *
  */
 public function __construct($plugins)
 {
     parent::__construct('configForm');
     $language = OW::getLanguage();
     $values = OW::getConfig()->getValues('uheader');
     if ($plugins['photo']) {
         $field = new CheckboxField('photo_share');
         $field->setId('photo_share_check');
         $field->setValue($values['photo_share']);
         $this->addElement($field);
         $field = new TextField('photo_album_name');
         $field->setValue(OW::getLanguage()->text('uheader', 'default_photo_album_name'));
         $field->setRequired();
         $this->addElement($field);
     }
     $field = new TextField('cover_height');
     $field->setValue($values['cover_height']);
     $field->addValidator(new IntValidator(self::COVER_MIN_HEIGHT, self::COVER_MAX_HEIGHT));
     $field->setRequired();
     $this->addElement($field);
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('uheader', 'config_save_label'));
     $this->addElement($submit);
 }
コード例 #2
0
ファイル: admin.php プロジェクト: vazahat/dudex
 /**
  * Class constructor
  *
  */
 public function __construct($plugins)
 {
     parent::__construct('configForm');
     $language = OW::getLanguage();
     $values = OW::getConfig()->getValues('attachments');
     if ($plugins['video']) {
         $field = new CheckboxField('video_share');
         $field->setValue($values['video_share']);
         $this->addElement($field);
     }
     if ($plugins['links']) {
         $field = new CheckboxField('link_share');
         $field->setValue($values['link_share']);
         $this->addElement($field);
     }
     if ($plugins['photo']) {
         $field = new CheckboxField('photo_share');
         $field->setId('photo_share_check');
         $field->setValue($values['photo_share']);
         $this->addElement($field);
         $field = new TextField('photo_album_name');
         $field->setValue(OW::getLanguage()->text('attachments', 'default_photo_album_name'));
         $field->setRequired();
         $this->addElement($field);
     }
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('attachments', 'config_save_label'));
     $this->addElement($submit);
 }
コード例 #3
0
ファイル: admin.php プロジェクト: vazahat/dudex
 /**
  * Class constructor
  *
  */
 public function __construct()
 {
     parent::__construct('configForm');
     $language = OW::getLanguage();
     $values = OW::getConfig()->getValues('utags');
     $field = new CheckboxField('copy_photo');
     $field->setId('copy_photo_check');
     $field->setValue($values['copy_photo']);
     $this->addElement($field);
     $field = new TextField('photo_album_name');
     $field->setValue(OW::getLanguage()->text('utags', 'default_photo_album_name'));
     $field->setRequired();
     $this->addElement($field);
     $field = new CheckboxField('crop_photo');
     $field->setValue($values['crop_photo']);
     $this->addElement($field);
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('utags', 'config_save_label'));
     $this->addElement($submit);
 }
コード例 #4
0
ファイル: admin.php プロジェクト: vazahat/dudex
 public function __construct($entityType, $actions, $features, $info)
 {
     parent::__construct("HINT_ConfigurationForm");
     $language = OW::getLanguage();
     $this->actions = $actions;
     $this->entityType = $entityType;
     // Actions
     foreach ($actions as $action) {
         $field = new CheckboxField("action-" . $action["key"]);
         $field->setId("action-" . $action["key"]);
         $field->addAttribute("data-key", $action["key"]);
         $field->setValue($action["active"]);
         $field->setLabel($action["label"]);
         $field->addAttribute("class", "h-refresher");
         $this->addElement($field);
     }
     // Additional Features
     $field = new CheckboxField("uheader_enabled");
     $field->setId("feature_uheader");
     $field->setValue($features["cover"]);
     $field->addAttribute("class", "h-refresher");
     $field->addAttribute("data-key", "cover");
     $this->addElement($field);
     // User Information
     $line0Options = HINT_BOL_Service::getInstance()->getInfoLineSettings($entityType, HINT_BOL_Service::INFO_LINE0);
     $field = new Selectbox("info_" . HINT_BOL_Service::INFO_LINE0);
     $field->setId("info0");
     foreach ($line0Options as $lineOption) {
         $field->addOption($lineOption["key"], $lineOption["label"]);
     }
     if (!empty($info[HINT_BOL_Service::INFO_LINE0]["key"])) {
         $field->setValue($info[HINT_BOL_Service::INFO_LINE0]["key"]);
     }
     $this->addElement($field);
     $questions = $this->findQuestions();
     $questionOptions = array();
     foreach ($questions as $question) {
         $questionOptions[$question->name] = BOL_QuestionService::getInstance()->getQuestionLang($question->name);
     }
     $field = new Selectbox("info_" . HINT_BOL_Service::INFO_LINE0 . "_question");
     $field->setId("info0_q");
     $field->setOptions($questionOptions);
     if (!empty($info[HINT_BOL_Service::INFO_LINE0]["question"])) {
         $field->setValue($info[HINT_BOL_Service::INFO_LINE0]["question"]);
     }
     $this->addElement($field);
     $line1Options = HINT_BOL_Service::getInstance()->getInfoLineSettings($entityType, HINT_BOL_Service::INFO_LINE1);
     $field = new Selectbox("info_" . HINT_BOL_Service::INFO_LINE1);
     $field->setId("info1");
     foreach ($line1Options as $lineOption) {
         $field->addOption($lineOption["key"], $lineOption["label"]);
     }
     if (!empty($info[HINT_BOL_Service::INFO_LINE1]["key"])) {
         $field->setValue($info[HINT_BOL_Service::INFO_LINE1]["key"]);
     }
     $this->addElement($field);
     $field = new Selectbox("info_" . HINT_BOL_Service::INFO_LINE1 . "_question");
     $field->setId("info1_q");
     $field->setOptions($questionOptions);
     if (!empty($info[HINT_BOL_Service::INFO_LINE1]["question"])) {
         $field->setValue($info[HINT_BOL_Service::INFO_LINE1]["question"]);
     }
     $this->addElement($field);
     $line2Options = HINT_BOL_Service::getInstance()->getInfoLineSettings($entityType, HINT_BOL_Service::INFO_LINE2);
     $field = new Selectbox("info_" . HINT_BOL_Service::INFO_LINE2);
     $field->setId("info2");
     foreach ($line2Options as $lineOption) {
         $field->addOption($lineOption["key"], $lineOption["label"]);
     }
     if (!empty($info[HINT_BOL_Service::INFO_LINE2]["key"])) {
         $field->setValue($info[HINT_BOL_Service::INFO_LINE2]["key"]);
     }
     $this->addElement($field);
     $field = new Selectbox("info_" . HINT_BOL_Service::INFO_LINE2 . "_question");
     $field->setId("info2_q");
     $field->setOptions($questionOptions);
     if (!empty($info[HINT_BOL_Service::INFO_LINE2]["question"])) {
         $field->setValue($info[HINT_BOL_Service::INFO_LINE2]["question"]);
     }
     $this->addElement($field);
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('hint', 'admin_save_btn'));
     $this->addElement($submit);
 }