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


PHP LeftAndMain::config方法代码示例

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


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

示例1: getEditForm

 /**
  * Gets the form used for viewing a time log
  */
 public function getEditForm($id = null, $fields = null)
 {
     $record = $this->currentPage();
     if ($this->action == 'view' && $record) {
         $fields = new FieldList(new HeaderField('LogHeader', _t('KapostBridgeLogViewer.VIEWING_ENTRY', '_Viewing Log Entry: {datetime}', array('datetime' => $record->dbObject('Created')->FormatFromSettings())), 3), new ReadonlyField('UserAgent', _t('KapostBridgeLogViewer.USER_AGENT', '_Requestor User Agent')), new ReadonlyField('Method', _t('KapostBridgeLogViewer.METHOD', '_Method')), ToggleCompositeField::create('RequestData', _t('KapostBridgeLogViewer.KAPOST_REQUEST', '_Kapost Request'), new FieldList(ReadonlyField::create('RequestFormatted', '')->setTemplate('KapostBridgeLogField')->addExtraClass('log-contents cms-panel-layout')))->setHeadingLevel(3), ToggleCompositeField::create('ResponseData', _t('KapostBridgeLogViewer.SILVERSTRIPE_RESPONSE', '_SilverStripe Response'), new FieldList(ReadonlyField::create('ResponseFormatted', '')->setTemplate('KapostBridgeLogField')->addExtraClass('log-contents cms-panel-layout')))->setHeadingLevel(3));
         $refObj = $record->ReferenceObject;
         if (!empty($refObj) && $refObj !== false && $refObj->exists()) {
             if (method_exists($refObj, 'CMSEditLink')) {
                 $fields->insertBefore(new KapostLogLinkField('CMSEditLink', _t('KapostBridgeLogViewer.REFERENCED_OBJECT', '_Referenced Object'), $refObj->CMSEditLink(), _t('KapostBridgeLogViewer.VIEW_REFERENCED_OBJECT', '_View Referenced Object')), 'RequestData');
             } else {
                 if ($refObj instanceof File) {
                     $refObjLink = Controller::join_links(LeftAndMain::config()->url_base, AssetAdmin::config()->url_segment, 'EditForm/field/File/item', $refObj->ID, 'edit');
                     $fields->insertBefore(new KapostLogLinkField('CMSEditLink', _t('KapostBridgeLogViewer.REFERENCED_OBJECT', '_Referenced Object'), $refObjLink, _t('KapostBridgeLogViewer.VIEW_REFERENCED_OBJECT', '_View Referenced Object')), 'RequestData');
                 }
             }
         }
     } else {
         $fields = new FieldList();
     }
     $form = new CMSForm($this, 'EditForm', $fields, new FieldList());
     $form->setResponseNegotiator($this->getResponseNegotiator());
     $form->addExtraClass('cms-edit-form center');
     $form->setAttribute('data-layout-type', 'border');
     $form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
     $form->setAttribute('data-pjax-fragment', 'CurrentForm');
     $form->setHTMLID('Form_EditForm');
     if ($record) {
         $form->loadDataFrom($record);
     }
     return $form;
 }
开发者ID:webbuilders-group,项目名称:silverstripe-kapost-bridge-logger,代码行数:34,代码来源:KapostBridgeLogViewer.php

示例2: CMSEditLink

 /**
  * Gets the edit link for the Kapost Object
  * @return {string} Edit link for the Kapost Object
  */
 public function CMSEditLink()
 {
     return Controller::join_links(LeftAndMain::config()->url_base, KapostAdmin::config()->url_segment, 'KapostObject/EditForm/field/KapostObject/item', $this->ID, 'edit');
 }
开发者ID:webbuilders-group,项目名称:silverstripe-kapost-bridge,代码行数:8,代码来源:KapostObject.php

示例3: resetMenu

 /**
  * Clear menu to default state as per LeftAndMain::init()
  */
 protected function resetMenu()
 {
     CMSMenu::clear_menu();
     CMSMenu::populate_menu();
     CMSMenu::add_link('Help', _t('LeftAndMain.HELP', 'Help', 'Menu title'), LeftAndMain::config()->help_link, -2, array('target' => '_blank'));
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:9,代码来源:LeftAndMainTest.php

示例4: getSilverStripeDocLink

 /**
  * Gets the SilverStripe docs link from the config layer
  * @return {string}
  */
 public function getSilverStripeDocLink()
 {
     return LeftAndMain::config()->help_link;
 }
开发者ID:webbuilders-group,项目名称:silverstripe-cmsuserdocs,代码行数:8,代码来源:CMSDocumentationViewer.php


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