From 65072e6af27a6e8c802073fc560a79392118ed3a Mon Sep 17 00:00:00 2001 From: fisharebest Date: Mon, 24 May 2010 16:12:01 +0000 Subject: Tables and blocks. Add wt_module_settings, move wt_nextid to wt_next_id, remove html block - just have adv-html block. --- includes/functions/functions.php | 26 +- includes/functions/functions_db.php | 28 +- includes/functions/functions_import.php | 6 +- includes/functions/functions_print_facts.php | 2 +- modules/JWplayer/audio.png | Bin 5720 -> 0 bytes modules/JWplayer/audio_2.png | Bin 939 -> 0 bytes modules/JWplayer/flvVideo.php | 91 --- modules/JWplayer/module.php | 59 -- modules/JWplayer/player.swf | Bin 86736 -> 0 bytes modules/JWplayer/silverlight.js | 581 ------------------- modules/JWplayer/swfobject.js | 8 - modules/JWplayer/wmvVideo.php | 70 --- modules/JWplayer/wmvplayer.js | 799 -------------------------- modules/JWplayer/wmvplayer.xaml | 330 ----------- modules/JWplayer/yt.swf | Bin 1136 -> 0 bytes modules/block_htmlplus/module.php | 437 -------------- modules/googlemap/db_schema/db_schema_1_2.php | 58 +- modules/googlemap/defaultconfig.php | 152 ++--- modules/googlemap/editconfig.php | 54 +- modules/html/module.php | 437 ++++++++++++++ modules/html_block/module.php | 139 ----- modules/jw_player/audio.png | Bin 0 -> 5720 bytes modules/jw_player/audio_2.png | Bin 0 -> 939 bytes modules/jw_player/flvVideo.php | 91 +++ modules/jw_player/module.php | 59 ++ modules/jw_player/player.swf | Bin 0 -> 86736 bytes modules/jw_player/silverlight.js | 581 +++++++++++++++++++ modules/jw_player/swfobject.js | 8 + modules/jw_player/wmvVideo.php | 70 +++ modules/jw_player/wmvplayer.js | 799 ++++++++++++++++++++++++++ modules/jw_player/wmvplayer.xaml | 330 +++++++++++ modules/jw_player/yt.swf | Bin 0 -> 1136 bytes modules/lightbox/db_schema/db_schema_0_1.php | 20 +- modules/lightbox/lb_defaultconfig.php | 22 +- modules/lightbox/lb_editconfig.php | 20 +- setup.php | 20 +- 36 files changed, 2597 insertions(+), 2700 deletions(-) delete mode 100644 modules/JWplayer/audio.png delete mode 100644 modules/JWplayer/audio_2.png delete mode 100644 modules/JWplayer/flvVideo.php delete mode 100644 modules/JWplayer/module.php delete mode 100644 modules/JWplayer/player.swf delete mode 100644 modules/JWplayer/silverlight.js delete mode 100644 modules/JWplayer/swfobject.js delete mode 100644 modules/JWplayer/wmvVideo.php delete mode 100644 modules/JWplayer/wmvplayer.js delete mode 100644 modules/JWplayer/wmvplayer.xaml delete mode 100644 modules/JWplayer/yt.swf delete mode 100644 modules/block_htmlplus/module.php create mode 100644 modules/html/module.php delete mode 100644 modules/html_block/module.php create mode 100644 modules/jw_player/audio.png create mode 100644 modules/jw_player/audio_2.png create mode 100644 modules/jw_player/flvVideo.php create mode 100644 modules/jw_player/module.php create mode 100644 modules/jw_player/player.swf create mode 100644 modules/jw_player/silverlight.js create mode 100644 modules/jw_player/swfobject.js create mode 100644 modules/jw_player/wmvVideo.php create mode 100644 modules/jw_player/wmvplayer.js create mode 100644 modules/jw_player/wmvplayer.xaml create mode 100644 modules/jw_player/yt.swf 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/JWplayer/audio.png b/modules/JWplayer/audio.png deleted file mode 100644 index 380e7def33..0000000000 Binary files a/modules/JWplayer/audio.png and /dev/null differ diff --git a/modules/JWplayer/audio_2.png b/modules/JWplayer/audio_2.png deleted file mode 100644 index e479fb2ad9..0000000000 Binary files a/modules/JWplayer/audio_2.png and /dev/null differ diff --git a/modules/JWplayer/flvVideo.php b/modules/JWplayer/flvVideo.php deleted file mode 100644 index 31b1d31db8..0000000000 --- a/modules/JWplayer/flvVideo.php +++ /dev/null @@ -1,91 +0,0 @@ - -> - - - - JW Player for Flash - - - -
- -".$flvVideo.""; -?> - - - - - - -
Get the Flash Player to see this player.
- - - - -
- - - diff --git a/modules/JWplayer/module.php b/modules/JWplayer/module.php deleted file mode 100644 index 36ca4f4dc4..0000000000 --- a/modules/JWplayer/module.php +++ /dev/null @@ -1,59 +0,0 @@ -getName().'/'.$mod_action.'.php'; - break; - } - } -} diff --git a/modules/JWplayer/player.swf b/modules/JWplayer/player.swf deleted file mode 100644 index 292241910e..0000000000 Binary files a/modules/JWplayer/player.swf and /dev/null differ diff --git a/modules/JWplayer/silverlight.js b/modules/JWplayer/silverlight.js deleted file mode 100644 index 8ecfa63392..0000000000 --- a/modules/JWplayer/silverlight.js +++ /dev/null @@ -1,581 +0,0 @@ -/* silverlight.js - PhpGedView Author Brian Holland - * @package webtrees - * @subpackage Module - * @version $Id$ -*/ -/////////////////////////////////////////////////////////////////////////////// -// -// Silverlight.js version 2.0.30523.6 -// -// This file is provided by Microsoft as a helper file for websites that -// incorporate Silverlight Objects. This file is provided under the Microsoft -// Public License available at -// http://code.msdn.microsoft.com/silverlightjs/Project/License.aspx. -// You may not use or distribute this file or the code in this file except as -// expressly permitted under that license. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -/////////////////////////////////////////////////////////////////////////////// - -if (!window.Silverlight) -{ - window.Silverlight = { }; -} - -////////////////////////////////////////////////////////////////// -// -// _silverlightCount: -// -// Counter of globalized event handlers -// -////////////////////////////////////////////////////////////////// -Silverlight._silverlightCount = 0; - -////////////////////////////////////////////////////////////////// -// -// fwlinkRoot: -// -// Prefix for fwlink URL's -// -////////////////////////////////////////////////////////////////// -Silverlight.fwlinkRoot='http://go2.microsoft.com/fwlink/?LinkID='; - -////////////////////////////////////////////////////////////////// -// -// onGetSilverlight: -// -// Called by Silverlight.GetSilverlight to notify the page that a user -// has requested the Silverlight installer -// -////////////////////////////////////////////////////////////////// -Silverlight.onGetSilverlight = null; - -////////////////////////////////////////////////////////////////// -// -// onSilverlightInstalled: -// -// Called by Silverlight.WaitForInstallCompletion when the page detects -// that Silverlight has been installed. The event handler is not called -// in upgrade scenarios. -// -////////////////////////////////////////////////////////////////// -Silverlight.onSilverlightInstalled = function () {window.location.reload(false);}; - -////////////////////////////////////////////////////////////////// -// -// isInstalled: -// -// Checks to see if the correct version is installed -// -////////////////////////////////////////////////////////////////// -Silverlight.isInstalled = function(version) -{ - var isVersionSupported=false; - var container = null; - - try - { - var control = null; - - try - { - control = new ActiveXObject('AgControl.AgControl'); - if ( version == null ) - { - isVersionSupported = true; - } - else if ( control.IsVersionSupported(version) ) - { - isVersionSupported = true; - } - control = null; - } - catch (e) - { - var plugin = navigator.plugins["Silverlight Plug-In"] ; - if ( plugin ) - { - if ( version === null ) - { - isVersionSupported = true; - } - else - { - var actualVer = plugin.description; - if ( actualVer === "1.0.30226.2") - actualVer = "2.0.30226.2"; - var actualVerArray =actualVer.split("."); - while ( actualVerArray.length > 3) - { - actualVerArray.pop(); - } - while ( actualVerArray.length < 4) - { - actualVerArray.push(0); - } - var reqVerArray = version.split("."); - while ( reqVerArray.length > 4) - { - reqVerArray.pop(); - } - - var requiredVersionPart ; - var actualVersionPart - var index = 0; - - - do - { - requiredVersionPart = parseInt(reqVerArray[index]); - actualVersionPart = parseInt(actualVerArray[index]); - index++; - } - while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); - - if ( requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart) ) - { - isVersionSupported = true; - } - } - } - } - } - catch (e) - { - isVersionSupported = false; - } - if (container) - { - document.body.removeChild(container); - } - - return isVersionSupported; -} -////////////////////////////////////////////////////////////////// -// -// WaitForInstallCompletion: -// -// Occasionally checks for Silverlight installation status. If it -// detects that Silverlight has been installed then it calls -// Silverlight.onSilverlightInstalled();. This is only supported -// if Silverlight was not previously installed on this computer. -// -////////////////////////////////////////////////////////////////// -Silverlight.WaitForInstallCompletion = function() -{ - if ( ! Silverlight.isBrowserRestartRequired && Silverlight.onSilverlightInstalled ) - { - try - { - navigator.plugins.refresh(); - } - catch(e) - { - } - if ( Silverlight.isInstalled(null) ) - { - Silverlight.onSilverlightInstalled(); - } - else - { - setTimeout(Silverlight.WaitForInstallCompletion, 3000); - } - } -} -////////////////////////////////////////////////////////////////// -// -// __startup: -// -// Performs startup tasks -////////////////////////////////////////////////////////////////// -Silverlight.__startup = function() -{ - Silverlight.isBrowserRestartRequired = Silverlight.isInstalled(null); - if ( !Silverlight.isBrowserRestartRequired) - { - Silverlight.WaitForInstallCompletion(); - } - if (window.removeEventListener) { - window.removeEventListener('load', Silverlight.__startup , false); - } - else { - window.detachEvent('onload', Silverlight.__startup ); - } -} - -if (window.addEventListener) -{ - window.addEventListener('load', Silverlight.__startup , false); -} -else -{ - window.attachEvent('onload', Silverlight.__startup ); -} - -/////////////////////////////////////////////////////////////////////////////// -// createObject: -// -// Inserts a Silverlight tag or installation experience into the HTML -// DOM based on the current installed state of Silverlight. -// -///////////////////////////////////////////////////////////////////////////////// - -Silverlight.createObject = function(source, parentElement, id, properties, events, initParams, userContext) -{ - var slPluginHelper = new Object(); - var slProperties = properties; - var slEvents = events; - - slPluginHelper.version = slProperties.version; - slProperties.source = source; - slPluginHelper.alt = slProperties.alt; - - //rename properties to their tag property names. For bacwards compatibility - //with Silverlight.js version 1.0 - if ( initParams ) - slProperties.initParams = initParams; - if ( slProperties.isWindowless && !slProperties.windowless) - slProperties.windowless = slProperties.isWindowless; - if ( slProperties.framerate && !slProperties.maxFramerate) - slProperties.maxFramerate = slProperties.framerate; - if ( id && !slProperties.id) - slProperties.id = id; - - // remove elements which are not to be added to the instantiation tag - delete slProperties.ignoreBrowserVer; - delete slProperties.inplaceInstallPrompt; - delete slProperties.version; - delete slProperties.isWindowless; - delete slProperties.framerate; - delete slProperties.data; - delete slProperties.src; - delete slProperties.alt; - - - // detect that the correct version of Silverlight is installed, else display install - - if (Silverlight.isInstalled(slPluginHelper.version)) - { - //move unknown events to the slProperties array - for (var name in slEvents) - { - if ( slEvents[name]) - { - if ( name == "onLoad" && typeof slEvents[name] == "function" && slEvents[name].length != 1 ) - { - var onLoadHandler = slEvents[name]; - slEvents[name]=function (sender){ return onLoadHandler(document.getElementById(id), userContext, sender)}; - } - var handlerName = Silverlight.__getHandlerName(slEvents[name]); - if ( handlerName != null ) - { - slProperties[name] = handlerName; - slEvents[name] = null; - } - else - { - throw "typeof events."+name+" must be 'function' or 'string'"; - } - } - } - slPluginHTML = Silverlight.buildHTML(slProperties); - } - //The control could not be instantiated. Show the installation prompt - else - { - slPluginHTML = Silverlight.buildPromptHTML(slPluginHelper); - } - - // insert or return the HTML - if(parentElement) - { - parentElement.innerHTML = slPluginHTML; - } - else - { - return slPluginHTML; - } - -} - -/////////////////////////////////////////////////////////////////////////////// -// -// buildHTML: -// -// create HTML that instantiates the control -// -/////////////////////////////////////////////////////////////////////////////// -Silverlight.buildHTML = function( slProperties) -{ - var htmlBuilder = []; - - htmlBuilder.push(''); - - delete slProperties.id; - delete slProperties.width; - delete slProperties.height; - - for (var name in slProperties) - { - if (slProperties[name]) - { - htmlBuilder.push(''); - } - } - htmlBuilder.push('<\/object>'); - return htmlBuilder.join(''); -} - - - -////////////////////////////////////////////////////////////////// -// -// createObjectEx: -// -// takes a single parameter of all createObject -// parameters enclosed in {} -// -////////////////////////////////////////////////////////////////// - -Silverlight.createObjectEx = function(params) -{ - var parameters = params; - var html = Silverlight.createObject(parameters.source, parameters.parentElement, parameters.id, parameters.properties, parameters.events, parameters.initParams, parameters.context); - if (parameters.parentElement == null) - { - return html; - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// buildPromptHTML -// -// Builds the HTML to prompt the user to download and install Silverlight -// -/////////////////////////////////////////////////////////////////////////////////////////////// -Silverlight.buildPromptHTML = function(slPluginHelper) -{ - var slPluginHTML = ""; - var urlRoot = Silverlight.fwlinkRoot; - var shortVer = slPluginHelper.version ; - if ( slPluginHelper.alt ) - { - slPluginHTML = slPluginHelper.alt; - } - else - { - if (! shortVer ) - { - shortVer=""; - } - slPluginHTML = "Get Microsoft Silverlight"; - slPluginHTML = slPluginHTML.replace('{1}', shortVer ); - slPluginHTML = slPluginHTML.replace('{2}', urlRoot + '108181'); - } - - return slPluginHTML; -} - -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// getSilverlight: -// -// Navigates the browser to the appropriate Silverlight installer -// -/////////////////////////////////////////////////////////////////////////////////////////////// -Silverlight.getSilverlight = function(version) -{ - if (Silverlight.onGetSilverlight ) - { - Silverlight.onGetSilverlight(); - } - - var shortVer = ""; - var reqVerArray = String(version).split("."); - if (reqVerArray.length > 1) - { - var majorNum = parseInt(reqVerArray[0] ); - if ( isNaN(majorNum) || majorNum < 2 ) - { - shortVer = "1.0"; - } - else - { - shortVer = reqVerArray[0]+'.'+reqVerArray[1]; - } - } - - var verArg = ""; - - if (shortVer.match(/^\d+\056\d+$/) ) - { - verArg = "&v="+shortVer; - } - - Silverlight.followFWLink("114576" + verArg); -} - - -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// followFWLink: -// -// Navigates to a url based on fwlinkid -// -/////////////////////////////////////////////////////////////////////////////////////////////// -Silverlight.followFWLink = function(linkid) -{ - top.location=Silverlight.fwlinkRoot+String(linkid); -} - -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// HtmlAttributeEncode: -// -// Encodes special characters in input strings as charcodes -// -/////////////////////////////////////////////////////////////////////////////////////////////// -Silverlight.HtmlAttributeEncode = function( strInput ) -{ - var c; - var retVal = ''; - - if(strInput == null) - { - return null; - } - - for(var cnt = 0; cnt < strInput.length; cnt++) - { - c = strInput.charCodeAt(cnt); - - if (( ( c > 96 ) && ( c < 123 ) ) || - ( ( c > 64 ) && ( c < 91 ) ) || - ( ( c > 43 ) && ( c < 58 ) && (c!=47)) || - ( c == 95 )) - { - retVal = retVal + String.fromCharCode(c); - } - else - { - retVal = retVal + '&#' + c + ';'; - } - } - - return retVal; -} -/////////////////////////////////////////////////////////////////////////////// -// -// default_error_handler: -// -// Default error handling function -// -/////////////////////////////////////////////////////////////////////////////// - -Silverlight.default_error_handler = function (sender, args) -{ - var iErrorCode; - var errorType = args.ErrorType; - - iErrorCode = args.ErrorCode; - - var errMsg = "\nSilverlight error message \n" ; - - errMsg += "ErrorCode: "+ iErrorCode + "\n"; - - - errMsg += "ErrorType: " + errorType + " \n"; - errMsg += "Message: " + args.ErrorMessage + " \n"; - - if (errorType == "ParserError") - { - errMsg += "XamlFile: " + args.xamlFile + " \n"; - errMsg += "Line: " + args.lineNumber + " \n"; - errMsg += "Position: " + args.charPosition + " \n"; - } - else if (errorType == "RuntimeError") - { - if (args.lineNumber != 0) - { - errMsg += "Line: " + args.lineNumber + " \n"; - errMsg += "Position: " + args.charPosition + " \n"; - } - errMsg += "MethodName: " + args.methodName + " \n"; - } - alert (errMsg); -} - -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// __cleanup: -// -// Releases event handler resources when the page is unloaded -// -/////////////////////////////////////////////////////////////////////////////////////////////// -Silverlight.__cleanup = function () -{ - for (var i = Silverlight._silverlightCount - 1; i >= 0; i--) { - window['__slEvent' + i] = null; - } - Silverlight._silverlightCount = 0; - if (window.removeEventListener) { - window.removeEventListener('unload', Silverlight.__cleanup , false); - } - else { - window.detachEvent('onunload', Silverlight.__cleanup ); - } -} - -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// __getHandlerName: -// -// Generates named event handlers for delegates. -// -/////////////////////////////////////////////////////////////////////////////////////////////// -Silverlight.__getHandlerName = function (handler) -{ - var handlerName = ""; - if ( typeof handler == "string") - { - handlerName = handler; - } - else if ( typeof handler == "function" ) - { - if (Silverlight._silverlightCount == 0) - { - if (window.addEventListener) - { - window.addEventListener('onunload', Silverlight.__cleanup , false); - } - else - { - window.attachEvent('onunload', Silverlight.__cleanup ); - } - } - var count = Silverlight._silverlightCount++; - handlerName = "__slEvent"+count; - - window[handlerName]=handler; - } - else - { - handlerName = null; - } - return handlerName; -} \ No newline at end of file diff --git a/modules/JWplayer/swfobject.js b/modules/JWplayer/swfobject.js deleted file mode 100644 index e7edd42c09..0000000000 --- a/modules/JWplayer/swfobject.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ - * - * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: - * http://www.opensource.org/licenses/mit-license.php - * - */ -if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; \ No newline at end of file diff --git a/modules/JWplayer/wmvVideo.php b/modules/JWplayer/wmvVideo.php deleted file mode 100644 index 49595ed7ee..0000000000 --- a/modules/JWplayer/wmvVideo.php +++ /dev/null @@ -1,70 +0,0 @@ - -> - - - - JW Player for Windows Media Videos - - - - -
- - - -
The player will be placed here
- - - -
- - diff --git a/modules/JWplayer/wmvplayer.js b/modules/JWplayer/wmvplayer.js deleted file mode 100644 index 75fb965787..0000000000 --- a/modules/JWplayer/wmvplayer.js +++ /dev/null @@ -1,799 +0,0 @@ -/* wmvplayer.js - PhpGedView Author Brian Holland - * @package webtrees - * @subpackage Module - * @version $Id$ -*/ -/**************************************************************************** -* JW WMV Player version 1.1, created with M$ Silverlight 1.0 -* -* This file contains all logic for the JW WMV Player. For a functional setup, -* the following two files are also needed: -* - silverlight.js (for instantiating the silverlight plugin) -* - wmvplayer.xaml (or another XAML skin describing the player graphics) -* -* More info: http://www.jeroenwijering.com/?item=JW_WMV_Player -****************************************************************************/ -if(typeof jeroenwijering == "undefined") { - var jeroenwijering = new Object(); - jeroenwijering.utils = new Object(); -} - - - - - - - - - - -/**************************************************************************** -* The player wrapper; loads config variables and starts MVC cycle. -****************************************************************************/ -jeroenwijering.Player = function(cnt,src,cfg) { - this.controller; - this.model; - this.view; - this.configuration = { - backgroundcolor:'FFFFFF', - windowless:'false', - file:'', - height:'260', - image:'', - backcolor:'FFFFFF', - frontcolor:'000000', - lightcolor:'000000', - screencolor:'000000', - width:'320', - logo:'', - overstretch:'false', - shownavigation:'true', - showstop:'false', - showdigits:'true', - usefullscreen:'true', - usemute:'false', - autostart:'false', - bufferlength:'3', - duration:'0', - repeat:'false', - sender:'', - start:'0', - volume:'90', - link:'', - linkfromdisplay:'false', - linktarget:'_self' - }; - for(itm in this.configuration) { - if(cfg[itm] != undefined) { - if (itm.indexOf('color') > 0) { - this.configuration[itm] = cfg[itm].substr(cfg[itm].length-6); - } else { - this.configuration[itm] = cfg[itm]; - } - } - } - Silverlight.createObjectEx({ - source:src, - parentElement:cnt, - properties:{ - width:this.configuration['width'], - height:this.configuration['height'], - version:'1.0', - inplaceInstallPrompt:true, - isWindowless:this.configuration['windowless'], - background:'#'+this.configuration['backgroundcolor'] - }, - events:{ - onLoad:this.onLoadHandler, - onError:null - }, - context:this - }); -} - -jeroenwijering.Player.prototype = { - addListener: function(typ,fcn) { - this.view.listeners.push({type:typ,func:fcn}); - }, - - getConfig: function() { - return this.configuration; - }, - - onLoadHandler: function(pid,tgt,sdr) { - tgt.configuration['sender'] = sdr; - tgt.controller = new jeroenwijering.Controller(tgt.configuration); - tgt.view = new jeroenwijering.View(tgt.configuration,tgt.controller); - tgt.model = new jeroenwijering.Model(tgt.configuration,tgt.controller,tgt.view); - tgt.controller.startMVC(tgt.view,tgt.model); - }, - - sendEvent: function(typ,prm) { - switch(typ.toUpperCase()) { - case 'LINK': - this.controller.setLink(); - break; - case 'LOAD': - this.controller.setLoad(prm); - break; - case 'MUTE': - this.controller.setMute(); - break; - case 'PLAY': - this.controller.setPlay(); - break; - case 'SCRUB': - this.controller.setScrub(prm); - break; - case 'STOP': - this.controller.setStop(); - break; - case 'VOLUME': - this.controller.setVolume(prm); - break; - } - } -} - - - - - - - - - - -/**************************************************************************** -* The controller of the player MVC triad, which processes all user input. -****************************************************************************/ -jeroenwijering.Controller = function(cfg) { - this.configuration = cfg; -} - -jeroenwijering.Controller.prototype = { - startMVC: function(vie,mdl) { - this.view = vie; - this.model = mdl; - if(this.configuration['usemute'] == 'true') { - this.view.onVolume(0); - this.view.onMute(true); - this.model.goVolume(0); - } else { - this.view.onVolume(this.configuration['volume']); - this.model.goVolume(this.configuration['volume']); - } - if(this.configuration['autostart'] == 'true') { - this.model.goStart(); - } else { - this.model.goPause(); - } - }, - - setState: function(old,stt) { - this.state = stt; - var pos = this.configuration['start']; - if(old == 'Closed' && pos > 0) { - setTimeout(jeroenwijering.utils.delegate(this,this.setScrub),200,pos); - } - }, - - setLink: function() { - if (this.configuration['linktarget'].indexOf('javascript:') == 0) { - return Function(this.configuration['linktarget']).apply(); - } else if (this.configuration['linktarget'] == '_blank') { - window.open(this.configuration['link']); - } else if (this.configuration['linktarget'] != '') { - window.location = this.configuration['link']; - } - }, - - setLoad: function(fil) { - if(this.model.state != "Closed") { - this.model.goStop(); - } - this.configuration['file'] = fil; - if(this.configuration['autostart'] == 'true') { - setTimeout(jeroenwijering.utils.delegate(this.model,this.model.goStart),100); - } - }, - - setMute: function() { - if(this.configuration['usemute'] == 'true') { - this.configuration['usemute'] = 'false'; - this.model.goVolume(this.configuration['volume']); - this.view.onMute(false); - } else { - this.configuration['usemute'] = 'true'; - this.model.goVolume(0); - this.view.onMute(true); - } - }, - - setPlay: function() { - if(this.state == 'Buffering' || this.state == 'Playing') { - if(this.configuration['duration'] == 0) { - this.model.goStop(); - } else { - this.model.goPause(); - } - } else { - this.model.goStart(); - } - }, - - setScrub: function(sec) { - if(sec < 2) { - sec = 0; - } else if (sec > this.configuration['duration']-4) { - sec = this.configuration['duration']-4; - } - if(this.state == 'Buffering' || this.state == 'Playing') { - this.model.goStart(sec); - } else { - this.model.goPause(sec); - } - }, - - setStop: function() { - this.model.goStop(); - }, - - setVolume: function(pct) { - if(pct < 0) { pct = 0; } else if(pct > 100) { pct = 100; } - this.configuration['volume'] = Math.round(pct); - this.model.goVolume(pct); - this.view.onVolume(pct); - if(this.configuration['usemute'] == 'true') { - this.configuration['usemute'] = 'false'; - this.view.onMute(false); - } - }, - - setFullscreen: function() { - var fss = !this.configuration['sender'].getHost().content.FullScreen; - this.configuration['sender'].getHost().content.FullScreen = fss; - jeroenwijering.utils.delegate(this.view,this.view.onFullscreen); - } -} - - - - - - - - - - -/**************************************************************************** -* The view of the player MVC triad, which manages the graphics. -****************************************************************************/ -jeroenwijering.View = function(cfg,ctr) { - this.configuration = cfg; - this.listeners = Array(); - this.controller = ctr; - this.fstimeout; - this.fslistener; - this.display = this.configuration['sender'].findName("PlayerDisplay"); - this.controlbar = this.configuration['sender'].findName("PlayerControls"); - this.configuration['sender'].getHost().content.onResize = - jeroenwijering.utils.delegate(this,this.resizePlayer); - this.configuration['sender'].getHost().content.onFullScreenChange = - jeroenwijering.utils.delegate(this,this.onFullscreen); - this.assignColorsClicks(); - this.resizePlayer(); -} - -jeroenwijering.View.prototype = { - onBuffer: function(pct) { - var snd = this.configuration['sender']; - if(pct == 0) { - snd.findName("BufferText").Text = null; - } else { - pct < 10 ? pct = "0"+pct: pct = ""+pct; - snd.findName("BufferText").Text = pct; - } - this.delegate('BUFFER',[pct]); - }, - - onFullscreen: function(fss) { - var snd = this.configuration['sender']; - var fst = snd.getHost().content.FullScreen; - if(fst) { - this.fstimeout = setTimeout(jeroenwijering.utils.delegate(this, - this.hideFSControls),2000); - this.fslistener = this.display.addEventListener('MouseMove', - jeroenwijering.utils.delegate(this,this.showFSControls)); - snd.findName("FullscreenSymbol").Visibility = "Collapsed"; - snd.findName("FullscreenOffSymbol").Visibility = "Visible"; - } else { - clearTimeout(this.fstimeout); - this.display.removeEventListener("MouseMove",this.fslistener); - this.controlbar.Visibility = "Visible"; - this.display.Cursor = "Hand"; - snd.findName("FullscreenSymbol").Visibility = "Visible"; - snd.findName("FullscreenOffSymbol").Visibility = "Collapsed"; - } - this.resizePlayer(); - this.delegate('FULLSCREEN'); - }, - - showFSControls: function(sdr,arg) { - var vbt = sdr.findName('PlayerControls'); - var yps = arg.GetPosition(vbt).Y; - clearTimeout(this.fstimeout); - this.controlbar.Visibility = "Visible"; - this.display.Cursor = "Hand"; - if(yps < 0) { - this.fstimeout = setTimeout(jeroenwijering.utils.delegate(this, - this.hideFSControls),2000); - } - }, - - hideFSControls: function() { - this.controlbar.Visibility = "Collapsed"; - this.display.Cursor = "None"; - }, - - onLoad: function(pct) { - var snd = this.configuration['sender']; - var max = snd.findName("TimeSlider").Width; - snd.findName("DownloadProgress").Width = Math.round(max*pct/100); - this.delegate('LOAD',[pct]); - }, - - onMute: function(mut) { - var snd = this.configuration['sender']; - this.configuration['usemute'] = ''+mut; - if(mut) { - snd.findName("VolumeHighlight").Visibility = "Collapsed"; - snd.findName("MuteSymbol").Visibility = "Visible"; - snd.findName("MuteOffSymbol").Visibility = "Collapsed"; - if(this.state == 'Playing') { - snd.findName("MuteIcon").Visibility = "Visible"; - } - } else { - snd.findName("VolumeHighlight").Visibility = "Visible"; - snd.findName("MuteSymbol").Visibility = "Collapsed"; - snd.findName("MuteOffSymbol").Visibility = "Visible"; - snd.findName("MuteIcon").Visibility = "Collapsed"; - } - this.delegate('MUTE'); - }, - - onState: function(old,stt) { - var snd = this.configuration['sender']; - this.state = stt; - if(stt == 'Buffering' || stt == 'Playing' || stt == 'Opening') { - snd.findName("PlayIcon").Visibility = "Collapsed"; - snd.findName("PlaySymbol").Visibility = "Collapsed"; - snd.findName("PlayOffSymbol").Visibility = "Visible"; - if (stt=='Playing') { - snd.findName("BufferIcon").Visibility = "Collapsed"; - snd.findName("BufferText").Visibility = "Collapsed"; - if(this.configuration['usemute'] == 'true') { - snd.findName("MuteIcon").Visibility = "Visible"; - } - } else{ - snd.findName("BufferIcon").Visibility = "Visible"; - snd.findName("BufferText").Visibility = "Visible"; - } - } else { - snd.findName("MuteIcon").Visibility = "Collapsed"; - snd.findName("BufferIcon").Visibility = "Collapsed"; - snd.findName("BufferText").Visibility = "Collapsed"; - snd.findName("PlayOffSymbol").Visibility = "Collapsed"; - snd.findName("PlaySymbol").Visibility = "Visible"; - if(this.configuration['linkfromdisplay'] == 'true') { - snd.findName("PlayIcon").Visibility = "Collapsed"; - } else { - snd.findName("PlayIcon").Visibility = "Visible"; - } - } - try { - if(!(old == 'Completed' && stt == 'Buffering') && - !(old == 'Buffering' && stt == 'Paused')) { - playerStatusChange(old.toUpperCase(),stt.toUpperCase()); - } - } catch (err) {} - this.delegate('STATE',[old,stt]); - }, - - onTime: function(elp,dur) { - var snd = this.configuration['sender']; - var snd = this.configuration['sender']; - var max = snd.findName("TimeSlider").Width; - if(dur > 0) { - var pos = Math.round(max*elp/dur); - this.configuration['duration'] = dur; - snd.findName("ElapsedText").Text = jeroenwijering.utils.timestring(elp); - snd.findName("RemainingText").Text = jeroenwijering.utils.timestring(dur-elp); - snd.findName("TimeSymbol").Visibility = "Visible"; - snd.findName("TimeSymbol")['Canvas.Left'] = pos+4; - snd.findName("TimeHighlight").Width = pos-2; - } else { - snd.findName("TimeSymbol").Visibility = "Collapsed"; - } - this.delegate('TIME',[elp,dur]); - }, - - onVolume: function(pct) { - var snd = this.configuration['sender']; - snd.findName("VolumeHighlight").Width = Math.round(pct/5); - this.delegate('VOLUME',[pct]); - }, - - assignColorsClicks: function() { - this.display.Cursor = "Hand"; - this.display.Background = "#FF"+this.configuration['screencolor']; - if(this.configuration['linkfromdisplay'] == 'false') { - this.display.addEventListener('MouseLeftButtonUp', - jeroenwijering.utils.delegate(this.controller, - this.controller.setPlay)); - } else { - this.display.addEventListener('MouseLeftButtonUp', - jeroenwijering.utils.delegate(this.controller, - this.controller.setLink)); - this.display.findName("PlayIcon").Visibility = "Collapsed"; - } - if(this.configuration['logo'] != '') { - this.display.findName('OverlayCanvas').Visibility = "Visible"; - this.display.findName('OverlayLogo').ImageSource = - this.configuration['logo']; - } - this.controlbar.findName("ControlbarBack").Fill = - "#FF"+this.configuration['backcolor']; - this.assignButton('Play',this.controller.setPlay); - this.assignButton('Stop',this.controller.setStop); - this.configuration['sender'].findName('ElapsedText').Foreground = - "#FF"+this.configuration['frontcolor']; - this.assignSlider('Time',this.changeTime); - this.configuration['sender'].findName('DownloadProgress').Fill = - "#FF"+this.configuration['frontcolor']; - this.configuration['sender'].findName('RemainingText').Foreground = - "#FF"+this.configuration['frontcolor']; - this.assignButton('Link',this.controller.setLink); - this.assignButton('Fullscreen',this.controller.setFullscreen); - this.assignButton('Mute',this.controller.setMute); - this.assignSlider('Volume',this.changeVolume); - }, - - assignButton: function(btn,act) { - var el1 = this.configuration['sender'].findName(btn+'Button'); - el1.Cursor = "Hand"; - el1.addEventListener('MouseLeftButtonUp', - jeroenwijering.utils.delegate(this.controller,act)); - el1.addEventListener('MouseEnter', - jeroenwijering.utils.delegate(this,this.rollOver)); - el1.addEventListener('MouseLeave', - jeroenwijering.utils.delegate(this,this.rollOut)); - this.configuration['sender'].findName(btn+'Symbol').Fill = - "#FF"+this.configuration['frontcolor']; - try { - this.configuration['sender'].findName(btn+'OffSymbol').Fill = - "#FF"+this.configuration['frontcolor']; - } catch(e) {} - }, - - assignSlider: function(sld,act) { - var el1 = this.configuration['sender'].findName(sld+'Button'); - el1.Cursor = "Hand"; - el1.addEventListener('MouseLeftButtonUp', - jeroenwijering.utils.delegate(this,act)); - el1.addEventListener('MouseEnter', - jeroenwijering.utils.delegate(this,this.rollOver)); - el1.addEventListener('MouseLeave', - jeroenwijering.utils.delegate(this,this.rollOut)); - this.configuration['sender'].findName(sld+'Slider').Fill = - "#FF"+this.configuration['frontcolor']; - this.configuration['sender'].findName(sld+'Highlight').Fill = - "#FF"+this.configuration['frontcolor']; - this.configuration['sender'].findName(sld+'Symbol').Fill = - "#FF"+this.configuration['frontcolor']; - }, - - delegate: function(typ,arg) { - for(var i=0; i 160) { - rgt += 35; - this.controlbar.findName('RemainingButton').Visibility="Visible"; - this.controlbar.findName('ElapsedButton').Visibility="Visible"; - this.placeElement('RemainingButton',wid-rgt); - this.placeElement('ElapsedButton',lft); - lft +=35; - } else { - this.controlbar.findName('RemainingButton').Visibility = - "Collapsed"; - this.controlbar.findName('ElapsedButton').Visibility="Collapsed"; - } - this.placeElement('TimeButton',lft); - this.stretchElement('TimeButton',wid-lft-rgt); - this.stretchElement('TimeShadow',wid-lft-rgt); - this.stretchElement('TimeStroke',wid-lft-rgt); - this.stretchElement('TimeFill',wid-lft-rgt); - this.stretchElement('TimeSlider',wid-lft-rgt-10); - this.stretchElement('DownloadProgress',wid-lft-rgt-10); - var tsb = this.configuration['sender'].findName('TimeSymbol'); - this.stretchElement('TimeHighlight',tsb['Canvas.Left']-5); - this.controlbar.Visibility = "Visible"; - }, - - centerElement: function(nam,wid,hei) { - var elm = this.configuration['sender'].findName(nam); - elm['Canvas.Left'] = Math.round(wid/2 - elm.Width/2); - elm['Canvas.Top'] = Math.round(hei/2 - elm.Height/2); - }, - - stretchElement: function(nam,wid,hei) { - var elm = this.configuration['sender'].findName(nam); - elm.Width = wid; - if (hei != undefined) { elm.Height = hei; } - }, - - placeElement: function(nam,xps,yps) { - var elm = this.configuration['sender'].findName(nam); - elm['Canvas.Left'] = xps; - if(yps) { elm['Canvas.Top'] = yps; } - } -} - - - - - - - - - - -/**************************************************************************** -* The model of the player MVC triad, which stores all playback logic. -****************************************************************************/ -jeroenwijering.Model = function(cfg,ctr,vie) { - this.configuration = cfg; - this.controller = ctr; - this.view = vie; - this.video = this.configuration['sender'].findName("VideoWindow"); - this.preview = this.configuration['sender'].findName("PlaceholderImage"); - var str = { - 'true':'UniformToFill', - 'false':'Uniform', - 'fit':'Fill', - 'none':'None' - } - this.state = this.video.CurrentState; - this.timeint; - this.video.Stretch = str[this.configuration['overstretch']]; - this.preview.Stretch = str[this.configuration['overstretch']]; - this.video.BufferingTime = - jeroenwijering.utils.spanstring(this.configuration['bufferlength']); - this.video.AutoPlay = true; - this.video.AddEventListener("CurrentStateChanged", - jeroenwijering.utils.delegate(this,this.stateChanged)); - this.video.AddEventListener("MediaEnded", - jeroenwijering.utils.delegate(this,this.mediaEnded)); - this.video.AddEventListener("BufferingProgressChanged", - jeroenwijering.utils.delegate(this,this.bufferChanged)); - this.video.AddEventListener("DownloadProgressChanged", - jeroenwijering.utils.delegate(this,this.downloadChanged)); - if(this.configuration['image'] != '') { - this.preview.Source = this.configuration['image']; - } -} - -jeroenwijering.Model.prototype = { - goPause: function(sec) { - this.video.pause(); - if(!isNaN(sec)) { - this.video.Position = jeroenwijering.utils.spanstring(sec); - } - this.timeChanged(); - }, - - goStart: function(sec) { - this.video.Visibility = 'Visible'; - this.preview.Visibility = 'Collapsed'; - if(this.state == "Closed") { - this.video.Source = this.configuration['file']; - } else { - this.video.play(); - } - if(!isNaN(sec)) { - this.video.Position = jeroenwijering.utils.spanstring(sec); - } - }, - - goStop: function() { - this.video.Visibility = 'Collapsed'; - this.preview.Visibility = 'Visible'; - this.goPause(0); - this.video.Source = 'null'; - this.view.onBuffer(0); - clearInterval(this.timeint); - }, - - goVolume: function(pct) { - this.video.Volume = pct/100; - }, - - stateChanged: function() { - var stt = this.video.CurrentState; - if(stt != this.state) { - this.controller.setState(this.state,stt); - this.view.onState(this.state,stt); - this.state = stt; - this.configuration['duration'] = - Math.round(this.video.NaturalDuration.Seconds*10)/10; - if(stt != "Playing" && stt != "Buffering" && stt != "Opening") { - clearInterval(this.timeint); - } else { - this.timeint = setInterval(jeroenwijering.utils.delegate( - this,this.timeChanged),100); - } - } - }, - - mediaEnded: function() { - if(this.configuration['repeat'] == 'true') { - this.goStart(0); - } else { - this.state = 'Completed'; - this.view.onState(this.state,'Completed'); - this.video.Visibility = 'Collapsed'; - this.preview.Visibility = 'Visible'; - this.goPause(0); - } - }, - - bufferChanged: function() { - var bfr = Math.round(this.video.BufferingProgress*100); - this.view.onBuffer(bfr); - }, - - downloadChanged: function() { - var dld = Math.round(this.video.DownloadProgress*100); - this.view.onLoad(dld); - }, - - timeChanged: function() { - var pos = Math.round(this.video.Position.Seconds*10)/10; - this.view.onTime(pos,this.configuration['duration']); - } -} - - - - - - - - - - -/**************************************************************************** -* Some utility functions. -****************************************************************************/ -jeroenwijering.utils.delegate = function(obj,fcn) { - return function() { - return fcn.apply(obj,arguments); - } -} -jeroenwijering.utils.timestring = function(stp) { - var hrs = Math.floor(stp/3600); - var min = Math.floor(stp%3600/60); - var sec = Math.round(stp%60); - var str = ""; - sec > 9 ? str += sec: str +='0'+sec; - min > 9 ? str = min+":"+str: str='0'+min+":"+str; - hrs > 0 ? str = hrs+":"+str: null; - return str; -} -jeroenwijering.utils.spanstring = function(stp) { - var hrs = Math.floor(stp/3600); - var min = Math.floor(stp%3600/60); - var sec = Math.round(stp%60*10)/10; - var str = hrs+':'+min+':'+sec; - return str; -} \ No newline at end of file diff --git a/modules/JWplayer/wmvplayer.xaml b/modules/JWplayer/wmvplayer.xaml deleted file mode 100644 index 17a9dbfb9e..0000000000 --- a/modules/JWplayer/wmvplayer.xaml +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/JWplayer/yt.swf b/modules/JWplayer/yt.swf deleted file mode 100644 index 881ec8b35c..0000000000 Binary files a/modules/JWplayer/yt.swf and /dev/null differ diff --git a/modules/block_htmlplus/module.php b/modules/block_htmlplus/module.php deleted file mode 100644 index c7d12bd795..0000000000 --- a/modules/block_htmlplus/module.php +++ /dev/null @@ -1,437 +0,0 @@ -gedcomCreatedSoftware(); - $CREATED_VERSION = $stats->gedcomCreatedVersion(); - $CREATED_DATE = $stats->gedcomDate(); - - /* - * First Pass. - * Handle embedded language, fact, global, etc. references - * This needs to be done first because the language variables could themselves - * contain embedded keywords. - */ - // Title - $title_tmp=embed_globals(get_block_setting($block_id, 'title')); - $html =embed_globals(get_block_setting($block_id, 'html')); - /* - * Second Pass. - */ - list($new_tags, $new_values) = $stats->getTags("{$title_tmp} {$html}"); - // Title - if (strstr($title_tmp, '#')){$title_tmp = str_replace($new_tags, $new_values, $title_tmp);} - // Content - $html = str_replace($new_tags, $new_values, $html); - - /* - * Restore Current GEDCOM - */ - $GEDCOM = WT_GEDCOM; - - /* - * Start Of Output - */ - $id=$this->getName().$block_id; - $title=''; - if ($ctype=="gedcom" && WT_USER_GEDCOM_ADMIN || $ctype=="user" && WT_USER_ID) { - if ($ctype=="gedcom") { - $name = WT_GEDCOM; - } else { - $name = WT_USER_NAME; - } - $title .= "" - ."\"".i18n::translate('Configure').'"'; - ; - } - if (WT_USER_GEDCOM_ADMIN) { - $title .= help_link('index_htmlplus_a'); - } else { - $title .= help_link('index_htmlplus'); - } - $title.=$title_tmp; - - $content = $html; - - $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, 'compat', safe_POST_bool('compat')); - set_block_setting($block_id, 'ui', safe_POST_bool('ui')); - set_block_setting($block_id, 'gedcom', safe_POST('gedcom')); - set_block_setting($block_id, 'title', $_POST['title']); - 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'; - } - - $templates=array( - i18n::translate('Keyword examples')=> -' - - - - - #getAllTagsTable# -
'.i18n::translate('Embedded variable').''.i18n::translate('Resulting value').'
', -i18n::translate('Narrative description')=>/* I18N: do not translate the #keywords# */ i18n::translate('This site was last updated on #gedcomUpdated#. There are #totalSurnames# surnames in this family tree. The earliest recorded event is the #firstEventType# of #firstEventName# in #firstEventYear#. The most recent event is the #lastEventType# of #lastEventName# in #lastEventYear#.

If you have any comments or feedback please contact #contactWebmaster#.'), - i18n::translate('GEDCOM statistics')=>'
-#gedcomTitle#
-'.i18n::translate('This GEDCOM was created using %1$s on %2$s.', '#gedcomCreatedSoftware#', '#gedcomDate#').' - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'.i18n::translate('Individuals').' #totalIndividuals#
'.i18n::translate('Total surnames').' #totalSurnames#
'. i18n::translate('Families').' #totalFamilies#
'.i18n::translate('Sources').' #totalSources#
'.i18n::translate('Media objects').' #totalMedia#
'.i18n::translate('Other records').' #totalOtherRecords#
'.i18n::translate('Total events').' #totalEvents#
'.i18n::translate('Males').' #totalSexMales# [#totalSexMalesPercentage#%]
'.i18n::translate('Females').' #totalSexFemales# [#totalSexFemalesPercentage#%]
'.i18n::translate('Total users').' #totalUsers#
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'.i18n::translate('Earliest birth year').' #firstBirthYear# #firstBirth#
'.i18n::translate('Latest birth year').' #lastBirthYear# #lastBirth#
'.i18n::translate('Earliest death year').' #firstDeathYear# #firstDeath#
'.i18n::translate('Latest death year').' #lastDeathYear# #lastDeath#
'.i18n::translate('Person who lived the longest').' #longestLifeAge# #longestLife#
'.i18n::translate('Average age at death').' #averageLifespan# 
'.i18n::translate('Family with the most children').' #largestFamilySize# #largestFamily#
'.i18n::translate('Average number of children per family').' #averageChildren#
-

