Added a toolbar icon to a dialog window that contains all link code (HTML, BBCode, URLs).
This commit is contained in:
parent
bb92e9178d
commit
2ba8992e3d
|
@ -39,7 +39,8 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
$BBCodeButton = false;
|
$BBCodeButton = false;
|
||||||
$FullURLButton = false;
|
$FullURLButton = false;
|
||||||
$InPageLinks = false;
|
$InPageLinks = false;
|
||||||
|
$ToolbarLinks = false;
|
||||||
|
|
||||||
for ($i = 0; $i < count($linkOpts_array); $i++) {
|
for ($i = 0; $i < count($linkOpts_array); $i++) {
|
||||||
if ($linkOpts_array[$i] == "HTMLCode") {
|
if ($linkOpts_array[$i] == "HTMLCode") {
|
||||||
$HTMLButton = true;
|
$HTMLButton = true;
|
||||||
|
@ -55,15 +56,19 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
if ($displayType_array[$i] == "InPageLinks") {
|
if ($displayType_array[$i] == "InPageLinks") {
|
||||||
$InPageLinks = true;
|
$InPageLinks = true;
|
||||||
}
|
}
|
||||||
|
if ($displayType_array[$i] == "ToolbarLinks") {
|
||||||
|
$ToolbarLinks = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save Settings.
|
// Save Settings.
|
||||||
module::set_var("embedlinks", "HTMLCode", $HTMLButton);
|
module::set_var("embedlinks", "HTMLCode", $HTMLButton);
|
||||||
module::set_var("embedlinks", "BBCode", $BBCodeButton);
|
module::set_var("embedlinks", "BBCode", $BBCodeButton);
|
||||||
module::set_var("embedlinks", "FullURL", $FullURLButton);
|
module::set_var("embedlinks", "FullURL", $FullURLButton);
|
||||||
module::set_var("embedlinks", "InPageLinks", $InPageLinks);
|
module::set_var("embedlinks", "InPageLinks", $InPageLinks);
|
||||||
|
module::set_var("embedlinks", "ToolbarLinks", $ToolbarLinks);
|
||||||
message::success(t("Your Selection Has Been Saved."));
|
message::success(t("Your Selection Has Been Saved."));
|
||||||
|
|
||||||
// Load Admin page.
|
// Load Admin page.
|
||||||
$view = new Admin_View("admin.html");
|
$view = new Admin_View("admin.html");
|
||||||
$view->content = new View("admin_embedlinks.html");
|
$view->content = new View("admin_embedlinks.html");
|
||||||
|
@ -83,7 +88,11 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
|
|
||||||
// Make an array for the different methods of displaying the links.
|
// Make an array for the different methods of displaying the links.
|
||||||
$linkDisplays["InPageLinks"] = array(t("Show Links In The Actual Page"), module::get_var("embedlinks", "InPageLinks"));
|
$linkDisplays["InPageLinks"] = array(t("Show Links In The Actual Page"), module::get_var("embedlinks", "InPageLinks"));
|
||||||
|
|
||||||
|
// Make an array for the different methods of displaying the links.
|
||||||
|
$linkDisplays["InPageLinks"] = array(t("Show Links In The Actual Page"), module::get_var("embedlinks", "InPageLinks"));
|
||||||
|
$linkDisplays["ToolbarLinks"] = array(t("Display toolbar image for HTML/BBCode/URLs links"), module::get_var("embedlinks", "ToolbarLinks"));
|
||||||
|
|
||||||
// Setup a few checkboxes on the form.
|
// Setup a few checkboxes on the form.
|
||||||
$add_links = $form->group("EmbedLinks");
|
$add_links = $form->group("EmbedLinks");
|
||||||
$add_links->checklist("LinkCodeTypeOptions")
|
$add_links->checklist("LinkCodeTypeOptions")
|
||||||
|
@ -97,4 +106,4 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
// Return the newly generated form.
|
// Return the newly generated form.
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,15 @@
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class EmbedLinks_Controller extends Controller {
|
class EmbedLinks_Controller extends Controller {
|
||||||
/**
|
public function showlinks($item_id) {
|
||||||
* Display the EXIF data for an item.
|
// Generate the Dialog Box for all HTML/BBCode/URLs available for $item.
|
||||||
*/
|
$item = ORM::factory("item", $item_id);
|
||||||
|
access::required("view", $item);
|
||||||
|
$view = new View("embedlinks_alllinksdialog.html");
|
||||||
|
$view->item_id = $item_id;
|
||||||
|
print $view;
|
||||||
|
}
|
||||||
|
|
||||||
public function showhtml($item_id) {
|
public function showhtml($item_id) {
|
||||||
// Generate the Dialog Box for HTML links.
|
// Generate the Dialog Box for HTML links.
|
||||||
$item = ORM::factory("item", $item_id);
|
$item = ORM::factory("item", $item_id);
|
||||||
|
@ -31,14 +37,14 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[0] = array("Text:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . "">Click Here</a>");
|
$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[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);
|
$linkTitles[0] = array("Link To This Album:", 2);
|
||||||
|
|
||||||
// If the item is a movie, don't display resize links, do display an embed link.
|
// If the item is a movie, don't display resize links, do display an embed link.
|
||||||
} elseif ($item->is_movie()) {
|
} elseif ($item->is_movie()) {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("Text:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . "">Click Here</a>");
|
$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[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 Page:", 2);
|
$linkTitles[0] = array("Link To This Page:", 2);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -61,7 +67,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[4] = array("Thumbnail:", "<a href="" . $item->resize_url(true) . ""><img src="" . $item->thumb_url(true) . ""></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) . "">");
|
$linkArray[5] = array("Image:", "<img src="" . $item->resize_url(true) . "">");
|
||||||
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -71,7 +77,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new View("embedlinks_htmldialog.html");
|
$view = new View("embedlinks_htmldialog.html");
|
||||||
$view->titles = $linkTitles;
|
$view->titles = $linkTitles;
|
||||||
$view->details = $linkArray;
|
$view->details = $linkArray;
|
||||||
|
@ -80,22 +86,22 @@ class EmbedLinks_Controller extends Controller {
|
||||||
|
|
||||||
public function showbbcode($item_id) {
|
public function showbbcode($item_id) {
|
||||||
// Generate the Dialog Box for BBCode links.
|
// Generate the Dialog Box for BBCode links.
|
||||||
$item = ORM::factory("item", $item_id);
|
$item = ORM::factory("item", $item_id);
|
||||||
access::required("view", $item);
|
access::required("view", $item);
|
||||||
|
|
||||||
// If the current page is an album, only display two links.
|
// If the current page is an album, only display two links.
|
||||||
if ($item->is_album()) {
|
if ($item->is_album()) {
|
||||||
$linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]");
|
$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[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);
|
$linkTitles[0] = array("Link To This Album:", 2);
|
||||||
|
|
||||||
// If the item is a movie, don't display resize links.
|
// If the item is a movie, don't display resize links.
|
||||||
} elseif ($item->is_movie()) {
|
} elseif ($item->is_movie()) {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]");
|
$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[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 Page:", 2);
|
$linkTitles[0] = array("Link To This Page:", 2);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -103,7 +109,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[3] = array("Thumbnail:", "[url=" . $item->file_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
$linkArray[3] = array("Thumbnail:", "[url=" . $item->file_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
||||||
$linkTitles[1] = array("Link To The Video File:", 2);
|
$linkTitles[1] = array("Link To The Video File:", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or else assume the item is a photo.
|
// Or else assume the item is a photo.
|
||||||
} else {
|
} else {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
|
@ -117,7 +123,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[4] = array("Thumbnail:", "[url=" . $item->resize_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/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]");
|
$linkArray[5] = array("Image:", "[img]" . $item->resize_url(true) . "[/img]");
|
||||||
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -127,7 +133,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new View("embedlinks_bbcodedialog.html");
|
$view = new View("embedlinks_bbcodedialog.html");
|
||||||
$view->titles = $linkTitles;
|
$view->titles = $linkTitles;
|
||||||
$view->details = $linkArray;
|
$view->details = $linkArray;
|
||||||
|
@ -136,9 +142,9 @@ class EmbedLinks_Controller extends Controller {
|
||||||
|
|
||||||
public function showfullurl($item_id) {
|
public function showfullurl($item_id) {
|
||||||
// Generate the Dialog Box for the URLs to the items thumb, resize and fullsize image.
|
// Generate the Dialog Box for the URLs to the items thumb, resize and fullsize image.
|
||||||
$item = ORM::factory("item", $item_id);
|
$item = ORM::factory("item", $item_id);
|
||||||
access::required("view", $item);
|
access::required("view", $item);
|
||||||
|
|
||||||
// If the current page is an album, only display a URL and thumnail fields.
|
// If the current page is an album, only display a URL and thumnail fields.
|
||||||
if ($item->is_album()) {
|
if ($item->is_album()) {
|
||||||
$linkArray[0] = array("Album URL:", url::abs_site("{$item->type}s/{$item->id}"));
|
$linkArray[0] = array("Album URL:", url::abs_site("{$item->type}s/{$item->id}"));
|
||||||
|
@ -150,7 +156,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
||||||
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display its URL.
|
// version of the current image, then display its URL.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -159,14 +165,14 @@ class EmbedLinks_Controller extends Controller {
|
||||||
} else {
|
} else {
|
||||||
$linkTitles[0] = array("URLs:", 2);
|
$linkTitles[0] = array("URLs:", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or else assume the item is a photo.
|
// Or else assume the item is a photo.
|
||||||
} else {
|
} else {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
||||||
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
||||||
$linkArray[2] = array("Resized:", $item->resize_url(true));
|
$linkArray[2] = array("Resized:", $item->resize_url(true));
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display its URL.
|
// version of the current image, then display its URL.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -176,11 +182,10 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkTitles[0] = array("URLs:", 3);
|
$linkTitles[0] = array("URLs:", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new View("embedlinks_fullurldialog.html");
|
$view = new View("embedlinks_fullurldialog.html");
|
||||||
$view->titles = $linkTitles;
|
$view->titles = $linkTitles;
|
||||||
$view->details = $linkArray;
|
$view->details = $linkArray;
|
||||||
print $view;
|
print $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
3
3.0/modules/embedlinks/css/embedlinks_menu.css
Normal file
3
3.0/modules/embedlinks/css/embedlinks_menu.css
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#g-view-menu #g-embedlinks-link {
|
||||||
|
background-image: url('../images/ico-view-embedlinks.png');
|
||||||
|
}
|
|
@ -47,7 +47,7 @@ class embedlinks_block_Core {
|
||||||
$block->title = t("Links");
|
$block->title = t("Links");
|
||||||
$block->content = new View("embedlinks_album_block.html");
|
$block->content = new View("embedlinks_album_block.html");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $block;
|
return $block;
|
||||||
|
|
|
@ -25,4 +25,43 @@ class embedlinks_event_Core {
|
||||||
->label(t("EmbedLinks"))
|
->label(t("EmbedLinks"))
|
||||||
->url(url::site("admin/embedlinks")));
|
->url(url::site("admin/embedlinks")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function album_menu($menu, $theme) {
|
||||||
|
// Display embedlinks toolbar icon, if the corresponding setting is enabled.
|
||||||
|
if (module::get_var("embedlinks", "ToolbarLinks") == true) {
|
||||||
|
$menu
|
||||||
|
->append(Menu::factory("link")
|
||||||
|
->id("embedlinks")
|
||||||
|
->label(t("Link to this page"))
|
||||||
|
->url(url::site("embedlinks/showlinks/" . $theme->item()->id))
|
||||||
|
->css_class("g-dialog-link")
|
||||||
|
->css_id("g-embedlinks-link"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static function photo_menu($menu, $theme) {
|
||||||
|
// Display embedlinks toolbar icon, if the corresponding setting is enabled.
|
||||||
|
if (module::get_var("embedlinks", "ToolbarLinks") == true) {
|
||||||
|
$menu
|
||||||
|
->append(Menu::factory("link")
|
||||||
|
->id("embedlinks")
|
||||||
|
->label(t("Link to this page"))
|
||||||
|
->url(url::site("embedlinks/showlinks/" . $theme->item()->id))
|
||||||
|
->css_class("g-dialog-link")
|
||||||
|
->css_id("g-embedlinks-link"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static function movie_menu($menu, $theme) {
|
||||||
|
// Display embedlinks toolbar icon, if the corresponding setting is enabled.
|
||||||
|
if (module::get_var("embedlinks", "ToolbarLinks") == true) {
|
||||||
|
$menu
|
||||||
|
->append(Menu::factory("link")
|
||||||
|
->id("embedlinks")
|
||||||
|
->label(t("Link to this page"))
|
||||||
|
->url(url::site("embedlinks/showlinks/" . $theme->item()->id))
|
||||||
|
->css_class("g-dialog-link")
|
||||||
|
->css_id("g-embedlinks-link"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
42
3.0/modules/embedlinks/helpers/embedlinks_installer.php
Normal file
42
3.0/modules/embedlinks/helpers/embedlinks_installer.php
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
|
* Gallery - a web based photo album viewer and editor
|
||||||
|
* Copyright (C) 2000-2011 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_installer {
|
||||||
|
static function install() {
|
||||||
|
// Set some default values.
|
||||||
|
module::set_var("embedlinks", "HTMLCode", true);
|
||||||
|
module::set_var("embedlinks", "BBCode", true);
|
||||||
|
module::set_var("embedlinks", "FullURL", true);
|
||||||
|
module::set_var("embedlinks", "InPageLinks", false);
|
||||||
|
module::set_var("embedlinks", "ToolbarLinks", true);
|
||||||
|
|
||||||
|
// Set the module version number.
|
||||||
|
module::set_version("embedlinks", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function upgrade($version) {
|
||||||
|
if ($version == 1) {
|
||||||
|
// Set some default values.
|
||||||
|
module::set_var("embedlinks", "ToolbarLinks", true);
|
||||||
|
|
||||||
|
// Set the module version number.
|
||||||
|
module::set_version("embedlinks", 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,6 +18,11 @@
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class embedlinks_theme_Core {
|
class embedlinks_theme_Core {
|
||||||
|
static function head($theme) {
|
||||||
|
// Load css code for the toolbar icon.
|
||||||
|
return $theme->css("embedlinks_menu.css");
|
||||||
|
}
|
||||||
|
|
||||||
static function photo_bottom($theme) {
|
static function photo_bottom($theme) {
|
||||||
// If the current item is a photo and displaying "In Page" links
|
// If the current item is a photo and displaying "In Page" links
|
||||||
// is enabled, then insert HTML/BBCode links into the bottom
|
// is enabled, then insert HTML/BBCode links into the bottom
|
||||||
|
|
BIN
3.0/modules/embedlinks/images/ico-view-embedlinks.png
Normal file
BIN
3.0/modules/embedlinks/images/ico-view-embedlinks.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
|
@ -1,7 +1,7 @@
|
||||||
name = "EmbedLinks"
|
name = "EmbedLinks"
|
||||||
description = "Display BBCode and HTML code to embed links to albums/images into other web pages."
|
description = "Display BBCode and HTML code to embed links to albums/images into other web pages."
|
||||||
version = 1
|
version = 2
|
||||||
author_name = ""
|
author_name = "rWatcher"
|
||||||
author_url = ""
|
author_url = "http://codex.gallery2.org/User:RWatcher"
|
||||||
info_url = "http://codex.gallery2.org/Gallery3:Modules:embedlinks"
|
info_url = "http://codex.gallery2.org/Gallery3:Modules:embedlinks"
|
||||||
discuss_url = "http://gallery.menalto.com/forum_module_embedlinks"
|
discuss_url = "http://gallery.menalto.com/node/88322"
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$( "#tabs" ).tabs();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<h1 style="display: none;"><?= t("Link to this page") ?></h1>
|
||||||
|
<div id="tabs" style="height: 300px">
|
||||||
|
<ul>
|
||||||
|
<li><a class="g-menu-link" href="<?= url::site("embedlinks/showhtml/{$item_id}") ?>" title="<?= t("HTML Links") ?>"><?= t("HTML Links") ?></a></li>
|
||||||
|
<li><a class="g-menu-link" href="<?= url::site("embedlinks/showbbcode/{$item_id}") ?>" title="<?= t("BBCode Links") ?>"><?= t("BBCode Links") ?></a></li>
|
||||||
|
<li><a class="g-menu-link" href="<?= url::site("embedlinks/showfullurl/{$item_id}") ?>" title="<?= t("URLs") ?>"><?= t("URLs") ?></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
|
@ -198,4 +198,4 @@ input[type="text"] {
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
<span class="ui-icon ui-icon-info"></span>
|
<span class="ui-icon ui-icon-info"></span>
|
||||||
<?= t("Show URLs") ?>
|
<?= t("Show URLs") ?>
|
||||||
</a>
|
</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
|
@ -39,7 +39,8 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
$BBCodeButton = false;
|
$BBCodeButton = false;
|
||||||
$FullURLButton = false;
|
$FullURLButton = false;
|
||||||
$InPageLinks = false;
|
$InPageLinks = false;
|
||||||
|
$ToolbarLinks = false;
|
||||||
|
|
||||||
for ($i = 0; $i < count($linkOpts_array); $i++) {
|
for ($i = 0; $i < count($linkOpts_array); $i++) {
|
||||||
if ($linkOpts_array[$i] == "HTMLCode") {
|
if ($linkOpts_array[$i] == "HTMLCode") {
|
||||||
$HTMLButton = true;
|
$HTMLButton = true;
|
||||||
|
@ -55,15 +56,19 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
if ($displayType_array[$i] == "InPageLinks") {
|
if ($displayType_array[$i] == "InPageLinks") {
|
||||||
$InPageLinks = true;
|
$InPageLinks = true;
|
||||||
}
|
}
|
||||||
|
if ($displayType_array[$i] == "ToolbarLinks") {
|
||||||
|
$ToolbarLinks = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save Settings.
|
// Save Settings.
|
||||||
module::set_var("embedlinks", "HTMLCode", $HTMLButton);
|
module::set_var("embedlinks", "HTMLCode", $HTMLButton);
|
||||||
module::set_var("embedlinks", "BBCode", $BBCodeButton);
|
module::set_var("embedlinks", "BBCode", $BBCodeButton);
|
||||||
module::set_var("embedlinks", "FullURL", $FullURLButton);
|
module::set_var("embedlinks", "FullURL", $FullURLButton);
|
||||||
module::set_var("embedlinks", "InPageLinks", $InPageLinks);
|
module::set_var("embedlinks", "InPageLinks", $InPageLinks);
|
||||||
|
module::set_var("embedlinks", "ToolbarLinks", $ToolbarLinks);
|
||||||
message::success(t("Your Selection Has Been Saved."));
|
message::success(t("Your Selection Has Been Saved."));
|
||||||
|
|
||||||
// Load Admin page.
|
// Load Admin page.
|
||||||
$view = new Admin_View("admin.html");
|
$view = new Admin_View("admin.html");
|
||||||
$view->content = new View("admin_embedlinks.html");
|
$view->content = new View("admin_embedlinks.html");
|
||||||
|
@ -83,7 +88,11 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
|
|
||||||
// Make an array for the different methods of displaying the links.
|
// Make an array for the different methods of displaying the links.
|
||||||
$linkDisplays["InPageLinks"] = array(t("Show Links In The Actual Page"), module::get_var("embedlinks", "InPageLinks"));
|
$linkDisplays["InPageLinks"] = array(t("Show Links In The Actual Page"), module::get_var("embedlinks", "InPageLinks"));
|
||||||
|
|
||||||
|
// Make an array for the different methods of displaying the links.
|
||||||
|
$linkDisplays["InPageLinks"] = array(t("Show Links In The Actual Page"), module::get_var("embedlinks", "InPageLinks"));
|
||||||
|
$linkDisplays["ToolbarLinks"] = array(t("Display toolbar image for HTML/BBCode/URLs links"), module::get_var("embedlinks", "ToolbarLinks"));
|
||||||
|
|
||||||
// Setup a few checkboxes on the form.
|
// Setup a few checkboxes on the form.
|
||||||
$add_links = $form->group("EmbedLinks");
|
$add_links = $form->group("EmbedLinks");
|
||||||
$add_links->checklist("LinkCodeTypeOptions")
|
$add_links->checklist("LinkCodeTypeOptions")
|
||||||
|
@ -97,4 +106,4 @@ class Admin_EmbedLinks_Controller extends Admin_Controller {
|
||||||
// Return the newly generated form.
|
// Return the newly generated form.
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,15 @@
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class EmbedLinks_Controller extends Controller {
|
class EmbedLinks_Controller extends Controller {
|
||||||
/**
|
public function showlinks($item_id) {
|
||||||
* Display the EXIF data for an item.
|
// Generate the Dialog Box for all HTML/BBCode/URLs available for $item.
|
||||||
*/
|
$item = ORM::factory("item", $item_id);
|
||||||
|
access::required("view", $item);
|
||||||
|
$view = new View("embedlinks_alllinksdialog.html");
|
||||||
|
$view->item_id = $item_id;
|
||||||
|
print $view;
|
||||||
|
}
|
||||||
|
|
||||||
public function showhtml($item_id) {
|
public function showhtml($item_id) {
|
||||||
// Generate the Dialog Box for HTML links.
|
// Generate the Dialog Box for HTML links.
|
||||||
$item = ORM::factory("item", $item_id);
|
$item = ORM::factory("item", $item_id);
|
||||||
|
@ -31,14 +37,14 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[0] = array("Text:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . "">Click Here</a>");
|
$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[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);
|
$linkTitles[0] = array("Link To This Album:", 2);
|
||||||
|
|
||||||
// If the item is a movie, don't display resize links, do display an embed link.
|
// If the item is a movie, don't display resize links, do display an embed link.
|
||||||
} elseif ($item->is_movie()) {
|
} elseif ($item->is_movie()) {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("Text:", "<a href="" . url::abs_site("{$item->type}s/{$item->id}") . "">Click Here</a>");
|
$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[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 Page:", 2);
|
$linkTitles[0] = array("Link To This Page:", 2);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -61,7 +67,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[4] = array("Thumbnail:", "<a href="" . $item->resize_url(true) . ""><img src="" . $item->thumb_url(true) . ""></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) . "">");
|
$linkArray[5] = array("Image:", "<img src="" . $item->resize_url(true) . "">");
|
||||||
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -71,7 +77,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new View("embedlinks_htmldialog.html");
|
$view = new View("embedlinks_htmldialog.html");
|
||||||
$view->titles = $linkTitles;
|
$view->titles = $linkTitles;
|
||||||
$view->details = $linkArray;
|
$view->details = $linkArray;
|
||||||
|
@ -80,22 +86,22 @@ class EmbedLinks_Controller extends Controller {
|
||||||
|
|
||||||
public function showbbcode($item_id) {
|
public function showbbcode($item_id) {
|
||||||
// Generate the Dialog Box for BBCode links.
|
// Generate the Dialog Box for BBCode links.
|
||||||
$item = ORM::factory("item", $item_id);
|
$item = ORM::factory("item", $item_id);
|
||||||
access::required("view", $item);
|
access::required("view", $item);
|
||||||
|
|
||||||
// If the current page is an album, only display two links.
|
// If the current page is an album, only display two links.
|
||||||
if ($item->is_album()) {
|
if ($item->is_album()) {
|
||||||
$linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]");
|
$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[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);
|
$linkTitles[0] = array("Link To This Album:", 2);
|
||||||
|
|
||||||
// If the item is a movie, don't display resize links.
|
// If the item is a movie, don't display resize links.
|
||||||
} elseif ($item->is_movie()) {
|
} elseif ($item->is_movie()) {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]");
|
$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[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 Page:", 2);
|
$linkTitles[0] = array("Link To This Page:", 2);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -103,7 +109,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[3] = array("Thumbnail:", "[url=" . $item->file_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
$linkArray[3] = array("Thumbnail:", "[url=" . $item->file_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]");
|
||||||
$linkTitles[1] = array("Link To The Video File:", 2);
|
$linkTitles[1] = array("Link To The Video File:", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or else assume the item is a photo.
|
// Or else assume the item is a photo.
|
||||||
} else {
|
} else {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
|
@ -117,7 +123,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkArray[4] = array("Thumbnail:", "[url=" . $item->resize_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/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]");
|
$linkArray[5] = array("Image:", "[img]" . $item->resize_url(true) . "[/img]");
|
||||||
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
$linkTitles[1] = array("Link To The Resized Image:", 3);
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display links to it.
|
// version of the current image, then display links to it.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -127,7 +133,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
$linkTitles[2] = array("Link To The Full Size Image:", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new View("embedlinks_bbcodedialog.html");
|
$view = new View("embedlinks_bbcodedialog.html");
|
||||||
$view->titles = $linkTitles;
|
$view->titles = $linkTitles;
|
||||||
$view->details = $linkArray;
|
$view->details = $linkArray;
|
||||||
|
@ -136,9 +142,9 @@ class EmbedLinks_Controller extends Controller {
|
||||||
|
|
||||||
public function showfullurl($item_id) {
|
public function showfullurl($item_id) {
|
||||||
// Generate the Dialog Box for the URLs to the items thumb, resize and fullsize image.
|
// Generate the Dialog Box for the URLs to the items thumb, resize and fullsize image.
|
||||||
$item = ORM::factory("item", $item_id);
|
$item = ORM::factory("item", $item_id);
|
||||||
access::required("view", $item);
|
access::required("view", $item);
|
||||||
|
|
||||||
// If the current page is an album, only display a URL and thumnail fields.
|
// If the current page is an album, only display a URL and thumnail fields.
|
||||||
if ($item->is_album()) {
|
if ($item->is_album()) {
|
||||||
$linkArray[0] = array("Album URL:", url::abs_site("{$item->type}s/{$item->id}"));
|
$linkArray[0] = array("Album URL:", url::abs_site("{$item->type}s/{$item->id}"));
|
||||||
|
@ -150,7 +156,7 @@ class EmbedLinks_Controller extends Controller {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
||||||
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display its URL.
|
// version of the current image, then display its URL.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -159,14 +165,14 @@ class EmbedLinks_Controller extends Controller {
|
||||||
} else {
|
} else {
|
||||||
$linkTitles[0] = array("URLs:", 2);
|
$linkTitles[0] = array("URLs:", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or else assume the item is a photo.
|
// Or else assume the item is a photo.
|
||||||
} else {
|
} else {
|
||||||
// Link to the current page.
|
// Link to the current page.
|
||||||
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
$linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}"));
|
||||||
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
$linkArray[1] = array("Thumbnail:", $item->thumb_url(true));
|
||||||
$linkArray[2] = array("Resized:", $item->resize_url(true));
|
$linkArray[2] = array("Resized:", $item->resize_url(true));
|
||||||
|
|
||||||
// If the visitor has suficient privlidges to see the fullsized
|
// If the visitor has suficient privlidges to see the fullsized
|
||||||
// version of the current image, then display its URL.
|
// version of the current image, then display its URL.
|
||||||
if (access::can("view_full", $item)) {
|
if (access::can("view_full", $item)) {
|
||||||
|
@ -176,11 +182,10 @@ class EmbedLinks_Controller extends Controller {
|
||||||
$linkTitles[0] = array("URLs:", 3);
|
$linkTitles[0] = array("URLs:", 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$view = new View("embedlinks_fullurldialog.html");
|
$view = new View("embedlinks_fullurldialog.html");
|
||||||
$view->titles = $linkTitles;
|
$view->titles = $linkTitles;
|
||||||
$view->details = $linkArray;
|
$view->details = $linkArray;
|
||||||
print $view;
|
print $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
3
3.1/modules/embedlinks/css/embedlinks_menu.css
Normal file
3
3.1/modules/embedlinks/css/embedlinks_menu.css
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#g-view-menu #g-embedlinks-link {
|
||||||
|
background-image: url('../images/ico-view-embedlinks.png');
|
||||||
|
}
|
|
@ -47,7 +47,7 @@ class embedlinks_block_Core {
|
||||||
$block->title = t("Links");
|
$block->title = t("Links");
|
||||||
$block->content = new View("embedlinks_album_block.html");
|
$block->content = new View("embedlinks_album_block.html");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $block;
|
return $block;
|
||||||
|
|
|
@ -25,4 +25,43 @@ class embedlinks_event_Core {
|
||||||
->label(t("EmbedLinks"))
|
->label(t("EmbedLinks"))
|
||||||
->url(url::site("admin/embedlinks")));
|
->url(url::site("admin/embedlinks")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function album_menu($menu, $theme) {
|
||||||
|
// Display embedlinks toolbar icon, if the corresponding setting is enabled.
|
||||||
|
if (module::get_var("embedlinks", "ToolbarLinks") == true) {
|
||||||
|
$menu
|
||||||
|
->append(Menu::factory("link")
|
||||||
|
->id("embedlinks")
|
||||||
|
->label(t("Link to this page"))
|
||||||
|
->url(url::site("embedlinks/showlinks/" . $theme->item()->id))
|
||||||
|
->css_class("g-dialog-link")
|
||||||
|
->css_id("g-embedlinks-link"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static function photo_menu($menu, $theme) {
|
||||||
|
// Display embedlinks toolbar icon, if the corresponding setting is enabled.
|
||||||
|
if (module::get_var("embedlinks", "ToolbarLinks") == true) {
|
||||||
|
$menu
|
||||||
|
->append(Menu::factory("link")
|
||||||
|
->id("embedlinks")
|
||||||
|
->label(t("Link to this page"))
|
||||||
|
->url(url::site("embedlinks/showlinks/" . $theme->item()->id))
|
||||||
|
->css_class("g-dialog-link")
|
||||||
|
->css_id("g-embedlinks-link"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static function movie_menu($menu, $theme) {
|
||||||
|
// Display embedlinks toolbar icon, if the corresponding setting is enabled.
|
||||||
|
if (module::get_var("embedlinks", "ToolbarLinks") == true) {
|
||||||
|
$menu
|
||||||
|
->append(Menu::factory("link")
|
||||||
|
->id("embedlinks")
|
||||||
|
->label(t("Link to this page"))
|
||||||
|
->url(url::site("embedlinks/showlinks/" . $theme->item()->id))
|
||||||
|
->css_class("g-dialog-link")
|
||||||
|
->css_id("g-embedlinks-link"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
42
3.1/modules/embedlinks/helpers/embedlinks_installer.php
Normal file
42
3.1/modules/embedlinks/helpers/embedlinks_installer.php
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
|
* Gallery - a web based photo album viewer and editor
|
||||||
|
* Copyright (C) 2000-2011 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_installer {
|
||||||
|
static function install() {
|
||||||
|
// Set some default values.
|
||||||
|
module::set_var("embedlinks", "HTMLCode", true);
|
||||||
|
module::set_var("embedlinks", "BBCode", true);
|
||||||
|
module::set_var("embedlinks", "FullURL", true);
|
||||||
|
module::set_var("embedlinks", "InPageLinks", false);
|
||||||
|
module::set_var("embedlinks", "ToolbarLinks", true);
|
||||||
|
|
||||||
|
// Set the module version number.
|
||||||
|
module::set_version("embedlinks", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function upgrade($version) {
|
||||||
|
if ($version == 1) {
|
||||||
|
// Set some default values.
|
||||||
|
module::set_var("embedlinks", "ToolbarLinks", true);
|
||||||
|
|
||||||
|
// Set the module version number.
|
||||||
|
module::set_version("embedlinks", 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,6 +18,11 @@
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class embedlinks_theme_Core {
|
class embedlinks_theme_Core {
|
||||||
|
static function head($theme) {
|
||||||
|
// Load css code for the toolbar icon.
|
||||||
|
return $theme->css("embedlinks_menu.css");
|
||||||
|
}
|
||||||
|
|
||||||
static function photo_bottom($theme) {
|
static function photo_bottom($theme) {
|
||||||
// If the current item is a photo and displaying "In Page" links
|
// If the current item is a photo and displaying "In Page" links
|
||||||
// is enabled, then insert HTML/BBCode links into the bottom
|
// is enabled, then insert HTML/BBCode links into the bottom
|
||||||
|
|
BIN
3.1/modules/embedlinks/images/ico-view-embedlinks.png
Normal file
BIN
3.1/modules/embedlinks/images/ico-view-embedlinks.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
|
@ -1,7 +1,7 @@
|
||||||
name = "EmbedLinks"
|
name = "EmbedLinks"
|
||||||
description = "Display BBCode and HTML code to embed links to albums/images into other web pages."
|
description = "Display BBCode and HTML code to embed links to albums/images into other web pages."
|
||||||
version = 1
|
version = 2
|
||||||
author_name = ""
|
author_name = "rWatcher"
|
||||||
author_url = ""
|
author_url = "http://codex.gallery2.org/User:RWatcher"
|
||||||
info_url = "http://codex.gallery2.org/Gallery3:Modules:embedlinks"
|
info_url = "http://codex.gallery2.org/Gallery3:Modules:embedlinks"
|
||||||
discuss_url = "http://gallery.menalto.com/forum_module_embedlinks"
|
discuss_url = "http://gallery.menalto.com/node/88322"
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$( "#tabs" ).tabs();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<h1 style="display: none;"><?= t("Link to this page") ?></h1>
|
||||||
|
<div id="tabs" style="height: 300px">
|
||||||
|
<ul>
|
||||||
|
<li><a class="g-menu-link" href="<?= url::site("embedlinks/showhtml/{$item_id}") ?>" title="<?= t("HTML Links") ?>"><?= t("HTML Links") ?></a></li>
|
||||||
|
<li><a class="g-menu-link" href="<?= url::site("embedlinks/showbbcode/{$item_id}") ?>" title="<?= t("BBCode Links") ?>"><?= t("BBCode Links") ?></a></li>
|
||||||
|
<li><a class="g-menu-link" href="<?= url::site("embedlinks/showfullurl/{$item_id}") ?>" title="<?= t("URLs") ?>"><?= t("URLs") ?></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
|
@ -198,4 +198,4 @@ input[type="text"] {
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
<span class="ui-icon ui-icon-info"></span>
|
<span class="ui-icon ui-icon-info"></span>
|
||||||
<?= t("Show URLs") ?>
|
<?= t("Show URLs") ?>
|
||||||
</a>
|
</a>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
Reference in New Issue
Block a user