<?php /** * Created by Vladimir Hryvinskyy. * Site: http://codice.in.ua/ * Date: 07.04.2016 * Project: oakcms * File name: header.php */ use yii\helpers\Url; $asset = \app\assets\MediaSystem::register($this); $userIdentity = Yii::$app->user->identity; ?> <header class="main-header"> <!-- Logo --> <a href="<?php echo Url::to(['/admin']); ?> " class="logo"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"><img src="<?php echo $asset->baseUrl; ?> /images/icon-logo.svg" width="30" height="30"></span> <!-- logo for regular state and mobile devices --> <span class="logo-lg"><img src="<?php echo $asset->baseUrl; ?> /images/icon-logo.svg" width="30" height="30"><b>Oak</b>CMS</span> </a>
/** * Created by Vladimir Hryvinskyy. * Site: http://codice.in.ua/ * Date: 07.04.2016 * Project: oakcms * File name: admin_bar.php * * @var $userIdentity \app\modules\user\models\User; * @var $this \app\components\CoreView; */ use yii\web\View; use yii\helpers\Url; use yii\bootstrap\Html; use app\assets\MediaSystem; use app\assets\jQuerySimpleSwitch; $asset = MediaSystem::register($this); jQuerySimpleSwitch::register($this); $js = "jQuery(document).ready(function() {\n var icb = \$('#oak_admin_bar .simple-switch');\n icb.simpleSwitch();\n \$('#oak_admin_bar').on('change', '.simple-switch', function(){\n var cb = \$(this);\n cb.prop('disabled', true);\n location.href = cb.attr('data-url') + '/' + (cb.is(':checked') ? 1 : 0);\n });\n});\n"; $js .= '$(\'.oakcms-edit\').each(function(i, element){var $this = $(element);$this.append(\'<a href=\\"\'+$this.data(\'edit\')+\'\\" class=\\"oakcms-goedit\\" style=\\"width: \'+$this.width()+\'px; height: \'+$this.height()+\'px;\\" target=\\"_blank\\"></a>\');});'; $this->registerCss('body {padding-top: 30px;}'); $this->registerJS($js, View::POS_END, 'oak_admin_bar'); $userIdentity = Yii::$app->user->identity; ?> <div id="oak_admin_bar" class=""> <a class="cms-logo" href="<?php echo Url::to(['/admin']); ?> " title="<?php echo Yii::t('admin', 'Go to admin panel'); ?> " data-toggle="tooltip" data-placement="bottom">