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


PHP TabSet类代码示例

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


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

示例1: updateCMSFields

 function updateCMSFields(&$fields)
 {
     /*
      * don't want slideshow on a redirector page
      */
     if ($this->owner->ClassName == 'RedirectorPage') {
         return $fields;
     }
     /*
      * if this is a new page set defaults 
      */
     if ($this->owner->Version == 1) {
         $this->set_defaults();
     }
     $tabSlides = new Tab('Slides');
     $tabSlides->setTitle(_t('Slideshow.SLIDESTABTITLE', 'Slides'));
     $tabSettings = new Tab('Settings');
     $tabSettings->setTitle(_t('Slideshow.SETTINGSTABTITLE', 'Settings'));
     $tabSlideShow = new TabSet('SlideshowTabs', $tabSlides, $tabSettings);
     $tabSlideShow->setTitle(_t('Slideshow.SLIDESHOWTABTITLE', 'Slideshow'));
     $fields->addFieldToTab('Root.Content', $tabSlideShow);
     $image_manager = new ImageDataObjectManager($this->owner, 'SlideshowSlides', 'SlideshowSlide', 'SlideImage', array(), 'getCMSFields_forPopup');
     $image_manager->copyOnImport = false;
     $fields->addFieldToTab('Root.Content.SlideshowTabs.Slides', $image_manager);
     /*
      * settings
      */
     if (count(self::$effects) > 1) {
         $fields->addFieldToTab('Root.Content.SlideshowTabs.Settings', new DropdownField($name = 'SlideEffect', $title = _t('Slideshow.EFFECT', 'Slide effect'), $source = array_combine(array_keys(self::$effects), array_keys(self::$effects))));
     } else {
         $fields->addFieldToTab('Root.Content.SlideshowTabs.Settings', new HiddenField($name = 'SlideEffect', $title = 'Slide Effect', $value = key(self::$effects)));
     }
     $fields->addFieldsToTab('Root.Content.SlideshowTabs.Settings', array(new TextField($name = 'SlideDuration', $title = _t('Slideshow.SLIDEDURATIOM', 'Duration of Each Slide (milliseconds)')), new TextField($name = 'TransitionDuration', $title = _t('Slideshow.TRANSITIONDURATION', 'Duration of Transition Between Slides (milliseconds)')), new CheckboxField($name = 'AutoPlay', $title = _t('Slideshow.AUTOPLAY', 'Start slideshow automatically')), new CheckboxField($name = 'Loop', $title = _t('Slideshow.LOOP', 'Loop slides')), new CheckboxField($name = 'PauseOnHover', $title = _t('Slideshow.PAUSEONHOVER', 'Pause the slideshow when the mouse hovers over it')), new OptionsetField($name = 'UpdateSlideshows', $title = _t('Slideshow.UPDATE', 'Update slideshows'), $source = array('page' => _t('Slideshow.UPDATEPAGEONLY', 'Apply to this page only'), 'section' => _t('Slideshow.UPDATESECTION', 'Apply to all slideshows in this section'), 'site' => _t('Slideshow.UPDATEALL', 'Apply to all slideshows on this site')), $value = 'page')));
 }
开发者ID:helpfulrobot,项目名称:mouseketeers-silverstripe-slideshow,代码行数:34,代码来源:Slideshow.php

示例2: getEditForm

 public function getEditForm($id = null, $fields = null)
 {
     // TODO Duplicate record fetching (see parent implementation)
     if (!$id) {
         $id = $this->currentPageID();
     }
     $form = parent::getEditForm($id);
     // TODO Duplicate record fetching (see parent implementation)
     $record = $this->getRecord($id);
     if ($record && !$record->canView()) {
         return Security::permissionFailure($this);
     }
     $memberList = GridField::create('Members', false, Member::get(), $memberListConfig = GridFieldConfig_RecordEditor::create()->addComponent(new GridFieldButtonRow('after'))->addComponent(new GridFieldExportButton('buttons-after-left')))->addExtraClass("members_grid");
     if ($record && method_exists($record, 'getValidator')) {
         $validator = $record->getValidator();
     } else {
         $validator = Injector::inst()->get('Member')->getValidator();
     }
     $memberListConfig->getComponentByType('GridFieldDetailForm')->setValidator($validator);
     $groupList = GridField::create('Groups', false, Group::get(), GridFieldConfig_RecordEditor::create());
     $columns = $groupList->getConfig()->getComponentByType('GridFieldDataColumns');
     $columns->setDisplayFields(array('Breadcrumbs' => singleton('Group')->fieldLabel('Title')));
     $columns->setFieldFormatting(array('Breadcrumbs' => function ($val, $item) {
         return Convert::raw2xml($item->getBreadcrumbs(' > '));
     }));
     $fields = new FieldList($root = new TabSet('Root', $usersTab = new Tab('Users', _t('SecurityAdmin.Users', 'Users'), $memberList, new LiteralField('MembersCautionText', sprintf('<p class="caution-remove"><strong>%s</strong></p>', _t('SecurityAdmin.MemberListCaution', 'Caution: Removing members from this list will remove them from all groups and the' . ' database')))), $groupsTab = new Tab('Groups', singleton('Group')->i18n_plural_name(), $groupList)), new HiddenField('ID', false, 0));
     // Add import capabilities. Limit to admin since the import logic can affect assigned permissions
     if (Permission::check('ADMIN')) {
         $fields->addFieldsToTab('Root.Users', array(new HeaderField(_t('SecurityAdmin.IMPORTUSERS', 'Import users'), 3), new LiteralField('MemberImportFormIframe', sprintf('<iframe src="%s" id="MemberImportFormIframe" width="100%%" height="250px" frameBorder="0">' . '</iframe>', $this->Link('memberimport')))));
         $fields->addFieldsToTab('Root.Groups', array(new HeaderField(_t('SecurityAdmin.IMPORTGROUPS', 'Import groups'), 3), new LiteralField('GroupImportFormIframe', sprintf('<iframe src="%s" id="GroupImportFormIframe" width="100%%" height="250px" frameBorder="0">' . '</iframe>', $this->Link('groupimport')))));
     }
     // Tab nav in CMS is rendered through separate template
     $root->setTemplate('CMSTabSet');
     // Add roles editing interface
     if (Permission::check('APPLY_ROLES')) {
         $rolesField = GridField::create('Roles', false, PermissionRole::get(), GridFieldConfig_RecordEditor::create());
         $rolesTab = $fields->findOrMakeTab('Root.Roles', _t('SecurityAdmin.TABROLES', 'Roles'));
         $rolesTab->push($rolesField);
     }
     $actionParam = $this->getRequest()->param('Action');
     if ($actionParam == 'groups') {
         $groupsTab->addExtraClass('ui-state-active');
     } elseif ($actionParam == 'users') {
         $usersTab->addExtraClass('ui-state-active');
     } elseif ($actionParam == 'roles') {
         $rolesTab->addExtraClass('ui-state-active');
     }
     $actions = new FieldList();
     $form = Form::create($this, 'EditForm', $fields, $actions)->setHTMLID('Form_EditForm');
     $form->addExtraClass('cms-edit-form');
     $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
     // Tab nav in CMS is rendered through separate template
     if ($form->Fields()->hasTabset()) {
         $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
     }
     $form->addExtraClass('center ss-tabset cms-tabset ' . $this->BaseCSSClasses());
     $form->setAttribute('data-pjax-fragment', 'CurrentForm');
     $this->extend('updateEditForm', $form);
     return $form;
 }
开发者ID:assertchris,项目名称:silverstripe-framework,代码行数:60,代码来源:SecurityAdmin.php

示例3: getEditForm

 /**
  * @return Form
  */
 public function getEditForm($id = null, $fields = null)
 {
     if (!$id) {
         $id = $this->currentPageID();
     }
     $form = parent::getEditForm($id);
     $record = $this->getRecord($id);
     if ($record && !$record->canView()) {
         return Security::permissionFailure($this);
     }
     $commentsConfig = GridFieldConfig::create()->addComponents(new GridFieldFilterHeader(), new GridFieldDataColumns(), new GridFieldSortableHeader(), new GridFieldPaginator(25), new GridFieldDeleteAction(), new GridFieldDetailForm(), new GridFieldExportButton(), new GridFieldEditButton(), new GridFieldDetailForm());
     $needs = new GridField('Comments', _t('CommentsAdmin.NeedsModeration', 'Needs Moderation'), Comment::get()->where('Moderated = 0'), $commentsConfig);
     $moderated = new GridField('CommentsModerated', _t('CommentsAdmin.CommentsModerated'), Comment::get()->where('Moderated = 1'), $commentsConfig);
     $fields = new FieldList($root = new TabSet('Root', new Tab('NeedsModeration', _t('CommentAdmin.NeedsModeration', 'Needs Moderation'), $needs), new Tab('Comments', _t('CommentAdmin.Moderated', 'Moderated'), $moderated)));
     $root->setTemplate('CMSTabSet');
     $actions = new FieldList();
     $form = new Form($this, 'EditForm', $fields, $actions);
     $form->addExtraClass('cms-edit-form');
     $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
     if ($form->Fields()->hasTabset()) {
         $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
         $form->addExtraClass('center ss-tabset cms-tabset ' . $this->BaseCSSClasses());
     }
     $this->extend('updateEditForm', $form);
     return $form;
 }
