[Linpha-cvs] SF.net SVN: linpha: [4397] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-05 14:03:47
|
Revision: 4397 Author: fangehrn Date: 2006-03-05 06:03:24 -0800 (Sun, 05 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4397&view=rev Log Message: ----------- Modified Paths: -------------- trunk/linpha2/index.php trunk/linpha2/linpha2.specs.txt Added Paths: ----------- trunk/linpha2/admin/image_fields.php trunk/linpha2/admin/image_fields_define.php trunk/linpha2/admin/index.php Removed Paths: ------------- trunk/linpha2/admin/image.php trunk/linpha2/lib/modules/module.admin.php Deleted: trunk/linpha2/admin/image.php =================================================================== --- trunk/linpha2/admin/image.php 2006-03-04 18:50:34 UTC (rev 4396) +++ trunk/linpha2/admin/image.php 2006-03-05 14:03:24 UTC (rev 4397) @@ -1,78 +0,0 @@ -<div align="center"> -<table border="0"> - <tr> - <td valign="top" rowspan="3" align="center"> - Current selection<br /> - <select name="image_fields" size="30" style="width: 200px;"> - <option value=""></option> - <option value=""></option> - <option value=""></option> - <option value=""></option> - </select> - <br /> - <input type="button" name="shift_up" value="^" /> - <input type="button" name="shift_down" value="v" /> - <input type="button" name="remove" value=">" /> - </td> - <td> - <input type="button" name="builtin_shiftleft" value="<" /> - </td> - <td> - Builtin fields<br /> - <select name="builtin_fields" size="10" style="width: 200px;"> - <option value=""></option> - <option value=""></option> - <option value=""></option> - <option value=""></option> - </select> - </td> - </tr> - <tr> - <td> - <input type="button" name="exif_shiftleft" value="<" /> - </td> - <td> - Exif fields<br /> - <select name="exif_fields" size="10" style="width: 200px;"> - <option value=""></option> - <option value=""></option> - <option value=""></option> - <option value=""></option> - </select> - </td> - </tr> - <tr> - <td> - <input type="button" name="iptc_shiftleft" value="<" /> - </td> - <td> - IPTC fields<br /> - <select name="iptc_fields" size="10" style="width: 200px;"> - <option value=""></option> - <option value=""></option> - <option value=""></option> - <option value=""></option> - </select> - </td> - </tr> - <tr> - <td> - <input type="text" name="title" value="" /><br /> - <input type="button" name="add_title" value="add title" /> - </td> - <td> - <input type="button" name="own_shiftleft" value="<" /> - </td> - <td> - Own fields<br /> - <select name="own_fields" size="10" style="width: 200px;"> - <option value=""></option> - <option value=""></option> - <option value=""></option> - <option value=""></option> - </select> - </td> - </tr> -</table> - -</div> \ No newline at end of file Copied: trunk/linpha2/admin/image_fields.php (from rev 4396, trunk/linpha2/admin/image.php) =================================================================== --- trunk/linpha2/admin/image_fields.php (rev 0) +++ trunk/linpha2/admin/image_fields.php 2006-03-05 14:03:24 UTC (rev 4397) @@ -0,0 +1,236 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + + +if(!isset( $_GET['cat'])) +{ + $_GET['cat'] = 'image'; +} + +$array_menu = Array( + 'image' => 'Image', + 'video' => 'Video' +); +?> + +<ul id="navlist"> + <?php + foreach($array_menu AS $key=>$value) + { + if($_GET['cat']==$key) + { + echo '<li id="active"><a href="?cat='.$key.'" id="current">'.$value.'</a></li>'; + } + else + { + echo '<li><a href="?cat='.$key.'">'.$value.'</a></li>'; + } + } + ?> +</ul> + + +<?php +switch($_GET['cat']) +{ +case 'image': +?> + <form name="form_image_fields"> + <div align="center"> + <table border="0"> + <tr> + <td valign="top" rowspan="3" align="center"> + Current image fields shown<br /> + <select name="select_image_fields" size="25" style="width: 200px;"> + <option value="element1">element1</option> + <option value="element2">element2</option> + <option value="element3">element3</option> + <option value="element4">element4</option> + </select> + <br /> + <input type="button" name="shift_up" value="^" onclick="moveupElement()" /> + <input type="button" name="shift_down" value="v" onclick="movedownElement()" /> + </td> + <td> + <input type="button" name="builtin_shiftleft" value="<" onclick="copyElement('builtin_fields')" /> + </td> + <td> + Builtin fields<br /> + <select id="builtin_fields" name="builtin_fields" size="7" style="width: 200px;"> + <option value="builtin1">builtin1</option> + <option value="builtin2">builtin2</option> + <option value="builtin3">builtin3</option> + <option value="builtin4">builtin4</option> + </select> + <br /> + <a href="image_fields.php?cat=own">define fields</a> + </td> + </tr> + <tr> + <td> + <input type="button" name="own_shiftleft" value="<" onclick="copyElement('own_fields')" /> + </td> + <td> + Own fields<br /> + <select id="own_fields" name="own_fields" size="7" style="width: 200px;"> + <option value="own1">own1</option> + <option value="own2">own2</option> + <option value="own3">own3</option> + <option value="own4">own4</option> + </select> + <br /> + <a href="image_fields.php?cat=own">define fields</a> + </td> + </tr> + <tr> + <td> + <input type="button" name="exif_shiftleft" value="<" onclick="copyElement('exif_fields')" /> + </td> + <td> + Exif fields<br /> + <select id="exif_fields" name="exif_fields" size="7" style="width: 200px;"> + <option value="exif1">exif1</option> + <option value="exif2">exif2</option> + <option value="exif3">exif3</option> + <option value="exif4">exif4</option> + </select> + <br /> + <a href="image_fields.php?cat=exif">define fields</a> + </td> + </tr> + <tr> + <td> + <input type="button" name="remove" value="delete selected" onclick="deleteElement()" /> + <br /><br /> + <input type="text" name="title_name" value="" /><br /> + <input type="button" name="add_title" value="add title" onclick="addElement()" /> + </td> + <td> + <input type="button" name="iptc_shiftleft" value="<" onclick="copyElement('iptc_fields')" /> + </td> + <td> + IPTC fields<br /> + <select id="iptc_fields" name="iptc_fields" size="7" style="width: 200px;"> + <option value="iptc1">iptc1</option> + <option value="iptc2">iptc2</option> + <option value="iptc3">iptc3</option> + <option value="iptc4">iptc4</option> + </select> + <br /> + <a href="image_fields.php?cat=iptc">define fields</a> + </td> + </tr> + </table> + + </div> + </form> +<?php + break; +case 'video': +?> + +<?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; + + /** + * set selectedIndex back to field above + */ + 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; + } +} + +function moveupElement () +{ + current_index = document.form_image_fields.select_image_fields.selectedIndex; + if( current_index != 0 ) + { + /** + * 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; + + 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; + } +} + +function movedownElement () +{ + current_index = document.form_image_fields.select_image_fields.selectedIndex; + + if( current_index != ( document.form_image_fields.select_image_fields.length - 1 ) ) + { + /** + * 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; + + 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; + } +} +</script> \ No newline at end of file Added: trunk/linpha2/admin/image_fields_define.php =================================================================== --- trunk/linpha2/admin/image_fields_define.php (rev 0) +++ trunk/linpha2/admin/image_fields_define.php 2006-03-05 14:03:24 UTC (rev 4397) @@ -0,0 +1,194 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + +if(!isset( $_GET['cat'])) +{ + $_GET['cat'] = 'own'; +} + +$array_menu = Array( + 'own' => 'Own', + 'exif' => 'Exif', + 'iptc' => 'Iptc' +); +?> + +<ul id="navlist"> + <?php + foreach($array_menu AS $key=>$value) + { + if($_GET['cat']==$key) + { + echo '<li id="active"><a href="?cat='.$key.'" id="current">'.$value.' fields</a></li>'; + } + else + { + echo '<li><a href="?cat='.$key.'">'.$value.' fields</a></li>'; + } + } + ?> +</ul> + + +<?php +switch($_GET['cat']) +{ +case 'own': +?> + + + +<?php + break; +case 'exif': +case 'iptc': + switch($_GET['cat']) + { + case 'exif': + break; + case 'iptc': + break; + } +?> + + <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 + <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;"> + <option value="element1">element1</option> + <option value="element2">element2</option> + <option value="element3">element3</option> + <option value="element4">element4</option> + </select> + <br /> + </td> + <td> + <input type="button" name="shiftleft" value="<" onclick="addElement()" /> + <br /> + <input type="button" name="shiftright" value=">" onclick="removeElement()" /> + </td> + <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> + </select> + </td> + </tr> + </table> + + </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; + + /** + * set selectedIndex back to field above + */ + 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; + } +} + +function moveupElement () +{ + current_index = document.form_image_fields.select_image_fields.selectedIndex; + if( current_index != 0 ) + { + /** + * 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; + + 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; + } +} + +function movedownElement () +{ + current_index = document.form_image_fields.select_image_fields.selectedIndex; + + if( current_index != ( document.form_image_fields.select_image_fields.length - 1 ) ) + { + /** + * 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; + + 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; + } +} +</script> \ No newline at end of file Added: trunk/linpha2/admin/index.php =================================================================== --- trunk/linpha2/admin/index.php (rev 0) +++ trunk/linpha2/admin/index.php 2006-03-05 14:03:24 UTC (rev 4397) @@ -0,0 +1,88 @@ +<?php +define('LINPHA_DIR','.'); + +/** + * init + */ + include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); + $linpha = new linpha(); + $linpha->sql->startSession(); + +/** + * @todo admin permission check + */ +?> + +<style> + +#navlist +{ +padding: 3px 0; +margin-left: 0; +border-bottom: 1px solid #778; +font: bold 12px Verdana, sans-serif; +} + +#navlist li +{ +list-style: none; +margin: 0; +display: inline; +} + +#navlist li a +{ +padding: 3px 0.5em; +margin-left: 3px; +border: 1px solid #778; +border-bottom: none; +background: #DDE; +text-decoration: none; +} + +#navlist li a:link { color: #448; } +#navlist li a:visited { color: #667; } + +#navlist li a:hover +{ +color: #000; +background: #AAE; +border-color: #227; +} + +#navlist li a#current +{ +background: white; +border-bottom: 1px solid white; +} + + +.option_title +{ + font-weight: bold; +} +</style> + + + +<a href="./?cat=permissions">Permissions</a> +<a href="./?cat=import">Import</a> +<a href="./?cat=image_fields">Select image fields</a> +<a href="./?cat=image_fields_define">Define image fields</a> + +<?php +switch($_GET['cat']) +{ +case 'permissions': + include_once('./permissions.php'); + break; +case 'import': + include_once('./import.php'); + break; +case 'image_fields': + include_once('./image_fields.php'); + break; +case 'image_fields_define': + include_once('./image_fields_define.php'); + break; +} \ No newline at end of file Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-03-04 18:50:34 UTC (rev 4396) +++ trunk/linpha2/index.php 2006-03-05 14:03:24 UTC (rev 4397) @@ -14,7 +14,7 @@ $output['menu_main'] = Array( 'home' => LINPHA_DIR . '/', - 'admin' => LINPHA_DIR . '/?cat=admin', + 'admin' => LINPHA_DIR . '/admin/', 'search' => '#', /*LINPHA_DIR . '/?cat=search'*/ 'login' => '#' /*LINPHA_DIR . '/?cat=login'*/ ); @@ -34,9 +34,6 @@ case 'basket': include_once(LINPHA_DIR.'/lib/modules/module.basket.php'); break; -case 'admin': - include_once(LINPHA_DIR.'/lib/modules/module.admin.php'); - break; } ?> \ No newline at end of file Deleted: trunk/linpha2/lib/modules/module.admin.php =================================================================== --- trunk/linpha2/lib/modules/module.admin.php 2006-03-04 18:50:34 UTC (rev 4396) +++ trunk/linpha2/lib/modules/module.admin.php 2006-03-05 14:03:24 UTC (rev 4397) @@ -1,8 +0,0 @@ -<?php - - -?> - -<a href="./admin/permissions.php">Permissions</a> -<a href="./admin/import.php">Import</a> -<a href="./admin/image.php">Image fields</a> \ No newline at end of file Modified: trunk/linpha2/linpha2.specs.txt =================================================================== --- trunk/linpha2/linpha2.specs.txt 2006-03-04 18:50:34 UTC (rev 4396) +++ trunk/linpha2/linpha2.specs.txt 2006-03-05 14:03:24 UTC (rev 4397) @@ -213,6 +213,14 @@ for Holidays, all images in this album should be shown (but what to do with subfolders?) + - ability to define own image fields (low priority) + types: + 1 = text + 2 = select + 3 = select multiple + 4 = date + 5 = date (with from to) + Part 12. main menu ============================================================================ - use a css only menu? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |