Skip to content

Commit

Permalink
Merge pull request #131 from noumo/master
Browse files Browse the repository at this point in the history
some fixes
  • Loading branch information
noumo committed Apr 19, 2016
2 parents 8dc7b42 + 9a58b23 commit 96623e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions AdminModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,33 @@ public function init()
{
parent::init();

if(Yii::$app->cache === null){
if (Yii::$app->cache === null) {
throw new \yii\web\ServerErrorHttpException('Please configure Cache component.');
}

$this->activeModules = Module::findAllActive();

$modules = [];
foreach($this->activeModules as $name => $module){
foreach ($this->activeModules as $name => $module) {
$modules[$name]['class'] = $module->class;
if(is_array($module->settings)){
if (is_array($module->settings)) {
$modules[$name]['settings'] = $module->settings;
}
}
$this->setModules($modules);

define('IS_ROOT', !Yii::$app->user->isGuest && Yii::$app->user->identity->isRoot());
define('LIVE_EDIT', !Yii::$app->user->isGuest && Yii::$app->session->get('easyii_live_edit'));
if (Yii::$app instanceof yii\web\Application) {
define('IS_ROOT', !Yii::$app->user->isGuest && Yii::$app->user->identity->isRoot());
define('LIVE_EDIT', !Yii::$app->user->isGuest && Yii::$app->session->get('easyii_live_edit'));
}
}


public function bootstrap($app)
{
Yii::setAlias('easyii', '@vendor/noumo/easyii');

if(!$app->user->isGuest && strpos($app->request->pathInfo, 'admin') === false) {
if (!$app->user->isGuest && strpos($app->request->pathInfo, 'admin') === false) {
$app->on(Application::EVENT_BEFORE_REQUEST, function () use ($app) {
$app->getView()->on(View::EVENT_BEGIN_BODY, [$this, 'renderToolbar']);
});
Expand All @@ -63,7 +65,7 @@ public function renderToolbar()

public function getInstalled()
{
if($this->_installed === null) {
if ($this->_installed === null) {
try {
$this->_installed = Yii::$app->db->createCommand("SHOW TABLES LIKE 'easyii_%'")->query()->count() > 0 ? true : false;
} catch (\Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion modules/feedback/mail/ru/new_feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<p>Пользователь <b><?= $feedback->name ?></b> оставил сообщение в вашей гостевой книге.</p>
<p>Просмотреть его вы можете <?= Html::a('здесь', $link) ?>.</p>
<hr>
<p>Это автоматическое сообщение и на него не нужно отвечатью</p>
<p>Это автоматическое сообщение и на него не нужно отвечать.</p>

0 comments on commit 96623e9

Please sign in to comment.