function display_map(&$cparams, $galleriaozio) { $this->Params = $cparams; $document = JFactory::getDocument(); JHtml::_('bootstrap.framework'); if ($cparams->get("load_css_bootstrap", 0) == 1) { JHtmlBootstrap::loadCSS(); } $prefix = JUri::base(true) . "/index.php?option=com_oziogallery3&view=loader"; $menu = JFactory::getApplication()->getMenu(); $itemid = $menu->getActive() or $itemid = $menu->getDefault(); $document->addScript($prefix . "&filename=map&type=js" . "&Itemid=" . $itemid->id . "&id=" . $galleriaozio); // per la compatibilità con Internet Explorer $document->addScript(JUri::root(true) . "/media/com_oziogallery3/js/jQuery.XDomainRequest.js"); $document->addStyleSheet(JUri::base(true) . "/media/com_oziogallery3/views/map/css/map.css"); // Api key parameter for Google map $api_key = $this->Params->get('api_key', NULL); $api_key = $api_key ? "&key=" . $api_key : ""; // Language parameter for Google map // See Google maps Language coverage at https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1 // Use JFactory::getLanguage(), because we can't rely on $lang variable $language = JFactory::getLanguage()->get("tag", NULL); $language = $language ? "&language=" . $language : ""; $current_uri = JFactory::getURI(); if (empty($GLOBALS["contentmap"]["gapi"])) { $GLOBALS["contentmap"]["gapi"] = true; $document->addScript(($current_uri->isSSL() ? 'https' : 'http') . "://maps.google.com/maps/api/js?sensor=false" . $language . $api_key); } if ($this->Params->get("cluster", "1")) { $document->addScript(JUri::root(true) . "/media/com_oziogallery3/js/markerclusterer_compiled.js"); } $document->addScript(JUri::root(true) . "/media/com_oziogallery3/js/oms.min.js"); ob_start(); require JPATH_SITE . "/components/com_oziogallery3/views/map/tmpl/default.php"; $result = JPATH_COMPONENT("com_oziogallery3/views/map/tmpl/default.php") . ob_get_contents(); ob_end_clean(); return $result; }
<?php /** * This file is part of Ozio Gallery 3. * * Ozio Gallery 3 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. * * Foobar 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 Foobar. If not, see <http://www.gnu.org/licenses/>. * * @copyright Copyright (C) 2010 Open Source Solutions S.L.U. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see RT-LICENSE.php */ defined('_JEXEC') or die; require_once JPATH_COMPONENT . "/oziogallery.inc"; jimport('joomla.application.component.controller'); $controller = JController::getInstance('OzioGallery'); $controller->execute(JRequest::getCmd('task')); $controller->redirect(JPATH_COMPONENT());
function display_list(&$cparams, $galleriaozio) { $this->Params = $cparams; $document = JFactory::getDocument(); if ($cparams->get("jquery", 1)) { $document->addScript("https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"); } // the ordering of MooTools and jQuery does not matter if you make sure jQuery.noConflict() is called immediately after jQuery is loaded (http://www.designvsdevelop.com/jquery-in-joomla-i-was-wrong/) $document->addScript(JURI::base(true) . "/components/com_oziogallery3/js/jquery-noconflict.js"); $document->addScript(JURI::root(true) . "/components/com_oziogallery3/js/jquery-pwi.js"); $prefix = JURI::base(true) . "/index.php?option=com_oziogallery3&view=loader"; $menu = JFactory::getApplication()->getMenu(); $itemid = $menu->getActive() or $itemid = $menu->getDefault(); $document->addScript($prefix . "&filename=pwi&type=js" . "&Itemid=" . $itemid->id . "&id=" . $galleriaozio); $document->addScript($prefix . "&filename=dateformat&type=js" . "&Itemid=" . $itemid->id . "&id=" . $galleriaozio); // per la compatibilità con Internet Explorer $document->addScript(JURI::base(true) . "/components/com_oziogallery3/js/jQuery.XDomainRequest.js"); $document->addStyleSheet(JURI::base(true) . "/components/com_oziogallery3/views/list/css/list.css"); ob_start(); require JPATH_SITE . "/components/com_oziogallery3/views/list/tmpl/default.php"; $result = JPATH_COMPONENT("com_oziogallery3/views/list/tmpl/default.php") . ob_get_contents(); ob_end_clean(); return $result; }
function display(&$cparams) { $user = $cparams->get("userid"); $images = array(); $albumid = $cparams->get("gallery_id"); $authcode = ""; if ($cparams->get("albumvisibility") == "limited") { $albumid = $cparams->get("limitedalbum"); $authcode = "&authkey=Gv1sRg" . $cparams->get("limitedpassword"); } // Old identifier: the album number $feed = "http://picasaweb.google.com/data/feed/api/user/" . $user . "/albumid/" . $albumid . "?v=2" . $authcode; // New identifier: the album unique name //$feed = "http://picasaweb.google.com/data/feed/api/user/" . $user . "/album/" . $albumid . "?v=2" . $authcode; $photos = simplexml_load_file($feed) or $photos = new SimpleXMLElement(file_get_contents(JPATH_COMPONENT . "/views/00fuerte/empty.xml")); foreach ($photos->entry as $photo) { $image = array(); $url = parse_url((string) $photo->content->attributes()->{"src"}); $relative_path = substr($url["path"], 1); $pieces = explode("/", $relative_path); $last = count($pieces) - 1; unset($pieces[$last]); $image["seed"] = $url["scheme"] ? $url["scheme"] . "://" . $url["host"] . "/" . implode("/", $pieces) . "/" : JURI::root() . implode("/", $pieces) . "/empty.png"; $image["album"] = str_replace("'", "\\'", (string) $photos->title); $image["summary"] = str_replace("'", "\\'", (string) $photo->summary); $gphoto = $photo->children('gphoto', true); $image["width"] = (string) $gphoto->width; $image["height"] = (string) $gphoto->height; // Avoids divisions by 0 if ($image["width"]) { $image["ratio"] = $image["height"] / $image["width"]; } else { $image["ratio"] = 1; } $images[] = $image; } $slides = "slides : ["; $separator = ""; foreach ($images as $image) { $slides .= $separator . "{ " . "seed : '" . $image["seed"] . "', " . "width : '" . $image["width"] . "', " . "height : '" . $image["height"] . "', " . "ratio : '" . $image["ratio"] . "', " . "album : '" . JText::_($image["album"]) . "', " . "summary : '" . JText::_($image['summary']) . "'" . " }"; $separator = ","; } $slides .= "],"; $slides = str_replace(array("\r\n", "\r", "\n"), " ", $slides); $autoplay = $cparams->get("autoplay", 0); $stop_loop = $cparams->get("stop_loop", 0); $slide_interval = $cparams->get("slide_interval", 3000); $transition = $cparams->get("transition", "slideRight"); $transition_speed = $cparams->get("transition_speed", "1000"); $pause_hover = $cparams->get("pause_hover", 0); $progress_bar = $cparams->get("progress_bar", 1); $image_protect = $cparams->get("image_protect", 1); $js = <<<EOT \t\t\tjQuery(function(\$){ \t\t\t\t\$.supersized({ \t\t\t\t\t// Functionality \t\t\t\t\tslideshow : 1, // Slideshow on/off \t\t\t\t\tautoplay : {$autoplay}, // Slideshow starts playing automatically \t\t\t\t\tstart_slide : 1,\t\t\t// Start slide (0 is random) \t\t\t\t\tstop_loop : {$stop_loop}, // Pauses slideshow on last slide \t\t\t\t\trandom\t\t\t\t\t: \t0,\t\t\t// Randomize slide order (Ignores start slide) \t\t\t\t\tslide_interval : {$slide_interval}, // Length between transitions \t\t\t\t\ttransition : '{$transition}', // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left \t\t\t\t\ttransition_speed : {$transition_speed}, // Speed of transition \t\t\t\t\tnew_window\t\t\t\t:\t1,\t\t\t// Image links open in new window/tab \t\t\t\t\tpause_hover : {$pause_hover}, // Pause slideshow on hover \t\t\t\t\tkeyboard_nav : 1,\t\t\t// Keyboard navigation on/off \t\t\t\t\tperformance\t\t\t\t:\t1,\t\t\t// 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit) \t\t\t\t\timage_protect\t\t\t:\t{$image_protect},\t\t\t// Disables image dragging and right click with Javascript \t\t\t\t\t// Size & Position \t\t\t\t\tmin_width\t\t : 0,\t\t\t// Min width allowed (in pixels) \t\t\t\t\tmin_height\t\t : 0,\t\t\t// Min height allowed (in pixels) \t\t\t\t\tvertical_center : 0,\t\t\t// Vertically center background \t\t\t\t\thorizontal_center : 0,\t\t\t// Horizontally center background \t\t\t\t\tfit_always\t\t\t\t:\t1,\t\t\t// Image will never exceed browser width or height (Ignores min. dimensions) \t\t\t\t\tfit_portrait \t: 0,\t\t\t// Portrait images will not exceed browser height \t\t\t\t\tfit_landscape\t\t\t: 0,\t\t\t// Landscape images will not exceed browser width \t\t\t\t\t// Components \t\t\t\t\tslide_links\t\t\t\t:\t'blank',\t// Individual links for each slide (Options: false, 'num', 'name', 'blank') \t\t\t\t\tthumb_links\t\t\t\t:\t1,\t\t\t// Individual thumb links for each slide \t\t\t\t\tthumbnail_navigation : 0,\t\t\t// Thumbnail navigation \t\t\t\t\t{$slides} \t\t\t\t\t// Theme Options \t\t\t\t\tprogress_bar : {$progress_bar}, // Timer for each slide \t\t\t\t\tmouse_scrub\t\t\t\t:\t0 \t\t\t\t}); \t\t }); EOT; $document = JFactory::getDocument(); $document->addStyleSheet(JURI::base(true) . "/components/com_oziogallery3/views/00fuerte/css/supersized.css"); $document->addStyleSheet(JURI::base(true) . "/components/com_oziogallery3/views/00fuerte/theme/supersized.shutter.css"); if ($cparams->get("jquery", 1)) { // protocol: https, location: googleapis, $document->addScript("https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"); } // the ordering of MooTools and jQuery does not matter if you make sure jQuery.noConflict() is called immediately after jQuery is loaded (http://www.designvsdevelop.com/jquery-in-joomla-i-was-wrong/) $document->addScript(JURI::base(true) . "/components/com_oziogallery3/views/00fuerte/js/supersized.js"); // Solo per l'effetto easeOutExpo $document->addScript(JURI::base(true) . "/components/com_oziogallery3/views/00fuerte/js/jquery.easing.min.js"); $prefix = JURI::base(true) . "/index.php?option=com_oziogallery3&view=loader"; $menu = JFactory::getApplication()->getMenu(); $itemid = $menu->getActive() or $itemid = $menu->getDefault(); $itemid = "&Itemid=" . $itemid->id; $document->addScript($prefix . "&type=js&filename=shutter" . $itemid); $document->addScript($prefix . "&type=js&filename=tinybox" . $itemid); $document->addScriptDeclaration($js); $document->addScript(JURI::base(true) . "/components/com_oziogallery3/views/00fuerte/js/jquery.ba-bbq.js"); $this->gallerywidth = $cparams->get("gallerywidth", array("text" => "100", "select" => "%")); if (is_object($this->gallerywidth)) { $this->gallerywidth = (array) $this->gallerywidth; } $this->play_button_style = $cparams->get("play_button", "0") ? '' : 'style="display:none;"'; $this->Params = $cparams; ob_start(); require JPATH_SITE . "/components/com_oziogallery3/views/00fuerte/tmpl/default.php"; $result = JPATH_COMPONENT("com_oziogallery3/views/00fuerte/tmpl/default.php") . ob_get_contents(); ob_end_clean(); return $result; }