@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace app\properties; |
| 4 | 4 | |
| 5 | -use Yii; |
|
| 6 | - |
|
| 7 | 5 | class TestProperty extends \admin\base\Property |
| 8 | 6 | { |
| 9 | 7 | public function init() |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Yii; |
| 6 | 6 | use Exception; |
| 7 | 7 | use admin\helpers\Storage; |
| 8 | -use admin\models\StorageImage; |
|
| 9 | 8 | use admin\models\StorageFile; |
| 10 | 9 | use admin\models\StorageFolder; |
| 11 | 10 | use admin\Module; |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace admin\controllers; |
| 4 | 4 | |
| 5 | 5 | use Yii; |
| 6 | -use admin\Module; |
|
| 7 | 6 | use luya\helpers\Url; |
| 8 | 7 | use yii\helpers\Json; |
| 9 | 8 | |
@@ -14,10 +14,10 @@ |
||
| 14 | 14 | public function actionIndex() |
| 15 | 15 | { |
| 16 | 16 | // register auth token |
| 17 | - $this->view->registerJs("var authToken='".Yii::$app->adminuser->identity->authToken ."';", \luya\web\View::POS_HEAD); |
|
| 17 | + $this->view->registerJs("var authToken='".Yii::$app->adminuser->identity->authToken."';", \luya\web\View::POS_HEAD); |
|
| 18 | 18 | $this->view->registerJs("var homeUrl='".Url::home(true)."';", \luya\web\View::POS_HEAD); |
| 19 | 19 | // register admin js translations from module |
| 20 | - $this->view->registerJs('var i18n=' . Json::encode($this->module->jsTranslations), \luya\web\View::POS_HEAD); |
|
| 20 | + $this->view->registerJs('var i18n='.Json::encode($this->module->jsTranslations), \luya\web\View::POS_HEAD); |
|
| 21 | 21 | // Init ElementQueries after page load |
| 22 | 22 | // $this->view->registerJs('setTimeout( function() {ElementQueries.listen(); ElementQueries.init();}, 1500);', \luya\web\View::POS_LOAD); |
| 23 | 23 | // return and render index view file |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use yii\db\Query; |
| 6 | 6 | use luya\helpers\ArrayHelper; |
| 7 | -use cmsadmin\models\NavContainer; |
|
| 8 | 7 | use admin\models\Lang; |
| 9 | 8 | |
| 10 | 9 | class MenuController extends \admin\base\RestController |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Goutte\Client; |
| 6 | 6 | use yii\base\InvalidConfigException; |
| 7 | 7 | use yii\base\yii\base; |
| 8 | -use luya\helpers\Url; |
|
| 9 | 8 | |
| 10 | 9 | class CrawlPage extends \yii\base\Object |
| 11 | 10 | { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $info = parse_url($this->baseUrl); |
| 34 | 34 | |
| 35 | - $this->baseHost = $info['scheme'] . '://' . $info['host']; |
|
| 35 | + $this->baseHost = $info['scheme'].'://'.$info['host']; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function flush() |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function getLinks() |
| 61 | 61 | { |
| 62 | - $links = $this->getCrawler()->filterXPath('//a')->each(function ($node, $i) { |
|
| 62 | + $links = $this->getCrawler()->filterXPath('//a')->each(function($node, $i) { |
|
| 63 | 63 | return $node->extract(array('_text', 'href'))[0]; |
| 64 | 64 | }); |
| 65 | 65 | foreach ($links as $key => $item) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | if (!isset($url['host']) || !isset($url['scheme'])) { |
| 69 | 69 | $base = $this->baseHost; |
| 70 | 70 | } else { |
| 71 | - $base = $url['scheme'] . '//' . $url['host']; |
|
| 71 | + $base = $url['scheme'].'//'.$url['host']; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $path = null; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $path = $url['path']; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - $url = rtrim($base, "/") . "/" . ltrim($path, "/"); |
|
| 80 | + $url = rtrim($base, "/")."/".ltrim($path, "/"); |
|
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | $links[$key][1] = http_build_url($url, [ |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | foreach ($array as $k => $v) { |
| 31 | 31 | if (is_numeric($v)) { |
| 32 | - $return[$k] = (int)$v; |
|
| 32 | + $return[$k] = (int) $v; |
|
| 33 | 33 | } elseif (is_array($v)) { |
| 34 | 34 | $return[$k] = self::typeCast($v); |
| 35 | 35 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | if ($route === $composition) { |
| 49 | 49 | $parsedRequest[0] = false; |
| 50 | 50 | // now see if the composition (+1 as we add add trailing slash at the end) matches the cutted route request part, if so its composition prefix, remove it. |
| 51 | - } elseif (substr($route, 0, $length+1) == $composition.'/') { |
|
| 51 | + } elseif (substr($route, 0, $length + 1) == $composition.'/') { |
|
| 52 | 52 | $parsedRequest[0] = substr($parsedRequest[0], $length); |
| 53 | 53 | } |
| 54 | 54 | // fix broken request urls |
@@ -211,10 +211,10 @@ discard block |
||
| 211 | 211 | $params = (array) $params; |
| 212 | 212 | $url = $this->internalCreateUrl($params); |
| 213 | 213 | if (strpos($url, '://') === false) { |
| 214 | - $url = $this->getHostInfo() . $url; |
|
| 214 | + $url = $this->getHostInfo().$url; |
|
| 215 | 215 | } |
| 216 | 216 | if (is_string($scheme) && ($pos = strpos($url, '://')) !== false) { |
| 217 | - $url = $scheme . substr($url, $pos); |
|
| 217 | + $url = $scheme.substr($url, $pos); |
|
| 218 | 218 | } |
| 219 | 219 | return $url; |
| 220 | 220 | } |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Goutte\Client; |
| 6 | 6 | use yii\base\InvalidConfigException; |
| 7 | 7 | use yii\base\yii\base; |
| 8 | -use luya\helpers\Url; |
|
| 9 | 8 | |
| 10 | 9 | class CrawlPage extends \yii\base\Object |
| 11 | 10 | { |
@@ -30,38 +30,38 @@ discard block |
||
| 30 | 30 | public function getFunctions() |
| 31 | 31 | { |
| 32 | 32 | return [ |
| 33 | - 'menuFindAll' => function ($container, $parentNavId) { |
|
| 33 | + 'menuFindAll' => function($container, $parentNavId) { |
|
| 34 | 34 | return Yii::$app->menu->findAll(['container' => $container, 'parent_nav_id' => $parentNavId]); |
| 35 | 35 | }, |
| 36 | - 'menuFindOne' => function ($id) { |
|
| 36 | + 'menuFindOne' => function($id) { |
|
| 37 | 37 | return Yii::$app->menu->findOne(['id' => $id]); |
| 38 | 38 | }, |
| 39 | - 'menuCurrent' => function () { |
|
| 39 | + 'menuCurrent' => function() { |
|
| 40 | 40 | return Yii::$app->menu->current; |
| 41 | 41 | }, |
| 42 | - 'menuCurrentLevel' => function ($level) { |
|
| 42 | + 'menuCurrentLevel' => function($level) { |
|
| 43 | 43 | return Yii::$app->menu->getLevelCurrent($level); |
| 44 | 44 | }, |
| 45 | - 'menuLevelContainer' => function ($level) { |
|
| 45 | + 'menuLevelContainer' => function($level) { |
|
| 46 | 46 | return Yii::$app->menu->getLevelContainer($level); |
| 47 | 47 | }, |
| 48 | - 'asset' => function ($name) { |
|
| 48 | + 'asset' => function($name) { |
|
| 49 | 49 | return Yii::$app->getAssetManager()->getBundle($name); |
| 50 | 50 | }, |
| 51 | - 'filterApply' => function ($imageId, $filterIdentifier) { |
|
| 51 | + 'filterApply' => function($imageId, $filterIdentifier) { |
|
| 52 | 52 | return Yii::$app->storage->getImage($imageId)->applyFilter($filterIdentifier); |
| 53 | 53 | }, |
| 54 | - 'image' => function ($imageId) { |
|
| 54 | + 'image' => function($imageId) { |
|
| 55 | 55 | return Yii::$app->storage->getImage($imageId); |
| 56 | 56 | }, |
| 57 | - 'element' => function () { |
|
| 57 | + 'element' => function() { |
|
| 58 | 58 | $args = func_get_args(); |
| 59 | 59 | $method = $args[0]; |
| 60 | 60 | unset($args[0]); |
| 61 | 61 | |
| 62 | 62 | return Yii::$app->element->run($method, $args); |
| 63 | 63 | }, |
| 64 | - 't' => function () { |
|
| 64 | + 't' => function() { |
|
| 65 | 65 | $args = func_get_args(); |
| 66 | 66 | |
| 67 | 67 | return call_user_func_array(['Yii', 't'], $args); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $twig->addFunction(new Twig_SimpleFunction($name, $lambda)); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $twig->addFilter(new Twig_SimpleFilter('strftime', function ($timestamp, $format) { |
|
| 82 | + $twig->addFilter(new Twig_SimpleFilter('strftime', function($timestamp, $format) { |
|
| 83 | 83 | if (is_numeric($timestamp)) { |
| 84 | 84 | return strftime($format, $timestamp); |
| 85 | 85 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | $name = substr($name, 0, -(strlen($suffix))); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - return $name . $suffix; |
|
| 78 | + return $name.$suffix; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |