function section_list($message = '') { pagetop(gTxt('sections'), $message); global $url_mode, $txpac, $wlink; $out[] = tr(tdcs(strong(gTxt('section_head')) . popHelp('section_category'), 3)); $out[] = tr(tdcs(form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('Create'), 'smallerbox') . eInput('section') . sInput('section_create')), 3)); $pageslist = safe_column("name", "txp_page", "1"); $styleslist = safe_column("name", "txp_css", "1"); $rs = safe_rows("*", "txp_section", "name!='' order by name"); if ($rs) { foreach ($rs as $a) { extract($a); if ($name == 'default') { continue; } if ($url_mode) { $wlink = !check_sections($name) ? sp . wLink('section', 'missing_section_file', 'name', $name) : ''; } $deletelink = dLink('section', 'section_delete', 'name', $name, '', 'type', 'section'); $form = startTable('edit') . stackRows(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20), fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pageslist, $page) . popHelp('section_uses_page'), '', 'noline'), fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styleslist, $css) . popHelp('section_uses_css'), '', 'noline'), fLabelCell(gTxt('selected_by_default') . '?') . td(yesnoradio('is_default', $is_default) . popHelp('section_is_default'), '', 'noline'), fLabelCell(gTxt('on_front_page') . '?') . td(yesnoradio('on_frontpage', $on_frontpage) . popHelp('section_on_frontpage'), '', 'noline'), fLabelCell(gTxt('syndicate') . '?') . td(yesnoradio('in_rss', $in_rss) . popHelp('section_syndicate'), '', 'noline'), fLabelCell(gTxt('include_in_search') . '?') . td(yesnoradio('searchable', $searchable) . popHelp('section_searchable'), '', 'noline'), tda(fInput('submit', '', gTxt('save_button'), 'smallerbox'), ' colspan="2" style="border:0"')) . endTable() . eInput('section') . sInput('section_save') . hInput('old_name', $name); $form = form($form); $out[] = tr(td($name . $wlink) . td($form) . td($deletelink)); } } echo startTable('list') . join('', $out) . endTable(); }
function sec_section_list($message = '') { pagetop(gTxt('sections'), $message); global $wlink; $pageslist = safe_column("name", "txp_page", "1=1"); $styleslist = safe_column("name", "txp_css", "1=1"); $out[] = tr(tdcs(strong(gTxt('section_head')) . popHelp('section_category'), 3)); $out[] = tr(tdcs(form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('Create'), 'smallerbox') . eInput('section') . sInput('section_create')), 3)); $defrow = safe_row("page, css", "txp_section", "name like 'default'"); $out[] = form(tr(td(gTxt('default')) . td(startTable('edit', 'left', '') . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pageslist, $defrow['page']) . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styleslist, $defrow['css']) . popHelp('section_uses_css'), '', 'noline')) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox'), ' colspan="2" style="border:0"')) . endTable()) . td()) . eInput('section') . sInput('section_save') . hInput('name', 'default')); $rs = safe_rows_start("*", "txp_section", "name!='' order by name"); if ($rs) { while ($a = nextRow($rs)) { extract($a); if ($name == 'default') { continue; } $deletelink = dLink('section', 'section_delete', 'name', $name, '', 'type', 'section'); $form = startTable('edit') . stackRows(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20), fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20), fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pageslist, $page) . popHelp('section_uses_page'), '', 'noline'), fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styleslist, $css) . popHelp('section_uses_css'), '', 'noline'), fLabelCell(gTxt('selected_by_default') . '?') . td(yesnoradio('is_default', $is_default) . popHelp('section_is_default'), '', 'noline'), fLabelCell(gTxt('on_front_page') . '?') . td(yesnoradio('on_frontpage', $on_frontpage) . popHelp('section_on_frontpage'), '', 'noline'), fLabelCell(gTxt('syndicate') . '?') . td(yesnoradio('in_rss', $in_rss) . popHelp('section_syndicate'), '', 'noline'), fLabelCell(gTxt('include_in_search') . '?') . td(yesnoradio('searchable', $searchable) . popHelp('section_searchable'), '', 'noline'), tda(fInput('submit', '', gTxt('save_button'), 'smallerbox'), ' colspan="2" style="border:0"')) . endTable() . eInput('section') . sInput('section_save') . hInput('old_name', $name); $form = form($form); $out[] = tr(td($name) . td($form) . td($deletelink)); } } echo startTable('list') . join('', $out) . endTable(); }
function article_edit() { pagetop(gTxt('categories')); extract(gpsa(array('name', 'parent'))); $row = safe_row("*", "txp_category", "name='{$name}' and type='article'"); if ($row) { extract($row); $out = stackRows(fLabelCell('article_category_name') . fInputCell('name', $name, 1, 20), fLabelCell('parent') . td(parent_pop($parent, 'article')), tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2)); } $out .= eInput('category') . sInput('article_save') . hInput('old_name', $name); echo form(startTable('edit') . $out . endTable()); }
function discuss_edit() { $discussid = gps('discussid'); extract(safe_row("*", "txp_discuss", "discussid='{$discussid}'")); $ta = '<textarea name="message" cols="60" rows="15">' . htmlspecialchars($message) . '</textarea>'; if (fetch('ip', 'txp_discuss_ipban', 'ip', $ip)) { $banstep = 'ipban_unban'; $bantext = gTxt('unban'); } else { $banstep = 'ipban_add'; $bantext = gTxt('ban'); } $banlink = '[<a href="?event=discuss' . a . 'step=' . $banstep . a . 'ip=' . $ip . a . 'name=' . urlencode($name) . a . 'discussid=' . $discussid . '">' . $bantext . '</a>]'; pagetop(gTxt('edit_comment')); echo form(startTable('edit') . stackRows(fLabelCell('name') . fInputCell('name', $name), fLabelCell('email') . fInputCell('email', $email), fLabelCell('website') . fInputCell('web', $web), td() . td($ta), fLabelCell('visible') . td(checkbox('visible', 1, $visible)), fLabelCell('IP') . td($ip . sp . $banlink), td() . td(fInput('submit', 'step', gTxt('save'), 'publish')), hInput("discussid", $discussid) . hInput('ip', $ip) . eInput('discuss') . sInput('discuss_save')) . endTable()); }
function discuss_edit() { $discussid = gps('discussid'); extract(safe_row("*", "txp_discuss", "discussid='{$discussid}'")); $ta = '<textarea name="message" cols="60" rows="15">' . preg_replace(array('/</', '/>/'), array('<', '>'), $message) . '</textarea>'; if (fetch('ip', 'txp_discuss_ipban', 'ip', $ip)) { $banstep = 'ipban_unban'; $bantext = gTxt('unban'); } else { $banstep = 'ipban_add'; $bantext = gTxt('ban'); } $banlink = '[<a href="?event=discuss' . a . 'step=' . $banstep . a . 'ip=' . $ip . a . 'name=' . urlencode($name) . a . 'discussid=' . $discussid . '">' . $bantext . '</a>]'; pagetop(gTxt('edit_comment')); echo form(startTable('edit') . stackRows(fLabelCell('name') . fInputCell('name', $name), fLabelCell('email') . fInputCell('email', $email), fLabelCell('website') . fInputCell('web', $web), td() . td($ta), fLabelCell('visible') . td(selectInput('visible', array(VISIBLE => gTxt('visible'), SPAM => gTxt('spam'), MODERATE => gTxt('unmoderated')), $visible, false)), fLabelCell('IP') . td($ip . sp . $banlink), td() . td(fInput('submit', 'step', gTxt('save'), 'publish')), hInput("discussid", $discussid) . hInput('ip', $ip) . hInput('parentid', $parentid) . eInput('discuss') . sInput('discuss_save')) . endTable()); }
function cat_event_category_edit($evname) { pagetop(gTxt('categories')); $id = assert_int(gps('id')); $parent = doSlash(gps('parent')); $row = safe_row("*", "txp_category", "id={$id}"); if ($row) { extract($row); $out = stackRows(fLabelCell($evname . '_category_name') . fInputCell('name', $name, 1, 20), fLabelCell('parent') . td(cat_parent_pop($parent, $evname, $id)), fLabelCell($evname . '_category_title') . fInputCell('title', $title, 1, 30), pluggable_ui('category_ui', 'extend_detail_form', '', $row), hInput('id', $id), tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2)); } $out .= eInput('category') . sInput('cat_' . $evname . '_save') . hInput('old_name', $name); echo '<div id="category_container" class="txp-container txp-edit">' . form(startTable('edit', '', 'edit-pane') . $out . endTable(), '', '', 'post', 'edit-form') . '</div>'; }
function discuss_edit() { pagetop(gTxt('edit_comment')); extract(gpsa(array('discussid', 'sort', 'dir', 'page', 'crit', 'search_method'))); $discussid = assert_int($discussid); $rs = safe_row('*, unix_timestamp(posted) as uPosted', 'txp_discuss', "discussid = {$discussid}"); if ($rs) { extract($rs); $message = htmlspecialchars($message); if (fetch('ip', 'txp_discuss_ipban', 'ip', $ip)) { $ban_step = 'ipban_unban'; $ban_text = gTxt('unban'); } else { $ban_step = 'ipban_add'; $ban_text = gTxt('ban'); } $ban_link = '[<a href="?event=discuss' . a . 'step=' . $ban_step . a . 'ip=' . $ip . a . 'name=' . urlencode($name) . a . 'discussid=' . $discussid . '">' . $ban_text . '</a>]'; echo form(startTable('edit') . stackRows(fLabelCell('name') . fInputCell('name', $name), fLabelCell('IP') . td("{$ip} {$ban_link}"), fLabelCell('email') . fInputCell('email', $email), fLabelCell('website') . fInputCell('web', $web), fLabelCell('date') . td(safe_strftime('%d %b %Y %X', $uPosted)), tda(gTxt('message')) . td('<textarea name="message" cols="60" rows="15">' . $message . '</textarea>'), fLabelCell('status') . td(selectInput('visible', array(VISIBLE => gTxt('visible'), SPAM => gTxt('spam'), MODERATE => gTxt('unmoderated')), $visible, false)), td() . td(fInput('submit', 'step', gTxt('save'), 'publish')), hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('crit', $crit) . hInput('search_method', $search_method) . hInput('discussid', $discussid) . hInput('parentid', $parentid) . hInput('ip', $ip) . eInput('discuss') . sInput('discuss_save')) . endTable()); } else { echo graf(gTxt('comment_not_found'), ' class="indicator"'); } }
function cat_event_category_edit($evname) { pagetop(gTxt('categories')); $id = assert_int(gps('id')); $parent = doSlash(gps('parent')); $row = safe_row("*", "txp_category", "id={$id}"); if ($row) { extract($row); $out = stackRows(fLabelCell($evname . '_category_name') . fInputCell('name', $name, 1, 20), fLabelCell('parent') . td(cat_parent_pop($parent, $evname, $id)), fLabelCell($evname . '_category_title') . fInputCell('title', $title, 1, 30), hInput('id', $id), tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2)); } $out .= eInput('category') . sInput('cat_' . $evname . '_save') . hInput('old_name', $name); echo form(startTable('edit') . $out . endTable()); }
function edit_view() { $id = assert_int(gps('id')); $type = ps('type'); $row = safe_row('*', 'txp_category', "id = {$id}"); if ($row) { extract($row); echo form(n . startTable('edit') . stackRows(n . tdcs(n . hed(gTxt($type . '_category'), 1), 2), fLabelCell('name') . fInputCell('name', $name, 1, 20), fLabelCell('parent') . n . td($this->cat_parent_pop('parent', $type, $id, $parent)), fLabelCell('title') . fInputCell('title', $title, 1, 30), n . tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2)) . endTable() . n . eInput('category') . n . sInput('edit') . n . hInput('id', $id) . n . hInput('old_name', $name) . n . hInput('type', $type)); } }
function zem_event_cat_tab_edit() { pagetop(gTxt('categories')); $id = assert_int(gps('id')); $parent = doSlash(gps('parent')); $row = safe_row('*', 'txp_category', "id = {$id}"); if ($row) { extract($row); $out = stackRows(fLabelCell(zem_event_gTxt('category_name')) . fInputCell('name', $name, 1, 20), fLabelCell('parent') . td(zem_event_cat_parent_pop($parent, 'event', $id)), fLabelCell(zem_event_gTxt('category_title')) . fInputCell('title', $title, 1, 30), hInput('id', $id), tdcs(fInput('submit', '', gTxt('save_button'), 'smallerbox'), 2)); } echo form(startTable('edit') . $out . eInput('zem_event_cats') . sInput('save') . hInput('old_name', $name) . endTable()); }