[Linpha-cvs] SF.net SVN: linpha: [4430] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-22 21:33:47
|
Revision: 4430 Author: fangehrn Date: 2006-03-22 13:33:26 -0800 (Wed, 22 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4430&view=rev Log Message: ----------- updated templates Modified Paths: -------------- trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.template_new.class.php trunk/linpha2/lib/classes/thumbnails.js trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/templates/css/default/basket.css trunk/linpha2/templates/css/default/home.css trunk/linpha2/templates/css/default/view_thumb.css trunk/linpha2/templates/html/default/basket.html.php trunk/linpha2/templates/html/default/global.html.php trunk/linpha2/templates/html/default/home.html.php trunk/linpha2/templates/html/default/view_comment.html.php trunk/linpha2/templates/html/default/view_thumb.html.php Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/index.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -5,7 +5,6 @@ /** * some init stuff - * @todo where to place? */ include_once(LINPHA_DIR.'/lib/classes/linpha.class.php'); $linpha = new linpha(); @@ -16,14 +15,6 @@ $_GET['cat'] = 'alb'; } - $linpha->template->output['menu_main'] = Array( - Array('name' => 'home', 'value' => LINPHA_DIR . '/'), - Array('name' => 'admin', 'value' => LINPHA_DIR . '/admin/'), - Array('name' => 'search', 'value' => '#'), /*LINPHA_DIR . '/?cat=search'*/ - Array('name' => 'login', 'value' => '#') /*LINPHA_DIR . '/?cat=login'*/ - ); - - /** * open modules */ Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -44,6 +44,7 @@ if(false == in_array($text."\n", $filedata)) { $filedata[] = $text."\n"; + natcasesort($filedata); // Sort an array using a case insensitive "natural order" algorithm file_put_contents($tmpfile, $filedata); } } @@ -94,13 +95,13 @@ $link = 'open'; $str_href = '>'; } + ?> - ?> - <div id="menu_switch"> - <a href="<?php echo $GLOBALS['linpha']->template->URL_full.'&menu='.$link; - ?>"><?php echo $str_href; ?></a> - </div> - <?php /* +<div id="menu_switch"> +<a href="<?php echo $GLOBALS['linpha']->template->URL_full.'&menu='.$link; + ?>"><?php echo $str_href; ?></a> +</div> +<?php /* onclick="open_close_menu(); return false;" <script language="JavaScript" type="text/javascript"> var menu_is_open = false; @@ -126,10 +127,12 @@ </script> */ ?> - <div id="menu_optional" style="<?php echo $style; ?>"> - <?php printMenuEntry('menu_optional'); ?> - </div> - <?php +<div id="menu_optional" style="<?php echo $style; ?>"> +<?php printMenuEntry('menu_optional'); ?> + +</div> +<?php + } if( isset( $GLOBALS['linpha']->template->output['menu_sub'] ) ) @@ -152,7 +155,7 @@ { foreach($GLOBALS['linpha']->template->output[$index] AS $key=>$value) { - echo "\n\n".'<ul>'."\n"; + echo "\n".'<ul>'."\n"; if(!is_array($value['value'])) { echo "\t".'<li><a href="'.$value['value'].'">'.$value['name'].'</a></li>'."\n"; @@ -165,26 +168,52 @@ foreach($value['value'] AS $sub_value) { - if(!is_array($sub_value['value'])) + /** + * search special + */ + if($sub_value['name'] == 'special_search') { - echo "\t\t".'<li><a href="'.$sub_value['value'].'">'.$sub_value['name'].'</a></li>'."\n"; +?> + <li><span> + <input type="text" name="search" value="" /> + <input type="submit" name="submit" value="<?php echo i18n("search"); ?>" /> + </span></li> +<?php } + /** + * login special + */ + elseif($sub_value['name'] == 'special_login') + { +?> + <li><span> + <?php echo i18n("Username"); ?>: <input type="text" name="username" value="" /><br /> + <?php echo i18n("Password"); ?>: <input type="password" name="password" value="" /><br /> + <input type="submit" name="submit" value="<?php echo i18n("login"); ?>" /> + </span></li> +<?php + } else { - echo "\t\t".'<li><span>'.$sub_value['name'].'</span>'."\n"; - - echo "\t\t".'<ul>'."\n"; - - foreach($sub_value['value'] AS $subsub_value) + if(!is_array($sub_value['value'])) { - echo "\t\t\t".'<li><a href="'.$subsub_value['value'].'">'.$subsub_value['name'].'</a></li>'."\n"; + echo "\t\t".'<li><a href="'.$sub_value['value'].'">'.$sub_value['name'].'</a></li>'."\n"; } - - echo "\t\t".'</ul>'."\n"; - echo "\t\t".'</li>'."\n"; + else + { + echo "\t\t".'<li><span>'.$sub_value['name'].' ></span>'."\n"; + + echo "\t\t".'<ul>'."\n"; + + foreach($sub_value['value'] AS $subsub_value) + { + echo "\t\t\t".'<li><a href="'.$subsub_value['value'].'">'.$subsub_value['name'].'</a></li>'."\n"; + } + + echo "\t\t".'</ul>'."\n"; + echo "\t\t".'</li>'."\n"; + } } - - } echo "\t".'</ul>'."\n"; Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -89,6 +89,9 @@ case 'meta': $this->view = 'meta_view'; break; + case 'comment': + $this->view = 'comment_view'; + break; default: $this->view = 'thumb_view'; } @@ -109,9 +112,6 @@ case 'meta': $this->view = 'meta_view'; break; - case 'comment': - $this->view = 'comment_view'; - break; default: $this->view = 'img_view'; } @@ -185,7 +185,7 @@ break; } - include_once(LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'_html/global.html.php'); + include_once(LINPHA_DIR.'/templates/html/'.$GLOBALS['linpha']->template->template_name.'/global.html.php'); } /** @@ -270,7 +270,7 @@ Array( 'name' => 'edit', 'value' => Array( - Array('name' => i18n('set_permissions'), 'value' => $edit_permission_link) + Array('name' => i18n('set permissions'), 'value' => $edit_permission_link) ) ), Array( @@ -601,6 +601,11 @@ $this->viewThumb_View_nojs(); } + function viewComment_view() + { + $GLOBALS['linpha']->template->setModuleName('view_comment'); + } + /** ***** image view */ Modified: trunk/linpha2/lib/classes/linpha.template_new.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template_new.class.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/lib/classes/linpha.template_new.class.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -12,7 +12,8 @@ function __construct() { - $this->template_name = 'main'; + $this->template_name = 'default'; + $this->output['title'] = "Linpha 2.0"; } /** @@ -23,13 +24,13 @@ switch($what) { case 'body': - $filename = LINPHA_DIR.'/templates/'.$this->template_name.'_html/'.$this->body_name.'.html.php'; + $filename = LINPHA_DIR.'/templates/html/'.$this->template_name.'/'.$this->body_name.'.html.php'; break; case 'head': - $filename = LINPHA_DIR.'/templates/'.$this->template_name.'_html/'.$this->head_name.'.head.php'; + $filename = LINPHA_DIR.'/templates/html/'.$this->template_name.'/'.$this->head_name.'.head.php'; break; case 'css': - echo LINPHA_DIR.'/templates/'.$this->template_name.'_css/'.$this->css_name.'.css'; + echo LINPHA_DIR.'/templates/css/'.$this->template_name.'/'.$this->css_name.'.css'; break; } Modified: trunk/linpha2/lib/classes/thumbnails.js =================================================================== --- trunk/linpha2/lib/classes/thumbnails.js 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/lib/classes/thumbnails.js 2006-03-22 21:33:26 UTC (rev 4430) @@ -167,13 +167,13 @@ var myImg = document.createElement("img"); myImg.src = link_get_thumb + img_ids[i]['id']; - myImg.height = (tn_size-img_div_spacer_height); + //myImg.height = (tn_size-img_div_spacer_height); - /* + myImg.style.cssText = "max-width: " + tn_size + "; max-height: " + (tn_size-img_div_spacer_height) + ";"; - myImg.style.max-width = tn_size; - myImg.style.max-height = tn_size-img_div_spacer_height; - */ + //myImg.style.max-width = tn_size; + //myImg.style.max-height = tn_size-img_div_spacer_height; + var myAttribute=document.createAttribute("class"); myAttribute.nodeValue = 'img_thumbnail'; Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/lib/modules/module.basket.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -81,14 +81,30 @@ } } - /** * build basket view */ + /** + * get and save parent ids + */ + if( count($_SESSION['basket_ids']) > 0 ) + { + sort($_SESSION['basket_ids']); + foreach($_SESSION['basket_ids'] AS $value) + { + $data = $GLOBALS['linpha']->db->GetRow("SELECT parent_id FROM ".PREFIX."photos WHERE id = '". linSql::linAddslashes($value)."'" ); + $array_folders[] = $data[0]; + + /** + * store all imgids in an array with parent_id as the key for easy access + */ + $GLOBALS['linpha']->template->output['basket_folder_contents'][$data[0]][] = $value; + } + + $GLOBALS['linpha']->template->output['basket_folders'] = array_unique($array_folders); + } - - $linpha->template->setModuleName('basket'); $linpha->template->URL_full = LINPHA_DIR.'/?cat=basket&ref_id='.$_GET['ref_id']; -include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'_html/global.html.php'); +include_once(LINPHA_DIR.'/templates/html/'.$GLOBALS['linpha']->template->template_name.'/global.html.php'); ?> \ No newline at end of file Modified: trunk/linpha2/templates/css/default/basket.css =================================================================== --- trunk/linpha2/templates/css/default/basket.css 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/css/default/basket.css 2006-03-22 21:33:26 UTC (rev 4430) @@ -1,3 +1,11 @@ +.main { + margin-left: 10px; +} + +.navigation { + margin-left: 10px; +} + .imgdiv { border: 1px #000000 solid; margin: 3px; Modified: trunk/linpha2/templates/css/default/home.css =================================================================== --- trunk/linpha2/templates/css/default/home.css 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/css/default/home.css 2006-03-22 21:33:26 UTC (rev 4430) @@ -1,3 +1,9 @@ +.main { + margin-left: 10px; +} + + + h1 { font-size: 18pt; font-family: Verdana, Arial, Helvetica, sans-serif; Modified: trunk/linpha2/templates/css/default/view_thumb.css =================================================================== --- trunk/linpha2/templates/css/default/view_thumb.css 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/css/default/view_thumb.css 2006-03-22 21:33:26 UTC (rev 4430) @@ -1,3 +1,12 @@ +.main { + margin-left: 10px; +} + +.navigation { + margin-left: 10px; +} + + /** * need this to calculate heigh of main div * if you're gettings scrollbars, adjust the height! Modified: trunk/linpha2/templates/html/default/basket.html.php =================================================================== --- trunk/linpha2/templates/html/default/basket.html.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/html/default/basket.html.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -12,64 +12,25 @@ <?php if( count($_SESSION['basket_ids']) > 0 ) { ?> - -<?php - - /** - * get and save parent ids - */ - sort($_SESSION['basket_ids']); - foreach($_SESSION['basket_ids'] AS $value) + <?php + foreach($GLOBALS['linpha']->template->output['basket_folders'] AS $value) { - $data = $GLOBALS['linpha']->db->GetRow("SELECT parent_id FROM ".PREFIX."photos WHERE id = '". linSql::linAddslashes($value)."'" ); - $array_folder_ids[] = $data[0]; - - $array_folders[$data[0]][] = $value; // store all imgids in an array with parent_id as the key - } - - $array_folder_ids = array_unique($array_folder_ids); - - - - foreach($array_folder_ids AS $value) - { echo set_navigation_line($value).'<br />'; - $i = 1; - foreach($array_folders[$value] AS $sub_value) + foreach($GLOBALS['linpha']->template->output['basket_folder_contents'][$value] AS $sub_value) { - ?> + ?> <div class='imgdiv'> <a href='javascript:void(0)' onclick='update_checkbox(<?php echo $i; ?>)'><img src='<?php echo LINPHA_DIR.'/get_thumb.php?id='.$sub_value; ?>' class='img_thumbnail' /></a> <br /> <input type='checkbox' id='<?php echo $i; ?>' name='img_id[]' value='<?php echo $sub_value; ?>'> </div> - <?php + <?php $i++; } - echo '<div style="clear: both;"></div><br /><br />'; } - - - - - - - /* - echo '<pre>'; - print_r($_SESSION['basket_ids']); - - - foreach($array_path_ids AS $value) - { - print_r(linSql::getFullFilenameFromId($value)); - } - - echo '</pre>';*/ -?> - - + ?> <script language="JavaScript" type='text/javascript'> function update_checkbox(elem_id) { @@ -84,14 +45,11 @@ } } </script> - - - - -<?php } else { - +<?php +} +else +{ echo i18n("Empty Basket"); - } ?> </div> </form> \ No newline at end of file Modified: trunk/linpha2/templates/html/default/global.html.php =================================================================== --- trunk/linpha2/templates/html/default/global.html.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/html/default/global.html.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -1,6 +1,43 @@ +<?php +/** + * create main menu + */ +$GLOBALS['linpha']->template->output['menu_main'] = Array( + Array('name' => 'home', 'value' => LINPHA_DIR . '/'), + Array('name' => 'admin', 'value' => LINPHA_DIR . '/admin/'), + Array( + 'name' => 'search', + 'value' => Array( + Array( + 'name' => 'special_search', + 'value' => '#' + ), + Array( + 'name' => 'extended search', + 'value' => LINPHA_DIR . '/?cat=search' + ) + ) + ), + Array( + 'name' => 'login', + 'value' => Array( + Array( + 'name' => 'special_login', + 'value' => '#' + ) + ) + ) +); + +/** + * first output starts here + */ +?> +<?php /*header('Content-type: text/html; charset='.$html_charset);*/ ?> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'_css/global.css'; ?>' type='text/css'> +<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/css/'.$GLOBALS['linpha']->template->template_name.'/global.css'; ?>' type='text/css'> <?php if( isset($GLOBALS['linpha']->template->output['sys_log'])) { ?> <style> .sys_log { @@ -31,14 +68,14 @@ <?php } ?> <link rel='stylesheet' href='<?php $GLOBALS['linpha']->template->includeFile('css'); ?>' type='text/css'> <?php $GLOBALS['linpha']->template->includeFile('head'); ?> +<title><?php echo $GLOBALS['linpha']->template->output['title']; ?></title> </head> <body> - <?php if( isset($GLOBALS['linpha']->template->output['sys_log']) ) { ?> <div id="sys_log" class="sys_log"> <div class="sys_log_close"><a href="javascript:toggleWindow()">X</a></div> <div id="sys_log_text" class="sys_log_text"> - Linpha Syslog:<br /> + <?php echo i18n("Linpha syslog"); ?>:<br /> <?php echo $GLOBALS['linpha']->template->output['sys_log']; ?> </div> </div> @@ -70,13 +107,15 @@ </script> <?php } ?> - +<!-- header with menu //--> <div class="header"> <div id="menu"> - <?php printMenu(); ?> +<?php printMenu(); echo "\n"; ?> </div> </div> + <div class="header2"></div> +<!-- end header with menu //--> <?php $GLOBALS['linpha']->template->includeFile('body'); ?> </body> Modified: trunk/linpha2/templates/html/default/home.html.php =================================================================== --- trunk/linpha2/templates/html/default/home.html.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/html/default/home.html.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -1,8 +1,3 @@ -<div class="left"> -left<br />left<br />left<br />left<br />left<br />left<br /> -left<br />left<br />left<br />left<br />left<br />left<br /> -</div> - <div id='maindiv' class='main'> <h1><?php echo i18n("Welcome"); ?></h1> @@ -19,7 +14,7 @@ ?> <div class='div_random_img'> <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' - . '<img class="img_random_thumbnail" title="'.htmlentities($value['path']).'" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" /></a>'; ?> + . '<img class="img_random_thumbnail" title="'.htmlentities($value['path']).'" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="randomimage" /></a>'; ?> </div> <?php } @@ -40,7 +35,7 @@ ?> <div class='div_folder'> <?php echo '<a href="'.LINPHA_DIR.'/?cat=alb&id='.$value['id'].'">' - . '<img class="img_folder_thumbnail" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" /></a>'; ?> + . '<img class="img_folder_thumbnail" src="'. LINPHA_DIR.'/get_thumb.php?id=' .$value['id'] .'" alt="thumbnail_album" /></a>'; ?> <div class='div_folder_text'> <h2><?php echo $value['name']; ?></h2> Modified: trunk/linpha2/templates/html/default/view_comment.html.php =================================================================== --- trunk/linpha2/templates/html/default/view_comment.html.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/html/default/view_comment.html.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -23,15 +23,14 @@ "WHERE md5sum = '".$GLOBALS['linpha']->imgview->id_current."'"); } } - - ?> -<div id='maindiv' class='main'> -<form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> <?php $data = $GLOBALS['linpha']->db->GetRow("SELECT id, time, author, comment FROM ".PREFIX."meta_comments"); ?> + +<div id='maindiv' class='main'> +<form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> <a href="<?php echo $GLOBALS['linpha']->template->URL_full.'&view=thumb'; ?>">back</a> <br /><br /> Modified: trunk/linpha2/templates/html/default/view_thumb.html.php =================================================================== --- trunk/linpha2/templates/html/default/view_thumb.html.php 2006-03-22 19:18:37 UTC (rev 4429) +++ trunk/linpha2/templates/html/default/view_thumb.html.php 2006-03-22 21:33:26 UTC (rev 4430) @@ -1,9 +1,3 @@ -<div class="left"> -left<br />left<br />left<br />left<br />left<br />left<br /> -left<br />left<br />left<br />left<br />left<br />left<br /> -</div> - - <?php /** * javascript enabled @@ -94,6 +88,4 @@ </div> <?php } -?> - - +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |