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


PHP Member::getCMSFields方法代码示例

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


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

示例1: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldsToTab('Root.Main', PhoneNumberField::create('Age', 'Age num'));
     $fields->addFieldsToTab('Root.Main', TextField::create('Job', 'Your Job'));
     return $fields;
 }
开发者ID:qteo94,项目名称:Silverstripe_tutorial,代码行数:7,代码来源:SSMember.php

示例2: getCMSFields

 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Password');
     $fields->removeByName('LastVisited');
     $fields->removeByName('Locale');
     $fields->removeByName('DirectGroups');
     $fields->removeByName('DateFormat');
     $fields->removeByName('TimeFormat');
     $fields->removeByName('FailedLoginCount');
     $fields->addFieldToTab('Root.Main', new TextField('StreetAddress1', 'Street Address 1'), 'StreetAddress2');
     $fields->addFieldToTab('Root.Main', new TextField('StreetAddress2', 'Street Address 2'), 'PostOfficeBox');
     $fields->addFieldToTab('Root.Main', new TextField('PostOfficeBox', 'Post Office Box Number'), 'Suburb');
     $fields->addFieldToTab('Root.Main', new TextField('PostCode', 'Post Code'), 'Country');
     $fields->addFieldToTab('Root.Main', new CountryDropdownField('Country'), 'PostOnly');
     $fields->addFieldToTab('Root.Main', new CheckboxField('PostOnly', 'Post only (no email)'), 'MembershipTypeID');
     return $fields;
 }
开发者ID:joshkosmala,项目名称:rsamembership,代码行数:18,代码来源:Membership.php

示例3: getCMSFields

 /**
  * Add some fields for managing Members in the CMS.
  * 
  * @return FieldSet
  */
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->addFieldToTab('Root.Address', new TextField('Address', _t('Customer.ADDRESS', "Address")));
     $fields->addFieldToTab('Root.Address', new TextField('AddressLine2', ''));
     $fields->addFieldToTab('Root.Address', new TextField('City', _t('Customer.CITY', "City")));
     $fields->addFieldToTab('Root.Address', new TextField('State', _t('Customer.STATE', "State")));
     $fields->addFieldToTab('Root.Address', new TextField('PostalCode', _t('Customer.POSTAL_CODE', "Postal Code")));
     $fields->addFieldToTab('Root.Address', new DropdownField('Country', _t('Customer.COUNTRY', "Country"), Geoip::getCountryDropDown()));
     $fields->removeByName('Street');
     $fields->removeByName('Suburb');
     $fields->removeByName('CityTown');
     $fields->removeByName('DateFormat');
     $fields->removeByName('TimeFormat');
     $fields->removeByName('Notes');
     $fields->removeByName('Orders');
     $fields->removeByName('Addresses');
     $fields->removeByName('Groups');
     $fields->removeByName('Permissions');
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:swipestripe-swipestripe,代码行数:26,代码来源:Customer.php

