This commit is contained in:
2020-10-06 14:27:47 +07:00
commit 586be80cf6
16613 changed files with 3274099 additions and 0 deletions

View File

@@ -0,0 +1 @@
vendor

View File

@@ -0,0 +1,158 @@
CHANGELOG
---------
## 2.6.0
* added default options for menu (CSS classes)
* updated test environment
## 2.5.0
* updated AdminLTE constraint to `^2.4.0`
* fixed menu toggle
## 2.4.4
* fixed JavaScript dependency
* restricted AdminLTE constraint
## 2.4.3
* added CRUD template
## 2.4.2
* updated menu rendering
## 2.4.0
* updated menu icons
* fixed isItemActive()
## 2.3.4
* added isAjaxRemoveFlash parameter
## 2.3.2
* updated label & link template
## 2.3.1
* use aliased AssetBundle
## 2.3.0
* updated menu widget (label-template)
## 2.2.4
* [FIX] fixed active menu with modules (Vasiliy Baranov)
* [ENH] added .hold-transition
## 2.2.3
* [ENH] : updated Gravatar widget E-Mail usage (@Quexer69)
## 2.2.2
* fixed Menu widget selection
* updated example views
## 2.2.1
* removed the restriction to use only FA
* added testing setup
## 2.2.0
* updated Menu widget
* updated composer dependencies
## 2.1.0
* updated black ("white") default skin for phundament
* updated default skins to be backward-compatible
* refactored views
* updated constraint
* Fix #47
* Added $skin option in AssetBundle and created Helper for selected skin class
* Updated docs
* changed adminlte to be loaded directly from packagist
* Added example of mini sidebar
* Update to AdminLTE 2.1.1
## 2.0.0
* Update login.php
* Added screenshot
* Update example to AdminLTE v2.0.5
* Changed line 14 main.php
* Update Alert.php
* Icon Placement before message
## 2.0.0-beta1
* update html markup to AdminLTE v2.0 for advanced template.
* update main.php
* updated "rmrevin/yii2-fontawesome" revision tag
* removed repository url
* added fork repository url for "yii2-fontawesome"
* updated css and js source files
* moved "beginBody() / endBody()" methods into body tag, code formatting
* fixed route to site index
* fixed "Gravatar" widget "email" attribute
* fixed "Trying to get property of non-object" added check if user is not guest
## 2.0.0-alpha1
* updated README
* Update login.php
* Added screenshot
* Update example to AdminLTE v2.0.5
* Changed line 14 main.php
* Update Alert.php
* Icon Placement before message
* Update html markup to AdminLTE v2.0 for advanced template.
* Update main.php
* updated "rmrevin/yii2-fontawesome" revision tag
* removed repository url
* added fork repository url for "yii2-fontawesome"
* updated css and js source files
* moved "beginBody() / endBody()" methods into body tag, code formatting
* fixed route to site index
* fixed "Gravatar" widget "email" attribute
* fixed "Trying to get property of non-object" added check if user is not guest
* added notice in docs
* bumpup rmrevin/yii2-fontawesome from 2.7.* to 2.8.*
* asset bundle cleanup yii\bootstrap\BootstrapPluginAsset depends already depends on yii\bootstrap\BootstrapAsset
* updated README
* fixed asset bundle for usage with v2, updated phundament/app example layout
* fixed typo
* requiring AdminLTE 2, added branch alias, fixes #18
## 1.1.1
* fix notice
## 1.1.0
* bumpup rmrevin/yii2-fontawesome from 2.7.* to 2.8.*
* asset bundle cleanup yii\bootstrap\BootstrapPluginAsset depends already depends on yii\bootstrap\BootstrapAsset
* updated README
* fixed asset bundle for usage with v2, updated phundament/app example layout
* fixed typo
* requiring AdminLTE 2, added branch alias, fixes #18
## 1.0.0
* updated README, preparing AdminLTE v1 and v2
## 0.2.0
* updated version constraints
* different structure of adminLTE with "minimum-stability" : "dev"
* add title to header
* added example views for yii2-basic-app
## 0.1.0
* updated namespaces
* refactored directory structure, update README, closes #5
* added native bundle of advanced Yii2 template
* remove duplicate aside
* added info about fixed class and skin for AdminLTE
* dded stylized alerts
* correct links
* fix url to assets bundle
* delete dublicate folder
* fix links to image, Move logout to header
* delete adminLTE folder
* add theme for Yii2 Advanced
* update composer.json
* fix gravatar output in main layout
* updated default page title with app name [Backend]
* updated example views
* updated example menu
* improve module detection in example view
* fixed missing csrf token, updated menu, code-formatting
* updated paths, added Phundament 4 template
* update README.md
* initial commit

View File

