Skip to content

Commit

Permalink
#211 - removed the ListController along with all links to it
Browse files Browse the repository at this point in the history
  • Loading branch information
alphadevx committed Sep 5, 2015
1 parent f88ac43 commit b3834a1
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 582 deletions.
12 changes: 6 additions & 6 deletions Alpha/Controller/ActiveRecordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,9 @@ protected function renderPageLinks()
if ($this->startPoint > 1) {
// handle secure URLs
if ($this->request->getParam('token', null) != null)
$body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ListController&ActiveRecordType='.$this->activeRecordType.'&start='.($this->startPoint-$config->get('app.list.page.amount'))).'">&lt;&lt;-Previous</a></li>';
$body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\AcitveRecordController&ActiveRecordType='.$this->activeRecordType.'&start='.($this->startPoint-$config->get('app.list.page.amount'))).'">&lt;&lt;-Previous</a></li>';
else
$body .= '<li><a href="/listall/'.urlencode($this->activeRecordType)."/".($this->startPoint-$config->get('app.list.page.amount')).'">&lt;&lt;-Previous</a></li>';
$body .= '<li><a href="/records/'.urlencode($this->activeRecordType)."/".($this->startPoint-$config->get('app.list.page.amount')).'">&lt;&lt;-Previous</a></li>';
} elseif ($this->recordCount > $config->get('app.list.page.amount')){
$body .= '<li class="disabled"><a href="#">&lt;&lt;-Previous</a></li>';
}
Expand All @@ -660,9 +660,9 @@ protected function renderPageLinks()
if ($i != ($this->startPoint-1)) {
// handle secure URLs
if ($this->request->getParam('token', null) != null)
$body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ListController&ActiveRecordType='.$this->activeRecordType.'&start='.($i+1)).'">'.$page.'</a></li>';
$body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$this->activeRecordType.'&start='.($i+1)).'">'.$page.'</a></li>';
else
$body .= '<li><a href="/listall/'.urlencode($this->activeRecordType)."/".($i+1).'">'.$page.'</a></li>';
$body .= '<li><a href="/records/'.urlencode($this->activeRecordType)."/".($i+1).'">'.$page.'</a></li>';
} elseif ($this->recordCount > $config->get('app.list.page.amount')) {
$body .= '<li class="active"><a href="#">'.$page.'</a></li>';
}
Expand All @@ -673,9 +673,9 @@ protected function renderPageLinks()
if ($this->recordCount > $end) {
// handle secure URLs
if ($this->request->getParam('token', null) != null)
$body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ListController&ActiveRecordType='.$this->activeRecordType.'&start='.($this->startPoint+$config->get('app.list.page.amount'))).'">Next-&gt;&gt;</a></li>';
$body .= '<li><a href="'.FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.$this->activeRecordType.'&start='.($this->startPoint+$config->get('app.list.page.amount'))).'">Next-&gt;&gt;</a></li>';
else
$body .= '<li><a href="/listall/'.urlencode($this->activeRecordType)."/".($this->startPoint+$config->get('app.list.page.amount')).
$body .= '<li><a href="/records/'.urlencode($this->activeRecordType)."/".($this->startPoint+$config->get('app.list.page.amount')).
'">Next-&gt;&gt;</a></li>';
} elseif ($this->recordCount > $config->get('app.list.page.amount')) {
$body .= '<li class="disabled"><a href="#">Next-&gt;&gt;</a></li>';
Expand Down
4 changes: 2 additions & 2 deletions Alpha/Controller/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function doGET($request)

// handle requests to view a list of articles
if ($this->mode == 'read') {
$listController = new ListController();
$listController = new ActiveRecordController();
$request->addParams(array('ActiveRecordType' => 'Alpha\Model\Article'));#
$listController->setRequest($request);
return $listController->doGET($request);
Expand Down Expand Up @@ -677,7 +677,7 @@ public function doDELETE($request)

$body .= '<center>';

$temp = new Button("document.location = '".FrontController::generateSecureURL('act=Alpha\Controller\ListController&ActiveRecordType='.get_class($this->BO))."'",
$temp = new Button("document.location = '".FrontController::generateSecureURL('act=Alpha\Controller\ActiveRecordController&ActiveRecordType='.get_class($this->BO))."'",
'Back to List','cancelBut');
$body .= $temp->render();

Expand Down
2 changes: 1 addition & 1 deletion Alpha/Controller/DEnumController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* </pre>
*
*/
class DEnumController extends ListController implements ControllerInterface
class DEnumController extends ActiveRecordController implements ControllerInterface
{
/**
* Trace logger
Expand Down
6 changes: 0 additions & 6 deletions Alpha/Controller/Front/FrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Alpha\Controller\GenSecureQueryStringController;
use Alpha\Controller\ImageController;
use Alpha\Controller\ListActiveRecordsController;
use Alpha\Controller\ListController;
use Alpha\Controller\LogController;
use Alpha\Controller\LoginController;
use Alpha\Controller\LogoutController;
Expand Down Expand Up @@ -218,11 +217,6 @@ public function __construct()
return $controller->process($request);
});

$this->addRoute('/listall/{ActiveRecordType}/{start}/{limit}', function($request) {
$controller = new ListController();
return $controller->process($request);
})->value('start', 1)->value('limit', $config->get('app.list.page.amount'));

$this->addRoute('/log/{logPath}', function($request) {
$controller = new LogController();
return $controller->process($request);
Expand Down
Loading

0 comments on commit b3834a1

Please sign in to comment.