|
Revision 1053, 0.8 kB
(checked in by ben, 2 years ago)
|
Fixed a notice issue with the $result variable; it is now initialised on first assignation.
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
@require_once("../../includes.php"); |
|---|
| 5 |
|
|---|
| 6 |
$id = optional_param('id',0,PARAM_INT); |
|---|
| 7 |
|
|---|
| 8 |
if (isloggedin()) { |
|---|
| 9 |
if ($widget = get_record('widgets','ident',$id)) { |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
$page_owner = $widget->owner; |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
// If so, wipe it! |
|---|
| 16 |
if (run("permissions:check","profile")) { |
|---|
| 17 |
|
|---|
| 18 |
widget_destroy($widget->ident); |
|---|
| 19 |
widget_reorder($page_owner,$widget->location,$widget->location_id,$widget->column); |
|---|
| 20 |
|
|---|
| 21 |
} |
|---|
| 22 |
} |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
$result = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; |
|---|
| 26 |
$result .= '<answer>'; |
|---|
| 27 |
$result .= '<wid>'.$id.'</wid>'; |
|---|
| 28 |
$result .= '</answer>'; |
|---|
| 29 |
header('Content-Type: application/xml'); |
|---|
| 30 |
print $result; |
|---|
| 31 |
?> |
|---|