开发者ID:roed,项目名称:silverstripe-comments,代码行数:29,代码来源:CommentAdmin.php

示例4: getEditForm

 /**
  * @return Form
  */
 public function getEditForm($id = null, $fields = null)
 {
     if (!$id) {
         $id = $this->currentPageID();
     }
     $form = parent::getEditForm($id);
     $record = $this->getRecord($id);
     if ($record && !$record->canView()) {
         return Security::permissionFailure($this);
     }
     $newComments = Comment::get()->filter('Moderated', 0);
     $newGrid = new CommentsGridField('NewComments', _t('CommentsAdmin.NewComments', 'New'), $newComments, CommentsGridFieldConfig::create());
     $approvedComments = Comment::get()->filter('Moderated', 1)->filter('IsSpam', 0);
     $approvedGrid = new CommentsGridField('ApprovedComments', _t('CommentsAdmin.ApprovedComments', 'Approved'), $approvedComments, CommentsGridFieldConfig::create());
     $spamComments = Comment::get()->filter('Moderated', 1)->filter('IsSpam', 1);
     $spamGrid = new CommentsGridField('SpamComments', _t('CommentsAdmin.SpamComments', 'Spam'), $spamComments, CommentsGridFieldConfig::create());
     $newCount = '(' . count($newComments) . ')';
     $approvedCount = '(' . count($approvedComments) . ')';
     $spamCount = '(' . count($spamComments) . ')';
     $fields = new FieldList($root = new TabSet('Root', new Tab('NewComments', _t('CommentAdmin.NewComments', 'New') . ' ' . $newCount, $newGrid), new Tab('ApprovedComments', _t('CommentAdmin.ApprovedComments', 'Approved') . ' ' . $approvedCount, $approvedGrid), new Tab('SpamComments', _t('CommentAdmin.SpamComments', 'Spam') . ' ' . $spamCount, $spamGrid)));
     $root->setTemplate('CMSTabSet');
     $actions = new FieldList();
     $form = new Form($this, 'EditForm', $fields, $actions);
     $form->addExtraClass('cms-edit-form');
     $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
     if ($form->Fields()->hasTabset()) {
         $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
         $form->addExtraClass('center ss-tabset cms-tabset ' . $this->BaseCSSClasses());
     }
     $this->extend('updateEditForm', $form);
     return $form;
 }
开发者ID:krissihall,项目名称:sm_ss,代码行数:35,代码来源:CommentAdmin.php

