/**
  * Constructor
  *
  * @param Controller $controller The parent controller, necessary to
  *                               create the appropriate form action tag.
  * @param string $name The method on the controller that will return this
  *                     form object.
  * @param FieldSet|FormField $fields All of the fields in the form - a
  *                                   {@link FieldSet} of {@link FormField}
  *                                   objects.
  * @param FieldSet|FormAction $actions All of the action buttons in the
  *                                     form - a {@link FieldSet} of
  *                                     {@link FormAction} objects
  * @param bool $checkCurrentUser If set to TRUE, it will be checked if a
  *                               the user is currently logged in, and if
  *                               so, only a logout button will be rendered
  */
 function __construct($controller, $name, $fields = null, $actions = null, $checkCurrentUser = true)
 {
     $this->authenticator_class = 'MemberAuthenticator';
     $customCSS = project() . '/css/member_login.css';
     if (Director::fileExists($customCSS)) {
         Requirements::css($customCSS);
     }
     if (isset($_REQUEST['BackURL'])) {
         $backURL = $_REQUEST['BackURL'];
     } else {
         $backURL = Session::get('BackURL');
     }
     if ($checkCurrentUser && Member::currentUserID()) {
         $fields = new FieldSet();
         $actions = new FieldSet(new FormAction("logout", _t('Member.BUTTONLOGINOTHER', "Log in as someone else")));
     } else {
         if (!$fields) {
             $fields = new FieldSet(new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this), new TextField("Email", _t('Member.EMAIL'), Session::get('SessionForms.MemberLoginForm.Email'), null, $this), new EncryptField("Password", _t('Member.PASSWORD'), null, $this), new CheckboxField("Remember", _t('Member.REMEMBERME', "Remember me next time?"), Session::get('SessionForms.MemberLoginForm.Remember'), $this));
         }
         if (!$actions) {
             $actions = new FieldSet(new FormAction("dologin", _t('Member.BUTTONLOGIN', "Log in")), new FormAction("forgotPassword", _t('Member.BUTTONLOSTPASSWORD', "I've lost my password")));
         }
     }
     if (isset($backURL)) {
         $fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
     }
     parent::__construct($controller, $name, $fields, $actions);
 }
 public function getCMSFields_forPopup()
 {
     $oFields = new FieldSet();
     $oFields->push(new TextField('Title'));
     $oFields->push(new TextField('Percentage'));
     return $oFields;
 }
 /**
  * standard SS method
  *
  */
 function updateCMSFields(FieldSet &$fields)
 {
     if ($brands = Dataobject::get("Brand")) {
         $fields->removeFieldFromTab("Root.Content.Main", "Model");
         $fields->addFieldToTab('Root.Content.Main', new DropdownField('BrandID', 'Please choose an brand', $brands->map("ID", "Title", "Please Select")), "FeaturedProduct");
     }
 }
 function getCMSFields_forPopup()
 {
     $fields = new FieldSet();
     $fields->push(new TextField('Title', 'Title'));
     $fields->push(new TextField('Description'));
     return $fields;
 }
    /**
     * Constructor
     *
     * @param Controller $controller The parent controller, necessary to
     *                               create the appropriate form action tag.
     * @param string $name The method on the controller that will return this
     *                     form object.
     * @param FieldSet|FormField $fields All of the fields in the form - a
     *                                   {@link FieldSet} of {@link FormField}
     *                                   objects.
     * @param FieldSet|FormAction $actions All of the action buttons in the
     *                                     form - a {@link FieldSet} of
     *                                     {@link FormAction} objects
     * @param bool $checkCurrentUser If set to TRUE, it will be checked if a
     *                               the user is currently logged in, and if
     *                               so, only a logout button will be rendered
     */
    function __construct($controller, $name, $fields = null, $actions = null, $checkCurrentUser = true)
    {
        $this->authenticator_class = 'OpenIDAuthenticator';
        Requirements::themedCSS('openid_login');
        if (isset($_REQUEST['BackURL'])) {
            $backURL = $_REQUEST['BackURL'];
        } else {
            $backURL = Session::get('BackURL');
        }
        if ($checkCurrentUser && Member::currentUserID()) {
            $fields = new FieldSet();
            $actions = new FieldSet(new FormAction("logout", _t('Member.BUTTONLOGINOTHER')));
        } else {
            if (!$fields) {
                $fields = new FieldSet(new LiteralField("OpenIDDescription", _t('OpenIDLoginForm.DESC', '<div id="OpenIDDescription"><p>OpenID is an Internet-wide identity system
		  					that allows you to sign in to many websites with a single account.
							For more information visit <a href="http://openid.net">openid.net</a>.</p></div>
						')), new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this), new TextField("OpenIDURL", _t('OpenIDLoginForm.URL', "OpenID URL"), Session::get('SessionForms.OpenIDLoginForm.OpenIDURL'), null, $this), new CheckboxField("Remember", _t('Member.REMEMBERME'), Session::get('SessionForms.OpenIDLoginForm.Remember'), $this));
            }
            if (!$actions) {
                $actions = new FieldSet(new FormAction("dologin", _t('Member.BUTTONLOGIN')));
            }
        }
        if (isset($backURL)) {
            $fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
        }
        parent::__construct($controller, $name, $fields, $actions);
    }
 /**
  * Form fields for displaying on the Checkout form, a dropdown of {@link FlatFeeShippingRate}s
  * that are filtered depending on the shipping country selected.
  * 
  * @see FlatFeeShippingRate
  * @see Modifier::combined_form_fields()
  * @param Order $order
  * @return FieldSet
  */
 public function getFormFields($order)
 {
     //TODO use SiteConfig object to get the countries back, but at the moment
     //SiteConfig ID not being set correctly on country db rows
     $fields = new FieldSet();
     $flatFeeShippingRates = DataObject::get('FLatFeeShippingRate');
     if ($flatFeeShippingRates) {
         //TODO could probably do this filter in the DataObject::get()
         //Filter based on shipping address
         $shippingCountry = null;
         if ($order && $order->exists()) {
             $shippingAddress = $order->ShippingAddress();
             if ($shippingAddress) {
                 $shippingCountry = $shippingAddress->Country;
             }
         }
         if ($shippingCountry) {
             foreach ($flatFeeShippingRates as $rate) {
                 if ($rate->CountryCode != $shippingCountry) {
                     $flatFeeShippingRates->remove($rate);
                 }
             }
         }
         $fields->push(new FlatFeeShippingField($this, 'Flat Fee Shipping', $flatFeeShippingRates->map('ID', 'Label')));
     }
     return $fields;
 }
	/**
	 * Constructor
	 *
	 * @param Controller $controller The parent controller, necessary to
	 *                               create the appropriate form action tag.
	 * @param string $name The method on the controller that will return this
	 *                     form object.
	 * @param FieldSet|FormField $fields All of the fields in the form - a
	 *                                   {@link FieldSet} of {@link FormField}
	 *                                   objects.
	 * @param FieldSet|FormAction $actions All of the action buttons in the
	 *                                     form - a {@link FieldSet} of
	 *                                     {@link FormAction} objects
	 * @param bool $checkCurrentUser If set to TRUE, it will be checked if a
	 *                               the user is currently logged in, and if
	 *                               so, only a logout button will be rendered
	 * @param string $authenticatorClassName Name of the authenticator class that this form uses.
	 */
	function __construct($controller, $name, $fields = null, $actions = null,
											 $checkCurrentUser = true) {

		// This is now set on the class directly to make it easier to create subclasses
		// $this->authenticator_class = $authenticatorClassName;

		$customCSS = project() . '/css/member_login.css';
		if(Director::fileExists($customCSS)) {
			Requirements::css($customCSS);
		}
		
		// Focus on the email input when the page is loaded
		Requirements::customScript("
			(function($){
				$(document).ready(function() {
					$('#Email input').focus();
				});
			})(jQuery);
		");

		if(isset($_REQUEST['BackURL'])) {
			$backURL = $_REQUEST['BackURL'];
		} else {
			$backURL = Session::get('BackURL');
		}

		if($checkCurrentUser && Member::currentUserID()) {
			$fields = new FieldSet();
			$actions = new FieldSet(new FormAction("logout", _t('Member.BUTTONLOGINOTHER', "Log in as someone else")));
		} else {
			if(!$fields) {
				$fields = new FieldSet(
					new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this),
					new TextField("Email", _t('Member.EMAIL', 'Email'), Session::get('SessionForms.MemberLoginForm.Email'), null, $this),
					new PasswordField("Password", _t('Member.PASSWORD', 'Password'))
				);
				if(Security::$autologin_enabled) {
					$fields->push(new CheckboxField(
						"Remember", 
						_t('Member.REMEMBERME', "Remember me next time?")
					));
				}
			}
			if(!$actions) {
				$actions = new FieldSet(
					new FormAction('dologin', _t('Member.BUTTONLOGIN', "Log in")),
					new LiteralField(
						'forgotPassword',
						'<p id="ForgotPassword"><a href="Security/lostpassword">' . _t('Member.BUTTONLOSTPASSWORD', "I've lost my password") . '</a></p>'
					)
				);
			}
		}

		if(isset($backURL)) {
			$fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
		}

		parent::__construct($controller, $name, $fields, $actions);
	}
Beispiel #8
0
 public function updateCMSFields(FieldSet &$fields)
 {
     $tablefield = new DataObjectManager($this->owner, 'Places', 'Place', array('Name' => 'Nombre', 'Lng' => 'Longitud', 'Lat' => 'Latitud'), 'getCMSFields_forPopUp');
     $tablefield->setPageSize(100);
     $contactDetailsTab = _t('HomePage.CONTACTDETAILSTAB', "ContactDetails");
     $fields->addFieldsToTab('Root.' . $contactDetailsTab, $tablefield);
 }
 /**
  * Add custom form fields into the CMS Main tab
  *
  * @return void
  */
 public function updateCMSFields(FieldSet &$fields)
 {
     $fields->addFieldsToTab('Root.GoogleSEO', array(new HeaderField('Google Codes', 1), new HeaderField('SiteWide', 2), new TextField('GoogleVerificationCode', 'Verification Code (code only)'), new TextField('GoogleAnalyticsCode', 'Analytics Code (code only, starting with UA-)')));
     $fields->addFieldsToTab('Root.DefaultLinks', array(new HeaderField('Links & Messages for site users', 1), new TextField('HelpEmail', 'Help Email, used in footer and cross site'), new TextField('LearnLink', 'Link for Learn Site Section'), new TextField('CreateLink', 'Link for Create Site Section'), new TextField('FindLink', 'Link for Find Site Section'), new TextField('ShareLink', 'Link for Share Site Section'), new TextField('MyEventsLink', 'Link for Account Menu -> Events Site Section'), new TextField('MyEventsTitle', 'Title for Account Menu -> Events Site Section'), new TextField('MyResultsLink', 'Link for Account Menu -> Results Site Section'), new TextField('MyResultsTitle', 'Title for Account Menu -> Results Site Section'), new TextField('MyAccountLink', 'Link for Account Menu -> Account Site Section')));
     $fields->addFieldsToTab('Root.UserMessages', array(new HtmlEditorField('CreateAccountContent', 'Prompt Member to Create an Account', 4, 20), new HtmlEditorField('LoginContent', 'Prompt Member to Login', 4, 20), new HtmlEditorField('MyEventsContent', 'User Account Content', 4, 20), new HtmlEditorField('MemberDefaultMessage', 'Message Shown on Incorrect Login, Admin Login and Permissions Error', 4, 20), new TextField('MemberFormTitle', 'Title Shown on Incorrect Login, Admin Login and Permissions Error')));
     $fields->addFieldsToTab('Root.FooterContent', array(new TextField('FooterFAQLink', 'URL Segement for FAQ link in footer e.g about/'), new TextField('FooterCol1title', 'Title Col1'), new TextareaField('FooterSocialMediaMessage', 'Social Media Message'), new HtmlEditorField('FooterCol1content', 'Footer Column 1 Content', 4, 20), new TextField('FooterCol2title', 'Title Col1'), new HtmlEditorField('FooterCol2content', 'Footer Column 1 Content', 4, 20), new TextField('FooterCol3title', 'Title Col1'), new HtmlEditorField('FooterCol3content', 'Footer Column 1 Content', 4, 20)));
 }
 /**
  * Form fields for displaying on the Checkout form, a {@link FlatFeeTaxField} that has
  * a hidden field with an ID for the {@link FlatFeeTaxRate} and a description of 
  * how much the calculated tax amounts to for the current {@link Order}.
  * 
  * @see FlatFeeShippingRate
  * @see Modifier::combined_form_fields()
  * @param Order $order
  * @return FieldSet
  */
 public function getFormFields($order)
 {
     //TODO use SiteConfig object to get the countries back, but at the moment
     //SiteConfig ID not being set correctly on country db rows
     $fields = new FieldSet();
     //Get tax rate based on shipping address
     $shippingCountryID = null;
     if ($order && $order->exists()) {
         $shippingAddress = $order->ShippingAddress();
         if ($shippingAddress) {
             $shippingCountryID = $shippingAddress->CountryID;
         }
     }
     if ($shippingCountryID) {
         $flatFeeTaxRate = DataObject::get_one('FlatFeeTaxRate', "CountryID = '{$shippingCountryID}'");
         if ($flatFeeTaxRate && $flatFeeTaxRate->exists()) {
             $flatFeeTaxField = new FlatFeeTaxField($this, $flatFeeTaxRate->Label(), $flatFeeTaxRate->ID);
             //Set the amount for display on the Order form
             $flatFeeTaxField->setAmount($this->Amount($order, $flatFeeTaxField->Value()));
             $fields->push($flatFeeTaxField);
         }
     }
     //Include the js for tax fields in either case
     if (!$fields->exists()) {
         Requirements::javascript('swipestripe/javascript/FlatFeeTaxField.js');
     }
     return $fields;
 }
    function getPaymentFormFields()
    {
        $site_currency = Payment::site_currency();
        $paymentsList = '<div id="SecurePayTechCardsAvailable">';
        $count = 0;
        foreach (self::$credit_cards as $name => $image) {
            $count++;
            $class = '';
            if ($count == 1) {
                $class = "first";
            }
            if ($count % 2) {
                $class .= " even";
            } else {
                $class .= " odd";
            }
            $paymentsList .= '<img src="' . $image . '" alt="' . $name . '" class="SecurePayTechCardImage' . $count . '" />';
        }
        Requirements::customScript('
			function paymark_verify(merchant) {
				window.open ("http://www.paymark.co.nz/dart/darthttp.dll?etsl&tn=verify&merchantid=" + merchant, "verify", "scrollbars=yes, width=400, height=400");
			}
		', 'paymark_verify');
        $paymentsList .= '
			<img height="30" src="payment_securatech/images/paymark_small.png" alt="Paymark Certified" onclick="paymark_verify (' . "'" . self::get_spt_merchant_id() . "'" . ')" class="last" />
			</div>';
        $fieldSet = new FieldSet();
        $fieldSet->push(new LiteralField('SPTInfo', $paymentsList));
        return $fieldSet;
    }
 /**
  * Adds group select fields to CMS
  * 
  * @param FieldSet $fields
  * @return void
  */
 public function updateCMSFields(FieldSet &$fields)
 {
     // Only modify folder objects with parent nodes
     if (!$this->owner instanceof Folder || !$this->owner->ID) {
         return;
     }
     // Only allow ADMIN and SECURE_FILE_SETTINGS members to edit these options
     if (!Permission::checkMember(Member::currentUser(), array('ADMIN', 'SECURE_FILE_SETTINGS'))) {
         return;
     }
     // Update Security Tab
     $secureFilesTab = $fields->findOrMakeTab('Root.' . _t('SecureFiles.SECUREFILETABNAME', 'Security'));
     $secureFilesTab->push(new HeaderField(_t('SecureFiles.GROUPACCESSTITLE', 'Group Access')));
     $secureFilesTab->push(new TreeMultiselectField('GroupPermissions', _t('SecureFiles.GROUPACCESSFIELD', 'Group Access Permissions')));
     if ($this->owner->InheritSecured()) {
         $permissionGroups = $this->owner->InheritedGroupPermissions();
         if ($permissionGroups->Count()) {
             $fieldText = implode(", ", $permissionGroups->map());
         } else {
             $fieldText = _t('SecureFiles.NONE', "(None)");
         }
         $InheritedGroupsField = new ReadonlyField("InheritedGroupPermissionsText", _t('SecureFiles.GROUPINHERITEDPERMS', 'Inherited Group Permissions'), $fieldText);
         $InheritedGroupsField->addExtraClass('prependUnlock');
         $secureFilesTab->push($InheritedGroupsField);
     }
 }
 public function __construct($controller, $method, $fields = null, $actions = null, $checkCurrentUser = true)
 {
     if (isset($_REQUEST['BackURL'])) {
         $backURL = $_REQUEST['BackURL'];
     } else {
         $backURL = Session::get('BackURL');
     }
     if ($checkCurrentUser && Member::currentUser() && Member::logged_in_session_exists()) {
         $fields = new FieldSet(new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this));
         $actions = new FieldSet(new FormAction("logout", _t('Member.BUTTONLOGINOTHER', "Log in as someone else")));
     } else {
         if (!$fields) {
             $fields = new FieldSet(new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this));
             if (Security::$autologin_enabled) {
                 $fields->push(new CheckboxField("Remember", _t('Member.REMEMBERME'), Session::get('SessionForms.LinkedinLoginForm.Remember'), $this));
             }
         }
         if (!$actions) {
             $actions = new FieldSet(new ImageFormAction('dologin', 'Sign in with LinkedIn', 'linkedin/Images/linkedin.png'));
         }
     }
     if (!empty($backURL)) {
         $fields->push(new HiddenField('BackURL', 'BackURL', $backURL));
     }
     parent::__construct($controller, $method, $fields, $actions);
 }
 /**
  * Adds fields to the Member Ecommerce FieldSet.
  * In this case, we add the name of the organisation as READ-ONLY.
  * @param FieldSet $fields
  * @return FieldSet
  */
 function augmentEcommerceFields(&$fields)
 {
     if ($group = $this->owner->getCorporateAccountGroup()) {
         $fields->push(new ReadonlyField("OrganisationName", _t("EcommerceCorporateAccount.FOR", "For"), $group->CombinedCorporateGroupName()));
     }
     return $fields;
 }
 /**
  * Initiate the standard Metadata catalogue search form. The 
  * additional parameter $defaults defines the default values for the form.
  * 
  * @param Controller $controller The parent controller, necessary to create the appropriate form action tag.
  * @param String $name The method on the controller that will return this form object.
  * @param FieldSet $fields All of the fields in the form - a {@link FieldSet} of {@link FormField} objects.
  * @param FieldSet $actions All of the action buttons in the form - a {@link FieldSet} of {@link FormAction} objects
  * @param Validator $validator Override the default validator instance (Default: {@link RequiredFields})
  * @param Array $defaults Override the default values of the form.		 
  */
 function __construct($controller, $name, FieldSet $fields = null, FieldSet $actions = null, $validator = null, $defaults = null)
 {
     $format = $defaults['format'];
     $searchTerm = $defaults['searchTerm'];
     $bboxUpper = $bboxLower = null;
     if (isset($defaults['bboxUpper']) && isset($defaults['bboxLower'])) {
         $bboxUpper = $defaults['bboxUpper'];
         $bboxLower = $defaults['bboxLower'];
     }
     $values = CataloguePage_Controller::get_standard_names();
     $upperField = new HiddenField('bboxUpper', _t('SearchForm.SEARCH', 'bboxUpper'), $bboxUpper);
     $upperField->addExtraClass('upper');
     $lowerField = new HiddenField('bboxLower', _t('SearchForm.SEARCH', 'bboxLower'), $bboxLower);
     $lowerField->addExtraClass('lower');
     if (!$fields) {
         $fields = new FieldSet(new TextField('searchTerm', _t('SearchForm.SEARCH', 'Search'), $searchTerm), $upperField, $lowerField, new OptionsetField('format', _t('SearchForm.MetadataStandard', 'Metadata Standard'), $values, $format));
     }
     if (singleton('SiteTree')->hasExtension('Translatable')) {
         $fields->push(new HiddenField('locale', 'locale', Translatable::get_current_locale()));
     }
     if (!$actions) {
         $actions = new FieldSet(new FormAction("submit", _t('SearchForm.Search', 'Search')));
     }
     parent::__construct($controller, $name, $fields, $actions);
     $this->setFormMethod('get');
 }
 public function getCMSFields_forPopup()
 {
     $fields = new FieldSet();
     $fields->push(new TextareaField('Caption'));
     $fields->push(new ImageField('Photo'));
     return $fields;
 }
 function getCMSFields()
 {
     $fields = new FieldSet(new TextField('SearchPhrase', 'Search For'), new TextField('SearchTitle', 'Title'), new TextField('SearchSubject', 'Subject'));
     $fields->merge(parent::getCMSFields());
     $fields->removeByName('TwitterUser');
     return $fields;
 }
	function getCMSFields_forPopup() {
		$fields = new FieldSet();
		
		$fields->push(new FileUploadField('Attachment'));
		
		return $fields;
	}
 /**
  * Adds token creation fields to CMS
  * 
  * @param FieldSet $fields
  * @return void
  */
 public function updateCMSFields(FieldSet &$fields)
 {
     // Only modify file objects with parent nodes
     if (!$this->owner instanceof Folder || !$this->owner->ID) {
         return;
     }
     // Only allow ADMIN and SECURE_FILE_SETTINGS members to edit these options
     if (!Permission::checkMember(Member::currentUser(), array('ADMIN', 'SECURE_FILE_SETTINGS'))) {
         return;
     }
     // Update Security Tab
     $secureFilesTab = $fields->findOrMakeTab('Root.' . _t('SecureFiles.SECUREFILETABNAME', 'Security'));
     $secureFilesTab->push(new HeaderField(_t('SecureFiles.TOKENACCESSTITLE', 'Token Access')));
     if (!$this->owner->containsFiles()) {
         $secureFilesTab->push(new ReadonlyField('DummyTokenList', '', _t('SecureFiles.NOFILESINFOLDER', 'There are no files in this folder.')));
         return;
     }
     $secureFilesTab->push($tokenList = new ComplexTableField($this->owner, 'ContainedFileTokens', 'SecureFileAccessToken', null, null, "File.ParentID = '{$this->owner->ID}'", $sourceSort = null, "JOIN File ON FileID = File.ID"));
     $tokenList->setParentIdName('FolderID');
     $tokenList->setRelationAutoSetting(false);
     // Remove add link if there are no files in this folder
     if (!$this->owner->containsFiles()) {
         $tokenList->setPermissions(array('edit', 'delete'));
     }
 }
 function getCMSFields_forPopup()
 {
     $fields = new FieldSet();
     $fields->push(new TextField('Title'));
     $fields->push(new FileIFrameField('KmlFile'));
     return $fields;
 }
 public function getCMSFields_forPopup()
 {
     $oFields = new FieldSet();
     $oFields->push(new TextField('FieldName', 'V.Important: No Spaces, Camel Case and abbreviate where possible'));
     $oFields->push(new TextField('Title'));
     $oFields->push(new TextField('Description'));
     return $oFields;
 }
 /**
  * Create {@link ComplexTableField} for managing {@link FlatFeeShippingRate}s.
  * 
  * @see DataObjectDecorator::updateCMSFields()
  */
 function updateCMSFields(FieldSet &$fields)
 {
     $fields->findOrMakeTabSet('Root.Shop.Shipping');
     $fields->addFieldToTab("Root.Shop.Shipping", new Tab('FlatFeeShipping'));
     $managerClass = class_exists('DataObjectManager') ? 'DataObjectManager' : 'ComplexTableField';
     $flatFeeManager = new $managerClass($this->owner, 'FlatFeeShippingRates', 'FlatFeeShippingRate', array('Title' => 'Label', 'Description' => 'Description', 'Country.Title' => 'Country', 'SummaryOfAmount' => 'Amount'), 'getCMSFields_forPopup');
     $fields->addFieldToTab("Root.Shop.Shipping.FlatFeeShipping", $flatFeeManager);
 }
 function updateCMSFields(FieldSet &$fields)
 {
     $bt = defined('DB::USE_ANSI_SQL') ? "\"" : "`";
     if (DataObject::get_one("FormFieldExplanation", "{$bt}ParentID{$bt} = " . $this->owner->ID)) {
         $fields->addFieldToTab("Root.Content.FormExplanations", $this->getFormFieldExplanationHasManyTable());
     }
     return $fields;
 }
 /**
  * Update SiteConfig with the top level fields
  *
  * @param FieldSet $fields 
  * @return void
  */
 function updateCMSFields(&$fields)
 {
     $fields->addFieldsToTab("Root.Access", array(new HeaderField(_t('SiteConfigCMSWorkflow.PUBLISHAPPROVEDHEADER', "Who can publish requests inside the CMS?"), 2), $actionTypeField = new OptionsetField("CanPublishType", "", array("LoggedInUsers" => _t('SiteTree.EDITANYONE', "Anyone who can log-in to the CMS"), "OnlyTheseUsers" => _t('SiteTree.EDITONLYTHESE', "Only these people (choose from list)")), "OnlyTheseUsers"), $actionerGroupsField = new TreeMultiselectField("PublisherGroups", "Publisher groups")));
     if (!Permission::check('ADMIN')) {
         $fields->replaceField('CanPublishType', $actionTypeField->performReadonlyTransformation());
         $fields->replaceField('PublisherGroups', $actionerGroupsField->performReadonlyTransformation());
     }
 }
 /**
  * @param FieldSet $fields 
  */
 public function updateCMSFields($fields)
 {
     $fields->addFieldsToTab('Root.Content.PublishingSchedule', array($dt = new Datetimefield('PublishOnDate', _t('AdvancedWorkflow.PUBLISH_ON', 'Publish on')), $ut = new Datetimefield('UnPublishOnDate', _t('AdvancedWorkflow.UNPUBLISH_ON', 'Un-publish on'))));
     $dt->getDateField()->setConfig('showcalendar', true);
     $dt->getTimeField()->setConfig('showdropdown', true);
     $ut->getDateField()->setConfig('showcalendar', true);
     $ut->getTimeField()->setConfig('showdropdown', true);
 }
 /**
  *
  *
  * @return unknown
  */
 public function getCMSFields_forPopup()
 {
     $f = new FieldSet(new TextField('Title', _t("PodcastEpisode.Title", "Title")), new TextField('Artist', _t("PodcastEpisode.Artist", "Artist")), new TextField('Duration', _t("PodcastEpisode.Duration", "Duration") . '(MM:SS)'), new DatePickerField('Date', _t("PodcastEpisode.Date", "Date")), new FileIFrameField('Attachment', _t("PodcastEpisode.Attachment", "Attachment")));
     if ($this->PodcastPage()->PagePerEpisode) {
         $f->push(new SimpleTinyMCEField('ShowNotes', _t("PodcastEpisode.ShowNotes", "Show Notes:")));
     }
     return $f;
 }
 public function updateCMSFields(FieldSet &$fields)
 {
     $tab = "Root.Jobamatic";
     // Create a new tab to hold our jobamatic settings so we don't clutter up the other tabs.
     $fields->findOrMakeTab($tab, "Jobamatic");
     $fields->addFieldToTab($tab, new TextField("jobamatic_publisher_id", "Publisher ID"));
     $fields->addFieldToTab($tab, new TextField("jobamatic_domain", "Domain"));
 }
 /**
  * Create fields for editing a ProductImage in the CMS.
  * 
  * @return FieldSet
  */
 public function getCMSFields_forPopup()
 {
     $fields = new FieldSet();
     $fields->push(new TextareaField('Caption'));
     $imageUploadField = class_exists('ImageUploadField') ? new ImageUploadField('Image') : new FileIFrameField('Image');
     $fields->push($imageUploadField);
     return $fields;
 }
 public function updateCMSFields(FieldSet $fields)
 {
     $fields->replaceField('TrackedLinks', $tracked = new TableListField('LinkViews', 'NewsletterLinkView', null, '"NewsletterID" = ' . $this->owner->ID, '"Created" DESC'));
     $tracked->setPermissions(array('show', 'export'));
     $viewers = new TableListField('Views', 'NewsletterView', null, '"NewsletterID" = ' . $this->owner->ID, '"Created" DESC');
     $viewers->setPermissions(array('show', 'export'));
     $fields->addFieldsToTab('Root.ViewedBy', array(new LiteralField('ViewsNote', '<p>The viewed by list may not be ' . 'accurate, as many email clients block images used for ' . 'tracking by default.</p>'), $viewers));
 }
 function updateCMSFields(FieldSet &$fields)
 {
     //$fields->addFieldToTab('Root.RewardPoints', new NumericField('PointsPrice', 'The number of reward points it costs to purchase this product as a reward. Only products that have a non-zero value will be available as rewards.'));
     if ($this instanceof SiteTree) {
         $fields->addFieldToTab('Root.Content.RewardPoints', new NumericField('PointsValue', 'The number of rewards points received when this product is purchased. This value is optional, the product reward points value will be calculated from the product price if this value is zero.'));
     } else {
         $fields->addFieldToTab('Root.RewardPoints', new NumericField('PointsValue', 'The number of rewards points received when this product is purchased. This value is optional, the product reward points value will be calculated from the product price this value is zero.'));
     }
 }