コード例 #1
0
ファイル: edit_polyline.php プロジェクト: bitweaver/gmap
    if (!$gContent->hasUpdatePermission()) {
        $gBitSystem->fatalError(tra("Sorry, you do not have permission to edit this polyline."));
    }
} else {
    $gContent->verifyCreatePermission();
    /* if we are passed a set_id the user is trying to add an overlay to a set.
    	   if they dont have the right, then f**k it.
    	   in the future it might be nice to send this back as an alert to display 
    	   so that the form does not get erased and their work is not lost, but this 
    	   should prevent the form from even loading. -wjames5
    	*/
    if (isset($_REQUEST['set_id'])) {
        require_once GMAP_PKG_PATH . 'BitGmapPolylineSet.php';
        $set = new BitGmapPolylineSet($_REQUEST['set_id']);
        $set->load();
        if ($set->isValid() && !$set->hasUserPermission('p_gmap_attach_children')) {
            $gBitSystem->fatalError(tra("You can not add polylines to this polyline set!"));
            die;
        }
    }
}
//Preview mode is handled by javascript on the client side.
//There is no callback to the server for previewing changes.
//most of the time we want xml back so we make it the default
$format = 'xml';
$XMLContent = "";
$statusCode = 401;
if (!empty($_REQUEST["save_polyline"])) {
    $gBitUser->verifyTicket();
    $storeHash = $_REQUEST;
    // the user might be submitting encoded html chars by ajax - decode them before storing