diff options
| -rw-r--r-- | includes/functions/functions.php | 26 | ||||
| -rw-r--r-- | includes/functions/functions_db.php | 28 | ||||
| -rw-r--r-- | includes/functions/functions_import.php | 6 | ||||
| -rw-r--r-- | includes/functions/functions_print_facts.php | 2 | ||||
| -rw-r--r-- | modules/googlemap/db_schema/db_schema_1_2.php | 58 | ||||
| -rw-r--r-- | modules/googlemap/defaultconfig.php | 138 | ||||
| -rw-r--r-- | modules/googlemap/editconfig.php | 54 | ||||
| -rw-r--r-- | modules/html/module.php (renamed from modules/block_htmlplus/module.php) | 12 | ||||
| -rw-r--r-- | modules/html_block/module.php | 139 | ||||
| -rw-r--r-- | modules/jw_player/audio.png (renamed from modules/JWplayer/audio.png) | bin | 5720 -> 5720 bytes | |||
| -rw-r--r-- | modules/jw_player/audio_2.png (renamed from modules/JWplayer/audio_2.png) | bin | 939 -> 939 bytes | |||
| -rw-r--r-- | modules/jw_player/flvVideo.php (renamed from modules/JWplayer/flvVideo.php) | 6 | ||||
| -rw-r--r-- | modules/jw_player/module.php (renamed from modules/JWplayer/module.php) | 2 | ||||
| -rw-r--r-- | modules/jw_player/player.swf (renamed from modules/JWplayer/player.swf) | bin | 86736 -> 86736 bytes | |||
| -rw-r--r-- | modules/jw_player/silverlight.js (renamed from modules/JWplayer/silverlight.js) | 0 | ||||
| -rw-r--r-- | modules/jw_player/swfobject.js (renamed from modules/JWplayer/swfobject.js) | 0 | ||||
| -rw-r--r-- | modules/jw_player/wmvVideo.php (renamed from modules/JWplayer/wmvVideo.php) | 10 | ||||
| -rw-r--r-- | modules/jw_player/wmvplayer.js (renamed from modules/JWplayer/wmvplayer.js) | 0 | ||||
| -rw-r--r-- | modules/jw_player/wmvplayer.xaml (renamed from modules/JWplayer/wmvplayer.xaml) | 0 | ||||
| -rw-r--r-- | modules/jw_player/yt.swf (renamed from modules/JWplayer/yt.swf) | bin | 1136 -> 1136 bytes | |||
| -rw-r--r-- | modules/lightbox/db_schema/db_schema_0_1.php | 20 | ||||
| -rw-r--r-- | modules/lightbox/lb_defaultconfig.php | 22 | ||||
| -rw-r--r-- | modules/lightbox/lb_editconfig.php | 20 | ||||
| -rw-r--r-- | setup.php | 20 |
24 files changed, 230 insertions, 333 deletions
diff --git a/includes/functions/functions.php b/includes/functions/functions.php index d51db78928..1e9d066b2b 100644 --- a/includes/functions/functions.php +++ b/includes/functions/functions.php @@ -2888,7 +2888,7 @@ function get_new_xref($type='INDI', $ged_id=WT_GED_ID, $use_cache=false) { } $num= - WT_DB::prepare("SELECT ni_id FROM {$TBLPREFIX}nextid WHERE ni_type=? AND ni_gedfile=?") + WT_DB::prepare("SELECT next_id FROM {$TBLPREFIX}next_id WHERE record_type=? AND gedcom_id=?") ->execute(array($type, $ged_id)) ->fetchOne(); @@ -2898,8 +2898,8 @@ function get_new_xref($type='INDI', $ged_id=WT_GED_ID, $use_cache=false) { if (is_null($num)) { $num = 1; - WT_DB::prepare("INSERT INTO {$TBLPREFIX}nextid VALUES(?, ?, ?)") - ->execute(array($num+1, $type, $ged_id)); + WT_DB::prepare("INSERT INTO {$TBLPREFIX}next_id (gedcom_id, record_type, next_id) VALUES(?, ?, 1)") + ->execute(array($ged_id, $type)); } //-- make sure this number has not already been used @@ -2917,7 +2917,7 @@ function get_new_xref($type='INDI', $ged_id=WT_GED_ID, $use_cache=false) { $key = $prefix.$num; //-- update the next id number in the DB table - WT_DB::prepare("UPDATE {$TBLPREFIX}nextid SET ni_id=? WHERE ni_type=? AND ni_gedfile=?") + WT_DB::prepare("UPDATE {$TBLPREFIX}next_id SET next_id=? WHERE record_type=? AND gedcom_id=?") ->execute(array($num+1, $type, $ged_id)); return $key; } @@ -3009,7 +3009,7 @@ function mediaFileInfo($fileName, $thumbName, $mid, $name='', $notes='', $obeyVi // -- Classify the incoming media file if (preg_match('~^https?://~i', $fileName)) $type = 'url_'; else $type = 'local_'; - if ((preg_match('/\.flv$/i', $fileName) || preg_match('~^https?://.*\.youtube\..*/watch\?~i', $fileName)) && is_dir(WT_ROOT.'modules/JWplayer')) { + if ((preg_match('/\.flv$/i', $fileName) || preg_match('~^https?://.*\.youtube\..*/watch\?~i', $fileName)) && is_dir(WT_ROOT.'modules/jw_player')) { $type .= 'flv'; } else if (preg_match('~^https?://picasaweb*\.google\..*/.*/~i', $fileName)) { $type .= 'picasa'; @@ -3032,17 +3032,17 @@ function mediaFileInfo($fileName, $thumbName, $mid, $name='', $notes='', $obeyVi require_once WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; switch ($type) { case 'url_flv': - $url = encode_url('module.php?mod=JWplayer&mod_action=flvVideo&flvVideo='.encrypt($fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); + $url = encode_url('module.php?mod=jw_player&mod_action=flvVideo&flvVideo='.encrypt($fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); break 2; case 'local_flv': - $url = encode_url('module.php?mod=JWplayer&mod_action=flvVideo&flvVideo='.encrypt($SERVER_URL.$fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); + $url = encode_url('module.php?mod=jw_player&mod_action=flvVideo&flvVideo='.encrypt($SERVER_URL.$fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); break 2; case 'url_wmv': - $url = encode_url('module.php?mod=JWplayer&mod_action=wmvVideo&wmvVideo='.encrypt($fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); + $url = encode_url('module.php?mod=jw_player&mod_action=wmvVideo&wmvVideo='.encrypt($fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); break 2; case 'local_audio': case 'local_wmv': - $url = encode_url('module.php?mod=JWplayer&mod_action=wmvVideo&wmvVideo='.encrypt($SERVER_URL.$fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); + $url = encode_url('module.php?mod=jw_player&mod_action=wmvVideo&wmvVideo='.encrypt($SERVER_URL.$fileName)) . "\" rel='clearbox(500, 392, click)' rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_COMPAT, 'UTF-8')) . "::" . htmlspecialchars($notes, ENT_COMPAT, 'UTF-8'); break 2; case 'url_image': case 'local_image': @@ -3061,17 +3061,17 @@ function mediaFileInfo($fileName, $thumbName, $mid, $name='', $notes='', $obeyVi // Lightbox is not installed or Lightbox is not appropriate for this media type switch ($type) { case 'url_flv': - $url = "javascript:;\" onclick=\" var winflv = window.open('".encode_url('module.php?mod=JWplayer&mod_action=flvVideo&flvVideo='.encrypt($fileName)) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; + $url = "javascript:;\" onclick=\" var winflv = window.open('".encode_url('module.php?mod=jw_player&mod_action=flvVideo&flvVideo='.encrypt($fileName)) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; break 2; case 'local_flv': - $url = "javascript:;\" onclick=\" var winflv = window.open('".encode_url('module.php?mod=JWplayer&mod_action=flvVideo&flvVideo='.encrypt($SERVER_URL.$fileName)) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; + $url = "javascript:;\" onclick=\" var winflv = window.open('".encode_url('module.php?mod=jw_player&mod_action=flvVideo&flvVideo='.encrypt($SERVER_URL.$fileName)) . "', 'winflv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winflv.focus();}"; break 2; case 'url_wmv': - $url = "javascript:;\" onclick=\" var winwmv = window.open('".encode_url('module.php?mod=JWplayer&mod_action=wmvVideo&wmvVideo='.encrypt($fileName)) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; + $url = "javascript:;\" onclick=\" var winwmv = window.open('".encode_url('module.php?mod=jw_player&mod_action=wmvVideo&wmvVideo='.encrypt($fileName)) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; break 2; case 'local_wmv': case 'local_audio': - $url = "javascript:;\" onclick=\" var winwmv = window.open('".encode_url('module.php?mod=JWplayer&mod_action=wmvVideo&wmvVideo='.encrypt($SERVER_URL.$fileName)) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; + $url = "javascript:;\" onclick=\" var winwmv = window.open('".encode_url('module.php?mod=jw_player&mod_action=wmvVideo&wmvVideo='.encrypt($SERVER_URL.$fileName)) . "', 'winwmv', 'width=500, height=392, left=600, top=200'); if (window.focus) {winwmv.focus();}"; break 2; case 'url_image': $imgsize = findImageSize($fileName); diff --git a/includes/functions/functions_db.php b/includes/functions/functions_db.php index 7f779a1fdd..de09e3a039 100644 --- a/includes/functions/functions_db.php +++ b/includes/functions/functions_db.php @@ -1764,7 +1764,7 @@ function delete_gedcom($ged_id) { WT_DB::prepare("DELETE FROM {$TBLPREFIX}media_mapping WHERE mm_gedfile=?")->execute(array($ged_id)); WT_DB::prepare("DELETE FROM {$TBLPREFIX}module_privacy WHERE gedcom_id =?")->execute(array($ged_id)); WT_DB::prepare("DELETE FROM {$TBLPREFIX}name WHERE n_file =?")->execute(array($ged_id)); - WT_DB::prepare("DELETE FROM {$TBLPREFIX}nextid WHERE ni_gedfile=?")->execute(array($ged_id)); + WT_DB::prepare("DELETE FROM {$TBLPREFIX}next_id WHERE gedcom_id =?")->execute(array($ged_id)); WT_DB::prepare("DELETE FROM {$TBLPREFIX}other WHERE o_file =?")->execute(array($ged_id)); WT_DB::prepare("DELETE FROM {$TBLPREFIX}placelinks WHERE pl_file =?")->execute(array($ged_id)); WT_DB::prepare("DELETE FROM {$TBLPREFIX}places WHERE p_file =?")->execute(array($ged_id)); @@ -2663,6 +2663,32 @@ function set_block_setting($block_id, $setting_name, $setting_value) { } } +function get_module_setting($module_name, $setting_name, $default_value=null) { + global $TBLPREFIX; + + $value= + WT_DB::prepare("SELECT setting_value FROM {$TBLPREFIX}module_setting WHERE module_name=? AND setting_name=?") + ->execute(array($module_name, $setting_name)) + ->fetchOne(); + + if (is_null($value)) { + return $default_value; + } else { + return $value; + } +} + +function set_module_setting($module_name, $setting_name, $setting_value) { + global $TBLPREFIX; + + if (is_null($setting_value)) { + WT_DB::prepare("DELETE FROM {$TBLPREFIX}module_setting WHERE module_name=? AND setting_name=?") + ->execute(array($module_name, $setting_name)); + } else { + WT_DB::prepare("REPLACE INTO {$TBLPREFIX}module_setting (module_name, setting_name, setting_value) VALUES (?, ?, ?)") + ->execute(array($module_name, $setting_name, $setting_value)); + } +} /** * update favorites regarding a merge of records diff --git a/includes/functions/functions_import.php b/includes/functions/functions_import.php index 33194aaf53..bd99fcbf51 100644 --- a/includes/functions/functions_import.php +++ b/includes/functions/functions_import.php @@ -1178,11 +1178,11 @@ function empty_database($ged_id, $keepmedia) { WT_DB::prepare("DELETE FROM {$TBLPREFIX}change WHERE gedcom_id=?")->execute(array($ged_id)); if ($keepmedia) { - WT_DB::prepare("DELETE FROM {$TBLPREFIX}link WHERE l_file =? AND l_type<> 'OBJE'")->execute(array($ged_id)); - WT_DB::prepare("DELETE FROM {$TBLPREFIX}nextid WHERE ni_gedfile=? AND ni_type<>'OBJE'")->execute(array($ged_id)); + WT_DB::prepare("DELETE FROM {$TBLPREFIX}link WHERE l_file =? AND l_type <>'OBJE'")->execute(array($ged_id)); + WT_DB::prepare("DELETE FROM {$TBLPREFIX}next_id WHERE gedcom_id=? AND record_type<>'OBJE'")->execute(array($ged_id)); } else { WT_DB::prepare("DELETE FROM {$TBLPREFIX}link WHERE l_file =?")->execute(array($ged_id)); - WT_DB::prepare("DELETE FROM {$TBLPREFIX}nextid WHERE ni_gedfile=?")->execute(array($ged_id)); + WT_DB::prepare("DELETE FROM {$TBLPREFIX}next_id WHERE gedcom_id =?")->execute(array($ged_id)); WT_DB::prepare("DELETE FROM {$TBLPREFIX}media WHERE m_gedfile =?")->execute(array($ged_id)); WT_DB::prepare("DELETE FROM {$TBLPREFIX}media_mapping WHERE mm_gedfile=?")->execute(array($ged_id)); } diff --git a/includes/functions/functions_print_facts.php b/includes/functions/functions_print_facts.php index db591dc410..abcf75e238 100644 --- a/includes/functions/functions_print_facts.php +++ b/includes/functions/functions_print_facts.php @@ -1481,7 +1481,7 @@ function print_main_media_row($rtype, $rowm, $pid) { } else { $file_type = 'local_'; } - if (preg_match("/\.flv$/i", $rowm['m_file']) && file_exists(WT_ROOT.'modules/JWplayer/flvVideo.php')) { + if (preg_match("/\.flv$/i", $rowm['m_file']) && file_exists(WT_ROOT.'modules/jw_player/flvVideo.php')) { $file_type .= 'flv'; } elseif (preg_match("/\.(jpg|jpeg|gif|png)$/i", $rowm['m_file'])) { $file_type .= 'image'; diff --git a/modules/googlemap/db_schema/db_schema_1_2.php b/modules/googlemap/db_schema/db_schema_1_2.php index 38bdc05bd8..609ec27738 100644 --- a/modules/googlemap/db_schema/db_schema_1_2.php +++ b/modules/googlemap/db_schema/db_schema_1_2.php @@ -47,37 +47,37 @@ if (file_exists(WT_ROOT.'modules/googlemap/config.php')) { // Use @, in case the config.php file is incomplete/corrupt @require WT_ROOT.'modules/googlemap/config.php'; // Rename settings from GOOGLEMAP_ to GM_ for consistency. - @set_site_setting('GM_ENABLED', (int)$GOOGLEMAP_ENABLED); - @set_site_setting('GM_API_KEY', $GOOGLEMAP_API_KEY); - @set_site_setting('GM_MAP_TYPE', $GOOGLEMAP_MAP_TYPE); - @set_site_setting('GM_MIN_ZOOM', $GOOGLEMAP_MIN_ZOOM); - @set_site_setting('GM_MAX_ZOOM', $GOOGLEMAP_MAX_ZOOM); - @set_site_setting('GM_XSIZE', $GOOGLEMAP_XSIZE); - @set_site_setting('GM_YSIZE', $GOOGLEMAP_YSIZE); - @set_site_setting('GM_PRECISION_0', $GOOGLEMAP_PRECISION_0); - @set_site_setting('GM_PRECISION_1', $GOOGLEMAP_PRECISION_1); - @set_site_setting('GM_PRECISION_2', $GOOGLEMAP_PRECISION_2); - @set_site_setting('GM_PRECISION_3', $GOOGLEMAP_PRECISION_3); - @set_site_setting('GM_PRECISION_4', $GOOGLEMAP_PRECISION_4); - @set_site_setting('GM_PRECISION_5', $GOOGLEMAP_PRECISION_5); - @set_site_setting('GM_DEFAULT_TOP_VALUE', $GM_DEFAULT_TOP_VALUE); - @set_site_setting('GM_MAX_NOF_LEVELS', $GM_MAX_NOF_LEVELS); - @set_site_setting('GM_COORD', (int)$GOOGLEMAP_COORD); - @set_site_setting('GM_PLACE_HIERARCHY', (int)$GOOGLEMAP_PLACE_HIERARCHY); - @set_site_setting('GM_PH_XSIZE', $GOOGLEMAP_PH_XSIZE); - @set_site_setting('GM_PH_YSIZE', $GOOGLEMAP_PH_YSIZE); - @set_site_setting('GM_PH_MARKER', $GOOGLEMAP_PH_MARKER); - @set_site_setting('GM_DISP_SHORT_PLACE', (int)$GM_DISP_SHORT_PLACE); - @set_site_setting('GM_PH_WHEEL', (int)$GOOGLEMAP_PH_WHEEL); - @set_site_setting('GM_PH_CONTROLS', (int)$GOOGLEMAP_PH_CONTROLS); - @set_site_setting('GM_DISP_COUNT', (int)$GM_DISP_COUNT); + @set_module_setting('googlemap', 'GM_ENABLED', (int)$GOOGLEMAP_ENABLED); + @set_module_setting('googlemap', 'GM_API_KEY', $GOOGLEMAP_API_KEY); + @set_module_setting('googlemap', 'GM_MAP_TYPE', $GOOGLEMAP_MAP_TYPE); + @set_module_setting('googlemap', 'GM_MIN_ZOOM', $GOOGLEMAP_MIN_ZOOM); + @set_module_setting('googlemap', 'GM_MAX_ZOOM', $GOOGLEMAP_MAX_ZOOM); + @set_module_setting('googlemap', 'GM_XSIZE', $GOOGLEMAP_XSIZE); + @set_module_setting('googlemap', 'GM_YSIZE', $GOOGLEMAP_YSIZE); + @set_module_setting('googlemap', 'GM_PRECISION_0', $GOOGLEMAP_PRECISION_0); + @set_module_setting('googlemap', 'GM_PRECISION_1', $GOOGLEMAP_PRECISION_1); + @set_module_setting('googlemap', 'GM_PRECISION_2', $GOOGLEMAP_PRECISION_2); + @set_module_setting('googlemap', 'GM_PRECISION_3', $GOOGLEMAP_PRECISION_3); + @set_module_setting('googlemap', 'GM_PRECISION_4', $GOOGLEMAP_PRECISION_4); + @set_module_setting('googlemap', 'GM_PRECISION_5', $GOOGLEMAP_PRECISION_5); + @set_module_setting('googlemap', 'GM_DEFAULT_TOP_VALUE', $GM_DEFAULT_TOP_VALUE); + @set_module_setting('googlemap', 'GM_MAX_NOF_LEVELS', $GM_MAX_NOF_LEVELS); + @set_module_setting('googlemap', 'GM_COORD', (int)$GOOGLEMAP_COORD); + @set_module_setting('googlemap', 'GM_PLACE_HIERARCHY', (int)$GOOGLEMAP_PLACE_HIERARCHY); + @set_module_setting('googlemap', 'GM_PH_XSIZE', $GOOGLEMAP_PH_XSIZE); + @set_module_setting('googlemap', 'GM_PH_YSIZE', $GOOGLEMAP_PH_YSIZE); + @set_module_setting('googlemap', 'GM_PH_MARKER', $GOOGLEMAP_PH_MARKER); + @set_module_setting('googlemap', 'GM_DISP_SHORT_PLACE', (int)$GM_DISP_SHORT_PLACE); + @set_module_setting('googlemap', 'GM_PH_WHEEL', (int)$GOOGLEMAP_PH_WHEEL); + @set_module_setting('googlemap', 'GM_PH_CONTROLS', (int)$GOOGLEMAP_PH_CONTROLS); + @set_module_setting('googlemap', 'GM_DISP_COUNT', (int)$GM_DISP_COUNT); for ($i=1; $i<=9; $i++) { - @set_site_setting('GM_MARKER_COLOR_'.$i, $GM_MARKER_COLOR[$i]); - @set_site_setting('GM_MARKER_SIZE_'.$i, $GM_MARKER_SIZE[$i]); - @set_site_setting('GM_PREFIX_'.$i, $GM_PREFIX[$i]); - @set_site_setting('GM_POSTFIX_'.$i, $GM_POSTFIX[$i]); - @set_site_setting('GM_PRE_POST_MODE_'.$i, $GM_PRE_POST_MODE[$i]); + @set_module_setting('googlemap', 'GM_MARKER_COLOR_'.$i, $GM_MARKER_COLOR[$i]); + @set_module_setting('googlemap', 'GM_MARKER_SIZE_'.$i, $GM_MARKER_SIZE[$i]); + @set_module_setting('googlemap', 'GM_PREFIX_'.$i, $GM_PREFIX[$i]); + @set_module_setting('googlemap', 'GM_POSTFIX_'.$i, $GM_POSTFIX[$i]); + @set_module_setting('googlemap', 'GM_PRE_POST_MODE_'.$i, $GM_PRE_POST_MODE[$i]); } @unlink(WT_ROOT.'modules/googlemap/config.php'); } diff --git a/modules/googlemap/defaultconfig.php b/modules/googlemap/defaultconfig.php index 7c73d9f64d..7d9b1e1228 100644 --- a/modules/googlemap/defaultconfig.php +++ b/modules/googlemap/defaultconfig.php @@ -42,62 +42,62 @@ try { // TODO: it will be more efficient to fetch all GM_% settings in a single DB query global $GOOGLEMAP_ENABLED; -$GOOGLEMAP_ENABLED = get_site_setting('GM_ENABLED', '0'); // Enable or disable Googlemap +$GOOGLEMAP_ENABLED = get_module_setting('googlemap', 'GM_ENABLED', '0'); // Enable or disable Googlemap global $GOOGLEMAP_API_KEY; -$GOOGLEMAP_API_KEY = get_site_setting('GM_API_KEY', 'Fill in your key here. Request key from http://www.google.com/apis/maps/'); // Fill in your key here. Request key from http://www.google.com/apis/maps/ +$GOOGLEMAP_API_KEY = get_module_setting('googlemap', 'GM_API_KEY', 'Fill in your key here. Request key from http://www.google.com/apis/maps/'); // Fill in your key here. Request key from http://www.google.com/apis/maps/ global $GOOGLEMAP_MAP_TYPE; -$GOOGLEMAP_MAP_TYPE = get_site_setting('GM_MAP_TYPE', 'G_NORMAL_MAP'); // possible values: G_PHYSICAL_MAP, G_NORMAL_MAP, G_SATELLITE_MAP or G_HYBRID_MAP. +$GOOGLEMAP_MAP_TYPE = get_module_setting('googlemap', 'GM_MAP_TYPE', 'G_NORMAL_MAP'); // possible values: G_PHYSICAL_MAP, G_NORMAL_MAP, G_SATELLITE_MAP or G_HYBRID_MAP. global $GOOGLEMAP_MIN_ZOOM; -$GOOGLEMAP_MIN_ZOOM = get_site_setting('GM_MIN_ZOOM', '2'); // min zoom level +$GOOGLEMAP_MIN_ZOOM = get_module_setting('googlemap', 'GM_MIN_ZOOM', '2'); // min zoom level global $GOOGLEMAP_MAX_ZOOM; -$GOOGLEMAP_MAX_ZOOM = get_site_setting('GM_MAX_ZOOM', '13'); // max zoom level +$GOOGLEMAP_MAX_ZOOM = get_module_setting('googlemap', 'GM_MAX_ZOOM', '13'); // max zoom level global $GOOGLEMAP_XSIZE; -$GOOGLEMAP_XSIZE = get_site_setting('GM_XSIZE', '600'); // X-size of Google map +$GOOGLEMAP_XSIZE = get_module_setting('googlemap', 'GM_XSIZE', '600'); // X-size of Google map global $GOOGLEMAP_YSIZE; -$GOOGLEMAP_YSIZE = get_site_setting('GM_YSIZE', '400'); // Y-size of Google map +$GOOGLEMAP_YSIZE = get_module_setting('googlemap', 'GM_YSIZE', '400'); // Y-size of Google map global $GOOGLEMAP_PRECISION_0; -$GOOGLEMAP_PRECISION_0 = get_site_setting('GM_PRECISION_0', '0'); // Country level +$GOOGLEMAP_PRECISION_0 = get_module_setting('googlemap', 'GM_PRECISION_0', '0'); // Country level global $GOOGLEMAP_PRECISION_1; -$GOOGLEMAP_PRECISION_1 = get_site_setting('GM_PRECISION_1', '1'); // State level +$GOOGLEMAP_PRECISION_1 = get_module_setting('googlemap', 'GM_PRECISION_1', '1'); // State level global $GOOGLEMAP_PRECISION_2; -$GOOGLEMAP_PRECISION_2 = get_site_setting('GM_PRECISION_2', '2'); // City level +$GOOGLEMAP_PRECISION_2 = get_module_setting('googlemap', 'GM_PRECISION_2', '2'); // City level global $GOOGLEMAP_PRECISION_3; -$GOOGLEMAP_PRECISION_3 = get_site_setting('GM_PRECISION_3', '3'); // Neighborhood level +$GOOGLEMAP_PRECISION_3 = get_module_setting('googlemap', 'GM_PRECISION_3', '3'); // Neighborhood level global $GOOGLEMAP_PRECISION_4; -$GOOGLEMAP_PRECISION_4 = get_site_setting('GM_PRECISION_4', '4'); // House level +$GOOGLEMAP_PRECISION_4 = get_module_setting('googlemap', 'GM_PRECISION_4', '4'); // House level global $GOOGLEMAP_PRECISION_5; -$GOOGLEMAP_PRECISION_5 = get_site_setting('GM_PRECISION_5', '9'); // Max prcision level +$GOOGLEMAP_PRECISION_5 = get_module_setting('googlemap', 'GM_PRECISION_5', '9'); // Max prcision level global $GM_MAX_NOF_LEVELS; -$GM_MAX_NOF_LEVELS = get_site_setting('GM_MAX_NOF_LEVELS', '4'); // Max nr of levels to use in Googlemap +$GM_MAX_NOF_LEVELS = get_module_setting('googlemap', 'GM_MAX_NOF_LEVELS', '4'); // Max nr of levels to use in Googlemap global $GM_DEFAULT_TOP_VALUE; -$GM_DEFAULT_TOP_VALUE = get_site_setting('GM_DEFAULT_TOP_VALUE', '' ); // Default value, inserted when no location can be found +$GM_DEFAULT_TOP_VALUE = get_module_setting('googlemap', 'GM_DEFAULT_TOP_VALUE', '' ); // Default value, inserted when no location can be found global $GOOGLEMAP_COORD; -$GOOGLEMAP_COORD = get_site_setting('GM_COORD', '0'); // Enable or disable Display Map Co-ordinates +$GOOGLEMAP_COORD = get_module_setting('googlemap', 'GM_COORD', '0'); // Enable or disable Display Map Co-ordinates //Place Hierarchy global $GOOGLEMAP_PLACE_HIERARCHY; -$GOOGLEMAP_PLACE_HIERARCHY=get_site_setting('GM_PLACE_HIERARCHY', '1' ); // Enable or disable Display Map in place herarchy +$GOOGLEMAP_PLACE_HIERARCHY=get_module_setting('googlemap', 'GM_PLACE_HIERARCHY', '1' ); // Enable or disable Display Map in place herarchy global $GOOGLEMAP_PH_XSIZE; -$GOOGLEMAP_PH_XSIZE =get_site_setting('GM_PH_XSIZE', '500' ); // X-size of Place Hierarchy Google map +$GOOGLEMAP_PH_XSIZE =get_module_setting('googlemap', 'GM_PH_XSIZE', '500' ); // X-size of Place Hierarchy Google map global $GOOGLEMAP_PH_YSIZE; -$GOOGLEMAP_PH_YSIZE =get_site_setting('GM_PH_YSIZE', '350' ); // Y-size of Place Hierarchy Google map +$GOOGLEMAP_PH_YSIZE =get_module_setting('googlemap', 'GM_PH_YSIZE', '350' ); // Y-size of Place Hierarchy Google map global $GOOGLEMAP_PH_MARKER; -$GOOGLEMAP_PH_MARKER =get_site_setting('GM_PH_MARKER', 'G_FLAG'); // Possible values: G_FLAG = Flag, G_DEFAULT_ICON = Standard icon +$GOOGLEMAP_PH_MARKER =get_module_setting('googlemap', 'GM_PH_MARKER', 'G_FLAG'); // Possible values: G_FLAG = Flag, G_DEFAULT_ICON = Standard icon global $GM_DISP_SHORT_PLACE; -$GM_DISP_SHORT_PLACE =get_site_setting('GM_DISP_SHORT_PLACE', '0'); // Display full place name or only the actual level name +$GM_DISP_SHORT_PLACE =get_module_setting('googlemap', 'GM_DISP_SHORT_PLACE', '0'); // Display full place name or only the actual level name global $GM_DISP_COUNT; -$GM_DISP_COUNT =get_site_setting('GM_DISP_COUNT', '0'); // Display the count of individuals and families connected to the place +$GM_DISP_COUNT =get_module_setting('googlemap', 'GM_DISP_COUNT', '0'); // Display the count of individuals and families connected to the place global $GOOGLEMAP_PH_WHEEL; -$GOOGLEMAP_PH_WHEEL =get_site_setting('GM_PH_WHEEL', '0'); // Use mouse wheel for zooming +$GOOGLEMAP_PH_WHEEL =get_module_setting('googlemap', 'GM_PH_WHEEL', '0'); // Use mouse wheel for zooming global $GOOGLEMAP_PH_CONTROLS; -$GOOGLEMAP_PH_CONTROLS =get_site_setting('GM_PH_CONTROLS', '1'); // Hide map controls when mouse is out +$GOOGLEMAP_PH_CONTROLS =get_module_setting('googlemap', 'GM_PH_CONTROLS', '1'); // Hide map controls when mouse is out // Configuration-options per location-level @@ -107,11 +107,11 @@ global $GM_PREFIX; global $GM_POSTFIX; global $GM_PRE_POST_MODE; -$GM_MARKER_COLOR [1]=get_site_setting('GM_MARKER_COLOR_1', 'Red' ); // Marker to be used -$GM_MARKER_SIZE [1]=get_site_setting('GM_MARKER_SIZE_1', 'Large'); // 'Small' or 'Large' -$GM_PREFIX [1]=get_site_setting('GM_PREFIX_1', '' ); // Text to be placed in front of the name -$GM_POSTFIX [1]=get_site_setting('GM_POSTFIX_1', '' ); // Text to be placed after the name -$GM_PRE_POST_MODE[1]=get_site_setting('GM_PRE_POST_MODE_1', '0' ); // Prefix/Postfix mode. Possible value are: +$GM_MARKER_COLOR [1]=get_module_setting('googlemap', 'GM_MARKER_COLOR_1', 'Red' ); // Marker to be used +$GM_MARKER_SIZE [1]=get_module_setting('googlemap', 'GM_MARKER_SIZE_1', 'Large'); // 'Small' or 'Large' +$GM_PREFIX [1]=get_module_setting('googlemap', 'GM_PREFIX_1', '' ); // Text to be placed in front of the name +$GM_POSTFIX [1]=get_module_setting('googlemap', 'GM_POSTFIX_1', '' ); // Text to be placed after the name +$GM_PRE_POST_MODE[1]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_1', '0' ); // Prefix/Postfix mode. Possible value are: // 0 = no pre/postfix // 1 = Normal name, Prefix, Postfix, Both // 2 = Normal name, Postfix, Prefxi, Both @@ -120,53 +120,53 @@ $GM_PRE_POST_MODE[1]=get_site_setting('GM_PRE_POST_MODE_1', '0' ); // Prefix/ // 5 = Prefix, Postfix, Normal name, Both // 6 = Postfix, Prefix, Normal name, Both -$GM_MARKER_COLOR [2]=get_site_setting('GM_MARKER_COLOR_2', 'Red' ); -$GM_MARKER_SIZE [2]=get_site_setting('GM_MARKER_SIZE_2', 'Large'); -$GM_PREFIX [2]=get_site_setting('GM_PREFIX_2', '' ); -$GM_POSTFIX [2]=get_site_setting('GM_POSTFIX_2', '' ); -$GM_PRE_POST_MODE[2]=get_site_setting('GM_PRE_POST_MODE_2', '0' ); +$GM_MARKER_COLOR [2]=get_module_setting('googlemap', 'GM_MARKER_COLOR_2', 'Red' ); +$GM_MARKER_SIZE [2]=get_module_setting('googlemap', 'GM_MARKER_SIZE_2', 'Large'); +$GM_PREFIX [2]=get_module_setting('googlemap', 'GM_PREFIX_2', '' ); +$GM_POSTFIX [2]=get_module_setting('googlemap', 'GM_POSTFIX_2', '' ); +$GM_PRE_POST_MODE[2]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_2', '0' ); -$GM_MARKER_COLOR [3]=get_site_setting('GM_MARKER_COLOR_3', 'Red' ); -$GM_MARKER_SIZE [3]=get_site_setting('GM_MARKER_SIZE_3', 'Large'); -$GM_PREFIX [3]=get_site_setting('GM_PREFIX_3', '' ); -$GM_POSTFIX [3]=get_site_setting('GM_POSTFIX_3', '' ); -$GM_PRE_POST_MODE[3]=get_site_setting('GM_PRE_POST_MODE_3', '0' ); +$GM_MARKER_COLOR [3]=get_module_setting('googlemap', 'GM_MARKER_COLOR_3', 'Red' ); +$GM_MARKER_SIZE [3]=get_module_setting('googlemap', 'GM_MARKER_SIZE_3', 'Large'); +$GM_PREFIX [3]=get_module_setting('googlemap', 'GM_PREFIX_3', '' ); +$GM_POSTFIX [3]=get_module_setting('googlemap', 'GM_POSTFIX_3', '' ); +$GM_PRE_POST_MODE[3]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_3', '0' ); -$GM_MARKER_COLOR [4]=get_site_setting('GM_MARKER_COLOR_4', 'Red' ); -$GM_MARKER_SIZE [4]=get_site_setting('GM_MARKER_SIZE_4', 'Large'); -$GM_PREFIX [4]=get_site_setting('GM_PREFIX_4', '' ); -$GM_POSTFIX [4]=get_site_setting('GM_POSTFIX_4', '' ); -$GM_PRE_POST_MODE[4]=get_site_setting('GM_PRE_POST_MODE_4', '0' ); +$GM_MARKER_COLOR [4]=get_module_setting('googlemap', 'GM_MARKER_COLOR_4', 'Red' ); +$GM_MARKER_SIZE [4]=get_module_setting('googlemap', 'GM_MARKER_SIZE_4', 'Large'); +$GM_PREFIX [4]=get_module_setting('googlemap', 'GM_PREFIX_4', '' ); +$GM_POSTFIX [4]=get_module_setting('googlemap', 'GM_POSTFIX_4', '' ); +$GM_PRE_POST_MODE[4]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_4', '0' ); -$GM_MARKER_COLOR [5]=get_site_setting('GM_MARKER_COLOR_5', 'Red' ); -$GM_MARKER_SIZE [5]=get_site_setting('GM_MARKER_SIZE_5', 'Large'); -$GM_PREFIX [5]=get_site_setting('GM_PREFIX_5', '' ); -$GM_POSTFIX [5]=get_site_setting('GM_POSTFIX_5', '' ); -$GM_PRE_POST_MODE[5]=get_site_setting('GM_PRE_POST_MODE_5', '0' ); +$GM_MARKER_COLOR [5]=get_module_setting('googlemap', 'GM_MARKER_COLOR_5', 'Red' ); +$GM_MARKER_SIZE [5]=get_module_setting('googlemap', 'GM_MARKER_SIZE_5', 'Large'); +$GM_PREFIX [5]=get_module_setting('googlemap', 'GM_PREFIX_5', '' ); +$GM_POSTFIX [5]=get_module_setting('googlemap', 'GM_POSTFIX_5', '' ); +$GM_PRE_POST_MODE[5]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_5', '0' ); -$GM_MARKER_COLOR [6]=get_site_setting('GM_MARKER_COLOR_6', 'Red' ); -$GM_MARKER_SIZE [6]=get_site_setting('GM_MARKER_SIZE_6', 'Large'); -$GM_PREFIX [6]=get_site_setting('GM_PREFIX_6', '' ); -$GM_POSTFIX [6]=get_site_setting('GM_POSTFIX_6', '' ); -$GM_PRE_POST_MODE[6]=get_site_setting('GM_PRE_POST_MODE_6', '0' ); +$GM_MARKER_COLOR [6]=get_module_setting('googlemap', 'GM_MARKER_COLOR_6', 'Red' ); +$GM_MARKER_SIZE [6]=get_module_setting('googlemap', 'GM_MARKER_SIZE_6', 'Large'); +$GM_PREFIX [6]=get_module_setting('googlemap', 'GM_PREFIX_6', '' ); +$GM_POSTFIX [6]=get_module_setting('googlemap', 'GM_POSTFIX_6', '' ); +$GM_PRE_POST_MODE[6]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_6', '0' ); -$GM_MARKER_COLOR [7]=get_site_setting('GM_MARKER_COLOR_7', 'Red' ); -$GM_MARKER_SIZE [7]=get_site_setting('GM_MARKER_SIZE_7', 'Large'); -$GM_PREFIX [7]=get_site_setting('GM_PREFIX_7', '' ); -$GM_POSTFIX [7]=get_site_setting('GM_POSTFIX_7', '' ); -$GM_PRE_POST_MODE[7]=get_site_setting('GM_PRE_POST_MODE_7', '0' ); +$GM_MARKER_COLOR [7]=get_module_setting('googlemap', 'GM_MARKER_COLOR_7', 'Red' ); +$GM_MARKER_SIZE [7]=get_module_setting('googlemap', 'GM_MARKER_SIZE_7', 'Large'); +$GM_PREFIX [7]=get_module_setting('googlemap', 'GM_PREFIX_7', '' ); +$GM_POSTFIX [7]=get_module_setting('googlemap', 'GM_POSTFIX_7', '' ); +$GM_PRE_POST_MODE[7]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_7', '0' ); -$GM_MARKER_COLOR [8]=get_site_setting('GM_MARKER_COLOR_8', 'Red' ); -$GM_MARKER_SIZE [8]=get_site_setting('GM_MARKER_SIZE_8', 'Large'); -$GM_PREFIX [8]=get_site_setting('GM_PREFIX_8', '' ); -$GM_POSTFIX [8]=get_site_setting('GM_POSTFIX_8', '' ); -$GM_PRE_POST_MODE[8]=get_site_setting('GM_PRE_POST_MODE_8', '0' ); +$GM_MARKER_COLOR [8]=get_module_setting('googlemap', 'GM_MARKER_COLOR_8', 'Red' ); +$GM_MARKER_SIZE [8]=get_module_setting('googlemap', 'GM_MARKER_SIZE_8', 'Large'); +$GM_PREFIX [8]=get_module_setting('googlemap', 'GM_PREFIX_8', '' ); +$GM_POSTFIX [8]=get_module_setting('googlemap', 'GM_POSTFIX_8', '' ); +$GM_PRE_POST_MODE[8]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_8', '0' ); -$GM_MARKER_COLOR [9]=get_site_setting('GM_MARKER_COLOR_9', 'Red' ); -$GM_MARKER_SIZE [9]=get_site_setting('GM_MARKER_SIZE_9', 'Large'); -$GM_PREFIX [9]=get_site_setting('GM_PREFIX_9', '' ); -$GM_POSTFIX [9]=get_site_setting('GM_POSTFIX_9', '' ); -$GM_PRE_POST_MODE[9]=get_site_setting('GM_PRE_POST_MODE_9', '0' ); +$GM_MARKER_COLOR [9]=get_module_setting('googlemap', 'GM_MARKER_COLOR_9', 'Red' ); +$GM_MARKER_SIZE [9]=get_module_setting('googlemap', 'GM_MARKER_SIZE_9', 'Large'); +$GM_PREFIX [9]=get_module_setting('googlemap', 'GM_PREFIX_9', '' ); +$GM_POSTFIX [9]=get_module_setting('googlemap', 'GM_POSTFIX_9', '' ); +$GM_PRE_POST_MODE[9]=get_module_setting('googlemap', 'GM_PRE_POST_MODE_9', '0' ); ?> diff --git a/modules/googlemap/editconfig.php b/modules/googlemap/editconfig.php index 4f32991e22..6ea7ab4a11 100644 --- a/modules/googlemap/editconfig.php +++ b/modules/googlemap/editconfig.php @@ -100,35 +100,35 @@ if (!WT_USER_IS_ADMIN) { } if ($action=="update" && !isset($security_user)) { - set_site_setting('GM_ENABLED', $_POST['NEW_GM_ENABLE']); - set_site_setting('GM_API_KEY', $_POST['NEW_GM_API_KEY']); - set_site_setting('GM_MAP_TYPE', $_POST['NEW_GM_MAP_TYPE']); - set_site_setting('GM_MIN_ZOOM', $_POST['NEW_GM_MIN_ZOOM']); - set_site_setting('GM_MAX_ZOOM', $_POST['NEW_GM_MAX_ZOOM']); - set_site_setting('GM_XSIZE', $_POST['NEW_GM_XSIZE']); - set_site_setting('GM_YSIZE', $_POST['NEW_GM_YSIZE']); - set_site_setting('GM_PRECISION_0', $_POST['NEW_GM_PRECISION_0']); - set_site_setting('GM_PRECISION_1', $_POST['NEW_GM_PRECISION_1']); - set_site_setting('GM_PRECISION_2', $_POST['NEW_GM_PRECISION_2']); - set_site_setting('GM_PRECISION_3', $_POST['NEW_GM_PRECISION_3']); - set_site_setting('GM_PRECISION_4', $_POST['NEW_GM_PRECISION_4']); - set_site_setting('GM_PRECISION_5', $_POST['NEW_GM_PRECISION_5']); - set_site_setting('GM_DEFAULT_TOP_VALUE', $_POST['NEW_GM_DEFAULT_TOP_LEVEL']); - set_site_setting('GM_MAX_NOF_LEVELS', $_POST['NEW_GM_LEVEL_COUNT']); - set_site_setting('GM_COORD', $_POST['NEW_GM_COORD']); - set_site_setting('GM_PLACE_HIERARCHY', $_POST['NEW_GM_PLACE_HIERARCHY']); - set_site_setting('GM_PH_XSIZE', $_POST['NEW_GM_PH_XSIZE']); - set_site_setting('GM_PH_YSIZE', $_POST['NEW_GM_PH_YSIZE']); - set_site_setting('GM_PH_MARKER', $_POST['NEW_GM_PH_MARKER']); - set_site_setting('GM_DISP_SHORT_PLACE', $_POST['NEW_GM_DISP_SHORT_PLACE']); - set_site_setting('GM_PH_WHEEL', $_POST['NEW_GM_PH_WHEEL']); - set_site_setting('GM_PH_CONTROLS', $_POST['NEW_GM_PH_CONTROLS']); - set_site_setting('GM_DISP_COUNT', $_POST['NEW_GM_DISP_COUNT']); + set_module_setting('googlemap', 'GM_ENABLED', $_POST['NEW_GM_ENABLE']); + set_module_setting('googlemap', 'GM_API_KEY', $_POST['NEW_GM_API_KEY']); + set_module_setting('googlemap', 'GM_MAP_TYPE', $_POST['NEW_GM_MAP_TYPE']); + set_module_setting('googlemap', 'GM_MIN_ZOOM', $_POST['NEW_GM_MIN_ZOOM']); + set_module_setting('googlemap', 'GM_MAX_ZOOM', $_POST['NEW_GM_MAX_ZOOM']); + set_module_setting('googlemap', 'GM_XSIZE', $_POST['NEW_GM_XSIZE']); + set_module_setting('googlemap', 'GM_YSIZE', $_POST['NEW_GM_YSIZE']); + set_module_setting('googlemap', 'GM_PRECISION_0', $_POST['NEW_GM_PRECISION_0']); + set_module_setting('googlemap', 'GM_PRECISION_1', $_POST['NEW_GM_PRECISION_1']); + set_module_setting('googlemap', 'GM_PRECISION_2', $_POST['NEW_GM_PRECISION_2']); + set_module_setting('googlemap', 'GM_PRECISION_3', $_POST['NEW_GM_PRECISION_3']); + set_module_setting('googlemap', 'GM_PRECISION_4', $_POST['NEW_GM_PRECISION_4']); + set_module_setting('googlemap', 'GM_PRECISION_5', $_POST['NEW_GM_PRECISION_5']); + set_module_setting('googlemap', 'GM_DEFAULT_TOP_VALUE', $_POST['NEW_GM_DEFAULT_TOP_LEVEL']); + set_module_setting('googlemap', 'GM_MAX_NOF_LEVELS', $_POST['NEW_GM_LEVEL_COUNT']); + set_module_setting('googlemap', 'GM_COORD', $_POST['NEW_GM_COORD']); + set_module_setting('googlemap', 'GM_PLACE_HIERARCHY', $_POST['NEW_GM_PLACE_HIERARCHY']); + set_module_setting('googlemap', 'GM_PH_XSIZE', $_POST['NEW_GM_PH_XSIZE']); + set_module_setting('googlemap', 'GM_PH_YSIZE', $_POST['NEW_GM_PH_YSIZE']); + set_module_setting('googlemap', 'GM_PH_MARKER', $_POST['NEW_GM_PH_MARKER']); + set_module_setting('googlemap', 'GM_DISP_SHORT_PLACE', $_POST['NEW_GM_DISP_SHORT_PLACE']); + set_module_setting('googlemap', 'GM_PH_WHEEL', $_POST['NEW_GM_PH_WHEEL']); + set_module_setting('googlemap', 'GM_PH_CONTROLS', $_POST['NEW_GM_PH_CONTROLS']); + set_module_setting('googlemap', 'GM_DISP_COUNT', $_POST['NEW_GM_DISP_COUNT']); for ($i=1; $i<=9; $i++) { - set_site_setting('GM_PREFIX_'.$i, $_POST['NEW_GM_PREFIX_'.$i]); - set_site_setting('GM_POSTFIX_'.$i, $_POST['NEW_GM_POSTFIX_'.$i]); - set_site_setting('GM_PRE_POST_MODE_'.$i, $_POST['NEW_GM_PRE_POST_MODE_'.$i]); + set_module_setting('googlemap', 'GM_PREFIX_'.$i, $_POST['NEW_GM_PREFIX_'.$i]); + set_module_setting('googlemap', 'GM_POSTFIX_'.$i, $_POST['NEW_GM_POSTFIX_'.$i]); + set_module_setting('googlemap', 'GM_PRE_POST_MODE_'.$i, $_POST['NEW_GM_PRE_POST_MODE_'.$i]); } AddToLog('Googlemap config updated', 'config'); diff --git a/modules/block_htmlplus/module.php b/modules/html/module.php index c7d12bd795..07c100f8da 100644 --- a/modules/block_htmlplus/module.php +++ b/modules/html/module.php @@ -32,10 +32,10 @@ if (!defined('WT_WEBTREES')) { require_once WT_ROOT.'includes/classes/class_module.php'; -class block_htmlplus_WT_Module extends WT_Module implements WT_Module_Block { +class html_WT_Module extends WT_Module implements WT_Module_Block { // Extend class WT_Module public function getTitle() { - return i18n::translate('Advanced HTML'); + return i18n::translate('HTML'); } // Extend class WT_Module @@ -192,9 +192,9 @@ class block_htmlplus_WT_Module extends WT_Module implements WT_Module_Block { require_once WT_ROOT.'includes/functions/functions_edit.php'; - $useFCK = file_exists(WT_ROOT.'modules/FCKeditor/fckeditor.php'); + $useFCK = file_exists(WT_ROOT.'modules/fck_editor/fckeditor.php'); if($useFCK){ - require WT_ROOT.'modules/FCKeditor/fckeditor.php'; + require WT_ROOT.'modules/fck_editor/fckeditor.php'; } $templates=array( @@ -385,9 +385,9 @@ i18n::translate('Narrative description')=>/* I18N: do not translate the #keyword if($useFCK) { // use FCKeditor module - require_once WT_ROOT.'modules/FCKeditor/fckeditor.php'; + require_once WT_ROOT.'modules/fck_editor/fckeditor.php'; $oFCKeditor = new FCKeditor('html') ; - $oFCKeditor->BasePath = './modules/FCKeditor/'; + $oFCKeditor->BasePath = './modules/fck_editor/'; $oFCKeditor->Value = $html; $oFCKeditor->Width = 700; $oFCKeditor->Height = 250; diff --git a/modules/html_block/module.php b/modules/html_block/module.php deleted file mode 100644 index 0fb7ad1662..0000000000 --- a/modules/html_block/module.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php -/** - * Classes and libraries for module system - * - * webtrees: Web based Family History software - * Copyright (C) 2010 webtrees development team. - * - * Derived from PhpGedView - * Copyright (C) 2010 John Finlay - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @version $Id: class_media.php 5451 2009-05-05 22:15:34Z fisharebest $ - */ - -if (!defined('WT_WEBTREES')) { - header('HTTP/1.0 403 Forbidden'); - exit; -} - -require_once WT_ROOT.'includes/classes/class_module.php'; - -class html_block_WT_Module extends WT_Module implements WT_Module_Block { - // Extend class WT_Module - public function getTitle() { - return i18n::translate('HTML'); - } - - // Extend class WT_Module - public function getDescription() { - return i18n::translate('This is a simple HTML block that you can place on your page to add any sort of message you may want.'); - } - - // Implement class WT_Module_Block - public function getBlock($block_id) { - global $ctype, $WT_IMAGE_DIR, $WT_IMAGES, $THEME_DIR; - - // Only show this block for certain languages - $languages=get_block_setting($block_id, 'languages'); - if ($languages && !in_array(WT_LOCALE, explode(',', $languages))) { - return; - } - - $id=$this->getName().$block_id; - $title=''; - $content=embed_globals(get_block_setting($block_id, 'html')); - - if ($ctype=="gedcom" && WT_USER_GEDCOM_ADMIN || $ctype=="user") { - $content .= "<a href=\"javascript: configure block\" onclick=\"window.open('index_edit.php?action=configure&ctype={$ctype}&block_id={$block_id}', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">" - ."<img class=\"adminicon\" src=\"{$WT_IMAGE_DIR}/{$WT_IMAGES['admin']['small']}\" width=\"15\" height=\"15\" border=\"0\" alt=\"".i18n::translate('Configure').'" /></a>'; - } - - $block=get_block_setting($block_id, 'block', false); - if ($block) { - require $THEME_DIR.'templates/block_small_temp.php'; - } else { - require $THEME_DIR.'templates/block_main_temp.php'; - } - } - - // Implement class WT_Module_Block - public function loadAjax() { - return true; - } - - // Implement class WT_Module_Block - public function isUserBlock() { - return true; - } - - // Implement class WT_Module_Block - public function isGedcomBlock() { - return true; - } - - // Implement class WT_Module_Block - public function configureBlock($block_id) { - if (safe_POST_bool('save')) { - set_block_setting($block_id, 'html', $_POST['html']); - $languages=array(); - foreach (i18n::installed_languages() as $code=>$name) { - if (safe_POST_bool('lang_'.$code)) { - $languages[]=$code; - } - } - if (!$languages) { - $languages[]=WT_LOCALE; - } - set_block_setting($block_id, 'languages', implode(',', $languages)); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; - exit; - } - - require_once WT_ROOT.'includes/functions/functions_edit.php'; - - $useFCK = file_exists(WT_ROOT.'modules/FCKeditor/fckeditor.php'); - if($useFCK){ - require WT_ROOT.'modules/FCKeditor/fckeditor.php'; - } - -?> - <tr> - <td class="optionbox" colspan="2"><?php - if ($useFCK) { // use FCKeditor module - $oFCKeditor = new FCKeditor('html') ; - $oFCKeditor->BasePath = './modules/FCKeditor/'; - $oFCKeditor->Value = get_block_setting($block_id, 'html'); - $oFCKeditor->Width = 700; - $oFCKeditor->Height = 250; - $oFCKeditor->Config['AutoDetectLanguage'] = false ; - $oFCKeditor->Config['DefaultLanguage'] = WT_LOCALE; - $oFCKeditor->Create() ; - } else { //use standard textarea - echo '<textarea name="html" rows="10" cols="80">', htmlspecialchars(get_block_setting($block_id, 'html')), '</textarea>'; - } - ?></td> - </tr> - <?php - - $languages=get_block_setting($block_id, 'languages', WT_LOCALE); - echo '<tr><td class="descriptionbox wrap width33">'; - echo i18n::translate('Show this block for which languages?'); - echo '</td><td class="optionbox">'; - echo edit_language_checkboxes('lang_', $languages); - echo '</td></tr>'; - } -} diff --git a/modules/JWplayer/audio.png b/modules/jw_player/audio.png Binary files differindex 380e7def33..380e7def33 100644 --- a/modules/JWplayer/audio.png +++ b/modules/jw_player/audio.png diff --git a/modules/JWplayer/audio_2.png b/modules/jw_player/audio_2.png Binary files differindex e479fb2ad9..e479fb2ad9 100644 --- a/modules/JWplayer/audio_2.png +++ b/modules/jw_player/audio_2.png diff --git a/modules/JWplayer/flvVideo.php b/modules/jw_player/flvVideo.php index 31b1d31db8..02d24a3dc1 100644 --- a/modules/JWplayer/flvVideo.php +++ b/modules/jw_player/flvVideo.php @@ -1,6 +1,6 @@ <?php /** - * JWplayer module for phpGedView + * JW Player module for phpGedView * * Display flv video media Items using JW Player in PGV * @@ -35,7 +35,7 @@ <META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <title>JW Player for Flash</title> - <script type="text/javascript" src="modules/JWplayer/swfobject.js"></script> + <script type="text/javascript" src="modules/jw_player/swfobject.js"></script> </head> <body bgcolor="#000000"> <center> @@ -75,7 +75,7 @@ $preview=""; <script type="text/javascript"> var video = "<?php print $flvVideo; ?>"; var preview = "<?php print $preview; ?>"; - var s1 = new SWFObject("modules/JWplayer/player.swf","ply","480","365","9","#000000"); + var s1 = new SWFObject("modules/jw_player/player.swf","ply","480","365","9","#000000"); s1.addParam("allowfullscreen","true"); s1.addParam("allowscriptaccess","always"); s1.addParam("stretching","fill"); diff --git a/modules/JWplayer/module.php b/modules/jw_player/module.php index 36ca4f4dc4..ce9773bbfb 100644 --- a/modules/JWplayer/module.php +++ b/modules/jw_player/module.php @@ -34,7 +34,7 @@ if (!defined('WT_WEBTREES')) { require_once WT_ROOT.'includes/classes/class_module.php'; -class JWplayer_WT_Module extends WT_Module { +class jw_player_WT_Module extends WT_Module { // Extend WT_Module public function getTitle() { // Do not translate this? diff --git a/modules/JWplayer/player.swf b/modules/jw_player/player.swf Binary files differindex 292241910e..292241910e 100644 --- a/modules/JWplayer/player.swf +++ b/modules/jw_player/player.swf diff --git a/modules/JWplayer/silverlight.js b/modules/jw_player/silverlight.js index 8ecfa63392..8ecfa63392 100644 --- a/modules/JWplayer/silverlight.js +++ b/modules/jw_player/silverlight.js diff --git a/modules/JWplayer/swfobject.js b/modules/jw_player/swfobject.js index e7edd42c09..e7edd42c09 100644 --- a/modules/JWplayer/swfobject.js +++ b/modules/jw_player/swfobject.js diff --git a/modules/JWplayer/wmvVideo.php b/modules/jw_player/wmvVideo.php index 49595ed7ee..b7cb4fd89e 100644 --- a/modules/JWplayer/wmvVideo.php +++ b/modules/jw_player/wmvVideo.php @@ -1,6 +1,6 @@ <?php /** - * JWplayer module for phpGedView + * JW Player module for phpGedView * * Display wmv video media Items using JW Player in PGV * @@ -35,8 +35,8 @@ <META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <title>JW Player for Windows Media Videos</title> - <script type="text/javascript" src="modules/JWplayer/silverlight.js"></script> - <script type="text/javascript" src="modules/JWplayer/wmvplayer.js"></script> + <script type="text/javascript" src="modules/jw_player/silverlight.js"></script> + <script type="text/javascript" src="modules/jw_player/wmvplayer.js"></script> </head> <body bgcolor="#000000"> <center> @@ -51,11 +51,11 @@ $wmvVideo=decrypt(safe_GET('wmvVideo')); <script type="text/javascript"> var elm = document.getElementById("myplayer"); - var src = 'modules/JWplayer/wmvplayer.xaml'; + var src = 'modules/jw_player/wmvplayer.xaml'; var cfg = { file:'<?php echo $wmvVideo; ?>', <?php if (preg_match("/\.mp3$/i", $wmvVideo)) { ?> - logo:'modules/JWplayer/audio.png', + logo:'modules/jw_player/audio.png', <?php } ?> autostart:'true', overstretch:'true', diff --git a/modules/JWplayer/wmvplayer.js b/modules/jw_player/wmvplayer.js index 75fb965787..75fb965787 100644 --- a/modules/JWplayer/wmvplayer.js +++ b/modules/jw_player/wmvplayer.js diff --git a/modules/JWplayer/wmvplayer.xaml b/modules/jw_player/wmvplayer.xaml index 17a9dbfb9e..17a9dbfb9e 100644 --- a/modules/JWplayer/wmvplayer.xaml +++ b/modules/jw_player/wmvplayer.xaml diff --git a/modules/JWplayer/yt.swf b/modules/jw_player/yt.swf Binary files differindex 881ec8b35c..881ec8b35c 100644 --- a/modules/JWplayer/yt.swf +++ b/modules/jw_player/yt.swf diff --git a/modules/lightbox/db_schema/db_schema_0_1.php b/modules/lightbox/db_schema/db_schema_0_1.php index d826e43d9d..5593c4dc4b 100644 --- a/modules/lightbox/db_schema/db_schema_0_1.php +++ b/modules/lightbox/db_schema/db_schema_0_1.php @@ -45,16 +45,16 @@ define('WT_LB_DB_SCHEMA_0_1', ''); if (file_exists(WT_ROOT.'modules/lightbox/lb_config.php')) { // Use @, in case the lb_config.php file is incomplete/corrupt @require_once WT_ROOT.'modules/lightbox/lb_config.php'; - @set_site_setting('LB_ENABLED', $mediatab); - @set_site_setting('LB_AL_HEAD_LINKS', $LB_AL_HEAD_LINKS); - @set_site_setting('LB_AL_THUMB_LINKS', $LB_AL_THUMB_LINKS); - @set_site_setting('LB_TT_BALLOON', $LB_TT_BALLOON); - @set_site_setting('LB_ML_THUMB_LINKS', $LB_ML_THUMB_LINKS); - @set_site_setting('LB_MUSIC_FILE', $LB_MUSIC_FILE); - @set_site_setting('LB_SS_SPEED', $LB_SS_SPEED); - @set_site_setting('LB_TRANSITION', $LB_TRANSITION); - @set_site_setting('LB_URL_WIDTH', $LB_URL_WIDTH); - @set_site_setting('LB_URL_HEIGHT', $LB_URL_HEIGHT); + @set_module_setting('lightbox', 'LB_ENABLED', $mediatab); + @set_module_setting('lightbox', 'LB_AL_HEAD_LINKS', $LB_AL_HEAD_LINKS); + @set_module_setting('lightbox', 'LB_AL_THUMB_LINKS', $LB_AL_THUMB_LINKS); + @set_module_setting('lightbox', 'LB_TT_BALLOON', $LB_TT_BALLOON); + @set_module_setting('lightbox', 'LB_ML_THUMB_LINKS', $LB_ML_THUMB_LINKS); + @set_module_setting('lightbox', 'LB_MUSIC_FILE', $LB_MUSIC_FILE); + @set_module_setting('lightbox', 'LB_SS_SPEED', $LB_SS_SPEED); + @set_module_setting('lightbox', 'LB_TRANSITION', $LB_TRANSITION); + @set_module_setting('lightbox', 'LB_URL_WIDTH', $LB_URL_WIDTH); + @set_module_setting('lightbox', 'LB_URL_HEIGHT', $LB_URL_HEIGHT); @unlink(WT_ROOT.'modules/lightbox/lb_config.php'); } diff --git a/modules/lightbox/lb_defaultconfig.php b/modules/lightbox/lb_defaultconfig.php index fcd558670d..9f5205b720 100644 --- a/modules/lightbox/lb_defaultconfig.php +++ b/modules/lightbox/lb_defaultconfig.php @@ -52,38 +52,38 @@ try { // TODO: it will be more efficient to fetch all LB_% settings in a single DB query -$mediatab=get_site_setting('LB_ENABLED', '1'); // Individual Page Media Tab +$mediatab=get_module_setting('lightbox', 'LB_ENABLED', '1'); // Individual Page Media Tab // Set to 0 to hide Media Tab on Indi page from All Users, // Set to 1 to show Media Tab on Indi page to All Users, [Default] -$LB_AL_HEAD_LINKS=get_site_setting('LB_AL_HEAD_LINKS', 'both'); // Album Tab Page Header Links. +$LB_AL_HEAD_LINKS=get_module_setting('lightbox', 'LB_AL_HEAD_LINKS', 'both'); // Album Tab Page Header Links. // Set to 'icon' to view icon links. // Set to 'text' to view text links // Set to 'both' to view both. -$LB_TT_BALLOON=get_site_setting('LB_TT_BALLOON', 'true'); // Album Tab Page - Above Thumbnail Links. +$LB_TT_BALLOON=get_module_setting('lightbox', 'LB_TT_BALLOON', 'true'); // Album Tab Page - Above Thumbnail Links. // Set to 'true' to view Tooltip Balloon. // Set to 'false' to view Tooltip Normal. -$LB_AL_THUMB_LINKS=get_site_setting('LB_AL_THUMB_LINKS', 'text'); // Album Tab Page - Below Thumbnail Links. +$LB_AL_THUMB_LINKS=get_module_setting('lightbox', 'LB_AL_THUMB_LINKS', 'text'); // Album Tab Page - Below Thumbnail Links. // Set to 'icon' to view icon links. // Set to 'text' to view text links. [Default] -$LB_SS_SPEED=get_site_setting('LB_SS_SPEED', '6'); // SlideShow speed in seconds. [Min 2 max 25] +$LB_SS_SPEED=get_module_setting('lightbox', 'LB_SS_SPEED', '6'); // SlideShow speed in seconds. [Min 2 max 25] -$LB_MUSIC_FILE=get_site_setting('LB_MUSIC_FILE', 'modules/lightbox/music/music.mp3'); // The music file. [mp3 only] +$LB_MUSIC_FILE=get_module_setting('lightbox', 'LB_MUSIC_FILE', 'modules/lightbox/music/music.mp3'); // The music file. [mp3 only] -$LB_TRANSITION=get_site_setting('LB_TRANSITION', 'warp'); // Next or Prvious Image Transition effect +$LB_TRANSITION=get_module_setting('lightbox', 'LB_TRANSITION', 'warp'); // Next or Prvious Image Transition effect // Set to 'none' No transtion effect. // Set to 'normal' Normal transtion effect. // Set to 'double' Fast transition effect. // Set to 'warp' Stretch transtition effect. [Default] -$LB_URL_WIDTH =get_site_setting('LB_URL_WIDTH', '1000'); // URL Window width in pixels -$LB_URL_HEIGHT=get_site_setting('LB_URL_HEIGHT', '600'); // URL Window height in pixels +$LB_URL_WIDTH =get_module_setting('lightbox', 'LB_URL_WIDTH', '1000'); // URL Window width in pixels +$LB_URL_HEIGHT=get_module_setting('lightbox', 'LB_URL_HEIGHT', '600'); // URL Window height in pixels -$LB_ML_THUMB_LINKS = get_site_setting('LB_ML_THUMB_LINKS', 'text'); // MultiMedia List Page Thumbnail Links +$LB_ML_THUMB_LINKS = get_module_setting('lightbox', 'LB_ML_THUMB_LINKS', 'text'); // MultiMedia List Page Thumbnail Links // Set to 'icon' to view icon links. // Set to 'text' to view text links. [Default] // Set to 'both' to view both. @@ -92,5 +92,5 @@ $LB_ML_THUMB_LINKS = get_site_setting('LB_ML_THUMB_LINKS', 'text'); // MultiMe // End Configuration Parameters ------------------------------------------------- // Tab id no for Lightbox -$tabno=get_site_setting('GM_ENABLED') ? 8 : 7; +$tabno=get_module_setting('lightbox', 'GM_ENABLED') ? 8 : 7; ?> diff --git a/modules/lightbox/lb_editconfig.php b/modules/lightbox/lb_editconfig.php index c087560091..66340785a6 100644 --- a/modules/lightbox/lb_editconfig.php +++ b/modules/lightbox/lb_editconfig.php @@ -58,16 +58,16 @@ if (!WT_USER_IS_ADMIN) { } if ($action=='update' && !isset($security_user)) { - set_site_setting('LB_ENABLED', $_POST['NEW_mediatab']); - set_site_setting('LB_AL_HEAD_LINKS', $_POST['NEW_LB_AL_HEAD_LINKS']); - set_site_setting('LB_AL_THUMB_LINKS', $_POST['NEW_LB_AL_THUMB_LINKS']); - set_site_setting('LB_TT_BALLOON', $_POST['NEW_LB_TT_BALLOON']); - set_site_setting('LB_ML_THUMB_LINKS', $_POST['NEW_LB_ML_THUMB_LINKS']); - set_site_setting('LB_MUSIC_FILE', $_POST['NEW_LB_MUSIC_FILE']); - set_site_setting('LB_SS_SPEED', $_POST['NEW_LB_SS_SPEED']); - set_site_setting('LB_TRANSITION', $_POST['NEW_LB_TRANSITION']); - set_site_setting('LB_URL_WIDTH', $_POST['NEW_LB_URL_WIDTH']); - set_site_setting('LB_URL_HEIGHT', $_POST['NEW_LB_URL_HEIGHT']); + set_module_setting('lightbox', 'LB_ENABLED', $_POST['NEW_mediatab']); + set_module_setting('lightbox', 'LB_AL_HEAD_LINKS', $_POST['NEW_LB_AL_HEAD_LINKS']); + set_module_setting('lightbox', 'LB_AL_THUMB_LINKS', $_POST['NEW_LB_AL_THUMB_LINKS']); + set_module_setting('lightbox', 'LB_TT_BALLOON', $_POST['NEW_LB_TT_BALLOON']); + set_module_setting('lightbox', 'LB_ML_THUMB_LINKS', $_POST['NEW_LB_ML_THUMB_LINKS']); + set_module_setting('lightbox', 'LB_MUSIC_FILE', $_POST['NEW_LB_MUSIC_FILE']); + set_module_setting('lightbox', 'LB_SS_SPEED', $_POST['NEW_LB_SS_SPEED']); + set_module_setting('lightbox', 'LB_TRANSITION', $_POST['NEW_LB_TRANSITION']); + set_module_setting('lightbox', 'LB_URL_WIDTH', $_POST['NEW_LB_URL_WIDTH']); + set_module_setting('lightbox', 'LB_URL_HEIGHT', $_POST['NEW_LB_URL_HEIGHT']); AddToLog('Lightbox config updated', 'config'); // read the config file again, to set the vars @@ -833,11 +833,12 @@ try { ") COLLATE utf8_unicode_ci ENGINE=InnoDB" ); $dbh->exec( - "CREATE TABLE IF NOT EXISTS {$TBLPREFIX}nextid (". - " ni_id INTEGER NOT NULL,". // TODO: use auto-increment columns - " ni_type VARCHAR(15) NOT NULL,". - " ni_gedfile INTEGER NOT NULL,". - " PRIMARY KEY (ni_type, ni_gedfile)". + "CREATE TABLE IF NOT EXISTS {$TBLPREFIX}next_id (". + " gedcom_id INTEGER NOT NULL,". + " record_type VARCHAR(15) NOT NULL,". + " next_id INTEGER NOT NULL,". + " PRIMARY KEY (gedcom_id, record_type),". + " FOREIGN KEY fk1 (gedcom_id) REFERENCES {$TBLPREFIX}gedcom (gedcom_id) /* ON DELETE CASCADE */". ") COLLATE utf8_unicode_ci ENGINE=InnoDB" ); $dbh->exec( @@ -906,6 +907,15 @@ try { ") COLLATE utf8_unicode_ci ENGINE=InnoDB" ); $dbh->exec( + "CREATE TABLE IF NOT EXISTS {$TBLPREFIX}module_setting (". + " module_name VARCHAR(32) NOT NULL,". + " setting_name VARCHAR(32) NOT NULL,". + " setting_value TEXT NOT NULL,". + " PRIMARY KEY (module_name, setting_name),". + " FOREIGN KEY fk1 (module_name) REFERENCES {$TBLPREFIX}module (module_name) /* ON DELETE CASCADE */". + ") COLLATE utf8_unicode_ci ENGINE=InnoDB" + ); + $dbh->exec( "CREATE TABLE IF NOT EXISTS {$TBLPREFIX}module_privacy (". " module_name VARCHAR(32) NOT NULL,". " gedcom_id INTEGER NOT NULL,". |
