예제 #1
0
        if ($sitemap->load($sitemapid)) {
            $action = JRequest::getCmd('action', '');
            $uid = JRequest::getCmd('uid', '');
            $itemid = JRequest::getInt('itemid', '');
            switch ($action) {
                case 'toggleElement':
                    if ($uid && $itemid) {
                        $state = $sitemap->toggleItem($uid, $itemid);
                    }
                    break;
                case 'changeProperty':
                    $uid = JRequest::getCmd('uid', '');
                    $property = JRequest::getCmd('property', '');
                    $value = JRequest::getCmd('value', '');
                    if ($uid && $itemid && $uid && $property) {
                        $state = $sitemap->chageItemPropery($uid, $itemid, 'xml', $property, $value);
                    }
                    break;
            }
        }
    }
    header('Content-Type: text/xml');
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
    echo "<response>\n";
    echo " <result>OK</result>\n";
    echo " <state>" . $state . "</state>\n";
    echo "</response>\n";
    exit;
} elseif ($task == 'navigator') {
    require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'admin.xmap.html.php';
    require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'XmapAdmin.php';