當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataObject::getCMSFields方法代碼示例

本文整理匯總了PHP中DataObject::getCMSFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataObject::getCMSFields方法的具體用法?PHP DataObject::getCMSFields怎麽用?PHP DataObject::getCMSFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DataObject的用法示例。


在下文中一共展示了DataObject::getCMSFields方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCMSFields

 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $HSEAScore = GroupedList::create(Score::get()->sort('ClassName'));
     $fields->addFieldToTab("Root.Main", new OptionSetField('Status', 'Status', singleton('Project')->dbObject('Status')->enumValues()));
     $fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Check List', $HSEAScore));
     $impact = GroupedList::create(Impact::get()->sort('Title'));
     $fields->addFieldToTab("Root.Main", new CheckboxsetField('Impacts', 'Impact', $impact));
     //$FinScore= DataObject::get('Score' ,"ClassName = 'Financial'");
     //		$fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Financial', $FinScore));
     //		$ServScore= DataObject::get('Score', "ClassName = 'Service'");
     //		$fields->addFieldToTab("Root.Main", new CheckboxsetField('Scores', 'Service', $ServScore));
     /*$gridFieldConfig = GridFieldConfig::create()->addComponents(
     			new GridFieldToolbarHeader(),
                 new GridFieldAddNewButton('toolbar-header-right'),
     			new GridFieldSortableHeader(),
     			new GridFieldDataColumns(),
     			new GridFieldPaginator(15),
     			new GridFieldEditButton(),
     			new GridFieldDeleteAction(),
     			new GridFieldDetailForm()
     		);
     		$gridfield = new GridField("Tasks", "Tasks", $this->Tasks(), $gridFieldConfig);
     		$fields->addFieldToTab('Root.Tasks', $gridfield);*/
     $fields->addFieldToTab("Root.Main", $dateField = new DateField("DueDate", "Date Due"));
     $dateField->setConfig('showcalendar', true);
     $dateField->setConfig('dateformat', 'dd/MM/YYYY');
     return $fields;
 }
開發者ID:micschk,項目名稱:SilverProject,代碼行數:29,代碼來源:Project.php

示例2: getCMSFields

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $cssFiles = new UploadField('CustomCSSFiles', _t('UserTemplatesExtension.CustomCSSFiles', "Custom CSS Files"));
        $jsFiles = new UploadField('CustomJSFiles', _t('UserTemplatesExtension.CustomJSFiles', "Custom JS Files"));
        $cssFiles->setFolderName(self::$css_folder);
        $jsFiles->setFolderName(self::$js_folder);
        $fields->removeByName('CustomCSSFiles');
        $fields->removeByName('CustomJSFiles');
        $templates = $this->fileBasedTemplates();
        if (count($templates)) {
            $fields->addFieldToTab('Root.Main', $dd = new DropdownField('ContentFile', _t('UserTemplatesExtension.CONTENT_FILE', 'File containing template'), $templates));
            $dd->setRightTitle('If selected, any Content set above will be ignored');
        } else {
            $fields->removeByName('ContentFile');
        }
        $fields->push($strict = CheckboxField::create('StrictActions', _t('UserTemplates.STRICT_ACTIONS', 'Require actions to be explicitly overridden')));
        $text = <<<DOC
   When applied to a page type that has sub-actions, an action template will be used ONLY if the action is listed below, and this main
\t   template will only be used for the 'index' action. If this is not checked, then this template will be used for ALL actions
\t   in the page it is applied to.
DOC;
        $strict->setRightTitle(_t('UserTemplates.STRICT_HELP', $text));
        $templates = DataList::create('UserTemplate')->filter(array('ID:not' => $this->ID));
        if ($templates->count()) {
            $templates = $templates->map();
            $fields->addFieldToTab('Root.Main', $kv = new KeyValueField('ActionTemplates', _t('UserTemplates.ACTION_TEMPLATES', 'Action specific templates'), array(), $templates));
            $kv->setRightTitle(_t('UserTemplates.ACTION_TEMPLATES_HELP', 'Specify an action name and select another user defined template to handle a specific action. Only used for Layout templates'));
        }
        $fields->addFieldToTab('Root.Main', $cssFiles);
        $fields->addFieldToTab('Root.Main', $jsFiles);
        return $fields;
    }
開發者ID:nyeholt,項目名稱:silverstripe-usertemplates,代碼行數:33,代碼來源:UserTemplate.php

