Commit 24719b7f authored by Tobias Munk's avatar Tobias Munk

removed unused code

parent fc689141
Pipeline #8432 failed with stages
......@@ -20,52 +20,5 @@ use yii\helpers\ArrayHelper;
*/
class Module extends \yii\base\Module
{
public function getMenuItems()
{
$menuItemPresets = [
'admin' => ['label' => '<i class="fa fa-dashboard"></i> <span>Dashboard</span>', 'url' => ['/admin']],
'user' => ['label' => '<i class="fa fa-users"></i> <span>Users</span>', 'url' => ['/user/admin']],
'packaii' => ['label' => '<i class="fa fa-cubes"></i> <span>Packages</span>', 'url' => ['/packaii']],
'gii' => ['label' => '<i class="fa fa-code"></i> <span>Code Generation</span>', 'url' => ['/gii']],
];
$autoMenuItems = [];
foreach (\Yii::$app->getModules() as $name => $m) {
switch ($name) {
case 'admin':
case 'user':
case 'packaii':
case 'gii':
$menuItems[] = $menuItemPresets[$name];
break;
default:
$module = \Yii::$app->getModule($name);
$autoMenuItems[] = [
'label' => '<i class="fa fa-cube"></i> <span>'.ucfirst($name).'</span>',
'url' => ['/'.$module->id],
];
}
}
$menuItems = ArrayHelper::merge($menuItems, $autoMenuItems);
return $menuItems;
}
public function getControllers($module = null)
{
if ($module === null) {
$module = \Yii::$app;
} else {
$module = \Yii::$app->getModule($module);
}
foreach (scandir($module->getControllerPath()) as $i => $name) {
if (substr($name, 0, 1) == '.') {
continue;
}
$controllers[] = \yii\helpers\Inflector::camel2id(str_replace('Controller.php', '', $name));
}
return $controllers;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment