예제 #1
0
// Now check permissions to access the polygonset
if ($gContent->isValid()) {
    $gContent->verifyUpdatePermission();
} else {
    $gContent->verifyCreatePermission();
    // $gBitSystem->verifyPermission( 'p_gmap_overlayset_edit' );
    /* if we are passed a gmap_id the user is trying to add a set to a map.
    	   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['gmap_id'])) {
        require_once GMAP_PKG_PATH . 'BitGmap.php';
        $set = new BitGmap($_REQUEST['gmap_id']);
        $set->load();
        if ($set->isValid() && !$set->hasUserPermission('p_gmap_attach_children')) {
            $gBitSystem->fatalError(tra("You can not add polygonsets to this map!"));
            die;
        }
    }
}
//Preview mode is handled by javascript on the client side.
//There is no callback to the server for previewing changes.
$format = 'xml';
$XMLContent = "";
$statusCode = 401;
if (!empty($_REQUEST["save_polygonset"])) {
    $gBitUser->verifyTicket();
    // the user might be submitting encoded html chars by ajax - decode them before storing
    if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
예제 #2
0
 if (isset($_REQUEST["submit_mult"]) && isset($_REQUEST["checked"]) && $_REQUEST["submit_mult"] == "remove_gmaps") {
     // Now check permissions to remove the selected gmap
     $gBitSystem->verifyPermission('p_gmap_remove');
     if (!empty($_REQUEST['cancel'])) {
         // user cancelled - just continue on, doing nothing
     } elseif (empty($_REQUEST['confirm'])) {
         $formHash['delete'] = TRUE;
         $formHash['submit_mult'] = 'remove_gmaps';
         foreach ($_REQUEST["checked"] as $del) {
             $formHash['input'][] = '<input type="hidden" name="checked[]" value="' . $del . '"/>';
         }
         $gBitSystem->confirmDialog($formHash, array('warning' => tra('Are you sure you want to delete these gmaps?') . ' (' . tra('Count: ') . count($_REQUEST["checked"]) . ')', 'error' => tra('This cannot be undone!')));
     } else {
         foreach ($_REQUEST["checked"] as $deleteId) {
             $tmpPage = new BitGmap($deleteId);
             if (!$tmpPage->load() || !$tmpPage->expunge()) {
                 array_merge($errors, array_values($tmpPage->mErrors));
             }
         }
         if (!empty($errors)) {
             $gBitSmarty->assign_by_ref('errors', $errors);
         }
     }
 }
 $gmap = new BitGmap();
 $listgmaps = $gmap->getList($_REQUEST);
 $gBitSmarty->assign_by_ref('control', $_REQUEST["control"]);
 $gBitSmarty->assign_by_ref('list', $listgmaps["data"]);
 // add pagination info
 $_REQUEST['listInfo']['ihash']['content_type_guid'] = BITGMAP_CONTENT_TYPE_GUID;
 // getList() has now placed all the pagination information in $_REQUEST['listInfo']
예제 #3
0
 */
global $gContent;
require_once GMAP_PKG_PATH . 'BitGmap.php';
require_once LIBERTY_PKG_PATH . 'lookup_content_inc.php';
// this is needed when the center module is applied to avoid abusing $_REQUEST
if (empty($lookupHash)) {
    $lookupHash =& $_REQUEST;
}
// 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 someone gives us a map_name we try to find it
    if (!empty($lookupHash['map_name'])) {
        global $gBitDb;
        $lookupHash['gmap_id'] = $gBitDb->getOne("SELECT gmap_id FROM `" . BIT_DB_PREFIX . "gmaps` g LEFT JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON (g.`content_id` = lc.`content_id`) WHERE lc.`title` = ?", array($lookupHash['map_name']));
        if (empty($lookupHash['gmap_id'])) {
            $gBitSystem->fatalError(tra('No map found with the name: ') . $lookupHash['map_name']);
        }
    }
    if (!empty($lookupHash['gmap_id']) && is_numeric($lookupHash['gmap_id'])) {
        // if gmap_id supplied, use that
        $gContent = new BitGmap($lookupHash['gmap_id']);
    } elseif (!empty($lookupHash['content_id']) && is_numeric($lookupHash['content_id'])) {
        // if content_id supplied, use that
        $gContent = new BitGmap(NULL, $lookupHash['content_id']);
    } else {
        // otherwise create new object
        $gContent = new BitGmap();
    }
    $gContent->load();
    $gBitSmarty->assign_by_ref("gContent", $gContent);
}