[Linpha-cvs] SF.net SVN: linpha: [4659] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-11-19 20:37:09
|
Revision: 4659 http://svn.sourceforge.net/linpha/?rev=4659&view=rev Author: fangehrn Date: 2006-11-19 12:32:55 -0800 (Sun, 19 Nov 2006) Log Message: ----------- 2006-11-19 flo * mostly finished iptc write support @todo only save iptc data if we entered some data in the iptc form @todo show full exif informations with pjmt/ShowFileInfo.php (provide security!) Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/metadata_define.php trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/docs/dev/external_libraries.txt trunk/linpha2/docs/dev/important stuff.txt 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.sql.class.php trunk/linpha2/lib/classes/metadata_editor.php trunk/linpha2/lib/classes/pjmt/Photoshop_File_Info.php trunk/linpha2/lib/include/common.php trunk/linpha2/lib/js/LinImage.js trunk/linpha2/lib/lang/lang.German.php trunk/linpha2/lib/lang/language.php trunk/linpha2/templates/default/fragments.php trunk/linpha2/templates/default/search.html.php trunk/linpha2/templates/default/themes/default/colorsettings.php trunk/linpha2/templates/default/themes/default/css/global.css trunk/linpha2/templates/default/themes/default/css/view_img.css trunk/linpha2/templates/default/view_albmeta.html.php trunk/linpha2/templates/default/view_img_static.html.php Added Paths: ----------- trunk/linpha2/lib/classes/pjmt/ trunk/linpha2/lib/include/Edit_File_Info.php trunk/linpha2/lib/include/calendar.php Removed Paths: ------------- trunk/linpha2/lib/classes/phpmeta/ trunk/linpha2/lib/include/calender.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/ChangeLog 2006-11-19 20:32:55 UTC (rev 4659) @@ -1,3 +1,8 @@ +2006-11-19 flo + * mostly finished iptc write support + @todo only save iptc data if we entered some data in the iptc form + @todo show full exif informations with pjmt/ShowFileInfo.php (provide security!) + 2006-11-17 flo * nearly finished meta data support Modified: trunk/linpha2/admin/metadata_define.php =================================================================== --- trunk/linpha2/admin/metadata_define.php 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/admin/metadata_define.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -200,7 +200,7 @@ while($data = $query->FetchRow()) { ?> - <h3><?php echo $data['name']; ?></h3> + <h3><?php echo i18n( ucfirst( $data['name'] ) ); ?></h3> <table border="0"> <tr> <td width="170"><b><?php echo i18n("Name"); ?></b></td> Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/docs/dev/TODO.txt 2006-11-19 20:32:55 UTC (rev 4659) @@ -8,6 +8,14 @@ thats not very user friendly - escape exif data +- how to handle common language strings like "Successfully updated data.", "Submit", "Access denied", "Check file permissions" ?? + i suggest using define('LIN_STR_SUBMIT', "Submit"); in the language file + and use it this way: echo i18n( LIN_STR_SUBMIT ); + or use: + define('LIN_STR_SUBMIT', i18n("Submit") ); + echo LIN_STR_SUBMIT; + ? + ## Big Todos - Installer Modified: trunk/linpha2/docs/dev/external_libraries.txt =================================================================== --- trunk/linpha2/docs/dev/external_libraries.txt 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/docs/dev/external_libraries.txt 2006-11-19 20:32:55 UTC (rev 4659) @@ -42,12 +42,37 @@ "RecName" => @$GLOBALS[ "IPTC_Entry_Names" ][ $iptctype ], "RecDesc" => @$GLOBALS[ "IPTC_Entry_Descriptions" ][ $iptctype ], ---- + + Edit_File_Info.php (located in /lib/include) + - base file from "Edit_File_Info.php", a lot of changes... - removed files: + Write_File_Info.php + - copied content to LinMetaDataModificate::saveModIptcData() + + Example.php + - renamed to ShowFileInfo.php, @todo add checkPermisions() !! + + Photoshop_File_Info.php + - line 1061 replace + if ( stristr ( $new_Exif_array[0][305]['Data'][0], $GLOBALS[ "Software Name" ]) == FALSE ) + with + if ( stristr ( $new_Exif_array[0][305]['Data'][0], "LinPHA") == FALSE ) + (we have changed $GLOBALS[ "Software Name" ] manually) + + - line 1450 replace + if ( stristr ( $new_Exif_array[0][305]['Data'][0], $GLOBALS[ "Software Name" ]) == FALSE ) + with + if ( stristr ( $new_Exif_array[0][305]['Data'][0], "LinPHA") == FALSE ) + + + - line 2051 replace "return false;" with "$foobar = false; return $foobar;" to prevent php notice "Notice: Only variable references should be returned by reference " + - line 2111 replace "return false;" with "$foobar = false; return $foobar;" to prevent php notice "Notice: Only variable references should be returned by reference " + + + Removed files: - documentation/ - Edit_File_Info.php - Edit_File_Info_Example.php - - Example.php - get_*_thumb.php (security) - test.jpg - TIFFExample.php Modified: trunk/linpha2/docs/dev/important stuff.txt =================================================================== --- trunk/linpha2/docs/dev/important stuff.txt 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/docs/dev/important stuff.txt 2006-11-19 20:32:55 UTC (rev 4659) @@ -1,8 +1,7 @@ - if we use exec($str, $array_output=array(), $return_value=''); it will always return empty $array_output and $return_value - you have to initialize $array_output and $return_value before! - + you have to initialize $array_output and $return_value before the exec() statement: $array_output = array(); $return_value = ''; exec($str, $array_output, $return_value); @@ -13,6 +12,10 @@ clearstatcache(); $handle = fopen($tmp_file, "rb"); $file_data = fread($handle, filesize($tmp_file)); + +- is_writable() does not work correctly under windows, it returns just the readonly attribute + see http://bugs.php.net/bug.php?id=27609 for details + see http://ch2.php.net/is_writable for alternative implementations - adodb eof $query = $GLOBALS['linpha']->db->Execute("SELECT id FROM meta_fields WHERE flags = '7'"); @@ -32,9 +35,4 @@ echo "Error: ".$error -> getMessage(); } -- $GLOBALS['linpha']->sql->config->value['sys_'] - -- some common language strings - "Successfully updated data." - "Submit" - ?? \ No newline at end of file +- $GLOBALS['linpha']->sql->config->value['sys_'] \ No newline at end of file Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -562,7 +562,7 @@ } break; case 'force_import': // called in viewImg - LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->full_filename) , $this->filename ); + LinImport::updateEntry( $GLOBALS['linpha']->template->idCurrent , dirname($this->src_file) , $this->filename ); break; case 'rotate_left': if($GLOBALS['linpha']->sql->isAdmin()) @@ -1145,6 +1145,11 @@ { $GLOBALS['linpha']->template->output['comment_text'] = ''; } + + /** + * save modified meta data + */ + LinMetaDataModificate::saveModifiedMetaData(); } @@ -1155,6 +1160,14 @@ */ function viewImg() { + $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); + $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; + $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; + + $array = LinImage::scaleToFit($this->org_width,$this->org_height,$this->max_width,$this->max_height); + $this->img_width = $array['w']; + $this->img_height = $array['h']; + $this->viewImgCommon(); $this->viewImgComments(); @@ -1231,20 +1244,10 @@ } // end viewImgAjax() /** - * stuff used Img and Meta view - * @uses LinImageview::viewImg - * @uses LinImageview:viewMeta + * stuff used in viewImg() and viewMeta() */ function viewImgCommon() { - $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); - $this->max_width = $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; - $this->max_height = $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; - - $array = LinImage::scaleToFit($this->org_width,$this->org_height,$this->max_width,$this->max_height); - $this->img_width = $array['w']; - $this->img_height = $array['h']; - $this->viewImgSetPrevNextThumb(); $this->viewImgStoreImageInformation(); @@ -1256,7 +1259,6 @@ ); } - /** * get/save image comments */ @@ -1302,8 +1304,6 @@ */ function viewImgStoreImageInformation() { - $this->full_filename = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); - $array_meta = array('exif','iptc'); foreach($array_meta AS $value) { @@ -1317,7 +1317,7 @@ */ if($GLOBALS['linpha']->sql->config->value['sys_image_'.$value]) { - $MetaData->saveData( $value, $this->full_filename,$this->md5sum); + $MetaData->saveData( $value, $this->src_file, $this->md5sum ); } } } @@ -1423,7 +1423,14 @@ { $GLOBALS['linpha']->template->setModuleName('view_img_static'); $GLOBALS['linpha']->template->overrideModule('css','view_img'); + + $this->src_file = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); + /** + * save modified meta data + */ + LinMetaDataModificate::saveModifiedMetaData(); + $this->viewImgCommon(); } Modified: trunk/linpha2/lib/classes/linpha.import.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.import.class.php 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/lib/classes/linpha.import.class.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -56,13 +56,16 @@ * read current directory in array */ $importarray_folder = Array(); - $d = dir( $dirname ); - while( false !== ($entry = $d->read() ) ) + if( $d = @dir( $dirname ) ) { - if($entry != '.' AND $entry != '..') + while( false !== ($entry = $d->read() ) ) { - $importarray_folder[] = $entry; + if($entry != '.' AND $entry != '..') + { + $importarray_folder[] = $entry; + } } + $d->close(); } /** @@ -338,20 +341,33 @@ /** * if the md5sum changes, update the md5sum in linpha_stats, linpha_meta_data - * occurs while rotating images, or if LinImport detects a change of the file + * occurs while rotating images, or we edited the iptc data, + * or if LinImport detects a change of the file * (for example: image has been edited with an external program) * * problem: if there are two images with the same md5sum, and one image gets changed - * linpha will update the md5sum of the changed image forthe comments (for example) + * linpha will update the md5sum of the changed image for the comments (for example) * to the new value, but if we then do a "detect file changes" on the old image, * the old image will do the same and change the md5sum of the comment back to this * this will create a race condition - * - * @todo if the file changed, it is best to re-index image - * -> delete/update exif/iptc/xmp data! + * -> thats not true ?! the "detect file changes" on the old image will not detect + * any changes, because there are no changes! */ function updateMd5sum( $id, $old_md5sum, $new_md5sum ) { + $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."meta_comments SET " . + "md5sum = '".$new_md5sum."' WHERE md5sum = '".$old_md5sum."'"); + + $GLOBALS['linpha']->db->Execute("UPDATE ".LIN_PREFIX."meta_data SET " . + "md5sum = '".$new_md5sum."' WHERE md5sum = '".$old_md5sum."'"); + + + /** + * if the file changed, it is best to re-index image + * -> delete/update exif/iptc/xmp data! + */ + $GLOBALS['linpha']->db->Execute("DELETE FROM ".LIN_PREFIX."meta_exif WHERE md5sum = '".$old_md5sum."'"); + $GLOBALS['linpha']->db->Execute("DELETE FROM ".LIN_PREFIX."meta_iptc WHERE md5sum = '".$old_md5sum."'"); } @@ -450,11 +466,11 @@ { /** * exif date and exif rotate stuff - * globally turn off using 'sys_import_exif' if having problems with phpmeta + * globally turn off using 'sys_import_exif' if having problems with pjmt */ if( $GLOBALS['linpha']->sql->config->value['sys_import_exif'] ) { - include_once( LINPHA_DIR.'/lib/classes/phpmeta/EXIF.php' ); + include_once( LINPHA_DIR.'/lib/classes/pjmt/EXIF.php' ); $meta = get_EXIF_JPEG($dirname.'/'.$filename); /** Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -408,8 +408,8 @@ */ function saveExifData($filename,$md5sum) { - include_once(LINPHA_DIR.'/lib/classes/phpmeta/JPEG.php'); // used for jpeg comment - include_once(LINPHA_DIR.'/lib/classes/phpmeta/EXIF.php'); + include_once(LINPHA_DIR.'/lib/classes/pjmt/JPEG.php'); // used for jpeg comment + include_once(LINPHA_DIR.'/lib/classes/pjmt/EXIF.php'); $str_columns = "md5sum, "; $str_values = "'".$md5sum."', "; @@ -510,8 +510,8 @@ */ function saveIptcData($filename, $md5sum) { - include_once(LINPHA_DIR.'/lib/classes/phpmeta/Photoshop_IRB.php'); - include_once(LINPHA_DIR.'/lib/classes/phpmeta/JPEG.php'); + include_once(LINPHA_DIR.'/lib/classes/pjmt/Photoshop_IRB.php'); + include_once(LINPHA_DIR.'/lib/classes/pjmt/JPEG.php'); $str_columns = "md5sum, "; $str_values = "'".$md5sum."', "; @@ -659,142 +659,335 @@ */ class LinMetaDataModificate extends LinMetaData { + function showEditMetaData() + { + /** + * 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: + 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="linMetaField['.$data['id'].']" value="'.$value.'" style="width: 250px;" maxlength="255" />'; + break; + 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="linMetaField['.$data['id'].']" id="linField'.$data['id'].'" value="'.$value.'" style="width: 150px;" maxlength="255" />' + .' <a href="javascript:void(0);" onclick="var loginWin = window.open(\''.LINPHA_CLIENT.'/lib/include/calendar.php?form=linField'.$data['id'].'\''. + ',\'Calendar\',\'height=250,width=300,scrollbars=no,menubar=no,status=no\');" target="_top">'.i18n("Calendar").'</a>'; + + 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="linMetaField['.$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>'."\n". + '<br /><span style="font-size: smaller;">'.i18n("For Multiple Select Use CTRL").'</span>'; + + if($GLOBALS['linpha']->sql->isAdmin()) + { + $GLOBALS['linpha']->template->output['meta_linpha'] .= '<br /><span style="font-size: smaller;"><a href="'.LINPHA_CLIENT.'/admin/?cat=metadata_define_adddata">'.i18n("Add More Options").'</a><br /><br /></span>'; + } + + break; + } + + $GLOBALS['linpha']->template->output['meta_linpha'] .= '</td></tr>'; + } + + /** + * set meta iptc + */ + if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) + { + if( isset($GLOBALS['linpha']->imgview->src_file) && file_exists($GLOBALS['linpha']->imgview->src_file)) + { + if( is_writable($GLOBALS['linpha']->imgview->src_file)) + { + $edit_possible = true; + $filename = $GLOBALS['linpha']->imgview->src_file; // used in IPTC Edit_File_Info.php + } + else + { + $edit_possible = false; + } + } + else + { + $edit_possible = false; + } + } + + /** + * build the meta data view + */ + $fragment = 'edit_meta'; + global $linTpl; + include(LINPHA_DIR.'/templates/'.$this->template_name.'/fragments.php'); - function saveLinphaMeta() + } // end function showEditMetaData() + + function saveModifiedMetaData() { if($GLOBALS['linpha']->sql->checkPermission('metadata_edit')) { - /** - * save metadata - */ if(isset($_POST['cmd']) && $_POST['cmd']=='insert_metadata') { - if(isset($_POST['field'])) + LinMetaDataModificate::saveModifiedMetaDataLinpha(); + + if($GLOBALS['linpha']->sql->config->value['sys_image_iptc'] + && isset($GLOBALS['linpha']->imgview->src_file) + && file_exists($GLOBALS['linpha']->imgview->src_file) + ) { /** - * delete existing entries + * write iptc data */ - $query = $GLOBALS['linpha']->db->Execute("DELETE FROM ".LIN_PREFIX."meta_data " . - "WHERE md5sum = '".$GLOBALS['linpha']->imgview->md5sum."'"); - - foreach($_POST['field'] AS $key=>$value) + global $new_ps_file_info_array; + $new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS']; + + /** + * important! + * remove other POST data from this array, because pjmt just takes all values and this will generate unexpected results!!! + * we got problems because $_POST['linMetaField'] is an array and pjmt couldnt handle this + */ + unset($new_ps_file_info_array['cmd']); + unset($new_ps_file_info_array['linMetaField']); + unset($new_ps_file_info_array['submit']); + + if( LinMetaDataModificate::saveModifiedMetaDataIptc( $new_ps_file_info_array ) ) { - 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)."')"); - } + /** + * force read data from file again if write was successful + */ + unset($new_ps_file_info_array); + LinImport::updateEntry( + $GLOBALS['linpha']->template->idCurrent , + dirname($GLOBALS['linpha']->imgview->src_file) , + basename($GLOBALS['linpha']->imgview->src_file) + ); } } } } - } - - function setMetaData() + + /** + * save modified linpha meta data to database + */ + function saveModifiedMetaDataLinpha() { - 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()) + if( isset($_POST['linMetaField']) && is_array($_POST['linMetaField']) ) { - $GLOBALS['linpha']->template->output['meta_linpha'] .= '<tr><td width="150" valign="top">'; + /** + * delete existing entries + */ + $query = $GLOBALS['linpha']->db->Execute("DELETE FROM ".LIN_PREFIX."meta_data " . + "WHERE md5sum = '".$GLOBALS['linpha']->imgview->md5sum."'"); - if( $data['flags']==5 ) + /** + * insert new entries + */ + foreach($_POST['linMetaField'] AS $key=>$value) { - $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 = ''; + if(is_array($value)) // coming from a select (categories etc.) + { + $value = ';'.implode(';',$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(! empty($value) ) { - 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']->db->Execute("INSERT into ".LIN_PREFIX."meta_data ". + "(field_id, md5sum, meta_data) VALUES " . + "('".LinSql::linAddslashes($key)."','".$GLOBALS['linpha']->imgview->md5sum."','".LinSql::linAddslashes($value)."')"); } - $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 - */ - /** - * edit IPTC Data in HTML popup - */ - function editIptcData() - { - - } /** - * save modified IPTC data to DB + * save iptc metadata back to file + * + * copied from pjmt/Write_File_Info.php + * + * @todo only save data if we entered some data in the iptc form!! */ - function saveModIptcData() + function saveModifiedMetaDataIptc( & $new_ps_file_info_array ) { + /** // Turn off Error Reporting + error_reporting ( 0 ); // Change: changed to no reporting - as of version 1.11 + include 'Toolkit_Version.php'; // Change: added as of version 1.11*/ + + // Include the required files for reading and writing Photoshop File Info + include_once(LINPHA_DIR.'/lib/classes/pjmt/JPEG.php'); + include_once(LINPHA_DIR.'/lib/classes/pjmt/XMP.php'); + include_once(LINPHA_DIR.'/lib/classes/pjmt/Photoshop_IRB.php'); + include_once(LINPHA_DIR.'/lib/classes/pjmt/EXIF.php'); + include_once(LINPHA_DIR.'/lib/classes/pjmt/Photoshop_File_Info.php'); + + $GLOBALS[ "Software Name" ] = "LinPHA v".LINPHA_VERSION.", powered by PHP JPEG Metadata Toolkit v" . $GLOBALS['Toolkit_Version'] ; + + // Copy all of the HTML Posted variables into an array + /** + * $new_ps_file_info_array = $GLOBALS['HTTP_POST_VARS']; + */ + + // Some characters are escaped with backslashes in HTML Posted variable + // Cycle through each of the HTML Posted variables, and strip out the slashes + /** + * already done in /include/common.php !! + * foreach( $new_ps_file_info_array as $var_key => $var_val ) + { + $new_ps_file_info_array[ $var_key ] = stripslashes( $var_val ); + }*/ + + // Keywords should be an array - explode it on newline boundarys + $new_ps_file_info_array[ 'keywords' ] = explode( "\n", trim( $new_ps_file_info_array[ 'keywords' ] ) ); + + // Supplemental Categories should be an array - explode it on newline boundarys + $new_ps_file_info_array[ 'supplementalcategories' ] = explode( "\n", trim( $new_ps_file_info_array[ 'supplementalcategories' ] ) ); + + /** + // Make the filename easier to access + $filename = $new_ps_file_info_array[ 'filename' ]; + + // Protect against hackers editing other files + $path_parts = pathinfo( $filename ); + if ( strcasecmp( $path_parts["extension"], "jpg" ) != 0 ) + { + echo "Incorrect File Type - JPEG Only\n"; + exit( ); + } + // Change: removed limitation on file being in current directory - as of version 1.11 + * + */ + $filename = $GLOBALS['linpha']->imgview->src_file; + + // Retrieve the header information + $jpeg_header_data = get_jpeg_header_data( $filename ); + + // Retreive the EXIF, XMP and Photoshop IRB information from + // the existing file, so that it can be updated + $Exif_array = get_EXIF_JPEG( $filename ); + $XMP_array = read_XMP_array_from_text( get_XMP_text( $jpeg_header_data ) ); + $IRB_array = get_Photoshop_IRB( $jpeg_header_data ); + + // Update the JPEG header information with the new Photoshop File Info + $jpeg_header_data = put_photoshop_file_info( $jpeg_header_data, $new_ps_file_info_array, $Exif_array, $XMP_array, $IRB_array ); + + // Check if the Update worked + if ( $jpeg_header_data == FALSE ) + { + // Update of file info didn't work - output error message + /** + * echo "Error - Failure update Photoshop File Info : $filename <br>\n"; + */ + linSysLog( i18n("Error - Failure update Photoshop File Info :" .' '. $filename) ); + + // Output HTML with the form and data which was + // sent, to allow the user to fix it + + /**$outputfilename = $filename; + include "Edit_File_info.php"; + echo "</body>\n"; + echo "</html>\n"; + + // Abort processing + exit( );*/ + + return false; + } + + // Attempt to write the new JPEG file + elseif ( FALSE == put_jpeg_header_data( $filename, $filename, $jpeg_header_data ) ) + { + // Writing of the new file didn't work - output error message + /** + * echo "Error - Failure to write new JPEG : $filename <br>\n"; + */ + linSysLog( i18n("Error: Failure to write new JPEG:" .' '. $filename) ); + + // Output HTML with the form and data which was + // sent, to allow the user to fix it + + /**$outputfilename = $filename; + include "Edit_File_info.php"; + echo "</body>\n"; + echo "</html>\n"; + + // Abort processing + exit( );*/ + + return false; + } + else + { + // Writing of new JPEG succeeded + + // Output information about new file + + linSysLog( i18n("DONE! Updated:" .' '. $filename) ); + /** + echo "<h1>DONE! - $filename updated</h1>\n"; + echo "<p><a href=\"Example.php?jpeg_fname=$filename\" >View Full Metatdata Information</a></p>\n"; + echo "<p><a href=\"Edit_File_Info_Example.php?jpeg_fname=$filename\" >Re-Edit Photoshop File Info</a></p>\n"; + echo "<br><br>\n"; + echo "<p>Below is the updated image, you can save it and look at the changed metadata in your favorite image editor</p>\n"; + echo "<p><img src=\"$filename\" ></p>\n";*/ + + return true; + } } } // end class LinMetaDataModificate @@ -1025,6 +1218,7 @@ * MetaColumns() returns the keys always uppercase independent of ADODB_ASSOC_CASE */ $array = $GLOBALS['linpha']->db->MetaColumns(LIN_PREFIX."meta_".$what); + $this->defined_fields[$what] = array(); foreach($array AS $key=>$value) { if( $key != 'MD5SUM') Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -551,6 +551,9 @@ /** * method to check if we are admin + * + * just returns the content of $isAdmin which has status private + * to prevent modification from external */ function isAdmin() { Modified: trunk/linpha2/lib/classes/metadata_editor.php =================================================================== --- trunk/linpha2/lib/classes/metadata_editor.php 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/lib/classes/metadata_editor.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -97,12 +97,12 @@ // Hide any unknown EXIF tags $GLOBALS['HIDE_UNKNOWN_TAGS'] = TRUE; - include './phpmeta/JPEG.php'; - include './phpmeta/JFIF.php'; - include './phpmeta/PictureInfo.php'; - include './phpmeta/XMP.php'; - include './phpmeta/Photoshop_IRB.php'; - include './phpmeta/EXIF.php'; + include './pjmt/JPEG.php'; + include './pjmt/JFIF.php'; + include './pjmt/PictureInfo.php'; + include './pjmt/XMP.php'; + include './pjmt/Photoshop_IRB.php'; + include './pjmt/EXIF.php'; // Output the title echo "<title>Metadata details for $filename</title>"; Copied: trunk/linpha2/lib/classes/pjmt (from rev 4658, trunk/linpha2/lib/classes/phpmeta) Modified: trunk/linpha2/lib/classes/pjmt/Photoshop_File_Info.php =================================================================== --- trunk/linpha2/lib/classes/phpmeta/Photoshop_File_Info.php 2006-11-17 21:36:12 UTC (rev 4658) +++ trunk/linpha2/lib/classes/pjmt/Photoshop_File_Info.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -1058,7 +1058,7 @@ { // An existing EXIF Software or Firmware Tag was found // Check if the existing Software or Firmware Tag already contains the Toolkit's name - if ( stristr ( $new_Exif_array[0][305]['Data'][0], $GLOBALS[ "Software Name" ]) == FALSE ) + if ( stristr ( $new_Exif_array[0][305]['Data'][0], "LinPHA") == FALSE ) { // Toolkit Name string not found in the existing Software/Firmware string - append it. $firmware_str = $new_Exif_array[0][305]['Data'][0] . " " . $GLOBALS[ "Software Name" ]; @@ -1442,12 +1442,13 @@ // Photoshop replaces the CreatorTool with "Adobe Photoshop ..." // This toolkit instead preserves existing value and appends the toolkit name to the end of it + // Check if a CreatorTool already exists if ( $Item[ 'value' ] != "" ) { // An existing CreatorTool was found // Check if the existing CreatorTool already contains the Toolkit's name - if ( stristr ( $Item[ 'value' ], $GLOBALS[ "Software Name" ]) == FALSE ) + if ( stristr ( $Item[ 'value' ], "LinPHA") == FALSE ) { // Toolkit Name string not found in the existing CreatorTool string - append it. $Item[ 'value' ] = $Item[ 'value' ] . " " . $GLOBALS[ "Software Name" ]; @@ -1463,9 +1464,6 @@ $Item[ 'value' ] = $GLOBALS[ "Software Name" ]; } - - - // Process the XMP Basic Job Information block // Find the XAP Basic Job Information within the XMP block @@ -2048,7 +2046,8 @@ } // No matching tag found - return error code - return FALSE; + //return FALSE; // prevent PHP notice "Notice: Only variable references should be returned by reference in D:\eclipse\linpha2\lib\classes\pjmt\Photoshop_File_Info.php on line 2051" + $foobar = false; return $foobar; } /****************************************************************************** @@ -2108,7 +2107,8 @@ } // No matching rdf:Description block found - return FALSE; + //return FALSE; // prevent PHP notice "Notice: Only variable references should be returned by reference in D:\eclipse\linpha2\lib\classes\pjmt\Photoshop_File_Info.php on line 2051" + $foobar = false; return $foobar; } /****************************************************************************** Added: trunk/linpha2/lib/include/Edit_File_Info.php =================================================================== --- trunk/linpha2/lib/include/Edit_File_Info.php (rev 0) +++ trunk/linpha2/lib/include/Edit_File_Info.php 2006-11-19 20:32:55 UTC (rev 4659) @@ -0,0 +1,562 @@ +<?php +if(!defined('LINPHA_DIR')) { exit(1); } + +/**************************************************************************** +* +* Filename: Edit_File_Info.php +* +* Description: Allows the user to edit the metadata of an image over the internet +* in the same way that Photoshop edits 'File Info' data +* This file provides only the html for a form containing the file info +* input fields. The rest of the html file must be provided by the calling script. +* $outputfilename must always be defined - it is ne name of the file which +* have the metadata changed after the form has been submitted +* +* This file has several modes of operation: +* +* 1) If $new_ps_file_info_array is defined then it's data will be used +* to fill the fields. +* 2) If $new_ps_file_info_array is not defined but $filename is defined, +* then the file info fields will be filled from the metadata in the file specified +* 3) If $new_ps_file_info_array is not defined but $filename and $default_ps_file_info_array +* are defined, then the file info fields will be filled from the metadata +* in the file specified, but where fields are blank, they will be filled from $default_ps_file_info_array +* 4) Otherwise the fields will be blank +* +* See Edit_File_Info_Example.php for an example of usage +* +* Author: Evan Hunter +* +* Date: 17/11/2004 +* +* Project: PHP JPEG Metadata Toolkit +* +* Revision: 1.11 +* +* Changes: 1.10 -> 1.11 : Changed displayed toolkit version numbers to reference Toolkit_Version.php +* +* URL: http://electronics.ozhiker.com +* +* Copyright: Copyright Evan Hunter 2004 +* +* License: This file is part of the PHP JPEG Metadata Toolkit. +* +* The PHP JPEG Metadata Toolkit is free software; you can +* redistribute it and/or modify it under the terms of the +* GNU General Public License as published by the Free Software +* Foundation; either version 2 of the License, or (at your +* option) any later version. +* +* The PHP JPEG Metadata Toolkit is distributed in the hope +* that it will be useful, but WITHOUT ANY WARRANTY; without +* even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License +* for more details. +* +* You should have received a copy of the GNU General Public +* License along with the PHP JPEG Metadata Toolkit; if not, +* write to the Free Software Foundation, Inc., 59 Temple +* Place, Suite 330, Boston, MA 02111-1307 USA +* +* If you require a different license for commercial or other +* purposes, please contact the author: ev...@oz... +* +***************************************************************************/ + + + + include LINPHA_DIR.'/lib/classes/pjmt/Toolkit_Version.php'; // Change: added as of version 1.11 + + // Check for operation modes 2 or 3 + // i.e. $filename is defined, and $new_ps_file_info_array is not + if ( ( ! isset( $new_ps_file_info_array ) ) && + ( isset( $filename ) ) && + ( is_string( $filename ) ) ) + { + // Hide any unknown EXIF tags + $GLOBALS['HIDE_UNKNOWN_TAGS'] = TRUE; + + // Accessing the existing file info for the specified file requires these includes + include_once( LINPHA_DIR.'/lib/classes/pjmt/JPEG.php' ); + include_once( LINPHA_DIR.'/lib/classes/pjmt/XMP.php' ); + include_once( LINPHA_DIR.'/lib/classes/pjmt/Photoshop_IRB.php' ); + include_once( LINPHA_DIR.'/lib/classes/pjmt/EXIF.php' ); + include_once( LINPHA_DIR.'/lib/classes/pjmt/Photoshop_File_Info.php' ); + + // Retrieve the header information from the JPEG file + $jpeg_header_data = get_jpeg_header_data( $filename ); + + // Retrieve EXIF information from the JPEG file + $Exif_array = get_EXIF_JPEG( $filename ); + + // Retrieve XMP information from the JPEG file + $XMP_array = read_XMP_array_from_text( get_XMP_text( $jpeg_header_data ) ); + + // Retrieve Photoshop IRB information from the JPEG file + $IRB_array = get_Photoshop_IRB( $jpeg_header_data ); + + // Retrieve Photoshop File Info from the three previous arrays + $new_ps_file_info_array = get_photoshop_file_info( $Exif_array, $XMP_array, $IRB_array ); + + + + // Check if there is an array of defaults available + if ( ( isset( $default_ps_file_info_array) ) && + ( is_array( $default_ps_file_info_array) ) ) + { + // There are defaults defined + + // Check if there is a default for the date defined + if ( ( ! array_key_exists( 'date', $default_ps_file_info_array ) ) || + ( ( array_key_exists( 'date', $default_ps_file_info_array ) ) && + ( $default_ps_file_info_array['date'] == '' ) ) ) + { + // No default for the date defined + // figure out a default from the file + + // Check if there is a EXIF Tag 36867 "Date and Time of Original" + if ( ( $Exif_array != FALSE ) && + ( array_key_exists( 0, $Exif_array ) ) && + ( array_key_exists( 34665, $Exif_array[0] ) ) && + ( array_key_exists( 0, $Exif_array[0][34665] ) ) && + ( array_key_exists( 36867, $Exif_array[0][34665][0] ) ) ) + { + // Tag "Date and Time of Original" found - use it for the default date + $default_ps_file_info_array['date'] = $Exif_array[0][34665][0][36867]['Data'][0]; + $default_ps_file_info_array['date'] = preg_replace( "/(\d\d\d\d):(\d\d):(\d\d)( \d\d:\d\d:\d\d)/", "$1-$2-$3", $default_ps_file_info_array['date'] ); + } + // Check if there is a EXIF Tag 36868 "Date and Time when Digitized" + else if ( ( $Exif_array != FALSE ) && + ( array_key_exists( 0, $Exif_array ) ) && + ( array_key_exists( 34665, $Exif_array[0] ) ) && + ( array_key_exists( 0, $Exif_array[0][34665] ) ) && + ( array_key_exists( 36868, $Exif_array[0][34665][0] ) ) ) + { + // Tag "Date and Time when Digitized" found - use it for the default date + $default_ps_file_info_array['date'] = $Exif_array[0][34665][0][36868]['Data'][0]; + $default_ps_file_info_array['date'] = preg_replace( "/(\d\d\d\d):(\d\d):(\d\d)( \d\d:\d\d:\d\d)/", "$1-$2-$3", $default_ps_file_info_array['date'] ); + } + // Check if there is a EXIF Tag 306 "Date and Time" + else if ( ( $Exif_array != FALSE ) && + ( array_key_exists( 0, $Exif_array ) ) && + ( array_key_exists( 306, $Exif_array[0] ) ) ) + { + // Tag "Date and Time" found - use it for the default date + $default_ps_file_info_array['date'] = $Exif_array[0][306]['Data'][0]; + $default_ps_file_info_array['date'] = preg_replace( "/(\d\d\d\d):(\d\d):(\d\d)( \d\d:\d\d:\d\d)/", "$1-$2-$3", $default_ps_file_info_array['date'] ); + } + else + { + // Couldn't find an EXIF date in the image + // Set default date as creation date of file + $default_ps_file_info_array['date'] = date ("Y-m-d", filectime( $filename )); + } + } + + // Cycle through all the elements of the default values array + foreach( $default_ps_file_info_array as $def_key =>$default_item ) + { + // Check if the current element is Keywords or + // Supplemental Categories as these are arrays + // and need to be treated differently + if ( ( strcasecmp( $def_key, "keywords" ) == 0 ) || + ( strcasecmp( $def_key, "supplementalcategories" ) == 0 ) ) + { + // Keywords or Supplemental Categories found + // Check if the File Info from the file is empty for this element + // and if there are default values in this array element + if ( ( count( $new_ps_file_info_array[ $def_key ] ) == 0 ) && + ( is_array( $default_item ) ) && + ( count( $default_item ) >= 0 ) ) + { + // The existing file info is empty, and there are + // defaults - add them + $new_ps_file_info_array[ $def_key ] = $default_item; + } + } + // Otherwise, this is not an array element, just check if it is blank in the existing file info + else if ( trim( $new_ps_file_info_array[ $def_key ] ) == "" ) + { + // The existing file info is blank, add the default value + $new_ps_file_info_array[ $def_key ] = $default_item; + } + + } + } + } + // Check for operation mode 4 - $new_ps_file_info_array and $filename are not defined, + else if ( ( ( !isset($new_ps_file_info_array) ) || ( ! is_array($new_ps_file_info_array) ) ) && + ( ( !isset($filename) ) || ( ! is_string( $filename ) ) ) ) + { + // No filename or new_ps_file_info_array defined, create a blank file info array to display + $new_ps_file_info_array = array( + "title" => "", + "author" => "", + "authorsposition" => "", + "caption" => "", + "captionwriter" => "", + "jobname" => "", + "copyrightstatus" => "", + "copyrightnotice" => "", + "ownerurl" => "", + "keywords" => array(), + "category" => "", + "supplementalcategories" => array(), + "date" => "", + "city" => "", + "state" => "", + "country" => "", + "credit" => "", + "source" => "", + "headline" => "", + "instructions" => "", + "transmissionreference" => "", + "urgency" => "" ); + } + + + +/*************************************************************************** +* +* Now output the actual HTML form +* +***************************************************************************/ +/** +?> + + + + + <form name="EditJPEG" action="Write_File_Info.php" method="post"> + + + echo "<input name=\"filename\" type=\"hidden\" value=\"$outputfilename\">"; + + <table> +*/ +?> + <tr> + <td> + Title + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"title\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'title' ], ENT_QUOTES) ."\">"; + ?> + </td> + </tr> + + <tr> + <td> + Author + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"author\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'author' ], ENT_QUOTES) ."\">"; + ?> + </td> + </tr> + + <tr> + <td> + Authors Position + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"authorsposition\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'authorsposition' ], ENT_QUOTES) ."\"> - Note: not used in Photoshop 7 or higher"; + ?> + </td> + </tr> + + <tr> + <td> + Description + </td> + <td> + <textarea name="caption" class="linForms" rows=3 cols=37 wrap="off"><?php echo htmlspecialchars($new_ps_file_info_array[ 'caption' ], ENT_QUOTES); ?></textarea> + </td> + </tr> + + <tr> + <td> + Description Writer + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"captionwriter\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'captionwriter' ], ENT_QUOTES) ."\">"; + ?> + </td> + </tr> + + + <tr> + <td> + Keywords + </td> + <td> + <textarea class="linForms" name="keywords" rows=3 cols=37 wrap="off"><?php + foreach( $new_ps_file_info_array[ 'keywords' ] as $keyword ) + { + echo htmlspecialchars($keyword, ENT_QUOTES)."
"; + } + ?></textarea> + </td> + </tr> + + + <tr> + <td> + Copyright Status + </td> + <td> + <select size=1 class="linForms" name="copyrightstatus"> + <?php + $copystatus = $new_ps_file_info_array[ 'copyrightstatus' ]; + if ( $copystatus == "Unknown" ) + { + echo "<option value=\"Unknown\" SELECTED >Unknown</option>\n"; + } + else + { + echo "<option value=\"Unknown\">Unknown</option>\n"; + } + + if ( $copystatus == "Copyrighted Work" ) + { + echo "<option value=\"Copyrighted Work\" SELECTED >Copyrighted Work</option>\n"; + } + else + { + echo "<option value=\"Copyrighted Work\">Copyrighted Work</option>\n"; + } + + if ( $copystatus == "Public Domain" ) + { + echo "<option value=\"Public Domain\" SELECTED >Public Domain</option>\n"; + } + else + { + echo "<option value=\"Public Domain\">Public Domain</option>\n"; + } + ?> + </select> + </td> + </tr> + + + <tr> + <td> + Copyright Notice + </td> + <td> + <textarea class="linForms" name="copyrightnotice" rows=3 cols=37 wrap="off"><?php echo htmlspecialchars($new_ps_file_info_array[ 'copyrightnotice' ], ENT_QUOTES); ?></textarea> + </td> + </tr> + + + <tr> + <td> + Copyright Info URL + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"ownerurl\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'ownerurl' ], ENT_QUOTES) ."\">\n"; + if ($new_ps_file_info_array[ 'ownerurl' ] != "" ) + { + echo "<a href=\"". htmlspecialchars($new_ps_file_info_array[ 'ownerurl' ], ENT_QUOTES) ."\" > (". htmlspecialchars($new_ps_file_info_array[ 'ownerurl' ], ENT_QUOTES) .")</a>\n"; + } + ?> + + </td> + </tr> + + + <tr> + <td> + Category + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"category\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'category' ], ENT_QUOTES) ."\">\n"; + ?> + + </td> + </tr> + + <tr> + <td> + Supplemental Categories + </td> + <td> + <textarea class="linForms" name="supplementalcategories" rows=3 cols=37 wrap="off"><?php + foreach( $new_ps_file_info_array[ 'supplementalcategories' ] as $supcat ) + { + echo htmlspecialchars($supcat, ENT_QUOTES)."
"; + } + ?></textarea> + </td> + </tr> + + + + <tr> + <td> + Date Created + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"date\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'date' ], ENT_QUOTES) ."\">"; + ?> + - Note date must be YYYY-MM-DD format + </td> + </tr> + + <tr> + <td> + City + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"city\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'city' ], ENT_QUOTES) ."\">"; + ?> + </td> + </tr> + + + <tr> + <td> + State + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"state\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'state' ], ENT_QUOTES) ."\">"; + ?> + </td> + </tr> + + + <tr> + <td> + Country + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"country\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'country' ], ENT_QUOTES) ."\">"; + ?> + </td> + </tr> + + + + <tr> + <td> + Credit + </td> + <td> + <?php + echo "<input size=49 class=\"linForms\" name=\"credit\" type=\"text\" value=\"". htmlspecialchars($new_ps_file_info_array[ 'credit' ], ENT_QUOTES) ."\">"; + ?> + ... [truncated message content] |