Added EXIF-style dialog boxes.
This commit is contained in:
parent
3df0138702
commit
fe79969937
89
modules/embedlinks/controllers/embedlinks.php
Normal file
89
modules/embedlinks/controllers/embedlinks.php
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
/**
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2009 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 EmbedLinks_Controller extends Controller {
|
||||
/**
|
||||
* Display the EXIF data for an item.
|
||||
*/
|
||||
public function showhtml($item_id) {
|
||||
$item = ORM::factory("item", $item_id);
|
||||
access::required("view", $item);
|
||||
|
||||
if ($item->is_album()) {
|
||||
$linkArray[0] = array("Text:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . "">Click Here</a>");
|
||||
$linkArray[1] = array("Thumbnail:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . ""><img src="" . $item->thumb_url(true) . ""></a>");
|
||||
$linkTitles[0] = array("Link To This Album:", 2);
|
||||
} else {
|
||||
$linkArray[0] = array("Text:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . "">Click Here</a>");
|
||||
$linkArray[1] = array("Thumbnail:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . ""><img src="" . $item->thumb_url(true) . ""></a>");
|
||||
$linkArray[2] = array("Resized:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . ""><img src="" . $item->resize_url(true) . ""></a>");
|
||||
$linkTitles[0] = array("Link To This Page:", 3);
|
||||
|
||||
$linkArray[3] = array("Text:", "<a href="" . $item->resize_url(true) . "">Click Here</a>");
|
||||
$linkArray[4] = array("Thumbnail:", "<a href="" . $item->resize_url(true) . ""><img src="" . $item->thumb_url(true) . ""></a>");
|
||||
$linkArray[5] = array("Image:", "<img src="" . $item->resize_url(true) . "">");
|
||||
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
||||
|
||||
if (access::can("view_full", $item)) {
|
||||
$linkArray[6] = array("Text:", "<a href="" . $item->file_url(true) . "">Click Here</a>");
|
||||
$linkArray[7] = array("Thumbnail:", "<a href="" . $item->file_url(true) . ""><img src="" . $item->thumb_url(true) . ""></a>");
|
||||
$linkArray[8] = array("Resized:", "<a href="" . $item->file_url(true) . ""><img src="" . $item->resize_url(true) . ""></a>");
|
||||
$linkTitles[2] = array("Link To The Fullsize Image:", 3);
|
||||
}
|
||||
}
|
||||
|
||||
$view = new View("embedlinks_htmldialog.html");
|
||||
$view->titles = $linkTitles;
|
||||
$view->details = $linkArray;
|
||||
print $view;
|
||||
}
|
||||
|
||||
public function showbbcode($item_id) {
|
||||
$item = ORM::factory("item", $item_id);
|
||||
access::required("view", $item);
|
||||
|
||||
if ($item->is_album()) {
|
||||
$linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]");
|
||||
$linkArray[1] = array("Thumbnail:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
||||
$linkTitles[0] = array("Link To This Album:", 2);
|
||||
} else {
|
||||
$linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]");
|
||||
$linkArray[1] = array("Thumbnail:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
||||
$linkArray[2] = array("Resized:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "][img]" . $item->resize_url(true) . "[/img][/url]");
|
||||
$linkTitles[0] = array("Link To This Page:", 3);
|
||||
|
||||
$linkArray[3] = array("Text:", "[url=" . $item->resize_url(true) . "]Click Here[/url]");
|
||||
$linkArray[4] = array("Thumbnail:", "[url=" . $item->resize_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
||||
$linkArray[5] = array("Image:", "[img]" . $item->resize_url(true) . "[/img]");
|
||||
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
||||
|
||||
if (access::can("view_full", $item)) {
|
||||
$linkArray[6] = array("Text:", "[url=" . $item->file_url(true) . "]Click Here[/url]");
|
||||
$linkArray[7] = array("Thumbnail:", "[url=" . $item->file_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
||||
$linkArray[8] = array("Resized:", "[url=" . $item->file_url(true) . "][img]" . $item->resize_url(true) . "[/img][/url]");
|
||||
$linkTitles[2] = array("Link To The Fullsize Image:", 3);
|
||||
}
|
||||
}
|
||||
|
||||
$view = new View("embedlinks_bbcodedialog.html");
|
||||
$view->titles = $linkTitles;
|
||||
$view->details = $linkArray;
|
||||
print $view;
|
||||
}
|
||||
}
|
24
modules/embedlinks/views/embedlinks_bbcodedialog.html.php
Normal file
24
modules/embedlinks/views/embedlinks_bbcodedialog.html.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<style>
|
||||
#gExifData {font-size: .85em;}
|
||||
.gOdd {background: #BDD2FF;}
|
||||
.gEven {background: #DFEFFC;}
|
||||
</style>
|
||||
<h1 style="display: none;"><?= t("BBCode") ?></h1>
|
||||
<div id="gExifData">
|
||||
<? $counter = 0; ?>
|
||||
<? for ($i = 0; $i < count($titles); $i++): ?>
|
||||
<table class="gMetadata" >
|
||||
<thead><tr><th cellspan="2"><?= t($titles[$i][0]) ?></th></thead>
|
||||
<tbody>
|
||||
<? for ($j = $counter; $j < $titles[$i][1]+$counter; $j++): ?>
|
||||
<tr>
|
||||
<td><?= t($details[$j][0]) ?></td>
|
||||
<td><input type="text" value="<?= $details[$j][1] ?>" readonly></td>
|
||||
</tr>
|
||||
<? endfor ?>
|
||||
<? $counter+= $titles[$i][1]; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<? endfor ?>
|
||||
</div>
|
24
modules/embedlinks/views/embedlinks_htmldialog.html.php
Normal file
24
modules/embedlinks/views/embedlinks_htmldialog.html.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<style>
|
||||
#gExifData {font-size: .85em;}
|
||||
.gOdd {background: #BDD2FF;}
|
||||
.gEven {background: #DFEFFC;}
|
||||
</style>
|
||||
<h1 style="display: none;"><?= t("HTML Code") ?></h1>
|
||||
<div id="gExifData">
|
||||
<? $counter = 0; ?>
|
||||
<? for ($i = 0; $i < count($titles); $i++): ?>
|
||||
<table class="gMetadata" >
|
||||
<thead><tr><th cellspan="2"><?= t($titles[$i][0]) ?></th></thead>
|
||||
<tbody>
|
||||
<? for ($j = $counter; $j < $titles[$i][1]+$counter; $j++): ?>
|
||||
<tr>
|
||||
<td><?= t($details[$j][0]) ?></td>
|
||||
<td><input type="text" value="<?= $details[$j][1] ?>" readonly></td>
|
||||
</tr>
|
||||
<? endfor ?>
|
||||
<? $counter+= $titles[$i][1]; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<? endfor ?>
|
||||
</div>
|
16
modules/embedlinks/views/embedlinks_sidebar.html.php
Normal file
16
modules/embedlinks/views/embedlinks_sidebar.html.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<? if (module::get_var("embedlinks", "HTMLCode")) { ?>
|
||||
<a href="<?= url::site("embedlinks/showhtml/{$item->id}") ?>" title="<?= t("HTML Links") ?>"
|
||||
class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all">
|
||||
<span class="ui-icon ui-icon-info"></span>
|
||||
<?= t("HTML Code") ?>
|
||||
</a><br />
|
||||
<? } ?>
|
||||
|
||||
<? if (module::get_var("embedlinks", "BBCode")) { ?>
|
||||
<a href="<?= url::site("embedlinks/showbbcode/{$item->id}") ?>" title="<?= t("BBCode Links") ?>"
|
||||
class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all">
|
||||
<span class="ui-icon ui-icon-info"></span>
|
||||
<?= t("BBCode") ?>
|
||||
</a>
|
||||
<? } ?>
|
Reference in New Issue
Block a user