本文整理汇总了PHP中span函数的典型用法代码示例。如果您正苦于以下问题:PHP span函数的具体用法?PHP span怎么用?PHP span使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了span函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wrap
/**
* @fn wrap($term)
* @short Wraps a string in a parent HTML element to add debug style selectors.
* @param term The string to be wrapped.
*/
private static function wrap($term)
{
if (!LOCALIZATION_DEBUG) {
return $term;
}
return span($term, array('class' => 'localization-debug'));
}
开发者ID:emeraldion,项目名称:creso,代码行数:12,代码来源:localization.php
示例2: __toString
/**
* @fn __toString
* @details Returns a string representation of the gate object.
*/
public function __toString()
{
$params = $this->params;
array_walk($params, create_function('&$val, $key', '$val = span("$key", array(\'class\' => \'code-array-key\')) . ' . 'span(\' => \', array(\'class\' => \'code-delimiter\')) . ' . 'span("\'$val\'", array(\'class\' => \'code-literal\'));'));
$params = empty($params) ? '' : implode(span(', ', array('class' => 'code-delimiter')), $params);
return span("{$this->controller}Controller", array('class' => 'code-class')) . span('::', array('class' => 'code-operator')) . span($this->action, array('class' => 'code-method')) . span('(', array('class' => 'code-delimiter')) . span($params, array('class' => 'code-method-params')) . span(')', array('class' => 'code-delimiter'));
}
开发者ID:emeraldion,项目名称:zelda,代码行数:11,代码来源:gate.php
示例3: to_html
/** Convert value to HTML parseable format
* @param mixed $value
* @return string
*/
public static function to_html(\System\Template\Renderer $ren, $value)
{
if (is_object($value) && method_exists($value, 'to_html')) {
return $value->to_html($ren);
}
if (is_array($value)) {
$content = array();
foreach ($value as $val) {
$content[] = li(self::to_html($ren, $val));
}
return ul('plain inline', $content);
}
if ($value instanceof \DateTime) {
return $ren->format_date($value, 'human');
}
if (gettype($value) == 'boolean') {
return span($value = $value ? 'yes' : 'no', $ren->trans($value));
}
if (gettype($value) == 'float') {
return number_format($value, 5);
}
if (gettype($value) == 'string') {
return htmlspecialchars_decode($value);
}
return $value;
}
开发者ID:just-paja,项目名称:fudjan,代码行数:30,代码来源:template.php
示例4: 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);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:34,代码来源:txp_auth.php
示例5: page_edit
/**
* The main Page editor panel.
*
* @param string|array $message The activity message
*/
function page_edit($message = '')
{
global $event, $step;
pagetop(gTxt('edit_pages'), $message);
extract(array_map('assert_string', gpsa(array('copy', 'save_error', 'savenew'))));
$name = sanitizeForPage(assert_string(gps('name')));
$newname = sanitizeForPage(assert_string(gps('newname')));
if ($step == 'page_delete' || empty($name) && $step != 'page_new' && !$savenew) {
$name = safe_field('page', 'txp_section', "name = 'default'");
} elseif ((($copy || $savenew) && $newname || $newname && $newname != $name) && !$save_error) {
$name = $newname;
}
$buttons = n . tag(gTxt('page_name'), 'label', array('for' => 'new_page')) . br . fInput('text', 'newname', $name, 'input-medium', '', '', INPUT_MEDIUM, '', 'new_page', false, true);
if ($name) {
$buttons .= span(href(gTxt('duplicate'), '#', array('id' => 'txp_clone', 'class' => 'clone', 'title' => gTxt('page_clone'))), array('class' => 'txp-actions'));
} else {
$buttons .= hInput('savenew', 'savenew');
}
$html = !$save_error ? fetch('user_html', 'txp_page', 'name', $name) : gps('html');
// Format of each entry is popTagLink -> array ( gTxt() string, class/ID).
$tagbuild_items = array('page_article' => array('page_article_hed', 'article-tags'), 'page_article_nav' => array('page_article_nav_hed', 'article-nav-tags'), 'page_nav' => array('page_nav_hed', 'nav-tags'), 'page_xml' => array('page_xml_hed', 'xml-tags'), 'page_misc' => array('page_misc_hed', 'misc-tags'), 'page_file' => array('page_file_hed', 'file-tags'));
$tagbuild_links = '';
foreach ($tagbuild_items as $tb => $item) {
$tagbuild_links .= wrapRegion($item[1] . '_group', taglinks($tb), $item[1], $item[0], 'page_' . $item[1]);
}
echo hed(gTxt('tab_pages'), 1, array('class' => 'txp-heading'));
echo n . tag(n . tag(hed(gTxt('tagbuilder'), 2) . $tagbuild_links, 'div', array('id' => 'tagbuild_links', 'class' => 'txp-layout-cell txp-layout-1-4')) . n . tag(form(graf($buttons) . graf(tag(gTxt('page_code'), 'label', array('for' => 'html')) . br . '<textarea class="code" id="html" name="html" cols="' . INPUT_LARGE . '" rows="' . TEXTAREA_HEIGHT_LARGE . '" dir="ltr">' . txpspecialchars($html) . '</textarea>') . graf(fInput('submit', '', gTxt('save'), 'publish') . eInput('page') . sInput('page_save') . hInput('name', $name)), '', '', 'post', 'edit-form', '', 'page_form'), 'div', array('id' => 'main_content', 'class' => 'txp-layout-cell txp-layout-2-4')) . n . tag(graf(sLink('page', 'page_new', gTxt('create_new_page')), ' class="action-create"') . page_list($name) . n, 'div', array('id' => 'content_switcher', 'class' => 'txp-layout-cell txp-layout-1-4')) . n, 'div', array('id' => $event . '_container', 'class' => 'txp-layout-grid'));
}
开发者ID:hcgtv,项目名称:textpattern,代码行数:33,代码来源:txp_page.php
示例6: textile
function textile($text, $lite = '')
{
if (get_magic_quotes_gpc() == 1) {
$text = stripslashes($text);
}
$text = incomingEntities($text);
$text = encodeEntities($text);
$text = fixEntities($text);
$text = cleanWhiteSpace($text);
$text = getRefs($text);
$text = noTextile($text);
$text = image($text);
$text = links($text);
$text = span($text);
$text = superscript($text);
$text = footnoteRef($text);
$text = code($text);
$text = glyphs($text);
$text = retrieve($text);
if ($lite == '') {
$text = lists($text);
$text = table($text);
$text = block($text);
}
/* clean up <notextile> */
$text = preg_replace('/<\\/?notextile>/', "", $text);
/* turn the temp char back to an ampersand entity */
$text = str_replace("x%x%", "&", $text);
$text = str_replace("<br />", "<br />\n", $text);
return trim($text);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:textile2.php
示例7: filename
/**
* @fn filename
* @short Returns the filename of the artifact.
*/
public function filename()
{
if (!$this->file_exists()) {
return span($this->file, array('class' => 'missing-file', 'title' => l('Missing file')));
}
return $this->file;
}
开发者ID:emeraldion,项目名称:zelda,代码行数:11,代码来源:software_artifact.php
示例8: pretty_diff_percent
function pretty_diff_percent($other)
{
if (!isset($this->quotazione) || !isset($other->quotazione)) {
return self::NOPE;
}
$plusminus_pct = 100 * ($this->quotazione - $other->quotazione) / $this->quotazione;
return span(sprintf('%.2f%%', $plusminus_pct), array('style' => 'color: ' . ($plusminus_pct < 0 ? 'red' : 'green')));
}
开发者ID:emeraldion,项目名称:creso,代码行数:8,代码来源:quote.php
示例9: footer
function footer()
{
global $txp_user;
$out[] = '<a id="mothership" href="http://textpattern.com/" title="' . gTxt('go_txp_com') . '" rel="external"><img src="' . $this->url . 'carver.png" width="40" height="40" alt="Textpattern" /></a>' . n . graf('Textpattern CMS · ' . txp_version);
if ($txp_user) {
$out[] = graf(gTxt('logged_in_as') . ' ' . span(txpspecialchars($txp_user)) . br . '<a href="index.php?logout=1">' . gTxt('logout') . '</a>', ' id="moniker"');
}
return join(n, $out);
}
开发者ID:balcides,项目名称:Cathartic_server,代码行数:9,代码来源:classic.php
示例10: footer
function footer()
{
global $txp_user;
$out[] = '<div id="end_page">' . n . '<a href="http://textpattern.com/" id="mothership"><img src="' . $this->url . 'carver.gif" width="60" height="48" border="0" alt="" /></a>' . n . graf('Textpattern · ' . txp_version);
if ($txp_user) {
$out[] = graf(gTxt('logged_in_as') . ' ' . span(htmlspecialchars($txp_user)) . br . '<a href="index.php?logout=1">' . gTxt('logout') . '</a>', ' id="moniker"');
}
$out[] = '</div>';
return join(n, $out);
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:10,代码来源:classic.php
示例11: plug_poll
function plug_poll($p, $o)
{
if ($p == 'init') {
poll_init();
}
if ($p) {
$ret = poll_menu($p);
}
return span(atd('poll' . $p) . atc('small'), $ret);
}
开发者ID:philum,项目名称:cms,代码行数:10,代码来源:poll.php
示例12: end_page
function end_page()
{
global $txp_user, $event;
if ($event != 'tag') {
echo '<div id="end_page">', navPop() . n, '<a href="http://www.textpattern.com"><img src="txp_img/carver.gif" width="60" height="48" border="0" alt="" /></a>' . n;
echo graf('Textpattern · ' . txp_version) . n;
echo $txp_user ? graf(gTxt('logged_in_as') . ' ' . span(htmlspecialchars($txp_user)) . br . '<a href="index.php?logout=1">' . gTxt('logout') . '</a>', ' id="moniker"') . n . '</div>' : '</div>';
echo n . '</body>' . n . '</html>';
}
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:10,代码来源:txplib_html.php
示例13: np_sav
function np_sav($d, $id)
{
$ret = hidden('', 'cka', 'm' . $d);
for ($i = 1; $i <= 7; $i++) {
$c = $i == $d ? 'active' : '';
$ret .= ljb($c . '" id="ckb' . $i, 'mem_storage', $id . '_m' . $i . '_1_1_ckb' . $i . '_memnu', $i);
}
$ret .= ljb('" id="ckc', 'mem_storage', $id . '_cka__1_ckc', 'save');
return span(atc('nbp') . atd('memnu'), $ret) . hlpbt('memstorage');
}
开发者ID:philum,项目名称:cms,代码行数:10,代码来源:notepad.php
示例14: initNavbar
private function initNavbar()
{
$this->navbar = div('', 'navbar');
foreach (Config::getCfg('navlinks') as $name => $link) {
$this->navbar->append(a(span(" {$name} ", 'navelement'), $link));
}
$stylelist = el('ul');
foreach (Config::getCfg("styles") as $name => $css) {
$stylelist->append(el('li', a(" {$name} ", "javascript:")->set("onclick", "StyleSwitcher.switchTo('{$name}')")->set("class", 'navelement')->set("title", $name)));
}
$this->navbar->append(el('ul', el('li', '[Page Style]' . $stylelist, ['class' => 'navelement']), ['class' => 'stylemenu']));
}
开发者ID:bstats,项目名称:b-stats,代码行数:12,代码来源:Page.php
示例15: codeline
function codeline($v, $p, $c)
{
//v§p:c //v:c
switch ($c) {
//elements
case 'br':
return br();
break;
case 'hr':
return hr();
break;
case 'balise':
if ($p) {
@(list($bal, $id, $css, $sty) = explode('|', $p));
if ($v) {
return balise($bal, array(5 => $css, 3 => $id, 16 => $sty), $v);
}
}
break;
case 'html':
if ($p && $v) {
return bal($p, $v);
}
break;
case 'span':
if (trim($v)) {
return span($p, $v);
}
break;
case 'div':
if (trim($v)) {
return div($p, $v);
}
break;
case 'css':
if (trim($v)) {
return btn($p, $v);
}
break;
case 'clear':
return divc($c, $v);
break;
//attributs
//attributs
case 'id':
return atd($c, $v);
break;
case 'class':
return atb($c, $v);
break;
case 'style':
return atb($c, $v);
break;
case 'name':
return atb($c, $v);
break;
case 'font-size':
return atb($c, $v);
break;
case 'font-family':
return atb($c, $v);
break;
//apps
//apps
case 'text':
return $v ? $v : $p;
break;
case 'url':
return lka($v, $p ? $p : preplink($v));
break;
case 'jurl':
return lj('', $v, $p);
break;
case 'link':
return special_link($v . '§' . $p);
break;
case 'ajx':
return lj('', 'popup', '_' . $p, $v);
break;
case 'anchor':
return '<a name="' . $v . '"></a>';
break;
case 'date':
return mkday(is_numeric($p) ? $p : '', $v);
break;
case 'title':
return suj_of_id($v);
break;
case 'read':
return read_msg($p, 3);
break;
case 'image':
return image($v);
break;
case 'thumb':
return make_thumb_d($v, $p);
break;
case 'picto':
return picto($v, $p);
break;
//.........这里部分代码省略.........
开发者ID:philum,项目名称:cms,代码行数:101,代码来源:pop.php
示例16: array
//---------------------------------------
// Add Hidden Variables
//---------------------------------------
$form->add_hidden('test1', 1);
$form->add_hidden('test2', 'Bob', array('class' => 'test_class'));
//---------------------------------------
// Start Fieldset
//---------------------------------------
$form->start_fieldset('Test', array('class' => 'fs_class'), array('class' => 'leg_class'));
$form->add_label('Label name');
$form->add_element(input(array('type' => 'text', 'placeholder' => "Type something...")));
//---------------------------------------
// End Fieldset
//---------------------------------------
$form->end_fieldset();
$form->add_element(span('Example block-level help text here.', array('class' => "help-block")));
$form->add_label(input(array('type' => 'checkbox')) . 'Check me out', array('class' => "checkbox"));
$form->add_element(button('Submit', array('type' => "submit", 'class' => "btn")));
//---------------------------------------
// Triple Layered Divs
//---------------------------------------
$form->start_div(array('id' => 'div1'));
$form->start_div(array('id' => 'div2'));
$form->start_div(array('id' => 'div3'));
$form->add_label('Triple Layered Divs');
$form->end_div();
$form->end_div();
$form->end_div();
//---------------------------------------
// Passing Multiple Elements
//---------------------------------------
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:31,代码来源:complex.php
示例17: _announce
private function _announce($thing, $async, $modal)
{
// $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';
$icon = 'ui-icon-closethick';
break;
case E_WARNING:
$class = 'warning';
$icon = 'ui-icon-alert';
break;
default:
$class = 'success';
$icon = 'ui-icon-check';
break;
}
if ($modal) {
$html = '';
// TODO: Say what?
$js = 'window.alert("' . escape_js(strip_tags($thing[0])) . '")';
} else {
$html = span(span(null, array('class' => 'ui-icon ' . $icon)) . ' ' . gTxt($thing[0]) . sp . href('×', '#close', ' class="close" role="button" title="' . gTxt('close') . '" aria-label="' . gTxt('close') . '"'), array('class' => 'messageflash ' . $class, 'role' => 'alert', 'aria-live' => 'assertive'));
// Try to inject $html into the message pane no matter when _announce()'s output is printed.
$js = escape_js($html);
$js = <<<EOS
\$(document).ready(function ()
{
\$("#messagepane").html("{$js}");
\$(window).resize(function ()
{
\$("#messagepane").css({
left: (\$(window).width() - \$("#messagepane").outerWidth()) / 2
});
});
\$(window).resize();
});
EOS;
}
if ($async) {
return $js;
} else {
return script_js(str_replace('</', '<\\/', $js), $html);
}
}
开发者ID:scar45,项目名称:textpattern,代码行数:52,代码来源:hive.php
示例18: action
public function action($trash = FALSE, $ID, $delete = TRUE, $edit = TRUE, $comments = FALSE)
{
$delete = $this->Users_Model->isAllow("delete");
$edit = $this->Users_Model->isAllow("edit");
if ($this->application === "comments") {
if ($delete and $edit) {
$URL1 = path($this->application . "/cpanel/validate/{$ID}");
$URL2 = path($this->application . "/cpanel/trash/{$ID}");
$title1 = __(_("Validate comment"));
$title2 = __(_("Send to trash"));
$onClick1 = "return confirm('" . __(_("Do you want to validate the comment?")) . "')";
$onClick2 = "return confirm('" . __(_("Do you want to send to the trash the record?")) . "')";
if ($comments) {
$action = a(span("tiny-image tiny-ok", " "), $URL1, FALSE, array("title" => $title1, "onclick" => $onClick1)) . a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
} else {
$action = a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
}
} elseif ($delete and $edit) {
$URL1 = path($this->application . "/cpanel/read/{$ID}");
$URL2 = path($this->application . "/cpanel/trash/{$ID}");
$title1 = __(_("Read Comment"));
$title2 = __(_("Send to Trash"));
$onClick2 = "return confirm('" . __(_("Do you want to send to the trash the record?")) . "')";
$action = a(span("tiny-image tiny-mail-off", " "), $URL1, FALSE, array("title" => $title1, "onclick" => $onClick1)) . a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
}
} elseif ($this->application === "feedback") {
if ($delete and $edit) {
$URL1 = path($this->application . "/cpanel/read/{$ID}");
$URL2 = path($this->application . "/cpanel/trash/{$ID}");
$title1 = __(_("Read Message"));
$title2 = __(_("Send to Trash"));
$onClick2 = "return confirm('" . __(_("Do you want to send to the trash the record?")) . "')";
$action = a(span("tiny-image tiny-mail", " "), $URL1, FALSE, array("title" => $title1)) . a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
} elseif ($delete and !$edit) {
$URL1 = path($this->application . "/cpanel/read/{$ID}");
$URL2 = path($this->application . "/cpanel/trash/{$ID}");
$title1 = __(_("Read Message"));
$title2 = __(_("Send to Trash"));
$onClick2 = "return confirm('" . __(_("Do you want to send to the trash the record?")) . "')";
$action = a(span("tiny-image tiny-mail-off", " "), $URL1, FALSE, array("title" => $title1, "onclick" => $onClick1)) . a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
}
} elseif ($comments) {
$URL1 = path($this->application . "/cpanel/validate/{$ID}");
$URL2 = path($this->application . "/cpanel/trash/{$ID}");
$title1 = __(_("Validate Comment"));
$title2 = __(_("Send to Trash"));
$onClick1 = "return confirm('" . __(_("Do you want to validate the comment?")) . "')";
$onClick2 = "return confirm('" . __(_("Do you want to send to the trash the record?")) . "')";
$action = a(span("tiny-image tiny-ok", " "), $URL1, FALSE, array("title" => $title1, "onclick" => $onClick1)) . a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
} elseif (!$trash) {
if ($delete and $edit) {
$URL1 = path($this->application . "/cpanel/edit/{$ID}");
$URL2 = path($this->application . "/cpanel/trash/{$ID}");
$title1 = __(_("Edit"));
$title2 = __(_("Send to trash"));
$onClick1 = "return confirm('" . __(_("Do you want to edit the record?")) . "')";
$onClick2 = "return confirm('" . __(_("Do you want to send to the trash the record?")) . "')";
$action = a(span("tiny-image tiny-edit", " "), $URL1, FALSE, array("title" => $title1, "onclick" => $onClick1)) . a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
} elseif ($delete and !$edit) {
$URL2 = path($this->application . "/cpanel/trash/{$ID}");
$title2 = __(_("Send to trash"));
$onClick2 = "return confirm('" . __(_("Do you want to send to the trash the record?")) . "')";
$action = a(span("tiny-image tiny-trash", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
} elseif (!$delete and !$edit) {
$action = span("tiny-image tiny-edit-off", " ") . span("tiny-image tiny-trash-off", " ");
}
} else {
$URL1 = path($this->application . "/cpanel/restore/{$ID}");
$URL2 = path($this->application . "/cpanel/delete/{$ID}");
$title1 = __(_("Restore"));
$title2 = __(_("Delete"));
$onClick1 = "return confirm('" . __(_("Do you want to restore the record?")) . "')";
$onClick2 = "return confirm('" . __(_("Do you want to delete the record permanently?")) . "')";
$action = a(span("tiny-image tiny-restore", " "), $URL1, FALSE, array("title" => $title1, "onclick" => $onClick1)) . a(span("tiny-image tiny-delete", " "), $URL2, FALSE, array("title" => $title2, "onclick" => $onClick2));
}
return $action;
}
开发者ID:no2key,项目名称:MuuCMS,代码行数:77,代码来源:cpanel.php
示例19: log_list
/**
* The main panel listing all log hits.
*
* @param string|array $message The activity message
*/
function log_list($message = '')
{
global $event, $log_list_pageby, $expire_logs_after;
pagetop(gTxt('tab_logs'), $message);
extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
if ($sort === '') {
$sort = get_pref('log_sort_column', 'time');
} else {
if (!in_array($sort, array('ip', 'host', 'page', 'refer', 'method', 'status'))) {
$sort = 'time';
}
set_pref('log_sort_column', $sort, 'log', 2, '', 0, PREF_PRIVATE);
}
if ($dir === '') {
$dir = get_pref('log_sort_dir', 'desc');
} else {
$dir = $dir == 'asc' ? "asc" : "desc";
set_pref('log_sort_dir', $dir, 'log', 2, '', 0, PREF_PRIVATE);
}
$expire_logs_after = assert_int($expire_logs_after);
safe_delete('txp_log', "time < DATE_SUB(NOW(), INTERVAL {$expire_logs_after} DAY)");
switch ($sort) {
case 'ip':
$sort_sql = "ip {$dir}";
break;
case 'host':
$sort_sql = "host {$dir}";
break;
case 'page':
$sort_sql = "page {$dir}";
break;
case 'refer':
$sort_sql = "refer {$dir}";
break;
case 'method':
$sort_sql = "method {$dir}";
break;
case 'status':
$sort_sql = "status {$dir}";
break;
default:
$sort = 'time';
$sort_sql = "time {$dir}";
break;
}
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$search = new Filter($event, array('ip' => array('column' => 'txp_log.ip', 'label' => gTxt('IP')), 'host' => array('column' => 'txp_log.host', 'label' => gTxt('host')), 'page' => array('column' => 'txp_log.page', 'label' => gTxt('page')), 'refer' => array('column' => 'txp_log.refer', 'label' => gTxt('referrer')), 'method' => array('column' => 'txp_log.method', 'label' => gTxt('method')), 'status' => array('column' => 'txp_log.status', 'label' => gTxt('status'), 'type' => 'integer')));
list($criteria, $crit, $search_method) = $search->getFilter(array('status' => array('can_list' => true)));
$search_render_options = array('placeholder' => 'search_logs');
$total = safe_count('txp_log', "{$criteria}");
echo n . tag(hed(gTxt('tab_logs'), 1, array('class' => 'txp-heading')), 'div', array('class' => 'txp-layout-2col-cell-1'));
$searchBlock = n . tag($search->renderForm('log_list', $search_render_options), 'div', array('class' => 'txp-layout-2col-cell-2', 'id' => $event . '_control'));
$contentBlockStart = n . tag_start('div', array('class' => 'txp-layout-1col', 'id' => $event . '_container'));
if ($total < 1) {
if ($criteria != 1) {
echo $searchBlock . $contentBlockStart . graf(span(null, array('class' => 'ui-icon ui-icon-info')) . ' ' . gTxt('no_results_found'), array('class' => 'alert-block information'));
} else {
echo $contentBlockStart . graf(span(null, array('class' => 'ui-icon ui-icon-info')) . ' ' . gTxt('no_refers_recorded'), array('class' => 'alert-block information'));
}
echo n . tag_end('div');
return;
}
$limit = max($log_list_pageby, 15);
list($page, $offset, $numPages) = pager($total, $limit, $page);
echo $searchBlock . $contentBlockStart;
$rs = safe_rows_start("*, UNIX_TIMESTAMP(time) AS uTime", 'txp_log', "{$criteria} ORDER BY {$sort_sql} LIMIT {$offset}, {$limit}");
if ($rs) {
echo n . tag(toggle_box('log_detail'), 'div', array('class' => 'txp-list-options')) . n . tag_start('form', array('class' => 'multi_edit_form', 'id' => 'log_form', 'name' => 'longform', 'method' => 'post', 'action' => 'index.php')) . n . tag_start('div', array('class' => 'txp-listtables')) . n . tag_start('table', array('class' => 'txp-list')) . n . tag_start('thead') . tr(hCell(fInput('checkbox', 'select_all', 0, '', '', '', '', '', 'select_all'), '', ' class="txp-list-col-multi-edit" scope="col" title="' . gTxt('toggle_all_selected') . '"') . column_head('time', 'time', 'log', true, $switch_dir, $crit, $search_method, ('time' == $sort ? "{$dir} " : '') . 'txp-list-col-time') . column_head('IP', 'ip', 'log', true, $switch_dir, $crit, $search_method, ('ip' == $sort ? "{$dir} " : '') . 'txp-list-col-ip') . column_head('host', 'host', 'log', true, $switch_dir, $crit, $search_method, ('host' == $sort ? "{$dir} " : '') . 'txp-list-col-host log_detail') . column_head('page', 'page', 'log', true, $switch_dir, $crit, $search_method, ('page' == $sort ? "{$dir} " : '') . 'txp-list-col-page') . column_head('referrer', 'refer', 'log', true, $switch_dir, $crit, $search_method, ('refer' == $sort ? "{$dir} " : '') . 'txp-list-col-refer') . column_head('method', 'method', 'log', true, $switch_dir, $crit, $search_method, ('method' == $sort ? "{$dir} " : '') . 'txp-list-col-method log_detail') . column_head('status', 'status', 'log', true, $switch_dir, $crit, $search_method, ('status' == $sort ? "{$dir} " : '') . 'txp-list-col-status log_detail')) . n . tag_end('thead') . n . tag_start('tbody');
while ($a = nextRow($rs)) {
extract($a, EXTR_PREFIX_ALL, 'log');
if ($log_refer) {
$log_refer = href(txpspecialchars(soft_wrap(preg_replace('#^http://#', '', $log_refer), 30)), txpspecialchars($log_refer), ' target="_blank"');
}
if ($log_page) {
$log_anchor = preg_replace('/\\/$/', '', $log_page);
$log_anchor = soft_wrap(substr($log_anchor, 1), 30);
$log_page = href(txpspecialchars($log_anchor), txpspecialchars($log_page), ' target="_blank"');
if ($log_method == 'POST') {
$log_page = strong($log_page);
}
}
echo tr(td(fInput('checkbox', 'selected[]', $log_id), '', 'txp-list-col-multi-edit') . hCell(gTime($log_uTime), '', ' class="txp-list-col-time" scope="row"') . td(href(txpspecialchars($log_ip), 'https://whois.domaintools.com/' . rawurlencode($log_ip), array('rel' => 'external', 'target' => '_blank')), '', 'txp-list-col-ip') . td(txpspecialchars($log_host), '', 'txp-list-col-host log_detail') . td($log_page, '', 'txp-list-col-page') . td($log_refer, '', 'txp-list-col-refer') . td(txpspecialchars($log_method), '', 'txp-list-col-method log_detail') . td($log_status, '', 'txp-list-col-status log_detail'));
}
echo n . tag_end('tbody') . n . tag_end('table') . n . tag_end('div') . log_multiedit_form($page, $sort, $dir, $crit, $search_method) . tInput() . n . tag_end('form') . n . tag_start('div', array('class' => 'txp-navigation', 'id' => $event . '_navigation')) . pageby_form('log', $log_list_pageby) . nav_form('log', $page, $numPages, $sort, $dir, $crit, $search_method, $total, $limit) . n . tag_end('div');
}
echo n . tag_end('div');
}
开发者ID:scar45,项目名称:textpattern,代码行数:92,代码来源:txp_log.php
示例20: author_list
/**
* The main author list.
*
* @param string|array $message The activity message
*/
function author_list($message = '')
{
global $txp_user, $author_list_pageby;
pagetop(gTxt('tab_site_admin'), $message);
if (is_disabled('mail')) {
echo graf(span(null, array('class' => 'ui-icon ui-icon-alert')) . ' ' . gTxt('warn_mail_unavailable'), array('class' => 'alert-block warning'));
}
echo hed(gTxt('tab_site_admin'), 1, array('class' => 'txp-heading'));
echo n . '<div id="users_control" class="txp-control-panel">';
$buttons = array();
// Change password button.
$buttons[] = sLink('admin', 'new_pass_form', gTxt('change_password'));
if (!has_privs('admin.edit')) {
// Change email address button.
$buttons[] = sLink('admin', 'change_email_form', gTxt('change_email_address'));
} else {
// New author button.
$buttons[] = sLink('admin', 'author_edit', gTxt('add_new_author'));
}
echo graf(join(n, $buttons), array('class' => 'txp-buttons'));
// User list.
if (has_privs('admin.list')) {
extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
if ($sort === '') {
$sort = get_pref('admin_sort_column', 'name');
}
if ($dir === '') {
$dir = get_pref('admin_sort_dir', 'asc');
}
$dir = $dir == 'desc' ? 'desc' : 'asc';
if (!in_array($sort, array('name', 'RealName', 'email', 'privs', 'last_login'))) {
$sort = 'name';
}
$sort_sql = $sort . ' ' . $dir;
set_pref('admin_sort_column', $sort, 'admin', 2, '', 0, PREF_PRIVATE);
set_pref('admin_sort_dir', $dir, 'admin', 2, '', 0, PREF_PRIVATE);
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$criteria = 1;
if ($search_method and $crit != '') {
$verbatim = preg_match('/^"(.*)"$/', $crit, $m);
$crit_escaped = $verbatim ? doSlash($m[1]) : doLike($crit);
$critsql = $verbatim ? array('id' => "user_id in ('" . join("','", do_list($crit_escaped)) . "')", 'login' => "name = '{$crit_escaped}'", 'real_name' => "RealName = '{$crit_escaped}'", 'email'
|
请发表评论