getUrlGenerator(); /* Fetch the real path of the gallery installation for file operation */ $basegallerydir = substr(dirname(__FILE__),0,-20); $base = GalleryUtilities::convertPathToUrl($basegallerydir); /* Fetch module parameters and save them in form variable */ list($ret, $param) = GalleryCoreApi::fetchAllPluginParameters('module', 'map'); foreach ($param as $key => $value) { $form[$key] = $value; } /* Add the google map fields (we don't care about errors) */ list($ret, $added) = mapHelper::addField('GPS', 'common', 0); list($ret, $added) = mapHelper::addField('ZoomLevel', 'common', 0); list($ret, $added) = mapHelper::addField('GELookAt', 'common', 0); /* Save the Color Names into the Custom Field */ $handle = fopen($basegallerydir . 'modules/map/images/markers/' . $param['useMarkerSet'] . '/colorlist', 'r'); $photolist = explode('*', fread($handle, filesize($basegallerydir . 'modules/map/images/markers/' . $param['useMarkerSet'] . '/colorlist') - 1)); fclose($handle); $handle = fopen($basegallerydir . 'modules/map/images/markers/' . $param['useAlbumMarkerSet'] . '/colorlist', 'r'); $albumlist = explode('*', fread($handle, filesize($basegallerydir . 'modules/map/images/markers/' . $param['useAlbumMarkerSet'] . '/colorlist') - 1)); fclose($handle); list ($ret, $params) = mapHelper::loadParameters(0, false); $newparam['common'] = $params['common']; /* Add in the Photo colors into the custom field */ $newparam['photo'][] = array ('field' => 'Color', 'summary' => '', 'detail' => 1, 'choices' => $photolist); /* Add in the Album colors into the custom field */ $newparam['album'][] = array ('field' => 'Color', 'summary' => '', 'detail' => 1, 'choices' => $albumlist); $ret = mapHelper::saveParameters($newparam, 0); /* Add additional fields */ $form['mode'] = GalleryUtilities::getRequestVariables('mode'); $form['picbase'] = $base . 'modules/map/images/'; $msie = '/msie\s(5\.[5-9]|[6-9]\.[0-9]*).*(win)/i'; if (!isset($_SERVER['HTTP_USER_AGENT']) || !preg_match($msie, $_SERVER['HTTP_USER_AGENT']) || preg_match('/opera/i', $_SERVER['HTTP_USER_AGENT'])) { $form['IE'] = false; } else { $form['IE'] = true; } if(!array_key_exists('AdminHelp', $form)) { $form['AdminHelp'] = 1; } if(!array_key_exists('UserHelp', $form)) { $form['UserHelp'] = 1; } $template->head('modules/map/templates/AdminHeader.tpl'); ?>