本文整理汇总了PHP中strong函数的典型用法代码示例。如果您正苦于以下问题:PHP strong函数的具体用法?PHP strong怎么用?PHP strong使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strong函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: css_edit_raw
function css_edit_raw()
{
global $event, $step;
$default_name = safe_field('css', 'txp_section', "name = 'default'");
extract(gpsa(array('name', 'newname', 'copy', 'savenew')));
if ($step == 'css_delete' || empty($name) && $step != 'pour' && !$savenew) {
$name = $default_name;
} elseif (($copy || $savenew) && trim(preg_replace('/[<>&"\']/', '', $newname))) {
$name = $newname;
}
if (empty($name)) {
$buttons = '<div class="edit-title">' . gTxt('name_for_this_style') . ': ' . fInput('text', 'newname', '', 'edit', '', '', 20) . hInput('savenew', 'savenew') . '</div>';
$thecss = gps('css');
} else {
$buttons = '<div class="edit-title">' . gTxt('you_are_editing_css') . sp . strong(htmlspecialchars($name)) . '</div>';
$thecss = fetch("css", 'txp_css', 'name', $name);
}
if (!empty($name)) {
$copy = '<span class="copy-as"><label for="copy-css">' . gTxt('copy_css_as') . '</label>' . sp . fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-css') . sp . fInput('submit', 'copy', gTxt('copy'), 'smallerbox') . '</span>';
} else {
$copy = '';
}
$right = '<div id="content_switcher">' . hed(gTxt('all_stylesheets'), 2) . graf(sLink('css', 'pour', gTxt('create_new_css')), ' class="action-create smallerbox"') . css_list($name, $default_name) . '</div>';
echo '<div id="' . $event . '_container" class="txp-container txp-edit">' . startTable('edit') . tr(td(form('<div id="main_content">' . $buttons . '<textarea id="css" class="code" name="css" cols="78" rows="32">' . htmlspecialchars($thecss) . '</textarea>' . br . fInput('submit', '', gTxt('save'), 'publish') . eInput('css') . sInput('css_save') . hInput('name', $name) . $copy . '</div>', '', '', 'post', 'edit-form', '', 'style_form'), '', 'column') . tdtl($right, ' class="column"')) . endTable() . '</div>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:25,代码来源:txp_css.php
示例2: database
/**
* database function.
*
* @access public
* @return void
*/
public function database()
{
$this->output->enable_profiler(true);
$this->load->database();
$this->load->dbutil();
$this->load->dbforge();
$data['title'] = $this->system_model->get('app_name');
$data['breadcrumbs'] = array(array('data' => anchor('/', $this->system_model->get('app_name')), 'mode' => 'unavailable'), array('data' => anchor('install', ucfirst(lang('install'))), 'mode' => 'unavailable'), array('data' => anchor('install/database', ucfirst(lang('install') . ' ' . lang('database'))), 'mode' => 'current'));
$html = heading(ucfirst(lang('install')) . ' ' . lang('database'), 1);
$current = $this->migration->current();
if (is_null($current)) {
$html .= div($this->migration->error_string(), 'alert-box error');
} else {
$html .= div('Klubb database version: ' . $current, 'alert-box success');
}
$tables = $this->db->list_tables();
foreach ($tables as $table) {
$fields = $this->db->list_fields($table);
array_unshift($fields, strong('Fält:'));
$fields = ul($fields, array('class' => 'inline-list'));
$html .= div(heading('Tabell: ' . $table, 4) . $fields, 'radius panel');
}
$data['html'] = $html;
$this->system_model->view('template', $data);
}
开发者ID:nyfagel,项目名称:klubb,代码行数:31,代码来源:install.php
示例3: 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();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:25,代码来源:txp_section.php
示例4: messenger
function messenger($thing, $thething = '', $action = '')
{
// $thing[0]: message text
// $thing[1]: message type, defaults to "success" unless empty or a different flag is set
if ($thing === '') {
return '';
}
if (!is_array($thing) || !isset($thing[1])) {
$thing = array($thing, 0);
}
switch ($thing[1]) {
case E_ERROR:
$class = 'error';
break;
case E_WARNING:
$class = 'warning';
break;
default:
$class = 'success';
break;
}
$html = "<span id='message' class='{$class}'>" . gTxt($thing[0]) . ($thething !== '' ? ' ' . strong($thething) : '') . ($action !== '' ? ' ' . gTxt($action) : '') . '</span>';
// Try to inject $html into the message pane no matter when messenger()'s output is printed
$js = addslashes($html);
$js = <<<EOS
\t\t\$(document).ready( function(){
\t \t\t\$("#messagepane").html("{$js}");
\t\t\t\$('#messagepane #message.error').fadeOut(800).fadeIn(800);
\t\t\t\$('#messagepane #message.warning').fadeOut(800).fadeIn(800);
\t\t} )
EOS;
return script_js(str_replace('</', '<\\/', $js), $html);
}
开发者ID:joebushi,项目名称:textpattern,代码行数:33,代码来源:classic.php
示例5: page_edit_form
function page_edit_form($name)
{
global $step;
$html = safe_field('user_html', 'txp_page', "name='" . doSlash($name) . "'");
$out[] = '<p>' . gTxt('you_are_editing_page') . sp . strong($name) . br . '<textarea id="html" class="code" name="html" cols="84" rows="36">' . htmlspecialchars($html) . '</textarea>' . br . n . fInput('submit', 'save', gTxt('save'), 'publish') . n . eInput('page') . n . sInput('page_save') . n . hInput('name', $name);
$out[] = n . '<label for="copy-page">' . gTxt('copy_page_as') . '</label>' . sp . n . fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-page') . n . fInput('submit', 'copy', gTxt('copy'), 'smallerbox') . '</p>';
return form(join('', $out));
}
开发者ID:nope,项目名称:Tipattern,代码行数:8,代码来源:txp_page.php
示例6: page_edit
function page_edit($message = '')
{
global $step;
pagetop(gTxt('edit_pages'), $message);
extract(gpsa(array('name', 'div')));
$name = (!$name or $step == 'page_delete') ? 'default' : $name;
$divline = $step == "div_edit" ? graf(gTxt('you_are_editing_div') . sp . strong($div)) : '';
echo startTable('edit') . tr(td() . td(graf(gTxt('you_are_editing_page') . sp . strong($name)) . $divline) . td()) . tr(tda(hed(gTxt('useful_tags'), 2) . graf(gTxt('page_article_hed') . br . small(taglinks('page_article')), ' class="column"') . graf(gTxt('page_article_nav_hed') . br . small(taglinks('page_article_nav')), ' class="column"') . graf(gTxt('page_nav_hed') . br . small(taglinks('page_nav')), ' class="column"') . graf(gTxt('page_xml_hed') . br . small(taglinks('page_xml')), ' class="column"') . graf(gTxt('page_misc_hed') . br . small(taglinks('page_misc')), ' class="column"') . graf(gTxt('page_file_hed') . br . small(taglinks('page_file')), ' class="column"')) . tda(page_edit_form($name), ' class="column"') . tda(hed(gTxt('all_pages'), 2) . page_list($name), ' class="column"')) . endTable();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:9,代码来源:txp_page.php
示例7: printConfig
function printConfig()
{
$carry = enumPostItems('ddb', 'duser', 'dpass', 'dhost', 'dprefix', 'txprefix', 'txpath', 'doc_root', 'ftphost', 'ftplogin', 'ftpass', 'ftpath');
$carry['txpath'] = preg_replace("/^(.*)\\/\$/", "\$1", $carry['txpath']);
$carry['doc_root'] = preg_replace("/^(.*)\\/\$/", "\$1", $carry['doc_root']);
$carry['ftpath'] = preg_replace("/^(.*)\\/\$/", "\$1", $carry['ftpath']);
extract($carry);
echo graf("Checking database connection...");
if (!($mylink = mysql_connect($dhost, $duser, $dpass))) {
exit(graf("Can't connect to the database with the values entered."));
}
echo graf('Connected.');
if (!($mydb = mysql_select_db($ddb))) {
exit(graf("Database " . strong($ddb) . " doesn't exist. Please create it or choose another."));
}
echo graf("Using database " . strong($ddb)), graf(strong('Before you proceed') . ', open <code>config.php</code> in the <code>/textpattern/</code> directory and replace its contents with the following:'), '<textarea style="width:400px;height:200px" name="config" rows="1" cols="1">', makeConfig($carry), '</textarea>', '<form action="setup.php" method="post">', fInput('submit', 'submit', 'I did it', 'smallbox'), sInput('getTxpLogin'), hInput('carry', postEncode($carry)), '</form>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:17,代码来源:setup.php
示例8: page_edit_form
function page_edit_form($name)
{
global $step;
if ($step == 'div_edit') {
list($html_array, $html, $start_pos, $stop_pos) = extract_div();
$html_array = serialize($html_array);
$outstep = 'div_save';
} else {
$html = safe_field('user_html', 'txp_page', "name='" . doSlash($name) . "'");
$outstep = 'page_save';
}
$divline = $step == 'div_edit' ? graf(gTxt('you_are_editing_div') . sp . strong($div)) : '';
$out[] = '<p>' . gTxt('you_are_editing_page') . sp . strong($name) . $divline . br . '<textarea id="html" class="code" name="html" cols="84" rows="36">' . htmlspecialchars($html) . '</textarea>' . br . n . fInput('submit', 'save', gTxt('save'), 'publish') . n . eInput('page') . n . sInput($outstep) . n . hInput('name', $name);
if ($step == 'div_edit') {
$out[] = n . hInput('html_array', $html_array) . n . hInput('start_pos', $start_pos) . n . hInput('stop_pos', $stop_pos) . n . hInput('name', $name);
} else {
$out[] = n . '<label for="copy-page">' . gTxt('copy_page_as') . '</label>' . sp . n . fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-page') . n . fInput('submit', 'copy', gTxt('copy'), 'smallerbox') . '</p>';
}
return form(join('', $out));
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:20,代码来源:txp_page.php
示例9: page_edit_form
function page_edit_form($name)
{
global $step;
if ($name) {
$html = safe_field('user_html', 'txp_page', "name='" . doSlash($name) . "'");
} else {
$html = gps('html');
}
if (empty($name)) {
$buttons = '<div class="edit-title">' . gTxt('name_for_this_page') . ': ' . fInput('text', 'newname', '', '', '', '', INPUT_REGULAR) . hInput('savenew', 'savenew') . '</div>';
} else {
$buttons = '<div class="edit-title">' . gTxt('you_are_editing_page') . sp . strong(txpspecialchars($name)) . '</div>';
}
$out[] = '<div id="main_content">' . $buttons . '<textarea id="html" class="code" name="html" cols="' . INPUT_LARGE . '" rows="' . INPUT_REGULAR . '">' . txpspecialchars($html) . '</textarea>' . n . '<p>' . fInput('submit', 'save', gTxt('save'), 'publish') . n . eInput('page') . n . sInput('page_save') . n . hInput('name', $name) . '</p>';
if (!empty($name)) {
$out[] = n . '<p class="copy-as"><label for="copy-page">' . gTxt('copy_page_as') . '</label>' . n . fInput('text', 'newname', '', 'input-medium', '', '', INPUT_MEDIUM, '', 'copy-page') . n . fInput('submit', 'copy', gTxt('copy')) . '</p>';
}
$out[] = '</div>';
return form(join('', $out), '', '', 'post', '', '', 'page_form');
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:20,代码来源:txp_page.php
示例10: page_edit_form
function page_edit_form($name)
{
global $step;
if ($name) {
$html = safe_field('user_html', 'txp_page', "name='" . doSlash($name) . "'");
} else {
$html = gps('html');
}
if (empty($name)) {
$buttons = '<div class="edit-title">' . gTxt('name_for_this_page') . ': ' . fInput('text', 'newname', '', 'edit', '', '', 20) . hInput('savenew', 'savenew') . '</div>';
} else {
$buttons = '<div class="edit-title">' . gTxt('you_are_editing_page') . sp . strong(htmlspecialchars($name)) . '</div>';
}
$out[] = '<div id="main_content">' . $buttons . '<textarea id="html" class="code" name="html" cols="84" rows="36">' . htmlspecialchars($html) . '</textarea>' . br . n . fInput('submit', 'save', gTxt('save'), 'publish') . n . eInput('page') . n . sInput('page_save') . n . hInput('name', $name);
if (!empty($name)) {
$out[] = n . '<span class="copy-as"><label for="copy-page">' . gTxt('copy_page_as') . '</label>' . sp . n . fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-page') . n . fInput('submit', 'copy', gTxt('copy'), 'smallerbox') . '</span>';
}
$out[] = '</div>';
return form(join('', $out), '', '', 'post', '', '', 'page_form');
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:20,代码来源:txp_page.php
示例11: author_edit
function author_edit()
{
global $step, $txp_user;
require_privs('admin.edit');
pagetop(gTxt('tab_site_admin'), '');
$vars = array('user_id', 'name', 'RealName', 'email', 'privs');
$rs = array();
extract(gpsa($vars));
$is_edit = $user_id && $step == 'author_edit';
if ($is_edit) {
$user_id = assert_int($user_id);
$rs = safe_row('*', 'txp_users', "user_id = {$user_id}");
extract($rs);
}
$caption = gTxt($is_edit ? 'edit_author' : 'add_new_author');
echo form('<div class="txp-edit">' . n . hed($caption, 2) . n . inputLabel('login_name', $is_edit ? strong($name) : fInput('text', 'name', $name, '', '', '', INPUT_REGULAR, '', 'login_name'), $is_edit ? '' : 'login_name', $is_edit ? '' : 'add_new_author') . n . inputLabel('real_name', fInput('text', 'RealName', $RealName, '', '', '', INPUT_REGULAR, '', 'real_name'), 'real_name') . n . inputLabel('login_email', fInput('text', 'email', $email, '', '', '', INPUT_REGULAR, '', 'login_email'), 'email') . n . inputLabel('privileges', $txp_user != $name ? privs($privs) : hInput('privs', $privs) . strong(get_priv_level($privs)), $is_edit ? '' : 'privileges', 'about_privileges') . n . pluggable_ui('author_ui', 'extend_detail_form', '', $rs) . n . graf(fInput('submit', '', gTxt('save'), 'publish')) . eInput('admin') . ($user_id ? hInput('user_id', $user_id) . sInput('author_save') : sInput('author_save_new')) . '</div>', '', '', 'post', 'edit-form', '', 'user_edit');
}
开发者ID:balcides,项目名称:Cathartic_server,代码行数:17,代码来源:txp_admin.php
示例12: form_edit
function form_edit($message = '')
{
global $event, $step, $essential_forms;
pagetop(gTxt('edit_forms'), $message);
extract(gpsa(array('Form', 'name', 'type')));
$name = trim(preg_replace('/[<>&"\']/', '', $name));
if ($step == 'form_create') {
$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='" . doSlash($name) . "'");
extract($rs);
$inputs = fInput('submit', 'save', gTxt('save'), 'publish') . eInput("form") . sInput('form_save') . hInput('oldname', $name);
}
if (!in_array($name, $essential_forms)) {
$changename = graf(gTxt('form_name') . br . fInput('text', 'name', $name, 'edit', '', '', INPUT_REGULAR));
} else {
$changename = graf(gTxt('form_name') . br . tag($name, 'em') . hInput('name', $name));
}
// Generate the tagbuilder links
// Format of each entry is popTagLink -> array ( gTxt string, class/ID )
$tagbuild_items = array('article' => array('articles', 'article-tags'), 'link' => array('links', 'link-tags'), 'comment' => array('comments', 'comment-tags'), 'comment_details' => array('comment_details', 'comment-detail-tags'), 'comment_form' => array('comment_form', 'comment-form-tags'), 'search_result' => array('search_results_form', 'search-result-tags'), 'file_download' => array('file_download_tags', 'file-tags'), 'category' => array('category_tags', 'category-tags'), 'section' => array('section_tags', 'section-tags'));
$tagbuild_links = '';
foreach ($tagbuild_items as $tb => $item) {
$tagbuild_links .= '<div class="' . $item[1] . '">' . hed('<a href="#' . $item[1] . '">' . gTxt($item[0]) . '</a>', 3, ' class="lever' . (get_pref('pane_form_' . $item[1] . '_visible') ? ' expanded' : '') . '"') . '<div id="' . $item[1] . '" class="toggle on" style="display:' . (get_pref('pane_form_' . $item[1] . '_visible') ? 'block' : 'none') . '">' . popTagLinks($tb) . '</div></div>';
}
$out = '<h1 class="txp-heading">' . gTxt('tab_forms') . sp . popHelp('forms_overview') . '</h1>' . '<div id="' . $event . '_container" class="txp-container">' . startTable('', '', 'txp-columntable') . tr(tdtl('<div id="tagbuild_links">' . hed(gTxt('tagbuilder'), 2) . $tagbuild_links . '</div>', ' class="column"') . tdtl('<form action="index.php" method="post" id="form_form">' . '<div id="main_content">' . '<div class="edit-title">' . gTxt('you_are_editing_form') . sp . strong($name ? $name : gTxt('untitled')) . '</div>' . '<textarea id="form" class="code" name="Form" cols="' . INPUT_LARGE . '" rows="' . INPUT_REGULAR . '">' . txpspecialchars($Form) . '</textarea>' . $changename . graf(gTxt('form_type') . br . formtypes($type)) . (empty($type) ? graf(gTxt('only_articles_can_be_previewed')) : '') . (empty($type) || $type == 'article' ? fInput('submit', 'form_preview', gTxt('preview')) : '') . graf($inputs) . '</div>' . n . tInput() . n . '</form>', ' class="column"') . tdtl('<div id="content_switcher">' . hed(gTxt('all_forms'), 2) . form_list($name) . '</div>', ' class="column"')) . endTable() . '</div>';
echo $out;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:29,代码来源:txp_form.php
示例13: missing_section_file
function missing_section_file()
{
global $txpcfg;
pageTop('missing section placeholder');
$name = gps('name');
$out = array(startTable("edit"), tr(tda(graf(gTxt('section_warning_part1') . ' ' . strong($name) . ' ' . gTxt('section_warning_part2') . ' ' . $txpcfg['doc_root'] . ' ' . gTxt('section_warning_part3') . ':') . graf('<textarea cols="50" rows="7">' . file_snip($name) . '</textarea>') . graf(gTxt('section_warning_part4') . ' <code>.htaccess</code> ' . gTxt('section_warning_part5') . ' ' . $txpcfg['doc_root'] . ' ' . gTxt('section_warning_part6') . ':') . graf('<textarea cols="50" rows="4">' . htaccess_snip($name) . '</textarea>'), ' width="500px"')), endTable());
echo join('', $out);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:8,代码来源:txp_section.php
示例14: radio_list
function radio_list($name, $values, $current_val = '', $hilight_val = '')
{
// $values is an array of value => label pairs
foreach ($values as $k => $v) {
$id = $name . '-' . $k;
$out[] = n . t . '<li class="status-' . $k . ' ' . $v . ($hilight_val == $k ? ' active' : '') . '">' . radio($name, $k, $current_val == $k ? 1 : 0, $id) . '<label for="' . $id . '">' . ($hilight_val == $k ? strong($v) : $v) . '</label></li>';
}
return '<ul class="status plain-list">' . join('', $out) . n . '</ul>';
}
开发者ID:nope,项目名称:textpattern,代码行数:9,代码来源:txplib_forms.php
示例15: getTxpLogin
function getTxpLogin()
{
$carry = postDecode(ps('carry'));
extract($carry);
$GLOBALS['textarray'] = setup_load_lang($lang);
@(include txpath . '/config.php');
if (!isset($txpcfg) || $txpcfg['db'] != $ddb || $txpcfg['table_prefix'] != $dprefix) {
echo graf(strong(gTxt('before_you_proceed')) . ', ' . gTxt('create_config', array('{txpath}' => txpath))), '<textarea style="width:400px;height:200px" name="config" rows="1" cols="1">', makeConfig($carry), '</textarea>', '<form action="' . $GLOBALS['rel_siteurl'] . '/textpattern/setup/index.php" method="post">', fInput('submit', 'submit', gTxt('did_it'), 'smallbox'), sInput('getTxpLogin'), hInput('carry', postEncode($carry)), '</form>';
return;
}
echo '<form action="' . $GLOBALS['rel_siteurl'] . '/textpattern/setup/index.php" method="post">', startTable('edit'), tr(tda(graf(gTxt('thanks')) . graf(gTxt('about_to_create')), ' width="400" colspan="2" align="center"')), tr(fLabelCell(gTxt('your_full_name')) . fInputCell('RealName')), tr(fLabelCell(gTxt('setup_login')) . fInputCell('name')), tr(fLabelCell(gTxt('choose_password')) . fInputCell('pass')), tr(fLabelCell(gTxt('your_email')) . fInputCell('email')), tr(td() . td(fInput('submit', 'Submit', gTxt('next'), 'publish'))), endTable(), sInput('createTxp'), hInput('lang', htmlspecialchars($lang)), hInput('siteurl', htmlspecialchars($siteurl)), '</form>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:12,代码来源:index.php
示例16: load_plugins
function load_plugins($type = 0)
{
global $prefs, $plugins, $plugins_ver;
if (!is_array($plugins)) {
$plugins = array();
}
if (!empty($prefs['plugin_cache_dir'])) {
$dir = rtrim($prefs['plugin_cache_dir'], '/') . '/';
// in case it's a relative path
if (!is_dir($dir)) {
$dir = rtrim(realpath(txpath . '/' . $dir), '/') . '/';
}
$files = glob($dir . '*.php');
if ($files) {
natsort($files);
foreach ($files as $f) {
load_plugin(basename($f, '.php'));
}
}
}
$where = 'status = 1 AND type IN (' . ($type ? '1,3' : '0,1') . ')';
$rs = safe_rows("name, code, version", "txp_plugin", $where . ' order by load_order');
if ($rs) {
$old_error_handler = set_error_handler("pluginErrorHandler");
foreach ($rs as $a) {
if (!in_array($a['name'], $plugins)) {
$plugins[] = $a['name'];
$plugins_ver[$a['name']] = $a['version'];
$GLOBALS['txp_current_plugin'] = $a['name'];
$eval_ok = eval($a['code']);
if ($eval_ok === FALSE) {
echo gTxt('plugin_load_error_above') . strong($a['name']) . n . br;
}
unset($GLOBALS['txp_current_plugin']);
}
}
restore_error_handler();
}
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:39,代码来源:txplib_misc.php
示例17: get_language
function get_language()
{
global $prefs, $txpcfg, $textarray;
require_once txpath . '/lib/IXRClass.php';
$lang_code = gps('lang_code');
$client = new IXR_Client(RPC_SERVER);
// $client->debug = true;
@set_time_limit(90);
if (gps('force') == 'file' || !$client->query('tups.getLanguage', $prefs['blog_uid'], $lang_code)) {
if ((gps('force') == 'file' || gps('updating') !== '1') && install_language_from_file($lang_code)) {
if (defined('LANG')) {
$textarray = load_lang(LANG);
}
return list_languages(gTxt($lang_code) . sp . gTxt('updated'));
} else {
$install_langfile = gTxt('install_langfile', array('{url}' => strong('<a href="' . RPC_SERVER . '/lang/">' . RPC_SERVER . '/lang/</a>')));
if ($install_langfile == 'install_langfile') {
$install_langfile = 'To install new languages from file you can download them from <b><a href="' . RPC_SERVER . '/lang/">' . RPC_SERVER . '/lang/</a></b> and place them inside your ./textpattern/lang/ directory.';
}
pagetop(gTxt('installing_language'));
echo tag(gTxt('rpc_connect_error') . "<!--" . $client->getErrorCode() . ' ' . $client->getErrorMessage() . "-->", 'p', ' style="text-align:center;color:red;width:50%;margin: 2em auto"');
echo tag($install_langfile, 'p', ' style="text-align:center;width:50%;margin: 2em auto"');
}
} else {
$response = $client->getResponse();
$lang_struct = unserialize($response);
function install_lang_key(&$value, $key)
{
extract(gpsa(array('lang_code', 'updating')));
$exists = safe_field('name', 'txp_lang', "name='" . doSlash($value['name']) . "' AND lang='" . doSlash($lang_code) . "'");
$q = "name='" . doSlash($value['name']) . "', event='" . doSlash($value['event']) . "', data='" . doSlash($value['data']) . "', lastmod='" . doSlash(strftime('%Y%m%d%H%M%S', $value['uLastmod'])) . "'";
if ($exists) {
$value['ok'] = safe_update('txp_lang', $q, "lang='" . doSlash($lang_code) . "' AND name='" . doSlash($value['name']) . "'");
} else {
$value['ok'] = safe_insert('txp_lang', $q . ", lang='" . doSlash($lang_code) . "'");
}
}
array_walk($lang_struct, 'install_lang_key');
$size = count($lang_struct);
$errors = 0;
for ($i = 0; $i < $size; $i++) {
$errors += !$lang_struct[$i]['ok'];
}
if (defined('LANG')) {
$textarray = load_lang(LANG);
}
$msg = gTxt($lang_code) . sp . gTxt('updated');
if ($errors > 0) {
$msg .= sprintf(" (%s errors, %s ok)", $errors, $size - $errors);
}
return list_languages($msg);
}
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:53,代码来源:txp_prefs.php
示例18: list_languages
/**
* Generates a <table> of every language that Textpattern supports.
*
* If requested with HTTP POST parameter 'force' set anything other than 'file',
* outputs any errors in RPC server connection.
*
* @param string|array $message The activity message
*/
function list_languages($message = '')
{
require_once txpath . '/lib/IXRClass.php';
$active_lang = safe_field("val", 'txp_prefs', "name = 'language'");
$lang_form = tag(form(tag(gTxt('active_language'), 'label', array('for' => 'language')) . languages('language', $active_lang) . eInput('lang') . sInput('save_language')), 'div', array('class' => 'txp-control-panel'));
$client = new IXR_Client(RPC_SERVER);
// $client->debug = true;
$available_lang = array();
$rpc_connect = false;
$show_files = false;
// Get items from RPC.
@set_time_limit(90);
// TODO: 90 seconds: seriously?
if ($client->query('tups.listLanguages', get_pref('blog_uid'))) {
$rpc_connect = true;
$response = $client->getResponse();
foreach ($response as $language) {
$available_lang[$language['language']]['rpc_lastmod'] = gmmktime($language['lastmodified']->hour, $language['lastmodified']->minute, $language['lastmodified']->second, $language['lastmodified']->month, $language['lastmodified']->day, $language['lastmodified']->year);
}
} elseif (gps('force') != 'file') {
$msg = gTxt('rpc_connect_error') . "<!--" . $client->getErrorCode() . ' ' . $client->getErrorMessage() . "-->";
}
// Get items from Filesystem.
$files = get_lang_files();
if (is_array($files) && !empty($files)) {
foreach ($files as $file) {
if ($fp = @fopen(txpath . DS . 'lang' . DS . $file, 'r')) {
$name = preg_replace('/\\.(txt|textpack)$/i', '', $file);
$firstline = fgets($fp, 4069);
fclose($fp);
if (strpos($firstline, '#@version') !== false) {
@(list($fversion, $ftime) = explode(';', trim(substr($firstline, strpos($firstline, ' ', 1)))));
} else {
$fversion = $ftime = null;
}
$available_lang[$name]['file_note'] = isset($fversion) ? $fversion : 0;
$available_lang[$name]['file_lastmod'] = isset($ftime) ? $ftime : 0;
}
}
}
// Get installed items from the database.
// We need a value here for the language itself, not for each one of the rows.
$rows = safe_rows("lang, UNIX_TIMESTAMP(MAX(lastmod)) AS lastmod", 'txp_lang', "1 = 1 GROUP BY lang ORDER BY lastmod DESC");
$installed_lang = array();
foreach ($rows as $language) {
$available_lang[$language['lang']]['db_lastmod'] = $language['lastmod'];
if ($language['lang'] != $active_lang) {
$installed_lang[] = $language['lang'];
}
}
$list = '';
// Create the language table components.
foreach ($available_lang as $langname => $langdat) {
$file_updated = isset($langdat['db_lastmod']) && @$langdat['file_lastmod'] > $langdat['db_lastmod'];
$rpc_updated = @$langdat['rpc_lastmod'] > @$langdat['db_lastmod'];
$rpc_install = tda($rpc_updated ? strong(eLink('lang', 'get_language', 'lang_code', $langname, isset($langdat['db_lastmod']) ? gTxt('update') : gTxt('install'), 'updating', isset($langdat['db_lastmod']), '')) . n . span(safe_strftime('%d %b %Y %X', @$langdat['rpc_lastmod']), array('class' => 'date modified')) : (isset($langdat['rpc_lastmod']) ? gTxt('up_to_date') : '-') . (isset($langdat['db_lastmod']) ? n . span(safe_strftime('%d %b %Y %X', $langdat['db_lastmod']), array('class' => 'date modified')) : ''), isset($langdat['db_lastmod']) && $rpc_updated ? ' class="highlight lang-value"' : ' class="lang-value"');
$lang_file = tda(isset($langdat['file_lastmod']) ? strong(eLink('lang', 'get_language', 'lang_code', $langname, $file_updated ? gTxt('update') : gTxt('install'), 'force', 'file', '')) . n . span(safe_strftime(get_pref('archive_dateformat'), $langdat['file_lastmod']), array('class' => 'date ' . ($file_updated ? 'created' : 'modified'))) : '-', ' class="lang-value languages_detail' . (isset($langdat['db_lastmod']) && $rpc_updated ? ' highlight' : '') . '"');
$list .= tr(hCell(gTxt($langname), '', isset($langdat['db_lastmod']) && $rpc_updated ? ' class="highlight lang-label" scope="row"' : ' class="lang-label" scope="row"') . n . $rpc_install . n . $lang_file . tda(in_array($langname, $installed_lang) ? dLink('lang', 'remove_language', 'lang_code', $langname, 1) : '-', ' class="languages_detail' . (isset($langdat['db_lastmod']) && $rpc_updated ? ' highlight' : '') . '"')) . n;
}
// Output table and content.
pagetop(gTxt('tab_languages'), $message);
echo n . tag(hed(gTxt('tab_languages'), 1, array('class' => 'txp-heading')), 'div', array('class' => 'txp-layout-2col-cell-1')) . n . tag_start('div', array('class' => 'txp-layout-1col', 'id' => 'language_container'));
if (isset($msg) && $msg) {
echo graf('<span class="ui-icon ui-icon-closethick"></span> ' . $msg, array('class' => 'alert-block error'));
}
echo $lang_form, n . tag(toggle_box('languages_detail'), 'div', array('class' => 'txp-list-options')) . n . tag_start('div', array('class' => 'txp-listtables')) . n . tag_start('table', array('class' => 'txp-list')) . n . tag_start('thead') . tr(hCell(gTxt('language'), '', ' scope="col"') . hCell(gTxt('from_server') . popHelp('install_lang_from_server'), '', ' scope="col"') . hCell(gTxt('from_file') . popHelp('install_lang_from_file'), '', ' class="languages_detail" scope="col"') . hCell(gTxt('remove_lang') . popHelp('remove_lang'), '', ' class="languages_detail" scope="col"')) . n . tag_end('thead') . n . tag_start('tbody') . $list . n . tag_end('tbody') . n . tag_end('table') . n . tag_end('div') . hed(gTxt('install_from_textpack'), 2) . n . tag(form('<label for="textpack-install">' . gTxt('install_textpack') . '</label>' . popHelp('get_textpack') . n . '<textarea class="code" id="textpack-install" name="textpack" cols="' . INPUT_LARGE . '" rows="' . TEXTAREA_HEIGHT_SMALL . '" dir="ltr"></textarea>' . fInput('submit', 'install_new', gTxt('upload')) . eInput('lang') . sInput('get_textpack'), '', '', 'post', '', '', 'text_uploader'), 'div', array('class' => 'txp-control-panel')) . n . tag_end('div');
}
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:75,代码来源:txp_lang.php
示例19: css_edit_raw
function css_edit_raw()
{
global $step;
$name = gps('name');
$default_name = safe_field('css', 'txp_section', "name = 'default'");
$name = (!$name or $step == 'css_delete') ? $default_name : $name;
if (gps('copy') && trim(preg_replace('/[<>&"\']/', '', gps('newname')))) {
$name = gps('newname');
}
if ($step == 'pour') {
$buttons = gTxt('name_for_this_style') . ': ' . fInput('text', 'newname', '', 'edit', '', '', 20) . hInput('savenew', 'savenew');
$thecss = '';
} else {
$buttons = '';
$thecss = base64_decode(fetch("css", 'txp_css', 'name', $name));
}
if ($step != 'pour') {
$left = graf(gTxt('you_are_editing_css') . br . strong($name)) . graf(eLink('css', 'css_edit_form', 'name', $name, gTxt('edit_css_in_form'))) . graf(sLink('css', 'pour', gTxt('bulkload_existing_css')));
$copy = gTxt('copy_css_as') . sp . fInput('text', 'newname', '', 'edit') . sp . fInput('submit', 'copy', gTxt('copy'), 'smallerbox');
} else {
$left = ' ';
$copy = '';
}
$right = hed(gTxt('all_stylesheets'), 2) . css_list($name, $default_name);
echo startTable('edit') . tr(tdtl($left) . td(form(graf($buttons) . '<textarea id="css" class="code" name="css" cols="78" rows="32">' . htmlspecialchars($thecss) . '</textarea>' . br . fInput('submit', '', gTxt('save'), 'publish') . eInput('css') . sInput('css_save') . hInput('name', $name) . $copy)) . tdtl($right)) . endTable();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:26,代码来源:txp_css.php
示例20: setup_config_contents
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1218|2022-08-30
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1130|2022-08-17
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:938|2022-11-06
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1334|2022-08-18
-
微慕小程序专业版支持在文章的详情页跳转商品卡片和公众号文章卡片;不过这些跳转卡片
阅读:588|2022-07-18
-
微信小程序不知不觉都走过了三个年头。
从当初的一夜成名到今天火爆的市场占有率,微
阅读:608|2022-07-18
-
** REJECT ** DO NOT USE THIS CANDIDATE NUMBER. ConsultIDs: none. Reason: This ca
阅读:504|2022-07-08
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:484|2022-08-16
-
kubernetes-client/python: Official Python client library for kubernetes
阅读:582|2022-08-15
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:636|2022-11-06
|
请发表评论