Xataface
2.0alpha2
Xataface Application Framework
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
actions
related_records_list.php
Go to the documentation of this file.
1
<?php
2
import
(
'Dataface/Table.php'
);
3
class
dataface_actions_related_records_list
{
4
function
handle
($params){
5
$app
=&
Dataface_Application::getInstance
();
6
$query =&
$app
->getQuery();
7
if
( !isset($query[
'-relationship'
]) ){
8
return
PEAR::raiseError
(
"No relationship specified."
);
9
}
10
11
$table
=&
Dataface_Table::loadTable
($query[
'-table'
]);
12
$record =&
$app
->getRecord();
13
if
( !$record ){
14
return
Dataface_Error::permissionDenied
(
"No record found"
);
15
}
16
$perms = $record->getPermissions(array(
'relationship'
=>$query[
'-relationship'
]));
17
18
if
( !@$perms[
'view related records'
] )
return
Dataface_Error::permissionDenied
(
'You don\'t have permission to view this relationship.'
);
19
20
$action =
$table
->getRelationshipsAsActions(array(), $query[
'-relationship'
]);
21
22
23
if
( isset($query[
'-template'
]) ){
24
df_display(array(
'record'
=>$record), $query[
'-template'
]);
25
}
else
if
( isset($action[
'template'
]) ){
26
df_display(array(
'record'
=>$record), $action[
'template'
]);
27
}
else
{
28
df_display(array(
'record'
=>$record),
'Dataface_Related_Records_List.html'
);
29
}
30
31
32
}
33
}
34
35
?>
Generated on Fri Mar 22 2013 09:40:33 for Xataface by
1.8.1.2