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:
@@ -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] .
|
||||||
|
|||||||
Reference in New Issue
Block a user