@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function addNamespace($sNamespace, $sDirectory, $sExtension = '') |
| 46 | 46 | { |
| 47 | 47 | // The 'jaxon' key cannot be overriden |
| 48 | - if($sNamespace == 'jaxon') |
|
| 48 | + if ($sNamespace == 'jaxon') |
|
| 49 | 49 | { |
| 50 | 50 | return; |
| 51 | 51 | } |
@@ -82,18 +82,18 @@ discard block |
||
| 82 | 82 | // Get the namespace name |
| 83 | 83 | $sNamespace = ''; |
| 84 | 84 | $iSeparatorPosition = strrpos($sTemplate, '::'); |
| 85 | - if($iSeparatorPosition !== false) |
|
| 85 | + if ($iSeparatorPosition !== false) |
|
| 86 | 86 | { |
| 87 | 87 | $sNamespace = substr($sTemplate, 0, $iSeparatorPosition); |
| 88 | 88 | $sTemplate = substr($sTemplate, $iSeparatorPosition + 2); |
| 89 | 89 | } |
| 90 | 90 | // The default namespace is 'jaxon' |
| 91 | - if(!($sNamespace = trim($sNamespace))) |
|
| 91 | + if (!($sNamespace = trim($sNamespace))) |
|
| 92 | 92 | { |
| 93 | 93 | $sNamespace = 'jaxon'; |
| 94 | 94 | } |
| 95 | 95 | // Check if the namespace is defined |
| 96 | - if(!key_exists($sNamespace, $this->aNamespaces)) |
|
| 96 | + if (!key_exists($sNamespace, $this->aNamespaces)) |
|
| 97 | 97 | { |
| 98 | 98 | return false; |
| 99 | 99 | } |
@@ -265,8 +265,7 @@ discard block |
||
| 265 | 265 | { |
| 266 | 266 | $pages[] = $this->createPage($i, $i == $this->currentPage); |
| 267 | 267 | } |
| 268 | - } |
|
| 269 | - else |
|
| 268 | + } else |
|
| 270 | 269 | { |
| 271 | 270 | // Determine the sliding range, centered around the current page. |
| 272 | 271 | $numAdjacents = (int) floor(($this->maxPagesToShow - 3) / 2); |
@@ -274,8 +273,7 @@ discard block |
||
| 274 | 273 | if($this->currentPage + $numAdjacents > $this->numPages) |
| 275 | 274 | { |
| 276 | 275 | $slidingStart = $this->numPages - $this->maxPagesToShow + 2; |
| 277 | - } |
|
| 278 | - else |
|
| 276 | + } else |
|
| 279 | 277 | { |
| 280 | 278 | $slidingStart = $this->currentPage - $numAdjacents; |
| 281 | 279 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | protected function updateNumPages() |
| 67 | 67 | { |
| 68 | - $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int) ceil($this->totalItems/$this->itemsPerPage)); |
|
| 68 | + $this->numPages = ($this->itemsPerPage == 0 ? 0 : (int)ceil($this->totalItems / $this->itemsPerPage)); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function setMaxPagesToShow($maxPagesToShow) |
| 76 | 76 | { |
| 77 | - if($maxPagesToShow < 3) |
|
| 77 | + if ($maxPagesToShow < 3) |
|
| 78 | 78 | { |
| 79 | 79 | throw new \InvalidArgumentException('maxPagesToShow cannot be less than 3.'); |
| 80 | 80 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $this->request = $request; |
| 156 | 156 | // Append the page number to the parameter list, if not yet given. |
| 157 | - if(($this->request) && !$this->request->hasPageNumber()) |
|
| 157 | + if (($this->request) && !$this->request->hasPageNumber()) |
|
| 158 | 158 | { |
| 159 | 159 | $this->request->addParameter(Jaxon::PAGE_NUMBER, 0); |
| 160 | 160 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | public function getNextPage() |
| 195 | 195 | { |
| 196 | - if($this->currentPage < $this->numPages) |
|
| 196 | + if ($this->currentPage < $this->numPages) |
|
| 197 | 197 | { |
| 198 | 198 | return $this->currentPage + 1; |
| 199 | 199 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | public function getPrevPage() |
| 205 | 205 | { |
| 206 | - if($this->currentPage > 1) |
|
| 206 | + if ($this->currentPage > 1) |
|
| 207 | 207 | { |
| 208 | 208 | return $this->currentPage - 1; |
| 209 | 209 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | public function getNextCall() |
| 215 | 215 | { |
| 216 | - if(!$this->getNextPage()) |
|
| 216 | + if (!$this->getNextPage()) |
|
| 217 | 217 | { |
| 218 | 218 | return null; |
| 219 | 219 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function getPrevCall() |
| 228 | 228 | { |
| 229 | - if(!$this->getPrevPage()) |
|
| 229 | + if (!$this->getPrevPage()) |
|
| 230 | 230 | { |
| 231 | 231 | return null; |
| 232 | 232 | } |
@@ -254,14 +254,14 @@ discard block |
||
| 254 | 254 | { |
| 255 | 255 | $pages = []; |
| 256 | 256 | |
| 257 | - if($this->numPages <= 1) |
|
| 257 | + if ($this->numPages <= 1) |
|
| 258 | 258 | { |
| 259 | 259 | return []; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - if($this->numPages <= $this->maxPagesToShow) |
|
| 262 | + if ($this->numPages <= $this->maxPagesToShow) |
|
| 263 | 263 | { |
| 264 | - for($i = 1; $i <= $this->numPages; $i++) |
|
| 264 | + for ($i = 1; $i <= $this->numPages; $i++) |
|
| 265 | 265 | { |
| 266 | 266 | $pages[] = $this->createPage($i, $i == $this->currentPage); |
| 267 | 267 | } |
@@ -269,9 +269,9 @@ discard block |
||
| 269 | 269 | else |
| 270 | 270 | { |
| 271 | 271 | // Determine the sliding range, centered around the current page. |
| 272 | - $numAdjacents = (int) floor(($this->maxPagesToShow - 3) / 2); |
|
| 272 | + $numAdjacents = (int)floor(($this->maxPagesToShow - 3) / 2); |
|
| 273 | 273 | |
| 274 | - if($this->currentPage + $numAdjacents > $this->numPages) |
|
| 274 | + if ($this->currentPage + $numAdjacents > $this->numPages) |
|
| 275 | 275 | { |
| 276 | 276 | $slidingStart = $this->numPages - $this->maxPagesToShow + 2; |
| 277 | 277 | } |
@@ -279,28 +279,28 @@ discard block |
||
| 279 | 279 | { |
| 280 | 280 | $slidingStart = $this->currentPage - $numAdjacents; |
| 281 | 281 | } |
| 282 | - if($slidingStart < 2) |
|
| 282 | + if ($slidingStart < 2) |
|
| 283 | 283 | { |
| 284 | 284 | $slidingStart = 2; |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | $slidingEnd = $slidingStart + $this->maxPagesToShow - 3; |
| 288 | - if($slidingEnd >= $this->numPages) |
|
| 288 | + if ($slidingEnd >= $this->numPages) |
|
| 289 | 289 | { |
| 290 | 290 | $slidingEnd = $this->numPages - 1; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | // Build the list of pages. |
| 294 | 294 | $pages[] = $this->createPage(1, $this->currentPage == 1); |
| 295 | - if($slidingStart > 2) |
|
| 295 | + if ($slidingStart > 2) |
|
| 296 | 296 | { |
| 297 | 297 | $pages[] = $this->createPageEllipsis(); |
| 298 | 298 | } |
| 299 | - for($i = $slidingStart; $i <= $slidingEnd; $i++) |
|
| 299 | + for ($i = $slidingStart; $i <= $slidingEnd; $i++) |
|
| 300 | 300 | { |
| 301 | 301 | $pages[] = $this->createPage($i, $i == $this->currentPage); |
| 302 | 302 | } |
| 303 | - if($slidingEnd < $this->numPages - 1) |
|
| 303 | + if ($slidingEnd < $this->numPages - 1) |
|
| 304 | 304 | { |
| 305 | 305 | $pages[] = $this->createPageEllipsis(); |
| 306 | 306 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | public function toHtml() |
| 348 | 348 | { |
| 349 | - if($this->getNumPages() <= 1) |
|
| 349 | + if ($this->getNumPages() <= 1) |
|
| 350 | 350 | { |
| 351 | 351 | return ''; |
| 352 | 352 | } |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | { |
| 370 | 370 | $first = ($this->currentPage - 1) * $this->itemsPerPage + 1; |
| 371 | 371 | |
| 372 | - if($first > $this->totalItems) |
|
| 372 | + if ($first > $this->totalItems) |
|
| 373 | 373 | { |
| 374 | 374 | return null; |
| 375 | 375 | } |
@@ -380,13 +380,13 @@ discard block |
||
| 380 | 380 | public function getCurrentPageLastItem() |
| 381 | 381 | { |
| 382 | 382 | $first = $this->getCurrentPageFirstItem(); |
| 383 | - if($first === null) |
|
| 383 | + if ($first === null) |
|
| 384 | 384 | { |
| 385 | 385 | return null; |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | $last = $first + $this->itemsPerPage - 1; |
| 389 | - if($last > $this->totalItems) |
|
| 389 | + if ($last > $this->totalItems) |
|
| 390 | 390 | { |
| 391 | 391 | return $this->totalItems; |
| 392 | 392 | } |
@@ -80,11 +80,11 @@ |
||
| 80 | 80 | protected function includeAssets() |
| 81 | 81 | { |
| 82 | 82 | $sPluginOptionName = 'assets.include.' . $this->getName(); |
| 83 | - if($this->hasOption($sPluginOptionName) && !$this->getOption($sPluginOptionName)) |
|
| 83 | + if ($this->hasOption($sPluginOptionName) && !$this->getOption($sPluginOptionName)) |
|
| 84 | 84 | { |
| 85 | 85 | return false; |
| 86 | 86 | } |
| 87 | - if($this->hasOption('assets.include.all') && !$this->getOption('assets.include.all')) |
|
| 87 | + if ($this->hasOption('assets.include.all') && !$this->getOption('assets.include.all')) |
|
| 88 | 88 | { |
| 89 | 89 | return false; |
| 90 | 90 | } |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <ul class="pagination"> |
| 2 | 2 | <?php |
| 3 | - if(($this->prev)) |
|
| 3 | + if (($this->prev)) |
|
| 4 | 4 | { |
| 5 | 5 | echo $this->prev; |
| 6 | 6 | } |
| 7 | 7 | echo $this->links; |
| 8 | - if(($this->next)) |
|
| 8 | + if (($this->next)) |
|
| 9 | 9 | { |
| 10 | 10 | echo $this->next; |
| 11 | 11 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php echo $this->sPrefix ?><?php echo $this->sAlias ?> = function() { |
| 2 | 2 | return jaxon.request( |
| 3 | 3 | { jxnfun: '<?php echo $this->sFunction ?>' }, |
| 4 | - { parameters: arguments<?php foreach($this->aConfig as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> } |
|
| 4 | + { parameters: arguments<?php foreach ($this->aConfig as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> } |
|
| 5 | 5 | ); |
| 6 | 6 | }; |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php echo $this->sPrefix ?><?php echo $this->sClass ?> = {}; |
| 2 | -<?php foreach($this->aMethods as $aMethod): ?> |
|
| 2 | +<?php foreach ($this->aMethods as $aMethod): ?> |
|
| 3 | 3 | <?php echo $this->sPrefix ?><?php echo $this->sClass ?>.<?php echo $aMethod['name'] ?> = function() { |
| 4 | 4 | return jaxon.request( |
| 5 | 5 | { jxncls: '<?php echo $this->sClass ?>', jxnmthd: '<?php echo $aMethod['name'] ?>' }, |
| 6 | - { parameters: arguments<?php foreach($aMethod['config'] as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> } |
|
| 6 | + { parameters: arguments<?php foreach ($aMethod['config'] as $sKey => $sValue): ?>, <?php echo $sKey ?>: <?php echo $sValue ?><?php endforeach ?> } |
|
| 7 | 7 | ); |
| 8 | 8 | }; |
| 9 | 9 | <?php endforeach ?> |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php echo $this->sPrefix ?><?php echo $this->sEvent ?> = function() { |
| 2 | 2 | return jaxon.request( |
| 3 | 3 | { jxnevt: '<?php echo $this->sEvent ?>' }, |
| 4 | - { parameters: arguments<?php if(($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if(($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> } |
|
| 4 | + { parameters: arguments<?php if (($this->sMode)): ?>, mode: '<?php echo $this->sMode ?>'<?php endif ?><?php if (($this->sMethod)): ?>, method: '<?php echo $this->sMethod ?>'<?php endif ?> } |
|
| 5 | 5 | ); |
| 6 | 6 | }; |
@@ -1,3 +1,3 @@ |
||
| 1 | -<?php foreach($this->aUrls as $sUrl): ?> |
|
| 1 | +<?php foreach ($this->aUrls as $sUrl): ?> |
|
| 2 | 2 | <script type="text/javascript" src="<?php echo $sUrl ?>" <?php echo $this->sJsOptions ?> charset="UTF-8"></script> |
| 3 | 3 | <?php endforeach ?> |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | jaxon.dom.ready(function() { |
| 2 | 2 | jaxon.command.handler.register('cc', jaxon.confirm.commands); |
| 3 | 3 | |
| 4 | -<?php if($this->sPluginScript): ?> |
|
| 4 | +<?php if ($this->sPluginScript): ?> |
|
| 5 | 5 | <?php echo $this->sPluginScript ?> |
| 6 | 6 | <?php endif ?> |
| 7 | 7 | }); |