linpha-cvs Mailing List for LinPHA PHP Photo Gallery
Status: Inactive
Brought to you by:
bzrudi
You can subscribe to this list here.
2006 |
Jan
|
Feb
(143) |
Mar
(104) |
Apr
(127) |
May
(20) |
Jun
(10) |
Jul
(28) |
Aug
(48) |
Sep
(55) |
Oct
(85) |
Nov
(57) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(16) |
Feb
(41) |
Mar
(56) |
Apr
(8) |
May
(1) |
Jun
(9) |
Jul
(54) |
Aug
(24) |
Sep
(2) |
Oct
(14) |
Nov
(30) |
Dec
(7) |
2008 |
Jan
(48) |
Feb
(52) |
Mar
(18) |
Apr
(30) |
May
(4) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Forum <fo...@dc...> - 2013-09-19 10:12:10
|
There seems to be no more activity in this project !? But it is a perfect piece of software with much downloads! The main problem is that there are more and more problems with newer software around like PHP versions, etc. I tried to have a look at the sources, but they are to complex for my basic knowledge to solve problems. Is there nobody who can take an eye at the bug tracker? Best regards Karsten |
From: Frank H. <fra...@un...> - 2010-01-27 13:54:04
|
Hi all, currently I installed you Images Management Tool for validation. During the installation I found out that in step 4 there is a small bug concerning "Create Datebase". Therefore that I have already running MySQL-DB with existing database your installation wizard will failed because in line 115 you have the following statement: if(!$result=mysql_query("CREATE DATABASE ".$DB_name)) If you correct this to if(!$result=mysql_query("CREATE DATABASE IF NOT EXISTS ".$DB_name)) { print("<font color=red>ERROR: Couldn't create $DB_name <br> Please make sure not to use any special chars in database names</font><br> <br>"); die(); } it works fine, if the database is already created ;-) Cheers Frank Hägele |
From: bzrudi <bz...@us...> - 2008-07-20 13:49:25
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1436 Modified Files: ChangeLog Log Message: [ linpha-Bugs-2022107 ] view all exif doesn't work in 1.3.4 -> fixed Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1281 retrieving revision 1.1282 diff -C2 -d -r1.1281 -r1.1282 *** ChangeLog 16 Jul 2008 13:51:25 -0000 1.1281 --- ChangeLog 20 Jul 2008 13:49:20 -0000 1.1282 *************** *** 1,3 **** --- 1,7 ---- + 2008-07-20 bzrudi + * [ linpha-Bugs-2022107 ] view all exif doesn't work in 1.3.4 --> FIXED! + Thanks to Bastiaan for reporting + 2008-07-11 bzrudi * remove 32k photos counter limitation for a single folder |
From: bzrudi <bz...@us...> - 2008-07-20 13:49:24
|
Update of /cvsroot/linpha/linpha/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1436/include Modified Files: metadata_editor.php Log Message: [ linpha-Bugs-2022107 ] view all exif doesn't work in 1.3.4 -> fixed Index: metadata_editor.php =================================================================== RCS file: /cvsroot/linpha/linpha/include/metadata_editor.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** metadata_editor.php 16 Apr 2008 06:57:08 -0000 1.9 --- metadata_editor.php 20 Jul 2008 13:49:20 -0000 1.10 *************** *** 61,70 **** include_once(TOP_DIR.'/include/db_connect.php'); - unset($filename); - /** * security */ ! if(!isset($filename) || strlen($_GET['md5sum']) <> 32) { echo "FATAL: expecting length of 32 chars for md5sum parameter..."; --- 61,68 ---- include_once(TOP_DIR.'/include/db_connect.php'); /** * security */ ! if(strlen($_GET['md5sum']) <> 32) { echo "FATAL: expecting length of 32 chars for md5sum parameter..."; *************** *** 72,79 **** } $query = $GLOBALS['db']->Execute("SELECT filename, prev_path FROM ".PREFIX."photos " . "WHERE md5sum = '".htmlspecialchars($_GET['md5sum'], ENT_QUOTES)."'"); ! $path = $query->FetchRow(); ! $filename = "../".$path[1]."/".$path[0].""; ?> <head> --- 70,89 ---- } + unset($filename); + $query = $GLOBALS['db']->Execute("SELECT filename, prev_path FROM ".PREFIX."photos " . "WHERE md5sum = '".htmlspecialchars($_GET['md5sum'], ENT_QUOTES)."'"); ! ! if(!$query->EOF) ! { ! $path = $query->FetchRow(); ! $filename = "../".$path[1]."/".$path[0].""; ! } ! else ! { ! echo "FATAL: could not get filename for md5sum..."; ! exit(); ! } ! ?> <head> |
From: bzrudi <bz...@us...> - 2008-07-16 13:51:35
|
Update of /cvsroot/linpha/linpha/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9731/install Modified Files: forth_stage_install.php Log Message: 32k limit counter fix Index: forth_stage_install.php =================================================================== RCS file: /cvsroot/linpha/linpha/install/forth_stage_install.php,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** forth_stage_install.php 11 Aug 2007 07:45:42 -0000 1.177 --- forth_stage_install.php 16 Jul 2008 13:51:24 -0000 1.178 *************** *** 251,255 **** level tinyint unsigned, groups varchar(255) DEFAULT ';public;', ! photos SMALLINT, PRIMARY KEY(ID) )", --- 251,255 ---- level tinyint unsigned, groups varchar(255) DEFAULT ';public;', ! photos INT(11), PRIMARY KEY(ID) )", *************** *** 477,481 **** level SMALLINT, groups VARCHAR(255) DEFAULT ';public;', ! photos SMALLINT )", $linpha_tables['sec_lev_album'] => "CREATE TABLE ".$linpha_tables['sec_lev_album']."( --- 477,481 ---- level SMALLINT, groups VARCHAR(255) DEFAULT ';public;', ! photos INT )", $linpha_tables['sec_lev_album'] => "CREATE TABLE ".$linpha_tables['sec_lev_album']."( *************** *** 677,681 **** level INTEGER, groups VARCHAR(255) DEFAULT ';public;', ! photos SMALLINT )", $linpha_tables['sec_lev_album'] => "CREATE TABLE ".$linpha_tables['sec_lev_album']."( --- 677,681 ---- level INTEGER, groups VARCHAR(255) DEFAULT ';public;', ! photos INTEGER )", $linpha_tables['sec_lev_album'] => "CREATE TABLE ".$linpha_tables['sec_lev_album']."( |
From: bzrudi <bz...@us...> - 2008-07-16 13:51:35
|
Update of /cvsroot/linpha/linpha/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9731/include Modified Files: upgrade.php Log Message: 32k limit counter fix Index: upgrade.php =================================================================== RCS file: /cvsroot/linpha/linpha/include/upgrade.php,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** upgrade.php 16 Apr 2008 06:58:19 -0000 1.164 --- upgrade.php 16 Jul 2008 13:51:25 -0000 1.165 *************** *** 335,338 **** update_config(1017, 'db_version'); } ?> ! --- 335,358 ---- update_config(1017, 'db_version'); } + + /** + * START UPDATE 1.3.4 -> 1.3.5 + */ + if($dbversion < 1018) + { + if($dbtype != "sqlite") + { + linpha_log('update','notice','DB update 1018 (remove 32k counter limit for single folder)'); + echo 'DB update 1018 (remove 32k counter limit for single folder)<br />'; + + $alter = $GLOBALS['db']->query("ALTER TABLE ".PREFIX."first_lev_album " . + "CHANGE photos photos INT(11)"); + } + update_config(1018, 'db_version'); + } + + /** + * END UPDATE 1.3.4 -> 1.3.5 + */ ?> ! |
From: bzrudi <bz...@us...> - 2008-07-16 13:51:35
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9731 Modified Files: ChangeLog Log Message: 32k limit counter fix Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1280 retrieving revision 1.1281 diff -C2 -d -r1.1280 -r1.1281 *** ChangeLog 18 Apr 2008 12:20:19 -0000 1.1280 --- ChangeLog 16 Jul 2008 13:51:25 -0000 1.1281 *************** *** 1,2 **** --- 1,6 ---- + + 2008-07-11 bzrudi + * remove 32k photos counter limitation for a single folder + ############################################### ### ### |
From: <fan...@us...> - 2008-05-06 22:32:28
|
Revision: 4936 http://linpha.svn.sourceforge.net/linpha/?rev=4936&view=rev Author: fangehrn Date: 2008-05-06 15:32:23 -0700 (Tue, 06 May 2008) Log Message: ----------- 2008-05-06 flo * ExifTool/Metadata - added check during installation - cleanups - bug fixes Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/install/lib.requirements.php trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step2_requirements.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.exiftool.class.php trunk/linpha2/lib/classes/linpha.filesys.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.pjmt.class.php trunk/linpha2/lib/classes/linpha.view.album.class.php trunk/linpha2/lib/classes/linpha.view.image.class.php trunk/linpha2/lib/include/metadata_iptc_edit.php trunk/linpha2/lib/include/metadata_xmp_edit.php trunk/linpha2/lib/js/LinYUIAlbum.js trunk/linpha2/templates/default/tabs/editXmp.html.php trunk/linpha2/templates/default/tabs/xmp.html.php trunk/linpha2/templates/default/viewer.head.php trunk/linpha2/templates/default/viewer.html.php Added Paths: ----------- trunk/linpha2/templates/default/tabs/editIptc.html.php trunk/linpha2/templates/default/tabs/iptc.html.php Removed Paths: ------------- trunk/linpha2/templates/default/tabs/editIptcXmp.html.php trunk/linpha2/templates/default/tabs/iptcXmp.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/ChangeLog 2008-05-06 22:32:23 UTC (rev 4936) @@ -1,4 +1,10 @@ +2008-05-06 flo + * ExifTool/Metadata + - added check during installation + - cleanups + - bug fixes + 2008-05-05 flo * Viewer - show initial loading icon Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/docs/dev/TODO.txt 2008-05-06 22:32:23 UTC (rev 4936) @@ -23,6 +23,9 @@ ## Big Todos +- Rounded corners not working as expected + (there's a max width/heigth) + - Thumb view - details view (is this really needed) - basket Modified: trunk/linpha2/install/lib.requirements.php =================================================================== --- trunk/linpha2/install/lib.requirements.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/install/lib.requirements.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -134,6 +134,12 @@ return $array; } +function installCheckExifTool() +{ + require_once(LINPHA_DIR.'/lib/classes/linpha.exiftool.class.php'); + $exiftool = new LinExifTool(); + return $exiftool->getExifToolVersion(); +} function installCheckConvert() { Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/install/step10_postsettings.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -147,7 +147,7 @@ <br /> <?php -if($_SESSION['sys_import_has_perl'] || LIN_OS == 'win') +if($_SESSION['sys_import_exiftool_avail']) { echo "<h2>".i18n_install("Make Use Of Exiftool?")."</h2><hr>"; echo i18n_install("Exiftool is an advanced manipulaion library for MetaData information like XMP/IPTC and friends.")." "; Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/install/step2_requirements.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -221,27 +221,57 @@ { print_line_middle($perl_version); print_line_right(success_msg()); - $perl_ok = 1; + $perl_ok = 1; } else { print_line_middle( i18n_install("Not Found") ); print_line_right(warning_msg()); - print_line_info( i18n_install("Perl was NOT found on this server. However, no need to panic as LinPHA will even work without.") ); + print_line_info( i18n_install("Perl was NOT found on this server. However, no need to panic as LinPHA will even work without. But you cannot use the ExifTool for reading/writing image metadata.") ); // please do not add linebreaks to translation strings. The would not get detected! $perl_ok = 0; } - echo "\t".'<input type="hidden" name="sys_import_has_perl" value="'.$perl_ok.'">'."\n"; + echo "\t".'<input type="hidden" name="sys_import_has_perl" value="'.$perl_ok.'">'."\n"; + + // @TODO make perl path avail in config + //echo "\t".'<input type="hidden" name="sys_import_perl_path" value="'.$perl_path.'">'."\n"; + } + else + { + $perl_ok = 1; + } - /** - * even if user decided to not make use of exiftool, we set - * sys_import_exiftool_avail = true , as we need it for video infos later - */ - echo "\t".'<input type="hidden" name="sys_import_exiftool_avail" value="'.$perl_ok.'">'; + if ($perl_ok) + { + print_line_left("ExifTool"); + + $exiftool_version = installCheckExifTool(); + + if($exiftool_version) + { + print_line_middle($exiftool_version); + print_line_right(success_msg()); + $exiftool_ok = 1; + } + else + { + print_line_middle( i18n_install("Not Supported") ); + print_line_right(warning_msg()); + print_line_info( i18n_install("ExifTool is not supported on your system. You will not be able to have full support for reading/writing image metadata.") ); + $exiftool_ok = 0; + } + + /** + * even if user decided to not make use of exiftool, we set + * sys_import_exiftool_avail = true , as we need it for video infos later + */ + echo "\t".'<input type="hidden" name="sys_import_exiftool_avail" value="'.$exiftool_ok.'">'; + } + else + { + echo "\t".'<input type="hidden" name="sys_import_exiftool_avail" value="0">'; + } - // @TODO make perl path avail in config - //echo "\t".'<input type="hidden" name="sys_import_perl_path" value="'.$perl_path.'">'."\n"; - } /** * check GD only if IM not available */ Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -338,6 +338,7 @@ 'sys_import_exif', 'sys_import_exif_autorot', 'sys_import_use_exiftool', + 'sys_import_exiftool_avail', 'sys_image_exif', 'sys_image_iptc', 'sys_image_xmp', Modified: trunk/linpha2/lib/classes/linpha.exiftool.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.exiftool.class.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/classes/linpha.exiftool.class.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -28,7 +28,7 @@ if(!defined('LINPHA_DIR')) { exit(1); } -class LinExifTool extends LinMetaData +class LinExifTool /*extends LinMetaData // this makes no sense! flo */ { public $exiftool, $filename; @@ -63,6 +63,23 @@ } } } + + public function getExifToolVersion() + { + $array_output = array(); $return_value = ''; // don't do this inside exec() !!!!!!!!!! it will overwrite the returned content !! + + LinFilesys::linExec($this->exiftool.' -ver', $array_output, $return_value); + + if ($return_value != 0) { + return false; + } + + if (!isset($array_output[0]) || empty($array_output[0]) || $array_output[0] == '0') { + return false; + } + + return $array_output[0]; + } /** * This method extracts the Thumbnail from EXIF/Composite section. @@ -82,6 +99,7 @@ /** * Buffer output of passthru and save to $thumb var */ + session_write_close(); // see LinFilesys::linExec() why this is absolutely required! ob_start(); passthru($this->exiftool.' '.$parameters.' "'.$filename.'"'); $thumb = ob_get_contents(); @@ -95,20 +113,9 @@ { $got_thumb = true; } - else - { - $got_thumb = false; - } } - - if($got_thumb) - { - return true; - } - else - { - return false; - } + + return $got_thumb; } /** @@ -192,10 +199,15 @@ $temp = explode("\t", $row); $key = trim($temp['0']); - $value = $temp['1']; + if (isset($temp['1'])) { + $value = $temp['1']; + } else { + $value = ""; + } + /** - * normalize tag names + * normalize tag names to be compatible EXIF standard * http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html */ switch($key) @@ -360,6 +372,79 @@ return $image_date; } + public function saveModifiedMetaData($filename, $metaTag, $meta_array) + { + $parameter = "-codedcharacterset=UTF8 " . + "-overwrite_original " . // No Backup we do take care of it our own :-) + "-n "; // Read numbers + + /** + * Update all images in folder with given MetaData, + * therefore we need to fake file to dirname instead + */ + if (isset($_POST['linRecursiveUpdate'])) + { + $file = dirname($filename); + $parameter .= "-r " . // Recursive + "-ext jpeg " . // Filetype + "-ext jpg " . + "-ext tif " . + "-ext tiff "; + } + else + { + $file = $filename; + } + + /** + * Go ahead write MetaData + */ + foreach($meta_array as $name => $value) + { + if(strlen(trim($value)) >= 1) + { + $name = str_replace("_", "-", $name); + $parameter .= "-$metaTag:$name='$value' "; + } + } + + //echo '<pre>', print_r($meta_array), '</pre>'; + //echo "PARA :".$parameter; + + /** + * Finally fire up exiftool + */ + $array_output = array(); $return_value = false; + LinFilesys::linExec($this->exiftool.' '.$parameter.' "'.$file.'"', $array_output, $return_value); + + if ($return_value != 0) + { + linSysLog(i18n("Error: Saving XMP/IPTC data failed.")); + linLog(LOG_TYPE_META, LOG_ERR, 'meta_data', "Error: Saving XMP/IPTC data failed for: ".$filename); + return false; + } + + /** + * Copy XMP to IPTC if needed + */ + if(isset($_POST['linXmp2Iptc'])) + { + $options = "-TagsFromFile "; + $arguments = LINPHA_DIR.'/lib/exiftool/xmp2iptc.args'; + + $array_output = array(); $return_value = false; + LinFilesys::linExec($this->exiftool.' '.$options.' "'.$file.'" -@ '.$arguments.' "'.$file.'"', $array_output, $return_value); + + if ($return_value != 0) + { + linLog(LOG_TYPE_META, LOG_ERR, 'meta_data', "Error: Copy XMP to IPTC failed for: ".$filename); + // no return false because previous exec() worked fine and then we need to re-import the file + } + } + + return true; + } + /** * Define array with allowed IPTC/XMP tags and human readable translation * @param none Modified: trunk/linpha2/lib/classes/linpha.filesys.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.filesys.class.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/classes/linpha.filesys.class.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -166,6 +166,9 @@ session_write_close(); exec( $str, $array_output, $return_value ); + + // untested, may work... (here they use it: http://framework.zend.com/manual/de/zend.session.advanced_usage.html) + //session_start(); } /** Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -378,194 +378,71 @@ * @return none * @author flo, bzrudi */ - public function saveModifiedMetaData() + public function saveModifiedMetaData($filename, $metaTag) { - if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) - { + if (!$GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { + return false; + } + + if (!file_exists($filename)) { + return false; + } + + $meta_array = $GLOBALS['_POST']; + + /** + * Important! + * Remove other POST data from this array, because we just + * take all values and this will generate unexpected results!!! + * We got problems because $_POST['linMetaField'] is an array. + */ + unset ($meta_array['linCmd']); + unset ($meta_array['linMetaField']); + unset ($meta_array['submit']); + unset ($meta_array['linDoBackup']); + unset ($meta_array['linRecursiveUpdate']); + unset ($meta_array['linXmp2Iptc']); + + /** + * See if we should create file backup first. If it went wrong, + * exit with $write_ok = false + */ + if (isset($_POST['linDoBackup'])) { + if (LinFilesys::backupFile($filename)) { + $write_ok = true; + } else { + $write_ok = false; + } + } else { /** - * Write IPTC/XMP MetaData to file + * If user wants no backup, make at least sure file is + * writeable, or break later */ - if(isset($_POST['linCmd']) - && isset ($GLOBALS['linpha']->imgview->src_file) - && file_exists($GLOBALS['linpha']->imgview->src_file)) - { - global $meta_array; - $meta_array = $GLOBALS['_POST']; - - /** - * Important! - * Remove other POST data from this array, because we just - * take all values and this will generate unexpected results!!! - * We got problems because $_POST['linMetaField'] is an array. - */ - unset ($meta_array['linCmd']); - unset ($meta_array['linMetaField']); - unset ($meta_array['submit']); - - /** - * Prevent notices from unset checkboxes and make sure to - * set to false if unset - */ - if(!isset($meta_array['linDoBackup'])) - { - /** - * If user wants no backup, make at least sure file is - * writeable, or break later - */ - if(is_writable($GLOBALS['linpha']->imgview->src_file)) - { - $write_ok = true; - } - else - { - $write_ok = false; - } - $meta_array['linDoBackup'] = false; - } - - /** - * Apply MetaData to all files in folder - */ - if(!isset($meta_array['linRecursiveUpdate'])) - { - $recursive_update = false; - } - else - { - $recursive_update = true; - } - - /** - * See if we should create file backup first. If it went wrong, - * exit with $write_ok = false - */ - if($meta_array['linDoBackup']) - { - if(LinFilesys - ::backupFile($GLOBALS['linpha']->imgview->src_file)) - { - $write_ok = true; - } - else - { - $write_ok = false; - } - } - - /** - * If the backup went wrong or file isn't writable, trying - * to write MetaData would most probably also fail, so skip it - */ - if($write_ok) - { - /** - * Fire up exiftool - */ - LinMetaData::__construct(); - $file = $GLOBALS['linpha']->imgview->src_file; - $exiftool = $this->objMetaTool->exiftool; - - /** - * Prevent exiftool from backing up file, as we do take - * care of it our own :-) - */ - $parameter = "-overwrite_original " . // No Backup - "-n "; // Read numbers - - /** - * Update all images in folder with given MetaData, - * therefore we need to fake file to dirname instead - */ - if($recursive_update) - { - $file = dirname($GLOBALS['linpha']->imgview->src_file); - $parameter .= "-r " . // Recursive - "-ext jpeg " . // Filetype - "-ext jpg " . - "-ext tif " . - "-ext tiff "; - } - - /** - * Apply XMP MetaData to IPTC Segment? - */ - if(!isset($meta_array['linXmp2Iptc'])) - { - $xmp2iptc = false; - } - else - { - $xmp2iptc = true; - } - - unset ($meta_array['linDoBackup']); - unset ($meta_array['linRecursiveUpdate']); - unset ($meta_array['linXmp2Iptc']); - - - /** - * Go ahead write MetaData - */ - if($_POST['linCmd'] == 'linInsertMetaIptc') - { - $metaTag = 'iptc'; - } - elseif($_POST['linCmd'] == 'linInsertMetaXmp') - { - $metaTag = 'xmp'; - } - - foreach($meta_array AS $name => $value) - { - if(strlen(trim($value)) >= 1) - { - $name = str_replace("_", "-", $name); - $parameter .= "-$metaTag:$name='$value' "; - } - } - - //echo '<pre>', print_r($meta_array), '</pre>'; - //echo "PARA :".$parameter; - - /** - * Finally fire up exiftool - * TODO: take care of response status - */ - $array_output = array(); $return_value = false; - LinFilesys::linExec($exiftool.' '.$parameter.' "'.$file.'"', $array_output, $return_value); - - /** - * Copy XMP to IPTC if needed - */ - if($xmp2iptc) - { - $options = "-TagsFromFile "; - $arguments = - LINPHA_DIR.'/lib/exiftool/xmp2iptc.args'; - - $array_output = array(); $return_value = false; - LinFilesys::linExec($exiftool.' '.$options.' "'.$file.'" -@ '.$arguments.' "'.$file.'"', $array_output, $return_value); - } - - /** - * force read data from file again if write was successful - */ - unset ($meta_array); - LinImport:: - updateEntry($GLOBALS['linpha']->template->idCurrent, - dirname($GLOBALS['linpha']->imgview->src_file), - basename($GLOBALS['linpha']->imgview->src_file)); - } - else - { - linSysLog(sprintf(i18n("Error: Processing of: %s failed, please check write permissions"), - $GLOBALS['linpha']->imgview->src_file)); - linLog(LOG_TYPE_META, LOG_ERR, 'meta_data', "Error: " . - "Processing failed for: ".' ' . - $GLOBALS['linpha']->imgview->src_file); - } + if(is_writable($filename)) { + $write_ok = true; + } else { + $write_ok = false; } } + + /** + * If the backup went wrong or file isn't writable, trying + * to write MetaData would most probably also fail, so skip it + */ + if (!$write_ok) + { + linSysLog(LIN_STR_CHKFILEPERM); + linLog(LOG_TYPE_META, LOG_ERR, 'meta_data', "Error: Processing failed for: ".$filename); + return false; + } + + if ($this->objMetaTool->saveModifiedMetaData($filename, $metaTag, $meta_array)) { + /** + * force read data from file again if write was successful + */ + LinImport::updateEntry($GLOBALS['linpha']->template->idCurrent, + dirname($filename), basename($filename)); + } } /** @@ -576,7 +453,7 @@ * @return none * @author flo */ - public function saveModifiedMetaDataLinpha($md5sum) + public static function saveModifiedMetaDataLinpha($md5sum) { if(isset($_POST['linMetaField']) && is_array($_POST['linMetaField'])) { Modified: trunk/linpha2/lib/classes/linpha.pjmt.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.pjmt.class.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/classes/linpha.pjmt.class.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -27,7 +27,7 @@ if(!defined('LINPHA_DIR')) { exit(1); } -class LinPjmtTool extends LinMetaData +class LinPjmtTool /*extends LinMetaData // this makes no sense! flo */ { /** * Constructor @@ -244,6 +244,12 @@ return $image_date; } + public function saveModifiedMetaData($filename, $metaTag, $meta_array) + { + // not implemented + return false; + } + /** * Define array with allowed EXIF tags and human readable translation * @param none Modified: trunk/linpha2/lib/classes/linpha.view.album.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -1,4 +1,4 @@ -<?php +<?php /* * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> * Florian Angehrn Modified: trunk/linpha2/lib/classes/linpha.view.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -50,10 +50,14 @@ $this->imgData = $GLOBALS['linpha']->db->GetRow("SELECT * FROM ".LIN_PREFIX."photos " . "WHERE id = '".LinSql::linAddslashes($GLOBALS['linpha']->template->idCurrent)."'"); - if(isset($_REQUEST['linCmd'])) { + if (isset($_REQUEST['linCmd'])) { $this->imageCommands(); } + if (isset($_REQUEST['linSaveIptcXmp'])) { + $this->saveIptcXmp($_REQUEST['linSaveIptcXmp']); + } + if ( !isset($_GET['linTab']) || empty($_GET['linTab']) ) { return; @@ -93,10 +97,14 @@ $this->getImageData('exif'); require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/exif.html.php'); break; - case 'iptcXmp': - $this->getImageData('iptcXmp'); - require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/iptcXmp.html.php'); + case 'iptc': + $this->getImageData('iptc'); + require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/iptc.html.php'); break; + case 'xmp': + $this->getImageData('xmp'); + require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/xmp.html.php'); + break; case 'editMeta': @@ -112,34 +120,56 @@ require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/editMeta.html.php'); break; - case 'editIptcXmp': + case 'editIptc': if (!LinIdentify::isSupportedImage($this->imgData['img_type'])) { return; } + + if (!$GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { + return; + } - $filename = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); // also used in metadata_[iptc,xmp]_edit.php + if (!$GLOBALS['linpha']->sql->config->value['sys_import_use_exiftool']) { + echo i18n("Error: Cannot edit IPTC: ExifTool is not enabled."); + return; + } - if ($GLOBALS['linpha']->sql->config->value['sys_image_iptc'] || $GLOBALS['linpha']->sql->config->value['sys_image_xmp']) { - if (isset ($GLOBALS['linpha']->imgview->src_file) && file_exists($GLOBALS['linpha']->imgview->src_file)) { - if (is_writable($filename)) { - $meta_edit_possible = true; - } else { - $meta_edit_possible = false; - } - } else { - $meta_edit_possible = false; - } - - if (!$meta_edit_possible) - { - echo LIN_STR_CHKFILEPERM; - return; - } + $filename = $this->getFullFilename(); // also used in metadata_[iptc,xmp]_edit.php + + if (!file_exists($filename) || !is_writable($filename)) { + echo LIN_STR_CHKFILEPERM; + return; } - require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/editIptcXmp.html.php'); + require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/editIptc.html.php'); + break; + case 'editXmp': + + if (!LinIdentify::isSupportedImage($this->imgData['img_type'])) { + return; + } + + if (!$GLOBALS['linpha']->sql->config->value['sys_image_xmp']) { + return; + } + + if (!$GLOBALS['linpha']->sql->config->value['sys_import_use_exiftool']) { + echo i18n("Error: Cannot edit IPTC: ExifTool is not enabled."); + return; + } + + $filename = $this->getFullFilename(); // also used in metadata_[iptc,xmp]_edit.php + + if (!file_exists($filename) || !is_writable($filename)) { + echo LIN_STR_CHKFILEPERM; + return; + } + + require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/editXmp.html.php'); + break; + } /*echo '{'."\n"; @@ -164,6 +194,7 @@ echo '}'."\n";*/ } + /** * Indexes the specified file with EXIF/IPTC/XMP/GPS data * @param string $filename filename to index @@ -183,15 +214,11 @@ if ($GLOBALS['linpha']->sql->config->value['sys_image_'.$value] && LinMetaData::fileNeedsIndexing($this->imgData['md5sum'], $table)) { - if (!isset($metadata)) { - $metadata = new LinMetaData(); + if (!isset($this->metadata)) { + $this->metadata = new LinMetaData(); } - if (!isset($this->src_file)) { - $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); - } - - $metadata->saveMetaDataToDatabase($value, $table, $this->src_file, $this->imgData['md5sum'] ); + $this->metadata->saveMetaDataToDatabase($value, $table, $this->getFullFilename(), $this->imgData['md5sum'] ); } } @@ -212,16 +239,12 @@ if (LinMetaData::fileNeedsIndexing($this->imgData['md5sum'], $table)) { - if (!isset($metadata)) { - $metadata = new LinMetaData(); + if (!isset($this->metadata)) { + $this->metadata = new LinMetaData(); } - if (!isset($this->src_file)) { - $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); - } - //$MetaData->singleImportGeoData($md5sum, $filename); - if ($metadata->saveMetaDataToDatabase('exifgps', $table, $this->src_file, $this->imgData['md5sum'] )) + if ($this->metadata->saveMetaDataToDatabase('exifgps', $table, $this->getFullFilename(), $this->imgData['md5sum'] )) { $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."photos " . "SET geodata='1' WHERE md5sum='".$this->imgData['md5sum']."' "); @@ -304,6 +327,14 @@ } +function getFullFilename() +{ + if (!isset($this->src_file)) { + $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); + } + return $this->src_file; +} + function saveImageComment() { /** @@ -341,40 +372,37 @@ */ function imageCommands() { - switch($_REQUEST['linCmd']) - { - case 'Recreate': - if($GLOBALS['linpha']->sql->isAdmin()) - { - $thumbnail = new LinImage(); - $_GET['force'] = true; - $thumbnail->createThumbnail($GLOBALS['linpha']->template->idCurrent); - } - break; - case 'ForceImport': // called in viewImg - if($GLOBALS['linpha']->sql->isAdmin()) { - if (!isset($this->src_file)) { - $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); - } - LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->src_file) , $this->imgData['name'] ); - } - break; + switch($_REQUEST['linCmd']) + { + case 'Recreate': + if($GLOBALS['linpha']->sql->isAdmin()) + { + $thumbnail = new LinImage(); + $_GET['force'] = true; + $thumbnail->createThumbnail($GLOBALS['linpha']->template->idCurrent); + } + break; + case 'ForceImport': // called in viewImg + if($GLOBALS['linpha']->sql->isAdmin()) { + LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->getFullFilename()) , $this->imgData['name'] ); + } + break; - case 'RotateLeft': - if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { - LinImage::rotateImageByMenuCall('-90', $GLOBALS['linpha']->template->idCurrent); - } - break; - case 'RotateRight': - if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { - LinImage::rotateImageByMenuCall('90', $GLOBALS['linpha']->template->idCurrent); - } - break; - - case 'AddToBasket': - LinViewImage::addToBasket(); - break; - } + case 'RotateLeft': + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { + LinImage::rotateImageByMenuCall('-90', $GLOBALS['linpha']->template->idCurrent); + } + break; + case 'RotateRight': + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { + LinImage::rotateImageByMenuCall('90', $GLOBALS['linpha']->template->idCurrent); + } + break; + + case 'AddToBasket': + LinViewImage::addToBasket(); + break; + } } static function addToBasket() @@ -420,5 +448,18 @@ }*/ } +function saveIptcXmp($what) +{ + if (!isset($this->metadata)) { + $this->metadata = new LinMetaData(); + } + + if ($what == 'iptc') { + $this->metadata->saveModifiedMetaData($this->getFullFilename(), 'iptc'); + } elseif ($what == 'xmp') { + $this->metadata->saveModifiedMetaData($this->getFullFilename(), 'xmp'); + } +} + } // end class LinViewImage ?> \ No newline at end of file Modified: trunk/linpha2/lib/include/metadata_iptc_edit.php =================================================================== --- trunk/linpha2/lib/include/metadata_iptc_edit.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/include/metadata_iptc_edit.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -46,53 +46,25 @@ /** * We are going to save all IPTC data UTF8 encoded in database + * @TODO is this still needed since we are using everything in UTF8? */ include_once(LINPHA_DIR.'/lib/pjmt/Unicode.php'); $MetaData = new LinMetaData(); -$MetaData->setMetaFields('iptc'); $file_data = $MetaData->objMetaTool->readMetaDataFromFile('iptc', $filename); +$file_data = array_change_key_case($file_data, CASE_LOWER); - /** - * User may have selected all fields, so there are no available fields left - * create emtpy array to prevent notices... - */ -$iptc_avail = $MetaData->available_fields['iptc']; -if(!is_array($iptc_avail)) -{ - $iptc_avail = array(); -} - - -/** - * User may have selected not even a single field for now, so there are no - * selected fields, create emtpy array to prevent notices... - */ -$iptc_defined = $MetaData->defined_fields['iptc']; -if(!is_array($iptc_defined)) -{ - $iptc_defined = array(); -} - - -/** - * Merge both arrays to make all fields avail - */ -$iptc_array = $iptc_avail + $iptc_defined; - -/** * Now output the actual HTML form */ -foreach($iptc_array AS $name => $value) +foreach(LinMetaData::$metaTags['iptc'] as $name => $description) { - $lower_array = array_change_key_case($file_data, CASE_LOWER); - $name = str_replace("_", "-", $name); + $name = str_replace("_", "-", $name); // ?? - if(isset($lower_array[$name])) + if(isset($file_data[$name])) { - $file_iptc = HTML_UTF8_Escape(trim($lower_array[$name])); + $file_iptc = HTML_UTF8_Escape(trim($file_data[$name])); } else { @@ -126,7 +98,7 @@ } echo "<tr>" . - "<td>$value</td>" . + "<td>$description</td>" . "<td> ". "<select name='$name' style='width:350px; size='1' class='linForms'>" . @@ -140,7 +112,7 @@ case 'specialinstructions': echo "<tr>" . - "<td>$value</td>" . + "<td>$description</td>" . "<td> ". "<textarea style='width:350px; height:50px;' class='linForms' name='$name' maxlength='255'>$file_iptc</textarea>" . @@ -152,7 +124,7 @@ case 'caption-abstract': echo "<tr>" . - "<td>$value</td>" . + "<td>$description</td>" . "<td> ". "<textarea style='width:350px; height:60px;' class='linForms' name='$name' maxlength='1999'>$file_iptc</textarea>" . @@ -163,7 +135,7 @@ default: echo "<tr>" . - "<td>$value</td>" . + "<td>$description</td>" . "<td> ". "<input style='width:350' class='linForms' name='$name' type='text' value='".$file_iptc."'>" . @@ -172,5 +144,4 @@ } } /* vi: set ts=4 sw=4 sts=4 */ -?> - +?> \ No newline at end of file Modified: trunk/linpha2/lib/include/metadata_xmp_edit.php =================================================================== --- trunk/linpha2/lib/include/metadata_xmp_edit.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/include/metadata_xmp_edit.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -43,46 +43,25 @@ <tr><td colspan = "3"><hr /></td></tr> <?php -$MetaData = new LinMetaData(); -$MetaData->setMetaFields('xmp'); -$file_data = $MetaData->objMetaTool->readMetaDataFromFile('xmp', $filename); - /** - * User may have selected all fields, so there are no available fields left - * create emtpy array to prevent notices... + * We are going to save all IPTC data UTF8 encoded in database + * @TODO is this still needed since we are using everything in UTF8? */ -$xmp_avail = $MetaData->available_fields['xmp']; -if(!is_array($xmp_avail)) -{ - $xmp_avail = array(); -} +include_once(LINPHA_DIR.'/lib/pjmt/Unicode.php'); -/** - * User may have selected not even a single field for now, so there are no - * selected fields, create emtpy array to prevent notices... - */ -$xmp_defined = $MetaData->defined_fields['xmp']; -if(!is_array($xmp_defined)) -{ - $xmp_defined = array(); -} -/** - * Merge both arrays to make all fields avail - */ -$xmp_array = $xmp_avail + $xmp_defined; +$MetaData = new LinMetaData(); +$file_data = $MetaData->objMetaTool->readMetaDataFromFile('xmp', $filename); +$file_data = array_change_key_case($file_data, CASE_LOWER); - /** * Now output the actual HTML form */ -foreach($xmp_array AS $name => $value) +foreach(LinMetaData::$metaTags['xmp'] as $name => $description) { - $lower_array = array_change_key_case($file_data, CASE_LOWER); - - if(isset($lower_array[$name])) + if(isset($file_data[$name])) { - $file_xmp = $lower_array[$name]; + $file_xmp = HTML_UTF8_Escape(trim($file_data[$name])); } else { @@ -109,7 +88,7 @@ echo "<tr>" . - "<td>$value</td>" . + "<td>$description</td>" . "<td> ". "<select name='$name' style='width:350px; size='1' class='linForms'>" . @@ -129,7 +108,7 @@ default: echo "<tr>" . - "<td>$value</td>" . + "<td>$description</td>" . "<td> ". "<input name='$name' style='width:350px;' class='linForms' type='text' value='".$file_xmp."'>" . Modified: trunk/linpha2/lib/js/LinYUIAlbum.js =================================================================== --- trunk/linpha2/lib/js/LinYUIAlbum.js 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/lib/js/LinYUIAlbum.js 2008-05-06 22:32:23 UTC (rev 4936) @@ -472,16 +472,24 @@ this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['exif']); } - if (linITPCXMPEnabled) { - this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['iptcXmp']); + if (linITPCEnabled) { + this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['iptc']); } + if (linXMPEnabled) { + this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['xmp']); + } + if (linPermMetaEdit) { this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['editMeta']); - if (linITPCXMPEnabled) { - this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['editIptcXmp']); + if (linITPCEnabled) { + this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['editIptc']); } + + if (linXMPEnabled) { + this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['editXmp']); + } } break; case 2: // video @@ -758,7 +766,17 @@ location.href = LINPHA_LINK+"&linCat=basket&checkout_as=print"; } +// saveIptcXmp() +YAHOO.linpha.Album.prototype.saveIptcXmp = function(what, formElem) { + YAHOO.util.Connect.setForm(formElem); + myLinGlobal.asyncRequest("POST", LINPHA_LINK+'linCat=image&linSaveIptcXmp='+what+'&linId='+linIdCurrent, this.saveIptcXmpFinish, this, null); +} +// saveIptcXmpFinish() +YAHOO.linpha.Album.prototype.saveIptcXmpFinish = function(t) { +} + + myLinPage.enableOnResize('thumb'); var myLinAlbum = new YAHOO.linpha.Album(); Copied: trunk/linpha2/templates/default/tabs/editIptc.html.php (from rev 4935, trunk/linpha2/templates/default/tabs/editIptcXmp.html.php) =================================================================== --- trunk/linpha2/templates/default/tabs/editIptc.html.php (rev 0) +++ trunk/linpha2/templates/default/tabs/editIptc.html.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -0,0 +1,33 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + +<div id="linDivMetaIptc"> +<?php if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { ?> + <br /> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp('iptc',this); return false;"> + <table border="0"> + <?php + include(LINPHA_DIR.'/lib/include/metadata_iptc_edit.php'); + ?> + <tr> + <td colspan="2"> + <br /> + <input type="hidden" name="linCmd" value="linInsertMetaIptc" /> + <input type="submit" class="linButton" name="submit" value="<?php echo LIN_STR_SUBMIT; ?>" /> + </td> + </tr> + </table> + </form> + <br /> + <br /> + <p>Powered by: <a href="http://owl.phy.queensu.ca/~phil/exiftool/" >ExifTool</a></p> + <?php +} else { + echo i18n("IPTC Is Currently Disabled.").'<br /><br />'; + if($GLOBALS['linpha']->sql->isAdmin()) { + echo '<a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_iptc">'.i18n("Enable IPTC").'</a>'; + echo '<br /><br />'; + } +} ?> +</div> + + \ No newline at end of file Deleted: trunk/linpha2/templates/default/tabs/editIptcXmp.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/editIptcXmp.html.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/templates/default/tabs/editIptcXmp.html.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -1,62 +0,0 @@ -<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> - -<div id="linDivMetaIptc"> -<?php if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { ?> - <br /> - <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp(this); return false;"> - <table border="0"> - <?php - include(LINPHA_DIR.'/lib/include/metadata_iptc_edit.php'); - ?> - <tr> - <td colspan="2"> - <br /> - <input type="hidden" name="linCmd" value="linInsertMetaIptc" /> - <input type="submit" class="linButton" name="submit" value="<?php echo LIN_STR_SUBMIT; ?>" /> - </td> - </tr> - </table> - </form> - <br /> - <br /> - <p>Powered by: <a href="http://owl.phy.queensu.ca/~phil/exiftool/" >ExifTool</a></p> - <?php -} else { - echo i18n("IPTC Is Currently Disabled.").'<br /><br />'; - if($GLOBALS['linpha']->sql->isAdmin()) { - echo '<a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_iptc">'.i18n("Enable IPTC").'</a>'; - echo '<br /><br />'; - } -} ?> -</div> - -<div id="linDivMetaXmp"> -<?php if($GLOBALS['linpha']->sql->config->value['sys_image_xmp']) { ?> - <br /> - <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp(this); return false;"> - <table border="0"> - <?php - include(LINPHA_DIR.'/lib/include/metadata_xmp_edit.php'); - ?> - <tr> - <td colspan="2"> - <br /> - <input type="hidden" name="linCmd" value="linInsertMetaXmp" /> - <input type="submit" class="linButton" name="submit" value="<?php echo LIN_STR_SUBMIT; ?>" /> - </td> - </tr> - </table> - </form> - <br /> - <br /> - <p>Powered by: <a href="http://owl.phy.queensu.ca/~phil/exiftool/" >ExifTool</a></p> - <?php -} else { - echo i18n("XMP Is Currently Disabled.").'<br /><br />'; - if($GLOBALS['linpha']->sql->isAdmin()) { - echo '<a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_xmp">'.i18n("Enable XMP").'</a>'; - echo '<br /><br />'; - } -} ?> -</div> - \ No newline at end of file Modified: trunk/linpha2/templates/default/tabs/editXmp.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/editXmp.html.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/templates/default/tabs/editXmp.html.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -1,39 +1,9 @@ <?php if(!defined('LINPHA_DIR')) { exit(1); } ?> -<div id="linDivMetaIptc"> -<?php if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { ?> - <br /> - <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp(this); return false;"> - <table border="0"> - <?php - include(LINPHA_DIR.'/lib/include/metadata_iptc_edit.php'); - ?> - <tr> - <td colspan="2"> - <br /> - <input type="hidden" name="linCmd" value="linInsertMetaIptc" /> - <input type="submit" class="linButton" name="submit" value="<?php echo LIN_STR_SUBMIT; ?>" /> - </td> - </tr> - </table> - </form> - <br /> - <br /> - <p>Powered by: <a href="http://owl.phy.queensu.ca/~phil/exiftool/" >ExifTool</a></p> - <?php -} else { - echo i18n("IPTC Is Currently Disabled.").'<br /><br />'; - if($GLOBALS['linpha']->sql->isAdmin()) { - echo '<a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_iptc">'.i18n("Enable IPTC").'</a>'; - echo '<br /><br />'; - } -} ?> -</div> - <div id="linDivMetaXmp"> <?php if($GLOBALS['linpha']->sql->config->value['sys_image_xmp']) { ?> <br /> - <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp(this); return false;"> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp('xmp',this); return false;"> <table border="0"> <?php include(LINPHA_DIR.'/lib/include/metadata_xmp_edit.php'); Copied: trunk/linpha2/templates/default/tabs/iptc.html.php (from rev 4935, trunk/linpha2/templates/default/tabs/iptcXmp.html.php) =================================================================== --- trunk/linpha2/templates/default/tabs/iptc.html.php (rev 0) +++ trunk/linpha2/templates/default/tabs/iptc.html.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -0,0 +1,3 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + +IPTC Deleted: trunk/linpha2/templates/default/tabs/iptcXmp.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/iptcXmp.html.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/templates/default/tabs/iptcXmp.html.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -1,3 +0,0 @@ -<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> - -IPTC/XMP Modified: trunk/linpha2/templates/default/tabs/xmp.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/xmp.html.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/templates/default/tabs/xmp.html.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -1,3 +1,3 @@ <?php if(!defined('LINPHA_DIR')) { exit(1); } ?> -IPTC/XMP +XMP Modified: trunk/linpha2/templates/default/viewer.head.php =================================================================== --- trunk/linpha2/templates/default/viewer.head.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/templates/default/viewer.head.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -10,8 +10,8 @@ var linMaxImgHeight = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; ?>; var linPermMetaEdit = <?php echo ($GLOBALS['linpha']->sql->checkPermission('metadata_edit') ? 'true' : 'false'); ?>; var linEXIFEnabled = <?php echo ($GLOBALS['linpha']->sql->config->value['sys_image_exif'] ? 'true': 'false'); ?>; -var linITPCXMPEnabled = <?php echo ( ($GLOBALS['linpha']->sql->config->value['sys_image_iptc'] - || $GLOBALS['linpha']->sql->config->value['sys_image_xmp']) ? 'true': 'false'); ?>; +var linITPCEnabled = <?php echo ($GLOBALS['linpha']->sql->config->value['sys_image_iptc'] ? 'true': 'false'); ?>; +var linXMPEnabled = <?php echo ($GLOBALS['linpha']->sql->config->value['sys_image_xmp'] ? 'true': 'false'); ?>; var linUseEffects = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_useeffects']; ?>; var linTnSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; var linTnSizeSmall = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display_small']; ?>; @@ -49,18 +49,4 @@ linYUILoader.insert(); - -/*linYUILoader.addModule({ - name: "LinGoogleMaps", - type: "js", - fullpath: "http://maps.google.com/maps?file=api&v=2&key=<?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_google_key']; ?>", - varName: "LinGoogleMaps" -}); -linYUILoader.addModule({ - name: "LinGoogleMapsReverseGeocoder", - type: "js", - fullpath: LINPHA_CLIENT + "/lib/plugins/maps/greversegeocoder.js", - varName: "LinGoogleMapsReverseGeocoder" -});*/ - </script> \ No newline at end of file Modified: trunk/linpha2/templates/default/viewer.html.php =================================================================== --- trunk/linpha2/templates/default/viewer.html.php 2008-05-06 21:11:59 UTC (rev 4935) +++ trunk/linpha2/templates/default/viewer.html.php 2008-05-06 22:32:23 UTC (rev 4936) @@ -63,9 +63,11 @@ linTabs['imageInfo'] = { label: '<?php echo i18n("Image Info"); ?>', cacheData: true, active: false }; linTabs['gps'] = { label: '<?php echo i18n("GPS Info"); ?>', cacheData: true, active: false }; linTabs['exif'] = { label: '<?php echo i18n("EXIF"); ?>', cacheData: true, active: false }; -linTabs['iptcXmp'] = { label: '<?php echo i18n("ITPC/XMP"); ?>', cacheData: true, active: false }; +linTabs['iptc'] = { label: '<?php echo i18n("ITPC"); ?>', cacheData: true, active: false }; +linTabs['xmp'] = { label: '<?php echo i18n("XMP"); ?>', cacheData: true, active: false }; linTabs['editMeta'] = { label: '<?php echo i18n("Edit Meta Data"); ?>', cacheData: true, active: false }; -linTabs['editIptcXmp'] = { label: '<?php echo i18n("Edit ITPC/XMP"); ?>', cacheData: true, active: false }; +linTabs['editIptc'] = { label: '<?php echo i18n("Edit ITPC"); ?>', cacheData: true, active: false }; +linTabs['editXmp'] = { label: '<?php echo i18n("Edit XMP"); ?>', cacheData: true, active: false }; linTabs['videoInfo'] = { label: '<?php echo i18n("Video Info"); ?>', cacheData: true, active: false }; <?php @@ -74,6 +76,8 @@ * inside the tabview control. There is a dispatcher as a YUI Plugin (http://www.bubbling-library.com/eng/api/docs/plugins/dispatcher). * But in my opinion its to big (~26KB) for just doing that... */ +if ($GLOBALS['linpha']->sql->config->isPluginActive('maps')) +{ ?> function linLoadGPSMap() { @@ -110,4 +114,7 @@ } ?> } +<?php +} +?> </script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-05-06 21:12:06
|
Revision: 4935 http://linpha.svn.sourceforge.net/linpha/?rev=4935&view=rev Author: fangehrn Date: 2008-05-06 14:11:59 -0700 (Tue, 06 May 2008) Log Message: ----------- Added Paths: ----------- trunk/linpha2/templates/default/tabs/xmp.html.php Copied: trunk/linpha2/templates/default/tabs/xmp.html.php (from rev 4934, trunk/linpha2/templates/default/tabs/iptcXmp.html.php) =================================================================== --- trunk/linpha2/templates/default/tabs/xmp.html.php (rev 0) +++ trunk/linpha2/templates/default/tabs/xmp.html.php 2008-05-06 21:11:59 UTC (rev 4935) @@ -0,0 +1,3 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + +IPTC/XMP This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-05-06 21:11:42
|
Revision: 4934 http://linpha.svn.sourceforge.net/linpha/?rev=4934&view=rev Author: fangehrn Date: 2008-05-06 14:11:37 -0700 (Tue, 06 May 2008) Log Message: ----------- Added Paths: ----------- trunk/linpha2/templates/default/tabs/editXmp.html.php Copied: trunk/linpha2/templates/default/tabs/editXmp.html.php (from rev 4933, trunk/linpha2/templates/default/tabs/editIptcXmp.html.php) =================================================================== --- trunk/linpha2/templates/default/tabs/editXmp.html.php (rev 0) +++ trunk/linpha2/templates/default/tabs/editXmp.html.php 2008-05-06 21:11:37 UTC (rev 4934) @@ -0,0 +1,62 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + +<div id="linDivMetaIptc"> +<?php if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { ?> + <br /> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp(this); return false;"> + <table border="0"> + <?php + include(LINPHA_DIR.'/lib/include/metadata_iptc_edit.php'); + ?> + <tr> + <td colspan="2"> + <br /> + <input type="hidden" name="linCmd" value="linInsertMetaIptc" /> + <input type="submit" class="linButton" name="submit" value="<?php echo LIN_STR_SUBMIT; ?>" /> + </td> + </tr> + </table> + </form> + <br /> + <br /> + <p>Powered by: <a href="http://owl.phy.queensu.ca/~phil/exiftool/" >ExifTool</a></p> + <?php +} else { + echo i18n("IPTC Is Currently Disabled.").'<br /><br />'; + if($GLOBALS['linpha']->sql->isAdmin()) { + echo '<a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_iptc">'.i18n("Enable IPTC").'</a>'; + echo '<br /><br />'; + } +} ?> +</div> + +<div id="linDivMetaXmp"> +<?php if($GLOBALS['linpha']->sql->config->value['sys_image_xmp']) { ?> + <br /> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST" onsubmit="myLinAlbum.saveIptcXmp(this); return false;"> + <table border="0"> + <?php + include(LINPHA_DIR.'/lib/include/metadata_xmp_edit.php'); + ?> + <tr> + <td colspan="2"> + <br /> + <input type="hidden" name="linCmd" value="linInsertMetaXmp" /> + <input type="submit" class="linButton" name="submit" value="<?php echo LIN_STR_SUBMIT; ?>" /> + </td> + </tr> + </table> + </form> + <br /> + <br /> + <p>Powered by: <a href="http://owl.phy.queensu.ca/~phil/exiftool/" >ExifTool</a></p> + <?php +} else { + echo i18n("XMP Is Currently Disabled.").'<br /><br />'; + if($GLOBALS['linpha']->sql->isAdmin()) { + echo '<a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_xmp">'.i18n("Enable XMP").'</a>'; + echo '<br /><br />'; + } +} ?> +</div> + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-05-05 22:01:05
|
Revision: 4933 http://linpha.svn.sourceforge.net/linpha/?rev=4933&view=rev Author: fangehrn Date: 2008-05-05 15:00:41 -0700 (Mon, 05 May 2008) Log Message: ----------- 2008-05-05 flo * Viewer - show initial loading icon * Basket - fixed bugs Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/lib/classes/linpha.view.album.class.php trunk/linpha2/lib/classes/linpha.view.image.class.php trunk/linpha2/lib/js/LinYUIAlbum.js trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/global.head.php trunk/linpha2/templates/default/themes/default/css/viewer.css trunk/linpha2/templates/default/viewer.html.php Removed Paths: ------------- trunk/linpha2/templates/default/view_img.head.php trunk/linpha2/templates/default/view_img.html.php trunk/linpha2/templates/default/view_meta.html.php trunk/linpha2/templates/default/view_thumb.head.php trunk/linpha2/templates/default/view_thumb.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/ChangeLog 2008-05-05 22:00:41 UTC (rev 4933) @@ -1,4 +1,11 @@ +2008-05-05 flo + * Viewer + - show initial loading icon + + * Basket + - fixed bugs + 2008-04-27 flo * GPS Tab - implemented mini google map and reverse geocoding Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/docs/dev/TODO.txt 2008-05-05 22:00:41 UTC (rev 4933) @@ -7,7 +7,6 @@ - add common interface for thumb order (ORDER by..) to prevent "LinPHA New_images.PHP SQL Injection Vulnerability" etc. -- escape exif data (see Common Tasks UTF8) - optimize DB querys (index) - if GDLib is not installed, the rounded corner stuff does not work @@ -19,14 +18,14 @@ - should enable browsers cache for the thumbnails and maybe also for the images -- compress javascripts (prototype and scriptaculous) - they are now nearly 200KB big - - re-add getId3 as fallback if exiftool is not available (video thumbnail and video playback) ## Big Todos +- Thumb view + - details view (is this really needed) + - basket - Installer - OSX testing @@ -79,6 +78,11 @@ DONE ############################################################################ +- compress javascripts (prototype and scriptaculous) + they are now nearly 200KB big + +- escape exif data (see Common Tasks UTF8) + - since the admin pages uses the template system, there is no update of the status during the import thats not very user friendly -> solution: start import etc. directly from the template file, and not buffer the output with ob_start() Modified: trunk/linpha2/lib/classes/linpha.view.album.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -1,4 +1,4 @@ -<?php +<?php /* * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> * Florian Angehrn @@ -321,9 +321,9 @@ array( 'name' => i18n("Basket"), 'link' => array( - array('name' => i18n("Add All To Basket"), 'link' => 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base.'&admin_cmd=basket_add_all&linId="+linIdCurrent'), - array('name' => i18n("Add To Basket"), 'link' => 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base.'&admin_cmd=basket_add_this&linId="+linIdCurrent'), - array('name' => i18n("Switch To Basket View"), 'link' => 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base.'&view=basket&linId="+linIdCurrent'), + //array('name' => i18n("Add All To Basket"), 'link' => 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base.'&admin_cmd=basket_add_all&linId="+linIdCurrent'), + array('name' => i18n("Add To Basket"), 'link' => 'javascript:myLinAlbum.addToBasket("no_checkout")'), + //array('name' => i18n("Switch To Basket View"), 'link' => 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base.'&view=basket&linId="+linIdCurrent'), array('name' => i18n("Open Basket"), 'link' => LINPHA_LINK.'&linCat=basket') ) ); @@ -415,18 +415,15 @@ */ if( $GLOBALS['linpha']->sql->checkPermission('basket_download')) { - $GLOBALS['linpha']->template->menu['icon_download'] = 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base. - '&admin_cmd=basket_add_all_with_checkout&checkout_as=download&linId="+linIdCurrent'; + $GLOBALS['linpha']->template->menu['icon_download'] = 'javascript:myLinAlbum.basketDownload()'; } if( $GLOBALS['linpha']->sql->checkPermission('basket_print')) { - $GLOBALS['linpha']->template->menu['icon_print'] = 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base. - '&admin_cmd=basket_add_all_with_checkout&checkout_as=print&linId="+linIdCurrent'; + $GLOBALS['linpha']->template->menu['icon_print'] = 'javascript:myLinAlbum.basketPrint()'; } if( $GLOBALS['linpha']->sql->checkPermission('basket_mail')) { - $GLOBALS['linpha']->template->menu['icon_mail'] = 'javascript:location.href="'.$GLOBALS['linpha']->template->URL_base. - '&admin_cmd=basket_add_all_with_checkout&checkout_as=mail&linId="+linIdCurrent'; + $GLOBALS['linpha']->template->menu['icon_mail'] = 'javascript:myLinAlbum.basketMail()'; } /** Modified: trunk/linpha2/lib/classes/linpha.view.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -43,14 +43,22 @@ return; } - if ( !isset($_GET['linTab']) || empty($_GET['linTab']) ) - { - return; + if (!LinSql::photoIsAllowed($GLOBALS['linpha']->template->idCurrent)) { + die(LIN_STR_ACCESSDENIED); } $this->imgData = $GLOBALS['linpha']->db->GetRow("SELECT * FROM ".LIN_PREFIX."photos " . "WHERE id = '".LinSql::linAddslashes($GLOBALS['linpha']->template->idCurrent)."'"); + if(isset($_REQUEST['linCmd'])) { + $this->imageCommands(); + } + + if ( !isset($_GET['linTab']) || empty($_GET['linTab']) ) + { + return; + } + $this->indexFile(); // normally at least one tab per image is called switch($_GET['linTab']) @@ -327,19 +335,15 @@ return false; } - - - - /** * method for special admin commands, like rotating images, import stuff etc. * @uses LinImgview::buildImgView() */ -function adminCommands() +function imageCommands() { - switch($_GET['admin_cmd']) + switch($_REQUEST['linCmd']) { - case 'recreate': + case 'Recreate': if($GLOBALS['linpha']->sql->isAdmin()) { $thumbnail = new LinImage(); @@ -347,83 +351,74 @@ $thumbnail->createThumbnail($GLOBALS['linpha']->template->idCurrent); } break; - case 'force_import': // called in viewImg - LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->src_file) , $this->filename ); + case 'ForceImport': // called in viewImg + if($GLOBALS['linpha']->sql->isAdmin()) { + if (!isset($this->src_file)) { + $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); + } + LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->src_file) , $this->imgData['name'] ); + } break; - case 'rotate_left': - if($GLOBALS['linpha']->sql->isAdmin()) - { + + case 'RotateLeft': + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { LinImage::rotateImageByMenuCall('-90', $GLOBALS['linpha']->template->idCurrent); } break; - case 'rotate_right': - if($GLOBALS['linpha']->sql->isAdmin()) - { + case 'RotateRight': + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { LinImage::rotateImageByMenuCall('90', $GLOBALS['linpha']->template->idCurrent); } break; - case 'basket_add_all': - case 'basket_add_all_with_checkout': - /** - * coming from imgview, mode=viewThumb - * the permission check with photoIsAllowed() is done while checking out - */ - foreach($this->photos_filtered AS $value) - { - if($value['img_type']!=0) - { - $_SESSION['basket_ids'][] = $value['id']; - } - } - - if($_GET['admin_cmd'] == 'basket_add_all_with_checkout') - { - header("Location: ".LINPHA_LINK."&linCat=basket&checkout_as=".$_GET['checkout_as']); - exit(); - } - break; - case 'basket_add_this': - case 'basket_add_this_with_checkout': - /** - * coming from imgview, mode=viewImg - */ - $_SESSION['basket_ids'][] = $GLOBALS['linpha']->template->idCurrent; - if($_GET['admin_cmd'] == 'basket_add_this_with_checkout') - { - header("Location: ".LINPHA_LINK."&linCat=basket&checkout_as=".$_GET['checkout_as']); - exit(); - } - break; + case 'AddToBasket': + LinViewImage::addToBasket(); + break; } - - - /** - * doing some special commands - * - * should be done after viewImg(), because adminCommands() (force_import) uses some image informations - */ - if(isset($_GET['admin_cmd'])) { - $this->adminCommands(); - } +} + +static function addToBasket() +{ + foreach ($_POST['linImgIds'] as $imgId) + { + $query = $GLOBALS['linpha']->db->Execute("SELECT img_type FROM ".LIN_PREFIX."photos " . + "WHERE id = '".LinSql::linAddslashes($imgId)."'"); - if(isset($_GET['linMsg'])) + if (!$query->EOF) { - switch($_GET['linMsg']) + $data = $query->FetchRow(); + + if ($data['img_type'] != '0' && $data['img_type'] != '9999999') { - case 'basket_added': linSysLog(i18n("Images Added To Basket.")); break; + if (LinSql::photoIsAllowed($imgId)) { + $_SESSION['basket_ids'][] = $imgId; + } } } + } + + /*$fileType = $GLOBALS['linpha']->db->GetOne("SELECT img_type FROM ".LIN_PREFIX."photos " . + "WHERE id = '".LinSql::linAddslashes($GLOBALS['linpha']->template->idCurrent)."'"); + + switch ($fileType) + { + case '0': + $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".LIN_PREFIX."photos " . + "WHERE parent_id = '".LinSql::linAddslashes($GLOBALS['linpha']->template->idCurrent)."' " . + "AND img_type != '0' AND img_type != '9999999'"); + while($data = $query->FetchRow()) { + if (LinSql::photoIsAllowed($data['id'])) { + $_SESSION['basket_ids'][] = $data['id']; + } + } + break; + case '9999999': + break; + default: + $_SESSION['basket_ids'][] = $GLOBALS['linpha']->template->idCurrent; + break; + }*/ } - - - - - - - - - } // end class LinViewImage -?> +?> \ No newline at end of file Modified: trunk/linpha2/lib/js/LinYUIAlbum.js =================================================================== --- trunk/linpha2/lib/js/LinYUIAlbum.js 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/lib/js/LinYUIAlbum.js 2008-05-05 22:00:41 UTC (rev 4933) @@ -180,9 +180,10 @@ if (this.mode == 'image') { (new YAHOO.util.Element('linDivThumbs')).removeClass("linDivThumbsSmall"); // would give an warning if the class does not exist } - this.mode = 'thumb'; + this.mode = "thumb"; - YAHOO.util.Dom.setStyle('linDivThumbs', "display", "block"); + YAHOO.util.Dom.setStyle("linDivLoadingAlbum", "display", "none"); + YAHOO.util.Dom.setStyle("linDivThumbs", "display", "block"); }; // openImage() @@ -694,6 +695,68 @@ myLinAlbum.panelViewAt.render( /*document.body*/ "linPanelContainer" ); }; +// basketDownload() +YAHOO.linpha.Album.prototype.basketDownload = function() { + this.addToBasket('download'); +} +// basketMail() +YAHOO.linpha.Album.prototype.basketMail = function() { + this.addToBasket('mail'); +} +// basketPrint() +YAHOO.linpha.Album.prototype.basketPrint = function() { + this.addToBasket('print'); +} +// addToBasket() +YAHOO.linpha.Album.prototype.addToBasket = function(checkout) { + YAHOO.util.Dom.setStyle("linDivLoadingAlbum", "display", "block"); + + if (this.mode == "image") { + postdata = "linImgIds[]="+linIdCurrent; + } else if (this.mode == "thumb") { + postdata = ""; + for(imgId in this.ThumbIds) { + postdata += "linImgIds[]="+imgId+"&"; + } + } else { + return; + } + + switch (checkout) + { + case "no_checkout": + myLinGlobal.asyncRequest('POST', LINPHA_LINK+'&linCat=image&linCmd=AddToBasket&linId='+linIdCurrent, this.addToBasketFinish, this, postdata); + break; + case "download": + myLinGlobal.asyncRequest('POST', LINPHA_LINK+'&linCat=image&linCmd=AddToBasket&linId='+linIdCurrent, this.basketDownloadFinish, this, postdata); + break; + case "mail": + myLinGlobal.asyncRequest('POST', LINPHA_LINK+'&linCat=image&linCmd=AddToBasket&linId='+linIdCurrent, this.basketMailFinish, this, postdata); + break; + case "print": + myLinGlobal.asyncRequest('POST', LINPHA_LINK+'&linCat=image&linCmd=AddToBasket&linId='+linIdCurrent, this.basketPrintFinish, this, postdata); + break; + } +} +// addToBasketFinish() +YAHOO.linpha.Album.prototype.addToBasketFinish = function(t) { + YAHOO.util.Dom.setStyle("linDivLoadingAlbum", "display", "none"); +} +// basketDownloadFinish() +YAHOO.linpha.Album.prototype.basketDownloadFinish = function(t) { + YAHOO.util.Dom.setStyle("linDivLoadingAlbum", "display", "none"); + location.href = LINPHA_LINK+"&linCat=basket&checkout_as=download"; +} +// basketMailFinish() +YAHOO.linpha.Album.prototype.basketMailFinish = function(t) { + YAHOO.util.Dom.setStyle("linDivLoadingAlbum", "display", "none"); + location.href = LINPHA_LINK+"&linCat=basket&checkout_as=mail"; +} +// basketPrintFinish() +YAHOO.linpha.Album.prototype.basketPrintFinish = function(t) { + YAHOO.util.Dom.setStyle("linDivLoadingAlbum", "display", "none"); + location.href = LINPHA_LINK+"&linCat=basket&checkout_as=print"; +} myLinPage.enableOnResize('thumb'); Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/lib/modules/module.basket.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -54,7 +54,6 @@ /** * do the final checkout */ - try { /** @@ -62,7 +61,7 @@ */ if(! $GLOBALS['linpha']->sql->checkPermission('basket_'.$_REQUEST['checkout_as'])) { - throw new Exception(i18n("No Access")); + throw new Exception(LIN_STR_ACCESSDENIED); } /** @@ -80,7 +79,7 @@ { if(! $GLOBALS['linpha']->sql->photoIsAllowed($value)) { - throw new Exception(i18n("No Access")); + throw new Exception(LIN_STR_ACCESSDENIED); } } @@ -110,12 +109,12 @@ break; - case 'add_selected': - /** + /*case 'add_selected': + * add ids to session * coming from imgview, mode=viewBasket * the permission check with photoIsAllowed() is done while checking out - */ + if( isset( $_POST['img_id'] ) ) { @@ -126,7 +125,7 @@ } Header("Location: ".linConvertAmp($_SESSION['ref_url_full'])."&linMsg=basket_added"); - exit(); + exit();*/ case 'remove_all': /** Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/basket.html.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -83,19 +83,19 @@ <table> <tr> <td width="170"><?php echo i18n("Recipient"); ?>:</td> - <td><input type="text" name="mail_address" value="<?php echo $mail_address; ?>" style="width: 175px;" /></td> + <td><input type="text" name="mail_address" value="<?php echo $mail_address; ?>" style="width: 235px;" /></td> </tr> <tr> <td><?php echo i18n("Sender"); ?>:</td> - <td><input type="text" name="sender_address" value="<?php echo $sender_address; ?>" style="width: 175px;" /></td> + <td><input type="text" name="sender_address" value="<?php echo $sender_address; ?>" style="width: 235px;" /></td> </tr> <tr> <td><?php echo i18n("Subject"); ?>:</td> - <td><input type="text" name="subject" value="<?php echo $subject; ?>" style="width: 175px;" /></td> + <td><input type="text" name="subject" value="<?php echo $subject; ?>" style="width: 235px;" /></td> </tr> <tr> <td><?php echo i18n("Message"); ?>:</td> - <td><textarea name="text_message" style="width: 175px;" rows="5" cols="40"><?php echo $text_message; ?></textarea></td> + <td><textarea name="text_message" style="width: 235px;" rows="5" cols="40"><?php echo $text_message; ?></textarea></td> </tr> <tr> <td><?php echo i18n("Mail Format"); ?>:</td> Modified: trunk/linpha2/templates/default/global.head.php =================================================================== --- trunk/linpha2/templates/default/global.head.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/global.head.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -72,8 +72,8 @@ <?php if (linUseAjax()) { ?> <!-- Load the YUI Loader script: --> -<!--<script src="http://yui.yahooapis.com/2.5.0/build/yuiloader/yuiloader-beta-min.js"></script> --> -<script src="http://yui.yahooapis.com/2.5.1/build/yuiloader/yuiloader-beta-debug.js"></script> +<script src="http://yui.yahooapis.com/2.5.0/build/yuiloader/yuiloader-beta-min.js"></script> +<!--<script src="http://yui.yahooapis.com/2.5.1/build/yuiloader/yuiloader-beta-debug.js"></script>--> <script type="text/javascript" language="Javascript"> var linYUILoader = new YAHOO.util.YUILoader({ require: ["logger"], // , "menu" Modified: trunk/linpha2/templates/default/themes/default/css/viewer.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/viewer.css 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/themes/default/css/viewer.css 2008-05-05 22:00:41 UTC (rev 4933) @@ -32,6 +32,10 @@ text-align: left; } +#linDivLoadingAlbum { + padding-left: 45%; + padding-top: 30px; +} #linDivLoading { /*position: absolute; left: 50%; Deleted: trunk/linpha2/templates/default/view_img.head.php =================================================================== --- trunk/linpha2/templates/default/view_img.head.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/view_img.head.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -1,39 +0,0 @@ - -<script language="JavaScript" type="text/javascript"> -var imageSrc = '<?php echo LINPHA_CLIENT.'/get_image.php?linId='; ?>'; -var thumbSrc = '<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='; ?>'; -var maxImageWidth = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; ?>; -var maxImageHeight = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; ?>; -var startImgHeight = <?php echo $GLOBALS['linpha']->imgview->img_height; ?>; -var firstImgId = <?php echo $GLOBALS['linpha']->imgview->photos_filtered[0]['id']; /* @todo needs updating on change of sort order */ ?>; -var lastImgId = <?php echo $GLOBALS['linpha']->imgview->photos_filtered[ count($GLOBALS['linpha']->imgview->photos_filtered)-1 ]['id']; /* @todo needs updating on change of sort order */ ?>; -var useEffects = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_useeffects']; ?>; -var linSlideshowHtml = '<?php -/** - * @todo is it somehow possible to cache the slideshow divs? - * for example in external .js file? (that would have to be generated from a php file...) - */ -$fragment = 'slideshow'; ob_start(); -include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); -$string = ob_get_clean(); $string = str_replace("\n","",$string); $string = str_replace("\r","",$string); $string = str_replace("\t","",$string); -echo $string; -?>'; -</script> - -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/scriptaculous.js?load=effects,builder"></script> -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/LinImage.js"> </script> - - -<!-- YUI Dependencies --> -<!-- Sam Skin CSS for TabView --> -<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.0/build/tabview/assets/skins/sam/tabview.css"> - -<!-- JavaScript Dependencies for Tabview: --> -<script type="text/javascript" src="http://yui.yahooapis.com/2.5.0/build/yahoo-dom-event/yahoo-dom-event.js"></script> -<script type="text/javascript" src="http://yui.yahooapis.com/2.5.0/build/element/element-beta-min.js"></script> - -<!-- OPTIONAL: Connection (required for dynamic loading of data) --> -<script type="text/javascript" src="http://yui.yahooapis.com/2.5.0/build/connection/connection-min.js"></script> - -<!-- Source file for TabView --> -<script type="text/javascript" src="http://yui.yahooapis.com/2.5.0/build/tabview/tabview-min.js"></script> Deleted: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/view_img.html.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -1,193 +0,0 @@ - -<!-- navigation --> -<?php if(isset($linTpl->output['navigation']) && !empty($linTpl->output['navigation'])) { ?> - <?php echo $linTpl->divRoundCorners('top','main'); ?> - - <div id="linDivNavigation"> - <?php echo $linTpl->output['navigation']; ?> - </div> - - <?php echo $linTpl->divRoundCorners('bottom','main'); ?> -<?php } ?> - -<!-- thumbnails --> -<?php echo $linTpl->divRoundCorners('top','main'); ?> - - <div id="linDivThumbnavi"> - <div id="linDivThumbnavi_Prev"></div> - <div id="linDivThumbnavi_Current"></div> - <div id="linDivThumbnavi_Next"></div> - </div> - -<?php echo $linTpl->divRoundCorners('bottom','main'); ?> - -<!-- main --> -<?php echo $linTpl->divRoundCorners('top','main'); ?> - <div id="linDivMain" class="yui-skin-sam"> - <div id="linDivloading"> - <img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/loading.gif"> - </div> - - <noscript><h1 class="linStyle"><?php echo i18n("If you have just disabled Javascript, you will need to restart your browser."); ?></h1></noscript> - - <!-- show image --> - <div id="linDivMainimage"> - <img id="linImgMainimage" style="display: none;"> - </div> - - <div id="linDivInfoLink" style="display: none; color: grey;"> - <a id="linHrefPanoLink" href="<?php echo LINPHA_LINK.'linCat=panorama&linId='.$linTpl->idCurrent; ?>" onclick="javascript:myLinImage.updateLinId(this)" target="_blank" style="color: black;"><?php echo i18n("Panorama"); ?></a> - <div id="linDivVideoLink"> - <a href="<?php echo LINPHA_LINK.'linCat=video&linId='.$linTpl->idCurrent; ?>" onclick="javascript:myLinImage.updateLinId(this)" target="_blank"><?php echo i18n("Play Video"); ?></a> - <a href="<?php echo LINPHA_LINK.'linCat=download&linId='.$linTpl->idCurrent; ?>&isDownload=true" onclick="javascript:myLinImage.updateLinId(this)"><?php echo i18n("Download Video"); ?></a> - </div> - <?php /*<a id="linHrefInfoLink" href="javascript:myLinImage.showImgInfo()" style="color: black;">Info</a>*/ ?> - </div> - - - <br /><br /> - - <div id="linDivTabs" class="yui-navset"> - <ul class="yui-nav"> - <li class="selected"><a href=""><em><?php echo i18n("Comments"); ?></em></a></li> - </ul> - <div class="yui-content" style="height: 200px; overflow: auto;"> - <div><p> - <!-- comments --> - <?php if($GLOBALS['linpha']->sql->checkPermission('metadata_comments')) { ?> - <!-- show add comment form --> - <div id="linDivAddComment"> - <form action="" method="POST" onsubmit="myLinGlobal.AjaxPost(linUrlBase + '&linId=' + IdCurrent + '&xml', Form.serialize(this),myLinImage.saveComment); return false;"> - <?php echo i18n("Add Comment"); ?>:<br /> - <div id="linDivAddCommentText"> - <input type="text" id="linInputAddCommentText" class="linForms" name="inputAddCommentText" value="" tabindex="1" style="width: 300px" /> - <a href="javascript:myLinImage.openTextarea()">(+)</a> - </div> - <div id="linDivAddCommentTextarea" style="display: none;"> - <textarea id="linInputAddCommentTextarea" class="linForms" name="inputAddCommentTextarea" tabindex="1" rows="10" style="width: 300px"></textarea> - </div> - - <?php echo i18n("Name"); ?>: <input type="text" class="linForms" name="inputAddCommentAuthor" value="" tabindex="2" size="10" style="width: 100px" maxlength="255" /> - - <input type="hidden" name="cmd" value="add_comment" /> - <input type="submit" name="submit" class="linButton" value="<?php echo i18n("Submit"); ?>" tabindex="2" /> - </form> - </div> - - <br /> - <?php } /* end if checkPermission('metadata_comments') */ ?> - - <!-- show image comments --> - <div id="linDivComments"></div> - </p></div> - - - </div> - </div> - - - <script type="text/javascript"> - var myTabs = new YAHOO.widget.TabView("linDivTabs"); - - myTabs.addTab( new YAHOO.widget.Tab({ - label: '<?php echo i18n("Image Info"); ?>', - content: '<div id="linDivMeta"></div>' - })); - myTabs.addTab( new YAHOO.widget.Tab({ - label: '<?php echo i18n("GPS Info"); ?>', - content: 'GPS' - })); - myTabs.addTab( new YAHOO.widget.Tab({ - label: '<?php echo i18n("EXIF"); ?>', - content: 'EXIF' - })); - myTabs.addTab( new YAHOO.widget.Tab({ - label: '<?php echo i18n("ITPC/XMP"); ?>', - content: 'ITPC/XMP' - })); - - - myTabs.addTab( new YAHOO.widget.Tab({ - label: '<?php echo i18n("Edit Meta Data"); ?>', - content: 'edit' - })); - myTabs.addTab( new YAHOO.widget.Tab({ - label: '<?php echo i18n("Edit ITPC/XMP"); ?>', - content: 'edit' - })); - - - myTabs.addTab( new YAHOO.widget.Tab({ - label: '<?php echo i18n("Video Info"); ?>', - content: '<div id="linDivMeta"></div>' - })); - - /* - <li><a href=""><em><?php echo i18n("Rating"); ?></em></a></li> - <li><a href=""><em><?php echo i18n("Fileinfo"); ?></em></a></li> - <li><a href=""><em><?php echo i18n("GPS Info"); ?></em></a></li> - <li><a href=""><em><?php echo i18n("EXIF"); ?></em></a></li> - <li><a href=""><em><?php echo i18n("IPTC/XMP"); ?></em></a></li> - - <div><p><?php echo i18n("Rating"); ?></p></div> - - <div><p> - <?php echo i18n("Fileinfo"); ?> - <div id="linDivMeta"></div> - - - </p></div> - - <div><p><?php echo i18n("GPS Info"); ?></p></div> - - <div><p> - <?php echo i18n("EXIF"); ?> - <div id="linDivExifLink" class="linDivMetaLinks"><a href="<?php echo LINPHA_LINK.'linCat=metadata&linId='.$linTpl->idCurrent; ?>" onclick="javascript:myLinImage.updateLinId(this)" target="_blank"><?php echo i18n("Show All Metadata"); ?></a></div> - </p></div> - - <div><p><?php echo i18n("IPTC/XMP"); ?></p></div> - - */ - /*alert( myTabs ); - alert( myTabs.get(0) ); - alert( myTabs.get(0).set('content','hiho') );*/ - //var tab0 = myTabs.get(0); - //alert(tab0); - //tabView.removeTab(tabView.get('activeTab')); - </script> - - - <div id="container"></div> - - <script type="text/javascript"> - /*var tabView = new YAHOO.widget.TabView(); - - tabView.addTab( new YAHOO.widget.Tab({ - label: 'lorem', - content: '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat.</p>', - active: true - })); - - tabView.addTab( new YAHOO.widget.Tab({ - label: 'ipsum', - content: '<ul><li><a href="#">Lorem ipsum dolor sit amet.</a></li><li><a href="#">Lorem ipsum dolor sit amet.</a></li><li><a href="#">Lorem ipsum dolor sit amet.</a></li><li><a href="#">Lorem ipsum dolor sit amet.</a></li></ul>' - - })); - - tabView.addTab( new YAHOO.widget.Tab({ - label: 'dolor', - content: '<form action="#"><fieldset><legend>Lorem Ipsum</legend><label for="foo"> <input id="foo" name="foo"></label><input type="submit" value="submit"></fieldset></form>' - })); - - tabView.appendTo('container');*/ - - //tabView.removeTab(tabView.get('activeTab')); - //tabView.getTab(0).set('content','hiho'); - //tabView.getTab(0).set('disabled',true); - //tabView.getTab(0).set('contentVisible',false); - - </script> - - </div> - -<?php echo $linTpl->divRoundCorners('bottom','main'); ?> \ No newline at end of file Deleted: trunk/linpha2/templates/default/view_meta.html.php =================================================================== Deleted: trunk/linpha2/templates/default/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.head.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/view_thumb.head.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -1,13 +0,0 @@ -<script language="JavaScript" type="text/javascript"> -var linTotPhotos = <?php echo $GLOBALS['linpha']->imgview->tot_photos; ?>; -var linStartupPage = 1; -var linTnSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; -var linPhotosPerPage = 'auto'; -var linViewMode = '<?php echo $_SESSION['mode_thumbview']; ?>'; -var linNrTextLines = <?php echo $GLOBALS['linpha']->imgview->nr_text_lines; ?>; -<?php echo $linTpl->output['files_db']."\n"; ?> -</script> - -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/scriptaculous.js?load=builder"></script> -<script type="text/javascript" language="javascript" src="<?php echo $linTpl->themeFile('DefsThumbView.js'); ?>"></script> -<script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/LinThumbnails.js"></script> Deleted: trunk/linpha2/templates/default/view_thumb.html.php =================================================================== --- trunk/linpha2/templates/default/view_thumb.html.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/view_thumb.html.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -1,29 +0,0 @@ - -<!-- navigation --> -<?php if(isset($linTpl->output['navigation']) && !empty($linTpl->output['navigation'])) { ?> - <?php echo $linTpl->divRoundCorners('top','main'); ?> - - <div id="linDivNavigation"> - <?php echo $linTpl->output['navigation']; ?> - </div> - - <?php echo $linTpl->divRoundCorners('bottom','main'); ?> -<?php } ?> - -<!-- main --> -<?php echo $linTpl->divRoundCorners('top','main'); ?> - - <div id="linDivPagenrOuter"> - <div id="linDivPagenr"> - <div id="linDivPagenrLeft" class="linDivPagenrAll"><?php echo $linTpl->output['page_nr_left']; ?></div> - <div id="linDivPagenrMiddle" class="linDivPagenrAll linDivPagenrMiddle"><?php echo $linTpl->output['page_nr']; ?></div> - <div id="linDivPagenrRight" class="linDivPagenrAll"><?php echo $linTpl->output['page_nr_right']; ?></div> - </div> - </div> - - <div id="linDivMain"> - <noscript><h1 class="linStyle"><?php echo i18n("If you have just disabled Javascript, you will have to restart your browser."); ?></h1></noscript> - </div> - <div style="clear: both;"></div> - -<?php echo $linTpl->divRoundCorners('bottom','main'); ?> Modified: trunk/linpha2/templates/default/viewer.html.php =================================================================== --- trunk/linpha2/templates/default/viewer.html.php 2008-04-27 21:51:22 UTC (rev 4932) +++ trunk/linpha2/templates/default/viewer.html.php 2008-05-05 22:00:41 UTC (rev 4933) @@ -19,6 +19,7 @@ <div id="linDivNav" style="display: none;">nav</div> <div><?php /* Internet Explorer requires this extra div */ ?> + <div id="linDivLoadingAlbum"><img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/loading.gif"></div> <div id="linDivImage" style="display: none;"> <div id="linDivMainImage" ondblclick="myLinNavigation.fullscreenStart()"> @@ -34,7 +35,7 @@ <div id="linDivOtherInfo" style="display: none;"> </div> </div> - <div id="linDivThumbs" style="display: none;">thumb</div> + <div id="linDivThumbs" style="display: none;"></div> </div> <div style="clear: both"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-27 21:51:26
|
Revision: 4932 http://linpha.svn.sourceforge.net/linpha/?rev=4932&view=rev Author: fangehrn Date: 2008-04-27 14:51:22 -0700 (Sun, 27 Apr 2008) Log Message: ----------- escape exif data Modified Paths: -------------- trunk/linpha2/templates/default/tabs/exif.html.php Modified: trunk/linpha2/templates/default/tabs/exif.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/exif.html.php 2008-04-27 12:37:17 UTC (rev 4931) +++ trunk/linpha2/templates/default/tabs/exif.html.php 2008-04-27 21:51:22 UTC (rev 4932) @@ -12,7 +12,7 @@ <?php echo LinMetaData::$metaTags['exif'][$key]; ?> </td> <td> - <?php echo $value; ?> + <?php echo htmlentities($value, ENT_QUOTES); ?> </td> </tr> <?php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-27 12:37:18
|
Revision: 4931 http://linpha.svn.sourceforge.net/linpha/?rev=4931&view=rev Author: fangehrn Date: 2008-04-27 05:37:17 -0700 (Sun, 27 Apr 2008) Log Message: ----------- 2008-04-27 flo * GPS Tab - implemented mini google map and reverse geocoding * More bug fixes - Album/Image view and Map plugin seems to be ok now (tested in FF, IE, Opera) Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/maintenance_import.php trunk/linpha2/docs/dev/external_libraries.txt trunk/linpha2/lib/classes/linpha.view.album.class.php trunk/linpha2/lib/classes/linpha.view.image.class.php trunk/linpha2/lib/js/LinYUIAlbum.js trunk/linpha2/lib/js/LinYUIPage.js trunk/linpha2/lib/plugins/maps/LinMapsYUI.js trunk/linpha2/lib/plugins/maps/module.maps.php trunk/linpha2/templates/default/maps.head.php trunk/linpha2/templates/default/maps.html.php trunk/linpha2/templates/default/tabs/gps.html.php trunk/linpha2/templates/default/viewer.head.php trunk/linpha2/templates/default/viewer.html.php Added Paths: ----------- trunk/linpha2/lib/plugins/maps/LinMaps_old.js trunk/linpha2/lib/plugins/maps/class.googlemaps_old.js trunk/linpha2/lib/plugins/maps/class.maps.php trunk/linpha2/lib/plugins/maps/greversegeocoder.js Removed Paths: ------------- trunk/linpha2/lib/plugins/maps/LinMaps.js trunk/linpha2/lib/plugins/maps/class.googlemaps.js Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/ChangeLog 2008-04-27 12:37:17 UTC (rev 4931) @@ -1,4 +1,11 @@ +2008-04-27 flo + * GPS Tab + - implemented mini google map and reverse geocoding + + * More bug fixes + - Album/Image view and Map plugin seems to be ok now (tested in FF, IE, Opera) + 2008-04-26 flo * Search bug fixes * Menu bug fixes Modified: trunk/linpha2/admin/maintenance_import.php =================================================================== --- trunk/linpha2/admin/maintenance_import.php 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/admin/maintenance_import.php 2008-04-27 12:37:17 UTC (rev 4931) @@ -197,13 +197,44 @@ } - /** - * exif, iptc, xmp - * - * if "Delete First" and "All albums" was selected, the whole table will be deleted - */ + /** + * get imgids to indexing, if reindex is selected: delete these entries first + */ + if ($all_albums) + { + echo i18n("All Directories selected").'<br />'; + + $query = $GLOBALS['linpha']->db->Execute("SELECT id, md5sum FROM ".LIN_PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999"); + while ($data = $query->FetchRow()) + { + $array_meta_ids[$data['id']] = $data['md5sum']; + } + } + else + { + echo i18n("Directory selected:").' '; + foreach ($_REQUEST['album_select'] AS $key=>$value) + { + $data = $GLOBALS['linpha']->db->GetRow("SELECT name FROM ".LIN_PREFIX."photos WHERE id = '".LinSql::linAddslashes($value)."'"); + echo $data['name'].', '; + + $query = $GLOBALS['linpha']->db->Execute("SELECT id, md5sum FROM ".LIN_PREFIX."photos WHERE " . + "parent_id = '".LinSql::linAddslashes($value)."' AND " . + "img_type <> 0 AND img_type <> 9999999"); + while ($data = $query->FetchRow()) + { + $array_meta_ids[$data['id']] = $data['md5sum']; + } + } + echo '<br />'; + } + + /** + * exif, iptc, xmp + * + * if "Delete First" and "All albums" was selected, the whole table will be deleted + */ $MetaData = new LinMetaData(); - foreach($array_meta as $meta_value) { if ( isset($_REQUEST['index_'.$meta_value]) && @@ -212,38 +243,6 @@ echo '<h2 class="linStyle">'.i18n("File Indexing").' ('.strtoupper($meta_value).')</h2>'; /** - * get imgids to indexing, if reindex is selected: delete these entries first - */ - if ($all_albums) - { - echo i18n("All Directories selected").'<br />'; - - $query = $GLOBALS['linpha']->db->Execute("SELECT id, md5sum FROM ".LIN_PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999"); - while ($data = $query->FetchRow()) - { - $array_meta_ids[$data['id']] = $data['md5sum']; - } - } - else - { - echo i18n("Directory selected:").' '; - foreach ($_REQUEST['album_select'] AS $key=>$value) - { - $data = $GLOBALS['linpha']->db->GetRow("SELECT name FROM ".LIN_PREFIX."photos WHERE id = '".LinSql::linAddslashes($value)."'"); - echo $data['name'].', '; - - $query = $GLOBALS['linpha']->db->Execute("SELECT id, md5sum FROM ".LIN_PREFIX."photos WHERE " . - "parent_id = '".LinSql::linAddslashes($value)."' AND " . - "img_type <> 0 AND img_type <> 9999999"); - while ($data = $query->FetchRow()) - { - $array_meta_ids[$data['id']] = $data['md5sum']; - } - } - echo '<br />'; - } - - /** * delete first (if selected) */ if ( isset($_REQUEST['index_'.$meta_value.'_delete']) ) @@ -287,8 +286,43 @@ echo '<br /><br />'; } - unset($array_meta_ids); + //unset($array_meta_ids); } + + if ($GLOBALS['linpha']->sql->config->isPluginActive('maps') + && $GLOBALS['linpha']->sql->config->value['plugins_maps_enable_geotagged'] + && $GLOBALS['linpha']->sql->config->value['plugins_maps_geotagged_autoimport'] + && isset($array_meta_ids) + && $_REQUEST['index_exif'] == 'index') + { + echo '<h2 class="linStyle">'.i18n("Import Geo Data").'</h2>'; + + $table = LIN_PREFIX."plugins_maps_image_geodata"; + + foreach ($array_meta_ids as $id=>$md5sum) + { + if (LinMetaData::fileNeedsIndexing($md5sum, $table)) + { + $full_filename = LinSql::getFullImagePath($id); + + if ($MetaData->saveMetaDataToDatabase('exifgps', $table, $full_filename, $md5sum )) + { + $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."photos " . + "SET geodata='1' WHERE md5sum='".$md5sum."' "); + + echo " ".$id." (GPS),"; + } + else + { + echo " ".$id.","; + } + + flush(); + } + } + + echo '<br /><br />'; + } } Modified: trunk/linpha2/docs/dev/external_libraries.txt =================================================================== --- trunk/linpha2/docs/dev/external_libraries.txt 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/docs/dev/external_libraries.txt 2008-04-27 12:37:17 UTC (rev 4931) @@ -1,16 +1,24 @@ -- csshover.htc V1.42.060206 +Javascript: -- scriptaculous 1.8.0 (contains prototype) -- prototype 1.6.0 +//- csshover.htc V1.42.060206 +//- scriptaculous 1.8.0 (contains prototype) +//- prototype 1.6.0 - JSCookMenu CHANGES ------- fixed bug in cmEnableItem() reported here: http://sourceforge.net/tracker/index.php?func=detail&aid=1766028&group_id=149372&atid=778279 - +- Google Reverse Geocoder (greversegeocoder.js) v1.0.6 + http://nicogoeminne.googlepages.com/documentation.html + +- YUI 2.5.1 + + +PHP: + - adodb - getid3 1.7.7 Modified: trunk/linpha2/lib/classes/linpha.view.album.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-04-27 12:37:17 UTC (rev 4931) @@ -500,8 +500,15 @@ } if (isset($arrOpt)) { $opt = '{'; + $i = 0; foreach( $arrOpt as $key=>$value) { - $opt .= '"'.$key.'": '.$value.', '; + $opt .= '"'.$key.'": '.$value; + + if ($i != count($arrOpt)-1) { + $opt .= ', '; + } + + $i++; } $opt .= '}'; } else { Modified: trunk/linpha2/lib/classes/linpha.view.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-04-27 12:37:17 UTC (rev 4931) @@ -76,8 +76,10 @@ break; case 'gps': - $this->getImageData('gps'); - require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/gps.html.php'); + if ($GLOBALS['linpha']->sql->config->isPluginActive('maps')) { + $this->getImageData('gps'); + require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/gps.html.php'); + } break; case 'exif': $this->getImageData('exif'); @@ -281,6 +283,15 @@ } break; + case 'gps': + require_once(LINPHA_DIR.'/lib/plugins/maps/class.maps.php'); + + $data = $GLOBALS['linpha']->db->GetRow("SELECT gpslatituderef, gpslatitude, gpslongituderef, gpslongitude " . + "FROM ".LIN_PREFIX."plugins_maps_image_geodata " . + "WHERE md5sum = '".LinSql::linAddslashes($this->imgData['md5sum'])."'"); + $this->latlon = LinMaps::getExifLatLon($data); + + break; } } Modified: trunk/linpha2/lib/js/LinYUIAlbum.js =================================================================== --- trunk/linpha2/lib/js/LinYUIAlbum.js 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/lib/js/LinYUIAlbum.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -450,6 +450,7 @@ //this.indexCommentTab = idx; // used by saveComment() this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['comments']); + loadGPSimmediate = false; switch( this.currentFileType ) { @@ -457,7 +458,13 @@ this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['imageInfo']); if (this.album.Thumbs[imgIndex].opt != null && this.album.Thumbs[imgIndex].opt.gps) { - this.Tabs[idx++] = new YAHOO.widget.Tab(tabConf['gps']); + this.Tabs[idx] = new YAHOO.widget.Tab(tabConf['gps']); + this.Tabs[idx].addListener('contentChange', linLoadGPSMap); // click + + //if (tabConf['gps'].active) + // loadGPSimmediate = true; + + idx++; } if (linEXIFEnabled) { @@ -494,6 +501,15 @@ this.TabView.addTab( this.Tabs[tabIndex] ); } + // check if there's again an active tab, and if not make the first tab active + if (typeof(this.TabView.get('activeTab')) == "undefined") + { + this.TabView.set('activeIndex', 0); + } + + if (loadGPSimmediate) + linLoadGPSMap(); + for(i = 1; i <= linPreloadImages; i++) { if ( this.album.Thumbs[imgIndex+i] ) @@ -685,3 +701,46 @@ var myLinAlbum = new YAHOO.linpha.Album(); myLinAlbum.loadAlbum('local'); + +/** + * show google map + * see not in viewer.html.php why this functions cannot be directly in the gps tab + */ +function linShowGoogleMap() +{ + //linYUILoader.onSuccess = null; + + if (GBrowserIsCompatible()) { + var map = new GMap2(document.getElementById("linDivMapObject")); + var point = new GLatLng(parseFloat($("linSpanLatitude").innerHTML), parseFloat($("linSpanLongitude").innerHTML)); + + map.setCenter(point, 10); + map.addControl(new GSmallMapControl()); + + map.addOverlay( new GMarker(point, {}) ); + + var reversegeocoder = new GReverseGeocoder(map); + + GEvent.addListener(reversegeocoder, "load", linSetGeocodeLocation); + /*function(placemark) { + $("linSpanNearestLocation").innerHTML = placemark.address; + } + );*/ + + GEvent.addListener(reversegeocoder, "error", + function() { + $("linSpanNearestLocation").innerHTML = "Unable to Reverse geocode"; + } + ); + + + reversegeocoder.reverseGeocode(point); + + YAHOO.util.Event.addListener(window, "unload", GUnload); + } +} +function linSetGeocodeLocation(placemark) +{ + // not an anonymous function to be able to debug it... + $("linSpanNearestLocation").innerHTML = placemark.address; +} Modified: trunk/linpha2/lib/js/LinYUIPage.js =================================================================== --- trunk/linpha2/lib/js/LinYUIPage.js 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/lib/js/LinYUIPage.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -23,7 +23,7 @@ // onResize() YAHOO.linpha.Page.prototype.onResize = function() { - if (typeof(linOnResizeWrapper) != null) + if (typeof(linOnResizeWrapper) != "undefined") linOnResizeWrapper(); else myLinPage.setMainHeight(true); Deleted: trunk/linpha2/lib/plugins/maps/LinMaps.js =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMaps.js 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/lib/plugins/maps/LinMaps.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -1,355 +0,0 @@ - -/** - * class and global definitions - */ -var LinMaps = Class.create(); -var myLinMaps; - -LinMaps.prototype = -{ - /** - * initialize() - * Constructor runs on completion of the DOM loading. - */ - initialize: function() - { - this.editMarker = false; - this.showNav = true; - this.defaultMarkerZoom = linMapsDefaultMarkerZoom; - - this.markersData = false; - this.markersObj = new Array(); - this.imagesObj = new Array(); - - this.ajaxUrl = linUrlBase + '&linId=' + linIdCurrent + '&xml'; - }, - - /** - * Marker functions - */ - loadMarkers: function() - { - myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=loadMarkers',myLinMaps.showMarkers); - }, - showMarkers: function(t) - { - var i; - - myLinMaps.markersData = eval('(' + t.responseText + ')'); - //myLinMaps.markers = t.responseText.evalJSON(true); - - /** - * delete existing markers - */ - if( myLinMaps.markersObj ) - { - for( i = 0; i < myLinMaps.markersObj.length; i++ ) - { - myLinMapObject.removeMarker( myLinMaps.markersObj[i] ); - } - - myLinMaps.markersObj = new Array(); - } - - /** - * draw new markers - */ - myLinMapObject.initBounds(); - - for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) - { - myLinMaps.markersObj[i] = myLinMapObject.createMarker( myLinMaps.markersData.markers[i], false ); - } - - /** - * update center - * only if there is more than one marker - * prevent zooming to high - */ - if( i > 0) { - if( i == 1 ) { - myLinMapObject.updateCenter( myLinMaps.markersData.markers[0].zoom ); - } else { - myLinMapObject.updateCenter( 0 ); - } - } - }, - - updateEditMarker: function() - { - if( myLinMaps.editMarker ) // marker activated. use myLinMaps. instead of "this." when fired from GEvent class - { - latlng = myLinMaps.editMarker.getPoint(); - $('linFormEditMarker').linInputLat.value = latlng.lat(); - $('linFormEditMarker').linInputLon.value = latlng.lng(); - $('linFormEditMarker').linInputZoom.value = googlemap.getZoom(); - } - }, - - saveMarker: function(t) - { - xmlAnswer = t.responseXML.documentElement; - - if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) - { - myLinMaps.removeEditMarker(); - - myLinMaps.loadMarkers(); - } - else - { - alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); - } - }, - - deleteMarker: function(markerId) - { - myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=deleteMarker&markerId='+markerId,myLinMaps.deleteMarkerFinish); - }, - deleteMarkerFinish: function(t) - { - xmlAnswer = t.responseXML.documentElement; - - if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) - { - var markerId = xmlAnswer.getElementsByTagName('responseData').item(0).firstChild.data; - - for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) - { - if( myLinMaps.markersData.markers[i].id == markerId ) - { - myLinMapObject.removeMarker( myLinMaps.markersObj[i] ); - myLinMaps.markersObj[i] = false; - } - } - } - else - { - alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); - } - }, - - removeEditMarker: function() - { - myLinMapObject.removeMarker( this.editMarker ); - this.editMarker = false; - }, - - assignAlbum: function(markerId,albId) - { - myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbum&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); - }, - assignAlbumChange: function(markerId,albId) { - myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbumChange&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); - }, - assignAlbumDelete: function(markerId,albId) - { - myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbumDelete&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); - }, - assignAlbumFinish: function(t) - { - xmlAnswer = t.responseXML.documentElement; - - // recreate marker on success - if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) - { - myLinMaps.loadMarkers(); - } - else - { - // print error message - alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); - } - }, - - loadAlbums: function() - { - myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=loadAlbums',myLinMaps.showAlbums); - }, - showAlbums: function(t) - { - $('linDivMapAlbums').innerHTML = ''; - albumsData = eval('(' + t.responseText + ')'); - - for( i = 0; i < albumsData.albums.length; i++ ) - { - $('linDivMapAlbums').innerHTML += - '<a href="javascript:myLinMaps.loadImages(' + albumsData.albums[i].id + ')">' - + albumsData.albums[i].name + '</a><br />'; - } - - myLinGlobal.createPopup('linDivPopupAlbums'); - }, - - /** - * Thumbnail functions - */ - loadImages: function(albId) - { - this.startLoading(); - - myLinMapObject.closeMarkerWindows(); - - if( !this.showNav ) { - this.toggleNav(); - } - - myLinGlobal.AjaxPost(this.ajaxUrl, 'cmd=loadImages&albId='+albId,myLinMaps.showImages); - - }, - showImages: function(t) - { - myLinMaps.imagesData = eval('(' + t.responseText + ')'); - //myLinMaps.images = t.responseText.evalJSON(true); - - /** - * delete existing images - */ - $('linDivMapNav').innerHTML = ''; - if( myLinMaps.imagesObj ) - { - for( i = 0; i < myLinMaps.imagesObj.length; i++ ) - { - myLinMapObject.removeMarker( myLinMaps.imagesObj[i] ); - } - - myLinMaps.imagesObj = new Array(); - } - - - /** - * draw new markers / create thumbnails list - */ - myLinMapObject.initBounds(); - - for( i = 0; i < myLinMaps.imagesData.images.length; i++ ) - { - thumbId = myLinMaps.imagesData.images[i].id; - - var ElemImg = Builder.node('img', {src: thumbSrc + thumbId, className: 'linImgMapThumb', width: displayThumbSize, height: displayThumbSize}); - var ElemA = Builder.node('a', {id: "thumb_"+thumbId, href: 'javascript:myLinMapObject.openImage(' + i + ')'}); - var ElemDiv = Builder.node('div', {className: 'linDivMapsThumb'}); - - ElemA.appendChild( ElemImg ); - ElemDiv.appendChild( ElemA ); - $('linDivMapNav').appendChild(ElemDiv); - - if( i == 0 ) - myLinMaps.imagesObj[i] = myLinMapObject.createMarker( myLinMaps.imagesData.images[i], true ); - else - myLinMaps.imagesObj[i] = myLinMapObject.createMarker( myLinMaps.imagesData.images[i], false ); - } - - myLinMapObject.updateCenter(0); - - myLinMaps.stopLoading(); - - }, - - toggleNav: function() - { - - if( this.showNav ) - { - Element.hide('linDivMapNav'); - - // backup current margin - $('linDivMapNav').style.marginRight = $('linDivMapObject').style.marginRight; - - $('linDivMapObject').style.marginRight = '7px'; - - this.showNav = false; - } - else - { - // restore saved margin - $('linDivMapObject').style.marginRight = $('linDivMapNav').style.marginRight; - $('linDivMapNav').style.marginRight = 0; - - Element.show('linDivMapNav'); - - this.showNav = true; - } - - // update google map size - myLinMapObject.checkResize(); - }, - - - - startLoading: function() { - Element.show('linDivLoadingOuter'); - }, - stopLoading: function() { - Element.hide('linDivLoadingOuter'); - } - - - - - - - - -} // end class LinMaps - -function linOnResizeWrapper() -{ - myLinGlobal.setWindowSize(); - var newHeight = myLinGlobal.linInnerHeight - $('linDivMain').offsetTop - $('linDivMapBottom').offsetHeight - 30; - if(newHeight < 100) - { - newHeight = 100; - } - - $('linDivMapNav').style.height = newHeight + 'px'; - $('linDivMapMain').style.height = newHeight + 'px'; - - - /** - * tempoarely set the map heigth to a small value (zero does not work!) - * in IE setMainHeight() would not work while reducing the window size - * because IE takes always as much space as he actually needs ignoring - * the height attribute - */ - - /*$('linDivMapNav').style.height = '10px'; - $('linDivMapMain').style.height = '10px'; - - myLinGlobal.setMainHeight(); - - $('linDivMapMain').style.height = ($('linDivMain').offsetHeight - $("linDivTop").offsetHeight - $('linDivMapBottom').offsetHeight - 5) + 'px';*/ - - /** - * set also height of the navigation bar - * overflow:auto does not work in IE with height: 100% - */ - /*$('linDivMapNav').style.height = $('linDivMapMain').style.height;*/ - - // resize also google map itself - myLinMapObject.checkResize(); -} - -/** - * initLinMaps() - * - * create the class object - */ -function initLinMaps() -{ - myLinMaps.toggleNav(); - - /*if( doLoadAlbums ) - myLinMaps.loadAlbums();*/ - - //linEnableOnResize(); - //linOnResizeWrapper(); - myLinPage.enableOnResize('maps'); - - myLinMaps.loadMarkers(); -} -Event.observe(window, 'load', initLinMaps, false); -//Event.observe(body, 'load', initLinMaps, false); - -myLinMaps = new LinMaps(); -linMapObjectInit(); Modified: trunk/linpha2/lib/plugins/maps/LinMapsYUI.js =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMapsYUI.js 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/lib/plugins/maps/LinMapsYUI.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -70,6 +70,13 @@ myLinMapObject.updateCenter( 0 ); } } + + if (startupAlbum != -1) + { + myLinMaps.loadImages(startupAlbum); + startupAlbum = -1; + } + }; YAHOO.linpha.Maps.prototype.updateEditMarker = function() @@ -233,7 +240,7 @@ { thumbId = myLinMaps.imagesData.images[i].id; - var ElemImg = Builder.node('img', {src: thumbSrc + thumbId, className: 'linImgMapThumb', width: displayThumbSize, height: displayThumbSize}); + var ElemImg = Builder.node('img', {src: thumbSrc + thumbId, border: 0 /*required for IE*/, className: 'linImgMapThumb', width: displayThumbSize, height: displayThumbSize}); var ElemA = Builder.node('a', {id: "thumb_"+thumbId, href: 'javascript:myLinMapObject.openImage(' + i + ')'}); var ElemDiv = Builder.node('div', {className: 'linDivMapsThumb'}); Copied: trunk/linpha2/lib/plugins/maps/LinMaps_old.js (from rev 4924, trunk/linpha2/lib/plugins/maps/LinMaps.js) =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMaps_old.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/LinMaps_old.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -0,0 +1,355 @@ + +/** + * class and global definitions + */ +var LinMaps = Class.create(); +var myLinMaps; + +LinMaps.prototype = +{ + /** + * initialize() + * Constructor runs on completion of the DOM loading. + */ + initialize: function() + { + this.editMarker = false; + this.showNav = true; + this.defaultMarkerZoom = linMapsDefaultMarkerZoom; + + this.markersData = false; + this.markersObj = new Array(); + this.imagesObj = new Array(); + + this.ajaxUrl = linUrlBase + '&linId=' + linIdCurrent + '&xml'; + }, + + /** + * Marker functions + */ + loadMarkers: function() + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=loadMarkers',myLinMaps.showMarkers); + }, + showMarkers: function(t) + { + var i; + + myLinMaps.markersData = eval('(' + t.responseText + ')'); + //myLinMaps.markers = t.responseText.evalJSON(true); + + /** + * delete existing markers + */ + if( myLinMaps.markersObj ) + { + for( i = 0; i < myLinMaps.markersObj.length; i++ ) + { + myLinMapObject.removeMarker( myLinMaps.markersObj[i] ); + } + + myLinMaps.markersObj = new Array(); + } + + /** + * draw new markers + */ + myLinMapObject.initBounds(); + + for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) + { + myLinMaps.markersObj[i] = myLinMapObject.createMarker( myLinMaps.markersData.markers[i], false ); + } + + /** + * update center + * only if there is more than one marker + * prevent zooming to high + */ + if( i > 0) { + if( i == 1 ) { + myLinMapObject.updateCenter( myLinMaps.markersData.markers[0].zoom ); + } else { + myLinMapObject.updateCenter( 0 ); + } + } + }, + + updateEditMarker: function() + { + if( myLinMaps.editMarker ) // marker activated. use myLinMaps. instead of "this." when fired from GEvent class + { + latlng = myLinMaps.editMarker.getPoint(); + $('linFormEditMarker').linInputLat.value = latlng.lat(); + $('linFormEditMarker').linInputLon.value = latlng.lng(); + $('linFormEditMarker').linInputZoom.value = googlemap.getZoom(); + } + }, + + saveMarker: function(t) + { + xmlAnswer = t.responseXML.documentElement; + + if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) + { + myLinMaps.removeEditMarker(); + + myLinMaps.loadMarkers(); + } + else + { + alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); + } + }, + + deleteMarker: function(markerId) + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=deleteMarker&markerId='+markerId,myLinMaps.deleteMarkerFinish); + }, + deleteMarkerFinish: function(t) + { + xmlAnswer = t.responseXML.documentElement; + + if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) + { + var markerId = xmlAnswer.getElementsByTagName('responseData').item(0).firstChild.data; + + for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) + { + if( myLinMaps.markersData.markers[i].id == markerId ) + { + myLinMapObject.removeMarker( myLinMaps.markersObj[i] ); + myLinMaps.markersObj[i] = false; + } + } + } + else + { + alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); + } + }, + + removeEditMarker: function() + { + myLinMapObject.removeMarker( this.editMarker ); + this.editMarker = false; + }, + + assignAlbum: function(markerId,albId) + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbum&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); + }, + assignAlbumChange: function(markerId,albId) { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbumChange&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); + }, + assignAlbumDelete: function(markerId,albId) + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbumDelete&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); + }, + assignAlbumFinish: function(t) + { + xmlAnswer = t.responseXML.documentElement; + + // recreate marker on success + if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) + { + myLinMaps.loadMarkers(); + } + else + { + // print error message + alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); + } + }, + + loadAlbums: function() + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=loadAlbums',myLinMaps.showAlbums); + }, + showAlbums: function(t) + { + $('linDivMapAlbums').innerHTML = ''; + albumsData = eval('(' + t.responseText + ')'); + + for( i = 0; i < albumsData.albums.length; i++ ) + { + $('linDivMapAlbums').innerHTML += + '<a href="javascript:myLinMaps.loadImages(' + albumsData.albums[i].id + ')">' + + albumsData.albums[i].name + '</a><br />'; + } + + myLinGlobal.createPopup('linDivPopupAlbums'); + }, + + /** + * Thumbnail functions + */ + loadImages: function(albId) + { + this.startLoading(); + + myLinMapObject.closeMarkerWindows(); + + if( !this.showNav ) { + this.toggleNav(); + } + + myLinGlobal.AjaxPost(this.ajaxUrl, 'cmd=loadImages&albId='+albId,myLinMaps.showImages); + + }, + showImages: function(t) + { + myLinMaps.imagesData = eval('(' + t.responseText + ')'); + //myLinMaps.images = t.responseText.evalJSON(true); + + /** + * delete existing images + */ + $('linDivMapNav').innerHTML = ''; + if( myLinMaps.imagesObj ) + { + for( i = 0; i < myLinMaps.imagesObj.length; i++ ) + { + myLinMapObject.removeMarker( myLinMaps.imagesObj[i] ); + } + + myLinMaps.imagesObj = new Array(); + } + + + /** + * draw new markers / create thumbnails list + */ + myLinMapObject.initBounds(); + + for( i = 0; i < myLinMaps.imagesData.images.length; i++ ) + { + thumbId = myLinMaps.imagesData.images[i].id; + + var ElemImg = Builder.node('img', {src: thumbSrc + thumbId, className: 'linImgMapThumb', width: displayThumbSize, height: displayThumbSize}); + var ElemA = Builder.node('a', {id: "thumb_"+thumbId, href: 'javascript:myLinMapObject.openImage(' + i + ')'}); + var ElemDiv = Builder.node('div', {className: 'linDivMapsThumb'}); + + ElemA.appendChild( ElemImg ); + ElemDiv.appendChild( ElemA ); + $('linDivMapNav').appendChild(ElemDiv); + + if( i == 0 ) + myLinMaps.imagesObj[i] = myLinMapObject.createMarker( myLinMaps.imagesData.images[i], true ); + else + myLinMaps.imagesObj[i] = myLinMapObject.createMarker( myLinMaps.imagesData.images[i], false ); + } + + myLinMapObject.updateCenter(0); + + myLinMaps.stopLoading(); + + }, + + toggleNav: function() + { + + if( this.showNav ) + { + Element.hide('linDivMapNav'); + + // backup current margin + $('linDivMapNav').style.marginRight = $('linDivMapObject').style.marginRight; + + $('linDivMapObject').style.marginRight = '7px'; + + this.showNav = false; + } + else + { + // restore saved margin + $('linDivMapObject').style.marginRight = $('linDivMapNav').style.marginRight; + $('linDivMapNav').style.marginRight = 0; + + Element.show('linDivMapNav'); + + this.showNav = true; + } + + // update google map size + myLinMapObject.checkResize(); + }, + + + + startLoading: function() { + Element.show('linDivLoadingOuter'); + }, + stopLoading: function() { + Element.hide('linDivLoadingOuter'); + } + + + + + + + + +} // end class LinMaps + +function linOnResizeWrapper() +{ + myLinGlobal.setWindowSize(); + var newHeight = myLinGlobal.linInnerHeight - $('linDivMain').offsetTop - $('linDivMapBottom').offsetHeight - 30; + if(newHeight < 100) + { + newHeight = 100; + } + + $('linDivMapNav').style.height = newHeight + 'px'; + $('linDivMapMain').style.height = newHeight + 'px'; + + + /** + * tempoarely set the map heigth to a small value (zero does not work!) + * in IE setMainHeight() would not work while reducing the window size + * because IE takes always as much space as he actually needs ignoring + * the height attribute + */ + + /*$('linDivMapNav').style.height = '10px'; + $('linDivMapMain').style.height = '10px'; + + myLinGlobal.setMainHeight(); + + $('linDivMapMain').style.height = ($('linDivMain').offsetHeight - $("linDivTop").offsetHeight - $('linDivMapBottom').offsetHeight - 5) + 'px';*/ + + /** + * set also height of the navigation bar + * overflow:auto does not work in IE with height: 100% + */ + /*$('linDivMapNav').style.height = $('linDivMapMain').style.height;*/ + + // resize also google map itself + myLinMapObject.checkResize(); +} + +/** + * initLinMaps() + * + * create the class object + */ +function initLinMaps() +{ + myLinMaps.toggleNav(); + + /*if( doLoadAlbums ) + myLinMaps.loadAlbums();*/ + + //linEnableOnResize(); + //linOnResizeWrapper(); + myLinPage.enableOnResize('maps'); + + myLinMaps.loadMarkers(); +} +Event.observe(window, 'load', initLinMaps, false); +//Event.observe(body, 'load', initLinMaps, false); + +myLinMaps = new LinMaps(); +linMapObjectInit(); Deleted: trunk/linpha2/lib/plugins/maps/class.googlemaps.js =================================================================== --- trunk/linpha2/lib/plugins/maps/class.googlemaps.js 2008-04-27 09:35:57 UTC (rev 4930) +++ trunk/linpha2/lib/plugins/maps/class.googlemaps.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -1,270 +0,0 @@ - -var LinMapObject = Class.create(); -var myLinMapObject; - -var googlemap = false; // the main google map object -var geocoder = false; // the main google geocoder object - -LinMapObject.prototype = -{ - /** - * initialize() - * Constructor runs on completion of the DOM loading. - */ - initialize: function() - { - this.bounds = false; - }, - - createMap: function() - { - var mapType = 'hybrid'; // 'normal', 'satellite' - var mapLargeControl = 1; - var mapMouseZoom = 1; - var mapOverview = 1; - var mapMinZoom = 1; - var mapMaxZoom = 23; - var mapDefaultZoom = 4; - var mapDefaultLat = 49.9801; - var mapDefaultLng = 10.8731; - - geocoder = new GClientGeocoder(); - googlemap = new google.maps.Map2(document.getElementById("linDivMapObject")); - - googlemap.setCenter(new google.maps.LatLng(mapDefaultLat, mapDefaultLng), mapDefaultZoom); - - switch(mapType) { - case 'normal': - googlemap.setMapType(G_NORMAL_MAP); - break; - case 'satellite': - googlemap.setMapType(G_SATELLITE_MAP); - break; - case 'hybrid': - googlemap.setMapType(G_HYBRID_MAP); - break; - } - - - if(mapMouseZoom) { - googlemap.enableScrollWheelZoom(); - var mapdiv = document.getElementById("linDivMapObject"); - GEvent.addDomListener(mapdiv, "DOMMouseScroll", linMapWheelevent); - mapdiv.onmousewheel = linMapWheelevent; - } - if(mapOverview) { - googlemap.addControl(new GOverviewMapControl()); - } - - if(mapLargeControl) { - googlemap.addControl(new GLargeMapControl()); - } else { - googlemap.addControl(new GSmallMapControl()); - } - - googlemap.addControl(new GMapTypeControl()); - - var mycontrol = new GMapTypeControl(); - googlemap.addControl(mycontrol); - new GKeyboardHandler(googlemap); - googlemap.enableDoubleClickZoom(); - googlemap.enableContinuousZoom(); - - - // prevent memory leaks in internet explorer - Event.observe(window, 'unload', GUnload, false); - GEvent.addListener(googlemap, "zoomend", myLinMaps.updateEditMarker); - }, - - initBounds: function() - { - this.bounds = new GLatLngBounds(); - }, - updateCenter: function( zoom ) - { - if( zoom == 0 ) { - zoom = googlemap.getBoundsZoomLevel(this.bounds); - } - - googlemap.setCenter(this.bounds.getCenter(), zoom); - }, - - createMarker: function( markerNode, markerType, openMarker ) - { - /*var icon = new GIcon(); - icon.image = image[0]; - icon.iconSize = new GSize(image[1], image[2]); - subt = image[2] / 100 * 11; - subt = Math.ceil(subt); - var anchor = image[2] - subt; - icon.iconAnchor= new GPoint(10, anchor); - //{icon: icon, draggable: true}*/ - - /** - * - http://www.google.com/intl/de_ALL/mapfiles/marker.png - http://www.google.com/intl/de_ALL/mapfiles/shadow50.png - - http://maps.google.com/mapfiles/ms/micons/red.png - http://maps.google.com/mapfiles/ms/micons/blue.png - http://maps.google.com/mapfiles/ms/micons/green.png - http://maps.google.com/mapfiles/ms/micons/lightblue.png - http://maps.google.com/mapfiles/ms/micons/yellow.png - http://maps.google.com/mapfiles/ms/micons/purple.png - http://maps.google.com/mapfiles/ms/micons/pink.png - - http://maps.google.com/mapfiles/ms/micons/red-dot.png - http://maps.google.com/mapfiles/ms/micons/blue-dot.png - http://maps.google.com/mapfiles/ms/micons/green-dot.png - http://maps.google.com/mapfiles/ms/micons/ltblue-dot.png - http://maps.google.com/mapfiles/ms/micons/yellow-dot.png - http://maps.google.com/mapfiles/ms/micons/purple-dot.png - http://maps.google.com/mapfiles/ms/micons/pink-dot.png - - http://maps.google.com/mapfiles/ms/micons/pushpin_shadow.png - http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png - http://maps.google.com/mapfiles/ms/micons/red-pushpin.png - http://maps.google.com/mapfiles/ms/micons/grn-pushpin.png - http://maps.google.com/mapfiles/ms/micons/ltblu-pushpin.png - http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png - http://maps.google.com/mapfiles/ms/micons/purple-pushpin.png - http://maps.google.com/mapfiles/ms/micons/pink-pushpin.png - * - */ - - //alert( markerNode.id + ' ' + markerNode.name + ' ' + markerNode.lat + ' ' + markerNode.lon); - - var point = new GLatLng( markerNode.lat, markerNode.lon); - - switch(markerNode.type) { - case 'album': - var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/blue-dot.png") - break; - case 'marker': - var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/purple-dot.png") - break; - case 'albumWithImg': - var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/green-dot.png") - break; - case 'images': - var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/yellow-dot.png") - break; - default: - var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/blue-dot.png") - break; - } - icon.iconSize = new GSize(32, 32); - var marker = new GMarker(point, icon); - - GEvent.addListener(marker, "click", function() { - marker.openInfoWindowHtml( linGetMarkerHtml(markerNode) ); - }); - - googlemap.addOverlay( marker ); - - this.bounds.extend(point); - - if( openMarker ) { - GEvent.trigger(marker, 'click'); - } - - return marker; - }, - - createEditMarker: function( center ) - { - myLinMaps.editMarker = new GMarker(center, {draggable: true}); - - var inputForm = document.createElement("form"); - inputForm.setAttribute("action",""); - inputForm.setAttribute("method","POST"); - inputForm.setAttribute("id","linFormEditMarker"); - inputForm.onsubmit = function() {myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, Form.serialize(this),myLinMaps.saveMarker); return false;}; - inputForm.innerHTML = $('linDivEditMarker').innerHTML; - - myLinMaps.editMarker.bindInfoWindow( inputForm ); // The marker.bindInfoWindow*() methods create GEvent listeners that perform the corresponding marker.openInfoWindow*() calls when the marker is clicked. - - GEvent.addListener(myLinMaps.editMarker, "drag", function() { - myLinMaps.updateEditMarker(); - }); - - /*GEvent.addListener(marker, "dragstart", function() { - map.closeInfoWindow(); - });*/ - - GEvent.addListener(myLinMaps.editMarker, "dragend", function() { - GEvent.trigger(myLinMaps.editMarker, 'click'); - }); - - googlemap.addOverlay( myLinMaps.editMarker ); - GEvent.trigger(myLinMaps.editMarker, 'click'); - myLinMaps.updateEditMarker(); - }, - - closeMarkerWindows: function() { - googlemap.closeInfoWindow(); - }, - - removeMarker: function( marker) - { - googlemap.removeOverlay( marker ); - }, - - openImage: function(imgIndex) - { - GEvent.trigger(myLinMaps.imagesObj[imgIndex], 'click'); - }, - - checkResize: function() - { - //alert("typeof googlemap.checkResize: " + typeof googlemap.checkResize ); - if( typeof googlemap.checkResize != "undefined" ) { - googlemap.checkResize(); - } - }, - - geocodeAddress: function(address) - { - if( myLinMaps.editMarker ) - { - googlemap.removeOverlay( myLinMaps.editMarker ); - } - - if( address == '' ) - { - this.createEditMarker( googlemap.getCenter() ); - } - else - { - geocoder.getLatLng( - address, - function(point) - { - if(!point) { - alert(address + " not found"); - } else { - googlemap.setCenter(point, myLinMaps.defaultMarkerZoom); - myLinMapObject.createEditMarker( point ); - $('linInputMarkerName').value = address; - } - } - ); - } - } -} - - -function linMapWheelevent(e) -{ - if (!e) e = window.event; - if (e.preventDefault) e.preventDefault(); - e.returnValue = false; -} - -function linMapObjectInit() -{ - myLinMapObject = new LinMapObject(); - - google.load("maps", "2.x"); - google.setOnLoadCallback(myLinMapObject.createMap); -} Copied: trunk/linpha2/lib/plugins/maps/class.googlemaps_old.js (from rev 4923, trunk/linpha2/lib/plugins/maps/class.googlemaps.js) =================================================================== --- trunk/linpha2/lib/plugins/maps/class.googlemaps_old.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/class.googlemaps_old.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -0,0 +1,270 @@ + +var LinMapObject = Class.create(); +var myLinMapObject; + +var googlemap = false; // the main google map object +var geocoder = false; // the main google geocoder object + +LinMapObject.prototype = +{ + /** + * initialize() + * Constructor runs on completion of the DOM loading. + */ + initialize: function() + { + this.bounds = false; + }, + + createMap: function() + { + var mapType = 'hybrid'; // 'normal', 'satellite' + var mapLargeControl = 1; + var mapMouseZoom = 1; + var mapOverview = 1; + var mapMinZoom = 1; + var mapMaxZoom = 23; + var mapDefaultZoom = 4; + var mapDefaultLat = 49.9801; + var mapDefaultLng = 10.8731; + + geocoder = new GClientGeocoder(); + googlemap = new google.maps.Map2(document.getElementById("linDivMapObject")); + + googlemap.setCenter(new google.maps.LatLng(mapDefaultLat, mapDefaultLng), mapDefaultZoom); + + switch(mapType) { + case 'normal': + googlemap.setMapType(G_NORMAL_MAP); + break; + case 'satellite': + googlemap.setMapType(G_SATELLITE_MAP); + break; + case 'hybrid': + googlemap.setMapType(G_HYBRID_MAP); + break; + } + + + if(mapMouseZoom) { + googlemap.enableScrollWheelZoom(); + var mapdiv = document.getElementById("linDivMapObject"); + GEvent.addDomListener(mapdiv, "DOMMouseScroll", linMapWheelevent); + mapdiv.onmousewheel = linMapWheelevent; + } + if(mapOverview) { + googlemap.addControl(new GOverviewMapControl()); + } + + if(mapLargeControl) { + googlemap.addControl(new GLargeMapControl()); + } else { + googlemap.addControl(new GSmallMapControl()); + } + + googlemap.addControl(new GMapTypeControl()); + + var mycontrol = new GMapTypeControl(); + googlemap.addControl(mycontrol); + new GKeyboardHandler(googlemap); + googlemap.enableDoubleClickZoom(); + googlemap.enableContinuousZoom(); + + + // prevent memory leaks in internet explorer + Event.observe(window, 'unload', GUnload, false); + GEvent.addListener(googlemap, "zoomend", myLinMaps.updateEditMarker); + }, + + initBounds: function() + { + this.bounds = new GLatLngBounds(); + }, + updateCenter: function( zoom ) + { + if( zoom == 0 ) { + zoom = googlemap.getBoundsZoomLevel(this.bounds); + } + + googlemap.setCenter(this.bounds.getCenter(), zoom); + }, + + createMarker: function( markerNode, markerType, openMarker ) + { + /*var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + //{icon: icon, draggable: true}*/ + + /** + * + http://www.google.com/intl/de_ALL/mapfiles/marker.png + http://www.google.com/intl/de_ALL/mapfiles/shadow50.png + + http://maps.google.com/mapfiles/ms/micons/red.png + http://maps.google.com/mapfiles/ms/micons/blue.png + http://maps.google.com/mapfiles/ms/micons/green.png + http://maps.google.com/mapfiles/ms/micons/lightblue.png + http://maps.google.com/mapfiles/ms/micons/yellow.png + http://maps.google.com/mapfiles/ms/micons/purple.png + http://maps.google.com/mapfiles/ms/micons/pink.png + + http://maps.google.com/mapfiles/ms/micons/red-dot.png + http://maps.google.com/mapfiles/ms/micons/blue-dot.png + http://maps.google.com/mapfiles/ms/micons/green-dot.png + http://maps.google.com/mapfiles/ms/micons/ltblue-dot.png + http://maps.google.com/mapfiles/ms/micons/yellow-dot.png + http://maps.google.com/mapfiles/ms/micons/purple-dot.png + http://maps.google.com/mapfiles/ms/micons/pink-dot.png + + http://maps.google.com/mapfiles/ms/micons/pushpin_shadow.png + http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png + http://maps.google.com/mapfiles/ms/micons/red-pushpin.png + http://maps.google.com/mapfiles/ms/micons/grn-pushpin.png + http://maps.google.com/mapfiles/ms/micons/ltblu-pushpin.png + http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png + http://maps.google.com/mapfiles/ms/micons/purple-pushpin.png + http://maps.google.com/mapfiles/ms/micons/pink-pushpin.png + * + */ + + //alert( markerNode.id + ' ' + markerNode.name + ' ' + markerNode.lat + ' ' + markerNode.lon); + + var point = new GLatLng( markerNode.lat, markerNode.lon); + + switch(markerNode.type) { + case 'album': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/blue-dot.png") + break; + case 'marker': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/purple-dot.png") + break; + case 'albumWithImg': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/green-dot.png") + break; + case 'images': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/yellow-dot.png") + break; + default: + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/blue-dot.png") + break; + } + icon.iconSize = new GSize(32, 32); + var marker = new GMarker(point, icon); + + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml( linGetMarkerHtml(markerNode) ); + }); + + googlemap.addOverlay( marker ); + + this.bounds.extend(point); + + if( openMarker ) { + GEvent.trigger(marker, 'click'); + } + + return marker; + }, + + createEditMarker: function( center ) + { + myLinMaps.editMarker = new GMarker(center, {draggable: true}); + + var inputForm = document.createElement("form"); + inputForm.setAttribute("action",""); + inputForm.setAttribute("method","POST"); + inputForm.setAttribute("id","linFormEditMarker"); + inputForm.onsubmit = function() {myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, Form.serialize(this),myLinMaps.saveMarker); return false;}; + inputForm.innerHTML = $('linDivEditMarker').innerHTML; + + myLinMaps.editMarker.bindInfoWindow( inputForm ); // The marker.bindInfoWindow*() methods create GEvent listeners that perform the corresponding marker.openInfoWindow*() calls when the marker is clicked. + + GEvent.addListener(myLinMaps.editMarker, "drag", function() { + myLinMaps.updateEditMarker(); + }); + + /*GEvent.addListener(marker, "dragstart", function() { + map.closeInfoWindow(); + });*/ + + GEvent.addListener(myLinMaps.editMarker, "dragend", function() { + GEvent.trigger(myLinMaps.editMarker, 'click'); + }); + + googlemap.addOverlay( myLinMaps.editMarker ); + GEvent.trigger(myLinMaps.editMarker, 'click'); + myLinMaps.updateEditMarker(); + }, + + closeMarkerWindows: function() { + googlemap.closeInfoWindow(); + }, + + removeMarker: function( marker) + { + googlemap.removeOverlay( marker ); + }, + + openImage: function(imgIndex) + { + GEvent.trigger(myLinMaps.imagesObj[imgIndex], 'click'); + }, + + checkResize: function() + { + //alert("typeof googlemap.checkResize: " + typeof googlemap.checkResize ); + if( typeof googlemap.checkResize != "undefined" ) { + googlemap.checkResize(); + } + }, + + geocodeAddress: function(address) + { + if( myLinMaps.editMarker ) + { + googlemap.removeOverlay( myLinMaps.editMarker ); + } + + if( address == '' ) + { + this.createEditMarker( googlemap.getCenter() ); + } + else + { + geocoder.getLatLng( + address, + function(point) + { + if(!point) { + alert(address + " not found"); + } else { + googlemap.setCenter(point, myLinMaps.defaultMarkerZoom); + myLinMapObject.createEditMarker( point ); + $('linInputMarkerName').value = address; + } + } + ); + } + } +} + + +function linMapWheelevent(e) +{ + if (!e) e = window.event; + if (e.preventDefault) e.preventDefault(); + e.returnValue = false; +} + +function linMapObjectInit() +{ + myLinMapObject = new LinMapObject(); + + google.load("maps", "2.x"); + google.setOnLoadCallback(myLinMapObject.createMap); +} Added: trunk/linpha2/lib/plugins/maps/class.maps.php =================================================================== --- trunk/linpha2/lib/plugins/maps/class.maps.php (rev 0) +++ trunk/linpha2/lib/plugins/maps/class.maps.php 2008-04-27 12:37:17 UTC (rev 4931) @@ -0,0 +1,94 @@ +<?php +/* + * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> + * Florian Angehrn + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/** + * This class holds database related methods + * @package Database + */ + +if(!defined('LINPHA_DIR')) { exit(1); } + +class LinMaps +{ +function __construct() +{ + +} + +static function getExifLatLon(&$LatLon) +{ + /*Array PJMT + ( + [md5sum] => 084a9633ae7544e35ff1faad6cb05564 + [gpslatituderef] => N + [gpslatitude] => 469762048/16777216 (28),285212672/16777216 (17),820803480/16777216 (48.9236998558) (Degrees Minutes Seconds North or South) + [gpslongituderef] => W + [gpslongitude] => 1879048192/134217728 (14),1207959552/134217728 (9),472055494/16777216 (28.1367000341) (Degrees Minutes Seconds East or West) + ) + /*Array Exiftool + ( + [md5sum] => 084a9633ae7544e35ff1faad6cb05564 + [gpslatituderef] => North + [gpslatitude] => 46.9762048 + [gpslongituderef] => West + [gpslongitude] => 18.79048192 + )*/ + + /** + * Exiftool saves lat and lon as float + */ + /*if($GLOBALS['linpha']->sql->config->value['sys_import_use_exiftool'] + && $GLOBALS['linpha']->sql->config->value['sys_import_exiftool_avail'])*/ + if (strpos($LatLon['gpslatitude'], '(') === false) // do this check dynamically to be able to turn on/off exiftool without re-indexing all images + { + foreach(array('gpslatitude','gpslongitude') as $value) + { + if( $LatLon[$value.'ref'] == 'South' OR $LatLon[$value.'ref'] == 'West' ) + { + $return[ $value ] = $LatLon[$value]*-1; + } + else + { + $return[$value] = $LatLon[$value]; + } + } + } + else + { + foreach(array('gpslatitude','gpslongitude') as $value) + { + error_log("USING PJMT",'','0'); + $arrHits = array(); + + // use '?' to be �non-greedy� (http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck#Gieriges_Verhalten) + preg_match_all('/\((.*?)\)/', $LatLon[ $value ], $arrHits); + + $return[ $value ] = $arrHits[1][0] + ($arrHits[1][1] * 1/60) + ($arrHits[1][2] * 1/60 * 1/60); + if( $LatLon[ $value.'ref'] == 'S' OR $LatLon[ $value.'ref'] == 'W' ) + { + $return[ $value ] *= -1; + } + } + } + return $return; +} + +} +?> \ No newline at end of file Added: trunk/linpha2/lib/plugins/maps/greversegeocoder.js =================================================================== --- trunk/linpha2/lib/plugins/maps/greversegeocoder.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/greversegeocoder.js 2008-04-27 12:37:17 UTC (rev 4931) @@ -0,0 +1,398 @@ +/* + Copyright 2007-2008 Nico Goeminne (nic...@gm...) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * Class GReverseGeocoder v1.0.6 + * + * This class is used to obtain reverse geocodes (addresses) for user specified points. + * It does not use any caching mechanisme and is limited to 10 000 request per day. + * It uses both GDirections as GClientGeocoder. The default country is set to "Belguim". + * The country could be set using the GReverseGeocoder.setBaseCountrybefore method + * before any reverse geocoding is attempted. + * + * All data is obtained by use of the Google Maps API only! + * Therefore Reverse Geocoding is only supported for those countries in which Google Maps + * supports Geocoding (GClientGeocoder) and Driving Directions (GDirections). + * As a result only street level results are returned. (No house numbers) + */ + + /* Change Log 5/01/08 + * + * - Changed getStreet() function + * Now numbered roads are parsed correctly + * - Added the getPlacemarkProperty(placemark,propertyname) function + * The helper function is useful to investigate the resulting placemark. + * Since the placemark structure depends on the used data provider, the structure + * and property names may be different. This method searches the placemark for a certain + * property name. For example, if one needs the postal code: + * + * GEvent.addListener(reversegeocoder, "load", + * function(placemark) { + * var postalcodenumber = reversegeocoder.getPlacemarkProperty(placemark,"PostalCodeNumber"); + * if (postalcodenumber != null) alert("Postal Code Number: " + postalcodenumber); + * else alert("Postal Code Number Unknown"); + * } + * ); + * + */ + + /* Change Log 18/11/07 + * + * - Removed setBaseCountry() function + * The user of the script doesn't have to set the country anymore, + * instead the geocoder is provided by a bounding box (works in the 2.x api - fixed by google) + * - Reported lng bug to google + */ + + +/* + * Creates a new instance of a reversegeocoder. + * Note that the reverseGeocode() method initiates a new query, + * which in turn triggers a "load" event once the query has finished loading. + * + * Additionally, the object contains thwo event listeners which you can intercept: + * "load": This event is triggered when the results of a reverse geocode query issued via + * GReverseGeocoder.reverseGeocode() are available. Note that the reverseGeocode() method + * initiates a new query, which in turn triggers a "load" event once the query has finished + * loading. + * "error": This event is triggered if a reverse geocode request results in an error. + * Callers can use GReverseGeocoder.getStatus() to get more information about the error. + * In GReverseGeocoder v1.0 the getStatus() method proxies the GDirections.getStatus() behavior. + */ +function GReverseGeocoder(map) { + // we don't actually need the map variable but to be sure the Google Map API + // is loaded + this.map=map; + this.gdirections = new GDirections(); + this.geocoder = new GClientGeocoder(); + this.lastpoint=null; + this.closestonroad=null; + this.experimental=false; + this.ad=""; + this.step=10; + this.start=1; + this.gdirectionsrefine = new GDirections(); + GEvent.bind(this.gdirections, "error", this, this.handleError); + GEvent.bind(this.gdirections, "load", this, this.processDirection); + GEvent.bind(this.gdirectionsrefine, "error", this, this.handleError); + GEvent.bind(this.gdirectionsrefine, "load", this, this.processDirectionRefine); +} + +/* + * This method issues a new reverse geocode query. + * The parameter is a GLatLng point. + * If successful the Placemark object is passed to the user-specified + * listener. + * + * E.g. var listener = GEvent.addListener(reversegeocoder,"load", + * function(placemark){ + * alert("The reverse geocoded address is " + placemark.address); + * } + * ); + */ +GReverseGeocoder.prototype.reverseGeocode = function(point){ + this.lastpoint = point; + this.closestonroad = null; + this.gdirections.clear(); + this.gdirections.loadFromWaypoints([point.toUrlValue(6),point.toUrlValue(6)],{getSteps: true, locale: "GB", getPolyline:true}); +} + +/* + * Returns the status of the reverse geocode request. + * In GReverseGeocoder v1.0 the getStatus() method proxies the GDirections.getStatus() behavior. + * The returned object has the following form: { code: 200 request: "directions" } + * The status code can take any of the values defined in GGeoStatusCode. (Since Google Map API 2.81) + */ +GReverseGeocoder.prototype.getStatus = function(){ + return this.gdirections.getStatus(); +} + + +/* + * Private implementation methods + */ + +/* + * This method is called when a GDirection error occurs, + * or if the GReverseGeocoder does not find an address. + */ +GReverseGeocoder.prototype.handleError = function() { + GEvent.trigger(this, "error"); +} + +/* + * This method first gets the closest street using GDirections, + * then tries to find addresses by combinating that street + * with the supplied country using the GClientGeocoder. + * This can result in multiple addresses and is filtered + * by the GReverseGeocoder.getBestMatchingPlacemark() method. + */ +GReverseGeocoder.prototype.processDirection = function() { + var source = this; + // snap to road + if ( this.gdirections.getPolyline() != null){ + this.closestonroad=this.gdirections.getPolyline().getVertex(0);; + } + + var nrroutes = this.gdirections.getNumRoutes(); + if (nrroutes != 0) { + var route = this.gdirections.getRoute(0); + var nrsteps = route.getNumSteps(); + if (nrsteps != 0) { + var step = route.getStep(0); + var street = step.getDescriptionHtml(); + /* v102 */ + street = this.getStreet(street); + var sw = new GLatLng(Number(this.lastpoint.lat()) - 0.01, Number(this.lastpoint.lng()) - 0.01); + var ne = new GLatLng(Number(this.lastpoint.lat()) + 0.01, Number(this.lastpoint.lng()) + 0.01); + var bounds = new GLatLngBounds(sw, ne); + this.geocoder.setViewport(bounds); + /* end change */ + this.geocoder.getLocations(street, + function(response) { + var placemark = source.getBestMatchingPlacemark(response); + if (placemark != null) { + if(source.experimental) { + source.ad = placemark.address; + source.step=10; + source.start=1; + source.houseNumberSearch(); + } + else { + GEvent.trigger(source, "load", placemark); + } + } + else{ + source.handleError(); + } + } + ); + } + } +} + +/* + * Finds the closest address towards the original point + * form the resultset obtained by the GClientGeocoder request. + * In GReverseGeocoder v1.0 an address is considered only if + * it is... [truncated message content] |
From: <fan...@us...> - 2008-04-27 09:36:09
|
Revision: 4930 http://linpha.svn.sourceforge.net/linpha/?rev=4930&view=rev Author: fangehrn Date: 2008-04-27 02:35:57 -0700 (Sun, 27 Apr 2008) Log Message: ----------- moved not needed javascript files Added Paths: ----------- trunk/linpha2/lib/js/old/LinGlobal_old.js trunk/linpha2/lib/js/old/LinImage_old.js trunk/linpha2/lib/js/old/LinThumbnails_old.js trunk/linpha2/lib/js/old/builder.js trunk/linpha2/lib/js/old/builder.yui.js trunk/linpha2/lib/js/old/controls.js trunk/linpha2/lib/js/old/controls.yui.js trunk/linpha2/lib/js/old/dragdrop.js trunk/linpha2/lib/js/old/dragdrop.yui.js trunk/linpha2/lib/js/old/effects.js trunk/linpha2/lib/js/old/effects.yui.js trunk/linpha2/lib/js/old/prototype/ trunk/linpha2/lib/js/old/prototype.js trunk/linpha2/lib/js/old/prototype.yui.js trunk/linpha2/lib/js/old/scriptaculous-js/ trunk/linpha2/lib/js/old/scriptaculous.js trunk/linpha2/lib/js/old/scriptaculous.yui.js trunk/linpha2/lib/js/old/slider.js trunk/linpha2/lib/js/old/slider.yui.js trunk/linpha2/lib/js/old/sound.js trunk/linpha2/lib/js/old/sound.yui.js trunk/linpha2/lib/js/old/unittest.js trunk/linpha2/lib/js/old/unittest.yui.js Removed Paths: ------------- trunk/linpha2/lib/js/LinGlobal_old.js trunk/linpha2/lib/js/LinImage_old.js trunk/linpha2/lib/js/LinThumbnails_old.js trunk/linpha2/lib/js/builder.js trunk/linpha2/lib/js/builder.yui.js trunk/linpha2/lib/js/controls.js trunk/linpha2/lib/js/controls.yui.js trunk/linpha2/lib/js/dragdrop.js trunk/linpha2/lib/js/dragdrop.yui.js trunk/linpha2/lib/js/effects.js trunk/linpha2/lib/js/effects.yui.js trunk/linpha2/lib/js/prototype/ trunk/linpha2/lib/js/prototype.js trunk/linpha2/lib/js/prototype.yui.js trunk/linpha2/lib/js/scriptaculous-js/ trunk/linpha2/lib/js/scriptaculous.js trunk/linpha2/lib/js/scriptaculous.yui.js trunk/linpha2/lib/js/slider.js trunk/linpha2/lib/js/slider.yui.js trunk/linpha2/lib/js/sound.js trunk/linpha2/lib/js/sound.yui.js trunk/linpha2/lib/js/unittest.js trunk/linpha2/lib/js/unittest.yui.js Deleted: trunk/linpha2/lib/js/LinGlobal_old.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal_old.js 2008-04-27 09:34:07 UTC (rev 4929) +++ trunk/linpha2/lib/js/LinGlobal_old.js 2008-04-27 09:35:57 UTC (rev 4930) @@ -1,311 +0,0 @@ - -/** - * class and global definitions - */ -var LinGlobal = Class.create(); -var myLinGlobal; - -LinGlobal.prototype = -{ - /** - * initialize() - * Constructor runs on completion of the DOM loading. - */ - initialize: function() - { - this.menuNeedsUpdating = false; - - this.linInnerWidth = 0; - this.linInnerHeight = 0; - this.linPageXOffset = 0; - this.linPageYOffset = 0; - - this.tabs = new Array(); - - this.nofPopups = 0; - }, - - /** - * dynamically open syslog - * used in ajax context - */ - linSyslog: function(text) - { - if( typeof $('linDivSyslogText') != 'undefined' ) - { - if( $('linDivSyslogText').innerHTML == '' ) - { - $('linDivSyslogText').innerHTML += text; - } - else - { - $('linDivSyslogText').innerHTML += '<br />' + text; - } - - this.setScrollSize(); - $('linDivSyslog').style.top = (this.linPageYOffset + 15) + 'px'; - $('linDivSyslog').style.left = (this.linPageXOffset + 15) + 'px'; - Element.show('linDivSyslog'); - } - }, - closeSyslog: function() - { - $('linDivSyslogText').innerHTML = ''; - Element.hide('linDivSyslog'); - }, - - /** - * check ajax compatibilty - * will be on every page view until it was successfully - * then, the page will be reloaded - * - * use this on every page and not only on home page, because if user is linked directly to an image - * - * ajax may be disabled with ./?linCat=ajax&disable_ajax - * and may be re-enabled with ./?linCat=ajax&enable_ajax - * - * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request - */ - checkAjaxCompatibility: function() - { - new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:myLinGlobal.checkAjaxCompatibilitySuccess} ); - }, - - /** - * reload page, now with ajax activated - * will be called if the request in checkAjaxCompatibility() was successfully - */ - checkAjaxCompatibilitySuccess: function(t) - { - if( t.responseText == 'use_js saved' ) - { - myLinGlobal.linSyslog('Ajax enabled'); - location.href = document.location; - } - }, - - AjaxPost: function(url, parameters, successFunction) - { - var opt = { - // Use POST - method: 'post', - // Send this lovely data - postBody: parameters - , - // asynchron, of course - asynchronous:true, - - // Handle successful response - onSuccess: successFunction, - - // Handle 404 - on404: function(t) { - alert('Error 404: ' + t.statusText); - }, - // Handle other errors - onFailure: function(t) { - alert('Error ' + t.status + ' -- ' + t.statusText); - } - } - - new Ajax.Request(url, opt); - }, - - /*reloadMenu: function() - { - if( this.menuNeedsUpdating ) - { - new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); - this.menuNeedsUpdating = false; - } - },*/ - - /** - * setWindowSize() - * - * sets two variables of the inner window width and height - * takes care of browser incompatibilities - */ - setWindowSize: function() - { - /** - * browser incompatibilities... - */ - if (window.innerHeight) // all except Explorer - { - this.linInnerWidth = self.innerWidth; - this.linInnerHeight = self.innerHeight; - } - else if (document.body && document.body.offsetWidth) - { - this.linInnerWidth = document.body.offsetWidth; - this.linInnerHeight = document.body.offsetHeight; - } - else - { - this.linInnerWidth = 500; - this.linInnerHeight = 300; - } - }, - - /** - * setMainHeight - * - * sets the height in thumb and image view of the "linDivMainOuter" - */ - setMainHeight: function() - { - this.setWindowSize(); - - var newHeight = this.linInnerHeight - $('linDivMain').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) - if(newHeight < 100) - { - newHeight = 100; - } - - $('linDivMain').style.height = newHeight + 'px'; - }, - - /** - * setScrollSize - * - * sets two variables with the scroll offset - * takes care of browser incompatibilites - * @uses linSyslog() - */ - setScrollSize: function() - { - if (self.pageYOffset) // all except Explorer - { - this.linPageXOffset = self.pageXOffset; - this.linPageYOffset = self.pageYOffset; - } - else if (document.documentElement && document.documentElement.scrollTop) - // Explorer 6 Strict - { - this.linPageXOffset = document.documentElement.scrollLeft; - this.linPageYOffset = document.documentElement.scrollTop; - } - else if (document.body) // all other Explorers - { - this.linPageXOffset = document.body.scrollLeft; - this.linPageYOffset = document.body.scrollTop; - } - }, - - fOnError: function(txt_message, url, line) { - var txt = "Error occured...\n\n"; - txt += "Message: " + txt_message + "\n"; - txt += "URL: " + url + "\n"; - txt += "Line: " + line; - alert(txt); - }, - - /** - * menu tab functions - - openTab: function( className, tabNr ) { - divElems = document.getElementsByTagName('div'); - for(i = 0, n = 0; i < divElems.length; i++) - { - if( divElems[i].className == className ) - { - if(n == tabNr && - typeof this.tabs[ className ]!='undefined' && - typeof this.tabs[ className ][ tabNr ]!='undefined' && - this.tabs[ className ][ tabNr ]!='disabled') - { - divElems[i].style.display = ''; - } else { - divElems[i].style.display = 'none'; - } - - n++; - } - } - }, - disableTab: function( className, tabNr, elemAId ) { - this.tabs[ className ][ tabNr ] = 'disabled'; - $(elemAId).style.color = 'gray'; - }, - enableTab: function( className, tabNr, elemAId ) { - //alert(className + ' ' + typeof this.tabs[ className ] + ' ' + this.tabs[ className ]); - //this.tabs[ className ][ tabNr ] = ''; - //this.tabs.className.tabNr = ''; - $(elemAId).style.color = ''; - },*/ - - /** - * popup functions - */ - createPopup: function( elemId ) { - this.divPopupWindow = Builder.node('div', {id: 'linPopup'+this.nofPopups, className: 'linPopupWindow'} ); - - var divClose = Builder.node('div', {className: 'linPopupClose'}); - var divCloseButton = Builder.node('input', {type: 'button', value: 'X', - onclick: 'myLinGlobal.closePopup(\'linPopup'+this.nofPopups+'\')', className: 'linPopupCloseButton'}); - divClose.appendChild(divCloseButton); - - var divTitleBar = Builder.node('div', {className: 'linPopupTitleBar'} ); - divTitleBar.appendChild(divClose); - - - var divText = $(elemId).cloneNode(true); - divText.className = 'linPopupText'; - Element.show(divText); - - this.divPopupWindow.appendChild(divTitleBar); - this.divPopupWindow.appendChild(divText); - - document.body.appendChild(this.divPopupWindow); - - new Draggable(this.divPopupWindow, {handle: 'linPopupTitleBar'}); - - this.nofPopups++; - }, - closePopup: function(elemId) { - document.body.removeChild($(elemId)); - } - - - // no comma at last function. firefox works, but IE not! -} - -/** - * initLinGlobal() - * - * create the class object - */ -function initLinGlobal() -{ - myLinGlobal = new LinGlobal(); - - Event.observe(window, 'error', myLinGlobal.fOnError, false); - - /*if( checkAjaxCompatibility ) { - myLinGlobal.checkAjaxCompatibility(); - }*/ -} - -//Event.observe(window, 'load', initLinGlobal, false); -initLinGlobal(); - - -/** - * on resize functions - */ -function linEnableOnResize() -{ - Event.observe(window, 'resize', linOnResizeCreateTrigger, false); -} - -/** - * resizeWindow, use this wrapper function because internet explorer triggers the resize event to fast - * - * linOnResizeWrapper() must be defined where it's actually used (LinThumbnails.js, LinMapView.js) - */ -function linOnResizeCreateTrigger() -{ - clearTimeout(this.timerResize); - this.timerResize = setTimeout(linOnResizeWrapper,250); -} Deleted: trunk/linpha2/lib/js/LinImage_old.js =================================================================== --- trunk/linpha2/lib/js/LinImage_old.js 2008-04-27 09:34:07 UTC (rev 4929) +++ trunk/linpha2/lib/js/LinImage_old.js 2008-04-27 09:35:57 UTC (rev 4930) @@ -1,1186 +0,0 @@ - -/** - * class and global definitions - */ -var LinImage = Class.create(); -var myLinImage; - -LinImage.prototype = { - - /** - * initialize() - * - * Constructor runs on completion of the DOM loading. - */ - initialize: function() - { - /*this.imgInfoColorNotActive = $('linDivInfoLink').style.color; - this.imgInfoColorActive = $('linHrefInfoLink').style.color;*/ - this.imgInfoShowHide = 'hide'; - - - this.fullscreenActive = false; - this.fullscreenOldMaxWidth, this.fullscreenOldMaxHeight, this.previousBodyOverflow; - this.slideshowActive = false; - this.ssCurrentTimerID; - this.ssCurrentDelay = 5000; - this.ssRandom = false; - this.ssLoop = false; - - this.xmlDoc = new Array(); - this.nextThumbs = new Array(); - this.prevThumbs = new Array(); - this.preloadImageSrc = new Array(); // image array, will contain a lot of preloaded images - this.finishedPreloadedImages = new Array(); // set to true after preload completed - this.preloadXmlFinished = new Array(); - - this.currentFileType; // 1 = image, 2 = video, 3 = others - - this.curLocationHash; - //this.timerResize; - }, - - - // ----------------------------------------------------------------------------------- - // functions to load xml data of images - // ----------------------------------------------------------------------------------- - - loadImage: function(imgId) { - if(IdCurrent != imgId) - { - IdCurrent = imgId; - //myLinGlobal.menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu - location.hash = 'idCurrent='+IdCurrent; - } - - this.curLocationHash = location.hash; // update current Hash, this value is periodically checked to reload the image if neccessary - - // do not load the data again if it is already cached - if(this.preloadXmlFinished[imgId] && typeof this.xmlDoc[imgId] != "undefined" ) // use typeof to work in IE - { - this.changeImage(); - } - else - { - this.loadImageXml(imgId); - } - }, - - loadImageXml: function(imgId) { - myLinGlobal.AjaxPost(linUrlBase + '&linId=' + imgId + '&xml', '', myLinImage.loadImageContinue); - }, - - loadImageContinue: function(t) { - var loadedimgid = t.responseXML.documentElement.getElementsByTagName('imgid').item(0).firstChild.data; - - // save xml data - myLinImage.xmlDoc[loadedimgid] = t.responseXML.documentElement; - myLinImage.preloadXmlFinished[loadedimgid] = true; - - if( loadedimgid == IdCurrent ) // coming from loadImage() - { - myLinImage.changeImage(); - } - else // coming from preloadImage() - { - myLinImage.preloadImage(loadedimgid); - } - }, - - - // ----------------------------------------------------------------------------------- - // Navigation functions - // ----------------------------------------------------------------------------------- - - movePrev: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - if(this.prevThumbs[ this.prevThumbs.length - 1 ]) - { - Element.setOpacity('linSsImgPrev',0.7); - new Effect.Appear('linSsImgPrev', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage(this.prevThumbs[ this.prevThumbs.length - 1 ]); - - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - } - else // end reached, do nothing but enable keyboard navigation again - { - myLinImage.enableKeyboardNav(); - } - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - moveNext: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - if(this.nextThumbs[0]) - { - Element.setOpacity('linSsImgNext',0.7); - new Effect.Appear('linSsImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage(this.nextThumbs[0]); - } - else if( this.ssLoop ) - { - Element.setOpacity('linSsImgNext',0.7); - new Effect.Appear('linSsImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); - this.moveFirst(); - } - else // end reached, do nothing but enable keyboard navigation again - { - myLinImage.enableKeyboardNav(); - } - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - moveFirst: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - Element.setOpacity('linSsImgFirst',0.7); - new Effect.Appear('linSsImgFirst', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage( firstImgId ); - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - moveLast: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - Element.setOpacity('linSsImgLast',0.7); - new Effect.Appear('linSsImgLast', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage( lastImgId ); - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - - // ----------------------------------------------------------------------------------- - // Change image functions - // ----------------------------------------------------------------------------------- - - /** - * changeImage() - */ - changeImage: function() { - - /** - * set height of outer div to prevent the whole page getting smaller, and if the image is loaded getting bigger again - * but in fullscreen, we want no activities in background - */ - if(! this.fullscreenActive) { - $('linDivMainimage').style.height = $('linImgMainimage').style.height; - //$('linDivMain').style.height = $('linDivMain').offsetHeight; - //alert($('linDivMain').offsetHeight); - } - - /** - * hide elements during transition - */ - this.hideImgInfoNow(); // hide text info link immediately - Element.hide('linImgMainimage'); // hide mainimage while changing image to prevent flicker - Element.hide('linDivInfoLink'); - - this.currentFileType = this.xmlDoc[IdCurrent].getElementsByTagName('filetype').item(0).firstChild.data; - - switch( this.currentFileType ) - { - case '1': // image - - if(! this.finishedPreloadedImages[IdCurrent] ) - { - Element.show('linDivloading'); - } - - //$('linImgMainimage').style.marginLeft = 0; // restore left margin, set when viewing videos - - /** - * calc image width and height - */ - var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; - var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; - var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); - var imgWidth = sizeArray[0]; - var imgHeight = sizeArray[1]; - - /** - * preload image - */ - var currentImgSrc = imageSrc + IdCurrent + '&width=' + imgWidth + '&height=' + imgHeight; - imgPreloader = new Image(); - - /** - * once image is preloaded, resize image container - * - * pay attention with the other image preloader! - * if imgWidth and imgWidth was not set with trailing 'var' it got overlapping with the other variables - * and this caused the image not resized correctly in resizeImageContainer() !!! - */ - imgPreloader.onload=function(){ - myLinImage.finishedPreloadedImages[IdCurrent] = true; - $('linImgMainimage').src = currentImgSrc; - myLinImage.resizeImageContainer(imgWidth, imgHeight); - } - imgPreloader.src = currentImgSrc; - - break; - case '2': // video - - //$('linImgMainimage').style.marginLeft = 200; - - /** - * show video thumbnail - */ - $('linImgMainimage').src = thumbSrc + IdCurrent ; - $('linImgMainimage').style.width = 'auto'; - $('linImgMainimage').style.height = 'auto'; - - /** - * show image and set div height - */ - this.showImage(); - - break; - case '0': // others - break; - } - }, - - /** - * resizeImageContainer() - */ - resizeImageContainer: function( imgWidth, imgHeight) { - - // get current height and width - /*this.wCur = $('linImgMainimage').offsetWidth; - this.hCur = $('linImgMainimage').offsetHeight; - - // scalars based on change from old to new - this.xScale = ((imgWidth + (borderSize * 2)) / this.wCur) * 100; - this.yScale = ((imgHeight + (borderSize * 2)) / this.hCur) * 100; - - // calculate size difference between new and old image, and resize if necessary - wDiff = (this.wCur - borderSize * 2) - imgWidth; - hDiff = (this.hCur - borderSize * 2) - imgHeight; - - if(!( hDiff == 0)){ new Effect.Scale('linImgMainimage', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); } - if(!( wDiff == 0)){ new Effect.Scale('linImgMainimage', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); } - - // if new and old image are same size and no scaling transition is necessary, - // do a quick pause to prevent image flicker. - if((hDiff == 0) && (wDiff == 0)){ - if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);} - }*/ - - $('linImgMainimage').style.width = imgWidth + 'px'; - $('linImgMainimage').style.height = imgHeight + 'px'; - - - /*Element.setHeight('prevLink', imgHeight); - Element.setHeight('nextLink', imgHeight); - Element.setWidth( 'imageDataContainer', imgWidth + (borderSize * 2));*/ - - /** - * show panorama link - * the only reason why do this at this point is, because this is only done on images - * and we just know the width and height - */ - if( imgWidth/imgHeight >= 2 || imgHeight/imgWidth >= 2 ) - { - Element.show('linHrefPanoLink'); - } - - this.showImage(); - }, - - /** - * showImage() - * - * Display image and begin preloading next images. - */ - showImage: function(){ - Element.hide('linDivloading'); - - if( useEffects ) - { - new Effect.Appear('linImgMainimage', { duration: 0.2, afterFinish: function(){ myLinImage.setImageData(); } }); - } - else - { - Element.show('linImgMainimage'); - this.setImageData() - } - - if(! this.fullscreenActive) - { - $('linDivMainimage').style.height = $('linImgMainimage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller - //$('linDivMain').style.height = 'auto'; - } - }, - - /** - * setImageData() - */ - setImageData: function() - { - this.enableKeyboardNav(); - - /** - * set title - */ - if( typeof $('linDivTitle') != 'undefined' ) - { - $('linDivTitle').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; - } - - /** - * update the menu - * - * replace the image ids in the menu - * replace( /linId=[0-9]* /g , "linId=" + IdCurrent ); - * its just an search/replace of 'linId=x' in the menu - * its very fast (about 0 - 15ms) and its executed every time the image changes - * - * but only in menuMore and menuAdmin, because we have in menuLogin - * linId='+IdCurrent, and ooh this will create very unexpected results..!! - */ - /*if( typeof $('linMenuAdmin') != 'undefined' ) - {*/ - //$('linMenuAdmin').innerHTML = $('linMenuAdmin').innerHTML.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); - /*}*/ - - /** - * menuMore - */ - /*if( typeof $('linMenuMore') != 'undefined' ) - {*/ - //$('linMenuMore').innerHTML = $('linMenuMore').innerHTML.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); - - // replace the width and height dimensions of the view at fullscreen link - //var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; - //var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; - //$('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /width=[0-9]*/ , "width=" + orgWidth ); - //$('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /height=[0-9]*/ , "height=" + orgHeight ); - //$('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /[0-9]*x[0-9]*/ , orgWidth + "x" + orgHeight ); - /*}*/ - - /** - * set current thumb - */ - $('linDivThumbnavi_Current').innerHTML = '<a href="javascript:myLinImage.loadImage(' + IdCurrent + ')"><img class="linImgThumbnavi_Current" src="' + thumbSrc + IdCurrent + '" /></a>'; - - /** - * set prev thumbs - */ - $('linDivThumbnavi_Prev').innerHTML = ''; - this.prevThumbs = new Array(); - if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length; i++) - { - var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; - this.prevThumbs[i] = thumbId; - this.setPrevNextThumb(thumbId, 'linDivThumbnavi_Prev'); - } - } - - /** - * set next thumbs - */ - $('linDivThumbnavi_Next').innerHTML = ''; - this.nextThumbs = new Array(); - if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) - { - var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; - this.nextThumbs[i] = thumbId; - this.setPrevNextThumb(thumbId, 'linDivThumbnavi_Next'); - } - } - - /** - * set meta data - */ - $('linDivMeta').innerHTML = ''; - if(this.xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) - { - var table = Builder.node('table', {id: 'linTableMeta'} ); - var tbody = Builder.node('tbody'); - - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) - { - var meta = this.xmlDoc[IdCurrent].getElementsByTagName('meta').item(i); - var metaname = meta.getElementsByTagName('name').item(0).firstChild.data; - if(meta.getElementsByTagName('value').item(0).hasChildNodes()) { // prevent error in IE - var metavalue = meta.getElementsByTagName('value').item(0).firstChild.data; - } else { - var metavalue = ''; - } - - var tr = Builder.node('tr'); - var tdleft = Builder.node('td', {className: 'linTdMetaLeftColumn'}, metaname ); - var tdright = Builder.node('td', metavalue ); - - tr.appendChild(tdleft); - tr.appendChild(tdright); - tbody.appendChild(tr); - } - - table.appendChild(tbody); - - $('linDivMeta').appendChild(table); - - } - - /** - * file type specific meta data stuff - */ - switch( this.currentFileType ) - { - case '1': // image - this.setImageInfoLink(); // show the "info" link, must be called after Appear('linImgMainimage') - - //Element.hide('linDivVideoLink'); - //Element.show('linDivExifLink'); - //$('linAMetaExif').href = '#' + $('linAMetaExif').href; - //myLinGlobal.enableTab( 'linDivTab', 3, 'linAMetaExif' ); - - break; - case '2': // video - - //Element.show('linDivVideoLink'); - //Element.hide('linDivExifLink'); - //$('linAMetaExif').href = $('linAMetaExif').href.substring(1); - //$('linAMetaExif').href = '#' + $('linAMetaExif').href; - - //myLinGlobal.disableTab( 'linDivTab', 3, 'linAMetaExif' ); - - /*$('linDivMetaOuter').style.top = $('linImgMainimage').offsetTop + 'px'; - $('linDivMetaOuter').style.height = $('linImgMainimage').offsetHeight + 'px'; // 'auto' - Element.show('linDivMetaOuter');*/ - - break; - } - - this.initTextareaAddComment(); - this.setComments(); - - /** - * set image nr - * currently only in slideshow used - */ - $('linDivSlideshowImgNr').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; - - - /** - * and at last, start preloading next and previous images - */ - this.preloadXml(); - - - }, - - /** - * setPrevNextThumb() - * - * code to generate a thumbnail with a <div><a><img> tag - */ - setPrevNextThumb: function(thumbId, divId) - { - var ElemImg = Builder.node('img', {id: 'thumb'+thumbId, className: 'linImgThumbnavi_PrevNext', src: thumbSrc + thumbId}); - var ElemA = Builder.node('a', {href: 'javascript:myLinImage.loadImage(' + thumbId + ')'}); - var ElemDiv = Builder.node('div', {className: 'linDivThumbnavi_PrevNext'}); - - ElemA.appendChild( ElemImg ); - ElemDiv.appendChild( ElemA ); - $(divId).appendChild(ElemDiv); - - if(! this.finishedPreloadedImages[thumbId]) { - Element.setOpacity('thumb'+thumbId,0.5); - } - - }, - - - // ----------------------------------------------------------------------------------- - // Keyboard actions - // ----------------------------------------------------------------------------------- - - /** - * enableKeyboardNav() - */ - enableKeyboardNav: function() { - document.onkeydown = this.keyboardAction; - }, - - /** - * disableKeyboardNav() - */ - disableKeyboardNav: function() { - document.onkeydown = ''; - }, - - /** - * keyboardAction() - * - * very nice - * http://www.mediaevent.de/javascript/needful_tables.html - */ - keyboardAction: function(e) { - - if (e == null) { // ie - keycode = event.keyCode; - ctrlKey = event.ctrlKey; - } else { // mozilla - keycode = e.which; - ctrlKey = e.ctrlKey; - } - - /*if( ctrlKey ) - { - alert('ctrl pressed'); - return; - }*/ - - //alert(keycode); - - key = String.fromCharCode(keycode).toLowerCase(); - - //if ((keycode == 39) && (ctrlKey == true)) // ctrl + arrow right - if (keycode == 34) // page down - { - myLinImage.disableKeyboardNav(); - myLinImage.moveNext(); - return false; - } - //else if ((keycode == 37) && (ctrlKey == true)) // ctrl + arrow left - else if (keycode == 33) // page up - { - myLinImage.disableKeyboardNav(); - myLinImage.movePrev(); - return false; - } - else if ((keycode == 32) && (ctrlKey == true)) // ctrl + space - { - myLinImage.slideshowStartStop(); - } - else if ((keycode == 122)) // F11 - { - if( myLinImage.fullscreenActive ) { - $('linDivSlideshowExit').show(); // hide exit button to force exit again with F11 - myLinImage.fullscreenStop(); - } else { - $('linDivSlideshowExit').hide(); - myLinImage.fullscreenStart(); - } - } - else if ((keycode == 36) && (ctrlKey == true)) // ctrl + home - //else if (keycode == 36) // home - { - myLinImage.moveFirst(); - return false; - } - else if ((keycode == 35) && (ctrlKey == true)) // ctrl + end - //else if (keycode == 35) // end - { - myLinImage.moveLast(); - return false; - } - else if( myLinImage.fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen - { - myLinImage.fullscreenStop(); - } - else if(myLinImage.fullscreenActive && key == 's') // start/stop slideshow - { - myLinImage.slideshowStartStop(); - } - else if(myLinImage.fullscreenActive && key == 'p') // display previous image - { - myLinImage.disableKeyboardNav(); - myLinImage.movePrev(); - } - else if(myLinImage.fullscreenActive && key == 'n') // display next image - { - myLinImage.disableKeyboardNav(); - myLinImage.moveNext(); - } - }, - - - // ----------------------------------------------------------------------------------- - // Preload functions - // ----------------------------------------------------------------------------------- - - /** - * preloadXml() - * Preload previous and next images. - * - * normally, loadImageXml() will call also preloadImage() - * but we also need to call preloadImage() if the Xml data is preloaded, - * but not yet the image (this may occur if we change to fullscreen, - * then, the images need to be re preloaded all - */ - preloadXml: function() { - - // preload nextthumb from left to right - if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) - { - var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; - - if(! this.preloadXmlFinished[imgId]) - { - this.loadImageXml(imgId); - } - else if(! this.finishedPreloadedImages[imgId] ) - { - this.preloadImage(imgId); - } - } - } - - // preload prevthumb from right to left - if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) - { - for(var i = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) - { - var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; - - if(! this.preloadXmlFinished[imgId]) - { - this.loadImageXml(imgId); - } - else if(! this.finishedPreloadedImages[imgId] ) - { - this.preloadImage(imgId); - } - } - } - }, - - /** - * preloadImage() - * - * will be called after getting the xml data - */ - preloadImage: function(imgId) - { - if(! this.finishedPreloadedImages[imgId] ) - { - switch(this.xmlDoc[imgId].getElementsByTagName('filetype').item(0).firstChild.data) - { - case '1': // image - /** - * set image width and height - */ - var orgWidth = this.xmlDoc[imgId].getElementsByTagName('imgwidth').item(0).firstChild.data; - var orgHeight = this.xmlDoc[imgId].getElementsByTagName('imgheight').item(0).firstChild.data; - var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); - var imgWidth = sizeArray[0]; - var imgHeight = sizeArray[1]; - - /** - * preload image - */ - this.preloadImageSrc[imgId] = new Image(); - - this.preloadImageSrc[imgId].onload=function(){ - myLinImage.preloadImageFinished(imgId); - } - this.preloadImageSrc[imgId].src = imageSrc + imgId + '&width=' + imgWidth + '&height=' + imgHeight; - - break; - case '2': // video - this.preloadImageFinished(imgId); - break; - case '0': // other - break; - } - } - }, - - preloadImageFinished: function(imgId) { - - this.finishedPreloadedImages[imgId] = true; - - if( $('thumb'+imgId) ) // maybe its not here anymore - { - new Effect.Appear('thumb'+imgId, { duration: 0.5, from: 0.5, to: 1.0 }); - } - - }, - - - // ----------------------------------------------------------------------------------- - // Slideshow functions - // ----------------------------------------------------------------------------------- - - fullscreenStart: function() - { - this.fullscreenActive = true; - - /** - * save old values to restore if slideshow ends - */ - this.fullscreenOldMaxWidth = maxImageWidth; - this.fullscreenOldMaxHeight = maxImageHeight; - - /** - * disable scrollbars - */ - this.previousBodyOverflow = document.getElementsByTagName("body")[0].style.overflow; - document.getElementsByTagName("body")[0].style.overflow='hidden'; - - /** - * start slideshow with some superduper effects - */ - Effect.Appear('linDivSlideshowOverlay', { queue: 'end', duration: 1.0, from: 0.0, to: 0.9 }); - Effect.BlindDown('linDivSlideshowControlsOuter', { queue: 'end'} ); - Element.show('linDivSlideshowImage'); - - /** - * steal the mainimage - */ - $('linDivMainimage').innerHTML = ''; - $('linDivSlideshowImage').innerHTML = '<img id="linImgMainimage" style="display: none;" class="linImgSlideshow">'; - - /** - * reload image with new position and size - */ - //this.resizeWindow(); - //linOnResizeCreateTrigger(); - linOnResizeWrapper(); - }, - fullscreenStop: function() - { - this.fullscreenActive = false; - - /** - * restore max image size - */ - maxImageWidth = this.fullscreenOldMaxWidth; - maxImageHeight = this.fullscreenOldMaxHeight; - - /** - * re-enable scrollbars - */ - document.getElementsByTagName("body")[0].style.overflow = this.previousBodyOverflow; - - /** - * delete preloaded images after stopping fullscreen - */ - this.finishedPreloadedImages = new Array(); - - /** - * end slideshow with some superduper effects - */ - Effect.Fold('linDivSlideshowControlsOuter', { queue: 'end'} ); - Effect.Fade('linDivSlideshowOverlay', { queue: 'end', duration: 0.5, from: 0.9, to: 0.0 } ); - Element.hide('linDivSlideshowImage'); - - /** - * give back the mainimage - */ - $('linDivSlideshowImage').innerHTML = ''; - $('linDivMainimage').innerHTML = '<img id="linImgMainimage" style="display: none;">'; - - /** - * reload image with old position and size - */ - this.loadImage( IdCurrent ); - }, - - slideshowStartStop: function() - { - // start Slideshow - if(! this.slideshowActive) - { - this.slideshowActive = true; - Element.setOpacity('linSsImgStart',0.7); - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - else // stop Slideshow - { - this.slideshowActive = false; - Element.setOpacity('linSsImgStart',1); - clearTimeout(this.ssCurrentTimerID); - } - }, - slideshowPlay: function() - { - if(this.nextThumbs[0] || this.ssLoop) - { - this.moveNext(); - //this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - else - { - // force stop slideshow - this.slideshowActive = true; - this.slideshowStartStop(); - } - }, - - slideshowChangeDelay: function() - { - this.ssCurrentDelay = $('linSsDelay').options[ $('linSsDelay').selectedIndex ].value * 1000; - //document.optionsForm.delay.options[document.optionsForm.delay.selectedIndex].value * 1000; - }, - slideshowChangeLoop: function() - { - if(! this.ssLoop) { - this.ssLoop = true; - Element.setOpacity('linSsImgLoop',0.7); - } else { - this.ssLoop = false; - Element.setOpacity('linSsImgLoop',1); - } - }, - slideshowChangeRandom: function() - { - if(! this.ssRandom) { - this.ssRandom = true; - Element.setOpacity('linSsImgRandom',0.7); - } else { - this.ssRandom = false; - Element.setOpacity('linSsImgRandom',1); - } - alert('This feature is currently not implemented, do we really need that?'); - }, - - - // ----------------------------------------------------------------------------------- - // Image info functions - // ----------------------------------------------------------------------------------- - - /** - * setImageInfoLink() - * - * positions the info link on bottom right of the image - * could only be done after image is not hidden anymore - * - * if this can be done without javascript, please tell me - */ - setImageInfoLink: function() - { - $('linDivInfoLink').style.top = ($('linImgMainimage').offsetTop + $('linImgMainimage').offsetHeight + 3) + 'px'; - $('linDivInfoLink').style.left = ($('linImgMainimage').offsetLeft + $('linImgMainimage').offsetWidth - 200) + 'px'; // 200: width of linDivInfoLink, value set view_img.css width = 200px; can't get width with javascript because element is hidden - Element.show('linDivInfoLink'); - }, - - /** - * DEPRECATED - * showImgInfo() - * - * fade out the image, show the meta infos, sets the color of the "Info" link to another - * - * idea: - * swap the colors of <a> and <div> tag (id 'linHrefInfoLink' and 'linDivInfoLink' - * so it is possible to set the colors in the css template (and not in javascript file) - - showImgInfo: function() - { - // make visible/invisible - if( this.imgInfoShowHide == 'hide' ) - { - this.imgInfoShowHide = 'show'; - - // set position - $('linDivMetaOuter').style.top = $('linImgMainimage').offsetTop + 'px'; - $('linDivMetaOuter').style.height = $('linImgMainimage').offsetHeight + 'px'; - - new Effect.Appear('linDivMetaOuter', { duration: 0.3 }); //, from: 0.0, to: 1.0 - new Effect.Fade('linDivMainimage', { duration: 0.3, from: 1.0, to: 0.2 }); - - $('linHrefInfoLink').style.color = this.imgInfoColorNotActive; - } - else - { - this.imgInfoShowHide = 'hide'; - - new Effect.Fade('linDivMetaOuter', { duration: 0.3 }); // , from: 1.0, to: 0.0 - new Effect.Appear('linDivMainimage', { duration: 0.3, from: 0.2, to: 1.0 }); - - $('linHrefInfoLink').style.color = this.imgInfoColorActive; - } - },*/ - hideImgInfoNow: function() - { - //Element.hide('linDivMetaOuter'); - Element.hide('linHrefPanoLink'); - Element.hide('linDivVideoLink'); - - //Element.setOpacity('linDivMainimage',1); - this.imgInfoShowHide = 'hide'; - - //$('linHrefInfoLink').style.color = this.imgInfoColorActive; - }, - - /** - * returns an array(width, height) with the correct size to fit - * in dst_w and dst_h - */ - scaleToFit: function(src_w,src_h,dst_w,dst_h,no_increase) - { - if(src_h == 0 || src_w == 0) - { - return new Array(0, 0); - } - - var img_relation = src_w / src_h; - - // Image is smaller than screen, no resize required - if ((src_w <= dst_w) && (src_h <= dst_h) && no_increase) - { - var returnarray = new Array( Math.round(src_w), Math.round(src_h) ); - } - else - { - /* - The image is way bigger than the screen, resize maintaining aspect ratio - - $src_w, $src_h: original image sizes - $dst_w, $dst_h: screen width and height - $img_relation = $src_w/$src_h; - - Either $dst_w decisive or $dst_h, usually $dst_h - */ - - var tmp_height = dst_w / img_relation; // calc the new height with screen width - if (tmp_height > dst_h) // we were wrong, it's still widther than screen -> $dst_h is decisive - { - var returnarray = new Array( Math.round(img_relation*dst_h), Math.round(dst_h) ); - } - else - { - var returnarray = new Array( Math.round(dst_w), Math.round(tmp_height) ); - } - } - - return returnarray; - }, - - - // ----------------------------------------------------------------------------------- - // Comments - // ----------------------------------------------------------------------------------- - - setComments: function() - { - $('linDivComments').innerHTML = ''; - - if(this.xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) - { - var tagcomment = this.xmlDoc[IdCurrent].getElementsByTagName('comment').item(i); - var commenttime = document.createTextNode( tagcomment.getElementsByTagName('time').item(0).firstChild.data + ' by ' ); - var commentauthor = document.createTextNode( tagcomment.getElementsByTagName('author').item(0).firstChild.data ); -// var commenttext = document.createTextNode( tagcomment.getElementsByTagName('text').item(0).firstChild.data ); - - var commenttextdiv = Builder.node('div', {id: 'linComment'+i}); - - $('linDivComments').appendChild(commenttime); - $('linDivComments').appendChild(commentauthor); - $('linDivComments').appendChild( document.createElement("hr") ); - $('linDivComments').appendChild(commenttextdiv); - $('linDivComments').appendChild( document.createElement("br") ); - $('linDivComments').appendChild( document.createElement("br") ); - - $('linComment'+i).innerHTML = tagcomment.getElementsByTagName('text').item(0).firstChild.data; - } - } - }, - - saveComment: function(t) - { - // not use 'this.' doesnt work if call from ajax success function - - myLinImage.xmlDoc[IdCurrent] = t.responseXML.documentElement; - - if(myLinImage.xmlDoc[IdCurrent].getElementsByTagName('commentadded').length > 0) - { - myLinImage.initTextareaAddComment(); - myLinGlobal.linSyslog( myLinImage.xmlDoc[IdCurrent].getElementsByTagName('commentadded').item(0).firstChild.data ); - } - - //myLinImage.loadImage(IdCurrent); - myLinImage.setComments(); - }, - - /** - * openTextarea() - * - * opens the bigger textarea to enter longer image comments - * this function is defined in view_img_static.html.php too - */ - openTextarea: function() - { - Element.show('linDivAddCommentTextarea'); - Element.hide('linDivAddCommentText'); - - $('linInputAddCommentTextarea').value = $('linInputAddCommentText').value; - }, - - initTextareaAddComment: function() - { - Element.hide('linDivAddCommentTextarea'); - Element.show('linDivAddCommentText'); - - $('linInputAddCommentTextarea').value = ''; - $('linInputAddCommentText').value = ''; - }, - - - // ----------------------------------------------------------------------------------- - // Meta functions - // ----------------------------------------------------------------------------------- - - updateLinId: function(elemId) - { - elemId.href = elemId.href.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); - } - - - // ----------------------------------------------------------------------------------- - // Common used functions - // ----------------------------------------------------------------------------------- - - /** - * resizeWindow, use this wrapper function because internet explorer triggers the resize event to fast - */ - /*resizeWindow: function () - { - clearTimeout(this.timerResize); - this.timerResize = setTimeout(linImageWrapper,250); - }*/ -} - -/** - * linImageWrapper() - * - * use this wrapper function if called from setTimeout() - * because 'this.' would not work otherwise - */ -function linOnResizeWrapper() -{ - if(myLinImage.fullscreenActive) - { - /** - * delete preloaded images after starting fullscreen and resizing window - */ - myLinImage.finishedPreloadedImages = new Array(); - - myLinGlobal.setWindowSize(); - maxImageWidth = myLinGlobal.linInnerWidth - 70; - maxImageHeight = myLinGlobal.linInnerHeight - 120; - - myLinImage.loadImage( IdCurrent ); - } - else - { - myLinImage.setImageInfoLink(); - // myLinGlobal.setMainHeight(); - } -} - -/** - * init on finished page load - */ -function initLinImage() -{ - $('linDivMainimage').style.height = startImgHeight + 'px'; // initial sets correct height at begin and not after the image is loaded - myLinImage = new LinImage(); - - /** - * doing something very important! - * rebuild the browsers histroy back, forware and reload functions - * if we have a #idCurrent=xyz in the url use this as the id - */ - if( document.location.hash.indexOf('idCurrent') != -1 ) - { - IdCurrent = document.location.hash.substr(11); - } - - /** - * and again something important - * rebuild the browsers histroy back, forware and reload functions - * periodically check if the url has changed - * if so, load the new id - */ - myLinImage.curLocationHash = location.hash; - window.setInterval(function() - { - if (myLinImage.curLocationHash != location.hash) - { - if( document.location.hash.substr(11) != '' ) - { - IdCurrent = document.location.hash.substr(11); - - } - else // location.hash contains no '#idCurrent', we're back on start - { - IdCurrent = startIdCurrent; - } - - myLinImage.loadImage(IdCurrent); - } - }, 1000); - - - /** - * append the slideshow divs to the body - * we need to append to body to be sure to get the real fullscreen - * even if we are locked in another div - */ - var objBody = document.getElementsByTagName("body").item(0); - objBody.appendChild( Builder.node('div', {id: "linDivSlideshowOverlay", style: "display: none;"}) ); - objBody.appendChild( Builder.node('div', {id: "linDivSlideshowImage", style: "display: none;"}) ); - objBody.appendChild( Builder.node('div', {id: "linDivSlideshowControlsOuter", style: "display: none;"}) ); - - $('linDivSlideshowControlsOuter').innerHTML = linSlideshowHtml; - - - // automatically start slideshow if requested (coming from thumbview) - if( document.location.search.indexOf('slideshow') != -1 ) - { - myLinImage.fullscreenStart(); - } - else - { - myLinImage.loadImage(IdCurrent); - // setMainHeight(); // defined in LinGlobal.js - // window.onresize = onWindowResize; - // Event.observe(window, 'resize', onWindowResize, false); - Event.observe(window, 'resize', linOnResizeCreateTrigger, false); - } -} - -Event.observe(window, 'load', initLinImage, false); - Deleted: trunk/linpha2/lib/js/LinThumbnails_old.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails_old.js 2008-04-27 09:34:07 UTC (rev 4929) +++ trunk/linpha2/lib/js/LinThumbnails_old.js 2008-04-27 09:35:57 UTC (rev 4930) @@ -1,426 +0,0 @@ -/** - * javascript thumbnail viewer - * - * check performance: - var start = new Date().getTime(); - alert( (new Date().getTime() - start) + 'ms' ); - * - */ - -/** - * class and global definitions - */ -var LinThumbnails = Class.create(); -var myLinThumbnails; - -LinThumbnails.prototype = -{ - /** - * initialize() - * Constructor runs on completion of the DOM loading. - */ - initialize: function() - { - this.currentPage = linStartupPage - this.nrPages = 0; - this.timerResize; - - /** - * page numbers - */ - this.pnLeft = 3; - this.pnRight = 3; - this.pnMiddleLeft = 2; - this.pnMiddleRight = 4; - this.pnConstant = this.pnLeft + this.pnRight + this.pnMiddleLeft + this.pnMiddleRight + 1; - this.spaceMin = 2; // minimum space before replacing numbers with dots - }, - - displayThumbs: function() - { - /** - * set correct main height only if linPhotosPerPage == auto - * needs to be in linDisplayThumbs! - */ - myLinGlobal.setMainHeight(); // defined in LinGlobal.js - - /** - * calculate nr of photos per page (from select form) - */ - switch( linPhotosPerPage ) - { - case 'auto': - var nr_cols = Math.floor( (document.getElementById('linDivMain')['offsetWidth']-linMainSpacerWidth) / (linTnSize + linImgSpacerWidth) ); - var nr_rows = Math.floor( (document.getElementById('linDivMain')['offsetHeight']-linMainSpacerHeight) / (linTnSize + linImgSpacerHeight + (linImgDivSpacerHeight*linNrTextLines) ) ); - var max_photos_per_page = nr_rows * nr_cols; - break; - case 'all': - var nr_cols = Math.floor( (document.getElementById('linDivMain')['offsetWidth']-linMainSpacerWidth) / (linTnSize + linImgSpacerWidth) ); - var max_photos_per_page = linTotPhotos; - var nr_rows = Math.ceil(max_photos_per_page / nr_cols); - break; - default: - /** - * ceil max_photos_per_page to complet the row! - */ - var nr_cols = Math.floor( (document.getElementById('linDivMain')['offsetWidth']-linMainSpacerWidth-5) / (linTnSize + linImgSpacerWidth) ); /* -5 -> scrollbars */ - var nr_rows = Math.ceil( linPhotosPerPage / nr_cols); - var max_photos_per_page = nr_rows * nr_cols; - break; - } - - /** - * at least on image per page - */ - (nr_cols == 0) ? nr_cols = 1 : ''; - (nr_rows == 0) ? nr_rows = 1 : ''; - (max_photos_per_page == 0) ? max_photos_per_page = nr_rows * nr_cols : ''; - - - /** - * prepare page numbers - */ - this.nrPages = Math.ceil( linTotPhotos / max_photos_per_page ); - - - /** - * check if our current page still exists (maybe we changed the linTnSize and now there arent so much pages anymore) - * (but not if this.currentPage == 1 and this.nrPages == 0) - */ - if(this.currentPage > this.nrPages && this.currentPage != 1) - { - this.currentPage = this.nrPages; - } - - /** - * write page numbers - */ - this.writePageNumbers(); - - /** - * write divs - */ - var img_nr = 1; - var startup_img_nr = (this.currentPage - 1)*max_photos_per_page; - - $('linDivMain').innerHTML=''; - divhtmltext = ''; - - if(linViewMode == 'thumbdetail') { - var style1text = ''; - var style2text = ' linDivImgDetail'; - var style3text = 'class="linDivTextDetail"'; - } else { - var style1text = ' style="width: ' + linTnSize + '"'; - var style2text = ''; - var style3text = 'class="linDivText"'; - } - - /** - * Prototype modfies the core Array object and you shouldn't use any for - * .. in -loops, instead do like this: - * [...] - * for (var i=0; $t = $aTOC[i]; i++) { - * $temp += 't=' + $t + '<br />'; - * } - * [...] - * - * for( var i=0; index = linImgIds[i] ; i++ ) - * but does not work because the index doesnt starts from 0 - */ - for (index in linImgIds) - { - if(index >= startup_img_nr && img_nr <= max_photos_per_page) - { - if( (img_nr-1) % nr_cols == 0) { - //var styletext = ' style="clear:left;"'; - divhtmltext += '<div style="clear: left;"></div>'; - } - - divhtmltext += - '<div id="linDivThumb' + index + '" class="linDivThumb"' + style1text + '>' + - linImgIds[index]['before'] + '<div class="linDivImg' + style2text + '">' + - '<a href="' + linUrlBase + '&linId=' + linImgIds[index]['id'] + '">' + - '<img src="' + LINPHA_CLIENT + '/get_thumb.php?linId=' + linImgIds[index]['id'] + '"' + - ' height="' + linTnSize + '" width="' + linTnSize + '" ' + - ' alt="' + linImgIds[index]['title'] + '" title="' + linImgIds[index]['title'] + '"' + - ' class="linImgThumb" />' + - '</a></div><div ' + style3text + '>' + linImgIds[index]['after'] + '</div></div>'; - - /** - * flush buffer of divhtmltext on end of line - * with this buffer, we're 3-4 as fast as without !! - * see also http://www.softwaresecretweapons.com/jspwiki/Wiki.jsp?page=JavascriptStringConcatenation !! - * - * update: using the DOM functions with createElement etc. we would be at least 2 times slower!! - * - * this is the way to go: - var i, j, el, idx, html; - idx = 0; - html = []; - html[idx++] = "<table>"; - for (i = 0; i < 1000; i++) { - html[idx++] = "<tr>"; - for (j = 0; j < 5; j++) { - html[idx++] = "<td></td>"; - } - html[idx++] = "</tr>"; - } - html[idx++] = "</table>"; - el = document.createElement("div"); - document.body.appendChild(el); - el.innerHTML = html.join(""); - */ - if( (img_nr-1) % nr_cols == 0) - { - $('linDivMain').innerHTML += divhtmltext; - divhtmltext = ''; - } - - img_nr++; - } - } - - $('linDivMain').innerHTML += divhtmltext; - }, - - writePageNumbers: function() - { - /** - * create an array with page numbers - */ - pn_nrs = new Array(); - var nr_pages_shown = 0; - var start_gap = 0; - var end_gap = 0; - - /** - * get all pages which should be shown - */ - for(var i = 1; i <= this.nrPages; i++) - { - if( this.pnConstant >= this.nrPages // show all pages if we dont have much - || i <= this.pnLeft // left side - || (i > ( this.nrPages - this.pnRight ) ) // right side - || (i >= ( this.currentPage - this.pnMiddleLeft ) && i <= this.currentPage) // middle left - || (i <= ( this.currentPage + this.pnMiddleRight ) && i >= this.currentPage) // middle right - ) - { - pn_nrs[i] = 1; - nr_pages_shown++; - - if(start_gap != 0 && end_gap == 0) // make sure this is done only with the first gap - { - end_gap = i-1; // used later to fill up this gap if needed - } - } - else - { - pn_nrs[i] = 0; - - if(start_gap == 0) // make sure this is done only with the first gap - { - start_gap = i; // used later to fill up this gap if needed - } - } - } - - /** - * add this.currentPage to array, and increment nr_pages_shown if needed - */ - if(pn_nrs[this.currentPage] == 0) - { - nr_pages_shown++; - } - pn_nrs[this.currentPage] = 2; - - /** - * if with have a lot of pages, fill up the array so that we have all the time the same number of page numbers - */ - if( this.pnConstant > nr_pages_shown && this.nrPages > this.pnConstant) - { - /** - * fill up the gap (there is only _one_ gap if we have to fill up the array) - * stop if we filled up enough the needed value, - * or stop if we are reaching the this.spaceMin (to prevent: 1 2 3 4 5 6 ... 8 9 10 11) - */ - beginn_with_startgap = 1; - while( this.pnConstant > nr_pages_shown && (end_gap - start_gap) >= this.spaceMin) - { - if(beginn_with_startgap == 1) - { - pn_nrs[start_gap] = 1; - nr_pages_shown++; - start_gap++; - - beginn_with_startgap = 0; - } - else //beginn_with_startgap = 0 - { - pn_nrs[end_gap] = 1; - nr_pages_shown++; - end_gap--; - - beginn_with_startgap = 1; - } - } - } - - /** - * search for small gaps (this.spaceMin) and fill up - */ - var counter = 0; - for(var i = 1; i <= this.nrPages; i++) - { - if(pn_nrs[i] == 0) - { - counter++; - } - else - { - if(counter < this.spaceMin) - { - /** - * fill up gap - */ - for(var ii = (i-1); ii >= (i-counter); ii--) - { - pn_nrs[ii] = 1; - } - } - - /** - * reset counter - */ - counter = 0; - } - } - - - - /** - * write starting '<<' and '<' - */ - if(this.currentPage == 1) - { - $('linDivPagenrLeft').innerHTML = "<< <"; - } - else - { - $('linDivPagenrLeft').innerHTML = ""; - - $('linDivPagenrLeft').appendChild( Builder.node( 'a', {href: 'javascript:myLinThumbnails.gotoPage(1)'}, "<<" ) ); - $('linDivPagenrLeft').appendChild( document.createTextNode(" ") ); - $('linDivPagenrLeft').appendChild( Builder.node( 'a', {href: 'javascript:myLinThumbnails.gotoPage( (myLinThumbnails.currentPage)-1 ) '}, "<" ) ); - } - - /** - * write page numbers - */ - $('linDivPagenrMiddle').innerHTML=''; - - for(var i = 1; i <= this.nrPages; i++) - { - if(pn_nrs[i] != 0) - { - start_gap = 0; - - if(pn_nrs[i] == 2) - { - var myText = document.createTextNode(i); - } - else if(pn_nrs[i] == 1) - { - var myText = document.createElement('a'); - - var myAttribute=document.createAttribute("href"); - myAttribute.nodeValue = 'javascript:myLinThumbnails.gotoPage('+i+')'; - myText.setAttributeNode(myAttribute); - - var myText2 = document.createTextNode(i); - myText.appendChild(myText2); - } - $('linDivPagenrMiddle').appendChild(myText); - - var myText = document.createTextNode(' '); - $('linDivPagenrMiddle').appendChild(myText); - } - else - { - if(start_gap == 0) - { - start_gap = 1; - - var myText = document.createTextNode(' ... '); - $('linDivPagenrMiddle').appendChild(myText); - } - } - } - - /** - * write ending '>' and '>>' - */ - if(this.currentPage == this.nrPages || this.nrPages == 0) // need check this.nrPages != 0 because we don't need links if this.nrPages == 0! - { - $('linDivPagenrRight').innerHTML = "> >>"; - } - else - { - $('linDivPagenrRight').innerHTML = ""; - - $('linDivPagenrRight').appendChild( Builder.node( 'a', {href: 'javascript:myLinThumbnails.gotoPage( (myLinThumbnails.currentPage)+1 )'}, ">" ) ); - $('linDivPagenrRight').appendChild( document.createTextNode(" ") ); - $('linDivPagenrRight').appendChild( Builder.node( 'a', {href: 'javascript:myLinThumbnails.gotoPage( myLinThumbnails.nrPages ) '}, ">>" ) ); - } - }, - - gotoPage: function(nr) - { - this.currentPage = nr; - this.displayThumbs(); - }, - - setTnSize: function( tn_size_local ) - { - linTnSize = tn_size_local; - this.displayThumbs(); - }, - - setNrImages: function( photos_per_page_local) - { - linPhotosPerPage = photos_per_page_local; - this.displayThumbs(); - }, - - /** - * loadSlideshow() - * - * to start the slideshow, first open imageview with first image, and then start slideshow - */ - loadSlideshow: function() - { - location.href = linUrlBase + '&linId=' + linImgIds[0]['id'] + '&slideshow'; - }, -} - - - -/** - * initLinThumbnails() - * - * create the object and initially display the thumbnails - */ -function initLinThumbnails() -{ - myLinThumbnails = new LinThumbnails(); - - linEnableOnResize(); - myLinThumbnails.displayThumbs(); -} - -function linOnResizeWrapper() -{ - myLinThumbnails.displayThumbs(); -} - -Event.observe(window, 'load', initLinThumbnails, false); Deleted: trunk/linpha2/lib/js/builder.js =================================================================== --- trunk/linpha2/lib/js/builder.js 2008-04-27 09:34:07 UTC (rev 4929) +++ trunk/linpha2/lib/js/builder.js 2008-04-27 09:35:57 UTC (rev 4930) @@ -1,136 +0,0 @@ -// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -var Builder = { - NODEMAP: { - AREA: 'map', - CAPTION: 'table', - COL: 'table', - COLGROUP: 'table', - LEGEND: 'fieldset', - OPTGROUP: 'select', - OPTION: 'select', - PARAM: 'object', - TBODY: 'table', - TD: 'table', - TFOOT: 'table', - TH: 'table', - THEAD: 'table', - TR: 'table' - }, - // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, - // due to a Firefox bug - node: function(elementName) { - elementName = elementName.toUpperCase(); - - // try innerHTML approach - var parentTag = this.NODEMAP[elementName] || 'div'; - var parentElement = document.createElement(parentTag); - try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 - parentElement.innerHTML = "<" + elementName + "></" + elementName + ">"; - } catch(e) {} - var element = parentElement.firstChild || null; - - // see if browser added wrapping tags - if(element && (element.tagName.toUpperCase() != elementName)) - element = element.getElementsByTagName(elementName)[0]; - - // fallback to createElement approach - if(!element) element = document.createElement(elementName); - - // abort if nothing could be created - if(!element) return; - - // attributes (or text) - if(arguments[1]) - if(this._isStringOrNumber(arguments[1]) || - (arguments[1] instanceof Array) || - arguments[1].tagName) { - this._children(element, arguments[1]); - } else { - var attrs = this._attributes(arguments[1]); - if(attrs.length) { - try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 - parentElement.innerHTML = "<" +elementName + " " + - ... [truncated message content] |
From: <fan...@us...> - 2008-04-27 09:34:25
|
Revision: 4929 http://linpha.svn.sourceforge.net/linpha/?rev=4929&view=rev Author: fangehrn Date: 2008-04-27 02:34:07 -0700 (Sun, 27 Apr 2008) Log Message: ----------- Added Paths: ----------- trunk/linpha2/lib/js/old/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-26 19:28:48
|
Revision: 4928 http://linpha.svn.sourceforge.net/linpha/?rev=4928&view=rev Author: fangehrn Date: 2008-04-26 12:28:44 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/linpha2/ChangeLog Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-04-26 19:28:25 UTC (rev 4927) +++ trunk/linpha2/ChangeLog 2008-04-26 19:28:44 UTC (rev 4928) @@ -1,4 +1,10 @@ +2008-04-26 flo + * Search bug fixes + * Menu bug fixes + * Maps plugin bug fixes + - set the thumbnail width to 250 (same width as the marker background) + 2008-04-08 flo * RSS plugin - implemented PicLens compatible rss feed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-26 19:28:29
|
Revision: 4927 http://linpha.svn.sourceforge.net/linpha/?rev=4927&view=rev Author: fangehrn Date: 2008-04-26 12:28:25 -0700 (Sat, 26 Apr 2008) Log Message: ----------- 2008-04-26 flo * Search bug fixes * Menu bug fixes * Maps plugin bug fixes - set the thumbnail width to 250 (same width as the marker background) Modified Paths: -------------- trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/global.head.php trunk/linpha2/templates/default/maps.head.php trunk/linpha2/templates/default/maps.html.php trunk/linpha2/templates/default/menu.html.php trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/static.login.html.php trunk/linpha2/templates/default/viewer.head.php Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/basket.html.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -1,3 +1,5 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + <?php echo $linTpl->divRoundCorners('top','main'); ?> <div id="linDivNavigation"> <?php if(isset($_SESSION['ref_url_full'])) { ?> Modified: trunk/linpha2/templates/default/global.head.php =================================================================== --- trunk/linpha2/templates/default/global.head.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/global.head.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -73,10 +73,10 @@ <?php if (linUseAjax()) { ?> <!-- Load the YUI Loader script: --> <!--<script src="http://yui.yahooapis.com/2.5.0/build/yuiloader/yuiloader-beta-min.js"></script> --> -<script src="http://yui.yahooapis.com/2.5.0/build/yuiloader/yuiloader-beta.js"></script> +<script src="http://yui.yahooapis.com/2.5.1/build/yuiloader/yuiloader-beta-debug.js"></script> <script type="text/javascript" language="Javascript"> var linYUILoader = new YAHOO.util.YUILoader({ - require: ["logger"/*, "menu"*/], + require: ["logger"], // , "menu" loadOptional: true, /*filter: { 'searchExp': "-min\\.js", Modified: trunk/linpha2/templates/default/maps.head.php =================================================================== --- trunk/linpha2/templates/default/maps.head.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/maps.head.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -1,4 +1,6 @@ +<?php /*<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/prototype.js"></script> <script type="text/javascript" language="javascript" src="<?php echo LINPHA_CLIENT; ?>/lib/js/scriptaculous.js?load=effects,builder,dragdrop"></script> +*/ ?> <script language="JavaScript" type="text/javascript"> var imageSrc = '<?php echo LINPHA_CLIENT.'/get_image.php?linId='; ?>'; var thumbSrc = '<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='; ?>'; @@ -10,13 +12,23 @@ var linMapsDefaultMarkerZoom = <?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_defaultMarkerZoom']; ?>; var linMapsMarkerThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_markerThumbSize']; ?>; </script> +<script type="text/javascript" language="javascript" src="<?php echo $linTpl->themeFile('DefsThumbView.js'); ?>"></script> <?php if( $GLOBALS['linpha']->sql->config->value['plugins_maps_mapType'] == '0' ) //0=google { - ?> - <script type="text/javascript" src="http://www.google.com/jsapi?key=<?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_google_key']; ?>"></script> - <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/class.googlemaps.js"></script> + ?> + <script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_google_key']; ?>" type="text/javascript"></script> + <?php /* <script type="text/javascript" src="http://www.google.com/jsapi?key=<?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_google_key']; ?>"></script> */ ?> + <?php /*<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/class.googlemaps.js"></script>*/ ?> + <script type="text/javascript" language="JavaScript"> + linYUILoader.addModule({ + name: 'linMapsClassJS', + type: 'js', + fullpath: LINPHA_CLIENT + '/lib/plugins/maps/class.googlemaps.YUI.js', + varName: 'linMapsClassJS' + }); + </script> <?php /** @@ -42,5 +54,20 @@ <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/class.xyz.js"></script> <?php } + ?> -<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/LinMaps.js"></script> + + +<?php /*<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/LinMaps.js"></script> +*/ ?> +<script language="JavaScript" type="text/javascript"> +linYUILoader.addModule({ + name: "linMapsJS", + type: "js", + fullpath: LINPHA_CLIENT + "/lib/plugins/maps/LinMapsYUI.js", + varName: "linMapsJS", + requires: ["LinYUIPageJS", "linMapsClassJS", "dragdrop", "container"] +}); +linYUILoader.require("linMapsJS"); +linYUILoader.insert(); +</script> Modified: trunk/linpha2/templates/default/maps.html.php =================================================================== --- trunk/linpha2/templates/default/maps.html.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/maps.html.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -1,9 +1,8 @@ +<div id="linDivTop"></div> + <?php echo $linTpl->divRoundCorners('top','main'); ?> <div id="linDivMain"> - -<div id="linDivMapTop"></div> - <div id="linDivMapMain"> <div id="linDivMapNav"></div> <div id="linDivMapResizeBorder" ondblClick="myLinMaps.toggleNav();"></div> @@ -13,9 +12,9 @@ <div id="linDivMapBottom"> <form action="" style="margin: 0;"> <input type="text" id="linInputAddress" size="30"> - <input type="button" onclick="myLinMapObject.geocodeAddress( $('linInputAddress').value )" value="<?php + <input type="button" onclick="myLinMapObject.geocodeAddress()" value="<?php echo i18n("Geocode"); ?>"> - <a href="javascript:myLinGlobal.createPopup('linDivPopupHelp');"><img style="border: 0;" src="<?php + <a href="javascript:myLinMaps.helpPopup.show();"><img style="border: 0;" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_random.gif" /></a> <a href="javascript:myLinMaps.loadAlbums();"><?php echo i18n("Albums"); ?></a> @@ -25,106 +24,121 @@ </div> <?php echo $linTpl->divRoundCorners('bottom','main'); ?> -<div id="linDivPopupHelp" style="display: none"> - <div> - <b><?php echo i18n("Legend:"); ?></b><br /><br /> - <img src="http://maps.google.com/mapfiles/ms/micons/red-dot.png" style="vertical-align:middle" alt="red" /> - <?php echo i18n("Current Marker"); ?><br /><br /> - <img src="http://maps.google.com/mapfiles/ms/micons/purple-dot.png" style="vertical-align:middle" alt="blue" /> - <?php echo i18n("Location Marker"); ?><br /><br /> - <img src="http://maps.google.com/mapfiles/ms/micons/blue-dot.png" style="vertical-align:middle" alt="purple" /> - <?php echo i18n("Location Marker With Assigned Albums"); ?><br /><br /> - <img src="http://maps.google.com/mapfiles/ms/micons/green-dot.png" style="vertical-align:middle" alt="green" /> - <?php echo i18n("Location Marker With Assigned Images (GPS)"); ?><br /><br /> - <img src="http://maps.google.com/mapfiles/ms/micons/yellow-dot.png" style="vertical-align:middle" alt="yellow" /> - <?php echo i18n("Images"); ?><br /><br /> - </div> - - <?php - if( $GLOBALS['linpha']->sql->checkPermission('plugins_maps_setMarkers') ) - { - ?> - <br /> - <div> - <b>Create marker:</b><br /> - 1. Enter address or just press "Geocode"<br /> - 2. Drag the marker to fine adjust<br /> - 3. Check marker name<br /> - 4. Press "Save"<br /> - <br /> - <b>Assign albums:</b><br /> - 1. Click on a marker<br /> - 2. Press "Assign album"<br /> - 3. Choose album and press "Save"<br /> - 4. Repeat for multiple albums<br /> - <br /> - <b>Assign images to an album marker:</b><br /> - This is done automatically. But it's required that your images have the - GPS information stored inside. You will need a GPS Data Logger to do this - automatically. It is also possible do it manually. Robogeo is a tool, but - it is not free.<br /> - </div> - - <div> - <b>Not assigned images:</b><br /> - albums/album1 (22 images)<br /> - </div> - <?php - } - ?> -</div> -<div id="linDivPopupAlbums" style="display: none;"> - <br /> - <?php echo i18n("Please select the album to show in Google Maps:"); ?> - <div id="linDivMapAlbums"></div> -</div> +<div id="linDivPanelContainer" class="yui-skin-sam"> -<div id="linDivEditMarker" style="display: none;"> - <fieldset style="width: 350px;"><legend><?php echo i18n("Create New Marker"); ?></legend> - <label for="linInputMarkerName" class="linInputEditMarker"><?php echo i18n("Marker Name"); ?>: - </label><input type="text" id="linInputMarkerName" name="linInputMarkerName" size="31" /><br /> - <label for="linInputLat" class="linInputEditMarker"><?php echo i18n("Lat/Lon/Zoom"); ?>: - </label><input type="text" id="linInputLat" name="linInputLat" size="10" /> - <input type="text" id="linInputLon" name="linInputLon" size="10" /> - <input type="text" id="linInputZoom" name="linInputZoom" size="1" /> + <div id="linDivPopupHelp" style="display: none"> + <div class="hd"><?php echo i18n("Help"); ?></div> + <div class="bd"> + + <div> + <b><?php echo i18n("Legend:"); ?></b><br /><br /> + <img src="http://maps.google.com/mapfiles/ms/micons/red-dot.png" style="vertical-align:middle" alt="red" /> + <?php echo i18n("Current Marker"); ?><br /><br /> + <img src="http://maps.google.com/mapfiles/ms/micons/purple-dot.png" style="vertical-align:middle" alt="blue" /> + <?php echo i18n("Location Marker"); ?><br /><br /> + <img src="http://maps.google.com/mapfiles/ms/micons/blue-dot.png" style="vertical-align:middle" alt="purple" /> + <?php echo i18n("Location Marker With Assigned Albums"); ?><br /><br /> + <img src="http://maps.google.com/mapfiles/ms/micons/green-dot.png" style="vertical-align:middle" alt="green" /> + <?php echo i18n("Location Marker With Assigned Images (GPS)"); ?><br /><br /> + <img src="http://maps.google.com/mapfiles/ms/micons/yellow-dot.png" style="vertical-align:middle" alt="yellow" /> + <?php echo i18n("Images"); ?><br /><br /> + </div> + + <?php + if( $GLOBALS['linpha']->sql->checkPermission('plugins_maps_setMarkers') ) + { + ?> + <div style="height: 200px; overflow: auto"> + <br /> + <b>Create marker:</b><br /> + 1. Enter address or just press "Geocode"<br /> + 2. Drag the marker to fine adjust<br /> + 3. Check marker name<br /> + 4. Press "Save"<br /> + <br /> + <b>Assign albums:</b><br /> + 1. Click on a marker<br /> + 2. Press "Assign album"<br /> + 3. Choose album and press "Save"<br /> + 4. Repeat for multiple albums<br /> + <br /> + <b>Assign images to an album marker:</b><br /> + This is done automatically. But it's required that your images have the + GPS information stored inside. You will need a GPS Data Logger to do this + automatically. It is also possible do it manually. Robogeo is a tool for that, but + it is not free.<br /> + + <br /> + <b>Not assigned images:</b><br /> + albums/album1 (22 images)<br /> + </div> + <?php + } + ?> + </div> + </div> - <br /><br /> - <input type="submit" value="<?php echo i18n("Save"); ?>" /> - <input type="button" value="<?php echo i18n("Cancel"); ?>" onclick="myLinMaps.removeEditMarker()"/> - <input type="hidden" name="cmd" value="saveMarker" /> - - </fieldset> + <div id="linDivPopupAlbums" style="display: none;"> + <div class="hd"><?php echo i18n("Albums"); ?></div> + <div class="bd"> + <?php echo i18n("Please select the album to show in Google Maps:"); ?> + <br /> + <div id="linDivMapAlbums"></div> + </div> + <div class="ft"></div> + </div> + + <div id="linDivEditMarker" style="display: none"> + <fieldset style="width: 350px;"><legend><?php echo i18n("Create New Marker"); ?></legend> + <label for="linInputMarkerName" class="linInputEditMarker"><?php echo i18n("Marker Name"); ?>: + </label><input type="text" id="linInputMarkerName" name="linInputMarkerName" size="31" /><br /> + <label for="linInputLat" class="linInputEditMarker"><?php echo i18n("Lat/Lon/Zoom"); ?>: + </label><input type="text" id="linInputLat" name="linInputLat" size="10" /> + <input type="text" id="linInputLon" name="linInputLon" size="10" /> + <input type="text" id="linInputZoom" name="linInputZoom" size="1" /> + + <br /><br /> + <input type="submit" value="<?php echo i18n("Save"); ?>" /> + <input type="button" value="<?php echo i18n("Cancel"); ?>" onclick="myLinMaps.removeEditMarker()"/> + <input type="hidden" name="cmd" value="saveMarker" /> + + </fieldset> + </div> </div> <div id="linDivLoadingOuter" style="display: none;" class="linBackground"> - <?php echo $linTpl->divRoundCorners('top','main'); ?> <div id="linDivLoading"> <img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/loading.gif" /> </div> - <?php echo $linTpl->divRoundCorners('bottom','main'); ?> </div> + <script language="JavaScript" type="text/javascript"> function linGetMarkerHtml(markerNode) { - var htmlStr = '<b>' + markerNode.name + '</b><br />'; + htmlStr = []; + idx = 0; + + htmlStr[idx++] = '<b>' + markerNode.name + '</b><br />'; if( markerNode.type == 'images' ) { - htmlStr += '<img src="'+imageSrc+markerNode.id+'" width="' + - linMapsMarkerThumbSize+'" >' + markerNode.text; + htmlStr[idx++] = '<a href="javascript:myLinMapObject.openImage('; + htmlStr[idx++] = (markerNode.index+1); + htmlStr[idx++] = ')"><img border="0" src="'+ imageSrc+markerNode.id; + htmlStr[idx++] = '" width="'+linMapsMarkerThumbSize+'" height="'+(linMapsMarkerThumbSize/markerNode.ratio); + htmlStr[idx++] = '"></a>' + markerNode.text; $('thumb_'+markerNode.id).focus(); } else { - if( markerNode.albId != 0 ) { - htmlStr += '<?php echo i18n("Album"); ?>: ' + markerNode.path + '<br />'; + htmlStr[idx++] = '<?php echo i18n("Album"); ?>: ' + markerNode.path + '<br />'; if( markerNode.type == 'albumWithImg') { - htmlStr += '<a href="javascript:myLinMaps.loadImages('+ markerNode.albId +')"><?php + htmlStr[idx++] = '<a href="javascript:myLinMaps.loadImages('+ markerNode.albId +')"><?php echo i18n("Open Images"); ?></a><br />'; } } @@ -133,22 +147,22 @@ if( $GLOBALS['linpha']->sql->checkPermission('plugins_maps_setMarkers') ) { ?> - htmlStr += '<br /><fieldset style="width: 350px;"><legend><?php + htmlStr[idx++] = '<br /><fieldset style="width: 350px;"><legend><?php echo i18n("Edit Marker"); ?></legend><form><select name="linInputAlbum" style="width: 250px;"><?php linBuildAlbumSelect($with_all_albs_entry=false,$with_linebreaks=false); ?></select><br />'; if(markerNode.albId != 0) { - htmlStr += '<input type="button" value="<?php echo i18n("Change Assigned Album"); + htmlStr[idx++] = '<input type="button" value="<?php echo i18n("Change Assigned Album"); ?>" onclick="myLinMaps.assignAlbumChange(' + markerNode.id + ',this.form.linInputAlbum.value)">' + '<input type="button" value="<?php echo i18n("Delete"); ?>" onclick="myLinMaps.assignAlbumDelete(' + markerNode.id + ',0)"><br /><br />'; } else { - htmlStr += '<input type="button" value="<?php echo i18n("Assign Album"); + htmlStr[idx++] = '<input type="button" value="<?php echo i18n("Assign Album"); ?>" onclick="myLinMaps.assignAlbum(' + markerNode.id + ', this.form.linInputAlbum.value)">'; } - htmlStr += '<input type="button" value="<?php echo i18n("Delete Marker"); ?>" onclick="if(confirm(\'<?php + htmlStr[idx++] = '<input type="button" value="<?php echo i18n("Delete Marker"); ?>" onclick="if(confirm(\'<?php echo sprintf(LIN_STR_CONFIRMDELETE, i18n("this marker")); ?>\')){myLinMaps.deleteMarker(' + markerNode.id + ');}"></form></fieldset>'; <?php @@ -156,7 +170,7 @@ ?> } - return htmlStr; + return htmlStr.join(""); } </script> Modified: trunk/linpha2/templates/default/menu.html.php =================================================================== --- trunk/linpha2/templates/default/menu.html.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/menu.html.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -76,22 +76,22 @@ if ($GLOBALS['linpha']->sql->isLoggedIn()) { $html_login .= i18n("Welcome").' '.$_SESSION['user_name'].' ('.$_SESSION['user_displayname'].')<br />' . - '<input type="hidden" name="cmd" value="logout" />' . + '<input type="hidden" name="linCmd" value="logout" />' . '<input type="submit" name="submit" class="linButton" value="'.i18n("Logout").'" />'; } else { $html_login .= '<br /><label for="linFormUsername" style="display: block; float: left; width: 80px;">' . - i18n("Username").': </label><input style="width: 105px;" class="linForms" type="text" name="username" value="" id="linFormUsername" />' . + i18n("Username").': </label><input style="width: 105px;" class="linForms" type="text" name="linUsername" value="" id="linFormUsername" />' . '<br /><label for="linFormPassword" style="display: block; float: left; width: 80px;">' . - i18n("Password").': </label><input style="width: 105px;" class="linForms" type="password" name="password" value="" id="linFormPassword" />' . + i18n("Password").': </label><input style="width: 105px;" class="linForms" type="password" name="linPassword" value="" id="linFormPassword" />' . '<br /><br />'; if ($GLOBALS['linpha']->sql->config->value['sys_session_autologin']) { $html_login .= '<label for="linFormCheckboxRemember">' . - '<input type="checkbox" name="rememberme" value="true" id="linFormCheckboxRemember" />' . + '<input type="checkbox" name="linRememberme" value="true" id="linFormCheckboxRemember" />' . i18n("Remember Me").'</label>'; } - $html_login .= '<input type="hidden" name="cmd" value="login" />' . + $html_login .= '<input type="hidden" name="linCmd" value="login" />' . '<input type="submit" name="submit" class="linButton" value="'.i18n("Login").'" /><br /><br />' . '<div style="font-size: smaller; border: 0px;">'.i18n("You must have cookies enabled to log in.").'</div>'; } @@ -115,8 +115,10 @@ echo '['; reset($linTpl->menuFinal); - list($key, $menuEntry) = each($linTpl->menuFinal); $prevIsIcon = false; + + /*list($key, $menuEntry) = each($linTpl->menuFinal); + if (isset( $menu[$key] )) { echo $menu[$key]; } elseif (isset($linTpl->menuJSCook[$key])) { @@ -125,16 +127,21 @@ echo '["'.linEscapeQuotes($menu[$key.'_img']).'", " ", "'.linEscapeQuotes($menuEntry['link']).'", null, null]'; $prevIsIcon = true; } else { - echo '[null, "'.linEscapeQuotes($menuEntry['name']).'", "'.linEscapeQuotes($menuEntry['link']).'", null, null]'; + echo '[null, "'.linEscapeQuotes($menuEntry['name']).'", "'.linEscapeQuotes(linConvertAmp($menuEntry['link'])).'", null, null]'; } + */ + for($i=1; list($key, $menuEntry) = each($linTpl->menuFinal); $i++) { - // separate icons - if (isset( $menu[$key.'_img'] ) && $prevIsIcon) { - echo ','."\n"; - } else { - echo ',"_cmSplit",'."\n"; + if ($i!=1) + { + // separate icons + if (isset( $menu[$key.'_img'] ) && $prevIsIcon) { + echo ','."\n"; + } else { + echo ',"_cmSplit",'."\n"; + } } $prevIsIcon = false; Modified: trunk/linpha2/templates/default/search.html.php =================================================================== --- trunk/linpha2/templates/default/search.html.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/search.html.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -72,7 +72,7 @@ * get text fields */ $query = $GLOBALS['linpha']->db->Execute("SELECT id, name FROM ".LIN_PREFIX."meta_fields WHERE field_type = '1' AND (flags = '5' OR flags = '7')"); - while($data = $query->FetchRow()) + while ($data = $query->FetchRow()) { echo '<input type="checkbox" id="b_'.$data['id'].'" name="button[meta]['.$data['id'].']" value="1"'.(isset($_REQUEST['button']['meta'][$data['id']]) ? ' checked' : '').'>'; echo '<label for="b_'.$data['id'].'">'.$data['name'].'</label><br />'; @@ -83,21 +83,20 @@ /** * Exif/Iptc/Xmp Informations */ - $array = Array('exif','iptc','xmp'); - foreach($array AS $meta_type) + $array = array('exif','iptc','xmp'); + foreach ($array as $meta_type) { - if($GLOBALS['linpha']->sql->config->value['sys_image_'.$meta_type]) + if ($GLOBALS['linpha']->sql->config->value['sys_image_'.$meta_type]) { - $MetaData->setMetaFields($meta_type); - $exif_count = $MetaData->defined_fields[$meta_type]; + //$exif_count = $MetaData->defined_fields[$meta_type]; ?> <br /><b><?php echo i18n("Search").strtoupper($meta_type); ?></b><br /> <input type="checkbox" id="b_<?php echo $meta_type; ?>_all" name="button[<?php echo $meta_type; ?>][all]" value="1"<?php echo isset($_REQUEST['b_'.$meta_type.'_all']) ? ' checked' : ''; ?> onClick="check_all('b_<?php echo $meta_type; ?>_all','<?php echo $meta_type; ?>')"><label for="b_<?php echo $meta_type; ?>_all"><b><?php echo i18n("All"); ?></b></label> <a href="javascript:div_expand('div_<?php echo $meta_type; ?>');"><img border="0" src="<?php echo $linTpl->themeFile('images/expand.gif'); ?>" /></a> <br /> - <div id="div_<?php echo $meta_type; ?>" style="border: 1px solid black; width: 200px;"> + <div id="div_<?php echo $meta_type; ?>" style="border: 1px solid black; width: 280px;"> <?php - for($i=1; list($key,$value) = each($MetaData->defined_fields[$meta_type]); $i++) + for ($i=1; list($key,$value) = each(LinMetaData::$metaTags[$meta_type]); $i++) { echo '<input type="checkbox" id="b_'.$meta_type.'_'.$i.'" name="button['.$meta_type.']['.$key.']" value="1"'; echo isset($_REQUEST['button'][$meta_type][$key]) ? ' checked="checked">' : '>'; Modified: trunk/linpha2/templates/default/static.login.html.php =================================================================== --- trunk/linpha2/templates/default/static.login.html.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/static.login.html.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -7,7 +7,7 @@ echo i18n("Welcome").' '.$_SESSION['user_name'].' ('.$_SESSION['user_displayname'].')'; ?> <br /> - <input type="hidden" name="cmd" value="logout" /> + <input type="hidden" name="linCmd" value="logout" /> <input type="submit" name="submit" class="linButton" value="<?php echo i18n("Logout"); ?>" /> <?php @@ -15,25 +15,25 @@ ?> <br /><label for="linFormUsername" style="display: block; float: left; width: 80px;"> <?php echo i18n("Username"); ?>: </label> - <input style="width: 105px;" class="linForms" type="text" name="username" value="" id="linFormUsername" /> + <input style="width: 105px;" class="linForms" type="text" name="linUsername" value="" id="linFormUsername" /> <br /><label for="linFormPassword" style="display: block; float: left; width: 80px;"> <?php echo i18n("Password"); ?>: </label> - <input style="width: 105px;" class="linForms" type="password" name="password" value="" id="linFormPassword" /> + <input style="width: 105px;" class="linForms" type="password" name="linPassword" value="" id="linFormPassword" /> <br /><br /> <?php if ($GLOBALS['linpha']->sql->config->value['sys_session_autologin']) { ?> - <label for="linFormCheckboxRemember"> - <input type="checkbox" name="rememberme" value="true" id="linFormCheckboxRemember" /> + <label for="linFormCheckboxRememberStatic"> + <input type="checkbox" name="linRememberme" value="true" id="linFormCheckboxRememberStatic" /> <?php echo i18n("Remember Me"); ?> </label> <?php } ?> - <input type="hidden" name="cmd" value="login" /> + <input type="hidden" name="linCmd" value="login" /> <input type="submit" name="submit" class="linButton" value="<?php echo i18n("Login"); ?>" /><br /><br /> <div style="font-size: smaller; border: 0px;"><?php echo i18n("You must have cookies enabled to log in."); ?></div> <?php Modified: trunk/linpha2/templates/default/viewer.head.php =================================================================== --- trunk/linpha2/templates/default/viewer.head.php 2008-04-26 19:27:58 UTC (rev 4926) +++ trunk/linpha2/templates/default/viewer.head.php 2008-04-26 19:28:25 UTC (rev 4927) @@ -44,8 +44,8 @@ linYUILoader.require('tabview'); -linYUILoader.require('LinYUIGlobalJS'); -linYUILoader.require('LinYUIPageJS'); +//linYUILoader.require('LinYUIGlobalJS'); +//linYUILoader.require('LinYUIPageJS'); linYUILoader.require('LinYUIAlbumNavigationJS'); linYUILoader.require('LinYUIAlbumJS'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-26 19:28:07
|
Revision: 4926 http://linpha.svn.sourceforge.net/linpha/?rev=4926&view=rev Author: fangehrn Date: 2008-04-26 12:27:58 -0700 (Sat, 26 Apr 2008) Log Message: ----------- 2008-04-26 flo * Search bug fixes * Menu bug fixes * Maps plugin bug fixes - set the thumbnail width to 250 (same width as the marker background) Modified Paths: -------------- trunk/linpha2/templates/default/tabs/comments.html.php trunk/linpha2/templates/default/tabs/editIptcXmp.html.php trunk/linpha2/templates/default/tabs/editMeta.html.php trunk/linpha2/templates/default/tabs/exif.html.php trunk/linpha2/templates/default/tabs/gps.html.php trunk/linpha2/templates/default/tabs/imageInfo.html.php trunk/linpha2/templates/default/tabs/iptcXmp.html.php trunk/linpha2/templates/default/tabs/videoInfo.html.php Modified: trunk/linpha2/templates/default/tabs/comments.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/comments.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/comments.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1,3 +1,5 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + <?php if($GLOBALS['linpha']->sql->checkPermission('metadata_comments')) { ?> <?php if (isset($linTpl->output['sys_log'])) { ?> Modified: trunk/linpha2/templates/default/tabs/editIptcXmp.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/editIptcXmp.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/editIptcXmp.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1,3 +1,5 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + <div id="linDivMetaIptc"> <?php if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { ?> <br /> Modified: trunk/linpha2/templates/default/tabs/editMeta.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/editMeta.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/editMeta.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1,3 +1,5 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + <?php if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { ?> <?php if (isset($linTpl->output['sys_log'])) { ?> Modified: trunk/linpha2/templates/default/tabs/exif.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/exif.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/exif.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1,3 +1,24 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + +<table border="1"> <?php -require_once(LINPHA_DIR.'/lib/include/metadata_info_show.php'); +foreach ($this->exifData as $key=>$value) +{ + if (!empty($value)) + { + ?> + <tr> + <td> + <?php echo LinMetaData::$metaTags['exif'][$key]; ?> + </td> + <td> + <?php echo $value; ?> + </td> + </tr> + <?php + } +} + +//require_once(LINPHA_DIR.'/lib/include/metadata_info_show.php'); ?> +</table> Modified: trunk/linpha2/templates/default/tabs/gps.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/gps.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/gps.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1 +1,3 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + GPS Modified: trunk/linpha2/templates/default/tabs/imageInfo.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/imageInfo.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/imageInfo.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1,3 +1,5 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + <table id="linTableMeta"> <?php foreach($this->imageInfo as $data) Modified: trunk/linpha2/templates/default/tabs/iptcXmp.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/iptcXmp.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/iptcXmp.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1 +1,3 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + IPTC/XMP Modified: trunk/linpha2/templates/default/tabs/videoInfo.html.php =================================================================== --- trunk/linpha2/templates/default/tabs/videoInfo.html.php 2008-04-26 19:27:40 UTC (rev 4925) +++ trunk/linpha2/templates/default/tabs/videoInfo.html.php 2008-04-26 19:27:58 UTC (rev 4926) @@ -1,3 +1,5 @@ +<?php if(!defined('LINPHA_DIR')) { exit(1); } ?> + Video <table id="linTableMeta"> <?php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-26 19:27:42
|
Revision: 4925 http://linpha.svn.sourceforge.net/linpha/?rev=4925&view=rev Author: fangehrn Date: 2008-04-26 12:27:40 -0700 (Sat, 26 Apr 2008) Log Message: ----------- 2008-04-26 flo * Search bug fixes * Menu bug fixes * Maps plugin bug fixes - set the thumbnail width to 250 (same width as the marker background) Modified Paths: -------------- trunk/linpha2/templates/default/themes/default/css/maps.css trunk/linpha2/templates/default/themes/default/menu/arrowdown.gif Modified: trunk/linpha2/templates/default/themes/default/css/maps.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/maps.css 2008-04-26 19:27:15 UTC (rev 4924) +++ trunk/linpha2/templates/default/themes/default/css/maps.css 2008-04-26 19:27:40 UTC (rev 4925) @@ -64,8 +64,8 @@ #linDivLoading { width: 50px; - height: 30px; + height: 50px; - padding-top: 3px; + padding-top: 20px; padding-left: 20px; } Modified: trunk/linpha2/templates/default/themes/default/menu/arrowdown.gif =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-26 19:27:18
|
Revision: 4924 http://linpha.svn.sourceforge.net/linpha/?rev=4924&view=rev Author: fangehrn Date: 2008-04-26 12:27:15 -0700 (Sat, 26 Apr 2008) Log Message: ----------- 2008-04-26 flo * Search bug fixes * Menu bug fixes * Maps plugin bug fixes - set the thumbnail width to 250 (same width as the marker background) Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/classes/linpha.view.album.class.php trunk/linpha2/lib/classes/linpha.view.image.class.php trunk/linpha2/lib/include/metadata_info_show.php trunk/linpha2/lib/js/LinYUIGlobal.js trunk/linpha2/lib/js/LinYUIPage.js trunk/linpha2/lib/modules/module.search.php trunk/linpha2/lib/plugins/maps/LinMaps.js trunk/linpha2/lib/plugins/maps/LinMapsYUI.js trunk/linpha2/lib/plugins/maps/class.googlemaps.YUI.js trunk/linpha2/lib/plugins/maps/module.maps.php trunk/linpha2/lib/plugins/maps/sql/sql.data.php Added Paths: ----------- trunk/linpha2/lib/js/LinGlobal_old.js trunk/linpha2/lib/js/LinImage_old.js trunk/linpha2/lib/js/LinThumbnails_old.js Removed Paths: ------------- trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/js/LinThumbnails.js Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2008-04-26 11:10:52 UTC (rev 4923) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2008-04-26 19:27:15 UTC (rev 4924) @@ -294,9 +294,9 @@ /** * check login and fill session */ - if( isset($_POST['cmd']) ) + if( isset($_POST['linCmd']) ) { - if($_POST['cmd']=='logout' && isset($_SESSION['user_name'])) // check for $_SESSION['user_name'] if the user reloads the page after logout + if($_POST['linCmd']=='logout' && isset($_SESSION['user_name'])) // check for $_SESSION['user_name'] if the user reloads the page after logout { linLog(LOG_TYPE_USER,LOG_NOTICE,'logout','User '.$_SESSION['user_name'].': logged out'); @@ -311,16 +311,16 @@ unset($_SESSION['user_groups']); unset($_SESSION['user_display_name']); - if(isset($_COOKIE['linpha_userid'])) { + if (isset($_COOKIE['linpha_userid'])) { setcookie('linpha_userid'); // delete cookie linpha_userid setcookie('linpha_password'); // delete cookie linpha_password } $sysLogMsg[] = i18n("Logged out."); } - elseif($_POST['cmd']=='login') + elseif ($_POST['linCmd']=='login') { - if( !isset($_POST['username']) OR !isset($_POST['password']) OR empty($_POST['username']) OR empty($_POST['password'])) + if ( !isset($_POST['linUsername']) || !isset($_POST['linPassword']) || empty($_POST['linUsername']) || empty($_POST['linPassword'])) { $sysLogMsg[] = i18n("Please Fill In All Fields!"); } @@ -330,38 +330,38 @@ * get user from DB */ $data = $GLOBALS['linpha']->db->GetRow("SELECT id, username, password, display_name FROM ".LIN_PREFIX."users ". - "WHERE username='".LinSql::linAddslashes($_POST['username'])."'"); + "WHERE username='".LinSql::linAddslashes($_POST['linUsername'])."'"); if ( isset($data['username']) && isset($data['password']) - && $_POST['username'] == $data['username'] - && $this->compareHash($data['id'], $_POST['password'], $data['password']) ) + && $_POST['linUsername'] == $data['username'] + && $this->compareHash($data['id'], $_POST['linPassword'], $data['password']) ) { /** * sucessfull login */ - linLog(LOG_TYPE_USER,LOG_NOTICE,'login','User '.$_POST['username'].': successfully logged in.'); + linLog(LOG_TYPE_USER,LOG_NOTICE,'login','User '.$_POST['linUsername'].': successfully logged in.'); $sysLogMsg[] = i18n("Successfully Logged In!"); - $this->setUserInformation($_POST['username'],$data['id'],$data['display_name']); + $this->setUserInformation($_POST['linUsername'],$data['id'],$data['display_name']); if ($GLOBALS['linpha']->sql->config->value['sys_session_autologin'] - && isset($_POST['rememberme'])) { + && isset($_POST['linRememberme'])) { $this->setLinphaCookie($data['id'], $data['password']); // this should be the updated hash (when needed) from compareHash() (call by reference) } /** * some security stuff */ - unset($_POST['password']); - unset($_REQUEST['password']); + unset($_POST['linPassword']); + unset($_REQUEST['linPassword']); } else { /** * failed login */ - linLog(LOG_TYPE_USER,LOG_WARNING,'login','User '.$_POST['username'].': login failed!'); + linLog(LOG_TYPE_USER,LOG_WARNING,'login','User '.$_POST['linUsername'].': login failed!'); $sysLogMsg[] = i18n("Login Failed!"); } } @@ -667,7 +667,7 @@ * $hash_secret not used at the moment * it has 2 main disadvantages: * - we would have to change require_once(config.sql.php) to require(config.sql.php) - * - if the admin deletes the file config.sql.php users will not never be able to authenticate + * - if the admin deletes the file config.sql.php users will not be able to authenticate * - it does not make sense to store the $hash_secret in the database instead of a file, * this would be no additional security! $sql_dir = ''; @@ -1026,6 +1026,13 @@ } } + function isPluginActive($plugin) + { + return isset($GLOBALS['linpha']->sql->config->value['plugins_'.$plugin.'_enable']) + && $GLOBALS['linpha']->sql->config->value['plugins_'.$plugin.'_enable']=='1'; + + } + } // end sub-class LinSqlConfig ?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.view.album.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-04-26 11:10:52 UTC (rev 4923) +++ trunk/linpha2/lib/classes/linpha.view.album.class.php 2008-04-26 19:27:15 UTC (rev 4924) @@ -1,4 +1,4 @@ -<?php +<?php /* * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> * Florian Angehrn Modified: trunk/linpha2/lib/classes/linpha.view.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-04-26 11:10:52 UTC (rev 4923) +++ trunk/linpha2/lib/classes/linpha.view.image.class.php 2008-04-26 19:27:15 UTC (rev 4924) @@ -80,6 +80,7 @@ require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/gps.html.php'); break; case 'exif': + $this->getImageData('exif'); require_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/tabs/exif.html.php'); break; case 'iptcXmp': @@ -191,7 +192,7 @@ * This should prevent all others from suffering performance issues * during import */ - if (isset($GLOBALS['linpha']->sql->config->value['plugins_maps_enable']) + if ($GLOBALS['linpha']->sql->config->isPluginActive('maps') && $GLOBALS['linpha']->sql->config->value['plugins_maps_enable_geotagged'] && $GLOBALS['linpha']->sql->config->value['plugins_maps_geotagged_autoimport']) { @@ -267,6 +268,19 @@ case 'videoInfo': $this->videoInfo = LinMetaData::readInformations($this->imgData, $flag_nr=11); break; + case 'exif': + $this->exifData = $GLOBALS['linpha']->db->GetRow("SELECT * FROM ".LIN_PREFIX."meta_exif " . + "WHERE md5sum = '".LinSql::linAddslashes($this->imgData['md5sum'])."'"); + unset($this->exifData['md5sum']); + + if ($GLOBALS['linpha']->sql->config->isPluginActive('maps') && $this->imgData['geodata']) + { + $this->gpsData = $GLOBALS['linpha']->db->GetRow("SELECT * FROM ".LIN_PREFIX."meta_exif " . + "WHERE md5sum = '".LinSql::linAddslashes($this->imgData['md5sum'])."'"); + unset($this->gpsData['md5sum']); + } + + break; } } Modified: trunk/linpha2/lib/include/metadata_info_show.php =================================================================== --- trunk/linpha2/lib/include/metadata_info_show.php 2008-04-26 11:10:52 UTC (rev 4923) +++ trunk/linpha2/lib/include/metadata_info_show.php 2008-04-26 19:27:15 UTC (rev 4924) @@ -25,7 +25,7 @@ */ if( !LinSql::photoIsAllowed( $GLOBALS['linpha']->template->idCurrent, $sql_perm_type = 'read' ) ) { - echo i18n("Access Denied!"); + echo LIN_STR_ACCESSDENIED; exit(); } @@ -39,7 +39,7 @@ if( ! isset($data['id']) ) { - echo i18n("Access Denied!"); + echo LIN_STR_ACCESSDENIED; exit(); } Deleted: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2008-04-26 11:10:52 UTC (rev 4923) +++ trunk/linpha2/lib/js/LinGlobal.js 2008-04-26 19:27:15 UTC (rev 4924) @@ -1,311 +0,0 @@ - -/** - * class and global definitions - */ -var LinGlobal = Class.create(); -var myLinGlobal; - -LinGlobal.prototype = -{ - /** - * initialize() - * Constructor runs on completion of the DOM loading. - */ - initialize: function() - { - this.menuNeedsUpdating = false; - - this.linInnerWidth = 0; - this.linInnerHeight = 0; - this.linPageXOffset = 0; - this.linPageYOffset = 0; - - this.tabs = new Array(); - - this.nofPopups = 0; - }, - - /** - * dynamically open syslog - * used in ajax context - */ - linSyslog: function(text) - { - if( typeof $('linDivSyslogText') != 'undefined' ) - { - if( $('linDivSyslogText').innerHTML == '' ) - { - $('linDivSyslogText').innerHTML += text; - } - else - { - $('linDivSyslogText').innerHTML += '<br />' + text; - } - - this.setScrollSize(); - $('linDivSyslog').style.top = (this.linPageYOffset + 15) + 'px'; - $('linDivSyslog').style.left = (this.linPageXOffset + 15) + 'px'; - Element.show('linDivSyslog'); - } - }, - closeSyslog: function() - { - $('linDivSyslogText').innerHTML = ''; - Element.hide('linDivSyslog'); - }, - - /** - * check ajax compatibilty - * will be on every page view until it was successfully - * then, the page will be reloaded - * - * use this on every page and not only on home page, because if user is linked directly to an image - * - * ajax may be disabled with ./?linCat=ajax&disable_ajax - * and may be re-enabled with ./?linCat=ajax&enable_ajax - * - * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request - */ - checkAjaxCompatibility: function() - { - new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:myLinGlobal.checkAjaxCompatibilitySuccess} ); - }, - - /** - * reload page, now with ajax activated - * will be called if the request in checkAjaxCompatibility() was successfully - */ - checkAjaxCompatibilitySuccess: function(t) - { - if( t.responseText == 'use_js saved' ) - { - myLinGlobal.linSyslog('Ajax enabled'); - location.href = document.location; - } - }, - - AjaxPost: function(url, parameters, successFunction) - { - var opt = { - // Use POST - method: 'post', - // Send this lovely data - postBody: parameters - , - // asynchron, of course - asynchronous:true, - - // Handle successful response - onSuccess: successFunction, - - // Handle 404 - on404: function(t) { - alert('Error 404: ' + t.statusText); - }, - // Handle other errors - onFailure: function(t) { - alert('Error ' + t.status + ' -- ' + t.statusText); - } - } - - new Ajax.Request(url, opt); - }, - - /*reloadMenu: function() - { - if( this.menuNeedsUpdating ) - { - new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); - this.menuNeedsUpdating = false; - } - },*/ - - /** - * setWindowSize() - * - * sets two variables of the inner window width and height - * takes care of browser incompatibilities - */ - setWindowSize: function() - { - /** - * browser incompatibilities... - */ - if (window.innerHeight) // all except Explorer - { - this.linInnerWidth = self.innerWidth; - this.linInnerHeight = self.innerHeight; - } - else if (document.body && document.body.offsetWidth) - { - this.linInnerWidth = document.body.offsetWidth; - this.linInnerHeight = document.body.offsetHeight; - } - else - { - this.linInnerWidth = 500; - this.linInnerHeight = 300; - } - }, - - /** - * setMainHeight - * - * sets the height in thumb and image view of the "linDivMainOuter" - */ - setMainHeight: function() - { - this.setWindowSize(); - - var newHeight = this.linInnerHeight - $('linDivMain').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) - if(newHeight < 100) - { - newHeight = 100; - } - - $('linDivMain').style.height = newHeight + 'px'; - }, - - /** - * setScrollSize - * - * sets two variables with the scroll offset - * takes care of browser incompatibilites - * @uses linSyslog() - */ - setScrollSize: function() - { - if (self.pageYOffset) // all except Explorer - { - this.linPageXOffset = self.pageXOffset; - this.linPageYOffset = self.pageYOffset; - } - else if (document.documentElement && document.documentElement.scrollTop) - // Explorer 6 Strict - { - this.linPageXOffset = document.documentElement.scrollLeft; - this.linPageYOffset = document.documentElement.scrollTop; - } - else if (document.body) // all other Explorers - { - this.linPageXOffset = document.body.scrollLeft; - this.linPageYOffset = document.body.scrollTop; - } - }, - - fOnError: function(txt_message, url, line) { - var txt = "Error occured...\n\n"; - txt += "Message: " + txt_message + "\n"; - txt += "URL: " + url + "\n"; - txt += "Line: " + line; - alert(txt); - }, - - /** - * menu tab functions - - openTab: function( className, tabNr ) { - divElems = document.getElementsByTagName('div'); - for(i = 0, n = 0; i < divElems.length; i++) - { - if( divElems[i].className == className ) - { - if(n == tabNr && - typeof this.tabs[ className ]!='undefined' && - typeof this.tabs[ className ][ tabNr ]!='undefined' && - this.tabs[ className ][ tabNr ]!='disabled') - { - divElems[i].style.display = ''; - } else { - divElems[i].style.display = 'none'; - } - - n++; - } - } - }, - disableTab: function( className, tabNr, elemAId ) { - this.tabs[ className ][ tabNr ] = 'disabled'; - $(elemAId).style.color = 'gray'; - }, - enableTab: function( className, tabNr, elemAId ) { - //alert(className + ' ' + typeof this.tabs[ className ] + ' ' + this.tabs[ className ]); - //this.tabs[ className ][ tabNr ] = ''; - //this.tabs.className.tabNr = ''; - $(elemAId).style.color = ''; - },*/ - - /** - * popup functions - */ - createPopup: function( elemId ) { - this.divPopupWindow = Builder.node('div', {id: 'linPopup'+this.nofPopups, className: 'linPopupWindow'} ); - - var divClose = Builder.node('div', {className: 'linPopupClose'}); - var divCloseButton = Builder.node('input', {type: 'button', value: 'X', - onclick: 'myLinGlobal.closePopup(\'linPopup'+this.nofPopups+'\')', className: 'linPopupCloseButton'}); - divClose.appendChild(divCloseButton); - - var divTitleBar = Builder.node('div', {className: 'linPopupTitleBar'} ); - divTitleBar.appendChild(divClose); - - - var divText = $(elemId).cloneNode(true); - divText.className = 'linPopupText'; - Element.show(divText); - - this.divPopupWindow.appendChild(divTitleBar); - this.divPopupWindow.appendChild(divText); - - document.body.appendChild(this.divPopupWindow); - - new Draggable(this.divPopupWindow, {handle: 'linPopupTitleBar'}); - - this.nofPopups++; - }, - closePopup: function(elemId) { - document.body.removeChild($(elemId)); - } - - - // no comma at last function. firefox works, but IE not! -} - -/** - * initLinGlobal() - * - * create the class object - */ -function initLinGlobal() -{ - myLinGlobal = new LinGlobal(); - - Event.observe(window, 'error', myLinGlobal.fOnError, false); - - /*if( checkAjaxCompatibility ) { - myLinGlobal.checkAjaxCompatibility(); - }*/ -} - -//Event.observe(window, 'load', initLinGlobal, false); -initLinGlobal(); - - -/** - * on resize functions - */ -function linEnableOnResize() -{ - Event.observe(window, 'resize', linOnResizeCreateTrigger, false); -} - -/** - * resizeWindow, use this wrapper function because internet explorer triggers the resize event to fast - * - * linOnResizeWrapper() must be defined where it's actually used (LinThumbnails.js, LinMapView.js) - */ -function linOnResizeCreateTrigger() -{ - clearTimeout(this.timerResize); - this.timerResize = setTimeout(linOnResizeWrapper,250); -} Copied: trunk/linpha2/lib/js/LinGlobal_old.js (from rev 4920, trunk/linpha2/lib/js/LinGlobal.js) =================================================================== --- trunk/linpha2/lib/js/LinGlobal_old.js (rev 0) +++ trunk/linpha2/lib/js/LinGlobal_old.js 2008-04-26 19:27:15 UTC (rev 4924) @@ -0,0 +1,311 @@ + +/** + * class and global definitions + */ +var LinGlobal = Class.create(); +var myLinGlobal; + +LinGlobal.prototype = +{ + /** + * initialize() + * Constructor runs on completion of the DOM loading. + */ + initialize: function() + { + this.menuNeedsUpdating = false; + + this.linInnerWidth = 0; + this.linInnerHeight = 0; + this.linPageXOffset = 0; + this.linPageYOffset = 0; + + this.tabs = new Array(); + + this.nofPopups = 0; + }, + + /** + * dynamically open syslog + * used in ajax context + */ + linSyslog: function(text) + { + if( typeof $('linDivSyslogText') != 'undefined' ) + { + if( $('linDivSyslogText').innerHTML == '' ) + { + $('linDivSyslogText').innerHTML += text; + } + else + { + $('linDivSyslogText').innerHTML += '<br />' + text; + } + + this.setScrollSize(); + $('linDivSyslog').style.top = (this.linPageYOffset + 15) + 'px'; + $('linDivSyslog').style.left = (this.linPageXOffset + 15) + 'px'; + Element.show('linDivSyslog'); + } + }, + closeSyslog: function() + { + $('linDivSyslogText').innerHTML = ''; + Element.hide('linDivSyslog'); + }, + + /** + * check ajax compatibilty + * will be on every page view until it was successfully + * then, the page will be reloaded + * + * use this on every page and not only on home page, because if user is linked directly to an image + * + * ajax may be disabled with ./?linCat=ajax&disable_ajax + * and may be re-enabled with ./?linCat=ajax&enable_ajax + * + * http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request + */ + checkAjaxCompatibility: function() + { + new Ajax.Request(LINPHA_LINK + '&linCat=ajax&use_js', {method:'get', asynchronous:true, onSuccess:myLinGlobal.checkAjaxCompatibilitySuccess} ); + }, + + /** + * reload page, now with ajax activated + * will be called if the request in checkAjaxCompatibility() was successfully + */ + checkAjaxCompatibilitySuccess: function(t) + { + if( t.responseText == 'use_js saved' ) + { + myLinGlobal.linSyslog('Ajax enabled'); + location.href = document.location; + } + }, + + AjaxPost: function(url, parameters, successFunction) + { + var opt = { + // Use POST + method: 'post', + // Send this lovely data + postBody: parameters + , + // asynchron, of course + asynchronous:true, + + // Handle successful response + onSuccess: successFunction, + + // Handle 404 + on404: function(t) { + alert('Error 404: ' + t.statusText); + }, + // Handle other errors + onFailure: function(t) { + alert('Error ' + t.status + ' -- ' + t.statusText); + } + } + + new Ajax.Request(url, opt); + }, + + /*reloadMenu: function() + { + if( this.menuNeedsUpdating ) + { + new Ajax.Updater('menu', LINPHA_LINK + '&linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'get', asynchronous:true, evalScripts:true}); + this.menuNeedsUpdating = false; + } + },*/ + + /** + * setWindowSize() + * + * sets two variables of the inner window width and height + * takes care of browser incompatibilities + */ + setWindowSize: function() + { + /** + * browser incompatibilities... + */ + if (window.innerHeight) // all except Explorer + { + this.linInnerWidth = self.innerWidth; + this.linInnerHeight = self.innerHeight; + } + else if (document.body && document.body.offsetWidth) + { + this.linInnerWidth = document.body.offsetWidth; + this.linInnerHeight = document.body.offsetHeight; + } + else + { + this.linInnerWidth = 500; + this.linInnerHeight = 300; + } + }, + + /** + * setMainHeight + * + * sets the height in thumb and image view of the "linDivMainOuter" + */ + setMainHeight: function() + { + this.setWindowSize(); + + var newHeight = this.linInnerHeight - $('linDivMain').offsetTop - 40; // 35 = 15 (bottom rounded corners) + 10 (margin-bottom) + 15 (??) + if(newHeight < 100) + { + newHeight = 100; + } + + $('linDivMain').style.height = newHeight + 'px'; + }, + + /** + * setScrollSize + * + * sets two variables with the scroll offset + * takes care of browser incompatibilites + * @uses linSyslog() + */ + setScrollSize: function() + { + if (self.pageYOffset) // all except Explorer + { + this.linPageXOffset = self.pageXOffset; + this.linPageYOffset = self.pageYOffset; + } + else if (document.documentElement && document.documentElement.scrollTop) + // Explorer 6 Strict + { + this.linPageXOffset = document.documentElement.scrollLeft; + this.linPageYOffset = document.documentElement.scrollTop; + } + else if (document.body) // all other Explorers + { + this.linPageXOffset = document.body.scrollLeft; + this.linPageYOffset = document.body.scrollTop; + } + }, + + fOnError: function(txt_message, url, line) { + var txt = "Error occured...\n\n"; + txt += "Message: " + txt_message + "\n"; + txt += "URL: " + url + "\n"; + txt += "Line: " + line; + alert(txt); + }, + + /** + * menu tab functions + + openTab: function( className, tabNr ) { + divElems = document.getElementsByTagName('div'); + for(i = 0, n = 0; i < divElems.length; i++) + { + if( divElems[i].className == className ) + { + if(n == tabNr && + typeof this.tabs[ className ]!='undefined' && + typeof this.tabs[ className ][ tabNr ]!='undefined' && + this.tabs[ className ][ tabNr ]!='disabled') + { + divElems[i].style.display = ''; + } else { + divElems[i].style.display = 'none'; + } + + n++; + } + } + }, + disableTab: function( className, tabNr, elemAId ) { + this.tabs[ className ][ tabNr ] = 'disabled'; + $(elemAId).style.color = 'gray'; + }, + enableTab: function( className, tabNr, elemAId ) { + //alert(className + ' ' + typeof this.tabs[ className ] + ' ' + this.tabs[ className ]); + //this.tabs[ className ][ tabNr ] = ''; + //this.tabs.className.tabNr = ''; + $(elemAId).style.color = ''; + },*/ + + /** + * popup functions + */ + createPopup: function( elemId ) { + this.divPopupWindow = Builder.node('div', {id: 'linPopup'+this.nofPopups, className: 'linPopupWindow'} ); + + var divClose = Builder.node('div', {className: 'linPopupClose'}); + var divCloseButton = Builder.node('input', {type: 'button', value: 'X', + onclick: 'myLinGlobal.closePopup(\'linPopup'+this.nofPopups+'\')', className: 'linPopupCloseButton'}); + divClose.appendChild(divCloseButton); + + var divTitleBar = Builder.node('div', {className: 'linPopupTitleBar'} ); + divTitleBar.appendChild(divClose); + + + var divText = $(elemId).cloneNode(true); + divText.className = 'linPopupText'; + Element.show(divText); + + this.divPopupWindow.appendChild(divTitleBar); + this.divPopupWindow.appendChild(divText); + + document.body.appendChild(this.divPopupWindow); + + new Draggable(this.divPopupWindow, {handle: 'linPopupTitleBar'}); + + this.nofPopups++; + }, + closePopup: function(elemId) { + document.body.removeChild($(elemId)); + } + + + // no comma at last function. firefox works, but IE not! +} + +/** + * initLinGlobal() + * + * create the class object + */ +function initLinGlobal() +{ + myLinGlobal = new LinGlobal(); + + Event.observe(window, 'error', myLinGlobal.fOnError, false); + + /*if( checkAjaxCompatibility ) { + myLinGlobal.checkAjaxCompatibility(); + }*/ +} + +//Event.observe(window, 'load', initLinGlobal, false); +initLinGlobal(); + + +/** + * on resize functions + */ +function linEnableOnResize() +{ + Event.observe(window, 'resize', linOnResizeCreateTrigger, false); +} + +/** + * resizeWindow, use this wrapper function because internet explorer triggers the resize event to fast + * + * linOnResizeWrapper() must be defined where it's actually used (LinThumbnails.js, LinMapView.js) + */ +function linOnResizeCreateTrigger() +{ + clearTimeout(this.timerResize); + this.timerResize = setTimeout(linOnResizeWrapper,250); +} Deleted: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2008-04-26 11:10:52 UTC (rev 4923) +++ trunk/linpha2/lib/js/LinImage.js 2008-04-26 19:27:15 UTC (rev 4924) @@ -1,1186 +0,0 @@ - -/** - * class and global definitions - */ -var LinImage = Class.create(); -var myLinImage; - -LinImage.prototype = { - - /** - * initialize() - * - * Constructor runs on completion of the DOM loading. - */ - initialize: function() - { - /*this.imgInfoColorNotActive = $('linDivInfoLink').style.color; - this.imgInfoColorActive = $('linHrefInfoLink').style.color;*/ - this.imgInfoShowHide = 'hide'; - - - this.fullscreenActive = false; - this.fullscreenOldMaxWidth, this.fullscreenOldMaxHeight, this.previousBodyOverflow; - this.slideshowActive = false; - this.ssCurrentTimerID; - this.ssCurrentDelay = 5000; - this.ssRandom = false; - this.ssLoop = false; - - this.xmlDoc = new Array(); - this.nextThumbs = new Array(); - this.prevThumbs = new Array(); - this.preloadImageSrc = new Array(); // image array, will contain a lot of preloaded images - this.finishedPreloadedImages = new Array(); // set to true after preload completed - this.preloadXmlFinished = new Array(); - - this.currentFileType; // 1 = image, 2 = video, 3 = others - - this.curLocationHash; - //this.timerResize; - }, - - - // ----------------------------------------------------------------------------------- - // functions to load xml data of images - // ----------------------------------------------------------------------------------- - - loadImage: function(imgId) { - if(IdCurrent != imgId) - { - IdCurrent = imgId; - //myLinGlobal.menuNeedsUpdating = true; // IdCurrent changed, update menu on next hover of the menu - location.hash = 'idCurrent='+IdCurrent; - } - - this.curLocationHash = location.hash; // update current Hash, this value is periodically checked to reload the image if neccessary - - // do not load the data again if it is already cached - if(this.preloadXmlFinished[imgId] && typeof this.xmlDoc[imgId] != "undefined" ) // use typeof to work in IE - { - this.changeImage(); - } - else - { - this.loadImageXml(imgId); - } - }, - - loadImageXml: function(imgId) { - myLinGlobal.AjaxPost(linUrlBase + '&linId=' + imgId + '&xml', '', myLinImage.loadImageContinue); - }, - - loadImageContinue: function(t) { - var loadedimgid = t.responseXML.documentElement.getElementsByTagName('imgid').item(0).firstChild.data; - - // save xml data - myLinImage.xmlDoc[loadedimgid] = t.responseXML.documentElement; - myLinImage.preloadXmlFinished[loadedimgid] = true; - - if( loadedimgid == IdCurrent ) // coming from loadImage() - { - myLinImage.changeImage(); - } - else // coming from preloadImage() - { - myLinImage.preloadImage(loadedimgid); - } - }, - - - // ----------------------------------------------------------------------------------- - // Navigation functions - // ----------------------------------------------------------------------------------- - - movePrev: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - if(this.prevThumbs[ this.prevThumbs.length - 1 ]) - { - Element.setOpacity('linSsImgPrev',0.7); - new Effect.Appear('linSsImgPrev', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage(this.prevThumbs[ this.prevThumbs.length - 1 ]); - - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - } - else // end reached, do nothing but enable keyboard navigation again - { - myLinImage.enableKeyboardNav(); - } - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - moveNext: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - if(this.nextThumbs[0]) - { - Element.setOpacity('linSsImgNext',0.7); - new Effect.Appear('linSsImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage(this.nextThumbs[0]); - } - else if( this.ssLoop ) - { - Element.setOpacity('linSsImgNext',0.7); - new Effect.Appear('linSsImgNext', { duration: 0.5, from: 0.7, to: 1.0 }); - this.moveFirst(); - } - else // end reached, do nothing but enable keyboard navigation again - { - myLinImage.enableKeyboardNav(); - } - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - moveFirst: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - Element.setOpacity('linSsImgFirst',0.7); - new Effect.Appear('linSsImgFirst', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage( firstImgId ); - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - moveLast: function() { - if( this.slideshowActive ) - { - clearTimeout(this.ssCurrentTimerID); - } - - Element.setOpacity('linSsImgLast',0.7); - new Effect.Appear('linSsImgLast', { duration: 0.5, from: 0.7, to: 1.0 }); - myLinImage.loadImage( lastImgId ); - - if( this.slideshowActive ) - { - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - }, - - // ----------------------------------------------------------------------------------- - // Change image functions - // ----------------------------------------------------------------------------------- - - /** - * changeImage() - */ - changeImage: function() { - - /** - * set height of outer div to prevent the whole page getting smaller, and if the image is loaded getting bigger again - * but in fullscreen, we want no activities in background - */ - if(! this.fullscreenActive) { - $('linDivMainimage').style.height = $('linImgMainimage').style.height; - //$('linDivMain').style.height = $('linDivMain').offsetHeight; - //alert($('linDivMain').offsetHeight); - } - - /** - * hide elements during transition - */ - this.hideImgInfoNow(); // hide text info link immediately - Element.hide('linImgMainimage'); // hide mainimage while changing image to prevent flicker - Element.hide('linDivInfoLink'); - - this.currentFileType = this.xmlDoc[IdCurrent].getElementsByTagName('filetype').item(0).firstChild.data; - - switch( this.currentFileType ) - { - case '1': // image - - if(! this.finishedPreloadedImages[IdCurrent] ) - { - Element.show('linDivloading'); - } - - //$('linImgMainimage').style.marginLeft = 0; // restore left margin, set when viewing videos - - /** - * calc image width and height - */ - var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; - var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; - var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); - var imgWidth = sizeArray[0]; - var imgHeight = sizeArray[1]; - - /** - * preload image - */ - var currentImgSrc = imageSrc + IdCurrent + '&width=' + imgWidth + '&height=' + imgHeight; - imgPreloader = new Image(); - - /** - * once image is preloaded, resize image container - * - * pay attention with the other image preloader! - * if imgWidth and imgWidth was not set with trailing 'var' it got overlapping with the other variables - * and this caused the image not resized correctly in resizeImageContainer() !!! - */ - imgPreloader.onload=function(){ - myLinImage.finishedPreloadedImages[IdCurrent] = true; - $('linImgMainimage').src = currentImgSrc; - myLinImage.resizeImageContainer(imgWidth, imgHeight); - } - imgPreloader.src = currentImgSrc; - - break; - case '2': // video - - //$('linImgMainimage').style.marginLeft = 200; - - /** - * show video thumbnail - */ - $('linImgMainimage').src = thumbSrc + IdCurrent ; - $('linImgMainimage').style.width = 'auto'; - $('linImgMainimage').style.height = 'auto'; - - /** - * show image and set div height - */ - this.showImage(); - - break; - case '0': // others - break; - } - }, - - /** - * resizeImageContainer() - */ - resizeImageContainer: function( imgWidth, imgHeight) { - - // get current height and width - /*this.wCur = $('linImgMainimage').offsetWidth; - this.hCur = $('linImgMainimage').offsetHeight; - - // scalars based on change from old to new - this.xScale = ((imgWidth + (borderSize * 2)) / this.wCur) * 100; - this.yScale = ((imgHeight + (borderSize * 2)) / this.hCur) * 100; - - // calculate size difference between new and old image, and resize if necessary - wDiff = (this.wCur - borderSize * 2) - imgWidth; - hDiff = (this.hCur - borderSize * 2) - imgHeight; - - if(!( hDiff == 0)){ new Effect.Scale('linImgMainimage', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); } - if(!( wDiff == 0)){ new Effect.Scale('linImgMainimage', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); } - - // if new and old image are same size and no scaling transition is necessary, - // do a quick pause to prevent image flicker. - if((hDiff == 0) && (wDiff == 0)){ - if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);} - }*/ - - $('linImgMainimage').style.width = imgWidth + 'px'; - $('linImgMainimage').style.height = imgHeight + 'px'; - - - /*Element.setHeight('prevLink', imgHeight); - Element.setHeight('nextLink', imgHeight); - Element.setWidth( 'imageDataContainer', imgWidth + (borderSize * 2));*/ - - /** - * show panorama link - * the only reason why do this at this point is, because this is only done on images - * and we just know the width and height - */ - if( imgWidth/imgHeight >= 2 || imgHeight/imgWidth >= 2 ) - { - Element.show('linHrefPanoLink'); - } - - this.showImage(); - }, - - /** - * showImage() - * - * Display image and begin preloading next images. - */ - showImage: function(){ - Element.hide('linDivloading'); - - if( useEffects ) - { - new Effect.Appear('linImgMainimage', { duration: 0.2, afterFinish: function(){ myLinImage.setImageData(); } }); - } - else - { - Element.show('linImgMainimage'); - this.setImageData() - } - - if(! this.fullscreenActive) - { - $('linDivMainimage').style.height = $('linImgMainimage').style.height; // reset to correct height to prevent trouble if image is bigger or smaller - //$('linDivMain').style.height = 'auto'; - } - }, - - /** - * setImageData() - */ - setImageData: function() - { - this.enableKeyboardNav(); - - /** - * set title - */ - if( typeof $('linDivTitle') != 'undefined' ) - { - $('linDivTitle').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('title').item(0).firstChild.data; - } - - /** - * update the menu - * - * replace the image ids in the menu - * replace( /linId=[0-9]* /g , "linId=" + IdCurrent ); - * its just an search/replace of 'linId=x' in the menu - * its very fast (about 0 - 15ms) and its executed every time the image changes - * - * but only in menuMore and menuAdmin, because we have in menuLogin - * linId='+IdCurrent, and ooh this will create very unexpected results..!! - */ - /*if( typeof $('linMenuAdmin') != 'undefined' ) - {*/ - //$('linMenuAdmin').innerHTML = $('linMenuAdmin').innerHTML.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); - /*}*/ - - /** - * menuMore - */ - /*if( typeof $('linMenuMore') != 'undefined' ) - {*/ - //$('linMenuMore').innerHTML = $('linMenuMore').innerHTML.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); - - // replace the width and height dimensions of the view at fullscreen link - //var orgWidth = this.xmlDoc[IdCurrent].getElementsByTagName('imgwidth').item(0).firstChild.data; - //var orgHeight = this.xmlDoc[IdCurrent].getElementsByTagName('imgheight').item(0).firstChild.data; - //$('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /width=[0-9]*/ , "width=" + orgWidth ); - //$('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /height=[0-9]*/ , "height=" + orgHeight ); - //$('linLiViewAtFullscreen').innerHTML = $('linLiViewAtFullscreen').innerHTML.replace( /[0-9]*x[0-9]*/ , orgWidth + "x" + orgHeight ); - /*}*/ - - /** - * set current thumb - */ - $('linDivThumbnavi_Current').innerHTML = '<a href="javascript:myLinImage.loadImage(' + IdCurrent + ')"><img class="linImgThumbnavi_Current" src="' + thumbSrc + IdCurrent + '" /></a>'; - - /** - * set prev thumbs - */ - $('linDivThumbnavi_Prev').innerHTML = ''; - this.prevThumbs = new Array(); - if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length; i++) - { - var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; - this.prevThumbs[i] = thumbId; - this.setPrevNextThumb(thumbId, 'linDivThumbnavi_Prev'); - } - } - - /** - * set next thumbs - */ - $('linDivThumbnavi_Next').innerHTML = ''; - this.nextThumbs = new Array(); - if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) - { - var thumbId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; - this.nextThumbs[i] = thumbId; - this.setPrevNextThumb(thumbId, 'linDivThumbnavi_Next'); - } - } - - /** - * set meta data - */ - $('linDivMeta').innerHTML = ''; - if(this.xmlDoc[IdCurrent].getElementsByTagName('meta').length > 0) - { - var table = Builder.node('table', {id: 'linTableMeta'} ); - var tbody = Builder.node('tbody'); - - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('meta').length; i++) - { - var meta = this.xmlDoc[IdCurrent].getElementsByTagName('meta').item(i); - var metaname = meta.getElementsByTagName('name').item(0).firstChild.data; - if(meta.getElementsByTagName('value').item(0).hasChildNodes()) { // prevent error in IE - var metavalue = meta.getElementsByTagName('value').item(0).firstChild.data; - } else { - var metavalue = ''; - } - - var tr = Builder.node('tr'); - var tdleft = Builder.node('td', {className: 'linTdMetaLeftColumn'}, metaname ); - var tdright = Builder.node('td', metavalue ); - - tr.appendChild(tdleft); - tr.appendChild(tdright); - tbody.appendChild(tr); - } - - table.appendChild(tbody); - - $('linDivMeta').appendChild(table); - - } - - /** - * file type specific meta data stuff - */ - switch( this.currentFileType ) - { - case '1': // image - this.setImageInfoLink(); // show the "info" link, must be called after Appear('linImgMainimage') - - //Element.hide('linDivVideoLink'); - //Element.show('linDivExifLink'); - //$('linAMetaExif').href = '#' + $('linAMetaExif').href; - //myLinGlobal.enableTab( 'linDivTab', 3, 'linAMetaExif' ); - - break; - case '2': // video - - //Element.show('linDivVideoLink'); - //Element.hide('linDivExifLink'); - //$('linAMetaExif').href = $('linAMetaExif').href.substring(1); - //$('linAMetaExif').href = '#' + $('linAMetaExif').href; - - //myLinGlobal.disableTab( 'linDivTab', 3, 'linAMetaExif' ); - - /*$('linDivMetaOuter').style.top = $('linImgMainimage').offsetTop + 'px'; - $('linDivMetaOuter').style.height = $('linImgMainimage').offsetHeight + 'px'; // 'auto' - Element.show('linDivMetaOuter');*/ - - break; - } - - this.initTextareaAddComment(); - this.setComments(); - - /** - * set image nr - * currently only in slideshow used - */ - $('linDivSlideshowImgNr').innerHTML = this.xmlDoc[IdCurrent].getElementsByTagName('imgnr').item(0).firstChild.data; - - - /** - * and at last, start preloading next and previous images - */ - this.preloadXml(); - - - }, - - /** - * setPrevNextThumb() - * - * code to generate a thumbnail with a <div><a><img> tag - */ - setPrevNextThumb: function(thumbId, divId) - { - var ElemImg = Builder.node('img', {id: 'thumb'+thumbId, className: 'linImgThumbnavi_PrevNext', src: thumbSrc + thumbId}); - var ElemA = Builder.node('a', {href: 'javascript:myLinImage.loadImage(' + thumbId + ')'}); - var ElemDiv = Builder.node('div', {className: 'linDivThumbnavi_PrevNext'}); - - ElemA.appendChild( ElemImg ); - ElemDiv.appendChild( ElemA ); - $(divId).appendChild(ElemDiv); - - if(! this.finishedPreloadedImages[thumbId]) { - Element.setOpacity('thumb'+thumbId,0.5); - } - - }, - - - // ----------------------------------------------------------------------------------- - // Keyboard actions - // ----------------------------------------------------------------------------------- - - /** - * enableKeyboardNav() - */ - enableKeyboardNav: function() { - document.onkeydown = this.keyboardAction; - }, - - /** - * disableKeyboardNav() - */ - disableKeyboardNav: function() { - document.onkeydown = ''; - }, - - /** - * keyboardAction() - * - * very nice - * http://www.mediaevent.de/javascript/needful_tables.html - */ - keyboardAction: function(e) { - - if (e == null) { // ie - keycode = event.keyCode; - ctrlKey = event.ctrlKey; - } else { // mozilla - keycode = e.which; - ctrlKey = e.ctrlKey; - } - - /*if( ctrlKey ) - { - alert('ctrl pressed'); - return; - }*/ - - //alert(keycode); - - key = String.fromCharCode(keycode).toLowerCase(); - - //if ((keycode == 39) && (ctrlKey == true)) // ctrl + arrow right - if (keycode == 34) // page down - { - myLinImage.disableKeyboardNav(); - myLinImage.moveNext(); - return false; - } - //else if ((keycode == 37) && (ctrlKey == true)) // ctrl + arrow left - else if (keycode == 33) // page up - { - myLinImage.disableKeyboardNav(); - myLinImage.movePrev(); - return false; - } - else if ((keycode == 32) && (ctrlKey == true)) // ctrl + space - { - myLinImage.slideshowStartStop(); - } - else if ((keycode == 122)) // F11 - { - if( myLinImage.fullscreenActive ) { - $('linDivSlideshowExit').show(); // hide exit button to force exit again with F11 - myLinImage.fullscreenStop(); - } else { - $('linDivSlideshowExit').hide(); - myLinImage.fullscreenStart(); - } - } - else if ((keycode == 36) && (ctrlKey == true)) // ctrl + home - //else if (keycode == 36) // home - { - myLinImage.moveFirst(); - return false; - } - else if ((keycode == 35) && (ctrlKey == true)) // ctrl + end - //else if (keycode == 35) // end - { - myLinImage.moveLast(); - return false; - } - else if( myLinImage.fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen - { - myLinImage.fullscreenStop(); - } - else if(myLinImage.fullscreenActive && key == 's') // start/stop slideshow - { - myLinImage.slideshowStartStop(); - } - else if(myLinImage.fullscreenActive && key == 'p') // display previous image - { - myLinImage.disableKeyboardNav(); - myLinImage.movePrev(); - } - else if(myLinImage.fullscreenActive && key == 'n') // display next image - { - myLinImage.disableKeyboardNav(); - myLinImage.moveNext(); - } - }, - - - // ----------------------------------------------------------------------------------- - // Preload functions - // ----------------------------------------------------------------------------------- - - /** - * preloadXml() - * Preload previous and next images. - * - * normally, loadImageXml() will call also preloadImage() - * but we also need to call preloadImage() if the Xml data is preloaded, - * but not yet the image (this may occur if we change to fullscreen, - * then, the images need to be re preloaded all - */ - preloadXml: function() { - - // preload nextthumb from left to right - if(this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').length; i++) - { - var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('nextthumb').item(i).firstChild.data; - - if(! this.preloadXmlFinished[imgId]) - { - this.loadImageXml(imgId); - } - else if(! this.finishedPreloadedImages[imgId] ) - { - this.preloadImage(imgId); - } - } - } - - // preload prevthumb from right to left - if(this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length > 0) - { - for(var i = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').length-1; i >= 0; i--) - { - var imgId = this.xmlDoc[IdCurrent].getElementsByTagName('prevthumb').item(i).firstChild.data; - - if(! this.preloadXmlFinished[imgId]) - { - this.loadImageXml(imgId); - } - else if(! this.finishedPreloadedImages[imgId] ) - { - this.preloadImage(imgId); - } - } - } - }, - - /** - * preloadImage() - * - * will be called after getting the xml data - */ - preloadImage: function(imgId) - { - if(! this.finishedPreloadedImages[imgId] ) - { - switch(this.xmlDoc[imgId].getElementsByTagName('filetype').item(0).firstChild.data) - { - case '1': // image - /** - * set image width and height - */ - var orgWidth = this.xmlDoc[imgId].getElementsByTagName('imgwidth').item(0).firstChild.data; - var orgHeight = this.xmlDoc[imgId].getElementsByTagName('imgheight').item(0).firstChild.data; - var sizeArray = this.scaleToFit(orgWidth,orgHeight,maxImageWidth,maxImageHeight,1); - var imgWidth = sizeArray[0]; - var imgHeight = sizeArray[1]; - - /** - * preload image - */ - this.preloadImageSrc[imgId] = new Image(); - - this.preloadImageSrc[imgId].onload=function(){ - myLinImage.preloadImageFinished(imgId); - } - this.preloadImageSrc[imgId].src = imageSrc + imgId + '&width=' + imgWidth + '&height=' + imgHeight; - - break; - case '2': // video - this.preloadImageFinished(imgId); - break; - case '0': // other - break; - } - } - }, - - preloadImageFinished: function(imgId) { - - this.finishedPreloadedImages[imgId] = true; - - if( $('thumb'+imgId) ) // maybe its not here anymore - { - new Effect.Appear('thumb'+imgId, { duration: 0.5, from: 0.5, to: 1.0 }); - } - - }, - - - // ----------------------------------------------------------------------------------- - // Slideshow functions - // ----------------------------------------------------------------------------------- - - fullscreenStart: function() - { - this.fullscreenActive = true; - - /** - * save old values to restore if slideshow ends - */ - this.fullscreenOldMaxWidth = maxImageWidth; - this.fullscreenOldMaxHeight = maxImageHeight; - - /** - * disable scrollbars - */ - this.previousBodyOverflow = document.getElementsByTagName("body")[0].style.overflow; - document.getElementsByTagName("body")[0].style.overflow='hidden'; - - /** - * start slideshow with some superduper effects - */ - Effect.Appear('linDivSlideshowOverlay', { queue: 'end', duration: 1.0, from: 0.0, to: 0.9 }); - Effect.BlindDown('linDivSlideshowControlsOuter', { queue: 'end'} ); - Element.show('linDivSlideshowImage'); - - /** - * steal the mainimage - */ - $('linDivMainimage').innerHTML = ''; - $('linDivSlideshowImage').innerHTML = '<img id="linImgMainimage" style="display: none;" class="linImgSlideshow">'; - - /** - * reload image with new position and size - */ - //this.resizeWindow(); - //linOnResizeCreateTrigger(); - linOnResizeWrapper(); - }, - fullscreenStop: function() - { - this.fullscreenActive = false; - - /** - * restore max image size - */ - maxImageWidth = this.fullscreenOldMaxWidth; - maxImageHeight = this.fullscreenOldMaxHeight; - - /** - * re-enable scrollbars - */ - document.getElementsByTagName("body")[0].style.overflow = this.previousBodyOverflow; - - /** - * delete preloaded images after stopping fullscreen - */ - this.finishedPreloadedImages = new Array(); - - /** - * end slideshow with some superduper effects - */ - Effect.Fold('linDivSlideshowControlsOuter', { queue: 'end'} ); - Effect.Fade('linDivSlideshowOverlay', { queue: 'end', duration: 0.5, from: 0.9, to: 0.0 } ); - Element.hide('linDivSlideshowImage'); - - /** - * give back the mainimage - */ - $('linDivSlideshowImage').innerHTML = ''; - $('linDivMainimage').innerHTML = '<img id="linImgMainimage" style="display: none;">'; - - /** - * reload image with old position and size - */ - this.loadImage( IdCurrent ); - }, - - slideshowStartStop: function() - { - // start Slideshow - if(! this.slideshowActive) - { - this.slideshowActive = true; - Element.setOpacity('linSsImgStart',0.7); - this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - else // stop Slideshow - { - this.slideshowActive = false; - Element.setOpacity('linSsImgStart',1); - clearTimeout(this.ssCurrentTimerID); - } - }, - slideshowPlay: function() - { - if(this.nextThumbs[0] || this.ssLoop) - { - this.moveNext(); - //this.ssCurrentTimerID = setTimeout("myLinImage.slideshowPlay()", this.ssCurrentDelay); - } - else - { - // force stop slideshow - this.slideshowActive = true; - this.slideshowStartStop(); - } - }, - - slideshowChangeDelay: function() - { - this.ssCurrentDelay = $('linSsDelay').options[ $('linSsDelay').selectedIndex ].value * 1000; - //document.optionsForm.delay.options[document.optionsForm.delay.selectedIndex].value * 1000; - }, - slideshowChangeLoop: function() - { - if(! this.ssLoop) { - this.ssLoop = true; - Element.setOpacity('linSsImgLoop',0.7); - } else { - this.ssLoop = false; - Element.setOpacity('linSsImgLoop',1); - } - }, - slideshowChangeRandom: function() - { - if(! this.ssRandom) { - this.ssRandom = true; - Element.setOpacity('linSsImgRandom',0.7); - } else { - this.ssRandom = false; - Element.setOpacity('linSsImgRandom',1); - } - alert('This feature is currently not implemented, do we really need that?'); - }, - - - // ----------------------------------------------------------------------------------- - // Image info functions - // ----------------------------------------------------------------------------------- - - /** - * setImageInfoLink() - * - * positions the info link on bottom right of the image - * could only be done after image is not hidden anymore - * - * if this can be done without javascript, please tell me - */ - setImageInfoLink: function() - { - $('linDivInfoLink').style.top = ($('linImgMainimage').offsetTop + $('linImgMainimage').offsetHeight + 3) + 'px'; - $('linDivInfoLink').style.left = ($('linImgMainimage').offsetLeft + $('linImgMainimage').offsetWidth - 200) + 'px'; // 200: width of linDivInfoLink, value set view_img.css width = 200px; can't get width with javascript because element is hidden - Element.show('linDivInfoLink'); - }, - - /** - * DEPRECATED - * showImgInfo() - * - * fade out the image, show the meta infos, sets the color of the "Info" link to another - * - * idea: - * swap the colors of <a> and <div> tag (id 'linHrefInfoLink' and 'linDivInfoLink' - * so it is possible to set the colors in the css template (and not in javascript file) - - showImgInfo: function() - { - // make visible/invisible - if( this.imgInfoShowHide == 'hide' ) - { - this.imgInfoShowHide = 'show'; - - // set position - $('linDivMetaOuter').style.top = $('linImgMainimage').offsetTop + 'px'; - $('linDivMetaOuter').style.height = $('linImgMainimage').offsetHeight + 'px'; - - new Effect.Appear('linDivMetaOuter', { duration: 0.3 }); //, from: 0.0, to: 1.0 - new Effect.Fade('linDivMainimage', { duration: 0.3, from: 1.0, to: 0.2 }); - - $('linHrefInfoLink').style.color = this.imgInfoColorNotActive; - } - else - { - this.imgInfoShowHide = 'hide'; - - new Effect.Fade('linDivMetaOuter', { duration: 0.3 }); // , from: 1.0, to: 0.0 - new Effect.Appear('linDivMainimage', { duration: 0.3, from: 0.2, to: 1.0 }); - - $('linHrefInfoLink').style.color = this.imgInfoColorActive; - } - },*/ - hideImgInfoNow: function() - { - //Element.hide('linDivMetaOuter'); - Element.hide('linHrefPanoLink'); - Element.hide('linDivVideoLink'); - - //Element.setOpacity('linDivMainimage',1); - this.imgInfoShowHide = 'hide'; - - //$('linHrefInfoLink').style.color = this.imgInfoColorActive; - }, - - /** - * returns an array(width, height) with the correct size to fit - * in dst_w and dst_h - */ - scaleToFit: function(src_w,src_h,dst_w,dst_h,no_increase) - { - if(src_h == 0 || src_w == 0) - { - return new Array(0, 0); - } - - var img_relation = src_w / src_h; - - // Image is smaller than screen, no resize required - if ((src_w <= dst_w) && (src_h <= dst_h) && no_increase) - { - var returnarray = new Array( Math.round(src_w), Math.round(src_h) ); - } - else - { - /* - The image is way bigger than the screen, resize maintaining aspect ratio - - $src_w, $src_h: original image sizes - $dst_w, $dst_h: screen width and height - $img_relation = $src_w/$src_h; - - Either $dst_w decisive or $dst_h, usually $dst_h - */ - - var tmp_height = dst_w / img_relation; // calc the new height with screen width - if (tmp_height > dst_h) // we were wrong, it's still widther than screen -> $dst_h is decisive - { - var returnarray = new Array( Math.round(img_relation*dst_h), Math.round(dst_h) ); - } - else - { - var returnarray = new Array( Math.round(dst_w), Math.round(tmp_height) ); - } - } - - return returnarray; - }, - - - // ----------------------------------------------------------------------------------- - // Comments - // ----------------------------------------------------------------------------------- - - setComments: function() - { - $('linDivComments').innerHTML = ''; - - if(this.xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) - { - var tagcomment = this.xmlDoc[IdCurrent].getElementsByTagName('comment').item(i); - var commenttime = document.createTextNode( tagcomment.getElementsByTagName('time').item(0).firstChild.data + ' by ' ); - var commentauthor = document.createTextNode( tagcomment.getElementsByTagName('author').item(0).firstChild.data ); -// var commenttext = document.createTextNode( tagcomment.getElementsByTagName('text').item(0).firstChild.data ); - - var commenttextdiv = Builder.node('div', {id: 'linComment'+i}); - - $('linDivComments').appendChild(commenttime); - $('linDivComments').appendChild(commentauthor); - $('linDivComments').appendChild( document.createElement("hr") ); - $('linDivComments').appendChild(commenttextdiv); - $('linDivComments').appendChild( document.createElement("br") ); - $('linDivComments').appendChild( document.createElement("br") ); - - $('linComment'+i).innerHTML = tagcomment.getElementsByTagName('text').item(0).firstChild.data; - } - } - }, - - saveComment: function(t) - { - // not use 'this.' doesnt work if call from ajax success function - - myLinImage.xmlDoc[IdCurrent] = t.responseXML.documentElement; - - if(myLinImage.xmlDoc[IdCurrent].getElementsByTagName('commentadded').length > 0) - { - myLinImage.initTextareaAddComment(); - myLinGlobal.linSyslog( myLinImage.xmlDoc[IdCurrent].getElementsByTagName('commentadded').item(0).firstChild.data ); - } - - //myLinImage.loadImage(IdCurrent); - myLinImage.setComments(); - }, - - /** - * openTextarea() - * - * opens the bigger textarea to enter longer image comments - * this function is defined in view_img_static.html.php too - */ - openTextarea: function() - { - Element.show('linDivAddCommentTextarea'); - Element.hide('linDivAddCommentText'); - - $('linInputAddCommentTextarea').value = $('linInputAddCommentText').value; - }, - - initTextareaAddComment: function() - { - Element.hide('linDivAddCommentTextarea'); - Element.show('linDivAddCommentText'); - - $('linInputAddCommentTextarea').value = ''; - $('linInputAddCommentText').value = ''; - }, - - - // ----------------------------------------------------------------------------------- - // Meta functions - // ----------------------------------------------------------------------------------- - - updateLinId: function(elemId) - { - elemId.href = elemId.href.replace( /linId=[0-9]*/g , "linId=" + IdCurrent ); - } - - - // ----------------------------------------------------------------------------------- - // Common used functions - // ----------------------------------------------------------------------------------- - - /** - * resizeWindow, use this wrapper function because internet explorer triggers the resize event to fast - */ - /*resizeWindow: function () - { - clearTimeout(this.timerResize); - this.timerResize = setTimeout(linImageWrapper,250); - }*/ -} - -/** - * linImageWrapper() - * - * use this wrapper function if called from setTimeout() - * because 'this.' would not work otherwise - */ -function linOnResizeWrapper() -{ - if(myLinImage.fullscreenActive) - { - /** - * delete preloaded images after starting fullscreen and resizing window - */ - myLinImage.finishedPreloadedImages = new Array(); - - myLinGlobal.setWindowSize(); - maxImageWidth = myLinGlobal.linInnerWidth - 70; - maxImageHeight = myLinGlobal.linInnerHeight - 120; - - myLinImage.loadImage( IdCurrent ); - } - else - { - myLinImage.setImageInfoLink(); - // myLinGlobal.setMainHeight(); - } -} - -/** - * init on finished page load - */ -function initLinImage() -{ - $('linDivMainimage').style.height = startImgHeight + 'px'; // initial sets correct height at begin and not after the image is loaded - myLinImage = new LinImage(); - - /** - * doing something very important! - * rebuild the browsers histroy back, forware and reload functions - * if we have a #idCurrent=xyz in the url use this as the id - */ - if( document.location.hash.indexOf('idCurrent') != -1 ) - { - IdCurrent = document.location.hash.substr(11); - } - - /** - * ... [truncated message content] |
From: <fan...@us...> - 2008-04-26 11:11:00
|
Revision: 4923 http://linpha.svn.sourceforge.net/linpha/?rev=4923&view=rev Author: fangehrn Date: 2008-04-26 04:10:52 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Added Paths: ----------- trunk/linpha2/lib/plugins/maps/class.googlemaps.YUI.js Copied: trunk/linpha2/lib/plugins/maps/class.googlemaps.YUI.js (from rev 4922, trunk/linpha2/lib/plugins/maps/class.googlemaps.js) =================================================================== --- trunk/linpha2/lib/plugins/maps/class.googlemaps.YUI.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/class.googlemaps.YUI.js 2008-04-26 11:10:52 UTC (rev 4923) @@ -0,0 +1,270 @@ + +var LinMapObject = Class.create(); +var myLinMapObject; + +var googlemap = false; // the main google map object +var geocoder = false; // the main google geocoder object + +LinMapObject.prototype = +{ + /** + * initialize() + * Constructor runs on completion of the DOM loading. + */ + initialize: function() + { + this.bounds = false; + }, + + createMap: function() + { + var mapType = 'hybrid'; // 'normal', 'satellite' + var mapLargeControl = 1; + var mapMouseZoom = 1; + var mapOverview = 1; + var mapMinZoom = 1; + var mapMaxZoom = 23; + var mapDefaultZoom = 4; + var mapDefaultLat = 49.9801; + var mapDefaultLng = 10.8731; + + geocoder = new GClientGeocoder(); + googlemap = new google.maps.Map2(document.getElementById("linDivMapObject")); + + googlemap.setCenter(new google.maps.LatLng(mapDefaultLat, mapDefaultLng), mapDefaultZoom); + + switch(mapType) { + case 'normal': + googlemap.setMapType(G_NORMAL_MAP); + break; + case 'satellite': + googlemap.setMapType(G_SATELLITE_MAP); + break; + case 'hybrid': + googlemap.setMapType(G_HYBRID_MAP); + break; + } + + + if(mapMouseZoom) { + googlemap.enableScrollWheelZoom(); + var mapdiv = document.getElementById("linDivMapObject"); + GEvent.addDomListener(mapdiv, "DOMMouseScroll", linMapWheelevent); + mapdiv.onmousewheel = linMapWheelevent; + } + if(mapOverview) { + googlemap.addControl(new GOverviewMapControl()); + } + + if(mapLargeControl) { + googlemap.addControl(new GLargeMapControl()); + } else { + googlemap.addControl(new GSmallMapControl()); + } + + googlemap.addControl(new GMapTypeControl()); + + var mycontrol = new GMapTypeControl(); + googlemap.addControl(mycontrol); + new GKeyboardHandler(googlemap); + googlemap.enableDoubleClickZoom(); + googlemap.enableContinuousZoom(); + + + // prevent memory leaks in internet explorer + Event.observe(window, 'unload', GUnload, false); + GEvent.addListener(googlemap, "zoomend", myLinMaps.updateEditMarker); + }, + + initBounds: function() + { + this.bounds = new GLatLngBounds(); + }, + updateCenter: function( zoom ) + { + if( zoom == 0 ) { + zoom = googlemap.getBoundsZoomLevel(this.bounds); + } + + googlemap.setCenter(this.bounds.getCenter(), zoom); + }, + + createMarker: function( markerNode, markerType, openMarker ) + { + /*var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + //{icon: icon, draggable: true}*/ + + /** + * + http://www.google.com/intl/de_ALL/mapfiles/marker.png + http://www.google.com/intl/de_ALL/mapfiles/shadow50.png + + http://maps.google.com/mapfiles/ms/micons/red.png + http://maps.google.com/mapfiles/ms/micons/blue.png + http://maps.google.com/mapfiles/ms/micons/green.png + http://maps.google.com/mapfiles/ms/micons/lightblue.png + http://maps.google.com/mapfiles/ms/micons/yellow.png + http://maps.google.com/mapfiles/ms/micons/purple.png + http://maps.google.com/mapfiles/ms/micons/pink.png + + http://maps.google.com/mapfiles/ms/micons/red-dot.png + http://maps.google.com/mapfiles/ms/micons/blue-dot.png + http://maps.google.com/mapfiles/ms/micons/green-dot.png + http://maps.google.com/mapfiles/ms/micons/ltblue-dot.png + http://maps.google.com/mapfiles/ms/micons/yellow-dot.png + http://maps.google.com/mapfiles/ms/micons/purple-dot.png + http://maps.google.com/mapfiles/ms/micons/pink-dot.png + + http://maps.google.com/mapfiles/ms/micons/pushpin_shadow.png + http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png + http://maps.google.com/mapfiles/ms/micons/red-pushpin.png + http://maps.google.com/mapfiles/ms/micons/grn-pushpin.png + http://maps.google.com/mapfiles/ms/micons/ltblu-pushpin.png + http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png + http://maps.google.com/mapfiles/ms/micons/purple-pushpin.png + http://maps.google.com/mapfiles/ms/micons/pink-pushpin.png + * + */ + + //alert( markerNode.id + ' ' + markerNode.name + ' ' + markerNode.lat + ' ' + markerNode.lon); + + var point = new GLatLng( markerNode.lat, markerNode.lon); + + switch(markerNode.type) { + case 'album': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/blue-dot.png") + break; + case 'marker': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/purple-dot.png") + break; + case 'albumWithImg': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/green-dot.png") + break; + case 'images': + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/yellow-dot.png") + break; + default: + var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/blue-dot.png") + break; + } + icon.iconSize = new GSize(32, 32); + var marker = new GMarker(point, icon); + + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml( linGetMarkerHtml(markerNode) ); + }); + + googlemap.addOverlay( marker ); + + this.bounds.extend(point); + + if( openMarker ) { + GEvent.trigger(marker, 'click'); + } + + return marker; + }, + + createEditMarker: function( center ) + { + myLinMaps.editMarker = new GMarker(center, {draggable: true}); + + var inputForm = document.createElement("form"); + inputForm.setAttribute("action",""); + inputForm.setAttribute("method","POST"); + inputForm.setAttribute("id","linFormEditMarker"); + inputForm.onsubmit = function() {myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, Form.serialize(this),myLinMaps.saveMarker); return false;}; + inputForm.innerHTML = $('linDivEditMarker').innerHTML; + + myLinMaps.editMarker.bindInfoWindow( inputForm ); // The marker.bindInfoWindow*() methods create GEvent listeners that perform the corresponding marker.openInfoWindow*() calls when the marker is clicked. + + GEvent.addListener(myLinMaps.editMarker, "drag", function() { + myLinMaps.updateEditMarker(); + }); + + /*GEvent.addListener(marker, "dragstart", function() { + map.closeInfoWindow(); + });*/ + + GEvent.addListener(myLinMaps.editMarker, "dragend", function() { + GEvent.trigger(myLinMaps.editMarker, 'click'); + }); + + googlemap.addOverlay( myLinMaps.editMarker ); + GEvent.trigger(myLinMaps.editMarker, 'click'); + myLinMaps.updateEditMarker(); + }, + + closeMarkerWindows: function() { + googlemap.closeInfoWindow(); + }, + + removeMarker: function( marker) + { + googlemap.removeOverlay( marker ); + }, + + openImage: function(imgIndex) + { + GEvent.trigger(myLinMaps.imagesObj[imgIndex], 'click'); + }, + + checkResize: function() + { + //alert("typeof googlemap.checkResize: " + typeof googlemap.checkResize ); + if( typeof googlemap.checkResize != "undefined" ) { + googlemap.checkResize(); + } + }, + + geocodeAddress: function(address) + { + if( myLinMaps.editMarker ) + { + googlemap.removeOverlay( myLinMaps.editMarker ); + } + + if( address == '' ) + { + this.createEditMarker( googlemap.getCenter() ); + } + else + { + geocoder.getLatLng( + address, + function(point) + { + if(!point) { + alert(address + " not found"); + } else { + googlemap.setCenter(point, myLinMaps.defaultMarkerZoom); + myLinMapObject.createEditMarker( point ); + $('linInputMarkerName').value = address; + } + } + ); + } + } +} + + +function linMapWheelevent(e) +{ + if (!e) e = window.event; + if (e.preventDefault) e.preventDefault(); + e.returnValue = false; +} + +function linMapObjectInit() +{ + myLinMapObject = new LinMapObject(); + + google.load("maps", "2.x"); + google.setOnLoadCallback(myLinMapObject.createMap); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-26 09:24:17
|
Revision: 4922 http://linpha.svn.sourceforge.net/linpha/?rev=4922&view=rev Author: fangehrn Date: 2008-04-26 02:23:26 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Added Paths: ----------- trunk/linpha2/lib/plugins/maps/LinMapsYUI.js Copied: trunk/linpha2/lib/plugins/maps/LinMapsYUI.js (from rev 4921, trunk/linpha2/lib/plugins/maps/LinMaps.js) =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMapsYUI.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/LinMapsYUI.js 2008-04-26 09:23:26 UTC (rev 4922) @@ -0,0 +1,355 @@ + +/** + * class and global definitions + */ +var LinMaps = Class.create(); +var myLinMaps; + +LinMaps.prototype = +{ + /** + * initialize() + * Constructor runs on completion of the DOM loading. + */ + initialize: function() + { + this.editMarker = false; + this.showNav = true; + this.defaultMarkerZoom = linMapsDefaultMarkerZoom; + + this.markersData = false; + this.markersObj = new Array(); + this.imagesObj = new Array(); + + this.ajaxUrl = linUrlBase + '&linId=' + linIdCurrent + '&xml'; + }, + + /** + * Marker functions + */ + loadMarkers: function() + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=loadMarkers',myLinMaps.showMarkers); + }, + showMarkers: function(t) + { + var i; + + myLinMaps.markersData = eval('(' + t.responseText + ')'); + //myLinMaps.markers = t.responseText.evalJSON(true); + + /** + * delete existing markers + */ + if( myLinMaps.markersObj ) + { + for( i = 0; i < myLinMaps.markersObj.length; i++ ) + { + myLinMapObject.removeMarker( myLinMaps.markersObj[i] ); + } + + myLinMaps.markersObj = new Array(); + } + + /** + * draw new markers + */ + myLinMapObject.initBounds(); + + for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) + { + myLinMaps.markersObj[i] = myLinMapObject.createMarker( myLinMaps.markersData.markers[i], false ); + } + + /** + * update center + * only if there is more than one marker + * prevent zooming to high + */ + if( i > 0) { + if( i == 1 ) { + myLinMapObject.updateCenter( myLinMaps.markersData.markers[0].zoom ); + } else { + myLinMapObject.updateCenter( 0 ); + } + } + }, + + updateEditMarker: function() + { + if( myLinMaps.editMarker ) // marker activated. use myLinMaps. instead of "this." when fired from GEvent class + { + latlng = myLinMaps.editMarker.getPoint(); + $('linFormEditMarker').linInputLat.value = latlng.lat(); + $('linFormEditMarker').linInputLon.value = latlng.lng(); + $('linFormEditMarker').linInputZoom.value = googlemap.getZoom(); + } + }, + + saveMarker: function(t) + { + xmlAnswer = t.responseXML.documentElement; + + if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) + { + myLinMaps.removeEditMarker(); + + myLinMaps.loadMarkers(); + } + else + { + alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); + } + }, + + deleteMarker: function(markerId) + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=deleteMarker&markerId='+markerId,myLinMaps.deleteMarkerFinish); + }, + deleteMarkerFinish: function(t) + { + xmlAnswer = t.responseXML.documentElement; + + if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) + { + var markerId = xmlAnswer.getElementsByTagName('responseData').item(0).firstChild.data; + + for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) + { + if( myLinMaps.markersData.markers[i].id == markerId ) + { + myLinMapObject.removeMarker( myLinMaps.markersObj[i] ); + myLinMaps.markersObj[i] = false; + } + } + } + else + { + alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); + } + }, + + removeEditMarker: function() + { + myLinMapObject.removeMarker( this.editMarker ); + this.editMarker = false; + }, + + assignAlbum: function(markerId,albId) + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbum&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); + }, + assignAlbumChange: function(markerId,albId) { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbumChange&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); + }, + assignAlbumDelete: function(markerId,albId) + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=assignAlbumDelete&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); + }, + assignAlbumFinish: function(t) + { + xmlAnswer = t.responseXML.documentElement; + + // recreate marker on success + if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) + { + myLinMaps.loadMarkers(); + } + else + { + // print error message + alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); + } + }, + + loadAlbums: function() + { + myLinGlobal.AjaxPost(myLinMaps.ajaxUrl, 'cmd=loadAlbums',myLinMaps.showAlbums); + }, + showAlbums: function(t) + { + $('linDivMapAlbums').innerHTML = ''; + albumsData = eval('(' + t.responseText + ')'); + + for( i = 0; i < albumsData.albums.length; i++ ) + { + $('linDivMapAlbums').innerHTML += + '<a href="javascript:myLinMaps.loadImages(' + albumsData.albums[i].id + ')">' + + albumsData.albums[i].name + '</a><br />'; + } + + myLinGlobal.createPopup('linDivPopupAlbums'); + }, + + /** + * Thumbnail functions + */ + loadImages: function(albId) + { + this.startLoading(); + + myLinMapObject.closeMarkerWindows(); + + if( !this.showNav ) { + this.toggleNav(); + } + + myLinGlobal.AjaxPost(this.ajaxUrl, 'cmd=loadImages&albId='+albId,myLinMaps.showImages); + + }, + showImages: function(t) + { + myLinMaps.imagesData = eval('(' + t.responseText + ')'); + //myLinMaps.images = t.responseText.evalJSON(true); + + /** + * delete existing images + */ + $('linDivMapNav').innerHTML = ''; + if( myLinMaps.imagesObj ) + { + for( i = 0; i < myLinMaps.imagesObj.length; i++ ) + { + myLinMapObject.removeMarker( myLinMaps.imagesObj[i] ); + } + + myLinMaps.imagesObj = new Array(); + } + + + /** + * draw new markers / create thumbnails list + */ + myLinMapObject.initBounds(); + + for( i = 0; i < myLinMaps.imagesData.images.length; i++ ) + { + thumbId = myLinMaps.imagesData.images[i].id; + + var ElemImg = Builder.node('img', {src: thumbSrc + thumbId, className: 'linImgMapThumb', width: displayThumbSize, height: displayThumbSize}); + var ElemA = Builder.node('a', {id: "thumb_"+thumbId, href: 'javascript:myLinMapObject.openImage(' + i + ')'}); + var ElemDiv = Builder.node('div', {className: 'linDivMapsThumb'}); + + ElemA.appendChild( ElemImg ); + ElemDiv.appendChild( ElemA ); + $('linDivMapNav').appendChild(ElemDiv); + + if( i == 0 ) + myLinMaps.imagesObj[i] = myLinMapObject.createMarker( myLinMaps.imagesData.images[i], true ); + else + myLinMaps.imagesObj[i] = myLinMapObject.createMarker( myLinMaps.imagesData.images[i], false ); + } + + myLinMapObject.updateCenter(0); + + myLinMaps.stopLoading(); + + }, + + toggleNav: function() + { + + if( this.showNav ) + { + Element.hide('linDivMapNav'); + + // backup current margin + $('linDivMapNav').style.marginRight = $('linDivMapObject').style.marginRight; + + $('linDivMapObject').style.marginRight = '7px'; + + this.showNav = false; + } + else + { + // restore saved margin + $('linDivMapObject').style.marginRight = $('linDivMapNav').style.marginRight; + $('linDivMapNav').style.marginRight = 0; + + Element.show('linDivMapNav'); + + this.showNav = true; + } + + // update google map size + myLinMapObject.checkResize(); + }, + + + + startLoading: function() { + Element.show('linDivLoadingOuter'); + }, + stopLoading: function() { + Element.hide('linDivLoadingOuter'); + } + + + + + + + + +} // end class LinMaps + +function linOnResizeWrapper() +{ + myLinGlobal.setWindowSize(); + var newHeight = myLinGlobal.linInnerHeight - $('linDivMain').offsetTop - $('linDivMapBottom').offsetHeight - 30; + if(newHeight < 100) + { + newHeight = 100; + } + + $('linDivMapNav').style.height = newHeight + 'px'; + $('linDivMapMain').style.height = newHeight + 'px'; + + + /** + * tempoarely set the map heigth to a small value (zero does not work!) + * in IE setMainHeight() would not work while reducing the window size + * because IE takes always as much space as he actually needs ignoring + * the height attribute + */ + + /*$('linDivMapNav').style.height = '10px'; + $('linDivMapMain').style.height = '10px'; + + myLinGlobal.setMainHeight(); + + $('linDivMapMain').style.height = ($('linDivMain').offsetHeight - $('linDivMapTop').offsetHeight - $('linDivMapBottom').offsetHeight - 5) + 'px';*/ + + /** + * set also height of the navigation bar + * overflow:auto does not work in IE with height: 100% + */ + /*$('linDivMapNav').style.height = $('linDivMapMain').style.height;*/ + + // resize also google map itself + myLinMapObject.checkResize(); +} + +/** + * initLinMaps() + * + * create the class object + */ +function initLinMaps() +{ + myLinMaps.toggleNav(); + + /*if( doLoadAlbums ) + myLinMaps.loadAlbums();*/ + + //linEnableOnResize(); + //linOnResizeWrapper(); + myLinPage.enableOnResize('maps'); + + myLinMaps.loadMarkers(); +} +Event.observe(window, 'load', initLinMaps, false); +//Event.observe(body, 'load', initLinMaps, false); + +myLinMaps = new LinMaps(); +linMapObjectInit(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-04-26 09:22:54
|
Revision: 4921 http://linpha.svn.sourceforge.net/linpha/?rev=4921&view=rev Author: fangehrn Date: 2008-04-26 02:22:48 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/linpha2/lib/plugins/maps/LinMaps.js Modified: trunk/linpha2/lib/plugins/maps/LinMaps.js =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMaps.js 2008-04-08 20:42:02 UTC (rev 4920) +++ trunk/linpha2/lib/plugins/maps/LinMaps.js 2008-04-26 09:22:48 UTC (rev 4921) @@ -21,7 +21,7 @@ this.markersObj = new Array(); this.imagesObj = new Array(); - this.ajaxUrl = linUrlBase + '&linId=' + IdCurrent + '&xml'; + this.ajaxUrl = linUrlBase + '&linId=' + linIdCurrent + '&xml'; }, /** @@ -326,7 +326,7 @@ */ /*$('linDivMapNav').style.height = $('linDivMapMain').style.height;*/ - // resize google map itself also + // resize also google map itself myLinMapObject.checkResize(); } @@ -342,12 +342,14 @@ /*if( doLoadAlbums ) myLinMaps.loadAlbums();*/ - linEnableOnResize(); - linOnResizeWrapper(); + //linEnableOnResize(); + //linOnResizeWrapper(); + myLinPage.enableOnResize('maps'); myLinMaps.loadMarkers(); } Event.observe(window, 'load', initLinMaps, false); +//Event.observe(body, 'load', initLinMaps, false); myLinMaps = new LinMaps(); linMapObjectInit(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: bzrudi <bz...@us...> - 2008-04-18 12:20:22
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6077 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1279 retrieving revision 1.1280 diff -C2 -d -r1.1279 -r1.1280 *** ChangeLog 15 Apr 2008 08:39:14 -0000 1.1279 --- ChangeLog 18 Apr 2008 12:20:19 -0000 1.1280 *************** *** 1,2 **** --- 1,8 ---- + ############################################### + ### ### + ### LinPHA 1.3.4 RELEASE! ### + ### ### + ############################################### + 2008-04-15 bzrudi * metadata_editor.php: check md5sum before executing SQL query |
From: bzrudi <bz...@us...> - 2008-04-16 06:58:23
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12045 Modified Files: footer.php Log Message: change to version 1.3.4 Index: footer.php =================================================================== RCS file: /cvsroot/linpha/linpha/footer.php,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** footer.php 15 Jan 2008 12:41:06 -0000 1.55 --- footer.php 16 Apr 2008 06:58:19 -0000 1.56 *************** *** 7,11 **** <tr> <td class='footerleft' width='200' style="white-space:nowrap"> ! LinPHA <?php echo $str_Version; ?> 1.3.3</td> <td class='footercenter' width='50%' style="white-space:nowrap"><b>----->>>>Have fun ----->>>></b></td> <td class='footerright' style="white-space:nowrap">2002-<?php echo date("Y"); ?> The LinPHA developers --- 7,11 ---- <tr> <td class='footerleft' width='200' style="white-space:nowrap"> ! LinPHA <?php echo $str_Version; ?> 1.3.4</td> <td class='footercenter' width='50%' style="white-space:nowrap"><b>----->>>>Have fun ----->>>></b></td> <td class='footerright' style="white-space:nowrap">2002-<?php echo date("Y"); ?> The LinPHA developers |