Skip to content

Commit

Permalink
yupe#418: Отключена загрузку виджета, если он не найден или модуль с
Browse files Browse the repository at this point in the history
виджетом не включен
  • Loading branch information
adminnu committed Dec 19, 2012
1 parent 4490f36 commit f10d7fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- #410: Тема bootstrap полностью перенесена в модули (adminnu)
- #415: Добавлен шаг при установке yupe с выбором устанавливаемых модулей (adminnu)
- #417: При запуске установки возникала ошибка в layout/main.php (adminnu)
- #418: Отключена загрузку виджета, если он не найден или модуль с виджетом не включен (adminnu)

Версия 0.4 (Первый выпуск) 10 Декабря 2012
------------------------------------------
Expand Down
15 changes: 14 additions & 1 deletion protected/modules/yupe/controllers/YMainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@ public function isMultilang()
public function init()
{
parent::init();

$this->yupe = Yii::app()->getModule('yupe');
}

public function widget($className, $properties = array(), $captureOutput = false)
{
if (stripos($className, 'application.modules.', 0) !== false)
{
$module = preg_replace('/^application\.modules\.([^\.]*).*$/', '$1', $className);
if (!is_file(Yii::getPathOfAlias($className) . '.php') || Yii::app()->getModule($module) == NULL)
{
echo Yii::t('yupe', 'Виджет '.$className.' не найден! Подключите модуль ' . $module . '!');
return;
}
}
parent::widget($className, $properties, $captureOutput);
}
}

0 comments on commit f10d7fc

Please sign in to comment.