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:
abijah
2009-08-11 17:30:12 +00:00
parent ec22f4b003
commit 6f2038f7b0

View File

@@ -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] .