linpha-cvs Mailing List for LinPHA PHP Photo Gallery (Page 7)
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: Tadashi J. <el...@us...> - 2008-01-16 17:42:26
|
Update of /cvsroot/linpha/linpha/lang In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27512/lang Modified Files: lang.Japanese.php Log Message: * fixed xss. * fixed typo translation. Index: lang.Japanese.php =================================================================== RCS file: /cvsroot/linpha/linpha/lang/lang.Japanese.php,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** lang.Japanese.php 16 Jan 2008 17:05:31 -0000 1.176 --- lang.Japanese.php 16 Jan 2008 17:42:21 -0000 1.177 *************** *** 774,778 **** $gb_header="LinPHA ã²ã¹ãããã¯"; $gb_opts="ã²ã¹ãããã¯ãªãã·ã§ã³"; ! $gb_rows="ãã¼ã¸ãã¤ã«è¡¨ç¤ºããæç¨¿æ°"; $gb_anon="å¿åã®ã²ã¹ãããã¯ã¸ã®æç¨¿ã許å¯ãã"; $gb_order="æç¨¿é åº"; --- 774,778 ---- $gb_header="LinPHA ã²ã¹ãããã¯"; $gb_opts="ã²ã¹ãããã¯ãªãã·ã§ã³"; ! $gb_rows="ãã¼ã¸æ¯ã«è¡¨ç¤ºããæç¨¿æ°"; $gb_anon="å¿åã®ã²ã¹ãããã¯ã¸ã®æç¨¿ã許å¯ãã"; $gb_order="æç¨¿é åº"; |
From: Tadashi J. <el...@us...> - 2008-01-16 17:05:36
|
Update of /cvsroot/linpha/linpha/lang In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15205/lang Modified Files: lang.English.php lang.Japanese.php Log Message: * updated Japanese translation. * fixed typo. Index: lang.English.php =================================================================== RCS file: /cvsroot/linpha/linpha/lang/lang.English.php,v retrieving revision 1.259 retrieving revision 1.260 diff -C2 -d -r1.259 -r1.260 *** lang.English.php 3 Jul 2007 16:03:49 -0000 1.259 --- lang.English.php 16 Jan 2008 17:05:31 -0000 1.260 *************** *** 1132,1136 **** $maps_setup_google_key="Your Google Key"; /* (maps plugin) -- */ $maps_setup_php_version_warning="Sorry - This Plugin requires at least PHP Version 4.2.0 or newer. Please update PHP"; /* (maps plugin) -- */ ! $maps_select_type="Please sleect Map Type:"; /* (maps plugin) -- */ $maps_select_type_info="<-- select whether to use Google or Yahoo maps"; /* (maps plugin) -- */ $maps_select_display_type="Please choose Map display Type:"; /* (maps plugin) -- */ --- 1132,1136 ---- $maps_setup_google_key="Your Google Key"; /* (maps plugin) -- */ $maps_setup_php_version_warning="Sorry - This Plugin requires at least PHP Version 4.2.0 or newer. Please update PHP"; /* (maps plugin) -- */ ! $maps_select_type="Please select Map Type:"; /* (maps plugin) -- */ $maps_select_type_info="<-- select whether to use Google or Yahoo maps"; /* (maps plugin) -- */ $maps_select_display_type="Please choose Map display Type:"; /* (maps plugin) -- */ *************** *** 1150,1154 **** $map_pan_ctrl_info="<-- show Map pan controls in Map"; /* (maps plugin) -- */ $map_auto_popup="Enable Marker Auto Popup"; /* (maps plugin) -- */ ! $map_auto_popup_info="<-- auto show Marker Popups on mousover"; /* (maps plugin) -- */ $map_album_add="Add Album"; /* (maps plugin) -- */ $map_marker_del="Delete Marker"; /* (maps plugin) -- */ --- 1150,1154 ---- $map_pan_ctrl_info="<-- show Map pan controls in Map"; /* (maps plugin) -- */ $map_auto_popup="Enable Marker Auto Popup"; /* (maps plugin) -- */ ! $map_auto_popup_info="<-- auto show Marker Popups on mouseover"; /* (maps plugin) -- */ $map_album_add="Add Album"; /* (maps plugin) -- */ $map_marker_del="Delete Marker"; /* (maps plugin) -- */ Index: lang.Japanese.php =================================================================== RCS file: /cvsroot/linpha/linpha/lang/lang.Japanese.php,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** lang.Japanese.php 3 Jul 2007 16:03:49 -0000 1.175 --- lang.Japanese.php 16 Jan 2008 17:05:31 -0000 1.176 *************** *** 63,68 **** $exif_check_msg="EXIF ãµãã¼ãã調æ»ä¸..."; $summary_msg="è¦ç´:"; ! $safe_mode_err="ããªãã®ãµã¼ãã¼ã® PHP 㯠PHP safe_mode ã«è¨å®ããã¦ãã¾ããLinPHA will not work ! as long as safe_mode is enabled in php.ini !"; $inst_abort_msg="!!! ã¤ã³ã¹ãã¼ã«ã䏿¢ãã¾ããã !!!"; $php_version_err="ããªãã®ãµã¼ãã¼ã¯ PHP 4.1.0 æªæºãå®è¡ããã¦ãã¾ããPHP ãã¢ããã°ã¬ã¼ãããªãéããLinPHA ã¯åä½ãã¾ããã"; --- 63,67 ---- $exif_check_msg="EXIF ãµãã¼ãã調æ»ä¸..."; $summary_msg="è¦ç´:"; ! $safe_mode_err="ããªãã®ãµã¼ãã¼ã® PHP 㯠PHP safe_mode ã«è¨å®ããã¦ãã¾ããLinPHA 㯠php.ini ã§ safe_mode ãæå¹ã§ã¯åä½ããªãã§ããã !"; $inst_abort_msg="!!! ã¤ã³ã¹ãã¼ã«ã䏿¢ãã¾ããã !!!"; $php_version_err="ããªãã®ãµã¼ãã¼ã¯ PHP 4.1.0 æªæºãå®è¡ããã¦ãã¾ããPHP ãã¢ããã°ã¬ã¼ãããªãéããLinPHA ã¯åä½ãã¾ããã"; *************** *** 106,115 **** $inst_db_header="LinPHA ãã¼ã¿ãã¼ã¹æ¥ç¶è¨å®"; $inst_db_host="ãã¹ãå:"; ! $inst_db_host_info="<-ãã¹ãå: 代表çã«ã¯ "localhost""; $inst_db_host_info2="<-ãã¹ãå: MySQL ãã¼ã¿ãã¼ã¹ãã¹ãå"; $inst_db_host_port="ãã¼ãçªå·:"; $inst_db_host_port_info="<-ãã¼ãçªå·: ä¸ç¢ºå®ãªå ´åããã®ã¾ã¾æ®ãã¾ã"; $inst_db_name="LinPHA ãã¼ã¿ãã¼ã¹å:"; ! $inst_db_name_info="<-LinPHA ã®ããã®ãã¼ã¿ãã¼ã¹åã, 代表çã«ã¯ "linpha""; $inst_db_name2="ãã¼ã¿ãã¼ã¹å:"; $inst_db_name_info2="<-ISP ããä¸ãããããã¼ã¿ãã¼ã¹å"; --- 105,114 ---- $inst_db_header="LinPHA ãã¼ã¿ãã¼ã¹æ¥ç¶è¨å®"; $inst_db_host="ãã¹ãå:"; ! $inst_db_host_info="<-ãã¹ãå: 代表çã«ã¯ "localhost" ã§ã"; $inst_db_host_info2="<-ãã¹ãå: MySQL ãã¼ã¿ãã¼ã¹ãã¹ãå"; $inst_db_host_port="ãã¼ãçªå·:"; $inst_db_host_port_info="<-ãã¼ãçªå·: ä¸ç¢ºå®ãªå ´åããã®ã¾ã¾æ®ãã¾ã"; $inst_db_name="LinPHA ãã¼ã¿ãã¼ã¹å:"; ! $inst_db_name_info="<-LinPHA ã®ããã®ãã¼ã¿ãã¼ã¹åã, 代表çã«ã¯ "linpha" ã§ã"; $inst_db_name2="ãã¼ã¿ãã¼ã¹å:"; $inst_db_name_info2="<-ISP ããä¸ãããããã¼ã¿ãã¼ã¹å"; *************** *** 135,145 **** /* forth_stage_install (page 4) */ ! $inst_status_4="ããã§ã¨ããããã¾ããã¤ã³ã¹ãã¼ã«ã«æåãã¾ãã!LinPHA ã¯ä»ä½¿ãæºåãåºæ¥ã¾ããã"; $inst_status_step4="ã¹ããã 4/4"; $inst_submit="å®äº"; $inst_db_tryconn="ãã¼ã¿ãã¼ã¹ã¸ã®æ¥ç¶ã«ææ¦ãã¾ãã"; ! $inst_db_tryconn_error="ãã¼ã¿ãã¼ã¹ãµã¼ãã¼ã¸ã®æ¥ç¶ã®ææ¦ã§ã¨ã©ã¼ãçºçãã¾ãããusing:"; $inst_db_tryconn_ok="OK, æ¥ç¶ãã¾ãã!"; ! $inst_db_tryinst="ãã¼ã¿ãã¼ã¹ã®ä½æã«ææ¦ãã¾ãã"; $inst_db_tryinst_error="ãã¼ã¿ãã¼ã¹ã®ä½æä¸ã®ã¨ã©ã¼:"; $inst_db_tryinst_ok="OK, 使ãã¾ãã!"; --- 134,144 ---- /* forth_stage_install (page 4) */ ! $inst_status_4="ããã§ã¨ããããã¾ããã¤ã³ã¹ãã¼ã«ã«æåãã¾ãã! ãã ãã¾ LinPHA ãä½¿ãæºåãã§ãã¾ããã"; $inst_status_step4="ã¹ããã 4/4"; $inst_submit="å®äº"; $inst_db_tryconn="ãã¼ã¿ãã¼ã¹ã¸ã®æ¥ç¶ã«ææ¦ãã¾ãã"; ! $inst_db_tryconn_error="ãã¼ã¿ãã¼ã¹ãµã¼ãã¼ã¸ã®æ¥ç¶ã®ã試ã¿ã¾ãããã¨ã©ã¼ãçºçãã¾ãããusing:"; $inst_db_tryconn_ok="OK, æ¥ç¶ãã¾ãã!"; ! $inst_db_tryinst="ãã¼ã¿ãã¼ã¹ã®ä½æã試ã¿ã¾ãã"; $inst_db_tryinst_error="ãã¼ã¿ãã¼ã¹ã®ä½æä¸ã®ã¨ã©ã¼:"; $inst_db_tryinst_ok="OK, 使ãã¾ãã!"; *************** *** 245,249 **** $detail_header1="/"; $detail_header2="ãã©ã«ãã¼å "; ! $php_to_old="PHP < 4.2.0 EXIF disabled!"; $views="表示"; $slideshow="ã¹ã©ã¤ãã·ã§ã¼"; --- 244,248 ---- $detail_header1="/"; $detail_header2="ãã©ã«ãã¼å "; ! $php_to_old="PHP ãã¼ã¸ã§ã³ 4.2.0 æªæºã¯ EXIF ãç¡å¹ã§ã!"; $views="表示"; $slideshow="ã¹ã©ã¤ãã·ã§ã¼"; *************** *** 268,272 **** $login_request_target="LinPHA 管çè ã¸é£çµ¡"; $login_admin_info="LinPHA 管çè ã¢ã«ã¦ã³ãã§ãã°ã¤ã³ãã管çã¿ã¹ã¯ãè¡ãã¾ãã"; ! $login_friend_account_info="ããæ¢ã« "friend" ã¢ã«ã¦ã³ããæã£ã¦ããã¨ãã¯ãããã§å人ã®ã»ããã£ã³ã°ãä¿®æ£ãããã¨ãã§ãã¾ãã"; --- 267,271 ---- $login_request_target="LinPHA 管çè ã¸é£çµ¡"; $login_admin_info="LinPHA 管çè ã¢ã«ã¦ã³ãã§ãã°ã¤ã³ãã管çã¿ã¹ã¯ãè¡ãã¾ãã"; ! $login_friend_account_info="ããæ¢ã« "friend" ã¢ã«ã¦ã³ããæã£ã¦ããã¨ãã¯ãããã§å人ã®è¨å®ãä¿®æ£ãããã¨ãã§ãã¾ãã"; *************** *** 526,530 **** define('STR_RENAMEENTERNEWNAME', '%s ã®æ°è¦åç§°å ¥å:'); define('STR_RENAMEBUTTON', 'åç§°å¤æ´'); ! define('STR_ERROR_DIR','ã¨ã©ã¼: ãã£ã¬ã¯ããªã®å 容ã®èªã¿è¾¼ã¿ãåºæ¥ã¾ããã'); define('STR_AUDIO', 'é³å£°'); define('STR_COMPRESSED', 'å§ç¸®æ¸ã¿'); --- 525,529 ---- define('STR_RENAMEENTERNEWNAME', '%s ã®æ°è¦åç§°å ¥å:'); define('STR_RENAMEBUTTON', 'åç§°å¤æ´'); ! define('STR_ERROR_DIR','ã¨ã©ã¼: ãã£ã¬ã¯ããªã®å 容ã®èªã¿è¾¼ã¿ãã§ãã¾ããã'); define('STR_AUDIO', 'é³å£°'); define('STR_COMPRESSED', 'å§ç¸®æ¸ã¿'); *************** *** 634,639 **** $new_user_retype_password="æ°è¦ãã¹ã¯ã¼ã(確èª)"; /* (admin.php) -- */ $select_db_header="ãã¼ã¿ãã¼ã¹ã¿ã¤ãã鏿ãã¦ãã ãã"; /* (sec_stage_install.php) -- */ ! $mysql_info="MySQLãã¼ã¿ãã¼ã¹ã¸ã®ã¢ã¯ã»ã¹ã®ããã«ãããé¸ãã§ãã ããã"; /* (sec_stage_install.php) -- */ ! $postgres_info="PostgreSQLãã¼ã¿ãã¼ã¹ã¸ã®ã¢ã¯ã»ã¹ã®ããã«ãããé¸ãã§ãã ããããã¡ããåç §ãã¦ãã ãã"; /* (sec_stage_install.php) -- reads: ...Please see info */ $login_autologin="èªåãã°ã¤ã³"; /* (toc.php) -- */ $login_autologin_user="èªåãã°ã¤ã³ ã¦ã¼ã¶ã¼æ å ±"; /* (toc.php) -- */ --- 633,638 ---- $new_user_retype_password="æ°è¦ãã¹ã¯ã¼ã(確èª)"; /* (admin.php) -- */ $select_db_header="ãã¼ã¿ãã¼ã¹ã¿ã¤ãã鏿ãã¦ãã ãã"; /* (sec_stage_install.php) -- */ ! $mysql_info="MySQL ãã¼ã¿ãã¼ã¹ã¸ã®ã¢ã¯ã»ã¹ã«ã¯ãããé¸ãã§ãã ããã"; /* (sec_stage_install.php) -- */ ! $postgres_info="PostgreSQL ãã¼ã¿ãã¼ã¹ã¸ã®ã¢ã¯ã»ã¹ã«ã¯ãããé¸ãã§ãã ããããã¡ããåç §ãã¦ãã ãã"; /* (sec_stage_install.php) -- reads: ...Please see info */ $login_autologin="èªåãã°ã¤ã³"; /* (toc.php) -- */ $login_autologin_user="èªåãã°ã¤ã³ ã¦ã¼ã¶ã¼æ å ±"; /* (toc.php) -- */ *************** *** 720,724 **** $bm_noimg_err="ã¨ã©ã¼ã§ãããã¡ã¤ã«ã¯ç»åã§ã¯ããã¾ããã"; $bm_tmpfile_err="䏿ç»åãã¡ã¤ã«ã®ä½æä¸ã®ããã¼ã§ãã"; ! $bm_tmpfile_warn="è¦å: 䏿ç»åã®åé¤ãåºæ¥ã¾ããã§ããã"; $bm_time_total="ç·å®è¡æé: "; $bm_img_sec="ç»å/ç§: "; --- 719,723 ---- $bm_noimg_err="ã¨ã©ã¼ã§ãããã¡ã¤ã«ã¯ç»åã§ã¯ããã¾ããã"; $bm_tmpfile_err="䏿ç»åãã¡ã¤ã«ã®ä½æä¸ã®ããã¼ã§ãã"; ! $bm_tmpfile_warn="è¦å: 䏿ç»åã®åé¤ãã§ãã¾ããã§ããã"; $bm_time_total="ç·å®è¡æé: "; $bm_img_sec="ç»å/ç§: "; *************** *** 1043,1048 **** $str_add_image_description="ç»åã®èª¬æã¨ã«ãã´ãªã®è¿½å "; /* (build_perms.php) -- */ $str_mail_add_all_users="ãã¹ã¦ã® linpha ã¦ã¼ã¶ã¼ãã¡ã¼ãªã³ã°ãªã¹ãã«è¿½å ãã"; /* (plugins/mail.php) -- */ ! $str_note_upload="<b>Note:</b> You don't have to upload your images through this form. You can use whatever you want (ftp,scp,nfs,local,...). Just copy them to the albums folder."; /* (plugins/ftp/index.php) -- */ ! $blacklist_opts="ãã©ãã¯ãªã¹ããªãã·ã§ã³ (SPAM ãããã¯)"; /* (varios) -- */ $blacklist_onoff="ã¡ãã»ã¼ã¸ãã£ã«ã¿ã¼ãæå¹ã«ãã"; /* (varios) -- */ $blacklist_keywords="黿¢ããåèª:"; /* (varios) -- */ --- 1042,1047 ---- $str_add_image_description="ç»åã®èª¬æã¨ã«ãã´ãªã®è¿½å "; /* (build_perms.php) -- */ $str_mail_add_all_users="ãã¹ã¦ã® linpha ã¦ã¼ã¶ã¼ãã¡ã¼ãªã³ã°ãªã¹ãã«è¿½å ãã"; /* (plugins/mail.php) -- */ ! $str_note_upload="<b>注æ:</b> You don't have to upload your images through this form. 使ç¨ãããã©ãã (ftp,scp,nfs,local,...) ãé¸ã¶ãã¨ãã§ãã¾ããJust copy them to the albums folder."; /* (plugins/ftp/index.php) -- */ ! $blacklist_opts="ãã©ãã¯ãªã¹ããªãã·ã§ã³ (SPAM é²å¾¡)"; /* (varios) -- */ $blacklist_onoff="ã¡ãã»ã¼ã¸ãã£ã«ã¿ã¼ãæå¹ã«ãã"; /* (varios) -- */ $blacklist_keywords="黿¢ããåèª:"; /* (varios) -- */ *************** *** 1082,1136 **** $mail_mailer_error=" - ã¡ã¼ã©ã¼ã¨ã©ã¼: "; /* (mailing.php) -- */ $str_log_events['comments']="ã¨ã³ããªã³ã¡ã³ã"; /* (log.php) -- */ ! $str_edit_members="Edit members"; /* (build_user.conf.php) -- */ ! $edit_groups="Edit groups "; /* (build_user.conf.php) -- */ ! $str_basket="Basket"; /* (various) -- */ ! $lang_plugins['log']="Logger"; /* (admin.php) -- */ ! $rss_created="XML RSS file generated successfully"; /* () -- */ ! $rss_not_created="RSS has not been built, because no change has been found"; /* () -- */ ! $rss_settings_saved="RSS settings saved"; /* () -- */ ! $lang_plugins['stats']="Statistics"; /* (various) -- */ $lang_plugins['RSS']="RSS"; /* (various) -- */ ! $str_no_watermarks="No Watermarks"; /* () -- */ ! $str_with_watermarks="With Watermarks"; /* () -- */ ! $str_create_cache_img="Create Cached Images"; /* () -- */ ! $str_reset_button="Reset"; /* () -- */ ! $cache_stats="Image Cache Stats"; /* () -- */ ! $drop_duplicates="Drop duplicates"; /* () -- */ ! $general_exif_rotate="Enable/Disable image auto rotation "; /* () -- */ ! $general_exif_rotate_info="<-- enable/disable image auto rotation by EXIF data"; /* () -- */ ! $lang_plugins['maps']="Google/Yahoo Maps"; /* () -- maps plugin */ ! $maps_setup_info_header="Google/Yahoo Maps Setup"; /* () -- maps plugin */ ! $maps_setup_yahoo_id="Your Yahoo Application ID"; /* (maps plugin) -- */ ! $maps_setup_google_key="Your Google Key"; /* (maps plugin) -- */ ! $maps_setup_php_version_warning="Sorry - This Plugin requires at least PHP Version 4.2.0 or newer. Please update PHP"; /* (maps plugin) -- */ ! $maps_select_type="Please sleect Map Type:"; /* (maps plugin) -- */ ! $maps_select_type_info="<-- select whether to use Google or Yahoo maps"; /* (maps plugin) -- */ ! $maps_select_display_type="Please choose Map display Type:"; /* (maps plugin) -- */ $maps_select_display_type_info="<-- show Hybrid, Sat or Regular Map"; /* (maps plugin) -- */ ! $maps_zoom_level="Default Zoom Level: 1-16 (Default 16, World Map)"; /* (maps plugin) -- */ ! $maps_zoom_level_info="<-- set default zoom level for Maps"; /* (maps plugin) -- */ ! $maps_zoom_location="Default location to center in view"; /* (maps plugin) -- */ ! $maps_zoom_location_info="<-- default location to center in Map"; /* (maps plugin) -- */ ! $maps_google_ctrl_size="Google Map controls size"; /* (maps plugin) -- */ ! $maps_google_ctrl_size_info="<-- adjust Google Maps slider and pan size"; /* (maps plugin) -- */ $maps_str="Maps"; /* (maps plugin) -- */ ! $map_type_ctrl="Enable Map Type Controls"; /* (maps plugin) -- */ $map_type_ctrl_info="<-- show Map type controls in Map"; /* (maps plugin) -- */ ! $map_slide_ctrl="Enable Map Slide Controls"; /* (maps plugin) -- */ ! $map_slide_ctrl_info="<-- show Map slide controls in Map"; /* (maps plugin) -- */ ! $map_pan_ctrl="Enable Map Pan Controls"; /* (maps plugin) -- */ ! $map_pan_ctrl_info="<-- show Map pan controls in Map"; /* (maps plugin) -- */ ! $map_auto_popup="Enable Marker Auto Popup"; /* (maps plugin) -- */ ! $map_auto_popup_info="<-- auto show Marker Popups on mousover"; /* (maps plugin) -- */ ! $map_album_add="Add Album"; /* (maps plugin) -- */ ! $map_marker_del="Delete Marker"; /* (maps plugin) -- */ ! $map_search_location="Search/Add new Location"; /* (maps plugin) -- */ $map_location_here="Your Location Here"; /* (maps plugin) -- */ ! $map_search_loc_button="Search Location"; /* (maps plugin) -- */ ! $map_add_location="Add new Location"; /* (maps plugin) -- */ ! $map_assign_album="Assign Album to Map Location"; /* (maps plugin) -- */ ! $general_ignored_files="Files to ignore in collection"; /* (build_general_config.php) -- */ ! $general_ignored_files_info="<-- files to ignore (comma seperated)"; /* (build_general_config.php) -- */ ! $general_ignored_fileext="File extensions to ignore in collection"; /* (build_general_config.php) -- */ ! $general_ignored_fileext_info="<-- file extensions to ignore (comma seperated)"; /* (build_general_config.php) -- */ ! ?> \ No newline at end of file --- 1081,1135 ---- $mail_mailer_error=" - ã¡ã¼ã©ã¼ã¨ã©ã¼: "; /* (mailing.php) -- */ $str_log_events['comments']="ã¨ã³ããªã³ã¡ã³ã"; /* (log.php) -- */ ! $str_edit_members="ã¡ã³ãã¼ãç·¨éãã"; /* (build_user.conf.php) -- */ ! $edit_groups="ã°ã«ã¼ããç·¨éãã "; /* (build_user.conf.php) -- */ ! $str_basket="ãã¹ã±ãã"; /* (various) -- */ ! $lang_plugins['log']="ãã°è¨é²"; /* (admin.php) -- */ ! $rss_created="XML RSS ãã¡ã¤ã«ã®çæã«æåãã¾ãã"; /* () -- */ ! $rss_not_created="RSS ã¯å¤æ´ãè¦ã¤ãããªããããæ§ç¯ãã¦ãã¾ããã"; /* () -- */ ! $rss_settings_saved="RSS è¨å®ãä¿åãã¾ãã"; /* () -- */ ! $lang_plugins['stats']="çµ±è¨"; /* (various) -- */ $lang_plugins['RSS']="RSS"; /* (various) -- */ ! $str_no_watermarks="ã¦ã©ã¼ã¿ã¼ãã¼ã¯ãªã"; /* () -- */ ! $str_with_watermarks="ã¦ã©ã¼ã¿ã¼ãã¼ã¯ãã"; /* () -- */ ! $str_create_cache_img="ãã£ãã·ã¥ãããç»åã®ä½æ"; /* () -- */ ! $str_reset_button="ãªã»ãããã"; /* () -- */ ! $cache_stats="ç»åãã£ãã·ã¥ã®ç¶æ "; /* () -- */ ! $drop_duplicates="è¤è£½ãæ£ã¦ã"; /* () -- */ ! $general_exif_rotate="ç»åã®èªååè»¢ã®æå¹/ç¡å¹ "; /* () -- */ ! $general_exif_rotate_info="<-- EXIF ãã¼ã¿ã«ããç»åã®èªååè»¢ã®æå¹å/ç¡å¹å"; /* () -- */ ! $lang_plugins['maps']="Google/Yahoo ããã"; /* () -- maps plugin */ ! $maps_setup_info_header="Google/Yahoo ãããã®è¨å®"; /* () -- maps plugin */ ! $maps_setup_yahoo_id="Yahoo ã¢ããªã±ã¼ã·ã§ã³ ID"; /* (maps plugin) -- */ ! $maps_setup_google_key="Google ãã¼"; /* (maps plugin) -- */ ! $maps_setup_php_version_warning="ããããªãã - ãã®ãã©ã°ã¤ã³ã¯å°ãªãã¨ã PHP ãã¼ã¸ã§ã³ 4.2.0 以ä¸ãè¦æ±ãã¦ãã¾ããPHP ãæ´æ°ãã¦ãã ããã"; /* (maps plugin) -- */ ! $maps_select_type="å°å³ã®ç¨®é¡ã®é¸æ:"; /* (maps plugin) -- */ ! $maps_select_type_info="<-- Google ãããã Yahoo ãããã®ãã¡ã©ã¡ããã鏿ãã¾ã"; /* (maps plugin) -- */ ! $maps_select_display_type="å°å³è¡¨ç¤ºã®ç¨®é¡ã鏿ãã¦ãã ãã:"; /* (maps plugin) -- */ $maps_select_display_type_info="<-- show Hybrid, Sat or Regular Map"; /* (maps plugin) -- */ ! $maps_zoom_level="æ¨æºã®ãºã¼ã ã¬ãã«: 1-16 (æ¨æºã¯ 16 ã§ãä¸çå°å³ã§ã)"; /* (maps plugin) -- */ ! $maps_zoom_level_info="<-- å°å³ã®æ¨æºã®ãºã¼ã ã¬ãã«ã§ã"; /* (maps plugin) -- */ ! $maps_zoom_location="æ¨æºã®å ´æã表示ã®ä¸å¤®ã«ãã"; /* (maps plugin) -- */ ! $maps_zoom_location_info="<-- å°å³ã®ä¸å¤®ã«æ¨æºã®å ´æã表示ãã¾ã"; /* (maps plugin) -- */ ! $maps_google_ctrl_size="Google ãããå¶å¾¡ãµã¤ãº"; /* (maps plugin) -- */ ! $maps_google_ctrl_size_info="<-- Google ãããã¨ãã³ã®å¤§ããã調æ´ãã¾ã"; /* (maps plugin) -- */ $maps_str="Maps"; /* (maps plugin) -- */ ! $map_type_ctrl="å°å³ã®ç¨®é¡å¶å¾¡ãæå¹ã«ãã"; /* (maps plugin) -- */ $map_type_ctrl_info="<-- show Map type controls in Map"; /* (maps plugin) -- */ ! $map_slide_ctrl="å°å³ã®ã¹ã©ã¤ãã®å¶å¾¡ãæå¹ã«ãã"; /* (maps plugin) -- */ ! $map_slide_ctrl_info="<-- å°å³ä¸ã«å°å³ã®ã¹ã©ã¤ãå¶å¾¡ã表示ãã¾ã"; /* (maps plugin) -- */ ! $map_pan_ctrl="å°å³ã®ãã³å¶å¾¡ãæå¹ã«ãã"; /* (maps plugin) -- */ ! $map_pan_ctrl_info="<-- å°å³ä¸ã«å°å³ã®ãã³å¶å¾¡ã表示ãã¾ã"; /* (maps plugin) -- */ ! $map_auto_popup="ãã¼ã«ã¼ã®èªåãããã¢ãããæå¹ã«ãã"; /* (maps plugin) -- */ ! $map_auto_popup_info="<-- èªåçã«ãã¦ã¹é貨ã§ãã¼ã«ã¼ãããã¢ããã表示ãã¾ã"; /* (maps plugin) -- */ ! $map_album_add="ã¢ã«ãã ã追å ãã"; /* (maps plugin) -- */ ! $map_marker_del="ãã¼ã«ã¼ãåé¤ãã"; /* (maps plugin) -- */ ! $map_search_location="æ°ããå ´æã®è¿½å /æ¤ç´¢"; /* (maps plugin) -- */ $map_location_here="Your Location Here"; /* (maps plugin) -- */ ! $map_search_loc_button="å ´æãæ¤ç´¢ãã"; /* (maps plugin) -- */ ! $map_add_location="æ°ããå ´æã追å ãã"; /* (maps plugin) -- */ ! $map_assign_album="å°å³ã®å ´æã«ã¢ã«ãã ãå²ãå½ã¦ã"; /* (maps plugin) -- */ ! $general_ignored_files="åéããç¡å¹ã«ãããã¡ã¤ã«"; /* (build_general_config.php) -- */ ! $general_ignored_files_info="<-- ç¡è¦ãããã¡ã¤ã« (åè§ã«ã³ãåºåã)"; /* (build_general_config.php) -- */ ! $general_ignored_fileext="åéããç¡å¹ã«ãããã¡ã¤ã«æ¡å¼µå"; /* (build_general_config.php) -- */ ! $general_ignored_fileext_info="<-- ç¡è¦ãããã¡ã¤ã«æ¡å¼µå (åè§ã«ã³ãåºåã)"; /* (build_general_config.php) -- */ ! ?> |
From: Tadashi J. <el...@us...> - 2008-01-16 17:05:35
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15205 Modified Files: ChangeLog Log Message: * updated Japanese translation. * fixed typo. Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1272 retrieving revision 1.1273 diff -C2 -d -r1.1272 -r1.1273 *** ChangeLog 15 Jan 2008 12:41:05 -0000 1.1272 --- ChangeLog 16 Jan 2008 17:05:31 -0000 1.1273 *************** *** 1,2 **** --- 1,7 ---- + 2008-01-17 Tadashi Jokagi <elf2000 AT users DOT sourceforge DOT net> + * ftp/index.php: fixed css and xss. + * updated Japanese translation. + * fixd typo. + 2008-01-08 bzrudi * footer.php: make copyright year dynamic in footer, e.g. 2002-XXXX |
From: Tadashi J. <el...@us...> - 2008-01-16 17:03:54
|
Update of /cvsroot/linpha/linpha/plugins/ftp In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14026 Modified Files: index.php Log Message: 2008-01-17 Tadashi Jokagi <elf2000 AT users DOT sourceforge DOT net> * ftp/index.php: fixed css and xss. Index: index.php =================================================================== RCS file: /cvsroot/linpha/linpha/plugins/ftp/index.php,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** index.php 15 Jul 2006 17:00:24 -0000 1.53 --- index.php 16 Jan 2008 17:03:46 -0000 1.54 *************** *** 288,292 **** <legend><?php printf($str_copy_to,$originame); ?></legend> <font class="mono"><?php echo $default['STARTDIR_LEFT']; ?>/</font> ! <input type='text' name='copy_to' value='<?php echo str_replace($default['STARTDIR_LEFT'].'/','',$dirleft.'/'); ?>'> <input type='hidden' name='todo' value='docopy'> <input type='hidden' name='originame' value='<?php echo htmlspecialchars($originame,ENT_QUOTES); ?>'> --- 288,292 ---- <legend><?php printf($str_copy_to,$originame); ?></legend> <font class="mono"><?php echo $default['STARTDIR_LEFT']; ?>/</font> ! <input type='text' name='copy_to' value='<?php echo htmlspecialchars(str_replace($default['STARTDIR_LEFT'].'/','',$dirleft.'/'),ENT_QUOTES); ?>'> <input type='hidden' name='todo' value='docopy'> <input type='hidden' name='originame' value='<?php echo htmlspecialchars($originame,ENT_QUOTES); ?>'> *************** *** 338,344 **** <legend><?php printf($str_rename_to,$originame); ?></legend> <font class="mono"><?php echo $default['STARTDIR_LEFT']; ?>/</font> ! <input type='text' name='rename_to' value='<?php echo str_replace($default['STARTDIR_LEFT'].'/','',$originame); ?>'> <input type='hidden' name='todo' value='dorename'> ! <input type='hidden' name='originame' value='<?php echo htmlspecialchars($originame); ?>'> <input type='submit' name='Submit' value='<?php echo STR_RENAME; ?>'> <?php echo getparams(); ?> --- 338,344 ---- <legend><?php printf($str_rename_to,$originame); ?></legend> <font class="mono"><?php echo $default['STARTDIR_LEFT']; ?>/</font> ! <input type='text' name='rename_to' value='<?php echo htmlspcialchars(str_replace($default['STARTDIR_LEFT'].'/','',$originame),ENT_QUOTES); ?>'> <input type='hidden' name='todo' value='dorename'> ! <input type='hidden' name='originame' value='<?php echo htmlspecialchars($originame,ENT_QUOTES); ?>'> <input type='submit' name='Submit' value='<?php echo STR_RENAME; ?>'> <?php echo getparams(); ?> *************** *** 380,384 **** <legend><?php echo STR_CREATEDIRLEGEND; ?></legend> <font class="mono"><?php echo $default['STARTDIR_LEFT']; ?>/</font> ! <input type='text' name='dirname' value='<?php echo str_replace($default['STARTDIR_LEFT'].'/','',$dirleft.'/'); ?>'> <input type='hidden' name='todo' value='createdir'> <input type='submit' name='Submit' value='<?php echo STR_CREATEDIRBUTTON; ?>'> --- 380,384 ---- <legend><?php echo STR_CREATEDIRLEGEND; ?></legend> <font class="mono"><?php echo $default['STARTDIR_LEFT']; ?>/</font> ! <input type='text' name='dirname' value='<?php echo htmlspecialchars(str_replace($default['STARTDIR_LEFT'].'/','',$dirleft.'/'),ENT_QUOTES); ?>'> <input type='hidden' name='todo' value='createdir'> <input type='submit' name='Submit' value='<?php echo STR_CREATEDIRBUTTON; ?>'> *************** *** 592,596 **** '<INPUT TYPE=HIDDEN NAME="todo" VALUE="upload">'.NL. '<INPUT TYPE=HIDDEN NAME="page" VALUE="ftp">'.NL. ! '<INPUT TYPE=HIDDEN NAME="targetdir" VALUE="'.htmlspecialchars($targetdir, ENT_QUOTES).'">'.NL. getparams() . '<B>'.STR_FILE_UPLOAD_TARGET.': '.htmlspecialchars($targetdir).'</B><BR>'.NL. --- 592,596 ---- '<INPUT TYPE=HIDDEN NAME="todo" VALUE="upload">'.NL. '<INPUT TYPE=HIDDEN NAME="page" VALUE="ftp">'.NL. ! '<INPUT TYPE=HIDDEN NAME="targetdir" VALUE="'.htmlspecialchars($targetdir,ENT_QUOTES).'">'.NL. getparams() . '<B>'.STR_FILE_UPLOAD_TARGET.': '.htmlspecialchars($targetdir).'</B><BR>'.NL. *************** *** 1235,1239 **** $hiddenparameters = ! "<INPUT TYPE='hidden' NAME='lt' VALUE= '".htmlspecialchars($dirleft, ENT_QUOTES)."'>".NL. "<INPUT TYPE='hidden' NAME='page' VALUE= 'ftp'>".NL. "<INPUT TYPE='hidden' NAME='todo' VALUE= ''>".NL. --- 1235,1239 ---- $hiddenparameters = ! "<INPUT TYPE='hidden' NAME='lt' VALUE= '".htmlspecialchars($dirleft,ENT_QUOTES)."'>".NL. "<INPUT TYPE='hidden' NAME='page' VALUE= 'ftp'>".NL. "<INPUT TYPE='hidden' NAME='todo' VALUE= ''>".NL. *************** *** 1353,1362 **** global $sortpass; ! $p = "<A class='naviline' HREF='".htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES)."?lt=".$d. AMP . "page=ftp'>%s</A>"; ! if (ereg('^([a-zA-Z]?:?\/?)$', $d, $r)) { $d = $r[1]; ! return sprintf($p, $d); }else { --- 1353,1361 ---- global $sortpass; ! $p = "<A class='naviline' HREF='".htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES)."?lt=%s". AMP . "page=ftp'>%s</A>"; if (ereg('^([a-zA-Z]?:?\/?)$', $d, $r)) { $d = $r[1]; ! return sprintf($p, urlencode($d), htmlspecialchars($d, ENT_QUOTES)); }else { *************** *** 1368,1372 **** navigatorline($d, $sd) . ($d=='/' ? '' : '/') . ! sprintf($p, $b); } } --- 1367,1371 ---- navigatorline($d, $sd) . ($d=='/' ? '' : '/') . ! sprintf($p, urlencode($d), htmlspecialchars($b, ENT_QUOTES)); } } |
From: Florian A. <fan...@us...> - 2008-01-16 06:55:56
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32001 Modified Files: .cvsignore Log Message: updated Index: .cvsignore =================================================================== RCS file: /cvsroot/linpha/linpha/.cvsignore,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** .cvsignore 3 Sep 2006 12:25:19 -0000 1.5 --- .cvsignore 16 Jan 2008 06:55:51 -0000 1.6 *************** *** 4,6 **** albums2 time.php ! --- 4,7 ---- albums2 time.php ! .cache ! .settings |
From: <fan...@us...> - 2008-01-15 22:22:17
|
Revision: 4811 http://linpha.svn.sourceforge.net/linpha/?rev=4811&view=rev Author: fangehrn Date: 2008-01-15 14:22:11 -0800 (Tue, 15 Jan 2008) Log Message: ----------- doing some tests with html strict and utf8 Added Paths: ----------- trunk/misc/design/1current/ trunk/misc/design/1current/colorsettings.php trunk/misc/design/1current/csshover.htc trunk/misc/design/1current/expand.gif trunk/misc/design/1current/func.watermark.php trunk/misc/design/1current/global.css trunk/misc/design/1current/home.css trunk/misc/design/1current/index.php trunk/misc/design/1current/roundcorners.php trunk/misc/design/2strictutf8/ trunk/misc/design/2strictutf8/Linpha2.html trunk/misc/design/2strictutf8/colorsettings.php trunk/misc/design/2strictutf8/csshover.htc trunk/misc/design/2strictutf8/expand.gif trunk/misc/design/2strictutf8/func.watermark.php trunk/misc/design/2strictutf8/global.css trunk/misc/design/2strictutf8/home.css trunk/misc/design/2strictutf8/index.php trunk/misc/design/2strictutf8/index2.php trunk/misc/design/2strictutf8/index3.php trunk/misc/design/2strictutf8/roundcorners.php trunk/misc/design/download.png trunk/misc/design/print.png trunk/misc/design/slideshow.png trunk/misc/design/thumb1.gif trunk/misc/design/thumb2.gif trunk/misc/design/thumb3.gif Added: trunk/misc/design/1current/colorsettings.php =================================================================== --- trunk/misc/design/1current/colorsettings.php (rev 0) +++ trunk/misc/design/1current/colorsettings.php 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,70 @@ +<?php +header("Content-Type: text/css"); + +/** + * force caching in browser + * works in firefox and internet explorer + */ +Header("Last-Modified: " . gmdate("D, d M Y H:i:s",mktime (0,0,0,1,1,2000)) . " GMT"); // Date in the past +Header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image +Header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate"); + + +/* + * Created on 26.10.2006 + * + * To change the template for this generated file go to + * Window - Preferences - PHPeclipse - PHP - Code Templates + */ +?> + +/** + * background color + * #linDivThumbNavi amd #divSlideshowControlsInner used in view_img.html.php + */ + body { + background-color: #<?php echo $_GET['bodybg']; ?>; + } + + #linDivMainOuter, #linDivMetaStaticOuter, #linDivNavigationOuter, /*.linButton,*/ #linDivThumbnaviOuter, #linDivSlideshowControls, .roundAlphabottomInner, .linBackground { + background-color: #<?php echo $_GET['bg']; ?>; + } + +/** + * font color + */ + body, #linDivMenu ul a, #linDivMenu ul span, #linDivMenu ul div { + color: #<?php echo $_GET['font']; ?>; + } + +/** + * albums color + */ + .linDivFolder { + background-color: #<?php echo $_GET['albumsbg']; ?>; + } + +/** + * link/form colors + */ + a:link, a:visited /*, .linButton*/ { + color: #<?php echo $_GET['links']; ?>; + } + a:hover /*, .linButton:hover*/ { + color: #<?php echo $_GET['linkshover']; ?>; + } + + .linForms { + background-color: #<?php echo $_GET['fieldscolor']; ?>; + border: 1px solid grey; + } + +/** + * menu + */ + #linDivMenu ul a:hover, #linDivMenu ul span:hover { + background: #bbbbbb; + } + #linDivMenu ul ul, .linInputMenu { + background-color: #eeeeee; + } Added: trunk/misc/design/1current/csshover.htc =================================================================== --- trunk/misc/design/1current/csshover.htc (rev 0) +++ trunk/misc/design/1current/csshover.htc 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,120 @@ +<attach event="ondocumentready" handler="parseStylesheets" /> +<script> +/** + * Whatever:hover - V1.42.060206 - hover & active + * ------------------------------------------------------------ + * (c) 2005 - Peter Nederlof + * Peterned - http://www.xs4all.nl/~peterned/ + * License - http://creativecommons.org/licenses/LGPL/2.1/ + * + * Whatever:hover is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Whatever:hover 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 + * Lesser General Public License for more details. + * + * Credits and thanks to: + * Arnoud Berendsen, Martin Reurings, Robert Hanson + * + * howto: body { behavior:url("csshover.htc"); } + * ------------------------------------------------------------ + */ + +var csshoverReg = /(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i, +currentSheet, doc = window.document, hoverEvents = [], activators = { + onhover:{on:'onmouseover', off:'onmouseout'}, + onactive:{on:'onmousedown', off:'onmouseup'} +} + +function parseStylesheets() { + if(!/MSIE (5|6)/.test(navigator.userAgent)) return; + window.attachEvent('onunload', unhookHoverEvents); + var sheets = doc.styleSheets, l = sheets.length; + for(var i=0; i<l; i++) + parseStylesheet(sheets[i]); +} + function parseStylesheet(sheet) { + if(sheet.imports) { + try { + var imports = sheet.imports, l = imports.length; + for(var i=0; i<l; i++) parseStylesheet(sheet.imports[i]); + } catch(securityException){} + } + + try { + var rules = (currentSheet = sheet).rules, l = rules.length; + for(var j=0; j<l; j++) parseCSSRule(rules[j]); + } catch(securityException){} + } + + function parseCSSRule(rule) { + var select = rule.selectorText, style = rule.style.cssText; + if(!csshoverReg.test(select) || !style) return; + + var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1'); + var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo); + var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1]; + var affected = select.replace(/:(hover|active).*$/, ''); + var elements = getElementsBySelect(affected); + if(elements.length == 0) return; + + currentSheet.addRule(newSelect, style); + for(var i=0; i<elements.length; i++) + new HoverElement(elements[i], className, activators[pseudo]); + } + +function HoverElement(node, className, events) { + if(!node.hovers) node.hovers = {}; + if(node.hovers[className]) return; + node.hovers[className] = true; + hookHoverEvent(node, events.on, function() { node.className += ' ' + className; }); + hookHoverEvent(node, events.off, function() { node.className = node.className.replace(new RegExp('\\s+'+className, 'g'),''); }); +} + function hookHoverEvent(node, type, handler) { + node.attachEvent(type, handler); + hoverEvents[hoverEvents.length] = { + node:node, type:type, handler:handler + }; + } + + function unhookHoverEvents() { + for(var e,i=0; i<hoverEvents.length; i++) { + e = hoverEvents[i]; + e.node.detachEvent(e.type, e.handler); + } + } + +function getElementsBySelect(rule) { + var parts, nodes = [doc]; + parts = rule.split(' '); + for(var i=0; i<parts.length; i++) { + nodes = getSelectedNodes(parts[i], nodes); + } return nodes; +} + function getSelectedNodes(select, elements) { + var result, node, nodes = []; + var identify = (/\#([a-z0-9_-]+)/i).exec(select); + if(identify) { + var element = doc.getElementById(identify[1]); + return element? [element]:nodes; + } + + var classname = (/\.([a-z0-9_-]+)/i).exec(select); + var tagName = select.replace(/(\.|\#|\:)[a-z0-9_-]+/i, ''); + var classReg = classname? new RegExp('\\b' + classname[1] + '\\b'):false; + for(var i=0; i<elements.length; i++) { + result = tagName? elements[i].all.tags(tagName):elements[i].all; + for(var j=0; j<result.length; j++) { + node = result[j]; + if(classReg && !classReg.test(node.className)) continue; + nodes[nodes.length] = node; + } + } + + return nodes; + } +</script> \ No newline at end of file Added: trunk/misc/design/1current/expand.gif =================================================================== (Binary files differ) Property changes on: trunk/misc/design/1current/expand.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/misc/design/1current/func.watermark.php =================================================================== --- trunk/misc/design/1current/func.watermark.php (rev 0) +++ trunk/misc/design/1current/func.watermark.php 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,547 @@ +<?php +/* +* Copyright (c) 2004 Heiko Rutenbeck <bz...@tu...> +* +* 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. +*/ + +if(!defined('LINPHA_DIR')) { exit(1); } + +class LinWatermark +{ + +/** +* @author flo +* @todo adapt from linpha1 +*/ +function needWatermark($imgid) +{ + if( $GLOBALS['linpha']->sql->config->value['plugins_active_wm'] + && $GLOBALS['linpha']->sql->config->value['plugins_wm_active'] + && !check_permissions('watermark',$imgid) ) + { + return true; + } else { + return false; + } +} + +/** + * returns array with all the configs and the default values, they are only defined here + */ +function getWatermarkArray() +{ + return array ( + 'wm_active' => "0", + 'wm_watermark' => "0", + 'wm_text' => "Copyright 2007", + 'wm_font' => "", + 'wm_fontsize' => "20", + 'wm_fontcolor' => "white", + 'wm_align' => "southwest", + 'wm_horizontal' => "0", + 'wm_vertical' => "0", + 'wm_enable_shadow' => "1", + 'wm_shadow_size' => "1", + 'wm_shadow_fontsize' => "20", + 'wm_shadow_color' => "black", + 'wm_enable_rectangle' => "1", + 'wm_rectangle_color' => "darkgrey", + 'wm_height' => "30", + 'wm_width' => "145", + 'wm_img_img' => "", + 'wm_dissolve' => "75%", + 'wm_resize' => "30" + ); +} + +function readWatermark() +{ + $arr_config = LinWatermark::getWatermarkArray(); + while(list($name,$value) = each($arr_config) ) + { + $arr_read[$name] = $GLOBALS['linpha']->sql->config->value['plugins_'.$name]; + } + return $arr_read; +} + +function updateWatermark() +{ + $arr_config = LinWatermark::getWatermarkArray(); + while(list($name,$value) = each($arr_config) ) + { + $GLOBALS['linpha']->sql->config->updateConfig($name,$_POST[$name]); + } +} + +/** + * restore watermark settings to initial settings or to examples + */ +function restoreWatermark() +{ + global $wm_restore_to; + + $arr_config = LinWatermark::getWatermarkArray(); + switch($_POST['setdefault']) + { + case 'initial': + break; + case 'settings1': + $arr_config['wm_watermark'] = 1; + $arr_config['wm_text'] = "(C) 2004 linpha.sf.net"; + $arr_config['wm_fontsize'] = "10"; + $arr_config['wm_fontcolor'] = "white"; + $arr_config['wm_align'] = "south"; + $arr_config['wm_horizontal'] = "0"; + $arr_config['wm_vertical'] = "0"; + $arr_config['wm_enable_rectangle'] = "1"; + $arr_config['wm_rectangle_color'] = "darkgrey"; + $arr_config['wm_enable_shadow'] = "2"; + $arr_config['wm_height'] = "20"; + $arr_config['wm_width'] = "2000"; + $arr_config['wm_resize'] = "no"; + break; + case 'settings2': + $arr_config['wm_watermark'] = 2; + $arr_config['wm_dissolve'] = "65%"; + $arr_config['wm_align'] = "southwest"; + $arr_config['wm_img_img'] = "linpha.png"; + $arr_config['wm_horizontal'] = "10"; + $arr_config['wm_vertical'] = "10"; + $arr_config['wm_resize'] = "30"; + + break; + case 'settings3': // maybe better for gd lib than for convert + $arr_config['wm_watermark'] = 1; + $arr_config['wm_dissolve'] = "100%"; + $arr_config['wm_align'] = "southwest"; + $arr_config['wm_text'] = "(C) 2004 linpha.sf.net"; + $arr_config['wm_fontsize'] = "20"; + $arr_config['wm_fontcolor'] = "white"; + $arr_config['wm_horizontal'] = "0"; + $arr_config['wm_vertical'] = "0"; + $arr_config['wm_enable_rectangle'] = "1"; + $arr_config['wm_rectangle_color'] = "darkgrey"; + $arr_config['wm_enable_shadow'] = "1"; + $arr_config['wm_shadow_size'] = "5"; + $arr_config['wm_shadow_fontsize'] = "2"; + $arr_config['wm_height'] = "30"; + $arr_config['wm_width'] = "260"; + $arr_config['wm_resize'] = "no"; + break; + } + while(list($name,$value) = each($arr_config) ) + { + $GLOBALS['linpha']->sql->config->updateConfig($name,$value); + } +} + +/** + * calcs the new height and width of the resized watermark + * $w, $h: size of the big image + * $org_width, $org_height: size of the watermark rectangle/image + * $resize: resize factor in percent + * + */ +function wmArrResized($w,$h,$org_width,$org_height,$resize) +{ + $arr_resized['w'] = round($w * $resize/100); + $arr_resized['h'] = round($h * $resize/100); + + $no_increase = 0; + $array = LinImage::scaleToFit($org_height,$org_width,$arr_resized['h'],$arr_resized['w'],$no_increase); + + //error_log('w: '.$w.' h: '.$h.' arr_resized_w: '.$arr_resized['w'].' arr_resized_h: '.$arr_resized['h']. + // ' org_w: '.$org_width.' org_h: '.$org_height.' scaleToFit w: '.$array['w'].' h: '.$array['h']); + + return $array; +} + +/** + * list with many available colors + * http://mail.gnu.org/archive/html/emacs-diffs/2002-06/msg00158.html + * @uses getRgbFromAll() + */ +static $Colors = array( + 'aliceblue'=>'#f0f8ff', + 'antiquewhite'=>'#faebd7', + 'aquamarine'=>'#7fffd4', + 'azure'=>'#f0ffff', + 'beige'=>'#f5f5dc', + 'bisque'=>'#ffe4c4', + 'black'=>'#000000', + 'blanchedalmond'=>'#ffebcd', + 'blue'=>'#0000ff', + 'blueviolet'=>'#8a2be2', + 'brown'=>'#a52a2a', + 'burlywood'=>'#deb887', + 'cadetblue'=>'#5f9ea0', + 'chartreuse'=>'#7fff00', + 'chocolate'=>'#d2691e', + 'coral'=>'#ff7f50', + 'cornflowerblue'=>'#6495ed', + 'cornsilk'=>'#fff8dc', + 'cyan'=>'#00ffff', + 'darkblue'=>'#00008b', + 'darkcyan'=>'#008b8b', + 'darkgoldenrod'=>'#b886011', + 'darkgray'=>'#a9a9a9', + 'darkgreen'=>'#006400', + 'darkgrey'=>'#a9a9a9', + 'darkkhaki'=>'#bdb76b', + 'darkmagenta'=>'#8b008b', + 'darkolivegreen'=>'#556b2f', + 'darkorange'=>'#ff8c00', + 'darkorchid'=>'#9932cc', + 'darkred'=>'#8b0000', + 'darksalmon'=>'#e9967a', + 'darkseagreen'=>'#8fbc8f', + 'darkslateblue'=>'#483d8b', + 'darkslategray'=>'#2f4f4f', + 'darkslategrey'=>'#2f4f4f', + 'darkturquoise'=>'#00ced1', + 'darkviolet'=>'#9400d3', + 'deeppink'=>'#ff1493', + 'deepskyblue'=>'#00bfff', + 'dimgray'=>'#696969', + 'dimgrey'=>'#696969', + 'dodgerblue'=>'#1e90ff', + 'firebrick'=>'#b22222', + 'floralwhite'=>'#fffaf0', + 'forestgreen'=>'#228b22', + 'gainsboro'=>'#dcdcdc', + 'ghostwhite'=>'#f8f8ff', + 'gold'=>'#ffd700', + 'goldenrod'=>'#daa520', + 'gray'=>'#bebebe', + 'green'=>'#00ff00', + 'greenyellow'=>'#adff2f', + 'honeydew'=>'#f0fff0', + 'hotpink'=>'#ff69b4', + 'indianred'=>'#cd5c5c', + 'ivory'=>'#fffff0', + 'khaki'=>'#f0e68c', + 'lavender'=>'#e6e6fa', + 'lavenderblush'=>'#fff0f5', + 'lawngreen'=>'#7cfc00', + 'lemonchiffon'=>'#fffacd', + 'lightblue'=>'#add8e6', + 'lightcoral'=>'#f08080', + 'lightcyan'=>'#e0ffff', + 'lightgoldenrod'=>'#eedd82', + 'lightgoldenrodyellow'=>'#fafad2', + 'lightgray'=>'#d3d3d3', + 'lightgreen'=>'#90ee90', + 'lightgrey'=>'#d3d3d3', + 'lightpink'=>'#ffb6c1', + 'lightred'=>'#ffc8c8', + 'lightsalmon'=>'#ffa07a', + 'lightseagreen'=>'#20b2aa', + 'lightskyblue'=>'#87cefa', + 'lightslateblue'=>'#8470ff', + 'lightslategray'=>'#778899', + 'lightsteelblue'=>'#b0c4de', + 'lightyellow'=>'#ffffe0', + 'limegreen'=>'#32cd32', + 'linen'=>'#faf0e6', + 'magenta'=>'#ff00ff', + 'maroon'=>'#b03060', + 'mediumaquamarine'=>'#66cdaa', + 'mediumblue'=>'#0000cd', + 'mediumorchid'=>'#ba55d3', + 'mediumpurple'=>'#9370db', + 'mediumseagreen'=>'#3cb371', + 'mediumslateblue'=>'#7b68ee', + 'mediumspringgreen'=>'#00fa9a', + 'mediumturquoise'=>'#48d1cc', + 'mediumvioletred'=>'#c71585', + 'midnightblue'=>'#191970', + 'mintcream'=>'#f5fffa', + 'mistyrose'=>'#ffe4e1', + 'moccasin'=>'#ffe4b5', + 'navajowhite'=>'#ffdead', + 'navy'=>'#000080', + 'navyblue'=>'#000080', + 'oldlace'=>'#fdf5e6', + 'olivedrab'=>'#6b8e23', + 'orange'=>'#ffa500', + 'orangered'=>'#ff4500', + 'orchid'=>'#da70d6', + 'palegoldenrod'=>'#eee8aa', + 'palegreen'=>'#98fb98', + 'paleturquoise'=>'#afeeee', + 'palevioletred'=>'#db7093', + 'papayawhip'=>'#ffefd5', + 'peachpuff'=>'#ffdab9', + 'peru'=>'#cd853f', + 'pink'=>'#ffc0cb', + 'plum'=>'#dda0dd', + 'powderblue'=>'#b0e0e6', + 'purple'=>'#a020f0', + 'red'=>'#ff0000', + 'rosybrown'=>'#bc8f8f', + 'royalblue'=>'#4169e1', + 'saddlebrown'=>'#8b4513', + 'salmon'=>'#fa8072', + 'sandybrown'=>'#f4a460', + 'seagreen'=>'#2e8b57', + 'seashell'=>'#fff5ee', + 'sienna'=>'#a0522d', + 'skyblue'=>'#87ceeb', + 'slateblue'=>'#6a5acd', + 'slategray'=>'#708090', + 'slategrey'=>'#708090', + 'snow'=>'#fffafa', + 'springgreen'=>'#00ff7f', + 'steelblue'=>'#4682b4', + 'tan'=>'#d2b48c', + 'thistle'=>'#d8bfd8', + 'tomato'=>'#ff6347', + 'turquoise'=>'#40e0d0', + 'violet'=>'#ee82ee', + 'violetred'=>'#d02090', + 'wheat'=>'#f5deb3', + 'white'=>'#ffffff', + 'yellow'=>'#ffff00', + 'yellowgreen'=>'#9acd32' +); + +/** + * not used anymore + */ +function getHtmlColorFromRgb($r,$g,$b) +{ + if(strlen(dechex($r))==1) { + $r = '0'.$r; + } else { + $r = dechex($r); + } + if(strlen(dechex($g))==1) { + $g = '0'.$g; + } else { + $g = dechex($g); + } + if(strlen(dechex($b))==1) { + $b = '0'.$b; + } else { + $b = dechex($b); + } + + return '#'.$r.$g.$b; +} + +/** + * used to check if it is a valid html color + * @uses isHtmlColor() + */ +function everyCharIsHex($string) +{ + for($i=0;$i<strlen($string);$i++) + { + $char = substr($string,$i,1); + $valid_color = false; + + if($char == "0") { // zero makes problems... '== 0' and '== "0"' is not the same... + $valid_color = true; + } + for($n=1;$n<=9;$n++) + { + if($char == $n) { + $valid_color = true; + } + } + + for($n='a';$n<='f';$n++) + { + if($char === $n) { + $valid_color = true; + } + } + + for($n='A';$n<='F';$n++) + { + if($char === $n) { + $valid_color = true; + } + } + if(!$valid_color) { + return 0; + } + } + return 1; +} + +/** + * used to check if it is a valid html color + * @uses getRgbFromAll() + */ +function isHtmlColor($string) +{ + switch(strlen($string)) + { + case 6: + if(LinWatermark::everyCharIsHex($string)) { + return 1; + } + break; + case 7: + if(substr($string,0,1)=="#") { + if(LinWatermark::everyCharIsHex(substr($string,1,6))) { + return 1; + } + } + break; + } + return 0; +} + +/** + * converts a html color to an array with the rgb values + * it doesn't matter if the html color is '#00FF00' or '00FF00' + * @uses getRgbFromAll() + */ +function getRgbFromHtml($string) +{ + switch(strlen($string)) + { + case 6: + break; + case 7: + $string = substr($string,1,6); + break; + } + $r_hex = substr($string,0,2); + $g_hex = substr($string,2,2); + $b_hex = substr($string,4,2); + $arr['r'] = hexdec($r_hex); + $arr['g'] = hexdec($g_hex); + $arr['b'] = hexdec($b_hex); + return $arr; +} + +/** + * returns an array with the rgb values + * it doesn't matter if the argument is 'darkblue', '#00FF55' or '00FF55' + * if it isn't a correct color, the color (0,0,0) is returned + * + * @uses watermark_gd() + */ +function getRgbFromAll($string) +{ + if( isset( LinWatermark::$Colors[$string]) ) + { + return LinWatermark::getRgbFromHtml( LinWatermark::$Colors[$string] ); + } + elseif(LinWatermark::isHtmlColor($string) ) + { + return LinWatermark::getRgbFromHtml( $string ); + } + else + { + array('r'=>0,'g'=>0,'b'=>0); + } +} + +/** + * return html color without '#' + * + * used in linpha2 - admin - settings_layout + */ +function getHtmlFromAll($string) +{ + if(LinWatermark::isHtmlColor($string)) + { + if(substr($string,0,1)=="#") + { + return substr($string,1,6); + } + else + { + return $string; + } + } + else + { + if( isset( LinWatermark::$Colors[$string]) ) + { + return substr(LinWatermark::$Colors[$string],1,6); + } + else + { + return 'ffffff'; + } + } +} + +/** + * @uses watermark_gd() + * calcs the position in pixel with a given align + * src_w, src_h: width and height from the textfield (or the small watermark image) + * dst_w, dst_h: width and height from the image + * pos_x, pos_y: additional adjust for the image + * + */ +function calcAlign($align, $src_w, $src_h, $dst_w, $dst_h, $pos_x, $pos_y) +{ + + switch($align) + { + case "center": + $arr_pos['x'] = ($dst_w-$src_w)/2+($pos_x); + $arr_pos['y'] = ($dst_h-$src_h)/2+($pos_y); + break; + case "east": + $arr_pos['x'] = $dst_w-$src_w+($pos_x); + $arr_pos['y'] = ($dst_h-$src_h)/2+($pos_y); + break; + case "west": + $arr_pos['x'] = $pos_x; + $arr_pos['y'] = ($dst_h-$src_h)/2+($pos_y); + break; + case "north": + $arr_pos['x'] = ($dst_w-$src_w)/2+($pos_x); + $arr_pos['y'] = $pos_y; + break; + case "south": + $arr_pos['x'] = ($dst_w-$src_w)/2+($pos_x); + $arr_pos['y'] = $dst_h-$src_h+($pos_y); + break; + case "northeast": + $arr_pos['x'] = $dst_w-$src_w+($pos_x); + $arr_pos['y'] = $pos_y; + break; + case "northwest": + $arr_pos['x'] = $pos_x; + $arr_pos['y'] = $pos_y; + break; + case "southwest": + $arr_pos['x'] = $pos_x; + $arr_pos['y'] = $dst_h-$src_h+($pos_y); + break; + case "southeast": + $arr_pos['x'] = $dst_w-$src_w+($pos_x); + $arr_pos['y'] = $dst_h-$src_h+($pos_y); + break; + default: + $arr_pos['x'] = $pos_x; + $arr_pos['y'] = $pos_y; + break; + + } + return $arr_pos; +} + +} +?> \ No newline at end of file Added: trunk/misc/design/1current/global.css =================================================================== --- trunk/misc/design/1current/global.css (rev 0) +++ trunk/misc/design/1current/global.css 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,343 @@ +<!-- +/** + * common definitions + * All 'em' calculations are based on 1 px = 0.0626em + */ + + #linBody { + font-family: arial, helvetica, sans-serif; + margin: 10px; + padding: 0px; + } + + + h1.linStyle { + font-size: 1.5em; + font-family: Verdana, Arial, Helvetica, sans-serif; + margin: 0px; + margin-top: 0px; + margin-bottom: 5px; + padding: 0px; + } + + h2.linStyle { + font-size: 1.2em; + font-family: Verdana, Arial, Helvetica, sans-serif; + margin: 0px; + margin-top: 0px; + margin-bottom: 5px; + padding: 0px; + } + + /** + * link button + */ + .linButton { + /*cursor: pointer; + border: 0; + font-size: 0.8em; + text-decoration: underline;*/ + } + + +/** + * title + */ + #linDivTitle + { + margin: 0; + margin-bottom: 20px; + margin-left: 90px; + + font-size: 2em; + } + #linDivTitle a:link, #linDivTitle a:visited, #linDivTitle a:hover + { + color: #444444; + text-decoration: none; + } + #linDivTitle a:hover + { + text-decoration: underline; + } + +/** + * navigation + */ + #linDivNavigationOuter { + margin: 0; + margin-bottom: 10px; + padding: 0; + } + #linDivNavigation + { + margin: 0; + padding: 5px; + } + +/** + * main + */ + #linDivMainOuter { + margin: 0; + padding: 0; + } + #linDivMain { + margin: 0; + padding: 0px; + padding-left: 10px; + padding-right: 10px; + } + +/** + * syslog + */ + #linDivSyslog { + position: absolute; + left: 15px; + top: 15px; + width: auto; + + z-index: 10; + + margin: 0; + padding: 5px; + + border: 1px solid #FFD500; + background-color: #FFFF81; + } + + #linDivSyslogClose { + position: absolute; + right: 0; + top: 0; + + z-index: 10; + + margin: 0; + padding: 0; + + background-color: #ffd5ee; + border: 1px solid #f09; + } + /** + * popup + */ + .linPopupWindow { + position: absolute; + top: 130px; + left: 40px; + width: 500px; + + background-color: #d4d0c8; + border: 2px outset grey; + + } + .linPopupTitleBar { + width: 100%; + height: 20px; + + background-color: #1e397b; + border-bottom: 1px solid black; + } + .linPopupClose { + position: absolute; + right: 0; + top: 0; + height: 20px; + width: 20px; + /*padding-left: 5px; + padding-right: 5px;*/ + + font-weight: bold; + /*background-color: #d4d0c8;*/ + + } + .linPopupCloseButton { + margin: 0; + padding: 0; + height: 20px; + width: 20px; + } + .linPopupText { + height: 350px; + + overflow: auto; + + padding: 5px; + } + +/** + * folder (used in home view, and maybe as subfolders) + * background-color and border-color are set in colorsettings.php + */ + .linDivFolder { + margin: 2px; + margin-left: 15px; + margin-bottom: 15px; + padding: 0; + + width: 700px; + } + + .linDivThumbnail { + height: 140px; + float: left; + } + + .linImgFolderThumbnail { + margin: 0; + margin-left: 20px; + margin-right: 30px; + margin-top: 5px; + padding: 0; + + width: 130px; + height: 130px; + + border: 0; + } + + .linDivFolderText { + margin: 0; + padding: 5px; + } + + .linDivFolderComment { + overflow: auto; + max-height: 300px; + + margin: 0; + margin-top: 10px; + margin-bottom: 10px; + padding: 0; + + /* word-wrap: break-word; fix ie to force width, but creates warnings in firefox !!! */ + } + + +/** + * menu + */ + #linDivMenu { + margin: 0; + padding: 0; + + width: 100%; + float: left; + } + + /** + * icons + */ + #linDivMenu div { + margin: 0; + margin-left: 5px; + margin-right: 5px; + padding: 0; + float: left; + } + #linDivMenu div a { + margin: 0; + padding: 0; + float: left; + } + + /** + * first level elements + */ + #linDivMenu ul { + list-style: none; + + margin: 0; + margin-left: 5px; + margin-right: 5px; + padding: 0; + + width: auto; + float: left; + + border-top: 1px solid #000000; + + white-space: nowrap; + } + #linDivMenu ul a, #linDivMenu ul span, #linDivMenu ul div { + display: block; + + margin: 0; + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + padding-bottom: 2px; + + text-align: center; + text-decoration: none; + + } + #linDivMenu ul span { + background: url(./expand.gif) no-repeat 100% 100%; + } + + + /** + * second and more level elements + */ + #linDivMenu ul ul { + position: absolute; + z-index: 500; + + border: 0; + + /** + * relativ to parent element! be careful + */ + margin: 0; + padding: 0; + font-size: 1em; + + } + #linDivMenu ul ul a, #linDivMenu ul ul span, #linDivMenu ul ul div { + margin: 0; + padding-left: 5px; + padding-right: 15px; + padding-top: 2px; + padding-bottom: 2px; + + border-width: 1px; + border-style: solid; + border-color: #ccc #888 #555 #bbb; + text-align: left; + } + + /** + * third stage, switch to horizontal menu entries + */ + #linDivMenu ul ul ul { + position: absolute; + top: 0; + left: 100%; + } + + + /** + * the most important thing + * enable/disable submenus + */ + #linDivMenu ul ul, + #linDivMenu ul li:hover ul ul, + #linDivMenu ul ul li:hover ul ul + {display: none;} + + #linDivMenu ul li:hover ul, + #linDivMenu ul ul li:hover ul, + #linDivMenu ul ul ul li:hover ul + {display: block;} + + #linDivMenu li {position: relative;} + + +/** + * end menu + */ + +--> \ No newline at end of file Added: trunk/misc/design/1current/home.css =================================================================== --- trunk/misc/design/1current/home.css (rev 0) +++ trunk/misc/design/1current/home.css 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,18 @@ + +hr.linStyle { + clear: both; +} + +.linDivRandomimg, .linDivNewimg { + float: left; + margin-left: 40px; +} + +.linImgRandomimg, .linImgNewimg { + border: 0; +} + +.linDivFolder a +{ + text-decoration: none; +} \ No newline at end of file Added: trunk/misc/design/1current/index.php =================================================================== --- trunk/misc/design/1current/index.php (rev 0) +++ trunk/misc/design/1current/index.php 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,242 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<title>Linpha 2.0</title> + +<!-- css includes --> + +<link rel='stylesheet' href='./colorsettings.php?bg=87CEFA&bodybg=DDDDDD&font=000000&albumsbg=D5FCF4&links=005388&linkshover=666666&fieldscolor=CCCCCC' type='text/css'> +<link rel='stylesheet' href='./global.css' type='text/css'> +<link rel='stylesheet' href='./home.css' type='text/css'> + + <!--[if IE]> + <style type="text/css" media="screen"> + #menu ul { width: 1em; } /* this will be a *min* width */ + #menu ul ul { width: 12em; } + #menu ul li { float: left; width: 100%; } + body { behavior: url(./csshover.htc); font-size: 100%; } + #menu ul li a { height: 1%; } + #menu a, #menu span { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } + </style> + <![endif]--> + +</head> + + +<body id="linBody"> + +<!-- syslog --> +<div id="linDivSyslog" style="display: none;"> + <div id="linDivSyslogClose"><a href="javascript:myLinGlobal.closeSyslog();">X</a></div> + <b>Linpha Syslog:</b><br /> + <div id="linDivSyslogText"></div> +</div> + + +<!-- title/navigation --> + +<div id="linDivTitle">Linpha 2.0 :: <a href="/linpha2/?&linCat=alb&linId=0">></a> </div> + + +<!-- menu --> +<div id="linDivMenu"> + <ul style="margin-left: 50px;"> + <li><a href="/linpha2/?&linCat=alb">Home</a></li> + </ul> + <ul> + <li><span>Suche </span> + <ul> + <li><a href="/linpha2/?&linCat=search">Extended Search</a></li> + <li> + <div> + <form method="GET" action="/linpha2/?&linCat=search"> + <input type="text" class="linForms" name="search_text" value="" /> + <input type="hidden" name="button[meta][all]" value="1" /> + + <input type="hidden" name="cmd" value="search" /> + <input type="hidden" name="linCat" value="search" /> + <input type="submit" name="submit" class="linButton linInputMenu" value="Suche" /> + </form> + </div> + </li> + </ul> + </li> + </ul> + <ul> + <li> + <span>Login </span> + <ul id="linMenuLogin"> + <li> + <div> + <form action="" method="POST" onsubmit="new Ajax.Updater('linDivMenu', LINPHA_CLIENT + '/?linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> + <!-- login infos --> + <br /> + <label for="linFormUsername" style="display: block; float: left; width: 80px;">Username: </label><input style="width: 105px;" class="linForms" type="text" name="username" value="" id="linFormUsername" /><br /> + <label for="linFormPassword" style="display: block; float: left; width: 80px;">Password: </label><input style="width: 105px;" class="linForms" type="password" name="password" value="" id="linFormPassword" /><br /> + <input type="checkbox" name="rememberme" value="true" id="linFormCheckboxRemember" /><label for="linFormCheckboxRemember">Remember Me</label> <input type="hidden" name="cmd" value="login" /> + <input type="submit" name="submit" class="linButton linInputMenu" value="Login" /><br /><br /> + <div style="font-size: smaller; border: 0px;">Um sich anmelden zu können, müssen Cookies aktiviert sein.</div> + </form> + </div> + </li> + </ul> + </li> + </ul> + <ul> + <li><span>More </span> + <ul id="linMenuMore"> + <li><span>Basket </span> + <ul> + <li><a href="/linpha2/?&linCat=alb&linId=4&admin_cmd=basket_add_all">Add All To Basket</a></li> + + <li><a href="/linpha2/?&linCat=alb&linId=4&view=basket">Switch To Basket View</a></li> + <li><a href="/linpha2/?&linCat=basket">Open Basket (0 Images)</a></li> + </ul> + </li> + <li><span>Ansicht </span> + <ul> + <li><span>Sort </span> + + <ul> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Name Asc">Name Asc</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Name Desc">Name Desc</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Date Asc">Date Asc</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Date Desc">Date Desc</a></li> + </ul> + </li> + + <li><span>Ansicht </span> + <ul> + <li><a href="/linpha2/?&linCat=alb&linId=4&view=thumb">Normal</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&view=thumbdetail">Detail</a></li> + </ul> + </li> + <li><span>Thumb Size </span> + + <ul> + <li><a href="javascript:myLinThumbnails.setTnSize(50)">50 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(75)">75 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(100)">100 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(150)">150 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(200)">200 Pixel</a></li> + + <li><a href="javascript:myLinThumbnails.setTnSize(250)">250 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(300)">300 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(400)">400 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(500)">500 Pixel</a></li> + </ul> + </li> + <li><span>Thumb Nr </span> + + <ul> + <li><a href="javascript:myLinThumbnails.setNrImages('auto')">auto</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('10')">10</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('25')">25</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('50')">50</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('100')">100</a></li> + + <li><a href="javascript:myLinThumbnails.setNrImages('200')">200</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('all')">all</a></li> + </ul> + </li> + </ul> + </li> + </ul> + </li> + </ul> + <!-- icons --> + <div> + <a href="javascript:myLinThumbnails.loadSlideshow()"><img src="../slideshow.png" border="0" title="Play Slideshow" /></a> + </div> +</div> + +<div style="clear: both;"></div> +<!-- end menu --> + + +<div id="linDivMainOuter"> + <div style="background: url(./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=tl" alt="" width="15" height="15" /> + </div> + + <div id="linDivMain"> + + <h1 class="linStyle">Willkommen</h1>Hi, this is the home of "The PHP Photo Archive" <a href="http://linpha.sf.net">aka LinPHA</a>.<br /> <br /> + + + <!-- Random Images --> + + <!-- New Images --> + + <!-- Browse by Date --> + + <!-- Albums --> + <hr class="linStyle" /> + + <h2>Test Zeichenkodierung</h2> + \xC4\xD6\xDC \xE4\xF6\xFC \xE9\xE8\xE0 $\xA3\x80@\xA2\xB0\xA7 + + <br /><br /> + + <h1 class="linStyle">Alben</h1> + + <div class="linDivFolder"> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tl" alt="" width="15" height="15" /> + </div> + <div class="linDivThumbnail"> + <a href="/linpha2/?&linCat=alb&linId=4"><img class="linImgFolderThumbnail" src="../thumb1.gif" alt="thumbnail_album" /></a> + </div> + <div class="linDivFolderText"> + <h2 class="linStyle"><a href="/linpha2/?&linCat=alb&linId=4">2005.05.14-16 Barcelona</a></h2> + Di 25. Dez 2007 19:08:13<br />0 Fotos<br /> + </div> + <div style="clear: both;"></div> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=bl" alt="" width="15" height="15" /> + </div> + </div> + + <div class="linDivFolder"> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tl" alt="" width="15" height="15" /> + </div> + <div class="linDivThumbnail"> + <a href="/linpha2/?&linCat=alb&linId=4"><img class="linImgFolderThumbnail" src="../thumb2.gif" alt="thumbnail_album" /></a> + </div> + <div class="linDivFolderText"> + <h2 class="linStyle"><a href="/linpha2/?&linCat=alb&linId=4">2007.07-14-28 Fuerteventura</a></h2> + Di 25. Dez 2007 19:08:13<br />0 Fotos<br /> + </div> + <div style="clear: both;"></div> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=bl" alt="" width="15" height="15" /> + </div> + </div> + + <div class="linDivFolder"> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tl" alt="" width="15" height="15" /> + </div> + <div class="linDivThumbnail"> + <a href="/linpha2/?&linCat=alb&linId=4"><img class="linImgFolderThumbnail" src="../thumb3.gif" alt="thumbnail_album" /></a> + </div> + <div class="linDivFolderText"> + <h2 class="linStyle"><a href="/linpha2/?&linCat=alb&linId=4">2007.12.15-16 Skifahren Samnaun</a></h2> + Di 25. Dez 2007 19:08:13<br />0 Fotos<br /> + </div> + <div style="clear: both;"></div> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=bl" alt="" width="15" height="15" /> + </div> + </div> + + </div> + + <div style="background: url(./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=bl" alt="" width="15" height="15" /> + </div> +</div> +</body> +</html> + Added: trunk/misc/design/1current/roundcorners.php =================================================================== --- trunk/misc/design/1current/roundcorners.php (rev 0) +++ trunk/misc/design/1current/roundcorners.php 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,87 @@ +<?php +if(!defined('LINPHA_DIR')) { define('LINPHA_DIR','../..'); } + +include_once( './func.watermark.php' ); + +if(!isset($_GET['color'])) +{ + $_GET['color'] = 'orange'; +} + +if(!isset($_GET['bgcolor'])) +{ + $_GET['bgcolor'] = 'white'; +} + +if(!isset($_GET['align'])) +{ + $_GET['align'] = 'tl'; +} + +if(!isset($_GET['size'])) +{ + $size = 15; +} +else +{ + $size = $_GET['size']; +} + +switch($_GET['align']) +{ +case 'tl': $cx = $size; $cy = $size; $workaround = 0; break; +case 'tr': $cx = -1; $cy = $size; $workaround = 0; break; +case 'bl': $cx = $size; $cy = 0; $workaround = 1; break; +case 'br': $cx = -1; $cy = -1; $workaround = 1; break; +} + +// create image +$image = imagecreatetruecolor($size, $size); + +// create colors +$rgb = LinWatermark::getRgbFromAll($_GET['color']); +$color = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); + +if(isset($_GET['alpha'])) +{ + imageAlphaBlending($image, false); + imageSaveAlpha($image, true); + $bgcolor = imagecolorallocatealpha($image, 0, 0, 0, 127); +} +else +{ + $rgb = LinWatermark::getRgbFromAll($_GET['bgcolor']); + $bgcolor = imagecolorallocate($image, $rgb['r'], $rgb['g'], $rgb['b']); +} + +// fill image with background color +imagefill($image, 0, 0, $bgcolor); + + +// draw circly +imagefilledellipse($image, $cx, $cy, ($size*2), ($size*2), $color); + +// workaround +if($workaround) +{ + imageline($image, 0, 0, $size-1, 0, $color ); +} + +// flush image +Header('Content-type: image/png'); + +/** + * force caching in browser + * works in firefox and internet explorer + */ +Header("Last-Modified: " . gmdate("D, d M Y H:i:s",mktime (0,0,0,1,1,2000)) . " GMT"); // Date in the past +Header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image +Header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate"); + + + +imagepng($image); +imagedestroy($image); + + +?> \ No newline at end of file Added: trunk/misc/design/2strictutf8/Linpha2.html =================================================================== --- trunk/misc/design/2strictutf8/Linpha2.html (rev 0) +++ trunk/misc/design/2strictutf8/Linpha2.html 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,246 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> + +<title>Linpha 2.0</title> + +<!-- css includes --> + +<link rel='stylesheet' href='./colorsettings.php?bg=87CEFA&bodybg=DDDDDD&font=000000&albumsbg=D5FCF4&links=005388&linkshover=666666&fieldscolor=CCCCCC' type='text/css'> +<link rel='stylesheet' href='./global.css' type='text/css'> +<link rel='stylesheet' href='./home.css' type='text/css'> + + <!--[if IE]> + <style type="text/css" media="screen"> + #menu ul { width: 1em; } /* this will be a *min* width */ + #menu ul ul { width: 12em; } + #menu ul li { float: left; width: 100%; } + body { behavior: url(./csshover.htc); font-size: 100%; } + #menu ul li a { height: 1%; } + #menu a, #menu span { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } + </style> + <![endif]--> + +</head> + + +<body id="linBody"> + +<!-- syslog --> +<div id="linDivSyslog" style="display: none;"> + <div id="linDivSyslogClose"><a href="javascript:myLinGlobal.closeSyslog();">X</a></div> + <b>Linpha Syslog:</b><br /> + <div id="linDivSyslogText"></div> +</div> + + +<!-- title/navigation --> + +<div id="linDivTitle">Linpha 2.0 :: <a href="/linpha2/?&linCat=alb&linId=0">></a> </div> + + +<!-- menu --> +<div id="linDivMenu"> + <ul style="margin-left: 50px;"> + <li><a href="/linpha2/?&linCat=alb">Home</a></li> + </ul> + <ul> + <li><span>Suche </span> + <ul> + <li><a href="/linpha2/?&linCat=search">Extended Search</a></li> + <li> + <div> + <form method="GET" action="/linpha2/?&linCat=search"> + <input type="text" class="linForms" name="search_text" value="" /> + <input type="hidden" name="button[meta][all]" value="1" /> + + <input type="hidden" name="cmd" value="search" /> + <input type="hidden" name="linCat" value="search" /> + <input type="submit" name="submit" class="linButton linInputMenu" value="Suche" /> + </form> + </div> + </li> + </ul> + </li> + </ul> + <ul> + <li> + <span>Login </span> + <ul id="linMenuLogin"> + <li> + <div> + <form action="" method="POST" onsubmit="new Ajax.Updater('linDivMenu', LINPHA_CLIENT + '/?linCat=ajax&reloadmenu&linId='+IdCurrent, {method: 'post', asynchronous:true, parameters:Form.serialize(this), evalScripts:true}); return false;"> + <!-- login infos --> + <br /> + <label for="linFormUsername" style="display: block; float: left; width: 80px;">Username: </label><input style="width: 105px;" class="linForms" type="text" name="username" value="" id="linFormUsername" /><br /> + <label for="linFormPassword" style="display: block; float: left; width: 80px;">Password: </label><input style="width: 105px;" class="linForms" type="password" name="password" value="" id="linFormPassword" /><br /> + <input type="checkbox" name="rememberme" value="true" id="linFormCheckboxRemember" /><label for="linFormCheckboxRemember">Remember Me</label> <input type="hidden" name="cmd" value="login" /> + <input type="submit" name="submit" class="linButton linInputMenu" value="Login" /><br /><br /> + <div style="font-size: smaller; border: 0px;">Um sich anmelden zu können, müssen Cookies aktiviert sein.</div> + </form> + </div> + </li> + </ul> + </li> + </ul> + <ul> + <li><span>More </span> + <ul id="linMenuMore"> + <li><span>Basket </span> + <ul> + <li><a href="/linpha2/?&linCat=alb&linId=4&admin_cmd=basket_add_all">Add All To Basket</a></li> + + <li><a href="/linpha2/?&linCat=alb&linId=4&view=basket">Switch To Basket View</a></li> + <li><a href="/linpha2/?&linCat=basket">Open Basket (0 Images)</a></li> + </ul> + </li> + <li><span>Ansicht </span> + <ul> + <li><span>Sort </span> + + <ul> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Name Asc">Name Asc</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Name Desc">Name Desc</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Date Asc">Date Asc</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&order_by=Date Desc">Date Desc</a></li> + </ul> + </li> + + <li><span>Ansicht </span> + <ul> + <li><a href="/linpha2/?&linCat=alb&linId=4&view=thumb">Normal</a></li> + <li><a href="/linpha2/?&linCat=alb&linId=4&view=thumbdetail">Detail</a></li> + </ul> + </li> + <li><span>Thumb Size </span> + + <ul> + <li><a href="javascript:myLinThumbnails.setTnSize(50)">50 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(75)">75 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(100)">100 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(150)">150 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(200)">200 Pixel</a></li> + + <li><a href="javascript:myLinThumbnails.setTnSize(250)">250 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(300)">300 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(400)">400 Pixel</a></li> + <li><a href="javascript:myLinThumbnails.setTnSize(500)">500 Pixel</a></li> + </ul> + </li> + <li><span>Thumb Nr </span> + + <ul> + <li><a href="javascript:myLinThumbnails.setNrImages('auto')">auto</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('10')">10</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('25')">25</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('50')">50</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('100')">100</a></li> + + <li><a href="javascript:myLinThumbnails.setNrImages('200')">200</a></li> + <li><a href="javascript:myLinThumbnails.setNrImages('all')">all</a></li> + </ul> + </li> + </ul> + </li> + </ul> + </li> + </ul> + <!-- icons --> + <div> + <a href="javascript:myLinThumbnails.loadSlideshow()"><img src="./slideshow.png" border="0" title="Play Slideshow" /></a> + </div> +</div> + +<div style="clear: both;"></div> +<!-- end menu --> + + +<div id="linDivMainOuter"> + <div style="background: url(./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=tl" alt="" width="15" height="15" /> + </div> + + <div id="linDivMain"> + + <h1 class="linStyle">Willkommen</h1>Hi, this is the home of "The PHP Photo Archive" <a href="http://linpha.sf.net">aka LinPHA</a>.<br /> <br /> + + + <!-- Random Images --> + + <!-- New Images --> + + <!-- Browse by Date --> + + <!-- Albums --> + <hr class="linStyle" /> + + <h2>Test Zeichenkodierung</h2> + \xC4\xD6\xDC \xE4\xF6\xFC \xE9\xE8\xE0 $\xA3\x80@\xA2\xB0\xA7 + + <br /><br /> + + <h1 class="linStyle">Alben</h1> + + <div class="linDivFolder"> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tl" alt="" width="15" height="15" /> + </div> + <div class="linDivThumbnail"> + <a href="/linpha2/?&linCat=alb&linId=4"><img class="linImgFolderThumbnail" src="./thumb1.gif" alt="thumbnail_album" /></a> + </div> + <div class="linDivFolderText"> + <h2 class="linStyle"><a href="/linpha2/?&linCat=alb&linId=4">2005.05.14-16 Barcelona</a></h2> + Di 25. Dez 2007 19:08:13<br />0 Fotos<br /> + </div> + <div style="clear: both;"></div> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=bl" alt="" width="15" height="15" /> + </div> + </div> + + <div class="linDivFolder"> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tl" alt="" width="15" height="15" /> + </div> + <div class="linDivThumbnail"> + <a href="/linpha2/?&linCat=alb&linId=4"><img class="linImgFolderThumbnail" src="./thumb2.gif" alt="thumbnail_album" /></a> + </div> + <div class="linDivFolderText"> + <h2 class="linStyle"><a href="/linpha2/?&linCat=alb&linId=4">2007.07-14-28 Fuerteventura</a></h2> + Di 25. Dez 2007 19:08:13<br />0 Fotos<br /> + </div> + <div style="clear: both;"></div> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=bl" alt="" width="15" height="15" /> + </div> + </div> + + <div class="linDivFolder"> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tr) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=tl" alt="" width="15" height="15" /> + </div> + <div class="linDivThumbnail"> + <a href="/linpha2/?&linCat=alb&linId=4"><img class="linImgFolderThumbnail" src="./thumb3.gif" alt="thumbnail_album" /></a> + </div> + <div class="linDivFolderText"> + <h2 class="linStyle"><a href="/linpha2/?&linCat=alb&linId=4">2007.12.15-16 Skifahren Samnaun</a></h2> + Di 25. Dez 2007 19:08:13<br />0 Fotos<br /> + </div> + <div style="clear: both;"></div> + <div style="background: url(./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=D5FCF4&bgcolor=87CEFA&size=15&align=bl" alt="" width="15" height="15" /> + </div> + </div> + + </div> + + <div style="background: url(./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=br) no-repeat top right;"> + <img src="./roundcorners.php?color=87CEFA&bgcolor=DDDDDD&size=15&align=bl" alt="" width="15" height="15" /> + </div> +</div> +</body> +</html> + Added: trunk/misc/design/2strictutf8/colorsettings.php =================================================================== --- trunk/misc/design/2strictutf8/colorsettings.php (rev 0) +++ trunk/misc/design/2strictutf8/colorsettings.php 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,70 @@ +<?php +header("Content-Type: text/css"); + +/** + * force caching in browser + * works in firefox and internet explorer + */ +Header("Last-Modified: " . gmdate("D, d M Y H:i:s",mktime (0,0,0,1,1,2000)) . " GMT"); // Date in the past +Header("Expires: Mon, 26 Jul 2100 05:00:00 GMT"); // In other words... never expire the image +Header("Cache-Control: max-age=10000000, s-maxage=1000000, proxy-revalidate, must-revalidate"); + + +/* + * Created on 26.10.2006 + * + * To change the template for this generated file go to + * Window - Preferences - PHPeclipse - PHP - Code Templates + */ +?> + +/** + * background color + * #linDivThumbNavi amd #divSlideshowControlsInner used in view_img.html.php + */ + body { + background-color: #<?php echo $_GET['bodybg']; ?>; + } + + #linDivMainOuter, #linDivMetaStaticOuter, #linDivNavigationOuter, /*.linButton,*/ #linDivThumbnaviOuter, #linDivSlideshowControls, .roundAlphabottomInner, .linBackground { + background-color: #<?php echo $_GET['bg']; ?>; + } + +/** + * font color + */ + body, #linDivMenu ul a, #linDivMenu ul span, #linDivMenu ul div { + color: #<?php echo $_GET['font']; ?>; + } + +/** + * albums color + */ + .linDivFolder { + background-color: #<?php echo $_GET['albumsbg']; ?>; + } + +/** + * link/form colors + */ + a:link, a:visited /*, .linButton*/ { + color: #<?php echo $_GET['links']; ?>; + } + a:hover /*, .linButton:hover*/ { + color: #<?php echo $_GET['linkshover']; ?>; + } + + .linForms { + background-color: #<?php echo $_GET['fieldscolor']; ?>; + border: 1px solid grey; + } + +/** + * menu + */ + #linDivMenu ul a:hover, #linDivMenu ul span:hover { + background: #bbbbbb; + } + #linDivMenu ul ul, .linInputMenu { + background-color: #eeeeee; + } Added: trunk/misc/design/2strictutf8/csshover.htc =================================================================== --- trunk/misc/design/2strictutf8/csshover.htc (rev 0) +++ trunk/misc/design/2strictutf8/csshover.htc 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,120 @@ +<attach event="ondocumentready" handler="parseStylesheets" /> +<script> +/** + * Whatever:hover - V1.42.060206 - hover & active + * ------------------------------------------------------------ + * (c) 2005 - Peter Nederlof + * Peterned - http://www.xs4all.nl/~peterned/ + * License - http://creativecommons.org/licenses/LGPL/2.1/ + * + * Whatever:hover is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Whatever:hover 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 + * Lesser General Public License for more details. + * + * Credits and thanks to: + * Arnoud Berendsen, Martin Reurings, Robert Hanson + * + * howto: body { behavior:url("csshover.htc"); } + * ------------------------------------------------------------ + */ + +var csshoverReg = /(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i, +currentSheet, doc = window.document, hoverEvents = [], activators = { + onhover:{on:'onmouseover', off:'onmouseout'}, + onactive:{on:'onmousedown', off:'onmouseup'} +} + +function parseStylesheets() { + if(!/MSIE (5|6)/.test(navigator.userAgent)) return; + window.attachEvent('onunload', unhookHoverEvents); + var sheets = doc.styleSheets, l = sheets.length; + for(var i=0; i<l; i++) + parseStylesheet(sheets[i]); +} + function parseStylesheet(sheet) { + if(sheet.imports) { + try { + var imports = sheet.imports, l = imports.length; + for(var i=0; i<l; i++) parseStylesheet(sheet.imports[i]); + } catch(securityException){} + } + + try { + var rules = (currentSheet = sheet).rules, l = rules.length; + for(var j=0; j<l; j++) parseCSSRule(rules[j]); + } catch(securityException){} + } + + function parseCSSRule(rule) { + var select = rule.selectorText, style = rule.style.cssText; + if(!csshoverReg.test(select) || !style) return; + + var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1'); + var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo); + var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1]; + var affected = select.replace(/:(hover|active).*$/, ''); + var elements = getElementsBySelect(affected); + if(elements.length == 0) return; + + currentSheet.addRule(newSelect, style); + for(var i=0; i<elements.length; i++) + new HoverElement(elements[i], className, activators[pseudo]); + } + +function HoverElement(node, className, events) { + if(!node.hovers) node.hovers = {}; + if(node.hovers[className]) return; + node.hovers[className] = true; + hookHoverEvent(node, events.on, function() { node.className += ' ' + className; }); + hookHoverEvent(node, events.off, function() { node.className = node.className.replace(new RegExp('\\s+'+className, 'g'),''); }); +} + function hookHoverEvent(node, type, handler) { + node.attachEvent(type, handler); + hoverEvents[hoverEvents.length] = { + node:node, type:type, handler:handler + }; + } + + function unhookHoverEvents() { + for(var e,i=0; i<hoverEvents.length; i++) { + e = hoverEvents[i]; + e.node.detachEvent(e.type, e.handler); + } + } + +function getElementsBySelect(rule) { + var parts, nodes = [doc]; + parts = rule.split(' '); + for(var i=0; i<parts.length; i++) { + nodes = getSelectedNodes(parts[i], nodes); + } return nodes; +} + function getSelectedNodes(select, elements) { + var result, node, nodes = []; + var identify = (/\#([a-z0-9_-]+)/i).exec(select); + if(identify) { + var element = doc.getElementById(identify[1]); + return element? [element]:nodes; + } + + var classname = (/\.([a-z0-9_-]+)/i).exec(select); + var tagName = select.replace(/(\.|\#|\:)[a-z0-9_-]+/i, ''); + var classReg = classname? new RegExp('\\b' + classname[1] + '\\b'):false; + for(var i=0; i<elements.length; i++) { + result = tagName? elements[i].all.tags(tagName):elements[i].all; + for(var j=0; j<result.length; j++) { + node = result[j]; + if(classReg && !classReg.test(node.className)) continue; + nodes[nodes.length] = node; + } + } + + return nodes; + } +</script> \ No newline at end of file Added: trunk/misc/design/2strictutf8/expand.gif =================================================================== (Binary files differ) Property changes on: trunk/misc/design/2strictutf8/expand.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/misc/design/2strictutf8/func.watermark.php =================================================================== --- trunk/misc/design/2strictutf8/func.watermark.php (rev 0) +++ trunk/misc/design/2strictutf8/func.watermark.php 2008-01-15 22:22:11 UTC (rev 4811) @@ -0,0 +1,547 @@ +<?php +/* +* Copyright (c) 2004 Heiko Rutenbeck <bz...@tu...> +* +* 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. +*/ + +if(!defined('LINPHA_DIR')) { exit(1); } + +class LinWatermark +{ + +/** +* @author flo +* @todo adapt from linpha1 +*/ +function needWatermark($imgid) +{ + if( $GLOBALS['linpha']->sql->config->value['plugins_active_wm'] + && $GLOBALS['linpha']->sql->config->value['plugins_wm_active'] + && !check_permissions('watermark',$imgid) ) + { + return true; + } else { + return false; + } +} + +/** + * returns array with all the configs and the default values, they are only defined here + */ +function getWatermarkArray() +{ + return array ( + 'wm_active' => "0", + 'wm_watermark' => "0", + 'wm_text' => "Copyright 2007", + 'wm_font' => "", + 'wm_fontsize' => "20", + 'wm_fontc... [truncated message content] |
From: <fan...@us...> - 2008-01-15 21:11:47
|
Revision: 4810 http://linpha.svn.sourceforge.net/linpha/?rev=4810&view=rev Author: fangehrn Date: 2008-01-15 13:10:43 -0800 (Tue, 15 Jan 2008) Log Message: ----------- Added Paths: ----------- trunk/misc/.project trunk/misc/design/ trunk/misc/make_release.sh Added: trunk/misc/.project =================================================================== --- trunk/misc/.project (rev 0) +++ trunk/misc/.project 2008-01-15 21:10:43 UTC (rev 4810) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>linpha_misc</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>net.sourceforge.phpeclipse.parserbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>net.sourceforge.phpeclipse.phpnature</nature> + </natures> +</projectDescription> Added: trunk/misc/make_release.sh =================================================================== --- trunk/misc/make_release.sh (rev 0) +++ trunk/misc/make_release.sh 2008-01-15 21:10:43 UTC (rev 4810) @@ -0,0 +1,151 @@ +#!/bin/sh +############################################################################ +## Export LinPHA from CVS, remove unwated files, do cleanups, make archives +## (tar.gz/tar.bz2/zip) and finally upload them to SF +## version 0.6.0 09. Aug. 2004 +## copyright bzrudi71 +## License GPL +############################################################################ + +TMP_DIR="~/tmp/linpha" +VERSION="1.1.0" # releae name (linpha-VERSION.xyz) +DO_DISTRI="1" # create tar.gz/tar.bz2/zip archives +#DO_UPLOAD="1" # ftp releases to SF +ARCHIVE_PATH="./archives/"; # where to store the archives bz2,gz,zip +AUTOCLEAN="0" # cleanup all tmp files by default + + +cd $TMP_DIR + +### here we go... ### +echo "BUILDING LinPHA RELEASE $VERSION" +echo -n "cleaning up..." +if [ -d linpha-$VERSION/ ] ;then + rm -rf ./linpha-$VERSION/ + rm -rf $ARCHIVE_PATH + echo " DONE!" + sleep 1s +fi + +echo "Getting LinPHA CVS (export)..." +export CVS_RSH=ssh +cvs -d:ext:fan...@cv...:/cvsroot/linpha export -D today linpha + +mv linpha linpha-$VERSION +if [ -d linpha-$VERSION/ ] ;then # export OK! + + sleep 2s + echo "Cleaning up LinPHA..." + + # change error:reporting in header.php + echo -n "Setting error_reporting => OFF in header.php..." + if [ -e linpha-$VERSION/header.php ] ;then + sed -e "s/E_ALL/1/" linpha-$VERSION/header.php > dummy.header + if [ -e dummy.header ] ;then + mv dummy.header linpha-$VERSION/header.php + echo " DONE!" + else + echo " Patching failed for some reason" + fi + fi + # remove langupdate.php + echo -n "Removing langupdate.php..." + if [ -e linpha-$VERSION/lang/langupdate.php ] ;then + rm linpha-$VERSION/lang/langupdate.php + echo " DONE!" + else + echo " FAILED (or already removed)" + fi + + # remove cronOthumb.php + echo -n "Removing cronOthumb.php.php..." + if [ -e linpha-$VERSION/cronOthumb.php ] ;then + rm linpha-$VERSION/cronOthumb.php + echo " DONE!" + else + echo " FAILED (or already removed)" + fi + + # run some changemods + echo "Changemodding some files:" + if [ -e linpha-$VERSION/search.php ] ;then + chmod 644 linpha-$VERSION/search.php + echo "... search.php DONE!"; + else + echo "... changemodding search.php FAILED!" + fi + + if [ -e linpha-$VERSION/styles/aqua.css ] ;then + chmod 644 linpha-$VERSION/styles/aqua.css + echo "... aqua.css DONE!"; + else + echo "... changemodding aqua.css FAILED!" + fi + + if [ -e linpha-$VERSION/styles/colored.css ] ;then + chmod 644 linpha-$VERSION/styles/colored.css + echo "... colored.css DONE!"; + else + echo "... changemodding colored.css FAILED!" + fi + + if [ -e linpha-$VERSION/styles/shadow.css ] ;then + chmod 644 linpha-$VERSION/styles/shadow.css + echo "... shadow.css DONE!"; + else + echo "... changemodding shadow.css FAILED!" + fi + + if [ -d linpha-$VERSION/sql ] ;then + chmod 777 linpha-$VERSION/sql + echo "... sql directory DONE!"; + else + echo "... changemodding sql directory FAILED!" + fi + + sleep 3s + + echo "Building all Archives..." + echo -n "Creating $ARCHIVE_PATH directory..." + mkdir $ARCHIVE_PATH + if [ -d $ARCHIVE_PATH ] ;then + echo " DONE!" + else + echo " FAILED!" + fi + sleep 2s + + ##### tar.gz ##### + echo "Creating linpha-$VERSION.tar.gz" + tar --create --file=$ARCHIVE_PATH/linpha-$VERSION.tar ./linpha-$VERSION + gzip -f $ARCHIVE_PATH/linpha-$VERSION.tar + if [ -e $ARCHIVE_PATH/linpha-$VERSION.tar.gz ] ;then + echo "OK linpha-$VERSION.tar.gz created..." + else + echo "FAILED" + fi + + ##### tar.bz2 ##### + echo "Creating linpha-$VERSION.tar.bz2" + tar --create --file=$ARCHIVE_PATH/linpha-$VERSION.tar ./linpha-$VERSION + bzip2 -f $ARCHIVE_PATH/linpha-$VERSION.tar + if [ -e $ARCHIVE_PATH/linpha-$VERSION.tar.bz2 ] ;then + echo "OK linpha-$VERSION.tar.bz2 created..." + else + echo "FAILED" + fi + + ##### zip ##### + echo "Creating linpha-$VERSION.zip" + zip -rq $ARCHIVE_PATH/linpha-$VERSION.zip ./linpha-$VERSION/ + if [ -e $ARCHIVE_PATH/linpha-$VERSION.zip ] ;then + echo "OK linpha-$VERSION.zip created..." + else + echo "FAILED" + fi + +else + echo "CVS checkout went wrong!, retry later" +fi + +echo "WOW! just another new release is ready to hit the masses :-))!" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2008-01-15 21:05:59
|
Revision: 4809 http://linpha.svn.sourceforge.net/linpha/?rev=4809&view=rev Author: fangehrn Date: 2008-01-15 13:05:54 -0800 (Tue, 15 Jan 2008) Log Message: ----------- Added Paths: ----------- trunk/misc/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: bzrudi <bz...@us...> - 2008-01-15 12:41:16
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22006 Modified Files: ChangeLog footer.php Log Message: make copyright year dynamic in footer, e.g. 2002-XXXX Index: footer.php =================================================================== RCS file: /cvsroot/linpha/linpha/footer.php,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** footer.php 25 Oct 2007 15:26:46 -0000 1.54 --- footer.php 15 Jan 2008 12:41:06 -0000 1.55 *************** *** 9,13 **** 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-2007 The LinPHA developers <?php if(read_config('timer')) { --- 9,13 ---- 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 <?php if(read_config('timer')) { Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1271 retrieving revision 1.1272 diff -C2 -d -r1.1271 -r1.1272 *** ChangeLog 10 Nov 2007 09:06:19 -0000 1.1271 --- ChangeLog 15 Jan 2008 12:41:05 -0000 1.1272 *************** *** 1,2 **** --- 1,6 ---- + 2008-01-08 bzrudi + * footer.php: make copyright year dynamic in footer, e.g. 2002-XXXX + + 2007-11-10 bzrudi * [ 1810717 ] IPTC and HTML code in Caption -> fixed! |
From: <bz...@us...> - 2007-12-09 15:13:51
|
Revision: 4808 http://linpha.svn.sourceforge.net/linpha/?rev=4808&view=rev Author: bzrudi Date: 2007-12-09 07:13:48 -0800 (Sun, 09 Dec 2007) Log Message: ----------- "remove filemanager from menu if plugin is disabled, even for admin user. would fail else and makes not to much sense imho" Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.imgview.class.php Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2007-12-09 15:11:00 UTC (rev 4807) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2007-12-09 15:13:48 UTC (rev 4808) @@ -280,8 +280,7 @@ if($GLOBALS['linpha']->sql->isLoggedIn()) { if( isset($GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable']) - && $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] == 1 - OR $GLOBALS['linpha']->sql->isAdmin()) + && $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] == 1 ) { $GLOBALS['linpha']->template->output['menu_My Settings']['filemanager'] = array('name' => i18n("Filemanager"), 'value' => LINPHA_LINK.'&linCat=filemanager'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-12-09 15:11:04
|
Revision: 4807 http://linpha.svn.sourceforge.net/linpha/?rev=4807&view=rev Author: bzrudi Date: 2007-12-09 07:11:00 -0800 (Sun, 09 Dec 2007) Log Message: ----------- "fixed plugins include (typo)" Modified Paths: -------------- trunk/linpha2/index.php Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2007-12-09 13:48:16 UTC (rev 4806) +++ trunk/linpha2/index.php 2007-12-09 15:11:00 UTC (rev 4807) @@ -43,9 +43,6 @@ case 'browse': require_once(LINPHA_DIR.'/lib/modules/module.browse.php'); break; -/*case 'filemanager': - require_once(LINPHA_DIR.'/lib/modules/module.filemanager.php'); - break;*/ case 'settings': require_once(LINPHA_DIR.'/lib/modules/module.settings.php'); break; @@ -74,8 +71,8 @@ default: // include plugins - $plugindDir = LINPHA_DIR.'/lib/plugins'; - $includeFile = $plugindDir.'/'.$_GET['linCat'].'/module.'.$_GET['linCat'].'.php'; + $pluginDir = LINPHA_DIR.'/lib/plugins'; + $includeFile = $pluginDir.'/'.$_GET['linCat'].'/module.'.$_GET['linCat'].'.php'; if( is_dir($pluginDir) && isset($GLOBALS['linpha']->sql->config->value['plugins_'.$_GET['linCat'].'_enable']) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-12-09 13:48:22
|
Revision: 4806 http://linpha.svn.sourceforge.net/linpha/?rev=4806&view=rev Author: bzrudi Date: 2007-12-09 05:48:16 -0800 (Sun, 09 Dec 2007) Log Message: ----------- "removed logging tab from features within admin section, as it's now to be found under plugins. plus minor changes under features tab " Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/settings_features.php trunk/linpha2/admin/settings_layout.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-12-09 13:15:30 UTC (rev 4805) +++ trunk/linpha2/ChangeLog 2007-12-09 13:48:16 UTC (rev 4806) @@ -1,7 +1,9 @@ 2007-12-09 bzrudi * fix for db_error.log file create * fixed a couple of notices and warnings introduced by new plugin model - + * removed logging tab from features within admin section, as it's now to be + found under plugins. plus minor changes under features tab + 2007-12-02 flo * created settings and permissions section for plugins they are dynamically loaded with the files /lib/plugins/*/settings.*.php Modified: trunk/linpha2/admin/settings_features.php =================================================================== --- trunk/linpha2/admin/settings_features.php 2007-12-09 13:15:30 UTC (rev 4805) +++ trunk/linpha2/admin/settings_features.php 2007-12-09 13:48:16 UTC (rev 4806) @@ -3,11 +3,19 @@ if(!isset($cat3)) { - $cat3 = 'others'; + $cat3 = 'general'; } - +/** + * save settings + */ +if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') +{ + $LinAdmin->saveConfig($LinAdmin->options); +} + $array_menu = array( - 'log' => array('name' => i18n("Logging"), 'link' => 'settings_features_log'), + 'general' => array('name' => i18n("General"), 'link' => 'settings_features_general'), + 'import' => array('name' => i18n("Import"), 'link' => 'settings_features_import'), 'others' => array('name' => i18n("Others"), 'link' => 'settings_features_others'), ); @@ -20,47 +28,17 @@ switch($cat3) { -case 'log': +case 'general': - /** - * save settings - */ - if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') - { - $LinAdmin->saveConfig(Array( - 'plugins_log_filename', - 'plugins_log_syslog_enable', - 'plugins_log_syslog_add_events', - 'plugins_log_email_enable', - 'plugins_log_email_add_events', - 'plugins_log_email_to', - 'plugins_log_email_headers', - 'plugins_log_email_subject' - )); - } + $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_lang_autolang'),'sys_lang_autolang',$LinAdmin->option_value_system['sys_lang_autolang']); + $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_lang'),'sys_lang',$LinAdmin->option_value_system['sys_lang'],array('options' => linGetAvailableLanguageFiles( 'lib/lang', $withEnglish = true ) ) ); - echo '<br /><h2 class="linStyle">'.i18n("Filename").'</h2>'; - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_filename'),'plugins_log_filename',$LinAdmin->option_value_system['plugins_log_filename']); +break; - echo '<br /><h2 class="linStyle">'.i18n("Syslog").'</h2>'; - echo i18n("(Event log in Windows)"); - $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_log_syslog_enable'),'plugins_log_syslog_enable',$LinAdmin->option_value_system['plugins_log_syslog_enable']); +case 'import': + +break; - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_syslog_add_events'),'plugins_log_syslog_add_events',$LinAdmin->option_value_system['plugins_log_syslog_add_events']); - echo i18n("Comma separated list. Valid events:")." login, logout, rotate, comments, guestbook, fm_others, fm_upload, fm_delete, fm_move, fm_copy, fm_rename, fm_create_folder, fm_perm"; - echo '<br />'; - - echo '<br /><h2 class="linStyle">'.i18n("Email").'</h2>'; - $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_log_email_enable'),'plugins_log_email_enable',$LinAdmin->option_value_system['plugins_log_email_enable']); - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_to'),'plugins_log_email_to',$LinAdmin->option_value_system['plugins_log_email_to']); - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_subject'),'plugins_log_email_subject',$LinAdmin->option_value_system['plugins_log_email_subject']); - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_headers'),'plugins_log_email_headers',$LinAdmin->option_value_system['plugins_log_email_headers']); - - $LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_add_events'),'plugins_log_email_add_events',$LinAdmin->option_value_system['plugins_log_email_add_events']); - echo i18n("Comma separated list. Valid events:")." login, logout, rotate, comments, guestbook, fm_others, fm_upload, fm_delete, fm_move, fm_copy, fm_rename, fm_create_folder, fm_perm"; - - break; - case 'others': /** * save settings @@ -77,7 +55,11 @@ $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_exif'),'sys_image_exif',$LinAdmin->option_value_system['sys_image_exif']); $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_iptc'),'sys_image_iptc',$LinAdmin->option_value_system['sys_image_iptc']); $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_image_xmp'),'sys_image_xmp',$LinAdmin->option_value_system['sys_image_xmp']);*/ - break; +break; +default: +break; + + } ?> \ No newline at end of file Modified: trunk/linpha2/admin/settings_layout.php =================================================================== --- trunk/linpha2/admin/settings_layout.php 2007-12-09 13:15:30 UTC (rev 4805) +++ trunk/linpha2/admin/settings_layout.php 2007-12-09 13:48:16 UTC (rev 4806) @@ -108,9 +108,6 @@ $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_template'),'sys_style_layout_template',$LinAdmin->option_value_system['sys_style_layout_template'],array('options' => LinAdmin::getTemplates())); $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_style_layout_theme'),'sys_style_layout_theme',$LinAdmin->option_value_system['sys_style_layout_theme'],array('options' => LinAdmin::getThemes($LinAdmin->option_value_system['sys_style_layout_template']))); - $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('sys_lang_autolang'),'sys_lang_autolang',$LinAdmin->option_value_system['sys_lang_autolang']); - $LinAdmin->printAdminConfig('select',$LinAdmin->getDescriptionByOptionName('sys_lang'),'sys_lang',$LinAdmin->option_value_system['sys_lang'],array('options' => linGetAvailableLanguageFiles( 'lib/lang', $withEnglish = true ) ) ); - echo '<br /><h2 class="linStyle">'.i18n("Colors").'</h2>'; ?> <script language="JavaScript" type="text/javascript"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-12-09 13:15:36
|
Revision: 4805 http://linpha.svn.sourceforge.net/linpha/?rev=4805&view=rev Author: bzrudi Date: 2007-12-09 05:15:30 -0800 (Sun, 09 Dec 2007) Log Message: ----------- "fixed a couple of notices and warnings introduced by new plugin model" Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.imgview.class.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-12-02 21:46:57 UTC (rev 4804) +++ trunk/linpha2/ChangeLog 2007-12-09 13:15:30 UTC (rev 4805) @@ -1,3 +1,6 @@ +2007-12-09 bzrudi + * fix for db_error.log file create + * fixed a couple of notices and warnings introduced by new plugin model 2007-12-02 flo * created settings and permissions section for plugins Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2007-12-02 21:46:57 UTC (rev 4804) +++ trunk/linpha2/lib/classes/linpha.functions.php 2007-12-09 13:15:30 UTC (rev 4805) @@ -602,55 +602,85 @@ */ if( !isset($GLOBALS['linpha']->sql->config->value) ) // database not connected! { - error_log("$time | $severity_msg | $type_msg | $ip | $user | $event | $text".LIN_NL, 3, LINPHA_DIR.'/var/db_error.log' ); + error_log("".time()." | $severity_msg | $type_msg | $ip | $user | $event | $text".LIN_NL, 3, LINPHA_DIR.'/var/db_error_tmp.log' ); } else { - /** - * filename - */ - error_log("$time | $severity_msg | $type_msg | $ip | $user | $event | $text".LIN_NL, 3, LinFilesys::getFullPath($GLOBALS['linpha']->sql->config->value['plugins_log_filename']) ); - - /** - * email - */ - if( $GLOBALS['linpha']->sql->config->value['plugins_log_email_enable'] ) - { - if( $severity <= LOG_WARNING OR - strpos($GLOBALS['linpha']->sql->config->value['plugins_log_email_add_events'], $event) !== false ) - { - mail( - $GLOBALS['linpha']->sql->config->value['plugins_log_email_to'], - $GLOBALS['linpha']->sql->config->value['plugins_log_email_subject'], - "$time | $severity_msg | $type_msg | $ip | $ip | $user | $text", - $GLOBALS['linpha']->sql->config->value['plugins_log_email_headers'] - ); - } - } - /** - * syslog + * Only if logging plugin is enabled */ - if( $GLOBALS['linpha']->sql->config->value['plugins_log_syslog_enable'] && - $severity <= LOG_WARNING ) - { - /** + if(isset($GLOBALS['linpha']->sql->config->value['plugins_log_enable']) && + $GLOBALS['linpha']->sql->config->value['plugins_log_enable'] == '1') + { + /** + * In case of database connection error a file named + * db_error_tmp.log is created. If the file exists, copy it's content + * over to the default filename defined in plugins_log_filename + * and delete it later for security reasons. We have to go this way, + * as a random filename would create a new file every time an error + * occured, and a defined filenname is not the best choice for + * security reasons. + * bzrudi + */ + if(file_exists(LINPHA_DIR.'/var/db_error_tmp.log')) + { + $fhandle = @file(LINPHA_DIR.'/var/db_error_tmp.log'); + if(is_array($fhandle)) + { + foreach($fhandle AS $line) + { + error_log("$line", 3, LinFilesys::getFullPath($GLOBALS['linpha']->sql->config->value['plugins_log_filename'])); + } + unlink(LINPHA_DIR.'/var/db_error_tmp.log'); + } + } + + /** + * filename + */ + error_log("$time | $severity_msg | $type_msg | $ip | $user | $event | $text".LIN_NL, 3, LinFilesys::getFullPath($GLOBALS['linpha']->sql->config->value['plugins_log_filename']) ); + + /** + * email + */ + if( $GLOBALS['linpha']->sql->config->value['plugins_log_email_enable'] ) + { + if( $severity <= LOG_WARNING OR + strpos($GLOBALS['linpha']->sql->config->value['plugins_log_email_add_events'], $event) !== false ) + { + mail( + $GLOBALS['linpha']->sql->config->value['plugins_log_email_to'], + $GLOBALS['linpha']->sql->config->value['plugins_log_email_subject'], + "$time | $severity_msg | $type_msg | $ip | $ip | $user | $text", + $GLOBALS['linpha']->sql->config->value['plugins_log_email_headers'] + ); + } + } + + /** + * syslog + */ + if( $GLOBALS['linpha']->sql->config->value['plugins_log_syslog_enable'] && + $severity <= LOG_WARNING ) + { + /** * In Windows NT, use the following values of priority: * 1 = error, * 2-5 = warning * 6 = info */ - - if( LIN_OS == 'win' ) - { - if( $severity <= LOG_ERR ) - { - $severity = 1; - } - } - - syslog($severity, "LinPHA $severity_msg | $type_msg | $ip | $user | $event | $text"); - } + + if( LIN_OS == 'win' ) + { + if( $severity <= LOG_ERR ) + { + $severity = 1; + } + } + + syslog($severity, "LinPHA $severity_msg | $type_msg | $ip | $user | $event | $text"); + } + } } } Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2007-12-02 21:46:57 UTC (rev 4804) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2007-12-09 13:15:30 UTC (rev 4805) @@ -279,7 +279,9 @@ */ if($GLOBALS['linpha']->sql->isLoggedIn()) { - if( $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] OR $GLOBALS['linpha']->sql->isAdmin()) + if( isset($GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable']) + && $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] == 1 + OR $GLOBALS['linpha']->sql->isAdmin()) { $GLOBALS['linpha']->template->output['menu_My Settings']['filemanager'] = array('name' => i18n("Filemanager"), 'value' => LINPHA_LINK.'&linCat=filemanager'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2007-12-02 21:47:05
|
Revision: 4804 http://linpha.svn.sourceforge.net/linpha/?rev=4804&view=rev Author: fangehrn Date: 2007-12-02 13:46:57 -0800 (Sun, 02 Dec 2007) Log Message: ----------- 2007-12-02 flo * created settings and permissions section for plugins they are dynamically loaded with the files /lib/plugins/*/settings.*.php and /lib/plugins/*/permissions.*.php * decided to have for each plugin own sql files -> plugins are now nearly separated from the main linpha files -> if someone adds a new plugin, you don't have to update linpha itself, just copy the plugin folder to the plugin directory and it will automatically appear in the admin section where it can be enabled and the tables and config entries are automatically created -> this solves also the sequences and triggers problem with oracle * changed back the style of the form buttons i think buttons should still be buttons * filemanager - disallow change of the file extension a user could upload anEvilPhpScriptMaskedAsAnImage.jpg and rename it later to anEvilPhpScriptMaskedAsAnImage.php Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/permissions.php trunk/linpha2/admin/permissions_others.php trunk/linpha2/admin/permissions_readwrite.php trunk/linpha2/admin/settings_plugins.php trunk/linpha2/index.php trunk/linpha2/install/step9_createtables.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.filesys.class.php trunk/linpha2/lib/include/sql/sql.data.php trunk/linpha2/lib/include/sql/sql.mysql.php trunk/linpha2/lib/include/sql/sql.tables.php trunk/linpha2/lib/modules/module.settings.php trunk/linpha2/lib/plugins/filemanager/settings.filemanager.php trunk/linpha2/reset_database.php trunk/linpha2/templates/default/global.html.php trunk/linpha2/templates/default/themes/default/colorsettings.php trunk/linpha2/templates/default/themes/default/css/global.css Added Paths: ----------- trunk/linpha2/lib/plugins/example/ trunk/linpha2/lib/plugins/example/module.example.php trunk/linpha2/lib/plugins/example/permissions.example.php trunk/linpha2/lib/plugins/example/settings.example.php trunk/linpha2/lib/plugins/example/sql/ trunk/linpha2/lib/plugins/example/sql/sql.data.php trunk/linpha2/lib/plugins/example/sql/sql.mysql.php trunk/linpha2/lib/plugins/example/sql/sql.oci8po.php trunk/linpha2/lib/plugins/example/sql/sql.postgres.php trunk/linpha2/lib/plugins/example/sql/sql.sqlite.php trunk/linpha2/lib/plugins/filemanager/module.filemanager.php trunk/linpha2/lib/plugins/filemanager/sql/ trunk/linpha2/lib/plugins/filemanager/sql/sql.data.php trunk/linpha2/lib/plugins/guestbook/permissions.guestbook.php trunk/linpha2/lib/plugins/guestbook/sql/ trunk/linpha2/lib/plugins/guestbook/sql/sql.data.php trunk/linpha2/lib/plugins/log/sql/ trunk/linpha2/lib/plugins/log/sql/sql.data.php trunk/linpha2/lib/plugins/maillist/sql/ trunk/linpha2/lib/plugins/maillist/sql/sql.data.php trunk/linpha2/lib/plugins/maps/permissions.maps.php trunk/linpha2/lib/plugins/maps/settings.maps.php trunk/linpha2/lib/plugins/maps/sql/ trunk/linpha2/lib/plugins/maps/sql/sql.data.php trunk/linpha2/lib/plugins/maps/sql/sql.mysql.php trunk/linpha2/lib/plugins/maps/sql/sql.oci8po.php trunk/linpha2/lib/plugins/maps/sql/sql.postgres.php trunk/linpha2/lib/plugins/maps/sql/sql.sqlite.php trunk/linpha2/lib/plugins/rss/sql/ trunk/linpha2/lib/plugins/rss/sql/sql.data.php trunk/linpha2/lib/plugins/stats/sql/ trunk/linpha2/lib/plugins/stats/sql/sql.data.php trunk/linpha2/lib/plugins/watermark/permissions.watermark.php trunk/linpha2/lib/plugins/watermark/sql/ trunk/linpha2/lib/plugins/watermark/sql/sql.data.php Removed Paths: ------------- trunk/linpha2/lib/modules/module.filemanager.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/ChangeLog 2007-12-02 21:46:57 UTC (rev 4804) @@ -1,4 +1,26 @@ +2007-12-02 flo + * created settings and permissions section for plugins + they are dynamically loaded with the files /lib/plugins/*/settings.*.php + and /lib/plugins/*/permissions.*.php + + * decided to have for each plugin own sql files + -> plugins are now nearly separated from the main linpha files + -> if someone adds a new plugin, you don't have to update linpha itself, + just copy the plugin folder to the plugin directory and it will + automatically appear in the admin section where it can be enabled + and the tables and config entries are automatically created + -> this solves also the sequences and triggers problem with oracle + + + * changed back the style of the form buttons + i think buttons should still be buttons + + * filemanager + - disallow change of the file extension + a user could upload anEvilPhpScriptMaskedAsAnImage.jpg and rename it later + to anEvilPhpScriptMaskedAsAnImage.php + 2007-12-01 flo * creating plugin interface - moved whole install/sql folder to lib/include/sql Modified: trunk/linpha2/admin/permissions.php =================================================================== --- trunk/linpha2/admin/permissions.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/admin/permissions.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -10,10 +10,11 @@ 'users' => array('name' => i18n("Users"), 'link' => 'permissions_users'), 'groups' => array('name' => i18n("Groups"), 'link' => 'permissions_groups'), 'usergroup' => array('name' => i18n("Group Memberships"), 'link' => 'permissions_usergroup'), - 'view' => array('name' => i18n("View"), 'link' => 'permissions_view'), - 'write' => array('name' => i18n("Write"), 'link' => 'permissions_write'), + 'view' => array('name' => i18n("Image View"), 'link' => 'permissions_view'), + 'write' => array('name' => i18n("Image Upload"), 'link' => 'permissions_write'), 'basket' => array('name' => i18n("Basket"), 'link' => 'permissions_basket'), 'metadata' => array('name' => i18n("MetaData"), 'link' => 'permissions_metadata'), + 'plugins' => array('name' => i18n("Plugins"), 'link' => 'permissions_plugins'), 'others' => array('name' => i18n("Others"), 'link' => 'permissions_others'), ); @@ -40,9 +41,14 @@ case 'basket': case 'metadata': +case 'plugins': case 'others': include_once('./permissions_others.php'); break; + +/*case 'plugins': + include_once(LINPHA_DIR.'/admin/permissions_plugins.php'); + break;*/ } ?> Modified: trunk/linpha2/admin/permissions_others.php =================================================================== --- trunk/linpha2/admin/permissions_others.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/admin/permissions_others.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -1,59 +1,16 @@ <?php if(!defined('LINPHA_DIR')) { exit(1); } -if(!isset($cat3)) -{ - $cat3 = ''; -} - -switch($cat2) -{ -case 'basket': - $array_menu = array( - 'print' => array('name' => i18n("Print"), 'link' => 'permissions_basket_print'), - 'mail' => array('name' => i18n("Mail"), 'link' => 'permissions_basket_mail'), - 'download' => array('name' => i18n("Download"), 'link' => 'permissions_basket_download'), - ); - break; -case 'metadata': - $array_menu = array( - 'comments' => array('name' => i18n("Write Comments"), 'link' => 'permissions_metadata_comments'), - 'deletecomments' => array('name' => i18n("Delete Comments"), 'link' => 'permissions_metadata_deletecomments'), - 'edit' => array('name' => i18n("Edit Image Informations"), 'link' => 'permissions_metadata_edit'), - ); - break; -case 'others': - $array_menu = array( - 'watermark' => array('name' => i18n("Watermark"), 'link' => 'permissions_others_watermark'), - 'stats' => array('name' => i18n("Statistics"), 'link' => 'permissions_others_stats'), - 'download' => array('name' => i18n("Download"), 'link' => 'permissions_others_download'), - ); - break; -} - -LinAdmin::printAdminMenu($array_menu,$cat3); - -if(!empty($cat3)) -{ - if($cat2 == 'basket' OR $cat2 == 'metadata') - { - $key = $cat2.'_'.$cat3; - } - elseif($cat2 == 'others') - { - $key = $cat3; - } - - /** - * save data - */ +/** + * save data + */ if(isset($_POST['cmd']) && $_POST['cmd'] == 'edit') { if($_POST['allowall'] == 'allowall') { $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."permissions " . "SET permission = ';public;' " . - "WHERE perm_type = '".LinSql::linAddslashes($key)."'"); + "WHERE perm_type = '".LinSql::linAddslashes($_POST['perm_type'])."'"); } else { @@ -68,38 +25,120 @@ $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."permissions " . "SET permission = '".LinSql::linAddslashes($str)."' " . - "WHERE perm_type = '".LinSql::linAddslashes($key)."'"); + "WHERE perm_type = '".LinSql::linAddslashes($_POST['perm_type'])."'"); } } + +switch($cat2) +{ +case 'basket': + printPermissions('basket_print',i18n("Basket Print")); + printPermissions('basket_mail',i18n("Basket Mail")); + printPermissions('basket_download',i18n("Basket Download")); + break; +case 'metadata': + printPermissions('metadata_comments',i18n("Write Comments")); + printPermissions('metadata_deletecomments',i18n("Delete Comments")); + printPermissions('metadata_edit',i18n("Edit Image Informations")); + break; +case 'others': + printPermissions('download',i18n("Download Single Images")); + break; +case 'plugins': + + $array_menu = array(); + $arrPlugins = LinAdmin::getPlugins(); + foreach( $arrPlugins as $key=>$value) + { + $includeFile = LINPHA_DIR.'/lib/plugins/'.$value.'/permissions.'.$value.'.php'; + if( isset($LinAdmin->option_value_system['plugins_'.$value.'_enable']) + && $LinAdmin->option_value_system['plugins_'.$value.'_enable']=='1' + && file_exists($includeFile) + ) + { + $array_menu[$value] = array( + 'name' => $LinAdmin->description_array['plugins_'.$value], + 'link' => 'permissions_plugins_'.$value + ); + } + } + if(!isset($cat3)) { + LinAdmin::printAdminMenu($array_menu,''); + } else { + LinAdmin::printAdminMenu($array_menu,$cat3); + } - echo '<b>'.i18n("Edit").': '.$array_menu[$cat3]['name'].'</b><br />'; + + if( isset($cat3) && in_array($cat3,$arrPlugins) + && $LinAdmin->option_value_system['plugins_'.$cat3.'_enable']=='1' ) + { + $includeFile = LINPHA_DIR.'/lib/plugins/'.$cat3.'/permissions.'.$cat3.'.php'; + if( file_exists($includeFile) ) + { + include_once($includeFile); + } + } + + break; +} + +?> + <script language="JavaScript" type="text/javascript"> + + function update_forms(formId) + { + if(formId.allowall[0].checked) + { + // use elements[2] for select name because it does not work with the name groups[] + formId.elements[2].disabled = true; + formId.elements[2].selectedIndex = -1; + } + + if(formId.allowall[1].checked) + { + formId.elements[2].disabled = false; + } + } + //update_forms(); + + </script> +<?php + +function printPermissions($key,$description) +{ + echo '<b>'.$description.'</b><br />'; + $data = $GLOBALS['linpha']->db->GetRow("SELECT permission FROM ".LIN_PREFIX."permissions " . "WHERE perm_type = '".LinSql::linAddslashes($key)."'"); + if( !$data ) { + echo "Warning: This permission does not exists: ".$key."<br />"; + return; + } + $array_permissions = linExplodeAndSlice(';',$data['permission']); if(in_array('public',$array_permissions)) { $allowall_checked = ' checked="checked"'; $allowgroups_checked = ''; + $groups_disabled = ' disabled="disabled"'; } else { $allowall_checked = ''; $allowgroups_checked = ' checked="checked"'; + $groups_disabled = ''; } -?> - <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$cat2.'_'.$cat3; ?>"> - <br /> - <input type="radio" id="allowall" name="allowall" value="allowall"<?php echo $allowall_checked; ?>onClick="update_forms()" /> - <label for="allowall"><?php echo i18n("Allow All"); ?></label> - <br /><br /> - <input type="radio" id="allowgroups" name="allowall" value="allowgroups"<?php echo $allowgroups_checked; ?>onClick="update_forms()" /> - <label for="allowgroups"><?php echo i18n("Allow Only This Groups:"); ?></label> - <br /> + ?> + <form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=permissions_'.$key; ?>"> + <label for="allowall<?php echo $key; ?>"><input type="radio" id="allowall<?php echo $key; ?>" name="allowall" value="allowall"<?php + echo $allowall_checked; ?> onclick="update_forms(this.form)" /> <?php echo i18n("Allow All"); ?></label><br /> + <label for="allowgroups<?php echo $key; ?>"><input type="radio" id="allowgroups<?php echo $key; ?>" name="allowall" value="allowgroups"<?php + echo $allowgroups_checked; ?>onclick="update_forms(this.form)" /> <?php echo i18n("Allow Only These Groups:"); ?></label><br /> - <select id="selectgroups" name="groups[]" size="5" style="width: 200;" multiple="multiple"> + <select id="selectgroups" name="groups[]" size="5" style="width: 200;" multiple="multiple"<?php echo $groups_disabled; ?>> <?php $query = $GLOBALS['linpha']->db->Execute("SELECT id, group_name FROM ".LIN_PREFIX."groups ORDER by group_name"); while($data = $query->FetchRow()) @@ -116,35 +155,15 @@ echo '<option value="'.$data['id'].'"'.$checked.'>'.$data['group_name'].'</option>'; } ?> + + <input type="hidden" name="perm_type" value="<?php echo $key; ?>" /> <input type="hidden" name="cmd" value="edit" /> <br /> <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" /> </select> </form> + <br /> + <?php +} - <script language="JavaScript" type="text/javascript"> - - function update_forms() - { - var allowall = document.getElementById('allowall'); - var allowgroups = document.getElementById('allowgroups'); - var selectgroups = document.getElementById('selectgroups'); - - if(allowall.checked) - { - selectgroups.disabled = true; - selectgroups.selectedIndex = -1; - } - - if(allowgroups.checked) - { - selectgroups.disabled = false; - } - } - update_forms(); - - </script> - -<?php -} ?> \ No newline at end of file Modified: trunk/linpha2/admin/permissions_readwrite.php =================================================================== --- trunk/linpha2/admin/permissions_readwrite.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/admin/permissions_readwrite.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -17,12 +17,12 @@ { $LinAdmin->saveConfig( Array( - 'plugins_filemanager_enable' + 'plugins_filemanager_userEnable' ) ); } - $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_filemanager_enable'),'plugins_filemanager_enable',$LinAdmin->option_value_system['plugins_filemanager_enable']); + $LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_filemanager_userEnable'),'plugins_filemanager_userEnable',$LinAdmin->option_value_system['plugins_filemanager_userEnable']); ?> <input type="hidden" name="cmd" value="saveconfig" /> @@ -32,7 +32,7 @@ <?php } -if($cat2 == 'view' OR ($cat2 == 'write' AND $GLOBALS['linpha']->sql->config->value['plugins_filemanager_enable'] )) +if($cat2 == 'view' OR ($cat2 == 'write' AND $GLOBALS['linpha']->sql->config->value['plugins_filemanager_userEnable'] )) { /** Modified: trunk/linpha2/admin/settings_plugins.php =================================================================== --- trunk/linpha2/admin/settings_plugins.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/admin/settings_plugins.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -6,7 +6,7 @@ $cat3 = 'enable'; } -$arrPlugins = explode(',',$LinAdmin->option_value_system['plugins_available']); +$arrPlugins = LinAdmin::getPlugins(); /** * save settings before showing menu @@ -19,30 +19,29 @@ } /** - * create database tables if necessary - * !!! WARNING: SAME CODE ALSO IN install/step9_createtables.php !!! + * create database tables and insert config data if necessary */ - include(LINPHA_DIR.'/lib/include/sql/sql.tables.php'); - foreach($linpha_tables AS $key=>$value) + foreach($arrPlugins as $value) // go through all plugins { - $linpha_tables[$key] = LIN_PREFIX.$value; - } - include(LINPHA_DIR.'/lib/include/sql/sql.'.LIN_DB_TYPE.'.php'); - - // go through all plugins - foreach($arrPlugins as $value) - { - // if now enabled and before it was disabled + // only if we enabled the plugin now and it didn't existed before if( isset($_POST['plugins_'.$value.'_enable']) && $_POST['plugins_'.$value.'_enable']=='1' - && $LinAdmin->option_value_system['plugins_'.$value.'_enable']=='0') + && !isset($LinAdmin->option_value_system['plugins_'.$value.'_enable']) ) { - linSysLog(i18n("Creating tables for plugin: ").' '.$LinAdmin->description_array['plugins_'.$value]); - foreach($sql_tables as $sqlStr) + $str1 = i18n("Enabling plugin \"%s\""); + linSysLog( sprintf($str1,$LinAdmin->description_array['plugins_'.$value]) ); + + /** + * create database tables + */ + $includeFile = LINPHA_DIR.'/lib/plugins/'.$value.'/sql/sql.'.LIN_DB_TYPE.'.php'; + if( file_exists($includeFile) ) { - // if table starts with "CREATE TABLE linpha_plugins_$value" - $sqlStrSearch = "CREATE TABLE ".LIN_PREFIX."plugins_".$value; - if(substr($sqlStr,0,strlen($sqlStrSearch)) == $sqlStrSearch) + $sql_tables = array(); + include($includeFile); + + linSysLog(i18n("Creating tables")); + foreach($sql_tables as $sqlStr) { $result = $linpha->db->Execute($sqlStr); @@ -51,10 +50,35 @@ if(!$result) { linSysLog($linpha->db->ErrorMsg()); } - } + } } + + /** + * insert config data + */ + $includeFile = LINPHA_DIR.'/lib/plugins/'.$value.'/sql/sql.data.php'; + if( file_exists($includeFile) ) // this file always exists (it wouldnt be a plugin otherwise) + { + $sql_queries = array(); + include($includeFile); + + linSysLog(i18n("Insert config data")); + foreach($sql_queries as $sqlStr) + { + $result = $linpha->db->Execute($sqlStr); + + // it the table already exists, we get automatically a nice message like + // "Table 'linpha2_plugins_maps_markers' already exists" + if(!$result) { + linSysLog($linpha->db->ErrorMsg()); + } + } + } + } - } + } + + // set plugins_*_enable to '1' $LinAdmin->saveConfig($arrPluginsFullName); } @@ -66,7 +90,9 @@ ); foreach( $arrPlugins as $key=>$value) { - if($LinAdmin->option_value_system['plugins_'.$value.'_enable'] == '1') + if(isset($LinAdmin->option_value_system['plugins_'.$value.'_enable']) + && $LinAdmin->option_value_system['plugins_'.$value.'_enable'] == '1' + ) { $array_menu[$value] = array( 'name' => $LinAdmin->description_array['plugins_'.$value], @@ -84,11 +110,17 @@ { foreach( $arrPlugins as $key=>$value) { + if(isset($LinAdmin->option_value_system['plugins_'.$value.'_enable'])) { + $optionValue = $LinAdmin->option_value_system['plugins_'.$value.'_enable']; + } else { + $optionValue = '0'; + } + $LinAdmin->printAdminConfig( 'radio', $LinAdmin->getDescriptionByOptionName('plugins_'.$value), 'plugins_'.$value.'_enable', - $LinAdmin->option_value_system['plugins_'.$value.'_enable'] + $optionValue ); } } Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/index.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -43,9 +43,9 @@ case 'browse': require_once(LINPHA_DIR.'/lib/modules/module.browse.php'); break; -case 'filemanager': +/*case 'filemanager': require_once(LINPHA_DIR.'/lib/modules/module.filemanager.php'); - break; + break;*/ case 'settings': require_once(LINPHA_DIR.'/lib/modules/module.settings.php'); break; @@ -72,17 +72,22 @@ break; -// plugins -case 'maps': - /** - * @todo check if plugin enabled - */ - require_once(LINPHA_DIR.'/lib/plugins/maps/module.maps.php'); - break; +default: + // include plugins + $plugindDir = LINPHA_DIR.'/lib/plugins'; + $includeFile = $plugindDir.'/'.$_GET['linCat'].'/module.'.$_GET['linCat'].'.php'; - -default: - require_once(LINPHA_DIR.'/lib/modules/module.empty.php'); + if( is_dir($pluginDir) + && isset($GLOBALS['linpha']->sql->config->value['plugins_'.$_GET['linCat'].'_enable']) + && $GLOBALS['linpha']->sql->config->value['plugins_'.$_GET['linCat'].'_enable']=='1' + && file_exists($includeFile)) + { + require_once($includeFile); + } + else + { + require_once(LINPHA_DIR.'/lib/modules/module.empty.php'); + } break; } Modified: trunk/linpha2/install/step9_createtables.php =================================================================== --- trunk/linpha2/install/step9_createtables.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/install/step9_createtables.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -39,13 +39,15 @@ /** * create tables - * !!! WARNING: SAME CODE ALSO IN admin/settings_plugins.php !!! */ /** * get table names and add prefix */ include_once(LINPHA_DIR.'/lib/include/sql/sql.tables.php'); - foreach($linpha_tables AS $key=>$value) + + // append LIN_PREFIX before each table + // but we also could do this directly in the sql.mysql.php file!? + foreach($linpha_tables as $key=>$value) { $linpha_tables[$key] = LIN_PREFIX.$value; } @@ -63,20 +65,13 @@ $translation_array = array_keys($linpha_tables); // only used in error case while( list($key,$query) = each($sql_tables) ) { - /** - * ignore plugins_ tables - */ - $sqlStrSearch = "CREATE TABLE ".LIN_PREFIX."plugins_"; - if(substr($query,0,strlen($sqlStrSearch)) != $sqlStrSearch) + $result = $linpha->db->Execute($query); + if(!$result) { - $result = $linpha->db->Execute($query); - if(!$result) - { - echo LIN_PREFIX.$translation_array[$key].' '; - echo failed_msg(); - echo ' '.$linpha->db->ErrorMsg().'<br />'; - $error_nr = 1; - } + echo LIN_PREFIX.$translation_array[$key].' '; + echo failed_msg(); + echo ' '.$linpha->db->ErrorMsg().'<br />'; + $error_nr = 1; } } /** Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -97,8 +97,6 @@ 'plugins_log_email_to' => i18n("Recipient"), 'plugins_log_email_headers' => i18n("Extra headers"), 'plugins_log_email_subject' => i18n("Subject"), - - 'plugins_filemanager_enable' => i18n("Enable Filemanager For Non-Admin Users"), ); } @@ -153,8 +151,10 @@ ?> </div> <div align="right"> - <input type="radio" id="<?php echo $id; ?>01" name="<?php echo $id; ?>" value="1"<?php echo $str_enabled; ?> /><label for="<?php echo $id; ?>01"><?php echo i18n("Enable"); ?></label> - <input type="radio" id="<?php echo $id; ?>02" name="<?php echo $id; ?>" value="0"<?php echo $str_disabled; ?>/><label for="<?php echo $id; ?>02"><?php echo i18n("Disable"); ?></label> + <label for="<?php echo $id; ?>01"><input type="radio" id="<?php echo $id; ?>01" name="<?php + echo $id; ?>" value="1"<?php echo $str_enabled; ?> /> <?php echo i18n("Enable"); ?></label> + <label for="<?php echo $id; ?>02"><input type="radio" id="<?php echo $id; ?>02" name="<?php + echo $id; ?>" value="0"<?php echo $str_disabled; ?> /> <?php echo i18n("Disable"); ?></label> <?php break; case 'text': @@ -174,7 +174,7 @@ <div align="right"> <select name="<?php echo $id; ?>" size="1"<?php echo (isset($settings['input_settings']) ? $settings['input_settings'] : '' ); ?> class="linForms"> <?php - foreach($settings['options'] AS $option_key=>$option_value) + foreach($settings['options'] as $option_key=>$option_value) { if($option_key == $value) { @@ -199,7 +199,14 @@ function saveConfig($array,$userid=0) { - foreach($array AS $value) + /** + * update config array once before + * need this for the plugins, the configs are not yet in array, only in the database + */ + $GLOBALS['linpha']->sql->config->reloadConfig(); + + + foreach($array as $value) { /** * does this config name exists? @@ -214,7 +221,7 @@ linSysLog(i18n("Settings saved.")); /** - * update config array + * update config array once after */ $GLOBALS['linpha']->sql->config->reloadConfig(); @@ -311,6 +318,10 @@ /** * a list of all settings which are enable/disable * to show radio buttons instead of text field + * not that bad if not uptodate + * + * @uses /admin/settings_all.php + * @uses /modules/module.settings.php */ function getRadioOptions() { @@ -358,24 +369,20 @@ function getTemplates() { $templatesdir = LINPHA_DIR."/templates"; - - $file_handle = opendir($templatesdir); - $all_themes = array(); - - while( ($file = readdir($file_handle)) !== false ) - { - if($file != "." && $file != ".." && $file != ".svn" && - is_dir($templatesdir.'/'.$file) && - file_exists($templatesdir.'/'.$file.'/global.html.php') && // do at least this check - file_exists($templatesdir.'/'.$file.'/themes') // do at least this check + $d = dir($templatesdir); + while ( ($entry = $d->read()) !== false ) { + if($entry != "." && $entry != ".." && $entry != ".svn" + && is_dir($templatesdir.'/'.$entry) + && file_exists($templatesdir.'/'.$entry.'/global.html.php') // do at least this check + && file_exists($templatesdir.'/'.$entry.'/themes') // do at least this check + ) { - $all_themes[$file] = $file; + $all_themes[$entry] = $entry; } } + $d->close(); - closedir($file_handle); - /* Sort theme files aphabetically */ asort($all_themes); @@ -385,26 +392,40 @@ function getThemes($template) { $templatesdir = LINPHA_DIR."/templates/".$template."/themes"; - - $file_handle = opendir($templatesdir); - $all_themes = array(); - - while( ($file = readdir($file_handle)) !== false ) - { - if($file != "." && $file != ".." && $file != ".svn" && is_dir($templatesdir.'/'.$file)) + $d = dir($templatesdir); + while ( ($entry = $d->read()) !== false ) { + if($entry != "." && $entry != ".." && $entry != ".svn" + && is_dir($templatesdir.'/'.$entry) ) { - $all_themes[$file] = $file; + $all_themes[$entry] = $entry; } } + $d->close(); - closedir($file_handle); - /* Sort theme files aphabetically */ asort($all_themes); return $all_themes; } +function getPlugins() +{ + $plugin_dir = LINPHA_DIR.'/lib/plugins'; + $d = dir($plugin_dir); + while ( ($entry = $d->read()) !== false ) { + if($entry != "." && $entry != ".." && $entry != ".svn" && $entry != "example" + && is_dir($plugin_dir.'/'.$entry) + && file_exists($plugin_dir.'/'.$entry.'/sql/sql.data.php') + ) + { + $arrPlugins[] = $entry; + } + } + $d->close(); + + return $arrPlugins; +} + } // end class LinAdmin ?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.filesys.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.filesys.class.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/lib/classes/linpha.filesys.class.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -140,6 +140,7 @@ /** * create a unique tmp folder + * not really thread safe, but it should be enough for us */ public static function createTmpFolder($prefix) { Modified: trunk/linpha2/lib/include/sql/sql.data.php =================================================================== --- trunk/linpha2/lib/include/sql/sql.data.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/lib/include/sql/sql.data.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -97,36 +97,6 @@ 'sys_style_others_sortorder' => 'nameasc', 'sys_user_autologin' => '1', - - - 'plugins_available' => 'filemanager,guestbook,log,maps,maillist,rss,stats,watermark', - - 'plugins_filemanager_enable' => '0', - 'plugins_filemanager_nruploads' => '5', - - 'plugins_guestbook_enable' => '0', - - 'plugins_log_enable' => '0', - 'plugins_log_filename' => 'var/linpha-'.random_string(6).'.log', - 'plugins_log_syslog_enable' => '0', - 'plugins_log_syslog_add_events' => '', - 'plugins_log_email_enable' => '0', - 'plugins_log_email_add_events' => '', - 'plugins_log_email_to' => 'LinPHA Logger<log@'.$_SERVER["HTTP_HOST"].'>', - 'plugins_log_email_headers' => 'From:LinPHA Logger<noreply@'.$_SERVER["HTTP_HOST"].'>', - 'plugins_log_email_subject' => 'Linpha Log', - - 'plugins_maps_enable' => '0', - 'plugins_maps_defaultMarkerZoom' => '10', - 'plugins_maps_mapType' => 'google', - 'plugins_maps_google_key' => 'ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg', // key for http://localhost - 'plugins_maps_markerThumbSize' => '350', - - 'plugins_maillist_enable' => '0', - 'plugins_rss_enable' => '0', - 'plugins_stats_enable' => '0', - 'plugins_watermark_enable' => '0', - ); $options_user_overrideable = Array( @@ -200,13 +170,7 @@ $sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . "VALUES ('metadata_edit', '')"; $sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('watermark', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('stats', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . "VALUES ('download', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('plugins_maps_setMarkers', '')"; /** Modified: trunk/linpha2/lib/include/sql/sql.mysql.php =================================================================== --- trunk/linpha2/lib/include/sql/sql.mysql.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/lib/include/sql/sql.mysql.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -145,15 +145,5 @@ "meta_data VARCHAR(255) NOT NULL default '', " . "PRIMARY KEY (id) " . ")", - "CREATE TABLE ".$linpha_tables['plugins_maps_markers']." ( ". - "id INT NOT NULL AUTO_INCREMENT, " . - "albId INT NOT NULL default '0', " . - "albPath VARCHAR(255) NOT NULL default '', " . - "markerName VARCHAR(255) NOT NULL default '', " . - "markerLat VARCHAR(255) NOT NULL default '', " . - "markerLon VARCHAR(255) NOT NULL default '', " . - "markerZoom INT NOT NULL default '0', " . - "PRIMARY KEY (id) " . - ")" ); ?> Modified: trunk/linpha2/lib/include/sql/sql.tables.php =================================================================== --- trunk/linpha2/lib/include/sql/sql.tables.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/lib/include/sql/sql.tables.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -36,6 +36,6 @@ "meta_xmp" => "meta_xmp", "meta_comments" => "meta_comments", "meta_data" => "meta_data", - "plugins_maps_markers" => "plugins_maps_markers" + "plugins_maps_setMarkers" => "plugins_maps_markers", // still need the plugin entries; workaround for reset_database.php ); ?> Deleted: trunk/linpha2/lib/modules/module.filemanager.php =================================================================== --- trunk/linpha2/lib/modules/module.filemanager.php 2007-12-01 17:14:09 UTC (rev 4803) +++ trunk/linpha2/lib/modules/module.filemanager.php 2007-12-02 21:46:57 UTC (rev 4804) @@ -1,1216 +0,0 @@ -<?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. - */ - -/** - * Filemanager - * @package Modules - */ - -/** - * Short Permission Description - * If a user has write permission to folder A, it means that - * he can upload images to this folder, rename content, delete content - * But he cannot rename or delete the folder itself - * - * - * it doesnt make sense to give write permissions to the files itself - * - * - * @todo make an option with allowed filetypes to upload: images, images and videos, all - * default setting: images - * its very dangerous if users may upload php files etc.!! or even video files may be - * prepared with malicious code (there are known security holes in some video players!) - */ - -/** - * @todo update md5sum while renaming or moving a folder - * on a folder, the md5sum is based on $md5sum = md5($dirname.'/'.$filename); - */ - -if(!defined('LINPHA_DIR')) { exit(1); } - -/** - * some double used i18n entries - */ - $str_checkpermissions = i18n("Check the permissions in the linpha albums folder. (This means NOT the write permissions page in the admin section)"); - $str_autoimportdisabled = i18n("Autoimport is disabled, you need now to start the manual import to make your changes appear, but you maybe don't have permissions to do that..."); - $str_nopermission = i18n("You don't have permissions to this folder!"); - $str_filealreadyexists = i18n("A File/Folder with the same name already exists!"); - -/** - * init stuff - */ - $parent_id = $linpha->template->idCurrent; - - /** - * check global permission - */ - if(! $linpha->sql->config->value['plugins_filemanager_enable'] - && !$linpha->sql->isAdmin()) - { - echo i18n("No Access!"); - exit(); - } - - if( ! $linpha->sql->photoIsAllowed( $parent_id, 'read' ) ) - { - echo i18n("No Access!"); - exit(); - } - - /** - * use this for child objects - */ - if( $linpha->sql->photoIsAllowed( $parent_id, 'write' ) ) - { - $isWriteAble = true; - } - else - { - $isWriteAble = false; - } - - - $i = 0; - $sum['size'] = 0; - $sum['files'] = 0; - - $use_posix = checkPosix(); - - if($use_posix) { - $uid = @posix_getuid(); // get user id of current process - } else { - $uid = 0; - } - - /** - * upload stuff - */ - include_once(LINPHA_DIR.'/lib/classes/archiver.class.php'); - $apps = new Archive_Applications(); - $apps->searchApps(); - - $appselect = '<option value="-">'. i18n("Extract Archive With"). '</option>'; - foreach($apps->found_apps AS $key=>$value) - { - $value = $key.' (.'.$apps->apps[$key]['file_ext'].')'; - $appselect .= '<option value="'.$key.'">'.$value.'</option>'; - } - -/** - * output buffering, to use in template - */ -ob_start(); - -/** - * parsing POST data - * - * cmd = file_action -> show forms - * cmd = do_file_action -> do actions - */ -if(isset($_REQUEST['cmd'])) -{ - try - { - switch($_REQUEST['cmd']) - { - case 'file_action': - if(!isset($_REQUEST['checkedfiles'])) - { - throw new Exception(i18n("No Files Selected")); - } - if(!isset($_REQUEST['file_action'])) - { - throw new Exception(i18n("No Action Selected")); - } - - ?> - <form method="POST" action="<?php echo LINPHA_LINK.'&linCat=filemanager&linId='.$parent_id; ?>"> - <?php - switch($_REQUEST['file_action']) - { - case 'rename': - $data = $linpha->db->GetRow("SELECT name, parent_id FROM ".LIN_PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($_REQUEST['checkedfiles'][0])."'"); - - echo '<b>'.i18n("Rename File/Folder").':</b><br />'; - ?> - <input type="text" name="new_name" value="<?php echo htmlspecialchars($data['name'],ENT_QUOTES); ?>" class="linForms" style="width: 300px;" /> - <input type="hidden" name="file_id" value="<?php echo $_REQUEST['checkedfiles'][0]; ?>" /> - <?php - break; - - case 'move': - case 'copy': - if( $_REQUEST['file_action'] == 'move') - { - echo i18n("Move These Files/Folders"); - } - elseif( $_REQUEST['file_action'] == 'copy') - { - echo i18n("Copy These Files/Folders"); - } - echo ':<br />'; - - foreach($_REQUEST['checkedfiles'] AS $value) - { - $data = $linpha->db->GetRow("SELECT name FROM ".LIN_PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($value)."'"); - echo htmlspecialchars($data['name'],ENT_QUOTES).', '; - } - echo '<br /><br />'; - echo i18n("To").':'; - echo '<br />'; - ?> - <select name="movecopy_to" class="linForms"> - <option value="0">/</option> - <?php - linBuildAlbumSelect( $with_all_albs_entry=false,$with_linebreaks=true ); - ?> - </selet> - <input type="hidden" name="checkedfiles" value="<?php echo implode(';',$_REQUEST['checkedfiles']); ?>" /> - <?php - break; - case 'delete': - echo i18n("Delete all the following files/folders including contents:").'<br />'; - foreach($_REQUEST['checkedfiles'] AS $value) - { - $data = $linpha->db->GetRow("SELECT name FROM ".LIN_PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($value)."'"); - echo htmlspecialchars($data['name'],ENT_QUOTES).', '; - } - echo '<br /><br />'; - echo i18n("Really Sure?"); - ?> - <input type="hidden" name="checkedfiles" value="<?php echo implode(';',$_REQUEST['checkedfiles']); ?>" /> - <?php - break; - case 'changeperm': - $full_filename = LinSql::getFullImagePath( $_REQUEST['checkedfiles'][0]); - - if( $full_filename == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_filename); - } - - $perm = getReadableFileperms($full_filename); - - (substr($perm, 1, 1)!="-" ? $ur = 1 : ''); - (substr($perm, 2, 1)!="-" ? $uw = 1 : ''); - (substr($perm, 3, 1)!="-" ? $ux = 1 : ''); - (substr($perm, 4, 1)!="-" ? $gr = 1 : ''); - (substr($perm, 5, 1)!="-" ? $gw = 1 : ''); - (substr($perm, 6, 1)!="-" ? $gx = 1 : ''); - (substr($perm, 7, 1)!="-" ? $or = 1 : ''); - (substr($perm, 8, 1)!="-" ? $ow = 1 : ''); - (substr($perm, 9, 1)!="-" ? $ox = 1 : ''); - - echo i18n("Change Permission Of:").' '.htmlspecialchars($full_filename,ENT_QUOTES); - ?> - <br /> - <table border="1" cellpadding="0" cellspacing="0"> - <tr> - <td width="100"> </td> - <td class='admintable' width="75"><?php echo i18n("Read"); ?></td> - <td class='admintable' width="75"><?php echo i18n("Write"); ?></td> - <td class='admintable' width="75"><?php echo i18n("Execute"); ?></td> - </tr> - <tr> - <td class='admintable'><?php echo i18n("Owner"); ?></td> - <td><input name="ur" type="checkbox" value="4"<?=(isset($ur) ? ' checked' : '')?>></td> - <td><input name="uw" type="checkbox" value="2"<?=(isset($uw) ? ' checked' : '')?>></td> - <td><input name="ux" type="checkbox" value="1"<?=(isset($ux) ? ' checked' : '')?>></td> - </tr> - <tr> - <td class='admintable'><?php echo i18n("Group"); ?></td> - <td><input name="gr" type="checkbox" value="4"<?=(isset($gr) ? ' checked' : '')?>></td> - <td><input name="gw" type="checkbox" value="2"<?=(isset($gw) ? ' checked' : '')?>></td> - <td><input name="gx" type="checkbox" value="1"<?=(isset($gx) ? ' checked' : '')?>></td> - </tr> - <tr> - <td class='admintable'><?php echo i18n("All Others"); ?></td> - <td><input name="or" type="checkbox" value="4"<?=(isset($or) ? ' checked' : '')?>></td> - <td><input name="ow" type="checkbox" value="2"<?=(isset($ow) ? ' checked' : '')?>></td> - <td><input name="ox" type="checkbox" value="1"<?=(isset($ox) ? ' checked' : '')?>></td> - </tr> - </table> - <input type="hidden" name="file_id" value="<?php echo $_REQUEST['checkedfiles'][0]; ?>" /> - <?php - break; - } - ?> - <input type="hidden" name="cmd" value="do_file_action" /> - <input type="hidden" name="file_action" value="<?php echo $_REQUEST['file_action']; ?>" /> - <input type="submit" name="submit" value="<?php echo i18n("Submit"); ?>" class="linButton" /> - </form> - <hr /><br /> - <?php - break; - - case 'do_file_action': - - switch($_POST['file_action']) - { - case 'rename': - $new_name = removeUnWantedChars( $_POST['new_name'] ); - - $full_filename = LinSql::getFullImagePath( $_POST['file_id'] ); - - if( $full_filename == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_filename); - } - - $parent_dirname = dirname($full_filename); - - /** - * check write permission of parent folder - */ - $data = $linpha->db->GetRow("SELECT parent_id FROM ".LIN_PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($_POST['file_id'])."'"); - if( ! $linpha->sql->photoIsAllowed( $data['parent_id'], 'write') ) - { - throw new Exception($str_nopermission); - } - - if( nameAlreadyExists( $new_name, $data['parent_id'] )) - { - throw new Exception($str_filealreadyexists); - } - - if( ! @rename( $full_filename , $parent_dirname."/".$new_name ) ) - { - throw new Exception(i18n("Rename File/Folder Failed!"). - htmlspecialchars($full_filename,ENT_QUOTES).' '.i18n("to").' '.htmlspecialchars($parent_dirname.'/'.$new_name,ENT_QUOTES). - LIN_NL.$str_checkpermissions - ); - } - - /** - * rename on filesys was successful - * -> rename also in db - */ - $linpha->db->Execute("UPDATE ".LIN_PREFIX."photos SET name = '".LinSql::linAddslashes($new_name)."' " . - "WHERE id = '".LinSql::linAddslashes($_POST['file_id'])."'"); - - linSysLog(i18n("Successfully Renamed!")); - linLog(LOG_TYPE_FILEMANAGER,LOG_NOTICE,'fm_rename',"renamed file (".$full_filename." to ".$parent_dirname."/".$new_name.")"); - break; - - case 'move': - case 'copy': - /** - * check write permission of target folder - * AND it will also check if it is a valid id (?) - */ - if( ! $linpha->sql->photoIsAllowed( $_POST['movecopy_to'], 'write') ) - { - throw new Exception($str_nopermission); - } - - /** - * get target name - */ - $full_destparentname = LinSql::getFullImagePath( $_POST['movecopy_to'] ); - - if( $full_destparentname == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_destparentname); - } - - /** - * check write permission of destination parent folder - */ - if( ! is_writable($full_destparentname) ) - { - throw new Exception( - sprintf( - i18n("Cannot Copy/Move to Folder \"%s\" because its not writable!"), - htmlspecialchars($full_destparentname,ENT_QUOTES) - ). - LIN_NL.$str_checkpermissions - ); - } - - - /** - * go through each folder - */ - $checkedfiles = explode(';',$_POST['checkedfiles']); - foreach($checkedfiles AS $value) - { - /** - * get full source name - */ - $full_sourcename = LinSql::getFullImagePath( $value ); - - if( $full_sourcename == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_filename); - } - - /** - * check read permission of source folder (not parent! ...) and content - */ - if( ! $linpha->sql->photoIsAllowed( $value, 'read') ) - { - throw new Exception($str_nopermission); - } - - /** - * check if destination is empty - */ - if( nameAlreadyExists( basename($full_sourcename), $_POST['movecopy_to'] )) - { - throw new Exception($str_filealreadyexists); - } - - /** - * move - */ - if( $_POST['file_action'] == 'move') - { - /** - * check write permission of parent source folder - */ - $data = $linpha->db->GetRow("SELECT parent_id FROM ".LIN_PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($value)."'"); - if($_POST['file_action'] == 'move') - { - if( ! $linpha->sql->photoIsAllowed( $data['parent_id'], 'write') ) - { - throw new Exception($str_nopermission); - } - } - - if( ! rename($full_sourcename, $full_destparentname.'/'.basename($full_sourcename) ) ) - { - linSysLog( - sprintf( - i18n("Error While Moving Files/Folders \"%s\" to \"%s\"!"), - htmlspecialchars($full_sourcename,ENT_QUOTES), - htmlspecialchars($full_destparentname.'/'.basename($full_sourcename),ENT_QUOTES) - ) - ); - linSysLog($str_checkpermissions); - - linLog(LOG_TYPE_FILEMANAGER,LOG_ERR,'fm_move',"cannot moved file/folder (".$full_sourcename." to ".$full_destparentname.'/'.basename($full_sourcename).")"); - } - else - { - $linpha->db->Execute("UPDATE ".LIN_PREFIX."photos " . - "SET parent_id = '".LinSql::linAddslashes($_POST['movecopy_to'])."' " . - "WHERE id = '".LinSql::linAddslashes($value)."'"); - - linSysLog( - sprintf( - i18n("Successfully Moved \"%s\" to \"%s\"!"), - htmlspecialchars($full_sourcename,ENT_QUOTES), - htmlspecialchars($full_destparentname.'/'.basename($full_sourcename),ENT_QUOTES) - ) - ); - - linLog(LOG_TYPE_FILEMANAGER,LOG_NOTICE,'fm_move',"moved file/folder (".$full_sourcename." to ".$full_destparentname.'/'.basename($full_sourcename).")"); - } - } - /** - * copy - */ - elseif( $_POST['file_action'] == 'copy') - { - /** - * copy files/folders (only which we have read permission) - */ - copy_r( $value, $full_sourcename, $full_destparentname); - - if( ! file_exists( $full_destparentname.'/'.basename($full_sourcename) )) - { - linSysLog( - sprintf( - i18n("Error While Copying Files/Folders \"%s\" to \"%s\"!"), - htmlspecialchars($full_sourcename,ENT_QUOTES), - htmlspecialchars($full_destparentname.'/'.basename($full_sourcename),ENT_QUOTES) - ) - ); - linSysLog($str_checkpermissions); - - linLog(LOG_TYPE_FILEMANAGER,LOG_ERR,'fm_copy',"Cannot copy file/folder (".$full_sourcename." to ".$full_destparentname.'/'.basename($full_sourcename).")"); - } - else - { - linSysLog( - sprintf( - i18n("Successfully Copied \"%s\" to \"%s\"!"), - $full_sourcename, - $full_destparentname.'/'.basename($full_sourcename) - ) - ); - - linLog(LOG_TYPE_FILEMANAGER,LOG_NOTICE,'fm_copy',"Copied file/folder (".$full_sourcename." to ".$full_destparentname.'/'.basename($full_sourcename).")"); - } - } - } - - break; - - case 'delete': - $checkedfiles = explode(';',$_POST['checkedfiles']); - foreach($checkedfiles AS $value) - { - if( $value == 0 ) - { - throw new Exception(i18n("For security reasons, its not possible to delete the whole albums folder!")); - } - - $data = $linpha->db->GetRow("SELECT parent_id FROM ".LIN_PREFIX."photos " . - "WHERE id = '".LinSql::linAddslashes($value)."'"); - - if( !isset($data['parent_id']) ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' file id: '.$value); - } - - /** - * check write permission of parent folder - */ - if( ! $linpha->sql->photoIsAllowed( $data['parent_id'], 'write') ) - { - throw new Exception($str_nopermission); - } - - $full_filename = LinSql::getFullImagePath( $value ); - - if( $full_filename == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_filename); - } - - LinFilesys::rm_rf($full_filename); - - if(file_exists($full_filename)) - { - throw new Exception(i18n("Deleting Files/Folders Failed").": \"".htmlspecialchars($full_filename,ENT_QUOTES)."\"".LIN_NL.$str_checkpermissions); - } - - linSysLog(i18n("File/Folder deleted successfully!")); - LinImport::deleteEntry( $value, $full_filename); - - linLog(LOG_TYPE_FILEMANAGER,LOG_NOTICE,'fm_delete',"Deleted file/folder (".$full_filename.")"); - } - break; - - case 'create_folder': - /** - * check write permission of parent folder - */ - if( ! $linpha->sql->photoIsAllowed( $linpha->template->idCurrent, 'write') ) - { - throw new Exception($str_nopermission); - } - - $new_name = removeUnWantedChars( $_POST['folder_name'] ); - - if( nameAlreadyExists( $new_name, $linpha->template->idCurrent )) - { - throw new Exception($str_filealreadyexists); - } - - $full_filename = LinSql::getFullImagePath( $linpha->template->idCurrent ); - - if( $full_filename == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_filename); - } - - if( empty( $new_name ) ) //catch empty folder create submit - { - throw new Exception(i18n("Create Folder Failed, No Folder Name given")); - } - elseif(! @mkdir( $full_filename .'/'. $new_name ) ) - { - throw new Exception(i18n("Create Folder Failed").": \"".htmlspecialchars($new_name,ENT_QUOTES)."\"".LIN_NL.$str_checkpermissions); - } - - linLog(LOG_TYPE_FILEMANAGER,LOG_NOTICE,'fm_create_folder',"Created folder (".$full_filename.'/'.$new_name.")"); - linSysLog(i18n("Folder Created Successfully!")); - - if( ! $linpha->sql->config->value['sys_import_autoimport'] ) - { - linSysLog($str_autoimportdisabled); - } - - break; - case 'changeperm': - $full_filename = LinSql::getFullImagePath( $_POST['file_id'] ); - - if( $full_filename == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_filename); - } - - isset($_POST['ur']) ? $ur = $_POST['ur'] : $ur = 0; - isset($_POST['uw']) ? $uw = $_POST['uw'] : $uw = 0; - isset($_POST['ux']) ? $ux = $_POST['ux'] : $ux = 0; - isset($_POST['gr']) ? $gr = $_POST['gr'] : $gr = 0; - isset($_POST['gw']) ? $gw = $_POST['gw'] : $gw = 0; - isset($_POST['gx']) ? $gx = $_POST['gx'] : $gx = 0; - isset($_POST['or']) ? $or = $_POST['or'] : $or = 0; - isset($_POST['ow']) ? $ow = $_POST['ow'] : $ow = 0; - isset($_POST['ox']) ? $ox = $_POST['ox'] : $ox = 0; - - $u = $ur+$uw+$ux; - $g = $gr+$gw+$gx; - $o = $or+$ow+$ox; - - $mode = $u.$g.$o; - - if(! @chmod($full_filename,intval($mode,8))) - { - throw new Exception(i18n("Change Permissions Failed").": \"".htmlspecialchars($full_filename,ENT_QUOTES)."\" to ".$mode.LIN_NL.$str_checkpermissions); - } - - linSysLog(i18n("Permissions Changed Successfully!")); - linLog(LOG_TYPE_FILEMANAGER,LOG_NOTICE,'fm_perm',"changed permission of ".$full_filename." to ".$mode); - - break; - case 'upload': - $targetdir = LinSql::getFullImagePath( $linpha->template->idCurrent ); - - $full_filename = LinSql::getFullImagePath( $linpha->template->idCurrent ); - if( $full_filename == false ) - { - throw new Exception(i18n("This file doesn't exists anymore!").' '.$full_filename); - } - - for($i = 0; $i < $linpha->sql->config->value['plugins_filemanager_nruploads']; $i++ ) - { - if( isset( $_FILES[ 'file' . $i ] ) && $_FILES[ 'file' . $i]['name'] ) // break loop as sson as 'name' is not set, to prevent a couple of warnings - { - $thisfile = $_FILES[ 'file' . $i ]; - - /** - * check errors - */ - if (isset($thisfile['error']) && $thisfile['error'] != 0 ) // ['error'] was added in PHP 4.2.0 - { - switch ( $thisfile['error'] ) - { - case 1: - throw new Exception( sprintf(i18n("Error: The uploaded file %s exceeds the upload_max_filesize directive in php.ini - %s"), - htmlspecialchars($thisfile['name'],ENT_QUOTES), ini_get('upload_max_filesize') ) ); - break; - case 2: - throw new Exception( sprintf(i18n("Error: Size of uploaded file %s exceeds the HTML FORM settings"), htmlspecialchars($thisfile['name'],ENT_QUOTES) ) ); - break; - case 3: - throw new Exception( sprintf(i18n("The uploaded file %s was only partially uploaded"), htmlspecialchars($thisfile['name'],ENT_QUOTES) ) ); - break; - } - } - - if ( $_POST[ 'app' . $i ] == '-' ) - { - list($org_width, $org_height, $org_type) = LinIdentify::linGetImageSize( $thisfile['tmp_name'] ); - if( !LinIdentify::isSupportedImage( $org_type ) && !LinIdentify::isVideo( $org_type ) ) - { - throw new Exception( i18n("This File Is Wether An Image Nor A Video").' ('.htmlspecialchars($thisfile['name'],ENT_QUOTES).')' ); - } - - if ( !move_uploaded_file( $thisfile['tmp_name'], "".$targetdir.'/'.$thisfile['name']."" ) ) - { - throw new Exception( sprintf(i18n("Unable To Move File (%s) To Directory (%s)"),htmlspecialchars($thisfile['name'],ENT_QUOTES),htmlspecialchars($targetdir,ENT_QUOTES ) ) ); - } - - $somethingUploaded = true; - } - /** - * extract archives - */ - else // $_POST[ 'app' . $i ] != '-' - { - $tmpfolder = LinFilesys::createTmpFolder('filemanager'); - - if ( !move_uploaded_file( $thisfile['tmp_name'], $tmpfolder . '/' . $thisfile['name'] ) ) - { - throw new Exception(sprintf( i18n("Unable To Move File (%s) To Directory (%s)"), htmlspecialchars($thisfile[ 'name' ],ENT_QUOTES), htmlspecialchars($targetdir,ENT_QUOTES) ) ); - } - - - $command = $apps->apps[$_POST['app'.$i]]['command_extract']; - $apps->searchApp($_POST['app'.$i]); - - $executable = $apps->found_apps[$_POST['app'.$i]].$apps->apps[$_POST['app'.$i]]['executable_extract']; - - $command = str_replace('{executable}',$executable,$command); - $command = str_replace('{archive_name}',linEscapeString($thisfile['name']),$command); - - $oldpwd = getcwd(); - if ( !chdir( $tmpfolder ) ) - { - throw new Exception( sprintf( i18n("Unable to switch (chdir) to %s directory. File being processed: %s"), $tmpfolder, $thisfile[ 'name' ] ) ); - } - - $output=array(); $return_value=''; // do not this directly in exec() ! - exec( $command, $output, $return_value ); - chdir( $oldpwd ); - - - echo '<textarea cols="80" rows="4"">' . - htmlspecialchars( $command . "\n". implode( "\n", $output ), ENT_QUOTES ) . - '</textarea><br />'; - - unset($output); - - /** - * move valid images and videos to target dir - * this will delete the archive file automatically... - * and also delete the tmpfolder - */ - moveValidEntries( $tmpfolder, $targetdir ); - - $somethingUploaded = true; - } - - linSysLog(i18n("File uploaded").": ".$thisfile['tmp_name']." ".$targetdir.'/'.$thisfile['name']); - linLog(LOG_TYPE_FILEMANAGER,LOG_NOTICE,'fm_upload',"Uploaded file (".$thisfile['tmp_name']." ".$targetdir.'/'.$thisfile['name'].")"); - } - } - - if(isset($somethingUploaded)) - { - if( ! $linpha->sql->config->value['sys_import_autoimport'] ) - { - linSysLog($str_autoimportdisabled); - } - } - break; - } // end switch($_POST['file_action']) - break; // end case 'do_file_action': - - } // end switch($_REQUEST['cmd']) - } // end try() - catch(Exception $error) - { - linSysLog("Error: ".str_replace(LIN_NL,"<br />",$error -> getMessage())); - linLog(LOG_TYPE_FILEMANAGER,LOG_ERR,'fm_'.$_REQUEST['file_action'],$error->getMessage()); - } - - /** - * print Syslog - */ - /*if( isset($linpha->template->output['sys_log']) ) - { - echo $linpha->template->output['sys_log']; - echo '<hr />'; - unset($linpha->template->output['sys_log']); - }*/ -} - -/** - * do import - */ - if( $linpha->sql->config->value['sys_import_autoimport'] ) - { - /** - * empty syslog - */ - //unset($linpha->template->output['sys_log']); - - LinImport::updateDir( $parent_id, $recursive = false, $dryrun = false ); - - /** - * print Syslog - */ - /*if( isset($linpha->template->output['sys_log']) ) - { - echo i18n("LinPHA Import:").'<br />'; - echo $linpha->template->output['sys_log']; - echo '<hr />'; - unset($linpha->template->output['sys_log']); - }*/ - } - -echo i18n("Current Folder:").' '.linSetNavigationLine( $parent_id, LINPHA_LINK.'&linCat=filemanager&linId=').'<br />'; -?> - -<form method="POST" action="<?php echo LINPHA_LINK.'&linCat=filemanager&linId='.$parent_id; ?>"> -<div id="linDivFilemanager"> -<table> - <tr> - <td width="20"> </td> - <td width="500"> - <?php - if($parent_id == 0) - { - echo ' '; - } - else - { - $data = $linpha->db->GetRow("SELECT name, parent_id FROM ".LIN_PREFIX."photos WHERE id = '".LinSql::linAddslashes($parent_id)."'"); - ?> - <a href="<?php echo LINPHA_LINK.'&linCat=filemanager&linId='.$data['parent_id']; ?>">..</a> - <?php - } - ?> - </td> - <td width="100"> </td> - <td width="150"> </td> - <td width="100"> </td> - </tr> - -<?php - -$query = $linpha->db->Execute("SELECT id, name, img_type FROM ".LIN_PREFIX."photos WHERE parent_id = '".LinSql::linAddslashes($parent_id)."' ORDER by name"); -while($data = $query->FetchRow()) -{ - $full_filename = LinSql::getFullImagePath( $data['id'] ); - - /** - * show only if file exists and we have READ permissions - */ - if( file_exists( $full_filename ) && $linpha->sql->photoIsAllowed( $data['id'], 'read' ) ) - { - /** - * set file informations - */ - $filestat = stat($full_filename); - - /** - * size and nr files - */ - if( $data['img_type'] != 0 && $data['img_type'] != 9999999 ) - { - $sum['size'] += $filestat['size']; - $sum['files']++; - } - - /** - * owner and group name - */ - if($use_posix) { - $owner_info = @posix_getpwuid($filestat['uid']); // use @ because check_posix() can return true even if it fails... - $group_info = @posix_getgrgid($filestat['gid']); - } else { - $owner_info['name'] = ''; - $group_info['name'] = ''; - } - - /** - * file permissions - */ - if( LIN_OS == 'win' ) - { - $file_permissions = - '[' . - (is_readable($full_filename) ? '<font color="green">r</font>' : ' ') . - (is_writable($full_filename) ? '<font color="red">w</font>' : ' ') . - (function_exists('is_executable') ? - (is_executable($full_filename) ? '<font color="blue">x</font>' : ' ') - : - ' ' - ) . - ']'; - } else { - $perm = '['.getReadableFileperms($full_filename).']'; - - $perm = str_replace('r','<font color="green">r</font>',$perm); - $perm = str_replace('w','<font color="red">w</font>',$perm); - $perm = str_replace('x','<font color="blue">x</font>',$perm); - - if($uid == $filestat['uid']) - { - $file_permissions = '<a href="'.LINPHA_LINK.'&linCat=filemanager&cmd=file_action&file_action=changeperm&checkedfiles[]='.$data['id'].'">'. $perm . '</a>'; - } - else - { - $file_permissions = $perm; - } - } - - ?> - <tr> - <td> - <?php - if($isWriteAble) - { - if( isset($_REQUEST['checkedfiles']) - && is_array($_REQUEST['checkedfiles']) - && in_array($data['id'], $_REQUEST['checkedfiles']) ) - { - $str_checked = ' checked="checked"'; - } - else - { - $str_checked = ''; - } - ?> - <input type="checkbox" name="checkedfiles[]" value="<?php echo $data['id']; ?>"<?php echo $str_checked; ?> /> - <?php } else { ?> - - <?php } ?> - </td> - <td> - <?php - if($data['img_type']==0) - { - echo '<a href="'.LINPHA_LINK.'&linCat=filemanager&linId='.$data['id'].'">'.htmlspecialchars($data['name'],ENT_QUOTES).'</a>'; - } - else - { - echo htmlspecialchars($data['name'],ENT_QUOTES); - } - ?> - </td> - <td align="right"><?php echo $data['img_type']==0 ? ' ' : LinFilesys::niceFilesize($filestat['size'],1); ?></td> - <td align="center"><?php echo strftime(... [truncated message content] |
From: <fan...@us...> - 2007-12-01 17:14:19
|
Revision: 4803 http://linpha.svn.sourceforge.net/linpha/?rev=4803&view=rev Author: fangehrn Date: 2007-12-01 09:14:09 -0800 (Sat, 01 Dec 2007) Log Message: ----------- 2007-12-01 flo * creating plugin interface - create plugin tables only when plugin is enabled pay attention with oracles sequences and triggers any idea how to create them dynamically? Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/maintenance_db.php trunk/linpha2/admin/settings_plugins.php trunk/linpha2/install/manual_install.php trunk/linpha2/install/step8_testing.php trunk/linpha2/install/step9_createtables.php trunk/linpha2/reset_database.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-12-01 15:58:31 UTC (rev 4802) +++ trunk/linpha2/ChangeLog 2007-12-01 17:14:09 UTC (rev 4803) @@ -4,6 +4,11 @@ - moved whole install/sql folder to lib/include/sql we need still that files if we want to dynamically create the plugin tables + and changed hopefully all paths + + - create plugin tables only when plugin is enabled + pay attention with oracles sequences and triggers + any idea how to create them dynamically? 2007-11-20 flo * finished basic part of the map plugin Modified: trunk/linpha2/admin/maintenance_db.php =================================================================== --- trunk/linpha2/admin/maintenance_db.php 2007-12-01 15:58:31 UTC (rev 4802) +++ trunk/linpha2/admin/maintenance_db.php 2007-12-01 17:14:09 UTC (rev 4803) @@ -308,7 +308,7 @@ $_SESSION['cache_dir'] = ''; $_SESSION['tmp_dir'] = ''; - include(LINPHA_DIR.'/lib/include/sql.data.php'); + include(LINPHA_DIR.'/lib/include/sql/sql.data.php'); foreach($options AS $key=>$value) { $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".LIN_PREFIX."config " . Modified: trunk/linpha2/admin/settings_plugins.php =================================================================== --- trunk/linpha2/admin/settings_plugins.php 2007-12-01 15:58:31 UTC (rev 4802) +++ trunk/linpha2/admin/settings_plugins.php 2007-12-01 17:14:09 UTC (rev 4803) @@ -15,21 +15,47 @@ { foreach($arrPlugins as $value) { - $arrPlugins2[] = 'plugins_'.$value.'_enable'; + $arrPluginsFullName[] = 'plugins_'.$value.'_enable'; } - $LinAdmin->saveConfig($arrPlugins2); - /** * create database tables if necessary + * !!! WARNING: SAME CODE ALSO IN install/step9_createtables.php !!! */ - foreach($arrPlugins2 as $value) + include(LINPHA_DIR.'/lib/include/sql/sql.tables.php'); + foreach($linpha_tables AS $key=>$value) { - if( isset($_POST[$value]) && $_POST[$value]=='1' ) + $linpha_tables[$key] = LIN_PREFIX.$value; + } + include(LINPHA_DIR.'/lib/include/sql/sql.'.LIN_DB_TYPE.'.php'); + + // go through all plugins + foreach($arrPlugins as $value) + { + // if now enabled and before it was disabled + if( isset($_POST['plugins_'.$value.'_enable']) + && $_POST['plugins_'.$value.'_enable']=='1' + && $LinAdmin->option_value_system['plugins_'.$value.'_enable']=='0') { - + linSysLog(i18n("Creating tables for plugin: ").' '.$LinAdmin->description_array['plugins_'.$value]); + foreach($sql_tables as $sqlStr) + { + // if table starts with "CREATE TABLE linpha_plugins_$value" + $sqlStrSearch = "CREATE TABLE ".LIN_PREFIX."plugins_".$value; + if(substr($sqlStr,0,strlen($sqlStrSearch)) == $sqlStrSearch) + { + $result = $linpha->db->Execute($sqlStr); + + // it the table already exists, we get automatically a nice message like + // "Table 'linpha2_plugins_maps_markers' already exists" + if(!$result) { + linSysLog($linpha->db->ErrorMsg()); + } + } + } } } + $LinAdmin->saveConfig($arrPluginsFullName); } /** @@ -74,4 +100,5 @@ include_once($includeFile); } } + ?> \ No newline at end of file Modified: trunk/linpha2/install/manual_install.php =================================================================== --- trunk/linpha2/install/manual_install.php 2007-12-01 15:58:31 UTC (rev 4802) +++ trunk/linpha2/install/manual_install.php 2007-12-01 17:14:09 UTC (rev 4803) @@ -84,7 +84,7 @@ /** * get table names and add prefix */ - include_once(LINPHA_DIR.'/install/sql/sql.tables.php'); + include_once(LINPHA_DIR.'/lib/include/sql/sql.tables.php'); foreach($linpha_tables AS $key=>$value) { $linpha_tables[$key] = LIN_PREFIX.$value; @@ -93,7 +93,7 @@ /** * include sql strings */ - include_once(LINPHA_DIR."/install/sql/sql.".LIN_DB_TYPE.".php"); + include_once(LINPHA_DIR."/lib/include/sql/sql.".LIN_DB_TYPE.".php"); /** * finally create tables @@ -108,7 +108,7 @@ * insert data */ $str_query .= "\n\n"; - include_once(LINPHA_DIR.'/lib/include/sql.data.php'); + include_once(LINPHA_DIR.'/lib/include/sql/sql.data.php'); foreach($sql_queries AS $value) { $str_query .= $value.";\n"; @@ -128,7 +128,7 @@ $donotchange = ' // change only with installer !!'; $comment[1] = $donotchange; -include_once(LINPHA_DIR.'/install/sql/config.dir.php'); +include_once(LINPHA_DIR.'/lib/include/sql/config.dir.php'); ?> <br /><br /> <?php echo i18n_install("Folders To Create:")."<br />"; ?> @@ -166,7 +166,7 @@ $comment[6] = $donotchange; $comment[7] = $changeme; -include_once(LINPHA_DIR.'/install/sql/config.sql.php'); +include_once(LINPHA_DIR.'/lib/include/sql/config.sql.php'); ?> <br /><br /> <?php echo i18n_install("Database Connection File")." <b>".$_SESSION['sql_dir']."/config.sql.php</b><br />"; ?> Modified: trunk/linpha2/install/step8_testing.php =================================================================== --- trunk/linpha2/install/step8_testing.php 2007-12-01 15:58:31 UTC (rev 4802) +++ trunk/linpha2/install/step8_testing.php 2007-12-01 17:14:09 UTC (rev 4803) @@ -94,12 +94,12 @@ } else { - include_once(LINPHA_DIR.'/install/sql/sql.tables.php'); + include_once(LINPHA_DIR.'/lib/include/sql/sql.tables.php'); /** * add prefix */ - foreach($linpha_tables AS $key=>$value) + foreach($linpha_tables as $key=>$value) { $linpha_tables[$key] = $_SESSION['sql_prefix'].$value; } Modified: trunk/linpha2/install/step9_createtables.php =================================================================== --- trunk/linpha2/install/step9_createtables.php 2007-12-01 15:58:31 UTC (rev 4802) +++ trunk/linpha2/install/step9_createtables.php 2007-12-01 17:14:09 UTC (rev 4803) @@ -39,11 +39,12 @@ /** * create tables + * !!! WARNING: SAME CODE ALSO IN admin/settings_plugins.php !!! */ /** * get table names and add prefix */ - include_once(LINPHA_DIR.'/install/sql/sql.tables.php'); + include_once(LINPHA_DIR.'/lib/include/sql/sql.tables.php'); foreach($linpha_tables AS $key=>$value) { $linpha_tables[$key] = LIN_PREFIX.$value; @@ -52,7 +53,7 @@ /** * include sql strings */ - include_once(LINPHA_DIR."/install/sql/sql.".LIN_DB_TYPE.".php"); + include_once(LINPHA_DIR.'/lib/include/sql/sql.'.LIN_DB_TYPE.'.php'); /** * finally create tables @@ -62,13 +63,20 @@ $translation_array = array_keys($linpha_tables); // only used in error case while( list($key,$query) = each($sql_tables) ) { - $result = $linpha->db->Execute($query); - if(!$result) + /** + * ignore plugins_ tables + */ + $sqlStrSearch = "CREATE TABLE ".LIN_PREFIX."plugins_"; + if(substr($query,0,strlen($sqlStrSearch)) != $sqlStrSearch) { - echo LIN_PREFIX.$translation_array[$key].' '; - echo failed_msg(); - echo ' '.$linpha->db->ErrorMsg().'<br />'; - $error_nr = 1; + $result = $linpha->db->Execute($query); + if(!$result) + { + echo LIN_PREFIX.$translation_array[$key].' '; + echo failed_msg(); + echo ' '.$linpha->db->ErrorMsg().'<br />'; + $error_nr = 1; + } } } /** @@ -125,7 +133,7 @@ * insert data */ echo "<br />".i18n_install("Inserting Table Data...").' '; - include_once(LINPHA_DIR.'/lib/include/sql.data.php'); + include_once(LINPHA_DIR.'/lib/include/sql/sql.data.php'); foreach($sql_queries AS $value) { $result = $linpha->db->Execute($value); @@ -171,7 +179,7 @@ if($fp) { $comment[1] = ''; - include_once(LINPHA_DIR.'/install/sql/config.dir.php'); + include_once(LINPHA_DIR.'/lib/include/sql/config.dir.php'); fwrite( $fp, $str ); fclose($fp); @@ -209,7 +217,7 @@ $comment[6] = ''; $comment[7] = ''; - include_once(LINPHA_DIR.'/install/sql/config.sql.php'); + include_once(LINPHA_DIR.'/lib/include/sql/config.sql.php'); fwrite( $fp, $str ); fclose($fp); Modified: trunk/linpha2/reset_database.php =================================================================== --- trunk/linpha2/reset_database.php 2007-12-01 15:58:31 UTC (rev 4802) +++ trunk/linpha2/reset_database.php 2007-12-01 17:14:09 UTC (rev 4803) @@ -21,7 +21,7 @@ /** * get table names and add prefix */ - include_once(LINPHA_DIR.'/install/sql/sql.tables.php'); + include_once(LINPHA_DIR.'/lib/include/sql/sql.tables.php'); foreach($linpha_tables AS $key=>$value) { $linpha_tables[$key] = LIN_PREFIX.$value; @@ -51,7 +51,7 @@ /** * include sql strings */ - include_once(LINPHA_DIR."/install/sql/sql.".LIN_DB_TYPE.".php"); + include_once(LINPHA_DIR."/lib/include/sql/sql.".LIN_DB_TYPE.".php"); /** * finally create tables @@ -61,13 +61,20 @@ $translation_array = array_keys($linpha_tables); // only used in error case while( list($key,$query) = each($sql_tables) ) { - $result = $linpha->db->Execute($query); - if(!$result) + /** + * ignore plugins_ tables + */ + $sqlStrSearch = "CREATE TABLE ".LIN_PREFIX."plugins_"; + if(substr($query,0,strlen($sqlStrSearch)) != $sqlStrSearch) { - echo LIN_PREFIX.$translation_array[$key].' '; - echo failed_msg(); - echo ' '.$linpha->db->ErrorMsg().'<br />'; - $error_nr = 1; + $result = $linpha->db->Execute($query); + if(!$result) + { + echo LIN_PREFIX.$translation_array[$key].' '; + echo failed_msg(); + echo ' '.$linpha->db->ErrorMsg().'<br />'; + $error_nr = 1; + } } } if(!isset($error_nr)) @@ -81,7 +88,7 @@ * insert data */ echo "<br /><br />".tr("Inserting Table Data")."... "; - include_once(LINPHA_DIR.'/lib/include/sql.data.php'); + include_once(LINPHA_DIR.'/lib/include/sql/sql.data.php'); foreach($sql_queries AS $value) { $result = $linpha->db->Execute($value); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2007-12-01 15:58:53
|
Revision: 4802 http://linpha.svn.sourceforge.net/linpha/?rev=4802&view=rev Author: fangehrn Date: 2007-12-01 07:58:31 -0800 (Sat, 01 Dec 2007) Log Message: ----------- 2007-12-01 flo * creating plugin interface - moved whole install/sql folder to lib/include/sql we need still that files if we want to dynamically create the plugin tables Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/maintenance_db.php trunk/linpha2/admin/settings.php trunk/linpha2/lib/classes/linpha.admin.class.php Added Paths: ----------- trunk/linpha2/admin/settings_plugins.php trunk/linpha2/lib/include/sql/ trunk/linpha2/lib/include/sql/sql.data.php trunk/linpha2/lib/plugins/filemanager/ trunk/linpha2/lib/plugins/filemanager/settings.filemanager.php trunk/linpha2/lib/plugins/guestbook/ trunk/linpha2/lib/plugins/log/ trunk/linpha2/lib/plugins/log/settings.log.php trunk/linpha2/lib/plugins/maillist/ trunk/linpha2/lib/plugins/rss/ trunk/linpha2/lib/plugins/stats/ Removed Paths: ------------- trunk/linpha2/install/sql/ trunk/linpha2/lib/include/sql.data.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-11-20 22:04:16 UTC (rev 4801) +++ trunk/linpha2/ChangeLog 2007-12-01 15:58:31 UTC (rev 4802) @@ -1,4 +1,10 @@ +2007-12-01 flo + * creating plugin interface + - moved whole install/sql folder to lib/include/sql + we need still that files if we want to dynamically create the + plugin tables + 2007-11-20 flo * finished basic part of the map plugin now working: Modified: trunk/linpha2/admin/maintenance_db.php =================================================================== --- trunk/linpha2/admin/maintenance_db.php 2007-11-20 22:04:16 UTC (rev 4801) +++ trunk/linpha2/admin/maintenance_db.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -1,6 +1,31 @@ <?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 file updates the database + * @package DB + */ + +if(!defined('LINPHA_DIR')) { exit(1); } + +/** * check if each photo has a parent element */ echo '<h2>'.i18n("Checking photos table").'</h2>'; Modified: trunk/linpha2/admin/settings.php =================================================================== --- trunk/linpha2/admin/settings.php 2007-11-20 22:04:16 UTC (rev 4801) +++ trunk/linpha2/admin/settings.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -9,6 +9,7 @@ $array_menu = array( 'layout' => array('name' => i18n("Layout"), 'link' => 'settings_layout'), 'features' => array('name' => i18n("Features"), 'link' => 'settings_features'), + 'plugins' => array('name' => i18n("Plugins"), 'link' => 'settings_plugins'), 'others' => array('name' => i18n("Others"), 'link' => 'settings_others'), 'all' => array('name' => i18n("All"), 'link' => 'settings_all') ); @@ -23,6 +24,9 @@ case 'features': include_once(LINPHA_DIR.'/admin/settings_features.php'); break; + case 'plugins': + include_once(LINPHA_DIR.'/admin/settings_plugins.php'); + break; case 'others': break; case 'all': Added: trunk/linpha2/admin/settings_plugins.php =================================================================== --- trunk/linpha2/admin/settings_plugins.php (rev 0) +++ trunk/linpha2/admin/settings_plugins.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -0,0 +1,77 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + +if(!isset($cat3)) +{ + $cat3 = 'enable'; +} + +$arrPlugins = explode(',',$LinAdmin->option_value_system['plugins_available']); + +/** + * save settings before showing menu + */ + if($cat3=='enable' && isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') + { + foreach($arrPlugins as $value) + { + $arrPlugins2[] = 'plugins_'.$value.'_enable'; + } + + $LinAdmin->saveConfig($arrPlugins2); + + /** + * create database tables if necessary + */ + foreach($arrPlugins2 as $value) + { + if( isset($_POST[$value]) && $_POST[$value]=='1' ) + { + + } + } + } + +/** + * show menu + */ +$array_menu = array( + 'enable' => array('name' => i18n("Enable/Disable Plugins"), 'link' => 'settings_plugins_enable'), +); +foreach( $arrPlugins as $key=>$value) +{ + if($LinAdmin->option_value_system['plugins_'.$value.'_enable'] == '1') + { + $array_menu[$value] = array( + 'name' => $LinAdmin->description_array['plugins_'.$value], + 'link' => 'settings_plugins_'.$value + ); + } +} + +LinAdmin::printAdminMenu($array_menu,$cat3); +?> + +<form method="POST" action="<?php echo LINPHA_DIR.'/admin/?cat=settings_plugins_'.$cat3; ?>"> +<?php +if($cat3=='enable') +{ + foreach( $arrPlugins as $key=>$value) + { + $LinAdmin->printAdminConfig( + 'radio', + $LinAdmin->getDescriptionByOptionName('plugins_'.$value), + 'plugins_'.$value.'_enable', + $LinAdmin->option_value_system['plugins_'.$value.'_enable'] + ); + } +} +elseif(in_array($cat3,$arrPlugins)) // prevent including evil file +{ + $includeFile = LINPHA_DIR.'/lib/plugins/'.$cat3.'/settings.'.$cat3.'.php'; + if( file_exists($includeFile)) + { + include_once($includeFile); + } +} +?> \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2007-11-20 22:04:16 UTC (rev 4801) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -77,6 +77,17 @@ 'sys_style_layout_color_links' => i18n("Links Color"), 'sys_style_layout_color_linkshover' => i18n("Links Hover Color"), 'sys_style_layout_color_fields' => i18n("Color Of Input and Select fields"), + + // plugin names + 'plugins_log' => i18n("Logging"), + 'plugins_filemanager' => i18n("Filemanager"), + 'plugins_maps' => i18n("Maps"), + 'plugins_guestbook' => i18n("Guestbook"), + 'plugins_stats' => i18n("Statistics"), + 'plugins_maillist' => i18n("Mailing List"), + 'plugins_rss' => i18n("RSS"), + 'plugins_watermark' => i18n("Watermark"), + 'plugins_log_filename' => i18n("Log to this filename"), 'plugins_log_syslog_enable' => i18n("Send important messages to syslog"), @@ -96,7 +107,7 @@ ?> <ul class="linUlMenu"> <?php - foreach($array_menu AS $key=>$value) + foreach($array_menu as $key=>$value) { if($value['link']=='linpha_home') { @@ -322,9 +333,17 @@ 'sys_style_thumb_showsubfoldersseparate', 'sys_style_image_useeffects', 'sys_user_autologin', + + 'plugins_filemanager_enable', + 'plugins_guestbook_enable', + 'plugins_log_enable', 'plugins_log_syslog_enable', 'plugins_log_email_enable', - 'plugins_filemanager_enable' + 'plugins_maps_enable', + 'plugins_maillist_enable', + 'plugins_rss_enable', + 'plugins_stats_enable', + 'plugins_watermark_enable', ); } Copied: trunk/linpha2/lib/include/sql (from rev 4798, trunk/linpha2/install/sql) Copied: trunk/linpha2/lib/include/sql/sql.data.php (from rev 4801, trunk/linpha2/lib/include/sql.data.php) =================================================================== --- trunk/linpha2/lib/include/sql/sql.data.php (rev 0) +++ trunk/linpha2/lib/include/sql/sql.data.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -0,0 +1,358 @@ +<?php +/* +* Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> +* +* 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. +*/ + +/** + * linpha installer + * @package Installation + */ + +/** + * config table + */ +$options = array( + 'sys_db_version' => '3', + 'sys_public_installation' => '1', + + 'sys_im_bracket_support' => $_SESSION['sys_im_bracket_support'], + 'sys_im_imagemagick_path' => $_SESSION['sys_im_convert_path'], + 'sys_im_use_imagemagick' => $_SESSION['sys_im_use_convert'], + 'sys_im_video_thumbnail' => '1', + + 'sys_import_autoimport' => '1', + 'sys_import_exif' => '1', + 'sys_import_exif_autorot' => '1', + 'sys_import_use_exiftool' => '0', + 'sys_import_use_emb_thumb' => '0', + 'sys_import_exiftool_avail' => '0', + 'sys_import_files_ignored' => 'Thumbs.db,ZbThumbnail.info,_vti_cnf,_derived,Picasa.ini,Cdlabel.alb', + 'sys_import_fileext_ignored' => 'thm,doc,txt', + + 'sys_image_exif' => '1', + 'sys_image_iptc' => '0', + 'sys_image_xmp' => '0', + 'sys_lang' => $_SESSION['language'], + 'sys_lang_autolang' => '1', + 'sys_path_album_dir' => $_SESSION['album_dir'], + 'sys_path_cache_dir' => $_SESSION['cache_dir'], + 'sys_path_tmp_dir' => $_SESSION['tmp_dir'], + 'sys_path_install_dir' => 'install', + + 'sys_basket_mail_max_size' => (1024*1024*2), + 'sys_basket_mail_smpthost' => 'localhost', + 'sys_basket_download_limit' => '0', + + 'sys_style_datetime_dates' => '%a %m/%d/%Y', + 'sys_style_datetime_times' => '%I:%M:%S %p', + + 'sys_style_home_showbrowsebydate' => '1', + 'sys_style_home_nrrandomimages' => '4', + 'sys_style_home_newimagesnr' => '4', + 'sys_style_home_newimagesage' => '7', + 'sys_style_home_showalbums' => '1', + 'sys_style_home_usedefaultwelcometext' => '1', + 'sys_style_home_firstsortorder' => 'nameasc', + + 'sys_style_thumb_size_max' => '200', + 'sys_style_thumb_size_display' => '150', + 'sys_style_thumb_showsubfoldersseparate' => '0', + 'sys_style_thumb_selectsizes' => '50,75,100,150,200,250,300,400,500', + 'sys_style_thumb_selectnrimages' => 'auto,10,25,50,100,200,all', + 'sys_style_thumb_nojsnrrows' => '3', + 'sys_style_thumb_nojsnrcols' => '4', + + 'sys_style_image_quality' => '75', + 'sys_style_image_width' => '700', + 'sys_style_image_height' => '525', + 'sys_style_image_nrprevnextthumbs' => '3', + 'sys_style_image_useeffects' => '1', + + 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design + 'sys_style_layout_color_elembg' => '87CEFA', + 'sys_style_layout_color_font' => '000000', + 'sys_style_layout_color_albumsbg' => 'D5FCF4', + 'sys_style_layout_color_links' => '005388', + 'sys_style_layout_color_linkshover' => '666666', + 'sys_style_layout_color_fields' => 'CCCCCC', + + 'sys_style_layout_theme' => 'default', + 'sys_style_layout_template' => 'default', + 'sys_style_layout_title' => 'Linpha 2.0', + + 'sys_style_others_sortorder' => 'nameasc', + + 'sys_user_autologin' => '1', + + + 'plugins_available' => 'filemanager,guestbook,log,maps,maillist,rss,stats,watermark', + + 'plugins_filemanager_enable' => '0', + 'plugins_filemanager_nruploads' => '5', + + 'plugins_guestbook_enable' => '0', + + 'plugins_log_enable' => '0', + 'plugins_log_filename' => 'var/linpha-'.random_string(6).'.log', + 'plugins_log_syslog_enable' => '0', + 'plugins_log_syslog_add_events' => '', + 'plugins_log_email_enable' => '0', + 'plugins_log_email_add_events' => '', + 'plugins_log_email_to' => 'LinPHA Logger<log@'.$_SERVER["HTTP_HOST"].'>', + 'plugins_log_email_headers' => 'From:LinPHA Logger<noreply@'.$_SERVER["HTTP_HOST"].'>', + 'plugins_log_email_subject' => 'Linpha Log', + + 'plugins_maps_enable' => '0', + 'plugins_maps_defaultMarkerZoom' => '10', + 'plugins_maps_mapType' => 'google', + 'plugins_maps_google_key' => 'ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg', // key for http://localhost + 'plugins_maps_markerThumbSize' => '350', + + 'plugins_maillist_enable' => '0', + 'plugins_rss_enable' => '0', + 'plugins_stats_enable' => '0', + 'plugins_watermark_enable' => '0', + +); + +$options_user_overrideable = Array( + 'sys_lang', + 'sys_lang_autolang', + 'sys_style_others_sortorder', + 'sys_style_template', + 'sys_style_home_showbrowsebydate', + 'sys_style_home_nrrandomimages', + 'sys_style_home_showalbums', + 'sys_style_home_firstsortorder', + 'sys_style_thumb_size_display', + 'sys_style_thumb_showsubfoldersseparate', + 'sys_style_thumb_nojsnrrows', + 'sys_style_thumb_nojsnrcols', + 'sys_style_image_width', + 'sys_style_image_height', + 'sys_style_image_nrprevnextthumbs' => '3', + 'sys_style_image_useeffects' => '1', + + 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design + 'sys_style_layout_color_elembg' => '87CEFA', + 'sys_style_layout_color_font' => '000000', + 'sys_style_layout_color_albumsbg' => 'D5FCF4', + 'sys_style_layout_color_links' => '005388', + 'sys_style_layout_color_linkshover' => '666666', + 'sys_style_layout_color_fields' => 'CCCCCC', + + 'sys_style_layout_theme' => 'default', + 'sys_style_layout_template' => 'default', +); + +/** + * create sql executes for all option entries + */ +while( list($name, $value) = each($options) ) +{ + if(in_array($name,$options_user_overrideable)) { + $override = 1; + } else { + $override = 0; + } + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . + "VALUES ('".$name."', '".$value."', '".$override."', '0')"; +} + +/** + * groups + */ +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."groups (group_name) VALUES ('admin')"; + +/** + * permissions + */ +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . + "VALUES (0, 'read', ';public;')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . + "VALUES (0, 'write', ';;')"; + + +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('basket_print', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('basket_mail', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('basket_download', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('metadata_comments', ';public;')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('metadata_deletecomments', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('metadata_edit', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('watermark', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('stats', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('download', '')"; +$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . + "VALUES ('plugins_maps_setMarkers', '')"; + + +/** + * MetaData + * see http://linpha.sourceforge.net/wiki/index.php/Tables_linpha_meta_fields for the definition + */ + /** + * special fields + * flag_nr 1 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('filename', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('imagesize', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('dimension', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('thumbnail', 0, 1)"; + + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('time_add', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('time_mod', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('time_exif', 0, 1)"; + + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('stats_numbers', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('stats_views', 0, 1)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('stats_downloads', 0, 1)"; + + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('first_comment', 0, 1)"; + /** + * workaround for i18n + * they wouldn't get detected otherwise... + * some are defined in linpha.metadata.php + */ + i18n("Filename"); i18n("Imagesize"); i18n("Dimension"); i18n("Thumbnail"); + + + /** + * builtin fields + * flag_nr 5 (builtin enabled) + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('description', 1, 5)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('category', 2, 5)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('persons', 2, 5)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('date', 3, 5)"; + /** + * workaround for i18n + * they wouldn't get detected otherwise... + * some are defined in linpha.metadata.php + */ + i18n("Description"); i18n("Category"); i18n("Persons"); i18n("Date"); + + + /** + * image fields + * flag_nr 10 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_dimension', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_category', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_persons', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_time_exif', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_stats_views', 0, 10)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_stats_downloads', 0, 10)"; + + + /** + * video fields + * flag_nr 11 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('??', 0, 11)"; + + /** + * album fields + * flag_nr 12 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_time_add', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_stats_numbers', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_persons', 0, 12)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_first_comment', 0, 12)"; + + + /** + * thumbnails fields + * flag_nr 13 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 13)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 13)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 13)"; + + /** + * thumbnails in detail view fields + * flag_nr 14 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_dimension', 0, 14)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('exif_datetimeoriginal', 0, 14)"; + + /** + * slideshow fields + * flag_nr 15 + */ + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_filename', 0, 15)"; + $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . + "(name, field_type, flags) VALUES ('builtin_description', 0, 15)"; + +?> + Deleted: trunk/linpha2/lib/include/sql.data.php =================================================================== --- trunk/linpha2/lib/include/sql.data.php 2007-11-20 22:04:16 UTC (rev 4801) +++ trunk/linpha2/lib/include/sql.data.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -1,347 +0,0 @@ -<?php -/* -* Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> -* -* 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. -*/ - -/** - * linpha installer - * @package Installation - */ - -/** - * config table - */ -$options = array( - 'sys_db_version' => '3', - 'sys_public_installation' => '1', - - 'sys_im_bracket_support' => $_SESSION['sys_im_bracket_support'], - 'sys_im_imagemagick_path' => $_SESSION['sys_im_convert_path'], - 'sys_im_use_imagemagick' => $_SESSION['sys_im_use_convert'], - 'sys_im_video_thumbnail' => '1', - - 'sys_import_autoimport' => '1', - 'sys_import_exif' => '1', - 'sys_import_exif_autorot' => '1', - 'sys_import_use_exiftool' => '0', - 'sys_import_use_emb_thumb' => '0', - 'sys_import_exiftool_avail' => '0', - 'sys_import_files_ignored' => 'Thumbs.db,ZbThumbnail.info,_vti_cnf,_derived,Picasa.ini,Cdlabel.alb', - 'sys_import_fileext_ignored' => 'thm,doc,txt', - - 'sys_image_exif' => '1', - 'sys_image_iptc' => '0', - 'sys_image_xmp' => '0', - 'sys_lang' => $_SESSION['language'], - 'sys_lang_autolang' => '1', - 'sys_path_album_dir' => $_SESSION['album_dir'], - 'sys_path_cache_dir' => $_SESSION['cache_dir'], - 'sys_path_tmp_dir' => $_SESSION['tmp_dir'], - 'sys_path_install_dir' => 'install', - - 'sys_basket_mail_max_size' => (1024*1024*2), - 'sys_basket_mail_smpthost' => 'localhost', - 'sys_basket_download_limit' => '0', - - 'sys_style_datetime_dates' => '%a %m/%d/%Y', - 'sys_style_datetime_times' => '%I:%M:%S %p', - - 'sys_style_home_showbrowsebydate' => '1', - 'sys_style_home_nrrandomimages' => '4', - 'sys_style_home_newimagesnr' => '4', - 'sys_style_home_newimagesage' => '7', - 'sys_style_home_showalbums' => '1', - 'sys_style_home_usedefaultwelcometext' => '1', - 'sys_style_home_firstsortorder' => 'nameasc', - - 'sys_style_thumb_size_max' => '200', - 'sys_style_thumb_size_display' => '150', - 'sys_style_thumb_showsubfoldersseparate' => '0', - 'sys_style_thumb_selectsizes' => '50,75,100,150,200,250,300,400,500', - 'sys_style_thumb_selectnrimages' => 'auto,10,25,50,100,200,all', - 'sys_style_thumb_nojsnrrows' => '3', - 'sys_style_thumb_nojsnrcols' => '4', - - 'sys_style_image_quality' => '75', - 'sys_style_image_width' => '700', - 'sys_style_image_height' => '525', - 'sys_style_image_nrprevnextthumbs' => '3', - 'sys_style_image_useeffects' => '1', - - 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design - 'sys_style_layout_color_elembg' => '87CEFA', - 'sys_style_layout_color_font' => '000000', - 'sys_style_layout_color_albumsbg' => 'D5FCF4', - 'sys_style_layout_color_links' => '005388', - 'sys_style_layout_color_linkshover' => '666666', - 'sys_style_layout_color_fields' => 'CCCCCC', - - 'sys_style_layout_theme' => 'default', - 'sys_style_layout_template' => 'default', - 'sys_style_layout_title' => 'Linpha 2.0', - - 'sys_style_others_sortorder' => 'nameasc', - - 'sys_user_autologin' => '1', - - - 'plugins_log_filename' => 'var/linpha-'.random_string(6).'.log', - 'plugins_log_syslog_enable' => '0', - 'plugins_log_syslog_add_events' => '', - 'plugins_log_email_enable' => '0', - 'plugins_log_email_add_events' => '', - 'plugins_log_email_to' => 'LinPHA Logger<log@'.$_SERVER["HTTP_HOST"].'>', - 'plugins_log_email_headers' => 'From:LinPHA Logger<noreply@'.$_SERVER["HTTP_HOST"].'>', - 'plugins_log_email_subject' => 'Linpha Log', - - 'plugins_filemanager_enable' => '0', - 'plugins_filemanager_nruploads' => '5', - - 'plugins_maps_defaultMarkerZoom' => '10', - 'plugins_maps_mapType' => 'google', - 'plugins_maps_google_key' => 'ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg', // key for http://localhost - 'plugins_maps_markerThumbSize' => '350', - -); - -$options_user_overrideable = Array( - 'sys_lang', - 'sys_lang_autolang', - 'sys_style_others_sortorder', - 'sys_style_template', - 'sys_style_home_showbrowsebydate', - 'sys_style_home_nrrandomimages', - 'sys_style_home_showalbums', - 'sys_style_home_firstsortorder', - 'sys_style_thumb_size_display', - 'sys_style_thumb_showsubfoldersseparate', - 'sys_style_thumb_nojsnrrows', - 'sys_style_thumb_nojsnrcols', - 'sys_style_image_width', - 'sys_style_image_height', - 'sys_style_image_nrprevnextthumbs' => '3', - 'sys_style_image_useeffects' => '1', - - 'sys_style_layout_color_bodybg' => 'DDDDDD', // the blue design - 'sys_style_layout_color_elembg' => '87CEFA', - 'sys_style_layout_color_font' => '000000', - 'sys_style_layout_color_albumsbg' => 'D5FCF4', - 'sys_style_layout_color_links' => '005388', - 'sys_style_layout_color_linkshover' => '666666', - 'sys_style_layout_color_fields' => 'CCCCCC', - - 'sys_style_layout_theme' => 'default', - 'sys_style_layout_template' => 'default', -); - -/** - * create sql executes for all option entries - */ -while( list($name, $value) = each($options) ) -{ - if(in_array($name,$options_user_overrideable)) { - $override = 1; - } else { - $override = 0; - } - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."config (option_name, option_value, override, user_id) " . - "VALUES ('".$name."', '".$value."', '".$override."', '0')"; -} - -/** - * groups - */ -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."groups (group_name) VALUES ('admin')"; - -/** - * permissions - */ -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . - "VALUES (0, 'read', ';public;')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (photos_id, perm_type, permission) " . - "VALUES (0, 'write', ';;')"; - - -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('basket_print', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('basket_mail', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('basket_download', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('metadata_comments', ';public;')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('metadata_deletecomments', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('metadata_edit', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('watermark', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('stats', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('download', '')"; -$sql_queries[] = "INSERT INTO ".LIN_PREFIX."permissions (perm_type, permission) " . - "VALUES ('plugins_maps_setMarkers', '')"; - - -/** - * MetaData - * see http://linpha.sourceforge.net/wiki/index.php/Tables_linpha_meta_fields for the definition - */ - /** - * special fields - * flag_nr 1 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('filename', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('imagesize', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('dimension', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('thumbnail', 0, 1)"; - - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('time_add', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('time_mod', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('time_exif', 0, 1)"; - - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('stats_numbers', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('stats_views', 0, 1)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('stats_downloads', 0, 1)"; - - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('first_comment', 0, 1)"; - /** - * workaround for i18n - * they wouldn't get detected otherwise... - * some are defined in linpha.metadata.php - */ - i18n("Filename"); i18n("Imagesize"); i18n("Dimension"); i18n("Thumbnail"); - - - /** - * builtin fields - * flag_nr 5 (builtin enabled) - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('description', 1, 5)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('category', 2, 5)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('persons', 2, 5)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('date', 3, 5)"; - /** - * workaround for i18n - * they wouldn't get detected otherwise... - * some are defined in linpha.metadata.php - */ - i18n("Description"); i18n("Category"); i18n("Persons"); i18n("Date"); - - - /** - * image fields - * flag_nr 10 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_dimension', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_category', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_persons', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_time_exif', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_stats_views', 0, 10)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_stats_downloads', 0, 10)"; - - - /** - * video fields - * flag_nr 11 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('??', 0, 11)"; - - /** - * album fields - * flag_nr 12 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_time_add', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_stats_numbers', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_persons', 0, 12)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_first_comment', 0, 12)"; - - - /** - * thumbnails fields - * flag_nr 13 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 13)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 13)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 13)"; - - /** - * thumbnails in detail view fields - * flag_nr 14 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_thumbnail', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_imagesize', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_dimension', 0, 14)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('exif_datetimeoriginal', 0, 14)"; - - /** - * slideshow fields - * flag_nr 15 - */ - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_filename', 0, 15)"; - $sql_queries[] = "INSERT INTO ".LIN_PREFIX."meta_fields " . - "(name, field_type, flags) VALUES ('builtin_description', 0, 15)"; - -?> - Added: trunk/linpha2/lib/plugins/filemanager/settings.filemanager.php =================================================================== --- trunk/linpha2/lib/plugins/filemanager/settings.filemanager.php (rev 0) +++ trunk/linpha2/lib/plugins/filemanager/settings.filemanager.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -0,0 +1,29 @@ +<?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. +*/ + +/** + * Settings for the admin section + * @package admin + */ + +if(!defined('LINPHA_DIR')) { exit(1); } + + +?> \ No newline at end of file Added: trunk/linpha2/lib/plugins/log/settings.log.php =================================================================== --- trunk/linpha2/lib/plugins/log/settings.log.php (rev 0) +++ trunk/linpha2/lib/plugins/log/settings.log.php 2007-12-01 15:58:31 UTC (rev 4802) @@ -0,0 +1,65 @@ +<?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. +*/ + +/** + * Settings for the admin section + * @package admin + */ + +if(!defined('LINPHA_DIR')) { exit(1); } + +/** + * save settings + */ + if(isset($_POST['cmd']) && $_POST['cmd']=='saveconfig') + { + $LinAdmin->saveConfig(Array( + 'plugins_log_filename', + 'plugins_log_syslog_enable', + 'plugins_log_syslog_add_events', + 'plugins_log_email_enable', + 'plugins_log_email_add_events', + 'plugins_log_email_to', + 'plugins_log_email_headers', + 'plugins_log_email_subject' + )); + } + +echo '<br /><h2 class="linStyle">'.i18n("Filename").'</h2>'; +$LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_filename'),'plugins_log_filename',$LinAdmin->option_value_system['plugins_log_filename']); + +echo '<br /><h2 class="linStyle">'.i18n("Syslog").'</h2>'; +echo i18n("(Event log in Windows)"); +$LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_log_syslog_enable'),'plugins_log_syslog_enable',$LinAdmin->option_value_system['plugins_log_syslog_enable']); + +$LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_syslog_add_events'),'plugins_log_syslog_add_events',$LinAdmin->option_value_system['plugins_log_syslog_add_events']); +echo i18n("Comma separated list. Valid events:")." login, logout, rotate, comments, guestbook, fm_others, fm_upload, fm_delete, fm_move, fm_copy, fm_rename, fm_create_folder, fm_perm"; +echo '<br />'; + +echo '<br /><h2 class="linStyle">'.i18n("Email").'</h2>'; +$LinAdmin->printAdminConfig('radio',$LinAdmin->getDescriptionByOptionName('plugins_log_email_enable'),'plugins_log_email_enable',$LinAdmin->option_value_system['plugins_log_email_enable']); +$LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_to'),'plugins_log_email_to',$LinAdmin->option_value_system['plugins_log_email_to']); +$LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_subject'),'plugins_log_email_subject',$LinAdmin->option_value_system['plugins_log_email_subject']); +$LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_headers'),'plugins_log_email_headers',$LinAdmin->option_value_system['plugins_log_email_headers']); + +$LinAdmin->printAdminConfig('text',$LinAdmin->getDescriptionByOptionName('plugins_log_email_add_events'),'plugins_log_email_add_events',$LinAdmin->option_value_system['plugins_log_email_add_events']); +echo i18n("Comma separated list. Valid events:")." login, logout, rotate, comments, guestbook, fm_others, fm_upload, fm_delete, fm_move, fm_copy, fm_rename, fm_create_folder, fm_perm"; + +?> \ 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: bzrudi <bz...@us...> - 2007-11-22 16:18:25
|
Update of /cvsroot/linpha/linpha/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17001/include Modified Files: metadata.class.php Log Message: prevent notice during import if exif header is missing or broken... Index: metadata.class.php =================================================================== RCS file: /cvsroot/linpha/linpha/include/metadata.class.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** metadata.class.php 4 Jan 2007 07:48:40 -0000 1.42 --- metadata.class.php 22 Nov 2007 16:18:22 -0000 1.43 *************** *** 935,939 **** * just get orientation tag data */ ! $rotation = $meta[0][274]['Data'][0]; if(is_numeric($rotation)) --- 935,939 ---- * just get orientation tag data */ ! $rotation = @$meta[0][274]['Data'][0]; if(is_numeric($rotation)) *************** *** 999,1001 **** } ! ?> \ No newline at end of file --- 999,1001 ---- } ! ?> |
From: <fan...@us...> - 2007-11-20 22:04:24
|
Revision: 4801 http://linpha.svn.sourceforge.net/linpha/?rev=4801&view=rev Author: fangehrn Date: 2007-11-20 14:04:16 -0800 (Tue, 20 Nov 2007) Log Message: ----------- 2007-11-20 flo * finished basic part of the map plugin now working: - creating markers - deleting markers - assign albums to markers - change/delete assigned albums - load/show gps images - create thumbnail list - image navigation Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/include/sql.data.php trunk/linpha2/lib/plugins/maps/LinMaps.js trunk/linpha2/lib/plugins/maps/class.googlemaps.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/themes/default/colorsettings.php trunk/linpha2/templates/default/themes/default/css/maps.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/ChangeLog 2007-11-20 22:04:16 UTC (rev 4801) @@ -1,3 +1,15 @@ + +2007-11-20 flo + * finished basic part of the map plugin + now working: + - creating markers + - deleting markers + - assign albums to markers + - change/delete assigned albums + - load/show gps images + - create thumbnail list + - image navigation + 2007-11-18 flo * installer - some UI improvements Modified: trunk/linpha2/lib/include/sql.data.php =================================================================== --- trunk/linpha2/lib/include/sql.data.php 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/lib/include/sql.data.php 2007-11-20 22:04:16 UTC (rev 4801) @@ -114,6 +114,7 @@ 'plugins_maps_defaultMarkerZoom' => '10', 'plugins_maps_mapType' => 'google', 'plugins_maps_google_key' => 'ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg', // key for http://localhost + 'plugins_maps_markerThumbSize' => '350', ); Modified: trunk/linpha2/lib/plugins/maps/LinMaps.js =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMaps.js 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/lib/plugins/maps/LinMaps.js 2007-11-20 22:04:16 UTC (rev 4801) @@ -19,6 +19,7 @@ this.markersData = false; this.markersObj = new Array(); + this.imagesObj = new Array(); }, /** @@ -55,7 +56,7 @@ for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) { - myLinMaps.markersObj[i] = myLinMapObject.createMarker( myLinMaps.markersData.markers[i] ); + myLinMaps.markersObj[i] = myLinMapObject.createMarker( myLinMaps.markersData.markers[i], false ); } /** @@ -134,15 +135,29 @@ assignAlbum: function(markerId,albId) { - alert( markerId + ' ' + albId ); myLinGlobal.AjaxPost('cmd=assignAlbum&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); }, - assignAlbumFinsih: function(t) + assignAlbumChange: function(markerId,albId) { + myLinGlobal.AjaxPost('cmd=assignAlbumChange&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); + }, + assignAlbumDelete: function(markerId,albId) { + myLinGlobal.AjaxPost('cmd=assignAlbumDelete&markerId='+markerId+'&albId='+albId,myLinMaps.assignAlbumFinish); }, - deleteAssignedAlbum: function(markerId,albId) + 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() @@ -163,9 +178,16 @@ myLinGlobal.createPopup('linDivPopupAlbums'); }, - + + /** + * Thumbnail functions + */ loadImages: function(albId) { + this.startLoading(); + + myLinMapObject.closeMarkerWindows(); + if( !this.showNav ) { this.toggleNav(); } @@ -179,47 +201,49 @@ //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 */ - $('linDivMapNav').innerHTML = ''; - //myLinMapObject.initBounds(); + 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, width: displayThumbSize, height: displayThumbSize}); - var ElemA = Builder.node('a', {href: 'javascript:myLinMaps.openImage(' + i + ')'}); + 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); - //myLinMaps.imagesObj[i] = myLinMapObject.createMarker( myLinMaps.imagesData.images[i] ); - + 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(); + myLinMapObject.updateCenter(0); + + myLinMaps.stopLoading(); }, - - openImage: function(imgIndex) - { - alert( myLinMaps.imagesData.images[imgIndex].lat + ' ' + myLinMaps.imagesData.images[imgIndex].lon); - }, - -/* getMarkerInfo: function( markerNode ) // maybe use markerId oder markerIndex (but that could be unsafe) - { - var infoStr = '<b>' + markerNode.name + '</b><br />' + markerNode.text; - - return infoStr; - },*/ - - /** - * Thumbnail functions - */ toggleNav: function() { @@ -247,6 +271,15 @@ // update google map size myLinMapObject.checkResize(); + }, + + + + startLoading: function() { + Element.show('linDivLoadingOuter'); + }, + stopLoading: function() { + Element.hide('linDivLoadingOuter'); } Modified: trunk/linpha2/lib/plugins/maps/class.googlemaps.js =================================================================== --- trunk/linpha2/lib/plugins/maps/class.googlemaps.js 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/lib/plugins/maps/class.googlemaps.js 2007-11-20 22:04:16 UTC (rev 4801) @@ -89,7 +89,7 @@ googlemap.setCenter(this.bounds.getCenter(), zoom); }, - createMarker: function( markerNode ) + createMarker: function( markerNode, markerType, openMarker ) { /*var icon = new GIcon(); icon.image = image[0]; @@ -135,7 +135,24 @@ //alert( markerNode.id + ' ' + markerNode.name + ' ' + markerNode.lat + ' ' + markerNode.lon); var point = new GLatLng( markerNode.lat, markerNode.lon); - var icon = new GIcon(G_DEFAULT_ICON, "http://maps.google.com/mapfiles/ms/micons/blue-dot.png") + + 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); @@ -147,6 +164,10 @@ this.bounds.extend(point); + if( openMarker ) { + GEvent.trigger(marker, 'click'); + } + return marker; }, @@ -180,11 +201,20 @@ 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 ); Modified: trunk/linpha2/lib/plugins/maps/module.maps.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.maps.php 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/lib/plugins/maps/module.maps.php 2007-11-20 22:04:16 UTC (rev 4801) @@ -50,23 +50,28 @@ while($data = $query->FetchRow()) { - $path = htmlspecialchars($data['albPath'],ENT_QUOTES); - - /*if($allowed) { - if( $data['albId'] != 0 ) { - $text = '<a href=\'javascript:myLinMaps.assignAlbumChange('.$data['id'].','.$data['albId'].')\'>'.i18n("Change Assigned Album").'</a>' . - '<br /><a href=\'javascript:myLinMaps.deleteAssignedAlbum('.$data['id'].','.$data['albId'].')\'>'.i18n("Delete Assigned Album").'</a>'; + if( $data['albId']!=0 ) { + + $query2 = $GLOBALS['linpha']->db->Execute("SELECT P.parent_id " . + "FROM ".LIN_PREFIX."meta_exif E INNER JOIN ".LIN_PREFIX."photos P on E.md5sum = P.md5sum " . + "WHERE gpslatituderef IS NOT NULL " . + "AND gpslatitude IS NOT NULL " . + "AND gpslongituderef IS NOT NULL " . + "AND gpslongitude IS NOT NULL " . + "AND P.parent_id = '".LinSql::linAddslashes($data['albId'])."'"); + if($query2->EOF) { + $type = 'album'; } else { - $text = '<a href=\'javascript:myLinMaps.assignAlbum('.$data['id'].',0)\'>'.i18n("Assign Album").'</a>'; + $type = 'albumWithImg'; } - - $text .= '<br /><a href=\'javascript:if(confirm(\'test\')){myLinMaps.deleteMarker('.$data['id'].')}\'>'.i18n("Delete Marker").'</a>'; - + } else { - $text = $path; - }*/ + $type = 'marker'; + } + + $path = htmlspecialchars($data['albPath'],ENT_QUOTES); - echo '{"id": '.$data['id'].', "albId": '.$data['albId'].', "path": "'.$path.'", ' . + echo '{"id": '.$data['id'].', "type": "'.$type.'", "albId": '.$data['albId'].', "path": "'.$path.'", ' . '"name": "'.htmlspecialchars($data['markerName'],ENT_QUOTES).'", ' . '"lat": '.$data['markerLat'].', "lon": '.$data['markerLon'].', ' . '"zoom": '.$data['markerZoom'].'}'; @@ -176,6 +181,8 @@ break; case 'assignAlbum': + case 'assignAlbumChange': + case 'assignAlbumDelete': header('Content-type: text/xml'); echo '<?xml version="1.0" ?>'."\n"; @@ -196,8 +203,12 @@ $markerId = intval($_REQUEST['markerId']); $albId = intval($_REQUEST['albId']); + $arrAlbPath = LinSql::getFullFilenameFromId($albId); + $albPath = implode('/',$arrAlbPath); + $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."plugins_maps_markers " . - "SET albId = '".LinSql::linAddslashes($albId)."' WHERE id='".LinSql::linAddslashes($markerId)."'"); + "SET albId = '".LinSql::linAddslashes($albId)."', " . + "albPath = '".LinSql::linAddslashes($albPath)."' WHERE id='".LinSql::linAddslashes($markerId)."'"); echo '<responseCode>success</responseCode>'."\n"; } @@ -278,7 +289,7 @@ $latlon = getExifLatLon($data); echo '{"id": '.$data['id'].', "parent_id": '.$data['parent_id'].', ' . - '"name": "'.htmlspecialchars( $data['name'] ,ENT_QUOTES).'", ' . + '"type": "images", "text": "", "name": "'.htmlspecialchars( $data['name'] ,ENT_QUOTES).'", ' . '"lat": '.$latlon['gpslatitude'].', "lon": '.$latlon['gpslongitude'] . "}"; Modified: trunk/linpha2/templates/default/maps.head.php =================================================================== --- trunk/linpha2/templates/default/maps.head.php 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/templates/default/maps.head.php 2007-11-20 22:04:16 UTC (rev 4801) @@ -9,6 +9,7 @@ var displayThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; 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> <?php Modified: trunk/linpha2/templates/default/maps.html.php =================================================================== --- trunk/linpha2/templates/default/maps.html.php 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/templates/default/maps.html.php 2007-11-20 22:04:16 UTC (rev 4801) @@ -30,12 +30,17 @@ <div id="linDivPopupHelp" style="display: none"> <div> - Legend:<br /> - (red) current marker<br /> - (yellow) location marker<br /> - (blue) location marker with assigned albums<br /> - (green) location marker with assigned images (GPS)<br /> - (pink) images<br /> + <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 @@ -44,27 +49,27 @@ ?> <br /> <div> - Create marker:<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 /> - Assign albums:<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 /> - Assign images to an album marker:<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. + it is not free.<br /> </div> <div> - Not assigned images:<br /> + <b>Not assigned images:</b><br /> albums/album1 (22 images)<br /> </div> <?php @@ -95,34 +100,64 @@ </fieldset> </div> +<div id="linDivLoadingOuter" style="display: none;" class="linBackground"> + <?php echo $linTpl->divRoundCorners('top'); ?> + <div id="linDivLoading"> + <img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/loading.gif" /> + </div> + <?php echo $linTpl->divRoundCorners('bottom'); ?> +</div> + <script language="JavaScript" type="text/javascript"> function linGetMarkerHtml(markerNode) { - var htmlStr = '<b>' + markerNode.name + '</b><br />' + markerNode.path; - <?php - if( $GLOBALS['linpha']->sql->checkPermission('plugins_maps_setMarkers') ) + var htmlStr = '<b>' + markerNode.name + '</b><br />'; + + if( markerNode.type == 'images' ) { - ?> - htmlStr += '<br /><br /><form><select name="linInputAlbum" style="width: 250px;"><?php - linBuildAlbumSelect($with_all_albs_entry=false,$with_linebreaks=false); ?></select><br />'; + htmlStr += '<img src="'+imageSrc+markerNode.id+'" width="' + + linMapsMarkerThumbSize+'" >' + markerNode.text; - if(markerNode.albId != 0) + $('thumb_'+markerNode.id).focus(); + } + else + { + + if( markerNode.albId != 0 ) { + htmlStr += '<?php echo i18n("Album"); ?>: ' + markerNode.path + '<br />'; + + if( markerNode.type == 'albumWithImg') { + htmlStr += '<a href="javascript:myLinMaps.loadImages('+ markerNode.albId +')"><?php + echo i18n("Open Images"); ?></a><br />'; + } + } + + <?php + if( $GLOBALS['linpha']->sql->checkPermission('plugins_maps_setMarkers') ) { - htmlStr += '<input type="button" value="<?php echo i18n("Change Assigned Album"); - ?>" onclick="myLinMaps.assignAlbumChange(' + markerNode.id + ',this.form.linInputAlbum.value)">' + - '<br /><input type="button" value="<?php echo i18n("Delete Assigned Album"); - ?>" onclick="myLinMaps.deleteAssignedAlbum(' + markerNode.id + ',' + markerNode.albId + ')">'; - } else { - htmlStr += '<input type="button" value="<?php echo i18n("Assign Album"); - ?>" onclick="myLinMaps.assignAlbum(this.form.linInputAlbum.value)">'; + ?> + htmlStr += '<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"); + ?>" 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"); + ?>" onclick="myLinMaps.assignAlbum(' + markerNode.id + ', this.form.linInputAlbum.value)">'; + } + + htmlStr += '<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 } - - htmlStr += '<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>'; - <?php + ?> } - ?> return htmlStr; } Modified: trunk/linpha2/templates/default/themes/default/colorsettings.php =================================================================== --- trunk/linpha2/templates/default/themes/default/colorsettings.php 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/templates/default/themes/default/colorsettings.php 2007-11-20 22:04:16 UTC (rev 4801) @@ -26,7 +26,7 @@ background-color: #<?php echo $_GET['bodybg']; ?>; } - #linDivMainOuter, #linDivMetaStaticOuter, #linDivNavigationOuter, .linButton, #linDivThumbnaviOuter, #linDivSlideshowControls, .roundAlphabottomInner { + #linDivMainOuter, #linDivMetaStaticOuter, #linDivNavigationOuter, .linButton, #linDivThumbnaviOuter, #linDivSlideshowControls, .roundAlphabottomInner, .linBackground { background-color: #<?php echo $_GET['bg']; ?>; } Modified: trunk/linpha2/templates/default/themes/default/css/maps.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/maps.css 2007-11-18 22:29:28 UTC (rev 4800) +++ trunk/linpha2/templates/default/themes/default/css/maps.css 2007-11-20 22:04:16 UTC (rev 4801) @@ -1,3 +1,8 @@ + +form { + margin: 0; +} + #linDivMapMain { height: 675px; } @@ -39,12 +44,28 @@ background-color: white; } -#linDivEditMarker form { - margin: 0; -} .linInputEditMarker { display: block; float: left; width: 125px; -} \ No newline at end of file +} + +.linImgMapThumb { + border: 1px solid grey; +} + +#linDivLoadingOuter { + position: absolute; + top: 40%; + left: 40%; + z-index: 100; +} + +#linDivLoading { + width: 50px; + height: 30px; + + padding-top: 3px; + padding-left: 20px; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2007-11-18 22:29:30
|
Revision: 4800 http://linpha.svn.sourceforge.net/linpha/?rev=4800&view=rev Author: fangehrn Date: 2007-11-18 14:29:28 -0800 (Sun, 18 Nov 2007) Log Message: ----------- updated documentation Modified Paths: -------------- trunk/linpha2/docs/dev/TODO.txt Added Paths: ----------- trunk/linpha2/lib/js/prototype-1.6.0/ trunk/linpha2/lib/js/prototype-1.6.0/CHANGELOG trunk/linpha2/lib/js/prototype-1.6.0/LICENSE trunk/linpha2/lib/js/prototype-1.6.0/README trunk/linpha2/lib/js/prototype-1.6.0/Rakefile trunk/linpha2/lib/js/scriptaculous-js-1.8.0/ trunk/linpha2/lib/js/scriptaculous-js-1.8.0/CHANGELOG trunk/linpha2/lib/js/scriptaculous-js-1.8.0/MIT-LICENSE trunk/linpha2/lib/js/scriptaculous-js-1.8.0/README trunk/linpha2/lib/js/sound.js Removed Paths: ------------- trunk/linpha2/lib/js/prototype-1.5.0_rc1/ trunk/linpha2/lib/js/scriptaculous-js-1.6.4/ Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2007-11-18 22:20:05 UTC (rev 4799) +++ trunk/linpha2/docs/dev/TODO.txt 2007-11-18 22:29:28 UTC (rev 4800) @@ -26,6 +26,9 @@ - fix (adodb) error handler +- compress javascripts (prototype and scriptaculous) + they are now nearly 200KB big + ## Big Todos - Switch to strict mode Added: trunk/linpha2/lib/js/prototype-1.6.0/CHANGELOG =================================================================== --- trunk/linpha2/lib/js/prototype-1.6.0/CHANGELOG (rev 0) +++ trunk/linpha2/lib/js/prototype-1.6.0/CHANGELOG 2007-11-18 22:29:28 UTC (rev 4800) @@ -0,0 +1,873 @@ +*1.6.0* (November 6, 2007) + +* Fix Class#addMethods for "toString" and "valueOf" methods in Internet Explorer. Closes #9901. [sam] + +* Exclude Opera from using the sourceIndex approach in Element#descendantOf. [Tobie Langel, Andrew Dupont] + +* Ensure Element#hasClassName always returns a boolean. Closes #10075. [ronnylovtangen, Tobie Langel] + +* Ensure selectors of the form "[href]" (attribute token with no preceding tag name) work properly. Closes #8870. [chao, kangax, Andrew Dupont] + +* Performance optimizations for Element#descendantOf. Costliness should no longer be dependent on the difference in depth between the parent and the child. [Andrew Dupont] + +* Apply the workaround for the Firefox "blinking element" opacity=1 bug only to Firefox 1.5. [Thomas Fuchs] + +* Add event.stopped, a boolean that is set to `true` when Event#stop is called. [Andrew Dupont, sam] + +* Reset the browser's dimensions to their original settings after running the DOM viewport tests. [sam] + +* Fix the test runner for Firefox in Leopard. [sam] + +* Use String#include wherever possible. + +* In IE, allow opacity to be set on elements not yet attached to the document. Closes #9904. [Thomas Fuchs, dcpedit, Tobie Langel] + +* Avoid the try..catch block in Ajax.Response#_getResponseJSON unless required. [Tobie Langel] + +* Add more tests to Element.update. Closes #9327. [Tobie Langel] + +* Make the Ajax.Response#headerJSON property correctly decode unicode characters. Closes #9285. [Marius Feraru, Tobie Langel] + +* Make sure Event and Event.extend are defined before wrapping events and calling their handler. Prevents a known Firefox bug from throwing errors on page load/unload (cf.: https://bugzilla.mozilla.org/show_bug.cgi?id=361271). Closes #5393, #9421. [staaky, John Resig, sam, Tobie Langel] + +* Minor cosmetic changes to the display of unit tests in terminal. [Tobie Langel] + +* Make submitting forms work in Opera < 9.1. Closes #9917, #9463, #8260. [kangax] + +* Fix template evaluation with empty replacements. Closes #9692. [Ryan McGeary] + +* Hash#toTemplateReplacements is an alias for Hash#toObject so you can once again pass hashes to Template#evaluate and String#interpolate. [sam] + +* Fix Event#is(Left|Middle|Right)Click in IE. Closes #7520 (again). [Mislav Marohnić] + +*1.6.0_rc1* (October 16, 2007) + +* Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont] + +* Don't translate "keypress" events into "keydown" events. [sam] + Note: "keypress" is broken in Safari <= 2.x, but Event#stop has no effect on "keydown" events. + +* Changed Element#makeClipping to remember the original overflow value, even if it's a non-inline style. [Andrew Dupont] + +* Cross-browser Event#isLeftClick with the addition of is(Middle|Right)Click. Closes #7520. [Christophe Porteneuve, Richard Quadling, Mislav Marohnić] + +* Changed Selector to use the non-XPath approach for Safari 3 because of bugs in its version of document.evaluate. [Andrew Dupont] + +* Changed the Selector regex that tests whether the selector can be expressed in XPath; added :checked, since XPath can't detect all scenarios in which an <input> is checked. Fixes #9776. [StelardActek, kangax, Andrew Dupont] + +* Changed Selector pattern match so that descendant combinators after pseudoclass tokens are properly handled. Fixes #9696. [wiktor, kangax, Andrew Dupont] + +* Make sure $w always returns an array. [Andrew Dupont, Tobie Langel] + +* Add more tests to Hash. [Mislav Marohnić] + +* Performance enhancements to $A. Closes #9464. [Samuel Lebeau] + +* Make Function#argumentNames work with named functions. Closes #9826. [Samuel Lebeau] + +* Add Object.isHash. [Tobie Langel] + +* Performance improvements to String#times. [Martin Ström] + +* Make Ajax.Response#getHeaderJSON and Ajax.Response#getResponseJSON pseudo private instance methods. [Tobie Langel] + +* Make ObjectRange use the new Class.create syntax. [Mislav Marohnić] + +* Fix a failing ClassCreate test case in IE. [Tobie Langel] + +* Complete rewrite of the Hash class. + + !! BACKWARDS COMPATIBILITY CHANGE !! This new version of Hash is NOT backwards compatible with the former Hash class. + + Properties are now hidden away in an private store to prevent the risk of collision with Hash's instance and mixed-in methods. + This implies that properties of the hash can no longer be set, accessed or deleted directly: use the new Hash#get(key), Hash#set(key, value) and Hash#unset(key) instance methods instead. + + - Make $H(object) equivalent to new Hash(object). Both now return a new (cloned) instance of Hash in all circumstances. + - Make Hash#merge non-destructive. + + - Add Hash#update (a destructive version of Hash#merge). + - Add Hash#clone (returns a new, cloned instance of Hash). + - Add Hash#toObject (returns a clone of the contained object). + - Add Hash#get(key) (returns the value of the specified property). + - Add Hash#set(key, value) (sets the value of the given property. returns the value). + - Add Hash#unset(key) (deletes the specified property and returns its value). + - Add Hash.from as a alias to $H for consistency with Array.from. + - Add Object.toQueryString. + + - Deprecate Hash.toQueryString (use Object.toQueryString or the instance method Hash#toQueryString instead). + + - Remove Hash#remove (use Hash#unset instead). + - Remove Hash.toJSON (use Object.toJSON or the instance method Hash#toJSON instead). [sam, Tobie Langel] + +* Element#wrap now returns the wrapper instead of the element being wrapped. [sam] + +* Namespace all custom event names to avoid conflicts with native DOM events. [sam] + - All custom event names MUST include a namespace. Prefix custom event names for observe, stopObserving, and fire with the namespace followed by a colon. E.g. document.fire("widget:activated") + - The "contentloaded" event is now "dom:loaded". + - The Event.DOMEvents array is no longer present. If an event name does not include a namespace, the event is treated as a native event. + +* Clean up the new class API. [sam, Tobie Langel] + - Add Class#addMethods for adding instance methods to classes. + - Remove Class.extend and Class.mixin. + - Class.create now takes a variable number of arguments: if the first argument is a class, the newly created class inherits from that class; all other arguments are treated as successive calls to addMethods. + +* Fix contentloaded event initialization in IE. Closes #9457, #9488, #9707. [Mislav Marohnić] + +* Deprecate document.getElementsByClassName and Element#getElementsByClassName since native versions return a NodeList and we can only return an Array. Please use $$ or Element#select instead. [sam] + For more information see https://bugzilla.mozilla.org/show_bug.cgi?id=390411 + +* Fix missing "var" in selector.js. Closes #9761. [Tobie Langel] + +* Date#toJSON now returns times in UTC for better compatibility with json.js. Closes #9332. [Tobie Langel] + +* Ensure document._getElementsByXPath extends the elements it returns; fixes $$ not returning extended elements in Opera 9.2. Closes #8843. [jdalton] + +* Update Prototype.Browser.MobileSafari for iPod touch compatibility. [sam] + +* Add tests for Object.extend and Object.clone. [Tobie Langel] + +* Add a test for Form.Observer. [Christoph Sturm] + +* Make sure setting opacity works on elements that have "no layout" in IE. [Thomas Fuchs] + +* Simplify Class.create by establishing a prototype chain when subclassing. Closes #9342. [Ben Newman] + +* Fix Ajax.PeriodicalUpdater for compatibility with Ajax.Response. Closes #9321. [kampers] + +* Ensure that classes always have an initialize method. [Mislav Marohnić] + +* Update Template, Selector, Ajax.*, and ObjectRange classes to use the new class system. [Mislav Marohnić] + +* Change Abstract.TimedObserver to subclass PeriodicalExecuter and tweak its subclasses to use new inheritance functionality. TimedObserver can now be stopped the same way as PeriodicalExecuter. Closes #8589. [Mislav Marohnić] + +* Fix Class.mixin to extend the class's prototype. [Mislav Marohnić] + +* Fix superclass method call breakage from [7337]. [Mislav Marohnić, sam] + +* Change Class.extend to allow for superclass method resolution and remove Class.inherit. Closes #9274. [Samuel Lebeau] + +* Event handlers are now bound to the observed element, not the event's target element. [Dan Webb] + +* Define Node constants conditionally after checking for Node.ELEMENT_NODE presence. Add unit test to check the values of all constants. Closes #7625. [Mislav Marohnić] + +* Make sure Enumerable#include doesn't do type comparision. [Mislav Marohnić] + +* Add contextmenu to Event.DOMEvents. [Thomas Fuchs] + +*1.6.0_rc0* (August 15, 2007) + +* Fix readAttribute-related failure in form.html in IE. [sam, Andrew Dupont] + +* Fix failing dom.html and selector.html tests in IE. [Tobie Langel, Andrew Dupont] + +* Make sure the WebKit redefinition of Element#cumulativeOffset uses Element._returnOffset. Closes #9245. [mdaines] + +* Make sure Element#observe and Element#stopObserving are always chainable. [sam] + +* Event.fire/Element#fire now returns the newly-fired event instead of the event's target element. [sam] + +* Restrict Event.DOMEvents to include only events that can be supported in all browsers. [sam] + +* Fix a failing test in base.html in Safari 2. [Tobie Langel] + +* Fix Element#positionedOffset and Element#getOffsetParent for static elements on IE. [Thomas Fuchs] + +* Make sure event handlers and their wrappers are removed from the cache by Event.stopObserving. [sam, Severin Heiniger] + +* Add line numbers to failures when unit testing in Firefox. Closes #9231. [John Resig] + +* Fix Function#argumentNames for Opera and IE. [Thomas Fuchs] + +* Add Object.isString, Object.isNumber, and Object.isUndefined, and clean up the source to make use of Object.isXXX where possible. [sam] + +* Add the document.viewport object for querying dimensions and scroll offsets of the browser viewport. [Andrew Dupont, Thomas Fuchs, sam] + Example: + document.viewport.getDimensions() // { width: 1149, height: 923 } + document.viewport.getWidth() // 1149 + document.viewport.getHeight() // 923 + document.viewport.getScrollOffsets() // { left: 0, top: 1592 } + +* Add support for brackets in quoted attribute value selectors. Closes #9157. [Ken Snyder] + +* Add some missing semicolons to the source tree. Closes #9140. [jdalton] + +* Fix event extensions and custom events firing for Safari 2.0. [Thomas Fuchs] + +* Add RegExp.escape for escaping regular expression strings. Closes #9094. [Ken Snyder] + +* Make the eventName and handler arguments to Event.stopObserving optional. If no handler is specified, all handlers for the given event are unregistered. If no event name is specified, all observed events on the element are unregistered. [sam] + +* Add cross-support for the DOMContentLoaded event through a Prototype custom event on document called "contentloaded". The DOMContentLoaded event fires before window.load, when the entire HTML document, but not necessarily its images, stylesheets or other assets, has loaded. Based on [6596]. [sam, Mislav Marohnić] + Example: + document.observe("contentloaded", function() { + $$("a").invoke("identify"); // give all <a> tags an ID + }); + +* Add Event.fire and Element.Methods.fire for firing custom events. Prototype custom events piggyback on a real DOM event ("ondataavailable"), so they bubble and cancel. You can fire custom events from any element, or fire global events on the document object. Observe custom events just as you'd observe a regular DOM event. [sam, Seth Dillingham] + +* Extend the event object with methods from Event.Methods and normalize it in IE. [sam, Mislav Marohnić] + +* Remove support for observing the capturing phase of DOM events, since we can't support it in all browsers. [sam] + +* Add Ajax.Response object which supports the following methods: responseJSON, headerJSON, getHeader, getAllHeaders and handles browser discrepancies in the other response methods. Add sanitizeJSON, evalJS and evalJSON to Ajax.Request. Closes #8122, #8006, #7295. [Tobie Langel] + +* Add an isRunningFromRake property to unit tests. [Tobie Langel] + +* Add support for Opera browser in jstest.rb. [Tobie Langel] + +* Inheritance branch merged to trunk; robust inheritance support for Class.create. Closes #5459. [Dean Edwards, Alex Arnell, Andrew Dupont, Mislav Mahronic] + - To access a method's superclass method, add "$super" as the first argument. (The naming is significant.) Works like Function#wrap. + - Class.create now takes two optional arguments. The first is an existing class to subclass; the second is an object literal defining the instance properties/methods. Either can be omitted. Backwards-compatible with old Class.create. + - Added Class.extend for dynamically adding methods to existing classes (while preserving inheritance chain). Can also be used for mixins. + - The 'constructor' property of a class instance always points back to the proper class. Class objects themselves have two special properties: 'superclass' and 'subclasses' (which default to 'null' and '[]', respectively). Allows for powerful introspection. + - Added Object.isFunction [sam] + +* Add Function#argumentNames, which returns an ordered array of the function's named arguments. [sam] + +* Prevent a crash in Safari 1.3 on String#stripScripts and String#extractScripts. Closes #8332. [grant, Tobie Langel] + +* Add Prototype.Browser.MobileSafari which evaluates to true on the iPhone's browser. [sam] + +* Optimize Selector#match and Element#match for simple selectors. Closes #9082. [Andrew Dupont] + +* Remove the dependency on Element.ClassNames from Element#addClassName/removeClassName/toggleClassName, and deprecate Element.ClassNames. Closes #9073. [Tobie Langel] + +* Make Element#wrap accept a second argument for setting attributes on the wrapper. Allow wrapping elements which are not part of the document. Closes #9071. [Tobie Langel] + +* Improvements for Element#replace, Element#update and Element#insert. Closes #7429, #9060. [Tobie Langel] + - Element#replace/update/insert uses the argument's toElement or toHTML method if present (toElement has precedence if both are present). + - Element#replace and Element#update now also accept DOM elements. + - Element#replace better handles table-related elements in IE and Opera. + +* Add Object.isArray and Object.isElement (returns true if the object is a DOM node of type 1). [Tobie Langel] + +* Add Object.toHTML (uses the object's toHTML method if present or else passes the object to String.interpret). [Tobie Langel] + +* Make Element#setStyle accept a string argument of CSS rules. Deprecate uncamelized style property names when setting styles using an object (for performance reasons). Closes #9059. [Tobie Langel] + Examples: + $('id').setStyle('font-size: 12px; float: left; opacity: 0.5'); + $('id').setStyle({fontSize: '12px', cssFloat: 'left', opacity: 0.5}); + + !! BACKWARDS COMPATIBILITY CHANGE !! + + If you have code that looks like this: + $('id').setStyle({'font-size': '12px'}); + You need to replace it with either of the following: + $('id').setStyle({fontSize: '12px'}); + $('id').setStyle('font-size: 12px;'); + +* Add Element#identify, which returns the element's ID if it exists, or sets and returns a unique, auto-generated ID (of the form "anonymous_element_" + auto-incremented digit) otherwise. Use this when you need to ensure an element has an ID. Closes #9012. [Jeff Watkins, sam, Tobie Langel] + +* Make Element#readAttribute work for cloned elements in IE. Closes #8481. [chem, Tobie Langel] + +* Template enhancements. Closes #8166. [Christophe Porteneuve] + - Added String#interpolate as a shortcut for new Template(...).evaluate(...). + - If you pass String#interpolate or Template#evaluate an object with a toTemplateReplacements() method, the return value of that method will be used as the replacement object. + - You can now substitute properties of template replacement values in template strings, using dot or bracket notation (or both). Example: + "#{name.last}, #{name.first[0]}. (#{location})".interpolate({ + name: { first: "Christophe", last: "Porteneuve" }, location: "Paris" + }) // "Porteneuve, C. (Paris)" + +* Extended grep semantics. The first argument to Enumerable#grep is now a "filter" (an object with a match() method) so you can now e.g. filter an array of DOM nodes by CSS selector. RegExp#match is now an alias to RegExp#test, so grep can still be used to filter an array of strings with a regular expression. Closes #7596. [Christophe Porteneuve, sam] + +* Make String#scan explicitly return a string. This prevents possible issues with methods expecting input data that is typeof == 'string'. Closes #6350. [AndrewRev, Tobie Langel] + +* Add Array#intersect for set intersection. Returns a new array containing all items common to the array and the argument, with duplicates removed (clone of the Ruby & method). [Thomas Fuchs] + Example: + [1,1,3,5].intersect([1,2,3]) -> [1,3] + +* Rename Element#getElementsBySelector to Element#select and add alias for Element#getElementsBySelector. [Thomas Fuchs] + +* Add Element#adjacent as a shortcut to selecting all adjacent nodes (and their children) that match a CSS selector. [Thomas Fuchs] + +* Enhance the Enumerable and Array APIs to more closely match those of JavaScript 1.6 as implemented in Firefox 1.5. Closes #6650, #8409. [Mislav Marohnić, Sylvain Zimmer] + - Add Array#lastIndexOf, and change Array#indexOf not to overwrite the native method. + - Make Enumerable use Array.prototype.forEach instead of _each when possible (slight speed increase). + - Add "filter", "entries", "every", and "some" Array aliases. + - All Enumerable methods now have an additional parameter, "context", which, if present, specifies the object to which the iterators' "this" is bound. + - Function#bind and #curry now return the receiving function if the binding object is undefined. + +* Temporary workaround for Prototype.BrowserFeatures.SpecificElementExtensions incorrectly evaluating to true on iPhone. (needs further investigation) [sam] + +* The action for Form#request defaults to the current URL if the "action" attribute is empty. (This is what most of the major browsers do.) Fixes #8483. [Tomas, Mislav Marohnić] + +* In form serialization, change the way submit buttons are handled. Previously all submit buttons were serialized; now Prototype serializes only the first one. Change Form#serialize and Form.serializeElements to accept a params hash. With the "hash: false" option, a serialized string is returned instead of the hash data object. With the "submit: 'foo'" option, only the submit button with the name "foo" is serialized. References #5031. [Mislav Marohnić] + Examples: + $('form').serialize({ submit: 'delete' }) + $('form').serialize({ hash: false }) //-> equivalent to $('form').serialize() + +* Form#findFirstElement respects HTML tabindexes. Closes #7595. [Christophe Porteneuve] + +* Added Form.Element#setValue method for setting values on various form controls. Checkboxes and radio buttons respond to a boolean and multiple select boxes expect an array of values. Closes #5902. [Jonathan Viney, Mislav Marohnić] + Examples: + $('text_input').setValue('hello world!') + $('remember_me').setValue(true) + $('attend_classes').setValue(['cheese rolling', 'evil chemistry']) + +* Make document.getElementsByClassName match a subset of the WHATWG Web Applications 1.0 specification which was adopted in Firefox 3 (http://www.whatwg.org/specs/web-apps/current-work/#getelementsbyclassname). It now supports multiple class names given as a whitespace-separated list in a string. Array argument is not supported. The method will only return the nodes that match all the class names. In browsers that implement the method natively it will not be overwritten. Closes #8401. [Mislav Marohnić] + Example: + document.getElementsByClassName('foo bar') + +* Fix a Safari rendering issue when floating elements could temporarily disappear when opacity was set to 1. Closes #7063. References #3044, #3813, #6706. [Thomas Fuchs, davidjrice] + +* Prevent a crash in Safari when calling String#evalJSON(true) on very large strings. Add String#isJSON. Closes #7834. [Tobie Langel] + +* Prevent a crash in Safari 1.3 on String#stripScripts and String#extractScripts. Closes #8332. [grant, Tobie Langel] + +* Allow JSON data to contain line breaks. Closes #8271. [pijyster, Tobie Langel] + +* Add Hash.prototype.index which returns the first found property that has a specific value. Closes #8528. [Thomas Fuchs, slusarz, Mislav Marohnić] + Examples: + var hash = $H({a:1,b:'2'}); + hash.index(1) // -> 'a' + hash.index('1') // -> undefined + +* Ensure HTMLElement exists before creating Element.extend. [Tobie Langel] + +* Add Number.prototype.round/ceil/floor/abs as an aliases to the respective methods in Math. Refactor to seperate number extensions from base.js. [Thomas Fuchs] + +* Make Element#absolutize and Element#relativize properly use Element#getStyle. Closes #8580. [Christophe Porteneuve] + +* Test library fixes: make rake dist work on Windows, only teardown if a browser is supported. Closes #8463, #8498. [Mislav Marohnić, grant] + +* Change Element.insert syntax to allow multiple positions. [Thomas Fuchs] + Examples: + Element.insert('foo', {top:'bar', bottom:'baz'}); + $('foo').insert({after: new Element('p').update('bar')}); + Element.insert('foo', new Element('p').update('bar')); // defaults to bottom + Element.insert('foo', 'bar'); // defaults to bottom + +* String.prototype.truncate now explicitly converts its return value into a string if no truncation takes place. This prevents possible issues with methods expecting input data that is typeof == 'string'. [Thomas Fuchs, Tobie Langel, Sam Stephenson] + +* Event.findElement behaves as expected when the element passed matches the given selector. Closes #8395. [Mislav Marohnić, Tobie Langel] + +* Element.setOpacity now calls removeAttribute on the filter style on IE if no more filters remain, which makes Cleartype work properly. Closes #8376. [alexdemi, Thomas Fuchs] + +* Event.findElement now uses Element#up (and as a result can take a CSS selector instead of just a tag name). [Tobie Langel] + +* Minor cleanup of the position methods [sam] + +* Fix Element#clonePosition to call viewportOffset. Closes #8372. [graemenelson, Christophe Porteneuve] + +* Prevent an error being thrown by $$ when #id does not exist in $$("div #id"). Closes #8325. [Tobie Langel, ecke] + +* Make Prototype.ScriptFragment behave when including Prototype inline. [Christophe Porteneuve] + +* Deprecate Position (kept for backwards compatibility). Add Element#cumulativeOffset, Element#positionedOffset, Element#absolutize, Element#relativize, Element#cumulativeScrollOffset, Element#getOffsetParent, Element#viewportOffset and Element#clonePosition. [Christophe Porteneuve] + +* Make Element#update and Element#insert work for SELECT tags in IE and Opera. [Tobie Langel] + +* Make Element#insert and Element#update better handle TABLE related elements in IE and Opera. Closes #7776, #8040, #7550, #7776, #7938. [Tobie Langel] + +* Make Element#readAttribute('title') work in Opera. [Tobie Langel] + +* Make Element#replace work with form elements in Firefox and Safari. Closes #8010, #7989. [dsl239, Tobie Langel] + +* Add Element#wrap which wraps the element inside a new one. Closes #5732. [P. Vande, Tobie Langel] + +* Make Element into a constructor: new Element(tagName, attributes). Add Element#writeAttribute which accepts a hash of attributes or a name/value pair. Closes #7476. [Mislav Marohnić, haraldmartin, Tobie Langel] + +* Insertion overhaul: Add Element.insert(content[, position = 'bottom']). Deprecate Insertion (kept for backwards compatibility). Make Ajax.Updater option.insertion accept both Insertion.Top or the now preferred 'top'. Closes #7907. [Tobie Langel] + +* Refactor Element.extend and eliminate Element.extend.cache. [sam] + +* Add Function#curry, Function#delay, Function#defer, and Function#wrap. Closes #8134. [Andrew Dupont, Tobie Langel, sam] + +*1.5.1* (May 1, 2007) + +* Don't duplicate the event argument in Function#bindAsEventListener. Closes #6497. [wiktor] + +* Fix Selector :not-clause chaining. [Andrew Dupont] + +*1.5.1_rc4* (April 27, 2007) + +* Fix $F breakage from [6598]. [sam] + +* Set window.$continue to an Error with a helpful message for anyone who may still be using "throw $continue". [sam] + +* Fix jstest.rb IE support so you don't have to close the IE window after each test (yay!). Closes #8207. [Ryan Schuft] + +* Fix jstest.rb Konqueror support. Closes #7140. [Christophe Porteneuve] + +* Fix regression in which no-argument calls to Element.addMethods() would not add the methods defined in Form.Methods and Form.Element.Methods. Closes #8206. [Tobie Langel, fwittekind] + +* Fix Element#readAttribute to work with the 'type' attribute in IE. Closes #8160. [Tobie Langel, Wiktor Ihárosi] + +*1.5.1_rc3* (April 24, 2007) + +* Add Element#childElements as an alias for Element#immediateDescendants. [Tobie Langel] + +* Optimize DOM navigation methods (Element#up, Element#down, Element#previous, Element#next) for no-argument calls. Closes #7848. [haraldmartin, sam] + +* Add Element#firstDescendant to retrieve the first non-text child node of an element. [sam] + +* Element.addMethods should add methods to Element as well as Element.Methods. Closes #7888. [Andrew Dupont] + +* Add support for per-request onCreate callbacks to Ajax.Request. Closes #8011. [Andrew Dupont] + +* Don't call evalResponse() when an Ajax response has no Content-type header. Closes #7827. [Tobie Langel] + +* Automatically strip security delimiter comments from JSON strings before evaling them. The default delimiter is '/*-secure- ... */' or you can specify your own with the Prototype.JSONFilter regular expression. If you wrap your JSON response bodies in this delimiter on the server side, rogue external sites can't hijack potentially sensitive data via <script> tags. Closes #7910. [Tobie Langel] + For more details on potential security problems, see: http://www.fortifysoftware.com/servlet/downloads/public/JavaScript_Hijacking.pdf + +* Add extra spacing so Array#toJSON and Hash#toJSON generate YAML-loadable JSON. Closes #7883. [Andrew Dupont] + +* Fix Form.request for forms containing an input element with name="action". Closes #8063. [Thomas Fuchs, Mislav Marohnić] + +* Make Event.element extend the returned element. Closes #7870. [Thomas Fuchs] + +* Prevent a crash on Safari on String.prototype.stripScripts and extractScripts with large <script> tags. [Thomas Fuchs] + +* Prevent linefeed normalisation in String.prototype.escapeHTML and unescapeHTML on IE for consistency with other browsers. Speed optimizations for Safari and IE. [Thomas Fuchs] + +* Make Hash.toQueryString serialize undefined values. Ensure consistency with String.prototype.toQueryParams. Closes #7806. [Mislav Marohnić] + Examples: + $H({a:'b',c:undefined}).toQueryString() -> 'a=b&c' + $H({a:'b',c:null}).toQueryString() -> 'a=b&c=' + $H('a=b&c'.toQueryParams()).toQueryString() -> 'a=b&c' + $H('a=b&c='.toQueryParams()).toQueryString() -> 'a=b&c=' + +* Fix issues with Selector an+b logic, :not support, attribute selector double quotes, plus performance improvements. Closes #7873, #7901. [Andrew Dupont] + +* Fix Form.disable to work again on non-form elements. Closes #6887. [Mislav Marohnić] + +* Fix an issue with String.prototype.endsWith. Closes #7822. [altblue] + +*1.5.1_rc2* (March 12, 2007) + +* Add a tab character via innerHTML to the selector whitespace test. [Christophe Porteneuve] + +* Add an attribution to YUI-Ext's DomQuery in selector.js. + +* Make Element.extend work on IE for Nodes with the same ID that where discarded. Closes #7497. [Mislav Marohnić, Thomas Fuchs] + +* Make Selector correctly extend the first element it returns on IE. [Thomas Fuchs] + +* Prevent a crash in Safari when using $A() on NodeList objects that contain text nodes. [Thomas Fuchs] + +* Fix Element.Methods.descendants() to properly extend elements on IE. [Thomas Fuchs] + +*1.5.1_rc1* (March 9, 2007) + +* Fix readAttribute for IE7. [Andrew Dupont] + +*1.5.1_rc0* (March 8, 2007) + +* Merge the selector branch into trunk, bringing vast performance improvements, bug fixes, and near-complete CSS3 compliance to $$ and Selector. Closes #7568. [Andrew Dupont] + Selector speed test: http://andrewdupont.net/test/double-dollar/ + +* Add support for JSON encoding and decoding. Closes #7427. [Tobie Langel] + +* Fix double escaping of query parameters in Hash.prototype.toQueryString, and prevent Safari from iterating over shadowed properties when creating hashes. Closes #7421. [Tobie Langel, Mislav Marohnić] + +* Fix simulated attribute reading for IE for "href", "src" and boolean attributes. [Mislav Marohnić, Thomas Fuchs] + +* Form.Element.disable() will now call blur(), removed blur() call from Form.Element.enable(). Closes #6034. [tdd] + +* Optimize document.getElementsByClassName and finalize DOM performance optimization refactoring. Closes #6696. [Mislav Marohnić] + +* Fix an issue with serializing empty array inputs. Closes #7516. [stakadush, Mislav Marohnić] + +* Add optional third parameter "camelized" to Element.setStyle, for optimized performance if style names are known to be camelCased. [Thomas Fuchs] + +* Fix a bug in the simulated hasAttribute for IE due to getAttributeNode sometimes returning null. [sam] + +* Optimize Element.getStyle and add new Element.getOpacity method. Special case IE and Opera getStyle methods. Closes #7648. [Tobie Langel, Thomas Fuchs] + +* Optimize Element.setStyle and add new Element.setOpacity method, special case IE and Gecko opacity methods. Closes #7585. [savetheclocktower] + +* Add unified Browser detection by providing Prototype.Browser.(IE|Gecko|WebKit|Opera) booleans. Closes #6800. [savetheclocktower] + +* Add String.prototype.empty and String.prototype.blank (tests if empty or whitespace-only). Closes #7016. [Jonathan Viney, Thomas Fuchs] + +* Update README to reflect new URLs, update LICENSE copyright years. Closes #7426. [Tobie Langel] + +* Array.prototype.uniq optimization. Closes #7417. [Christophe Porteneuve] + +* String.prototype.endsWith should not fail on multiple occurrences. Closes #7416. [Christophe Porteneuve] + +* Add Form.Methods.request as a convenience method for serializing and submitting a form via Ajax.Request to the URL in the form's action attribute. [sam] + + Options passed to request() are intelligently merged with the underlying Ajax.Request options: + - If the form has a method attribute, its value is used for the Ajax.Request method option. If a method option is passed to request(), it takes precedence over the form's method attribute. If neither is specified, method defaults to "post". + - Key/value pairs specified in the parameters option (either as a query string or as a hash) will be merged with (and take precedence over) the serialized form parameters. + +* Fix $(form).serialize() in Safari and add support for extending specific tags to Element.addMethods. Closes #7358. [Andrew Dupont] + +* Add String.prototype.startsWith, String.prototype.endsWith, and String.prototype.include. Closes #7075. [Tobie Langel] + +* Improve performance of String.prototype.escapeHTML by using a cached div and text node. Closes #6937. [altblue] + +* Make setStyle() with opacity: 0 in Internet Explorer work correctly. [Thomas Fuchs] + +* Form.Element.activate shouldn't raise an exception when the form or field is hidden. [sam] + +* Remove support for "throw $continue" in Enumerable. Use "return" instead. [sam] + +* Update HEADER to reflect new URL. [sam] + +*1.5.0* (January 18, 2007) + +* Add test to ensure Content-type header is set for simulated verbs. [sam] + +* Fix Content-Type header for HTTP methods simulated with POST not defaulting to application/x-www-form-urlencoded. [Thomas Fuchs] + +* Simplify form serialization and add support for fields with the same name as Hash methods. Closes #6649. [Mislav Marohnić] + +* Fix attribute selectors for IE. Closes #5170. [Tobie Langel, Andrew Dupont] + +* A slew of dom.js improvements. Closes #4217, #6589, #7001. [Tobie] + - Fix Element.getDimensions() for hidden elements, make Element.getHeight() use .getDimensions() + - Add Element.getWidth() + - Make Element.replace() call .toString() on the html argument (alike .update()) + - Fix an issue with Element.get/setStyle() and Safari with 'float' + - Add a bunch of missing unit tests + +* Fix an issue with Element.setStyle({opacity:''}) setting the opacity to 0 instead of removing the set inline opacity style. [Thomas Fuchs] + +* Ensure Ajax.Request's evalResponse is called before onComplete so that onComplete can reference any elements created during the response. Closes #6727. [jonathan] + +* Ensure the WEBrick test runner sets the correct Content-Type for tests and fixtures. [sam] + +* Form.serialize once again works with non-form elements. This is a temporary change to prevent the Rails link_to_remote regression described in #6898. Prototype 1.5.1 will introduce an API for working with collections of arbitrary form elements. References #6887. Closes #6898. [sam] + +* Make selectors match forms that have an element with name="id" correctly, fixes #5759 [mislav] + +* Remove support for HTTP authorization in Ajax calls introduced with #6366. Closes #6638 [jmecham] + +* Add Enumerable.size() to count elements in an enumerable and the corresponding Array.size() method, fixes #6710 [ZenCocoon] + +* Add String.succ() method to allow for String ranges, fixes #6037 [Cory Hudson, mislav] + Examples: + 'abcd'.succ(); -> 'abce' + $R('a','d').map(function(char){ return char; }); -> ['a','b','c','d'] + +* Make Element.scrollTo() correctly consider offsets of parent DOM nodes, fixes #6625 [ohader, savetheclocktower] + +* Fix Enumerable.inGroupsOf() to correctly work with fill values that evaluate to false, fixes #6782 [hawk] + +* Remove/cleanup redundant $() calls in dom.js, fixes #6817 [Tobie] + +* Don't cache files in automatic unit tests, fixes #6218 [voidlock] + +* Add $w() to easily create arrays from strings like Ruby's %w, fixes #5682 [glazedginger, brendon.aaron] + +* Add Element.toggleClassName() to toggle CSS classes on elements, fixes #6759 [Tobie] + +* Make Form.getInputs always return an array for consistency, fixes #6475 [Justin Gehtland, savetheclocktower] + +* Make TimedObserver work correctly for SELECT MULTIPLE elements, fixes #6593 [clemos, tdd] + +* Fix Template.prototype.evaluate to correctly interpret 0 and false values, add String.interpret() for safely interpreting and converting values to strings, fixes #6675 [hawk] + +* Make Element.getStyle() work with camelCased argument, fixes #6686 [Tobie] + +* Fix a redundant check in Array.prototype.compact, fixes #4739 [wlodarcz, mislav] + +* Fix $() to correctly pass back the results of document.getElementById(), notably returning "null" on elements not found, fixes #6582 [adsmart] + +* Change/add assertNull, assertUndefined, assertNullOrUndefined and not-* variants in unittest.js, fixes #6582 [adsmart] + +* Cleanup String.prototype.camelize, fix an issue with String.prototype.underscore, fixes #4714, #6685 [Tobie, Thomas Fuchs] + +* Add String.prototype.capitalize, which returns a string with the first character in upper case, fixes #6666 [Tobie] + +* Make Element.getStyle() and Element.setStyle() handle the CSS 'opacity' property transparently in IE, fixes #6093 [brandon.aaron, Tobie] + +* Fix handling of CSS 'float' property for Element.getStyle() and Element.setStyle(), fixes #4160 [Thomas Fuchs, ericf] + +* Fix that onComplete would be called twice with synchronous Ajax requests on Safari (provides units tests for #5756) [Thomas Fuchs] + +* Fix Form.Field.activate to not select text on buttons in IE, fixes #2653 [sutch, mislav, Thomas Fuchs] + +* Fix String.unescapeHTML() on Firefox for strings that are longer than 2048 bytes, fixes #5789 [Paul Moers, Thomas Fuchs] + +* Redefine Array.prototype.concat for Opera, as the native implemenation doesn't work correctly [Thomas Fuchs] + +* Add unit tests for Function.prototype.bind() [Thomas Fuchs] + +* Add String.prototype.underscore and String.prototype.dasherize [Thomas Fuchs] + Examples: + 'Hello_World'.dasherize() -> 'Hello-World' + 'borderBottomWidth'.underscore() -> 'border_bottom_width' + 'borderBottomWidth'.underscore().dasherize() -> 'border-bottom-width' + +*1.5.0_rc2* (November 11, 2006) + +* Ensure that existing DOM properties take precedence over extended element methods in all browsers. Closes #5115. [Sean Kleinjung, sam] + +* Add Element.Methods.readAttribute as a simple wrapper around getAttribute (which isn't a "real" function and doesn't have .apply or .call in Safari and IE). Useful in conjunction with Enumerable.invoke for extracting the values of a custom attribute from a collection of elements. [sam] + Example: + <div id="widgets"> + <div class="widget" widget_id="7">...</div> + <div class="widget" widget_id="8">...</div> + <div class="widget" widget_id="9">...</div> + </div> + + $$('div.widget').invoke('readAttribute', 'widget_id') + // ["7", "8", "9"] + +* Add Element.Methods.immediateDescendants, like $A($(element).childNodes) but without text nodes. [sam] + +* More consistency. Closes #6573. [Bob Silva] + +* String.prototype.toQueryParams and Hash.prototype.toQueryString now properly serialize arrays as multiple values. Closes #4436. [mislav, altblue, L`OcuS] + +* Fix Form.serialize for options with empty values. Closes #5033. [tdd, Thomas Fuchs, sam] + +* Add Element.Methods.Simulated for simulating HTMLElement methods in lesser browsers. Add hasAttribute as the first simulated method. [tdd, Thomas Fuchs, sam] + +* Add a "retry with throw" button for test error messages. [sam] + +* rake test now runs test/unit/*.html by default. Additionally, you can specify individual tests to run with the TESTS environment variable, and you can restrict the tests to particular browsers using the BROWSERS environment variable. [sam] + + Examples: + % BROWSERS=safari,firefox rake test + % TESTS=dom rake test + +* Element.hasClassName now bypasses the Element.ClassNames API for performance. [sam] + +* Pick some low-hanging performance and DRYness fruit. [sam] + - Inline length property accesses in for loops + - Enumerable-ize for loops where it makes sense + - Make better use of Element.Methods and Form.Methods/Form.Element.Methods + +* A slew of Ajax improvements. Closes #6366. [mislav, sam] + + Public-facing changes include: + - HTTP method can be specified in either lowercase or uppercase, and uppercase is always used when opening the XHR connection + - Added 'encoding' option (for POST) with a default of 'UTF-8' + - Ajax.Request now recognizes all the JavaScript MIME types we're aware of + - PUT body support with the 'postBody' option + - HTTP authentication support with the 'username' and 'password' options + - Query parameters can be passed as a string or as a hash + - Fixed both String.toQueryParams and Hash.toQueryString when handling empty values + - Request headers can now be specified as a hash with the 'requestHeaders' option + +* Improve performance of the common case where $ is called with a single argument. Closes #6347. [sam, rvermillion, mislav] + +* Fix Object.inspect to correctly distinguish between null and undefined, fixes #5941 [tdd, mislav] + +* Don't serialize disabled form elements, fixes #4586 [tdd] + +* Make HTML element classes extension mechanism for Safari not throw errors on WebKit beta versions [Thomas Fuchs] + +* Add support for using Element.update() with no or a non-string parameter [Thomas Fuchs] + + Example: + $('empty_me').update() -> clears the element + $('easy_as').update(123) -> set element content to '123' + +* Add unit tests for hashes, fixes #6344 [Tobie Langel] + +* Add clone() method to arrays, fixes #6338 [Tobie Langel] + +* Backing out of [5194] (Element.clear) because of issues with IE on certain elements, #6051 + +* Add Element.clear for easily emptying out elements, fixes #6051 [bra...@gm...] + +* Enumerable.each now returns the enumerable to allow for method chaining, fixes #6250 [eventualbuddha] + +* Make makeClipping and undoClipping always return their element to stay chainable + +* Fix an issue with certain Element chain calls not correctly extending elements with Prototype element methods on IE [Thomas Fuchs] + +* Add Enumerable.eachSlice and Enumerable.inGroupsOf, fixes #6046 [ra...@td..., Thomas Fuchs] + + Example: + [1,2,3,4,5].inGroupsOf(3) -> [[1,2,3],[4,5,null]] + [1,2,3].inGroupsOf(4,'x') -> [[1,2,3,'x']] + +* Complete unit tests for array.js and string.js [Thomas Fuchs] + +* Performance improvements for document.getElementsByClassName, including querying with XPath in supported browsers. [Andrew Dupont] + +* Make Form.getElements() return elements in the correct order, fix broken Form.serialize return, fixes #4249, #6172 [la...@pi..., Thomas Fuchs, john] + +* Add various DOM unit tests, fixes #6176, #6177 [tdd] + +* Split Form.serialize into Form.serialize and Form.serializeElements. The latter can be used stand-alone to serialize an array of elements you pass in, instead of the entire form [DHH] + +* Form.Element.disable() and .enable() will now work correctly, fixes #6034 [dre...@bu...] + +* Fix IE and Safari issues with Position.positionedOffset, add position.html unit tests, fixes #5621 [re...@ia...] + +* Fix an issue with Element.undoClipping and IE [Thomas Fuchs] + +* Element.cleanWhitespace now correctly removes consecutive empty text nodes, fixes #3209 [liv...@gm...] + +* Element.extend now does not try to extend text nodes, fixes #4642 [sie...@gm...] + +*1.5.0_rc1* (September 4, 2006) + +* bindAsEventListener now passes along any provided arguments after the event argument. Closes #5508. [tod...@re...] + +* Fix makeClipping and undoClipping with local overflow style values other than visible and hidden, fixes #3672 [Thomas Fuchs] + +* Add Element.up, Element.down, Element.previous, and Element.next for easily traversing the DOM. (Inspired by Thomas Fuchs' original implementation of Element.up: http://pastie.caboo.se/7702) [sam] + + Examples: + <div id="sidebar"> -> $('nav').up() or $('menu').up('div') + <ul id="nav"> -> $('sidebar').down() or $('sidebar').down('ul') or $('menu').previous() + <li>...</li> -> $('sidebar').down(1) or $('sidebar').down('li') + <li>...</li> -> $('sidebar').down(2) or $('sidebar').down('li', 2) or $('sidebar').down('li').next('li') + <li class="selected">...</li> -> $('sidebar').down('li.selected') + </ul> + <ul id="menu"> -> $('sidebar').down('ul').next() + ... + +* Refactor $$ and Element.getElementsBySelector into Selector.findChildElements. [sam] + +* Add Element.match, which takes a single CSS selector expression and returns true if it matches the element. [sam] + +* Add Element.ancestors, Element.descendants, Element.previousSiblings, Element.nextSiblings, and Element.siblings. [sam] + +* Add Element.inspect for better DOM debugging. [sam] + +* Add an optional boolean argument to String.prototype.inspect which, when true, makes the string double-quoted instead of single-quoted. [sam] + +* Add the uniq() method to Arrays, which returns a new Array with duplicates removed, fixes #3810 [secondlife] + +* Add stop() method to PeriodicalExecutor, fixes #4801 [Jon Evans] + +* Fix issues with Enumerable.any, ObjectRange.toArray, added unit tests, fixes #4419 [miyamuko, Thomas Fuchs] + +* Fix two instances of unneccesarily redeclared variables, fixes #5229 [Thomas Fuchs] + +* Fix a loop in Element.extend to properly use local variable, fixes #5128 [arrix] + +* Add constants for additional keys in Event, fixes #5411, #5795 [simone_b] + +* Workaround a DOM API bug in Opera in Position.page(), fixes #2407, #5848 [Thomas Fuchs] + +* Remove duplicate definition of Position.clone(), fixes #3765 [Thomas Fuchs] + +* Make destructive Element, Form, and Form.Element methods return their first argument, so that multiple calls can be chained together. [sam] + + ex. $("sidebar").addClassName("selected").show(); + + The following methods now return their first argument: Element.toggle, Element.hide, Element.show, Element.remove, Element.update, Element.replace, Element.addClassName, Element.removeClassName, Element.observe, Element.stopObserving, Element.cleanWhitespace, Element.scrollTo, Element.setStyle, Element.makePositioned, Element.undoPositioned, Element.makeClipping, Element.undoClipping, Form.reset, Form.disable, Form.enable, Form.focusFirstElement, Form.Element.focus, Form.Element.select, Form.Element.clear, Form.Element.activate, Form.Element.disable, Form.Element.enable. + +* For consistency, Element.toggle, Element.show, Element.hide, Field.clear, and Field.present no longer take an arbitrary number of arguments. [sam] + + !! BACKWARDS COMPATIBILITY CHANGE !! + + If you have code that looks like this: + Element.show('page', 'sidebar', 'content'); + You need to replace it with code like this: + ['page', 'sidebar', 'content'].each(Element.show); + +* Mix in Form and Form.Element methods to forms and form field elements with $() and $$(). Closes #4448. [Dan Webb, sam] + +* Add Object.clone [sam] + +* Add Form.Element.disable and Form.Element.enable. Closes #4943. [ja...@pr...] + +* Field is now simply an alias for Form.Element. [sam] + +* Add Element.Methods.getElementsByClassName and Element.Methods.getElementsBySelector. Closes #4669. [Andrew Dupont, DHH, sam] + +* Avoid race condition when stopping an Ajax.PeriodicalUpdater. Closes #4809. [e98...@gm...] + +* Improve support for synchronous requests. Closes #5916. [sam, jt...@gm...] + +* Add serialization and observation support for input type=search. Closes #4096. [rpn...@gm...] + +* Properly decode query components in String.prototype.toQueryParams. Closes #3487. [sam] + +* Add Array.prototype.reduce [sam]: + [1, 2].reduce() // [1, 2] + [1].reduce() // 1 + [].reduce() // undefined + +* Add Object.keys and Object.values [sam] + +* Simulate non-GET/POST requests by POSTing with a _method parameter set to the actual verb [DHH] + +* Make Element.update() handle TABLE-related elements with the DOM API because of IE's missing .innerHTML property on them [Thomas Fuchs, thx to Rick Olson] + +* Sync to script.aculo.us unittest.js library as of 2006/08/29 [Thomas Fuchs] + +* Add additional unit tests to test/unit/dom.html for testing Element.update and $().update in various enviroments [Thomas Fuchs] + +* Prevent possible exceptions on unloading the page in IE [Thomas Fuchs] + +*1.5.0_rc0* (April 5, 2006) + +* Modify HTMLElement.prototype and short-circuit Element.extend where possible. Closes #4477. [Thomas Fuchs] + +* Only observe window.onunload in IE for Mozilla bfcache support. Closes #3726. [Mike A. Owens] + +* Don't redefine Array.prototype.shift. Closes #4138. [leeo] + +* Prevent redefining Array.prototype.reverse more than once. Closes #3951. [bre...@gm...] + +* Fix Enumerable.min/Enumerable.max to recognize the value 0. Closes #3847, #4190. [rub...@br..., Martin Bialasinski] + +* Change Ajax.getTransport to prefer XMLHttpRequest in anticipation of IE 7. Closes #3688. [js...@ma..., sam] + +* Make Array.prototype.flatten more robust. Closes #3453. [Martin Bialasinski, sam] + +* Fix evalScripts from crashing Firefox if script includes 'var'. Closes #3288, #4165. [ra...@nt..., sam] + +* Scope iterators locally. Closes #4589. [sam] + +* Support Insertion.Before/Insertion.After for <tr> elements in IE. Closes #3925. [rai...@sn...] + +* Add a contentType option for overriding application/x-www-form-urlencoded in Ajax.Request. Closes #3564. [av...@ar..., sam] + +* Surround values in the X-JSON header in parenthesis for better compatibility with Firefox. Closes #4118. [big...@gm...] + +* Fix Form.serialize to properly encode option values in multiple selects in IE. Closes #3291. [rub...@br...] + +* Cache methods added to DOM elements with Element.extend to prevent memory leaks in IE. Closes #4465. [ja...@la..., sam] + +* 1.5.0_pre1* (March 26, 2006) + +* Add attribute selector support for Selector (and $$). Closes #4368. [dev...@gm...] + Example: + $$('form#foo input[type=text]').each(function(input) { + input.setStyle({color: 'red'}); + }); + +* Send Accept header containing 'text/javascript, text/html, application/xml, text/xml */*'' to inform Rails that we prefer RJS, but we'll take HTML or XML or whatever if you can't deliver the goods [DHH] + +* Make $$ work in IE. Closes #3715. [rub...@br...] + +* Add test/browser.html, which provides a simple object browser for the Prototype source (Firefox/Safari only). [sam] + +* Add Element.extend, which mixes Element methods into a single HTML element. This means you can now write $('foo').show() instead of Element.show('foo'). $, $$ and document.getElementsByClassName automatically call Element.extend on any returned elements. [sam] + +* Add Element.replace as a cross-browser implementation of the "outerHTML" property. References #3246. [to...@cr...] + +* Fix Enumerable.zip iterator behavior. [Marcin Kaszynski, sam] + +*1.5.0_pre0* (January 18, 2006) + +* Add String.prototype.truncate to complement the Action View truncate helper. [sam] + +* Add String.prototype.gsub, String.prototype.sub, and String.prototype.scan, all of which take a pattern and an iterator (or a pattern and a replacement template string in the case of gsub and sub). [sam] + +* Add a Template class for interpolating named keys from an object in a string. [sam] + +* Add the $$ function for finding DOM elements by simple CSS selector strings. [sam] + Example: Find all <img> elements inside <p> elements with class "summary", all inside + the <div> with id "page". Hide each matched <img> tag. + $$('div#page p.summary img').each(Element.hide) + +* Add a Selector class for matching elements by single CSS selector tokens. [sam] + +* Add Test.Unit.Assertions.assertEnumEqual for comparing Enumerables in tests. [sam] + +* Add Element.childOf(element, ancestor) which returns true when element is a child of ancestor. [sam] + +* Fix escaping in String.prototype.inspect. [sam] + +* Add String.prototype.strip to remove leading and trailing whitespace from a string. [sam] + +* Move Prototype to Rails SVN. [sam] + http://dev.rubyonrails.org/svn/rails/spinoffs/prototype/ + +* Make the console nicer. [sam] + +* Prune the source tree. [sam] Added: trunk/linpha2/lib/js/prototype-1.6.0/LICENSE =================================================================== --- trunk/linpha2/lib/js/prototype-1.6.0/LICENSE (rev 0) +++ trunk/linpha2/lib/js/prototype-1.6.0/LICENSE 2007-11-18 22:29:28 UTC (rev 4800) @@ -0,0 +1,16 @@ +Copyright (c) 2005-2007 Sam Stephenson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. Added: trunk/linpha2/lib/js/prototype-1.6.0/README =================================================================== --- trunk/linpha2/lib/js/prototype-1.6.0/README (rev 0) +++ trunk/linpha2/lib/js/prototype-1.6.0/README 2007-11-18 22:29:28 UTC (rev 4800) @@ -0,0 +1,55 @@ += Prototype +==== An object-oriented JavaScript framework + +Prototype is a JavaScript framework that aims to ease development of dynamic +web applications. It offers a familiar class-style OO framework, extensive +Ajax support, higher-order programming constructs, and easy DOM manipulation. + +=== Targeted platforms + +Prototype currently targets the following platforms: + +* Microsoft Internet Explorer for Windows, version 6.0 and higher +* Mozilla Firefox 1.0/Mozilla 1.7 and higher +* Apple Safari 1.2 and higher + +== Using Prototype + +To use Prototype in your application, download the latest release from the +Prototype web site (http://prototypejs.org/download) and copy +<tt>dist/prototype.js</tt> to a suitable location. Then include it in your HTML +like so: + + <script type="text/javascript" src="/path/to/prototype.js"></script> + +=== Building Prototype from source + +<tt>prototype.js</tt> is a composite file generated from many source files in +the <tt>src/</tt> directory. To build Prototype, you'll need: + +* a copy of the Prototype source tree, either from a distribution tarball or + from the Subversion repository (see below) +* Ruby 1.8.2 or higher (http://www.ruby-lang.org/) +* Rake -- Ruby Make (http://rake.rubyforge.org/) +* RDoc, if your Ruby distribution does not include it + +From the root Prototype directory, + +* <tt>rake dist</tt> will preprocess the Prototype source using ERB and + generate the composite <tt>dist/prototype.js</tt>. +* <tt>rake package</tt> will create a distribution tarball in the + <tt>pkg/</tt> directory. + +== Contributing to Prototype + +Check out the Prototype source with + $ svn co http://svn.rubyonrails.org/rails/spinoffs/prototype/trunk/ prototype + +Find out how to contribute: + http://prototypejs.org/contribute + +== Documentation + +Please see the online Prototype API: + http://prototypejs.org/api + Added: trunk/linpha2/lib/js/prototype-1.6.0/Rakefile =================================================================== --- trunk/linpha2/lib/js/prototype-1.6.0/Rakefile (rev 0) +++ trunk/linpha2/lib/js/prototype-1.6.0/Rakefile 2007-11-18 22:29:28 UTC (rev 4800) @@ -0,0 +1,59 @@ +require 'rake' +require 'rake/packagetask' + +PROTOTYPE_ROOT = File.expand_path(File.dirname(__FILE__)) +PROTOTYPE_SRC_DIR = File.join(PROTOTYPE_ROOT, 'src') +PROTOTYPE_DIST_DIR = File.join(PROTOTYPE_ROOT, 'dist') +PROTOTYPE_PKG_DIR = File.join(PROTOTYPE_ROOT, 'pkg') +PROTOTYPE_VERSION = '1.6.0' + +task :default => [:dist, :package, :clean_package_source] + +task :dist do + $:.unshift File.join(PROTOTYPE_ROOT, 'lib') + require 'protodoc' + + Dir.chdir(PROTOTYPE_SRC_DIR) do + File.open(File.join(PROTOTYPE_DIST_DIR, 'prototype.js'), 'w+') do |dist| + dist << Protodoc::Preprocessor.new('prototype.js') + end + end +end + +Rake::PackageTask.new('prototype', PROTOTYPE_VERSION) do |package| + package.need_tar_gz = true + package.package_dir = PROTOTYPE_PKG_DIR + package.package_files.include( + '[A-Z]*', + 'dist/prototype.js', + 'lib/**', + 'src/**', + 'test/**' + ) +end + +task :test => [:dist, :test_units] + +require 'test/lib/jstest' +desc "Runs all the JavaScript unit tests and collects the results" +JavaScriptTestTask.new(:test_units) do |t| + tests_to_run = ENV['TESTS'] && ENV['TESTS'].split(',') + browsers_to_test = ENV['BROWSERS'] && ENV['BROWSERS'].split(',') + + t.mount("/dist") + t.mount("/test") + + Dir["test/unit/*.html"].sort.each do |test_file| + test_file = "/#{test_file}" + test_name = test_file[/.*\/(.+?)\.html/, 1] + t.run(test_file) unless tests_to_run && !tests_to_run.include?(test_name) + end + + %w( safari firefox ie konqueror opera ).each do |browser| + t.browser(browser.to_sym) unless browsers_to_test && !browsers_to_test.include?(browser) + end +end + +task :clean_package_source do + rm_rf File.join(PROTOTYPE_PKG_DIR, "prototype-#{PROTOTYPE_VERSION}") +end Added: trunk/linpha2/lib/js/scriptaculous-js-1.8.0/CHANGELOG =================================================================== --- trunk/linpha2/lib/js/scriptaculous-js-1.8.0/CHANGELOG (rev 0) +++ trunk/linpha2/lib/js/scriptaculous-js-1.8.0/CHANGELOG 2007-11-18 22:29:28 UTC (rev 4800) @@ -0,0 +1,1147 @@ +*V1.8.0* (November 6, 2007) + +* Update to Prototype 1.6.0 final + +* Ajax.InPlaceEditor now can deal with callbacks that return an object. Closes #10064. [tdd] + +* Fix a potential problem with the loader and Firefox 2.0 on the Mac. Closes #9951. [awaters] + +* Add duration and distance options to Effect.Shake. Closes #8637. [amiel, rmm5t] + +* Update code to use new Hash implemention in Prototype 1.6. Update InPlaceEditor to use new Class.create syntax. [tdd] + +*V1.8.0 preview 0* (October 12, 2007) + +* Update to new Class.create syntax in Prototype 1.6; update to latest Prototype 1.6 trunk. + +* Fix bottom CSS property reassignment and initialization in queues for Effect#SlideUp. Closes #7412, #7761. + +* Fix an issue with String#parseStyle that could sometimes cause errors on Safari 2. + +* Refactoring to use Prototype 1.6. Remove dependency of Effect.tagifyText from builder. Use Prototype code style rules more consistently. + +* Remove the deprecated Effect2 namespace. + +* Update to Prototype 1.6.0_rc0. + +* Some effect code refactoring to take advantage of new Prototype 1.6 features. + +* Effect.ScrollTo is now no longer a core effect (returns a Effect.Tween instance now). + +* Add Effect.Tween, a new core effect. This effect tweens between two values and sets a property or calls a method on an object (including DOM elements); or allows for a ca... [truncated message content] |
From: <fan...@us...> - 2007-11-18 22:20:11
|
Revision: 4799 http://linpha.svn.sourceforge.net/linpha/?rev=4799&view=rev Author: fangehrn Date: 2007-11-18 14:20:05 -0800 (Sun, 18 Nov 2007) Log Message: ----------- 2007-11-18 flo * installer - some UI improvements - added sys_public_installation to sql.data.php and update it only in step10_postsettings.php like the other settings * integrity.php fixed bug and readded bypass for install check with install/ignore_delete_install_msg.txt * created global class for inline popups - updated scriptaculous (1.8.0) and prototype (1.6.0) * maps plugin - fixed some annoying IE bugs (edit marker not working, ajax data not working) - using inline popup for help window Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/docs/dev/external_libraries.txt trunk/linpha2/install/ignore_delete_install_msg.txt trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step11_finish.php trunk/linpha2/install/step3_dbtype.php trunk/linpha2/lib/include/integrity.php trunk/linpha2/lib/include/sql.data.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/builder.js trunk/linpha2/lib/js/controls.js trunk/linpha2/lib/js/dragdrop.js trunk/linpha2/lib/js/effects.js trunk/linpha2/lib/js/prototype.js trunk/linpha2/lib/js/scriptaculous.js trunk/linpha2/lib/js/slider.js trunk/linpha2/lib/js/unittest.js trunk/linpha2/lib/plugins/maps/LinMaps.js trunk/linpha2/lib/plugins/maps/class.googlemaps.js trunk/linpha2/lib/plugins/maps/module.maps.php trunk/linpha2/templates/default/maps.html.php trunk/linpha2/templates/default/themes/default/css/global.css Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/ChangeLog 2007-11-18 22:20:05 UTC (rev 4799) @@ -1,3 +1,16 @@ +2007-11-18 flo + * installer + - some UI improvements + - added sys_public_installation to sql.data.php and update it + only in step10_postsettings.php like the other settings + * integrity.php fixed bug and readded bypass for install check with + install/ignore_delete_install_msg.txt + * created global class for inline popups + - updated scriptaculous (1.8.0) and prototype (1.6.0) + * maps plugin + - fixed some annoying IE bugs (edit marker not working, ajax data not working) + - using inline popup for help window + 2007-11-10 bzrudi * bump exiftool to latest 7.00 stable release * fixed a couple of issues in installer and maintenance_import.php Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/docs/dev/TODO.txt 2007-11-18 22:20:05 UTC (rev 4799) @@ -24,7 +24,7 @@ - should enable browsers cache for the thumbnails and maybe also for the images -- fix error handler +- fix (adodb) error handler ## Big Todos Modified: trunk/linpha2/docs/dev/external_libraries.txt =================================================================== --- trunk/linpha2/docs/dev/external_libraries.txt 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/docs/dev/external_libraries.txt 2007-11-18 22:20:05 UTC (rev 4799) @@ -1,8 +1,8 @@ - csshover.htc V1.42.060206 -- scriptaculous 1.6.4 (contains prototype) -- prototype 1.5.0_rc1 +- scriptaculous 1.8.0 (contains prototype) +- prototype 1.6.0 - adodb Modified: trunk/linpha2/install/ignore_delete_install_msg.txt =================================================================== --- trunk/linpha2/install/ignore_delete_install_msg.txt 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/install/ignore_delete_install_msg.txt 2007-11-18 22:20:05 UTC (rev 4799) @@ -0,0 +1,2 @@ +If this file exists, the check for existing ./install directory is ignored. +This file must be remove in official releases. \ No newline at end of file Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/install/step10_postsettings.php 2007-11-18 22:20:05 UTC (rev 4799) @@ -85,10 +85,10 @@ ?> <div align="center"> <div class="box4"> - <input type='radio' name='sys_public_installation' value='1' checked=checked> - <?php echo i18n_install("<b>Internet</b>"); ?> - <input type='radio' name='sys_public_installation' value='0' > - <?php echo i18n_install("<b>Intranet</b>"); ?> + <input type='radio' id='linInputTypeInternet' name='sys_public_installation' value='1' checked=checked><label for="linInputTypeInternet"> + <?php echo i18n_install("<b>Internet</b>"); ?></label> + <input type='radio' id='linInputTypeIntranet' name='sys_public_installation' value='0' ><label for="linInputTypeIntranet"> + <?php echo i18n_install("<b>Intranet</b>"); ?></label> </div> </div> @@ -105,13 +105,13 @@ ?> <div align="center"> <div class="box2"> - <input type='radio' name='quality' value='1'>High Quality<br /> - <img src='./graphics/hqdemo.jpg' width="120" height="90" border="0""> + <input type='radio' id='linInputQualityHigh' name='quality' value='1'><label for="linInputQualityHigh">High Quality<br /> + <img src='./graphics/hqdemo.jpg' width="120" height="90" border="0""></label> </div> <div class="box2" style="float: none; "> - <input type='radio' name='quality' value='0' checked>Low Quality<br /> - <img src='./graphics/lqdemo.jpg' width="120" height="90" border="0""> + <input type='radio' id='linInputQualityLow' name='quality' value='0' checked><label for="linInputQualityLow">Low Quality<br /> + <img src='./graphics/lqdemo.jpg' width="120" height="90" border="0""></label> </div> </div> <?php @@ -126,21 +126,21 @@ <div align="center"> <div class="box3"> - <input type='radio' name='sys_style_tn_size' value='90'> + <input type='radio' id='linInputTNSize90' name='sys_style_tn_size' value='90'><label for="linInputTNSize90"> 90 pixel<br /> - <img src='./graphics/thumb90px.jpg' /> + <img src='./graphics/thumb90px.jpg' /></label> </div> <div class="box3"> - <input type='radio' name='sys_style_tn_size' value='120' checked="checked"> + <input type='radio' id='linInputTNSize120' name='sys_style_tn_size' value='120' checked="checked"><label for="linInputTNSize120"> 120 pixel<br /> - <img src='./graphics/thumb120px.jpg' /> + <img src='./graphics/thumb120px.jpg' /></label> </div> <div class="box3"> - <input type='radio' name='sys_style_tn_size' value='150'> + <input type='radio' id='linInputTNSize150' name='sys_style_tn_size' value='150'><label for="linInputTNSize150"> 150 pixel<br /> - <img src='./graphics/thumb150px.jpg'> + <img src='./graphics/thumb150px.jpg'></label> </div> </div> <br /> @@ -154,18 +154,18 @@ ?> <div align="center"> <div class="box4"> - <input type='radio' name='sys_import_use_exiftool' value='1'> + <input type='radio' id='linInputExifToolYes' name='sys_import_use_exiftool' value='1'><label for="linInputExifToolYes"> <?php echo i18n_install("Yes"); ?> - <input type='radio' name='sys_import_use_exiftool' value='0' checked=checked> + <input type='radio' id='linInputExifToolNo' name='sys_import_use_exiftool' value='0' checked=checked><label for="linInputExifToolNo"> <?php echo i18n_install("No"); ?> <?php echo i18n_install("Enable Exiftool"); ?> </div> <div class="box4"> - <input type='radio' name='sys_import_use_emb_thumb' value='1'> + <input type='radio' id='linInputEmbTNYes' name='sys_import_use_emb_thumb' value='1'><label for="linInputEmbTNYes"> <?php echo i18n_install("Yes"); ?> - <input type='radio' name='sys_import_use_emb_thumb' value='0' checked=checked> + <input type='radio' id='linInputEmbTNNo' name='sys_import_use_emb_thumb' value='0' checked=checked><label for="linInputEmbTNNo"> <?php echo i18n_install("No"); ?> <?php echo i18n_install("Extract Embedded Thumbnails"); ?> Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/install/step11_finish.php 2007-11-18 22:20:05 UTC (rev 4799) @@ -86,10 +86,9 @@ echo "<br />".i18n_install("Saving Install Type (Internet/Intranet) To Database...").' '; if( isset( $_POST['sys_public_installation'] ) ) { - $result = $linpha->db->Execute("INSERT INTO ".LIN_PREFIX."config " . - "(option_value, option_name) VALUES (" . - "'".LinSql::linAddslashes($_POST['sys_public_installation'])."', " . - "'".LinSql::linAddslashes('sys_public_installation')."')"); + $result = $linpha->db->Execute("UPDATE ".LIN_PREFIX."config " . + "SET option_value = '".LinSql::linAddslashes($_POST['sys_public_installation'])."' " . + "WHERE option_name = 'sys_public_installation'"); if(!$result) { echo failed_msg(); @@ -102,7 +101,7 @@ else { echo failed_msg(); - echo "<br />".i18n_install("Error - No Value Specified!"); + echo "<br />".i18n_install("Error: No Value Specified!"); $error_nr = 1; } @@ -115,20 +114,25 @@ $result = $linpha->db->Execute("UPDATE ".LIN_PREFIX."config " . "SET option_value = '".LinSql::linAddslashes($_POST['sys_style_tn_size'])."' " . "WHERE option_name = 'sys_style_thumb_size_max'"); - if(!$result) - { + if(!$result) { echo failed_msg(); + $error_nr = 1; } else { - $result = $linpha->db->Execute("UPDATE ".LIN_PREFIX."config " . + $result = $linpha->db->Execute("UPDATE ".LIN_PREFIX."config " . "SET option_value = '".LinSql::linAddslashes($_POST['sys_style_tn_size'])."' " . "WHERE option_name = 'sys_style_thumb_size_display'"); - echo success_msg(); + if(!$result) { + echo failed_msg(); + $error_nr = 1; + } else { + echo success_msg(); + } } } else { echo failed_msg(); - echo "<br />".i18n_install("Error - No Value Specified!"); + echo "<br />".i18n_install("Error: No Value Specified!"); $error_nr = 1; } Modified: trunk/linpha2/install/step3_dbtype.php =================================================================== --- trunk/linpha2/install/step3_dbtype.php 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/install/step3_dbtype.php 2007-11-18 22:20:05 UTC (rev 4799) @@ -125,11 +125,13 @@ <br /><br /> <h1><?php echo i18n_install("Select Installation Mode"); ?></h1><hr> -<input type='radio' name='install_mode' value='automatic' checked="checked"> -<?php echo i18n_install("Automatic mode"); ?> +<input type='radio' id='linInputModeAutomatic' name='install_mode' value='automatic' checked="checked"><?php +/* no linebreak between <input> and <label> tag */ ?><label for="linInputModeAutomatic"> +<?php echo i18n_install("Automatic mode"); ?></label> <br /> -<input type='radio' name='install_mode' value='manual'> -<?php echo i18n_install("Manual Mode (Experts Only)"); ?> +<input type='radio' id='linInputModeManual' name='install_mode' value='manual'><?php +/* no linebreak between <input> and <label> tag */ ?><label for="linInputModeManual"> +<?php echo i18n_install("Manual Mode (Experts Only)"); ?></label> <?php include_once(LINPHA_DIR.'/install/footer.php'); Modified: trunk/linpha2/lib/include/integrity.php =================================================================== --- trunk/linpha2/lib/include/integrity.php 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/lib/include/integrity.php 2007-11-18 22:20:05 UTC (rev 4799) @@ -29,46 +29,34 @@ /** * check folders */ - $folders = array("install", "album", "tmp", "cache"); - $install_type_public = $GLOBALS['linpha']->sql->config->value['sys_public_installation']; + /** + * Install directory check only on public installation + */ + $dir = LinSql::getPath('install'); + if( !file_exists($dir.'/ignore_delete_install_msg.txt') && file_exists($dir) && + $GLOBALS['linpha']->sql->config->value['sys_public_installation'] == true) + { + throw new Exception(i18n("For security reasons, the LinPHA ./install directory needs to be removed!")); + } - foreach($folders AS $directory) + $folders = array("album", "tmp", "cache"); + foreach($folders as $directory) { - $dir = LinSql::getPath($directory); - - /** - * Install directory check only on public installation - */ - if( $directory == "install" && file_exists($dir) && $install_type_public == true) - { - throw new Exception(i18n("For security reasons, the LinPHA $dir " . - "directory needs to be removed!")); - break; - } - else - { - break; - } + $dir = LinSql::getPath($directory); if( ! file_exists($dir) ) { - throw new Exception(i18n("Directory ".$dir." doesn't exist - " . - "Please make sure to create directory manually.")); - break; + throw new Exception( getErrorMsg(1,$dir)); } - if( ! is_writable($dir) && $directory != "album") + if( ! is_readable($dir) ) { - throw new Exception(i18n("Directory ".$dir." is not writable - " . - "Please change write permissions manually.")); - break; + throw new Exception( getErrorMsg(2,$dir)); } - - if( ! is_readable($dir) ) + + if( ! is_writable($dir) && $directory != "album") { - throw new Exception(i18n("Directory ".$dir." is not readable - " . - "Please change read permissions manually")); - break; + throw new Exception( getErrorMsg(3,$dir)); } } } @@ -77,5 +65,26 @@ die("Error: ".$error -> getMessage()); } +function getErrorMsg($type,$dir) { + switch($type) + { + case 1: + // Do not break strings inside i18n() function. + // Language translation would not work anymore! + return sprintf(i18n("Directory %s doesn't exist - Please make sure to create directory manually."),$dir); + break; + case 2: + // Do not break strings inside i18n() function. + // Language translation would not work anymore! + return sprintf(i18n("Directory %s is not readable - Please change read permissions manually"),$dir); + break; + case 3: + // Do not break strings inside i18n() function. + // Language translation would not work anymore! + return sprintf(i18n("Directory %s is not writable - Please change write permissions manually."),$dir); + break; + } +} + /* vi: set ts=4 sw=4 sts=4 */ -?> +?> \ No newline at end of file Modified: trunk/linpha2/lib/include/sql.data.php =================================================================== --- trunk/linpha2/lib/include/sql.data.php 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/lib/include/sql.data.php 2007-11-18 22:20:05 UTC (rev 4799) @@ -27,6 +27,7 @@ */ $options = array( 'sys_db_version' => '3', + 'sys_public_installation' => '1', 'sys_im_bracket_support' => $_SESSION['sys_im_bracket_support'], 'sys_im_imagemagick_path' => $_SESSION['sys_im_convert_path'], Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/lib/js/LinGlobal.js 2007-11-18 22:20:05 UTC (rev 4799) @@ -21,6 +21,8 @@ this.linPageYOffset = 0; this.tabs = new Array(); + + this.nofPopups = 0; }, /** @@ -231,7 +233,42 @@ //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! } /** Modified: trunk/linpha2/lib/js/builder.js =================================================================== --- trunk/linpha2/lib/js/builder.js 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/lib/js/builder.js 2007-11-18 22:20:05 UTC (rev 4799) @@ -1,8 +1,9 @@ -// script.aculo.us builder.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 +// script.aculo.us builder.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 -// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // -// See scriptaculous.js for full license. +// 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: { @@ -35,7 +36,7 @@ var element = parentElement.firstChild || null; // see if browser added wrapping tags - if(element && (element.tagName != elementName)) + if(element && (element.tagName.toUpperCase() != elementName)) element = element.getElementsByTagName(elementName)[0]; // fallback to createElement approach @@ -47,7 +48,8 @@ // attributes (or text) if(arguments[1]) if(this._isStringOrNumber(arguments[1]) || - (arguments[1] instanceof Array)) { + (arguments[1] instanceof Array) || + arguments[1].tagName) { this._children(element, arguments[1]); } else { var attrs = this._attributes(arguments[1]); @@ -63,9 +65,9 @@ for(attr in arguments[1]) element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; } - if(element.tagName != elementName) + if(element.tagName.toUpperCase() != elementName) element = parentElement.getElementsByTagName(elementName)[0]; - } + } } // text, or array of children @@ -77,14 +79,24 @@ _text: function(text) { return document.createTextNode(text); }, + + ATTR_MAP: { + 'className': 'class', + 'htmlFor': 'for' + }, + _attributes: function(attributes) { var attrs = []; for(attribute in attributes) - attrs.push((attribute=='className' ? 'class' : attribute) + - '="' + attributes[attribute].toString().escapeHTML() + '"'); + attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + + '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); return attrs.join(" "); }, _children: function(element, children) { + if(children.tagName) { + element.appendChild(children); + return; + } if(typeof children=='object') { // array can hold nodes and text children.flatten().each( function(e) { if(typeof e=='object') @@ -94,12 +106,17 @@ element.appendChild(Builder._text(e)); }); } else - if(Builder._isStringOrNumber(children)) - element.appendChild(Builder._text(children)); + if(Builder._isStringOrNumber(children)) + element.appendChild(Builder._text(children)); }, _isStringOrNumber: function(param) { return(typeof param=='string' || typeof param=='number'); }, + build: function(html) { + var element = this.node('div'); + $(element).update(html.strip()); + return element.down(); + }, dump: function(scope) { if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope @@ -116,4 +133,4 @@ } }); } -} \ No newline at end of file +} Modified: trunk/linpha2/lib/js/controls.js =================================================================== --- trunk/linpha2/lib/js/controls.js 2007-11-11 09:48:23 UTC (rev 4798) +++ trunk/linpha2/lib/js/controls.js 2007-11-18 22:20:05 UTC (rev 4799) @@ -1,14 +1,15 @@ -// script.aculo.us controls.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 +// script.aculo.us controls.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 -// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan) -// (c) 2005 Jon Tirsen (http://www.tirsen.com) +// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) // Contributors: // Richard Livsey // Rahul Bhargava // Rob Wills // -// See scriptaculous.js for full license. +// 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/ // Autocompleter.Base handles all the autocompletion functionality // that's independent of the data source for autocompletion. This @@ -38,22 +39,23 @@ if(typeof Effect == 'undefined') throw("controls.js requires including script.aculo.us' effects.js library"); -var Autocompleter = {} -Autocompleter.Base = function() {}; -Autocompleter.Base.prototype = { +var Autocompleter = { } +Autocompleter.Base = Class.create({ baseInitialize: function(element, update, options) { - this.element = $(element); + element = $(element) + this.element = element; this.update = $(update); this.hasFocus = false; this.changed = false; this.active = false; this.index = 0; this.entryCount = 0; + this.oldElementValue = this.element.value; if(this.setOptions) this.setOptions(options); else - this.options = options || {}; + this.options = options || { }; this.options.paramName = this.options.paramName || this.element.name; this.options.tokens = this.options.tokens || []; @@ -75,6 +77,9 @@ if(typeof(this.options.tokens) == 'string') this.options.tokens = new Array(this.options.tokens); + // Force carriage returns as token delimiters anyway + if (!this.options.tokens.include('\n')) + this.options.tokens.push('\n'); this.observer = null; @@ -82,15 +87,14 @@ Element.hide(this.update); - Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this)); - Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, 'keypress', this.onKeyPress.bindAsEventListener(this)); }, show: function() { if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); if(!this.iefix && - (navigator.appVersion.indexOf('MSIE')>0) && - (navigator.userAgent.indexOf('Opera')<0) && + (Prototype.Browser.IE) && (Element.getStyle(this.update, 'position')=='absolute')) { new Insertion.After(this.update, '<iframe id="' + this.update.id + '_iefix" '+ @@ -140,17 +144,17 @@ case Event.KEY_UP: this.markPrevious(); this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); + if(Prototype.Browser.WebKit) Event.stop(event); return; case Event.KEY_DOWN: this.markNext(); this.render(); - if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); + if(Prototype.Browser.WebKit) Event.stop(event); return; } else if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || - (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return; + (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; this.changed = true; this.hasFocus = true; @@ -196,7 +200,6 @@ this.index==i ? Element.addClassName(this.getEntry(i),"selected") : Element.removeClassName(this.getEntry(i),"selected"); - if(this.hasFocus) { this.show(); this.active = true; @@ -239,21 +242,22 @@ } var value = ''; if (this.options.select) { - var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; + var nodes = $(selectedElement).select('.' + this.options.select) || []; if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); } else value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); - var lastTokenPos = this.findLastToken(); - if (lastTokenPos != -1) { - var newValue = this.element.value.substr(0, lastTokenPos + 1); - var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); + var bounds = this.getTokenBounds(); + if (bounds[0] != -1) { + var newValue = this.element.value.substr(0, bounds[0]); + var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); if (whitespace) newValue += whitespace[0]; - this.element.value = newValue + value; + this.element.value = newValue + value + this.element.value.substr(bounds[1]); } else { this.element.value = value; } + this.oldElementValue = this.element.value; this.element.focus(); if (this.options.afterUpdateElement) @@ -264,11 +268,11 @@ if(!this.changed && this.hasFocus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); - Element.cleanWhitespace(this.update.firstChild); + Element.cleanWhitespace(this.update.down()); - if(this.update.firstChild && this.update.firstChild.childNodes) { + if(this.update.firstChild && this.update.down().childNodes) { this.entryCount = - this.update.firstChild.childNodes.length; + this.update.down().childNodes.length; for (var i = 0; i < this.entryCount; i++) { var entry = this.getEntry(i); entry.autocompleteIndex = i; @@ -297,39 +301,48 @@ onObserverEvent: function() { this.changed = false; + this.tokenBounds = null; if(this.getToken().length>=this.options.minChars) { - this.startIndicator(); this.getUpdatedChoices(); } else { this.active = false; this.hide(); } + this.oldElementValue = this.element.value; }, getToken: function() { - var tokenPos = this.findLastToken(); - if (tokenPos != -1) - var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,''); - else - var ret = this.element.value; - - return /\n/.test(ret) ? '' : ret; + var bounds = this.getTokenBounds(); + return this.element.value.substring(bounds[0], bounds[1]).strip(); }, - findLastToken: function() { - var lastTokenPos = -1; - - for (var i=0; i<this.options.tokens.length; i++) { - var thisTokenPos = this.element.value.lastIndexOf(this.options.tokens[i]); - if (thisTokenPos > lastTokenPos) - lastTokenPos = thisTokenPos; + getTokenBounds: function() { + if (null != this.tokenBounds) return this.tokenBounds; + var value = this.element.value; + if (value.strip().empty()) return [-1, 0]; + var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); + var offset = (diff == this.oldElementValue.length ? 1 : 0); + var prevTokenPos = -1, nextTokenPos = value.length; + var tp; + for (var index = 0, l = this.options.tokens.length; index < l; ++index) { + tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); + if (tp > prevTokenPos) prevTokenPos = tp; + tp = value.indexOf(this.options.tokens[index], diff + offset); + if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; } - return lastTokenPos; + return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); } -} +}); -Ajax.Autocompleter = Class.create(); -Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), { +Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { + var boundary = Math.min(newS.length, oldS.length); + for (var index = 0; index < boundary; ++index) + if (newS[index] != oldS[index]) + return index; + return boundary; +}; + +Ajax.Autocompleter = Class.create(Autocompleter.Base, { initialize: function(element, update, url, options) { this.baseInitialize(element, update, options); this.options.asynchronous = true; @@ -339,7 +352,9 @@ }, getUpdatedChoices: function() { - entry = encodeURIComponent(this.options.paramName) + '=' + + this.startIndicator(); + + var entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken()); this.options.parameters = this.options.callback ? @@ -347,14 +362,13 @@ if(this.options.defaultParams) this.options.parameters += '&' + this.options.defaultParams; - + new Ajax.Request(this.url, this.options); }, onComplete: function(request) { this.updateChoices(request.responseText); } - }); // The local array autocompleter. Used when you'd prefer to @@ -392,8 +406,7 @@ // In that case, the other options above will not apply unless // you support them. -Autocompleter.Local = Class.create(); -Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), { +Autocompleter.Local = Class.create(Autocompleter.Base, { initialize: function(element, update, array, options) { this.baseInitialize(element, update, options); this.options.array = array; @@ -449,13 +462,12 @@ ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } - }, options || {}); + }, options || { }); } }); -// AJAX in-place editor -// -// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor +// AJAX in-place editor and collection editor +// Full rewrite by Christophe Porteneuve <td...@td...> (April 2007). // Use this if you notice weird scrolling problems on some browsers, // the DOM might be a bit confused when this gets called so do this @@ -466,352 +478,472 @@ }, 1); } -Ajax.InPlaceEditor = Class.create(); -Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99"; -Ajax.InPlaceEditor.prototype = { +Ajax.InPlaceEditor = Class.create({ initialize: function(element, url, options) { this.url = url; - this.element = $(element); - - this.options = Object.extend({ - okButton: true, - okText: "ok", - cancelLink: true, - cancelText: "cancel", - savingText: "Saving...", - clickToEditText: "Click to edit", - okText: "ok", - rows: 1, - onComplete: function(transport, element) { - new Effect.Highlight(element, {startcolor: this.options.highlightcolor}); - }, - onFailure: function(transport) { - alert("Error communicating with the server: " + transport.responseText.stripTags()); - }, - callback: function(form) { - return Form.serialize(form); - }, - handleLineBreaks: true, - loadingText: 'Loading...', - savingClassName: 'inplaceeditor-saving', - loadingClassName: 'inplaceeditor-loading', - formClassName: 'inplaceeditor-form', - highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor, - highlightendcolor: "#FFFFFF", - externalControl: null, - submitOnBlur: false, - ajaxOptions: {}, - evalScripts: false - }, options || {}); - - if(!this.options.formId && this.element.id) { - this.options.formId = this.element.id + "-inplaceeditor"; - if ($(this.options.formId)) { - // there's already a form with that name, don't specify an id - this.options.formId = null; - } + this.element = element = $(element); + this.prepareOptions(); + this._controls = { }; + arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! + Object.extend(this.options, options || { }); + if (!this.options.formId && this.element.id) { + this.options.formId = this.element.id + '-inplaceeditor'; + if ($(this.options.formId)) + this.options.formId = ''; } - - if (this.options.externalControl) { + if (this.options.externalControl) this.options.externalControl = $(this.options.externalControl); - } - - this.originalBackground = Element.getStyle(this.element, 'background-color'); - if (!this.originalBackground) { - this.originalBackground = "transparent"; - } - + if (!this.options.externalControl) + this.options.externalControlOnly = false; + this._originalBackground = this.element.getStyle('background-color') || 'transparent'; this.element.title = this.options.clickToEditText; - - this.onclickListener = this.enterEditMode.bindAsEventListener(this); - this.mouseoverListener = this.enterHover.bindAsEventListener(this); - this.mouseoutListener = this.leaveHover.bindAsEventListener(this); - Event.observe(this.element, 'click', this.onclickListener); - Event.observe(this.element, 'mouseover', this.mouseoverListener); - Event.observe(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.observe(this.options.externalControl, 'click', this.onclickListener); - Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener); - } + this._boundCancelHandler = this.handleFormCancellation.bind(this); + this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); + this._boundFailureHandler = this.handleAJAXFailure.bind(this); + this._boundSubmitHandler = this.handleFormSubmission.bind(this); + this._boundWrapperHandler = this.wrapUp.bind(this); + this.registerListeners(); }, - enterEditMode: function(evt) { - if (this.saving) return; - if (this.editing) return; - this.editing = true; - this.onEnterEditMode(); - if (this.options.externalControl) { - Element.hide(this.options.externalControl); - } - Element.hide(this.element); - this.createForm(); - this.element.parentNode.insertBefore(this.form, this.element); - if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField); - // stop the event to avoid a page refresh in Safari - if (evt) { - Event.stop(evt); - } - return false; + checkForEscapeOrReturn: function(e) { + if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; + if (Event.KEY_ESC == e.keyCode) + this.handleFormCancellation(e); + else if (Event.KEY_RETURN == e.keyCode) + this.handleFormSubmission(e); }, - createForm: function() { - this.form = document.createElement("form"); - this.form.id = this.options.formId; - Element.addClassName(this.form, this.options.formClassName) - this.form.onsubmit = this.onSubmit.bind(this); - - this.createEditField(); - - if (this.options.textarea) { - var br = document.createElement("br"); - this.form.appendChild(br); + createControl: function(mode, handler, extraClasses) { + var control = this.options[mode + 'Control']; + var text = this.options[mode + 'Text']; + if ('button' == control) { + var btn = document.createElement('input'); + btn.type = 'submit'; + btn.value = text; + btn.className = 'editor_' + mode + '_button'; + if ('cancel' == mode) + btn.onclick = this._boundCancelHandler; + this._form.appendChild(btn); + this._controls[mode] = btn; + } else if ('link' == control) { + var link = document.createElement('a'); + link.href = '#'; + link.appendChild(document.createTextNode(text)); + link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; + link.className = 'editor_' + mode + '_link'; + if (extraClasses) + link.className += ' ' + extraClasses; + this._form.appendChild(link); + this._controls[mode] = link; } - - if (this.options.okButton) { - okButton = document.createElement("input"); - okButton.type = "submit"; - okButton.value = this.options.okText; - okButton.className = 'editor_ok_button'; - this.form.appendChild(okButton); - } - - if (this.options.cancelLink) { - cancelLink = document.createElement("a"); - cancelLink.href = "#"; - cancelLink.appendChild(document.createTextNode(this.options.cancelText)); - cancelLink.onclick = this.onclickCancel.bind(this); - cancelLink.className = 'editor_cancel'; - this.form.appendChild(cancelLink); - } }, - hasHTMLLineBreaks: function(string) { - if (!this.options.handleLineBreaks) return false; - return string.match(/<br/i) || string.match(/<p>/i); - }, - convertHTMLLineBreaks: function(string) { - return string.replace(/<br>/gi, "\n").replace(/<br\/>/gi, "\n").replace(/<\/p>/gi, "\n").replace(/<p>/gi, ""); - }, createEditField: function() { - var text; - if(this.options.loadTextURL) { - text = this.options.loadingText; - } else { - text = this.getText(); - } - - var obj = this; - - if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) { - this.options.textarea = false; - var textField = document.createElement("input"); - textField.obj = this; - textField.type = "text"; - textField.name = "value"; - textField.value = text; - textField.style.backgroundColor = this.options.highlightcolor; - textField.className = 'editor_field'; + var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); + var fld; + if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { + fld = document.createElement('input'); + fld.type = 'text'; var size = this.options.size || this.options.cols || 0; - if (size != 0) textField.size = size; - if (this.options.submitOnBlur) - textField.onblur = this.onSubmit.bind(this); - this.editField = textField; + if (0 < size) fld.size = size; } else { - this.options.textarea = true; - var textArea = document.createElement("textarea"); - textArea.obj = this; - textArea.name = "value"; - textArea.value = this.convertHTMLLineBreaks(text); - textArea.rows = this.options.rows; - textArea.cols = this.options.cols || 40; - textArea.className = 'editor_field'; - if (this.options.submitOnBlur) - textArea.onblur = this.onSubmit.bind(this); - this.editField = textArea; + fld = document.createElement('textarea'); + fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); + fld.cols = this.options.cols || 40; } - - if(this.options.loadTextURL) { + fld.name = this.options.paramName; + fld.value = text; // No HTML breaks conversion anymore + fld.className = 'editor_field'; + if (this.options.submitOnBlur) + fld.onblur = this._boundSubmitHandler; + this._controls.editor = fld; + if (this.options.loadTextURL) this.loadExternalText(); - } - this.form.appendChild(this.editField); + this._form.appendChild(this._controls.editor); }, - getText: function() { - return this.element.innerHTML; + createForm: function() { + var ipe = this; + function addText(mode, condition) { + var text = ipe.options['text' + mode + 'Controls']; + if (!text || condition === false) return; + ipe._form.appendChild(document.createTextNode(text)); + }; + this._form = $(document.createElement('form')); + this._form.id = this.options.formId; + this._form.addClassName(this.options.formClassName); + this._form.onsubmit = this._boundSubmitHandler; + this.createEditField(); + if ('textarea' == this._controls.editor.tagName.toLowerCase()) + this._form.appendChild(document.createElement('br')); + if (this.options.onFormCustomization) + this.options.onFormCustomization(this, this._form); + addText('Before', this.options.okControl || this.options.cancelControl); + this.createControl('ok', this._boundSubmitHandler); + addText('Between', this.options.okControl && this.options.cancelControl); + this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); + addText('After', this.options.okControl || this.options.cancelControl); }, - loadExternalText: function() { - Element.addClassName(this.form, this.options.loadingClassName); - this.editField.disabled = true; - new Ajax.Request( - this.options.loadTextURL, - Object.extend({ - asynchronous: true, - onComplete: this.onLoadedExternalText.bind(this) - }, this.options.ajaxOptions) - ); + destroy: function() { + if (this._oldInnerHTML) + this.element.innerHTML = this._oldInnerHTML; + this.leaveEditMode(); + this.unregisterListeners(); }, - onLoadedExternalText: function(transport) { - Element.removeClassName(this.form, this.options.loadingClassName); - this.editField.disabled = false; - this.editField.value = transport.responseText.stripTags(); - Field.scrollFreeActivate(this.editField); + enterEditMode: function(e) { + if (this._saving || this._editing) return; + this._editing = true; + this.triggerCallback('onEnterEditMode'); + if (this.options.externalControl) + this.options.externalControl.hide(); + this.element.hide(); + this.createForm(); + this.element.parentNode.insertBefore(this._form, this.element); + if (!this.options.loadTextURL) + this.postProcessEditField(); + if (e) Event.stop(e); }, - onclickCancel: function() { - this.onComplete(); - this.leaveEditMode(); - return false; + enterHover: function(e) { + if (this.options.hoverClassName) + this.element.addClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onEnterHover'); }, - onFailure: function(transport) { - this.options.onFailure(transport); - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - this.oldInnerHTML = null; + getText: function() { + return this.element.innerHTML; + }, + handleAJAXFailure: function(transport) { + this.triggerCallback('onFailure', transport); + if (this._oldInnerHTML) { + this.element.innerHTML = this._oldInnerHTML; + this._oldInnerHTML = null; } - return false; }, - onSubmit: function() { - // onLoading resets these so we need to save them away for the Ajax call - var form = this.form; - var value = this.editField.value; - - // do this first, sometimes the ajax call returns before we get a chance to switch on Saving... - // which means this will actually switch on Saving... *after* we've left edit mode causing Saving... - // to be displayed indefinitely - this.onLoading(); - - if (this.options.evalScripts) { - new Ajax.Request( - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this), - asynchronous:true, - evalScripts:true - }, this.options.ajaxOptions)); - } else { - new Ajax.Updater( - { success: this.element, - // don't update on failure (this could be an option) - failure: null }, - this.url, Object.extend({ - parameters: this.options.callback(form, value), - onComplete: this.onComplete.bind(this), - onFailure: this.onFailure.bind(this) - }, this.options.ajaxOptions)); + handleFormCancellation: function(e) { + this.wrapUp(); + if (e) Event.stop(e); + }, + handleFormSubmission: function(e) { + var form = this._form; + var value = $F(this._controls.editor); + this.prepareSubmission(); + var params = this.options.callback(form, value) || ''; + if (Object.isString(params)) + params = params.toQueryParams(); + params.editorId = this.element.id; + if (this.options.htmlResponse) { + var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Updater({ success: this.element }, this.url, options); + } else { + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.url, options); } - // stop the event to avoid a page refresh in Safari - if (arguments.length > 1) { - Event.stop(arguments[0]); - } - return false; + if (e) Event.stop(e); }, - onLoading: function() { - this.saving = true; + leaveEditMode: function() { + this.element.removeClassName(this.options.savingClassName); this.removeForm(); this.leaveHover(); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + if (this.options.externalControl) + this.options.externalControl.show(); + this._saving = false; + this._editing = false; + this._oldInnerHTML = null; + this.triggerCallback('onLeaveEditMode'); + }, + leaveHover: function(e) { + if (this.options.hoverClassName) + this.element.removeClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onLeaveHover'); + }, + loadExternalText: function() { + this._form.addClassName(this.options.loadingClassName); + this._controls.editor.disabled = true; + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._form.removeClassName(this.options.loadingClassName); + var text = transport.responseText; + if (this.options.stripLoadedTextTags) + text = text.stripTags(); + this._controls.editor.value = text; + this._controls.editor.disabled = false; + this.postProcessEditField(); + }.bind(this), + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + postProcessEditField: function() { + var fpc = this.options.fieldPostCreation; + if (fpc) + $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); + }, + prepareOptions: function() { + this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); + Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); + [this._extraDefaultOptions].flatten().compact().each(function(defs) { + Object.extend(this.options, defs); + }.bind(this)); + }, + prepareSubmission: function() { + this._saving = true; + this.removeForm(); + this.leaveHover(); this.showSaving(); }, + registerListeners: function() { + this._listeners = { }; + var listener; + $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { + listener = this[pair.value].bind(this); + this._listeners[pair.key] = listener; + if (!this.options.externalControlOnly) + this.element.observe(pair.key, listener); + if (this.options.externalControl) + this.options.externalControl.observe(pair.key, listener); + }.bind(this)); + }, + removeForm: function() { + if (!this._form) return; + this._form.remove(); + this._form = null; + this._controls = { }; + }, showSaving: function() { - this.oldInnerHTML = this.element.innerHTML; + this._oldInnerHTML = this.element.innerHTML; this.element.innerHTML = this.options.savingText; - Element.addClassName(this.element, this.options.savingClassName); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); + this.element.addClassName(this.options.savingClassName); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); }, - removeForm: function() { - if(this.form) { - if (this.form.parentNode) Element.remove(this.form); - this.form = null; + triggerCallback: function(cbName, arg) { + if ('function' == typeof this.options[cbName]) { + this.options[cbName](this, arg); } }, - enterHover: function() { - if (this.saving) return; - this.element.style.backgroundColor = this.options.highlightcolor; - if (this.effect) { - this.effect.cancel(); - } - Element.addClassName(this.element, this.options.hoverClassName) + unregisterListeners: function() { + $H(this._listeners).each(function(pair) { + if (!this.options.externalControlOnly) + this.element.stopObserving(pair.key, pair.value); + if (this.options.externalControl) + this.options.externalControl.stopObserving(pair.key, pair.value); + }.bind(this)); }, - leaveHover: function() { - if (this.options.backgroundColor) { - this.element.style.backgroundColor = this.oldBackground; - } - Element.removeClassName(this.element, this.options.hoverClassName) - if (this.saving) return; - this.effect = new Effect.Highlight(this.element, { - startcolor: this.options.highlightcolor, - endcolor: this.options.highlightendcolor, - restorecolor: this.originalBackground + wrapUp: function(transport) { + this.leaveEditMode(); + // Can't use triggerCallback due to backward compatibility: requires + // binding + direct element + this._boundComplete(transport, this.element); + } +}); + +Object.extend(Ajax.InPlaceEditor.prototype, { + dispose: Ajax.InPlaceEditor.prototype.destroy +}); + +Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { + initialize: function($super, element, url, options) { + this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; + $super(element, url, options); + }, + + createEditField: function() { + var list = document.createElement('select'); + list.name = this.options.paramName; + list.size = 1; + this._controls.editor = list; + this._collection = this.options.collection || []; + if (this.options.loadCollectionURL) + this.loadCollection(); + else + this.checkForExternalText(); + this._form.appendChild(this._controls.editor); + }, + + loadCollection: function() { + this._form.addClassName(this.options.loadingClassName); + this.showLoadingText(this.options.loadingCollectionText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + var js = transport.responseText.strip(); + if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check + throw 'Server returned an invalid collection representation.'; + this._collection = eval(js); + this.checkForExternalText(); + }.bind(this), + onFailure: this.onFailure }); + new Ajax.Request(this.options.loadCollectionURL, options); }, - leaveEditMode: function() { - Element.removeClassName(this.element, this.options.savingClassName); - this.removeForm(); - this.leaveHover(); - this.element.style.backgroundColor = this.originalBackground; - Element.show(this.element); - if (this.options.externalControl) { - Element.show(this.options.externalControl); + + showLoadingText: function(text) { + this._controls.editor.disabled = true; + var tempOption = this._controls.editor.firstChild; + if (!tempOption) { + tempOption = document.createElement('option'); + tempOption.value = ''; + this._controls.editor.appendChild(tempOption); + tempOption.selected = true; } - this.editing = false; - this.saving = false; - this.oldInnerHTML = null; - this.onLeaveEditMode(); + tempOption.update((text || '').stripScripts().stripTags()); }, - onComplete: function(transport) { - this.leaveEditMode(); - this.options.onComplete.bind(this)(transport, this.element); + + checkForExternalText: function() { + this._text = this.getText(); + if (this.options.loadTextURL) + this.loadExternalText(); + else + this.buildOptionList(); }, - onEnterEditMode: function() {}, - onLeaveEditMode: function() {}, - dispose: function() { - if (this.oldInnerHTML) { - this.element.innerHTML = this.oldInnerHTML; - } - this.leaveEditMode(); - Event.stopObserving(this.element, 'click', this.onclickListener); - Event.stopObserving(this.element, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.element, 'mouseout', this.mouseoutListener); - if (this.options.externalControl) { - Event.stopObserving(this.options.externalControl, 'click', this.onclickListener); - Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener); - Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener); - } + + loadExternalText: function() { + this.showLoadingText(this.options.loadingText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._text = transport.responseText.strip(); + this.buildOptionList(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + + buildOptionList: function() { + this._form.removeClassName(this.options.loadingClassName); + this._collection = this._collection.map(function(entry) { + return 2 === entry.length ? entry : [entry, entry].flatten(); + }); + var marker = ('value' in this.options) ? this.options.value : this._text; + var textFound = this._collection.any(function(entry) { + return entry[0] == marker; + }.bind(this)); + this._controls.editor.update(''); + var option; + this._collection.each(function(entry, index) { + option = document.createElement('option'); + option.value = entry[0]; + option.selected = textFound ? entry[0] == marker : 0 == index; + option.appendChild(document.createTextNode(entry[1])); + this._controls.editor.appendChild(option); + }.bind(this)); + this._controls.editor.disabled = false; + Field.scrollFreeActivate(this._controls.editor); } +}); + +//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** +//**** This only exists for a while, in order to let **** +//**** users adapt to the new API. Read up on the new **** +//**** API and convert your code to it ASAP! **** + +Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { + if (!options) return; + function fallback(name, expr) { + if (name in options || expr === undefined) return; + options[name] = expr; + }; + fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : + options.cancelLink == options.cancelButton == false ? false : undefined))); + fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : + options.okLink == options.okButton == false ? false : undefined))); + fallback('highlightColor', options.highlightcolor); + fallback('highlightEndColor', options.highlightendcolor); }; -Ajax.InPlaceCollectionEditor = Class.create(); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype); -Object.extend(Ajax.InPlaceCollectionEditor.prototype, { - createEditField: function() { - if (!this.cached_selectTag) { - var selectTag = document.createElement("select"); - var collection = this.options.collection || []; - var optionTag; - collection.each(function(e,i) { - optionTag = document.createElement("option"); - optionTag.value = (e instanceof Array) ? e[0] : e; - if((typeof this.options.value == 'undefined') && - ((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true; - if(this.options.value==optionTag.value) optionTag.selected = true; - optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e)); - selectTag.appendChild(optionTag); - }.bind(this)); - this.cached_selectTag = selectTag; +Object.extend(Ajax.InPlaceEditor, { + DefaultOptions: { + ajaxOptions: { }, + autoRows: 3, // Use when multi-line w/ rows == 1 + cancelControl: 'link', // 'link'|'button'|false + cancelText: 'cancel', + clickToEditText: 'Click to edit', + externalControl: null, // id|elt + externalControlOnly: false, + fieldPostCreation: 'activate', // 'activate'|'focus'|false + formClassName: 'inplaceeditor-form', + formId: null, // id|elt + highlightColor: '#ffff99', + highlightEndColor: '#ffffff', + hoverClassName: '', + htmlResponse: true, + loadingClassName: 'inplaceeditor-loading', + loadingText: 'Loading...', + okControl: 'button', // 'link'|'button'|false + okText: 'ok', + paramName: 'value', + rows: 1, // If 1 and multi-line, uses autoRows + savingClassName: 'inplaceeditor-saving', + savingText: 'Saving...', + size: 0, + stripLoadedTextTags: false, + submitOnBlur: false, + textAfterControls: '', + textBeforeControls: '', + textBetweenControls: '' + }, + DefaultCallbacks: { + callback: function(form) { + return Form.serialize(form); + }, + onComplete: function(transport, element) { + // For backward compatibility, this one is bound to the IPE, and passes + // the element directly. It was too often customized, so we don't break it. + new Effect.Highlight(element, { + startcolor: this.options.highlightColor, keepBackgroundImage: true }); + }, + onEnterEditMode: null, + onEnterHover: function(ipe) { + ipe.element.style.backgroundColor = ipe.options.highlightColor; + if (ipe._effect) + ipe._effect.cancel(); + }, + onFailure: function(transport, ipe) { + alert('Error communication with the server: ' + transport.responseText.stripTags()); + }, + onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. + onLeaveEditMode: null, + onLeaveHover: function(ipe) { + ipe._effect = new Effect.Highlight(ipe.element, { + startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, + restorecolor: ipe._originalBackground, keepBackgroundImage: true + }); } - - this.editField = this.cached_selectTag; - if(this.options.loadTextURL) this.loadExternalText(); - this.form.appendChild(this.editField); - this.options.callback = function(form, value) { - return "value=" + encodeURIComponent(value); - } + }, + Listeners: { + click: 'enterEditMode', + keydown: 'checkForEscapeOrReturn', + mouseover: 'enterHover',... [truncated message content] |
From: <bz...@us...> - 2007-11-11 09:48:24
|
Revision: 4798 http://linpha.svn.sourceforge.net/linpha/?rev=4798&view=rev Author: bzrudi Date: 2007-11-11 01:48:23 -0800 (Sun, 11 Nov 2007) Log Message: ----------- "minor speeling change" Modified Paths: -------------- trunk/linpha2/install/step4_selectdirectories.php Modified: trunk/linpha2/install/step4_selectdirectories.php =================================================================== --- trunk/linpha2/install/step4_selectdirectories.php 2007-11-11 09:33:51 UTC (rev 4797) +++ trunk/linpha2/install/step4_selectdirectories.php 2007-11-11 09:48:23 UTC (rev 4798) @@ -74,7 +74,7 @@ <br /><br /> <br /> -<h2 style="color: red;"><?php echo i18n_install("Note: For security reasons folder names were named random!"); ?></h2><hr> +<h2 style="color: red;"><?php echo i18n_install("Note: For security reasons folders were named random!"); ?></h2><hr> <br /> <div class="boxalign"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-11-11 09:33:55
|
Revision: 4797 http://linpha.svn.sourceforge.net/linpha/?rev=4797&view=rev Author: bzrudi Date: 2007-11-11 01:33:51 -0800 (Sun, 11 Nov 2007) Log Message: ----------- "fix double index on md5sum for iptc and xmp tables" Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.metadata.class.php Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2007-11-10 16:23:18 UTC (rev 4796) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2007-11-11 09:33:51 UTC (rev 4797) @@ -847,8 +847,8 @@ $value = str_replace("-", "_", strtolower($value)); $str .= LinSql::linAddslashes(strtolower($value))." VARCHAR(255), "; } - $str .= "PRIMARY KEY (md5sum), "; - $str .= "KEY (md5sum) )"; + $str .= "PRIMARY KEY (md5sum) )"; + } elseif (LIN_DB_TYPE == "sqlite") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-11-10 16:23:25
|
Revision: 4796 http://linpha.svn.sourceforge.net/linpha/?rev=4796&view=rev Author: bzrudi Date: 2007-11-10 08:23:18 -0800 (Sat, 10 Nov 2007) Log Message: ----------- "new file" Added Paths: ----------- trunk/linpha2/lib/exiftool/lib/Image/ExifTool/BigTIFF.pm Added: trunk/linpha2/lib/exiftool/lib/Image/ExifTool/BigTIFF.pm =================================================================== --- trunk/linpha2/lib/exiftool/lib/Image/ExifTool/BigTIFF.pm (rev 0) +++ trunk/linpha2/lib/exiftool/lib/Image/ExifTool/BigTIFF.pm 2007-11-10 16:23:18 UTC (rev 4796) @@ -0,0 +1,277 @@ +#------------------------------------------------------------------------------ +# File: BigTIFF.pm +# +# Description: Read Big TIFF meta information +# +# Revisions: 07/03/2007 - P. Harvey Created +# +# References: 1) http://www.awaresystems.be/imaging/tiff/bigtiff.html +#------------------------------------------------------------------------------ + +package Image::ExifTool::BigTIFF; + +use strict; +use vars qw($VERSION); +use Image::ExifTool qw(:DataAccess :Utils); +use Image::ExifTool::Exif; + +$VERSION = '1.00'; + +my $maxOffset = 0x7fffffff; # currently supported maximum data offset/size + +#------------------------------------------------------------------------------ +# Process Big IFD directory +# Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref +# Returns: 1 on success, otherwise returns 0 and sets a Warning +sub ProcessBigIFD($$$) +{ + my ($exifTool, $dirInfo, $tagTablePtr) = @_; + my $raf = $$dirInfo{RAF}; + my $verbose = $exifTool->{OPTIONS}->{Verbose}; + my $htmlDump = $exifTool->{HTML_DUMP}; + my $dirName = $$dirInfo{DirName}; + my $dirStart = $$dirInfo{DirStart}; + + $verbose = -1 if $htmlDump; # mix htmlDump into verbose so we can test for both at once + + # loop through IFD chain + for (;;) { + if ($dirStart > $maxOffset) { + $exifTool->Warn('Huge offsets not yet supported'); + last; + } + unless ($raf->Seek($dirStart, 0)) { + $exifTool->Warn("Bad $dirName offset"); + return 0; + } + my ($dirBuff, $index); + unless ($raf->Read($dirBuff, 8) == 8) { + $exifTool->Warn("Truncated $dirName count"); + return 0; + } + my $numEntries = Image::ExifTool::Get64u(\$dirBuff, 0); + $verbose > 0 and $exifTool->VerboseDir($dirName, $numEntries); + my $bsize = $numEntries * 20; + if ($bsize > $maxOffset) { + $exifTool->Warn('Huge directory counts not yet supported'); + last; + } + my $bufPos = $raf->Tell(); + unless ($raf->Read($dirBuff, $bsize) == $bsize) { + $exifTool->Warn("Truncated $dirName directory"); + return 0; + } + my $nextIFD; + $raf->Read($nextIFD, 8) == 8 or undef $nextIFD; # try to read next IFD pointer + if ($htmlDump) { + $exifTool->HtmlDump($bufPos-8, 8, "$dirName entries", "Entry count: $numEntries"); + if (defined $nextIFD) { + my $tip = sprintf("Offset: 0x%.8x", Image::ExifTool::Get64u(\$nextIFD, 0)); + $exifTool->HtmlDump($bufPos + 20 * $numEntries, 8, "Next IFD", $tip, 0); + } + } + # loop through all entries in this BigTIFF IFD + for ($index=0; $index<$numEntries; ++$index) { + my $entry = 20 * $index; + my $tagID = Get16u(\$dirBuff, $entry); + my $format = Get16u(\$dirBuff, $entry+2); + my $count = Image::ExifTool::Get64u(\$dirBuff, $entry+4); + my $formatSize = $Image::ExifTool::Exif::formatSize[$format]; + unless (defined $formatSize) { + $exifTool->HtmlDump($bufPos+$entry,20,"[invalid IFD entry]", + "Bad format value: $format", 1); + # warn unless the IFD was just padded with zeros + $exifTool->Warn(sprintf("Unknown format ($format) for $dirName tag 0x%x",$tagID)); + return 0; # assume corrupted IFD + } + my $formatStr = $Image::ExifTool::Exif::formatName[$format]; + my $size = $count * $formatSize; + my $tagInfo = $exifTool->GetTagInfo($tagTablePtr, $tagID); + next unless $tagInfo or $verbose; + my $valuePtr = $entry + 12; + my ($valBuff, $valBase); + if ($size > 8) { + if ($size > $maxOffset) { + $exifTool->Warn("Can't yet handle $dirName entry $index (huge size)"); + next; + } + $valuePtr = Image::ExifTool::Get64u(\$dirBuff, $valuePtr); + if ($valuePtr > $maxOffset) { + $exifTool->Warn("Can't yet handle $dirName entry $index (huge offset)"); + next; + } + unless ($raf->Seek($valuePtr, 0) and $raf->Read($valBuff, $size) == $size) { + $exifTool->Warn("Error reading $dirName entry $index"); + next; + } + $valBase = 0; + } else { + $valBuff = substr($dirBuff, $valuePtr, $size); + $valBase = $bufPos; + } + my $val = ReadValue(\$valBuff, 0, $formatStr, $count, $size); + if ($htmlDump) { + my ($tagName, $colName); + if ($tagID == 0x927c and $dirName eq 'ExifIFD') { + $tagName = 'MakerNotes'; + } elsif ($tagInfo) { + $tagName = $$tagInfo{Name}; + } else { + $tagName = sprintf("Tag 0x%.4x",$tagID); + } + my $dname = sprintf("$dirName-%.2d", $index); + # build our tool tip + my $tip = sprintf("Tag ID: 0x%.4x\\n", $tagID) . + "Format: $formatStr\[$count]\\nSize: $size bytes\\n"; + if ($size > 8) { + $tip .= sprintf("Value offset: 0x%.8x\\n", $valuePtr); + $colName = "<span class=H>$tagName</span>"; + } else { + $colName = $tagName; + } + my $tval = (length $val < 32) ? $val : substr($val,0,28) . '[...]'; + if ($formatStr =~ /^(string|undef|binary)/) { + # translate all characters that could mess up JavaScript + $tval =~ tr/\\\x00-\x1f\x7f-\xff/./; + $tval =~ tr/"/'/; + $tval = "$tval"; + } elsif ($tagInfo and Image::ExifTool::IsInt($tval)) { + if ($$tagInfo{IsOffset}) { + $tval = sprintf('0x%.4x', $tval); + } elsif ($$tagInfo{PrintHex}) { + $tval = sprintf('0x%x', $tval); + } + } + $tip .= "Value: $tval"; + $exifTool->HtmlDump($entry+$bufPos, 20, "$dname $colName", $tip, 1); + if ($size > 8) { + # add value data block + my $flg = ($tagInfo and $$tagInfo{SubDirectory} and $$tagInfo{MakerNotes}) ? 4 : 0; + $exifTool->HtmlDump($valuePtr,$size,"$tagName value",'SAME', $flg); + } + } + if ($tagInfo and $$tagInfo{SubIFD}) { + # process all SubIFD's as BigTIFF + $verbose > 0 and $exifTool->VerboseInfo($tagID, $tagInfo, + Table => $tagTablePtr, + Index => $index, + Value => $val, + DataPt => \$valBuff, + DataPos => $valBase + $valuePtr, + Start => 0, + Size => $size, + Format => $formatStr, + Count => $count, + ); + my @offsets = split ' ', $val; + my $i; + for ($i=0; $i<scalar(@offsets); ++$i) { + my $subdirName = $$tagInfo{Name}; + $subdirName .= $i if $i; + my %subdirInfo = ( + RAF => $raf, + DataPos => 0, + DirStart => $offsets[$i], + DirName => $subdirName, + Parent => $dirInfo, + ); + $exifTool->ProcessDirectory(\%subdirInfo, $tagTablePtr, \&ProcessBigIFD); + } + } else { + my $tagKey = $exifTool->HandleTag($tagTablePtr, $tagID, $val, + Index => $index, + DataPt => \$valBuff, + DataPos => $valBase + $valuePtr, + Start => 0, + Size => $size, + Format => $formatStr, + TagInfo => $tagInfo, + RAF => $raf, + ); + $tagKey and $exifTool->SetGroup1($tagKey, $dirName); + } + } + last unless $dirName =~ /^(IFD|SubIFD)(\d*)$/; + $dirName = $1 . (($2 || 0) + 1); + defined $nextIFD or $exifTool->Warn("Bad $dirName pointer"), return 0; + $dirStart = Image::ExifTool::Get64u(\$nextIFD, 0); + $dirStart or last; + } + return 1; +} + +#------------------------------------------------------------------------------ +# Extract meta information from a BigTIFF image +# Inputs: 0) ExifTool object reference, 1) dirInfo reference +# Returns: 1 on success, 0 if this wasn't a valid BigTIFF image +sub ProcessBTF($$) +{ + my ($exifTool, $dirInfo) = @_; + my $raf = $$dirInfo{RAF}; + my $buff; + + return 0 unless $raf->Read($buff, 16) == 16; + return 0 unless $buff =~ /^(MM\0\x2b\0\x08\0\0|II\x2b\0\x08\0\0\0)/; + if ($$dirInfo{OutFile}) { + $exifTool->Error('ExifTool does not support writing of BigTIFF images'); + return 1; + } + $exifTool->SetFileType('BTF'); # set the FileType tag + SetByteOrder(substr($buff, 0, 2)); + my $offset = Image::ExifTool::Get64u(\$buff, 8); + if ($exifTool->{HTML_DUMP}) { + my $o = (GetByteOrder() eq 'II') ? 'Little' : 'Big'; + $exifTool->HtmlDump(0, 8, "BigTIFF header", "Byte order: $o endian", 0); + $exifTool->HtmlDump(8, 8, "IFD0 pointer", sprintf("Offset: 0x%.8x",$offset), 0); + } + my %dirInfo = ( + RAF => $raf, + DataPos => 0, + DirStart => $offset, + DirName => 'IFD0', + Parent => 'BigTIFF', + ); + my $tagTablePtr = GetTagTable('Image::ExifTool::Exif::Main'); + $exifTool->ProcessDirectory(\%dirInfo, $tagTablePtr, \&ProcessBigIFD); + return 1; +} + +1; # end + +__END__ + +=head1 NAME + +Image::ExifTool::BigTIFF - Read Big TIFF meta information + +=head1 SYNOPSIS + +This module is used by Image::ExifTool + +=head1 DESCRIPTION + +This module contains routines required by Image::ExifTool to read meta +information in BigTIFF images. + +=head1 AUTHOR + +Copyright 2003-2007, Phil Harvey (phil at owl.phy.queensu.ca) + +This library is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=head1 REFERENCES + +=over 4 + +=item L<http://www.awaresystems.be/imaging/tiff/bigtiff.html> + +=back + +=head1 SEE ALSO + +L<Image::ExifTool::TagNames/EXIF Tags>, +L<Image::ExifTool(3pm)|Image::ExifTool> + +=cut + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-11-10 16:21:47
|
Revision: 4795 http://linpha.svn.sourceforge.net/linpha/?rev=4795&view=rev Author: bzrudi Date: 2007-11-10 08:21:46 -0800 (Sat, 10 Nov 2007) Log Message: ----------- "minor fixes" Modified Paths: -------------- trunk/linpha2/install/step2_requirements.php Modified: trunk/linpha2/install/step2_requirements.php =================================================================== --- trunk/linpha2/install/step2_requirements.php 2007-11-10 16:19:35 UTC (rev 4794) +++ trunk/linpha2/install/step2_requirements.php 2007-11-10 16:21:46 UTC (rev 4795) @@ -427,8 +427,8 @@ print_line_middle( i18n_install("No") ); print_line_right(warning_msg()); print_line_info( - i18n_install("The /albums folder is not protected from outside!"). - i18n_install("Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\">here</a> for more details.") + i18n_install("The /albums folder is not protected from outside! "). + i18n_install("Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\" target=\"_blank\">here</a> for more details.") ); } elseif( $ret == 3 ) @@ -436,7 +436,7 @@ print_line_middle( i18n_install("Unknown") ); print_line_right(warning_msg()); print_line_info( - i18n_install("Cannot determine wether the /albums folder is protected from outside!"). + i18n_install("Cannot determine wether the /albums folder is protected from outside! "). i18n_install("Please see <a href=\"http://linpha.sourceforge.net/wiki/index.php/Secure_LinPHA\" target=\"_blank\">here</a> for more details.") ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-11-10 16:19:48
|
Revision: 4794 http://linpha.svn.sourceforge.net/linpha/?rev=4794&view=rev Author: bzrudi Date: 2007-11-10 08:19:35 -0800 (Sat, 10 Nov 2007) Log Message: ----------- "fixed a couple if errors " Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/maintenance_import.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-11-10 15:50:29 UTC (rev 4793) +++ trunk/linpha2/ChangeLog 2007-11-10 16:19:35 UTC (rev 4794) @@ -1,3 +1,7 @@ +2007-11-10 bzrudi + * bump exiftool to latest 7.00 stable release + * fixed a couple of issues in installer and maintenance_import.php + 2007-11-08 bzrudi * more security related stuff Modified: trunk/linpha2/admin/maintenance_import.php =================================================================== --- trunk/linpha2/admin/maintenance_import.php 2007-11-10 15:50:29 UTC (rev 4793) +++ trunk/linpha2/admin/maintenance_import.php 2007-11-10 16:19:35 UTC (rev 4794) @@ -126,7 +126,7 @@ if($_REQUEST['index_thumbnails']!='no') { echo '<h3>'.i18n("Parsing All Directories...").'</h3><br />'; - $createthumbquery = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".LIN_PREFIX."photos WHERE img_type <> 0 AND img_type <> 9999999"); + $createthumbquery = $GLOBALS['linpha']->db->Execute("SELECT id FROM ".LIN_PREFIX."photos WHERE img_type <> '0' AND img_type <> '9999999'"); } } else // $all_albums == false -> not all directory selected @@ -139,9 +139,9 @@ $data = $GLOBALS['linpha']->db->GetRow("SELECT name FROM ".LIN_PREFIX."photos WHERE id = '".LinSql::linAddslashes($value)."'"); echo i18n("Parsing Directory:").' '.$data['name'].'<br />'; - $sql = "SELECT id FROM ".LIN_PREFIX."photos WHERE " . + $sql = "SELECT id, img_type FROM ".LIN_PREFIX."photos WHERE " . "parent_id = '".LinSql::linAddslashes($value)."' AND " . - "img_type <> 0 AND img_type <> 9999999"; + "img_type <> '0' AND img_type <> '9999999' "; /** * delete thumbnails @@ -152,7 +152,7 @@ $query = $GLOBALS['linpha']->db->Execute($sql); while($data = $query->FetchRow(ADODB_FETCH_NUM)) { - if( LinImage::deleteCachedThumbnail($data[0]) ) + if( LinImage::deleteCachedThumbnail($data[0], $data[1])) { echo " ".$data[0].","; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |