[Linpha-cvs] SF.net SVN: linpha: [4569] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-10-02 19:34:17
|
Revision: 4569 http://svn.sourceforge.net/linpha/?rev=4569&view=rev Author: fangehrn Date: 2006-10-02 12:34:03 -0700 (Mon, 02 Oct 2006) Log Message: ----------- 2006-10-02 flo * working on an ajax image view... ;-) Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/templates/default/view_img_static.html.php Added Paths: ----------- trunk/linpha2/templates/default/view_img.html.php Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-02 19:10:42 UTC (rev 4568) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-10-02 19:34:03 UTC (rev 4569) @@ -203,7 +203,7 @@ switch($_SESSION['mode_imageview']) { case 'img': - $this->viewImg(); + $this->viewImg(); /* will exit in xml mode */ break; case 'meta': $this->viewMeta(); @@ -1057,6 +1057,43 @@ /** + * setup image view + */ +function viewImg() +{ + $this->viewImgCommon(); + $this->viewImgComments(); + + if($_SESSION['use_js']) + { + $GLOBALS['linpha']->template->setModuleName('view_img'); + + if(isset($_GET['xml'])) + { + $this->viewImgAjax(); + exit(); + } + } + else + { + $GLOBALS['linpha']->template->setModuleName('view_img_static'); + $GLOBALS['linpha']->template->overrideModule('css','view_img'); + } +} + +/** + * generate xml data for ajax image view + */ +function viewImgAjax() +{ + print_r($GLOBALS['linpha']->template->output); + + /** + * @todo fetch comments + */ +} + +/** * stuff used Img and Meta view * @uses LinImageview::viewImg * @uses LinImageview:viewMeta @@ -1075,15 +1112,12 @@ } } + /** - * setup image view + * get/save image comments */ -function viewImg() +function viewImgComments() { - $GLOBALS['linpha']->template->setModuleName('view_img'); - - $this->viewImgCommon(); - /** * image comments */ @@ -1241,8 +1275,7 @@ /** * set current image and thumb */ - $GLOBALS['linpha']->template->output['image'] = '<img id="mainimage" src="'.LINPHA_DIR.'/get_image.php?id=' - . $this->photos_filtered[$this->current_key]['id'] . '" />'; + $GLOBALS['linpha']->template->output['image'] = LINPHA_DIR.'/get_image.php?id=' . $this->photos_filtered[$this->current_key]['id']; $GLOBALS['linpha']->template->output['current_thumb'] = $this->viewImgThumbHtml( $this->current_key , 'current' ); } @@ -1252,7 +1285,8 @@ */ function viewMeta() { - $GLOBALS['linpha']->template->setModuleName('view_img'); + $GLOBALS['linpha']->template->setModuleName('view_img_static'); + $GLOBALS['linpha']->template->overrideModule('css','view_img'); $this->viewImgCommon(); Added: trunk/linpha2/templates/default/view_img.html.php =================================================================== --- trunk/linpha2/templates/default/view_img.html.php (rev 0) +++ trunk/linpha2/templates/default/view_img.html.php 2006-10-02 19:34:03 UTC (rev 4569) @@ -0,0 +1,100 @@ +<?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> +<div id="navigation"> + <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> +</div> +<?php } ?> + +<div id="divthumbnavi"> + <div class="roundtop"> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + </div> + + <div id="thumbnavi"> + <div class="thumbnavi_prevthumb"> + <?php /*echo $GLOBALS['linpha']->template->output['prev_thumb'];*/ ?> + </div> + <?php /*echo $GLOBALS['linpha']->template->output['current_thumb'];*/ ?> + <div class="thumbnavi_nextthumb"> + <?php /*echo $GLOBALS['linpha']->template->output['next_thumb'];*/ ?> + </div> + </div> + + <div class="roundbottom"> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + </div> +</div> + +<div id="divmain"> + <div class="roundtop"> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + </div> + <div id="main"> + <noscript><h1><?php echo i18n("If you have just disabled Javascript, you will need to restart your browser."); ?></h1></noscript> + + <!-- show image --> + <img id="mainimage" src="" /> + + <br /><br /> + + <!-- comments --> + <?php if($GLOBALS['linpha']->sql->checkPermission('metadata_comments')) { ?> + <!-- show add comment form --> + <div class="add_comment"> + <form action="<?php echo $GLOBALS['linpha']->template->URL_full; ?>" method="POST"> + <?php echo i18n("Add Comment"); ?>:<br /> + <div id="comment_div_text"> + <input type="text" id="comment_input_text" name="comment_text" value="" tabindex="1" size="40" maxlength="40" /> + <a href="javascript:open_textarea()">(+)</a> + </div> + <textarea style="display: none;" id="comment_textarea" name="comment_textarea" tabindex="1" rows="10" cols="50"></textarea> + <?php echo i18n("Name"); ?>: <input type="text" name="author" value="" tabindex="2" size="10" maxlength="40" /> + <input type="hidden" name="cmd" value="add_comment" /> + <input type="submit" name="submit" value="<?php echo i18n("submit"); ?>" /> + </form> + </div> + <script language="JavaScript" type="text/javascript"> + function open_textarea() + { + document.getElementById('comment_textarea').style.display = 'block'; + document.getElementById('comment_div_text').style.display = 'none'; + + document.getElementById('comment_textarea').value = document.getElementById('comment_input_text').value; + } + </script> + + <br /><br /> + <?php } /* end if checkPermission('metadata_comments') */ ?> + + <!-- show image comments --> + <?php /*while($data = $GLOBALS['linpha']->template->output['image_comments']->FetchRow()) { ?> + <div class="comments"> + <?php echo $data['meta_time']; ?> <?php echo htmlspecialchars($data['meta_author'],ENT_QUOTES); ?> + <br /> + <?php echo htmlspecialchars($data['meta_comment'],ENT_QUOTES); ?> + <br /><br /> + </div> + <?php } */?> + + </div> + + <div class="roundbottom"> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + </div> +</div> + +<div id="divright"> + <div class="roundtop"> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/tl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + </div> + <div id="right"> + <?php + /*foreach($GLOBALS['linpha']->template->output['image_infos'] AS $value) + { + echo $value['name'].': '.$value['value'].'<br />'; + }*/ + ?> + </div> + <div class="roundbottom"> + <img src="<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/images/bl.gif'; ?>" alt="" width="15" height="15" class="corner" style="display: none" /> + </div> +</div> \ No newline at end of file Modified: trunk/linpha2/templates/default/view_img_static.html.php =================================================================== --- trunk/linpha2/templates/default/view_img_static.html.php 2006-10-02 19:10:42 UTC (rev 4568) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-10-02 19:34:03 UTC (rev 4569) @@ -1,3 +1,10 @@ + +<script language="JavaScript" type="text/javascript"> +<!-- +location.href = "<?php echo convert_amp($GLOBALS['linpha']->template->URL_full.'&use_js=1'); ?>"; +//--> +</script> + <?php if(isset($GLOBALS['linpha']->template->output['navigation']) && !empty($GLOBALS['linpha']->template->output['navigation'])) { ?> <div id="navigation"> <?php echo $GLOBALS['linpha']->template->output['navigation']; ?> @@ -35,7 +42,7 @@ } else { ?> <!-- show image --> - <?php echo $GLOBALS['linpha']->template->output['image']; ?> + <img id="mainimage" src="<?php echo $GLOBALS['linpha']->template->output['image']; ?>" /> <br /><br /> <!-- comments --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |