public function updateCMSFields(FieldSet $fields)
 {
     $service = singleton('WorkflowService');
     if ($effective = $service->getDefinitionFor($this->owner)) {
         $effectiveTitle = $effective->Title;
     } else {
         $effectiveTitle = _t('WorkflowApplicable.NONE', '(none)');
     }
     $allDefinitions = array(_t('WorkflowApplicable.INHERIT', 'Inherit from parent'));
     if ($definitions = $service->getDefinitions()) {
         $allDefinitions += $definitions->map();
     }
     $tab = $fields->fieldByName('Root') ? 'Root.Workflow' : 'BottomRoot.Workflow';
     $applyWorkflowField = null;
     $fields->addFieldToTab($tab, new HeaderField('AppliedWorkflowHeader', _t('WorkflowApplicable.APPLIEDWORKFLOW', 'Applied Workflow')));
     if (Permission::check('APPLY_WORKFLOW')) {
         $fields->addFieldToTab($tab, new DropdownField('WorkflowDefinitionID', _t('WorkflowApplicable.DEFINITION', 'Applied Workflow'), $allDefinitions));
     }
     $fields->addFieldToTab($tab, new ReadonlyField('EffectiveWorkflow', _t('WorkflowApplicable.EFFECTIVE_WORKFLOW', 'Effective Workflow'), $effectiveTitle));
     $fields->addFieldToTab($tab, new HeaderField('WorkflowLogHeader', _t('WorkflowApplicable.WORKFLOWLOG', 'Workflow Log')));
     $fields->addFieldToTab($tab, $logTable = new ComplexTableField($this->owner, 'WorkflowLog', 'WorkflowInstance', null, 'getActionsSummaryFields', sprintf('"TargetClass" = \'%s\' AND "TargetID" = %d', $this->owner->class, $this->owner->ID)));
     $logTable->setRelationAutoSetting(false);
     $logTable->setPermissions(array('show'));
     $logTable->setPopupSize(760, 420);
 }
 /**
  * standard SS method
  *
  */
 function updateCMSFields(FieldSet &$fields)
 {
     $fields->addFieldToTab('Root.Content', new Tab(ProductVariation::get_plural_name(), new HeaderField(ProductVariation::get_plural_name() . " for {$this->owner->Title}"), $this->owner->getVariationsTable(), new CreateEcommerceVariations_Field('VariationMaker', '', $this->owner->ID)));
     if ($this->owner->Variations() && $this->owner->Variations()->count()) {
         $fields->addFieldToTab('Root.Content.Main', new LabelField('variationspriceinstructions', 'Price - Because you have one or more variations, you can vary the price in the "' . ProductVariation::get_plural_name() . '" tab. You set the default price here.'), 'Price');
         $fields->addFieldToTab('Root.Content.Details', new LiteralField('UpdateVariationsPrices', "<p class=\"message good\">Click <a href=\"{$this->owner->Link('updatevariationpricefromproduct')}\">here</a> to update all the variations with the price above.</p>"), 'InternalItemID');
     }
 }
 /**
  * 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);
 }
 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 {@link ComplexTableField} for managing {@link FlatFeeTaxRate}s.
  * 
  * @see DataObjectDecorator::updateCMSFields()
  */
 function updateCMSFields(FieldSet &$fields)
 {
     //$fields->addFieldToTab("Root", new TabSet('Shop'));
     $fields->addFieldToTab("Root.Shop", new TabSet('Tax'));
     $fields->addFieldToTab("Root.Shop.Tax", new Tab('FlatFeeTax'));
     $managerClass = class_exists('DataObjectManager') ? 'DataObjectManager' : 'ComplexTableField';
     $flatFeeManager = new $managerClass($this->owner, 'FlatFeeTaxRates', 'FlatFeeTaxRate', array('Title' => 'Label', 'Description' => 'Description', 'Country.Title' => 'Country', 'SummaryOfRate' => 'Rate'), 'getCMSFields_forPopup');
     $fields->addFieldToTab("Root.Shop.Tax.FlatFeeTax", $flatFeeManager);
 }
 function getCMSFields_forPopup()
 {
     $fields = new FieldSet(new TabSet('Root'));
     //Name
     $fields->addFieldToTab("Root.Name", new TextField('VideoName', 'Name'));
     //Video
     $fields->addFieldToTab("Root.Video", new TextField('URL', 'URL Code'));
     return $fields;
 }
 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.'));
     }
 }
 public function updateDateTimeCMSFields(FieldSet $fields)
 {
     if (!$this->owner->isInDB()) {
         $fields->addFieldToTab('Root.Resources', new LiteralField('BookResourcesNote', '<p>You can book resources after you save for the first time.</p>'));
         return;
     }
     $fields->addFieldToTab('Root.Resources', $res = new ManyManyPickerField($this->owner, 'Resources', 'Booked Resources For This Event', array('ExtraFields' => 'getCmsExtraFields', 'ShowPickedInSearch' => false, 'PopupHeight' => 350)));
     $res->getSearchField()->setOption('FilterCallback', array($this->owner, 'filterEventResource'));
 }
 public function updateCMSFields(FieldSet $fields) {
 	$fields->addFieldToTab("Root.CongressAPI", new LiteralField("Instructions", "<p>The Congress API uses the Sunlight Congress API, and requires an API key.
 	You can register to get an API key here: <a href='http://services.sunlightlabs.com/accounts/register/' target='_blank'>http://services.sunlightlabs.com/accounts/register/</a>"));
     $fields->addFieldToTab("Root.CongressAPI", new TextField("SLApiKey", "Sunlight API Key"));
     
     $fields->addFieldToTab("Root.CongressAPI", new LiteralField("Instructions", "<p>The Congress API uses the IPInfoDB's API for gathering location
     info from IP address, and it requires an API key as well.
 	You can register to get an API key here: <a href='http://www.ipinfodb.com/register.php' target='_blank'>http://www.ipinfodb.com/register.php</a>"));
     $fields->addFieldToTab("Root.CongressAPI", new TextField("IPInfoKey", "IPInfoDB API Key"));
 }
 /**
  * Add UrlParent SiteTree Dropdown to Behaviour Tab
  *
  * @param FieldSet $fields
  */
 public function updateCMSFields(FieldSet &$fields)
 {
     //$baseURLField = $fields->fieldByName('BaseUrlLabel');
     $link = $this->Link();
     $link = substr($link, 1);
     $link = str_replace($this->owner->URLSegment . '/', '', $link);
     $baseUrlField = new LabelField('BaseUrlLabel', $link);
     $fields->addFieldToTab('Root.Content.Metadata', $baseUrlField, 'URLSegment');
     $fields->addFieldToTab('Root.Behaviour', new TreeDropdownField("UrlParentID", 'URL Parent', 'SiteTree'));
 }
예제 #11
0
 /**
  * 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");
     }
 }
 /**
  * standard SS method
  *
  */
 function updateCMSFields(FieldSet &$fields)
 {
     // is it a product or variation
     if ($this->owner instanceof SiteTree) {
         if (!$this->owner->Variations()->exists()) {
             $tabName = "Root.Content.Main";
             $fieldName = "Weight";
             $fields->addFieldToTab($tabName, new NumericField('SpecialPrice', 'Special Price (0.00 will be ignored)', '', 12), $fieldName);
             $fields->addFieldToTab($tabName, new NumericField('Discount', 'Percentage Discount', '', 2), $fieldName);
         }
     } else {
         // it's a variation and hopefully has fields
         $fields->insertAfter(new NumericField('SpecialPrice', 'Special Price (0.00 will be ignored)', '', 12), "Price");
         $fields->insertAfter(new NumericField('Discount', 'Percentage Discount', '', 2), "SpecialPrice");
     }
 }
 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;
 }
    /**
     * Adding fields for shop settings such as email, license key.
     * 
     * @see DataObjectDecorator::updateCMSFields()
     */
    function updateCMSFields(FieldSet &$fields)
    {
        $fields->findOrMakeTabSet('Root.Shop');
        //License key
        $fields->addFieldToTab("Root.Shop", new Tab('LicenseKey'));
        $licenseKeyField = new TextField('LicenseKey', _t('ShopSettings.LICENSEKEY', 'License Key'), self::$license_key);
        $fields->addFieldToTab('Root.Shop.LicenseKey', $licenseKeyField->performReadonlyTransformation());
        //TODO include the license here in a text area field and some info about setting the license key perhaps
        //Shop emails
        $fields->addFieldToTab("Root.Shop", new TabSet('Emails'));
        $fields->addFieldToTab("Root.Shop.Emails", new Tab('Receipt'), new Tab('Notification'));
        $fields->addFieldToTab('Root.Shop.Emails.Receipt', new TextField('ReceiptFrom', _t('ShopSettings.FROM', 'From')));
        $receiptTo = new TextField('ReceiptTo', _t('ShopSettings.TO', 'To'));
        $receiptTo->setValue(_t('ShopSettings.RECEIPT_TO', 'Sent to customer'));
        $receiptTo = $receiptTo->performReadonlyTransformation();
        $fields->addFieldToTab('Root.Shop.Emails.Receipt', $receiptTo);
        $fields->addFieldToTab('Root.Shop.Emails.Receipt', new TextField('ReceiptSubject', _t('ShopSettings.SUBJECT_LINE', 'Subject line')));
        $fields->addFieldToTab('Root.Shop.Emails.Receipt', new TextareaField('ReceiptBody', _t('ShopSettings.MESSAGE', 'Message (order details are included in the email)'), 8));
        $fields->addFieldToTab('Root.Shop.Emails.Receipt', new TextareaField('EmailSignature', _t('ShopSettings.SIGNATURE', 'Signature'), 8));
        $notificationFrom = new TextField('NotificationFrom', _t('ShopSettings.FROM', 'From'));
        $notificationFrom->setValue(_t('ShopSettings.NOTIFICATION_FROM', 'Customer email address'));
        $notificationFrom = $notificationFrom->performReadonlyTransformation();
        $fields->addFieldToTab('Root.Shop.Emails.Notification', $notificationFrom);
        $fields->addFieldToTab('Root.Shop.Emails.Notification', new TextField('NotificationTo', _t('ShopSettings.TO', 'To')));
        $fields->addFieldToTab('Root.Shop.Emails.Notification', new TextField('NotificationSubject', _t('ShopSettings.SUBJECT_LINE', 'Subject line')));
        $fields->addFieldToTab('Root.Shop.Emails.Notification', new TextareaField('NotificationBody', _t('ShopSettings.MESSAGE', 'Message (order details are included in the email)'), 10));
        //Shipping
        $fields->findOrMakeTabSet('Root.Shop.Shipping');
        $fields->addFieldToTab("Root.Shop.Shipping", new Tab('Countries'));
        $fields->addFieldToTab("Root.Shop.Shipping", new Tab('Regions'));
        $managerClass = class_exists('DataObjectManager') ? 'DataObjectManager' : 'ComplexTableField';
        $manager = new $managerClass($this->owner, 'ShippingCountries', 'Country_Shipping');
        $fields->addFieldToTab("Root.Shop.Shipping.Countries", $manager);
        $managerClass = class_exists('DataObjectManager') ? 'DataObjectManager' : 'ComplexTableField';
        $manager = new $managerClass($this->owner, 'ShippingRegions', 'Region_Shipping');
        $fields->addFieldToTab("Root.Shop.Shipping.Regions", $manager);
        if (file_exists(BASE_PATH . '/swipestripe') && ShopSettings::get_license_key() == null) {
            $warning = _t('ShopSettings.LICENCE_WARNING', '
        Warning: You have SwipeStripe installed without a license key. 
        Please <a href="http://swipestripe.com" target="_blank">purchase a license key here</a> before this site goes live.
			');
            $fields->addFieldToTab("Root.Main", new LiteralField("SwipeStripeLicenseWarning", '<p class="message warning">' . $warning . '</p>'), "Title");
        }
    }
예제 #15
0
파일: Group.php 프로젝트: Raiser/Praktikum
 /**
  * Caution: Only call on instances, not through a singleton.
  *
  * @return FieldSet
  */
 public function getCMSFields()
 {
     $fields = new FieldSet(new TabSet("Root", new Tab(_t('SecurityAdmin.MEMBERS', 'Members'), new TextField("Title", $this->fieldLabel('Title')), $memberList = new MemberTableField($this, "Members", $this, null, false)), $permissionsTab = new Tab(_t('SecurityAdmin.PERMISSIONS', 'Permissions'), new PermissionCheckboxSetField('Permissions', false, 'Permission', 'GroupID', $this)), new Tab(_t('Security.IPADDRESSES', 'IP Addresses'), new LiteralField("", _t('SecurityAdmin.IPADDRESSESHELP', "<p>You can restrict this group to a particular \n\t\t\t\t\t\tIP address range (one range per line). <br />Ranges can be in any of the following forms: <br />\n\t\t\t\t\t\t203.96.152.12<br />\n\t\t\t\t\t\t203.96.152/24<br />\n\t\t\t\t\t\t203.96/16<br />\n\t\t\t\t\t\t203/8<br /><br />If you enter one or more IP address ranges in this box, then members will only get\n\t\t\t\t\t\tthe rights of being in this group if they log on from one of the valid IP addresses.  It won't prevent\n\t\t\t\t\t\tpeople from logging in.  This is because the same user might have to log in to access parts of the\n\t\t\t\t\t\tsystem without IP address restrictions.")), new TextareaField("IPRestrictions", "IP Ranges", 10))));
     // Only add a dropdown for HTML editor configurations if more than one is available.
     // Otherwise Member->getHtmlEditorConfigForCMS() will default to the 'cms' configuration.
     $editorConfigMap = HtmlEditorConfig::get_available_configs_map();
     if (count($editorConfigMap) > 1) {
         $fields->addFieldToTab('Root.Permissions', new DropdownField('HtmlEditorConfig', 'HTML Editor Configuration', $editorConfigMap), 'Permissions');
     }
     if (!Permission::check('EDIT_PERMISSIONS')) {
         $fields->removeFieldFromTab('Root', 'Permissions');
         $fields->removeFieldFromTab('Root', 'IP Addresses');
     }
     // Only show the "Roles" tab if permissions are granted to edit them,
     // and at least one role exists
     if (Permission::check('APPLY_ROLES') && DataObject::get('PermissionRole')) {
         $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.ROLES', 'Roles'));
         $fields->addFieldToTab('Root.Roles', new LiteralField("", "<p>" . _t('SecurityAdmin.ROLESDESCRIPTION', "This section allows you to add roles to this group. Roles are logical groupings of permissions, which can be editied in the Roles tab") . "</p>"));
         // Add roles (and disable all checkboxes for inherited roles)
         $allRoles = Permission::check('ADMIN') ? DataObject::get('PermissionRole') : DataObject::get('PermissionRole', 'OnlyAdminCanApply = 0');
         $groupRoles = $this->Roles();
         $inheritedRoles = new DataObjectSet();
         $ancestors = $this->getAncestors();
         foreach ($ancestors as $ancestor) {
             $ancestorRoles = $ancestor->Roles();
             if ($ancestorRoles) {
                 $inheritedRoles->merge($ancestorRoles);
             }
         }
         $fields->findOrMakeTab('Root.Roles', 'Root.' . _t('SecurityAdmin.ROLES', 'Roles'));
         $fields->addFieldToTab('Root.Roles', $rolesField = new CheckboxSetField('Roles', 'Roles', $allRoles));
         $rolesField->setDefaultItems($inheritedRoles->column('ID'));
         $rolesField->setDisabledItems($inheritedRoles->column('ID'));
     }
     $memberList->setController($this);
     $memberList->setPermissions(array('edit', 'delete', 'export', 'add', 'inlineadd'));
     $memberList->setParentClass('Group');
     $memberList->setPopupCaption(_t('SecurityAdmin.VIEWUSER', 'View User'));
     $memberList->setRelationAutoSetting(false);
     $fields->push($idField = new HiddenField("ID"));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 function updateCMSFields(FieldSet &$fields)
 {
     if ($this->owner->ID && $this->owner->Code == strtolower(self::$main_group)) {
         $newMerchants = new ComplexTableField(Controller::has_curr() ? Controller::curr() : new Controller(), 'NewMembers', 'Member');
         $newMerchants->setCustomSourceItems(self::get_new_merchants());
         $fields->addFieldToTab('Root', new Tab(_t('MerchantGroupDOD.NEWMERCHANTS', 'New Merchants'), $newMerchants), 'Members');
         $fields->findOrMakeTab('Root.Members')->setTitle(_t('MerchantGroupDOD.ALLMERCHANTS', 'All Merchants'));
         $fields->removeByName('Title');
     }
 }
 function updateCMSFields(FieldSet &$fields)
 {
     if (!FlashObject::has_external_flash_file()) {
         $show = true;
         if (is_array(self::get_classes_with_flash()) && count(self::get_classes_with_flash())) {
             if (!in_array($this->owner->ClassName, self::get_classes_with_flash())) {
                 $show = false;
             }
         }
         if (is_array(self::get_classes_without_flash()) && count(self::get_classes_without_flash())) {
             if (in_array($this->owner->ClassName, self::get_classes_without_flash())) {
                 $show = false;
             }
         }
         if ($show) {
             $fields->addFieldToTab("Root.Content.FlashObject", new FileIFrameField('FlashFile', 'File'));
             $fields->addFieldToTab("Root.Content.FlashObject", new TextField('Title', 'Title'));
         }
     }
     return $fields;
 }
 /**
  * Add subsites-specific fields to the folder editor.
  */
 function updateCMSFields(FieldSet &$fields)
 {
     if ($this->owner instanceof Folder) {
         $sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin');
         $dropdownValues = $sites ? $sites->toDropdownMap() : array();
         $dropdownValues[0] = 'All sites';
         ksort($dropdownValues);
         if ($sites) {
             $fields->addFieldToTab('Root.Details', new DropdownField("SubsiteID", "Subsite", $dropdownValues));
         }
     }
 }
 public function getCMSFields()
 {
     $fields = new FieldSet(new TabSet('Root'));
     $fields->addFieldToTab('Root.Main', new TextField('Title', _t('WorkflowAction.TITLE', 'Title')));
     $filter = '';
     $reqParent = isset($_REQUEST['ParentID']) ? (int) $_REQUEST['ParentID'] : 0;
     $attachTo = $this->ActionID ? $this->ActionID : $reqParent;
     if ($attachTo) {
         $action = DataObject::get_by_id('WorkflowAction', $attachTo);
         if ($action && $action->ID) {
             $filter = '"WorkflowDefID" = ' . (int) $action->WorkflowDefID;
         }
     }
     $actions = DataObject::get('WorkflowAction', $filter);
     $options = array();
     if ($actions) {
         $options = $actions->map();
     }
     $typeOptions = $this->dbObject('Type')->enumValues();
     $fields->addFieldToTab('Root.Main', new DropdownField('ActionID', _t('WorkflowTransition.ACTION', 'Action'), $options));
     $fields->addFieldToTab('Root.Main', new DropdownField('NextActionID', _t('WorkflowTransition.NEXT_ACTION', 'Next Action'), $options, null, null, _t('WorkflowTransition.SELECTONE', '(Select one)')));
     $fields->addFieldToTab('Root.Main', new DropdownField('Type', _t('WorkflowTransition.TYPE', 'Type'), $typeOptions));
     $fields->addFieldToTab('Root.RestrictToUsers', new TreeMultiselectField('Users', _t('WorkflowDefinition.USERS', 'Restrict to Users'), 'Member'));
     $fields->addFieldToTab('Root.RestrictToUsers', new TreeMultiselectField('Groups', _t('WorkflowDefinition.GROUPS', 'Restrict to Groups'), 'Group'));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 /**
  */
 public function getCMSFields()
 {
     $fields = new FieldSet(new TabSet('Root'));
     $cmsUsers = Member::mapInCMSGroups()->getItems();
     if ($cmsUsers && $cmsUsers->count()) {
         $cmsUsers = $cmsUsers->map();
     } else {
         $cmsUsers = array();
     }
     $fields->addFieldToTab('Root.Main', new TextField('Title', _t('WorkflowDefinition.TITLE', 'Title')));
     $fields->addFieldToTab('Root.Main', new TextareaField('Description', _t('WorkflowDefinition.DESCRIPTION', 'Description')));
     $fields->addFieldToTab('Root.Main', new CheckboxSetField('Users', _t('WorkflowDefinition.USERS', 'Users'), $cmsUsers));
     $fields->addFieldToTab('Root.Main', new TreeMultiselectField('Groups', _t('WorkflowDefinition.GROUPS', 'Groups'), 'Group'));
     if (class_exists('AbstractQueuedJob')) {
         $before = _t('WorkflowDefinition.SENDREMINDERDAYSBEFORE', 'Send reminder email after ');
         $after = _t('WorkflowDefinition.SENDREMINDERDAYSAFTER', ' days without action.');
         $fields->addFieldToTab('Root.Main', new FieldGroup(_t('WorkflowDefinition.REMINDEREMAIL', 'Reminder Email'), new LabelField('ReminderEmailBefore', $before), new NumericField('RemindDays', ''), new LabelField('ReminderEmailAfter', $after)));
     }
     if ($this->ID && Permission::check('VIEW_ACTIVE_WORKFLOWS')) {
         $fields->addFieldToTab('Root.ActiveInstances', $active = new ComplexTableField($this, 'Instances', 'WorkflowInstance', array('Title' => 'Title', 'Target.Title' => 'Target Title', 'WorkflowStatus' => 'Status', 'CurrentAction.Title' => 'Current Action', 'LastEdited' => 'Last Actioned'), 'getInstanceManagementFields', '"WorkflowStatus" IN (\'Active\', \'Paused\')', '"LastEdited" DESC'));
         if (Permission::check('REASSIGN_ACTIVE_WORKFLOWS')) {
             $active->setPermissions(array('show', 'edit'));
         } else {
             $active->setPermissions(array('show'));
         }
         $fields->addFieldToTab('Root.Completed', $complete = new ComplexTableField($this, 'CompletedInstances', 'WorkflowInstance', array('Title' => 'Title', 'Target.Title' => 'Target Title', 'WorkflowStatus' => 'Status', 'CurrentAction.Title' => 'Current Action', 'LastEdited' => 'Last Actioned'), 'getActionsSummaryFields', '"WorkflowStatus" IN (\'Complete\', \'Cancelled\')', '"LastEdited" DESC'));
         $complete->setPermissions(array('show'));
     }
     return $fields;
 }
 public function EditForm()
 {
     $fields = new FieldSet(new TabSet("Root"));
     $actions = new FieldSet();
     $columns = array('JobTitle' => _t('QueuedJobs.TABLE_TITLE', 'Title'), 'Created' => _t('QueuedJobs.TABLE_ADDE', 'Added'), 'JobStarted' => _t('QueuedJobs.TABLE_STARTED', 'Started'), 'JobRestarted' => _t('QueuedJobs.TABLE_RESUMED', 'Resumed'), 'StartAfter' => _t('QueuedJobs.TABLE_START_AFTER', 'Start After'), 'JobStatus' => _t('QueuedJobs.TABLE_STATUS', 'Status'), 'Messages' => _t('QueuedJobs.TABLE_MESSAGES', 'Message'), 'StepsProcessed' => _t('QueuedJobs.TABLE_NUM_PROCESSED', 'Number Processed'), 'TotalSteps' => _t('QueuedJobs.TABLE_TOTAL', 'Total'));
     // QueuedJobListField
     $filter = $this->queuedJobsService->getJobListFilter($this->selectedQueue, 300);
     $table = new QueuedJobListField('QueuedJobs', 'QueuedJobDescriptor', $columns, $filter, 'StartAfter ASC, Created DESC');
     $table->actions['pause'] = array('label' => _t('QueuedJobs.PAUSE_LABEL', 'Pause'), 'icon' => 'queuedjobs/images/control_pause_blue.png', 'icon_disabled' => 'queuedjobs/images/control_pause_blue.png', 'class' => 'pauselink');
     $table->actions['resume'] = array('label' => _t('QueuedJobs.RESUME_LABEL', 'Resume'), 'icon' => 'queuedjobs/images/control_play_blue.png', 'icon_disabled' => 'queuedjobs/images/control_play_blue.png', 'class' => 'resumelink');
     $table->actions['execute'] = array('label' => _t('QueuedJobs.EXECUTE_LABEL', 'Execute'), 'icon' => 'queuedjobs/images/cog_go.png', 'icon_disabled' => 'queuedjobs/images/cog_go.png', 'class' => 'executelink');
     $table->setPermissions(array('delete', 'pause', 'resume', 'execute'));
     $fields->addFieldToTab('Root.Main', $table);
     return new Form($this, 'EditForm', $fields, $actions);
 }
예제 #22
0
 /**
  * Get the fieldset to display in the administration section
  */
 function getCMSFields()
 {
     $group = null;
     if ($this->GroupID) {
         $group = DataObject::get_one("Group", "ID = {$this->GroupID}");
     }
     $fields = new FieldSet(new TextField("Title", _t('NewsletterType.NEWSLETTERTYPE', 'Newsletter Type')), new TextField("FromEmail", _t('NewsletterType.SENDFROM', 'Send newsletters from')), new TabSet("Root", new Tab(_t('NewsletterType.DRAFTS', 'Drafts'), $draftList = new NewsletterList("Draft", $this, _t('NewsletterType.DRAFT', 'Draft'))), new TabSet('Sent', new Tab(_t('NewsletterType.SENT', 'Sent'), $sendList = new NewsletterList("Send", $this, _t('NewsletterType.SEND', 'Send'))), new Tab(_t('NewsletterType.UNSUBSCRIBED', 'Unsubscribed'), $unsubscribedList = new UnsubscribedList("Unsubscribed", $this)), new Tab(_t('NewsletterType.BOUNCED', 'Bounced'), $bouncedList = new BouncedList("Bounced", $this)))));
     if ($this->GroupID) {
         $fields->addFieldToTab('Root', new TabSet("Recipients", new Tab(_t('NewsletterType.RECIPIENTS', 'Recipients'), $recipients = new MemberTableField($this, "Recipients", $group)), new Tab(_t('NewsletterType.IMPORT', 'Import'), $importField = new RecipientImportField("ImportFile", _t('NewsletterType.IMPORTFROM', 'Import from file'), $group))));
         $recipients->setController($this);
         $importField->setController($this);
         $importField->setTypeID($this->ID);
     }
     $fields->addFieldToTab('Root', new Tab(_t('NewsletterType.TEMPLATE', 'Template'), $templates = new TemplateList("Template", "Template", $this->Template, NewsletterAdmin::template_path())));
     $draftList->setController($this);
     $sendList->setController($this);
     $templates->setController($this);
     $unsubscribedList->setController($this);
     $bouncedList->setController($this);
     $fields->push($idField = new HiddenField("ID"));
     $fields->push(new HiddenField("executeForm", "", "TypeEditForm"));
     $idField->setValue($this->ID);
     return $fields;
 }
 function updateCMSFields(FieldSet &$fields)
 {
     $fields->addFieldToTab('Root.Main', new CheckboxField("IsColour", "Is this a colour variation type?"));
     /*
     $fieldList = array(
     	'Value' => 'Value',
     	'Sort' => 'Sort',
     	'Colour' => 'Colour'
     );
     $fieldTypes = array(
     	'Value' => 'TextField',
     	'Sort' => 'TextField',
     	'Colour' => 'ColorField'
     );
     
     $valuesTable = new TableField("Values", "ProductAttributeValue",$fieldList,$fieldTypes);
     // Need this or else the table shows all value objects
     $values = DataObject::get('ProductAttributeValue','TypeID = '.$this->owner->ID);
     $valuesTable->setCustomSourceItems($values);
     $fields->addFieldToTab("Root.Values", $valuesTable);
     */
 }
 /**
  * Get the fields that are sent to the CMS. In
  * your decorators: updateCMSFields(&$fields)
  *
  * @return Fieldset
  */
 function getCMSFields()
 {
     Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");
     $fields = new FieldSet(new TabSet("Root", $tabMain = new Tab('Main', $titleField = new TextField("Title", _t('SiteConfig.SITETITLE', "Site title")), $taglineField = new TextField("Tagline", _t('SiteConfig.SITETAGLINE', "Site Tagline/Slogan")), new DropdownField("Theme", _t('SiteConfig.THEME', 'Theme'), $this->getAvailableThemes(), '', null, _t('SiteConfig.DEFAULTTHEME', '(Use default theme)'))), $tabAccess = new Tab('Access', new HeaderField('WhoCanViewHeader', _t('SiteConfig.VIEWHEADER', "Who can view pages on this site?"), 2), $viewersOptionsField = new OptionsetField("CanViewType"), $viewerGroupsField = new TreeMultiselectField("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups")), new HeaderField('WhoCanEditHeader', _t('SiteConfig.EDITHEADER', "Who can edit pages on this site?"), 2), $editorsOptionsField = new OptionsetField("CanEditType"), $editorGroupsField = new TreeMultiselectField("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups")), new HeaderField('WhoCanCreateTopLevelHeader', _t('SiteConfig.TOPLEVELCREATE', "Who can create pages in the root of the site?"), 2), $topLevelCreatorsOptionsField = new OptionsetField("CanCreateTopLevelType"), $topLevelCreatorsGroupsField = new TreeMultiselectField("CreateTopLevelGroups", _t('SiteTree.TOPLEVELCREATORGROUPS', "Top level creators")))));
     $viewersOptionsSource = array();
     $viewersOptionsSource["Anyone"] = _t('SiteTree.ACCESSANYONE', "Anyone");
     $viewersOptionsSource["LoggedInUsers"] = _t('SiteTree.ACCESSLOGGEDIN', "Logged-in users");
     $viewersOptionsSource["OnlyTheseUsers"] = _t('SiteTree.ACCESSONLYTHESE', "Only these people (choose from list)");
     $viewersOptionsField->setSource($viewersOptionsSource);
     $editorsOptionsSource = array();
     $editorsOptionsSource["LoggedInUsers"] = _t('SiteTree.EDITANYONE', "Anyone who can log-in to the CMS");
     $editorsOptionsSource["OnlyTheseUsers"] = _t('SiteTree.EDITONLYTHESE', "Only these people (choose from list)");
     $editorsOptionsField->setSource($editorsOptionsSource);
     $topLevelCreatorsOptionsField->setSource($editorsOptionsSource);
     // Translatable doesn't handle updateCMSFields on DataObjects,
     // so add it here to save the current Locale,
     // because onBeforeWrite does not work.
     if (Object::has_extension('SiteConfig', "Translatable")) {
         $fields->push(new HiddenField("Locale"));
     }
     if (!Permission::check('EDIT_SITECONFIG')) {
         $fields->makeFieldReadonly($viewersOptionsField);
         $fields->makeFieldReadonly($viewerGroupsField);
         $fields->makeFieldReadonly($editorsOptionsField);
         $fields->makeFieldReadonly($editorGroupsField);
         $fields->makeFieldReadonly($topLevelCreatorsOptionsField);
         $fields->makeFieldReadonly($topLevelCreatorsGroupsField);
         $fields->makeFieldReadonly($taglineField);
         $fields->makeFieldReadonly($titleField);
     }
     if (file_exists(BASE_PATH . '/install.php')) {
         $fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader", "<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING", "Warning: You should remove install.php from this SilverStripe install for security reasons.") . "</p>"), "Title");
     }
     $tabMain->setTitle(_t('SiteConfig.TABMAIN', "Main"));
     $tabAccess->setTitle(_t('SiteConfig.TABACCESS', "Access"));
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
 function getCMSFields()
 {
     $product = $this->Product();
     $fields = new FieldSet(new TabSet('Root', new Tab('Main', new NumericField('Price'), new CheckboxField('AllowPurchase', _t("ProductVariation.ALLOWPURCHASE", 'Allow Purchase ?')), new TextField('InternalItemID', _t("ProductVariation.INTERNALITEMID", 'Internal Item ID')), new TextField('Description', _t("ProductVariation.DESCRIPTION", "Description (optional)")), new ImageField('Image'))));
     $types = $product->VariationAttributes();
     if ($this->ID) {
         $purchased = $this->getPurchasedTotal();
         $values = $this->AttributeValues();
         foreach ($types as $type) {
             $field = $type->getDropDownField();
             if ($field) {
                 $value = $values->find('TypeID', $type->ID);
                 if ($value) {
                     $field->setValue($value->ID);
                     if ($purchased) {
                         $field = $field->performReadonlyTransformation();
                         $field->setName("Type{$type->ID}");
                     }
                 } else {
                     if ($purchased) {
                         $field = new ReadonlyField("Type{$type->ID}", $type->Name, _t("ProductVariation.ALREADYPURCHASED", 'NOT SET (you can not select a value now because it has already been purchased).'));
                     } else {
                         $field->setEmptyString('');
                     }
                 }
             } else {
                 $field = new ReadonlyField("Type{$type->ID}", $type->Name, _t("ProductVariation.NOVALUESTOSELECT", 'No values to select'));
             }
             $fields->addFieldToTab('Root.Attributes', $field);
         }
         $fields->addFieldToTab('Root.Orders', new ComplexTableField($this, 'OrderItems', 'ProductVariation_OrderItem', array('Order.ID' => '#', 'Order.Created' => 'When', 'Order.Member.Name' => 'Member', 'Quantity' => 'Quantity', 'Total' => 'Total'), new FieldSet(), "\"BuyableID\" = '{$this->ID}'", "\"Created\" DESC"));
     } else {
         foreach ($types as $type) {
             $field = $type->getDropDownField();
             $fields->addFieldToTab('Root.Attributes', $field);
         }
     }
     $this->extend('updateCMSFields', $fields);
     return $fields;
 }
예제 #26
0
	/**
	 * Gets the form fields as defined through the metadata
	 * on {@link $obj} and the custom parameters passed to FormScaffolder.
	 * Depending on those parameters, the fields can be used in ajax-context,
	 * contain {@link TabSet}s etc.
	 * 
	 * @return FieldSet
	 */
	public function getFieldSet() {
		$fields = new FieldSet();
		
		// tabbed or untabbed
		if($this->tabbed) {
			$fields->push(new TabSet("Root", $mainTab = new Tab("Main")));
			$mainTab->setTitle(_t('SiteTree.TABMAIN', "Main"));
		}
		
		// add database fields
		foreach($this->obj->db() as $fieldName => $fieldType) {
			if($this->restrictFields && !in_array($fieldName, $this->restrictFields)) continue;
			
			// @todo Pass localized title
			if($this->fieldClasses && isset($this->fieldClasses[$fieldName])) {
				$fieldClass = $this->fieldClasses[$fieldName];
				$fieldObject = new $fieldClass($fieldName);
			} else {
				$fieldObject = $this->obj->dbObject($fieldName)->scaffoldFormField(null, $this->getParamsArray());
			}
			$fieldObject->setTitle($this->obj->fieldLabel($fieldName));
			if($this->tabbed) {
				$fields->addFieldToTab("Root.Main", $fieldObject);
			} else {
				$fields->push($fieldObject);
			}
		}
		
		// add has_one relation fields
		if($this->obj->has_one()) {
			foreach($this->obj->has_one() as $relationship => $component) {
				if($this->restrictFields && !in_array($relationship, $this->restrictFields)) continue;
				$hasOneField = $this->obj->dbObject("{$relationship}ID")->scaffoldFormField(null, $this->getParamsArray());
				$hasOneField->setTitle($this->obj->fieldLabel($relationship));
				if($this->tabbed) {
					$fields->addFieldToTab("Root.Main", $hasOneField);
				} else {
					$fields->push($hasOneField);
				}
			}
		}
		
		// only add relational fields if an ID is present
		if($this->obj->ID) {
			// add has_many relation fields
			if($this->obj->has_many() && ($this->includeRelations === true || isset($this->includeRelations['has_many']))) {
				foreach($this->obj->has_many() as $relationship => $component) {
					if($this->tabbed) {
						$relationTab = $fields->findOrMakeTab(
							"Root.$relationship", 
							$this->obj->fieldLabel($relationship)
						);
					}
					$relationshipFields = singleton($component)->summaryFields();
					$foreignKey = $this->obj->getComponentJoinField($relationship);
					$ctf = new ComplexTableField(
						$this,
						$relationship,
						$component,
						$relationshipFields,
						"getCMSFields", 
						"$foreignKey = " . $this->obj->ID
					);
					$ctf->setPermissions(TableListField::permissions_for_object($component));
					if($this->tabbed) {
						$fields->addFieldToTab("Root.$relationship", $ctf);
					} else {
						$fields->push($ctf);
					}
				}
			}

			if($this->obj->many_many() && ($this->includeRelations === true || isset($this->includeRelations['many_many']))) {
				foreach($this->obj->many_many() as $relationship => $component) {
					if($this->tabbed) {
						$relationTab = $fields->findOrMakeTab(
							"Root.$relationship", 
							$this->obj->fieldLabel($relationship)
						);
					}

					$relationshipFields = singleton($component)->summaryFields();
					$filterWhere = $this->obj->getManyManyFilter($relationship, $component);
					$filterJoin = $this->obj->getManyManyJoin($relationship, $component);
					$ctf =  new ComplexTableField(
						$this,
						$relationship,
						$component,
						$relationshipFields,
						"getCMSFields", 
						$filterWhere,
						'', 
						$filterJoin
					);
					$ctf->setPermissions(TableListField::permissions_for_object($component));
					$ctf->popupClass = "ScaffoldingComplexTableField_Popup";
					if($this->tabbed) {
						$fields->addFieldToTab("Root.$relationship", $ctf);
					} else {
						$fields->push($ctf);
					}
				}
			}
		}
		
		return $fields;
	}
 function testAddingFieldToATabWithTheSameNameAsTheField()
 {
     $fieldSet = new FieldSet($root = new TabSet("Root", $main = new Tab("Main", $a = new TextField("A"))));
     /* If you have a tab with the same name as the field, then technically it's a duplicate. However, it's allowed because
     		tab isn't a data field.  Only duplicate data fields are problematic */
     $fieldSet->addFieldToTab("Root.MyName", $myName = new TextField("MyName"));
     $this->assertNotNull($fieldSet->fieldByName('Root')->fieldByName('MyName'));
     $this->assertSame($myName, $fieldSet->fieldByName('Root')->fieldByName('MyName')->Fields()->First());
 }
 /**
  * Create an iterable list of properties to display to end users
  * 
  * @see sapphire/core/model/DataObject#getCMSFields($params)
  */
 public function getCMSFields()
 {
     $fields = new FieldSet(new TabSet("Root", new Tab('Details', new LiteralField("ExternalContentItem_Alert", _t('ExternalContent.REMOTE_ITEM', 'This is a remote content item and therefore cannot be edited')), new LiteralField("ExternalContentItem_LINK", _t('ExternalContent.LINK', '<a target="_blank" href="' . $this->cmisObject->getUrl() . '">View this item</a>')))));
     if ($this->cmisObject) {
         $props = $this->cmisObject->getProperties();
         foreach ($props as $name => $value) {
             $fields->addFieldToTab('Root.Details', new ReadonlyField($name, _t('SeaMistContentItem.' . $name, $name), $value));
         }
     }
     return $fields;
 }
	/**
	 * Get the pop-up fields for the given record.
	 */
	function getCustomFieldsFor($childData) {
		if(!$childData) {
			user_error("AssetTableField::DetailForm No record found");
			return null;
		}
		
		if($childData->ParentID) {
			$folder = DataObject::get_by_id('File', $childData->ParentID );
		} else {
			$folder = singleton('Folder');
		}
		
		$urlLink = "<div class='field readonly'>";
		$urlLink .= "<label class='left'>"._t('AssetTableField.URL','URL')."</label>";
		$urlLink .= "<span class='readonly'><a href='{$childData->Link()}'>{$childData->RelativeLink()}</a></span>";
		$urlLink .= "</div>";
		
		$detailFormFields = new FieldSet(
			new TabSet("BottomRoot",
				$mainTab = new Tab('Main',
					new TextField("Title", _t('AssetTableField.TITLE','Title')),
					new TextField("Name", _t('AssetTableField.FILENAME','Filename')),
					new LiteralField("AbsoluteURL", $urlLink),
					new ReadonlyField("FileType", _t('AssetTableField.TYPE','Type')),
					new ReadonlyField("Size", _t('AssetTableField.SIZE','Size'), $childData->getSize()),
					new DropdownField("OwnerID", _t('AssetTableField.OWNER','Owner'), Member::mapInCMSGroups()),
					new DateField_Disabled("Created", _t('AssetTableField.CREATED','First uploaded')),
					new DateField_Disabled("LastEdited", _t('AssetTableField.LASTEDIT','Last changed'))
				)
			)
		);
		$mainTab->setTitle(_t('AssetTableField.MAIN', 'Main'));

		if(is_a($childData, 'Image')) {
			$tab = $detailFormFields->findOrMakeTab("BottomRoot.Image", _t('AssetTableField.IMAGE', 'Image'));
			
			$big = $childData->URL;
			$formattedImage = $childData->getFormattedImage('AssetLibraryPreview');
			$thumbnail = $formattedImage ? $formattedImage->URL : '';
			
			// Hmm this required the translated string to be appended to BottomRoot to add this to the Main tab
			$detailFormFields->addFieldToTab('BottomRoot.Main',
				new ReadonlyField("Dimensions", _t('AssetTableField.DIM','Dimensions'))
			);

			$tab->push(
				new LiteralField("ImageFull",
					"<img id='thumbnailImage' src='{$thumbnail}?r=" . rand(1,100000)  . "' alt='{$childData->Name}' />"
				)
			);
		}

		if($childData && $childData->hasMethod('BackLinkTracking')) {
			if(class_exists('Subsite')) Subsite::disable_subsite_filter(true);
			$links = $childData->BackLinkTracking();
			if(class_exists('Subsite')) Subsite::disable_subsite_filter(false);

			if($links && $links->exists()) {
				$backlinks = array();
				foreach($links as $link) {
					$backlinks[] = "<li><a href=\"admin/show/$link->ID\">" . $link->Breadcrumbs(null,true). "</a></li>";
				}
				$backlinks = "<div style=\"clear:left\">". _t('AssetTableField.PAGESLINKING','The following pages link to this file:') ."<ul>" . implode("",$backlinks) . "</ul></div>";
			}
			if(!isset($backlinks)) $backlinks = "<p>". _t('AssetTableField.NOLINKS',"This file hasn't been linked to from any pages.") ."</p>";
			$detailFormFields->addFieldToTab("BottomRoot.Links", new LiteralField("Backlinks", $backlinks));
		}
		
		// the ID field confuses the Controller-logic in finding the right view for ReferencedField
		$detailFormFields->removeByName('ID');
		
		if($childData) $childData->extend('updateCMSFields', $detailFormFields);
		
		return $detailFormFields;
	}
예제 #30
0
 function DetailForm()
 {
     $ID = isset($_REQUEST['ctf']['ID']) ? Convert::raw2xml($_REQUEST['ctf']['ID']) : null;
     $childID = isset($_REQUEST['ctf']['childID']) ? Convert::raw2xml($_REQUEST['ctf']['childID']) : null;
     $childClass = isset($_REQUEST['fieldName']) ? Convert::raw2xml($_REQUEST['fieldName']) : null;
     $methodName = isset($_REQUEST['methodName']) ? $_REQUEST['methodName'] : null;
     if (!$childID) {
         user_error("AssetTableField::DetailForm Please specify a valid ID");
         return null;
     }
     if ($childID) {
         $childData = DataObject::get_by_id("File", $childID);
     }
     if (!$childData) {
         user_error("AssetTableField::DetailForm No record found");
         return null;
     }
     if ($childData->ParentID) {
         $folder = DataObject::get_by_id('File', $childData->ParentID);
     } else {
         $folder = singleton('Folder');
     }
     $urlLink = "<div class='field readonly'>";
     $urlLink .= "<label class='left'>" . _t('AssetTableField.URL', 'URL') . "</label>";
     $urlLink .= "<span class='readonly'><a href='{$childData->Link()}'>{$childData->RelativeLink()}</a></span>";
     $urlLink .= "</div>";
     $detailFormFields = new FieldSet(new TabSet("BottomRoot", new Tab(_t('AssetTableField.MAIN', 'Main'), new TextField("Title", _t('AssetTableField.TITLE', 'Title')), new TextField("Name", _t('AssetTableField.FILENAME', 'Filename')), new LiteralField("AbsoluteURL", $urlLink), new ReadonlyField("FileType", _t('AssetTableField.TYPE', 'Type')), new ReadonlyField("Size", _t('AssetTableField.SIZE', 'Size'), $childData->getSize()), new DropdownField("OwnerID", _t('AssetTableField.OWNER', 'Owner'), Member::mapInCMSGroups($folder->CanEdit())), new DateField_Disabled("Created", _t('AssetTableField.CREATED', 'First uploaded')), new DateField_Disabled("LastEdited", _t('AssetTableField.LASTEDIT', 'Last changed')))));
     if (is_a($childData, 'Image')) {
         $big = $childData->URL;
         $thumbnail = $childData->getFormattedImage('AssetLibraryPreview')->URL;
         // Hmm this required the translated string to be appended to BottomRoot to add this to the Main tab
         $detailFormFields->addFieldToTab("BottomRoot." . _t('AssetTableField.MAIN', 'Main'), new ReadonlyField("Dimensions", _t('AssetTableField.DIM', 'Dimensions')), "Created");
         $detailFormFields->addFieldToTab("BottomRoot", new Tab(_t('AssetTableField.IMAGE', 'Image'), new LiteralField("ImageFull", '<a id="ImageEditorActivator" href="javascript: void(0)">' . "<img id='thumbnailImage' src='{$thumbnail}?r=" . rand(1, 100000) . "' alt='{$childData->Name}' /><p>" . _t('AssetTableField.EDITIMAGE', 'Edit this image') . "</p>" . '</a>' . '<script type="text/javascript" src="cms/javascript/ImageEditor/Activator.js"></script><script type="text/javascript">var imageActivator = new ImageEditor.Activator.initialize();Event.observe("ImageEditorActivator","click",imageActivator.onOpen);</script>')), 'Main');
         if (class_exists('GalleryFile')) {
             $detailFormFields->addFieldToTab("BottomRoot", new Tab(_t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'), new TextField("Content", _t('AssetTableField.CAPTION', 'Caption'))));
         }
     } else {
         if (class_exists('GalleryFile')) {
             if ($childData->Extension == 'swf') {
                 $detailFormFields->addFieldToTab("BottomRoot", new Tab(_t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'), new TextField("Content", _t('AssetTableField.CAPTION', 'Caption')), new TextField('PopupWidth', _t('AssetTableField.POPUPWIDTH', 'Popup Width')), new TextField('PopupHeight', _t('AssetTableField.POPUPHEIGHT', 'Popup Height')), new HeaderField(_t('AssetTableField.SWFFILEOPTIONS', 'SWF File Options')), new CheckboxField('Embed', _t('AssetTableField.ISFLASH', 'Is A Flash Document')), new CheckboxField('LimitDimensions', _t('AssetTableField.DIMLIMT', 'Limit The Dimensions In The Popup Window'))));
             } else {
                 $detailFormFields->addFieldToTab("BottomRoot", new Tab(_t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'), new TextField("Content", _t('AssetTableField.CAPTION', 'Caption')), new TextField('PopupWidth', _t('AssetTableField.POPUPWIDTH', 'Popup Width')), new TextField('PopupHeight', _t('AssetTableField.POPUPHEIGHT', 'Popup Height'))));
             }
         }
     }
     if ($childData && $childData->hasMethod('BackLinkTracking')) {
         $links = $childData->BackLinkTracking();
         if ($links->exists()) {
             foreach ($links as $link) {
                 $backlinks[] = "<li><a href=\"admin/show/{$link->ID}\">" . $link->Breadcrumbs(null, true) . "</a></li>";
             }
             $backlinks = "<div style=\"clear:left\">" . _t('AssetTableField.PAGESLINKING', 'The following pages link to this file:') . "<ul>" . implode("", $backlinks) . "</ul>";
         }
         if (!isset($backlinks)) {
             $backlinks = "<p>" . _t('AssetTableField.NOLINKS', "This file hasn't been linked to from any pages.") . "</p>";
         }
         $detailFormFields->addFieldToTab("BottomRoot.Links", new LiteralField("Backlinks", $backlinks));
     }
     // the ID field confuses the Controller-logic in finding the right view for ReferencedField
     $detailFormFields->removeByName('ID');
     if ($childData) {
         $childData->extend('updateCMSFields', $detailFormFields);
     }
     // add a namespaced ID instead thats "converted" by saveComplexTableField()
     $detailFormFields->push(new HiddenField("ctf[childID]", "", $childID));
     $detailFormFields->push(new HiddenField("ctf[ClassName]", "", $this->sourceClass));
     $readonly = $this->methodName == "show";
     $form = new ComplexTableField_Popup($this, "DetailForm", $detailFormFields, $this->sourceClass, $readonly);
     if (is_numeric($childID)) {
         if ($methodName == "show" || $methodName == "edit") {
             $form->loadDataFrom($childData);
         }
     }
     if (!$folder->userCanEdit() || $methodName == "show") {
         $form->makeReadonly();
     }
     return $form;
 }