Exemplo n.º 1
0
if ($gContent->isValid()) {
    if (!$gContent->hasUpdatePermission()) {
        $gBitSystem->fatalError(tra("Sorry, you do not have permission to edit this polygon."));
    }
} 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 . 'BitGmapPolygonSet.php';
        $set = new BitGmapPolygonSet($_REQUEST['set_id']);
        $set->load();
        if ($set->isValid() && !$set->hasUserPermission('p_gmap_attach_children')) {
            $gBitSystem->fatalError(tra("You can not add polygons to this polygon 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_polygon"])) {
    $gBitUser->verifyTicket();
    $storeHash = $_REQUEST;
Exemplo n.º 2
0
 * All Rights Reserved. See below for details and a complete list of authors.
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
 * @author Will <*****@*****.**>
 * 
 * @package gmap
 * @subpackage functions
 */
/**
 * required setup
 */
global $gContent;
require_once GMAP_PKG_PATH . 'BitGmapPolygonSet.php';
require_once LIBERTY_PKG_PATH . 'lookup_content_inc.php';
// if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
if (empty($gContent) || !is_object($gContent) || !$gContent->isValid()) {
    if (!empty($_REQUEST['set_id']) && is_numeric($_REQUEST['set_id'])) {
        // if sample_id supplied, use that
        $gContent = new BitGmapPolygonSet($_REQUEST['set_id']);
    } elseif (!empty($_REQUEST['content_id']) && is_numeric($_REQUEST['content_id'])) {
        // if content_id supplied, use that
        $gContent = new BitGmapPolygonSet(NULL, $_REQUEST['content_id']);
    } else {
        // otherwise create new object
        $gContent = new BitGmapPolygonSet();
    }
    if (empty($_REQUEST['gmap_id']) || !is_numeric($_REQUEST['gmap_id'])) {
        $_REQUEST['gmap_id'] = NULL;
    }
    $gContent->load($_REQUEST['gmap_id']);
    $gBitSmarty->assign_by_ref("gContent", $gContent);
}