示例3: getCMSFields

 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // the date field is added in a bit more complex manner so it can have the dropdown date picker
     $EventStartDate = new DateField('EventStartDate', 'First Day of Event');
     $EventStartDate->setConfig('showcalendar', true);
     $EventStartDate->setConfig('showdropdown', true);
     $fields->addFieldToTab('Root.Main', $EventStartDate, 'Content');
     // same things for the event end date
     $EventEndDate = new DateField('EventEndDate', 'Last Day of Event');
     $EventEndDate->setConfig('showcalendar', true);
     $EventEndDate->setConfig('showdropdown', true);
     $fields->addFieldToTab('Root.Main', $EventEndDate, 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventLink', 'Event Button Link (URL)'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventLinkLabel', 'Event Button Label'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventLocation', 'Event Location'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventSponsor', 'Event Sponsor'), 'Content');
     $fields->addFieldToTab('Root.Main', new TextField('EventSponsorLogoUrl', 'URL of the Event Sponsor Logo'), 'Content');
     $fields->addFieldToTab('Root.Main', new CheckboxField('IsSummit', 'Official OpenStack Summit Event'), 'Content');
     // remove unneeded fields
     $fields->removeFieldFromTab("Root.Main", "MenuTitle");
     // rename fields
     $fields->renameField("Content", "Event Page Content");
     $fields->renameField("Title", "Event Title");
     return $fields;
 }
開發者ID:Thingee,項目名稱:openstack-org,代碼行數:26,代碼來源:EventPage.php

示例4: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('eventmanagement/javascript/event-ticket-cms.js');
     $fields->removeByName('EventID');
     $fields->removeByName('StartType');
     $fields->removeByName('StartDate');
     $fields->removeByName('StartDays');
     $fields->removeByName('StartHours');
     $fields->removeByName('StartMins');
     $fields->removeByName('EndType');
     $fields->removeByName('EndDate');
     $fields->removeByName('EndDays');
     $fields->removeByName('EndHours');
     $fields->removeByName('EndMins');
     if (class_exists('Payment')) {
         $fields->insertBefore(new OptionSetField('Type', 'Ticket type', array('Free' => 'Free ticket', 'Price' => 'Fixed price ticket')), 'Price');
     } else {
         $fields->removeByName('Type');
         $fields->removeByName('Price');
     }
     foreach (array('Start', 'End') as $type) {
         $fields->addFieldsToTab('Root.Main', array(new OptionSetField("{$type}Type", "{$type} sales at", array('Date' => 'A specific date and time', 'TimeBefore' => 'A time before the event starts')), $dateTime = new DatetimeField("{$type}Date", ''), $before = new FieldGroup("{$type}Offset", new NumericField("{$type}Days", 'Days'), new NumericField("{$type}Hours", 'Hours'), new NumericField("{$type}Mins", 'Minutes'))));
         $before->setName("{$type}Offset");
         $before->setTitle(' ');
         $dateTime->getDateField()->setConfig('showcalendar', true);
         $dateTime->getTimeField()->setConfig('showdropdown', true);
     }
     $fields->addFieldsToTab('Root.Advanced', array(new TextareaField('Description', 'Description'), new NumericField('MinTickets', 'Minimum tickets per order'), new NumericField('MaxTickets', 'Maximum tickets per order')));
     return $fields;
 }
開發者ID:tim-lar,項目名稱:silverstripe-eventmanagement,代碼行數:32,代碼來源:EventTicket.php

示例5: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeFieldsFromTab('Root.Main', array('ServicesPageID', 'SortOrder'));
     $fields->dataFieldByName('Content')->setRows(20);
     return $fields;
 }
開發者ID:sentromedia,項目名稱:letsfund,代碼行數:7,代碼來源:ServicesFeature.php

示例6: getCMSFields

 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     // create a dedicated tab for open layers
     $fields->addFieldsToTab("Root.Main", array(new LiteralField("StyleMapHelp", "<h2>Style Map Help</h2>"), new LiteralField("MapLabel1", "Please click <a href='map-style-help?stage=Stage' target='_help'>here<a/> for more help.")));
     return $fields;
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-openlayers,代碼行數:7,代碼來源:OLStyleMap.php

示例7: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName("AddressID");
     $fields->addFieldToTab("Root.Main", HasOneButtonField::create("Address", "Address", $this));
     return $fields;
 }
開發者ID:burnbright,項目名稱:silverstripe-shop-shipping,代碼行數:7,代碼來源:Warehouse.php

