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


PHP TextField::setReadonly方法代码示例

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


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

示例1: setReadonly

 /**
  * @param bool $bool
  *
  * @return void
  */
 public function setReadonly($bool)
 {
     parent::setReadonly($bool);
     foreach ($this->manualFields as $field) {
         $field->setReadonly($bool);
     }
 }
开发者ID:fullscreeninteractive,项目名称:silverstripe-addressfinder,代码行数:12,代码来源:AddressFinderField.php

示例2: getCMSFields

 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->add($name = new TextField('Name', 'Name'));
     $name->setReadonly(true);
     $fields->add(new TextField('Message', 'Custom Message'));
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:8,代码来源:RSVPNumberValidationRule.php

示例3: getCMSFields

 public function getCMSFields()
 {
     $fields = new FieldList();
     $fields->add($type_txt = new TextField('Type', 'Type'));
     if ($this->ID > 0 && Summit::isDefaultEventType($this->Type)) {
         $type_txt->setReadonly(true);
     }
     $fields->add(new ColorField("Color", "Color"));
     $fields->add(new CheckboxField("BlackoutTimes", "Blackout Times"));
     $fields->add(new HiddenField('SummitID', 'SummitID'));
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:12,代码来源:SummitEventType.php

示例4: buildCurrencyField

 /**
  * Builds a new currency field based on the allowed currencies configured
  *
  * @return FormField
  */
 protected function buildCurrencyField()
 {
     $name = $this->getName();
     $allowedCurrencies = $this->getAllowedCurrencies();
     if ($allowedCurrencies) {
         $field = new DropdownField("{$name}[Currency]", _t('MoneyField.FIELDLABELCURRENCY', 'Currency'), ArrayLib::is_associative($allowedCurrencies) ? $allowedCurrencies : array_combine($allowedCurrencies, $allowedCurrencies));
     } else {
         $field = new TextField("{$name}[Currency]", _t('MoneyField.FIELDLABELCURRENCY', 'Currency'));
     }
     $field->setReadonly($this->isReadonly());
     $field->setDisabled($this->isDisabled());
     return $field;
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:18,代码来源:MoneyField.php

示例5: loadDataFrom

 public function loadDataFrom($data, $mergeStrategy = 0, $fieldList = null)
 {
     parent::loadDataFrom($data, $mergeStrategy, $fieldList);
     if ($data && $data instanceof SummitAttendee && $data->ID > 0) {
         // if we have an attendee then show the form on readonly mode ...
         $ticket = $data->Tickets()->first();
         $this->fields->insertAfter($t1 = new TextField('TicketBoughtDate', 'Ticket Bought Date', $ticket->TicketBoughtDate), 'ExternalOrderId');
         $t2 = $this->fields->fieldByName('ExternalOrderId');
         $t2->setValue($ticket->ExternalOrderId);
         $this->fields->insertAfter($t3 = new TextField('TicketType', 'Ticket Type', $ticket->TicketType()->Name), 'TicketBoughtDate');
         $t1->setReadonly(true);
         $t2->setReadonly(true);
         $t3->setReadonly(true);
     }
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:15,代码来源:SummitAttendeeInfoForm.php

示例6: loadDataFrom

 public function loadDataFrom($data, $mergeStrategy = 0, $fieldList = null)
 {
     parent::loadDataFrom($data, $mergeStrategy, $fieldList);
     if ($data && $data instanceof SummitAttendee && $data->ID > 0) {
         $this->fields->insertAfter($t1 = new TextField('TicketBoughtDate', 'Ticket Bought Date', $data->TicketBoughtDate), 'ExternalOrderId');
         $t2 = $this->fields->fieldByName('ExternalOrderId');
         $this->fields->insertAfter($t3 = new TextField('TicketType', 'Ticket Type', $data->TicketType()->Name), 'TicketBoughtDate');
         $t1->setReadonly(true);
         $t2->setReadonly(true);
         $t3->setReadonly(true);
         $checkbox = $this->getField('SharedContactInfo');
         if (!is_null($checkbox)) {
             $checkbox->setValue(intval($data->SharedContactInfo) === 1);
         }
         $btn = $this->Actions()->first();
         if (!is_null($btn)) {
             $btn->setTitle('Save');
         }
     }
 }
开发者ID:rbowen,项目名称:openstack-org,代码行数:20,代码来源:SummitAttendeeInfoForm.php

示例7: updateCMSFields

 /**
  * @param FieldList $fields
  * @return FieldList|void
  */
 public function updateCMSFields(FieldList $fields)
 {
     $oldFields = $fields->toArray();
     foreach ($oldFields as $field) {
         $fields->remove($field);
     }
     $fields->push(new LiteralField("Title", "<h2>Marketplace Type</h2>"));
     $fields->push(new TextField("Name", "Name"));
     $fields->push(new CheckboxField("Active", "Active"));
     if ($this->owner->ID > 0) {
         $slug_field = new TextField('Slug', 'Slug');
         $slug_field->setReadonly(true);
         $slug_field->setDisabled(true);
         $slug_field->performReadonlyTransformation();
         $fields->push($slug_field);
         $group_field = new TextField('Group', 'Group', $this->owner->AdminGroup()->Title);
         $group_field->setReadonly(true);
         $group_field->setDisabled(true);
         $group_field->performReadonlyTransformation();
         $fields->push($group_field);
     }
     return $fields;
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:27,代码来源:MarketPlaceTypeAdminUI.php

示例8: getQuickAccessFields

 /**
  * Returns the quick access fields to display in GridField
  * 
  * @return FieldList
  */
 public function getQuickAccessFields()
 {
     $quickAccessFields = new FieldList();
     $threeColField = '<div class="multi-col-field"><strong>%s</strong><span>%s</span><span>%s</span></div>';
     $twoColField = '<div class="multi-col-field"><strong>%s</strong><span></span><span>%s</span></div>';
     $orderNumberField = new TextField('OrderNumber__' . $this->ID, $this->fieldLabel('OrderNumber'), $this->OrderNumber);
     $orderStatusField = new TextField('SilvercartOrderStatus__' . $this->ID, $this->fieldLabel('SilvercartOrderStatus'), $this->SilvercartOrderStatus()->Title);
     $orderPositionTable = new SilvercartTableField('SilvercartOrderPositions__' . $this->ID, $this->fieldLabel('SilvercartOrderPositions'), $this->SilvercartOrderPositions());
     $shippingField = new LiteralField('SilvercartShippingMethod__' . $this->ID, sprintf($threeColField, $this->fieldLabel('SilvercartShippingMethod'), $this->SilvercartShippingMethod()->TitleWithCarrier, $this->HandlingCostShipmentNice));
     $paymentField = new LiteralField('SilvercartPaymentMethod__' . $this->ID, sprintf($threeColField, $this->fieldLabel('SilvercartPaymentMethod'), $this->SilvercartPaymentMethod()->Title, $this->HandlingCostPaymentNice));
     $amountTotalField = new LiteralField('AmountTotal__' . $this->ID, sprintf($twoColField, $this->fieldLabel('AmountTotal'), $this->AmountTotalNice));
     $orderNumberField->setReadonly(true);
     $orderStatusField->setReadonly(true);
     $mainGroup = new SilvercartFieldGroup('MainGroup');
     $mainGroup->push($orderNumberField);
     $mainGroup->push($orderStatusField);
     $quickAccessFields->push($mainGroup);
     $quickAccessFields->push($orderPositionTable);
     $quickAccessFields->push($shippingField);
     $quickAccessFields->push($paymentField);
     $quickAccessFields->push($amountTotalField);
     $this->extend('updateQuickAccessFields', $quickAccessFields);
     return $quickAccessFields;
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:29,代码来源:SilvercartOrder.php

示例9: setReadonly

 public function setReadonly($readonly)
 {
     $this->setSliderOption('disabled', (bool) $readonly);
     return parent::setReadonly($readonly);
 }
开发者ID:helpfulrobot,项目名称:lekoala-silverstripe-form-extras,代码行数:5,代码来源:SliderField.php

示例10: updateCMSFields

 /**
  * Adds a translation section
  *
  * @param FieldList $fields The FieldList
  * 
  * @return void
  *
  * @author Sebastian Diel <sdiel@pixeltricks.de>
  * @since 04.04.2013
  */
 public function updateCMSFields(FieldList $fields)
 {
     $this->getCMSFieldsIsCalled = true;
     $fields->findOrMakeTab('Root.SEO')->setTitle($this->owner->fieldLabel('SeoTab'));
     $fields->findOrMakeTab('Root.SocialMedia')->setTitle($this->owner->fieldLabel('SocialMediaTab'));
     $fields->findOrMakeTab('Root.Translations')->setTitle($this->owner->fieldLabel('TranslationsTab'));
     $googleWebmasterCodeField = new TextField('GoogleWebmasterCode', $this->owner->fieldLabel('GoogleWebmasterCode'));
     $googleAnalyticsTrackingCodeField = new TextareaField('GoogleAnalyticsTrackingCode', $this->owner->fieldLabel('GoogleAnalyticsTrackingCode'));
     $googleConversionTrackingCodeField = new TextareaField('GoogleConversionTrackingCode', $this->owner->fieldLabel('GoogleConversionTrackingCode'));
     $piwikTrackingCodeField = new TextareaField('PiwikTrackingCode', $this->owner->fieldLabel('PiwikTrackingCode'));
     $fields->addFieldToTab('Root.SEO', $googleWebmasterCodeField);
     $fields->addFieldToTab('Root.SEO', $googleAnalyticsTrackingCodeField);
     $fields->addFieldToTab('Root.SEO', $googleConversionTrackingCodeField);
     $fields->addFieldToTab('Root.SEO', $piwikTrackingCodeField);
     $facebookLinkField = new TextField('FacebookLink', $this->owner->fieldLabel('FacebookLink'));
     $twitterLinkField = new TextField('TwitterLink', $this->owner->fieldLabel('TwitterLink'));
     $xingLinkField = new TextField('XingLink', $this->owner->fieldLabel('XingLink'));
     $fields->addFieldToTab('Root.SocialMedia', $facebookLinkField);
     $fields->addFieldToTab('Root.SocialMedia', $twitterLinkField);
     $fields->addFieldToTab('Root.SocialMedia', $xingLinkField);
     $translatable = new Translatable();
     $translatable->setOwner($this->owner);
     $translatable->updateCMSFields($fields);
     $localeField = new TextField('CurrentLocale', $this->owner->fieldLabel('CurrentLocale'), i18n::get_locale_name($this->owner->Locale));
     $createButton = new InlineFormAction('createsitetreetranslation', $this->owner->fieldLabel('createsitetreetranslation'));
     $publishButton = new InlineFormAction('publishsitetree', $this->owner->fieldLabel('publishsitetree'));
     $localeField->setReadonly(true);
     $localeField->setDisabled(true);
     $createButton->setRightTitle($this->owner->fieldLabel('createsitetreetranslationDesc'));
     $createButton->includeDefaultJS(false);
     $createButton->addExtraClass('createTranslationButton');
     $publishButton->includeDefaultJS(false);
     $publishButton->addExtraClass('createTranslationButton');
     $fields->addFieldToTab('Root.Translations', $localeField, 'CreateTransHeader');
     $fields->addFieldToTab('Root.Translations', $createButton, 'createtranslation');
     $fields->addFieldToTab('Root.Translations', $publishButton, 'createtranslation');
     $fields->removeByName('createtranslation');
     $this->getCMSFieldsForSilvercart($fields);
 }
开发者ID:silvercart,项目名称:silvercart,代码行数:49,代码来源:SilvercartSiteConfig.php


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