@@ -88,7 +88,7 @@ |
||
88 | 88 | * |
89 | 89 | * @param Alpha\Util\Http\Request $request |
90 | 90 | * |
91 | - * @return Alpha\Util\Http\Response |
|
91 | + * @return Response |
|
92 | 92 | * |
93 | 93 | * @since 1.0 |
94 | 94 | */ |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $config = ConfigProvider::getInstance(); |
200 | 200 | |
201 | 201 | // used to track when our pagination range ends |
202 | - $end = ($this->startPoint + $config->get('app.list.page.amount')); |
|
202 | + $end = ($this->startPoint+$config->get('app.list.page.amount')); |
|
203 | 203 | |
204 | 204 | $body = ''; |
205 | 205 | |
@@ -289,14 +289,14 @@ discard block |
||
289 | 289 | |
290 | 290 | $body = ''; |
291 | 291 | |
292 | - $end = ($this->startPoint + $config->get('app.list.page.amount')); |
|
292 | + $end = ($this->startPoint+$config->get('app.list.page.amount')); |
|
293 | 293 | |
294 | 294 | if ($end > $this->resultCount) { |
295 | 295 | $end = $this->resultCount; |
296 | 296 | } |
297 | 297 | |
298 | 298 | if ($this->resultCount > 0) { |
299 | - $body .= '<p align="center">Displaying '.($this->startPoint + 1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>. '; |
|
299 | + $body .= '<p align="center">Displaying '.($this->startPoint+1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>. '; |
|
300 | 300 | } else { |
301 | 301 | if (!empty($this->query)) { |
302 | 302 | $body .= View::displayUpdateMessage('There were no search results for your query.'); |
@@ -308,9 +308,9 @@ discard block |
||
308 | 308 | if ($this->startPoint > 0) { |
309 | 309 | // handle secure URLs |
310 | 310 | if (isset($params['tk'])) { |
311 | - $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint - $config->get('app.list.page.amount'))).'">«</a></li>'; |
|
311 | + $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint-$config->get('app.list.page.amount'))).'">«</a></li>'; |
|
312 | 312 | } else { |
313 | - $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint - $config->get('app.list.page.amount')).'">«</a></li>'; |
|
313 | + $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint-$config->get('app.list.page.amount')).'">«</a></li>'; |
|
314 | 314 | } |
315 | 315 | } elseif ($this->resultCount > $config->get('app.list.page.amount')) { |
316 | 316 | $body .= '<li class="disabled"><a href="#">«</a></li>'; |
@@ -336,9 +336,9 @@ discard block |
||
336 | 336 | if ($this->resultCount > $end) { |
337 | 337 | // handle secure URLs |
338 | 338 | if (isset($params['tk'])) { |
339 | - $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint + $config->get('app.list.page.amount'))).'">Next->></a></li>'; |
|
339 | + $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint+$config->get('app.list.page.amount'))).'">Next->></a></li>'; |
|
340 | 340 | } else { |
341 | - $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint + $config->get('app.list.page.amount')).'">»</a></li>'; |
|
341 | + $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/'.($this->startPoint+$config->get('app.list.page.amount')).'">»</a></li>'; |
|
342 | 342 | } |
343 | 343 | } elseif ($this->resultCount > $config->get('app.list.page.amount')) { |
344 | 344 | $body .= '<li class="disabled"><a href="#">»</a></li>'; |
@@ -1013,7 +1013,7 @@ |
||
1013 | 1013 | /** |
1014 | 1014 | * Get the current view renderer provider. |
1015 | 1015 | * |
1016 | - * @return Alpha\View\Renderer\RendererProviderInterface |
|
1016 | + * @return RendererProviderInterface |
|
1017 | 1017 | * |
1018 | 1018 | * @since 2.0 |
1019 | 1019 | */ |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | foreach ($attachments[0] as $attachmentURL) { |
157 | 157 | $start = mb_strpos($attachmentURL, '/'); |
158 | 158 | $end = mb_strrpos($attachmentURL, '"'); |
159 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
159 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
160 | 160 | |
161 | 161 | if (method_exists($this->BO, 'getAttachmentSecureURL')) { |
162 | 162 | $this->content = str_replace($attachmentURL, 'href='.$this->BO->getAttachmentSecureURL($fileName), $this->content); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | foreach ($attachments[0] as $attachmentURL) { |
171 | 171 | $start = mb_strpos($attachmentURL, '/'); |
172 | 172 | $end = mb_strrpos($attachmentURL, '" alt'); |
173 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
173 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
174 | 174 | |
175 | 175 | if ($config->get('cms.images.widget')) { |
176 | 176 | // get the details of the source image |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $type = 'png'; |
186 | 186 | } |
187 | 187 | |
188 | - $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean) $config->get('cms.images.widget.secure')); |
|
188 | + $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean)$config->get('cms.images.widget.secure')); |
|
189 | 189 | $this->content = str_replace($attachmentURL, $img->renderHTMLLink(), $this->content); |
190 | 190 | } else { |
191 | 191 | // render a normal image link to the ViewAttachment controller |
@@ -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 String(); |
184 | 184 | $this->URL->setRule(Validator::OPTIONAL_HTTP_URL); |
@@ -174,7 +174,7 @@ |
||
174 | 174 | $this->set('sequence', 0); |
175 | 175 | } |
176 | 176 | |
177 | - $this->set('sequence', $this->get('sequence') + 1); |
|
177 | + $this->set('sequence', $this->get('sequence')+1); |
|
178 | 178 | $this->save(); |
179 | 179 | } |
180 | 180 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | if (isset($codeTypeTag[0])) { |
75 | 75 | $start = mb_strpos($codeTypeTag[0], '['); |
76 | 76 | $end = mb_strpos($codeTypeTag[0], ']'); |
77 | - $language = mb_substr($codeTypeTag[0], $start + 1, $end - ($start + 1)); |
|
77 | + $language = mb_substr($codeTypeTag[0], $start+1, $end-($start+1)); |
|
78 | 78 | } else { |
79 | 79 | // will use php as a defualt language type when none is provided |
80 | 80 | $language = 'php'; |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | { |
101 | 101 | $config = ConfigProvider::getInstance(); |
102 | 102 | |
103 | - $whole_match = $matches[1]; |
|
104 | - $link_text = $this->runSpanGamut($matches[2]); |
|
105 | - $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
106 | - $title =& $matches[7]; |
|
107 | - $attr = $this->doExtraAttributes("a", $dummy =& $matches[8]); |
|
103 | + $whole_match = $matches[1]; |
|
104 | + $link_text = $this->runSpanGamut($matches[2]); |
|
105 | + $url = $matches[3] == '' ? $matches[4] : $matches[3]; |
|
106 | + $title = & $matches[7]; |
|
107 | + $attr = $this->doExtraAttributes("a", $dummy = & $matches[8]); |
|
108 | 108 | |
109 | 109 | $external = false; |
110 | 110 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $result = "<a href=\"$url\""; |
127 | 127 | if (isset($title)) { |
128 | 128 | $title = $this->encodeAttribute($title); |
129 | - $result .= " title=\"$title\""; |
|
129 | + $result .= " title=\"$title\""; |
|
130 | 130 | } |
131 | 131 | if ($external) { |
132 | 132 | $result .= " target=\"$url\""; |
@@ -205,6 +205,6 @@ discard block |
||
205 | 205 | $text .= "</tbody>\n"; |
206 | 206 | $text .= "</table>"; |
207 | 207 | |
208 | - return $this->hashBlock($text) . "\n"; |
|
208 | + return $this->hashBlock($text)."\n"; |
|
209 | 209 | } |
210 | 210 | } |
@@ -158,14 +158,15 @@ discard block |
||
158 | 158 | # Reading alignement from header underline. |
159 | 159 | $separators = preg_split('/ *[|] */', $underline); |
160 | 160 | foreach ($separators as $n => $s) { |
161 | - if (preg_match('/^ *-+: *$/', $s)) |
|
162 | - $attr[$n] = $this->_doTable_makeAlignAttr('right'); |
|
163 | - else if (preg_match('/^ *:-+: *$/', $s)) |
|
164 | - $attr[$n] = $this->_doTable_makeAlignAttr('center'); |
|
165 | - else if (preg_match('/^ *:-+ *$/', $s)) |
|
166 | - $attr[$n] = $this->_doTable_makeAlignAttr('left'); |
|
167 | - else |
|
168 | - $attr[$n] = ''; |
|
161 | + if (preg_match('/^ *-+: *$/', $s)) { |
|
162 | + $attr[$n] = $this->_doTable_makeAlignAttr('right'); |
|
163 | + } else if (preg_match('/^ *:-+: *$/', $s)) { |
|
164 | + $attr[$n] = $this->_doTable_makeAlignAttr('center'); |
|
165 | + } else if (preg_match('/^ *:-+ *$/', $s)) { |
|
166 | + $attr[$n] = $this->_doTable_makeAlignAttr('left'); |
|
167 | + } else { |
|
168 | + $attr[$n] = ''; |
|
169 | + } |
|
169 | 170 | } |
170 | 171 | |
171 | 172 | # Parsing span elements, including code spans, character escapes, |
@@ -179,8 +180,9 @@ discard block |
||
179 | 180 | $text = "<table class=\"table table-bordered\">\n"; |
180 | 181 | $text .= "<thead>\n"; |
181 | 182 | $text .= "<tr>\n"; |
182 | - foreach ($headers as $n => $header) |
|
183 | - $text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n"; |
|
183 | + foreach ($headers as $n => $header) { |
|
184 | + $text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n"; |
|
185 | + } |
|
184 | 186 | $text .= "</tr>\n"; |
185 | 187 | $text .= "</thead>\n"; |
186 | 188 | |
@@ -198,8 +200,9 @@ discard block |
||
198 | 200 | $row_cells = array_pad($row_cells, $col_count, ''); |
199 | 201 | |
200 | 202 | $text .= "<tr>\n"; |
201 | - foreach ($row_cells as $n => $cell) |
|
202 | - $text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n"; |
|
203 | + foreach ($row_cells as $n => $cell) { |
|
204 | + $text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n"; |
|
205 | + } |
|
203 | 206 | $text .= "</tr>\n"; |
204 | 207 | } |
205 | 208 | $text .= "</tbody>\n"; |