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_checkboxes.php
Go to the documentation of this file.
1
<?php
2
class
dataface_actions_related_records_checkboxes
{
3
4
function
handle
($params){
5
$app
=&
Dataface_Application::getInstance
();
6
$query =&
$app
->getQuery();
7
$record =&
$app
->getRecord();
8
if
( !$record ){
9
return
PEAR::raiseError
(
"No record found."
,
DATAFACE_E_NOTICE
);
10
}
11
if
( !isset($query[
'-relationship'
]) ){
12
return
PEAR::raiseError
(
"No relationship specified."
);
13
}
14
15
$table
=&
Dataface_Table::loadTable
($query[
'-table'
]);
16
17
$action =
$table
->getRelationshipsAsActions(array(), $query[
'-relationship'
]);
18
19
if
( @$action[
'permission'
] and !$record->checkPermission($action[
'permission'
]) ){
20
return
Dataface_Error::permissionDenied
();
21
}
22
23
ob_start();
24
import
(
'Dataface/RelationshipCheckboxForm.php'
);
25
$form =
new
Dataface_RelationshipCheckboxForm
($record, $query[
'-relationship'
]);
26
$out
= ob_get_contents();
27
ob_end_clean();
28
29
if
( isset($query[
'-template'
]) ){
30
df_display(array(
'form'
=>
$out
), $query[
'-template'
]);
31
}
else
if
( isset($action[
'template'
]) ){
32
df_display(array(
'form'
=>
$out
), $action[
'template'
]);
33
}
else
{
34
df_display(array(
'form'
=>
$out
),
'Dataface_related_records_checkboxes.html'
);
35
}
36
37
38
}
39
40
}
41
42
?>
Generated on Fri Mar 22 2013 09:40:33 for Xataface by
1.8.1.2