本文整理汇总了PHP中popHelp函数的典型用法代码示例。如果您正苦于以下问题:PHP popHelp函数的具体用法?PHP popHelp怎么用?PHP popHelp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了popHelp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sec_section_list
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();
}
示例2: doLoginForm
/**
* Renders and outputs a login form.
*
* This function outputs a full HTML document,
* including <head> and footer.
*
* @param string|array $message The activity message
*/
function doLoginForm($message)
{
global $textarray_script, $event, $step;
include txpath . '/lib/txplib_head.php';
$event = 'login';
if (gps('logout')) {
$step = 'logout';
} elseif (gps('reset')) {
$step = 'reset';
}
pagetop(gTxt('login'), $message);
$stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
$reset = gps('reset');
$name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
$out = array();
if ($reset) {
$out[] = hed(gTxt('password_reset'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), ' class="login-name"') . graf(fInput('submit', '', gTxt('password_reset_button'), 'publish') . n) . graf(href(gTxt('back_to_login'), 'index.php'), array('class' => 'login-return')) . hInput('p_reset', 1);
} else {
$out[] = hed(gTxt('login_to_textpattern'), 2, array('id' => 'txp-login-heading')) . graf(n . span(tag(gTxt('name'), 'label', array('for' => 'login_name')), array('class' => 'txp-label')) . n . span(fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), array('class' => 'txp-value')), array('class' => 'login-name')) . graf(n . span(tag(gTxt('password'), 'label', array('for' => 'login_password')), array('class' => 'txp-label')) . n . span(fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password'), array('class' => 'txp-value')), array('class' => 'login-password')) . graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . tag(gTxt('stay_logged_in'), 'label', array('for' => 'login_stay')) . popHelp('remember_login') . n, array('class' => 'login-stay')) . graf(fInput('submit', '', gTxt('log_in_button'), 'publish') . n) . graf(href(gTxt('password_forgotten'), '?reset=1'), array('class' => 'login-forgot'));
if (gps('event')) {
$out[] = eInput(gps('event'));
}
}
echo form(tag(join('', $out), 'section', array('role' => 'region', 'class' => 'txp-login', 'aria-labelledby' => 'txp-login-heading')), '', '', 'post', '', '', 'login_form') . script_js('textpattern.textarray = ' . json_encode($textarray_script)) . n . '</main><!-- /txp-body -->' . n . '</body>' . n . '</html>';
exit(0);
}
示例3: section_list
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();
}
示例4: doLoginForm
function doLoginForm($message)
{
include txpath . '/lib/txplib_head.php';
pagetop(gTxt('login'), $message);
$stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
$reset = gps('reset');
$name = join(',', array_slice(explode(',', cs('txp_login')), 0, -1));
echo n . '<div id="login_container" class="txp-container">';
echo form('<div class="txp-login">' . n . hed(gTxt($reset ? 'password_reset' : 'login_to_textpattern'), 2) . n . graf('<span class="login-label"><label for="login_name">' . gTxt('name') . '</label></span>' . n . '<span class="login-value">' . fInput('text', 'p_userid', $name, '', '', '', INPUT_REGULAR, '', 'login_name') . '</span>', ' class="login-name"') . ($reset ? '' : n . graf('<span class="login-label"><label for="login_password">' . gTxt('password') . '</label></span>' . n . '<span class="login-value">' . fInput('password', 'p_password', '', '', '', '', INPUT_REGULAR, '', 'login_password') . '</span>', ' class="login-password"')) . ($reset ? '' : graf(checkbox('stay', 1, $stay, '', 'login_stay') . n . '<label for="login_stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login'), ' class="login-stay"')) . ($reset ? n . hInput('p_reset', 1) : '') . n . graf(fInput('submit', '', gTxt($reset ? 'password_reset_button' : 'log_in_button'), 'publish')) . n . ($reset ? graf('<a href="index.php">' . gTxt('back_to_login') . '</a>', ' class="login-return"') : graf('<a href="?reset=1">' . gTxt('password_forgotten') . '</a>', ' class="login-forgot"')) . (gps('event') ? eInput(gps('event')) : '') . '</div>', '', '', 'post', '', '', 'login_form') . '</div>' . n . script_js(<<<EOSCR
// Focus on either username or password when empty
\$(document).ready(
\tfunction() {
\t\tvar has_name = \$("#login_name").val().length;
\t\tvar password_box = \$("#login_password").val();
\t\tvar has_password = (password_box) ? password_box.length : 0;
\t\tif (!has_name) {
\t\t\t\$("#login_name").focus();
\t\t} else if (!has_password) {
\t\t \t\$("#login_password").focus();
\t\t}
\t}
);
EOSCR
) . n . '</div><!-- /txp-body -->' . n . '</body>' . n . '</html>';
exit(0);
}
示例5: doLoginForm
function doLoginForm($message)
{
global $txpcfg;
include $txpcfg['txpath'] . '/lib/txplib_head.php';
pagetop('log in');
echo form(startTable('edit') . tr(td() . td(graf($message))) . tr(fLabelCell('name') . fInputCell('p_userid')) . tr(fLabelCell('password') . td(fInput('password', 'p_password', '', 'edit'))) . tr(td() . td(graf(checkbox('stay', 1, 1) . gTxt('stay_logged_in') . popHelp('remember_login')))) . tr(fLabelCell('') . td(fInput('submit', '', gTxt('log_in_button'), 'publish'))) . endTable());
exit("</div></body></html>");
}
示例6: doLoginForm
function doLoginForm($message)
{
global $txpcfg;
include txpath . '/lib/txplib_head.php';
pagetop(gTxt('login'));
$stay = !(cs('txp_nostay') == 1);
echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', '', 1, '', '', 'name')) . n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password'))) . n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login')))) . n . n . tr(n . td() . td(fInput('submit', '', gTxt('log_in_button'), 'publish', '', '', '', 4))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</div>' . n . n . '</body>' . n . '</html>';
exit(0);
}
示例7: getDbInfo
function getDbInfo()
{
$temp_txpath = dirname(__FILE__);
$temp_doc_root = $_SERVER['DOCUMENT_ROOT'];
echo '<form action="setup.php" method="post">', '<table id="setup" cellpadding="0" cellspacing="0" border="0">', tr(tda(hed('Welcome to Textpattern', 3) . graf('Inevitably, we need a few details.', ' style="margin-bottom:3em"') . hed('MySQL', 3) . graf('Note that the database you specify must exist;
Textpattern won’t create it for you.'), ' width="400" height="50" colspan="4", align="left"')), tr(fLabelCell('MySQL login') . fInputCell('duser', '', 1) . fLabelCell('MySQL password') . fInputCell('dpass', '', 2)), tr(fLabelCell('MySQL server') . fInputCell('dhost', '', 3) . fLabelCell('MySQL database') . fInputCell('ddb', '', 4)), tr(fLabelCell('Table prefix') . fInputCell('dprefix', '', 5) . tdcs(small('(Use ONLY for multiple installations in one database)'), 2)), tr(tdcs(' ', 4)), tr(tdcs(hed('Site Paths', 3) . graf('Please confirm the following paths to your site root and to the Textpattern directory.'), 4)), tr(fLabelCell('Full path to server\'s web root') . tdcs(fInput('text', 'doc_root', $temp_doc_root, 'edit', '', '', 40) . popHelp('doc_root'), 3)), tr(fLabelCell('Full path to Textpattern') . tdcs(fInput('text', 'txpath', $temp_txpath, 'edit', '', '', 40) . popHelp('full_path'), 3));
echo tr(td() . td(fInput('submit', 'Submit', 'Next', 'publish')) . td() . td());
echo endTable(), sInput('printConfig'), '</form>';
}
示例8: doLoginForm
function doLoginForm($message)
{
global $txpcfg;
include txpath . '/lib/txplib_head.php';
pagetop(gTxt('login'));
$stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
$reset = gps('reset');
list($name) = split(',', cs('txp_login'));
echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', $name, 1, '', '', 'name')) . ($reset ? '' : n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password')))) . ($reset ? '' : n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login'))))) . n . n . tr(n . td() . td(($reset ? hInput('p_reset', 1) : '') . fInput('submit', '', gTxt($reset ? 'password_reset_button' : 'log_in_button'), 'publish', '', '', '', 4) . ($reset ? '' : graf('<a href="?reset=1">' . gTxt('password_forgotten') . '</a>')))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</body>' . n . '</html>';
exit(0);
}
示例9: sec_section_list
function sec_section_list($message = '')
{
global $wlink;
pagetop(gTxt('sections'), $message);
$default = safe_row('page, css', 'txp_section', "name = 'default'");
$pages = safe_column('name', 'txp_page', "1 = 1");
$styles = safe_column('name', 'txp_css', "1 = 1");
echo n . n . startTable('list') . n . n . tr(tda(n . n . hed(gTxt('section_head') . sp . popHelp('section_category'), 1) . n . n . form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('create'), 'smallerbox') . eInput('section') . sInput('section_create')), ' colspan="3"')) . n . n . tr(td(gTxt('default')) . td(form('<table>' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $default['page']) . sp . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $default['css']) . sp . popHelp('section_uses_css'), '', 'noline')) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'default'), ' colspan="2" class="noline"')) . endTable())) . td());
$rs = safe_rows_start('*', 'txp_section', "name != 'default' order by name");
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
echo n . n . tr(n . td($name) . n . td(form('<table>' . n . n . tr(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20)) . n . n . tr(fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20)) . n . n . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $page) . sp . popHelp('section_uses_page'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $css) . sp . popHelp('section_uses_css'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('selected_by_default')) . td(yesnoradio('is_default', $is_default, '', $name) . sp . popHelp('section_is_default'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('on_front_page')) . td(yesnoradio('on_frontpage', $on_frontpage, '', $name) . sp . popHelp('section_on_frontpage'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('syndicate')) . td(yesnoradio('in_rss', $in_rss, '', $name) . sp . popHelp('section_syndicate'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('include_in_search')) . td(yesnoradio('searchable', $searchable, '', $name) . sp . popHelp('section_searchable'), '', 'noline')) . n . n . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('old_name', $name), ' colspan="2" class="noline"')) . endTable(), '', '', 'post', '', 'section-' . $name)) . td(dLink('section', 'section_delete', 'name', $name, '', 'type', 'section')), " id=\"section-{$name}\"");
}
}
echo n . n . endTable();
}
示例10: sec_section_list
function sec_section_list($message = '')
{
global $wlink;
pagetop(gTxt('sections'), $message);
$default = safe_row('page, css', 'txp_section', "name = 'default'");
$home = safe_row('page, css', 'txp_section', "name = 'home'");
$pages = safe_column('name', 'txp_page', "1 = 1");
$styles = safe_column('name', 'txp_css', "1 = 1");
echo n . n . startTable('list') . n . n . tr(tda(n . n . hed(gTxt('section_head') . sp . popHelp('section_category'), 1) . n . n . form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('create'), 'smallerbox') . eInput('section') . sInput('section_create')), ' colspan="3"')) . n . n . tr(tda(gTxt('home'), ' onclick="toggleDisplay(\'section_home\'); return false;"') . td(form('<table id="section_home">' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $home['page']) . sp . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $home['css']) . sp . popHelp('section_uses_css'), '', 'noline')) . pluggable_ui('section_ui', 'extend_detail_form', '', $home) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'home'), ' colspan="2" class="noline"')) . endTable())) . td()) . n . n . tr(tda(gTxt('default'), ' onclick="toggleDisplay(\'section_default\'); return false;"') . td(form('<table id="section_default">' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $default['page']) . sp . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $default['css']) . sp . popHelp('section_uses_css'), '', 'noline')) . pluggable_ui('section_ui', 'extend_detail_form', '', $default) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'default'), ' colspan="2" class="noline"')) . endTable())) . td());
$rs = safe_rows_start('*', 'txp_section', "name != 'default' AND name != 'home' order by name");
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
echo n . n . tr(n . tda($name, ' onclick="toggleDisplay(\'section_' . $name . '\'); return false;"') . n . td(form('<table id="section_' . $name . '">' . n . n . tr(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20)) . n . n . tr(fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20)) . n . n . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $page) . sp . popHelp('section_uses_page'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $css) . sp . popHelp('section_uses_css'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('selected_by_default')) . td(yesnoradio('is_default', $is_default, '', $name) . sp . popHelp('section_is_default'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('on_front_page')) . td(yesnoradio('on_frontpage', $on_frontpage, '', $name) . sp . popHelp('section_on_frontpage'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('syndicate')) . td(yesnoradio('in_rss', $in_rss, '', $name) . sp . popHelp('section_syndicate'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('include_in_search')) . td(yesnoradio('searchable', $searchable, '', $name) . sp . popHelp('section_searchable'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('section_descr') . ':') . fTextCell('descr', $descr, 1, 4, 20)) . n . n . tr(fLabelCell(gTxt('section_metakey') . ':') . fInputCell('metakey', $metakey, 1, 20)) . n . n . tr(fLabelCell(gTxt('section_metadesc') . ':') . fTextCell('metadesc', $metadesc, 1, 4, 20)) . pluggable_ui('section_ui', 'extend_detail_form', '', $a) . n . n . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('old_name', $name), ' colspan="2" class="noline"')) . endTable(), '', '', 'post', '', 'section-' . $name)) . td(dLink('section', 'section_delete', 'name', $name, '', 'type', 'section')), " id=\"section-{$name}\" class=\"jsection\" ");
}
}
echo n . n . endTable();
}
示例11: getDbInfo
function getDbInfo()
{
$lang = isPost('lang');
$GLOBALS['textarray'] = setup_load_lang($lang);
@(include './config.php');
if (!empty($txpcfg['db'])) {
exit(graf(gTxt('already_installed')));
}
$temp_txpath = dirname(__FILE__);
if (@$_SERVER['SCRIPT_NAME'] && (@$_SERVER['SERVER_NAME'] || @$_SERVER['HTTP_HOST'])) {
$guess_siteurl = @$_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
$guess_siteurl .= rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), '/');
} else {
$guess_siteurl = 'mysite.com';
}
echo '<form action="setup.php" method="post">', '<table id="setup" cellpadding="0" cellspacing="0" border="0">', tr(tda(hed(gTxt('welcome_to_textpattern'), 3) . graf(gTxt('need_details'), ' style="margin-bottom:3em"') . hed('MySQL', 3) . graf(gTxt('db_must_exist')), ' width="400" height="50" colspan="4" align="left"')), tr(fLabelCell(gTxt('mysql_login')) . fInputCell('duser', '', 1) . fLabelCell(gTxt('mysql_password')) . fInputCell('dpass', '', 2)), tr(fLabelCell(gTxt('mysql_server')) . fInputCell('dhost', '', 3) . fLabelCell(gTxt('mysql_database')) . fInputCell('ddb', '', 4)), tr(fLabelCell(gTxt('table_prefix')) . fInputCell('dprefix', '', 5) . tdcs(small(gTxt('prefix_warning')), 2)), tr(tdcs(' ', 4)), tr(tdcs(hed(gTxt('site_path'), 3) . graf(gTxt('confirm_site_path')), 4)), tr(fLabelCell(gTxt('full_path_to_txp')) . tdcs(fInput('text', 'txpath', $temp_txpath, 'edit', '', '', 40) . popHelp('full_path'), 3)), tr(tdcs(' ', 4)), tr(tdcs(hed(gTxt('site_url'), 3) . graf(gTxt('please_enter_url')), 4)), tr(fLabelCell('http://') . tdcs(fInput('text', 'siteurl', $guess_siteurl, 'edit', '', '', 40) . popHelp('site_url'), 3));
echo tr(td() . td(fInput('submit', 'Submit', gTxt('next'), 'publish')) . td() . td());
echo endTable(), hInput('lang', $lang), sInput('printConfig'), '</form>';
}
示例12: pCell
function pCell($item, $var, $format, $size = "", $nohelp = "")
{
$var = stripslashes($var);
$out = tda(gTxt($item), ' style="text-align:right;vertical-align:middle"');
switch ($format) {
case "radio":
$in = yesnoradio($item, $var);
break;
case "input":
$in = text_input($item, $var, $size);
break;
case "timeoffset":
$in = timeoffset_select($item, $var);
break;
case 'commentmode':
$in = commentmode($item, $var);
break;
case 'cases':
$in = cases($item, $var);
break;
case 'dateformats':
$in = dateformats($item, $var);
break;
case 'weeks':
$in = weeks($item, $var);
break;
case 'logging':
$in = logging($item, $var);
break;
case 'languages':
$in = languages($item, $var);
break;
case 'text':
$in = text($item, $var);
break;
case 'urlmodes':
$in = urlmodes($item, $var);
}
$out .= td($in);
$out .= $nohelp != 1 ? tda(popHelp($item), ' style="vertical-align:middle"') : td();
return tr($out);
}
示例13: sec_section_list
function sec_section_list($message = '')
{
global $wlink, $event;
pagetop(gTxt('sections'), $message);
$default = safe_row('page, css', 'txp_section', "name = 'default'");
$pages = safe_column('name', 'txp_page', "1 = 1");
$styles = safe_column('name', 'txp_css', "1 = 1");
echo n . '<div id="' . $event . '_container" class="txp-container txp-list">';
echo n . n . startTable('list') . n . n . tr(tda(n . n . hed(gTxt('section_head') . sp . popHelp('section_category'), 2) . n . '<div id="' . $event . '_control" class="txp-control-panel">' . n . n . form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('create'), 'smallerbox') . eInput('section') . sInput('section_create'), '', '', 'post', 'edit-form', '', 'section_create') . n . '</div>', ' colspan="3"')) . n . n . tr(td(gTxt('default'), '', 'label') . td(form('<table>' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $default['page']) . sp . popHelp('section_uses_page'), '', 'noline'), ' class="uses-page"') . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $default['css']) . sp . popHelp('section_uses_css'), '', 'noline'), ' class="uses-style"') . pluggable_ui('section_ui', 'extend_detail_form', '', $default) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'default'), ' colspan="2" class="noline"')) . endTable())) . td(), ' class="section default"');
$rs = safe_rows_start('*', 'txp_section', "name != 'default' order by name");
if ($rs) {
$ctr = 1;
while ($a = nextRow($rs)) {
extract($a);
echo n . n . tr(n . td($name, '', 'label') . n . td(form('<table>' . n . n . tr(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20), ' class="name"') . n . n . tr(fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20), ' class="title"') . n . n . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $page) . sp . popHelp('section_uses_page'), '', 'noline'), ' class="uses-page"') . n . n . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $css) . sp . popHelp('section_uses_css'), '', 'noline'), ' class="uses-style"') . n . n . tr(fLabelCell(gTxt('selected_by_default')) . td(yesnoradio('is_default', $is_default, '', $name) . sp . popHelp('section_is_default'), '', 'noline'), ' class="option is-default"') . n . n . tr(fLabelCell(gTxt('on_front_page')) . td(yesnoradio('on_frontpage', $on_frontpage, '', $name) . sp . popHelp('section_on_frontpage'), '', 'noline'), ' class="option on-frontpage"') . n . n . tr(fLabelCell(gTxt('syndicate')) . td(yesnoradio('in_rss', $in_rss, '', $name) . sp . popHelp('section_syndicate'), '', 'noline'), ' class="option in-rss"') . n . n . tr(fLabelCell(gTxt('include_in_search')) . td(yesnoradio('searchable', $searchable, '', $name) . sp . popHelp('section_searchable'), '', 'noline'), ' class="option is-searchable"') . pluggable_ui('section_ui', 'extend_detail_form', '', $a) . n . n . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('old_name', $name), ' colspan="2" class="noline"')) . endTable(), '', '', 'post', '', 'section-' . $name), '', 'main') . td(dLink('section', 'section_delete', 'name', $name, '', 'type', 'section'), '', 'actions'), ' id="section-' . $name . '" class="section ' . ($ctr % 2 == 0 ? 'even' : 'odd') . '"');
$ctr++;
}
}
echo n . n . endTable() . '</div>';
}
示例14: getDbInfo
function getDbInfo()
{
$GLOBALS['textarray'] = setup_load_lang(ps('lang'));
@(include txpath . '/config.php');
if (!empty($txpcfg['db'])) {
exit(graf(gTxt('already_installed', array('{txpath}' => txpath))));
}
if (@$_SERVER['SCRIPT_NAME'] && (@$_SERVER['SERVER_NAME'] || @$_SERVER['HTTP_HOST'])) {
$guess_siteurl = @$_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
$guess_siteurl .= $GLOBALS['rel_siteurl'];
} else {
$guess_siteurl = 'mysite.com';
}
echo '<form action="' . $GLOBALS['rel_siteurl'] . '/textpattern/setup/index.php" method="post">', '<table id="setup" cellpadding="0" cellspacing="0" border="0">', tr(tda(hed(gTxt('welcome_to_textpattern'), 3) . graf(gTxt('need_details'), ' style="margin-bottom:3em"') . hed('MySQL', 3) . graf(gTxt('db_must_exist')), ' width="400" height="50" colspan="4" align="left"')), tr(fLabelCell(gTxt('mysql_login')) . fInputCell('duser', '', 1) . fLabelCell(gTxt('mysql_password')) . fInputCell('dpass', '', 2)), tr(fLabelCell(gTxt('mysql_server')) . fInputCell('dhost', 'localhost', 3) . fLabelCell(gTxt('mysql_database')) . fInputCell('ddb', '', 4)), tr(fLabelCell(gTxt('table_prefix')) . fInputCell('dprefix', '', 5) . tdcs(small(gTxt('prefix_warning')), 2)), tr(tdcs(' ', 4)), tr(tdcs(hed(gTxt('site_url'), 3) . graf(gTxt('please_enter_url')), 4)), tr(fLabelCell('http://') . tdcs(fInput('text', 'siteurl', $guess_siteurl, 'edit', '', '', 40) . popHelp('siteurl'), 3));
if (!is_callable('mail')) {
echo tr(tdcs(gTxt('warn_mail_unavailable'), 3, null, '" style="color:red;text-align:center'));
}
echo tr(td() . td(fInput('submit', 'Submit', gTxt('next'), 'publish')) . td() . td());
echo endTable(), hInput('lang', LANG), sInput('printConfig'), '</form>';
}
示例15: form_edit
function form_edit($message = '')
{
global $step;
pagetop(gTxt('edit_forms'), $message);
extract(gpsa(array('Form', 'name', 'type')));
if ($step == 'form_create') {
$Form = '';
$name = '';
$type = '';
$inputs = fInput('submit', 'savenew', gTxt('save_new'), 'publish') . eInput("form") . sInput('form_save');
} else {
$name = (!$name or $step == 'form_delete') ? 'default' : $name;
$rs = safe_row("*", "txp_form", "name='{$name}'");
if ($rs) {
extract($rs);
$inputs = fInput('submit', 'save', gTxt('save'), 'publish') . eInput("form") . sInput('form_save') . hInput('oldname', $name);
}
}
$out = startTable('edit') . tr(tdtl(hed(gTxt('useful_tags'), 2) . graf(gTxt('articles') . sp . popHelp('form_place_article') . br . popTagLinks('article')) . graf(gTxt('links') . sp . popHelp('form_place_link') . br . popTagLinks('link')) . graf(gTxt('displayed_comments') . sp . popHelp('form_place_comment') . br . popTagLinks('comment')) . graf(gTxt('comment_form') . sp . popHelp('form_place_input') . br . popTagLinks('comment_form')) . graf(gTxt('search_input_form') . sp . popHelp('form_place_search_input') . br . popTagLinks('search_input')) . graf(gTxt('search_results_form') . sp . popHelp('form_place_search_results') . br . popTagLinks('search_result')) . graf(tag('<strong>' . gTxt('file_download_tags') . '</strong>', 'a', ' href="#" onclick="toggleDisplay(\'downloadtags\');"') . sp . popHelp('form_file_download_tags')) . graf(popTagLinks('file_download'), ' style="display:none;" id="downloadtags"')) . tdtl('<form action="index.php" method="post">' . input_textarea($Form) . graf(gTxt('form_name') . br . fInput('text', 'name', $name, 'edit', '', '', 15)) . graf(gTxt('form_type') . br . formtypes($type)) . graf(gTxt('only_articles_can_be_previewed')) . fInput('submit', 'preview', gTxt('preview'), 'smallbox') . graf($inputs) . '</form>') . tdtl(form_list($name))) . endTable();
echo $out;
}