@@ -0,0 +1,292 @@
AdminLTE Asset Bundle
=====================
[![Latest Stable Version](https://poser.pugx.org/dmstr/yii2-adminlte-asset/v/stable.svg)](https://packagist.org/packages/dmstr/yii2-adminlte-asset)
[![Total Downloads](https://poser.pugx.org/dmstr/yii2-adminlte-asset/downloads.svg)](https://packagist.org/packages/dmstr/yii2-adminlte-asset)
[![License](https://poser.pugx.org/dmstr/yii2-adminlte-asset/license.svg)](https://packagist.org/packages/dmstr/yii2-adminlte-asset)
*Backend UI for Yii2 Framework, based on [AdminLTE](https://github.com/almasaeed2010/AdminLTE)*
!["Yii2 AdminLTE Presentation"](https://cloud.githubusercontent.com/assets/874234/7603896/753228ee-f943-11e4-9d42-2a31b41eb42d.jpg)
This package contains an [Asset Bundle for Yii 2.0 Framework](http://www.yiiframework.com/doc-2.0/guide-structure-assets.html)
which registers the CSS files for the AdminLTE user-interface.
The CSS files are installed via Yii's recommended usage of the `fxp/composer-asset-plugin` v1.1.1 or later.
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
To install AdminLTE v2 run:
```
composer require dmstr/yii2-adminlte-asset "^2.1"
```
To install AdminLTE v1 run:
```
composer require dmstr/yii2-adminlte-asset "^1"
```
FAQ
---
### Web-font usage
AdminLTE dropped web-font inclusion in `2.4.0`, so you need to include your desired font manually, ie.
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
> Inclusion via CDN is not recommended for production, please adjust this to your project's asset-bundling workflow.
For details see [#140](https://github.com/dmstr/yii2-adminlte-asset/issues/140).
### Upgrading
When upgrading please see the [AdminLTE upgrade guide](https://adminlte.io/docs/2.4/upgrade-guide) for adjustments you need to make in your views.
### Composer installation
- For issues with `DmitryBaranovskiy/eve.git`, please see [#128](https://github.com/dmstr/yii2-adminlte-asset/issues/128#issuecomment-361895922) and [#113](https://github.com/dmstr/yii2-adminlte-asset/issues/133#issuecomment-337179853).
### Compatibility matrix
| yii2-adminlte-asset | AdminLTE |
|---|---|
| 2.4 | 2.0 - 2.3 |
| 2.5 | 2.4 |
> For other [issues](https://github.com/dmstr/yii2-adminlte-asset/issues?utf8=%E2%9C%93&q=is%3Aissue), please search GitHub first.
Quick Start
-----------
Once the extension is installed, you can have a **preview** by reconfiguring the path mappings of the view component:
For Yii 2 [Advanced Application Template](https://github.com/yiisoft/yii2-app-advanced) or [Basic Application Template](https://github.com/yiisoft/yii2-app-basic)
```php
'components' => [
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app'
],
],
],
],
```
For [phd5](https://github.com/dmstr/phd5-app) application
```php
'components' => [
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/testing/app'
],
],
],
],
```
This asset bundle provides sample files for layout and view (see folder `examples/`), they are **not meant to be customized directly in the `vendor/` folder**.
Therefore it is recommended to **copy the views into your application** and adjust them to your needs.
Customization
-------------
- Copy files from `vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app` (or other theme) to `@app/views`.
- Remove the custom `view` configuration from your application by deleting the path mappings, if you have made them before.
- Edit your views adhering to html markup `vendor/almasaeed2010/adminlte/pages`
### AdminLTE Plugins
Assets for [AdminLTE plugins](https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#plugins) are not included
in our `AdminLteAsset` but you can find these files in your vendor directory under `vendor/almasaeed2010/adminlte/plugins`.
So if you want to use any of them we recommend to create a custom bundle where you list the plugin files you need:
```php
use yii\web\AssetBundle;
class AdminLtePluginAsset extends AssetBundle
{
public $sourcePath = '@vendor/almasaeed2010/adminlte/plugins';
public $js = [
'datatables/dataTables.bootstrap.min.js',
// more plugin Js here
];
public $css = [
'datatables/dataTables.bootstrap.css',
// more plugin CSS here
];
public $depends = [
'dmstr\web\AdminLteAsset',
];
}
```
As this asset depends on our `AdminLteAsset` it's the only asset you have to register, for example in
your `main.php` layout file.
### Skins
By default the extension uses blue skin for AdminLTE. You can change it in config file.
```php
'components' => [
'assetManager' => [
'bundles' => [
'dmstr\web\AdminLteAsset' => [
'skin' => 'skin-black',
],
],
],
],
```
And then just replace class of body `skin-blue`. You can use `AdminLteHelper::skinClass()` if you don't want to alter every view file when you change skin color.
```html
<body class="<?= \dmstr\helpers\AdminLteHelper::skinClass() ?>">
```
**Note:** Use `AdminLteHelper::skinClass()` only if you override the skin through configuration. Otherwise you will not get the correct css class of body.
Here is the list of available skins:
```
"skin-blue",
"skin-black",
"skin-red",
"skin-yellow",
"skin-purple",
"skin-green",
"skin-blue-light",
"skin-black-light",
"skin-red-light",
"skin-yellow-light",
"skin-purple-light",
"skin-green-light"
```
#### Disabling skin file loading, when using bundled assets
Yii::$container->set(
AdminLteAsset::className(),
[
'skin' => false,
]
);
If you want to use native DOM of headers AdminLTE
```html
<h1>
About <small>static page</small>
</h1>
```
then you can follow the code:
```php
/* @var $this yii\web\View */
$this->params['breadcrumbs'][] = 'About';
$this->beginBlock('content-header'); ?>
About <small>static page</small>
<?php $this->endBlock(); ?>
<div class="site-about">
<p> This is the About page. You may modify the following file to customize its content: </p>
<code><?= __FILE__ ?></code>
</div>
```
### Left sidebar menu - Widget Menu
If you need to separate sections of the menu then just add the `li.header` item to `items`
```php
'items' => [
['label' => 'Gii', 'icon' => 'file-code-o', 'url' => ['/gii']],
['label' => 'Debug', 'icon' => 'dashboard', 'url' => ['/debug']],
['label' => 'MAIN NAVIGATION', 'options' => ['class' => 'header']], // here
// ... a group items
['label' => '', 'options' => ['class' => 'header']],
// ... a group items
['label' => '', 'options' => ['class' => 'header']],
// ... a group items
```
To add a label for a item:
```php
'items' => [
[
'label' => 'Mailbox',
'icon' => 'envelope-o',
'url' => ['/mailbox'],
'template'=>'<a href="{url}">{icon} {label}<span class="pull-right-container"><small class="label pull-right bg-yellow">123</small></span></a>'
],
]
```
By default to icons will be added prefix of [Font Awesome](http://fontawesome.io/)
### Template for Gii CRUD generator
Tell Gii about our template. The setting is made in the config file:
```php
if (YII_ENV_DEV) {
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'],
'generators' => [ //here
'crud' => [
'class' => 'yii\gii\generators\crud\Generator',
'templates' => [
'adminlte' => '@vendor/dmstr/yii2-adminlte-asset/gii/templates/crud/simple',
]
]
],
];
}
```
Testing
-------
Go to the tests folder and start the testing stack
cd tests
docker-compose up -d
Install `yii2-adminlte-asset` in the testing application
docker-compose exec php composer install
Open testing URLs in your browser
http://docker.local:20580/test
http://docker.local:20580/test/login
Further Information
-------------------
For AdminLTE documentation, please read https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html
> Namespacing rules follow the Yii 2.0 framework structure, eg. `dmstr\web` for the Asset Bundle.

View File

@@ -0,0 +1,34 @@
{
"name": "dmstr/yii2-adminlte-asset",
"description": "AdminLTE backend theme asset bundle for Yii 2.0 Framework",
"type": "yii2-extension",
"keywords": ["yii2","extension","adminlte","admin","theme","backend","asset","css","less"],
"license": "BSD-3-Clause",
"authors": [
{
"name": "Tobias Munk",
"email": "tobias@diemeisterei.de"
},
{
"name": "Evgeniy Tkachenko",
"email": "et.coder@gmail.com"
}
],
"require": {
"yiisoft/yii2": "2.*",
"yiisoft/yii2-bootstrap": "~2.0.0",
"cebe/yii2-gravatar": "1.*",
"almasaeed2010/adminlte": "^2.4.0",
"rmrevin/yii2-fontawesome": "~2.9"
},
"autoload": {
"psr-4": {
"dmstr\\": ""
}
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
}
}

686
vendor/dmstr/yii2-adminlte-asset/composer.lock generated vendored Normal file
View File

@@ -0,0 +1,686 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "8c61b3ccc40587888446f958530c1cfe",
"content-hash": "2e6e89d7f676354d3bc2fb7ad877e93b",
"packages": [
{
"name": "almasaeed2010/adminlte",
"version": "v2.3.2",
"source": {
"type": "git",
"url": "https://github.com/almasaeed2010/AdminLTE.git",
"reference": "1ee281b3b99e8d8cccdc72fb8437c6888149cb46"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/almasaeed2010/AdminLTE/zipball/1ee281b3b99e8d8cccdc72fb8437c6888149cb46",
"reference": "1ee281b3b99e8d8cccdc72fb8437c6888149cb46",
"shasum": ""
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Abdullah Almsaeed",
"email": "support@almsaeedstudio.com"
}
],
"description": "AdminLTE - admin control panel and dashboard that's based on Bootstrap 3",
"homepage": "http://almsaeedstudio.com/",
"keywords": [
"JS",
"admin",
"back-end",
"css",
"less",
"responsive",
"template",
"theme",
"web"
],
"time": "2015-10-23 14:50:49"
},
{
"name": "bower-asset/bootstrap",
"version": "v3.3.5",
"source": {
"type": "git",
"url": "https://github.com/twbs/bootstrap.git",
"reference": "16b48259a62f576e52c903c476bd42b90ab22482"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/16b48259a62f576e52c903c476bd42b90ab22482",
"reference": "16b48259a62f576e52c903c476bd42b90ab22482",
"shasum": ""
},
"require": {
"bower-asset/jquery": ">=1.9.1"
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": [
"less/bootstrap.less",
"dist/js/bootstrap.js"
],
"bower-asset-ignore": [
"/.*",
"_config.yml",
"CNAME",
"composer.json",
"CONTRIBUTING.md",
"docs",
"js/tests",
"test-infra"
]
},
"license": [
"MIT"
],
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
"keywords": [
"css",
"framework",
"front-end",
"js",
"less",
"mobile-first",
"responsive",
"web"
]
},
{
"name": "bower-asset/fontawesome",
"version": "v4.5.0",
"source": {
"type": "git",
"url": "https://github.com/FortAwesome/Font-Awesome.git",
"reference": "fddd2c240452e6c8990c4ef75e0265b455aa7968"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/fddd2c240452e6c8990c4ef75e0265b455aa7968",
"reference": "fddd2c240452e6c8990c4ef75e0265b455aa7968",
"shasum": ""
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": [
"less/font-awesome.less",
"scss/font-awesome.scss"
],
"bower-asset-ignore": [
"*/.*",
"*.json",
"src",
"*.yml",
"Gemfile",
"Gemfile.lock",
"*.md"
]
},
"license": [
"OFL-1.1",
"MIT",
"CC-BY-3.0"
],
"description": "Font Awesome"
},
{
"name": "bower-asset/jquery",
"version": "2.1.4",
"source": {
"type": "git",
"url": "https://github.com/jquery/jquery-dist.git",
"reference": "7751e69b615c6eca6f783a81e292a55725af6b85"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jquery/jquery-dist/zipball/7751e69b615c6eca6f783a81e292a55725af6b85",
"reference": "7751e69b615c6eca6f783a81e292a55725af6b85",
"shasum": ""
},
"require-dev": {
"bower-asset/qunit": "1.14.0",
"bower-asset/requirejs": "2.1.10",
"bower-asset/sinon": "1.8.1",
"bower-asset/sizzle": "2.1.1-patch2"
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": "dist/jquery.js",
"bower-asset-ignore": [
"**/.*",
"build",
"dist/cdn",
"speed",
"test",
"*.md",
"AUTHORS.txt",
"Gruntfile.js",
"package.json"
]
},
"license": [
"MIT"
],
"keywords": [
"javascript",
"jquery",
"library"
]
},
{
"name": "bower-asset/jquery.inputmask",
"version": "3.1.63",
"source": {
"type": "git",
"url": "https://github.com/RobinHerbots/jquery.inputmask.git",
"reference": "c40c7287eadc31e341ebbf0c02352eb55b9cbc48"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/RobinHerbots/jquery.inputmask/zipball/c40c7287eadc31e341ebbf0c02352eb55b9cbc48",
"reference": "c40c7287eadc31e341ebbf0c02352eb55b9cbc48",
"shasum": ""
},
"require": {
"bower-asset/jquery": ">=1.7"
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": [
"./dist/inputmask/jquery.inputmask.js",
"./dist/inputmask/jquery.inputmask.extensions.js",
"./dist/inputmask/jquery.inputmask.date.extensions.js",
"./dist/inputmask/jquery.inputmask.numeric.extensions.js",
"./dist/inputmask/jquery.inputmask.phone.extensions.js",
"./dist/inputmask/jquery.inputmask.regex.extensions.js"
],
"bower-asset-ignore": [
"**/.*",
"qunit/",
"nuget/",
"tools/",
"js/",
"*.md",
"build.properties",
"build.xml",
"jquery.inputmask.jquery.json"
]
},
"license": [
"http://opensource.org/licenses/mit-license.php"
],
"description": "jquery.inputmask is a jquery plugin which create an input mask.",
"keywords": [
"form",
"input",
"inputmask",
"jquery",
"mask",
"plugins"
]
},
{
"name": "bower-asset/punycode",
"version": "v1.3.2",
"source": {
"type": "git",
"url": "https://github.com/bestiejs/punycode.js.git",
"reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3",
"reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3",
"shasum": ""
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": "punycode.js",
"bower-asset-ignore": [
"coverage",
"tests",
".*",
"component.json",
"Gruntfile.js",
"node_modules",
"package.json"
]
}
},
{
"name": "bower-asset/yii2-pjax",
"version": "v2.0.5",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/jquery-pjax.git",
"reference": "6818718408086db6bdcf33649cecb86b6b4f9b67"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/6818718408086db6bdcf33649cecb86b6b4f9b67",
"reference": "6818718408086db6bdcf33649cecb86b6b4f9b67",
"shasum": ""
},
"require": {
"bower-asset/jquery": ">=1.8"
},
"type": "bower-asset-library",
"extra": {
"bower-asset-main": "./jquery.pjax.js",
"bower-asset-ignore": [
".travis.yml",
"Gemfile",
"Gemfile.lock",
"vendor/",
"script/",
"test/"
]
},
"license": [
"MIT"
]
},
{
"name": "cebe/markdown",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/cebe/markdown.git",
"reference": "54a2c49de31cc44e864ebf0500a35ef21d0010b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cebe/markdown/zipball/54a2c49de31cc44e864ebf0500a35ef21d0010b2",
"reference": "54a2c49de31cc44e864ebf0500a35ef21d0010b2",
"shasum": ""
},
"require": {
"lib-pcre": "*",
"php": ">=5.4.0"
},
"require-dev": {
"cebe/indent": "*",
"facebook/xhprof": "*@dev",
"phpunit/phpunit": "4.1.*"
},
"bin": [
"bin/markdown"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"cebe\\markdown\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Carsten Brandt",
"email": "mail@cebe.cc",
"homepage": "http://cebe.cc/",
"role": "Creator"
}
],
"description": "A super fast, highly extensible markdown parser for PHP",
"homepage": "https://github.com/cebe/markdown#readme",
"keywords": [
"extensible",
"fast",
"gfm",
"markdown",
"markdown-extra"
],
"time": "2015-03-06 05:28:07"
},
{
"name": "cebe/yii2-gravatar",
"version": "1.1",
"target-dir": "cebe/gravatar",
"source": {
"type": "git",
"url": "https://github.com/cebe/yii2-gravatar.git",
"reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cebe/yii2-gravatar/zipball/c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057",
"reference": "c9c01bd14c9bdee9e5ae1ef1aad23f80c182c057",
"shasum": ""
},
"require": {
"yiisoft/yii2": "*"
},
"type": "yii2-extension",
"autoload": {
"psr-0": {
"cebe\\gravatar\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Carsten Brandt",
"email": "mail@cebe.cc",
"homepage": "http://cebe.cc/",
"role": "Core framework development"
}
],
"description": "Gravatar Widget for Yii 2",
"keywords": [
"gravatar",
"yii"
],
"time": "2013-12-10 17:49:58"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.6.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "6f389f0f25b90d0b495308efcfa073981177f0fd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd",
"reference": "6f389f0f25b90d0b495308efcfa073981177f0fd",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"time": "2013-11-30 08:25:19"
},
{
"name": "rmrevin/yii2-fontawesome",
"version": "2.13.0",
"source": {
"type": "git",
"url": "https://github.com/rmrevin/yii2-fontawesome.git",
"reference": "2efbfacb22be59f373d11a7e3dfa9213e2ba18a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rmrevin/yii2-fontawesome/zipball/2efbfacb22be59f373d11a7e3dfa9213e2ba18a9",
"reference": "2efbfacb22be59f373d11a7e3dfa9213e2ba18a9",
"shasum": ""
},
"require": {
"bower-asset/fontawesome": "4.5.*",
"php": ">=5.4.0",
"yiisoft/yii2": "2.0.*"
},
"type": "yii2-extension",
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
},
"autoload": {
"psr-4": {
"rmrevin\\yii\\fontawesome\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Revin Roman",
"email": "roman@rmrevin.com",
"homepage": "https://rmrevin.com/"
}
],
"description": "Asset Bundle for Yii2 with Font Awesome",
"keywords": [
"asset",
"awesome",
"bundle",
"font",
"yii"
],
"time": "2015-11-26 15:24:53"
},
{
"name": "yiisoft/yii2",
"version": "2.0.6",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/yii2-framework.git",
"reference": "f42b2eb80f61992438661b01d0d74c6738e2ff38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/f42b2eb80f61992438661b01d0d74c6738e2ff38",
"reference": "f42b2eb80f61992438661b01d0d74c6738e2ff38",
"shasum": ""
},
"require": {
"bower-asset/jquery": "2.1.*@stable | 1.11.*@stable",
"bower-asset/jquery.inputmask": "3.1.*",
"bower-asset/punycode": "1.3.*",
"bower-asset/yii2-pjax": ">=2.0.1",
"cebe/markdown": "~1.0.0 | ~1.1.0",
"ext-mbstring": "*",
"ezyang/htmlpurifier": "4.6.*",
"lib-pcre": "*",
"php": ">=5.4.0",
"yiisoft/yii2-composer": "*"
},
"bin": [
"yii"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"yii\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Qiang Xue",
"email": "qiang.xue@gmail.com",
"homepage": "http://www.yiiframework.com/",
"role": "Founder and project lead"
},
{
"name": "Alexander Makarov",
"email": "sam@rmcreative.ru",
"homepage": "http://rmcreative.ru/",
"role": "Core framework development"
},
{
"name": "Maurizio Domba",
"homepage": "http://mdomba.info/",
"role": "Core framework development"
},
{
"name": "Carsten Brandt",
"email": "mail@cebe.cc",
"homepage": "http://cebe.cc/",
"role": "Core framework development"
},
{
"name": "Timur Ruziev",
"email": "resurtm@gmail.com",
"homepage": "http://resurtm.com/",
"role": "Core framework development"
},
{
"name": "Paul Klimov",
"email": "klimov.paul@gmail.com",
"role": "Core framework development"
}
],
"description": "Yii PHP Framework Version 2",
"homepage": "http://www.yiiframework.com/",
"keywords": [
"framework",
"yii2"
],
"time": "2015-08-05 22:00:30"
},
{
"name": "yiisoft/yii2-bootstrap",
"version": "2.0.5",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/yii2-bootstrap.git",
"reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/1464f93834b1d5edb1f5625f7ffd6c3723fa4923",
"reference": "1464f93834b1d5edb1f5625f7ffd6c3723fa4923",
"shasum": ""
},
"require": {
"bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*",
"yiisoft/yii2": ">=2.0.6"
},
"type": "yii2-extension",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
},
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
},
"autoload": {
"psr-4": {
"yii\\bootstrap\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Qiang Xue",
"email": "qiang.xue@gmail.com"
}
],
"description": "The Twitter Bootstrap extension for the Yii framework",
"keywords": [
"bootstrap",
"yii2"
],
"time": "2015-09-23 17:48:24"
},
{
"name": "yiisoft/yii2-composer",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/yiisoft/yii2-composer.git",
"reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/ca8d23707ae47d20b0454e4b135c156f6da6d7be",
"reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be",
"shasum": ""
},
"require": {
"composer-plugin-api": "1.0.0"
},
"type": "composer-plugin",
"extra": {
"class": "yii\\composer\\Plugin",
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"yii\\composer\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Qiang Xue",
"email": "qiang.xue@gmail.com"
}
],
"description": "The composer plugin for Yii extension installer",
"keywords": [
"composer",
"extension installer",
"yii2"
],
"time": "2015-03-01 06:22:44"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

View File

@@ -0,0 +1,41 @@
<?php
use yii\helpers\Inflector;
$favourites = ($favourites) ?: [];
// Note: requires `$controllers` variable during rendering...
?>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-body">
<ul class="list-group">
<?php
$dataProvider = new \yii\data\ArrayDataProvider(
[
'allModels' => $controllers,
'pagination' => [
'pageSize' => 100
]
]
);
echo \yii\widgets\ListView::widget(
[
'dataProvider' => $dataProvider,
'itemView' => function ($data) {
return '<li class="list-group-item">' . \yii\helpers\Html::a(
$data['label'],
$data['route']
) . '</li>';
},
]
);
?>
</ul>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,79 @@
<div class="row">
<div class="col-md-3">
<div class="box box-default collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">Expandable</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
</button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body" style="display: none;">
The body of the box
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
<div class="col-md-3">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">Removable</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body">
The body of the box
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
<div class="col-md-3">
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">Collapsable</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body">
The body of the box
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
<div class="col-md-3">
<div class="box box-danger">
<div class="box-header">
<h3 class="box-title">Loading state</h3>
</div>
<div class="box-body">
The body of the box
</div>
<!-- /.box-body -->
<!-- Loading (remove the following to stop the loading)-->
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
<!-- end loading -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>

View File

@@ -0,0 +1,169 @@
<div class="row">
<div class="col-md-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-blue">
<div class="inner">
<h3>
<?= YII_ENV ?>
</h3>
<p>
Go to Frontend
</p>
</div>
<div class="icon">
<i class="ion ion-home"></i>
</div>
<a href="<?= \yii\helpers\Url::to('site/index') ?>" class="small-box-footer">
Homepage <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<!-- ./col -->
<div class="col-md-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3>
n/a
</h3>
<p>
Users
</p>
</div>
<div class="icon">
<i class="ion ion-person"></i>
</div>
<a href="<?= \yii\helpers\Url::to(['/user/admin']) ?>" class="small-box-footer">
Manage <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<!-- ./col -->
<div class="col-md-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-orange">
<div class="inner">
<h3>
<?= count(\Yii::$app->getModules()) ?>
</h3>
<p>
Modules
</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>
</div>
<a href="<?= \yii\helpers\Url::to(['/debug']) ?>" class="small-box-footer">
Debug <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<!-- ./col -->
<div class="col-md-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3>
<?= getenv('APP_VERSION') ?>
</h3>
<p>
Version
</p>
</div>
<div class="icon">
<i class="ion ion-grid"></i>
</div>
<a href="<?= \yii\helpers\Url::to('http://phundament.com') ?>" target="_blank" class="small-box-footer">
Phundament Online <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<!-- ./col -->
</div>
<div class="row">
<div class="col-sm-12">
<!-- Default box -->
<div class="box">
<div class="box-header">
<h3 class="box-title">Languages</h3>
</div>
<div class="box-body">
Test
</div>
<!-- /.box-body -->
<div class="box-footer">
<small>Registered in <code>urlManager</code> application component.</small>
</div>
<!-- /.box-footer-->
</div>
<!-- /.box -->
</div>
</div>
<div class="row">
<div class="col-sm-6">
<!-- Default box -->
<div class="box">
<div class="box-header">
<h3 class="box-title">Modules</h3>
</div>
<div class="box-body">
<?php
foreach (\Yii::$app->getModules() AS $name => $m) {
$module = \Yii::$app->getModule($name);
echo yii\helpers\Html::a(
$module->id,
['/'.$module->id],
['class' => 'btn btn-default btn-flat']
);
}
?>
</div>
<!-- /.box-body -->
<div class="box-footer">
<small>Registered in application from configuration or bootstrapping.</small>
</div>
<!-- /.box-footer-->
</div>
<!-- /.box -->
</div>
<div class="col-sm-6">
<!-- Default box -->
<div class="box">
<div class="box-header">
<h3 class="box-title">Documentation</h3>
</div>
<div class="box-body">
<div class="alert alert-info">
<i class="fa fa-warning"></i>
<b>Notice!</b> Use the <i>yii2-apidoc</i> extension to
create the HTML documentation for this application.
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
</div>
<!-- /.box-footer-->
</div>
<!-- /.box -->
</div>
</div>
<?= $this->render('_expand-collapse') ?>

View File

@@ -0,0 +1,114 @@
<?php
?>
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<?php echo \cebe\gravatar\Gravatar::widget(
[
'email' => 'username@example.com',
'options' => [
'alt' => 'username',
],
'size' => 64,
]
); ?>
</div>
<div class="pull-left info">
<p>username</p>
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<!-- search form -->
<form action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..."/>
<span class="input-group-btn">
<button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i
class="fa fa-search"></i></button>
</span>
</div>
</form>
<!-- /.search form -->
<?php
// prepare menu items, get all modules
$menuItems = [];
$favouriteMenuItems[] = ['label' => 'MAIN NAVIGATION', 'options' => ['class' => 'header']];
$developerMenuItems = [];
$developerMenuItems[] = [
'url' => ['/sub/action/one'],
'icon' => 'cog',
'label' => 'Sub 1',
];
$developerMenuItems[] = [
'icon' => 'cog',
'label' => 'No Link',
];
$developerMenuItems[] = [
'icon' => 'cog',
'label' => 'Not visible',
'visible' => false,
];
$developerMenuItems[] = [
'icon' => 'cog',
'label' => 'Folder',
'items' => [
[
'url' => ['/sub/action/two'],
'icon' => 'cog',
'label' => 'SubSub 2',
],
],
];
$developerMenuItems[] = [
'url' => ['/sub/action/three'],
'icon' => 'cog',
'label' => 'Sub 3',
];
$developerMenuItems[] = [
'url' => ['/sub/action/param', 'id' => 'a'],
'icon' => 'cog',
'label' => 'Param A',
];
$developerMenuItems[] = [
'url' => ['/sub/action/param', 'id' => 'b'],
'icon' => 'cog',
'label' => 'Param B',
];
$menuItems[] = [
'url' => ['/test'],
'icon' => 'cog',
'label' => 'Test',
];
$menuItems[] = [
#'url' => '#',
'icon' => 'cog',
'label' => 'Test with items',
'items' => $developerMenuItems,
];
for ($i = 0; $i < 25; $i++) {
$menuItems[] = [
'url' => ['/test/auto', 'id' => $i],
'icon' => 'cog',
'label' => 'Auto '.$i,
];
}
echo dmstr\widgets\Menu::widget([
'items' => \yii\helpers\ArrayHelper::merge($favouriteMenuItems, $menuItems),
]);
?>

View File

@@ -0,0 +1,164 @@
<?php
use dmstr\widgets\Alert;
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $content string */
$this->title = $this->title . ' [Backend]';
dmstr\web\AdminLteAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- Ionicons -->
<link href="//code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css" rel="stylesheet" type="text/css"/>
<!-- Theme style -->
<?php $this->head() ?>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body class="hold-transition skin-black sidebar-mini">
<?php $this->beginBody() ?>
<div class="wrapper">
<header class="main-header">
<!-- Logo -->
<a href="<?= \Yii::$app->homeUrl ?>" class="logo"><?= getenv('APP_TITLE') ?></a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Messages: style can be found in dropdown.less-->
<li class="dropdown messages-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-envelope-o"></i>
<span class="label label-success">1</span>
</a>
<ul class="dropdown-menu">
<li class="header">You have 1 notification(s)</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
<li>
<a href="#">
<i class="ion ion-ios7-people info"></i> Welcome to Phundament 4!
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown tasks-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-flag"></i>
<span class="label label-default">n/a</span>
</a>
<ul class="dropdown-menu">
<li class="header">Languages</li>
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu">
languages
</ul>
</li>
</ul>
</li>
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="glyphicon glyphicon-user"></i>
<span>Username <i class="caret"></i></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header bg-light-blue">
<?php echo \cebe\gravatar\Gravatar::widget(
[
'email' => 'username@example.com',
'options' => [
'alt' => 'username'
],
'size' => 128
]
); ?>
<p>
username
<small>username@example.com</small>
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="<?= \yii\helpers\Url::to(['/user/settings/profile']) ?>"
class="btn btn-default btn-flat">Profile</a>
</div>
<div class="pull-right">
<a href="<?= \yii\helpers\Url::to(['/user/security/logout']) ?>"
class="btn btn-default btn-flat" data-method="post">Sign out</a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<?= $this->render('_sidebar') ?>
</section>
<!-- /.sidebar -->
</aside>
<!-- Right side column. Contains the navbar and content of the page -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<small><?= $this->title ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active">Dashboard</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<?= Alert::widget() ?>
<?= $content ?>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
Powered by <strong><a href="http://phundament.com">Phundament 4</a></strong>
</footer>
</div>
<!-- ./wrapper -->
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html class="bg-black">
<head>
<meta charset="UTF-8">
<title>AdminLTE | Log in</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="../../css/AdminLTE.css" rel="stylesheet" type="text/css" />
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body class="bg-black">
<div class="form-box" id="login-box">
<div class="header">Sign In</div>
<form action="../../index.html" method="post">
<div class="body bg-gray">
<div class="form-group">
<input type="text" name="userid" class="form-control" placeholder="User ID"/>
</div>
<div class="form-group">
<input type="password" name="password" class="form-control" placeholder="Password"/>
</div>
<div class="form-group">
<input type="checkbox" name="remember_me"/> Remember me
</div>
</div>
<div class="footer">
<button type="submit" class="btn bg-olive btn-block">Sign me in</button>
<p><a href="#">I forgot my password</a></p>
<a href="register.html" class="text-center">Register a new membership</a>
</div>
</form>
<div class="margin text-center">
<span>Sign in using social networks</span>
<br/>
<button class="btn bg-light-blue btn-circle"><i class="fa fa-facebook"></i></button>
<button class="btn bg-aqua btn-circle"><i class="fa fa-twitter"></i></button>
<button class="btn bg-red btn-circle"><i class="fa fa-google-plus"></i></button>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>

View File

@@ -0,0 +1,226 @@
<?php
use yii\widgets\Breadcrumbs;
use dmstr\widgets\Alert;
?>
<div class="content-wrapper">
<section class="content-header">
<?=
Breadcrumbs::widget(
[
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]
)
?>
</section>
<section class="content">
<input type="hidden" value="<?php echo Yii::$app->user->id; ?>" name="current_user_id">
<?= Alert::widget() ?>
<?= $content ?>
</section>
</div>
<footer class="main-footer <?php if (Yii::$app->params['hideInfomation']) echo "hidden"; ?>" style="font-size: 22px;">
<div class="pull-right hidden-xs <?php if (!Yii::$app->params['TCTECH']) echo "hidden"; ?>" style="margin-top: 10px;">
<b>Hotline</b> <a href="tel:0912461556">091.246.1556</a>
</div>
<?php if (!Yii::$app->params['TCTECH']) { ?>
<strong>Copyright &copy; <?php echo date("Y"); ?> <a href="https://beetinnovators.com/">BEET INNOVATORS</a>.</strong> All rights reserved.
<?php } else { ?>
<strong>Copyright &copy; <?php echo date("Y"); ?> <a href="https://beetinnovators.com/"><img src="/images/BI_Logo.png" width="120px"></a> & <a href="https://tctech.vn/"><img src="/images/TCTech.jpg" width="120px"></a>.</strong> All rights reserved.
<?php } ?>
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Create the tabs -->
<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
<li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
<li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<!-- Home tab content -->
<div class="tab-pane" id="control-sidebar-home-tab">
<h3 class="control-sidebar-heading">Recent Activity</h3>
<ul class='control-sidebar-menu'>
<li>
<a href='javascript::;'>
<i class="menu-icon fa fa-birthday-cake bg-red"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Langdon's Birthday</h4>
<p>Will be 23 on April 24th</p>
</div>
</a>
</li>
<li>
<a href='javascript::;'>
<i class="menu-icon fa fa-user bg-yellow"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>
<p>New phone +1(800)555-1234</p>
</div>
</a>
</li>
<li>
<a href='javascript::;'>
<i class="menu-icon fa fa-envelope-o bg-light-blue"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>
<p>nora@example.com</p>
</div>
</a>
</li>
<li>
<a href='javascript::;'>
<i class="menu-icon fa fa-file-code-o bg-green"></i>
<div class="menu-info">
<h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>
<p>Execution time 5 seconds</p>
</div>
</a>
</li>
</ul>
<!-- /.control-sidebar-menu -->
<h3 class="control-sidebar-heading">Tasks Progress</h3>
<ul class='control-sidebar-menu'>
<li>
<a href='javascript::;'>
<h4 class="control-sidebar-subheading">
Custom Template Design
<span class="label label-danger pull-right">70%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-danger" style="width: 70%"></div>
</div>
</a>
</li>
<li>
<a href='javascript::;'>
<h4 class="control-sidebar-subheading">
Update Resume
<span class="label label-success pull-right">95%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-success" style="width: 95%"></div>
</div>
</a>
</li>
<li>
<a href='javascript::;'>
<h4 class="control-sidebar-subheading">
Laravel Integration
<span class="label label-waring pull-right">50%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-warning" style="width: 50%"></div>
</div>
</a>
</li>
<li>
<a href='javascript::;'>
<h4 class="control-sidebar-subheading">
Back End Framework
<span class="label label-primary pull-right">68%</span>
</h4>
<div class="progress progress-xxs">
<div class="progress-bar progress-bar-primary" style="width: 68%"></div>
</div>
</a>
</li>
</ul>
<!-- /.control-sidebar-menu -->
</div>
<!-- /.tab-pane -->
<!-- Settings tab content -->
<div class="tab-pane" id="control-sidebar-settings-tab">
<form method="post">
<h3 class="control-sidebar-heading">General Settings</h3>
<div class="form-group">
<label class="control-sidebar-subheading">
Report panel usage
<input type="checkbox" class="pull-right" checked/>
</label>
<p>
Some information about this general settings option
</p>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Allow mail redirect
<input type="checkbox" class="pull-right" checked/>
</label>
<p>
Other sets of options are available
</p>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Expose author name in posts
<input type="checkbox" class="pull-right" checked/>
</label>
<p>
Allow the user to show his name in blog posts
</p>
</div>
<!-- /.form-group -->
<h3 class="control-sidebar-heading">Chat Settings</h3>
<div class="form-group">
<label class="control-sidebar-subheading">
Show me as online
<input type="checkbox" class="pull-right" checked/>
</label>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Turn off notifications
<input type="checkbox" class="pull-right"/>
</label>
</div>
<!-- /.form-group -->
<div class="form-group">
<label class="control-sidebar-subheading">
Delete chat history
<a href="javascript::;" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
</label>
</div>
<!-- /.form-group -->
</form>
</div>
<!-- /.tab-pane -->
</div>
</aside><!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
<div class='control-sidebar-bg'></div>

View File

@@ -0,0 +1,112 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this \yii\web\View */
/* @var $content string */
?>
<header class="main-header">
<?php
if (Yii::$app->params['hideInfomation']) {
echo Html::a('<span class="logo-mini">AIP</span><span class="logo-lg">AIParking</span>', Yii::$app->homeUrl, ['class' => 'logo']);
} else {
echo Html::a('<span class="logo-mini">BI</span><span class="logo-lg"><img src="/images/logo.png" width="75%"></span>', Yii::$app->homeUrl, ['class' => 'logo']);
}
?>
<nav class="navbar navbar-static-top" role="navigation">
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown notifications-menu">
</li>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="<?php
if (Yii::$app->user->isGuest) {
echo $directoryAsset . "/img/user2-160x160.jpg";
} else {
echo Yii::$app->user->identity->user_image == null ? $directoryAsset . "/img/user2-160x160.jpg" : Yii::getAlias("@images_folder") . Yii::$app->user->identity->user_image;
}
?>" class="user-image" alt="User Image"/>
<span class="hidden-xs">
<?php
if (Yii::$app->user->isGuest) {
echo "";
} else {
echo Yii::$app->user->identity->first_name . " " . Yii::$app->user->identity->last_name;
}
?>
</span>
</a>
<ul class="dropdown-menu" style="width:250px">
<!-- User image -->
<li class="user-header" style="height: auto;">
<div class="user-panel">
<div class="pull-left image">
<img src="<?php
if (Yii::$app->user->isGuest) {
echo $directoryAsset . "/img/user2-160x160.jpg";
} else {
echo Yii::$app->user->identity->user_image == null ? $directoryAsset . "/img/user2-160x160.jpg" : Yii::getAlias("@images_folder") . Yii::$app->user->identity->user_image;
}
?>" class="img-circle">
</div>
<div class="pull-left info">
<p style="color: #fff;"><?= Yii::$app->user->isGuest ? "" : \Yii::$app->user->identity->first_name; ?></p>
<a href="#" style="color: #fff;"><i class="fa fa-circle text-success"></i> <?php echo Yii::t("app", "Online"); ?></a>
</div>
</div>
</li>
<li class="user-body" style="border:none">
<ul style="list-style: none; padding: 0">
<li><a class="text-bold" href="<?php echo yii\helpers\Url::to(['/user/profiles']); ?>"><i class="fa fa-user"></i>&nbsp; <?php echo Yii::t("app", "Thông tin cá nhân"); ?></a></li>
<li><a class="text-bold" href="<?php echo yii\helpers\Url::to(['/user/change-password']); ?>"><i class="fa fa-lock"></i>&nbsp; <?php echo Yii::t("app", "Đổi mật khẩu"); ?></a></li>
<li class="separator"><hr style="margin:0;padding:0"></li>
<li>
<a href="<?php echo yii\helpers\Url::to(["/site/logout"]); ?>" onclick="$(this).parent().find('form').submit();return false;"><i class="fa fa-sign-out"></i>&nbsp; <?php echo Yii::t("app", "Đăng xuất"); ?></a>
<?php
ActiveForm::begin([
'action' => yii\helpers\Url::to(["/site/logout"]),
'method' => 'POST',
'options' => ['style' => 'display:none']
]);
?>
<div class="pull-right">
<button name="action" value="logout" class="btn btn-default btn-flat"><?php echo Yii::t("app", "Đăng xuất"); ?></button>
</div>
<?php ActiveForm::end(); ?>
</li>
</ul>
<style>
.user-body li a.text-bold{
font-weight: bold;
}
.user-body li a .fa{
color:#3c8dbc !important;
}
.user-body li{
padding: 5px 0px;
}
</style>
</li>
</ul>
</li>
<!-- User Account: style can be found in dropdown.less -->
<!-- <li>
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
</li>-->
</ul>
</div>
</nav>
</header>

View File

@@ -0,0 +1,52 @@
<aside class="main-sidebar">
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<img src="<?php
if (Yii::$app->user->isGuest) {
echo $directoryAsset . "/img/user2-160x160.jpg";
} else {
echo Yii::$app->user->identity->user_image == null ? $directoryAsset . "/img/user2-160x160.jpg" : Yii::getAlias("@images_folder") . Yii::$app->user->identity->user_image;
}
?>" class="img-circle" alt="User Image"/>
</div>
<div class="pull-left info">
<p>
<?php
if (Yii::$app->user->isGuest) {
echo "";
} else {
echo Yii::$app->user->identity->first_name . " " . Yii::$app->user->identity->last_name;
}
?>
</p>
<a href="#"><i class="fa fa-circle text-success"></i> <?php echo Yii::t("app", "Online"); ?></a>
</div>
</div>
<br>
<?=
dmstr\widgets\Menu::widget(
[
'options' => ['class' => 'sidebar-menu tree', 'data-widget' => 'tree'],
'items' => [
['label' => 'Bảng điều khiển', 'url' => ['/dashboard'], 'icon' => 'dashboard'],
[
'label' => 'Hệ thống', 'icon' => 'cogs', 'url' => ['#'],
'items' => [
['label' => 'Người dùng', 'icon' => 'users', 'url' => ['/user'], 'visible' => Yii::$app->user->can('administrator')]
],
'visible' => Yii::$app->user->can('administrator')
],
['label' => 'Login', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest],
],
]
)
?>
</section>
</aside>

View File

@@ -0,0 +1,29 @@
<?php
use backend\assets\AppAsset;
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $content string */
dmstr\web\AdminLteAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<body class="login-page">
<?php $this->beginBody() ?>
<?= $content ?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

View File

@@ -0,0 +1,65 @@
<?php
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $content string */
if (Yii::$app->controller->action->id === 'login') {
/**
* Do not use this code in your template. Remove it.
* Instead, use the code $this->layout = '//main-login'; in your controller.
*/
echo $this->render(
'main-login',
['content' => $content]
);
} else {
if (class_exists('backend\assets\AppAsset')) {
backend\assets\AppAsset::register($this);
} else {
app\assets\AppAsset::register($this);
}
dmstr\web\AdminLteAsset::register($this);
$directoryAsset = Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist');
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<meta charset="<?= Yii::$app->charset ?>"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<body class="hold-transition <?= \dmstr\helpers\AdminLteHelper::skinClass() ?> sidebar-mini">
<?php $this->beginBody() ?>
<div class="wrapper">
<?= $this->render(
'header.php',
['directoryAsset' => $directoryAsset]
) ?>
<?= $this->render(
'left.php',
['directoryAsset' => $directoryAsset]
)
?>
<?= $this->render(
'content.php',
['content' => $content, 'directoryAsset' => $directoryAsset]
) ?>
</div>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
<?php } ?>

View File

@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $name string */
/* @var $message string */
/* @var $exception Exception */
$this->title = $name;
?>
<section class="content">
<div class="error-page">
<h2 class="headline text-info"><i class="fa fa-warning text-yellow"></i></h2>
<div class="error-content">
<h3><?= $name ?></h3>
<p>
<?= nl2br(Html::encode($message)) ?>
</p>
<p>
The above error occurred while the Web server was processing your request.
Please contact us if you think this is a server error. Thank you.
Meanwhile, you may <a href='<?= Yii::$app->homeUrl ?>'>return to dashboard</a> or try using the search
form.
</p>
<form class='search-form'>
<div class='input-group'>
<input type="text" name="search" class='form-control' placeholder="Search"/>
<div class="input-group-btn">
<button type="submit" name="submit" class="btn btn-primary"><i class="fa fa-search"></i>
</button>
</div>
</div>
</form>
</div>
</div>
</section>

View File

@@ -0,0 +1,69 @@
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */
$this->title = 'Sign In';
$fieldOptions1 = [
'options' => ['class' => 'form-group has-feedback'],
'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];
$fieldOptions2 = [
'options' => ['class' => 'form-group has-feedback'],
'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];
?>
<style>
.login-box, .register-box{
margin: 3% auto;
}
</style>
<div class="login-box">
<div class="login-logo">
<img src="/images/logo.png" width="100%">
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg"><b>ĐĂNG NHẬP</b></p>
<?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>
<?=
$form
->field($model, 'username', $fieldOptions1)
->label(false)
->textInput(['placeholder' => $model->getAttributeLabel('username')])
?>
<?=
$form
->field($model, 'password', $fieldOptions2)
->label(false)
->passwordInput(['placeholder' => $model->getAttributeLabel('password')])
?>
<div class="row">
<div class="col-xs-7">
<?= $form->field($model, 'rememberMe')->checkbox() ?>
</div>
<!-- /.col -->
<div class="col-xs-5">
<?= Html::submitButton('Đăng nhập', ['class' => 'btn btn-primary btn-block', 'name' => 'login-button']) ?>
</div>
<!-- /.col -->
</div>
<?php ActiveForm::end(); ?>
<a href="#">I forgot my password</a><br>
</div>
<!-- /.login-box-body -->
</div><!-- /.login-box -->

View File

@@ -0,0 +1,176 @@
<?php
/**
* This is the template for generating a CRUD controller class file.
*/
use yii\db\ActiveRecordInterface;
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
$controllerClass = StringHelper::basename($generator->controllerClass);
$modelClass = StringHelper::basename($generator->modelClass);
$searchModelClass = StringHelper::basename($generator->searchModelClass);
if ($modelClass === $searchModelClass) {
$searchModelAlias = $searchModelClass . 'Search';
}
/* @var $class ActiveRecordInterface */
$class = $generator->modelClass;
$pks = $class::primaryKey();
$urlParams = $generator->generateUrlParams();
$actionParams = $generator->generateActionParams();
$actionParamComments = $generator->generateActionParamComments();
echo "<?php\n";
?>
namespace <?= StringHelper::dirname(ltrim($generator->controllerClass, '\\')) ?>;
use Yii;
use <?= ltrim($generator->modelClass, '\\') ?>;
<?php if (!empty($generator->searchModelClass)): ?>
use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>;
<?php else: ?>
use yii\data\ActiveDataProvider;
<?php endif; ?>
use <?= ltrim($generator->baseControllerClass, '\\') ?>;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* <?= $controllerClass ?> implements the CRUD actions for <?= $modelClass ?> model.
*/
class <?= $controllerClass ?> extends <?= StringHelper::basename($generator->baseControllerClass) . "\n" ?>
{
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
/**
* Lists all <?= $modelClass ?> models.
* @return mixed
*/
public function actionIndex()
{
<?php if (!empty($generator->searchModelClass)): ?>
$searchModel = new <?= isset($searchModelAlias) ? $searchModelAlias : $searchModelClass ?>();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
<?php else: ?>
$dataProvider = new ActiveDataProvider([
'query' => <?= $modelClass ?>::find(),
]);
return $this->render('index', [
'dataProvider' => $dataProvider,
]);
<?php endif; ?>
}
/**
* Displays a single <?= $modelClass ?> model.
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed
*/
public function actionView(<?= $actionParams ?>)
{
return $this->render('view', [
'model' => $this->findModel(<?= $actionParams ?>),
]);
}
/**
* Creates a new <?= $modelClass ?> model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new <?= $modelClass ?>();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', <?= $urlParams ?>]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing <?= $modelClass ?> model.
* If update is successful, the browser will be redirected to the 'view' page.
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed
*/
public function actionUpdate(<?= $actionParams ?>)
{
$model = $this->findModel(<?= $actionParams ?>);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', <?= $urlParams ?>]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing <?= $modelClass ?> model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return mixed
*/
public function actionDelete(<?= $actionParams ?>)
{
$this->findModel(<?= $actionParams ?>)->delete();
return $this->redirect(['index']);
}
/**
* Finds the <?= $modelClass ?> model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* <?= implode("\n * ", $actionParamComments) . "\n" ?>
* @return <?= $modelClass ?> the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel(<?= $actionParams ?>)
{
<?php
if (count($pks) === 1) {
$condition = '$id';
} else {
$condition = [];
foreach ($pks as $pk) {
$condition[] = "'$pk' => \$$pk";
}
$condition = '[' . implode(', ', $condition) . ']';
}
?>
if (($model = <?= $modelClass ?>::findOne(<?= $condition ?>)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}

View File

@@ -0,0 +1,87 @@
<?php
/**
* This is the template for generating CRUD search class of the specified model.
*/
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
$modelClass = StringHelper::basename($generator->modelClass);
$searchModelClass = StringHelper::basename($generator->searchModelClass);
if ($modelClass === $searchModelClass) {
$modelAlias = $modelClass . 'Model';
}
$rules = $generator->generateSearchRules();
$labels = $generator->generateSearchLabels();
$searchAttributes = $generator->getSearchAttributes();
$searchConditions = $generator->generateSearchConditions();
echo "<?php\n";
?>
namespace <?= StringHelper::dirname(ltrim($generator->searchModelClass, '\\')) ?>;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use <?= ltrim($generator->modelClass, '\\') . (isset($modelAlias) ? " as $modelAlias" : "") ?>;
/**
* <?= $searchModelClass ?> represents the model behind the search form of `<?= $generator->modelClass ?>`.
*/
class <?= $searchModelClass ?> extends <?= isset($modelAlias) ? $modelAlias : $modelClass ?>
{
/**
* @inheritdoc
*/
public function rules()
{
return [
<?= implode(",\n ", $rules) ?>,
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = <?= isset($modelAlias) ? $modelAlias : $modelClass ?>::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,<?= (in_array('id', $searchAttributes)) ? "\n 'sort' => ['defaultOrder' => ['id' => SORT_DESC]]\n" : '' ?>
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
<?= implode("\n ", $searchConditions) ?>
return $dataProvider;
}
}

View File

@@ -0,0 +1,41 @@
<?php
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
/* @var $model \yii\db\ActiveRecord */
$model = new $generator->modelClass();
$safeAttributes = $model->safeAttributes();
if (empty($safeAttributes)) {
$safeAttributes = $model->attributes();
}
echo "<?php\n";
?>
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-form box box-primary">
<?= "<?php " ?>$form = ActiveForm::begin(); ?>
<div class="box-body table-responsive">
<?php foreach ($generator->getColumnNames() as $attribute) {
if (in_array($attribute, $safeAttributes)) {
echo " <?= " . $generator->generateActiveField($attribute) . " ?>\n\n";
}
} ?>
</div>
<div class="box-footer">
<?= "<?= " ?>Html::submitButton(<?= $generator->generateString('Save') ?>, ['class' => 'btn btn-success btn-flat']) ?>
</div>
<?= "<?php " ?>ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,49 @@
<?php
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
echo "<?php\n";
?>
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->searchModelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-search">
<?= "<?php " ?>$form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
<?php if ($generator->enablePjax): ?>
'options' => [
'data-pjax' => 1
],
<?php endif; ?>
]); ?>
<?php
$count = 0;
foreach ($generator->getColumnNames() as $attribute) {
if (++$count < 6) {
echo " <?= " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
} else {
echo " <?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
}
}
?>
<div class="form-group">
<?= "<?= " ?>Html::submitButton(<?= $generator->generateString('Search') ?>, ['class' => 'btn btn-primary']) ?>
<?= "<?= " ?>Html::resetButton(<?= $generator->generateString('Reset') ?>, ['class' => 'btn btn-default']) ?>
</div>
<?= "<?php " ?>ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,28 @@
<?php
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
echo "<?php\n";
?>
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
$this->title = <?= $generator->generateString('Create ' . Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-create">
<?= "<?= " ?>$this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,78 @@
<?php
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
$urlParams = $generator->generateUrlParams();
$nameAttribute = $generator->getNameAttribute();
echo "<?php\n";
?>
use yii\helpers\Html;
use <?= $generator->indexWidgetType === 'grid' ? "yii\\grid\\GridView" : "yii\\widgets\\ListView" ?>;
<?= $generator->enablePjax ? 'use yii\widgets\Pjax;' : '' ?>
/* @var $this yii\web\View */
<?= !empty($generator->searchModelClass) ? "/* @var \$searchModel " . ltrim($generator->searchModelClass, '\\') . " */\n" : '' ?>
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>;
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-index box box-primary">
<?= $generator->enablePjax ? " <?php Pjax::begin(); ?>\n" : ''
?> <div class="box-header with-border">
<?= "<?= " ?>Html::a(<?= $generator->generateString('Create ' . Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>, ['create'], ['class' => 'btn btn-success btn-flat']) ?>
</div>
<div class="box-body table-responsive no-padding">
<?php if(!empty($generator->searchModelClass)): ?>
<?= " <?php " . ($generator->indexWidgetType === 'grid' ? "// " : "") ?>echo $this->render('_search', ['model' => $searchModel]); ?>
<?php endif;
if ($generator->indexWidgetType === 'grid'):
echo " <?= " ?>GridView::widget([
'dataProvider' => $dataProvider,
<?= !empty($generator->searchModelClass) ? "'filterModel' => \$searchModel,\n 'layout' => \"{items}\\n{summary}\\n{pager}\",\n 'columns' => [\n" : "'layout' => \"{items}\\n{summary}\\n{pager}\",\n 'columns' => [\n"; ?>
['class' => 'yii\grid\SerialColumn'],
<?php
$count = 0;
if (($tableSchema = $generator->getTableSchema()) === false) {
foreach ($generator->getColumnNames() as $name) {
if (++$count < 6) {
echo " '" . $name . "',\n";
} else {
echo " // '" . $name . "',\n";
}
}
} else {
foreach ($tableSchema->columns as $column) {
$format = $generator->generateColumnFormat($column);
if (++$count < 6) {
echo " '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
} else {
echo " // '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
}
}
}
?>
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
<?php else: ?>
<?= "<?= " ?>ListView::widget([
'dataProvider' => $dataProvider,
'itemOptions' => ['class' => 'item'],
'itemView' => function ($model, $key, $index, $widget) {
return Html::a(Html::encode($model-><?= $nameAttribute ?>), ['view', <?= $urlParams ?>]);
},
]) ?>
<?php endif; ?>
</div>
<?= $generator->enablePjax ? " <?php Pjax::end(); ?>\n" : '' ?>
</div>

View File

@@ -0,0 +1,30 @@
<?php
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
$urlParams = $generator->generateUrlParams();
echo "<?php\n";
?>
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
$this->title = <?= $generator->generateString('Update {modelClass}: ', ['modelClass' => Inflector::camel2words(StringHelper::basename($generator->modelClass))]) ?> . $model-><?= $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model-><?= $generator->getNameAttribute() ?>, 'url' => ['view', <?= $urlParams ?>]];
$this->params['breadcrumbs'][] = <?= $generator->generateString('Update') ?>;
?>
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-update">
<?= "<?= " ?>$this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,54 @@
<?php
use yii\helpers\Inflector;
use yii\helpers\StringHelper;
/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */
$urlParams = $generator->generateUrlParams();
echo "<?php\n";
?>
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
$this->title = $model-><?= $generator->getNameAttribute() ?>;
$this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString(Inflector::pluralize(Inflector::camel2words(StringHelper::basename($generator->modelClass)))) ?>, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-view box box-primary">
<div class="box-header">
<?= "<?= " ?>Html::a(<?= $generator->generateString('Update') ?>, ['update', <?= $urlParams ?>], ['class' => 'btn btn-primary btn-flat']) ?>
<?= "<?= " ?>Html::a(<?= $generator->generateString('Delete') ?>, ['delete', <?= $urlParams ?>], [
'class' => 'btn btn-danger btn-flat',
'data' => [
'confirm' => <?= $generator->generateString('Are you sure you want to delete this item?') ?>,
'method' => 'post',
],
]) ?>
</div>
<div class="box-body table-responsive no-padding">
<?= "<?= " ?>DetailView::widget([
'model' => $model,
'attributes' => [
<?php
if (($tableSchema = $generator->getTableSchema()) === false) {
foreach ($generator->getColumnNames() as $name) {
echo " '" . $name . "',\n";
}
} else {
foreach ($generator->getTableSchema()->columns as $column) {
$format = stripos($column->name, 'created_at') !== false || stripos($column->name, 'updated_at') !== false ? 'datetime' : $generator->generateColumnFormat($column);
echo " '" . $column->name . ($format === 'text' ? "" : ":" . $format) . "',\n";
}
}
?>
],
]) ?>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<?php
namespace dmstr\helpers;
use Yii;
class AdminLteHelper
{
/**
* It allows you to get the name of the css class.
* You can add the appropriate class to the body tag for dynamic change the template's appearance.
* Note: Use this fucntion only if you override the skin through configuration.
* Otherwise you will not get the correct css class of body.
*
* @return string
*/
public static function skinClass()
{
/** @var \dmstr\web\AdminLteAsset $bundle */
$bundle = Yii::$app->assetManager->getBundle('dmstr\web\AdminLteAsset');
return $bundle->skin;
}
}

View File

@@ -0,0 +1,15 @@
Testing
=======
Potemkin-Stack
--------------
Start app
docker-compose up -d
Find port
docker-compose ps

View File

@@ -0,0 +1 @@
vendor

View File

@@ -0,0 +1,34 @@
{
"repositories": [
{
"type": "vcs",
"url": "file:///repo"
}
],
"require": {
"wikimedia/composer-merge-plugin": "~1.4",
"schmunk42/yii2-giiant": "dev-develop"
},
"extra": {
"merge-plugin": {
"require": [
"/app/composer.json",
"/repo/composer.json"
]
}
},
"config": {
"fxp-asset": {
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
},
"vcs-driver-options": {
"github-no-api": true
},
"git-skip-update": "2 days",
"pattern-skip-version": "(-build|-patch)",
"optimize-with-installed-packages": true
}
}
}

2344
vendor/dmstr/yii2-adminlte-asset/tests/_app/composer.lock generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
<?php
return [
'defaultRoute' => 'test',
'aliases' => [
'repo' => '/repo',
'tests/app' => '@repo/tests/_app',
'dmstr' => '/repo',
'@dmstr/web' => '/repo/web',
'@dmstr/widgets' => '/repo/widgets',
'@dmstr/helpers' => '/repo/helpers',
],
'controllerNamespace' => 'tests\app\controllers',
'components' => [
'urlManager' => [
'rules' => [
'param/<id>' => 'sub/action/param'
]
]
]
];

View File

@@ -0,0 +1,32 @@
<?php
/**
* @link http://www.diemeisterei.de/
* @copyright Copyright (c) 2017 diemeisterei GmbH, Stuttgart
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace tests\app\controllers;
use yii\web\Controller;
class TestController extends Controller
{
public $layout = '@repo/example-views/testing/app/layouts/main';
public function actionIndex()
{
return $this->render('@repo/example-views/testing/app/default/index');
}
public function actionAuto()
{
return $this->render('@repo/example-views/testing/app/default/index');
}
public function actionLogin()
{
return $this->render('@repo/example-views/testing/app/security/login');
}
}

View File

@@ -0,0 +1,38 @@
<?php
/**
* @link http://www.diemeisterei.de/
* @copyright Copyright (c) 2017 diemeisterei GmbH, Stuttgart
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace tests\app\controllers\sub;
use yii\web\Controller;
class ActionController extends Controller
{
public $layout = '@repo/example-views/testing/app/layouts/main';
public function actionOne()
{
return $this->render('@repo/example-views/testing/app/default/index');
}
public function actionTwo()
{
return $this->render('@repo/example-views/testing/app/default/index');
}
public function actionThree()
{
return $this->render('@repo/example-views/testing/app/default/index');
}
public function actionParam($id)
{
return $this->render('@repo/example-views/testing/app/default/index');
}
}

View File

@@ -0,0 +1,17 @@
version: '2'
services:
php:
image: dmstr/yii2-app:0.5.1
working_dir: /repo/tests/_app
volumes:
- ../:/repo:cached
- ./_app/vendor:/app/vendor:delegated
- ~/.composer-docker/cache:/root/.composer/cache:delegated
environment:
- PHP_USER_ID=82
- GITHUB_API_TOKEN=${GITHUB_API_TOKEN}
- APP_CONFIG_FILE=/repo/tests/_app/config/local.php
- YII_ENV=dev
- YII_DEBUG=1
ports:
- 20580:80

View File

@@ -0,0 +1,49 @@
<?php
namespace dmstr\web;
use yii\base\Exception;
use yii\web\AssetBundle as BaseAdminLteAsset;
/**
* AdminLte AssetBundle
* @since 0.1
*/
class AdminLteAsset extends BaseAdminLteAsset
{
public $sourcePath = '@vendor/almasaeed2010/adminlte/dist';
public $css = [
'css/AdminLTE.min.css',
];
public $js = [
'js/adminlte.min.js'
];
public $depends = [
'rmrevin\yii\fontawesome\AssetBundle',
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset',
];
/**
* @var string|bool Choose skin color, eg. `'skin-blue'` or set `false` to disable skin loading
* @see https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#layout
*/
public $skin = '_all-skins';
/**
* @inheritdoc
*/
public function init()
{
// Append skin color file if specified
if ($this->skin) {
if (('_all-skins' !== $this->skin) && (strpos($this->skin, 'skin-') !== 0)) {
throw new Exception('Invalid skin specified');
}
$this->css[] = sprintf('css/skins/%s.min.css', $this->skin);
}
parent::init();
}
}

View File

@@ -0,0 +1,106 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace dmstr\widgets;
use yii\bootstrap\Alert as BootstrapAlert;
use yii\bootstrap\Widget;
/**
* Alert widget renders a message from session flash for AdminLTE alerts. All flash messages are displayed
* in the sequence they were assigned using setFlash. You can set message as following:
*
* ```php
* \Yii::$app->getSession()->setFlash('error', '<b>Alert!</b> Danger alert preview. This alert is dismissable.');
* ```
*
* Multiple messages could be set as follows:
*
* ```php
* \Yii::$app->getSession()->setFlash('error', ['Error 1', 'Error 2']);
* ```
*
* @author Evgeniy Tkachenko <et.coder@gmail.com>
*/
class Alert extends Widget
{
/**
* @var array the alert types configuration for the flash messages.
* This array is setup as $key => $value, where:
* - $key is the name of the session flash variable
* - $value is the array:
* - class of alert type (i.e. danger, success, info, warning)
* - icon for alert AdminLTE
*/
public $alertTypes = [
'error' => [
'class' => 'alert-danger',
'icon' => '<i class="icon fa fa-ban"></i>',
],
'danger' => [
'class' => 'alert-danger',
'icon' => '<i class="icon fa fa-ban"></i>',
],
'success' => [
'class' => 'alert-success',
'icon' => '<i class="icon fa fa-check"></i>',
],
'info' => [
'class' => 'alert-info',
'icon' => '<i class="icon fa fa-info"></i>',
],
'warning' => [
'class' => 'alert-warning',
'icon' => '<i class="icon fa fa-warning"></i>',
],
];
/**
* @var array the options for rendering the close button tag.
*/
public $closeButton = [];
/**
* @var boolean whether to removed flash messages during AJAX requests
*/
public $isAjaxRemoveFlash = true;
/**
* Initializes the widget.
* This method will register the bootstrap asset bundle. If you override this method,
* make sure you call the parent implementation first.
*/
public function init()
{
parent::init();
$session = \Yii::$app->getSession();
$flashes = $session->getAllFlashes();
$appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : '';
foreach ($flashes as $type => $data) {
if (isset($this->alertTypes[$type])) {
$data = (array) $data;
foreach ($data as $message) {
$this->options['class'] = $this->alertTypes[$type]['class'] . $appendCss;
$this->options['id'] = $this->getId() . '-' . $type;
echo BootstrapAlert::widget([
'body' => $this->alertTypes[$type]['icon'] . $message,
'closeButton' => $this->closeButton,
'options' => $this->options,
]);
}
if ($this->isAjaxRemoveFlash && !\Yii::$app->request->isAjax) {
$session->removeFlash($type);
}
}
}
}
}

View File

@@ -0,0 +1,212 @@
<?php
namespace dmstr\widgets;
use Yii;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use yii\helpers\Html;
/**
* Class Menu
* Theme menu widget.
*/
class Menu extends \yii\widgets\Menu
{
/**
* @inheritdoc
*/
public $linkTemplate = '<a href="{url}">{icon} {label}</a>';
/**
* @inheritdoc
* Styles all labels of items on sidebar by AdminLTE
*/
public $labelTemplate = '<span>{label}</span>';
public $submenuTemplate = "\n<ul class='treeview-menu' {show}>\n{items}\n</ul>\n";
public $activateParents = true;
public $defaultIconHtml = '<i class="fa fa-circle-o"></i> ';
public $options = ['class' => 'sidebar-menu', 'data-widget' => 'tree'];
/**
* @var string is prefix that will be added to $item['icon'] if it exist.
* By default uses for Font Awesome (http://fontawesome.io/)
*/
public static $iconClassPrefix = 'fa fa-';
private $noDefaultAction;
private $noDefaultRoute;
/**
* Renders the menu.
*/
public function run()
{
if ($this->route === null && Yii::$app->controller !== null) {
$this->route = Yii::$app->controller->getRoute();
}
if ($this->params === null) {
$this->params = Yii::$app->request->getQueryParams();
}
$posDefaultAction = strpos($this->route, Yii::$app->controller->defaultAction);
if ($posDefaultAction) {
$this->noDefaultAction = rtrim(substr($this->route, 0, $posDefaultAction), '/');
} else {
$this->noDefaultAction = false;
}
$posDefaultRoute = strpos($this->route, Yii::$app->controller->module->defaultRoute);
if ($posDefaultRoute) {
$this->noDefaultRoute = rtrim(substr($this->route, 0, $posDefaultRoute), '/');
} else {
$this->noDefaultRoute = false;
}
$items = $this->normalizeItems($this->items, $hasActiveChild);
if (!empty($items)) {
$options = $this->options;
$tag = ArrayHelper::remove($options, 'tag', 'ul');
echo Html::tag($tag, $this->renderItems($items), $options);
}
}
/**
* @inheritdoc
*/
protected function renderItem($item)
{
if (isset($item['items'])) {
$labelTemplate = '<a href="{url}">{icon} {label} <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
$linkTemplate = '<a href="{url}">{icon} {label} <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>';
} else {
$labelTemplate = $this->labelTemplate;
$linkTemplate = $this->linkTemplate;
}
$replacements = [
'{label}' => strtr($this->labelTemplate, ['{label}' => $item['label'],]),
'{icon}' => empty($item['icon']) ? $this->defaultIconHtml
: '<i class="' . static::$iconClassPrefix . $item['icon'] . '"></i> ',
'{url}' => isset($item['url']) ? Url::to($item['url']) : 'javascript:void(0);',
];
$template = ArrayHelper::getValue($item, 'template', isset($item['url']) ? $linkTemplate : $labelTemplate);
return strtr($template, $replacements);
}
/**
* Recursively renders the menu items (without the container tag).
* @param array $items the menu items to be rendered recursively
* @return string the rendering result
*/
protected function renderItems($items)
{
$n = count($items);
$lines = [];
foreach ($items as $i => $item) {
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', []));
$tag = ArrayHelper::remove($options, 'tag', 'li');
$class = [];
if ($item['active']) {
$class[] = $this->activeCssClass;
}
if ($i === 0 && $this->firstItemCssClass !== null) {
$class[] = $this->firstItemCssClass;
}
if ($i === $n - 1 && $this->lastItemCssClass !== null) {
$class[] = $this->lastItemCssClass;
}
if (!empty($class)) {
if (empty($options['class'])) {
$options['class'] = implode(' ', $class);
} else {
$options['class'] .= ' ' . implode(' ', $class);
}
}
$menu = $this->renderItem($item);
if (!empty($item['items'])) {
$menu .= strtr($this->submenuTemplate, [
'{show}' => $item['active'] ? "style='display: block'" : '',
'{items}' => $this->renderItems($item['items']),
]);
if (isset($options['class'])) {
$options['class'] .= ' treeview';
} else {
$options['class'] = 'treeview';
}
}
$lines[] = Html::tag($tag, $menu, $options);
}
return implode("\n", $lines);
}
/**
* @inheritdoc
*/
protected function normalizeItems($items, &$active)
{
foreach ($items as $i => $item) {
if (isset($item['visible']) && !$item['visible']) {
unset($items[$i]);
continue;
}
if (!isset($item['label'])) {
$item['label'] = '';
}
$encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
$items[$i]['label'] = $encodeLabel ? Html::encode($item['label']) : $item['label'];
$items[$i]['icon'] = isset($item['icon']) ? $item['icon'] : '';
$hasActiveChild = false;
if (isset($item['items'])) {
$items[$i]['items'] = $this->normalizeItems($item['items'], $hasActiveChild);
if (empty($items[$i]['items']) && $this->hideEmptyItems) {
unset($items[$i]['items']);
if (!isset($item['url'])) {
unset($items[$i]);
continue;
}
}
}
if (!isset($item['active'])) {
if ($this->activateParents && $hasActiveChild || $this->activateItems && $this->isItemActive($item)) {
$active = $items[$i]['active'] = true;
} else {
$items[$i]['active'] = false;
}
} elseif ($item['active']) {
$active = true;
}
}
return array_values($items);
}
/**
* Checks whether a menu item is active.
* This is done by checking if [[route]] and [[params]] match that specified in the `url` option of the menu item.
* When the `url` option of a menu item is specified in terms of an array, its first element is treated
* as the route for the item and the rest of the elements are the associated parameters.
* Only when its route and parameters match [[route]] and [[params]], respectively, will a menu item
* be considered active.
* @param array $item the menu item to be checked
* @return boolean whether the menu item is active
*/
protected function isItemActive($item)
{
if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) {
$route = $item['url'][0];
if (isset($route[0]) && $route[0] !== '/' && Yii::$app->controller) {
$route = ltrim(Yii::$app->controller->module->getUniqueId() . '/' . $route, '/');
}
$route = ltrim($route, '/');
if ($route != $this->route && $route !== $this->noDefaultRoute && $route !== $this->noDefaultAction) {
return false;
}
unset($item['url']['#']);
if (count($item['url']) > 1) {
foreach (array_splice($item['url'], 1) as $name => $value) {
if ($value !== null && (!isset($this->params[$name]) || $this->params[$name] != $value)) {
return false;
}
}
}
return true;
}
return false;
}
}