本文整理汇总了PHP中treeSelectInput函数的典型用法代码示例。如果您正苦于以下问题:PHP treeSelectInput函数的具体用法?PHP treeSelectInput怎么用?PHP treeSelectInput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了treeSelectInput函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:8,代码来源:txplib_forms.php
示例2: parent_pop
function parent_pop($name, $type)
{
$rs = getTree("root", $type);
if ($rs) {
return ' ' . treeSelectInput('parent', $rs, $name);
}
return 'no categories created';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:8,代码来源:txp_category.php
示例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');
}
开发者ID:NicolasGraph,项目名称:oui_prefs_functions,代码行数:8,代码来源:category_list.php
示例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');
}
开发者ID:NicolasGraph,项目名称:oui_prefs_functions,代码行数:8,代码来源:cat_article_list.php
示例5: linkcategory_popup
function linkcategory_popup($cat = "")
{
$arr = array('');
$rs = getTree("root", "link");
if ($rs) {
return treeSelectInput("category", $rs, $cat);
}
return false;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:9,代码来源:txp_link.php
示例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');
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:11,代码来源:txp_category.php
示例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');
}
开发者ID:psic,项目名称:websites,代码行数:14,代码来源:txp_category.php
示例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();
}
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:14,代码来源:txp_image.php
示例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
//.........这里部分代码省略.........
开发者ID:bgarrels,项目名称:textpattern,代码行数:101,代码来源:txplib_head.php
示例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);
}
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:35,代码来源:txp_list.php
示例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;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:16,代码来源:txplib_misc.php
示例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();
}
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:32,代码来源:txp_file.php
示例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>';
}
}
开发者ID:psic,项目名称:websites,代码行数:45,代码来源:txp_file.php
示例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);
//.........这里部分代码省略.........
开发者ID:evanfarrar,项目名称:opensprints.org,代码行数:101,代码来源:txplib_head.php
示例15: category_popup
function category_popup($name, $val)
{
$rs = getTree("root", 'article');
if ($rs) {
return treeSelectInput($name, $rs, $val);
}
return false;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:8,代码来源:txp_article.php
示例16: category_pop
function category_pop($name)
{
$arr = array('');
$rs = getTree('root', 'article');
if ($rs) {
return ' ' . treeSelectInput("category", $rs, $name);
}
return 'no categories created';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:9,代码来源:txp_tag.php
示例17: image_edit
function image_edit($message = '', $id = '')
{
global $prefs, $file_max_upload_size, $txp_user, $event, $all_image_cats;
if (!$id) {
$id = gps('id');
}
$id = assert_int($id);
$rs = safe_row("*, unix_timestamp(date) as uDate", "txp_image", "id = {$id}");
if ($rs) {
extract($rs);
if (!has_privs('image.edit') && !($author === $txp_user && has_privs('image.edit.own'))) {
image_list(gTxt('restricted_area'));
return;
}
pagetop(gTxt('edit_image'), $message);
extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
if ($ext != '.swf') {
$aspect = $h == $w ? ' square' : ($h > $w ? ' portrait' : ' landscape');
$img_info = $id . $ext . ' (' . $w . ' × ' . $h . ')';
$img = '<div class="fullsize-image"><img class="content-image" src="' . imagesrcurl($id, $ext) . "?{$uDate}" . '" alt="' . $img_info . '" title="' . $img_info . '" /></div>';
} else {
$img = $aspect = '';
}
if ($thumbnail and $ext != '.swf') {
$thumb_info = $id . 't' . $ext . ' (' . $thumb_w . ' × ' . $thumb_h . ')';
$thumb = '<img class="content-image" src="' . imagesrcurl($id, $ext, true) . "?{$uDate}" . '" alt="' . $thumb_info . '" ' . ($thumb_w ? 'width="' . $thumb_w . '" height="' . $thumb_h . '" title="' . $thumb_info . '"' : '') . ' />';
} else {
$thumb = '';
if ($thumb_w == 0) {
$thumb_w = get_pref('thumb_w', 0);
}
if ($thumb_h == 0) {
$thumb_h = get_pref('thumb_h', 0);
}
}
echo n . '<div id="' . $event . '_container" class="txp-container">';
echo pluggable_ui('image_ui', 'fullsize_image', $img, $rs), '<section class="txp-edit">', hed(gTxt('edit_image'), 2), pluggable_ui('image_ui', 'image_edit', wrapGroup('image_edit_group', upload_form('', '', 'image_replace', 'image', $id, $file_max_upload_size, 'image_replace', 'image-replace'), 'replace_image', 'replace-image', 'replace_image_form'), $rs), pluggable_ui('image_ui', 'thumbnail_image', '<div class="thumbnail-edit">' . ($thumbnail ? $thumb . n . dLink('image', 'thumbnail_delete', 'id', $id, '', '', '', '', array($page, $sort, $dir, $crit, $search_method)) : '') . '</div>', $rs), pluggable_ui('image_ui', 'thumbnail_edit', wrapGroup('thumbnail_edit_group', upload_form('', '', 'thumbnail_insert', 'image', $id, $file_max_upload_size, 'upload_thumbnail', 'thumbnail-upload'), 'upload_thumbnail', 'thumbnail-upload', 'upload_thumbnail'), $rs), check_gd($ext) ? pluggable_ui('image_ui', 'thumbnail_create', wrapGroup('thumbnail_create_group', form(graf(n . '<label for="width">' . gTxt('thumb_width') . '</label>' . fInput('text', 'width', @$thumb_w, 'input-xsmall', '', '', INPUT_XSMALL, '', 'width') . n . '<label for="height">' . gTxt('thumb_height') . '</label>' . fInput('text', 'height', @$thumb_h, 'input-xsmall', '', '', INPUT_XSMALL, '', 'height') . n . '<label for="crop">' . gTxt('keep_square_pixels') . '</label>' . checkbox('crop', 1, @$prefs['thumb_crop'], '', 'crop') . fInput('submit', '', gTxt('Create')), ' class="edit-alter-thumbnail"') . hInput('id', $id) . eInput('image') . sInput('thumbnail_create') . hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('search_method', $search_method) . hInput('crit', $crit), '', '', 'post', 'edit-form', '', 'thumbnail_alter_form'), 'create_thumbnail', 'thumbnail-alter', 'create_thumbnail'), $rs) : '', '<div class="image-detail">', form(inputLabel('image_name', fInput('text', 'name', $name, '', '', '', INPUT_REGULAR, '', 'image_name'), 'image_name') . inputLabel('image_category', treeSelectInput('category', $all_image_cats, $category, 'image_category'), 'image_category') . inputLabel('image_alt_text', fInput('text', 'alt', $alt, '', '', '', INPUT_REGULAR, '', 'image_alt_text'), 'alt_text') . inputLabel('image_caption', text_area('caption', 0, 0, $caption, 'image_caption', TEXTAREA_HEIGHT_SMALL, INPUT_LARGE), 'caption', '', '', '') . pluggable_ui('image_ui', 'extend_detail_form', '', $rs) . graf(fInput('submit', '', gTxt('save'), 'publish')) . hInput('id', $id) . eInput('image') . sInput('image_save') . hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('search_method', $search_method) . hInput('crit', $crit), '', '', 'post', 'edit-form', '', 'image_details_form'), '</div>', '</section>' . n . '</div>';
}
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:39,代码来源:txp_image.php
示例18: tbCategoryPop
/**
* Renders a HTML <select> list of Categories.
*
* @param string $value Currently selected value
* @param string $type Context to which the category applies
* @return string HTML
*/
private function tbCategoryPop($value, $type = 'article')
{
$vals = getTree('root', $type);
if ($vals) {
return ' ' . treeSelectInput('category', $vals, $value, 'category');
}
return gTxt('no_categories_available');
}
开发者ID:hcgtv,项目名称:textpattern,代码行数:15,代码来源:txp_tag.php
示例19: cat_event_category_list
/**
* Renders a list of categories.
*
* @param string $event Type of category
* @return string HTML
*/
function cat_event_category_list($event)
{
$rs = getTree('root', $event);
$parent = ps('parent_cat');
$heading = 'tab_' . ($event == 'article' ? 'list' : $event);
$for = $rs ? ' for="' . $event . '_category_parent"' : '';
$out = hed(gTxt($heading) . popHelp($event . '_category'), 2) . form(graf(tag(gTxt('create_new_category'), 'label', array('for' => $event . '_category_new')) . br . fInput('text', 'title', '', '', '', '', INPUT_REGULAR, '', $event . '_category_new')) . ($rs ? graf('<label' . $for . '>' . gTxt('parent') . '</label>' . br . treeSelectInput('parent_cat', $rs, $parent, $event . '_category_parent'), array('class' => 'parent')) : '') . graf(fInput('submit', '', gTxt('Create')) . eInput('category') . sInput('cat_' . $event . '_create')), '', '', 'post', $event);
if ($rs) {
$total_count = array();
if ($event == 'article') {
// Count distinct articles for both categories, avoid duplicates.
$rs2 = getRows("SELECT category, COUNT(*) AS num FROM (\n SELECT ID, Category1 AS category FROM " . safe_pfx('textpattern') . "\n UNION\n SELECT ID, Category2 AS category FROM " . safe_pfx('textpattern') . "\n ) AS t WHERE category != '' GROUP BY category");
if ($rs2 !== false) {
foreach ($rs2 as $a) {
$total_count[$a['category']] = $a['num'];
}
}
} else {
switch ($event) {
case 'link':
$rs2 = safe_rows_start("category, COUNT(*) AS num", 'txp_link', "1 = 1 GROUP BY category");
break;
case 'image':
$rs2 = safe_rows_start("category, COUNT(*) AS num", 'txp_image', "1 = 1 GROUP BY category");
break;
case 'file':
$rs2 = safe_rows_start("category, COUNT(*) AS num", 'txp_file', "1 = 1 GROUP BY category");
break;
}
while ($a = nextRow($rs2)) {
$name = $a['category'];
$num = $a['num'];
$total_count[$name] = $num;
}
}
$items = array();
foreach ($rs as $a) {
extract($a);
// Format count.
switch ($event) {
case 'article':
$url = 'index.php?event=list' . a . 'search_method=categories' . a . 'crit=' . $name;
break;
case 'link':
$url = 'index.php?event=link' . a . 'search_method=category' . a . 'crit=' . $name;
break;
case 'image':
$url = 'index.php?event=image' . a . 'search_method=category' . a . 'crit=' . $name;
break;
case 'file':
$url = 'index.php?event=file' . a . 'search_method=category' . a . 'crit=' . $name;
break;
}
$count = isset($total_count[$name]) ? href('(' . $total_count[$name] . ')', $url) : '(0)';
if (empty($title)) {
$edit_link = '<em>' . eLink('category', 'cat_' . $event . '_edit', 'id', $id, gTxt('untitled')) . '</em>';
} else {
$edit_link = eLink('category', 'cat_' . $event . '_edit', 'id', $id, $title);
}
$items[] = graf(checkbox('selected[]', $id, 0) . sp . str_repeat(sp . sp, $level * 2) . $edit_link . sp . $count, ' class="level-' . $level . '"');
}
if ($items) {
$out .= cat_article_multiedit_form($event, $items);
}
} else {
$out .= graf(span(null, array('class' => 'ui-icon ui-icon-info')) . ' ' . gTxt('no_categories_exist'), array('class' => 'alert-block information'));
}
return $out;
}
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:75,代码来源:txp_category.php
示例20: image_edit
function image_edit($message = '', $id = '')
{
global $txpcfg, $img_dir, $file_max_upload_size, $txp_user, $event;
if (!$id) {
$id = gps('id');
}
$id = assert_int($id);
$rs = safe_row("*, unix_timestamp(date) as uDate", "txp_image", "id = {$id}");
if ($rs) {
extract($rs);
if (!has_privs('image.edit') && !($author == $txp_user && has_privs('image.edit.own'))) {
image_list(gTxt('restricted_area'));
return;
}
pagetop(gTxt('edit_image'), $message);
extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
$categories = getTree("root", "image");
if ($ext != '.swf') {
$aspect = $h == $w ? ' square' : ($h > $w ? ' portrait' : ' landscape');
$img = '<img class="image fullsize" src="' . imagesrcurl($id, $ext) . "?{$uDate}" . '" height="' . $h . '" width="' . $w . '" alt="" title="' . $id . $ext . ' (' . $w . ' × ' . $h . ')" id="image-fullsize" />';
} else {
$img = $aspect = '';
}
if ($thumbnail and $ext != '.swf') {
$thumb = '<img class="image thumbnail" src="' . imagesrcurl($id, $ext, true) . "?{$uDate}" . '" alt="" ' . ($thumb_w ? "width='{$thumb_w}' height='{$thumb_h}'" : '') . ' />';
} else {
$thumb = '';
}
echo n . '<div id="' . $event . '_container" class="txp-container txp-edit">';
echo startTable('list', '', 'edit-pane'), tr(td(pluggable_ui('image_ui', 'image_edit', $img . br . upload_form(gTxt('replace_image'), 'replace_image_form', 'image_replace', 'image', $id, $file_max_upload_size, 'image-replace', 'image-replace'), $rs)), ' class="image-edit' . $aspect . '"'), tr(td(pluggable_ui('image_ui', 'thumbnail_edit', join('', array($thumbnail ? startTable('image-thumbnail', '', 'image-thumbnail') . tr(td($thumb, '', 'thumbwrapper') . td(dLink('image', 'thumbnail_delete', 'id', $id, '', '', '', '', array($page, $sort, $dir, $crit, $search_method)))) . endTable() . br : '', upload_form(gTxt('upload_thumbnail'), 'upload_thumbnail', 'thumbnail_insert', 'image', $id, $file_max_upload_size, 'upload-thumbnail', 'thumbnail-upload'))), $rs)), ' class="thumbnail-edit"'), check_gd($ext) ? thumb_ui($id, $rs) : '', tr(td(form(graf('<label for="image-name">' . gTxt('image_name') . '</label>' . br . fInput('text', 'name', $name, 'edit', '', '', '', '', 'image-name'), ' class="name"') . graf('<label for="image-category">' . gTxt('image_category') . '</label>' . br . treeSelectInput('category', $categories, $category, 'image-category'), ' class="category"') . graf('<label for="alt-text">' . gTxt('alt_text') . '</label>' . br . fInput('text', 'alt', $alt, 'edit', '', '', 50, '', 'alt-text'), ' class="alt text"') . graf('<label for="caption">' . gTxt('caption') . '</label>' . br . '<textarea id="caption" name="caption">' . $caption . '</textarea>', ' class="caption description text"') . pluggable_ui('image_ui', 'extend_detail_form', '', $rs) . n . graf(fInput('submit', '', gTxt('save'), 'publish')) . n . hInput('id', $id) . n . eInput('image') . n . sInput('image_save') . n . hInput('sort', $sort) . n . hInput('dir', $dir) . n . hInput('page', $page) . n . hInput('search_method', $search_method) . n . hInput('crit', $crit), '', '', 'post', 'edit-form', '', 'image_details_form')), ' class="image-detail"'), endTable() . n . '</div>';
}
}
开发者ID:psic,项目名称:websites,代码行数:32,代码来源:txp_image.php
注:本文中的treeSelectInput函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论