displaytoggle.tpl
{*
* $Revision: 1.1 $
* If you want to customize this file, do not edit it directly since future upgrades
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
* version. Gallery will look for that file first and use it if it exists.
*}
{if $user.isRegisteredUser}
{capture name=detailMode}
{if ($theme.detailMode)}
Summary |
{g->text text="detail"}
{else}
Summary |
{g->text text="detail"}
{/if}
{/capture}
{g->text text="toggle mode: %s" arg1=$smarty.capture.detailMode}
{/if}
theme.tpl
{if $theme.pageType == 'album'}
{g->theme include="album.tpl"}
{g->theme include="displaytoggle.tpl"}
theme.inc
/**
* @see GalleryTheme::showAlbumPage
*/
function showAlbumPage(&$template, $item, $params, $childIds) {
$ret = $this->loadCommonTemplateData(
$template, $item, $params,
array('owner', 'viewCount', 'descendentCount', 'parents', 'peers',
'systemLinks', 'itemLinks', 'itemSummaries',
'itemDetailFiles', 'thumbnails', 'pageNavigator', 'jumpRange','childItemLinksDetailed'),
$childIds);
if ($ret->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null);
}
/* Add in our extra stuff */
$theme =& $template->getVariableByReference('theme');
$theme['columnWidthPct'] = floor(100 / $params['columns']);
$detailMode = GalleryUtilities::getRequestVariables('detailMode');
if ($detailMode != null) {
$session =& $gallery->getSession();
$session->put('theme.detailMode', $detailMode ? 1 : 0);
}
/* Add our header and styles */
return array(GalleryStatus::success(), 'theme.tpl');
}