@@ -96,7 +96,7 @@ discard block  | 
                                                    ||
| 96 | 96 | *  | 
                                                        
| 97 | 97 | * @param alpha\Util\Http\Request $request  | 
                                                        
| 98 | 98 | *  | 
                                                        
| 99 | - * @return alpha\Util\Http\Response  | 
                                                        |
| 99 | + * @return Response  | 
                                                        |
| 100 | 100 | *  | 
                                                        
| 101 | 101 | * @since 1.0  | 
                                                        
| 102 | 102 | */  | 
                                                        
@@ -120,7 +120,7 @@ discard block  | 
                                                    ||
| 120 | 120 | *  | 
                                                        
| 121 | 121 | * @param alpha\Util\Http\Request $request  | 
                                                        
| 122 | 122 | *  | 
                                                        
| 123 | - * @return alpha\Util\Http\Response  | 
                                                        |
| 123 | + * @return Response  | 
                                                        |
| 124 | 124 | *  | 
                                                        
| 125 | 125 | * @since 1.0  | 
                                                        
| 126 | 126 | */  | 
                                                        
@@ -444,11 +444,11 @@ discard block  | 
                                                    ||
| 444 | 444 | |
| 445 | 445 | // ensure that the last index never overruns the total record count  | 
                                                        
| 446 | 446 |          if ($last > $recordCount) { | 
                                                        
| 447 | - $last = $recordCount ;  | 
                                                        |
| 447 | + $last = $recordCount;  | 
                                                        |
| 448 | 448 | }  | 
                                                        
| 449 | 449 | |
| 450 | 450 | // render a message for an empty list  | 
                                                        
