summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-11 17:42:05 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-11 17:42:05 +0000
commit37a1cca520536ba52b14069b1efb4871d47e44de (patch)
treeff3c4d1bba5c51cd2eb46f2b8c7ba3ac1146deca
parentd739d1ea46c1b8452469cef26f3cbd4ddbdc3c38 (diff)
Well, exif dialog displays and will show the summary information.
However, The text needs to be scaled or the size of the box needs to be managed such that there is nowrapping. The columns need to be styled for odd and even. And I can't get tabbing to work. If you click on details tab nothing happens and i don't know what I've done wrong. Addition input is appreciated.
-rw-r--r--modules/exif/controllers/exif.php33
-rw-r--r--modules/exif/helpers/exif_theme.php31
-rw-r--r--modules/exif/views/exif_dialog.html.php77
-rw-r--r--modules/exif/views/exif_sidebar.html.php8
4 files changed, 149 insertions, 0 deletions
diff --git a/modules/exif/controllers/exif.php b/modules/exif/controllers/exif.php
new file mode 100644
index 00000000..ca2e4cab
--- /dev/null
+++ b/modules/exif/controllers/exif.php
@@ -0,0 +1,33 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class Exif_Controller extends Controller {
+ /**
+ * Display the Exif data an existing comment.
+ */
+ public function show($item_id) {
+ $item = ORM::factory("item", $item_id);
+ access::required("view", $item);
+
+ $view = new View("exif_dialog.html");
+ $view->details = array("summary" => exif::get($item), "detail" => exif::get($item, false));
+
+ print $view;
+ }
+}
diff --git a/modules/exif/helpers/exif_theme.php b/modules/exif/helpers/exif_theme.php
new file mode 100644
index 00000000..e7174b4d
--- /dev/null
+++ b/modules/exif/helpers/exif_theme.php
@@ -0,0 +1,31 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program 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.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class exif_theme_Core {
+ static function sidebar_bottom($theme) {
+ if ($theme->item()->is_photo()) {
+ $view = new View("exif_sidebar.html");
+
+ $csrf = access::csrf_token();
+ $view->url = url::site("exif/show/{$theme->item()->id}?csrf=$csrf");
+ return $view;
+ }
+ return null;
+ }
+}
diff --git a/modules/exif/views/exif_dialog.html.php b/modules/exif/views/exif_dialog.html.php
new file mode 100644
index 00000000..8eb40caa
--- /dev/null
+++ b/modules/exif/views/exif_dialog.html.php
@@ -0,0 +1,77 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<style>
+/* Tabs ----------------------------------*/
+.ui-tabs {padding: .2em;}
+.ui-tabs .ui-tabs-nav { padding: .2em .2em 0 .2em; position: relative; }
+.ui-tabs .ui-tabs-nav li { float: left; border-bottom: 0 !important; margin: 0 .2em -1px 0; padding: 0; list-style: none; }
+.ui-tabs .ui-tabs-nav li a { display:block; text-decoration: none; padding: .5em 1em; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: .1em; border-bottom: 0; }
+.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border: 0; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
+</style>
+<script type="/text/javascript">
+ $("#gExifData").ready(function() {
+ $('#gExifData').tabs();
+ });
+</script>
+<h1 style="display: none;"><?= t("Photo Detail") ?></h1>
+<div id="gExifData" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
+ <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
+ <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#gExifSummary"><?= t("Summary")?></a></li>
+ <li class="ui-state-default ui-corner-top"><a href="#gExifDetail"><?= t("Detail")?></a></li>
+ </ul>
+ <div id="gExifSummary" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
+ <table>
+ <tbody>
+ <? for ($i = 0; $i < count($details["summary"]); $i++): ?>
+ <tr>
+ <td class="gEven">
+ <?= $details["summary"][$i]["caption"] ?>
+ </td>
+ <td class="gOdd">
+ <?= $details["summary"][$i]["value"] ?>
+ </td>
+ <? if (!empty($details["summary"][++$i])): ?>
+ <td class="gEven">
+ <?= $details["summary"][$i]["caption"] ?>
+ </td>
+ <td class="gOdd">
+ <?= $details["summary"][$i]["value"] ?>
+ </td>
+ <? else: ?>
+ <td class="gEven"></td><td class="gOdd"></td>
+ <? endif ?>
+ </td>
+ </tr>
+ <? endfor ?>
+ </tbody>
+ </table>
+ </div>
+ <div id="gExifDetail" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide">
+ <table>
+ <tbody>
+ <? for ($i = 0; $i < count($details["detail"]); $i++): ?>
+ <tr>
+ <td class="gEven">
+ <?= $details["detail"][$i]["caption"] ?>
+ </td>
+ <td class="gOdd">
+ <?= $details["detail"][$i]["value"] ?>
+ </td>
+ <? if (!empty($details["detail"][++$i])): ?>
+ <td class="gEven">
+ <?= $details["detail"][$i]["caption"] ?>
+ </td>
+ <td class="gOdd">
+ <?= $details["detail"][$i]["value"] ?>
+ </td>
+ <? else: ?>
+ <td class="gEven"></td><td class="gOdd"></td>
+ <? endif ?>
+ </td>
+ </tr>
+ <? endfor ?>
+ </tbody>
+ </table>
+ </div>
+</div> \ No newline at end of file
diff --git a/modules/exif/views/exif_sidebar.html.php b/modules/exif/views/exif_sidebar.html.php
new file mode 100644
index 00000000..21f5a79b
--- /dev/null
+++ b/modules/exif/views/exif_sidebar.html.php
@@ -0,0 +1,8 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<a href="<?= $url ?>" title="<?= t("Photo Details") ?>"
+ class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all">
+ <span class="ui-icon ui-icon-info"></span>
+ <?= t("View more information") ?>
+</a>
+
+ \ No newline at end of file