-'.i18n::translate('Most Common Surnames').'
-#commonSurnames# -
' - ); - - $title=get_block_setting($block_id, 'title'); - $html=get_block_setting($block_id, 'html'); - // title - print "" - .translate_fact('TITL') - .help_link('index_htmlplus_title') - ."" - ; - - // templates - print "" - .i18n::translate('Templates') - .help_link('index_htmlplus_template') - ."" - ; - if($useFCK) - { - print "\t\t\t\n" - ."\t\t\t\n"; - } - print "\t\t\t\t\n"; - foreach($templates as $title=>$template) - { - print "\t\t\t\t\n"; - } - print "\t\t\t\n" - ."\t\t\n\t\n" - ; - - // gedcom - $gedcoms = get_all_gedcoms(); - $gedcom=get_block_setting($block_id, 'gedcom'); - if(count($gedcoms) > 1) - { - if($gedcom == '__current__'){$sel_current = ' selected="selected"';}else{$sel_current = '';} - if($gedcom == '__default__'){$sel_default = ' selected="selected"';}else{$sel_default = '';} - print "\t\n\t\t" - .i18n::translate('Family Tree') - .help_link('index_htmlplus_gedcom') - ."\n" - ."\t\t\t\n" - ."\t\t\n\t\n" - ; - } - - // html - print "\t\n\t\t\n" - .i18n::translate('Content') - .help_link('index_htmlplus_content') - ."

" - ."" - ; - if($useFCK) - { - // use FCKeditor module - require_once WT_ROOT.'modules/FCKeditor/fckeditor.php'; - $oFCKeditor = new FCKeditor('html') ; - $oFCKeditor->BasePath = './modules/FCKeditor/'; - $oFCKeditor->Value = $html; - $oFCKeditor->Width = 700; - $oFCKeditor->Height = 250; - $oFCKeditor->Config['AutoDetectLanguage'] = false ; - $oFCKeditor->Config['DefaultLanguage'] = WT_LOCALE; - $oFCKeditor->Create() ; - } - else - { - //use standard textarea - print ""; - } - - print "\n\t\t\n\t\n"; - - // compatibility mode - $compat=get_block_setting($block_id, 'compat', false); - if($compat == 1){$compat = ' checked="checked"';}else{$compat = '';} - print "\t\n\t\t" - .i18n::translate('Compatibility Mode') - .help_link('index_htmlplus_compat') - ."\n\n" - ."\t\n" - ; - - // extended features - $ui=get_block_setting($block_id, 'ui', false); - if ($ui == 1) { - $ui = ' checked="checked"'; - } else { - $ui = ''; - } - print "\t\n\t\t" - .i18n::translate('Extended Interface') - .help_link('index_htmlplus_ui') - ."\n" - ."\t\n" - ; - - $languages=get_block_setting($block_id, 'languages', WT_LOCALE); - echo ''; - echo i18n::translate('Show this block for which languages?'); - echo ''; - echo edit_language_checkboxes('lang_', $languages); - echo ''; - } -} 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 [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 [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 [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 [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 [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 [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 [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 [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_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_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_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_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_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_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_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/html/module.php b/modules/html/module.php new file mode 100644 index 0000000000..07c100f8da --- /dev/null +++ b/modules/html/module.php @@ -0,0 +1,437 @@ +gedcomCreatedSoftware(); + $CREATED_VERSION = $stats->gedcomCreatedVersion(); + $CREATED_DATE = $stats->gedcomDate(); + + /* + * First Pass. + * Handle embedded language, fact, global, etc. references + * This needs to be done first because the language variables could themselves + * contain embedded keywords. + */ + // Title + $title_tmp=embed_globals(get_block_setting($block_id, 'title')); + $html =embed_globals(get_block_setting($block_id, 'html')); + /* + * Second Pass. + */ + list($new_tags, $new_values) = $stats->getTags("{$title_tmp} {$html}"); + // Title + if (strstr($title_tmp, '#')){$title_tmp = str_replace($new_tags, $new_values, $title_tmp);} + // Content + $html = str_replace($new_tags, $new_values, $html); + + /* + * Restore Current GEDCOM + */ + $GEDCOM = WT_GEDCOM; + + /* + * Start Of Output + */ + $id=$this->getName().$block_id; + $title=''; + if ($ctype=="gedcom" && WT_USER_GEDCOM_ADMIN || $ctype=="user" && WT_USER_ID) { + if ($ctype=="gedcom") { + $name = WT_GEDCOM; + } else { + $name = WT_USER_NAME; + } + $title .= "" + ."\"".i18n::translate('Configure').'"'; + ; + } + if (WT_USER_GEDCOM_ADMIN) { + $title .= help_link('index_htmlplus_a'); + } else { + $title .= help_link('index_htmlplus'); + } + $title.=$title_tmp; + + $content = $html; + + $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, 'compat', safe_POST_bool('compat')); + set_block_setting($block_id, 'ui', safe_POST_bool('ui')); + set_block_setting($block_id, 'gedcom', safe_POST('gedcom')); + set_block_setting($block_id, 'title', $_POST['title']); + 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/fck_editor/fckeditor.php'); + if($useFCK){ + require WT_ROOT.'modules/fck_editor/fckeditor.php'; + } + + $templates=array( + i18n::translate('Keyword examples')=> +' + + + + + #getAllTagsTable# +
'.i18n::translate('Embedded variable').''.i18n::translate('Resulting value').'
', +i18n::translate('Narrative description')=>/* I18N: do not translate the #keywords# */ i18n::translate('This site was last updated on #gedcomUpdated#. There are #totalSurnames# surnames in this family tree. The earliest recorded event is the #firstEventType# of #firstEventName# in #firstEventYear#. The most recent event is the #lastEventType# of #lastEventName# in #lastEventYear#.

