@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | foreach ($this->elements AS $element) { |
| 28 | 28 | if (!$model->checkAttributeExists($element)) { |
| 29 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 29 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 30 | 30 | |
| 31 | 31 | return false; |
| 32 | 32 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $query = new Query($this->container->db); |
| 36 | 36 | $query->select = $this->params['attribute']; |
| 37 | 37 | $query->table = $this->params['table']; |
| 38 | - $query->addWhere($this->params['attribute'] . '="' . $elementValue . '"'); |
|
| 38 | + $query->addWhere($this->params['attribute'].'="'.$elementValue.'"'); |
|
| 39 | 39 | $query->limit = 1; |
| 40 | 40 | $query->single = true; |
| 41 | 41 | |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | foreach ($this->elements AS $element) { |
| 27 | 27 | if (!$model->checkAttributeExists($element)) { |
| 28 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 28 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 29 | 29 | |
| 30 | 30 | return false; |
| 31 | 31 | } |
| 32 | 32 | $elementValue = $model->$element; |
| 33 | 33 | if (preg_match($this->params['pattern'], $elementValue) === false) { |
| 34 | - $this->errors[] = 'Parameter ' . $element . ' not valid with regular expression'; |
|
| 34 | + $this->errors[] = 'Parameter '.$element.' not valid with regular expression'; |
|
| 35 | 35 | |
| 36 | 36 | return false; |
| 37 | 37 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function client(IFormModel $model) |
| 47 | 47 | { |
| 48 | - $js = 'if (!this.value.match(' . $this->params['pattern'] . ')) {' . |
|
| 48 | + $js = 'if (!this.value.match('.$this->params['pattern'].')) {'. |
|
| 49 | 49 | ' e.preventDefault(); this.focus(); alert(\'Value not valid with regular expression\'); }'; |
| 50 | 50 | |
| 51 | 51 | return $js; |
@@ -25,12 +25,12 @@ |
||
| 25 | 25 | { |
| 26 | 26 | foreach ($this->elements AS $element) { |
| 27 | 27 | if (!$model->checkAttributeExists($element)) { |
| 28 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 28 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 29 | 29 | |
| 30 | 30 | return false; |
| 31 | 31 | } |
| 32 | 32 | if (!$model->$element) { |
| 33 | - $this->errors[] = $element . ' error: required element is empty.'; |
|
| 33 | + $this->errors[] = $element.' error: required element is empty.'; |
|
| 34 | 34 | |
| 35 | 35 | return false; |
| 36 | 36 | } |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | foreach ($this->elements AS $element) { |
| 42 | 42 | if (!$model->checkAttributeExists($element)) { |
| 43 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 43 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 44 | 44 | |
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | $elementValue = $model->$element; |
| 48 | 48 | |
| 49 | 49 | if (($elementValue !== $this->params['true']) && ($elementValue !== $this->params['false'])) { |
| 50 | - $this->errors[] = $element . ' error: required element is empty.'; |
|
| 50 | + $this->errors[] = $element.' error: required element is empty.'; |
|
| 51 | 51 | |
| 52 | 52 | return false; |
| 53 | 53 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function client(IFormModel $model) |
| 63 | 63 | { |
| 64 | - return 'if (this.value != ' . $this->params['true'] . ' && this.value != ' . $this->params['false'] . ') {' . |
|
| 64 | + return 'if (this.value != '.$this->params['true'].' && this.value != '.$this->params['false'].') {'. |
|
| 65 | 65 | ' e.preventDefault(); this.focus(); alert(\'Value not compatible\'); }'; |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | if (!$model->checkAttributeExists($element)) { |
| 28 | 28 | $files = $this->container->request->getFiles(); |
| 29 | 29 | if (!empty($this->params['maxFiles']) && (count($files->files) > $this->params['maxFiles'])) { |
| 30 | - $this->errors[] = 'Too many files in parameter ' . $element; |
|
| 30 | + $this->errors[] = 'Too many files in parameter '.$element; |
|
| 31 | 31 | |
| 32 | 32 | return false; |
| 33 | 33 | } |
@@ -35,17 +35,17 @@ discard block |
||
| 35 | 35 | if (!empty($this->params['types']) && (strpos($this->params['types'], |
| 36 | 36 | $fContext['type']) === false) |
| 37 | 37 | ) { |
| 38 | - $this->errors[] = 'File ' . $fContext['name'] . ' not allowed type'; |
|
| 38 | + $this->errors[] = 'File '.$fContext['name'].' not allowed type'; |
|
| 39 | 39 | |
| 40 | 40 | return false; |
| 41 | 41 | } |
| 42 | 42 | if (!empty($this->params['minSize']) && ($fContext['size'] < $this->params['minSize'])) { |
| 43 | - $this->errors[] = 'File ' . $fContext['name'] . ' too small size'; |
|
| 43 | + $this->errors[] = 'File '.$fContext['name'].' too small size'; |
|
| 44 | 44 | |
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | if (!empty($this->params['maxSize']) && ($fContext['type'] > $this->params['maxSize'])) { |
| 48 | - $this->errors[] = 'File ' . $fContext['name'] . ' too many size'; |
|
| 48 | + $this->errors[] = 'File '.$fContext['name'].' too many size'; |
|
| 49 | 49 | |
| 50 | 50 | return false; |
| 51 | 51 | } |
@@ -25,12 +25,12 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | foreach ($this->elements AS $element) { |
| 27 | 27 | if (!$model->checkAttributeExists($element)) { |
| 28 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 28 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 29 | 29 | |
| 30 | 30 | return false; |
| 31 | 31 | } |
| 32 | 32 | if (filter_var($model->$element, FILTER_VALIDATE_URL) === false) { |
| 33 | - $this->errors[] = 'Parameter ' . $element . ' is not a valid URL address'; |
|
| 33 | + $this->errors[] = 'Parameter '.$element.' is not a valid URL address'; |
|
| 34 | 34 | |
| 35 | 35 | return false; |
| 36 | 36 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function client(IFormModel $model) |
| 46 | 46 | { |
| 47 | - $jsString = 'if (/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(this.value' . |
|
| 47 | + $jsString = 'if (/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(this.value'. |
|
| 48 | 48 | ') != true) { e.preventDefault(); this.focus(); alert(\'Value is not a URL\'); }'; |
| 49 | 49 | |
| 50 | 50 | return $jsString; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | { |
| 46 | 46 | foreach ($this->elements AS $element) { |
| 47 | 47 | if (!$model->checkAttributeExists($element)) { |
| 48 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 48 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 49 | 49 | |
| 50 | 50 | return false; |
| 51 | 51 | } |
@@ -30,23 +30,23 @@ discard block |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | if (!$model->checkAttributeExists($this->params['attribute'])) { |
| 33 | - throw new Exception('Attribute `' . $this->params['attribute'] . '` not found into ' . get_class($model)); |
|
| 33 | + throw new Exception('Attribute `'.$this->params['attribute'].'` not found into '.get_class($model)); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | foreach ($this->elements AS $element) { |
| 37 | 37 | if (!$model->checkAttributeExists($element)) { |
| 38 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 38 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 39 | 39 | |
| 40 | 40 | return false; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $elementValue = $model->$element; |
| 44 | 44 | if (!empty($this->params['value']) && ($this->params['value'] !== $elementValue)) { |
| 45 | - $this->errors[] = 'Parameter ' . $element . ' not equal ' . $this->params['value']; |
|
| 45 | + $this->errors[] = 'Parameter '.$element.' not equal '.$this->params['value']; |
|
| 46 | 46 | |
| 47 | 47 | return false; |
| 48 | 48 | } elseif (!empty($this->params['attribute']) && ($model->{$this->params['attribute']} !== $elementValue)) { |
| 49 | - $this->errors[] = 'Parameter ' . $element . ' not equal ' . $model->{$this->params['attribute']}; |
|
| 49 | + $this->errors[] = 'Parameter '.$element.' not equal '.$model->{$this->params['attribute']}; |
|
| 50 | 50 | |
| 51 | 51 | return false; |
| 52 | 52 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $value = $model->$attribute; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - $js = 'if (this.value!="' . $value . '") { e.preventDefault(); this.focus(); alert(\'Value is not compatible\'); }'; |
|
| 69 | + $js = 'if (this.value!="'.$value.'") { e.preventDefault(); this.focus(); alert(\'Value is not compatible\'); }'; |
|
| 70 | 70 | |
| 71 | 71 | return $js; |
| 72 | 72 | } |
@@ -25,12 +25,12 @@ |
||
| 25 | 25 | { |
| 26 | 26 | foreach ($this->elements AS $element) { |
| 27 | 27 | if (!$model->checkAttributeExists($element)) { |
| 28 | - $this->errors[] = 'Parameter ' . $element . ' not defined in class ' . get_class($model); |
|
| 28 | + $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
|
| 29 | 29 | |
| 30 | 30 | return false; |
| 31 | 31 | } |
| 32 | 32 | if (!is_numeric($model->$element)) { |
| 33 | - $this->errors[] = 'Parameter ' . $element . ' is not a numeric'; |
|
| 33 | + $this->errors[] = 'Parameter '.$element.' is not a numeric'; |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |