rendered paste bodydisplaytoggle.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}
<div class="{$class}">
{capture name=detailMode}
{if ($theme.detailMode)}
<a href="{g->url arg1="controller=core.ShowItem" arg2="detailMode=0" arg3="return=1"}">Summary</a> | <span class="active"> {g->text text="detail"} </span>
{else}
<span class="active"> Summary </span> | <a href="{g->url arg1="controller=core.ShowItem" arg2="detailMode=1" arg3="return=1"}">{g->text text="detail"}</a>
{/if}
{/capture}
{g->text text="toggle mode: %s" arg1=$smarty.capture.detailMode}
</div>
{/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');
}