If you have any comments or feedback please contact #contactWebmaster#.'), + i18n::translate('GEDCOM statistics')=>'
+#gedcomTitle#
+'.i18n::translate('This GEDCOM was created using %1$s on %2$s.', '#gedcomCreatedSoftware#', '#gedcomDate#').' + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
'.i18n::translate('Individuals').' #totalIndividuals#
'.i18n::translate('Total surnames').' #totalSurnames#
'. i18n::translate('Families').' #totalFamilies#
'.i18n::translate('Sources').' #totalSources#
'.i18n::translate('Media objects').' #totalMedia#
'.i18n::translate('Other records').' #totalOtherRecords#
'.i18n::translate('Total events').' #totalEvents#
'.i18n::translate('Males').' #totalSexMales# [#totalSexMalesPercentage#%]
'.i18n::translate('Females').' #totalSexFemales# [#totalSexFemalesPercentage#%]
'.i18n::translate('Total users').' #totalUsers#
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
'.i18n::translate('Earliest birth year').' #firstBirthYear# #firstBirth#
'.i18n::translate('Latest birth year').' #lastBirthYear# #lastBirth#
'.i18n::translate('Earliest death year').' #firstDeathYear# #firstDeath#
'.i18n::translate('Latest death year').' #lastDeathYear# #lastDeath#
'.i18n::translate('Person who lived the longest').' #longestLifeAge# #longestLife#
'.i18n::translate('Average age at death').' #averageLifespan# 
'.i18n::translate('Family with the most children').' #largestFamilySize# #largestFamily#
'.i18n::translate('Average number of children per family').' #averageChildren#
+

+'.i18n::translate('Most Common Surnames').'
+#commonSurnames# +
' + ); + + $title=get_block_setting($block_id, 'title'); + $html=get_block_setting($block_id, 'html'); + // title + print "" + .translate_fact('TITL') + .help_link('index_htmlplus_title') + ."" + ; + + // templates + print "" + .i18n::translate('Templates') + .help_link('index_htmlplus_template') + ."" + ; + if($useFCK) + { + print "\t\t\t\n" + ."\t\t\t\n"; + } + print "\t\t\t\t\n"; + foreach($templates as $title=>$template) + { + print "\t\t\t\t\n"; + } + print "\t\t\t\n" + ."\t\t\n\t\n" + ; + + // gedcom + $gedcoms = get_all_gedcoms(); + $gedcom=get_block_setting($block_id, 'gedcom'); + if(count($gedcoms) > 1) + { + if($gedcom == '__current__'){$sel_current = ' selected="selected"';}else{$sel_current = '';} + if($gedcom == '__default__'){$sel_default = ' selected="selected"';}else{$sel_default = '';} + print "\t\n\t\t" + .i18n::translate('Family Tree') + .help_link('index_htmlplus_gedcom') + ."\n" + ."\t\t\t\n" + ."\t\t\n\t\n" + ; + } + + // html + print "\t\n\t\t\n" + .i18n::translate('Content') + .help_link('index_htmlplus_content') + ."

" + ."" + ; + if($useFCK) + { + // use FCKeditor module + require_once WT_ROOT.'modules/fck_editor/fckeditor.php'; + $oFCKeditor = new FCKeditor('html') ; + $oFCKeditor->BasePath = './modules/fck_editor/'; + $oFCKeditor->Value = $html; + $oFCKeditor->Width = 700; + $oFCKeditor->Height = 250; + $oFCKeditor->Config['AutoDetectLanguage'] = false ; + $oFCKeditor->Config['DefaultLanguage'] = WT_LOCALE; + $oFCKeditor->Create() ; + } + else + { + //use standard textarea + print ""; + } + + print "\n\t\t\n\t\n"; + + // compatibility mode + $compat=get_block_setting($block_id, 'compat', false); + if($compat == 1){$compat = ' checked="checked"';}else{$compat = '';} + print "\t\n\t\t" + .i18n::translate('Compatibility Mode') + .help_link('index_htmlplus_compat') + ."\n\n" + ."\t\n" + ; + + // extended features + $ui=get_block_setting($block_id, 'ui', false); + if ($ui == 1) { + $ui = ' checked="checked"'; + } else { + $ui = ''; + } + print "\t\n\t\t" + .i18n::translate('Extended Interface') + .help_link('index_htmlplus_ui') + ."\n" + ."\t\n" + ; + + $languages=get_block_setting($block_id, 'languages', WT_LOCALE); + echo ''; + echo i18n::translate('Show this block for which languages?'); + echo ''; + echo edit_language_checkboxes('lang_', $languages); + echo ''; + } +} 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 @@ -getName().$block_id; - $title=''; - $content=embed_globals(get_block_setting($block_id, 'html')); - - if ($ctype=="gedcom" && WT_USER_GEDCOM_ADMIN || $ctype=="user") { - $content .= "" - ."\"".i18n::translate('Configure').'"'; - } - - $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'; - } - -?> - - 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 ''; - } - ?> - - '; - echo i18n::translate('Show this block for which languages?'); - echo ''; - echo edit_language_checkboxes('lang_', $languages); - echo ''; - } -} diff --git a/modules/jw_player/audio.png b/modules/jw_player/audio.png new file mode 100644 index 0000000000..380e7def33 Binary files /dev/null and b/modules/jw_player/audio.png differ diff --git a/modules/jw_player/audio_2.png b/modules/jw_player/audio_2.png new file mode 100644 index 0000000000..e479fb2ad9 Binary files /dev/null and b/modules/jw_player/audio_2.png differ diff --git a/modules/jw_player/flvVideo.php b/modules/jw_player/flvVideo.php new file mode 100644 index 0000000000..02d24a3dc1 --- /dev/null +++ b/modules/jw_player/flvVideo.php @@ -0,0 +1,91 @@ + +> + + + + JW Player for Flash + + + +
+ +".$flvVideo.""; +?> + + + + + + +
Get the Flash Player to see this player.
+ + + + +
+ + + diff --git a/modules/jw_player/module.php b/modules/jw_player/module.php new file mode 100644 index 0000000000..ce9773bbfb --- /dev/null +++ b/modules/jw_player/module.php @@ -0,0 +1,59 @@ +getName().'/'.$mod_action.'.php'; + break; + } + } +} diff --git a/modules/jw_player/player.swf b/modules/jw_player/player.swf new file mode 100644 index 0000000000..292241910e Binary files /dev/null and b/modules/jw_player/player.swf differ diff --git a/modules/jw_player/silverlight.js b/modules/jw_player/silverlight.js new file mode 100644 index 0000000000..8ecfa63392 --- /dev/null +++ b/modules/jw_player/silverlight.js @@ -0,0 +1,581 @@ +/* silverlight.js - PhpGedView Author Brian Holland + * @package webtrees + * @subpackage Module + * @version $Id$ +*/ +/////////////////////////////////////////////////////////////////////////////// +// +// Silverlight.js version 2.0.30523.6 +// +// This file is provided by Microsoft as a helper file for websites that +// incorporate Silverlight Objects. This file is provided under the Microsoft +// Public License available at +// http://code.msdn.microsoft.com/silverlightjs/Project/License.aspx. +// You may not use or distribute this file or the code in this file except as +// expressly permitted under that license. +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +/////////////////////////////////////////////////////////////////////////////// + +if (!window.Silverlight) +{ + window.Silverlight = { }; +} + +////////////////////////////////////////////////////////////////// +// +// _silverlightCount: +// +// Counter of globalized event handlers +// +////////////////////////////////////////////////////////////////// +Silverlight._silverlightCount = 0; + +////////////////////////////////////////////////////////////////// +// +// fwlinkRoot: +// +// Prefix for fwlink URL's +// +////////////////////////////////////////////////////////////////// +Silverlight.fwlinkRoot='http://go2.microsoft.com/fwlink/?LinkID='; + +////////////////////////////////////////////////////////////////// +// +// onGetSilverlight: +// +// Called by Silverlight.GetSilverlight to notify the page that a user +// has requested the Silverlight installer +// +////////////////////////////////////////////////////////////////// +Silverlight.onGetSilverlight = null; + +////////////////////////////////////////////////////////////////// +// +// onSilverlightInstalled: +// +// Called by Silverlight.WaitForInstallCompletion when the page detects +// that Silverlight has been installed. The event handler is not called +// in upgrade scenarios. +// +////////////////////////////////////////////////////////////////// +Silverlight.onSilverlightInstalled = function () {window.location.reload(false);}; + +////////////////////////////////////////////////////////////////// +// +// isInstalled: +// +// Checks to see if the correct version is installed +// +////////////////////////////////////////////////////////////////// +Silverlight.isInstalled = function(version) +{ + var isVersionSupported=false; + var container = null; + + try + { + var control = null; + + try + { + control = new ActiveXObject('AgControl.AgControl'); + if ( version == null ) + { + isVersionSupported = true; + } + else if ( control.IsVersionSupported(version) ) + { + isVersionSupported = true; + } + control = null; + } + catch (e) + { + var plugin = navigator.plugins["Silverlight Plug-In"] ; + if ( plugin ) + { + if ( version === null ) + { + isVersionSupported = true; + } + else + { + var actualVer = plugin.description; + if ( actualVer === "1.0.30226.2") + actualVer = "2.0.30226.2"; + var actualVerArray =actualVer.split("."); + while ( actualVerArray.length > 3) + { + actualVerArray.pop(); + } + while ( actualVerArray.length < 4) + { + actualVerArray.push(0); + } + var reqVerArray = version.split("."); + while ( reqVerArray.length > 4) + { + reqVerArray.pop(); + } + + var requiredVersionPart ; + var actualVersionPart + var index = 0; + + + do + { + requiredVersionPart = parseInt(reqVerArray[index]); + actualVersionPart = parseInt(actualVerArray[index]); + index++; + } + while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); + + if ( requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart) ) + { + isVersionSupported = true; + } + } + } + } + } + catch (e) + { + isVersionSupported = false; + } + if (container) + { + document.body.removeChild(container); + } + + return isVersionSupported; +} +////////////////////////////////////////////////////////////////// +// +// WaitForInstallCompletion: +// +// Occasionally checks for Silverlight installation status. If it +// detects that Silverlight has been installed then it calls +// Silverlight.onSilverlightInstalled();. This is only supported +// if Silverlight was not previously installed on this computer. +// +////////////////////////////////////////////////////////////////// +Silverlight.WaitForInstallCompletion = function() +{ + if ( ! Silverlight.isBrowserRestartRequired && Silverlight.onSilverlightInstalled ) + { + try + { + navigator.plugins.refresh(); + } + catch(e) + { + } + if ( Silverlight.isInstalled(null) ) + { + Silverlight.onSilverlightInstalled(); + } + else + { + setTimeout(Silverlight.WaitForInstallCompletion, 3000); + } + } +} +////////////////////////////////////////////////////////////////// +// +// __startup: +// +// Performs startup tasks +////////////////////////////////////////////////////////////////// +Silverlight.__startup = function() +{ + Silverlight.isBrowserRestartRequired = Silverlight.isInstalled(null); + if ( !Silverlight.isBrowserRestartRequired) + { + Silverlight.WaitForInstallCompletion(); + } + if (window.removeEventListener) { + window.removeEventListener('load', Silverlight.__startup , false); + } + else { + window.detachEvent('onload', Silverlight.__startup ); + } +} + +if (window.addEventListener) +{ + window.addEventListener('load', Silverlight.__startup , false); +} +else +{ + window.attachEvent('onload', Silverlight.__startup ); +} + +/////////////////////////////////////////////////////////////////////////////// +// createObject: +// +// Inserts a Silverlight tag or installation experience into the HTML +// DOM based on the current installed state of Silverlight. +// +///////////////////////////////////////////////////////////////////////////////// + +Silverlight.createObject = function(source, parentElement, id, properties, events, initParams, userContext) +{ + var slPluginHelper = new Object(); + var slProperties = properties; + var slEvents = events; + + slPluginHelper.version = slProperties.version; + slProperties.source = source; + slPluginHelper.alt = slProperties.alt; + + //rename properties to their tag property names. For bacwards compatibility + //with Silverlight.js version 1.0 + if ( initParams ) + slProperties.initParams = initParams; + if ( slProperties.isWindowless && !slProperties.windowless) + slProperties.windowless = slProperties.isWindowless; + if ( slProperties.framerate && !slProperties.maxFramerate) + slProperties.maxFramerate = slProperties.framerate; + if ( id && !slProperties.id) + slProperties.id = id; + + // remove elements which are not to be added to the instantiation tag + delete slProperties.ignoreBrowserVer; + delete slProperties.inplaceInstallPrompt; + delete slProperties.version; + delete slProperties.isWindowless; + delete slProperties.framerate; + delete slProperties.data; + delete slProperties.src; + delete slProperties.alt; + + + // detect that the correct version of Silverlight is installed, else display install + + if (Silverlight.isInstalled(slPluginHelper.version)) + { + //move unknown events to the slProperties array + for (var name in slEvents) + { + if ( slEvents[name]) + { + if ( name == "onLoad" && typeof slEvents[name] == "function" && slEvents[name].length != 1 ) + { + var onLoadHandler = slEvents[name]; + slEvents[name]=function (sender){ return onLoadHandler(document.getElementById(id), userContext, sender)}; + } + var handlerName = Silverlight.__getHandlerName(slEvents[name]); + if ( handlerName != null ) + { + slProperties[name] = handlerName; + slEvents[name] = null; + } + else + { + throw "typeof events."+name+" must be 'function' or 'string'"; + } + } + } + slPluginHTML = Silverlight.buildHTML(slProperties); + } + //The control could not be instantiated. Show the installation prompt + else + { + slPluginHTML = Silverlight.buildPromptHTML(slPluginHelper); + } + + // insert or return the HTML + if(parentElement) + { + parentElement.innerHTML = slPluginHTML; + } + else + { + return slPluginHTML; + } + +} + +/////////////////////////////////////////////////////////////////////////////// +// +// buildHTML: +// +// create HTML that instantiates the control +// +/////////////////////////////////////////////////////////////////////////////// +Silverlight.buildHTML = function( slProperties) +{ + var htmlBuilder = []; + + htmlBuilder.push(''); + + delete slProperties.id; + delete slProperties.width; + delete slProperties.height; + + for (var name in slProperties) + { + if (slProperties[name]) + { + htmlBuilder.push(''); + } + } + htmlBuilder.push('<\/object>'); + return htmlBuilder.join(''); +} + + + +////////////////////////////////////////////////////////////////// +// +// createObjectEx: +// +// takes a single parameter of all createObject +// parameters enclosed in {} +// +////////////////////////////////////////////////////////////////// + +Silverlight.createObjectEx = function(params) +{ + var parameters = params; + var html = Silverlight.createObject(parameters.source, parameters.parentElement, parameters.id, parameters.properties, parameters.events, parameters.initParams, parameters.context); + if (parameters.parentElement == null) + { + return html; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// +// buildPromptHTML +// +// Builds the HTML to prompt the user to download and install Silverlight +// +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.buildPromptHTML = function(slPluginHelper) +{ + var slPluginHTML = ""; + var urlRoot = Silverlight.fwlinkRoot; + var shortVer = slPluginHelper.version ; + if ( slPluginHelper.alt ) + { + slPluginHTML = slPluginHelper.alt; + } + else + { + if (! shortVer ) + { + shortVer=""; + } + slPluginHTML = "Get Microsoft Silverlight"; + slPluginHTML = slPluginHTML.replace('{1}', shortVer ); + slPluginHTML = slPluginHTML.replace('{2}', urlRoot + '108181'); + } + + return slPluginHTML; +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// +// getSilverlight: +// +// Navigates the browser to the appropriate Silverlight installer +// +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.getSilverlight = function(version) +{ + if (Silverlight.onGetSilverlight ) + { + Silverlight.onGetSilverlight(); + } + + var shortVer = ""; + var reqVerArray = String(version).split("."); + if (reqVerArray.length > 1) + { + var majorNum = parseInt(reqVerArray[0] ); + if ( isNaN(majorNum) || majorNum < 2 ) + { + shortVer = "1.0"; + } + else + { + shortVer = reqVerArray[0]+'.'+reqVerArray[1]; + } + } + + var verArg = ""; + + if (shortVer.match(/^\d+\056\d+$/) ) + { + verArg = "&v="+shortVer; + } + + Silverlight.followFWLink("114576" + verArg); +} + + +/////////////////////////////////////////////////////////////////////////////////////////////// +// +// followFWLink: +// +// Navigates to a url based on fwlinkid +// +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.followFWLink = function(linkid) +{ + top.location=Silverlight.fwlinkRoot+String(linkid); +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// +// HtmlAttributeEncode: +// +// Encodes special characters in input strings as charcodes +// +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.HtmlAttributeEncode = function( strInput ) +{ + var c; + var retVal = ''; + + if(strInput == null) + { + return null; + } + + for(var cnt = 0; cnt < strInput.length; cnt++) + { + c = strInput.charCodeAt(cnt); + + if (( ( c > 96 ) && ( c < 123 ) ) || + ( ( c > 64 ) && ( c < 91 ) ) || + ( ( c > 43 ) && ( c < 58 ) && (c!=47)) || + ( c == 95 )) + { + retVal = retVal + String.fromCharCode(c); + } + else + { + retVal = retVal + '&#' + c + ';'; + } + } + + return retVal; +} +/////////////////////////////////////////////////////////////////////////////// +// +// default_error_handler: +// +// Default error handling function +// +/////////////////////////////////////////////////////////////////////////////// + +Silverlight.default_error_handler = function (sender, args) +{ + var iErrorCode; + var errorType = args.ErrorType; + + iErrorCode = args.ErrorCode; + + var errMsg = "\nSilverlight error message \n" ; + + errMsg += "ErrorCode: "+ iErrorCode + "\n"; + + + errMsg += "ErrorType: " + errorType + " \n"; + errMsg += "Message: " + args.ErrorMessage + " \n"; + + if (errorType == "ParserError") + { + errMsg += "XamlFile: " + args.xamlFile + " \n"; + errMsg += "Line: " + args.lineNumber + " \n"; + errMsg += "Position: " + args.charPosition + " \n"; + } + else if (errorType == "RuntimeError") + { + if (args.lineNumber != 0) + { + errMsg += "Line: " + args.lineNumber + " \n"; + errMsg += "Position: " + args.charPosition + " \n"; + } + errMsg += "MethodName: " + args.methodName + " \n"; + } + alert (errMsg); +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// +// __cleanup: +// +// Releases event handler resources when the page is unloaded +// +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.__cleanup = function () +{ + for (var i = Silverlight._silverlightCount - 1; i >= 0; i--) { + window['__slEvent' + i] = null; + } + Silverlight._silverlightCount = 0; + if (window.removeEventListener) { + window.removeEventListener('unload', Silverlight.__cleanup , false); + } + else { + window.detachEvent('onunload', Silverlight.__cleanup ); + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// +// __getHandlerName: +// +// Generates named event handlers for delegates. +// +/////////////////////////////////////////////////////////////////////////////////////////////// +Silverlight.__getHandlerName = function (handler) +{ + var handlerName = ""; + if ( typeof handler == "string") + { + handlerName = handler; + } + else if ( typeof handler == "function" ) + { + if (Silverlight._silverlightCount == 0) + { + if (window.addEventListener) + { + window.addEventListener('onunload', Silverlight.__cleanup , false); + } + else + { + window.attachEvent('onunload', Silverlight.__cleanup ); + } + } + var count = Silverlight._silverlightCount++; + handlerName = "__slEvent"+count; + + window[handlerName]=handler; + } + else + { + handlerName = null; + } + return handlerName; +} \ No newline at end of file diff --git a/modules/jw_player/swfobject.js b/modules/jw_player/swfobject.js new file mode 100644 index 0000000000..e7edd42c09 --- /dev/null +++ b/modules/jw_player/swfobject.js @@ -0,0 +1,8 @@ +/** + * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ + * + * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ +if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; \ No newline at end of file diff --git a/modules/jw_player/wmvVideo.php b/modules/jw_player/wmvVideo.php new file mode 100644 index 0000000000..b7cb4fd89e --- /dev/null +++ b/modules/jw_player/wmvVideo.php @@ -0,0 +1,70 @@ + +> + + + + JW Player for Windows Media Videos + + + + +
+ + + +
The player will be placed here
+ + + +
+ + diff --git a/modules/jw_player/wmvplayer.js b/modules/jw_player/wmvplayer.js new file mode 100644 index 0000000000..75fb965787 --- /dev/null +++ b/modules/jw_player/wmvplayer.js @@ -0,0 +1,799 @@ +/* wmvplayer.js - PhpGedView Author Brian Holland + * @package webtrees + * @subpackage Module + * @version $Id$ +*/ +/**************************************************************************** +* JW WMV Player version 1.1, created with M$ Silverlight 1.0 +* +* This file contains all logic for the JW WMV Player. For a functional setup, +* the following two files are also needed: +* - silverlight.js (for instantiating the silverlight plugin) +* - wmvplayer.xaml (or another XAML skin describing the player graphics) +* +* More info: http://www.jeroenwijering.com/?item=JW_WMV_Player +****************************************************************************/ +if(typeof jeroenwijering == "undefined") { + var jeroenwijering = new Object(); + jeroenwijering.utils = new Object(); +} + + + + + + + + + + +/**************************************************************************** +* The player wrapper; loads config variables and starts MVC cycle. +****************************************************************************/ +jeroenwijering.Player = function(cnt,src,cfg) { + this.controller; + this.model; + this.view; + this.configuration = { + backgroundcolor:'FFFFFF', + windowless:'false', + file:'', + height:'260', + image:'', + backcolor:'FFFFFF', + frontcolor:'000000', + lightcolor:'000000', + screencolor:'000000', + width:'320', + logo:'', + overstretch:'false', + shownavigation:'true', + showstop:'false', + showdigits:'true', + usefullscreen:'true', + usemute:'false', + autostart:'false', + bufferlength:'3', + duration:'0', + repeat:'false', + sender:'', + start:'0', + volume:'90', + link:'', + linkfromdisplay:'false', + linktarget:'_self' + }; + for(itm in this.configuration) { + if(cfg[itm] != undefined) { + if (itm.indexOf('color') > 0) { + this.configuration[itm] = cfg[itm].substr(cfg[itm].length-6); + } else { + this.configuration[itm] = cfg[itm]; + } + } + } + Silverlight.createObjectEx({ + source:src, + parentElement:cnt, + properties:{ + width:this.configuration['width'], + height:this.configuration['height'], + version:'1.0', + inplaceInstallPrompt:true, + isWindowless:this.configuration['windowless'], + background:'#'+this.configuration['backgroundcolor'] + }, + events:{ + onLoad:this.onLoadHandler, + onError:null + }, + context:this + }); +} + +jeroenwijering.Player.prototype = { + addListener: function(typ,fcn) { + this.view.listeners.push({type:typ,func:fcn}); + }, + + getConfig: function() { + return this.configuration; + }, + + onLoadHandler: function(pid,tgt,sdr) { + tgt.configuration['sender'] = sdr; + tgt.controller = new jeroenwijering.Controller(tgt.configuration); + tgt.view = new jeroenwijering.View(tgt.configuration,tgt.controller); + tgt.model = new jeroenwijering.Model(tgt.configuration,tgt.controller,tgt.view); + tgt.controller.startMVC(tgt.view,tgt.model); + }, + + sendEvent: function(typ,prm) { + switch(typ.toUpperCase()) { + case 'LINK': + this.controller.setLink(); + break; + case 'LOAD': + this.controller.setLoad(prm); + break; + case 'MUTE': + this.controller.setMute(); + break; + case 'PLAY': + this.controller.setPlay(); + break; + case 'SCRUB': + this.controller.setScrub(prm); + break; + case 'STOP': + this.controller.setStop(); + break; + case 'VOLUME': + this.controller.setVolume(prm); + break; + } + } +} + + + + + + + + + + +/**************************************************************************** +* The controller of the player MVC triad, which processes all user input. +****************************************************************************/ +jeroenwijering.Controller = function(cfg) { + this.configuration = cfg; +} + +jeroenwijering.Controller.prototype = { + startMVC: function(vie,mdl) { + this.view = vie; + this.model = mdl; + if(this.configuration['usemute'] == 'true') { + this.view.onVolume(0); + this.view.onMute(true); + this.model.goVolume(0); + } else { + this.view.onVolume(this.configuration['volume']); + this.model.goVolume(this.configuration['volume']); + } + if(this.configuration['autostart'] == 'true') { + this.model.goStart(); + } else { + this.model.goPause(); + } + }, + + setState: function(old,stt) { + this.state = stt; + var pos = this.configuration['start']; + if(old == 'Closed' && pos > 0) { + setTimeout(jeroenwijering.utils.delegate(this,this.setScrub),200,pos); + } + }, + + setLink: function() { + if (this.configuration['linktarget'].indexOf('javascript:') == 0) { + return Function(this.configuration['linktarget']).apply(); + } else if (this.configuration['linktarget'] == '_blank') { + window.open(this.configuration['link']); + } else if (this.configuration['linktarget'] != '') { + window.location = this.configuration['link']; + } + }, + + setLoad: function(fil) { + if(this.model.state != "Closed") { + this.model.goStop(); + } + this.configuration['file'] = fil; + if(this.configuration['autostart'] == 'true') { + setTimeout(jeroenwijering.utils.delegate(this.model,this.model.goStart),100); + } + }, + + setMute: function() { + if(this.configuration['usemute'] == 'true') { + this.configuration['usemute'] = 'false'; + this.model.goVolume(this.configuration['volume']); + this.view.onMute(false); + } else { + this.configuration['usemute'] = 'true'; + this.model.goVolume(0); + this.view.onMute(true); + } + }, + + setPlay: function() { + if(this.state == 'Buffering' || this.state == 'Playing') { + if(this.configuration['duration'] == 0) { + this.model.goStop(); + } else { + this.model.goPause(); + } + } else { + this.model.goStart(); + } + }, + + setScrub: function(sec) { + if(sec < 2) { + sec = 0; + } else if (sec > this.configuration['duration']-4) { + sec = this.configuration['duration']-4; + } + if(this.state == 'Buffering' || this.state == 'Playing') { + this.model.goStart(sec); + } else { + this.model.goPause(sec); + } + }, + + setStop: function() { + this.model.goStop(); + }, + + setVolume: function(pct) { + if(pct < 0) { pct = 0; } else if(pct > 100) { pct = 100; } + this.configuration['volume'] = Math.round(pct); + this.model.goVolume(pct); + this.view.onVolume(pct); + if(this.configuration['usemute'] == 'true') { + this.configuration['usemute'] = 'false'; + this.view.onMute(false); + } + }, + + setFullscreen: function() { + var fss = !this.configuration['sender'].getHost().content.FullScreen; + this.configuration['sender'].getHost().content.FullScreen = fss; + jeroenwijering.utils.delegate(this.view,this.view.onFullscreen); + } +} + + + + + + + + + + +/**************************************************************************** +* The view of the player MVC triad, which manages the graphics. +****************************************************************************/ +jeroenwijering.View = function(cfg,ctr) { + this.configuration = cfg; + this.listeners = Array(); + this.controller = ctr; + this.fstimeout; + this.fslistener; + this.display = this.configuration['sender'].findName("PlayerDisplay"); + this.controlbar = this.configuration['sender'].findName("PlayerControls"); + this.configuration['sender'].getHost().content.onResize = + jeroenwijering.utils.delegate(this,this.resizePlayer); + this.configuration['sender'].getHost().content.onFullScreenChange = + jeroenwijering.utils.delegate(this,this.onFullscreen); + this.assignColorsClicks(); + this.resizePlayer(); +} + +jeroenwijering.View.prototype = { + onBuffer: function(pct) { + var snd = this.configuration['sender']; + if(pct == 0) { + snd.findName("BufferText").Text = null; + } else { + pct < 10 ? pct = "0"+pct: pct = ""+pct; + snd.findName("BufferText").Text = pct; + } + this.delegate('BUFFER',[pct]); + }, + + onFullscreen: function(fss) { + var snd = this.configuration['sender']; + var fst = snd.getHost().content.FullScreen; + if(fst) { + this.fstimeout = setTimeout(jeroenwijering.utils.delegate(this, + this.hideFSControls),2000); + this.fslistener = this.display.addEventListener('MouseMove', + jeroenwijering.utils.delegate(this,this.showFSControls)); + snd.findName("FullscreenSymbol").Visibility = "Collapsed"; + snd.findName("FullscreenOffSymbol").Visibility = "Visible"; + } else { + clearTimeout(this.fstimeout); + this.display.removeEventListener("MouseMove",this.fslistener); + this.controlbar.Visibility = "Visible"; + this.display.Cursor = "Hand"; + snd.findName("FullscreenSymbol").Visibility = "Visible"; + snd.findName("FullscreenOffSymbol").Visibility = "Collapsed"; + } + this.resizePlayer(); + this.delegate('FULLSCREEN'); + }, + + showFSControls: function(sdr,arg) { + var vbt = sdr.findName('PlayerControls'); + var yps = arg.GetPosition(vbt).Y; + clearTimeout(this.fstimeout); + this.controlbar.Visibility = "Visible"; + this.display.Cursor = "Hand"; + if(yps < 0) { + this.fstimeout = setTimeout(jeroenwijering.utils.delegate(this, + this.hideFSControls),2000); + } + }, + + hideFSControls: function() { + this.controlbar.Visibility = "Collapsed"; + this.display.Cursor = "None"; + }, + + onLoad: function(pct) { + var snd = this.configuration['sender']; + var max = snd.findName("TimeSlider").Width; + snd.findName("DownloadProgress").Width = Math.round(max*pct/100); + this.delegate('LOAD',[pct]); + }, + + onMute: function(mut) { + var snd = this.configuration['sender']; + this.configuration['usemute'] = ''+mut; + if(mut) { + snd.findName("VolumeHighlight").Visibility = "Collapsed"; + snd.findName("MuteSymbol").Visibility = "Visible"; + snd.findName("MuteOffSymbol").Visibility = "Collapsed"; + if(this.state == 'Playing') { + snd.findName("MuteIcon").Visibility = "Visible"; + } + } else { + snd.findName("VolumeHighlight").Visibility = "Visible"; + snd.findName("MuteSymbol").Visibility = "Collapsed"; + snd.findName("MuteOffSymbol").Visibility = "Visible"; + snd.findName("MuteIcon").Visibility = "Collapsed"; + } + this.delegate('MUTE'); + }, + + onState: function(old,stt) { + var snd = this.configuration['sender']; + this.state = stt; + if(stt == 'Buffering' || stt == 'Playing' || stt == 'Opening') { + snd.findName("PlayIcon").Visibility = "Collapsed"; + snd.findName("PlaySymbol").Visibility = "Collapsed"; + snd.findName("PlayOffSymbol").Visibility = "Visible"; + if (stt=='Playing') { + snd.findName("BufferIcon").Visibility = "Collapsed"; + snd.findName("BufferText").Visibility = "Collapsed"; + if(this.configuration['usemute'] == 'true') { + snd.findName("MuteIcon").Visibility = "Visible"; + } + } else{ + snd.findName("BufferIcon").Visibility = "Visible"; + snd.findName("BufferText").Visibility = "Visible"; + } + } else { + snd.findName("MuteIcon").Visibility = "Collapsed"; + snd.findName("BufferIcon").Visibility = "Collapsed"; + snd.findName("BufferText").Visibility = "Collapsed"; + snd.findName("PlayOffSymbol").Visibility = "Collapsed"; + snd.findName("PlaySymbol").Visibility = "Visible"; + if(this.configuration['linkfromdisplay'] == 'true') { + snd.findName("PlayIcon").Visibility = "Collapsed"; + } else { + snd.findName("PlayIcon").Visibility = "Visible"; + } + } + try { + if(!(old == 'Completed' && stt == 'Buffering') && + !(old == 'Buffering' && stt == 'Paused')) { + playerStatusChange(old.toUpperCase(),stt.toUpperCase()); + } + } catch (err) {} + this.delegate('STATE',[old,stt]); + }, + + onTime: function(elp,dur) { + var snd = this.configuration['sender']; + var snd = this.configuration['sender']; + var max = snd.findName("TimeSlider").Width; + if(dur > 0) { + var pos = Math.round(max*elp/dur); + this.configuration['duration'] = dur; + snd.findName("ElapsedText").Text = jeroenwijering.utils.timestring(elp); + snd.findName("RemainingText").Text = jeroenwijering.utils.timestring(dur-elp); + snd.findName("TimeSymbol").Visibility = "Visible"; + snd.findName("TimeSymbol")['Canvas.Left'] = pos+4; + snd.findName("TimeHighlight").Width = pos-2; + } else { + snd.findName("TimeSymbol").Visibility = "Collapsed"; + } + this.delegate('TIME',[elp,dur]); + }, + + onVolume: function(pct) { + var snd = this.configuration['sender']; + snd.findName("VolumeHighlight").Width = Math.round(pct/5); + this.delegate('VOLUME',[pct]); + }, + + assignColorsClicks: function() { + this.display.Cursor = "Hand"; + this.display.Background = "#FF"+this.configuration['screencolor']; + if(this.configuration['linkfromdisplay'] == 'false') { + this.display.addEventListener('MouseLeftButtonUp', + jeroenwijering.utils.delegate(this.controller, + this.controller.setPlay)); + } else { + this.display.addEventListener('MouseLeftButtonUp', + jeroenwijering.utils.delegate(this.controller, + this.controller.setLink)); + this.display.findName("PlayIcon").Visibility = "Collapsed"; + } + if(this.configuration['logo'] != '') { + this.display.findName('OverlayCanvas').Visibility = "Visible"; + this.display.findName('OverlayLogo').ImageSource = + this.configuration['logo']; + } + this.controlbar.findName("ControlbarBack").Fill = + "#FF"+this.configuration['backcolor']; + this.assignButton('Play',this.controller.setPlay); + this.assignButton('Stop',this.controller.setStop); + this.configuration['sender'].findName('ElapsedText').Foreground = + "#FF"+this.configuration['frontcolor']; + this.assignSlider('Time',this.changeTime); + this.configuration['sender'].findName('DownloadProgress').Fill = + "#FF"+this.configuration['frontcolor']; + this.configuration['sender'].findName('RemainingText').Foreground = + "#FF"+this.configuration['frontcolor']; + this.assignButton('Link',this.controller.setLink); + this.assignButton('Fullscreen',this.controller.setFullscreen); + this.assignButton('Mute',this.controller.setMute); + this.assignSlider('Volume',this.changeVolume); + }, + + assignButton: function(btn,act) { + var el1 = this.configuration['sender'].findName(btn+'Button'); + el1.Cursor = "Hand"; + el1.addEventListener('MouseLeftButtonUp', + jeroenwijering.utils.delegate(this.controller,act)); + el1.addEventListener('MouseEnter', + jeroenwijering.utils.delegate(this,this.rollOver)); + el1.addEventListener('MouseLeave', + jeroenwijering.utils.delegate(this,this.rollOut)); + this.configuration['sender'].findName(btn+'Symbol').Fill = + "#FF"+this.configuration['frontcolor']; + try { + this.configuration['sender'].findName(btn+'OffSymbol').Fill = + "#FF"+this.configuration['frontcolor']; + } catch(e) {} + }, + + assignSlider: function(sld,act) { + var el1 = this.configuration['sender'].findName(sld+'Button'); + el1.Cursor = "Hand"; + el1.addEventListener('MouseLeftButtonUp', + jeroenwijering.utils.delegate(this,act)); + el1.addEventListener('MouseEnter', + jeroenwijering.utils.delegate(this,this.rollOver)); + el1.addEventListener('MouseLeave', + jeroenwijering.utils.delegate(this,this.rollOut)); + this.configuration['sender'].findName(sld+'Slider').Fill = + "#FF"+this.configuration['frontcolor']; + this.configuration['sender'].findName(sld+'Highlight').Fill = + "#FF"+this.configuration['frontcolor']; + this.configuration['sender'].findName(sld+'Symbol').Fill = + "#FF"+this.configuration['frontcolor']; + }, + + delegate: function(typ,arg) { + for(var i=0; i 160) { + rgt += 35; + this.controlbar.findName('RemainingButton').Visibility="Visible"; + this.controlbar.findName('ElapsedButton').Visibility="Visible"; + this.placeElement('RemainingButton',wid-rgt); + this.placeElement('ElapsedButton',lft); + lft +=35; + } else { + this.controlbar.findName('RemainingButton').Visibility = + "Collapsed"; + this.controlbar.findName('ElapsedButton').Visibility="Collapsed"; + } + this.placeElement('TimeButton',lft); + this.stretchElement('TimeButton',wid-lft-rgt); + this.stretchElement('TimeShadow',wid-lft-rgt); + this.stretchElement('TimeStroke',wid-lft-rgt); + this.stretchElement('TimeFill',wid-lft-rgt); + this.stretchElement('TimeSlider',wid-lft-rgt-10); + this.stretchElement('DownloadProgress',wid-lft-rgt-10); + var tsb = this.configuration['sender'].findName('TimeSymbol'); + this.stretchElement('TimeHighlight',tsb['Canvas.Left']-5); + this.controlbar.Visibility = "Visible"; + }, + + centerElement: function(nam,wid,hei) { + var elm = this.configuration['sender'].findName(nam); + elm['Canvas.Left'] = Math.round(wid/2 - elm.Width/2); + elm['Canvas.Top'] = Math.round(hei/2 - elm.Height/2); + }, + + stretchElement: function(nam,wid,hei) { + var elm = this.configuration['sender'].findName(nam); + elm.Width = wid; + if (hei != undefined) { elm.Height = hei; } + }, + + placeElement: function(nam,xps,yps) { + var elm = this.configuration['sender'].findName(nam); + elm['Canvas.Left'] = xps; + if(yps) { elm['Canvas.Top'] = yps; } + } +} + + + + + + + + + + +/**************************************************************************** +* The model of the player MVC triad, which stores all playback logic. +****************************************************************************/ +jeroenwijering.Model = function(cfg,ctr,vie) { + this.configuration = cfg; + this.controller = ctr; + this.view = vie; + this.video = this.configuration['sender'].findName("VideoWindow"); + this.preview = this.configuration['sender'].findName("PlaceholderImage"); + var str = { + 'true':'UniformToFill', + 'false':'Uniform', + 'fit':'Fill', + 'none':'None' + } + this.state = this.video.CurrentState; + this.timeint; + this.video.Stretch = str[this.configuration['overstretch']]; + this.preview.Stretch = str[this.configuration['overstretch']]; + this.video.BufferingTime = + jeroenwijering.utils.spanstring(this.configuration['bufferlength']); + this.video.AutoPlay = true; + this.video.AddEventListener("CurrentStateChanged", + jeroenwijering.utils.delegate(this,this.stateChanged)); + this.video.AddEventListener("MediaEnded", + jeroenwijering.utils.delegate(this,this.mediaEnded)); + this.video.AddEventListener("BufferingProgressChanged", + jeroenwijering.utils.delegate(this,this.bufferChanged)); + this.video.AddEventListener("DownloadProgressChanged", + jeroenwijering.utils.delegate(this,this.downloadChanged)); + if(this.configuration['image'] != '') { + this.preview.Source = this.configuration['image']; + } +} + +jeroenwijering.Model.prototype = { + goPause: function(sec) { + this.video.pause(); + if(!isNaN(sec)) { + this.video.Position = jeroenwijering.utils.spanstring(sec); + } + this.timeChanged(); + }, + + goStart: function(sec) { + this.video.Visibility = 'Visible'; + this.preview.Visibility = 'Collapsed'; + if(this.state == "Closed") { + this.video.Source = this.configuration['file']; + } else { + this.video.play(); + } + if(!isNaN(sec)) { + this.video.Position = jeroenwijering.utils.spanstring(sec); + } + }, + + goStop: function() { + this.video.Visibility = 'Collapsed'; + this.preview.Visibility = 'Visible'; + this.goPause(0); + this.video.Source = 'null'; + this.view.onBuffer(0); + clearInterval(this.timeint); + }, + + goVolume: function(pct) { + this.video.Volume = pct/100; + }, + + stateChanged: function() { + var stt = this.video.CurrentState; + if(stt != this.state) { + this.controller.setState(this.state,stt); + this.view.onState(this.state,stt); + this.state = stt; + this.configuration['duration'] = + Math.round(this.video.NaturalDuration.Seconds*10)/10; + if(stt != "Playing" && stt != "Buffering" && stt != "Opening") { + clearInterval(this.timeint); + } else { + this.timeint = setInterval(jeroenwijering.utils.delegate( + this,this.timeChanged),100); + } + } + }, + + mediaEnded: function() { + if(this.configuration['repeat'] == 'true') { + this.goStart(0); + } else { + this.state = 'Completed'; + this.view.onState(this.state,'Completed'); + this.video.Visibility = 'Collapsed'; + this.preview.Visibility = 'Visible'; + this.goPause(0); + } + }, + + bufferChanged: function() { + var bfr = Math.round(this.video.BufferingProgress*100); + this.view.onBuffer(bfr); + }, + + downloadChanged: function() { + var dld = Math.round(this.video.DownloadProgress*100); + this.view.onLoad(dld); + }, + + timeChanged: function() { + var pos = Math.round(this.video.Position.Seconds*10)/10; + this.view.onTime(pos,this.configuration['duration']); + } +} + + + + + + + + + + +/**************************************************************************** +* Some utility functions. +****************************************************************************/ +jeroenwijering.utils.delegate = function(obj,fcn) { + return function() { + return fcn.apply(obj,arguments); + } +} +jeroenwijering.utils.timestring = function(stp) { + var hrs = Math.floor(stp/3600); + var min = Math.floor(stp%3600/60); + var sec = Math.round(stp%60); + var str = ""; + sec > 9 ? str += sec: str +='0'+sec; + min > 9 ? str = min+":"+str: str='0'+min+":"+str; + hrs > 0 ? str = hrs+":"+str: null; + return str; +} +jeroenwijering.utils.spanstring = function(stp) { + var hrs = Math.floor(stp/3600); + var min = Math.floor(stp%3600/60); + var sec = Math.round(stp%60*10)/10; + var str = hrs+':'+min+':'+sec; + return str; +} \ No newline at end of file diff --git a/modules/jw_player/wmvplayer.xaml b/modules/jw_player/wmvplayer.xaml new file mode 100644 index 0000000000..17a9dbfb9e --- /dev/null +++ b/modules/jw_player/wmvplayer.xaml @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/jw_player/yt.swf b/modules/jw_player/yt.swf new file mode 100644 index 0000000000..881ec8b35c Binary files /dev/null and b/modules/jw_player/yt.swf differ 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 diff --git a/setup.php b/setup.php index 19725fcd6e..4a7710193e 100644 --- a/setup.php +++ b/setup.php @@ -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( @@ -905,6 +906,15 @@ try { " PRIMARY KEY (module_name)". ") 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,". -- cgit v1.3