[Linpha-cvs] SF.net SVN: linpha: [4400] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-05 21:43:26
|
Revision: 4400 Author: fangehrn Date: 2006-03-05 13:43:01 -0800 (Sun, 05 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4400&view=rev Log Message: ----------- * adding an admin menu * working on image fields Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/admin.css trunk/linpha2/admin/image_fields_define.php trunk/linpha2/admin/image_fields_select.php trunk/linpha2/admin/index.php trunk/linpha2/db_data.sql trunk/linpha2/db_mysql.sql trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/classes/metadata.config.php trunk/linpha2/linpha2.specs.txt Added Paths: ----------- trunk/linpha2/admin/image_fields.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/ChangeLog 2006-03-05 21:43:01 UTC (rev 4400) @@ -1,5 +1,9 @@ 2006-03-04 flo + * adding an admin menu + * working on image fields + +2006-03-04 flo * fixed some double declarations in installer * implemented basic basket functions * admin/image.php Modified: trunk/linpha2/admin/admin.css =================================================================== --- trunk/linpha2/admin/admin.css 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/admin/admin.css 2006-03-05 21:43:01 UTC (rev 4400) @@ -1,3 +1,9 @@ +form +{ + margin: 0; + padding: 0; +} + .navlist { padding: 3px 0; Added: trunk/linpha2/admin/image_fields.php =================================================================== --- trunk/linpha2/admin/image_fields.php (rev 0) +++ trunk/linpha2/admin/image_fields.php 2006-03-05 21:43:01 UTC (rev 4400) @@ -0,0 +1,26 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + +if(!isset($cat2)) +{ + $cat2 = 'select'; +} + +$array_menu = Array( + 'select' => Array('name' => 'Select image fields', 'link' => 'imagefields_select'), + 'define' => Array('name' => 'Define image fields', 'link' => 'imagefields_define') +); + +print_admin_menu($array_menu,$cat2); + +switch($cat2) +{ +case 'select': + include_once('./image_fields_select.php'); + break; +case 'define': + include_once('./image_fields_define.php'); + break; +} +?> + Modified: trunk/linpha2/admin/image_fields_define.php =================================================================== --- trunk/linpha2/admin/image_fields_define.php 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/admin/image_fields_define.php 2006-03-05 21:43:01 UTC (rev 4400) @@ -1,53 +1,337 @@ <?php if(!defined('LINPHA_DIR')) { exit(1); } +/** + * init + */ + if(!isset($cat3)) + { + $cat3 = 'own'; + } + $array_field_types = Array( + 1 => 'text', + 2 => 'select', + 3 => 'date' + ); -if(!isset( $_GET['sub_cat'])) +/** + * show subsubmenu + */ + $array_menu = Array( + 'own' => Array('name' => 'Own fields', 'link' => 'imagefields_define_own'), + 'adddata' => Array('name' => 'Add select data (set Category names)', 'link' => 'imagefields_define_adddata'), + 'exif' => Array('name' => 'Exif fields', 'link' => 'imagefields_define_exif'), + 'iptc' => Array('name' => 'Iptc fields', 'link' => 'imagefields_define_iptc') + ); + + print_admin_menu($array_menu,$cat3); + +/** + * parse POST data + */ +if(isset($_POST['cmd'])) { - $_GET['sub_cat'] = 'own'; -} + switch($_POST['cmd']) + { + case 'update_builtin': + foreach($_POST['builtin'] AS $key=>$value) + { + $linpha->db->Execute("UPDATE ".PREFIX."meta_fields SET enabled = '".linSql::linAddslashes($value)."' ". + "WHERE id = '".linSql::linAddslashes($key)."'"); + } + + break; + case 'add_new': + $linpha->db->Execute("INSERT into ".PREFIX."meta_fields (name, field_type, builtin, enabled) " . + "VALUES ('".linSql::linAddslashes($_POST['new_name'])."', '".linSql::linAddslashes($_POST['new_type'])."', '0', '1') "); + break; + case 'change_field': -$array_menu = Array( - 'own' => Array('name' => 'Own fields', 'link' => '?cat=image_fields_define&sub_cat=own'), - 'exif' => Array('name' => 'Exif fields', 'link' => '?cat=image_fields_define&sub_cat=exif'), - 'iptc' => Array('name' => 'Iptc fields', 'link' => '?cat=image_fields_define&sub_cat=iptc') -); + $linpha->db->Execute("UPDATE ".PREFIX."meta_fields SET " . + "name = '".linSql::linAddslashes($_POST['new_name'])."', ". + "enabled = '".linSql::linAddslashes($_POST['builtin'][$_POST['id']])."' ". + "WHERE id = '".linSql::linAddslashes($_POST['id'])."'"); + break; + case 'delete': + ?> + <h3>Delete selected field</h3> + Really sure? all will be lost... + <form action="./?cat=imagefields_define_own" method="POST"> + <input type="hidden" name="cmd" value="do_delete" /> + <input type="hidden" name="id" value="<?php echo $_POST['id']; ?>" /> + <input type="submit" name="delete" value="delete" /> + <a href="./?cat=imagefields_define_own">Cancel</a> + </form> + <br /><br /> + <?php + break; + case 'do_delete': + $linpha->db->Execute("DELETE FROM ".PREFIX."meta_fields WHERE id = '".linSql::linAddslashes($_POST['id'])."'"); + break; + case 'add_new_category': + if(isset($_POST['isprivate'])) { + $isprivate = 1; + } else { + $isprivate = 0; + } + $linpha->db->Execute("INSERT into ".PREFIX."meta_category (field_id, name, isprivate) VALUES (" . + "'".linSql::linAddslashes($_POST['field_id'])."'," . + "'".linSql::linAddslashes($_POST['new_name'])."'," . + "'".$isprivate."')"); -print_admin_menu($array_menu,$_GET['sub_cat']); + break; + case 'mod_category': + if(isset($_POST['isprivate'])) { + $isprivate = 1; + } else { + $isprivate = 0; + } + + $linpha->db->Execute("UPDATE ".PREFIX."meta_category SET " . + "name = '".linSql::linAddslashes($_POST['new_name'])."', ". + "isprivate = '".$isprivate."' ". + "WHERE id = '".linSql::linAddslashes($_POST['id'])."'"); -switch($_GET['sub_cat']) + break; + case 'delete_category': + $linpha->db->Execute("DELETE FROM ".PREFIX."meta_category WHERE id = '".linSql::linAddslashes($_POST['id'])."'"); + break; + case 'update_exifiptc': + $linpha->sql->config->updateConfig('sys_image_'.$cat3,$_POST['exifiptc_enable']); + $linpha->sql->config->reloadConfig(); + break; + } +} + +switch($cat3) { case 'own': -?> + ?> + <h3>Built-in fields</h3> + <form name="builtin" action="./?cat=imagefields_define_own" method="POST"> + <table border="0" width="400"> + <tr> + <td><b>Field name</b></td> + <td><b>Type</b></td> + <td><b>Enable</b></td> + <td><b>Disable</b></td> + </tr> + + <?php + $query = $linpha->db->Execute("SELECT id, name, field_type, enabled FROM ".PREFIX."meta_fields WHERE builtin = '1'"); + while($data = $query->FetchRow()) + { + echo '<tr><td>'; + echo $data['name']; + echo '</td><td>'; + echo $array_field_types[$data['field_type']]; + echo '</td><td>'; + + echo '<input type="radio" name="builtin['.$data['id'].']" value="1"'. ( $data['enabled'] ? ' checked="checked"' : '') .' />'; + echo '</td><td>'; + echo '<input type="radio" name="builtin['.$data['id'].']" value="0"'. ( $data['enabled'] ? '' : ' checked="checked"') .' />'; + echo '</td></tr>'; + } + ?> + </table> + + <input type="hidden" name="cmd" value="update_builtin" /> + <input type="submit" name="submit" value="submit" /> + </form> + <br /> + + + <h3>Add new own fields</h3> + <form name="addnew" action="./?cat=imagefields_define_own" method="POST"> + <table border="0"> + <tr> + <td width="100">Name</td> + <td><input type="text" name="new_name" value="" maxlength="255" style="width: 200px;" /></td> + </tr> + <tr> + <td>Type</td> + <td> + <select name="new_type" style="width: 200px;" > + <?php + foreach($array_field_types AS $key=>$value) + { + echo '<option value="'.$key.'">'.$value.'</option>'; + } + ?> + </select> + </td> + </tr> + </table> + <input type="hidden" name="cmd" value="add_new" /> + <input type="submit" name="submit" value="add new"/> + </form> + <br /> + + <?php + $query = $linpha->db->Execute("SELECT id, name, field_type, enabled FROM ".PREFIX."meta_fields WHERE builtin = '0'"); + if($query->RecordCount()>0) + { + ?> + <h3>Own fields</h3> + <form name="builtin" action="./?cat=imagefields_define_own" method="POST"> + <table border="0"> + <tr> + <td width="170"><b>Field name</b></td> + <td width="150"><b>Type</b></td> + <td width="70"><b>Enable</b></td> + <td width="100"><b>Disable</b></td> + <td><b>Commands</b></td> + <td> </td> + </tr> + + <?php + while($data = $query->FetchRow()) + { + ?> + <tr> + <form action="./?cat=imagefields_define_own" method="POST"> + <td> + <input type="text" name="new_name" value="<?php echo $data['name']; ?>" style="width: 150px;" maxlength="255" /> + </td> + <td><?php echo $array_field_types[$data['field_type']]; ?></td> + <td> + <?php + echo '<input type="radio" name="builtin['.$data['id'].']" value="1"'. ( $data['enabled'] ? ' checked="checked"' : '') .' />'; + ?> + </td> + <td> + <?php + echo '<input type="radio" name="builtin['.$data['id'].']" value="0"'. ( $data['enabled'] ? '' : ' checked="checked"') .' />'; + ?> + </td> + <td> + <input type="hidden" name="cmd" value="change_field" /> + <input type="hidden" name="id" value="<?php echo $data['id']; ?>" /> + <input type="submit" name="rename" value="submit" /> + </td> + </form> + <td> + <form action="./?cat=imagefields_define_own" method="POST"> + <input type="hidden" name="cmd" value="delete" /> + <input type="hidden" name="id" value="<?php echo $data['id']; ?>" /> + <input type="submit" name="delete" value="delete" /> + </form> + </td> + </tr> + <?php + } + + ?> + </table> + </form> + <?php + } - -<?php break; +case 'adddata': + $query = $linpha->db->Execute("SELECT id, name FROM ".PREFIX."meta_fields WHERE field_type = '2'"); + while($data = $query->FetchRow()) + { + ?> + <h3><?php echo $data['name']; ?></h3> + <table border="0"> + <tr> + <td width="170"><b>Name</b></td> + <td width="150"><b>Private</b></td> + <td><b>Commands</b></td> + <td> </td> + </tr> + <?php + $query2 = $linpha->db->Execute("SELECT id, name, isprivate FROM ".PREFIX."meta_category WHERE field_id = '".$data['id']."'"); + while($data2 = $query2->FetchRow()) + { + ?> + <tr> + <form action="./?cat=imagefields_define_adddata" method="POST"> + <td> + <input type="text" name="new_name" value="<?php echo $data2['name']; ?>" /> + </td> + <td> + <input type="checkbox" name="isprivate" value="true"<?php echo ($data2['isprivate'] ? ' checked="checked"' : ''); ?> /> + </td> + <td> + <input type="hidden" name="cmd" value="mod_category" /> + <input type="hidden" name="id" value="<?php echo $data2['id']; ?>" /> + <input type="submit" name="submit" value="Submit" /> + </td> + </form> + <td> + <form action="./?cat=imagefields_define_adddata" method="POST"> + <input type="hidden" name="cmd" value="delete_category" /> + <input type="hidden" name="id" value="<?php echo $data2['id']; ?>" /> + <input type="submit" name="delete" value="delete" /> + </form> + </td> + </tr> + <?php + } + ?> + <tr> + <form action="./?cat=imagefields_define_adddata" method="POST"> + <td> + <input type="text" name="new_name" value="" /> + </td> + <td> + <input type="checkbox" name="isprivate" value="1" /> + </td> + <td> + <input type="hidden" name="field_id" value="<?php echo $data['id']; ?>" /> + <input type="hidden" name="cmd" value="add_new_category" /> + <input type="submit" name="submit" value="Add new" /> + </td> + <td> </td> + </form> + </tr> + </table> + <?php + } + break; case 'exif': case 'iptc': - switch($_GET['sub_cat']) + switch($cat3) { case 'exif': + include_once(LINPHA_DIR.'/lib/classes/metadata.class.php'); + $array_available_fields = MetaData::getExifTranslationArray(); + + /** + * modify array as needed + */ + foreach($array_available_fields AS $key=>$value) + { + $array_available_fields[$key] = $key; + } break; case 'iptc': + include_once(LINPHA_DIR.'/lib/classes/metadata.config.php'); + $array_available_fields = getIptcTranslationArray(); break; } + + $enabled = $linpha->sql->config->value['sys_image_'.$cat3]; ?> - <form name="form_image_fields"> <div align="center"> - - <input type="radio" name="global_enable" value="true" />Enable - <input type="radio" name="global_enable" value="false" />Disable + <form action="./?cat=imagefields_define_<?php echo $cat3; ?>" method="POST"> + <input type="radio" name="exifiptc_enable" value="1"<?php echo ($enabled ? ' checked="checked"' : ''); ?> />Enable + <input type="radio" name="exifiptc_enable" value="0"<?php echo ($enabled ? '' : ' checked="checked"'); ?> />Disable + <input type="hidden" name="cmd" value="update_exifiptc" /> + <input type="submit" name="name" value="update" /> + </form> <br /><br /> <table border="0"> <tr> <td valign="top" rowspan="3" align="center"> Selected fields<br /> - <select name="selected_fields" size="25" style="width: 200px;"> + <select id="selected_fields" name="selected_fields" size="25" style="width: 200px;"> <option value="element1">element1</option> <option value="element2">element2</option> <option value="element3">element3</option> @@ -63,10 +347,12 @@ <td valign="top"> Available fields<br /> <select id="all_fields" name="builtin_fields" size="25" style="width: 200px;"> - <option value="builtin1">builtin1</option> - <option value="builtin2">builtin2</option> - <option value="builtin3">builtin3</option> - <option value="builtin4">builtin4</option> + <?php + foreach($array_available_fields AS $key=>$value) + { + echo '<option value="'.$key.'">'.$value.'</option>'; + } + ?> </select> </td> </tr> @@ -74,106 +360,51 @@ </div> </form> -<?php - break; -} -?> -<script type="text/javascript"> -/** - * http://www.babailiica.com/js/sorter/ - */ - -function copyElement (coming_from) -{ - obj = document.getElementById(coming_from); - - NewEntry = new Option( obj.options[ obj.selectedIndex ].value, obj.options[ obj.selectedIndex ].text, false, true ); - document.form_image_fields.select_image_fields.options[document.form_image_fields.select_image_fields.options.length] = NewEntry; -} - -function addElement () -{ - NewEntry = new Option( document.form_image_fields.title_name.value, document.form_image_fields.title_name.value, false, true ); - NewEntry.className = "option_title"; - document.form_image_fields.select_image_fields.options[document.form_image_fields.select_image_fields.options.length] = NewEntry; - document.form_image_fields.title_name.value = ""; -} - -function deleteElement () -{ - current_index = document.form_image_fields.select_image_fields.selectedIndex; - document.form_image_fields.select_image_fields.options[ current_index ] = null; - + <script type="text/javascript"> /** - * set selectedIndex back to field above + * http://www.babailiica.com/js/sorter/ */ - if( current_index == document.form_image_fields.select_image_fields.length ) + + function addElement () { - document.form_image_fields.select_image_fields.selectedIndex = current_index - 1; + obj_from = document.getElementById('all_fields'); + obj_to = document.getElementById('selected_fields'); + + moveElement(obj_from, obj_to); } - else - { - document.form_image_fields.select_image_fields.selectedIndex = current_index; - } -} -function moveupElement () -{ - current_index = document.form_image_fields.select_image_fields.selectedIndex; - if( current_index != 0 ) + function removeElement () { - /** - * swap entries - */ - obj = document.form_image_fields.select_image_fields.options; + obj_from = document.getElementById('selected_fields'); + obj_to = document.getElementById('all_fields'); - tmp_value = obj[ current_index ].value; - tmp_text = obj[ current_index ].text; - tmp_class = obj[ current_index ].className; - - obj[ current_index ].value = obj[ current_index - 1].value; - obj[ current_index ].text = obj[ current_index - 1].text; - obj[ current_index ].className = obj[ current_index - 1].className; - - obj[ current_index - 1].value = tmp_value; - obj[ current_index - 1].text = tmp_text; - obj[ current_index - 1].className = tmp_class; - - /** - * set selectedIndex back to swapped field - */ - document.form_image_fields.select_image_fields.selectedIndex = current_index - 1; + moveElement(obj_from, obj_to); } -} -function movedownElement () -{ - current_index = document.form_image_fields.select_image_fields.selectedIndex; - - if( current_index != ( document.form_image_fields.select_image_fields.length - 1 ) ) + function moveElement(obj_from, obj_to) { - /** - * swap entries - */ - obj = document.form_image_fields.select_image_fields.options; - - tmp_value = obj[ current_index ].value; - tmp_text = obj[ current_index ].text; - tmp_class = obj[ current_index ].className; - - obj[ current_index ].value = obj[ current_index + 1].value; - obj[ current_index ].text = obj[ current_index + 1].text; - obj[ current_index ].className = obj[ current_index + 1].className; + NewEntry = new Option( obj_from.options[ obj_from.selectedIndex ].text, obj_from.options[ obj_from.selectedIndex ].value, false, true ); + obj_to.options[ obj_to.options.length] = NewEntry; - obj[ current_index + 1].value = tmp_value; - obj[ current_index + 1].text = tmp_text; - obj[ current_index + 1].className = tmp_class; - + current_index = obj_from.selectedIndex; + obj_from.options[ current_index ] = null; + /** - * set selectedIndex back to swapped field + * set selectedIndex back to field above */ - document.form_image_fields.select_image_fields.selectedIndex = current_index + 1; + /*if( current_index == document.form_image_fields.select_image_fields.length ) + { + document.form_image_fields.select_image_fields.selectedIndex = current_index - 1; + } + else + { + document.form_image_fields.select_image_fields.selectedIndex = current_index; + }*/ } + + </script> +<?php + break; } -</script> \ No newline at end of file +?> \ No newline at end of file Modified: trunk/linpha2/admin/image_fields_select.php =================================================================== --- trunk/linpha2/admin/image_fields_select.php 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/admin/image_fields_select.php 2006-03-05 21:43:01 UTC (rev 4400) @@ -1,20 +1,19 @@ <?php if(!defined('LINPHA_DIR')) { exit(1); } - -if(!isset( $_GET['sub_cat'])) +if(!isset($cat3)) { - $_GET['sub_cat'] = 'image'; + $cat3 = 'image'; } $array_menu = Array( - 'image' => Array('name' => 'Image', 'link' => '?cat=image_fields&sub_cat=image'), - 'video' => Array('name' => 'Video', 'link' => '?cat=image_fields&sub_cat=video') + 'image' => Array('name' => 'Image', 'link' => 'imagefields_select_image'), + 'video' => Array('name' => 'Video', 'link' => 'imagefields_select_video') ); -print_admin_menu($array_menu,$_GET['sub_cat']); +print_admin_menu($array_menu,$cat3); -switch($_GET['sub_cat']) +switch($cat3) { case 'image': ?> @@ -46,7 +45,7 @@ <option value="builtin4">builtin4</option> </select> <br /> - <a href="./?cat=image_fields_define&sub_cat=own">define fields</a> + <a href="./?cat=imagefields_define_own">define fields</a> </td> </tr> <tr> @@ -62,7 +61,7 @@ <option value="own4">own4</option> </select> <br /> - <a href="./?cat=image_fields_define&sub_cat=own">define fields</a> + <a href="./?cat=imagefields_define_own">define fields</a> </td> </tr> <tr> @@ -78,7 +77,7 @@ <option value="exif4">exif4</option> </select> <br /> - <a href="./?cat=image_fields_define&sub_cat=exif">define fields</a> + <a href="./?cat=imagefields_define_exif">define fields</a> </td> </tr> <tr> @@ -100,7 +99,7 @@ <option value="iptc4">iptc4</option> </select> <br /> - <a href="./?cat=image_fields_define&sub_cat=iptc">define fields</a> + <a href="./?cat=imagefields_define_iptc">define fields</a> </td> </tr> </table> @@ -128,7 +127,7 @@ { obj = document.getElementById(coming_from); - NewEntry = new Option( obj.options[ obj.selectedIndex ].value, obj.options[ obj.selectedIndex ].text, false, true ); + NewEntry = new Option( obj.options[ obj.selectedIndex ].text, obj.options[ obj.selectedIndex ].value, false, true ); document.form_image_fields.select_image_fields.options[document.form_image_fields.select_image_fields.options.length] = NewEntry; } Modified: trunk/linpha2/admin/index.php =================================================================== --- trunk/linpha2/admin/index.php 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/admin/index.php 2006-03-05 21:43:01 UTC (rev 4400) @@ -4,6 +4,7 @@ /** * init */ + include_once(LINPHA_DIR.'/lib/include/common.php'); include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); $linpha = new linpha(); $linpha->sql->startSession(); @@ -14,11 +15,30 @@ if( ! isset( $_GET['cat'] ) ) { - $_GET['cat'] = 'home'; + $cat1 = 'home'; } +else +{ + $array = explode('_',$_GET['cat']); + + $cat1 = $array[0]; + + if(isset($array[1])) + { + $cat2 = $array[1]; + } + + if(isset($array[2])) + { + $cat3 = $array[2]; + } + + if(isset($array[3])) + { + $cat4 = $array[3]; + } +} ?> - - <html> <head> <link rel='stylesheet' href='admin.css' type='text/css'> @@ -27,16 +47,15 @@ <?php $array_menu = Array( - 'home' => Array('name' => 'Home', 'link' => '?cat=home'), - 'permissions' => Array('name' => 'Permissions', 'link' => '?cat=permissions'), - 'import' => Array('name' => 'Import', 'link' => '?cat=import'), - 'image_fields' => Array('name' => 'Select image fields', 'link' => '?cat=image_fields'), - 'image_fields_define' => Array('name' => 'Define image fields', 'link' => '?cat=image_fields_define') + 'home' => Array('name' => 'Home', 'link' => 'home'), + 'permissions' => Array('name' => 'Permissions', 'link' => 'permissions'), + 'import' => Array('name' => 'Import', 'link' => 'import'), + 'imagefields' => Array('name' => 'Image fields', 'link' => 'imagefields'), ); -print_admin_menu($array_menu,$_GET['cat']); +print_admin_menu($array_menu,$cat1); -switch($_GET['cat']) +switch($cat1) { case 'home': include_once('./home.php'); @@ -47,12 +66,9 @@ case 'import': include_once('./import.php'); break; -case 'image_fields': +case 'imagefields': include_once('./image_fields.php'); break; -case 'image_fields_define': - include_once('./image_fields_define.php'); - break; } ?> @@ -70,11 +86,11 @@ { if($active==$key) { - echo '<li class="active"><a href="'.$value['link'].'" class="current">'.$value['name'].'</a></li>'; + echo '<li class="active"><a href="./?cat='.$value['link'].'" class="current">'.$value['name'].'</a></li>'; } else { - echo '<li><a href="'.$value['link'].'">'.$value['name'].'</a></li>'; + echo '<li><a href="./?cat='.$value['link'].'">'.$value['name'].'</a></li>'; } } ?> Modified: trunk/linpha2/db_data.sql =================================================================== --- trunk/linpha2/db_data.sql 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/db_data.sql 2006-03-05 21:43:01 UTC (rev 4400) @@ -6,12 +6,14 @@ INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_db_adodb_cache_path', 'var/tmp/adocache', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_db_adodb_caching', '0', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_db_version', '1', 0); -INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_import_autoimport', '1', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_im_bracket_support', '0', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_im_convert_path', '0', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_im_gd_version', '0', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_im_use_convert', '0', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_im_video_thumbnail', '1', 0); +INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_import_autoimport', '1', 0); +INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_image_exif', '1', 0); +INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_image_iptc', '0', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_lang', 'German', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_lang_autolang', '1', 0); INSERT INTO `linpha_config` (`option_name`, `option_value`, `userid`) VALUES ('sys_path_album_dir', 'albums/', 0); Modified: trunk/linpha2/db_mysql.sql =================================================================== --- trunk/linpha2/db_mysql.sql 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/db_mysql.sql 2006-03-05 21:43:01 UTC (rev 4400) @@ -76,4 +76,25 @@ `stats_views` int(11) NOT NULL default '0', `stats_downloads` int(11) NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; \ No newline at end of file +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +DROP TABLE IF EXISTS linpha_meta_fields; +CREATE TABLE IF NOT EXISTS linpha_meta_fields ( + id int(11) NOT NULL auto_increment, + name varchar(255) NOT NULL default '', + field_type int(11) NOT NULL default '0', + builtin int(11) NOT NULL default '0', + enabled int(11) NOT NULL default '0', + PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +DROP TABLE IF EXISTS `linpha_meta_category`; +CREATE TABLE linpha_meta_category ( + id int(11) NOT NULL auto_increment, + field_id int(11) NOT NULL default '0', + name varchar(255) NOT NULL default '', + isprivate int(11) default NULL, + PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-03-05 21:43:01 UTC (rev 4400) @@ -428,9 +428,9 @@ function updateConfig($option_name,$option_value) { $GLOBALS['linpha']->db->Execute("UPDATE ".PREFIX."config SET option_value = ". - "'".$GLOBALS['linpha']->sql->linAddslashes($option_value)."'". + "'".linSql::linAddslashes($option_value)."'". "WHERE option_name = ". - "'".$GLOBALS['linpha']->sql->linAddslashes($option_name)."'"); + "'".linSql::linAddslashes($option_name)."'"); } } // end sub-class linSqlConfig Modified: trunk/linpha2/lib/classes/metadata.config.php =================================================================== --- trunk/linpha2/lib/classes/metadata.config.php 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/lib/classes/metadata.config.php 2006-03-05 21:43:01 UTC (rev 4400) @@ -68,17 +68,10 @@ $exif_search_tags = Array( 'DateTimeOriginal', 'ImageDescription','JpegComment','Artist','Copyright','Make','Model' ); - - -/** - * Function used in search.php to translate iptc tags to human readable values - * if called with $arg == single. If called with $arg == array return the wholw - * thing for metadata.class.php (i.e. left_view ) - * @returns $array or single array value - */ -function translateIptcSearchTags($tag, $arg) + +function getIptcTranslationArray() { - $trans_array= array( + return array( 'caption' => 'Caption', 'caption_writer' => 'Caption Writer', 'headline' => 'Headline', @@ -108,6 +101,17 @@ 'country_code' => 'Country Code', 'trans_reference' => 'Transmission Reference' ); +} + +/** + * Function used in search.php to translate iptc tags to human readable values + * if called with $arg == single. If called with $arg == array return the wholw + * thing for metadata.class.php (i.e. left_view ) + * @returns $array or single array value + */ +function translateIptcSearchTags($tag, $arg) +{ + $trans_array = getIptcTranslationArray(); /** * return: either single value or whole array Modified: trunk/linpha2/linpha2.specs.txt =================================================================== --- trunk/linpha2/linpha2.specs.txt 2006-03-05 14:24:51 UTC (rev 4399) +++ trunk/linpha2/linpha2.specs.txt 2006-03-05 21:43:01 UTC (rev 4400) @@ -219,7 +219,6 @@ 2 = select 3 = select multiple 4 = date - 5 = date (with from to) Part 12. main menu ============================================================================ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |