UserSettingMenu in authentication settings

This commit is contained in:
buddha87 2016-06-05 19:20:43 +02:00
parent dcd41d049d
commit 5baf8b8e62
6 changed files with 60 additions and 25 deletions

View File

@ -35,7 +35,8 @@
"bower-asset/bootstrap-markdown": "2.10.*",
"bower-asset/select2" : "^4.0.2",
"bower-asset/bluebird" : "^3.3.5",
"bower-asset/select2-bootstrap-theme" : "0.1.0-beta.4"
"bower-asset/select2-bootstrap-theme" : "0.1.0-beta.4",
"jonnyw/php-phantomjs": "4.*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
@ -51,6 +52,12 @@
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject"
],
"post-install-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
],
"post-update-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
]
},
"extra": {

View File

@ -3,23 +3,11 @@
use yii\widgets\ActiveForm;
use humhub\compat\CHtml;
use humhub\models\Setting;
use yii\helpers\Url;
?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo Yii::t('AdminModule.views_setting_authentication', '<strong>Authentication</strong> - Basic'); ?></div>
<div class="panel-body">
<ul class="nav nav-pills">
<li class="active"><a
href="<?php echo Url::toRoute('authentication'); ?>"><?php echo Yii::t('AdminModule.views_setting_authentication', 'Basic'); ?></a>
</li>
<li>
<a href="<?php echo Url::toRoute('authentication-ldap'); ?>"><?php echo Yii::t('AdminModule.views_setting_authentication', 'LDAP'); ?></a>
</li>
</ul>
<br/>
<?= \humhub\modules\admin\widgets\UserSettingMenu::widget([]) ?>
<?php $form = ActiveForm::begin(['id' => 'authentication-settings-form']); ?>

View File

@ -3,22 +3,12 @@
use yii\widgets\ActiveForm;
use humhub\compat\CHtml;
use humhub\models\Setting;
use yii\helpers\Url;
?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo Yii::t('AdminModule.views_setting_authentication_ldap', '<strong>Authentication</strong> - LDAP'); ?></div>
<div class="panel-body">
<ul class="nav nav-pills">
<li>
<a href="<?php echo Url::toRoute('authentication'); ?>"><?php echo Yii::t('AdminModule.views_setting_authentication_ldap', 'Basic'); ?></a>
</li>
<li class="active"><a
href="<?php echo Url::toRoute('authentication-ldap'); ?>"><?php echo Yii::t('AdminModule.views_setting_authentication_ldap', 'LDAP'); ?></a>
</li>
</ul>
<br/>
<?= \humhub\modules\admin\widgets\UserSettingMenu::widget([]) ?>
<?php if ($enabled): ?>
<?php if ($errorMessage != ""): ?>

View File

@ -0,0 +1,44 @@
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
namespace humhub\modules\admin\widgets;
use Yii;
use yii\helpers\Url;
/**
* User Administration Menu
*
* @author Basti
*/
class UserSettingMenu extends \humhub\widgets\BaseMenu
{
public $template = "@humhub/widgets/views/tabMenu";
public $type = "adminUserSettingNavigation";
public function init()
{
$this->addItem(array(
'label' => Yii::t('AdminModule.views_setting_authentication', 'General'),
'url' => Url::toRoute(['/admin/setting/authentication']),
'sortOrder' => 100,
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'settings' && Yii::$app->controller->action->id == 'authentication'),
));
$this->addItem(array(
'label' => Yii::t('AdminModule.views_setting_authentication', 'LDAP'),
'url' => Url::toRoute(['/admin/setting/authentication-ldap']),
'sortOrder' => 200,
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'admin' && Yii::$app->controller->id == 'settings' && Yii::$app->controller->action->id == 'authentication-ldap'),
));
parent::init();
}
}

View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,2 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore