本文整理匯總了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;
}