| 451 | -        if ($recordCount  > 0) { | 
                                                        |
| 451 | +        if ($recordCount > 0) { | 
                                                        |
| 452 | 452 | $html .= '<ul class="pagination">';  | 
                                                        
| 453 | 453 |          } else { | 
                                                        
| 454 | 454 | $html .= '<p align="center">The list is empty.  </p>';  | 
                                                        
@@ -457,7 +457,7 @@ discard block  | 
                                                    ||
| 457 | 457 | }  | 
                                                        
| 458 | 458 | |
| 459 | 459 | // render "Previous" link  | 
                                                        
| 460 | -        if ($start  > 0) { | 
                                                        |
| 460 | +        if ($start > 0) { | 
                                                        |
| 461 | 461 | // handle secure URLs  | 
                                                        
| 462 | 462 |              if ($controller->getRequest()->getParam('token', null) != null) { | 
                                                        
| 463 | 463 |                  $url = FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$controller->getRequest()->getParam('ActiveRecordType').'&start='.($start-$controller->getLimit()).'&limit='.$limit); | 
                                                        
@@ -465,15 +465,15 @@ discard block  | 
                                                    ||
| 465 | 465 |                  $url = '/records/'.urlencode($controller->getRequest()->getParam('ActiveRecordType')).'/'.($start-$limit).'/'.$limit; | 
                                                        
| 466 | 466 | }  | 
                                                        
| 467 | 467 | $html .= '<li><a href="'.$url.'"><<-Previous</a></li>';  | 
                                                        
| 468 | -        } elseif ($recordCount  > $limit) { | 
                                                        |
| 468 | +        } elseif ($recordCount > $limit) { | 
                                                        |
| 469 | 469 | $html .= '<li class="disabled"><a href="#"><<-Previous</a></li>';  | 
                                                        
| 470 | 470 | }  | 
                                                        
| 471 | 471 | |
| 472 | 472 | // render the page index links  | 
                                                        
| 473 | -        if ($recordCount  > $limit) { | 
                                                        |
| 473 | +        if ($recordCount > $limit) { | 
                                                        |
| 474 | 474 | $page = 1;  | 
                                                        
| 475 | 475 | |
| 476 | -            for ($i = 0; $i < $recordCount ; $i += $limit) { | 
                                                        |
| 476 | +            for ($i = 0; $i < $recordCount; $i += $limit) { | 
                                                        |
| 477 | 477 |                  if ($i != $start) { | 
                                                        
| 478 | 478 | // handle secure URLs  | 
                                                        
| 479 | 479 |                      if ($controller->getRequest()->getParam('token', null) != null) { | 
                                                        
@@ -482,7 +482,7 @@ discard block  | 
                                                    ||
| 482 | 482 |                          $url = '/records/'.urlencode($controller->getRequest()->getParam('ActiveRecordType')).'/'.$i.'/'.$limit; | 
                                                        
| 483 | 483 | }  | 
                                                        
| 484 | 484 | $html .= '<li><a href="'.$url.'">'.$page.'</a></li>';  | 
                                                        
| 485 | -                } elseif ($recordCount  > $limit) { // render an anchor for the current page | 
                                                        |
| 485 | +                } elseif ($recordCount > $limit) { // render an anchor for the current page | 
                                                        |
| 486 | 486 | $html .= '<li class="active"><a href="#">'.$page.'</a></li>';  | 
                                                        
| 487 | 487 | }  | 
                                                        
| 488 | 488 | |
@@ -491,7 +491,7 @@ discard block  | 
                                                    ||
| 491 | 491 | }  | 
                                                        
| 492 | 492 | |
| 493 | 493 | // render "Next" link  | 
                                                        
| 494 | -        if ($recordCount  > $last) { | 
                                                        |
| 494 | +        if ($recordCount > $last) { | 
                                                        |
| 495 | 495 | // handle secure URLs  | 
                                                        
| 496 | 496 |              if ($controller->getRequest()->getParam('token', null) != null) { | 
                                                        
| 497 | 497 |                  $url = FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$controller->getRequest()->getParam('ActiveRecordType').'&start='.($start+$limit).'&limit='.$limit); | 
                                                        
@@ -499,7 +499,7 @@ discard block  | 
                                                    ||
| 499 | 499 |                  $url = '/records/'.urlencode($controller->getRequest()->getParam('ActiveRecordType')).'/'.($start+$limit.'/'.$limit); | 
                                                        
| 500 | 500 | }  | 
                                                        
| 501 | 501 | $html .= '<li><a href="'.$url.'">Next->></a></li>';  | 
                                                        
| 502 | -        } elseif ($recordCount  > $limit) { | 
                                                        |
| 502 | +        } elseif ($recordCount > $limit) { | 
                                                        |
| 503 | 503 | $html .= '<li class="disabled"><a href="#">Next->></a></li>';  | 
                                                        
| 504 | 504 | }  | 
                                                        
| 505 | 505 | |
@@ -174,145 +174,145 @@ discard block  | 
                                                    ||
| 174 | 174 |              throw new BadRequestException('Request character encoding does not match expected UTF-8'); | 
                                                        
| 175 | 175 | }  | 
                                                        
| 176 | 176 | |
| 177 | -        $this->addRoute('/', function ($request) { | 
                                                        |
| 177 | +        $this->addRoute('/', function($request) { | 
                                                        |
| 178 | 178 | $controller = new IndexController();  | 
                                                        
| 179 | 179 | |
| 180 | 180 | return $controller->process($request);  | 
                                                        
| 181 | 181 | });  | 
                                                        
| 182 | 182 | |
| 183 | -        $this->addRoute('/a/{title}/{view}', function ($request) { | 
                                                        |
| 183 | +        $this->addRoute('/a/{title}/{view}', function($request) { | 
                                                        |
| 184 | 184 | $controller = new ArticleController();  | 
                                                        
| 185 | 185 | |
| 186 | 186 | return $controller->process($request);  | 
                                                        
| 187 | 187 |          })->value('title', null)->value('view', 'detailed'); | 
                                                        
| 188 | 188 | |
| 189 | -        $this->addRoute('/articles/{start}/{limit}', function ($request) { | 
                                                        |
| 189 | +        $this->addRoute('/articles/{start}/{limit}', function($request) { | 
                                                        |
| 190 | 190 | $controller = new ArticleController();  | 
                                                        
| 191 | 191 | |
| 192 | 192 | return $controller->process($request);  | 
                                                        
| 193 | 193 |          })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); | 
                                                        
| 194 | 194 | |
| 195 | -        $this->addRoute('/attach/{articleID}/{filename}', function ($request) { | 
                                                        |
| 195 | +        $this->addRoute('/attach/{articleID}/{filename}', function($request) { | 
                                                        |
| 196 | 196 | $controller = new AttachmentController();  | 
                                                        
| 197 | 197 | |
| 198 | 198 | return $controller->process($request);  | 
                                                        
| 199 | 199 |          })->value('filename', null); | 
                                                        
| 200 | 200 | |
| 201 | -        $this->addRoute('/cache', function ($request) { | 
                                                        |
| 201 | +        $this->addRoute('/cache', function($request) { | 
                                                        |
| 202 | 202 | $controller = new CacheController();  | 
                                                        
| 203 | 203 | |
| 204 | 204 | return $controller->process($request);  | 
                                                        
| 205 | 205 | });  | 
                                                        
| 206 | 206 | |
| 207 | -        $this->addRoute('/denum/{denumID}', function ($request) { | 
                                                        |
| 207 | +        $this->addRoute('/denum/{denumID}', function($request) { | 
                                                        |
| 208 | 208 | $controller = new DEnumController();  | 
                                                        
| 209 | 209 | |
| 210 | 210 | return $controller->process($request);  | 
                                                        
| 211 | 211 |          })->value('denumID', null); | 
                                                        
| 212 | 212 | |
| 213 | -        $this->addRoute('/excel/{ActiveRecordType}/{ActiveRecordID}', function ($request) { | 
                                                        |
| 213 | +        $this->addRoute('/excel/{ActiveRecordType}/{ActiveRecordID}', function($request) { | 
                                                        |
| 214 | 214 | $controller = new ExcelController();  | 
                                                        
| 215 | 215 | |
| 216 | 216 | return $controller->process($request);  | 
                                                        
| 217 | 217 |          })->value('ActiveRecordID', null); | 
                                                        
| 218 | 218 | |
| 219 | -        $this->addRoute('/feed/{ActiveRecordType}/{type}', function ($request) { | 
                                                        |
| 219 | +        $this->addRoute('/feed/{ActiveRecordType}/{type}', function($request) { | 
                                                        |
| 220 | 220 | $controller = new FeedController();  | 
                                                        
| 221 | 221 | |
| 222 | 222 | return $controller->process($request);  | 
                                                        
| 223 | 223 |          })->value('type', 'Atom'); | 
                                                        
| 224 | 224 | |
| 225 | -        $this->addRoute('/gensecure', function ($request) { | 
                                                        |
| 225 | +        $this->addRoute('/gensecure', function($request) { | 
                                                        |
| 226 | 226 | $controller = new GenSecureQueryStringController();  | 
                                                        
| 227 | 227 | |
| 228 | 228 | return $controller->process($request);  | 
                                                        
| 229 | 229 | });  | 
                                                        
| 230 | 230 | |
| 231 | -        $this->addRoute('/image/{source}/{width}/{height}/{type}/{quality}/{scale}/{secure}/{var1}/{var2}', function ($request) { | 
                                                        |
| 231 | +        $this->addRoute('/image/{source}/{width}/{height}/{type}/{quality}/{scale}/{secure}/{var1}/{var2}', function($request) { | 
                                                        |
| 232 | 232 | $controller = new ImageController();  | 
                                                        
| 233 | 233 | |
| 234 | 234 | return $controller->process($request);  | 
                                                        
| 235 | 235 |          })->value('var1', null)->value('var2', null); | 
                                                        
| 236 | 236 | |
| 237 | -        $this->addRoute('/listactiverecords', function ($request) { | 
                                                        |
| 237 | +        $this->addRoute('/listactiverecords', function($request) { | 
                                                        |
| 238 | 238 | $controller = new ListActiveRecordsController();  | 
                                                        
| 239 | 239 | |
| 240 | 240 | return $controller->process($request);  | 
                                                        
| 241 | 241 | });  | 
                                                        
| 242 | 242 | |
| 243 | -        $this->addRoute('/log/{logPath}', function ($request) { | 
                                                        |
| 243 | +        $this->addRoute('/log/{logPath}', function($request) { | 
                                                        |
| 244 | 244 | $controller = new LogController();  | 
                                                        
| 245 | 245 | |
| 246 | 246 | return $controller->process($request);  | 
                                                        
| 247 | 247 | });  | 
                                                        
| 248 | 248 | |
| 249 | -        $this->addRoute('/login', function ($request) { | 
                                                        |
| 249 | +        $this->addRoute('/login', function($request) { | 
                                                        |
| 250 | 250 | $controller = new LoginController();  | 
                                                        
| 251 | 251 | |
| 252 | 252 | return $controller->process($request);  | 
                                                        
| 253 | 253 | });  | 
                                                        
| 254 | 254 | |
| 255 | -        $this->addRoute('/logout', function ($request) { | 
                                                        |
| 255 | +        $this->addRoute('/logout', function($request) { | 
                                                        |
| 256 | 256 | $controller = new LogoutController();  | 
                                                        
| 257 | 257 | |
| 258 | 258 | return $controller->process($request);  | 
                                                        
| 259 | 259 | });  | 
                                                        
| 260 | 260 | |
| 261 | -        $this->addRoute('/metric', function ($request) { | 
                                                        |
| 261 | +        $this->addRoute('/metric', function($request) { | 
                                                        |
| 262 | 262 | $controller = new MetricController();  | 
                                                        
| 263 | 263 | |
| 264 | 264 | return $controller->process($request);  | 
                                                        
| 265 | 265 | });  | 
                                                        
| 266 | 266 | |
| 267 | -        $this->addRoute('/recordselector/12m/{ActiveRecordID}/{field}/{relatedClass}/{relatedClassField}/{relatedClassDisplayField}/{relationType}', function ($request) { | 
                                                        |
| 267 | +        $this->addRoute('/recordselector/12m/{ActiveRecordID}/{field}/{relatedClass}/{relatedClassField}/{relatedClassDisplayField}/{relationType}', function($request) { | 
                                                        |
| 268 | 268 | $controller = new RecordSelectorController();  | 
                                                        
| 269 | 269 | |
| 270 | 270 | return $controller->process($request);  | 
                                                        
| 271 | 271 |          })->value('relationType', 'ONE-TO-MANY'); | 
                                                        
| 272 | 272 | |
| 273 | -        $this->addRoute('/recordselector/m2m/{ActiveRecordID}/{field}/{relatedClassLeft}/{relatedClassLeftDisplayField}/{relatedClassRight}/{relatedClassRightDisplayField}/{accessingClassName}/{lookupIDs}/{relationType}', function ($request) { | 
                                                        |
| 273 | +        $this->addRoute('/recordselector/m2m/{ActiveRecordID}/{field}/{relatedClassLeft}/{relatedClassLeftDisplayField}/{relatedClassRight}/{relatedClassRightDisplayField}/{accessingClassName}/{lookupIDs}/{relationType}', function($request) { | 
                                                        |
| 274 | 274 | $controller = new RecordSelectorController();  | 
                                                        
| 275 | 275 | |
| 276 | 276 | return $controller->process($request);  | 
                                                        
| 277 | 277 |          })->value('relationType', 'MANY-TO-MANY'); | 
                                                        
| 278 | 278 | |
| 279 | -        $this->addRoute('/search/{query}/{start}/{limit}', function ($request) { | 
                                                        |
| 279 | +        $this->addRoute('/search/{query}/{start}/{limit}', function($request) { | 
                                                        |
| 280 | 280 | $controller = new SearchController();  | 
                                                        
| 281 | 281 | |
| 282 | 282 | return $controller->process($request);  | 
                                                        
| 283 | 283 |          })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); | 
                                                        
| 284 | 284 | |
| 285 | -        $this->addRoute('/sequence/{start}/{limit}', function ($request) { | 
                                                        |
| 285 | +        $this->addRoute('/sequence/{start}/{limit}', function($request) { | 
                                                        |
| 286 | 286 | $controller = new SequenceController();  | 
                                                        
| 287 | 287 | |
| 288 | 288 | return $controller->process($request);  | 
                                                        
| 289 | 289 |          })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); | 
                                                        
| 290 | 290 | |
| 291 | -        $this->addRoute('/tag/{ActiveRecordType}/{ActiveRecordID}', function ($request) { | 
                                                        |
| 291 | +        $this->addRoute('/tag/{ActiveRecordType}/{ActiveRecordID}', function($request) { | 
                                                        |
| 292 | 292 | $controller = new TagController();  | 
                                                        
| 293 | 293 | |
| 294 | 294 | return $controller->process($request);  | 
                                                        
| 295 | 295 | });  | 
                                                        
| 296 | 296 | |
| 297 | -        $this->addRoute('/install', function ($request) { | 
                                                        |
| 297 | +        $this->addRoute('/install', function($request) { | 
                                                        |
| 298 | 298 | $controller = new InstallController();  | 
                                                        
| 299 | 299 | |
| 300 | 300 | return $controller->process($request);  | 
                                                        
| 301 | 301 | });  | 
                                                        
| 302 | 302 | |
| 303 | -        $this->addRoute('/record/{ActiveRecordType}/{ActiveRecordID}/{view}', function ($request) { | 
                                                        |
| 303 | +        $this->addRoute('/record/{ActiveRecordType}/{ActiveRecordID}/{view}', function($request) { | 
                                                        |
| 304 | 304 | $controller = new ActiveRecordController();  | 
                                                        
| 305 | 305 | |
| 306 | 306 | return $controller->process($request);  | 
                                                        
| 307 | 307 |          })->value('ActiveRecordID', null)->value('view', 'detailed'); | 
                                                        
| 308 | 308 | |
| 309 | -        $this->addRoute('/records/{ActiveRecordType}/{start}/{limit}', function ($request) { | 
                                                        |
| 309 | +        $this->addRoute('/records/{ActiveRecordType}/{start}/{limit}', function($request) { | 
                                                        |
| 310 | 310 | $controller = new ActiveRecordController();  | 
                                                        
| 311 | 311 | |
| 312 | 312 | return $controller->process($request);  | 
                                                        
| 313 | 313 |          })->value('start', 0)->value('limit', $config->get('app.list.page.amount')); | 
                                                        
| 314 | 314 | |
| 315 | -        $this->addRoute('/tk/{token}', function ($request) { | 
                                                        |
| 315 | +        $this->addRoute('/tk/{token}', function($request) { | 
                                                        |
| 316 | 316 |              $params = self::getDecodeQueryParams($request->getParam('token')); | 
                                                        
| 317 | 317 | |
| 318 | 318 |              if (isset($params['act'])) { | 
                                                        
@@ -339,14 +339,14 @@ discard block  | 
                                                    ||
| 339 | 339 | return new Response(404, 'Resource not found');  | 
                                                        
| 340 | 340 | });  | 
                                                        
| 341 | 341 | |
| 342 | -        $this->addRoute('/alpha/service', function ($request) { | 
                                                        |
| 342 | +        $this->addRoute('/alpha/service', function($request) { | 
                                                        |
| 343 | 343 | $controller = new LoginController();  | 
                                                        
| 344 | 344 |              $controller->setUnitOfWork(array('Alpha\Controller\LoginController', 'Alpha\Controller\ListActiveRecordsController')); | 
                                                        
| 345 | 345 | |
| 346 | 346 | return $controller->process($request);  | 
                                                        
| 347 | 347 | });  | 
                                                        
| 348 | 348 | |
| 349 | -        $this->addRoute('/phpinfo', function ($request) { | 
                                                        |
| 349 | +        $this->addRoute('/phpinfo', function($request) { | 
                                                        |
| 350 | 350 | $controller = new PhpinfoController();  | 
                                                        
| 351 | 351 | |
| 352 | 352 | return $controller->process($request);  | 
                                                        
@@ -10,15 +10,11 @@  | 
                                                    ||
| 10 | 10 | use Alpha\Util\Http\Request;  | 
                                                        
| 11 | 11 | use Alpha\Util\Http\Response;  | 
                                                        
| 12 | 12 | use Alpha\Util\Service\ServiceFactory;  | 
                                                        
| 13 | -use Alpha\Util\File\FileUtils;  | 
                                                        |
| 14 | 13 | use Alpha\Model\Article;  | 
                                                        
| 15 | 14 | use Alpha\Model\ArticleComment;  | 
                                                        
| 16 | 15 | use Alpha\Model\Type\Relation;  | 
                                                        
| 17 | 16 | use Alpha\View\View;  | 
                                                        
| 18 | -use Alpha\View\ViewState;  | 
                                                        |
| 19 | 17 | use Alpha\View\Widget\Button;  | 
                                                        
| 20 | -use Alpha\Exception\SecurityException;  | 
                                                        |
| 21 | -use Alpha\Exception\AlphaException;  | 
                                                        |
| 22 | 18 | use Alpha\Exception\RecordNotFoundException;  | 
                                                        
| 23 | 19 | use Alpha\Exception\IllegalArguementException;  | 
                                                        
| 24 | 20 | use Alpha\Exception\ResourceNotFoundException;  | 
                                                        
@@ -7,7 +7,6 @@  | 
                                                    ||
| 7 | 7 | use Alpha\Util\Extension\Markdown;  | 
                                                        
| 8 | 8 | use Alpha\Util\Service\ServiceFactory;  | 
                                                        
| 9 | 9 | use Alpha\View\Widget\Image;  | 
                                                        
| 10 | -use Alpha\Exception\AlphaException;  | 
                                                        |
| 11 | 10 | |
| 12 | 11 | /**  | 
                                                        
| 13 | 12 | * A facade class for the TCPDF library which is used to convert some HTML content provided by the  | 
                                                        
@@ -5,7 +5,6 @@  | 
                                                    ||
| 5 | 5 | use Alpha\Util\Config\ConfigProvider;  | 
                                                        
| 6 | 6 | use Alpha\Util\Service\ServiceFactory;  | 
                                                        
| 7 | 7 | use Alpha\View\Widget\Image;  | 
                                                        
| 8 | -use Alpha\Exception\AlphaException;  | 
                                                        |
| 9 | 8 | |
| 10 | 9 | /**  | 
                                                        
| 11 | 10 | * A facade class for the Markdown library.  | 
                                                        
@@ -3,12 +3,10 @@  | 
                                                    ||
| 3 | 3 | namespace Alpha\Model;  | 
                                                        
| 4 | 4 | |
| 5 | 5 | use Alpha\Model\Type\SmallText;  | 
                                                        
| 6 | -use Alpha\Model\Type\DEnum;  | 
                                                        |
| 7 | 6 | use Alpha\Model\Type\Text;  | 
                                                        
| 8 | 7 | use Alpha\Model\Type\LargeText;  | 
                                                        
| 9 | 8 | use Alpha\Model\Type\Boolean;  | 
                                                        
| 10 | 9 | use Alpha\Model\Type\Relation;  | 
                                                        
| 11 | -use Alpha\Util\Config\Configprovider;  | 
                                                        |
| 12 | 10 | use Alpha\Util\Logging\Logger;  | 
                                                        
| 13 | 11 | use Alpha\Util\Service\ServiceFactory;  | 
                                                        
| 14 | 12 | use Alpha\Exception\ValidationException;  | 
                                                        
@@ -2,9 +2,6 @@  | 
                                                    ||
| 2 | 2 | |
| 3 | 3 | namespace Alpha\Model\Type;  | 
                                                        
| 4 | 4 | |
| 5 | -use Alpha\Util\Helper\Validator;  | 
                                                        |
| 6 | -use Alpha\Exception\IllegalArguementException;  | 
                                                        |
| 7 | -  | 
                                                        |
| 8 | 5 | /**  | 
                                                        
| 9 | 6 | * The HugeText complex data type.  | 
                                                        
| 10 | 7 | *  | 
                                                        
@@ -2,9 +2,6 @@  | 
                                                    ||
| 2 | 2 | |
| 3 | 3 | namespace Alpha\Model\Type;  | 
                                                        
| 4 | 4 | |
| 5 | -use Alpha\Util\Helper\Validator;  | 
                                                        |
| 6 | -use Alpha\Exception\IllegalArguementException;  | 
                                                        |
| 7 | -  | 
                                                        |
| 8 | 5 | /**  | 
                                                        
| 9 | 6 | * The LargeText complex data type.  | 
                                                        
| 10 | 7 | *  |