@@ -71,6 +71,9 @@ |
||
| 71 | 71 | parent::afterDelete(); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $context |
|
| 76 | + */ |
|
| 74 | 77 | public static function objectId($blockId, $id, $context, $pageObject = null) |
| 75 | 78 | { |
| 76 | 79 | $block = self::find()->where(['id' => $blockId])->asArray()->one(); |
@@ -39,6 +39,9 @@ |
||
| 39 | 39 | ]; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | + /** |
|
| 43 | + * @param integer $navId |
|
| 44 | + */ |
|
| 42 | 45 | public static function findContent($navId) |
| 43 | 46 | { |
| 44 | 47 | $lang = Yii::$app->composition->getKey('langShortCode'); |
@@ -120,13 +120,13 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | switch ($e->name) { |
| 122 | 122 | case 'afterInsert': |
| 123 | - Log::add(1, "nav.insert, cms_nav.id '" . $this->id . "'", $this->toArray()); |
|
| 123 | + Log::add(1, "nav.insert, cms_nav.id '".$this->id."'", $this->toArray()); |
|
| 124 | 124 | break; |
| 125 | 125 | case 'afterUpdate': |
| 126 | - Log::add(2, "nav.update, cms_nav.id '" . $this->id . "'", $this->toArray()); |
|
| 126 | + Log::add(2, "nav.update, cms_nav.id '".$this->id."'", $this->toArray()); |
|
| 127 | 127 | break; |
| 128 | 128 | case 'afterDelete': |
| 129 | - Log::add(3, "nav.delete, cms_nav.id '" . $this->id . "'", $this->toArray()); |
|
| 129 | + Log::add(3, "nav.delete, cms_nav.id '".$this->id."'", $this->toArray()); |
|
| 130 | 130 | break; |
| 131 | 131 | } |
| 132 | 132 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | public function moveUpstairs() |
| 229 | 229 | { |
| 230 | - $startIndex = (int)$this->sort_index; |
|
| 230 | + $startIndex = (int) $this->sort_index; |
|
| 231 | 231 | foreach (self::find()->where('sort_index >= :index', ['index' => $startIndex])->andWhere(['nav_container_id' => $this->nav_container_id, 'parent_nav_id' => $this->parent_nav_id])->orderBy('sort_index ASC')->asArray()->all() as $item) { |
| 232 | 232 | ++$startIndex; |
| 233 | 233 | Yii::$app->db->createCommand()->update(self::tableName(), ['sort_index' => $startIndex], 'id=:id', ['id' => $item['id']])->execute(); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | public function moveDownstairs() |
| 238 | 238 | { |
| 239 | - $startIndex = (int)$this->sort_index; |
|
| 239 | + $startIndex = (int) $this->sort_index; |
|
| 240 | 240 | foreach (self::find()->where('sort_index >= :index', ['index' => $startIndex])->andWhere(['nav_container_id' => $this->nav_container_id, 'parent_nav_id' => $this->parent_nav_id])->orderBy('sort_index ASC')->asArray()->all() as $item) { |
| 241 | 241 | --$startIndex; |
| 242 | 242 | Yii::$app->db->createCommand()->update(self::tableName(), ['sort_index' => $startIndex], 'id=:id', ['id' => $item['id']])->execute(); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * |
| 184 | 184 | * @todo fix me above! |
| 185 | 185 | * |
| 186 | - * @param unknown $moduleName |
|
| 186 | + * @param string $moduleName |
|
| 187 | 187 | */ |
| 188 | 188 | public static function fromModule($moduleName) |
| 189 | 189 | { |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | /** |
| 236 | 236 | * @todo use AR or queryCommand? NavItem::find()->leftJoin('cms_nav_item_module', 'nav_item_type_id=cms_nav_item_module.id')->where(['nav_item_type' => 2, 'cms_nav_item_module.module_name' => $moduleName])->asArray()->one() |
| 237 | 237 | * |
| 238 | - * @param unknown $moduleName |
|
| 238 | + * @param string $moduleName |
|
| 239 | 239 | * |
| 240 | 240 | * @return unknown |
| 241 | 241 | */ |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | * |
| 267 | 267 | * Copy content of type cms_nav_item_page to a target nav item. This will create a new entry in cms_nav_item_page and for every used block a new entry in cms_nav_item_page_block_item |
| 268 | 268 | * |
| 269 | - * @param $targetNavItem nav item object |
|
| 269 | + * @param \yii\db\ActiveRecord $targetNavItem nav item object |
|
| 270 | 270 | * @return bool |
| 271 | 271 | */ |
| 272 | 272 | public function copyPageItem($targetNavItem) |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * |
| 321 | 321 | * Copy content of type cms_nav_item_module to a target nav item. This will create a new entry in cms_nav_item_module. |
| 322 | 322 | * |
| 323 | - * @param $targetNavItem |
|
| 323 | + * @param \yii\db\ActiveRecord $targetNavItem |
|
| 324 | 324 | * @return bool |
| 325 | 325 | */ |
| 326 | 326 | public function copyModuleItem($targetNavItem) |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * |
| 349 | 349 | * Copy content of type cms_nav_item_redirect to a target nav item. This will create a new entry in cms_nav_item_redirect. |
| 350 | 350 | * |
| 351 | - * @param $targetNavItem |
|
| 351 | + * @param \yii\db\ActiveRecord $targetNavItem |
|
| 352 | 352 | * @return bool |
| 353 | 353 | */ |
| 354 | 354 | public function copyRedirectItem($targetNavItem) |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | |
| 21 | 21 | private $_module = null; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @return \luya\base\Module |
|
| 25 | + */ |
|
| 23 | 26 | private function getModule() |
| 24 | 27 | { |
| 25 | 28 | if ($this->_module !== null) { |
@@ -79,6 +79,9 @@ discard block |
||
| 79 | 79 | throw new Exception("Could not find the requested cms layout id '".$this->layout_id."' for nav item page id '". $this->id . "'. Make sure your page does not have an old inactive/deleted cms layout selected."); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $key |
|
| 84 | + */ |
|
| 82 | 85 | private function setHasCache($key, $value, $expirationTime) |
| 83 | 86 | { |
| 84 | 87 | if (Yii::$app->has('cache')) { |
@@ -86,6 +89,9 @@ discard block |
||
| 86 | 89 | } |
| 87 | 90 | } |
| 88 | 91 | |
| 92 | + /** |
|
| 93 | + * @param string $key |
|
| 94 | + */ |
|
| 89 | 95 | private function getHasCache($key) |
| 90 | 96 | { |
| 91 | 97 | if (Yii::$app->has('cache')) { |
@@ -98,6 +104,9 @@ discard block |
||
| 98 | 104 | return false; |
| 99 | 105 | } |
| 100 | 106 | |
| 107 | + /** |
|
| 108 | + * @param integer $prevId |
|
| 109 | + */ |
|
| 101 | 110 | public function renderPlaceholder($navItemPageId, $placeholderVar, $prevId) |
| 102 | 111 | { |
| 103 | 112 | $string = ''; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | return $data; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - throw new Exception("Could not find the requested cms layout id '".$this->layout_id."' for nav item page id '". $this->id . "'. Make sure your page does not have an old inactive/deleted cms layout selected."); |
|
| 79 | + throw new Exception("Could not find the requested cms layout id '".$this->layout_id."' for nav item page id '".$this->id."'. Make sure your page does not have an old inactive/deleted cms layout selected."); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | private function setHasCache($key, $value, $expirationTime) |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $string.= $blockResponse; |
|
| 147 | + $string .= $blockResponse; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $string; |
@@ -46,6 +46,9 @@ |
||
| 46 | 46 | return $model->getErrors(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $message |
|
| 51 | + */ |
|
| 49 | 52 | public function slack($message, $room) |
| 50 | 53 | { |
| 51 | 54 | $ch = curl_init('https://slack.com/api/chat.postMessage'); |
@@ -46,6 +46,9 @@ |
||
| 46 | 46 | return $model->getErrors(); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $message |
|
| 51 | + */ |
|
| 49 | 52 | public function slack($message, $room) |
| 50 | 53 | { |
| 51 | 54 | $ch = curl_init('https://slack.com/api/chat.postMessage'); |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $mailHtml = $this->renderPartial('_mail', ['model' => $model]); |
| 35 | 35 | |
| 36 | 36 | if (!empty($this->module->recipient)) { |
| 37 | - $mailer = Yii::$app->mail->compose('Error Api: ' . $model->serverName, $mailHtml); |
|
| 37 | + $mailer = Yii::$app->mail->compose('Error Api: '.$model->serverName, $mailHtml); |
|
| 38 | 38 | foreach ($this->module->recipient as $recipient) { |
| 39 | 39 | $mailer->address($recipient); |
| 40 | 40 | } |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | ?> |
| 6 | 6 | <h1 style="color: #f00;"><?php echo $model->message; ?></h1> |
| 7 | 7 | <p style="color: #800000;">from <strong><?php echo $model->serverName; ?></strong></p> |
| 8 | -<a href="https://github.com/luyadev/luya/issues/new?title=<?php echo urlencode('#'. $model->identifier . ' ' . $model->message);?>"><?php echo errorapi\Module::t('mail_create_issue') ?></a> |
|
| 8 | +<a href="https://github.com/luyadev/luya/issues/new?title=<?php echo urlencode('#'.$model->identifier.' '.$model->message); ?>"><?php echo errorapi\Module::t('mail_create_issue') ?></a> |
|
| 9 | 9 | <table cellspacing="2" cellpadding="6" border="0" width="1200"> |
| 10 | 10 | <?php foreach ($model->errorArray as $key => $value): ?> |
| 11 | 11 | <tr> |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | <table cellspacing="0" cellpadding="4" border="0"> |
| 35 | 35 | <?php foreach ($value as $k => $v): ?> |
| 36 | 36 | <tr> |
| 37 | - <td><?php echo $k; ?>:</td><td><?php echo (is_array($v)) ? print_r($v, true) : $v; ?></td> |
|
| 37 | + <td><?php echo $k; ?>:</td><td><?php echo (is_array($v)) ? print_r($v, true) : $v; ?></td> |
|
| 38 | 38 | </tr> |
| 39 | 39 | <?php endforeach; ?> |
| 40 | 40 | </table> |
| 41 | 41 | <?php else: ?> |
| 42 | 42 | <?php echo $value; ?> |
| 43 | - <?php endif;?> |
|
| 43 | + <?php endif; ?> |
|
| 44 | 44 | </tr> |
| 45 | 45 | <?php endforeach; ?> |
| 46 | 46 | </table> |
| 47 | 47 | \ No newline at end of file |
@@ -38,8 +38,11 @@ |
||
| 38 | 38 | </tr> |
| 39 | 39 | <?php endforeach; ?> |
| 40 | 40 | </table> |
| 41 | - <?php else: ?> |
|
| 42 | - <?php echo $value; ?> |
|
| 41 | + <?php else { |
|
| 42 | + : ?> |
|
| 43 | + <?php echo $value; |
|
| 44 | +} |
|
| 45 | +?> |
|
| 43 | 46 | <?php endif;?> |
| 44 | 47 | </tr> |
| 45 | 48 | <?php endforeach; ?> |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @var $model |
|
| 4 | - */ |
|
| 3 | + * @var $model |
|
| 4 | + */ |
|
| 5 | 5 | ?> |
| 6 | 6 | <h1 style="color: #f00;"><?php echo $model->message; ?></h1> |
| 7 | 7 | <p style="color: #800000;">from <strong><?php echo $model->serverName; ?></strong></p> |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function parseRequest($manager, $request) |
| 19 | 19 | { |
| 20 | 20 | // add trace info |
| 21 | - Yii::info('LUYA-CMS RouteBehaviorUrlRule is parsing the Request for path info \'' . $request->pathInfo .'\'', __METHOD__); |
|
| 21 | + Yii::info('LUYA-CMS RouteBehaviorUrlRule is parsing the Request for path info \''.$request->pathInfo.'\'', __METHOD__); |
|
| 22 | 22 | // return the custom route |
| 23 | 23 | |
| 24 | 24 | $parts = explode("/", $request->pathInfo); |