1
0

DownloadFullsize Updates.

This commit is contained in:
rWatcher 2009-09-16 19:08:16 -04:00
parent 86d70770f1
commit 5582b41829
13 changed files with 93 additions and 11 deletions

View File

@ -1,6 +0,0 @@
Copy "ico-view-downloadfullsize.png" into your "themes/CURRENTTHEME/images" folder.
Edit the file "themes/CURRENTTHEME/css/screen.css" to include the following lines:
#gViewMenu #gDownloadFullsizeLink {
background-image: url('../images/ico-view-downloadfullsize.png');
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -35,6 +35,7 @@ class Admin_DownloadFullsize_Controller extends Admin_Controller {
$dlLinks_array = Input::instance()->post("DownloadLinkOptions");
$tButton = false;
$fButton = false;
$download_original_button = false;
for ($i = 0; $i < count($dlLinks_array); $i++) {
if ($dlLinks_array[$i] == "tButton") {
$tButton = true;
@ -44,6 +45,16 @@ class Admin_DownloadFullsize_Controller extends Admin_Controller {
}
}
if (module::is_active("keeporiginal")) {
$keeporiginal_array = Input::instance()->post("DownloadOriginalOptions");
for ($i = 0; $i < count($keeporiginal_array); $i++) {
if ($keeporiginal_array[$i] == "DownloadOriginalImage") {
$download_original_button = true;
}
}
module::set_var("downloadfullsize", "DownloadOriginalImage", $download_original_button);
}
// Save Settings.
module::set_var("downloadfullsize", "tButton", $tButton);
module::set_var("downloadfullsize", "fButton", $fButton);
@ -63,16 +74,24 @@ class Admin_DownloadFullsize_Controller extends Admin_Controller {
array("id" => "gDownloadFullsizeAdminForm"));
// Make an array for the different types of download links.
$linkOptions["fButton"] = array("Show Floppy Disk Link", module::get_var("downloadfullsize", "fButton"));
$linkOptions["tButton"] = array("Show Text Download Text Link", module::get_var("downloadfullsize", "tButton"));
$linkOptions["fButton"] = array(t("Show Floppy Disk Link"), module::get_var("downloadfullsize", "fButton"));
$linkOptions["tButton"] = array(t("Show Text Download Text Link"), module::get_var("downloadfullsize", "tButton"));
// Setup a few checkboxes on the form.
$add_links = $form->group("DownloadLinks");
$add_links->checklist("DownloadLinkOptions")
->options($linkOptions);
if (module::is_active("keeporiginal")) {
$KeepOriginalOptions["DownloadOriginalImage"] = array(t("Allow visitors to download the original image when available?"), module::get_var("downloadfullsize", "DownloadOriginalImage"));
$keeporiginal_group = $form->group("KeepOriginalPrefs")
->label(t("KeepOriginal Preferences"));
$keeporiginal_group->checklist("DownloadOriginalOptions")
->options($KeepOriginalOptions);
}
// Add a save button to the form.
$add_links->submit("SaveLinks")->value(t("Save"));
$form->submit("SaveLinks")->value(t("Save"));
// Return the newly generated form.
return $form;

View File

@ -22,6 +22,16 @@ class downloadfullsize_Controller extends Controller {
public function send($id) {
$item = ORM::factory("item", $id);
access::required("view_full", $item);
download::force($item->file_path());
if (module::is_active("keeporiginal") && $item->is_photo() && module::get_var("downloadfullsize", "DownloadOriginalImage")) {
$original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path());
if (file_exists($original_image)) {
download::force($original_image);
} else {
download::force($item->file_path());
}
} else {
download::force($item->file_path());
}
}
}

View File

@ -32,6 +32,20 @@ class downloadfullsize_event_Core {
}
}
static function movie_menu($menu, $theme) {
if (access::can("view_full", $theme->item)) {
if (module::get_var("downloadfullsize", "fButton")) {
$downloadLink = url::site("downloadfullsize/send/$theme->item");
$menu
->append(Menu::factory("link")
->id("downloadfullsize")
->label(t("Download Video"))
->url($downloadLink)
->css_id("gDownloadFullsizeLink"));
}
}
}
static function admin_menu($menu, $theme) {
$menu->get("settings_menu")
->append(Menu::factory("link")

View File

@ -18,8 +18,29 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class downloadfullsize_theme {
static function head($theme) {
if (!$theme->item()) {
return;
}
return new View("downloadfullsize_header_block.html");
}
static function sidebar_blocks($theme) {
$item = $theme->item();
if ($item && $item->is_movie() && access::can("view_full", $item)) {
if (module::get_var("downloadfullsize", "tButton")) {
$block = new Block();
$block->css_id = "gDownloadFullsize";
$block->title = t("Download");
$block->content = new View("downloadfullsize_block.html");
$block->content->item = ORM::factory("item", 1);
return $block;
}
}
if ($item && $item->is_photo() && access::can("view_full", $item)) {
if (module::get_var("downloadfullsize", "tButton")) {
$block = new Block();

View File

@ -1,7 +1,18 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? if ($theme->item->is_photo()) { ?>
<div class="gDownloadFullsizeBlock">
<a href="<?= url::site("downloadfullsize/send/$theme->item") ?>"
title="<?= t("Download Photo") ?>"
class="gButtonLink ui-icon-left ui-state-default ui-corner-all"><?= t("Download Fullsize Image") ?></a>
</div>
<? } ?>
<? if ($theme->item->is_movie()) { ?>
<div class="gDownloadFullsizeBlock">
<a href="<?= url::site("downloadfullsize/send/$theme->item") ?>"
title="<?= t("Download Video") ?>"
class="gButtonLink ui-icon-left ui-state-default ui-corner-all"><?= t("Download Video") ?></a>
</div>
<? } ?>

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class MiniSlideShow_Controller extends Controller {
public function showslideshow($item_id) {
// Generate the Dialog Box to display the slideshow in.

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class minislideshow_event_Core {
static function admin_menu($menu, $theme) {
// Add a menu option to the admin screen for configuring the slideshow.

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class minislideshow_installer {
static function deactivate() {
site_status::clear("minislideshow_needs_rss");

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class minislideshow_theme_Core {
static function head($theme) {
if (!$theme->item()) {

View File

@ -26,7 +26,15 @@ class rwinfo_theme_Core {
$block = new Block();
$block->css_id = "gMetadata";
$block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info");
$block_title = "";
if ($theme->item->is_album()) {
$block_title = t("Album Info");
} else if ($theme->item->is_movie()) {
$block_title = t("Movie Info");
} else {
$block_title = t("Photo Info");
}
$block->title = $block_title;
$block->content = new View("rwinfo_block.html");
return $block;
}

View File

@ -3,3 +3,4 @@ Hide the info sidebar for the root album (without title and description there re
Display date created for albums only (and continue to display the capture date for everything else)
Display tags in the info sidebar (if the tags module is active).
Display tags when mousing over the thumbnails (if tags module is active).
Display "Movie Info" on movies instead of "Photo Info" like the Gallery Info module does.