@@ -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 |
@@ -29,6 +29,7 @@ discard block |
||
| 29 | 29 | * So you need to use the "%u" formatter of sprintf() or printf() to get the string representation of the unsigned crc32() checksum in decimal format. |
| 30 | 30 | * |
| 31 | 31 | * @var string |
| 32 | + * @param string $fileName |
|
| 32 | 33 | */ |
| 33 | 34 | public static function createFileHash($fileName) |
| 34 | 35 | { |
@@ -133,7 +134,7 @@ discard block |
||
| 133 | 134 | /** |
| 134 | 135 | * |
| 135 | 136 | * @param array $fileArray Its an entry of the files array like $_FILEs['logo_image']; |
| 136 | - * @param number $toFolder |
|
| 137 | + * @param integer $toFolder |
|
| 137 | 138 | * @param string $isHidden |
| 138 | 139 | */ |
| 139 | 140 | public static function uploadFromFileArray(array $fileArray, $toFolder = 0, $isHidden = false) |
@@ -194,7 +195,7 @@ discard block |
||
| 194 | 195 | /** |
| 195 | 196 | * |
| 196 | 197 | * @param array $filesArray Use $_FILES |
| 197 | - * @param number $toFolder |
|
| 198 | + * @param integer $toFolder |
|
| 198 | 199 | * @param string $isHidden |
| 199 | 200 | * |
| 200 | 201 | * @todo what happen if $files does have more then one entry, as the response is limit to 1 |
@@ -103,8 +103,8 @@ |
||
| 103 | 103 | $height = 0; |
| 104 | 104 | |
| 105 | 105 | if (isset($dimensions[0]) && isset($dimensions[1])) { |
| 106 | - $width = (int)$dimensions[0]; |
|
| 107 | - $height = (int)$dimensions[1]; |
|
| 106 | + $width = (int) $dimensions[0]; |
|
| 107 | + $height = (int) $dimensions[1]; |
|
| 108 | 108 | } elseif ($throwException) { |
| 109 | 109 | throw new Exception("Unable to determine the resoltuions of the file $filePath."); |
| 110 | 110 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * |
| 41 | - * @return string|boolean |
|
| 41 | + * @return string|false |
|
| 42 | 42 | */ |
| 43 | 43 | public function getSource() |
| 44 | 44 | { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * |
| 56 | - * @return string|boolean |
|
| 56 | + * @return string|false |
|
| 57 | 57 | */ |
| 58 | 58 | public function getServerSource() |
| 59 | 59 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $apply = Yii::$app->storage->addImage($this->getFileId(), $this->getFilterId()); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - return ($this->getFile()) ? Yii::$app->storage->httpPath . '/' . $this->getFilterId() . '_' . $this->getFile()->getSystemFileName() : false; |
|
| 51 | + return ($this->getFile()) ? Yii::$app->storage->httpPath.'/'.$this->getFilterId().'_'.$this->getFile()->getSystemFileName() : false; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function getServerSource() |
| 59 | 59 | { |
| 60 | - return ($this->getFile()) ? Yii::$app->storage->serverPath . '/' . $this->getFilterId() . '_' . $this->getFile()->getSystemFileName() : false; |
|
| 60 | + return ($this->getFile()) ? Yii::$app->storage->serverPath.'/'.$this->getFilterId().'_'.$this->getFile()->getSystemFileName() : false; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -7,6 +7,9 @@ |
||
| 7 | 7 | |
| 8 | 8 | class FilterImporter extends \luya\base\Importer |
| 9 | 9 | { |
| 10 | + /** |
|
| 11 | + * @param string $identifier |
|
| 12 | + */ |
|
| 10 | 13 | private function refresh($identifier, $fields) |
| 11 | 14 | { |
| 12 | 15 | $model = StorageEffect::find()->where(['identifier' => $identifier])->one(); |
@@ -9,11 +9,17 @@ discard block |
||
| 9 | 9 | return 'admin_config'; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | + /** |
|
| 13 | + * @param string $name |
|
| 14 | + */ |
|
| 12 | 15 | public static function has($name) |
| 13 | 16 | { |
| 14 | 17 | return (self::find()->where(['name' => $name])->one()) ? true : false; |
| 15 | 18 | } |
| 16 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $name |
|
| 22 | + */ |
|
| 17 | 23 | public static function get($name) |
| 18 | 24 | { |
| 19 | 25 | $model = self::find()->where(['name' => $name])->asArray()->one(); |
@@ -25,6 +31,9 @@ discard block |
||
| 25 | 31 | return; |
| 26 | 32 | } |
| 27 | 33 | |
| 34 | + /** |
|
| 35 | + * @param string $name |
|
| 36 | + */ |
|
| 28 | 37 | public static function set($name, $value) |
| 29 | 38 | { |
| 30 | 39 | $model = self::find()->where(['name' => $name])->one(); |
@@ -42,6 +51,9 @@ discard block |
||
| 42 | 51 | return $model->insert(false); |
| 43 | 52 | } |
| 44 | 53 | |
| 54 | + /** |
|
| 55 | + * @param string $name |
|
| 56 | + */ |
|
| 45 | 57 | public static function remove($name) |
| 46 | 58 | { |
| 47 | 59 | $model = self::find()->where(['name' => $name])->one(); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | * We can not global set is_deleted=0 to the where condition cause in some parts of the storage we want |
| 41 | 41 | * to access the name_new_compound to rebuild old image paths. |
| 42 | 42 | * |
| 43 | - * @return \yii\db\$this |
|
| 43 | + * @return \yii\db\ActiveQuery |
|
| 44 | 44 | */ |
| 45 | 45 | public static function find() |
| 46 | 46 | { |
@@ -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'); |
@@ -45,6 +45,9 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public $ngRestServiceArray = []; |
| 47 | 47 | |
| 48 | + /** |
|
| 49 | + * @param \admin\ngrest\ConfigBuilder $config |
|
| 50 | + */ |
|
| 48 | 51 | abstract public function ngRestConfig($config); |
| 49 | 52 | |
| 50 | 53 | abstract public function ngRestApiEndpoint(); |
@@ -292,8 +295,8 @@ discard block |
||
| 292 | 295 | * |
| 293 | 296 | * |
| 294 | 297 | * @param \admin\ngrest\ConfigBuilder $config |
| 295 | - * @param unknown $type |
|
| 296 | - * @param array $fields |
|
| 298 | + * @param string $type |
|
| 299 | + * @param string[] $fields |
|
| 297 | 300 | * @throws \yii\base\InvalidConfigException |
| 298 | 301 | * @since 1.0.0-beta4 |
| 299 | 302 | */ |
@@ -26,6 +26,9 @@ discard block |
||
| 26 | 26 | return $this->_model; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $type |
|
| 31 | + */ |
|
| 29 | 32 | protected function createBaseElement($doc, $type) |
| 30 | 33 | { |
| 31 | 34 | $elmn = $doc->createElement($type); |
@@ -47,6 +50,9 @@ discard block |
||
| 47 | 50 | $this->i18n = $i18n; |
| 48 | 51 | } |
| 49 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string $name |
|
| 55 | + */ |
|
| 50 | 56 | public function getServiceName($name) |
| 51 | 57 | { |
| 52 | 58 | return 'service.'.$this->name.'.'.$name; |