本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}