public function init() { parent::init(); if ($this->requestIsAdmin()) { if (!$this->noImage) { $this->noImage = AdminAsset::getAssetUrl("images/no-photo.gif"); //$this->noImage = \Yii::$app->getAssetManager()->getAssetUrl(AdminAsset::register(\Yii::$app->view), "images/no-photo.gif"); } \Yii::beginProfile('admin loading'); //Загрузка всех компонентов. $components = \Yii::$app->getComponents(); foreach ($components as $id => $data) { try { \Yii::$app->get($id); } catch (\Exception $e) { continue; } } \Yii::$app->trigger(self::EVENT_READY, new Event(['name' => self::EVENT_READY])); \Yii::endProfile('admin loading'); } }
/** * Регистрация дополнительных asset * @param View $view * @return $this */ public function registerAsset(View $view) { if ($this->asset) { if (class_exists($this->asset)) { $className = $this->asset; $className::register($view); } } if ($this->enableCustomPromt == Cms::BOOL_Y) { $file = AdminAsset::getAssetUrl('js/classes/modal/Promt.js'); //$file = \Yii::$app->assetManager->getAssetUrl(AdminAsset::register($view), 'js/classes/modal/Promt.js'); \Yii::$app->view->registerJsFile($file, ['depends' => [AdminAsset::className()]]); } if ($this->enableCustomConfirm == Cms::BOOL_Y) { $file = AdminAsset::getAssetUrl('js/classes/modal/Confirm.js'); //$file = \Yii::$app->assetManager->getAssetUrl(AdminAsset::register($view), 'js/classes/modal/Confirm.js'); \Yii::$app->view->registerJsFile($file, ['depends' => [AdminAsset::className()]]); } return $this; }
* @date 26.02.2015 * @since 1.0.0 */ use skeeks\cms\modules\admin\assets\AdminAsset; use yii\helpers\Html; use yii\bootstrap\Nav; use yii\bootstrap\NavBar; use yii\widgets\Breadcrumbs; use skeeks\cms\App; use skeeks\cms\helpers\UrlHelper; /* @var $this \yii\web\View */ /* @var $content string */ \skeeks\cms\modules\admin\assets\AdminUnauthorizedAsset::register($this); \Yii::$app->admin->registerAsset($this)->initJs(); $urlBg = \Yii::$app->assetManager->getAssetUrl(\skeeks\cms\modules\admin\assets\AdminAsset::register($this), 'images/bg/582738_www.Gde-Fon.com.jpg'); $blockerLoader = \Yii::$app->getAssetManager()->getAssetUrl(\Yii::$app->getAssetManager()->getBundle(\skeeks\cms\modules\admin\assets\AdminAsset::className()), 'images/loaders/circulare-blue-24_24.GIF'); $this->registerCss(<<<CSS body.sx-styled { background: url({$urlBg}) center fixed; } CSS ); $this->registerJs(<<<JS (function(sx, \$, _) { sx.AppUnAuthorized = new sx.classes.AppUnAuthorized({ 'blockerLoader': '{$blockerLoader}' }); })(sx, sx.\$, sx._); JS
<?php use skeeks\cms\modules\admin\assets\AdminAsset; use yii\helpers\Html; use yii\bootstrap\Nav; use yii\bootstrap\NavBar; use yii\widgets\Breadcrumbs; use skeeks\cms\App; use skeeks\cms\helpers\UrlHelper; /* @var $this \yii\web\View */ /* @var $content string */ AdminAsset::register($this); \Yii::$app->admin->registerAsset($this)->initJs(); \skeeks\cms\modules\admin\widgets\UserLastActivityWidget::widget(); $this->beginPage(); ?> <!DOCTYPE html> <html lang="<?php echo Yii::$app->language; ?> "> <head> <meta charset="<?php echo Yii::$app->charset; ?> "/> <meta name="viewport" content="width=device-width, initial-scale=1"> <?php echo Html::csrfMetaTags(); ?> <title><?php