Commit 930ee330 authored by lindonb's avatar lindonb

No commit message

No commit message
parent 3c9f3d8c
......@@ -1359,6 +1359,7 @@ img/icons/table_multiple.png -text
img/icons/table_sort.png -text
img/icons/tag_blue.png -text
img/icons/tag_blue_add.png -text
img/icons/tag_orange.png -text
img/icons/task_received.png -text
img/icons/task_shared.png -text
img/icons/task_submitted.png -text
......@@ -3084,6 +3085,7 @@ lib/menubuilder/menu.js -text
lib/menubuilder/menulib.php -text
lib/messu/index.php -text
lib/messu/messulib.php -text
lib/metadata/basicinfo.php -text
lib/metadata/imagefile.php -text
lib/metadata/index.php -text
lib/metadata/iptc.php -text
......@@ -5417,6 +5419,7 @@ templates/messu-read.tpl -text
templates/messu-read_archive.tpl -text
templates/messu-read_sent.tpl -text
templates/messu-sent.tpl -text
templates/metadata/meta_view_dialog.tpl -text
templates/metrics-tab.tpl -text
templates/module.tpl -text
templates/modules/index.php -text
......
......@@ -240,7 +240,7 @@ class ImageAbstract
return $this->width;
}
function getMetadata($filename = null, $ispath = true, $extended = true, $mwg_compliant = true)
function getMetadata($filename = null, $ispath = true, $extended = true)
{
include_once('lib/metadata/metadata.php');
if ($filename === null) {
......@@ -253,7 +253,7 @@ class ImageAbstract
}
}
if (!is_object($this->metadata) || get_class($this->metadata) != 'FileMetadata') {
$this->metadata = new FileMetadata($filename, $ispath, $extended, $mwg_compliant);
$this->metadata = new FileMetadata($filename, $ispath, $extended);
}
return $this->metadata;
}
......
<?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) {
header('location: index.php');
exit;
}
/**
* Manipulates basic metadata extracted from a file
*/
class BasicInfo
{
/**
* Label and suffix information for each field
*
* @var array
*/
var $specs = array(
'size' => array(
'label' => 'File Size',
'suffix' => 'bytes',
),
'type' => array(
'label' => 'File Type',
),
'charset' => array(
'label' => 'Character Set',
),
'devices' => array(
'label' => 'Devices',
),
);
/**
* Process raw basic metadata to ready for table presentations by adding labels and suffixes and expected fields
*
* @param array $basicraw Basic file metadata in a simple array
*
* @return array|bool $basic Processed metadata with expected fields used in later functions
*/
function processRawData($basicraw)
{
if (is_array($basicraw)) {
foreach ($basicraw as $name => $field) {
$basic[$name]['newval'] = $field;
$basic[$name]['label'] = $this->specs[$name]['label'];
if (isset($this->specs[$name]['suffix'])) {
$basic[$name]['suffix'] = $this->specs[$name]['suffix'];
}
}
return $basic;
} else {
return false;
}
}
}
\ No newline at end of file
......@@ -11,9 +11,10 @@ if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) {
exit;
}
/*
* Reads JPEG-specific metadata from a JPEG file
/**
* Reads metadata common to image files
* Called by the FileMetadata class at metadata/metadata.php, which handles generic file metadata
* Image-specific classes (like Jpeg) extend this class
*/
class ImageFile
{
......@@ -21,7 +22,12 @@ class ImageFile
var $width = null;
var $height = null;
var $otherinfo = null;
/**
* Assign common image metadata information to properties
*
* @param FileMetadata object $metaObj
*/
function __construct($metaObj)
{
$this->header = getimagesize($metaObj->currname, $otherinfo);
......@@ -29,5 +35,5 @@ class ImageFile
$this->height = $this->header[1];
$this->otherinfo = $otherinfo;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -600,7 +600,6 @@ function wikiplugin_img( $data, $params )
$srcmash = $imgdata['fileId'] . $imgdata['id'] . $imgdata['attId'] . $imgdata['src'];
if (( strpos($srcmash, '|') !== false ) || (strpos($srcmash, ',') !== false ) || !empty($imgdata['fgalId'])) {
$separator = '';
$id = '';
if (!empty($imgdata['id'])) {
$id = 'id';
} elseif (!empty($imgdata['fileId'])) {
......@@ -770,9 +769,9 @@ function wikiplugin_img( $data, $params )
if ($imgdata['desc'] == 'idesc' || $imgdata['desc'] == 'ititle' || $xmpview) {
$metadata = $imageObj->getMetadata(null, null, $xmpview)->typemeta;
//description from image iptc
$idesc = isset($metadata['iptc_raw']['2#120'][0]) ? $metadata['iptc_raw']['2#120'][0] : '';
$idesc = isset($metadata['iptcraw']['iptc']['2#120'][0]) ? $metadata['iptcraw']['iptc']['2#120'][0] : '';
//title from image iptc
$ititle = isset($metadata['iptc_raw']['2#005'][0]) ? $metadata['iptc_raw']['2#005'][0] : '';
$ititle = isset($metadata['iptcraw']['iptc']['2#005'][0]) ? $metadata['iptcraw']['iptc']['2#005'][0] : '';
}
$fwidth = '';
......@@ -1198,25 +1197,8 @@ function wikiplugin_img( $data, $params )
static $lastval = 0;
$id = 'imgdialog-' . ++$lastval;
$id_link = $id . '-link';
$dialog = $imageObj->metadata->dialogMetadata($imageObj->metadata, $id, $filename);
$dialog = $imageObj->metadata->dialogTabs($imageObj->metadata, $id, $id_link, $filename);
$repl .= $dialog;
$jq = '$(document).ready(function() {
$("#' . $id . '").css(\'z-index\', \'1005\').dialog({
autoOpen: false,
width: 700,
zIndex: 1005
});
$("#' . $id_link . '").click(function() {
$("#' . $id . '").accordion({
autoHeight: false,
collapsible: true
}).dialog(\'open\');
return false;
});
});';
global $headerlib;
$headerlib->add_jq_onready($jq);
}
////////////////////// Create enlarge button, metadata icon, description and their divs////////////////////
//Start div that goes around button and description if these are set
......@@ -1278,7 +1260,9 @@ function wikiplugin_img( $data, $params )
}
//Add metadata icon
if ($imgdata['metadata'] == 'view') {
$repl .= '<div style="float:right; margin-right:2px"><a href="#" id="' . $id_link . '"><img src="./img/icons/tag_blue.png" alt="' . tra('Metadata') . '" title="' . tra('Metadata') . '"/></a></div>';
$repl .= '<div style="float:right; margin-right:2px"><a href="#" id="' . $id_link
. '"><img src="./img/icons/tag_orange.png" alt="' . tra('Metadata') . '" title="'
. tra('Metadata') . '"/></a></div>';
}
//Add description based on user setting (use $desconly from above) and close divs
isset($desconly) ? $repl .= $desconly : '';
......
......@@ -737,23 +737,6 @@ body.tiki_wiki #comments {
padding: 2px;
}
.wpimg-meta-col1 {
text-align: right;
font-weight: bold;
width: 225px;
margin-right: 5px;
}
.wpimg-meta-col2 {
width: 375px;
}
.wpimg-meta-section {
border-bottom: solid 1px #d3d3d3;
width: 600px;
margin-right: 5px;
}
/* wikiplugin_carousel v3 */
.ic_button {
......@@ -1766,4 +1749,23 @@ form.simple textarea.export {
max-width: 130px;
}
/* Metadata dialog box */
.meta-col1 {
text-align: right;
font-weight: bold;
font-size: 14px;
width: 225px;
margin-right: 5px;
}
.meta-col2 {
font-size: 14px;
width: 375px;
}
.meta-section {
border-bottom: solid 1px #d3d3d3;
width: 600px;
font-style: italic;
}
/* End of file */
<div id="{$id|escape}" title="{tr}Image Metadata for{/tr} {$filename|escape}" style="display:none">
{if $type eq 'data'}
{if $extended eq 'n'}
<span>
{tr}<em>Note: only basic metadata processed for this file type</em>{/tr}
</span>
{/if}
<ul>
{foreach $metarray as $subtypes}
<li>
<a href="#tabs-{$subtypes@iteration}">
{if $subtypes@key|count_words gt 1}
{tr}{$subtypes@key|escape}{/tr}
{else}
{$subtypes@key|upper|escape}
{/if}
</a>
</li>
{/foreach}
</ul>
{foreach $metarray as $subtypes}
<table id="tabs-{$subtypes@iteration}">
{foreach $subtypes as $fields}
{if $fields|count gt 0}
<tr>
<td colspan="2">
<div class="meta-section">
{tr}{$fields@key|lower|capitalize|escape}{/tr}
</div>
</td>
</tr>
{foreach $fields as $fieldarray}
<tr>
<td>
<div class="meta-col1">
{if isset($fieldarray.label) && $fieldarray.label ne 'li'}
{tr}{$fieldarray.label|escape}{/tr}
{else}
{tr}{$fieldarray@key|escape}{/tr}
{/if}
</div>
</td>
<td>
<div class="meta-col2">
{$fieldarray.newval|escape}
{if isset($fieldarray.suffix)}
{if !empty($fieldarray.newval)}
&nbsp;
{/if}
{tr}{$fieldarray.suffix|escape}{/tr}
{/if}
</div>
</td>
</tr>
{/foreach}
{/if}
{/foreach}
</table>
{/foreach}
{else}
{if !$error}
{tr}No metadata found{/tr}
{else}
{tr}$error{/tr}
{/if}
{/if}
</div>
{jq}
$("#{{$id}}").css('z-index', '1005').dialog({
autoOpen: false,
width: 675,
zIndex: 1005
});
$("#{{$id_link}}").click(function() {
$("#{{$id}}").tabs({
autoHeight: false,
collapsible: true
}).dialog('open');
return false;
});
{/jq}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment