Added ability to customize the action on grid links

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@537 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-11 17:30:12 +00:00
parent 3696aa011c
commit b1dfe5bd50

View File

@@ -696,8 +696,9 @@ class AppController extends Controller {
return; return;
foreach ($links AS $table => $fields) { foreach ($links AS $table => $fields) {
$special = array('controller', 'id'); $special = array('controller', 'action', 'id');
$controller = Inflector::pluralize(Inflector::underscore($table)); $controller = Inflector::pluralize(Inflector::underscore($table));
$action = 'view';
$id = 'id'; $id = 'id';
extract(array_intersect_key($fields, array_flip($special))); extract(array_intersect_key($fields, array_flip($special)));
foreach ($records AS &$record) { foreach ($records AS &$record) {
@@ -713,7 +714,7 @@ class AppController extends Controller {
$record[$table][$field] = $record[$table][$field] =
'<A HREF="' . '<A HREF="' .
Router::url(array('controller' => $controller, Router::url(array('controller' => $controller,
'action' => 'view', 'action' => $action,
$record[$table][$id])) . $record[$table][$id])) .
'">' . '">' .
$record[$table][$field] . $record[$table][$field] .