当前位置: 首页>>代码示例>>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;未经允许,请勿转载。