當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。