本文整理汇总了PHP中generateListFromArray函数的典型用法代码示例。如果您正苦于以下问题:PHP generateListFromArray函数的具体用法?PHP generateListFromArray怎么用?PHP generateListFromArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generateListFromArray函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switcher_controllink
function switcher_controllink($html)
{
global $personalities, $_zp_gallery_page;
$personality = getOption('themeSwitcher_garland_personality');
if (!$personality) {
$personality = getOption('garland_personality');
}
?>
<span id="themeSwitcher_garland">
<span title="<?php
echo gettext("Garland image display handling.");
?>
">
<?php
echo gettext('Personality');
?>
<select name="themePersonality" id="themePersonality" onchange="switchPersonality();">
<?php
generateListFromArray(array($personality), $personalities, false, true);
?>
</select>
</span>
</span>
<?php
return $html;
}
示例2: handleOption
function handleOption($option, $currentValue)
{
$themecolors = array('red', 'white', 'blue', 'none');
if ($option == 'demoTheme_colors') {
echo '<select id="demoTheme_themeselect_colors" name="' . $option . '"' . ">\n";
generateListFromArray(array($currentValue), $themecolors, false, false);
echo "</select>\n";
}
}
示例3: handleOption
function handleOption($option, $currentValue)
{
global $themecolors;
if ($option == 'Theme_colors') {
echo '<select id="EF_themeselect_colors" name="' . $option . '"' . ">\n";
generateListFromArray(array($currentValue), $themecolors, false, false);
echo "</select>\n";
}
}
示例4: handleOption
function handleOption($option, $currentValue)
{
switch ($option) {
case 'simplicity3_header_scroll':
echo '<select id="themeselect" name="' . $option . '"' . ">\n";
generateListFromArray(array($currentValue), array("fixed" => "fixed", "banner" => "banner", "scroll" => "scroll"), false, true);
echo "</select>\n";
break;
}
}
示例5: generateLanguageOptionList
/**
* Generates the option list for the language selectin <select>
* @param bool $HTTPAccept set to true to include the HTTPAccept item
*
*/
function generateLanguageOptionList($HTTPAccept)
{
global $_zp_active_languages;
if (is_null($_zp_active_languages)) {
$_zp_active_languages = generateLanguageList();
}
$locales = $_zp_active_languages;
if ($HTTPAccept) {
// for admin only
$locales[gettext("HTTP Accept Language")] = '';
}
generateListFromArray(array(getOption('locale', $HTTPAccept)), $locales, false, true);
}
示例6: handleOption
function handleOption($option, $currentValue)
{
switch ($option) {
case 'garland_menu':
$menusets = array();
echo '<select id="garland_menuset" name="garland_menu"';
if (function_exists('printCustomMenu') && getThemeOption('custom_index_page', NULL, 'garland') === 'gallery') {
$result = query_full_array("SELECT DISTINCT menuset FROM " . prefix('menu') . " ORDER BY menuset");
foreach ($result as $set) {
$menusets[$set['menuset']] = $set['menuset'];
}
} else {
echo ' disabled="disabled"';
}
echo ">\n";
echo '<option value="" style="background-color:LightGray">' . gettext('*standard menu') . '</option>';
generateListFromArray(array($currentValue), $menusets, false, false);
echo "</select>\n";
break;
}
}
示例7: handleOption
function handleOption($option, $currentValue)
{
$sort = array(gettext('Filename') => 'filename', gettext('Custom') => 'custom', gettext('Date') => 'date', gettext('Title') => 'title', gettext('ID') => 'id', gettext('Filemtime') => 'mtime', gettext('Owner') => 'owner', gettext('Published') => 'show');
switch ($option) {
case 'favorites_albumsort':
?>
<span class="nowrap">
<select id="albumsortselect" name="subalbumsortby" onchange="update_direction(this, 'album_direction_div', 'album_custom_div');">
<?php
$cvt = $type = strtolower(getOption('favorites_album_sort_type'));
if ($type && !in_array($type, $sort)) {
$cv = array('custom');
} else {
$cv = array($type);
}
generateListFromArray($cv, $sort, false, true);
?>
</select>
<?php
if ($type == 'random' || $type == '') {
$dsp = 'none';
} else {
$dsp = 'inline';
}
?>
<label id="album_direction_div" style="display:<?php
echo $dsp;
?>
;white-space:nowrap;">
<?php
echo gettext("Descending");
?>
<input type="checkbox" name="album_sortdirection" value="1"
<?php
if (getOption('favorites_album_sort_direction')) {
echo "CHECKED";
}
?>
/>
</label>
</span>
<?php
break;
case 'favorites_imagesort':
?>
<span class="nowrap">
<select id="imagesortselect" name="sortby" onchange="update_direction(this, 'image_direction_div', 'image_custom_div')">
<?php
$cvt = $type = strtolower(getOption('favorites_image_sort_type'));
if ($type && !in_array($type, $sort)) {
$cv = array('custom');
} else {
$cv = array($type);
}
generateListFromArray($cv, $sort, false, true);
?>
</select>
<?php
if ($type == 'random' || $type == '') {
$dsp = 'none';
} else {
$dsp = 'inline';
}
?>
<label id="image_direction_div" style="display:<?php
echo $dsp;
?>
;white-space:nowrap;">
<?php
echo gettext("Descending");
?>
<input type="checkbox" name="image_sortdirection" value="1"
<?php
if (getOption('favorites_image_sort_direction')) {
echo ' checked="checked"';
}
?>
/>
</label>
</span>
<?php
break;
}
}
示例8: gettext
style="background-color:LightGray"><?php
echo gettext('*no watermark');
?>
</option>
<option value="" <?php
if (empty($current)) {
echo ' selected="selected"';
}
?>
style="background-color:LightGray"><?php
echo gettext('*default');
?>
</option>
<?php
$watermarks = getWatermarks();
generateListFromArray(array($current), $watermarks, false, false);
?>
</select>
<span id="WMUSE_<?php
echo $currentimage;
?>
" style="display:<?php
if ($current == '') {
echo 'none';
} else {
echo 'inline';
}
?>
">
<?php
$wmuse = $image->getWMUse();
示例9: gettext
$themes = $_zp_gallery->getThemes();
if (empty($themename)) {
$current_theme = $galleryTheme;
$theme = $themes[$galleryTheme];
$themenamedisplay = '</em><small>' . gettext("no theme assigned, defaulting to Gallery theme") . '</small><em>';
$gallerydefault = true;
} else {
$theme = $themes[$themename];
$themenamedisplay = $theme['name'];
$gallerydefault = false;
}
if (count($themelist) > 1) {
echo '<form action="#" method="post">';
echo gettext("Show theme for: ");
echo '<select id="themealbum" name="themealbum" onchange="this.form.submit()">';
generateListFromArray(array(pathurlencode($alb)), $themelist, false, true);
echo '</select>';
echo '</form>';
}
if (count($themelist) == 0) {
echo '<div class="errorbox" id="no_themes">';
echo "<h2>" . gettext("There are no themes for which you have rights to administer.") . "</h2>";
echo '</div>';
} else {
echo "<h1>" . sprintf(gettext('Current theme for <code><strong>%1$s</strong></code>: <em>%2$s</em>'), $albumtitle, $themenamedisplay);
if (!empty($alb) && !empty($themename)) {
?>
<a class="reset" onclick="launchScript('',['action=settheme','themealbum=<?php
echo pathurlencode($album->name);
?>
示例10: gettext
echo gettext('Drag the albums into the order you wish them displayed.');
?>
<form name="gallery_sort" style="float: right;" method="post" action="<?php
echo WEBPATH . '/' . ZENFOLDER;
?>
/admin-edit.php?page=edit&action=gallery_sortorder" >
<?php
XSRFToken('gallery_sortorder');
?>
<span class="nowrap">
<?php
echo gettext('Sort albums by:');
?>
<select id="albumsortselect" name="gallery_sortby" onchange="this.form.submit();">
<?php
generateListFromArray($cv, $sort, false, true);
?>
</select>
</span>
</form>
<br clear="all">
<p class="notebox">
<?php
echo gettext('<strong>Note:</strong> Dragging an album under a different parent will move the album. You cannot move albums under a <em>dynamic</em> album.');
?>
</p>
<?php
}
?>
<p>
<?php
示例11: printTabs
<div id="main">
<?php
printTabs();
?>
<div id="content">
<h1><?php
echo gettext('Find injected quotes in translation files.');
?>
</h1>
<form action="<?php
echo WEBPATH . "/" . USER_PLUGIN_FOLDER . '/' . 'findQuotes.php';
?>
" method="post">
<select name="language">
<?php
generateListFromArray(array($selected), $list, false, true);
?>
</select>
<button type="submit"><?php
echo gettext('Go');
?>
</button>
</form>
<?php
if ($lang) {
if ($lang == 'en_US') {
$filepath = SERVERPATH . '/' . ZENFOLDER . '/locale/de_DE/LC_MESSAGES/zenphoto.po';
// presumed to be up-to-date
} else {
$filepath = SERVERPATH . '/' . ZENFOLDER . '/locale/' . $lang . '/LC_MESSAGES/zenphoto.po';
}
示例12: controlLink
/**
*
* places a selector so a user may change thems
* @param string $text link text
*/
static function controlLink($textIn = NULL)
{
global $_zp_gallery, $_themeSwitcherThemelist, $_zp_gallery_page;
if (self::active()) {
$themes = array();
foreach ($_zp_gallery->getThemes() as $theme => $details) {
if ($_themeSwitcherThemelist[$theme]) {
if (getPlugin($_zp_gallery_page, $theme)) {
$themes[$details['name']] = $theme;
}
}
}
$text = $textIn;
if (empty($text)) {
$text = gettext('Theme');
}
$reloc = pathurlencode(trim(preg_replace('~themeSwitcher=.*?&~', '', getRequestURI() . '&'), '?&'));
if (strpos($reloc, '?')) {
$reloc .= '&themeSwitcher=%t';
} else {
$reloc .= '?themeSwitcher=%t';
}
$theme = $_zp_gallery->getCurrentTheme();
?>
<span class="themeSwitcherControlLink">
<span title="<?php
echo gettext("Themes will not show in this list if selecting them would result in a “not found” error.");
?>
">
<?php
echo $text;
?>
<select name="themeSwitcher" id="themeSwitcher" onchange="switchTheme('<?php
echo html_encode($reloc);
?>
')">
<?php
generateListFromArray(array($theme), $themes, false, true);
?>
</select>
</span>
<?php
zp_apply_filter('themeSwitcher_Controllink', $theme);
?>
</span>
<?php
}
return $textIn;
}
示例13: watermark
static function watermark($image, $i, $field, $type)
{
if ($type == 'save') {
if (isset($_POST[$i . '-' . $field['name']])) {
$wmt = sanitize($_POST[$i . '-' . $field['name']], 3);
$image->setWatermark($wmt);
$wmuse = 0;
if (isset($_POST['wm_image-' . $i])) {
$wmuse = $wmuse | WATERMARK_IMAGE;
}
if (isset($_POST['wm_thumb-' . $i])) {
$wmuse = $wmuse | WATERMARK_THUMB;
}
if (isset($_POST['wm_full-' . $i])) {
$wmuse = $wmuse | WATERMARK_FULL;
}
$image->setWMUse($wmuse);
$image->save();
}
return NULL;
} else {
$item = NULL;
if ($image->isMyItem($image->manage_some_rights)) {
$current = $image->getWatermark();
ob_start();
?>
<select id="image_watermark-<?php
echo $i;
?>
" name="<?php
echo $i . '-' . $field['name'];
?>
" onclick="toggleWMUse(<?php
echo $i;
?>
);">
<option value="<?php
echo NO_WATERMARK;
?>
" <?php
if ($current == NO_WATERMARK) {
echo ' selected = "selected"';
}
?>
style="background-color:LightGray"><?php
echo gettext('*no watermark');
?>
</option>
<option value="" <?php
if (empty($current)) {
echo ' selected = "selected"';
}
?>
style="background-color:LightGray"><?php
echo gettext('*default');
?>
</option>
<?php
$watermarks = getWatermarks();
generateListFromArray(array($current), $watermarks, false, false);
?>
</select>
<?php
if ($current == '') {
$displaystyle = 'none';
} else {
$displaystyle = 'inline';
}
?>
<span id="WMUSE_<?php
echo $i;
?>
" style="display:<?php
echo $displaystyle;
?>
">
<?php
$wmuse = $image->getWMUse();
?>
<label><input type="checkbox" value="1" id="wm_image-<?php
echo $i;
?>
" name="wm_image-<?php
echo $i;
?>
" <?php
if ($wmuse & WATERMARK_IMAGE) {
echo 'checked="checked"';
}
?>
/><?php
echo gettext('image');
?>
</label>
<label><input type="checkbox" value="1" id="wm_thumb-<?php
echo $i;
?>
" name="wm_thumb-<?php
echo $i;
?>
//.........这里部分代码省略.........
示例14: authorSelector
/**
* Prints a dropdown to select the author of a page or news article (Admin rights users only)
*
* @param string $currentadmin The current admin is selected if adding a new article, otherwise the original author
*/
function authorSelector($author = NULL)
{
global $_zp_authority, $_zp_current_admin_obj;
if (empty($author)) {
$author = $_zp_current_admin_obj->getUser();
}
$authors = array($author => $author);
if (zp_loggedin(MANAGE_ALL_PAGES_RIGHTS | MANAGE_ALL_NEWS_RIGHTS)) {
$admins = $_zp_authority->getAdministrators();
foreach ($admins as $admin) {
if ($admin['rights'] & (ADMIN_RIGHTS | ZENPAGE_PAGES_RIGHTS | ZENPAGE_NEWS_RIGHTS)) {
$authors[$admin['user']] = $admin['user'];
}
}
}
?>
<select size='1' name="author" id="author">
<?php
generateListFromArray(array($author), $authors, false, false);
?>
</select>
<?php
}
示例15: printBulkActions
/**
* Edit tab bulk actions drop-down
* @param array $checkarray the list of actions
* @param bool $checkAll set true to include check all box
*/
function printBulkActions($checkarray, $checkAll = false)
{
$customInfo = $colorboxBookmark = array();
foreach ($checkarray as $key => $value) {
if (is_array($value)) {
$checkarray[$key] = $value['name'];
switch ($action = $value['action']) {
case 'mass_customTextarea_data':
$data['size'] = -1;
case 'mass_customText_data':
$customInfo[$value['name']] = $value;
$action = 'mass_' . $value['name'] . '_data';
break;
}
$colorboxBookmark[$value['name']] = $action;
}
}
if (!empty($colorboxBookmark)) {
?>
<script type="text/javascript">
//<!-- <![CDATA[
function checkFor(obj) {
var sel = obj.options[obj.selectedIndex].value;
var mark;
switch (sel) {
<?php
foreach ($colorboxBookmark as $key => $mark) {
?>
case '<?php
echo $key;
?>
':
mark = '<?php
echo $mark;
?>
';
break;
<?php
}
?>
default:
mark = false;
break;
}
if (mark) {
$.colorbox({
href: '#' + mark,
inline: true,
open: true,
close: '<?php
echo gettext("ok");
?>
'
});
}
}
// ]]> -->
</script>
<?php
}
?>
<span style="float:right">
<select class="ignoredirty" name="checkallaction" id="checkallaction" size="1" onchange="checkFor(this);" >
<?php
generateListFromArray(array('noaction'), $checkarray, false, true);
?>
</select>
<?php
if ($checkAll) {
?>
<br />
<?php
echo gettext("Check All");
?>
<input class="ignoredirty" type="checkbox" name="allbox" id="allbox" onclick="checkAll(this.form, 'ids[]', this.checked);" />
<?php
}
?>
</span>
<?php
foreach ($customInfo as $key => $data) {
?>
<div id="mass_<?php
echo $key;
?>
" style="display:none;
">
<div id="mass_<?php
echo $key;
?>
_data">
<?php
printf('Value for %s:', $data['desc']);
if ($data['action'] == 'mass_customText_data') {
if (isset($data['size']) && $data['size'] >= 0) {
//.........这里部分代码省略.........