本文整理汇总了PHP中TextareaField类的典型用法代码示例。如果您正苦于以下问题:PHP TextareaField类的具体用法?PHP TextareaField怎么用?PHP TextareaField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextareaField类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getEditForm
/**
*
* @param SS_Request $request
* @return Form
*/
public function getEditForm($id = null, $fields = null)
{
$form = parent::getEditForm($id, $fields);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// return $form;
}
if (!Permission::check('ADMIN')) {
return $form;
}
$fields = $form->Fields();
$config = $this->searchService->localEngineConfig();
$allow = $config ? $config->RunLocal : null;
$fields->push(new CheckboxField('RunLocal', _t('SolrAdmin.RUN_LOCAL', 'Run local Jetty instance of Solr?'), $allow));
if ($allow) {
$status = $this->searchService->localEngineStatus();
if (!$status) {
$fields->push(new CheckboxField('Start', _t('SolrAdmin.START', 'Start Solr')));
} else {
$fields->push(new CheckboxField('Kill', _t('SolrAdmin.Kill', 'Kill Solr process (' . $status . ')')));
}
$log = $this->searchService->getLogData(100);
$log = array_reverse($log);
$fields->push($logtxt = new TextareaField('Log', _t('SolrAdmin.LOG', 'Log')));
$logtxt->setColumns(20)->setRows(15)->setValue(implode($log));
}
$form->Actions()->push(new FormAction('saveconfig', _t('SolrAdmin.SAVE', 'Save')));
$form->Actions()->push(new FormAction('reindex', _t('SolrAdmin.REINDEX', 'Reindex')));
// $actions = new FieldSet();
// $form = new Form($this, 'EditForm', $fields, $actions);
return $form;
}
开发者ID:helpfulrobot,项目名称:silverstripe-solr,代码行数:36,代码来源:SolrAdminController.php
示例2: getCMSFields
public function getCMSFields()
{
$summit_id = isset($_REQUEST['SummitID']) ? $_REQUEST['SummitID'] : Summit::ActiveSummitID();
Requirements::javascript('summit/javascript/SummitPushNotification.js');
$f = new FieldList($rootTab = new TabSet("Root", $tabMain = new Tab('Main')));
$f->addFieldToTab('Root.Main', $txt = new TextareaField('Message', 'Message'));
$txt->setAttribute('required', 'true');
$f->addFieldToTab('Root.Main', $ddl_channel = new DropdownField('Channel', 'Channel', singleton('SummitPushNotification')->dbObject('Channel')->enumValues()));
$f->addFieldToTab('Root.Main', $ddl_events = new DropdownField('EventID', 'Event', SummitEvent::get()->filter(['Published' => 1, 'SummitID' => $summit_id])->sort('Title', 'ASC')->Map('ID', 'FormattedTitle')));
$f->addFieldToTab('Root.Main', $ddl_groups = new DropdownField('GroupID', 'Group', Group::get()->sort('Title', 'ASC')->Map('ID', 'Title')));
$f->addFieldToTab('Root.Main', new HiddenField('SummitID', 'SummitID'));
$ddl_channel->setEmptyString('--SELECT A CHANNEL--');
$ddl_channel->setAttribute('required', 'true');
$ddl_events->setEmptyString('--SELECT AN EVENT--');
$ddl_events->addExtraClass('hidden');
$ddl_groups->setEmptyString('--SELECT A GROUP--');
$ddl_groups->addExtraClass('hidden');
$config = GridFieldConfig_RelationEditor::create(50);
$config->removeComponentsByType('GridFieldAddExistingAutocompleter');
$config->removeComponentsByType('GridFieldAddNewButton');
$config->addComponent($auto_completer = new CustomGridFieldAddExistingAutocompleter('buttons-before-right'));
$auto_completer->setResultsFormat('$Title ($Email)');
$recipients = new GridField('Recipients', 'Member Recipients', $this->Recipients(), $config);
$f->addFieldToTab('Root.Main', $recipients);
return $f;
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:26,代码来源:SummitPushNotification.php
示例3: getCMSFields
public function getCMSFields()
{
$fields = new FieldList();
$fields->push(new TabSet('Root', new Tab('Main', _t('SiteTree.TABMAIN', 'Main'), new TextField('Title', _t('UniadsObject.db_Title', 'Title')))));
if ($this->ID) {
$previewLink = Director::absoluteBaseURL() . 'admin/' . UniadsAdmin::config()->url_segment . '/UniadsObject/preview/' . $this->ID;
$fields->addFieldToTab('Root.Main', new ReadonlyField('Impressions', _t('UniadsObject.db_Impressions', 'Impressions')), 'Title');
$fields->addFieldToTab('Root.Main', new ReadonlyField('Clicks', _t('UniadsObject.db_Clicks', 'Clicks')), 'Title');
$fields->addFieldsToTab('Root.Main', array(DropdownField::create('CampaignID', _t('UniadsObject.has_one_Campaign', 'Campaign'), DataList::create('UniadsCampaign')->map())->setEmptyString(_t('UniadsObject.Campaign_none', 'none')), DropdownField::create('ZoneID', _t('UniadsObject.has_one_Zone', 'Zone'), DataList::create('UniadsZone')->map())->setEmptyString(_t('UniadsObject.Zone_select', 'select one')), new NumericField('Weight', _t('UniadsObject.db_Weight', 'Weight (controls how often it will be shown relative to others)')), new TextField('TargetURL', _t('UniadsObject.db_TargetURL', 'Target URL')), new Treedropdownfield('InternalPageID', _t('UniadsObject.has_one_InternalPage', 'Internal Page Link'), 'Page'), new CheckboxField('NewWindow', _t('UniadsObject.db_NewWindow', 'Open in a new Window')), $file = new UploadField('File', _t('UniadsObject.has_one_File', 'Advertisement File')), $AdContent = new TextareaField('AdContent', _t('UniadsObject.db_AdContent', 'Advertisement Content')), $Starts = new DateField('Starts', _t('UniadsObject.db_Starts', 'Starts')), $Expires = new DateField('Expires', _t('UniadsObject.db_Expires', 'Expires')), new NumericField('ImpressionLimit', _t('UniadsObject.db_ImpressionLimit', 'Impression Limit')), new CheckboxField('Active', _t('UniadsObject.db_Active', 'Active')), new LiteralField('Preview', '<a href="' . $previewLink . '" target="_blank">' . _t('UniadsObject.Preview', 'Preview this advertisement') . "</a>")));
$app_categories = File::config()->app_categories;
$file->setFolderName($this->config()->files_dir);
$file->getValidator()->setAllowedMaxFileSize(array('*' => $this->config()->max_file_size));
$file->getValidator()->setAllowedExtensions(array_merge($app_categories['image'], $app_categories['flash']));
$AdContent->setRows(10);
$AdContent->setColumns(20);
$Starts->setConfig('showcalendar', true);
$Starts->setConfig('dateformat', i18n::get_date_format());
$Starts->setConfig('datavalueformat', 'yyyy-MM-dd');
$Expires->setConfig('showcalendar', true);
$Expires->setConfig('dateformat', i18n::get_date_format());
$Expires->setConfig('datavalueformat', 'yyyy-MM-dd');
$Expires->setConfig('min', date('Y-m-d', strtotime($this->Starts ? $this->Starts : '+1 days')));
}
$this->extend('updateCMSFields', $fields);
return $fields;
}
开发者ID:helpfulrobot,项目名称:unisolutions-silverstripe-uniads,代码行数:26,代码来源:UniadsObject.php
示例4: __construct
function __construct($controller, $name)
{
$org_field = null;
$current_user = Member::currentUser();
$current_affiliations = $current_user->getCurrentAffiliations();
if (!$current_affiliations) {
$org_field = new TextField('Organization', 'Your Organization Name');
} else {
if (count($current_affiliations) > 1) {
$source = array();
foreach ($current_affiliations as $a) {
$org = $a->Organization();
$source[$org->ID] = $org->Name;
}
$source['0'] = "-- New One --";
$ddl = new DropdownField('OrgID', 'Your Organization', $source);
$ddl->setEmptyString('-- Select Your Organization --');
$org_field = new FieldGroup();
$org_field->push($ddl);
$org_field->push($txt = new TextField('Organization', ''));
$txt->addExtraClass('new-org-name');
} else {
$org_field = new TextField('Organization', 'Your Organization Name', $current_user->getOrgName());
}
}
$fields = new FieldList($org_field, new DropdownField('Industry', 'Your Organization’s Primary Industry', ArrayUtils::AlphaSort(DeploymentSurveyOptions::$industry_options, array('' => '-- Please Select One --'), array('Other' => 'Other Industry (please specify)'))), new TextareaField('OtherIndustry', 'Other Industry'), $org_it_activity = new TextareaField('ITActivity', 'Your Organization’s Primary IT Activity'), new LiteralField('Break', '<hr/>'), new LiteralField('Break', '<p>Your Organization’s Primary Location or Headquarters</p>'), $country = new DropdownField('PrimaryCountry', 'Country', CountryCodes::$iso_3166_countryCodes), new TextField('PrimaryState', 'State / Province / Region'), new TextField('PrimaryCity', 'City'), new DropdownField('OrgSize', 'Your Organization Size (All Branches, Locations, Sites)', DeploymentSurveyOptions::$organization_size_options), new CustomCheckboxSetField('OpenStackInvolvement', 'What best describes your Organization’s involvement with OpenStack?<BR>Select All That Apply', ArrayUtils::AlphaSort(DeploymentSurveyOptions::$openstack_involvement_options)));
$org_it_activity->addExtraClass('hidden');
$country->setEmptyString('-- Select One --');
$nextButton = new FormAction('NextStep', ' Next Step ');
$actions = new FieldList($nextButton);
$validator = new RequiredFields();
Requirements::javascript('surveys/js/deployment_survey_yourorganization_form.js');
parent::__construct($controller, $name, $fields, $actions, $validator);
}
开发者ID:Thingee,项目名称:openstack-org,代码行数:34,代码来源:DeploymentSurveyYourOrganizationForm.php
示例5: EditProfileForm
/**
* @return Form|SS_HTTPResponse
*/
public function EditProfileForm()
{
if (!Member::currentUser()) {
$this->setFlash(_t('EditProfilePage.LoginWarning', 'Please login to edit your profile'), 'warning');
return $this->redirect(Director::absoluteBaseURL());
}
$firstName = new TextField('FirstName');
$firstName->setAttribute('placeholder', _t('EditProfilePage.FirstNamePlaceholder', 'Enter your first name'))->setAttribute('required', 'required')->addExtraClass('form-control');
$surname = new TextField('Surname');
$surname->setAttribute('placeholder', _t('EditProfilePage.SurnamePlaceholder', 'Enter your surname'))->setAttribute('required', 'required')->addExtraClass('form-control');
$email = new EmailField('Email');
$email->setAttribute('placeholder', _t('EditProfilePage.EmailPlaceholder', 'Enter your email address'))->setAttribute('required', 'required')->addExtraClass('form-control');
$jobTitle = new TextField('JobTitle');
$jobTitle->setAttribute('placeholder', _t('EditProfilePage.JobTitlePlaceholder', 'Enter your job title'))->addExtraClass('form-control');
$website = new TextField('Website');
$website->setAttribute('placeholder', _t('EditProfilePage.WebsitePlaceholder', 'Enter your website'))->addExtraClass('form-control');
$blurb = new TextareaField('Blurb');
$blurb->setAttribute('placeholder', _t('EditProfilePage.BlurbPlaceholder', 'Enter your blurb'))->addExtraClass('form-control');
$confirmPassword = new ConfirmedPasswordField('Password', _t('EditProfilePage.PasswordLabel', 'New Password'));
$confirmPassword->canBeEmpty = true;
$confirmPassword->setAttribute('placeholder', _t('EditProfilePage.PasswordPlaceholder', 'Enter your password'))->addExtraClass('form-control');
$fields = new FieldList($firstName, $surname, $email, $jobTitle, $website, $blurb, $confirmPassword);
$action = new FormAction('SaveProfile', _t('EditProfilePage.SaveProfileText', 'Update Profile'));
$action->addExtraClass('btn btn-primary btn-lg');
$actions = new FieldList($action);
// Create action
$validator = new RequiredFields('FirstName', 'Email');
//Create form
$form = new Form($this, 'EditProfileForm', $fields, $actions, $validator);
//Populate the form with the current members data
$Member = Member::currentUser();
$form->loadDataFrom($Member->data());
//Return the form
return $form;
}
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:38,代码来源:EditProfilePage.php
示例6: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
/* -----------------------------------------
* Color Picker
------------------------------------------*/
Requirements::css('boilerplate/css/colorpicker.css');
Requirements::javascript('boilerplate/javascript/colorpicker.min.js');
Requirements::javascript('boilerplate/javascript/colorpicker.init.js');
/* =========================================
* Settings
=========================================*/
if (!$fields->fieldByName('Root.Settings')) {
$fields->addFieldToTab('Root', new TabSet('Settings'));
}
/* -----------------------------------------
* Images
------------------------------------------*/
$fields->findOrMakeTab('Root.Settings.Images', 'Images');
$fields->addFieldsToTab('Root.Settings.Images', array($logo = new UploadField('LogoImage', _t('BoilerplateConfig.LogoImageLabel', 'Logo')), $favicon = new UploadField('Favicon', _t('BoilerplateConfig.FaviconLabel', 'Favicon'))));
$logo->setRightTitle('Choose an Image For Your Logo');
$favicon->setRightTitle('Choose an Image For Your Favicon (16x16)');
/* -----------------------------------------
* Company Details
------------------------------------------*/
$fields->findOrMakeTab('Root.Settings.Details', 'Details');
$fields->addFieldsToTab('Root.Settings.Details', array(new Textfield('Phone', _t('BoilerplateConfig.PhoneLabel', 'Phone Number')), new Textfield('Email', _t('BoilerplateConfig.EmailLabel', 'Public Email Address')), $PhysicalAddress = new HtmlEditorField('PhysicalAddress', _t('BoilerplateConfig.PhysicalAddressLabel', 'Physical Address'))));
$PhysicalAddress->setRows(3);
/* -----------------------------------------
* Tracking Code
------------------------------------------*/
$fields->findOrMakeTab('Root.Settings.TrackingCode', 'Tracking Code');
$fields->addFieldsToTab('Root.Settings.TrackingCode', array($trackingCode = new TextareaField('TrackingCode', _t('BoilerplateConfig.TrackingCodeLabel', 'Tracking Code'))));
$trackingCode->setRows(20);
}
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:34,代码来源:BoilerplateConfig.php
示例7: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Contact Form settings
$recipient_field = new EmailField('DefaultRecipient', 'Email recipient');
$recipient_field->setDescription('Default email address to send submissions to.');
$subject_field = new TextField('Subject', 'Email subject');
$subject_field->setDescription('Subject for the email.');
$default_from_field = new EmailField('DefaultFrom', 'Email from');
$default_from_field->setDescription('Default from email address.');
$fields->addFieldToTab('Root.ContactForm.Settings', $recipient_field);
$fields->addFieldToTab('Root.ContactForm.Settings', $subject_field);
$fields->addFieldToTab('Root.ContactForm.Settings', $default_from_field);
// Contact Form fields
$conf = GridFieldConfig_RelationEditor::create(10);
$conf->addComponent(new GridFieldSortableRows('SortOrder'));
$data_columns = $conf->getComponentByType('GridFieldDataColumns');
$data_columns->setDisplayFields(array('Name' => 'Name', 'Type' => 'Type', 'requiredText' => 'Required'));
$contact_form_fields = new GridField('Fields', 'Field', $this->ContactFields(), $conf);
$fields->addFieldToTab('Root.ContactForm.Fields', $contact_form_fields);
// Recipient map
$contact_fields = array();
foreach ($this->ContactFields() as $contact_field) {
$contact_fields[$contact_field->Name] = $contact_field->Name;
}
$recipient_map_field_field = new DropdownField('RecipientMapField', 'Recipient Map Field', $contact_fields);
$recipient_map_field_field->setDescription('Field used to map recipients.');
$recipient_map_field = new TextareaField('RecipientMap', 'Recipient Map');
$recipient_map_field->setDescription('Map field values to an email address (format: value:email address) one per line.');
$fields->addFieldToTab('Root.ContactForm.RecipientMap', $recipient_map_field_field);
$fields->addFieldToTab('Root.ContactForm.RecipientMap', $recipient_map_field);
return $fields;
}
开发者ID:helpfulrobot,项目名称:chtombleson-silverstripe-streamline,代码行数:33,代码来源:StreamLineContactPage.php
示例8: getFieldConfiguration
public function getFieldConfiguration()
{
$textAreaField = new TextareaField($this->getSettingName('Content'), "HTML");
$textAreaField->setRows(4);
$textAreaField->setColumns(20);
return new FieldList($textAreaField, new CheckboxField($this->getSettingName('HideFromReports'), _t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'), $this->getSetting('HideFromReports')));
}
开发者ID:nzjoel,项目名称:silverstripe-userforms,代码行数:7,代码来源:EditableLiteralField.php
示例9: __construct
function __construct($controller, $name)
{
$Name = new TextField('Name', 'Your name');
$Phone = new TextField('Phone', 'Your phone number');
$Email = new TextField('Email', 'Your email');
$Subject = new TextField('Subject', 'Subject');
$Message = new TextareaField('Message', 'Your message', '10', '45');
$Name->addExtraClass('Required');
$Email->addExtraClass('Required');
$Message->addExtraClass('Required');
$messageFields = new CompositeField($Name, $Phone, $Email, $Subject, $Message);
$fields = new FieldSet($messageFields);
$actions = new FieldSet(new FormAction('processMessage', 'send'));
Requirements::customScript('
jQuery(document).ready(function() {
jQuery("#ContactForm_ContactForm_Name").addClass("validate[required,custom[onlyLetter],length[0,100]] text-input");
jQuery("#ContactForm_ContactForm_Email").addClass("validate[required,custom[email]] text-input");
jQuery("#ContactForm_ContactForm_Message").addClass("validate[required,length[6,300]] text-input");
jQuery("#ContactForm_ContactForm").validationEngine()
});
');
parent::__construct($controller, $name, $fields, $actions);
}
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:26,代码来源:ContactForm.php
示例10: getCMSFields
public function getCMSFields()
{
$fieldBody = new TextareaField('Body', 'Inhoud');
$fieldBody->setRows(5);
$oFields = new FieldList(new TextField('Header', 'Title'), $fieldBody, new TextField('FieldLabelName', 'Dummy text in name field'), new TextField('FieldLabelEmail', 'Dummy text in email field'), new TextField('BtnLabel', 'Button label'));
if (Config::inst()->get(NewsLetterWidget_Name, NewsLetterWidget_Storage_Sys) == NewsLetterWidget_Storage_Sys_Mailchimp) {
$fldTextFieldListId = new TextField('MailChimpListID', 'Mailchimp lijst id');
$sApiKey = Config::inst()->get(NewsLetterWidget_Name, NewsLetterWidget_Storage_Sys_Mailchimp_APIKey);
if ($sApiKey == null || trim($sApiKey) == '') {
$oFields->push($fldTextFieldListId);
} else {
// fetch lists
$api = new MCAPI($sApiKey);
$retval = $api->lists();
if ($api->errorCode) {
//echo "Unable to load lists()!";
//echo "\n\tCode=".$api->errorCode;
//echo "\n\tMsg=".$api->errorMessage."\n";
} else {
//echo "Lists that matched:".$retval['total']."\n";
//echo "Lists returned:".sizeof($retval['data'])."\n";
$aOptions = array();
foreach ($retval['data'] as $list) {
//echo "Id = ".$list['id']." - ".$list['name']."\n";
//echo "Web_id = ".$list['web_id']."\n";
$aOptions[$list['id']] = $list['name'];
}
$oFields->push(new DropdownField('MailChimpListID', 'Mailchimp lijst id', $aOptions));
}
}
}
return $oFields;
}
开发者ID:hamaka,项目名称:hamaka-widgets,代码行数:33,代码来源:NewsletterWidget.php
示例11: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
$type = new DropdownField('EventType', _t('ScoutDistrict.Events.TYPE', 'Type'), array('section-meeting' => _t('ScoutDistrict.Enum.SECTIONMEETING', 'Section Meeting'), 'leaders-meeting' => _t('ScoutDistrict.Enum.LEADERSMEETING', 'Leaders Meeting'), 'activity' => _t('ScoutDistrict.Enum.ACTIVITY', 'Activity'), 'fundraising' => _t('ScoutDistrict.Enum.FUNDRAISING', 'Fundraising'), 'committee' => _t('ScoutDistrict.Enum.COMMITTEE', 'Committee'), 'camp' => _t('ScoutDistrict.Enum.CAMP', 'Camp'), 'group' => _t('ScoutDistrict.Enum.GROUP', 'Group'), 'district' => _t('ScoutDistrict.Enum.DISTRICT', 'District'), 'training' => _t('ScoutDistrict.Enum.TRAINING', 'Training'), 'other' => _t('ScoutDistrict.Enum.OTHER', 'Other')));
$type->setRightTitle(_t('ScoutDistrict.Events.TYPE_HELP', 'What Type of event is this'))->addExtraClass('help');
$location = new TextField('EventLocation', _t('ScoutDistrict.Events.LOCATION', 'Location'));
$location->setRightTitle(_t('ScoutDistrict.Events.LOCATION_HELP', 'Where is the event being held'))->addExtraClass('help');
$latitude = new TextField('EventLatitude', _t('ScoutDistrict.Events.LATITUDE', 'Latitude'));
$latitude->setRightTitle(_t('ScoutDistrict.Events.LATITUDE_HELP', 'Latitude of event Location'))->addExtraClass('help');
$longitude = new TextField('EventLongitude', _t('ScoutDistrict.Events.LONGITUDE', 'Longitude'));
$longitude->setRightTitle(_t('ScoutDistrict.Events.LONGITUDE_HELP', 'Longitude of event Location'))->addExtraClass('help');
$bookingDetails = new TextareaField('EventBookingDetails', _t('ScoutDistrict.Events.BOOKINGDETAILS', 'Booking Details'));
$bookingDetails->setRightTitle(_t('ScoutDistrict.Events.BOOKINGDETAILS_HELP', 'Details of how to book a place for the Event'))->addExtraClass('help');
$bookingURL = new TextField('EventBookingURL', _t('ScoutDistrict.Events.BOOKINGURL', 'Booking URL'));
$bookingURL->setRightTitle(_t('ScoutDistrict.Events.BOOKINGURL_HELP', 'The URL of an external site to book a place'))->addExtraClass('help');
$fields->addFieldsToTab('Root.Scouts', array($type, $location, $latitude, $longitude, $bookingDetails, $bookingURL));
$thumbnail = new UploadField('ThumbnailImage', _t('ScoutDistrict.Events.THUMBNAIL', 'Thumbnail Image'));
$thumbnail->setFolderName('event/thumbnail');
$thumbnail->setRightTitle(_t('ScoutDistrict.Events.THUMBNAIL_HELP', 'A small image for displaying in listing/aggregated content'))->addExtraClass('help');
$image = new UploadField('Image', _t('ScoutDistrict.Events.IMAGE', 'Image'));
$image->setFolderName('event/image');
$image->setRightTitle(_t('ScoutDistrict.Events.IMAGE_HELP', 'A Larger image for displaying in event header'))->addExtraClass('help');
$files = new UploadField('Files', _t('ScoutDistrict.Events.FILE', 'Files'));
$files->setFolderName('event/file');
$files->setRightTitle(_t('ScoutDistrict.Events.FILE_HELP', 'This can be a file containing information about the event or an application form, etc'))->addExtraClass('help');
$fields->addFieldsToTab('Root.Files', array($thumbnail, $image, $files));
return $fields;
}
开发者ID:helpfulrobot,项目名称:phpboyscout-silverstripe-scouts,代码行数:27,代码来源:ScoutCalenderEventExtension.php
示例12: __construct
function __construct($controller, $name)
{
// Define fields //////////////////////////////////////
$fields = new FieldList(new LiteralField('paragraph', '<p>
The questions on this page are optional, but will help us better understand the details of how you are using and interacting with OpenStack. Any information you provide on this step will be treated as private and confidential and only used in aggregate reporting.
</p>
<p>
<strong>If you do not wish to answer these questions, you make <a href="' . $controller->Link('SkipAppDevSurvey') . '">skip to the next section</a>.</strong>
</p><hr>'), new CustomCheckboxSetField('Toolkits', 'What toolkits do you use or plan to use to interact with the OpenStack API?<BR>Select All That Apply', ArrayUtils::AlphaSort(AppDevSurveyOptions::$toolkits_options, null, array('Other' => 'Other Toolkits (please specify)'))), $t1 = new TextareaField('OtherToolkits', ''), new LiteralField('Container', '<div id="wrote_your_own_container" class="hidden">'), $programming_lang = new CustomCheckboxSetField('ProgrammingLanguages', 'If you wrote your own code for interacting with the OpenStack API, what programming language did you write it in?', ArrayUtils::AlphaSort(AppDevSurveyOptions::$languages_options, null, array('Other' => 'Other (please specify)'))), $other_programming_lang = new TextareaField('OtherProgrammingLanguages', ''), new CustomCheckboxSetField('APIFormats', 'If you wrote your own code for interacting with the OpenStack API, what wire format are you using?<BR>Select All That Apply', ArrayUtils::AlphaSort(AppDevSurveyOptions::$api_format_options, null, array('Other' => 'Other Wire Format (please specify)'))), $t3 = new TextareaField('OtherAPIFormats', ''), new LiteralField('Container', '</div>'), new CustomCheckboxSetField('OperatingSystems', 'What operating systems are you using or plan on using to develop your applications?<BR>Select All That Apply', ArrayUtils::AlphaSort(AppDevSurveyOptions::$opsys_options, null, array('Other' => 'Other Development OS (please specify)'))), $t4 = new TextareaField('OtherOperatingSystems', ''), new CustomCheckboxSetField('GuestOperatingSystems', 'What guest operating systems are you using or plan on using to deploy your applications to customers?<BR>Select All That Apply', ArrayUtils::AlphaSort(AppDevSurveyOptions::$opsys_options, null, array('Other' => 'Other Development OS (please specify)'))), $t5 = new TextareaField('OtherGuestOperatingSystems', ''), new LiteralField('Break', '<hr/>'), new LiteralField('Break', '<p>Please share your thoughts with us on the state of applications on OpenStack</p>'), new TextAreaField('StruggleDevelopmentDeploying', 'What do you struggle with when developing or deploying applications on OpenStack?'), $docs = new DropdownField('DocsPriority', 'What is your top priority in evaluating API and SDK docs?', AppDevSurveyOptions::$docs_priority_options), $t6 = new TextareaField('OtherDocsPriority', ''));
$t1->addExtraClass('hidden');
$t3->addExtraClass('hidden');
$t4->addExtraClass('hidden');
$t5->addExtraClass('hidden');
$t6->addExtraClass('hidden');
$other_programming_lang->addExtraClass('hidden');
$docs->setEmptyString('-- Select One --');
// $prevButton = new CancelFormAction($controller->Link().'Login', 'Previous Step');
$nextButton = new FormAction('SaveAppDevSurvey', ' Next Step ');
$actions = new FieldList($nextButton);
// Create Validators
$validator = new RequiredFields();
Requirements::javascript('surveys/js/deployment_survey_appdevsurvey_form.js');
parent::__construct($controller, $name, $fields, $actions, $validator);
if ($AppDevSurvey = $this->controller->LoadAppDevSurvey()) {
$this->loadDataFrom($AppDevSurvey->data());
}
}
开发者ID:Thingee,项目名称:openstack-org,代码行数:27,代码来源:DeploymentSurveyAppDevSurveyForm.php
示例13: TypoForm
function TypoForm()
{
$array = array('green', 'yellow', 'blue', 'pink', 'orange');
$form = new Form($this, 'TestForm', $fields = FieldList::create(HeaderField::create('HeaderField1', 'HeaderField Level 1', 1), LiteralField::create('LiteralField', '<p>All fields up to EmailField are required and should be marked as such</p>'), TextField::create('TextField1', 'Text Field Example 1'), TextField::create('TextField2', 'Text Field Example 2'), TextField::create('TextField3', 'Text Field Example 3'), TextField::create('TextField4', ''), HeaderField::create('HeaderField2b', 'Field with right title', 2), $textAreaField = new TextareaField('TextareaField', 'Textarea Field'), EmailField::create('EmailField', 'Email address'), HeaderField::create('HeaderField2c', 'HeaderField Level 2', 2), DropdownField::create('DropdownField', 'Dropdown Field', array(0 => '-- please select --', 1 => 'test AAAA', 2 => 'test BBBB')), OptionsetField::create('OptionSF', 'Optionset Field', $array), CheckboxSetField::create('CheckboxSF', 'Checkbox Set Field', $array), CountryDropdownField::create('CountryDropdownField', 'Countries'), CurrencyField::create('CurrencyField', 'Bling bling', '$123.45'), HeaderField::create('HeaderField3', 'Other Fields', 3), NumericField::create('NumericField', 'Numeric Field '), DateField::create('DateField', 'Date Field'), DateField::create('DateTimeField', 'Date and Time Field'), CheckboxField::create('CheckboxField', 'Checkbox Field')), $actions = FieldList::create(FormAction::create('submit', 'Submit Button')), $requiredFields = RequiredFields::create('TextField1', 'TextField2', 'TextField3', 'ErrorField1', 'ErrorField2', 'EmailField', 'TextField3', 'RightTitleField', 'CheckboxField', 'CheckboxSetField'));
$textAreaField->setColumns(45);
$form->setMessage('warning message', 'warning');
return $form;
}
开发者ID:helpfulrobot,项目名称:sunnysideup-typography,代码行数:8,代码来源:Typography.php
示例14: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
if ($this->owner->Parent()->ClassName == "SectionOverviewPage") {
$summaryfield = new TextareaField('SummaryText', 'Section Summary Text');
$summaryfield->setRightTitle('Displayed on this page\'s section overview parent page (' . $this->owner->Parent()->MenuTitle . '), if left blank, uses first paragraph of the Content.');
$fields->addFieldToTab("Root.Main", $summaryfield, 'Metadata');
}
}
开发者ID:helpfulrobot,项目名称:purplespider-section-overview,代码行数:8,代码来源:SOPageExtension.php
示例15: testReadonlyDisplayUnicodes
/**
* Quick smoke test to ensure that text with unicodes is being displayed properly in readonly fields.
*/
function testReadonlyDisplayUnicodes()
{
$inputText = "These are some unicodes: äöü";
$field = new TextareaField("Test", "Test");
$field->setValue($inputText);
$field = $field->performReadonlyTransformation();
$this->assertContains('These are some unicodes: äöü', $field->Field());
}
开发者ID:nomidi,项目名称:sapphire,代码行数:11,代码来源:TextareaFieldTest.php
示例16: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->replaceField('ItemTemplate', $ta = new TextareaField('ItemTemplate', _t('ListingTemplate.ITEM_TEMPLATE', 'Item Template (use the Items variable to iterate over)')));
$ta->setRows(20);
$ta->setColumns(120);
return $fields;
}
开发者ID:helpfulrobot,项目名称:silverstripe-listingpage,代码行数:8,代码来源:ListingTemplate.php
示例17: getColumnContent
/**
* HTML for the column, content of the <td> element.
*
* @param GridField $gridField
* @param DataObject $record - Record displayed in this row
* @param string $columnName
* @return string - HTML for the column. Return NULL to skip.
*/
public function getColumnContent($gridField, $record, $columnName)
{
$field = new TextareaField('MetaDescription');
$value = $gridField->getDataFieldValue($record, $columnName);
$value = $this->formatValue($gridField, $record, $columnName, $value);
$field->setName($this->getFieldName($field->getName(), $gridField, $record));
$field->setValue($value);
return $field->Field() . $this->getErrorMessages();
}
开发者ID:helpfulrobot,项目名称:littlegiant-silverstripe-seo-editor,代码行数:17,代码来源:SEOEditorMetaDescriptionColumn.php
示例18: getFieldConfiguration
public function getFieldConfiguration()
{
$customSettings = unserialize($this->CustomSettings);
$content = isset($customSettings['Content']) ? $customSettings['Content'] : '';
$textAreaField = new TextareaField($this->getSettingName('Content'), "HTML", $content);
$textAreaField->setRows(4);
$textAreaField->setColumns(20);
return new FieldList($textAreaField, new CheckboxField($this->getSettingName('HideFromReports'), _t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'), $this->getSetting('HideFromReports')));
}
开发者ID:8secs,项目名称:cocina,代码行数:9,代码来源:EditableLiteralField.php
示例19: getFieldConfiguration
public function getFieldConfiguration()
{
$customSettings = unserialize($this->CustomSettings);
$content = isset($customSettings['Content']) ? $customSettings['Content'] : '';
$textAreaField = new TextareaField($this->getSettingName('Content'), "HTML", $content);
$textAreaField->setRows(4);
$textAreaField->setColumns(20);
return new FieldList($textAreaField);
}
开发者ID:helpfulrobot,项目名称:satrun77-editablefield,代码行数:9,代码来源:EditableFieldLiteral.php
示例20: updateCMSFields
public function updateCMSFields(FieldList $fields)
{
if ($this->owner->MediaType != __CLASS__) {
return;
}
$thumbField = $this->owner->getUploadField('ThumbnailImage', 'Thumbnail (optional - will grab from YouTube)', SitePhoto::$allowed_file_types, 'images');
$posterField = $this->owner->getUploadField('PosterImage', 'Poster Image (optional - will grab from YouTube)', SitePhoto::$allowed_file_types, 'images');
$fields->addFieldsToTab('Root.Main', array(new TextField('YouTubeVideoID', 'YouTube Video ID'), $caption = new TextareaField('Caption'), $thumbField, $posterField));
$caption->setRows(1);
}
开发者ID:helpfulrobot,项目名称:briceburg-silverstripe-sitemedia,代码行数:10,代码来源:SiteYouTubeVideo.php
注:本文中的TextareaField类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论