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


PHP ModelAdmin::getManagedModels方法代码示例

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


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

示例1: getManagedModels

 /**
  * @return array
  **/
 public function getManagedModels()
 {
     $models = parent::getManagedModels();
     // remove blocksets if not in use (set in config):
     if (!$this->blockManager->getUseBlockSets()) {
         unset($models['BlockSet']);
     }
     return $models;
 }
开发者ID:anselmdk,项目名称:silverstripe-blocks,代码行数:12,代码来源:BlockAdmin.php

示例2: getManagedModels

 public function getManagedModels()
 {
     $models = parent::getManagedModels();
     if (NewsArticle::config()->get('author_mode') != 'object') {
         unset($models['NewsAuthor']);
     }
     if (!NewsArticle::config()->get('enable_tags')) {
         unset($models['NewsTag']);
     }
     return $models;
 }
开发者ID:nyeholt,项目名称:silverstripe-newsly,代码行数:11,代码来源:NewsAdmin.php

示例3: getManagedModels

 /**
  * @return array Map of class name to an array of 'title' (see {@link $managed_models})
  */
 function getManagedModels()
 {
     $models = EcommerceConfig::get($this->class, "managed_models");
     foreach ($models as $key => $model) {
         if (is_array($model)) {
             $model = $key;
         }
         if (!class_exists($model)) {
             unset($models[$key]);
         }
     }
     Config::inst()->update('ModelAdminEcommerceBaseClass', 'managed_models', $models);
     return parent::getManagedModels();
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce,代码行数:17,代码来源:ModelAdminEcommerceBaseClass.php

示例4: getManagedModels

 /**
  * Override managed model labels with CMS defaults for member, group and role.
  *
  * @return array
  */
 public function getManagedModels()
 {
     $models = parent::getManagedModels();
     if (isset($models['Member']) && isset($models['Member']['title'])) {
         $models['Member']['title'] = _t('SecurityAdmin.Users', 'Users');
     }
     if (isset($models['Group']) && isset($models['Group']['title'])) {
         $models['Group']['title'] = singleton('Group')->i18n_plural_name();
     }
     if (isset($models['PermissionRole']) && isset($models['PermissionRole']['title'])) {
         $models['PermissionRole']['title'] = _t('SecurityAdmin.TABROLES', 'Roles');
     }
     return $models;
 }
开发者ID:helpfulrobot,项目名称:studiobonito-silverstripe-security,代码行数:19,代码来源:MemberAdmin.php

示例5: getManagedModels

 /**
  * If no managed models are explicitly defined, then default to displaying
  * all available reports.
  *
  * @return array
  */
 public function getManagedModels()
 {
     if ($this->managedModels !== null) {
         return $this->managedModels;
     }
     if ($this->stat('managed_models')) {
         $result = parent::getManagedModels();
     } else {
         $classes = ClassInfo::subclassesFor('AdvancedReport');
         $result = array();
         array_shift($classes);
         foreach ($classes as $class) {
             $result[$class] = array('title' => singleton($class)->singular_name());
         }
     }
     return $this->managedModels = $result;
 }
开发者ID:helpfulrobot,项目名称:maldicore-advancedreports,代码行数:23,代码来源:AdvancedReportsAdmin.php

示例6: getManagedModels

 /**
  * @return array Map of class name to an array of 'title' (see {@link $managed_models})
  */
 public function getManagedModels()
 {
     $models = parent::getManagedModels();
     if (array_key_exists('KapostObject', $models)) {
         $models['KapostObject']['title'] = _t('KapostAdmin.INCOMING_CONTENT', '_Incoming Content');
     }
     return $models;
 }
开发者ID:webbuilders-group,项目名称:silverstripe-kapost-bridge,代码行数:11,代码来源:KapostAdmin.php


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