[Linpha-cvs] SF.net SVN: linpha: [4658] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-11-17 21:36:16
|
Revision: 4658 http://svn.sourceforge.net/linpha/?rev=4658&view=rev Author: fangehrn Date: 2006-11-17 13:36:12 -0800 (Fri, 17 Nov 2006) Log Message: ----------- * nearly finished meta data support Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/index.php trunk/linpha2/lib/classes/linpha.admin.class.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.image.class.php trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.import.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/classes/linpha.template.class.php trunk/linpha2/lib/js/LinImage.js trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/themes/default/css/global.css trunk/linpha2/templates/default/view_img_static.html.php trunk/linpha2/templates/default/view_meta.html.php Added Paths: ----------- trunk/linpha2/templates/default/view_albmeta.html.php Removed Paths: ------------- trunk/linpha2/templates/default/view_albcomment.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/ChangeLog 2006-11-17 21:36:12 UTC (rev 4658) @@ -1,3 +1,6 @@ +2006-11-17 flo + * nearly finished meta data support + 2006-11-16 flo * generate also a md5sum for folders take the full filename Modified: trunk/linpha2/admin/index.php =================================================================== --- trunk/linpha2/admin/index.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/admin/index.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -62,15 +62,6 @@ $cat4 = $array[3]; } } - - -/*<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/admin/admin.css'; ?>' type='text/css'> -<link rel='stylesheet' href='<?php echo LINPHA_DIR.'/templates/'.$GLOBALS['linpha']->template->template_name.'/css/syslog.css'; ?>' type='text/css'> -</head> -<body>*/ ?> <?php Modified: trunk/linpha2/lib/classes/linpha.admin.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.admin.class.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/classes/linpha.admin.class.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -105,7 +105,7 @@ { if($active==$key) { - echo '<li class="active"><a href="./?cat='.$value['link'].'" class="current">'.i18n($value['name']).'</a></li>'; + echo '<li><a href="./?cat='.$value['link'].'" class="current">'.i18n($value['name']).'</a></li>'; } else { Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/classes/linpha.functions.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -189,8 +189,8 @@ $post=eregi_replace("^www\\.([^ ,\r\n]*)","[url]http://www.\\1[/url]",$post); // 3. part - $post=preg_replace("/\[url\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\1</a>",$post); - $post=preg_replace("/\[url=(.*)\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\2</a>",$post); + $post=preg_replace("/\[url\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=\"_blank\">\\1</a>",$post); + $post=preg_replace("/\[url=(.*)\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=\"_blank\">\\2</a>",$post); //##### Modified: trunk/linpha2/lib/classes/linpha.image.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/classes/linpha.image.class.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -625,7 +625,8 @@ } /** - * deleteCached cached images by photo id + * delete all cached images by this photo id + * (there can be more than one image with the same photo id in different sizes etc.) * * @param int $id id of image in database */ Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -161,30 +161,6 @@ $this->filterPhotosNotPermitted(); /** - * doing some special commands - */ - if(isset($_GET['admin_cmd'])) { - $this->adminCommands(); - } - - if(isset($_GET['linMsg'])) - { - switch($_GET['linMsg']) - { - case 'basket_added': linSysLog(i18n("Images Added To Basket.")); break; - } - } - - /** - * set ref urls - * used in basket and ajax reloadmenu - */ - $_SESSION['ref_url_full'] = $GLOBALS['linpha']->template->URL_full; - $_SESSION['ref_url_base'] = $GLOBALS['linpha']->template->URL_base; - $_SESSION['ref_modulename'] = $this->modulename; - - - /** * set mode specific things */ switch($this->mode) @@ -202,8 +178,8 @@ case 'basket': $this->viewBasket(); break; - case 'albcomment': - $this->viewAlbComment(); + case 'albmeta': + $this->viewAlbMeta(); break; } break; @@ -220,6 +196,30 @@ break; } + /** + * doing some special commands + * + * should be done after viewImg(), because adminCommands() (force_import) uses some image informations + */ + if(isset($_GET['admin_cmd'])) { + $this->adminCommands(); + } + + if(isset($_GET['linMsg'])) + { + switch($_GET['linMsg']) + { + case 'basket_added': linSysLog(i18n("Images Added To Basket.")); break; + } + } + + /** + * set ref urls + * used in basket and ajax reloadmenu + */ + $_SESSION['ref_url_full'] = $GLOBALS['linpha']->template->URL_full; + $_SESSION['ref_url_base'] = $GLOBALS['linpha']->template->URL_base; + $_SESSION['ref_modulename'] = $this->modulename; /** * set admin menu and more menu @@ -296,7 +296,7 @@ 'name' => i18n("Import"), 'value' => array( array('name' => i18n("Start Import Of This Folder/File"), 'value' => LINPHA_CLIENT.'/admin/?cat=maintenance_import&album_select[]='.$this->id_parent), - array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&force_update') + array('name' => i18n("Detect File Changes"), 'value' => $GLOBALS['linpha']->template->URL_full.'&admin_cmd=force_import') ) ); @@ -403,8 +403,7 @@ array( 'name' => i18n("Metainfo"), 'value' => array( - array('name' => i18n("Edit Album Comment"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=albcomment'), - array('name' => i18n("Edit Album Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=meta') + array('name' => i18n("Edit Album Information"), 'value' => $GLOBALS['linpha']->template->URL_full.'&view=albmeta'), ) ); } @@ -562,6 +561,9 @@ $thumbnail->createThumbnail($GLOBALS['linpha']->template->idCurrent); } break; + case 'force_import': // called in viewImg + LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->full_filename) , $this->filename ); + break; case 'rotate_left': if($GLOBALS['linpha']->sql->isAdmin()) { @@ -959,7 +961,11 @@ } elseif($key == 'builtin_first_comment') { - $this->photos_filtered[$photo_key]['album_infos'] .= '<div class="linDivFolderComment">'.$value['value'].'</div>'; + $this->photos_filtered[$photo_key]['album_infos'] .= '<div class="linDivFolderComment">'.$value['value']; + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { + $this->photos_filtered[$photo_key]['album_infos'] .= ' <a href="'.$GLOBALS['linpha']->template->URL_base.'&linId='.$photo_value['id'].'&view=albmeta'.'">Edit</a>'; + } + $this->photos_filtered[$photo_key]['album_infos'] .= '</div>'; } else { @@ -1077,9 +1083,9 @@ /** * setup comment view */ -function viewAlbComment() +function viewAlbMeta() { - $GLOBALS['linpha']->template->setModuleName('view_albcomment'); + $GLOBALS['linpha']->template->setModuleName('view_albmeta'); /** * save data @@ -1215,7 +1221,7 @@ <comment> <time><?php echo linStrftime($data['meta_time']); ?></time> <author><?php echo htmlspecialchars($data['meta_author'],ENT_QUOTES); ?></author> - <text><?php echo htmlspecialchars($data['meta_comment'],ENT_QUOTES); ?></text> + <text><?php echo str_replace('<','<',linHtmlTag($data['meta_comment'],ENT_QUOTES) ); ?></text> </comment> <?php } ?> </root> @@ -1248,10 +1254,6 @@ $this->photos_filtered[ $this->current_key ], $flag_nr=10 ); - - if(isset($_GET['force_update'])) { - LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->full_filename) , $this->filename ); - } } @@ -1422,39 +1424,6 @@ $GLOBALS['linpha']->template->setModuleName('view_img_static'); $GLOBALS['linpha']->template->overrideModule('css','view_img'); - if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) - { - /** - * save metadata - */ - if(isset($_POST['cmd']) && $_POST['cmd']=='insert_metadata') - { - if(isset($_POST['field'])) - { - /** - * delete existing entries - */ - $query = $GLOBALS['linpha']->db->Execute("DELETE FROM ".LIN_PREFIX."meta_data " . - "WHERE md5sum = '".$GLOBALS['linpha']->imgview->md5sum."'"); - - foreach($_POST['field'] AS $key=>$value) - { - if(is_array($value)) // coming from a select (categories etc.) - { - $value = ';'.implode(';',$value).';'; - } - - if(! empty($value) ) - { - $GLOBALS['linpha']->db->Execute("INSERT into ".LIN_PREFIX."meta_data ". - "(field_id, md5sum, meta_data) VALUES " . - "('".LinSql::linAddslashes($key)."','".$GLOBALS['linpha']->imgview->md5sum."','".linSql::linAddslashes($value)."')"); - } - } - } - } - } - $this->viewImgCommon(); } Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -331,9 +331,8 @@ LinImport::updateMd5sum( $id, $data['md5sum'], $md5sum ); - $thumbnail = new LinImage(); - $_GET['force'] = true; - $thumbnail->createThumbnail($id); + LinImage::deleteCachedImage($id, $data['img_type']); // they will automatically be recreated + LinImage::deleteCachedThumbnail($id, $data['img_type']); } } Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -112,10 +112,11 @@ break; case 'first_comment': $name = i18n("First Comment"); - $value = $GLOBALS['linpha']->db->GetOne( + $value = linHtmlTag( + $GLOBALS['linpha']->db->GetOne( "SELECT meta_comment FROM ".LIN_PREFIX."meta_comments " . "WHERE md5sum = '".LinSql::linAddslashes($array_src_infos['md5sum'])."' " . - "ORDER by meta_time ASC" + "ORDER by meta_time ASC") ); break; @@ -659,6 +660,124 @@ class LinMetaDataModificate extends LinMetaData { + function saveLinphaMeta() + { + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) + { + /** + * save metadata + */ + if(isset($_POST['cmd']) && $_POST['cmd']=='insert_metadata') + { + if(isset($_POST['field'])) + { + /** + * delete existing entries + */ + $query = $GLOBALS['linpha']->db->Execute("DELETE FROM ".LIN_PREFIX."meta_data " . + "WHERE md5sum = '".$GLOBALS['linpha']->imgview->md5sum."'"); + + foreach($_POST['field'] AS $key=>$value) + { + if(is_array($value)) // coming from a select (categories etc.) + { + $value = ';'.implode(';',$value).';'; + } + + if(! empty($value) ) + { + $GLOBALS['linpha']->db->Execute("INSERT into ".LIN_PREFIX."meta_data ". + "(field_id, md5sum, meta_data) VALUES " . + "('".LinSql::linAddslashes($key)."','".$GLOBALS['linpha']->imgview->md5sum."','".linSql::linAddslashes($value)."')"); + } + } + } + } + } + + } + + function setMetaData() + { + LinMetaDataModificate::saveLinphaMeta(); + + global $linTpl; + + /** + * set meta linpha + */ + $GLOBALS['linpha']->template->output['meta_linpha'] = ''; + + $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type, flags " . + "FROM ".LIN_PREFIX."meta_fields " . + "WHERE flags = '5' OR flags = '7' ORDER by id"); + while($data = $query->FetchRow()) + { + $GLOBALS['linpha']->template->output['meta_linpha'] .= '<tr><td width="150" valign="top">'; + + if( $data['flags']==5 ) + { + $GLOBALS['linpha']->template->output['meta_linpha'] .= LinMetaData::getNameOfField('builtin_'.$data['name'],false); + } + elseif( $data['flags']==7 ) + { + $GLOBALS['linpha']->template->output['meta_linpha'] .= LinMetaData::getNameOfField('id_'.$data['id'],false); + } + $GLOBALS['linpha']->template->output['meta_linpha'] .= '</td><td>'; + + $meta_data = $GLOBALS['linpha']->db->GetRow("SELECT meta_data FROM ".LIN_PREFIX."meta_data " . + "WHERE md5sum = '".$GLOBALS['linpha']->imgview->md5sum."'" . + "AND field_id = '".$data['id']."'"); + + switch($data['field_type']) + { + case 1: + case 3: + if(isset($meta_data['meta_data'])) { + $value = htmlspecialchars($meta_data['meta_data'],ENT_QUOTES); + } else { + $value = ''; + } + $GLOBALS['linpha']->template->output['meta_linpha'] .= '<input type="text" class="linForms" name="field['.$data['id'].']" value="'.$value.'" style="width: 250px;" maxlength="255" />'; + break; + case 2: + if(isset($meta_data['meta_data'])) { + $array_pieces = linExplodeAndSlice(';',$meta_data['meta_data']); + } else { + $array_pieces = Array(); + } + + $GLOBALS['linpha']->template->output['meta_linpha'] .= '<select name="field['.$data['id'].'][]" class="linForms" size="7" multiple="multiple" style="width: 250px;">'; + + $cat_query = $GLOBALS['linpha']->db->Execute("SELECT id, name " . + "FROM ".LIN_PREFIX."meta_category " . + "WHERE field_id = '".$data['id']."'"); + while($cat_data = $cat_query->FetchRow()) + { + if(in_array($cat_data['id'],$array_pieces)) { + $checked = ' selected="selected"'; + } else { + $checked = ''; + } + + $GLOBALS['linpha']->template->output['meta_linpha'] .= '<option value="'.$cat_data['id'].'"'.$checked.'>'.htmlspecialchars($cat_data['name'],ENT_QUOTES).'</option>'."\n"; + } + $GLOBALS['linpha']->template->output['meta_linpha'] .= '</select>'; + break; + } + + $GLOBALS['linpha']->template->output['meta_linpha'] .= '</td></tr>'; + } + + /** + * set meta iptc + */ + $GLOBALS['linpha']->template->output['meta_iptc'] = '<tr><td>some iptc data</td><td></td></tr>'; + + $fragment = 'edit_meta'; + include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); + } + /** * edit iptc functions */ Modified: trunk/linpha2/lib/classes/linpha.template.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/classes/linpha.template.class.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -96,7 +96,7 @@ <?php if($this->layout_name != 'default' && file_exists(LINPHA_DIR.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css')) { ?> -<link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css'; ?>' type='text/css'>\n"; +<link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/templates/'.$this->template_name.'/themes/'.$this->layout_name.'/css/global.css'; ?>' type='text/css'> <?php } ?> <!-- body css --> Modified: trunk/linpha2/lib/js/LinImage.js =================================================================== --- trunk/linpha2/lib/js/LinImage.js 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/lib/js/LinImage.js 2006-11-17 21:36:12 UTC (rev 4658) @@ -408,40 +408,9 @@ } } - /** - * set comments - */ this.initTextareaAddComment(); - $('linDivComments').innerHTML = ''; + this.setComments(); - if(this.xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) - { - for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) - { - var tagcomment = this.xmlDoc[IdCurrent].getElementsByTagName('comment').item(i); - var commenttime = document.createTextNode( tagcomment.getElementsByTagName('time').item(0).firstChild.data + ' by ' ); - var commentauthor = document.createTextNode( tagcomment.getElementsByTagName('author').item(0).firstChild.data ); - var commenttext = document.createTextNode( tagcomment.getElementsByTagName('text').item(0).firstChild.data ); - - $('linDivComments').appendChild(commenttime); - $('linDivComments').appendChild(commentauthor); - $('linDivComments').appendChild( document.createElement("hr") ); - $('linDivComments').appendChild(commenttext); - $('linDivComments').appendChild( document.createElement("br") ); - $('linDivComments').appendChild( document.createElement("br") ); - - /*var ElemDiv = document.createElement("div"); - ElemDiv.setAttribute('class','comments'); - ElemDiv.appendChild(commenttime); - ElemDiv.appendChild(commentauthor); - ElemDiv.appendChild( document.createElement("br") ); - ElemDiv.appendChild(commenttext); - ElemDiv.appendChild( document.createElement("br") ); - - $('linDivComments').appendChild(ElemDiv);*/ - } - } - /** * set image nr * currently only in slideshow used @@ -930,16 +899,47 @@ // Comments // ----------------------------------------------------------------------------------- + setComments: function() + { + $('linDivComments').innerHTML = ''; + + if(this.xmlDoc[IdCurrent].getElementsByTagName('comment').length > 0) + { + for(var i = 0; i < this.xmlDoc[IdCurrent].getElementsByTagName('comment').length; i++) + { + var tagcomment = this.xmlDoc[IdCurrent].getElementsByTagName('comment').item(i); + var commenttime = document.createTextNode( tagcomment.getElementsByTagName('time').item(0).firstChild.data + ' by ' ); + var commentauthor = document.createTextNode( tagcomment.getElementsByTagName('author').item(0).firstChild.data ); +// var commenttext = document.createTextNode( tagcomment.getElementsByTagName('text').item(0).firstChild.data ); + + var commenttextdiv = Builder.node('div', {id: 'linComment'+i}); + + $('linDivComments').appendChild(commenttime); + $('linDivComments').appendChild(commentauthor); + $('linDivComments').appendChild( document.createElement("hr") ); + $('linDivComments').appendChild(commenttextdiv); + $('linDivComments').appendChild( document.createElement("br") ); + $('linDivComments').appendChild( document.createElement("br") ); + + $('linComment'+i).innerHTML = tagcomment.getElementsByTagName('text').item(0).firstChild.data; + } + } + }, + saveComment: function(t) { - this.xmlDoc[IdCurrent] = t.responseXML.documentElement; + // not use 'this.' doesnt work if call from ajax success function + + myLinImage.xmlDoc[IdCurrent] = t.responseXML.documentElement; - if(this.xmlDoc[IdCurrent].getElementsByTagName('commentadded').length > 0) + if(myLinImage.xmlDoc[IdCurrent].getElementsByTagName('commentadded').length > 0) { - myLinGlobal.linSyslog( this.xmlDoc[IdCurrent].getElementsByTagName('commentadded').item(0).firstChild.data ); + myLinImage.initTextareaAddComment(); + myLinGlobal.linSyslog( myLinImage.xmlDoc[IdCurrent].getElementsByTagName('commentadded').item(0).firstChild.data ); } - myLinImage.loadImage(IdCurrent); // not use 'this.' doesnt work if call from ajax success function + //myLinImage.loadImage(IdCurrent); + myLinImage.setComments(); }, /** Modified: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/templates/default/fragments.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -121,48 +121,132 @@ * the slideshow controls */ case 'slideshow': -?> -<div id="linDivSlideshowControls"> - <div style="float: left; margin-left: 10px; "> - <a href="javascript:myLinImage.moveFirst()"><img id="linSsImgFirst" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_first.gif" width="25" height="25" border="0" alt="First" title="<?php echo i18n("First"); ?>" /></a> - <a href="javascript:myLinImage.movePrev()"><img id="linSsImgPrev" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_previous.gif" width="25" height="25" border="0" alt="Previous" title="<?php echo i18n("Previous"); ?>" /></a> - <a href="javascript:myLinImage.slideshowStartStop()"><img id="linSsImgStart" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_play.gif" width="25" height="25" border="0" alt="Play" title="<?php echo i18n("Play/Pause"); ?>" /></a> - <!--<a href="javascript:myLinImage.slideshowStop()"><img id="linSsImgStop" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Stop" title="<?php echo i18n("Stop"); ?>" /></a>--> - <a href="javascript:myLinImage.moveNext()"><img id="linSsImgNext" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_next.gif" width="25" height="25" border="0" alt="Next" title="<?php echo i18n("Next"); ?>" /></a> - <a href="javascript:myLinImage.moveLast()"><img id="linSsImgLast" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_last.gif" width="25" height="25" border="0" alt="Last" title="<?php echo i18n("Last"); ?>" /></a> - </div> + ?> + <div id="linDivSlideshowControls"> + <div style="float: left; margin-left: 10px; "> + <a href="javascript:myLinImage.moveFirst()"><img id="linSsImgFirst" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_first.gif" width="25" height="25" border="0" alt="First" title="<?php echo i18n("First"); ?>" /></a> + <a href="javascript:myLinImage.movePrev()"><img id="linSsImgPrev" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_previous.gif" width="25" height="25" border="0" alt="Previous" title="<?php echo i18n("Previous"); ?>" /></a> + <a href="javascript:myLinImage.slideshowStartStop()"><img id="linSsImgStart" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_play.gif" width="25" height="25" border="0" alt="Play" title="<?php echo i18n("Play/Pause"); ?>" /></a> + <!--<a href="javascript:myLinImage.slideshowStop()"><img id="linSsImgStop" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Stop" title="<?php echo i18n("Stop"); ?>" /></a>--> + <a href="javascript:myLinImage.moveNext()"><img id="linSsImgNext" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_next.gif" width="25" height="25" border="0" alt="Next" title="<?php echo i18n("Next"); ?>" /></a> + <a href="javascript:myLinImage.moveLast()"><img id="linSsImgLast" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_last.gif" width="25" height="25" border="0" alt="Last" title="<?php echo i18n("Last"); ?>" /></a> + </div> + + <div style="float: left; margin-left: 40px; "> + <select id="linSsDelay" name="delay" size="1" class="linForms" onchange="myLinImage.slideshowChangeDelay()" title="<?php echo i18n("Delay"); ?>"> + <option value="3">3 s</option> + <option value="4">4 s</option> + <option value="5" selected="selected">5 s</option> + <option value="10">10 s</option> + <option value="15">15 s</option> + <option value="30">30 s</option> + <option value="45">45 s</option> + <option value="60">60 s</option> + </select> + </div> - <div style="float: left; margin-left: 40px; "> - <select id="linSsDelay" name="delay" size="1" class="linForms" onchange="myLinImage.slideshowChangeDelay()" title="<?php echo i18n("Delay"); ?>"> - <option value="3">3 s</option> - <option value="4">4 s</option> - <option value="5" selected="selected">5 s</option> - <option value="10">10 s</option> - <option value="15">15 s</option> - <option value="30">30 s</option> - <option value="45">45 s</option> - <option value="60">60 s</option> - </select> + <div style="float: left; margin-left: 10px; "> + <a href="javascript:myLinImage.slideshowChangeLoop()"><img id="linSsImgLoop" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_loop.gif" width="25" height="25" border="0" alt="Loop" title="<?php echo i18n("Enable/disable Loop"); ?>" /></a> + <!--<a href="javascript:myLinImage.slideshowChangeLoop()"><img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_noloop.gif" width="25" height="25" border="0" /></a>--> + <a href="javascript:myLinImage.slideshowChangeRandom()"><img id="linSsImgRandom" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_norandom.gif" width="25" height="25" border="0" alt="Random" title="<?php echo i18n("Enable/disable Random Play Order"); ?>" /></a> + <!--<a href="javascript:myLinImage.slideshowChangeRandom()"><img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_random.gif" width="25" height="25" border="0" /></a>--> + </div> + + <div id="linDivSlideshowImgNr" style="float: left; margin-left: 40px; "></div> + + <div id="linDivSlideshowExit" style="float: left; margin-left: 40px; "> + <a href="javascript:myLinImage.fullscreenStop()"><img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Exit" title="<?php echo i18n("Exit Fullscreen"); ?>" ></a> + </div> + + <div style="clear: both;"></div> </div> + <?php echo $linTpl->divRoundCorners('bottom','alpha'); ?> +<?php +break; - <div style="float: left; margin-left: 10px; "> - <a href="javascript:myLinImage.slideshowChangeLoop()"><img id="linSsImgLoop" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_loop.gif" width="25" height="25" border="0" alt="Loop" title="<?php echo i18n("Enable/disable Loop"); ?>" /></a> - <!--<a href="javascript:myLinImage.slideshowChangeLoop()"><img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_noloop.gif" width="25" height="25" border="0" /></a>--> - <a href="javascript:myLinImage.slideshowChangeRandom()"><img id="linSsImgRandom" src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_norandom.gif" width="25" height="25" border="0" alt="Random" title="<?php echo i18n("Enable/disable Random Play Order"); ?>" /></a> - <!--<a href="javascript:myLinImage.slideshowChangeRandom()"><img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_random.gif" width="25" height="25" border="0" /></a>--> - </div> - <div id="linDivSlideshowImgNr" style="float: left; margin-left: 40px; "></div> +/** + * view meta + */ +case 'edit_meta': + if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { ?> + + <link rel='stylesheet' href='<?php echo LINPHA_CLIENT.'/templates/'.$this->template_name.'/themes/default/css/admin.css'; ?>' type='text/css'> - <div id="linDivSlideshowExit" style="float: left; margin-left: 40px; "> - <a href="javascript:myLinImage.fullscreenStop()"><img src="<?php echo LINPHA_CLIENT; ?>/lib/graphics/ss_stop.gif" width="25" height="25" border="0" alt="Exit" title="<?php echo i18n("Exit Fullscreen"); ?>" ></a> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST"> + <input type="hidden" name="cmd" value="insert_metadata" /> + + <?php if($GLOBALS['linpha']->imgview->img_type!=0) { ?> + <ul class="linUlMenu"> + <li><a id="linAMetaLinpha" href="javascript:showMetaLinpha()">LinPHA MetaData</a></li> + <li><a id="linAMetaIptc" href="javascript:showMetaIptc()">XMP (IPTC)</a></li> + </ul> + <div id="linDivMetaIptc"> + <?php if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { ?> + <table border="0" style="float: left;"> + <?php echo $linTpl->output['meta_iptc']; ?> + <tr> + <td rowspan="2"> + <br /> + <input type="submit" class="linButton" name="submit" value="<?php echo i18n("Submit"); ?>" /> + </td> + </tr> + </table> + <?php } else { + echo i18n("IPTC Is Currently Disabled.").'<br /><br />'; + if($GLOBALS['linpha']->sql->isAdmin()) { + echo '<a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_iptc">'.i18n("Enable IPTC").'</a>'; + echo '<br /><br />'; + } + } ?> </div> + <?php } /* end if img_type!=0 */ ?> + + <div id="linDivMetaLinpha"> + <table border="0" style="float: left;"> + <?php echo $linTpl->output['meta_linpha']; ?> + <tr> + <td rowspan="2"> + <br /> + <input type="submit" class="linButton" name="submit" value="<?php echo i18n("Submit"); ?>" /> + </td> + </tr> + </table> + </div> + + <img style="margin-left: 20px;" src="<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='.$GLOBALS['linpha']->template->idCurrent; + ?>" width="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; + ?>" height="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; + ?>" /> + + </form> - <div style="clear: both;"></div> -</div> -<?php echo $linTpl->divRoundCorners('bottom','alpha'); ?> + <?php if($GLOBALS['linpha']->imgview->img_type!=0) { ?> + <script language="JavaScript" type="text/javascript"> + <!-- + function showMetaLinpha() + { + $('linAMetaLinpha').className = 'current'; + $('linAMetaIptc').className = ''; + Element.hide('linDivMetaIptc'); + Element.show('linDivMetaLinpha'); + } + + function showMetaIptc() + { + $('linAMetaLinpha').className = ''; + $('linAMetaIptc').className = 'current'; + Element.hide('linDivMetaLinpha'); + Element.show('linDivMetaIptc'); + } + showMetaLinpha(); + --> + </script> + <?php } /* end if img_type!=0 */ ?> -<?php + <?php } /* end if checkPermission('metadata_edit') */ ?> + + <?php break; } ?> Modified: trunk/linpha2/templates/default/themes/default/css/global.css =================================================================== --- trunk/linpha2/templates/default/themes/default/css/global.css 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/templates/default/themes/default/css/global.css 2006-11-17 21:36:12 UTC (rev 4658) @@ -160,6 +160,13 @@ .linDivFolderComment { overflow: auto; max-height: 300px; + + margin: 0; + margin-top: 10px; + margin-bottom: 10px; + padding: 0; + + word-wrap: break-word; /* fix ie to force width */ } Deleted: trunk/linpha2/templates/default/view_albcomment.html.php =================================================================== --- trunk/linpha2/templates/default/view_albcomment.html.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/templates/default/view_albcomment.html.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -1,19 +0,0 @@ -<div id="linDivMainOuter"> - <?php echo $linTpl->divRoundCorners('top'); ?> - - <div id="linDivMain"> - <form action="<?php echo $linTpl->URL_full; ?>" method="POST"> - Author: - <input type="text" name="author" value="<?php echo $linTpl->output['comment_author']; ?>" size="40" maxlength="255" /> - <br /> - <textarea name="comment" rows="10" cols="50"><?php echo $linTpl->output['comment_text']; ?></textarea> - <br /> - <input type="hidden" name="cmd" value="add_comment" /> - - <a class="linButton" href="<?php echo $linTpl->URL_full.'&view=thumb'; ?>">back</a> - <input type="submit" class="linButton" name="submit" value="submit" /> - </form> - </div> - - <?php echo $linTpl->divRoundCorners('bottom'); ?> -</div> \ No newline at end of file Copied: trunk/linpha2/templates/default/view_albmeta.html.php (from rev 4657, trunk/linpha2/templates/default/view_albcomment.html.php) =================================================================== --- trunk/linpha2/templates/default/view_albmeta.html.php (rev 0) +++ trunk/linpha2/templates/default/view_albmeta.html.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -0,0 +1,26 @@ +<div id="linDivMainOuter"> + <?php echo $linTpl->divRoundCorners('top'); ?> + + <div id="linDivMain"> + <a class="linButton" href="<?php echo $linTpl->URL_full.'&view=thumb'; ?>"><?php echo i18n("<< Back To Album View");?></a> + <br /><br /> + + <h1 class="linStyle"><?php echo i18n("Edit Album Comment"); ?></h1> + <form action="<?php echo $linTpl->URL_full; ?>" method="POST"> + Author: + <input type="text" name="author" value="<?php echo $linTpl->output['comment_author']; ?>" size="40" maxlength="255" /> + <br /> + <textarea name="comment" rows="10" cols="50"><?php echo $linTpl->output['comment_text']; ?></textarea> + <br /> + <input type="hidden" name="cmd" value="add_comment" /> + <input type="submit" class="linButton" name="submit" value="submit" /> + </form> + <br /> + + <h1 class="linStyle"><?php echo i18n("Edit Album Informations"); ?></h1> + <?php LinMetaDataModificate::setMetaData(); ?> + <div style="clear: both;"></div> + </div> + + <?php echo $linTpl->divRoundCorners('bottom'); ?> +</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-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/templates/default/view_img_static.html.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -35,8 +35,11 @@ <?php echo $linTpl->divRoundCorners('top'); ?> <div id="linDivMain"> <?php if($_SESSION['mode_imageview']=='meta') { ?> - <!-- edit meta data - include view_meta.html --> - <?php include_once(LINPHA_DIR.'/templates/'.$linTpl->template_name.'/view_meta.html.php'); + <!-- edit meta data - include view_meta.html --> + <a href="<?php echo $linTpl->URL_full.'&view=img'; ?>"><?php echo i18n("<< Back To Default View");?></a> + <br /><br /> + <h1 class="linStyle"><?php echo i18n("Edit Image Imformation")?></h1> + <?php LinMetaDataModificate::setMetaData(); } else { ?> <!-- show image --> @@ -85,7 +88,7 @@ <?php while($data = $linTpl->output['image_comments']->FetchRow()) { ?> <?php echo linStrftime($data['meta_time']).' '.i18n("by").' '.htmlspecialchars($data['meta_author'],ENT_QUOTES); ?> <hr /> - <?php echo htmlspecialchars($data['meta_comment'],ENT_QUOTES); ?> + <?php echo linHtmlTag($data['meta_comment'],ENT_QUOTES); ?> <br /><br /> <?php } ?> </div> Modified: trunk/linpha2/templates/default/view_meta.html.php =================================================================== --- trunk/linpha2/templates/default/view_meta.html.php 2006-11-16 21:46:57 UTC (rev 4657) +++ trunk/linpha2/templates/default/view_meta.html.php 2006-11-17 21:36:12 UTC (rev 4658) @@ -1,100 +0,0 @@ -<?php -/** - * this file is included from view_img.html.php - */ - -?> -<style> -#linImgMainimage -{ - width: 300px; -} -</style> -<a href="<?php echo $linTpl->URL_full.'&view=img'; ?>"><?php echo i18n("<< Back To Default View");?></a> -<h1 class="linStyle"><?php echo i18n("Edit Image Imformation")?></h1> -<?php - -if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) -{ - $num_query = $GLOBALS['linpha']->db->GetRow("SELECT count(id) " . - "FROM ".LIN_PREFIX."meta_fields " . - "WHERE flags = '5' " . - "OR flags = '7'"); - - $query = $GLOBALS['linpha']->db->Execute("SELECT id, name, field_type " . - "FROM ".LIN_PREFIX."meta_fields " . - "WHERE flags = '5' OR flags = '7' ORDER by id"); - -?> -<form action="<?php echo $linTpl->URL_full; ?>" method="POST"> -<table border='1'> - <tr> - <td width="150"><b><?php echo i18n("Name"); ?></b></td> - <td width="200"><b><?php echo i18n("Value"); ?></b></td> - <td rowspan="<?php echo $num_query['0']+1; ?>"> - <img src="<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='.$GLOBALS['linpha']->template->idCurrent;?> - width="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>" - height="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>" - </td> - </tr> - <?php - while($data = $query->FetchRow()) - { - ?> - <tr> - <td><?php echo $data['name']; ?></td> - <td> - <?php - $meta_data = $GLOBALS['linpha']->db->GetRow("SELECT meta_data FROM ".LIN_PREFIX."meta_data " . - "WHERE md5sum = '".$GLOBALS['linpha']->imgview->md5sum."'" . - "AND field_id = '".$data['id']."'"); - - switch($data['field_type']) - { - case 1: - case 3: - if(isset($meta_data['meta_data'])) { - $value = htmlspecialchars($meta_data['meta_data'],ENT_QUOTES); - } else { - $value = ''; - } - echo '<input type="text" name="field['.$data['id'].']" value="'.$value.'" style="width: 200px;" maxlength="255" />'; - break; - case 2: - if(isset($meta_data['meta_data'])) { - $array_pieces = linExplodeAndSlice(';',$meta_data['meta_data']); - } else { - $array_pieces = Array(); - } - ?> - <select name="field[<?php echo $data['id']; ?>][]" multiple="multiple" style="width: 200px;"> - <?php - $cat_query = $GLOBALS['linpha']->db->Execute("SELECT id, name " . - "FROM ".LIN_PREFIX."meta_category " . - "WHERE field_id = '".$data['id']."'"); - while($cat_data = $cat_query->FetchRow()) - { - if(in_array($cat_data['id'],$array_pieces)) { - $checked = ' selected="selected"'; - } else { - $checked = ''; - } - - echo '<option value="'.$cat_data['id'].'"'.$checked.'>'.htmlspecialchars($cat_data['name'],ENT_QUOTES).'</option>'."\n"; - } - ?> - </select> - <?php - break; - } - ?> - </td> - </tr> - <?php - } - ?> -</table> -<input type="hidden" name="cmd" value="insert_metadata" /> -<input type="submit" name="submit" value="submit" /> -</form> -<?php } /* end if checkPermission('metadata_edit') */ ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |