|
Revision 1369, 1.2 kB
(checked in by rho, 1 year ago)
|
cleanup
- use to templates_page_output function to display page
Signed-off: Rolando Espinoza La fuente <rho@prosoftpeople.com>
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
@require_once("../../includes.php"); |
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
$object_id = optional_param('object_id',0,PARAM_INT); |
|---|
| 12 |
$object_type = optional_param('object_type',''); |
|---|
| 13 |
|
|---|
| 14 |
$title = _gettext("Bad page"); |
|---|
| 15 |
$body = "<p>".__gettext("Either this page does not exist or you do not have permission to view it.")."</p>"; |
|---|
| 16 |
if ($object_id && $object_type) { |
|---|
| 17 |
$access = get_access($object_id,$object_type,"read"); |
|---|
| 18 |
|
|---|
| 19 |
// if and only if they have access to the object |
|---|
| 20 |
if ($access == 'PUBLIC' || run("users:access_level_check",$access)) { |
|---|
| 21 |
$title = __gettext('Comments on').' "'.get_title($object_id,$object_type).'"'; |
|---|
| 22 |
$back = '<p><a href="'.get_url($object_id,$object_type).'">'.__gettext("Go back").'</a></p>'; |
|---|
| 23 |
$body = $back; |
|---|
| 24 |
$body .= implode('',action('annotate',$object_id,$object_type,NULL, |
|---|
| 25 |
array('comment_form_type'=>'separate'))); |
|---|
| 26 |
$body .= $back; |
|---|
| 27 |
} |
|---|
| 28 |
} |
|---|
| 29 |
|
|---|
| 30 |
templates_page_setup(); |
|---|
| 31 |
templates_page_output($title, $body); |
|---|
| 32 |
|
|---|
| 33 |
?> |
|---|