示例4: getCMSFields

 /**
  * getCMSFields
  * Alter the FieldList provided by the Member class to 
  * the requirements of an online store.
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
     $fields = parent::getCMSFields();
     /** REMOVE SCAFFOLDED FIELDS TO ADD LATER
      * -- Locale is removed. As these users will not use the CMS itself so the default values will suffice for now.
      * -- DirectGroups is removed. Customer group membership is handled by onAfterWrite().
      * -- DateFormat and TimeFormat are removed. The default will be fine for nearly all installations.
      * -- Those fields not mentioned are re-added later.
      */
     $fields->removeFieldsFromTab("Root.Main", array("FirstName", "Surname", "CompanyName", "Email", "Password", "StoreCredit", "LandlineNumber", "MobileNumber", "DirectGroups", "Locale", "FailedLoginCount", "LastVisited", "TimeFormat", "DateFormat"));
     //If the customer record has been created, display the ID of the record as the account number.
     if ($this->exists()) {
         $fields->addFieldsToTab("Root.Main", array(HeaderField::create("Account Details"), CompositeField::create(ReadonlyField::create("AccountNo", "Account Number", $this->ID), ReadonlyField::create("LastVisited", "Last Signed In", $this->LastVisited), NumericField::create("StoreCredit", "StoreCredit")->setRightTitle("The amount of credit this customer can spend on orders in your store."))));
     }
     //Add Customer Details Fields
     $fields->addFieldsToTab("Root.Main", array(HeaderField::create("Customer Details"), CompositeField::create(TextField::create("FirstName", "First Name"), TextField::create("Surname", "Surname"), TextField::create("CompanyName", "Company Name"), TextField::create("LandlineNumber", "Landline Number"), TextField::create("MobileNumber", "Mobile Number")), HeaderField::create("Login Details"), CompositeField::create(EmailField::create("Email", "Email Address"), NumericField::create("FailedLoginCount", "Failed Login Count")->setRightTitle("The total number of failed login attempts this customer has made. Set to 0 to unblock their account."))));
     //Add Confirmed Password Field befoe the FailedLoginCount field
     $password = ConfirmedPasswordField::create('Password', null, null, null, true)->setCanBeEmpty(true);
     if (!$this->ID) {
         $password->showOnClick = false;
     }
     $fields->addFieldToTab("Root.Main", $password, "FailedLoginCount");
     //Customer Address Book Tab
     $fields->addFieldsToTab("Root.AddressBook", array(HeaderField::create($this->exists() ? $this->FirstName . " " . $this->Surname . "'s Address Book" : "Customer Address Book"), CompositeField::create(LiteralField::create($title = "CustomFieldsDescription", "<div class=\"literal-field literal-field-noborder\">\n\t\t\t\t\t\tThe address book is used to store multiple customer addresses for shipping and billing purposes.\n\t\t\t\t\t</div>"), $this->exists() ? GridField::create("Customer_AddressBook", "", $this->Addresses(), GridFieldConfig_RecordEditor::create()) : LiteralField::create($title = "AddressBookNotice", "<div class=\"literal-field field\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"message notice\">\n\t\t\t\t\t\t\t<i class=\"fa fa-info-circle\"></i>\n\t\t\t\t\t\t\tThis customer doesn't exist in the system yet. To be able to see addresses for this customer you must first \n\t\t\t\t\t\t\tclick create.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>"))));
     //Customer Orders Tab
     $fields->addFieldsToTab("Root.Orders", array(HeaderField::create($this->exists() ? $this->FirstName . " " . $this->Surname . "'s Orders" : "Customer Orders"), CompositeField::create(LiteralField::create($title = "CustomFieldsDescription", "<div class=\"literal-field literal-field-noborder\">\n\t\t\t\t\t\tIf this customer has placed orders with your store you can see them below.\n\t\t\t\t\t</div>"), $this->exists() ? GridField::create("Customers_Orders", "", $this->Orders(), GridFieldConfig_RecordEditor::create()) : LiteralField::create($title = "OrdersNotice", "<div class=\"literal-field field\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"message notice\">\n\t\t\t\t\t\t\t<i class=\"fa fa-info-circle\"></i>\n\t\t\t\t\t\t\tThis customer doesn't exist in the system yet. To be able to see orders for this customer you must first \n\t\t\t\t\t\t\tclick create.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>"))));
     //Update Store Credit Field
     $storecredit = NumericField::create("StoreCredit", "Store Credit (" . Product::getDefaultCurrency() . ")");
     $fields->replaceField("StoreCredit", $storecredit);
     //Remove Automatically Generated Address GridField
     $fields->removeFieldFromTab("Root", "Addresses");
     $fields->removeFieldFromTab("Root", "Permissions");
     $fields->removeFieldFromTab("Root.Orders", "Orders");
     return $fields;
 }
开发者ID:micschk,项目名称:torindul-silverstripe-shop,代码行数:43,代码来源:Customer.php

示例5: getCMSFields

 function getCMSFields()
 {
     $fields = parent::getCMSFields();
     return $fields;
 }
开发者ID:pstaender,项目名称:ShopSystem,代码行数:5,代码来源:ShopClient.php

示例6: getCMSFields

	public function getCMSFields() {
		$fields = parent::getCMSFields();
		$fields->removeByName('Groups');

		return $fields;
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:6,代码来源:Developer.php


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