示例8: getCMSFields

    function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->removeByName("Title");
        $fields->addFieldToTab("Root.Main", new HeaderField($name = "TitleHeader", "search for: '" . $this->Title . "'", 1), "RedirectTo");
        $fields->removeByName("Recommendations");
        if (!$this->RedirectTo) {
            $source = SiteTree::get()->filter(array("ShowInSearch" => 1))->exclude(array("ClassName" => "SearchPlusPage"));
            $sourceArray = $sourc->map()->toArray();
            //$fields->addFieldToTab("Root.Main", new MultiSelectField($name = "Recommendations", $title = "Recommendations", $sourceArray));
            $fields->addFieldToTab("Root.Main", new TreeMultiselectField($name = "Recommendations", $title = "Recommendations", "SiteTree"));
        } else {
            $fields->addFieldToTab("Root.Main", new LiteralField($name = "Recommendations", '<p>This search phrase cannot have recommendations, because it redirects to <i>' . $this->RedirectTo . '</i></p>'));
        }
        $page = SearchPlusPage::get()->first();
        if (!$page) {
            user_error("Make sure to create a SearchPlusPage to make proper use of this module", E_USER_NOTICE);
        } else {
            $fields->addFieldToTab("Root.Main", new LiteralField($name = "BackLinks", $content = '<p>
						Review a graph of all <a href="' . $page->Link() . 'popularsearchwords/100/10/">Popular Search Phrases</a> OR
						<a href="' . $page->Link() . 'results/?Search=' . urlencode($this->Title) . '&amp;action_results=Search&amp;redirect=1">try this search</a>.
					</p>'));
        }
        return $fields;
    }
開發者ID:helpfulrobot,項目名稱:sunnysideup-searchplus,代碼行數:25,代碼來源:SearchHistory.php

示例9: getCMSFields

 /**
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->push(new TextField('OPColor', 'OP Color'));
     $fields->push(new TextField('CSSColor', 'CSS Color'));
     return $fields;
 }
開發者ID:helpfulrobot,項目名稱:otago-opcolor,代碼行數:11,代碼來源:ColourSchemes.php

示例10: getCMSFields

 /**
  * Add the Meta tag CMS fields
  *
  * @since version 1.0.0
  *
  * @return object Return the current page fields
  **/
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Main');
     $fields->addFieldsToTab('Root.SEO', [HeaderField::create('Meta Tag'), DropdownField::create('Type', 'Tag type', $this->tagTypes()), TextField::create('Name'), TextField::create('Value'), HiddenField::create('PageID')]);
     return $fields;
 }
開發者ID:Cyber-Duck,項目名稱:Silverstripe-SEO,代碼行數:14,代碼來源:SEO_HeadTag.php

示例11: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName(['CaseStudyHolderID']);
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
開發者ID:helpfulrobot,項目名稱:wernerkrauss-silverstripe-casestudies,代碼行數:7,代碼來源:CaseStudy.php

示例12: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->replaceField("From", $from = new DateField("From", "Valid From - add any date and time"));
     $fields->replaceField("Until", $until = new DateField("Until", "Valid Until - add any date and time"));
     $fields->replaceField("NewPrice", new CurrencyField("NewPrice", "PRICE (OPTION 1 / 3) - only enter if there is a set new price independent of the 'standard' price."));
     $fields->replaceField("Percentage", new NumericField("Percentage", "PERCENTAGE (OPTIONAL 2/ 3) discount from 0 (0% discount) to 100 (100% discount)."));
     $fields->replaceField("Reduction", new CurrencyField("Reduction", "REDUCTION (OPTION 3 /3 ) - e.g. if you enter 2.00 then the new price will be the standard product price minus 2."));
     if (!$this->ID) {
         $fields->addFieldToTab("Root.Main", new LiteralField("SaveFirst", "<p>Please save first - and then select security groups / countries</p>"));
         $fields->removeByName("NoLongerValid");
     }
     if ($groups = Group::get()->count()) {
         $groups = Group::get();
         $fields->replaceField("Groups", new CheckboxSetField("Groups", "Who", $groups->map()->toArray()));
     } else {
         $fields->removeByName("Groups");
     }
     if ($ecommerceCountries = EcommerceCountry::get()) {
         $fields->replaceField("EcommerceCountries", new CheckboxSetField("EcommerceCountries", "Where", $ecommerceCountries->map()->toArray()));
     } else {
         $fields->removeByName("EcommerceCountries");
     }
     if (DiscountCouponOption::get()->count()) {
         $fields->replaceField("DiscountCouponOptions", new CheckboxSetField("DiscountCouponOptions", "Discount Coupons", DiscountCouponOption::get()->map()->toArray()));
     } else {
         $fields->removeByName("DiscountCouponOptions");
     }
     $from->setConfig('showcalendar', true);
     $until->setConfig('showcalendar', true);
     return $fields;
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-ecommerce-complex-pricing,代碼行數:32,代碼來源:ComplexPriceObject.php

示例13: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->dataFieldByName('Link')->setRightTitle('Fully qualified (http://www.google.com) or internal (section/page)');
     $fields->dataFieldByName('isLinkExternal')->setTitle('Open link in new window?');
     return $fields;
 }
開發者ID:helpfulrobot,項目名稱:clyonseis-silverstripe-simpleblock,代碼行數:7,代碼來源:SimpleBlock.php

示例14: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Main', new HeaderField('ProfileSectionTitle', _t('MemberProfiles.PROFILESECTION', 'Profile Section')), 'CustomTitle');
     $fields->addFieldToTab('Root.Main', new ReadonlyField('DefaultTitle', _t('MemberProfiles.SECTIONTYPE', 'Section type')), 'CustomTitle');
     return $fields;
 }
開發者ID:newsplash,項目名稱:silverstripe-memberprofiles,代碼行數:7,代碼來源:MemberProfileSection.php

示例15: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab("Root.Main", $this->getCountryField(), 'State');
     $fields->removeByName("MemberID");
     return $fields;
 }
開發者ID:burnbright,項目名稱:silverstripe-shop,代碼行數:7,代碼來源:Address.php


注:本文中的DataObject::getCMSFields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。