本文整理匯總了PHP中Gallery::getCurrentTheme方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::getCurrentTheme方法的具體用法?PHP Gallery::getCurrentTheme怎麽用?PHP Gallery::getCurrentTheme使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::getCurrentTheme方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handleOption
function handleOption($option, $currentValue)
{
switch ($option) {
case 'Theme_colors':
$theme = basename(dirname(__FILE__));
$themeroot = SERVERPATH . "/themes/{$theme}/styles";
echo '<select id="themeselect" name="' . $option . '"' . ">\n";
generateListFromFiles($currentValue, $themeroot, '.css');
echo "</select>\n";
break;
case 'Graphic_logo':
$gallery = new Gallery();
$theme = $gallery->getCurrentTheme();
$themeroot = SERVERPATH . "/themes/{$theme}/images";
echo '<select id="themeselect" name="' . $option . '"' . ">\n";
echo '<option></option>';
generateListFromFiles($currentValue, $themeroot, '.png');
echo "</select>\n";
break;
}
}
示例2: printf
<li><?php
printf(gettext('Zenphoto version <strong>%1$s [%2$s] (%3$s)</strong>'), ZENPHOTO_VERSION, ZENPHOTO_RELEASE, $official);
?>
</li>
<li><?php
if (ZENPHOTO_LOCALE) {
printf(gettext('Current locale setting: <strong>%1$s</strong>'), ZENPHOTO_LOCALE);
} else {
echo gettext('<strong>Locale setting has failed</strong>');
}
?>
</li>
<li>
<?php
$themes = $gallery->getThemes();
$currenttheme = $gallery->getCurrentTheme();
if (array_key_exists($currenttheme, $themes) && isset($themes[$currenttheme]['name'])) {
$currenttheme = $themes[$currenttheme]['name'];
}
printf(gettext('Current gallery theme: <strong>%1$s</strong>'), $currenttheme);
?>
</li>
<li><?php
printf(gettext('PHP version: <strong>%1$s</strong>'), phpversion());
?>
</li>
<?php
if (!defined('RELEASE')) {
?>
<li>
<?php
示例3: gettext
$official = gettext('Official Build');
} else {
$official = gettext('SVN');
}
?>
<li><?php
printf(gettext('Zenphoto version <strong>%1$s [%2$s] (%3$s)</strong>'), ZENPHOTO_VERSION, ZENPHOTO_RELEASE, $official);
?>
</li>
<?php
if (isset($zenpage_version)) {
printf(gettext('zenpage version <strong>%1$s [%2$s]</strong>'), $zenpage_version, ZENPAGE_RELEASE);
}
?>
<li><?php
printf(gettext('Current gallery theme: <strong>%1$s</strong>'), $gallery->getCurrentTheme());
?>
</li>
<li><?php
printf(gettext('PHP version: <strong>%1$s</strong>'), phpversion());
?>
</li>
<li><?php
printf(gettext('PHP memory limit: <strong>%1$s</strong> (Note: Your server might allocate less!)'), INI_GET('memory_limit'));
?>
</li>
<li><?php
printf(gettext('MySQL version: <strong>%1$s</strong>'), mysql_get_client_info());
?>
</li>
<li><?php
示例4: printCustomPageSelector
/**
* Prints the selector for custom pages
*
* @return string
*/
function printCustomPageSelector($current)
{
$gallery = new Gallery();
?>
<select id="custompageselector" name="custompageselect">
<?php
$curdir = getcwd();
$themename = $gallery->getCurrentTheme();
$root = SERVERPATH . '/' . THEMEFOLDER . '/' . $themename . '/';
chdir($root);
$filelist = safe_glob('*.php');
$list = array();
foreach ($filelist as $file) {
$list[] = str_replace('.php', '', filesystemToInternal($file));
}
generateListFromArray(array($current), $list, false, false);
chdir($curdir);
?>
</select>
<?php
}
示例5: urlencode
}
$themelist[$key] = urlencode($alb);
}
}
}
if (!empty($_REQUEST['themealbum'])) {
$alb = urldecode(sanitize_path($_REQUEST['themealbum']));
$album = new Album($gallery, $alb);
$albumtitle = $album->getTitle();
$themename = $album->getAlbumTheme();
} else {
foreach ($themelist as $albumtitle => $alb) {
break;
}
if (empty($alb)) {
$themename = $gallery->getCurrentTheme();
$album = NULL;
} else {
$alb = sanitize_path($alb);
$album = new Album($gallery, $alb);
$albumtitle = $album->getTitle();
$themename = $album->getAlbumTheme();
}
}
?>
<form action="?action=saveoptions" method="post" AUTOCOMPLETE=OFF>
<input type="hidden" name="savethemeoptions" value="yes" />
<table class='bordered'>
<?php
if (count($themelist) == 0) {
?>
示例6: getLayoutSelector
/**
* Worker function for creating layout selectors. Returns the HTML
*
* @param object $obj
* @param string $type
* @param string $text
* @param string$secondary
*/
function getLayoutSelector($obj, $type, $text, $prefix = '', $secondary = false)
{
global $_zp_gallery;
if (is_null($_zp_gallery)) {
$_zp_gallery = new Gallery();
}
$selectdefault = '';
$selected = '';
$files = array();
$list = array();
$getlayout = '';
$table = $obj->table;
$path = SERVERPATH . '/' . THEMEFOLDER . '/' . $_zp_gallery->getCurrentTheme() . '/';
$defaultlayout = '';
$defaulttext = gettext('default');
switch ($table) {
case 'albums':
if ($secondary) {
// the selector for the image default of the album
$filesmask = 'image';
} else {
$filesmask = 'album';
}
$child = $obj->getParentID();
$defaulttext = gettext('inherited');
break;
case 'images':
$filesmask = 'image';
$album = $obj->album;
$child = $album->getParentID();
$defaulttext = gettext('album default');
break;
case 'pages':
$filesmask = 'pages';
$child = $obj->getParentID();
$defaulttext = gettext('inherited');
break;
case 'news':
$child = false;
$categories = $obj->getCategories();
if ($categories) {
foreach ($categories as $cat) {
$cat = new ZenpageCategory($cat['titlelink']);
$getlayout = getSelectedLayout($cat, 'multiple_layouts_news_categories');
if ($getlayout && $getlayout['data']) {
// in at least one news category with an alternate page
$defaulttext = gettext('inherited');
$defaultlayout = gettext('from category');
break;
}
}
}
$filesmask = 'news';
break;
case 'news_categories':
$child = $obj->getParentID();
$defaulttext = gettext('inherited');
$filesmask = 'news';
break;
}
$curdir = getcwd();
chdir($path);
$files = safe_glob($filesmask . '*.php');
chdir($curdir);
if ($child) {
$defaultlayout = checkParentLayouts($obj, $type);
$defaultlayout = $defaultlayout['data'];
}
if ($defaultlayout) {
$defaultlayout = stripSuffix($defaultlayout);
} else {
$defaultlayout = $filesmask;
}
if ($obj->transient) {
$getlayout = false;
} else {
$getlayout = query_single_row("SELECT * FROM " . prefix('plugin_storage') . ' WHERE `aux` = ' . $obj->getID() . ' AND `type` = "' . $type . '"');
}
if (!$child && ($key = array_search($filesmask . '.php', $files)) !== false) {
unset($files[$key]);
}
foreach ($files as $file) {
$file = filesystemToInternal($file);
$list[stripSuffix($file)] = $file;
}
ksort($list);
$html = $text;
if (count($files) != 0) {
$html .= '<select id="' . $type . $prefix . '" name="' . $prefix . $type . '">' . "\n";
if (is_array($getlayout)) {
$selectedlayout = $getlayout['data'];
} else {
//.........這裏部分代碼省略.........
示例7: array
return false;
}
}
return false;
}
// ]]> -->
</script>
<?php
echo "\n</head>";
echo "\n<body>";
printLogoAndLinks();
echo "\n" . '<div id="main">';
printTabs();
echo "\n" . '<div id="content">';
$galleryTheme = $_zp_gallery->getCurrentTheme();
$themelist = array();
if (zp_loggedin(ADMIN_RIGHTS)) {
$gallery_title = $_zp_gallery->getTitle();
if ($gallery_title != gettext("Gallery")) {
$gallery_title .= ' (' . gettext("Gallery") . ')';
}
$themelist[$gallery_title] = '';
}
$albums = $_zp_gallery->getAlbums(0);
foreach ($albums as $alb) {
$album = newAlbum($alb);
if ($album->isMyItem(THEMES_RIGHTS)) {
$key = $album->getTitle();
if ($key != $alb) {
$key .= " ({$alb})";
示例8: getThemeOption
/**
* Returns the value of a theme option
*
* @param string $option option key
* @param object $album
* @param string $theme default theme name
* @return mixed
*/
function getThemeOption($option, $album = NULL, $theme = NULL)
{
global $_set_theme_album;
if (is_null($album)) {
$album = $_set_theme_album;
}
if (is_null($album)) {
$id = 0;
} else {
$id = $album->id;
$theme = $album->getAlbumTheme();
}
if (empty($theme)) {
$gallery = new Gallery();
$theme = $gallery->getCurrentTheme();
}
// album-theme
$sql = "SELECT `value` FROM " . prefix('options') . " WHERE `name`=" . db_quote($option) . " AND `ownerid`=" . $id . " AND `theme`=" . db_quote($theme);
$db = query_single_row($sql);
if (!$db) {
// raw theme option
$sql = "SELECT `value` FROM " . prefix('options') . " WHERE `name`=" . db_quote($option) . " AND `ownerid`=0 AND `theme`=" . db_quote($theme);
$db = query_single_row($sql);
if (!$db) {
// raw album option
$sql = "SELECT `value` FROM " . prefix('options') . " WHERE `name`=" . db_quote($option) . " AND `ownerid`=" . $id . " AND `theme`=NULL";
$db = query_single_row($sql);
if (!$db) {
return getOption($option);
}
}
}
return $db['value'];
}
示例9: setThemeOption
if (isset($_POST['custom_index_page'])) {
setThemeOption('custom_index_page', sanitize($_POST['custom_index_page'], 3), $table, $themename);
}
$otg = getThemeOption('thumb_gray', $table, $themename);
setThemeOption('thumb_gray', (int) isset($_POST['thumb_gray']), $table, $themename);
if ($otg = getThemeOption('thumb_gray', $table, $themename)) {
$wmo = 99;
}
// force cache clear
$oig = getThemeOption('image_gray', $table, $themename);
setThemeOption('image_gray', (int) isset($_POST['image_gray']), $table, $themename);
if ($oig = getThemeOption('image_gray', $table, $themename)) {
$wmo = 99;
}
// force cache clear
if (is_null($table) && $themename == $gallery->getCurrentTheme()) {
// record as global options as well.
if (isset($_POST['image_size'])) {
setOption('image_size', sanitize_numeric($_POST['image_size']), $table, $themename);
}
if (isset($_POST['image_use_side'])) {
setOption('image_use_side', sanitize($_POST['image_use_side']), $table, $themename);
}
if (isset($_POST['thumb_size'])) {
setOption('thumb_size', $ts, $table, $themename);
}
if (isset($_POST['thumb_crop'])) {
setOption('thumb_crop', (int) isset($_POST['thumb_crop']), $table, $themename);
}
if (isset($_POST['thumb_crop_width'])) {
setOption('thumb_crop_width', $ncw, $table, $themename);