本文整理汇总了PHP中eLink函数的典型用法代码示例。如果您正苦于以下问题:PHP eLink函数的具体用法?PHP eLink怎么用?PHP eLink使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form_list
function form_list($curname)
{
global $step, $essential_forms;
$out[] = '<p class="action-create smallerbox">' . sLink('form', 'form_create', gTxt('create_new_form')) . '</p>';
$methods = array('delete' => gTxt('delete'));
$rs = safe_rows_start("*", "txp_form", "1 order by type asc, name asc");
if ($rs) {
$ctr = 1;
$prev_type = '';
while ($a = nextRow($rs)) {
extract($a);
$editlink = $curname != $name ? eLink('form', 'form_edit', 'name', $name, $name) : htmlspecialchars($name);
$modbox = !in_array($name, $essential_forms) ? '<input type="checkbox" name="selected_forms[]" value="' . $name . '" />' : '';
if ($prev_type != $type) {
$visipref = 'pane_form_' . $type . '_visible';
//TODO: Add 'article', 'comment', 'misc' to rpc server for gTxt()
$group_start = '<div class="form-list-group ' . $type . '"><h3 class="plain lever' . (get_pref($visipref) ? ' expanded' : '') . '"><a href="#' . $type . '">' . ucfirst(gTxt($type)) . '</a></h3>' . n . '<div id="' . $type . '" class="toggle form-list" style="display:' . (get_pref($visipref) ? 'block' : 'none') . '">' . n . '<ul class="plain-list">' . n;
$group_end = $ctr > 1 ? '</ul></div></div>' . n : '';
} else {
$group_start = $group_end = '';
}
$out[] = $group_end . $group_start;
$out[] = '<li class="' . ($ctr % 2 == 0 ? 'even' : 'odd') . '">' . n . '<span class="form-list-action">' . $modbox . '</span><span class="form-list-name">' . $editlink . '</span></li>';
$prev_type = $type;
$ctr++;
}
$out[] = '</ul></div></div>';
$out[] = eInput('form') . sInput('form_multi_edit');
$out[] = graf(selectInput('edit_method', $methods, '', 1) . sp . gTxt('selected') . sp . fInput('submit', 'form_multi_edit', gTxt('go'), 'smallerbox'), ' align="right"');
return form(join('', $out), '', "verify('" . gTxt('are_you_sure') . "')", 'post', '', '', 'allforms_form');
}
}
示例2: plugin_list
function plugin_list($message = '')
{
pagetop(gTxt('edit_plugins'), $message);
echo n . n . startTable('edit') . tr(tda(plugin_form(), ' colspan="8" style="height: 30px; border: none;"')) . endTable();
extract(gpsa(array('sort', 'dir')));
$dir = $dir == 'desc' ? 'desc' : 'asc';
if (!in_array($sort, array('name', 'status', 'author', 'version', 'modified', 'load_order'))) {
$sort = 'name';
}
$sort_sql = $sort . ' ' . $dir;
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$rs = safe_rows_start('name, status, author, author_uri, version, description, length(help) as help, abs(strcmp(md5(code),code_md5)) as modified, load_order, flags', 'txp_plugin', '1 order by ' . $sort_sql);
if ($rs and numRows($rs) > 0) {
echo '<form action="index.php" method="post" name="longform" onsubmit="return verify(\'' . gTxt('are_you_sure') . '\')">' . startTable('list') . tr(column_head('plugin', 'name', 'plugin', true, $switch_dir, '', '', 'name' == $sort ? $dir : '') . column_head('author', 'author', 'plugin', true, $switch_dir, '', '', 'author' == $sort ? $dir : '') . column_head('version', 'version', 'plugin', true, $switch_dir, '', '', 'version' == $sort ? $dir : '') . column_head('plugin_modified', 'modified', 'plugin', true, $switch_dir, '', '', 'modified' == $sort ? $dir : '') . hCell(gTxt('description')) . column_head('active', 'status', 'plugin', true, $switch_dir, '', '', 'status' == $sort ? $dir : '') . column_head('order', 'load_order', 'plugin', true, $switch_dir, '', '', 'load_order' == $sort ? $dir : '') . hCell(gTxt('manage'), '', ' class="manage"') . hCell());
while ($a = nextRow($rs)) {
foreach ($a as $key => $value) {
${$key} = htmlspecialchars($value);
}
// Fix up the description for clean cases
$description = preg_replace(array('#<br />#', '#<(/?(a|b|i|em|strong))>#', '#<a href="(https?|\\.|\\/|ftp)([A-Za-z0-9:/?.=_]+?)">#'), array('<br />', '<$1>', '<a href="$1$2">'), $description);
$help = !empty($help) ? n . t . '<li><a href="?event=plugin' . a . 'step=plugin_help' . a . 'name=' . urlencode($name) . '">' . gTxt('help') . '</a></li>' : '';
$plugin_prefs = $flags & PLUGIN_HAS_PREFS && $status ? n . t . '<li><a href="?event=plugin_prefs.' . urlencode($name) . '">' . gTxt('plugin_prefs') . '</a></li>' : '';
echo tr(n . td($name) . td(href($author, $author_uri)) . td($version, 10) . td($modified ? gTxt('yes') : '') . td($description, 260) . td(status_link($status, $name, yes_no($status)), 30) . td($load_order) . td(n . '<ul class="plugin_manage">' . $help . n . t . '<li>' . eLink('plugin', 'plugin_edit', 'name', $name, gTxt('edit')) . '</li>' . $plugin_prefs . n . '</ul>') . td(fInput('checkbox', 'selected[]', $name), 30));
unset($name, $page, $deletelink);
}
echo tr(tda(select_buttons() . plugin_multiedit_form('', $sort, $dir, '', ''), ' colspan="10" style="text-align: right; border: none;"')) . n . endTable() . n . '</form>';
}
}
示例3: discuss_list
function discuss_list($message = '')
{
pagetop(gTxt('list_discussions'), $message);
extract(doSlash(gpsa(array('page', 'crit'))));
extract(get_prefs());
$total = safe_count('txp_discuss', "1=1");
$limit = max(@$comment_list_pageby, 25);
$numPages = ceil($total / $limit);
$page = !$page ? 1 : $page;
$offset = ($page - 1) * $limit;
$nav[] = $page > 1 ? PrevNextLink("discuss", $page - 1, gTxt('prev'), 'prev') : '';
$nav[] = sp . small($page . '/' . $numPages) . sp;
$nav[] = $page != $numPages ? PrevNextLink("discuss", $page + 1, gTxt('next'), 'next') : '';
$criteria = $crit ? "message like '%{$crit}%'" : '1=1';
$rs = safe_rows_start("*, unix_timestamp(posted) as uPosted", "txp_discuss", "{$criteria} order by posted desc limit {$offset}, {$limit}");
echo pageby_form('discuss', $comment_list_pageby);
if ($rs) {
echo '<form action="index.php" method="post" name="longform" onsubmit="return verify(\'' . gTxt('are_you_sure') . '\')">', startTable('list'), assHead('date', 'name', 'message', 'parent', '');
while ($a = nextRow($rs)) {
extract($a);
$dmessage = $visible == SPAM ? short_preview($message) : $message;
$date = "" . date("M d, g:ia", $uPosted + tz_offset()) . "";
$editlink = eLink('discuss', 'discuss_edit', 'discussid', $discussid, $date);
$cbox = fInput('checkbox', 'selected[]', $discussid);
$tq = fetch('Title', 'textpattern', 'ID', $parentid);
$parent = !$tq ? gTxt('article_deleted') : $tq;
echo assRow(array($editlink => 100, $name => 100, $dmessage => 250, $parent => 100, $cbox => 20), ' class="' . ($visible == VISIBLE ? 'visible' : ($visible == SPAM ? 'spam' : 'moderate')) . '"');
}
echo tr(tda(select_buttons() . discuss_multiedit_form(), ' colspan="5" style="text-align:right;border:0px"'));
echo endTable() . '</form>';
echo startTable('edit'), tr(td(form(fInput('text', 'crit', '', 'edit') . fInput('submit', 'search', gTxt('search'), 'smallbox') . eInput("discuss") . sInput("list"))) . td(graf(join('', $nav)))) . tr(tda(graf('<a href="index.php?event=discuss' . a . 'step=ipban_list">' . gTxt('list_banned_ips') . '</a>'), ' colspan="2" align="center" valign="middle"')), endTable();
} else {
echo graf(gTxt('no_comments_recorded'), ' align="center"');
}
}
示例4: css_list
/**
* Renders a list of stylesheets.
*
* @param string $current The active stylesheet
* @param string $default Not used
* @return string HTML
*/
function css_list($current, $default)
{
$out = array();
$protected = safe_column('DISTINCT css', 'txp_section', '1=1');
$criteria = 1;
$criteria .= callback_event('admin_criteria', 'css_list', 0, $criteria);
$rs = safe_rows_start('name', 'txp_css', $criteria);
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
$active = $current === $name;
if ($active) {
$edit = txpspecialchars($name);
} else {
$edit = eLink('css', '', 'name', $name, $name);
}
if (!array_key_exists($name, $protected)) {
$edit .= dLink('css', 'css_delete', 'name', $name);
}
$out[] = tag(n . $edit . n, 'li', array('class' => $active ? 'active' : ''));
}
$out = tag(join(n, $out), 'ul', array('class' => 'switcher-list'));
return wrapGroup('all_styles', $out, 'all_stylesheets');
}
}
示例5: plugin_list
function plugin_list($message = '')
{
global $event;
pagetop(gTxt('tab_plugins'), $message);
echo '<h1 class="txp-heading">' . gTxt('tab_plugins') . '</h1>';
echo '<div id="' . $event . '_control" class="txp-control-panel">';
echo n . plugin_form() . n . '</div>';
extract(gpsa(array('sort', 'dir')));
if ($sort === '') {
$sort = get_pref('plugin_sort_column', 'name');
}
if ($dir === '') {
$dir = get_pref('plugin_sort_dir', 'asc');
}
$dir = $dir == 'desc' ? 'desc' : 'asc';
if (!in_array($sort, array('name', 'status', 'author', 'version', 'modified', 'load_order'))) {
$sort = 'name';
}
$sort_sql = $sort . ' ' . $dir;
set_pref('plugin_sort_column', $sort, 'plugin', 2, '', 0, PREF_PRIVATE);
set_pref('plugin_sort_dir', $dir, 'plugin', 2, '', 0, PREF_PRIVATE);
$switch_dir = $dir == 'desc' ? 'asc' : 'desc';
$rs = safe_rows_start('name, status, author, author_uri, version, description, length(help) as help, abs(strcmp(md5(code),code_md5)) as modified, load_order, flags', 'txp_plugin', '1 order by ' . $sort_sql);
if ($rs and numRows($rs) > 0) {
echo n . '<div id="' . $event . '_container" class="txp-container">';
echo '<form action="index.php" id="plugin_form" class="multi_edit_form" method="post" name="longform">' . n . '<div class="txp-listtables">' . n . startTable('', '', 'txp-list') . n . '<thead>' . tr(n . hCell(fInput('checkbox', 'select_all', 0, '', '', '', '', '', 'select_all'), '', ' title="' . gTxt('toggle_all_selected') . '" class="multi-edit"') . n . column_head('plugin', 'name', 'plugin', true, $switch_dir, '', '', ('name' == $sort ? "{$dir} " : '') . 'name') . n . column_head('author', 'author', 'plugin', true, $switch_dir, '', '', ('author' == $sort ? "{$dir} " : '') . 'author') . n . column_head('version', 'version', 'plugin', true, $switch_dir, '', '', ('version' == $sort ? "{$dir} " : '') . 'version') . n . column_head('plugin_modified', 'modified', 'plugin', true, $switch_dir, '', '', ('modified' == $sort ? "{$dir} " : '') . 'modified') . n . hCell(gTxt('description'), '', ' class="description"') . n . column_head('active', 'status', 'plugin', true, $switch_dir, '', '', ('status' == $sort ? "{$dir} " : '') . 'status') . n . column_head('order', 'load_order', 'plugin', true, $switch_dir, '', '', ('load_order' == $sort ? "{$dir} " : '') . 'load-order') . n . hCell(gTxt('manage'), '', ' class="manage actions"')) . n . '</thead>';
echo '<tbody>';
while ($a = nextRow($rs)) {
foreach ($a as $key => $value) {
${$key} = txpspecialchars($value);
}
// Fix up the description for clean cases
$description = preg_replace(array('#<br />#', '#<(/?(a|b|i|em|strong))>#', '#<a href="(https?|\\.|\\/|ftp)([A-Za-z0-9:/?.=_]+?)">#'), array('<br />', '<$1>', '<a href="$1$2">'), $description);
$help = !empty($help) ? '<a class="plugin-help" href="?event=plugin' . a . 'step=plugin_help' . a . 'name=' . urlencode($name) . '">' . gTxt('help') . '</a>' : '';
$plugin_prefs = $flags & PLUGIN_HAS_PREFS ? '<a class="plugin-prefs" href="?event=plugin_prefs.' . urlencode($name) . '">' . gTxt('plugin_prefs') . '</a>' : '';
$manage = array();
if ($help) {
$manage[] = $help;
}
if ($plugin_prefs) {
$manage[] = $plugin_prefs;
}
$manage_items = $manage ? join(tag(sp . '|' . sp, 'span'), $manage) : '-';
$edit_url = eLink('plugin', 'plugin_edit', 'name', $name, $name);
echo tr(n . td(fInput('checkbox', 'selected[]', $name), '', 'multi-edit') . td($edit_url, '', 'name') . td(href($author, $author_uri, ' rel="external"'), '', 'author') . td($version, '', 'version') . td($modified ? '<span class="warning">' . gTxt('yes') . '</span>' : '', '', 'modified') . td($description, '', 'description') . td(status_link($status, $name, yes_no($status)), '', 'status') . td($load_order, '', 'load-order') . td($manage_items, '', 'manage'), $status ? ' class="active"' : '');
unset($name, $page, $deletelink);
}
echo '</tbody>', n, endTable(), n, '</div>', n, plugin_multiedit_form('', $sort, $dir, '', ''), n, tInput(), n, '</form>', n, '</div>';
// Show/hide "Options" link by setting the appropriate class on the plugins TR
echo script_js(<<<EOS
textpattern.Relay.register('txpAsyncHref.success', function(event, data) {
\t\$(data['this']).closest('tr').toggleClass('active');
});
EOS
);
}
}
示例6: list_list
function list_list($message = "", $post = '')
{
extract(get_prefs());
$lvars = array("page", "sort", "dir", "crit", 'method');
extract(gpsa($lvars));
global $statuses, $step;
pagetop("Textpattern", $message);
$total = getCount('textpattern', "1");
$limit = $article_list_pageby ? $article_list_pageby : 25;
$numPages = ceil($total / $limit);
$page = !$page ? 1 : $page;
$offset = ($page - 1) * $limit;
if (!$sort) {
$sort = "Posted";
}
if (!$dir) {
$dir = "desc";
}
if ($dir == "desc") {
$linkdir = "asc";
} else {
$linkdir = "desc";
}
if ($crit) {
$critsql = array('title_body' => "Title rlike '{$crit}' or Body rlike '{$crit}'", 'author' => "AuthorID rlike '{$crit}'", 'categories' => "Category1 rlike '{$crit}' or Category2 rlike '{$crit}'", 'section' => "Section rlike '{$crit}'", 'status' => "Status rlike '{$crit}'");
$criteria = $critsql[$method];
$limit = 500;
} else {
$criteria = 1;
}
$rs = safe_rows("*, unix_timestamp(Posted) as uPosted", "textpattern", "{$criteria} order by {$sort} {$dir} limit {$offset},{$limit}");
echo !$crit ? list_nav_form($page, $numPages, $sort, $dir) : '', list_searching_form($crit, $method);
if ($rs) {
echo '<form action="index.php" method="post" onsubmit="return verify(\'' . gTxt('are_you_sure') . '\')">', startTable('list'), '<tr>', column_head('posted', 'Posted', 'list', 1, $linkdir), column_head('title', 'Title', 'list', 1, $linkdir), $use_sections ? column_head('section', 'Section', 'list', 1, $linkdir) : '', $use_categories ? column_head('category1', 'Category1', 'list', 1, $linkdir) . column_head('category2', 'Category2', 'list', 1, $linkdir) : '', hCell(gTxt('Author')), column_head(gTxt('status'), 'Status', 'list', 1, $linkdir), td(), '</tr>';
foreach ($rs as $a) {
extract($a);
if ($use_categories == 1) {
$cat1 = $Category1;
$cat2 = $Category2;
}
$stat = !empty($Status) ? $statuses[$Status] : '';
if ($use_sections == 1) {
$sect = $Section;
}
$adate = date("d M y", $uPosted + $timeoffset);
$alink = eLink('article', 'edit', 'ID', $ID, $adate);
$tlink = eLink('article', 'edit', 'ID', $ID, $Title);
$modbox = fInput('checkbox', 'selected[]', $ID);
echo "<tr>" . n, td($alink), td($tlink, 200), $use_sections ? td($sect, 75) : '', $use_categories ? td($cat1, 75) . td($cat2, 75) : '', td($AuthorID), td($stat, 45), td($modbox), '</tr>' . n;
}
echo tr(tda(list_multiedit_form(), ' colspan="8" style="text-align:right;border:0px"'));
echo "</table></form>";
echo pageby_form('list', $article_list_pageby);
unset($sort);
}
}
示例7: page_list
function page_list($current)
{
$rs = safe_rows_start("name", "txp_page", "name != '' order by name");
while ($a = nextRow($rs)) {
extract($a);
$dlink = $name != 'default' ? dLink('page', 'page_delete', 'name', $name) : '';
$link = eLink('page', '', 'name', $name, $name);
$out[] = $current == $name ? tr(td($name) . td($dlink)) : tr(td($link) . td($dlink));
}
return startTable('list') . join(n, $out) . endTable();
}
示例8: page_list
function page_list($current)
{
$protected = safe_column('DISTINCT page', 'txp_section', '1=1') + array('error_default');
$rs = safe_rows_start('name', 'txp_page', "1 order by name asc");
while ($a = nextRow($rs)) {
extract($a);
$link = eLink('page', '', 'name', $name, $name);
$dlink = !in_array($name, $protected) ? dLink('page', 'page_delete', 'name', $name) : '';
$out[] = $current == $name ? tr(td($name) . td($dlink)) : tr(td($link) . td($dlink));
}
return startTable('list') . join(n, $out) . endTable();
}
示例9: list_plugins
function list_plugins($message = '')
{
pagetop(gTxt('edit_plugins'), $message);
echo startTable('list') . tr(tda(plugin_form() . plugin_form_old(), ' colspan="5" style="border:0;height:50px"')) . assHead('plugin', 'author', 'version', 'description', 'active', '');
$rs = safe_rows("*", "txp_plugin", "1 order by name");
foreach ($rs as $a) {
extract($a);
// nice to have eval() do a syntax check on the plugin here
echo tr(td(eLink('plugin', 'edit', 'name', $name, $name), 150) . td('<a href="' . $author_uri . '">' . $author . '</a>', 100) . td($version, 10) . td($description, 260) . td(status_link($status, $name, yes_no($status)), 30) . td(dLink('plugin', 'delete', 'name', $name), 30));
unset($name, $page, $deletelink);
}
echo endTable();
}
示例10: plugin_list
function plugin_list($message = '')
{
pagetop(gTxt('edit_plugins'), $message);
echo startTable('list') . tr(tda(plugin_form() . plugin_form_old(), ' colspan="8" style="border:0;height:50px"')) . assHead('plugin', 'author', 'version', 'description', 'active', '', '', '');
$rs = safe_rows_start("*", "txp_plugin", "1 order by name");
while ($a = nextRow($rs)) {
extract($a);
$elink = eLink('plugin', 'plugin_edit', 'name', $name, gTxt('edit'));
$hlink = '<a href="?event=plugin&step=plugin_help&name=' . $name . '">' . gTxt('help') . '</a>';
echo tr(td($name) . td('<a href="' . $author_uri . '">' . $author . '</a>') . td($version, 10) . td($description, 260) . td(status_link($status, $name, yes_no($status)), 30) . td($elink) . td($hlink) . td(dLink('plugin', 'plugin_delete', 'name', $name), 30));
unset($name, $page, $deletelink);
}
echo endTable();
}
示例11: css_list
function css_list($current, $default)
{
$out[] = startTable('', '', 'txp-list');
$criteria = 1;
$criteria .= callback_event('admin_criteria', 'css_list', 0, $criteria);
$rs = safe_rows_start('name', 'txp_css', $criteria);
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
$edit = $current != $name ? eLink('css', '', 'name', $name, $name) : txpspecialchars($name);
$delete = $name != $default ? dLink('css', 'css_delete', 'name', $name) : '';
$out[] = tr(td($edit) . td($delete));
}
$out[] = endTable();
return join('', $out);
}
}
示例12: jmd_rate_prefs
function jmd_rate_prefs($event, $step)
{
ob_start('jmd_rate_prefs_head');
pagetop('jmd_rate_prefs');
echo '<div id="jmd_rate_prefs">';
if (!$step) {
echo fieldset(form(fInput('submit', 'install', 'Install', 'publish') . eInput('jmd_rate_prefs') . sInput('install')) . form(fInput('submit', 'uninstall', 'Uninstall', 'publish') . eInput('jmd_rate_prefs') . sInput('uninstall'), '', "verify('Are you sure you want to delete all ratings?');"), 'Setup', 'setup');
echo fieldset(form('<label>Quantity ' . fInput('text', 'qty', 4) . '</label><br/>
<label>Path and filename of star image ' . fInput('text', 'path', '/stars.png') . '</label><br/>
<label>Star width' . fInput('text', 'width', 19) . '</label><br/>
<label>Star height' . fInput('text', 'height', 18) . '</label><br/>
<label>Container class name' . fInput('text', 'class', 'rating') . '</label><br/>' . fInput('submit', 'generate', 'Generate CSS', 'publish') . eInput('jmd_rate_prefs') . sInput('builder')), 'CSS builder');
} elseif ($step == 'install') {
$sql = "CREATE TABLE " . safe_pfx('jmd_rate') . "(\n\t\t\tparentid INT,\n\t\t\tvalue INT,\n\t\t\tmax_value INT,\n\t\t\tip INT UNSIGNED,\n\t\t\tPRIMARY KEY(parentid, ip)\n\t\t)";
$create = safe_query($sql);
if ($create) {
echo tag('Table created successfully. ' . eLink('jmd_rate_prefs', '', '', '', 'Back to preferences?'), 'p', ' class="ok"');
} else {
echo tag('Database exists. ' . eLink('jmd_rate_prefs', '', '', '', 'Back to preferences?'), 'p', ' class="not-ok"');
}
} elseif ($step == 'uninstall') {
safe_query("DROP TABLE IF EXISTS " . safe_pfx('jmd_rate'));
echo tag('Table dropped. ' . eLink('jmd_rate_prefs', '', '', '', 'Back to preferences?'), 'p', ' class="ok"');
} elseif ($step == 'builder') {
if (is_numeric(gps('qty')) && is_numeric(gps('width')) && is_numeric(gps('height'))) {
$qty = gps('qty');
$w = round(gps('width'));
$h = round(gps('height'));
$path = htmlentities(gps('path'));
$class = '.' . gps('class');
echo tag('CSS', 'h1');
echo "\n<textarea class=\"code\" cols=\"78\" rows=\"32\" id=\"jmd_rate_css\">\n{$class} {}\n\t{$class}, {$class} * {\n\t\tmargin: 0;\n\t\tborder: 0;\n\t\tpadding: 0;\n\t}\n\t{$class} ul {\n\t\theight: " . $h . "px;\n\t\tposition: relative;\n\t}\n\t\t{$class} ul, {$class} .current_rating, {$class} a:hover {\n\t\t\tbackground: url({$path});\n\t\t}\n\t\t{$class} li {\n\t\t\tlist-style: none;\n\t\t\ttext-indent: -9999px;\n\t\t}\n\t\t\t{$class} .current_rating {\n\t\t\t\tbackground-position: 0 -" . $h . "px;\n\t\t\t\tz-index: 1;\n\t\t\t}\n\t\t\t\t{$class} .current_rating, {$class} a {\n\t\t\t\t\theight: " . $h . "px;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t}\n\t\t\t{$class} a {\n\t\t\t\twidth: " . $w . "px;\n\t\t\t\theight: " . $h . "px;\n\t\t\t\toverflow: hidden;\n\t\t\t\tz-index: 3;\n\t\t\t}\n\t\t\t\t{$class} a:hover{\n\t\t\t\t\tbackground-position: left center;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\tz-index: 2;\n\t\t\t\t}\n\t\t\t\t\t" . $class . "_1 a:hover { width: " . $w . "px }\n\t\t\t";
for ($i = 2; $i <= $qty; $i++) {
echo '
' . $class . '_' . $i . ' a { left: ' . ($i - 1) * $w . 'px }
' . $class . '_' . $i . ' a:hover { width: ' . $w * $i . 'px }
';
}
echo '</textarea>';
}
echo tag(eLink('jmd_rate_prefs', '', '', '', 'Try again?'), 'p');
} else {
echo tag('Error.', 'h1');
}
echo '</div><!--//jmd_rate_prefs-->';
}
示例13: css_list
function css_list($current, $default)
{
$out[] = startTable('list', 'left', 'list');
$rs = safe_rows_start('name', 'txp_css', "1=1");
$ctr = 1;
if ($rs) {
while ($a = nextRow($rs)) {
extract($a);
$edit = $current != $name ? eLink('css', '', 'name', $name, $name) : htmlspecialchars($name);
$delete = $name != $default ? dLink('css', 'css_delete', 'name', $name) : '';
$trcls = ' class="' . (($ctr == 1 ? 'first ' : '') . ($ctr % 2 == 0 ? 'even' : 'odd')) . '"';
$out[] = tr(td($edit) . td($delete), $trcls);
$ctr++;
}
$out[] = endTable();
return join('', $out);
}
}
示例14: form_list
function form_list($curname)
{
global $step, $essential_forms, $form_types;
$types = formTypes('', false);
$methods = array('changetype' => array('label' => gTxt('changetype'), 'html' => $types), 'delete' => gTxt('delete'));
$out[] = '<p class="action-create">' . sLink('form', 'form_create', gTxt('create_new_form')) . '</p>';
$criteria = 1;
$criteria .= callback_event('admin_criteria', 'form_list', 0, $criteria);
$rs = safe_rows_start("*", "txp_form", "{$criteria} order by field(type,'" . join("','", array_keys($form_types)) . "') asc, name asc");
if ($rs) {
$ctr = 1;
$prev_type = '';
while ($a = nextRow($rs)) {
extract($a);
$editlink = $curname != $name ? eLink('form', 'form_edit', 'name', $name, $name) : txpspecialchars($name);
$modbox = !in_array($name, $essential_forms) ? '<input type="checkbox" name="selected_forms[]" value="' . $name . '" />' : '';
if ($prev_type != $type) {
$visipref = 'pane_form_' . $type . '_visible';
$group_start = '<div class="form-list-group ' . $type . '"><h3 class="lever' . (get_pref($visipref) ? ' expanded' : '') . '"><a href="#' . $type . '">' . $form_types[$type] . '</a></h3>' . n . '<div id="' . $type . '" class="toggle form-list" style="display:' . (get_pref($visipref) ? 'block' : 'none') . '">' . n . '<ul class="plain-list">' . n;
$group_end = $ctr > 1 ? '</ul></div></div>' . n : '';
} else {
$group_start = $group_end = '';
}
$out[] = $group_end . $group_start;
$out[] = '<li>' . n . '<span class="form-list-action">' . $modbox . '</span><span class="form-list-name">' . $editlink . '</span></li>';
$prev_type = $type;
$ctr++;
}
$out[] = '</ul></div></div>';
$out[] = multi_edit($methods, 'form', 'form_multi_edit');
return form(join('', $out), '', '', 'post', '', '', 'allforms_form') . script_js(<<<EOS
\t\t\t\t\$(document).ready(function() {
\t\t\t\t\t\$('#allforms_form').txpMultiEditForm({
\t\t\t\t\t\t'checkbox' : 'input[name="selected_forms[]"][type=checkbox]',
\t\t\t\t\t\t'row' : '.plain-list li, .form-list-name',
\t\t\t\t\t\t'highlighted' : '.plain-list li'
\t\t\t\t\t});
\t\t\t\t});
EOS
);
}
}
示例15: link_edit
function link_edit($message = "")
{
global $vars, $step;
extract(gpsa($vars));
pagetop(gTxt('edit_links', $message));
$id = gps('id');
if ($id && $step == 'link_edit') {
extract(safe_row("*", "txp_link", "id = {$id}"));
}
if ($step == 'link_save' or $step == 'link_post') {
foreach ($vars as $var) {
${$var} = '';
}
}
$textarea = '<textarea name="description" cols="40" rows="7" tabindex="4">' . $description . '</textarea>';
$selects = linkcategory_popup($category);
$editlink = ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']';
$out = startTable('edit') . tr(fLabelCell('title') . fInputCell('linkname', $linkname, 1, 30)) . tr(fLabelCell('sort_value') . fInputCell('linksort', $linksort, 2, 15)) . tr(fLabelCell('url', 'link_url') . fInputCell('url', $url, 3, 30)) . tr(fLabelCell('link_category', 'link_category') . td($selects . $editlink)) . tr(fLabelCell('description', 'link_description') . tda($textarea, ' valign="top"')) . tr(td() . td(fInput("submit", '', gTxt('save'), "publish"))) . endTable() . eInput('link') . sInput($step == 'link_edit' ? 'link_save' : 'link_post') . hInput('id', $id);
echo form($out);
echo link_list();
}