示例5: ItemEditForm

 function ItemEditForm()
 {
     $form = parent::ItemEditForm();
     $actions = $form->Actions();
     $majorActions = CompositeField::create()->setName('MajorActions')->setTag('fieldset')->addExtraClass('ss-ui-buttonset');
     $rootTabSet = new TabSet('ActionMenus');
     $moreOptions = new Tab('MoreOptions', _t('SiteTree.MoreOptions', 'More options', 'Expands a view for more buttons'));
     $rootTabSet->push($moreOptions);
     $rootTabSet->addExtraClass('ss-ui-action-tabset action-menus');
     // Render page information into the "more-options" drop-up, on the top.
     $baseClass = ClassInfo::baseDataClass($this->record->class);
     $live = Versioned::get_one_by_stage($this->record->class, 'Live', "\"{$baseClass}\".\"ID\"='{$this->record->ID}'");
     $existsOnLive = $this->record->getExistsOnLive();
     $published = $this->record->isPublished();
     $moreOptions->push(new LiteralField('Information', $this->record->customise(array('Live' => $live, 'ExistsOnLive' => $existsOnLive))->renderWith('SiteTree_Information')));
     $actions->removeByName('action_doSave');
     $actions->removeByName('action_doDelete');
     if ($this->record->canEdit()) {
         if ($this->record->IsDeletedFromStage) {
             if ($existsOnLive) {
                 $majorActions->push(FormAction::create('revert', _t('CMSMain.RESTORE', 'Restore')));
                 if ($this->record->canDelete() && $this->record->canDeleteFromLive()) {
                     $majorActions->push(FormAction::create('unpublish', _t('CMSMain.DELETEFP', 'Delete'))->addExtraClass('ss-ui-action-destructive'));
                 }
             } else {
                 if (!$this->record->isNew()) {
                     $majorActions->push(FormAction::create('restore', _t('CMSMain.RESTORE', 'Restore'))->setAttribute('data-icon', 'decline'));
                 } else {
                     $majorActions->push(FormAction::create('save', _t('SiteTree.BUTTONSAVED', 'Saved'))->addExtraClass('ss-ui-alternate ss-ui-action-constructive')->setAttribute('data-icon', 'accept')->setAttribute('data-icon-alternate', 'addpage')->setAttribute('data-text-alternate', _t('CMSMain.SAVEDRAFT', 'Save draft'))->setUseButtonTag(true));
                     $majorActions->push(FormAction::create('publish', _t('SiteTree.BUTTONPUBLISHED', 'Published'))->addExtraClass('ss-ui-alternate ss-ui-action-constructive')->setAttribute('data-icon', 'accept')->setAttribute('data-icon-alternate', 'disk')->setAttribute('data-text-alternate', _t('SiteTree.BUTTONSAVEPUBLISH', 'Save & publish'))->setUseButtonTag(true));
                 }
             }
         } else {
             if ($this->record->canDelete() && !$published) {
                 $moreOptions->push(FormAction::create('delete', _t('SiteTree.BUTTONDELETE', 'Delete draft'))->addExtraClass('ss-ui-action-destructive')->setUseButtonTag(true));
             }
             $majorActions->push(FormAction::create('save', _t('SiteTree.BUTTONSAVED', 'Saved'))->setAttribute('data-icon', 'accept')->setAttribute('data-icon-alternate', 'addpage')->setAttribute('data-text-alternate', _t('CMSMain.SAVEDRAFT', 'Save draft'))->setUseButtonTag(true));
         }
     }
     $publish = FormAction::create('publish', $published ? _t('SiteTree.BUTTONPUBLISHED', 'Published') : _t('SiteTree.BUTTONSAVEPUBLISH', 'Save & publish'))->setAttribute('data-icon', 'accept')->setAttribute('data-icon-alternate', 'disk')->setAttribute('data-text-alternate', _t('SiteTree.BUTTONSAVEPUBLISH', 'Save & publish'))->setUseButtonTag(true);
     if (!$published || $this->record->stagesDiffer('Stage', 'Live') && $published) {
         $publish->addExtraClass('ss-ui-alternate');
     }
     if ($this->record->canPublish() && !$this->record->IsDeletedFromStage) {
         $majorActions->push($publish);
     }
     if ($published && $this->record->canPublish() && !$this->record->IsDeletedFromStage && $this->record->canDeleteFromLive()) {
         $moreOptions->push(FormAction::create('unpublish', _t('SiteTree.BUTTONUNPUBLISH', 'Unpublish'), 'delete')->addExtraClass('ss-ui-action-destructive')->setUseButtonTag(true));
     }
     if ($this->record->stagesDiffer('Stage', 'Live') && !$this->record->IsDeletedFromStage && $this->record->isPublished() && $this->record->canEdit()) {
         $moreOptions->push(FormAction::create('rollback', _t('SiteTree.BUTTONCANCELDRAFT', 'Cancel draft changes'))->setDescription(_t('SiteTree.BUTTONCANCELDRAFTDESC', 'Delete your draft and revert to the currently published page'))->setUseButtonTag(true));
     }
     $actions->push($majorActions);
     $actions->push($rootTabSet);
     if ($this->record->hasMethod('getCMSValidator')) {
         $form->setValidator($this->record->getCMSValidator());
     }
     return $form;
 }
开发者ID:helpfulrobot,项目名称:studiobonito-silverstripe-publishable,代码行数:59,代码来源:PublishableGridFieldDetailForm.php

