當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GridFieldConfig_RelationEditor::__construct方法代碼示例

本文整理匯總了PHP中GridFieldConfig_RelationEditor::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP GridFieldConfig_RelationEditor::__construct方法的具體用法?PHP GridFieldConfig_RelationEditor::__construct怎麽用?PHP GridFieldConfig_RelationEditor::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GridFieldConfig_RelationEditor的用法示例。


在下文中一共展示了GridFieldConfig_RelationEditor::__construct方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @param string $sortField - Field to sort the blocks on. If this is set, it will also make the
  * 	blocks sortable in the CMS (requires SortableGridField module!)
  * @param array $allowedBlocks - a set of allowed class names, optionally mapped to titles
  * @param int $itemsPerPage - How many items per page should show up
  */
 public function __construct($sortField = null, $allowedBlocks = null, $itemsPerPage = null)
 {
     parent::__construct($itemsPerPage);
     // setup a bulk manager for block management
     $bulkManager = new GridFieldBulkManager();
     // remove the default actions
     $toRemove = array('bulkedit', 'bulkEdit', 'delete', 'unlink', 'unLink');
     $validActions = array_keys($bulkManager->getConfig('actions'));
     foreach ($toRemove as $key) {
         if (in_array($key, $validActions)) {
             $bulkManager->removeBulkAction($key);
         }
     }
     // add the actions in desired order
     $bulkManager->addBulkAction('publish', _t('PageBlock.PUBLISH', 'Publish'))->addBulkAction('unpublish', _t('PageBlock.UNPUBLISH', 'Unpublish'))->addBulkAction('bulkedit', _t('PageBlock.EDIT', 'Edit'), 'GridFieldBulkActionEditHandler', array('icon' => 'pencil'))->addBulkAction('versionedunlink', _t('PageBlock.UNLINK', 'Unlink'), 'GridFieldBulkActionVersionedUnlinkHandler', array('icon' => 'chain--minus'))->addBulkAction('versioneddelete', _t('PageBlock.DELETE', 'Delete'), 'GridFieldBulkActionVersionedDeleteHandler', array('isDestructive' => true, 'icon' => 'decline'));
     if ($sortField && class_exists('GridFieldOrderableRows')) {
         $this->addComponent(new GridFieldOrderableRows($sortField));
     }
     // remove the delete action, since unlinking is not required
     $this->removeComponent($this->getComponentByType('GridFieldDeleteAction'));
     // remove the search field since it doesn't make sense (cannot add existing, unless "stealing" from another page)
     $this->removeComponentsByType('GridFieldAddExistingAutocompleter');
     $this->addComponent(new GridFieldAddExistingSearchButton('buttons-before-right'));
     $this->addComponent(new GridFieldAddNewMultiClass(), 'GridFieldToolbarHeader');
     $this->addComponent($bulkManager);
     $this->getComponentByType('GridFieldDataColumns')->setDisplayFields(array('Title' => _t('Block.TITLE', 'Title'), 'i18n_singular_name' => _t('Block.TYPE', 'Type'), 'PublishedStatus' => _t('Block.STATUS', 'Status')));
     $this->setAllowedBlocks($allowedBlocks);
 }
開發者ID:VisionaerAG,項目名稱:page-blocks,代碼行數:34,代碼來源:PageBlocks.php

示例2: __construct

 public function __construct($itemsPerPage = null, $numberToLimitTo = null)
 {
     parent::__construct($itemsPerPage);
     $this->removeComponentsByType('GridFieldAddExistingAutocompleter');
     $this->addComponent(new LRGridFieldAddExistingAutocompleter('buttons-before-right', null, $numberToLimitTo));
     $this->removeComponentsByType('GridFieldDetailForm');
     $this->addComponent(new LRGridFieldDetailForm('DetailForm', $numberToLimitTo));
 }
開發者ID:helpfulrobot,項目名稱:webbuilders-group-silverstripe-limitedrelationsgridfield,代碼行數:8,代碼來源:LRGridFieldConfig.php

示例3: __construct

 /**
  * @param int $itemsPerPage - How many items per page should show up
  */
 public function __construct($itemsPerPage = null)
 {
     parent::__construct(10000);
     $this->removeComponentsByType("GridFieldAddExistingAutocompleter");
     //$this->removeComponentsByType("GridFieldButtonRow");
     //$this->removeComponentsByType("GridFieldAddNewButton");
     //$this->removeComponentsByType("GridFieldToolbarHeader");
     //$this->removeComponentsByType("GridFieldSortableHeader");
     //$this->removeComponentsByType("GridFieldFilterHeader");
     //$this->removeComponentsByType("GridFieldDataColumns");
     //$this->removeComponentsByType("GridFieldEditButton");
     $this->removeComponentsByType("GridFieldDeleteAction");
     //$this->removeComponentsByType("GridFieldPageCount");
     //$this->removeComponentsByType("GridFieldPaginator");
     //$this->removeComponentsByType("GridFieldDetailForm");
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-ecommerce,代碼行數:19,代碼來源:GridFieldConfigForOrderItems.php

示例4: __construct

 public function __construct($itemsPerPage = null, $sort = false)
 {
     parent::__construct($itemsPerPage);
     if ($sort) {
         if (class_exists('GridFieldSortableRows')) {
             $this->addComponent(new GridFieldSortableRows('SortOrder'));
         } else {
             if (class_exists('GridFieldOrderableRows')) {
                 $this->addComponent(new GridFieldOrderableRows('SortOrder'));
             }
         }
     }
     if (class_exists('GridFieldBulkManager')) {
         $this->addComponent(new GridFieldBulkManager());
     }
 }
開發者ID:helpfulrobot,項目名稱:lekoala-silverstripe-form-extras,代碼行數:16,代碼來源:GridFieldConfig_RelationDefault.php

示例5: __construct

 /**
  * @param {int} $itemsPerPage How many items per page should show up
  */
 public function __construct($itemsPerPage = null)
 {
     parent::__construct($itemsPerPage);
     $this->removeComponentsByType('GridFieldDetailForm')->addComponent(new FrontEndGridFieldDetailForm());
 }
開發者ID:helpfulrobot,項目名稱:webbuilders-group-silverstripe-frontendgridfield,代碼行數:8,代碼來源:FrontEndGridFieldConfig.php

示例6: __construct

 /**
  * @param int $itemsPerPage - How many items per page should show up
  */
 public function __construct($itemsPerPage = null)
 {
     parent::__construct($itemsPerPage);
     $this->removeComponentsByType("GridFieldEditButton")->removeComponentsByType("GridFieldAddNewButton")->addComponent(new GridFieldAddNewButtonOriginalPage())->addComponent(new GridFieldEditButtonOriginalPage());
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-ecommerce,代碼行數:8,代碼來源:GridFieldEditOriginalPageConfigWithDelete.php

示例7: GridFieldUserColumns

 function __construct($itemsPerPage = null)
 {
     parent::__construct($itemsPerPage);
     $this->addComponent(new GridFieldUserColumns());
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-gridfield-addons,代碼行數:5,代碼來源:GridFieldUserColumns.php


注:本文中的GridFieldConfig_RelationEditor::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。