Exemple #1
0
 * @subpackage functions
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('gmap');
// Access the gmap class
global $gContent;
require_once GMAP_PKG_PATH . 'BitGmap.php';
require_once LIBERTY_PKG_PATH . 'lookup_content_inc.php';
$gContent = new BitGmap();
//if a maptype_id is passed try to look it up and see if the user is the owner or has admin perms
if (isset($_REQUEST['icon_id']) && is_numeric($_REQUEST['icon_id'])) {
    $style = $gContent->getIconStyle($_REQUEST['icon_id']);
    if ($style != NULL && ($style['user_id'] == $gBitUser->mUserId || $gBitUser->hasPermission('p_gmap_admin')) != TRUE) {
        $gBitSystem->fatalError(tra("You can not edit this icon!"));
    }
}
//check the user has permission to edit maptypes in general
$gBitSystem->verifyPermission('p_gmap_overlay_update');
//Preview mode is handled by javascript on the client side.
//There is no callback to the server for previewing changes.
$format = 'xml';
if (!empty($_REQUEST["save_iconstyle"])) {
    $gBitUser->verifyTicket();
    if ($result = $gContent->storeIconStyle($_REQUEST)) {
        $gBitSmarty->assign_by_ref('iconstyleInfo', $result);
    }
} else {
Exemple #2
0
 * 
 * @package gmap
 * @subpackage functions
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('gmap');
// Now check permissions to access this page
$gBitSystem->verifyPermission('p_gmap_view');
$gContent = new BitGmap();
//if a icon_id is passed try to look it up
if (@BitBase::verifyId($_REQUEST['icon_id'])) {
    if ($result = $gContent->getIconStyle($_REQUEST['icon_id'])) {
        $gBitSmarty->assign_by_ref('iconstyleInfo', $result);
        $statusCode = 200;
        $gBitSmarty->assign('statusCode', $statusCode);
    }
    $gBitSystem->display('bitpackage:gmap/edit_iconstyle_xml.tpl', null, array('format' => 'xml', 'display_mode' => 'display'));
} else {
    // this is how you store and update all icons found in the icons path
    $_REQUEST['max_records'] = $gBitSystem->getConfig('max_records') * 5;
    $icons = $gContent->getIconList($_REQUEST);
    if (empty($icons) || !empty($_REQUEST['update_icon_list'])) {
        $gContent->importIcons(GMAP_PKG_PATH . "icons");
        $icons = $gContent->getIconList($_REQUEST);
    }
    $gBitSmarty->assign('icons', $icons);
    $gBitSmarty->assign('themes', $gContent->getIconThemes());