Example #1
0
    }
}
if ($conf['picture_download_icon'] and !empty($picture['current']['download_url'])) {
    $template->append('current', array('U_DOWNLOAD' => $picture['current']['download_url']), true);
}
if ($page['slideshow']) {
    $tpl_slideshow = array();
    //slideshow end
    $template->assign(array('U_SLIDESHOW_STOP' => $picture['current']['url']));
    foreach (array('repeat', 'play') as $p) {
        $var_name = 'U_' . ($slideshow_params[$p] ? 'STOP_' : 'START_') . strtoupper($p);
        $tpl_slideshow[$var_name] = add_url_params($picture['current']['url'], array('slideshow' => encode_slideshow_params(array_merge($slideshow_params, array($p => !$slideshow_params[$p])))));
    }
    foreach (array('dec', 'inc') as $op) {
        $new_period = $slideshow_params['period'] + ($op == 'dec' ? -1 : 1) * $conf['slideshow_period_step'];
        $new_slideshow_params = correct_slideshow_params(array_merge($slideshow_params, array('period' => $new_period)));
        if ($new_slideshow_params['period'] === $new_period) {
            $var_name = 'U_' . strtoupper($op) . '_PERIOD';
            $tpl_slideshow[$var_name] = add_url_params($picture['current']['url'], array('slideshow' => encode_slideshow_params($new_slideshow_params)));
        }
    }
    $template->assign('slideshow', $tpl_slideshow);
} elseif ($conf['picture_slideshow_icon']) {
    $template->assign(array('U_SLIDESHOW_START' => add_url_params($picture['current']['url'], array('slideshow' => ''))));
}
$template->assign(array('SECTION_TITLE' => $page['section_title'], 'PHOTO' => $title_nb, 'IS_HOME' => 'categories' == $page['section'] and !isset($page['category']), 'LEVEL_SEPARATOR' => $conf['level_separator'], 'U_UP' => $url_up, 'DISPLAY_NAV_BUTTONS' => $conf['picture_navigation_icons'], 'DISPLAY_NAV_THUMB' => $conf['picture_navigation_thumb']));
if ($conf['picture_metadata_icon']) {
    $template->assign('U_METADATA', $url_metadata);
}
//------------------------------------------------------- upper menu management
// admin links
Example #2
0
/**
 * Encodes slideshow array params into a string
 *
 * @param array $decode_params
 * @return string
 */
function encode_slideshow_params($decode_params = array())
{
    global $conf;
    $params = array_diff_assoc(correct_slideshow_params($decode_params), get_default_slideshow_params());
    $result = '';
    foreach ($params as $name => $value) {
        // boolean_to_string return $value, if it's not a bool
        $result .= '+' . $name . '-' . boolean_to_string($value);
    }
    return $result;
}