示例6: getCMSFields

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
        Requirements::javascript('memberprofiles/javascript/MemberProfilePageCms.js');
        // Setup tabs
        $fields->addFieldToTab('Root', $profile = new TabSet('Profile'), 'Content');
        $fields->addFieldToTab('Root', $email = new Tab('Email'), 'Behaviour');
        $profile->setTitle(_t('MemberProfiles.PROFILE', 'Profile'));
        $email->setTitle(_t('MemberProfiles.EMAIL', 'Email'));
        $fields->findOrMakeTab('Root.Profile.Fields', _t('MemberProfiles.FIELDS', 'Fields'));
        $fields->findOrMakeTab('Root.Profile.Groups', _t('MemberProfiles.GROUPS', 'Groups'));
        $fields->findOrMakeTab('Root.Profile.PublicProfile', _t('MemberProfiles.PUBLICPROFILE', 'Public Profile'));
        // Profile fields
        $fields->addFieldsToTab('Root.Profile.Fields', array(new HeaderField('ProfileFieldsHeader', _t('MemberProfiles.PROFILEFIELDS', 'Profile Fields')), $table = new OrderableComplexTableField($this, 'Fields', 'MemberProfileField')));
        $table->setPermissions(array('show', 'edit'));
        $table->setCustomSourceItems($this->getProfileFields());
        // Groups
        $fields->addFieldsToTab('Root.Profile.Groups', array(new HeaderField('GroupsHeader', _t('MemberProfiles.GROUPASSIGNMENT', 'Group Assignment')), new LiteralField('GroupsNote', '<p>' . _t('MemberProfiles.GROUPSNOTE', 'Any users registering via this page will always be added to ' . 'the below groups (if registration is enabled). Conversely, a ' . 'member must belong to these groups in order to edit their ' . 'profile on this page.') . '</p>'), new CheckboxSetField('Groups', '', DataObject::get('Group')->map()), new HeaderField('SelectableGroupsHeader', _t('MemberProfiles.USERSELECTABLE', 'User Selectable')), new LiteralField('SelectableGroupsNote', '<p>' . _t('MemberProfiles.SELECTABLEGROUPSNOTE', 'Users can choose to belong to the following groups, if the ' . '"Groups" field is enabled in the "Fields" tab.') . '</p>'), new CheckboxSetField('SelectableGroups', '', DataObject::get('Group')->map())));
        // Public profile
        $fields->addFieldsToTab('Root.Profile.PublicProfile', array(new HeaderField('PublicProfileHeader', _t('MemberProfiles.PUBLICPROFILE', 'Public Profile')), new CheckboxField('AllowProfileViewing', _t('MemberProfiles.ALLOWPROFILEVIEWING', 'Allow people to view user profiles.')), new HeaderField('ProfileSectionsHeader', _t('MemberProfiles.PROFILESECTIONS', 'Profile Sections')), new MemberProfileSectionField($this, 'Sections', 'MemberProfileSection')));
        // Email confirmation and validation
        $fields->addFieldsToTab('Root.Email', array(new HeaderField('EmailHeader', 'Email Confirmation and Validation'), new OptionSetField('EmailType', '', array('Validation' => 'Require email validation to activate an account', 'Confirmation' => 'Send a confirmation email after a user registers', 'None' => 'Do not send any emails')), new ToggleCompositeField('EmailContent', 'Email Content', array(new TextField('EmailSubject', 'Email subject'), new TextField('EmailFrom', 'Email from'), new TextareaField('EmailTemplate', 'Email template'), new LiteralField('TemplateNote', MemberConfirmationEmail::TEMPLATE_NOTE))), new ToggleCompositeField('ConfirmationContent', 'Confirmation Content', array(new LiteralField('ConfirmationNote', '<p>This content is dispayed when
					a user confirms their account.</p>'), new TextField('ConfirmationTitle', 'Title'), new HtmlEditorField('ConfirmationContent', 'Content')))));
        // Content
        $fields->removeFieldFromTab('Root.Content.Main', 'Content');
        $fields->addFieldToTab('Root.Content', $profileContent = new Tab('Profile'), 'Metadata');
        $fields->addFieldToTab('Root.Content', $regContent = new Tab('Registration'), 'Metadata');
        $fields->addFieldToTab('Root.Content', $afterReg = new Tab('AfterRegistration'), 'Metadata');
        $profileContent->setTitle(_t('MemberProfiles.PROFILE', 'Profile'));
        $regContent->setTitle(_t('MemberProfiles.REGISTRATION', 'Registration'));
        $afterReg->setTitle(_t('MemberProfiles.AFTERREG', 'After Registration'));
        $tabs = array('Profile', 'Registration', 'AfterRegistration');
        foreach ($tabs as $tab) {
            $fields->addFieldsToTab("Root.Content.{$tab}", array(new TextField("{$tab}Title", _t('MemberProfiles.TITLE', 'Title')), new HtmlEditorField("{$tab}Content", _t('MemberProfiles.CONTENT', 'Content'))));
        }
        $fields->addFieldToTab('Root.Content.AfterRegistration', new CheckboxField('RegistrationRedirect', _t('MemberProfiles.REDIRECT_AFTER_REG', 'Redirect after registration?')), 'AfterRegistrationContent');
        $fields->addFieldToTab('Root.Content.AfterRegistration', new TreeDropdownField('PostRegistrationTargetID', _t('MemberProfiles.REDIRECT_TARGET', 'Redirect to page'), 'SiteTree'), 'AfterRegistrationContent');
        // Behaviour
        $fields->addFieldToTab('Root.Behaviour', new HeaderField('ProfileBehaviour', _t('MemberProfiles.PROFILEBEHAVIOUR', 'Profile Behaviour')), 'ClassName');
        $fields->addFieldToTab('Root.Behaviour', new CheckboxField('AllowRegistration', _t('MemberProfiles.ALLOWREG', 'Allow registration via this page')), 'ClassName');
        $fields->addFieldToTab('Root.Behaviour', new CheckboxField('AllowProfileEditing', _t('MemberProfiles.ALLOWEDITING', 'Allow users to edit their own profile on this page')), 'ClassName');
        $fields->addFieldToTab('Root.Behaviour', new CheckboxField('AllowAdding', _t('MemberProfiles.ALLOWADD', 'Allow members with member creation permissions to add members via this page')), 'ClassName');
        $requireApproval = new CheckboxField('RequireApproval', _t('MemberProfiles.REQUIREREGAPPROVAL', 'Require registration approval by an administrator?'));
        $fields->addFieldToTab('Root.Behaviour', $requireApproval, 'ClassName');
        $approvalGroups = _t('MemberProfiles.NOTIFYTHESEGROUPS', 'Notify these groups to approve new registrations');
        $approvalGroups = new TreeMultiselectField('ApprovalGroups', $approvalGroups, 'Group');
        $fields->addFieldToTab('Root.Behaviour', $approvalGroups, 'ClassName');
        $pageSettings = new HeaderField('PageSettingsHeader', _t('MemberProfiles.PAGEBEHAVIOUR', 'Page Behaviour'));
        $fields->addFieldToTab('Root.Behaviour', $pageSettings, 'ClassName');
        return $fields;
    }
开发者ID:newsplash,项目名称:silverstripe-memberprofiles,代码行数:53,代码来源:MemberProfilePage.php

示例7: Form

 /**
  * This method should be overloaded to build out the detail form.
  *
  * @return Form
  */
 public function Form()
 {
     $form = new Form($this, 'Form', new FieldList($root = new TabSet('Root', new Tab('Main'))), new FieldList());
     if ($this->getTopLevelController() instanceof LeftAndMain) {
         $form->setTemplate('LeftAndMain_EditForm');
         $form->addExtraClass('cms-content cms-edit-form cms-tabset center');
         $form->setAttribute('data-pjax-fragment', 'CurrentForm Content');
         $root->setTemplate('CMSTabSet');
         $form->Backlink = $this->getBackLink();
     }
     return $form;
 }
开发者ID:helpfulrobot,项目名称:ajshort-silverstripe-gridfieldextensions,代码行数:17,代码来源:GridFieldRequestHandler.php

示例8: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     $fields->addFieldToTab('Root', Tab::create("GoogleAnalytics", _t('GoogleAnalyzer.TABTITLE', "Google Analytics")));
     $fields->addFieldToTab("Root.GoogleAnalytics", TabSet::create("Stats", _t('GoogleAnalyzer.STATS', "Stats")));
     $fields->addFieldToTab('Root.GoogleAnalytics.Stats', Tab::create("Performance", _t('GoogleAnalyzer.PERFORMANCE', "Performance")));
     $fields->addFieldToTab("Root.GoogleAnalytics.Stats.Performance", new GooglePerformanceChart($this->owner));
 }
开发者ID:helpfulrobot,项目名称:jelicanin-silverstripe-googleanalytics,代码行数:7,代码来源:GoogleAnalyzer.php

示例9: getCMSFields

 function getCMSFields()
 {
     $fields = FieldList::create(TabSet::create('Root'));
     $fields->addFieldToTab('Root.Main', new TextField('Title'));
     $fields->addFieldToTab('Root.Main', new CurrencyField('Price'));
     return $fields;
 }
开发者ID:ormandroid,项目名称:ss_boilerplate,代码行数:7,代码来源:MenuVariation.php

示例10: getCMSFields

 public function getCMSFields()
 {
     $fields = FieldList::create(TabSet::create('Root'))->text('Title')->text('Code', 'Code', '', 5)->textarea('Description')->numeric('SessionCount', 'Number of sessions')->numeric('AlternateCount', 'Number of alternates')->checkbox('VotingVisible', "This category is visible to voters")->checkbox('ChairVisible', "This category is visible to track chairs")->hidden('SummitID', 'SummitID');
     if ($this->ID > 0) {
         //tags
         $config = new GridFieldConfig_RelationEditor(100);
         $config->removeComponentsByType(new GridFieldDataColumns());
         $config->removeComponentsByType(new GridFieldDetailForm());
         $completer = $config->getComponentByType('GridFieldAddExistingAutocompleter');
         $completer->setResultsFormat('$Tag');
         $completer->setSearchFields(array('Tag'));
         $completer->setSearchList(Tag::get());
         $editconf = new GridFieldDetailForm();
         $editconf->setFields(FieldList::create(TextField::create('Tag', 'Tag'), DropdownField::create('ManyMany[Group]', 'Group', array('topics' => 'Topics', 'speaker' => 'Speaker', 'openstack projects mentioned' => 'OpenStack Projects Mentioned'))));
         $summaryfieldsconf = new GridFieldDataColumns();
         $summaryfieldsconf->setDisplayFields(array('Tag' => 'Tag', 'Group' => 'Group'));
         $config->addComponent($editconf);
         $config->addComponent($summaryfieldsconf, new GridFieldFilterHeader());
         $tags = new GridField('AllowedTags', 'Tags', $this->AllowedTags(), $config);
         $fields->addFieldToTab('Root.Main', $tags);
         // extra questions for call-for-presentations
         $config = new GridFieldConfig_RelationEditor();
         $config->removeComponentsByType('GridFieldAddNewButton');
         $multi_class_selector = new GridFieldAddNewMultiClass();
         $multi_class_selector->setClasses(array('TrackTextBoxQuestionTemplate' => 'TextBox', 'TrackCheckBoxQuestionTemplate' => 'CheckBox', 'TrackCheckBoxListQuestionTemplate' => 'CheckBoxList', 'TrackRadioButtonListQuestionTemplate' => 'RadioButtonList', 'TrackDropDownQuestionTemplate' => 'ComboBox', 'TrackLiteralContentQuestionTemplate' => 'Literal'));
         $config->addComponent($multi_class_selector);
         $questions = new GridField('ExtraQuestions', 'Track Specific Questions', $this->ExtraQuestions(), $config);
         $fields->addFieldToTab('Root.Main', $questions);
     }
     return $fields;
 }
开发者ID:hogepodge,项目名称:openstack-org,代码行数:31,代码来源:PresentationCategory.php

示例11: updateCMSFields

 /**
  * @param FieldList $fields
  */
 public function updateCMSFields(FieldList $fields)
 {
     /** =========================================
          * @var TextareaField $address
          * @var TextareaField $postalAddress
          * @var TextField $mailChimpAPI
          * @var TextareaField $mailChimpSuccessMessage
         ===========================================*/
     if (!$fields->fieldByName('Root.Settings')) {
         $fields->addFieldToTab('Root', TabSet::create('Settings'));
     }
     /** -----------------------------------------
      * Details
      * ----------------------------------------*/
     $address = TextareaField::create('Address', 'Address');
     $address->setRows(8);
     $postalAddress = TextareaField::create('PostalAddress', 'Postal Address');
     $postalAddress->setRows(8);
     $fields->findOrMakeTab('Root.Settings.Details');
     $fields->addFieldsToTab('Root.Settings.Details', array(HeaderField::create('', 'Company Details'), Textfield::create('Phone', 'Phone Number'), Textfield::create('Email', 'Public Email Address'), $address, $postalAddress, TextField::create('Facebook', 'Facebook'), TextField::create('LinkedIn', 'LinkedIn'), TextField::create('Pinterest', 'Pinterest'), TextField::create('TwitterHandle', 'Twitter Handle')));
     /** -----------------------------------------
      * Subscription
      * ----------------------------------------*/
     $mailChimpAPI = TextField::create('MailChimpAPI', 'API Key');
     $mailChimpSuccessMessage = TextareaField::create('MailChimpSuccessMessage', 'Success Message (optional)');
     $mailChimpAPI->setRightTitle('<a href="https://us9.admin.mailchimp.com/account/api-key-popup/" target="_blank"><i>How do I get my MailChimp API Key?</i></a>');
     $mailChimpSuccessMessage->setRows(2)->setRightTitle('Message displayed when a user has successfully subscribed to a list.');
     $fields->findOrMakeTab('Root.Settings.Subscription', 'Subscription');
     $fields->addFieldsToTab('Root.Settings.Subscription', array(HeaderField::create('', 'Newsletter Subscription'), LiteralField::create('', '<p>The API key, and list ID are necessary for the Newsletter Subscription form to function.</p>'), $mailChimpAPI, TextField::create('MailChimpListID', 'List ID'), $mailChimpSuccessMessage));
 }
开发者ID:toastnz,项目名称:quicksilver,代码行数:33,代码来源:SiteConfigExtension.php

示例12: getCMSFields

 /**
  * getCMSFields
  * Construct the FieldList used in the CMS. To provide a
  * smarter UI we don't use the scaffolding provided by
  * parent::getCMSFields.
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
     //Create the FieldList and push the Root TabSet on to it.
     $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create("Add/Edit Order Status"), CompositeField::create(TextField::create("Title", "Friendly Name")->setRightTitle("The name of your custom order status. i.e. Pending, Awaiting Stock."), TextareaField::create("Content", "Friendly Description")->setRightTitle("This will be shown to your customers. What do you wish to tell them about this status?")))));
     return $fields;
 }
开发者ID:micschk,项目名称:torindul-silverstripe-shop,代码行数:15,代码来源:Order_Statuses.php

示例13: updateCMSFields

 public function updateCMSFields(FieldList $fields)
 {
     $fields->insertBefore($shoptab = Tab::create('Shop', 'Shop'), 'Access');
     $fields->addFieldsToTab("Root.Shop", TabSet::create("ShopTabs", $maintab = Tab::create("Main", TreeDropdownField::create('TermsPageID', _t("ShopConfig.TERMSPAGE", 'Terms and Conditions Page'), 'SiteTree'), TreeDropdownField::create("CustomerGroupID", _t("ShopConfig.CUSTOMERGROUP", "Group to add new customers to"), "Group"), UploadField::create('DefaultProductImage', _t('ShopConfig.DEFAULTIMAGE', 'Default Product Image'))), $countriestab = Tab::create("Countries", CheckboxSetField::create('AllowedCountries', _t('ShopConfig.ALLOWED_COUNTRIES', 'Allowed Ordering and Shipping Countries'), self::config()->iso_3166_country_codes))));
     $fields->removeByName("CreateTopLevelGroups");
     $countriestab->setTitle(_t('ShopConfig.ALLOWED_COUNTRIES_TAB_TITLE', "Allowed Countries"));
 }
开发者ID:NobrainerWeb,项目名称:silverstripe-shop,代码行数:7,代码来源:ShopConfig.php

示例14: getCMSFields

 /**
  * @return FieldList
  */
 public function getCMSFields()
 {
     /** =========================================
          * @var FieldList $fields
          * @var FieldGroup $settings
          * @var UploadField $image
          * @var GridFieldConfig_RelationEditor $config
          * @var GridField $gridField
         ===========================================*/
     $fields = FieldList::create(TabSet::create('Root'));
     $fields->addfieldToTab('Root.Main', $title = TextField::create('Title'));
     $title->setRightTitle('Title used in the cms as a visual cue for this piece of content.');
     $fields->addFieldToTab('Root.Main', $settings = FieldGroup::create(array(CheckboxField::create('IsFullWidth', 'Container full width'))));
     $settings->setTitle('Settings');
     $fields->addFieldToTab('Root.Main', HeaderField::create('', 'Style'));
     $fields->addFieldToTab('Root.Main', DesignField::create('Style', 'Container', '.container', array('padding-top' => 'TextField', 'padding-bottom' => 'TextField', 'margin-top' => 'TextField', 'margin-bottom' => 'TextField', 'color' => 'ColorField', 'background' => 'ColorField')));
     $fields->addFieldToTab('Root.Main', HeaderField::create('', 'Background (optional)', 4));
     $fields->addFieldToTab('Root.Main', $image = UploadField::create('Image', _t('PageBuilderContainer.IMAGE', 'Image')));
     $image->setAllowedExtensions(array('jpeg', 'jpg', 'gif', 'png'));
     $image->setFolderName('Uploads/site-builder/containers');
     $fields->addFieldToTab('Root.Main', DropdownField::create('BackgroundType', 'Type', $this->dbObject('BackgroundType')->enumValues()));
     $config = GridFieldConfig_RelationEditor::create(10);
     $config->addComponent(GridFieldOrderableRows::create('SortOrder'))->addComponent(new GridFieldDeleteAction());
     $gridField = GridField::create('Items', 'Items', $this->Items(), $config);
     $gridField->addExtraClass('hide');
     $fields->addFieldToTab('Root.Main', $gridField);
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:toastnz-silverstripe-site-builder,代码行数:31,代码来源:PageBuilderContainer.php

示例15: getCMSFields

 /**
  * getCMSFields
  * Construct the FieldList used in the CMS. To provide a
  * smarter UI we don't use the scaffolding provided by
  * parent::getCMSFields.
  * 
  * @return FieldList
  */
 public function getCMSFields()
 {
     Requirements::css('torindul-silverstripe-shop/css/LeftAndMain.css');
     //Create the FieldList and push the Root TabSet on to it.
     $fields = FieldList::create($root = TabSet::create('Root', Tab::create("Main", HeaderField::create($this->SystemName), CompositeField::create(TextField::create("Title", "Friendly Name")->setRightTitle("This is the name your customers would see against this courier."), DropdownField::create("Enabled", "Enable this courier?", array("0" => "No", "1" => "Yes"))->setEmptyString("(Select one)")->setRightTitle("Can customers use this courier?")))));
     return $fields;
 }
开发者ID:micschk,项目名称:torindul-silverstripe-shop,代码行数:15,代码来源:Courier.php


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