$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['style_id']) && is_numeric($_REQUEST['style_id'])) { $style = $gContent->getPolylineStyle($_REQUEST['style_id']); if ($style != NULL && ($style['user_id'] == $gBitUser->mUserId || $gBitUser->hasPermission('p_gmap_admin')) != TRUE) { $gBitSystem->fatalError(tra("You can not edit this style!")); } } //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_polylinestyle"])) { $gBitUser->verifyTicket(); if ($result = $gContent->storePolylineStyle($_REQUEST)) { $gBitSmarty->assign_by_ref('polylinestyleInfo', $result); } } else { if (isset($_REQUEST["style_id"])) { $polylinestyle = $gContent->getPolylineStyle($_REQUEST["style_id"]); } $gBitSmarty->assign_by_ref('polylinestyleInfo', $polylinestyle); $gBitSystem->display('bitpackage:gmap/edit_polylinestyle.tpl', NULL, array('format' => 'center_only', 'display_mode' => 'edit')); die; } if (count($gContent->mErrors) > 0) { $gBitThemes->setFormatHeader('center_only'); $gBitSmarty->assign_by_ref('errors', $gContent->mErrors); } else { $gBitSystem->display('bitpackage:gmap/edit_polylinestyle_xml.tpl', null, $format, array('display_mode' => 'edit'));