Source

joomla-picasa / site / views / album / tmpl / default.php

<?php

// no direct access
defined('_JEXEC') or die('Restricted access');

if ($this->params->get('picasaInstantEnabled') == '1'){
	$instantScript = "<script type='text/javascript' src='" . $this->baseurl . "/components/com_joomlapicasa2/libraries/instant/instant.js'></script>";
	$mainframe->addCustomHeadTag($instantScript);
}

if ($this->params->get('picasaLightboxEnabled') == '1'){
	$mootoolsScript = "<script type='text/javascript' src='" . $this->baseurl . "/media/system/js/mootools.js'></script>";
	$mainframe->addCustomHeadTag($mootoolsScript);
	$slimboxScript = "<script type='text/javascript' src='" . $this->baseurl . "/components/com_joomlapicasa2/libraries/slimbox/slimbox.js'></script>";
	$mainframe->addCustomHeadTag($slimboxScript);
	$slimboxCss = "<link rel='stylesheet' href='" . $this->baseurl . "/components/com_joomlapicasa2/libraries/slimbox/slimbox.css' type='text/css' media='screen' />";
	$mainframe->addCustomHeadTag($slimboxCss);
}

$db =& JFactory::getDBO();

$maxPhotosPerPage = $this->params->get('picasaMaxPhotosPerPage');
$currentPage = $db->getEscaped(JRequest::getVar('page'));
$totPages = ceil ($this->numPhotos / $maxPhotosPerPage);

$db =& JFactory::getDBO();

echo "<h1>" . $this->albumTitle  . "</h1>";

echo JText::_('Jp2_album_contains') . " <strong>" . $this->numPhotos . "</strong> " . JText::_('Jp2_photos');

echo "<p align=center>";

echo " " . JText::_('JP2_page') . " " . $currentPage . "/" . $totPages . " <br />";

echo "</p>";

echo "<table align='center'>";
echo "<tr>";
for ($i = 0; $i < sizeof($this->photosList); $i++){
	$photo = $this->photosList[$i];
	if ($i % $this->params->get('picasaMaxPhotosPerRow') == 0)
		echo "<tr>";
	echo "<td>";
	echo "<a href = '" . $photo['photoURL'] . "?imgmax=400' ";
	if ($this->params->get('picasaLightboxEnabled') == '1')
		echo "rel='lightbox[" . $db->getEscaped(JRequest::getVar('album')) . "]'";
	echo ">";
	echo "<img ";
	if ($this->params->get('picasaInstantEnabled') == '1')
		echo " class=\"instant\" ";
	echo "src='" . $photo['thumbnailURL'] . "' alt='". $photo['photoTitle'] . "' /></a>";
	echo "</td>";
	if ( ($i + $this->params->get('picasaMaxPhotosPerRow') + 1) % $this->params->get('picasaMaxPhotosPerRow') == 0)
		echo "</tr>";
}
echo "</table>";
echo "<p align='center'>";
if ($currentPage > 1){
	echo "<a href=" . JRoute::_( 'index.php?option=com_joomlapicasa2&view=album&album=' . $db->getEscaped(JRequest::getVar('album')) . '&page='. ($currentPage-1) ) . ">";
}
echo JText::_('JP2_prev');
if ($currentPage > 1){
	echo "</a>";
}

echo " | ";

if ($currentPage < $totPages){
	echo "<a href=" . JRoute::_( 'index.php?option=com_joomlapicasa2&view=album&album=' . $db->getEscaped(JRequest::getVar('album')) . '&page='. ($currentPage+1) ) . ">";
}
echo JText::_('JP2_next');
if ($currentPage < $totPages){
	echo "</a>";
}

echo "</p>";
echo "<br/>Joomla! Picasa by <a href='http://prof3ta.netsons.org'>Roberto Aloi (a.k.a. Prof3ta)</a><br/>";

?>