[Linpha-cvs] SF.net SVN: linpha: [4605] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-10-29 00:18:48
|
Revision: 4605 http://svn.sourceforge.net/linpha/?rev=4605&view=rev Author: fangehrn Date: 2006-10-28 17:18:31 -0700 (Sat, 28 Oct 2006) Log Message: ----------- 2006-10-29 flo * changed accesskey for prev/next to page up/down * improved basket view Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/modules/module.basket.php trunk/linpha2/templates/default/basket.html.php trunk/linpha2/templates/default/view_basket.html.php trunk/linpha2/templates/default/view_img.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/ChangeLog 2006-10-29 00:18:31 UTC (rev 4605) @@ -1,3 +1,7 @@ +2006-10-29 flo + * changed accesskey for prev/next to page up/down + * improved basket view + 2006-10-28 flo * improved a lot * reset database and enjoy Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/lib/js/LinImage.js 2006-10-29 00:18:31 UTC (rev 4605) @@ -433,48 +433,61 @@ if (e == null) { // ie keycode = event.keyCode; + ctrlKey = event.ctrlKey; } else { // mozilla keycode = e.which; + ctrlKey = e.ctrlKey; } - /*if( e.ctrlKey ) + /*if( ctrlKey ) { alert('ctrl pressed'); return; }*/ + //alert(keycode); + key = String.fromCharCode(keycode).toLowerCase(); - if ((keycode == 39) && (e.ctrlKey == true)) // ctrl + arrow right + //if ((keycode == 39) && (ctrlKey == true)) // ctrl + arrow right + if (keycode == 34) // page down { myLinImage.disableKeyboardNav(); myLinImage.moveNext(); + return false; } - else if ((keycode == 37) && (e.ctrlKey == true)) // ctrl + arrow left + //else if ((keycode == 37) && (ctrlKey == true)) // ctrl + arrow left + else if (keycode == 33) // page up { myLinImage.disableKeyboardNav(); myLinImage.movePrev(); + return false; } - else if ((keycode == 32) && (e.ctrlKey == true)) // ctrl + space + else if ((keycode == 32) && (ctrlKey == true)) // ctrl + space { myLinImage.slideshowStartStop(); } else if ((keycode == 122)) // F11 { if( fullscreenActive ) { + $('divSlideshowExit').show(); // hide exit button to force exit again with F11 myLinImage.fullscreenStop(); } else { + $('divSlideshowExit').hide(); myLinImage.fullscreenStart(); } } - else if ((keycode == 36) && (e.ctrlKey == true)) // ctrl + home + else if ((keycode == 36) && (ctrlKey == true)) // ctrl + home + //else if (keycode == 36) // home { myLinImage.moveFirst(); + return false; } - else if ((keycode == 35) && (e.ctrlKey == true)) // ctrl + end + else if ((keycode == 35) && (ctrlKey == true)) // ctrl + end + //else if (keycode == 35) // end { myLinImage.moveLast(); -// return false; + return false; } else if( fullscreenActive && ((key == 'f') || (key == 'x') || (key == 'o') || (key == 'c') ) ) // close fullscreen { @@ -494,43 +507,6 @@ myLinImage.disableKeyboardNav(); myLinImage.moveNext(); } - - -/* if (!e) var e = window.event; - - * } - else if ((38 == key) && (true == e.ctrlKey)) { //ctrl + arrow up - link_id = 'page_up'; - } - else - link_id = 'page_next'; - } - else if ((40 == key) && (true == e.ctrlKey)) { //ctrl + arrow down - if (slideshow) { - slideshow(); - } - }*/ - - - - /*if( fullscreenActive && ( (key == 'x') || (key == 'o') || (key == 'c') ) ) { // close fullscreen - myLinImage.fullscreenStop(); - } else if(key == 'f'){ // start/stop fullscreen - if( fullscreenActive ) { - myLinImage.fullscreenStop(); - } else { - myLinImage.fullscreenStart(); - } - } else if(key == 's'){ // start/stop slideshow - myLinImage.slideshowStartStop(); - } else if(key == 'p'){ // display previous image - myLinImage.disableKeyboardNav(); - myLinImage.movePrev(); - } else if(key == 'n'){ // display next image - myLinImage.disableKeyboardNav(); - myLinImage.moveNext(); - }*/ - }, /** Modified: trunk/linpha2/lib/modules/module.basket.php =================================================================== --- trunk/linpha2/lib/modules/module.basket.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/lib/modules/module.basket.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -24,6 +24,9 @@ */ if(!defined('LINPHA_DIR')) { exit(1); } +set_time_limit(0); +ini_set('max_execution_time','1000'); + /** * parse POST data and GET commands */ @@ -171,7 +174,31 @@ $GLOBALS['linpha']->template->output['basket_folders'] = array_unique($array_folders); } + + /** + * create select form + */ + $GLOBALS['linpha']->template->output['select_checkout'] = '<option value=""></option>'."\n"; + if( $GLOBALS['linpha']->sql->checkPermission('basket_download') ) + { + $GLOBALS['linpha']->template->output['select_checkout'] .= '<option value="download"'. + (isset($_REQUEST['checkout_as']) && $_REQUEST['checkout_as'] == 'download' ? ' selected="selected"' : ''). + '>'.i18n("Download").'</option>'."\n"; + } + if( $GLOBALS['linpha']->sql->checkPermission('basket_mail') ) + { + $GLOBALS['linpha']->template->output['select_checkout'] .= '<option value="mail"'. + (isset($_REQUEST['checkout_as']) && $_REQUEST['checkout_as'] == 'mail' ? ' selected="selected"' : ''). + '>'.i18n("Send As Mail").'</option>'."\n"; + } + if( $GLOBALS['linpha']->sql->checkPermission('basket_print') ) + { + $GLOBALS['linpha']->template->output['select_checkout'] .= '<option value="print"'. + (isset($_REQUEST['checkout_as']) && $_REQUEST['checkout_as'] == 'print' ? ' selected="selected"' : ''). + '>'.i18n("Print").'</option>'."\n"; + } + $linpha->template->setModuleName('basket'); $linpha->template->URL_full = LINPHA_DIR.'/?cat=basket'; $linpha->template->output['title'] = '<a href="'.$linpha->template->URL_full.'">'.i18n("Basket").'</a>'; Modified: trunk/linpha2/templates/default/basket.html.php =================================================================== --- trunk/linpha2/templates/default/basket.html.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/templates/default/basket.html.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -3,29 +3,34 @@ <?php echo $tpl->divRoundCorners('top'); ?> <div id="navigation"> + <?php if(isset($_SESSION['basket_ref_url'])) { ?> <a style="float: left; margin-right: 2px;" class="button" href="<?php echo $_SESSION['basket_ref_url']; ?>"><?php echo i18n("Go Back"); ?></a> - <form name="basket_checkout" style="float: left; margin-right: 2px;" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <?php } ?> + + <br /><br /> + <h1><?php echo i18n("Basket"); ?></h1> + <br /> + <form name="basket_checkout" style="margin-right: 2px;" action="<?php echo $tpl->URL_full; ?>" method="POST"> + <h2>1. <?php echo i18n("Select Checkout"); ?></h2> + <select name="checkout_as" class="linforms" onchange="document.basket_checkout.submit()"> - <option value=""><?php echo i18n("Checkout"); ?></option> - <option value="download"><?php echo i18n("Download"); ?></option> - <option value="mail"><?php echo i18n("Send As Mail"); ?></option> - <option value="print"><?php echo i18n("Print"); ?></option> + <?php echo $tpl->output['select_checkout']; ?> </select> + </form> - <?php echo i18n("Images in basket");?>: <?php echo count($_SESSION['basket_ids']); ?> - <br /><br /> + <br /> + <?php if(isset($_REQUEST['checkout_as'])) { switch($_REQUEST['checkout_as']) { case 'download': - echo '<h2>'.i18n("Basket")." - ".i18n("Download").'</h2>'; - - echo i18n("Select Type Of Archive"); + echo '<h2>2. '.i18n("Download").'</h2>'; + echo '<b>'.i18n("Select Type Of Archive").'</b>'; ?> <form name="zip_selected" action="<?php echo $tpl->URL_full; ?>" method="POST"> - <select name="ziptype" size="1"> + <select name="ziptype" class="linforms" size="1"> <?php include_once(LINPHA_DIR.'/lib/classes/archiver.class.php'); $apps = new Archive_Applications(); @@ -37,11 +42,11 @@ echo '<option value="'.$key.'">'.sprintf(i18n("Create %s Archiv"),$value).'</option>'."\n"; } ?> - </select><br /> + </select> <?php if($GLOBALS['linpha']->sql->isAdmin()) { - echo i18n("Add More Apps"); + echo '('.i18n("Add More Applications").')'; //putHelpButton('archive_apps'); echo "<br />\n\n"; } @@ -49,12 +54,12 @@ <br /> <input type="hidden" name="checkout_as" value="download" /> <input type="hidden" name="cmd" value="checkout" /> - <input type="submit" class="button" name="submit" value="<?php echo i18n("Download Archive"); ?>" /> + <input type="submit" class="button" name="submit" value="<?php echo i18n("Start Download"); ?>" /> </form> <?php break; // end checkout - download case 'mail': - echo '<h2>'.i18n("Basket")." - ".i18n("Send As Mail").'</h2>'; + echo '<h2>2. '.i18n("Send As Mail").'</h2>'; $default_text_message = ''; @@ -113,7 +118,7 @@ <?php break; // end checkout - mail case 'print': - echo '<h2>'.i18n("Basket")." - ".i18n("Print Images").'</h2>'; + echo '<h2>2. '.i18n("Print Images").'</h2>'; ?> <script language="JavaScript" type="text/javascript"> function update_quality_settings() @@ -170,6 +175,8 @@ <div id="divmain"> <?php echo $tpl->divRoundCorners('top'); ?> <div id="main"> + + <b><?php echo i18n("Images in basket").': '.count($_SESSION['basket_ids']); ?></b><br /><br /> <form name="basket_remove" action="<?php echo $tpl->URL_full; ?>&cmd=remove_selected" method="POST"> Modified: trunk/linpha2/templates/default/view_basket.html.php =================================================================== --- trunk/linpha2/templates/default/view_basket.html.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/templates/default/view_basket.html.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -39,16 +39,15 @@ /** * add clear float to last div on row */ - if( ($i-1) % $GLOBALS['no_js_nr_cols'] == 0) + if( ($i-1) % $GLOBALS['linpha']->sql->config->value['sys_style_thumb_nojsnrcols'] == 0) { - 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).")'>Select Row</a><br />"; - echo "<a href='javascript:void(0)' onclick='check_all()'>Select All Of This Page</a>"; + echo "<div style='height: ".$GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']."px; clear: left; float: left;'>"; + echo "<a href='javascript:void(0)' onclick='check_from_to(".$i.",".($i+$GLOBALS['linpha']->sql->config->value['sys_style_thumb_nojsnrcols']-1).")'>Select Row</a><br />"; echo "</div>"; } ?> - <div style='width: <?php echo $GLOBALS['def_tn_size']; ?>px; height: <?php echo $GLOBALS['def_tn_size']; ?>px;' class='imgdiv'> - <label for='<?php echo $i; ?>'><img style='cursor: pointer;' height='<?php echo ($GLOBALS['def_tn_size']-20); ?>' src='./get_thumb.php?id=<?php echo $value['id']; ?>' class='img_thumbnail' /></label> + <div style='width: <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>px; height: <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>px; float: left;'> + <label for='<?php echo $i; ?>'><img style='cursor: pointer;' height='<?php echo ($GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']-20); ?>' src='./get_thumb.php?id=<?php echo $value['id']; ?>' /></label> <div class="img_text"> <input type='checkbox' id='<?php echo $i; ?>' name='img_id[]' value='<?php echo $value['id']; ?>'> @@ -64,30 +63,28 @@ <div style="clear: left;"></div> <br /><br /> - <input class="button" type='submit' value='add to basket'> - <a class="button" href="<?php echo LINPHA_DIR.'?cat=basket&ref_id='.$GLOBALS['linpha']->imgview->id_current.'&cmd=add_all'; ?>">add all of this folder to basket</a> + <a href='javascript:void(0)' class="button" onclick='check_all()'><?php echo i18n("Select all of this page"); ?></a> + <input class="button" type='submit' value='<?php echo i18n("Add to basket"); ?>'> + <a class="button" href="<?php echo $GLOBALS['linpha']->template->URL_full.'&admin_cmd=basket_add_all'; ?>"><?php echo i18n("Add all of this folder to basket"); ?></a> <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 of this page"; } - for (var i = 0; i < document.forms[0].length; i++) + for (var i = 0; i < document.getElementsByName('img_id[]').length; i++) { - elem = document.forms[0].elements[i]; + elem = document.getElementsByName('img_id[]')[i]; if (elem.type == "checkbox") { elem.checked = checkflag; } } - return return_value; } function check_from_to(i_start,i_end) Modified: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php 2006-10-28 16:34:50 UTC (rev 4604) +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-29 00:18:31 UTC (rev 4605) @@ -103,7 +103,7 @@ <div id="divSlideshowImgNr" style="float: left; margin-left: 40px; "></div> - <div style="float: left; margin-left: 40px; "> + <div id="divSlideshowExit" style="float: left; margin-left: 40px; "> <a href="javascript:myLinImage.fullscreenStop()"><img src="<?php echo LINPHA_DIR; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Exit" title="<?php echo i18n("Exit Fullscreen"); ?>" ></a> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |