[Linpha-cvs] SF.net SVN: linpha: [4802] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
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. |