Added ability to customize the action on grid links
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@537 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -696,8 +696,9 @@ class AppController extends Controller {
|
||||
return;
|
||||
|
||||
foreach ($links AS $table => $fields) {
|
||||
$special = array('controller', 'id');
|
||||
$special = array('controller', 'action', 'id');
|
||||
$controller = Inflector::pluralize(Inflector::underscore($table));
|
||||
$action = 'view';
|
||||
$id = 'id';
|
||||
extract(array_intersect_key($fields, array_flip($special)));
|
||||
foreach ($records AS &$record) {
|
||||
@@ -713,7 +714,7 @@ class AppController extends Controller {
|
||||
$record[$table][$field] =
|
||||
'<A HREF="' .
|
||||
Router::url(array('controller' => $controller,
|
||||
'action' => 'view',
|
||||
'action' => $action,
|
||||
$record[$table][$id])) .
|
||||
'">' .
|
||||
$record[$table][$field] .
|
||||
|
||||
Reference in New Issue
Block a user