@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if (isset($codeTypeTag[0])) { |
76 | 76 | $start = mb_strpos($codeTypeTag[0], '['); |
77 | 77 | $end = mb_strpos($codeTypeTag[0], ']'); |
78 | - $language = mb_substr($codeTypeTag[0], $start + 1, $end - ($start + 1)); |
|
78 | + $language = mb_substr($codeTypeTag[0], $start+1, $end-($start+1)); |
|
79 | 79 | } else { |
80 | 80 | // will use php as a default language type when none is provided |
81 | 81 | $language = 'php'; |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | { |
107 | 107 | $config = ConfigProvider::getInstance(); |
108 | 108 | |
109 | - $whole_match = $matches[1]; |
|
110 | - $link_text = $this->runSpanGamut($matches[2]); |
|
111 | - $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
112 | - $title =& $matches[7]; |
|
113 | - $attr = $this->doExtraAttributes("a", $dummy =& $matches[8]); |
|
109 | + $whole_match = $matches[1]; |
|
110 | + $link_text = $this->runSpanGamut($matches[2]); |
|
111 | + $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
112 | + $title = & $matches[7]; |
|
113 | + $attr = $this->doExtraAttributes("a", $dummy = & $matches[8]); |
|
114 | 114 | |
115 | 115 | $external = false; |
116 | 116 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $result = "<a href=\"$url\""; |
133 | 133 | if (isset($title)) { |
134 | 134 | $title = $this->encodeAttribute($title); |
135 | - $result .= " title=\"$title\""; |
|
135 | + $result .= " title=\"$title\""; |
|
136 | 136 | } |
137 | 137 | if ($external) { |
138 | 138 | $result .= " target=\"$url\""; |
@@ -214,6 +214,6 @@ discard block |
||
214 | 214 | $text .= "</tbody>\n"; |
215 | 215 | $text .= "</table>"; |
216 | 216 | |
217 | - return $this->hashBlock($text) . "\n"; |
|
217 | + return $this->hashBlock($text)."\n"; |
|
218 | 218 | } |
219 | 219 | } |
@@ -379,7 +379,7 @@ |
||
379 | 379 | */ |
380 | 380 | public static function isBase64($value) |
381 | 381 | { |
382 | - return (bool) preg_match('/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/', $value); |
|
382 | + return (bool)preg_match('/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/', $value); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | 'state' => 'Account state', |
115 | 115 | 'URL' => 'Your site address', |
116 | 116 | 'rights' => 'Rights Group Membership', |
117 | - 'actions' => 'Actions', ); |
|
117 | + 'actions' => 'Actions',); |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * The name of the database table for the class. |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $this->password->isPassword(true); |
179 | 179 | $this->state = new Enum(array( |
180 | 180 | 'Active', |
181 | - 'Disabled', )); |
|
181 | + 'Disabled',)); |
|
182 | 182 | $this->state->setValue('Active'); |
183 | 183 | $this->URL = new SmallText(); |
184 | 184 | $this->URL->setRule(Validator::OPTIONAL_HTTP_URL); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | foreach ($attachments[0] as $attachmentURL) { |
155 | 155 | $start = mb_strpos($attachmentURL, '/'); |
156 | 156 | $end = mb_strrpos($attachmentURL, '"'); |
157 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
157 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
158 | 158 | |
159 | 159 | if (method_exists($this->article, 'getAttachmentSecureURL')) { |
160 | 160 | $this->content = str_replace($attachmentURL, 'href='.$this->article->getAttachmentSecureURL($fileName), $this->content); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | foreach ($attachments[0] as $attachmentURL) { |
169 | 169 | $start = mb_strpos($attachmentURL, '/'); |
170 | 170 | $end = mb_strrpos($attachmentURL, '" alt'); |
171 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
171 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
172 | 172 | |
173 | 173 | if ($config->get('cms.images.widget')) { |
174 | 174 | // get the details of the source image |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $type = 'png'; |
184 | 184 | } |
185 | 185 | |
186 | - $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean) $config->get('cms.images.widget.secure')); |
|
186 | + $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean)$config->get('cms.images.widget.secure')); |
|
187 | 187 | $this->content = str_replace($attachmentURL, $img->renderHTMLLink(), $this->content); |
188 | 188 | } else { |
189 | 189 | // render a normal image link to the ViewAttachment controller |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | public function getChildrenCenter() |
468 | 468 | { |
469 | 469 | $node = $this->getChildAt(0); |
470 | - $node1 = $this->getChildAt(count($this->children) - 1); |
|
470 | + $node1 = $this->getChildAt(count($this->children)-1); |
|
471 | 471 | |
472 | - return $node->getOffset() + (($node1->getOffset() - $node->getOffset()) + $node1->getWidth()) / 2; |
|
472 | + return $node->getOffset()+(($node1->getOffset()-$node->getOffset())+$node1->getWidth())/2; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | /** |
@@ -521,14 +521,14 @@ discard block |
||
521 | 521 | */ |
522 | 522 | public function setUpLinks() |
523 | 523 | { |
524 | - $xa = $this->x + ($this->width / 2); |
|
525 | - $ya = $this->y + $this->height; |
|
524 | + $xa = $this->x+($this->width/2); |
|
525 | + $ya = $this->y+$this->height; |
|
526 | 526 | |
527 | 527 | foreach ($this->children as $child) { |
528 | - $xd = $xc = $child->getX() + ($child->getWidth() / 2); |
|
528 | + $xd = $xc = $child->getX()+($child->getWidth()/2); |
|
529 | 529 | $yd = $child->getY(); |
530 | 530 | $xb = $xa; |
531 | - $yb = $yc = $ya + ($yd - $ya) / 2; |
|
531 | + $yb = $yc = $ya+($yd-$ya)/2; |
|
532 | 532 | $this->links[$child->id]['xa'] = $xa; |
533 | 533 | $this->links[$child->id]['ya'] = $ya; |
534 | 534 | $this->links[$child->id]['xb'] = $xb; |
@@ -509,19 +509,19 @@ discard block |
||
509 | 509 | } |
510 | 510 | // found the current job |
511 | 511 | if ($this->name == $jobs[$i]) { |
512 | - if (isset($jobs[$i - 1])) { |
|
512 | + if (isset($jobs[$i-1])) { |
|
513 | 513 | // set the previous job if it exists |
514 | - $this->previousJob = $jobs[$i - 1]; |
|
514 | + $this->previousJob = $jobs[$i-1]; |
|
515 | 515 | self::$logger->debug('Previous job ['.$this->previousJob.']'); |
516 | 516 | } |
517 | - if (isset($jobs[$i + 1])) { |
|
517 | + if (isset($jobs[$i+1])) { |
|
518 | 518 | // set the next job if it exists |
519 | - $this->nextJob = $jobs[$i + 1]; |
|
519 | + $this->nextJob = $jobs[$i+1]; |
|
520 | 520 | self::$logger->debug('Next job ['.$this->nextJob.']'); |
521 | 521 | } |
522 | 522 | } |
523 | 523 | // the last job in the sequence |
524 | - if ($i == ($numOfJobs - 1)) { |
|
524 | + if ($i == ($numOfJobs-1)) { |
|
525 | 525 | $this->lastJob = $jobs[$i]; |
526 | 526 | } |
527 | 527 | } |
@@ -685,9 +685,9 @@ discard block |
||
685 | 685 | intval($this->unitEndTime->getYear()) |
686 | 686 | ); |
687 | 687 | |
688 | - self::$logger->debug('<<getUnitDuration ['.($intEndTime - $intStartTime).']'); |
|
688 | + self::$logger->debug('<<getUnitDuration ['.($intEndTime-$intStartTime).']'); |
|
689 | 689 | |
690 | - return $intEndTime - $intStartTime; |
|
690 | + return $intEndTime-$intStartTime; |
|
691 | 691 | } |
692 | 692 | |
693 | 693 | /** |
@@ -1153,7 +1153,7 @@ discard block |
||
1153 | 1153 | */ |
1154 | 1154 | |
1155 | 1155 | // the server hostname + today's date less 1 hour (i.e. yesterday where time is < 1:00AM) |
1156 | - $var1 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($host.date('Ymd', (time() - 3600)))), '+/', '-_'), '='); |
|
1156 | + $var1 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($host.date('Ymd', (time()-3600)))), '+/', '-_'), '='); |
|
1157 | 1157 | // the server's IP plus $var1 |
1158 | 1158 | $var2 = rtrim(strtr(base64_encode(SecurityUtils::encrypt($ip.$var1)), '+/', '-_'), '='); |
1159 | 1159 |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | // work out how many columns will be in the table |
226 | 226 | $reflection = new ReflectionClass(get_class($this->record)); |
227 | 227 | $properties = array_keys($reflection->getDefaultProperties()); |
228 | - $fields['colCount'] = 1 + count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
228 | + $fields['colCount'] = 1+count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
229 | 229 | |
230 | 230 | // get the class attributes |
231 | 231 | $properties = $reflection->getProperties(); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $html .= ' <th>'.$this->record->getDataLabel($propName).'</th>'; |
247 | 247 | } |
248 | 248 | } else { |
249 | - $fields['colCount'] = $fields['colCount'] - 1; |
|
249 | + $fields['colCount'] = $fields['colCount']-1; |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | $html .= '</tr><tr>'; |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | if ($viewState->get('markdownTextBoxRows') == '') { |
1032 | 1032 | $text = new TextBox($this->record->getPropObject($name), $label, $name, 10); |
1033 | 1033 | } else { |
1034 | - $text = new TextBox($this->record->getPropObject($name), $label, $name, (integer) $viewState->get('markdownTextBoxRows')); |
|
1034 | + $text = new TextBox($this->record->getPropObject($name), $label, $name, (integer)$viewState->get('markdownTextBoxRows')); |
|
1035 | 1035 | } |
1036 | 1036 | |
1037 | 1037 | $html .= $text->render(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // work out how many columns will be in the table |
104 | 104 | $reflection = new \ReflectionClass(get_class($this->record)); |
105 | 105 | $properties = array_keys($reflection->getDefaultProperties()); |
106 | - $fields['colCount'] = 1 + count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
106 | + $fields['colCount'] = 1+count(array_diff($properties, $this->record->getDefaultAttributes(), $this->record->getTransientAttributes())); |
|
107 | 107 | |
108 | 108 | // get the class attributes |
109 | 109 | $properties = $reflection->getProperties(); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $html .= ' <th>'.$this->record->getDataLabel($propName).'</th>'; |
125 | 125 | } |
126 | 126 | } else { |
127 | - $fields['colCount'] = $fields['colCount'] - 1; |
|
127 | + $fields['colCount'] = $fields['colCount']-1; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | $html .= '</tr><tr>'; |
@@ -253,7 +253,7 @@ |
||
253 | 253 | |
254 | 254 | $html .= '<tr>'; |
255 | 255 | |
256 | - $html .= '<td>'.$file.' <em>('.number_format(filesize($this->record->getAttachmentsLocation().'/'.$file) / 1024).' KB)</em></td>'; |
|
256 | + $html .= '<td>'.$file.' <em>('.number_format(filesize($this->record->getAttachmentsLocation().'/'.$file)/1024).' KB)</em></td>'; |
|
257 | 257 | |
258 | 258 | $js = "if(window.jQuery) { |
259 | 259 | BootstrapDialog.show({ |