summaryrefslogtreecommitdiff
path: root/lib/tpl
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-07-31 18:35:54 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-07-31 18:35:54 +0200
commit36df6fa3069d55db3c35724c4f465bde9c50b53a (patch)
treed462d09cf51c2732731eb6db4c7cd601c86df4c1 /lib/tpl
parent23a34783631a54703aa67aa0de81c404c59ef4ef (diff)
downloadrpg-36df6fa3069d55db3c35724c4f465bde9c50b53a.tar.gz
rpg-36df6fa3069d55db3c35724c4f465bde9c50b53a.tar.bz2
image metadata editor
This patch adds an meta data editor for JPEG files. Currently title, caption, artist, copyright and keywords can be saved. The data is saved to the apropriate IPTC fields. Additional fields can be added in the appropriate template. Compatibility testing with other programs is needed! darcs-hash:20050731163554-7ad00-dd936ec19549203dcf72de8774309c0b17d0b679.gz
Diffstat (limited to 'lib/tpl')
-rw-r--r--lib/tpl/default/design.css22
-rw-r--r--lib/tpl/default/mediaedit.php90
2 files changed, 112 insertions, 0 deletions
diff --git a/lib/tpl/default/design.css b/lib/tpl/default/design.css
index 48453a736..ee03815ff 100644
--- a/lib/tpl/default/design.css
+++ b/lib/tpl/default/design.css
@@ -733,3 +733,25 @@ div.mediaselect-right li, div.uploadform {
clear: both;
}
+div.mediaedit div.data label{
+ display: block;
+ text-align: right;
+ width: 20%;
+ float: left;
+ margin-right: 0.5em;
+}
+
+div.mediaedit div.data input, div.mediaedit div.data textarea{
+ width: 75%;
+ padding: 0.1em;
+ margin: 0.1em;
+}
+
+div.mediaedit div.data input.button {
+ width: 10em;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+
diff --git a/lib/tpl/default/mediaedit.php b/lib/tpl/default/mediaedit.php
new file mode 100644
index 000000000..53a969e1b
--- /dev/null
+++ b/lib/tpl/default/mediaedit.php
@@ -0,0 +1,90 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?php
+/**
+ * DokuWiki Default Template
+ *
+ * This is the template for editing image meta data.
+ * It is displayed in the media popup.
+ *
+ * You should leave the doctype at the very top - It should
+ * always be the very first line of a document.
+ *
+ * @link http://wiki.splitbrain.org/wiki:tpl:templates
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang']?>" lang="<?php echo $conf['lang']?>" dir="ltr">
+<head>
+ <title><?php echo hsc($lang['mediaselect'])?> [<?php echo hsc($conf['title'])?>]</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <?php tpl_metaheaders()?>
+
+ <link rel="shortcut icon" href="<?php echo DOKU_BASE?>images/favicon.ico" />
+ <link rel="stylesheet" media="screen" type="text/css" href="<?php echo DOKU_TPL?>layout.css" />
+ <link rel="stylesheet" media="screen" type="text/css" href="<?php echo DOKU_TPL?>design.css" />
+</head>
+
+<body>
+<div class="dokuwiki">
+ <?php html_msgarea()?>
+
+ <h1><?php echo hsc($lang['metaedit'])?> <code><?php echo hsc(noNS($IMG))?></code></h1>
+
+ <div class="mediaedit">
+ <?php/* everything in meta array is tried to save and read */?>
+
+ <div class="data">
+ <form action="<?php echo DOKU_BASE?>lib/exe/media.php" accept-charset="utf-8" method="post">
+ <input type="hidden" name="edit" value="<?php echo hsc($IMG)?>" />
+ <input type="hidden" name="save" value="1" />
+
+ <label for="title"><?php echo $lang['img_title']?></label>
+ <input type="text" name="meta[Iptc.Headline]" id="title" class="edit"
+ value="<?php echo hsc(tpl_img_getTag('IPTC.Headline'))?>" /><br />
+
+ <label for="caption"><?php echo $lang['img_caption']?></label>
+ <textarea name="meta[Iptc.Caption]" id="caption" class="edit" rows="5"><?php
+ echo hsc(tpl_img_getTag(array('IPTC.Caption',
+ 'EXIF.UserComment',
+ 'EXIF.TIFFImageDescription',
+ 'EXIF.TIFFUserComment')));
+ ?></textarea><br />
+
+ <label for="artist"><?php echo $lang['img_artist']?></label>
+ <input type="text" name="meta[Iptc.Byline]" id="artist" class="edit"
+ value="<?php echo hsc(tpl_img_getTag(array('Iptc.Byline',
+ 'Exif.TIFFArtist',
+ 'Exif.Artist',
+ 'Iptc.Credit')))?>" /><br />
+
+ <label for="copy"><?php echo $lang['img_copyr']?></label>
+ <input type="text" name="meta[Iptc.CopyrightNotice]" id="copy" class="edit"
+ value="<?php echo hsc(tpl_img_getTag(array('Iptc.CopyrightNotice','Exif.TIFFCopyright','Exif.Copyright')))?>" /><br />
+
+
+ <label for="keywords"><?php echo $lang['img_keywords']?></label>
+ <textarea name="meta[Iptc.Keywords]" id="keywords" class="edit"><?php
+ echo hsc(tpl_img_getTag(array('IPTC.Keywords',
+ 'EXIF.Category')));
+ ?></textarea><br />
+
+
+ <input type="submit" value="<?php echo $lang['btn_save']?>" title="ALT+S"
+ accesskey="s" class="button" />
+
+ </form>
+ </div>
+
+
+ <div class="footer">
+ <hr>
+ <?php tpl_button('backtomedia')?>
+ </div>
+ </div>
+
+</div>
+</body>
+</html>
+