Commit cbe5fa80 authored by salvis's avatar salvis

Turn the node nid/title into a link fragment pointing to the node (especially...

Turn the node nid/title into a link fragment pointing to the node (especially useful on pages with multiple nodes).
parent b6003523
......@@ -234,7 +234,8 @@ function devel_node_access_block($op = 'list', $delta = 0) {
$rows = array();
while ($row = db_fetch_object($result)) {
$explained = module_invoke_all('node_access_explain', $row);
$rows[] = array(!empty($row->title) ? check_plain($row->title) : $row->nid,
$title = (!empty($row->title) ? check_plain($row->title) : $row->nid);
$rows[] = array('<a href="#node-'. $row->nid .'">'. $title .'</a>',
$row->realm,
$row->gid,
$row->grant_view,
......@@ -378,13 +379,13 @@ function devel_node_access_block($op = 'list', $delta = 0) {
$row->grant_update = $grant['grant_update'];
$row->grant_delete = $grant['grant_delete'];
$row->explained = implode('; ', module_invoke_all('node_access_explain', $row));
unset($row->title);
unset($row->title); // possibly needed above
if ($row->nid == 0 && $row->gid == 0 && $row->realm == 'all' && count($all_grants) > 1) {
$row->state = array('data' => $states['unexpected'][0], 'title' => $states['unexpected'][2]);
$class = $states['unexpected'][1];
}
else {
$class = $states[$grant['state']][1];
$class = $states[$grant['state']][1];
}
$error_count += ($class == 'error');
$row = (array) $row;
......@@ -399,6 +400,7 @@ function devel_node_access_block($op = 'list', $delta = 0) {
$row["grant_$op"]['class'] = 'error';
}
}
$row['nid'] = '<a href="#node-'. $grant['nid'] .'">'. $row['nid'] .'</a>';
foreach (array('nid', 'priority', 'gid') as $key) {
$row[$key] = array('data' => $row[$key], 'style' => 'text-align: right');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment