本文整理汇总了PHP中treeSelectInput函数的典型用法代码示例。如果您正苦于以下问题:PHP treeSelectInput函数的具体用法?PHP treeSelectInput怎么用?PHP treeSelectInput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了treeSelectInput函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: categorySelectInput
function categorySelectInput($type, $name, $val, $id, $onchange = 0, $parent_id = NULL)
{
$rs = tree_get('txp_category', $parent_id, "parent > 0 and type='" . doSlash($type) . "'");
if ($rs) {
return treeSelectInput($name, $rs, $val, $id, $onchange, 1, 'name');
}
return false;
}
示例2: parent_pop
function parent_pop($name, $type)
{
$rs = getTree("root", $type);
if ($rs) {
return ' ' . treeSelectInput('parent', $rs, $name);
}
return 'no categories created';
}
示例3: oui_prefs_category_list
function oui_prefs_category_list($name, $val)
{
$rs = getTree('root', '');
if ($rs) {
return treeSelectInput($name, $rs, $val);
}
return gtxt('no_categories_exist');
}
示例4: oui_prefs_cat_article_list
function oui_prefs_cat_article_list($name, $val)
{
$rs = getTree('root', 'article', "title != 'default' ORDER BY id, title");
if ($rs) {
return treeSelectInput($name, $rs, $val);
}
return gtxt('no_categories_exist');
}
示例5: linkcategory_popup
function linkcategory_popup($cat = "")
{
$arr = array('');
$rs = getTree("root", "link");
if ($rs) {
return treeSelectInput("category", $rs, $cat);
}
return false;
}
示例6: cat_parent_pop
function cat_parent_pop($input_name, $type, $id, $current_parent)
{
$id = assert_int($id);
list($lft, $rgt) = array_values(safe_row('lft, rgt', 'txp_category', 'id = ' . $id));
# $rs = getTree('root', $type, "lft not between $lft and $rgt");
$rs = tree_get('txp_category', NULL, "parent != 0 and type='" . doSlash($type) . "' and lft not between {$lft} and {$rgt}");
if ($rs) {
return treeSelectInput($input_name, $rs, $current_parent);
}
return gTxt('no_other_categories_exist');
}
示例7: cat_parent_pop
function cat_parent_pop($name, $type, $id)
{
if ($id) {
$id = assert_int($id);
list($lft, $rgt) = array_values(safe_row('lft, rgt', 'txp_category', 'id = ' . $id));
$rs = getTree('root', $type, "lft not between {$lft} and {$rgt}");
} else {
$rs = getTree('root', $type);
}
if ($rs) {
return treeSelectInput('parent', $rs, $name);
}
return gTxt('no_other_categories_exist');
}
示例8: image_edit
function image_edit($message = '', $id = '')
{
if (!$id) {
$id = gps('id');
}
global $txpcfg, $img_dir;
pagetop('image', $message);
$categories = getTree("root", "image");
$rs = safe_row("*", "txp_image", "id='{$id}'");
if ($rs) {
extract($rs);
echo startTable('list'), tr(td('<img src="' . hu . $img_dir . '/' . $id . $ext . '" height="' . $h . '" width="' . $w . '" alt="" />' . br . upload_form(gTxt('replace_image'), 'replace_image_form', 'image_replace', 'image', $id))), tr(td(join('', array($thumbnail ? '<img src="' . hu . $img_dir . '/' . $id . 't' . $ext . '" alt="" />' . br : '', upload_form(gTxt('upload_thumbnail'), 'upload_thumbnail', 'thumbnail_insert', 'image', $id))))), function_exists("imagecreatefromjpeg") ? thumb_ui($id) : '', tr(td(form(graf(gTxt('image_name') . br . fInput('text', 'name', $name, 'edit')) . graf(gTxt('image_category') . br . treeSelectInput('category', $categories, $category)) . graf(gTxt('alt_text') . br . fInput('text', 'alt', $alt, 'edit', '', '', 50)) . graf(gTxt('caption') . br . text_area('caption', '100', '400', $caption)) . graf(fInput('submit', '', gTxt('save'), 'publish')) . hInput('id', $id) . eInput('image') . sInput('image_save')))), endTable();
}
}
示例9: pagetop
function pagetop($pagetitle, $message = "")
{
global $siteurl, $sitename, $txp_user, $event, $step, $app_mode, $theme;
if ($app_mode == 'async') {
return;
}
$area = gps('area');
$event = !$event ? 'article' : $event;
$bm = gps('bm');
$privs = safe_field("privs", "txp_users", "name = '" . doSlash($txp_user) . "'");
$GLOBALS['privs'] = $privs;
$areas = areas();
$area = false;
foreach ($areas as $k => $v) {
if (in_array($event, $v)) {
$area = $k;
break;
}
}
if (gps('logout')) {
$body_id = 'page-logout';
} elseif (!$txp_user) {
$body_id = 'page-login';
} else {
$body_id = 'page-' . htmlspecialchars($event);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php
echo LANG;
?>
" lang="<?php
echo LANG;
?>
" dir="<?php
echo gTxt('lang_dir');
?>
">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<title>Txp › <?php
echo htmlspecialchars($sitename);
?>
› <?php
echo escape_title($pagetitle);
?>
</title>
<script src="jquery.js" type="text/javascript"></script>
<?php
echo script_js('var textpattern = {event: "' . htmlspecialchars($event) . '", step: "' . htmlspecialchars($step) . '"};');
?>
<script type="text/javascript" src="textpattern.js"></script>
<script type="text/javascript">
<!--
var cookieEnabled = checkCookies();
if (!cookieEnabled)
{
confirm('<?php
echo trim(gTxt('cookies_must_be_enabled'));
?>
');
}
<?php
$edit = array();
if ($event == 'list') {
$rs = safe_column('name', 'txp_section', "name != 'default'");
$edit['section'] = $rs ? selectInput('Section', $rs, '', true) : '';
$rs = getTree('root', 'article');
$edit['category1'] = $rs ? treeSelectInput('Category1', $rs, '') : '';
$edit['category2'] = $rs ? treeSelectInput('Category2', $rs, '') : '';
$edit['comments'] = onoffRadio('Annotate', safe_field('val', 'txp_prefs', "name = 'comments_on_default'"));
$edit['status'] = selectInput('Status', array(1 => gTxt('draft'), 2 => gTxt('hidden'), 3 => gTxt('pending'), 4 => gTxt('live'), 5 => gTxt('sticky')), '', true);
$rs = safe_column('name', 'txp_users', "privs not in(0,6) order by name asc");
$edit['author'] = $rs ? selectInput('AuthorID', $rs, '', true) : '';
}
if (in_array($event, array('image', 'file', 'link'))) {
$rs = getTree('root', $event);
$edit['category'] = $rs ? treeSelectInput('category', $rs, '') : '';
$rs = safe_column('name', 'txp_users', "privs not in(0,6) order by name asc");
$edit['author'] = $rs ? selectInput('author', $rs, '', true) : '';
}
if ($event == 'plugin') {
$edit['order'] = selectInput('order', array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9), 5, false);
}
if ($event == 'admin') {
$edit['privilege'] = privs();
$rs = safe_column('name', 'txp_users', '1=1');
$edit_assign_assets = $rs ? selectInput('assign_assets', $rs, '', true) : '';
}
// output JavaScript
?>
function poweredit(elm)
{
var something = elm.options[elm.selectedIndex].value;
// Add another chunk of HTML
//.........这里部分代码省略.........
示例10: list_multiedit_form
/**
* Renders a multi-edit form widget for articles.
*
* @param int $page The page number
* @param string $sort The current sort value
* @param string $dir The current sort direction
* @param string $crit The current search criteria
* @param string $search_method The current search method
* @return string HTML
*/
function list_multiedit_form($page, $sort, $dir, $crit, $search_method)
{
global $statuses, $all_cats, $all_authors, $all_sections;
if ($all_cats) {
$category1 = treeSelectInput('Category1', $all_cats, '');
$category2 = treeSelectInput('Category2', $all_cats, '');
} else {
$category1 = $category2 = '';
}
$sections = $all_sections ? selectInput('Section', $all_sections, '', true) : '';
$comments = onoffRadio('Annotate', get_pref('comments_on_default'));
$status = selectInput('Status', $statuses, '', true);
$authors = $all_authors ? selectInput('AuthorID', $all_authors, '', true) : '';
$methods = array('changesection' => array('label' => gTxt('changesection'), 'html' => $sections), 'changecategory1' => array('label' => gTxt('changecategory1'), 'html' => $category1), 'changecategory2' => array('label' => gTxt('changecategory2'), 'html' => $category2), 'changestatus' => array('label' => gTxt('changestatus'), 'html' => $status), 'changecomments' => array('label' => gTxt('changecomments'), 'html' => $comments), 'changeauthor' => array('label' => gTxt('changeauthor'), 'html' => $authors), 'duplicate' => gTxt('duplicate'), 'delete' => gTxt('delete'));
if (!$all_cats) {
unset($methods['changecategory1'], $methods['changecategory2']);
}
if (has_single_author('textpattern', 'AuthorID')) {
unset($methods['changeauthor']);
}
if (!has_privs('article.delete.own') && !has_privs('article.delete')) {
unset($methods['delete']);
}
return multi_edit($methods, 'list', 'list_multi_edit', $page, $sort, $dir, $crit, $search_method);
}
示例11: event_category_popup
/**
* PEDRO:
* Helper functions for common textpattern event files actions.
* Code refactoring from original files. Intended to do easy and less error
* prone the future build of new textpattern extensions, and to add new
* events to multiedit forms.
*/
function event_category_popup($name, $cat = "")
{
$arr = array('');
$rs = getTree("root", $name);
if ($rs) {
return treeSelectInput("category", $rs, $cat);
}
return false;
}
示例12: file_edit
function file_edit($message = '', $id = '')
{
global $txpcfg, $file_base_path, $levels, $path_from_root;
extract(doSlash(gpsa(array('name', 'category', 'permissions', 'description'))));
if (!$id) {
$id = gps('id');
}
pagetop('file', $message);
$categories = getTree("root", "file");
$rs = safe_row("*", "txp_file", "id='{$id}'");
if ($rs) {
extract($rs);
if ($permissions == '') {
$permissions = '-1';
}
$file_exists = file_exists(build_file_path($file_base_path, $filename));
$existing_files = get_filenames();
$status = '<span style="color:';
$status .= $file_exists ? 'green' : 'red';
$status .= '">';
$status .= $file_exists ? gTxt('file_status_ok') : gTxt('file_status_missing');
$status .= '</span>';
$downloadlink = $file_exists ? make_download_link($id, $filename, $filename) : $filename;
$form = '';
if ($file_exists) {
$form = tr(td(form(graf(gTxt('file_category') . br . treeSelectInput('category', $categories, $category)) . graf(gTxt('description') . br . text_area('description', '100', '400', $description)) . graf(fInput('submit', '', gTxt('save'))) . hInput('filename', $filename) . hInput('id', $id) . eInput('file') . sInput('file_save'))));
} else {
$form = tr(tda(hed(gTxt('file_relink'), 3) . file_upload_form(gTxt('upload_file'), 'upload', 'file_replace', $id) . form(graf(gTxt('existing_file') . ' ' . selectInput('filename', $existing_files, "", 1) . fInput('submit', '', gTxt('Save'), 'smallerbox') . eInput('file') . hInput('id', $id) . hInput('category', $category) . hInput('perms', $permissions == '-1' ? '' : $permissions) . hInput('description', $description) . sInput('file_save'))), ' colspan="4" style="border:0"'));
}
echo startTable('list'), tr(td(graf(gTxt('file_status') . br . $status) . graf(gTxt('file_name') . br . $downloadlink) . graf(gTxt('file_download_count') . br . (isset($downloads) ? $downloads : 0)))), $form, endTable();
}
}
示例13: file_edit
function file_edit($message = '', $id = '')
{
global $file_base_path, $levels, $file_statuses, $txp_user, $event;
extract(gpsa(array('name', 'title', 'category', 'permissions', 'description', 'sort', 'dir', 'page', 'crit', 'search_method', 'publish_now')));
if (!$id) {
$id = gps('id');
}
$id = assert_int($id);
$categories = getTree('root', 'file');
$rs = safe_row('*, unix_timestamp(created) as created, unix_timestamp(modified) as modified', 'txp_file', "id = {$id}");
if ($rs) {
extract($rs);
$filename = sanitizeForFile($filename);
if (!has_privs('file.edit') && !($author == $txp_user && has_privs('file.edit.own'))) {
file_list(gTxt('restricted_area'));
return;
}
pagetop(gTxt('file'), $message);
if ($permissions == '') {
$permissions = '-1';
}
if (!has_privs('file.publish') && $status >= 4) {
$status = 3;
}
$file_exists = file_exists(build_file_path($file_base_path, $filename));
$replace = $file_exists ? tr(td(file_upload_form(gTxt('replace_file'), 'file_replace', 'file_replace', $id, 'file-replace')), ' class="replace-file"') : '';
$existing_files = get_filenames();
$condition = '<span class="';
$condition .= $file_exists ? 'ok' : 'not-ok';
$condition .= '">';
$condition .= $file_exists ? gTxt('file_status_ok') : gTxt('file_status_missing');
$condition .= '</span>';
$downloadlink = $file_exists ? make_download_link($id, htmlspecialchars($filename), $filename) : htmlspecialchars($filename);
$created = n . graf(checkbox('publish_now', '1', $publish_now, '', 'publish_now') . '<label for="publish_now">' . gTxt('set_to_now') . '</label>', ' class="publish-now"') . n . graf(gTxt('or_publish_at') . sp . popHelp('timestamp'), ' class="publish-at"') . n . graf('<span class="label">' . gtxt('date') . '</span>' . sp . tsi('year', '%Y', $rs['created']) . ' / ' . tsi('month', '%m', $rs['created']) . ' / ' . tsi('day', '%d', $rs['created']), ' class="date posted created"') . n . graf('<span class="label">' . gTxt('time') . '</span>' . sp . tsi('hour', '%H', $rs['created']) . ' : ' . tsi('minute', '%M', $rs['created']) . ' : ' . tsi('second', '%S', $rs['created']), ' class="time posted created"');
$form = '';
if ($file_exists) {
$form = tr(td(form(graf('<label for="file_title">' . gTxt('title') . '</label>: ' . fInput('text', 'title', $title, '', '', '', 40, '', 'file_title'), ' class="title"') . graf('<label for="category">' . gTxt('file_category') . '</label>' . br . treeSelectInput('category', $categories, $category), ' class="category"') . graf('<label for="description">' . gTxt('description') . '</label>' . br . text_area('description', '100', '400', $description, 'description'), ' class="description text"') . fieldset(radio_list('status', $file_statuses, $status, 4), gTxt('status'), 'file-status') . fieldset($created, gTxt('timestamp'), 'file-created') . pluggable_ui('file_ui', 'extend_detail_form', '', $rs) . graf(fInput('submit', '', gTxt('save'), 'publish')) . eInput('file') . sInput('file_save') . hInput('filename', $filename) . hInput('id', $id) . hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('crit', $crit) . hInput('search_method', $search_method), '', '', 'post', 'edit-form', '', 'file_details')), ' class="file-detail exists"');
} else {
$ef_select = empty($existing_files) ? '' : gTxt('existing_file') . ' ' . selectInput('filename', $existing_files, "", 1);
$form = tr(tda(hed(gTxt('file_relink'), 3) . file_upload_form(gTxt('upload_file'), 'file_reassign', 'file_replace', $id, 'file-reassign') . form(graf($ef_select . pluggable_ui('file_ui', 'extend_detail_form', '', $rs) . fInput('submit', '', gTxt('Save'), 'smallerbox') . eInput('file') . sInput('file_save') . hInput('id', $id) . hInput('category', $category) . hInput('perms', $permissions == '-1' ? '' : $permissions) . hInput('title', $title) . hInput('description', $description) . hInput('status', $status) . hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('crit', $crit) . hInput('search_method', $search_method)), '', '', 'post', 'edit-form', '', 'assign_file'), ' colspan="4" style="border:0"'), ' class="file-detail not-exists"');
}
echo n . '<div id="' . $event . '_container" class="txp-container txp-edit">';
echo startTable('list', '', 'edit-pane'), tr(td(graf(gTxt('file_status') . ': ' . $condition, ' class="condition"') . graf(gTxt('file_name') . ': ' . $downloadlink, ' class="name"') . graf(gTxt('file_download_count') . ': ' . $downloads, ' class="downloads"')), ' class="file-info"'), $form, $replace, endTable() . n . '</div>';
}
}
示例14: pagetop
function pagetop($pagetitle, $message = "")
{
global $css_mode, $siteurl, $sitename, $txp_user, $event;
$area = gps('area');
$event = !$event ? 'article' : $event;
$bm = gps('bm');
$privs = safe_field("privs", "txp_users", "name = '" . doSlash($txp_user) . "'");
$GLOBALS['privs'] = $privs;
$areas = areas();
$area = false;
foreach ($areas as $k => $v) {
if (in_array($event, $v)) {
$area = $k;
break;
}
}
if (gps('logout')) {
$body_id = 'page-logout';
} elseif (!$txp_user) {
$body_id = 'page-login';
} else {
$body_id = 'page-' . $event;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php
echo LANG;
?>
" lang="<?php
echo LANG;
?>
" dir="<?php
echo gTxt('lang_dir');
?>
">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<title>Txp › <?php
echo htmlspecialchars($sitename);
?>
› <?php
echo escape_title($pagetitle);
?>
</title>
<link href="textpattern.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="textpattern.js"></script>
<script type="text/javascript">
<!--
var cookieEnabled = checkCookies();
if (!cookieEnabled)
{
confirm('<?php
echo trim(gTxt('cookies_must_be_enabled'));
?>
');
}
<?php
$edit = array();
if ($event == 'list') {
$rs = safe_column('name', 'txp_section', "name != 'default'");
$edit['section'] = $rs ? selectInput('Section', $rs, '', true) : '';
$rs = getTree('root', 'article');
$edit['category1'] = $rs ? treeSelectInput('Category1', $rs, '') : '';
$edit['category2'] = $rs ? treeSelectInput('Category2', $rs, '') : '';
$edit['comments'] = onoffRadio('Annotate', safe_field('val', 'txp_prefs', "name = 'comments_on_default'"));
$edit['status'] = selectInput('Status', array(1 => gTxt('draft'), 2 => gTxt('hidden'), 3 => gTxt('pending'), 4 => gTxt('live'), 5 => gTxt('sticky')), '', true);
$rs = safe_column('name', 'txp_users', "privs not in(0,6)");
$edit['author'] = $rs ? selectInput('AuthorID', $rs, '', true) : '';
}
if (in_array($event, array('image', 'file', 'link'))) {
$rs = getTree('root', $event);
$edit['category'] = $rs ? treeSelectInput('category', $rs, '') : '';
}
if ($event == 'plugin') {
$edit['order'] = selectInput('order', array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9), 5, false);
}
if ($event == 'admin') {
$edit['privilege'] = privs();
}
// output JavaScript
?>
function poweredit(elm)
{
var something = elm.options[elm.selectedIndex].value;
// Add another chunk of HTML
var pjs = document.getElementById('js');
if (pjs == null)
{
var br = document.createElement('br');
elm.parentNode.appendChild(br);
pjs = document.createElement('P');
pjs.setAttribute('id','js');
elm.parentNode.appendChild(pjs);
//.........这里部分代码省略.........
示例15: category_popup
function category_popup($name, $val)
{
$rs = getTree("root", 'article');
if ($rs) {
return treeSelectInput($name, $rs, $val);
}
return false;
}