[Linpha-cvs] SF.net SVN: linpha: [4392] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-04 10:41:27
|
Revision: 4392 Author: fangehrn Date: 2006-03-04 02:41:04 -0800 (Sat, 04 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4392&view=rev Log Message: ----------- * working on basket Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.other.php trunk/linpha2/templates/main_html/global.html.php trunk/linpha2/templates/main_html/view_basket.html.php trunk/linpha2/templates/main_html/view_thumb.head.php Removed Paths: ------------- trunk/linpha2/templates/main_html/view_img.head.php trunk/linpha2/templates/main_html/view_thumbdetail.head.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/ChangeLog 2006-03-04 10:41:04 UTC (rev 4392) @@ -1,4 +1,9 @@ + 2006-03-04 flo + * fixed some double declarations in installer + * working on basket + +2006-03-04 flo * testing svn deleted linpha1 from svn (it is still available on older revisions) maybe we want to delete the linpha1 tags also.. Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/index.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -20,8 +20,8 @@ case 'alb': include_once(LINPHA_DIR.'/lib/module.albums.php'); break; -case 'img': - include_once(LINPHA_DIR.'/lib/module.image.php'); +case 'search': + include_once(LINPHA_DIR.'/lib/module.search.php'); break; } Modified: trunk/linpha2/lib/classes/linpha.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.class.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/lib/classes/linpha.class.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -41,6 +41,7 @@ } include_once(LINPHA_DIR.'/lib/classes/linpha.sql.class.php'); +include_once(LINPHA_DIR.'/lib/classes/linpha.template_new.class.php'); include_once(LINPHA_DIR.'/lib/classes/linpha.image.class.php'); include_once(LINPHA_DIR.'/lib/classes/linpha.filesys.class.php'); @@ -50,11 +51,12 @@ class linpha { - public $db, $sql; + public $db, $sql, $template; function __construct() { $this->sql = new linSql(); + $this->template = new linTemplate(); } } // end class linpha Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -31,7 +31,6 @@ public $id_current; public $id_parent; private $album_dir; -private $head,$body; private $nr_pages, $current_page; // only used if javascript disabled /** @@ -148,7 +147,7 @@ $this->viewBasket_view(); } - include_once(LINPHA_DIR.'/templates/global.html.php'); + include_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'_html/global.html.php'); } /** @@ -173,7 +172,7 @@ } /** - * create top menu + * create optional top menu */ function setMenu() { @@ -210,18 +209,15 @@ $GLOBALS['output']['menu_optional'] = Array( 'basket' => Array( - 'add all to basket (of this page)' => '#', - 'add all to basket (of all pages)' => '#', + 'add all to basket' => '#', 'switch to basket view' => $this->link_url.'&id='.$this->id_current.'&view=basket', 'open basket' => '#' ), - 'thumb' => Array( - 'size' => $array_tn_sizes_links, - 'nr' => $array_nr_links - ), 'view' => Array( 'sort' => $array_sort_orders_links, - 'view' => $array_views_links + 'view' => $array_views_links, + 'thumb_size' => $array_tn_sizes_links, + 'thumb_nr' => $array_nr_links ), 'edit' => Array( 'set_permissions' => LINPHA_DIR.'/admin/permissions.php?&cmd=edit&id='.$this->id_current @@ -247,20 +243,17 @@ ); break; case 'basket_view': - $GLOBALS['output']['menu_optional'] = Array( - 'open basket' => '#', - 'add selected to basket' => '#', - 'edit' => Array( - 'rot_left' => '#', - 'rot_right' => '#', - 'set_permissions' => LINPHA_DIR.'/admin/permissions.php?&cmd=edit&id='.$this->id_current - ) + $GLOBALS['output']['menu_sub'] = Array( + 'back to normal view' => $this->link_url.'&id='.$this->id_current.'&view=thumb', + 'open basket' => '#' ); break; } } } + + /** * img_view */ @@ -269,8 +262,7 @@ */ function viewImg_view() { - $this->head = 'imgview.head.php'; - $this->body = 'imgview.html.php'; + $GLOBALS['linpha']->template->setModuleName('view_img'); /** * search current key in array @@ -347,8 +339,7 @@ */ function viewThumb_View() { - $this->head = 'thumbview.head.php'; - $this->body = 'thumbview.html.php'; + $GLOBALS['linpha']->template->setModuleName('view_thumb'); $this->setSubFolders(); @@ -541,8 +532,7 @@ */ function viewThumbdetail_view() { - $this->head = 'thumbview_detail.head.php'; - $this->body = 'thumbview_detail.html.php'; + $GLOBALS['linpha']->template->setModuleName('view_thumbdetail'); $this->setRandomImages(); } @@ -574,8 +564,8 @@ */ function viewBasket_view() { - $this->head = 'thumbview.head.php'; - $this->body = 'view_basket.html.php'; + $GLOBALS['linpha']->template->setModuleName('view_basket'); + $GLOBALS['linpha']->template->overrideModule('css','view_thumb'); // used the same css definitions as view_thumb $this->setSubFolders(); $this->viewThumb_View_nojs(); Modified: trunk/linpha2/lib/classes/linpha.other.php =================================================================== --- trunk/linpha2/lib/classes/linpha.other.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/lib/classes/linpha.other.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -79,8 +79,23 @@ </div> <?php } + + if( isset( $GLOBALS['output']['menu_sub'] ) ) + { + printSubMenu(); + } } +function printSubMenu() +{ + echo '</div>'; + echo '<div">Basket: '; + foreach($GLOBALS['output']['menu_sub'] AS $key=>$value) + { + echo '<a href="'.$value.'">'.$key.'</a> '; + } +} + function printMenuEntry($index) { foreach($GLOBALS['output'][$index] AS $key=>$value) Modified: trunk/linpha2/templates/main_html/global.html.php =================================================================== --- trunk/linpha2/templates/main_html/global.html.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/templates/main_html/global.html.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -1,160 +1,6 @@ <html> <head> -<style type="text/css"> -<!-- - body { - font-family: arial, helvetica, sans-serif; - margin: 0px; - } - - .header { - background-color: #ffd5ee; - border: 1px solid #f09; - /*position: fixed; - top: 10px; - left: 10px; - right: 10px;*/ - margin: 10px; - z-index: 400; - padding: 5px; - - height: 70px; - } - - /** - * used if .header is position:fixed - */ - .header2 { - /*margin: 10px; - height: 80px;*/ - /*visibility: hidden;*/ - } - - .left { - position: absolute; - top: 100px; - left: 10px; - - width: 205px; - min-height: 400px; - - - padding: 5px; - margin: 0px; - - background-color: #ffd5ee; - - border: 1px solid #f09; - } - - .navigation { - background-color: #d5fcf4; - padding: 0; - border: 1px solid #0c9; - margin: 10px 10px 10px 237px; - } - - .main { - background-color: #d5eeff; - padding: 5px; - border: 1px solid #09f; - margin: 10px 10px 10px 237px; - } - - -/** - * menu - * view http://www.tanfa.co.uk/css/examples/menu/tutorial-h.asp - * the nicest one! - */ - #menu { - width: 100%; - float: left; - } - - #menu ul { - list-style: none; - margin: 0; - padding: 0; - width: 7em; - float: left; - } - - /** - * all elements - */ - #menu a, #menu span { - display: block; - border-width: 1px; - border-style: solid; - border-color: #ccc #888 #555 #bbb; - margin: 0; - padding: 2px 3px; - color: #fff; - background: #036; - text-decoration: none; - } - - /** - * only first level elements - */ - #menu ul a, #menu ul span { - text-align: center; - } - - /** - * only two or more level elements - */ - #menu ul ul a, #menu ul ul span { - text-align: left; - } - - #menu a:hover, #menu span:hover { - color: #fff; - background: #369; - } - - #menu li { - position: relative; - } - - #menu ul ul { - position: absolute; - z-index: 500; - font-size: 0.8em; - width: auto; - min-width: 7em; - white-space: nowrap; - } - - #menu ul ul ul { - position: absolute; - top: 0; - left: 100%; - } - - div#menu ul ul { - display: none; - } - - div#menu ul ul, - div#menu ul li:hover ul ul, - div#menu ul ul li:hover ul ul - {display: none;} - - div#menu ul li:hover ul, - div#menu ul ul li:hover ul, - div#menu ul ul ul li:hover ul - {display: block;} - - #menu_switch a { - width: 1em; - float: left; - } ---> -</style> - - +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'_css/global.css'; ?>' type='text/css'> <?php if( isset($output['sys_log'])) { ?> <style> .sys_log { @@ -183,10 +29,8 @@ } </style> <?php } ?> - - -<?php include_once( LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->imgview->head ); ?> - +<link rel='stylesheet' href='<?php $GLOBALS['linpha']->template->includeFile('css'); ?>' type='text/css'> +<?php $GLOBALS['linpha']->template->includeFile('head'); ?> </head> <body> @@ -239,6 +83,6 @@ left<br />left<br />left<br />left<br />left<br />left<br /> </div> -<?php include_once( LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->imgview->body ); ?> +<?php $GLOBALS['linpha']->template->includeFile('body'); ?> </body> </html> \ No newline at end of file Modified: trunk/linpha2/templates/main_html/view_basket.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_basket.html.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/templates/main_html/view_basket.html.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -11,6 +11,7 @@ <br /><br /> </div> +<form name='basket' action='#' method='POST'> <div id='maindiv' class='main'> <?php $i = 1; @@ -21,21 +22,84 @@ */ if( ($i-1) % $GLOBALS['no_js_nr_cols'] == 0) { - $str_clear = ' clear: left;'; + echo "<div style='height: ".$GLOBALS['def_tn_size']."px; clear: left;' class='imgdiv'>"; + echo "<a href='javascript:void(0)' onclick='check_from_to(".$i.",".($i+$GLOBALS['no_js_nr_cols']-1).")'>Check row</a>"; + echo "</div>"; } - else - { - $str_clear = ''; - } - $i++; ?> - <div style='width: <?php echo $GLOBALS['def_tn_size']; ?>px; height: <?php echo $GLOBALS['def_tn_size']; ?>px; <?php echo $str_clear; ?>' class='imgdiv'> - <a href='./?cat=alb&id=<?php echo $value['id']; ?>'><img height='<?php echo ($GLOBALS['def_tn_size']-20); ?>' src='./get_thumb.php?id=<?php echo $value['id']; ?>' class='img_thumbnail' /></a> + <div style='width: <?php echo $GLOBALS['def_tn_size']; ?>px; height: <?php echo $GLOBALS['def_tn_size']; ?>px;' class='imgdiv'> + <a href='javascript:void(0)' onclick='update_checkbox(<?php echo $i; ?>)'><img height='<?php echo ($GLOBALS['def_tn_size']-20); ?>' src='./get_thumb.php?id=<?php echo $value['id']; ?>' class='img_thumbnail' /></a> <br /> - <input type="checkbox" /> + <input type='checkbox' id='<?php echo $i; ?>' name='img_id[]' value='<?php echo $value['id']; ?>'> <?php echo $value['name']; ?> </div> + <?php + $i++; } ?> + <div style="clear: left;"></div> + <br /><br /> + <input type='button' name='button_check_all' value='check all' onClick='this.value=check_all()'> + <input type='submit' value='add to basket'> + <script language="JavaScript" type='text/javascript'> + var checkflag = 0; + function check_all() { + if (checkflag == 0) // check all + { + checkflag = 1; + var return_value = "remove selection"; + } + else // clear all + { + checkflag = 0; + var return_value = "check all"; + } + + for (var i = 0; i < document.forms[0].length; i++) + { + elem = document.forms[0].elements[i]; + if (elem.type == "checkbox") { + elem.checked = checkflag; + } + } + return return_value; + } + + function update_checkbox(elem_id) + { + elem = document.getElementById(elem_id); + if(elem.checked==true) + { + elem.checked = false; + } + else + { + elem.checked = true; + } + } + + function check_from_to(i_start,i_end) + { + var do_what; + elem = document.getElementById(i_start); + if(elem.checked==true) + { + do_what = false; + } + else + { + do_what = true; + } + + for(var i = i_start; i <= i_end; i++) + { + if(document.getElementById(i)) // don't run out of index on last line + { + document.getElementById(i).checked = do_what; + } + } + } + </script> + </div> \ No newline at end of file Deleted: trunk/linpha2/templates/main_html/view_img.head.php =================================================================== --- trunk/linpha2/templates/main_html/view_img.head.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/templates/main_html/view_img.head.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -1,83 +0,0 @@ -<style type="text/css"> - - a:link { - color: #666666; - text-decoration: underline; - } - a:visited { - color:#666666; - text-decoration: underline; - } - a:hover { - color:#0080D0; - text-decoration: underline; - } - - .mainimage { - width: 350px; - height: auto; - } - - .main { - text-align: center; - } - - -/** - * navigation stuff - */ - .div_all_main { - position: relative; - - background-color: #d5fcf4; - border: 1px solid #0c9; - margin: 10px 10px 10px 237px; - height: 120px; - - text-align: center; - font-size: 0.5em; - - } - - .div_all_prevthumb { - position: absolute; - right: 50%; - margin-right: 50px; - } - - .div_all_nextthumb { - position: absolute; - left: 50%; - margin-left: 50px; - } - - .div_prevnextthumb { - /*border: 1px solid #000000;*/ - float: left; - width: 90px; - height: 90px; - margin: 2px; - } - - .div_currentthumb { - /*border: 1px solid #000000;*/ - position: absolute; - left: 50%; - margin: 2px; - - width: 80px; - margin-left: -40px; /* should be the half of 'width' */ - height: 80px; - } - - .img_prevnextthumb { - width: 75px; - height: auto; - border: 0px; - } - .img_currentthumb { - width: 50px; - height: auto; - border: 0px; - } -</style> \ No newline at end of file Modified: trunk/linpha2/templates/main_html/view_thumb.head.php =================================================================== --- trunk/linpha2/templates/main_html/view_thumb.head.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/templates/main_html/view_thumb.head.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -1,58 +1,12 @@ -<style type="text/css"> - -/** - * need this to calculate heigh of main div - * if you're gettings scrollbars, adjust the height! - */ -.spacer_height { - height: 220px; - position: absolute; - visibility: hidden; -} - -.imgdiv { - border: 1px #000000 solid; - margin: 3px; - text-align: center; - float: left; -} - -.img_thumbnail { - border: 0; - width: auto; -} - -.page_nr_main { - position: absolute; - right: 12px; - top: 100px; - width: 600px; -} -.page_nr { - float: right; - border: 1px #000000 solid; - margin: 5px;; - padding: 10px; - height: 25px; - width: 40px; - white-space: nowrap; -} - -.main { - height: 500px; -} - -</style> - <?php if($GLOBALS['linpha']->imgview->use_javascript) { ?> - <script language="JavaScript" type="text/javascript"> - var tot_photos = <?php echo $GLOBALS['linpha']->imgview->tot_photos; ?>; - var startup_page = 1; - var link_get_thumb = '<?php echo LINPHA_DIR.'/get_thumb.php?id='; ?>'; - var link_url = '<?php echo $GLOBALS['linpha']->imgview->link_url; ?>'; - var tn_size = <?php echo $GLOBALS['def_tn_size']; ?>; - var photos_per_page = 'auto'; - <?php echo $GLOBALS['linpha']->imgview->output['files_db']."\n"; ?> - </script> - <script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/classes/thumbnails.js"> </script> +<script language="JavaScript" type="text/javascript"> +var tot_photos = <?php echo $GLOBALS['linpha']->imgview->tot_photos; ?>; +var startup_page = 1; +var link_get_thumb = '<?php echo LINPHA_DIR.'/get_thumb.php?id='; ?>'; +var link_url = '<?php echo $GLOBALS['linpha']->imgview->link_url; ?>'; +var tn_size = <?php echo $GLOBALS['def_tn_size']; ?>; +var photos_per_page = 'auto'; +<?php echo $GLOBALS['linpha']->imgview->output['files_db']."\n"; ?> +</script> +<script type="text/javascript" language="javascript" src="<?php echo LINPHA_DIR; ?>/lib/classes/thumbnails.js"> </script> <?php } ?> \ No newline at end of file Deleted: trunk/linpha2/templates/main_html/view_thumbdetail.head.php =================================================================== --- trunk/linpha2/templates/main_html/view_thumbdetail.head.php 2006-03-04 08:52:22 UTC (rev 4391) +++ trunk/linpha2/templates/main_html/view_thumbdetail.head.php 2006-03-04 10:41:04 UTC (rev 4392) @@ -1,65 +0,0 @@ -<style type="text/css"> - -h1 { - font-size: 18pt; - font-family: Verdana, Arial, Helvetica, sans-serif; -} - -h2 { - font-size: 14pt; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin-top: 2px; - margin-bottom: 7px; -} - -hr { - clear: both; -} - -.div_random { - height: 200px; -} - -.div_random_img { - float: left; - margin-left: 40px; -} - -.img_random_thumbnail { - border: 0; - - max-width: 130px; - max-height: 130px; -} - -.div_folder { - position: relative; - margin: 2px; - margin-left: 15px; - margin-bottom: 15px; - padding: 5px; - - height: 151px; - width: 700px; - - background-color: #d5fcf4; - border: 1px solid #0c9; -} - -.div_folder_text { - margin-left: 180px; - height: 140px; - padding: 5px; -} - -.img_folder_thumbnail { - position: absolute; - top: 15px; - left: 20px; - - width: 130px; - height: auto; - - border: 0; -} -</style> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |