本文整理汇总了PHP中gtxt函数的典型用法代码示例。如果您正苦于以下问题:PHP gtxt函数的具体用法?PHP gtxt怎么用?PHP gtxt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gtxt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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');
}
示例3: oui_prefs_section_list
function oui_prefs_section_list($name, $val)
{
$sections = safe_rows("name, title", 'txp_section', "name != 'default' ORDER BY title, name");
if ($sections) {
$vals = array();
foreach ($sections as $row) {
$vals[$row['name']] = $row['title'];
}
return selectInput($name, $vals, $val, 'true');
}
return gtxt('no_sections_available');
}
示例4: oui_prefs_article_list
function oui_prefs_article_list($name, $val)
{
$articles = safe_rows("title, id", 'textpattern', "title != 'default' ORDER BY id, title");
if ($articles) {
$vals = array();
foreach ($articles as $row) {
$vals[$row['id']] = $row['title'];
}
return selectInput($name, $vals, $val, 'true');
}
return gtxt('no_articles_recorded');
}
示例5: oui_prefs_style_list
function oui_prefs_style_list($name, $val)
{
$styles = safe_rows("name", 'txp_css', "name != 'default' ORDER BY name");
if ($styles) {
$vals = array();
foreach ($styles as $row) {
$vals[$row['name']] = $row['name'];
}
return selectInput($name, $vals, $val, 'true');
}
return gtxt('no_styles_recorded');
}
示例6: oui_prefs_file_list
function oui_prefs_file_list($name, $val)
{
$files = safe_rows("name, id", 'txp_image', "name != 'default' ORDER BY id, name");
if ($files) {
$vals = array();
foreach ($files as $row) {
$vals[$row['id']] = $row['name'];
}
return selectInput($name, $vals, $val, 'true');
}
return gtxt('no_images_recorded');
}
示例7: oui_prefs_custom_field_list
function oui_prefs_custom_field_list($name, $val)
{
$custom_fields = safe_rows("name, val", 'txp_prefs', "name LIKE 'custom_%_set' AND val<>'' ORDER BY name");
if ($custom_fields) {
$vals = array();
foreach ($custom_fields as $row) {
$vals[$row['val']] = $row['val'];
}
return selectInput($name, $vals, $val, 'true');
}
return gtxt('no_custom_fields_recorded');
}
示例8: file_edit
function file_edit($message = '', $id = '')
{
global $txpcfg, $file_base_path, $levels, $file_statuses;
pagetop(gTxt('file'), $message);
extract(gpsa(array('name', '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);
if ($permissions == '') {
$permissions = '-1';
}
$file_exists = file_exists(build_file_path($file_base_path, $filename));
$replace = $file_exists ? tr(td(file_upload_form(gTxt('replace_file'), 'upload', 'file_replace', $id))) : '';
$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>') . n . graf(gTxt('or_publish_at') . sp . popHelp('timestamp')) . n . graf(gtxt('date') . sp . tsi('year', '%Y', $rs['created']) . ' / ' . tsi('month', '%m', $rs['created']) . ' / ' . tsi('day', '%d', $rs['created'])) . n . graf(gTxt('time') . sp . tsi('hour', '%H', $rs['created']) . ' : ' . tsi('minute', '%M', $rs['created']) . ' : ' . tsi('second', '%S', $rs['created']));
$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)) . fieldset(radio_list('status', $file_statuses, $status, 4), gTxt('status'), 'file-status') . fieldset($created, gTxt('timestamp'), 'file-created') . graf(fInput('submit', '', gTxt('save'))) . 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))));
} 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') . sInput('file_save') . hInput('id', $id) . hInput('category', $category) . hInput('perms', $permissions == '-1' ? '' : $permissions) . hInput('description', $description) . hInput('status', $status) . hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('crit', $crit) . hInput('search_method', $search_method))), ' colspan="4" style="border:0"'));
}
echo startTable('list'), tr(td(graf(gTxt('file_status') . br . $condition) . graf(gTxt('file_name') . br . $downloadlink) . graf(gTxt('file_download_count') . br . $downloads))), $form, $replace, endTable();
}
}
示例9: article_edit
//.........这里部分代码省略.........
}
}
echo tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), htmlspecialchars($bod)), 'code', ' class="body"');
} else {
echo pluggable_ui('article_ui', 'body', n . graf('<label for="body">' . gTxt('body') . '</label>' . sp . popHelp('body') . br . '<textarea id="body" name="Body" cols="55" rows="31" tabindex="2">' . htmlspecialchars($Body) . '</textarea>', ' class="body"'), $rs);
}
//-- excerpt --------------------
if ($articles_use_excerpts) {
if ($view == 'text') {
echo pluggable_ui('article_ui', 'excerpt', n . graf('<label for="excerpt">' . gTxt('excerpt') . '</label>' . sp . popHelp('excerpt') . br . '<textarea id="excerpt" name="Excerpt" cols="55" rows="5" tabindex="3">' . htmlspecialchars($Excerpt) . '</textarea>', ' class="excerpt"'), $rs);
} else {
echo n . '<hr width="50%" />';
echo '<div class="excerpt">';
echo $textile_excerpt == USE_TEXTILE ? $view == 'preview' ? graf($textile->textileThis($Excerpt)) : tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), htmlspecialchars($textile->TextileThis($Excerpt))), 'code', ' class="excerpt"') : graf($Excerpt);
echo '</div>';
}
}
//-- author --------------
if ($view == "text" && $step != "create") {
echo '<p class="author small">' . gTxt('posted_by') . ': ' . htmlspecialchars($AuthorID) . ' · ' . safe_strftime('%d %b %Y · %X', $sPosted);
if ($sPosted != $sLastMod) {
echo br . gTxt('modified_by') . ': ' . htmlspecialchars($LastModID) . ' · ' . safe_strftime('%d %b %Y · %X', $sLastMod);
}
echo '</p>';
}
echo hInput('from_view', $view), '</div></div></td>';
//-- layer tabs -------------------
echo '<td id="article-tabs"><div id="view_modes">';
echo pluggable_ui('article_ui', 'view', $use_textile == USE_TEXTILE || $textile_body == USE_TEXTILE ? tag(tab('text', $view) . tab('html', $view) . tab('preview', $view), 'ul') : ' ', $rs);
echo '</div></td>';
echo '<td id="article-col-2"><div id="supporting_content">';
if ($view == 'text') {
if ($step != 'create') {
echo n . graf(href(gtxt('create_new'), 'index.php?event=article'), ' class="action-create"');
}
//-- prev/next article links --
if ($step != 'create' and ($prev_id or $next_id)) {
echo '<p class="article-nav">', $prev_id ? prevnext_link('‹' . gTxt('prev'), 'article', 'edit', $prev_id, gTxt('prev')) : '', $next_id ? prevnext_link(gTxt('next') . '›', 'article', 'edit', $next_id, gTxt('next')) : '', '</p>';
}
//-- status radios --------------
echo pluggable_ui('article_ui', 'status', n . n . '<fieldset id="write-status">' . n . '<legend>' . gTxt('status') . '</legend>' . n . status_radio($Status) . n . '</fieldset>', $rs);
//-- category selects -----------
echo pluggable_ui('article_ui', 'categories', n . n . '<fieldset id="write-sort">' . n . '<legend>' . gTxt('sort_display') . '</legend>' . n . graf('<label for="category-1">' . gTxt('category1') . '</label> ' . '<span class="edit category-edit small">[' . eLink('category', '', '', '', gTxt('edit')) . ']</span>' . br . n . category_popup('Category1', $Category1, 'category-1'), ' class="category category-1"') . n . graf('<label for="category-2">' . gTxt('category2') . '</label>' . br . n . category_popup('Category2', $Category2, 'category-2'), ' class="category category-2"'), $rs);
//-- section select --------------
if (!$from_view && !$pull) {
$Section = getDefaultSection();
}
echo pluggable_ui('article_ui', 'section', n . graf('<label for="section">' . gTxt('section') . '</label> ' . '<span class="edit section-edit small">[' . eLink('section', '', '', '', gTxt('edit')) . ']</span>' . br . section_popup($Section, 'section'), ' class="section"') . n . '</fieldset>', $rs);
//-- "More" section
echo n . n . '<div id="more_group"><h3 class="plain lever' . (get_pref('pane_article_more_visible') ? ' expanded' : '') . '"><a href="#more">' . gTxt('more') . '</a></h3>', '<div id="more" class="toggle" style="display:' . (get_pref('pane_article_more_visible') ? 'block' : 'none') . '">';
//-- comments stuff --------------
if ($step == "create") {
//Avoiding invite disappear when previewing
$AnnotateInvite = !empty($store_out['AnnotateInvite']) ? $store_out['AnnotateInvite'] : $comments_default_invite;
if ($comments_on_default == 1) {
$Annotate = 1;
}
}
if ($use_comments == 1) {
$invite[] = n . n . '<fieldset id="write-comments">' . n . '<legend>' . gTxt('comments') . '</legend>';
$comments_expired = false;
if ($step != 'create' && $comments_disabled_after) {
$lifespan = $comments_disabled_after * 86400;
$time_since = time() - $sPosted;
if ($time_since > $lifespan) {
$comments_expired = true;
示例10: file_edit
function file_edit($message = '', $id = '')
{
global $file_base_path, $levels, $file_statuses, $txp_user, $event, $all_file_cats;
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);
$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('edit_file'), $message);
if ($permissions == '') {
$permissions = '-1';
}
if (!has_privs('file.publish') && $status >= STATUS_LIVE) {
$status = STATUS_PENDING;
}
$file_exists = file_exists(build_file_path($file_base_path, $filename));
$existing_files = get_filenames();
$replace = $file_exists ? '<div class="summary-details replace-file">' . n . '<h3>' . gTxt('replace_file') . sp . popHelp('file_replace') . '</h3>' . n . '<div>' . n . file_upload_form('', '', 'file_replace', $id, 'file_replace') . n . '</div>' . n . '</div>' . n : '<div class="summary-details upload-file">' . n . '<h3>' . gTxt('file_relink') . sp . popHelp('file_reassign') . '</h3>' . n . '<div>' . n . file_upload_form('', '', 'file_replace', $id, 'file_reassign') . n . '</div>' . n . '</div>' . n;
$condition = '<span class="' . ($file_exists ? 'success' : 'error') . '">' . ($file_exists ? gTxt('file_status_ok') : gTxt('file_status_missing')) . '</span>';
$downloadlink = $file_exists ? make_download_link($id, txpspecialchars($filename), $filename) : txpspecialchars($filename);
$created = graf(checkbox('publish_now', '1', $publish_now, '', 'publish_now') . '<label for="publish_now">' . gTxt('set_to_now') . '</label>', ' class="edit-file-publish-now"') . n . graf(gTxt('or_publish_at') . sp . popHelp('timestamp'), ' class="edit-file-publish-at"') . n . graf('<span class="label">' . gtxt('date') . '</span>' . n . tsi('year', '%Y', $rs['created']) . ' / ' . n . tsi('month', '%m', $rs['created']) . ' / ' . n . tsi('day', '%d', $rs['created']), ' class="edit-file-published"') . n . graf('<span class="label">' . gTxt('time') . '</span>' . n . tsi('hour', '%H', $rs['created']) . ' : ' . n . tsi('minute', '%M', $rs['created']) . ' : ' . n . tsi('second', '%S', $rs['created']), ' class="edit-file-created"');
echo n . '<div id="' . $event . '_container" class="txp-container">';
echo '<div class="txp-edit">', hed(gTxt('edit_file'), 2), inputLabel('condition', $condition) . n, inputLabel('name', $downloadlink) . n, inputLabel('download_count', $downloads) . n, $replace . n, '<div class="file-detail ' . ($file_exists ? '' : 'not-') . 'exists">' . n, form(($file_exists ? inputLabel('file_status', radioSet($file_statuses, 'status', $status)) . n . inputLabel('file_title', fInput('text', 'title', $title, '', '', '', INPUT_REGULAR, '', 'file_title'), 'title') . n . inputLabel('file_category', treeSelectInput('category', $all_file_cats, $category, 'file_category'), 'file_category') . n . inputLabel('file_description', '<textarea id="file_description" name="description" rows="' . INPUT_XSMALL . '" cols="' . INPUT_LARGE . '">' . $description . '</textarea>', 'description', '', '', '') . n . '<fieldset class="file-created">' . n . '<legend>' . n . gTxt('timestamp') . n . '</legend>' . n . $created . n . '</fieldset>' . n . pluggable_ui('file_ui', 'extend_detail_form', '', $rs) . graf(fInput('submit', '', gTxt('Save'), 'publish')) . n . hInput('filename', $filename) : (empty($existing_files) ? '' : gTxt('existing_file') . n . selectInput('filename', $existing_files, '', 1)) . n . pluggable_ui('file_ui', 'extend_detail_form', '', $rs) . n . graf(fInput('submit', '', gTxt('Save'), 'publish')) . n . hInput('category', $category) . n . hInput('perms', $permissions == '-1' ? '' : $permissions) . n . hInput('title', $title) . n . hInput('description', $description) . n . hInput('status', $status)) . eInput('file') . n . sInput('file_save') . n . hInput('id', $id) . n . hInput('sort', $sort) . n . hInput('dir', $dir) . n . hInput('page', $page) . n . hInput('crit', $crit) . n . hInput('search_method', $search_method), '', '', 'post', 'edit-form', '', $file_exists ? 'file_details' : 'assign_file'), '</div>' . n, '</div>' . n . '</div>';
}
}
示例11: article_edit_form
function article_edit_form($step, $view, $from_view, $article)
{
global $txpcfg, $txp_user, $article_vars;
extract(get_prefs());
extract($article);
if ($step != 'create') {
// Previous record?
$prev_id = checkIfNeighbour('prev', $sPosted);
// Next record?
$next_id = checkIfNeighbour('next', $sPosted);
}
echo n . n . '<form name="article" method="post" action="index.php" enctype="multipart/form-data">';
if ($view != 'text') {
echo hInput('store', base64_encode(serialize($article)));
}
echo hInput('ID', $ID) . eInput('article') . sInput($step) . '<input type="hidden" name="view" />' . startTable('edit') . '<tr>' . n . '<td id="article-col-1">';
if ($view == 'text') {
//-- markup help --------------
echo side_help($markup_body, $markup_excerpt) . '<h3 class="plain"><a href="#advanced" onclick="toggleDisplay(\'advanced\'); return false;">' . gTxt('advanced_options') . '</a></h3>', '<div id="advanced" style="display:none;">', n . graf('<label for="markup-body">' . gTxt('article_markup') . '</label>' . br . pref_markup('markup_body', $markup_body, 'markup-body')), n . graf('<label for="markup-excerpt">' . gTxt('excerpt_markup') . '</label>' . pref_markup('markup_excerpt', $markup_excerpt, 'markup-excerpt')), $allow_form_override ? graf('<label for="override-form">' . gTxt('override_default_form') . '</label>' . br . form_pop($override_form, 'override-form') . sp . popHelp('override_form')) : '', n . graf('<label for="article-image">' . gTxt('article_image') . '</label>' . sp . popHelp('article_image') . br . fInput('text', 'Image', $Image, 'edit', '', '', 22, '', 'article-image')), n . graf('<label for="url-title">' . gTxt('url_title') . '</label>' . sp . popHelp('url_title') . br . fInput('text', 'url_title', $url_title, 'edit', '', '', 22, '', 'url-title')) . '</div>
<h3 class="plain"><a href="#recent" onclick="toggleDisplay(\'recent\'); return false;">' . gTxt('recent_articles') . '</a>' . '</h3>' . '<div id="recent" style="display:none;">';
$recents = safe_rows_start("Title, ID", 'textpattern', "1=1 order by LastMod desc limit 10");
if ($recents) {
echo '<ul class="plain-list">';
while ($recent = nextRow($recents)) {
if (!$recent['Title']) {
$recent['Title'] = gTxt('untitled') . sp . $recent['ID'];
}
echo n . t . '<li><a href="?event=article' . a . 'step=edit' . a . 'ID=' . $recent['ID'] . '">' . escape_title($recent['Title']) . '</a></li>';
}
echo '</ul>';
}
echo '</div>';
} else {
echo sp;
}
echo '</td>' . n . '<td id="article-main">';
//-- title input --------------
if ($view == 'preview') {
echo hed(gTxt('preview'), 2) . hed($Title, 1);
} elseif ($view == 'html') {
echo hed('XHTML', 2) . hed($Title, 1);
} else {
echo '<p><label for="title">' . gTxt('title') . '</label>';
if (($Status == 4 or $Status == 5) and $step != 'create') {
include_once txpath . '/publish/taghandlers.php';
echo sp . sp . '[<a href="' . permlinkurl_id($ID) . '">' . gTxt('view') . '</a>]';
}
echo '<br />' . n . '<input type="text" id="title" name="Title" value="' . cleanfInput($Title) . '" class="edit" size="65" tabindex="1" /></p>';
}
//-- body --------------------
if ($view == 'preview') {
echo do_markup($markup_body, $Body);
} elseif ($view == 'html') {
$bod = do_markup($markup_body, $Body);
echo tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), htmlspecialchars($bod)), 'code');
} else {
echo n . graf('<label for="body">' . gTxt('body') . '</label><br />' . n . '<textarea id="body" name="Body" cols="55" rows="31" tabindex="2">' . htmlspecialchars($Body) . '</textarea>');
}
//-- excerpt --------------------
if ($articles_use_excerpts) {
if ($view == 'text') {
echo n . graf('<label for="excerpt">' . gTxt('excerpt') . '</label>' . sp . popHelp('excerpt') . br . '<textarea id="excerpt" name="Excerpt" cols="55" rows="10" tabindex="3">' . htmlspecialchars($Excerpt) . '</textarea>');
} else {
echo n . '<hr width="50%" />';
echo $view == 'preview' ? graf(do_markup($markup_excerpt, $Excerpt)) : tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), htmlspecialchars(do_markup($markup_excerpt, $Excerpt))), 'code');
}
}
//-- keywords --------------
if ($view == 'text') {
echo n . graf('<label for="keywords">' . gTxt('keywords') . '</label>' . sp . popHelp('keywords') . br . '<textarea id="keywords" name="Keywords" cols="55" rows="5">' . htmlspecialchars(str_replace(',', ', ', $Keywords)) . '</textarea>');
//-- custom fields --------------
echo $custom_1_set ? custField(1, $custom_1_set, $custom_1) : '', $custom_2_set ? custField(2, $custom_2_set, $custom_2) : '', $custom_3_set ? custField(3, $custom_3_set, $custom_3) : '', $custom_4_set ? custField(4, $custom_4_set, $custom_4) : '', $custom_5_set ? custField(5, $custom_5_set, $custom_5) : '', $custom_6_set ? custField(6, $custom_6_set, $custom_6) : '', $custom_7_set ? custField(7, $custom_7_set, $custom_7) : '', $custom_8_set ? custField(8, $custom_8_set, $custom_8) : '', $custom_9_set ? custField(9, $custom_9_set, $custom_9) : '', $custom_10_set ? custField(10, $custom_10_set, $custom_10) : '';
}
//-- author --------------
if ($view == "text" && $step != "create") {
echo '<p class="small">' . gTxt('posted_by') . ': ' . htmlspecialchars($AuthorID) . ' · ' . safe_strftime('%d %b %Y · %X', $sPosted);
if ($sPosted != $sLastMod) {
echo br . gTxt('modified_by') . ': ' . htmlspecialchars($LastModID) . ' · ' . safe_strftime('%d %b %Y · %X', $sLastMod);
}
echo '</p>';
}
echo hInput('from_view', $view);
echo '</td>';
echo '<td id="article-tabs">';
//-- layer tabs -------------------
echo graf(tab('text', $view) . br . tab('html', $view) . br . tab('preview', $view));
echo '</td>';
echo '<td id="article-col-2">';
if ($view == 'text') {
if ($step != 'create') {
echo n . graf(href(gtxt('create_new'), 'index.php?event=article'));
}
//-- prev/next article links --
if ($step != 'create' and ($prev_id or $next_id)) {
echo '<p>', $prev_id ? prevnext_link('‹' . gTxt('prev'), 'article', 'edit', $prev_id, gTxt('prev')) : '', $next_id ? prevnext_link(gTxt('next') . '›', 'article', 'edit', $next_id, gTxt('next')) : '', '</p>';
}
//-- status radios --------------
echo n . n . fieldset(status_radio($Status), gTxt('status'), 'write-status') . n . n . fieldset(n . graf('<label for="section">' . gTxt('section') . '</label> ' . '<span class="small">[' . eLink('section', '', '', '', gTxt('edit')) . ']</span>' . br . section_popup($Section, 'section')) . n . graf('<label for="category-1">' . gTxt('category1') . '</label> ' . '<span class="small">[' . eLink('category', '', '', '', gTxt('edit')) . ']</span>' . br . n . category_popup('Category1', $Category1, 'category-1')) . n . graf('<label for="category-2">' . gTxt('category2') . '</label>' . br . n . category_popup('Category2', $Category2, 'category-2')), gTxt('sort_display'), 'write-sort') . n . n . '<h3 class="plain"><a href="#more" onclick="toggleDisplay(\'more\'); return false;">' . gTxt('more') . '</a></h3>', '<div id="more" style="display: none;">';
//-- comments stuff --------------
//.........这里部分代码省略.........
示例12: article_partial_expires
function article_partial_expires($rs)
{
extract($rs);
return pluggable_ui('article_ui', 'expires', n . n . '<fieldset id="write-expires">' . n . '<legend>' . gTxt('expires') . '</legend>' . n . graf('<span class="label">' . gtxt('date') . '</span>' . sp . tsi('exp_year', '%Y', $sExpires) . ' / ' . tsi('exp_month', '%m', $sExpires) . ' / ' . tsi('exp_day', '%d', $sExpires), ' class="date expires"') . n . graf('<span class="label">' . gTxt('time') . '</span>' . sp . tsi('exp_hour', '%H', $sExpires) . ' : ' . tsi('exp_minute', '%M', $sExpires) . ' : ' . tsi('exp_second', '%S', $sExpires), ' class="time expires"') . n . hInput('sExpires', $sExpires) . n . '</fieldset>', $rs);
}
示例13: article_edit
//.........这里部分代码省略.........
$html_url_title = $partials['url_title']['html'];
echo wrapRegion('meta_group', $html_url_title . $html_keywords, 'meta', 'meta', 'article_meta');
// Article image.
echo $partials['image']['html'];
// Custom fields.
echo $partials['custom_fields']['html'];
// Recent articles.
echo wrapRegion('recent_group', $partials['recent_articles']['html'], 'recent', 'recent_articles', 'article_recent');
} else {
echo sp;
}
echo n . '</div>' . n . '</div>';
// End of .txp-layout-cell.
echo n . '<div class="txp-layout-cell txp-layout-2-4">' . n . '<div role="region" id="main_content">';
// View mode tabs.
echo $partials['view_modes']['html'];
// Title input.
if ($view == 'preview') {
echo n . '<div class="preview">' . hed(gTxt('preview'), 2) . hed($Title, 1, ' class="title"');
} elseif ($view == 'html') {
echo n . '<div class="html">' . hed('HTML', 2) . hed($Title, 1, ' class="title"');
} elseif ($view == 'text') {
echo n . '<div class="text">' . $partials['title']['html'];
}
// Body.
if ($view == 'preview') {
echo n . '<div class="body">' . $Body_html . '</div>';
} elseif ($view == 'html') {
echo tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), txpspecialchars($Body_html)), 'code', ' class="body"');
} else {
echo $partials['body']['html'];
}
// Excerpt.
if ($articles_use_excerpts) {
if ($view == 'preview') {
echo n . '<hr />' . n . '<div class="excerpt">' . $Excerpt_html . '</div>';
} elseif ($view == 'html') {
echo n . '<hr />' . tag(str_replace(array(n, t), array(br, sp . sp . sp . sp), txpspecialchars($Excerpt_html)), 'code', array('class' => 'excerpt'));
} else {
echo $partials['excerpt']['html'];
}
}
// Author.
if ($view == "text" && $step != "create") {
echo $partials['author']['html'];
}
echo hInput('from_view', $view), n . '</div>';
echo n . '</div>' . n . '</div>';
// End of .txp-layout-cell.
echo n . '<div class="txp-layout-cell txp-layout-1-4">' . n . '<div id="supporting_content">';
if ($view == 'text') {
// Publish and Save buttons.
if ($step == 'create' and empty($GLOBALS['ID'])) {
if (has_privs('article.publish')) {
$push_button = fInput('submit', 'publish', gTxt('publish'), 'publish');
} else {
$push_button = fInput('submit', 'publish', gTxt('save'), 'publish');
}
echo graf($push_button, array('id' => 'write-publish'));
} elseif ($Status >= STATUS_LIVE && has_privs('article.edit.published') || $Status >= STATUS_LIVE && $AuthorID === $txp_user && has_privs('article.edit.own.published') || $Status < STATUS_LIVE && has_privs('article.edit') || $Status < STATUS_LIVE && $AuthorID === $txp_user && has_privs('article.edit.own')) {
echo graf(fInput('submit', 'save', gTxt('save'), 'publish'), array('id' => 'write-save'));
}
if ($step != 'create') {
echo graf(href(gtxt('create_new'), 'index.php?event=article'), ' class="action-create"');
}
// Prev/next article links.
if ($step != 'create' and ($rs['prev_id'] or $rs['next_id'])) {
echo $partials['article_nav']['html'];
}
// Sort and display.
echo pluggable_ui('article_ui', 'sort_display', wrapRegion('write-sort', $partials['status']['html'] . $partials['section']['html'] . $partials['categories']['html'], '', gTxt('sort_display')), $rs);
// "Comments" section.
echo wrapRegion('comments_group', $partials['comments']['html'], 'comments', 'comment_settings', 'article_comments', $use_comments == 1 ? '' : 'empty');
// "Dates" section.
if ($step == "create" and empty($GLOBALS['ID'])) {
// Timestamp.
// Avoiding modified date to disappear.
if (!empty($store_out['year'])) {
$persist_timestamp = safe_strtotime($store_out['year'] . '-' . $store_out['month'] . '-' . $store_out['day'] . ' ' . $store_out['hour'] . ':' . $store_out['minute'] . ':' . $store_out['second']);
} else {
$persist_timestamp = time();
}
$posted_block = pluggable_ui('article_ui', 'timestamp', wrapRegion('write-timestamp', graf(checkbox('publish_now', '1', $publish_now, '', 'publish_now') . n . '<label for="publish_now">' . gTxt('set_to_now') . '</label>', ' class="publish-now"') . graf(gTxt('or_publish_at') . popHelp('timestamp'), ' class="publish-at"') . graf(span(gTxt('date'), array('class' => 'txp-label-fixed')) . br . tsi('year', '%Y', $persist_timestamp, '') . ' / ' . tsi('month', '%m', $persist_timestamp, '') . ' / ' . tsi('day', '%d', $persist_timestamp, ''), ' class="date posted created"') . graf(span(gTxt('time'), array('class' => 'txp-label-fixed')) . br . tsi('hour', '%H', $persist_timestamp, '') . ' : ' . tsi('minute', '%M', $persist_timestamp, '') . ' : ' . tsi('second', '%S', $persist_timestamp, ''), ' class="time posted created"'), '', gTxt('timestamp')), array('sPosted' => $persist_timestamp) + $rs);
// Expires.
if (!empty($store_out['exp_year'])) {
$persist_timestamp = safe_strtotime($store_out['exp_year'] . '-' . $store_out['exp_month'] . '-' . $store_out['exp_day'] . ' ' . $store_out['exp_hour'] . ':' . $store_out['exp_minute'] . ':' . $store_out['second']);
} else {
$persist_timestamp = 0;
}
$expires_block = pluggable_ui('article_ui', 'expires', wrapRegion('write-expires', graf(span(gTxt('date'), array('class' => 'txp-label-fixed')) . br . tsi('exp_year', '%Y', $persist_timestamp, '') . ' / ' . tsi('exp_month', '%m', $persist_timestamp, '') . ' / ' . tsi('exp_day', '%d', $persist_timestamp, ''), ' class="date expires"') . graf(span(gTxt('time'), array('class' => 'txp-label-fixed')) . br . tsi('exp_hour', '%H', $persist_timestamp, '') . ' : ' . tsi('exp_minute', '%M', $persist_timestamp, '') . ' : ' . tsi('exp_second', '%S', $persist_timestamp, ''), ' class="time expires"'), '', gTxt('expires')), $rs);
} else {
// Timestamp.
$posted_block = $partials['posted']['html'];
// Expires.
$expires_block = $partials['expires']['html'];
}
echo wrapRegion('dates_group', $posted_block . $expires_block, 'dates', 'date_settings', 'article_dates');
}
echo n . '</div>' . n . '</div>' . n . '</div>' . tInput() . n . '</form>';
}
示例14: ign_current_user
/**
* Displays currently logged-in user
*
*
**/
function ign_current_user($atts)
{
global $ign_user, $ign_err;
extract(lAtts(array('display' => 'name', 'verbose' => false, 'greeting' => gtxt('logged_in_as'), 'form' => 'current_user'), $atts, 0));
if (!$ign_err) {
$use_form = @fetch_form($form);
if (empty($use_form)) {
$use_form = ign_default_form('current_user');
}
return parse($use_form);
} else {
return false;
}
}
示例15: 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>';
}
}