当前位置: 首页>>代码示例>>PHP>>正文


PHP TextField::setId方法代码示例

本文整理汇总了PHP中TextField::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP TextField::setId方法的具体用法?PHP TextField::setId怎么用?PHP TextField::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextField的用法示例。


在下文中一共展示了TextField::setId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($conversationId, $opponentId)
 {
     parent::__construct('newMailMessageForm');
     $this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
     $field = new TextField('newMessageText');
     $field->setValue(OW::getLanguage()->text('mailbox', 'text_message_invitation'));
     $field->setId('newMessageText');
     $this->addElement($field);
     $field = new HiddenField('attachment');
     $this->addElement($field);
     $field = new HiddenField('conversationId');
     $field->setValue($conversationId);
     $this->addElement($field);
     $field = new HiddenField('opponentId');
     $field->setValue($opponentId);
     $this->addElement($field);
     $field = new HiddenField('uid');
     $field->setValue(UTIL_HtmlTag::generateAutoId('mailbox_conversation_' . $conversationId . '_' . $opponentId));
     $this->addElement($field);
     $submit = new Submit('newMessageSendBtn');
     $submit->setId('newMessageSendBtn');
     $submit->setName('newMessageSendBtn');
     $submit->setValue(OW::getLanguage()->text('mailbox', 'add_button'));
     $this->addElement($submit);
     if (!OW::getRequest()->isAjax()) {
         $js = UTIL_JsGenerator::composeJsString('
         owForms["newMailMessageForm"].bind( "submit", function( r )
         {
             $("#newmessage-mail-send-btn").addClass("owm_preloader_circle");
         });');
         OW::getDocument()->addOnloadScript($js);
     }
     $this->setAction(OW::getRouter()->urlFor('MAILBOX_MCTRL_Messages', 'newmessage'));
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:34,代码来源:new_mail_message_form.php

示例2: __construct

 public function __construct()
 {
     parent::__construct('upload-form');
     $language = OW::getLanguage();
     $this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
     $fileField = new FileField('photo');
     //$fileField->setRequired(true);
     $this->addElement($fileField);
     // album Field
     $albumField = new TextField('album');
     $albumField->setRequired(true);
     $albumField->setHasInvitation(true);
     $albumField->setId('album_input');
     $albumField->setInvitation($language->text('photo', 'create_album'));
     $this->addElement($albumField);
     // description Field
     $descField = new Textarea('description');
     $descField->setHasInvitation(true);
     $descField->setInvitation($language->text('photo', 'describe_photo'));
     $this->addElement($descField);
     $cancel = new Submit('cancel', false);
     $cancel->setValue($language->text('base', 'cancel_button'));
     $this->addElement($cancel);
     $submit = new Submit('submit', false);
     $this->addElement($submit);
 }
开发者ID:tammyrocks,项目名称:photo,代码行数:26,代码来源:upload_form.php

示例3: __construct

 public function __construct($photoId = NULL)
 {
     parent::__construct('photo-edit-form');
     $this->setAjax(TRUE);
     $this->setAction(OW::getRouter()->urlFor('PHOTO_CTRL_Photo', 'ajaxUpdatePhoto'));
     $this->bindJsFunction('success', 'function( data )
         {
             OW.trigger("photo.afterPhotoEdit", data);
         }');
     $photo = PHOTO_BOL_PhotoService::getInstance()->findPhotoById($photoId);
     $album = PHOTO_BOL_PhotoAlbumService::getInstance()->findAlbumById($photo->albumId);
     $photoIdField = new HiddenField('photoId');
     $photoIdField->setRequired(TRUE);
     $photoIdField->setValue($photo->id);
     $photoIdField->addValidator(new PHOTO_CLASS_PhotoOwnerValidator());
     $this->addElement($photoIdField);
     $albumField = new TextField('album');
     $albumField->setId('ajax-upload-album');
     $albumField->setRequired();
     $albumField->setValue($album->name);
     $albumField->setLabel(OW::getLanguage()->text('photo', 'create_album'));
     $albumField->addAttribute('class', 'ow_dropdown_btn ow_inputready ow_cursor_pointer');
     $albumField->addAttribute('autocomplete', 'off');
     $albumField->addAttribute('readonly');
     $this->addElement($albumField);
     $albumNameField = new TextField('album-name');
     $albumNameField->setRequired();
     $albumNameField->setValue($album->name);
     $albumNameField->addValidator(new PHOTO_CLASS_AlbumNameValidator(FALSE, NULL, $album->name));
     $albumNameField->setHasInvitation(TRUE);
     $albumNameField->setInvitation(OW::getLanguage()->text('photo', 'album_name'));
     $albumNameField->addAttribute('class', 'ow_smallmargin invitation');
     $this->addElement($albumNameField);
     $desc = new Textarea('description');
     $desc->setHasInvitation(TRUE);
     $desc->setInvitation(OW::getLanguage()->text('photo', 'album_desc'));
     $this->addElement($desc);
     $photoDesc = new PHOTO_CLASS_HashtagFormElement('photo-desc');
     $photoDesc->setValue($photo->description);
     $photoDesc->setLabel(OW::getLanguage()->text('photo', 'album_desc'));
     $this->addElement($photoDesc);
     $submit = new Submit('edit');
     $submit->setValue(OW::getLanguage()->text('photo', 'btn_edit'));
     $this->addElement($submit);
 }
开发者ID:tammyrocks,项目名称:photo,代码行数:45,代码来源:edit_form.php

示例4: render

 public function render()
 {
     $name = $this->getName();
     $hidden = new HiddenField($name, $this->getValue());
     $id = $this->getId();
     $hidden->addAttribute("id", $id);
     $ret = $hidden->render();
     if ($this->storedFieldSet === false) {
         $this->addSearchField($this->storedField);
         $this->storedFieldSet = true;
     }
     $object = array("model" => $this->model->package, "format" => "json", "fields" => $this->searchFields, "limit" => 20, "conditions" => "", "and_conditions" => $this->andConditions);
     $jsonSearchFields = array_reverse($this->searchFields);
     $object = base64_encode(serialize($object));
     $path = Application::$prefix . "/lib/models/urlaccess.php?object={$object}";
     $fields = urlencode(json_encode($jsonSearchFields));
     $text = new TextField();
     $text->addAttribute("onkeyup", "fapiUpdateSearchField('{$id}','{$path}','{$fields}',this," . ($this->boldFirst ? "true" : "false") . ",'{$this->onChangeAttribute}')");
     $text->addAttribute("autocomplete", "off");
     if ($this->getValue() != "") {
         $data = $this->model[$this->getValue()];
         for ($i = 2; $i < count($jsonSearchFields); $i++) {
             $val .= $data[0][$jsonSearchFields[$i]] . " ";
         }
         $text->setValue($val);
     }
     $text->setId($id . "_search_entry");
     $ret .= $text->render();
     $ret .= "<div class='fapi-popup' id='{$id}_search_area'></div>";
     return $ret;
 }
开发者ID:rocksyne,项目名称:wyf,代码行数:31,代码来源:ModelSearchField.php

示例5: __construct

 public function __construct(OW_Renderable $rendrable)
 {
     parent::__construct('page-add-form');
     $titleTextField = new TextField('title');
     $titleTextField->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_page_title'))->addAttribute('class', 'ow_text');
     $titleTextField->setId('title');
     $isLocal = true;
     if (OW::getRequest()->isPost()) {
         $isLocal = $_POST['type'] == 'local' ? true : false;
     }
     $titleTextField->addValidator(new PageTitleValidator());
     $this->addElement($titleTextField);
     $nameTextField = new TextField('name');
     $nameTextField->setLabel(OW::getLanguage()->text('admin', 'pages_add_menu_name'))->setRequired(true)->addAttribute('class', 'ow_text');
     $this->addElement($nameTextField);
     $visibleForCheckboxGroup = new CheckboxGroup('visible-for');
     $opts = array('1' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_guests'), '2' => OW::getLanguage()->text('admin', 'pages_edit_visible_for_members'));
     $visibleForCheckboxGroup->setOptions($opts);
     $visibleForCheckboxGroup->setLabel(OW::getLanguage()->text('admin', 'pages_edit_local_visible_for'));
     $this->addElement($visibleForCheckboxGroup);
     $metaTagsTextarea = new Textarea('meta-tags');
     $metaTagsTextarea->setLabel('Page meta tags')->setId('meta-tags')->setDescription(OW::getLanguage()->text('admin', 'pages_page_field_meta_desc'));
     $this->addElement($metaTagsTextarea);
     $contentTextArea = new Textarea('content');
     $contentTextArea->setLabel(OW::getLanguage()->text('admin', 'pages_add_page_content'))->setId('content')->setDescription(OW::getLanguage()->text('admin', 'pages_page_field_content_desc', array('src' => OW::getThemeManager()->getCurrentTheme()->getStaticImagesUrl() . 'question.png', 'url' => '#')));
     $this->addElement($contentTextArea);
     $typeHiddenField = new TextField('type');
     $type = OW::getRequest()->isPost() && $_POST['type'] ? $_POST['type'] : 'local';
     $rendrable->assign('isLocal', $isLocal);
     $typeHiddenField->setValue($type);
     $typeHiddenField->setId('type');
     $typeHiddenField->setLabel(OW::getLanguage()->text('admin', 'page_add_page_address'));
     $this->addElement($typeHiddenField);
     $localUrlTextField = new TextField('local-url');
     $localUrlTextField->addValidator(new LocalPageUrlValidator())->addValidator(new LocalPageUniqueValidator());
     $localUrlTextField->setId('url1');
     $this->addElement($localUrlTextField);
     $externalUrl = new TextField('external-url');
     $externalUrl->setInvitation('http://www.example.com')->setHasInvitation(true)->addValidator(new ADMIN_CLASS_ExternalPageUrlValidator())->setId('url2');
     $this->addElement($externalUrl);
     $extOpenInNewWindow = new CheckboxField('ext-open-in-new-window');
     $extOpenInNewWindow->setLabel(OW::getLanguage()->text('admin', 'pages_edit_external_url_open_in_new_window'));
     $this->addElement($extOpenInNewWindow);
     $submit = new Submit('submit');
     $this->addElement($submit->setValue(OW::getLanguage()->text('base', 'pages_add_submit')));
 }
开发者ID:ecki,项目名称:oxwall,代码行数:46,代码来源:pages.php

示例6: settings

 public function settings()
 {
     $language = OW::getLanguage();
     $config = OW::getConfig();
     $adminForm = new Form('adminForm');
     $element = new TextField('introWidth');
     $element->setValue($config->getValue('sitetour', 'introWidth'));
     $element->setLabel($language->text('sitetour', 'intro_width'));
     $element->setRequired();
     $element->addValidator(new IntValidator(1));
     $adminForm->addElement($element);
     $element = new TextField('guidePos');
     $element->setValue($config->getValue('sitetour', 'guidePos'));
     $element->setLabel($language->text('sitetour', 'guide_pos'));
     $element->setRequired();
     $element->addValidator(new IntValidator(1));
     $adminForm->addElement($element);
     $element = new TextField('guideColor');
     $element->setValue($config->getValue('sitetour', 'guideColor'));
     $element->setLabel($language->text('sitetour', 'guide_color'));
     $element->setId('colorBox');
     $adminForm->addElement($element);
     $element = new CheckboxField('enableForGuests');
     $element->setValue($config->getValue('sitetour', 'enableForGuests'));
     $element->setLabel($language->text('sitetour', 'enable_for_guests'));
     $adminForm->addElement($element);
     $element = new CheckboxField('enableRTL');
     $element->setValue($config->getValue('sitetour', 'enableRTL'));
     $element->setLabel($language->text('sitetour', 'enable_rtl'));
     $adminForm->addElement($element);
     $element = new Selectbox('exitOnEsc');
     $element->addOptions(array('true' => $language->text('sitetour', 'enabled'), 'false' => $language->text('sitetour', 'disabled')));
     $element->setValue($config->getValue('sitetour', 'exitOnEsc'));
     $element->setLabel($language->text('sitetour', 'exit_esc'));
     $element->setRequired();
     $adminForm->addElement($element);
     $element = new Selectbox('exitOnOverlayClick');
     $element->addOptions(array('true' => $language->text('sitetour', 'enabled'), 'false' => $language->text('sitetour', 'disabled')));
     $element->setValue($config->getValue('sitetour', 'exitOnOverlayClick'));
     $element->setLabel($language->text('sitetour', 'exit_overlay_click'));
     $element->setRequired();
     $adminForm->addElement($element);
     $element = new Selectbox('showStepNumbers');
     $element->addOptions(array('true' => $language->text('sitetour', 'enabled'), 'false' => $language->text('sitetour', 'disabled')));
     $element->setValue($config->getValue('sitetour', 'showStepNumbers'));
     $element->setLabel($language->text('sitetour', 'show_step_numbers'));
     $element->setRequired();
     $adminForm->addElement($element);
     $element = new Selectbox('keyboardNavigation');
     $element->addOptions(array('true' => $language->text('sitetour', 'enabled'), 'false' => $language->text('sitetour', 'disabled')));
     $element->setValue($config->getValue('sitetour', 'keyboardNavigation'));
     $element->setLabel($language->text('sitetour', 'keyboard_navigation'));
     $element->setRequired();
     $adminForm->addElement($element);
     $element = new Selectbox('showButtons');
     $element->addOptions(array('true' => $language->text('sitetour', 'enabled'), 'false' => $language->text('sitetour', 'disabled')));
     $element->setValue($config->getValue('sitetour', 'showButtons'));
     $element->setLabel($language->text('sitetour', 'show_buttons'));
     $element->setRequired();
     $adminForm->addElement($element);
     $element = new Selectbox('showBullets');
     $element->addOptions(array('true' => $language->text('sitetour', 'enabled'), 'false' => $language->text('sitetour', 'disabled')));
     $element->setValue($config->getValue('sitetour', 'showBullets'));
     $element->setLabel($language->text('sitetour', 'show_bullets'));
     $element->setRequired();
     $adminForm->addElement($element);
     $element = new Submit('saveSettings');
     $element->setValue($language->text('sitetour', 'admin_save_settings'));
     $adminForm->addElement($element);
     if (OW::getRequest()->isPost()) {
         if ($adminForm->isValid($_POST)) {
             $values = $adminForm->getValues();
             $config->saveConfig('sitetour', 'enableForGuests', $values['enableForGuests']);
             $config->saveConfig('sitetour', 'enableRTL', $values['enableRTL']);
             $config->saveConfig('sitetour', 'exitOnEsc', $values['exitOnEsc']);
             $config->saveConfig('sitetour', 'exitOnOverlayClick', $values['exitOnOverlayClick']);
             $config->saveConfig('sitetour', 'showStepNumbers', $values['showStepNumbers']);
             $config->saveConfig('sitetour', 'keyboardNavigation', $values['keyboardNavigation']);
             $config->saveConfig('sitetour', 'showButtons', $values['showButtons']);
             $config->saveConfig('sitetour', 'showBullets', $values['showBullets']);
             $config->saveConfig('sitetour', 'introWidth', $values['introWidth']);
             $config->saveConfig('sitetour', 'guideColor', $values['guideColor']);
             $config->saveConfig('sitetour', 'guidePos', $values['guidePos']);
             OW::getFeedback()->info($language->text('sitetour', 'user_save_success'));
         }
     }
     $this->addForm($adminForm);
     OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('sitetour')->getStaticCssUrl() . 'spectrum.css');
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('sitetour')->getStaticJsUrl() . 'spectrum.js');
     $this->setPageHeading(OW::getLanguage()->text('sitetour', 'admin_settings_title'));
     $this->setPageTitle(OW::getLanguage()->text('sitetour', 'admin_settings_title'));
     $this->setPageHeadingIconClass('ow_ic_gear_wheel');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:93,代码来源:admin.php

示例7: renderHeader

 protected function renderHeader()
 {
     $searchFunction = $this->name . "Search()";
     $table = "<table class='tapi-table' id='{$this->name}'>";
     //Render Headers
     $table .= "<thead><tr>";
     //$table .= "<td><input type='checkbox' onchange=\"wyf.tapi.checkToggle('$this->name',this)\"></td>";
     foreach ($this->headers as $i => $header) {
         $table .= "<td onclick=\"wyf.tapi.sort('" . $this->name . "','" . $this->tableData["rawFields"][$i + 1] . "')\">\n            {$header}\n            </td>";
     }
     if ($this->useInlineOperations) {
         $table .= "<td>Operations</td>";
     }
     $table .= "</tr>";
     //Render search fields
     $table .= "<tr id='tapi-{$this->name}-search' class='tapi-search-row' >";
     foreach ($this->headers as $i => $header) {
         $table .= "<td>";
         //if(count(explode(",",$this->fields[$i]))==1)
         //{
         switch ($this->fields[$i + 1]["type"]) {
             case "string":
             case "text":
                 $text = new TextField();
                 $text->setId($this->fields[$i + 1]["name"]);
                 $text->addAttribute("onkeyup", $searchFunction);
                 $table .= $text->render();
                 $name = $this->fields[$i + 1]["name"];
                 // veeery dirty code @todo clean this up small
                 //$this->searchScript .= "if($('#$name').val()!='') conditions = (conditions==''?'':conditions+' AND ')+ \"lower('\" + $('#$name').val() +\"') in lower({$this->tableData["rawFields"][$i+1]}))>0\";\n";
                 $this->searchScript .= "if(\$('#{$name}').val()!='') { conditions = (conditions==''?'':conditions+' AND ')+ \"lower({$this->tableData["rawFields"][$i + 1]}::varchar) like ?\"; boundData.push('%'+\$('#{$name}').val().toLowerCase()+'%');}\n";
                 break;
                 /*case "reference":
                                         $text = new TextField();
                                         $text->setId($this->fields[$i]["name"]);
                                         $text->addAttribute("onkeyup",$searchFunction);
                                         $table .= $text->render();
                                         $modelInfo = Model::resolvePath($this->fields[$i]["reference"]);
                                         $model = Model::load($modelInfo["model"]);
                                         $fieldName = $model->database.".".$this->fields[$i]["referenceValue"];
                                         $this->searchScript .= "if($('#{$this->fields[$i]["name"]}').val()!='') condition += escape('$fieldName='+$('#{$fields[$i]["name"]}').val()+',');";
                                         break;
                 
                                         $list = new ModelSearchField($fields[$i]["reference"],$fields[$i]["referenceValue"]);
                                         $list->boldFirst = false;
                                         $list->setId($fields[$i]["name"]);
                                         $list->addAttribute("onChange",$searchFunction);
                                         $table .= $list->render();
                                         $modelInfo = Model::resolvePath($fields[$i]["reference"]);
                                         $model = Model::load($modelInfo["model"]);
                                         $fieldName = $model->database.".".$field[$i]["name"];
                                         $this->searchScript .= "if($('#{$field["name"]}').val()!='') condition += escape('$fieldName='+$('#{$field["name"]}').val()+',');";
                                         break;*/
                 /*case "enum":
                       $list = new SelectionList();
                       foreach($fields[$i]["options"] as $value => $label)
                       {
                           $list->addOption($label,$value);
                       }
                       $list->setId($fields[$i]["name"]);
                       $table.=$list->render();
                       break;
                   case "integer":
                   case "double":
                       $options = Element::create("SelectionList")->
                                   addOption("Equals",0)->
                                   addOption("Greater than",1)->
                                   addOption("Less than",2);
                       $text = new TextField();
                       $text->setId($fields[$i]["name"]);
                       $table .= $options->render().$text->render();
                       break;
                   case "date":
                       $date = new DateField();
                       $date->setId($fields[$i]["name"]);
                       $table .= $date->render();
                       break;
                   case "boolean":
                       $options = Element::create("SelectionList")->
                                   addOption("Yes",1)->addOption("No",0);
                       $options->setId($fields[$i]["name"]);
                       $table .= $options->render();
                       break;*/
         }
         //}
         /*else
           {
               $text = new TextField();
               $text->setId("concat_field_$i");
               $text->addAttribute("onkeyup",$searchFunction);
               $table .= $text->render();
               $name = addslashes($this->model->datastore->concatenate(explode(",",$this->fields[$i])));
               $this->searchScript .= "if($('#concat_field_$i').val()!='') condition += escape('$name='+$('#concat_field_$i').val()+',');";
           }*/
         $table .= "</td>";
     }
     if ($this->useInlineOperations) {
         $table .= "<td><input class='fapi-button' type='button' value='Search' onclick='{$searchFunction}'/></td></tr></thead>";
     }
     //Render Data
//.........这里部分代码省略.........
开发者ID:ekowabaka,项目名称:cfx,代码行数:101,代码来源:MultiModelTable.php

示例8: __construct

 public function __construct()
 {
     parent::__construct('add-category-form');
     $lang = OW::getLanguage();
     $category = new TextField('category');
     $category->setRequired(true);
     $category->setHasInvitation(true);
     $category->setInvitation($lang->text('ocsfaq', 'category'));
     $category->setId("category_input");
     $this->addElement($category);
     $submit = new Submit('add');
     $submit->setValue($lang->text('ocsfaq', 'btn_add_category'));
     $this->addElement($submit);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:14,代码来源:admin.php

示例9: __construct

 public function __construct($name)
 {
     parent::__construct($name);
     $militaryTime = Ow::getConfig()->getValue('base', 'military_time');
     $language = OW::getLanguage();
     $currentYear = date('Y', time());
     $title = new TextField('title');
     $title->setRequired();
     $title->setLabel($language->text('eventx', 'add_form_title_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'title'), $title);
     OW::getEventManager()->trigger($event);
     $title = $event->getData();
     $this->addElement($title);
     $startDate = new DateField('start_date');
     $startDate->setMinYear($currentYear);
     $startDate->setMaxYear($currentYear + 5);
     $startDate->setRequired();
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'start_date'), $startDate);
     OW::getEventManager()->trigger($event);
     $startDate = $event->getData();
     $this->addElement($startDate);
     $startTime = new EventTimeField('start_time');
     $startTime->setMilitaryTime($militaryTime);
     if (!empty($_POST['endDateFlag'])) {
         $startTime->setRequired();
     }
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'start_time'), $startTime);
     OW::getEventManager()->trigger($event);
     $startTime = $event->getData();
     $this->addElement($startTime);
     $endDate = new DateField('end_date');
     $endDate->setMinYear($currentYear);
     $endDate->setMaxYear($currentYear + 5);
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'end_date'), $endDate);
     OW::getEventManager()->trigger($event);
     $endDate = $event->getData();
     $this->addElement($endDate);
     $endTime = new EventTimeField('end_time');
     $endTime->setMilitaryTime($militaryTime);
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'end_time'), $endTime);
     OW::getEventManager()->trigger($event);
     $endTime = $event->getData();
     $this->addElement($endTime);
     if (OW::getConfig()->getValue('eventx', 'enableCategoryList') == '1') {
         if (OW::getConfig()->getValue('eventx', 'enableMultiCategories') == 1) {
             $element = new CheckboxGroup('event_category');
             $element->setColumnCount(3);
         } else {
             $element = new SelectBox('event_category');
         }
         $element->setRequired(true);
         $element->setLabel($language->text('eventx', 'event_category_label'));
         foreach (EVENTX_BOL_EventService::getInstance()->getCategoriesList() as $category) {
             $element->addOption($category->id, $category->name);
         }
         $this->addElement($element);
     }
     $maxInvites = new TextField('max_invites');
     $maxInvites->setRequired();
     $validator = new IntValidator(0);
     $validator->setErrorMessage($language->text('eventx', 'invalid_integer_value'));
     $maxInvites->addValidator($validator);
     $maxInvites->setLabel($language->text('eventx', 'add_form_maxinvites_label'));
     $this->addElement($maxInvites);
     $location = new TextField('location');
     $location->setRequired();
     $location->setId('location');
     $location->setLabel($language->text('eventx', 'add_form_location_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'location'), $location);
     OW::getEventManager()->trigger($event);
     $location = $event->getData();
     $this->addElement($location);
     $whoCanView = new RadioField('who_can_view');
     $whoCanView->setRequired();
     $whoCanView->addOptions(array('1' => $language->text('eventx', 'add_form_who_can_view_option_anybody'), '2' => $language->text('eventx', 'add_form_who_can_view_option_invit_only')));
     $whoCanView->setLabel($language->text('eventx', 'add_form_who_can_view_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'who_can_view'), $whoCanView);
     OW::getEventManager()->trigger($event);
     $whoCanView = $event->getData();
     $this->addElement($whoCanView);
     $whoCanInvite = new RadioField('who_can_invite');
     $whoCanInvite->setRequired();
     $whoCanInvite->addOptions(array(EVENTX_BOL_EventService::CAN_INVITE_PARTICIPANT => $language->text('eventx', 'add_form_who_can_invite_option_participants'), EVENTX_BOL_EventService::CAN_INVITE_CREATOR => $language->text('eventx', 'add_form_who_can_invite_option_creator')));
     $whoCanInvite->setLabel($language->text('eventx', 'add_form_who_can_invite_label'));
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'who_can_invite'), $whoCanInvite);
     OW::getEventManager()->trigger($event);
     $whoCanInvite = $event->getData();
     $this->addElement($whoCanInvite);
     $desc = new WysiwygTextarea('desc');
     $desc->setLabel($language->text('eventx', 'add_form_desc_label'));
     $desc->setRequired();
     $event = new OW_Event(self::EVENTX_NAME, array('name' => 'desc'), $desc);
     OW::getEventManager()->trigger($event);
     $desc = $event->getData();
     $this->addElement($desc);
     $imageField = new FileField('image');
     $imageField->setLabel($language->text('eventx', 'add_form_image_label'));
     $this->addElement($imageField);
     if (OW::getConfig()->getValue('eventx', 'enableTagsList') == '1') {
         $tags = new TagsInputField('tags');
//.........这里部分代码省略.........
开发者ID:vazahat,项目名称:dudex,代码行数:101,代码来源:base.php


注:本文中的TextField::setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。