本文整理汇总了PHP中Skin::table_suffix方法的典型用法代码示例。如果您正苦于以下问题:PHP Skin::table_suffix方法的具体用法?PHP Skin::table_suffix怎么用?PHP Skin::table_suffix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skin
的用法示例。
在下文中一共展示了Skin::table_suffix方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: layout
/**
* list sections as topics in a forum
*
* @param resource the SQL result
* @return string the rendered text
**/
function layout($result)
{
global $context;
// empty list
if (!SQL::count($result)) {
$output = array();
return $output;
}
// output as a string
$text = '';
// build a list of sections
$family = '';
$first = TRUE;
while ($item = SQL::fetch($result)) {
// change the family
if ($item['family'] != $family) {
$family = $item['family'];
// close last table only if a section has been already listed
if (!$first) {
$text .= Skin::table_suffix();
}
// show the family
$text .= '<h2><span>' . $family . ' </span></h2>' . "\n" . Skin::table_prefix('yabb') . Skin::table_row(array(i18n::s('Board'), 'center=' . i18n::s('Topics'), i18n::s('Last post')), 'header');
} elseif ($first) {
$text .= Skin::table_prefix('yabb');
$text .= Skin::table_row(array(i18n::s('Board'), 'center=' . i18n::s('Topics'), i18n::s('Last post')), 'header');
}
// done with this case
$first = FALSE;
// reset everything
$prefix = $label = $suffix = $icon = '';
// signal restricted and private sections
if ($item['active'] == 'N') {
$prefix .= PRIVATE_FLAG;
} elseif ($item['active'] == 'R') {
$prefix .= RESTRICTED_FLAG;
}
// indicate the id in the hovering popup
$hover = i18n::s('View the section');
if (Surfer::is_member()) {
$hover .= ' [section=' . $item['id'] . ']';
}
// the url to view this item
$url = Sections::get_permalink($item);
// use the title as a link to the page
$title =& Skin::build_link($url, Codes::beautify_title($item['title']), 'basic', $hover);
// also use a clickable thumbnail, if any
if ($item['thumbnail_url']) {
$prefix = Skin::build_link($url, '<img src="' . $item['thumbnail_url'] . '" alt="" title="' . encode_field($hover) . '" class="left_image" />', 'basic', $hover) . $prefix;
}
// flag sections updated recently
if ($item['expiry_date'] > NULL_DATE && $item['expiry_date'] <= $context['now']) {
$suffix = EXPIRED_FLAG . ' ';
} elseif ($item['create_date'] >= $context['fresh']) {
$suffix = NEW_FLAG . ' ';
} elseif ($item['edit_date'] >= $context['fresh']) {
$suffix = UPDATED_FLAG . ' ';
}
// board introduction
if ($item['introduction']) {
$suffix .= '<br style="clear: none;" />' . Codes::beautify_introduction($item['introduction']);
}
// more details
$details = '';
$more = array();
// board moderators
if ($moderators = Sections::list_editors_by_name($item, 0, 7, 'comma5')) {
$more[] = sprintf(i18n::ns('Moderator: %s', 'Moderators: %s', count($moderators)), $moderators);
}
// children boards
if ($children =& Sections::list_by_title_for_anchor('section:' . $item['id'], 0, COMPACT_LIST_SIZE, 'comma')) {
$more[] = sprintf(i18n::ns('Child board: %s', 'Child boards: %s', count($children)), Skin::build_list($children, 'comma'));
}
// as a compact list
if (count($more)) {
$details .= '<ul class="compact">';
foreach ($more as $list_item) {
$details .= '<li>' . $list_item . '</li>' . "\n";
}
$details .= '</ul>' . "\n";
}
// all details
if ($details) {
$details = BR . '<span class="details">' . $details . "</span>\n";
}
// count posts here, and in children sections
$anchors = Sections::get_branch_at_anchor('section:' . $item['id']);
if (!($count = Articles::count_for_anchor($anchors))) {
$count = 0;
}
// get last post
$last_post = '--';
$article =& Articles::get_newest_for_anchor($anchors, TRUE);
if ($article['id']) {
//.........这里部分代码省略.........
示例2: sprintf
// the title of the page
$context['page_title'] = i18n::s('Codes to format lists');
// the date of last modification
if (Surfer::is_associate()) {
$context['page_details'] .= '<p class="details">' . sprintf(i18n::s('Edited %s'), Skin::build_date(getlastmod())) . '</p>';
}
// page header
$context['text'] .= '<p>' . i18n::s('On this page we are introducing some formatting codes and live examples of utilization.') . '</p>';
// add a toc
$context['text'] .= "\n" . '[toc]' . "\n";
// [*]
$context['text'] .= '[title]' . i18n::s('List item') . ' [escape][*][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('A simple list:') . "\n\n" . '[*]' . i18n::s('First item') . "\n\n" . '[*]' . i18n::s('Second item (after one empty line)') . "\n" . '[*]' . i18n::s('Third item (next the previous one)') . '[/escape]</td>' . '<td>' . i18n::s('A simple list:') . "\n\n" . '[*]' . i18n::s('First item') . "\n\n" . '[*]' . i18n::s('Second item (after one empty line)') . "\n" . '[*]' . i18n::s('Third item (next the previous one)') . '</td></tr>' . Skin::table_suffix();
// [list]...[/list]
$context['text'] .= '[title]' . i18n::s('Bulleted list') . ' [escape][list]...[/list][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('A list with bulleted items:') . "\n" . '[list]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list][/escape]</td>' . '<td>' . i18n::s('A list with bulleted items:') . "\n" . '[list]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list]</td></tr>' . Skin::table_suffix();
// [list=1]...[/list]
$context['text'] .= '[title]' . i18n::s('Numbered list') . ' [escape][list=1]...[/list][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('A list with numbered items:') . "\n" . '[list=1]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list][/escape]</td>' . '<td>' . i18n::s('A list with numbered items:') . "\n" . '[list=1]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list]</td></tr>' . Skin::table_suffix();
// [list=a]...[/list]
$context['text'] .= '[title]' . i18n::s('Numbered list') . ' [escape][list=a]...[/list][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('A list with alphabetically numbered items:') . "\n" . '[list=a]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list][/escape]</td>' . '<td>' . i18n::s('A list with alphabetically numbered items:') . "\n" . '[list=a]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list]</td></tr>' . Skin::table_suffix();
// [list=A]...[/list]
$context['text'] .= '[title]' . i18n::s('Numbered list') . ' [escape][list=A]...[/list][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('Another list with alphabetically numbered items:') . "\n" . '[list=A]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list][/escape]</td>' . '<td>' . i18n::s('Another list with alphabetically numbered items:') . "\n" . '[list=A]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list]</td></tr>' . Skin::table_suffix();
// [list=i]...[/list]
$context['text'] .= '[title]' . i18n::s('Numbered list') . ' [escape][list=i]...[/list][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('A list with roman numbers:') . "\n" . '[list=i]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list][/escape]</td>' . '<td>' . i18n::s('A list with roman numbers:') . "\n" . '[list=i]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list]</td></tr>' . Skin::table_suffix();
// [list=I]...[/list]
$context['text'] .= '[title]' . i18n::s('Numbered list') . ' [escape][list=I]...[/list][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('Another list with roman numbers:') . "\n" . '[list=I]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list][/escape]</td>' . '<td>' . i18n::s('Another list with roman numbers:') . "\n" . '[list=I]' . "\n" . '[*]' . i18n::s('First item') . "\n" . '[*]' . i18n::s('Second item') . "\n" . '[/list]</td></tr>' . Skin::table_suffix();
// transform the text
$context['text'] = Codes::beautify($context['text']);
// general help on this page
$help = '<p>' . sprintf(i18n::s('Please note that actual rendering depends on the selected %s.'), Skin::build_link('skins/', i18n::s('skin'), 'shortcut')) . '</p>';
$context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
// render the skin
render_skin();
示例3: sprintf
// [category.description=id]
$context['text'] .= '[title]' . i18n::s('Category') . ' [escape][category.description=<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][category.description=featured][/escape]</td>' . '<td>[category.description=featured]</td></tr>' . Skin::table_suffix();
// [user=id]
$context['text'] .= '[title]' . i18n::s('User shortcut') . ' [escape][user=<id>] [user=<id>, <label>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . sprintf(i18n::s('Have a look at %s'), '[user=' . Surfer::get_id() . ']') . '[/escape]</td>' . '<td>' . sprintf(i18n::s('Have a look at %s'), '[user=' . Surfer::get_id() . ']') . '</td></tr>' . Skin::table_suffix();
// [server=id]
$context['text'] .= '[title]' . i18n::s('Server shortcut') . ' [escape][server=<id>] [server=<id>, <label>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('Click to view the page of [server=2, this server]') . '[/escape]</td>' . '<td>' . i18n::s('Click to view the page of [server=2, this server]') . '</td></tr>' . Skin::table_suffix();
// [file=id]
$context['text'] .= '[title]' . i18n::s('File shortcut') . ' [escape][file=<id>] [file=<id>, <label>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . sprintf(i18n::s('Have a look at %s'), '[file=' . $file_id . ']') . '[/escape]</td>' . '<td>' . sprintf(i18n::s('Have a look at %s'), '[file=' . $file_id . ']') . '</td></tr>' . Skin::table_suffix();
// [download=id]
$context['text'] .= '[title]' . i18n::s('Download shortcut') . ' [escape][download=<id>] [download=<id>, <label>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . sprintf(i18n::s('Click to %s'), '[download=' . $file_id . ', ' . i18n::s('download the file') . ']') . '[/escape]</td>' . '<td>' . sprintf(i18n::s('Click to %s'), '[download=' . $file_id . ', ' . i18n::s('download the file') . ']') . '</td></tr>' . Skin::table_suffix();
// [clicks=id]
$context['text'] .= '[title]' . i18n::s('Member clicks') . ' [escape][clicks=<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][clicks=' . $file_id . '][/escape]</td>' . '<td>[clicks=' . $file_id . ']</td></tr>' . Skin::table_suffix();
// [action=id]
$context['text'] .= '[title]' . i18n::s('Action shortcut') . ' [escape][action=<id>] [action=<id>, <label>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('Click to view the page of [action=2, this action]') . '[/escape]</td>' . '<td>' . i18n::s('Click to view the page of [action=2, this action]') . '</td></tr>' . Skin::table_suffix();
// [comment=id]
$context['text'] .= '[title]' . i18n::s('Comment shortcut') . ' [escape][comment=<id>] [comment=<id>, <label>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('Click to view the page of [comment=2, this comment]') . '[/escape]</td>' . '<td>' . i18n::s('Click to view the page of [comment=2, this comment]') . '</td></tr>' . Skin::table_suffix();
// [script]index.php[/script]
$context['text'] .= '[title]' . i18n::s('Script shortcut') . ' [escape][script]<path/script.php>[/script][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('You can access the documentation for the script [script]shared/codes.php[/script]') . '[/escape]</td>' . '<td>' . i18n::s('You can access the documentation for the script [script]shared/codes.php[/script]') . '</td></tr>' . Skin::table_suffix();
// [search=yacs]
$context['text'] .= '[title]' . i18n::s('Search') . ' [escape][search] [search=<words>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('All you want to know on [search=yacs]') . '[/escape]</td>' . '<td>' . i18n::s('All you want to know on [search=yacs]') . '</td></tr>' . Skin::table_suffix();
// [wikipedia=keyword, label]
$context['text'] .= '[title]' . i18n::s('Wikipedia') . ' [escape][wikipedia=keyword] [wikipedia=keyword, label][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('All you want to know on [wikipedia=Web_2, the web 2.0]') . '[/escape]</td>' . '<td>' . i18n::s('All you want to know on [wikipedia=Web_2, the web 2.0]') . '</td></tr>' . Skin::table_suffix();
// [proxy]url[/proxy]
$context['text'] .= '[title]' . i18n::s('Proxy') . ' [escape][proxy]web address[/proxy][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][proxy]http://www.google.com/[/proxy][/escape]</td>' . '<td>[proxy]http://www.google.com/[/proxy]</td></tr>' . Skin::table_suffix();
// transform the text
$context['text'] = Codes::beautify($context['text']);
// general help on this page
$help = '<p>' . sprintf(i18n::s('Please note that actual rendering depends on the selected %s.'), Skin::build_link('skins/', i18n::s('skin'), 'shortcut')) . '</p>';
$context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
// render the skin
render_skin();
示例4: array
$cells = array(i18n::s('Downloads'), 'left=' . Skin::build_number($item['hits'], i18n::s('downloads')));
$context['text'] .= Skin::table_row($cells, $lines++);
}
// the first poster
if ($item['create_name']) {
$cells = array(i18n::s('Posted by'), $item['create_name']);
$context['text'] .= Skin::table_row($cells, $lines++);
}
// the last poster
if ($item['edit_name'] != $item['create_name']) {
$cells = array(i18n::s('Updated by'), $item['edit_name']);
$context['text'] .= Skin::table_row($cells, $lines++);
}
// date of last action
$cells = array(i18n::s('Last action'), Skin::build_date($item['edit_date']));
$context['text'] .= Skin::table_row($cells, $lines++);
// associates may change the active flag: Yes/public, Restricted/logged, No/associates
if (Surfer::is_associate()) {
if ($item['active'] == 'N' && Surfer::is_associate()) {
$context['text'] .= Skin::table_row(array(i18n::s('Access'), 'left=' . i18n::s('Private - Access is restricted to selected persons')), $lines++);
} elseif ($item['active'] == 'R' && Surfer::is_member()) {
$context['text'] .= Skin::table_row(array(i18n::s('Access'), 'left=' . i18n::s('Community -Access is granted to any identified surfer')), $lines++);
}
}
// end of the table
$context['text'] .= Skin::table_suffix();
// count items related to this file
$context['text'] .= Anchors::stat_related_to('file:' . $item['id'], i18n::s('Following items are attached to this record and will be deleted as well.'));
}
// render the skin
render_skin();
示例5: render_static_table
/**
* render a table
*
* @param string the table content
* @param string the variant, if any
* @return string the rendered text
**/
public static function render_static_table($content, $variant = '')
{
global $context;
// we are providing inline tables
if ($variant) {
$variant = 'inline ' . $variant;
} else {
$variant = 'inline';
}
// do we have headers to proceed?
$in_body = !preg_match('/\\[body\\]/i', $content);
// start at first line, except if headers have to be printed first
if ($in_body) {
$count = 1;
} else {
$count = 2;
}
// split lines
$rows = explode("\n", $content);
if (!is_array($rows)) {
return '';
}
// one row per line - cells are separated by |, \t, or 2 spaces
$text =& Skin::table_prefix($variant);
foreach ($rows as $row) {
// skip blank lines
if (!$row) {
continue;
}
// header row
if (!$in_body) {
if (preg_match('/\\[body\\]/i', $row)) {
$in_body = true;
} else {
$text .= Skin::table_row(preg_split("/([\\|\t]| " . " )/", $row), 'header');
}
// body row
} else {
$text .= Skin::table_row(preg_split("/([\\|\t]| " . " )/", $row), $count++);
}
}
// return the complete table
$text .= Skin::table_suffix();
return $text;
}
示例6: build
//.........这里部分代码省略.........
$item_bar += array(Tables::get_url($id, 'edit') => i18n::s('edit'));
}
if (count($item_bar)) {
$text .= '<caption>' . Skin::build_list($item_bar, 'menu') . "</caption>\n";
}
}
// column headers are clickable links
$cells = array();
$index = 0;
while ($field = SQL::fetch_field($rows)) {
if ($index++ != 0 || $table['with_zoom'] != 'Y') {
$cells[] = ucfirst($field->name);
}
}
$text .= "\t\t" . Skin::table_row($cells, 'sortable');
// the table body
$count = 0;
$row_index = 0;
while ($row = SQL::fetch_row($rows)) {
$cells = array();
$link = '';
for ($index = 0; $index < count($row); $index++) {
if ($index == 0 && $table['with_zoom'] == 'Y') {
$link = $row[$index];
} elseif ($link) {
$cells[] = Skin::build_link($link, $row[$index]);
$link = '';
} else {
$cells[] = $row[$index];
}
}
$text .= "\t\t" . Skin::table_row($cells, $count++);
}
$text .= Skin::table_suffix();
return $text;
// adapted to open chart flash
// adapted to open chart flash
case 'chart':
// get title for y series
$y_title = $y2_title = $y3_title = NULL;
$y_index = $y2_index = $y3_index = 0;
$index = 0;
while ($field = SQL::fetch_field($rows)) {
// time will be used for x labels
if ($index == 0 && $table['with_zoom'] == 'T') {
} elseif ($index == 0 && $table['with_zoom'] == 'Y') {
} elseif (!$y_title) {
$y_title = '"' . ucfirst($field->name) . '"';
$y_index = $index;
} elseif (!$y2_title) {
$y2_title = '"' . ucfirst($field->name) . '"';
$y2_index = $index;
} elseif (!$y3_title) {
$y3_title = '"' . ucfirst($field->name) . '"';
$y3_index = $index;
break;
}
$index++;
}
// process every table row
$x_labels = array();
$y_values = array();
$y2_values = array();
$y3_values = array();
$y_min = $y_max = NULL;
$count = 1;
示例7: sprintf
// [sections=self]
$context['text'] .= '[title]' . i18n::s('Assigned sections') . ' [escape][sections=self] [sections=user:<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][sections.folded=self][/escape]</td>' . '<td>[sections.folded=self]</td></tr>' . Skin::table_suffix();
// [categories]
$context['text'] .= '[title]' . i18n::s('Categories') . ' [escape][categories] [categories=category:<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][categories][/escape]</td>' . '<td>[categories]</td></tr>' . Skin::table_suffix();
// [categories=self]
$context['text'] .= '[title]' . i18n::s('Assigned categories') . ' [escape][categories=self] [categories=user:<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][categories=self][/escape]</td>' . '<td>[categories=self]</td></tr>' . Skin::table_suffix();
// [published]
$context['text'] .= '[title]' . i18n::s('Recent pages') . ' [escape][published] [published=section:<id>] [published=category:<id>][/escape][/title]' . '<p>' . i18n::s('Use the simplest form to display a compact list of pages, or limit the scope.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][published.decorated][/escape]</td>' . '<td>[published.decorated]</td></tr>' . Skin::table_suffix();
// [published=self]
$context['text'] .= '[title]' . i18n::s('Personal pages') . ' [escape][published=self] [published=user:<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][published=self, 20][/escape]</td>' . '<td>[published=self, 20]</td></tr>' . Skin::table_suffix();
// [updated]
$context['text'] .= '[title]' . i18n::s('Recent updates') . ' [escape][updated] [updated=section:<id>] [updated=category:<id>][/escape][/title]' . '<p>' . i18n::s('Use the simplest form to display a compact list of pages, or limit the scope.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][updated.timeline][/escape]</td>' . '<td>[updated.timeline]</td></tr>' . Skin::table_suffix();
// [updated=self]
$context['text'] .= '[title]' . i18n::s('Personal updates') . ' [escape][updated=self] [updated=user:<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][updated=self, 12][/escape]</td>' . '<td>[updated=self, 12]</td></tr>' . Skin::table_suffix();
// [read]
$context['text'] .= '[title]' . i18n::s('Hall of fame') . ' [escape][read] [read=section:<id>][/escape][/title]' . '<p>' . i18n::s('Use the simplest form to display a compact list of pages, or limit the scope.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][read][/escape]</td>' . '<td>[read]</td></tr>' . Skin::table_suffix();
// [read=self]
$context['text'] .= '[title]' . i18n::s('Personal hits') . ' [escape][read=self] [read=user:<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][read=self][/escape]</td>' . '<td>[read=self]</td></tr>' . Skin::table_suffix();
// [voted]
$context['text'] .= '[title]' . i18n::s('Hall of fame') . ' [escape][voted] [voted=section:<id>][/escape][/title]' . '<p>' . i18n::s('Use the simplest form to display a compact list of pages, or limit the scope.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][voted][/escape]</td>' . '<td>[voted]</td></tr>' . Skin::table_suffix();
// [voted=self]
$context['text'] .= '[title]' . i18n::s('Personal hits') . ' [escape][voted=self] [voted=user:<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][voted=self][/escape]</td>' . '<td>[voted=self]</td></tr>' . Skin::table_suffix();
// [users=present]
$context['text'] .= '[title]' . i18n::s('Present users') . ' [escape][users=present][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][users=present][/escape]</td>' . '<td>[users=present]</td></tr>' . Skin::table_suffix();
// transform the text
$context['text'] = Codes::beautify($context['text']);
// general help on this page
$help = '<p>' . sprintf(i18n::s('Please note that actual rendering depends on the selected %s.'), Skin::build_link('skins/', i18n::s('skin'), 'shortcut')) . '</p>';
$context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
// render the skin
render_skin();
示例8: foreach
/**
* build a complete table
*
* @param array headers
* @param array rows of cells
* @param string a variant, if any, as decribed for table_prefix()
* @return a string to be sent to the browser
*/
public static function &table($headers, &$rows, $variant = 'yc-grid')
{
$text =& Skin::table_prefix($variant);
if (isset($headers) && is_array($headers)) {
$text .= Skin::table_row($headers, 'sortable');
}
$row_count = 1;
if (is_array($rows)) {
foreach ($rows as $cells) {
$text .= Skin::table_row($cells, $row_count++);
}
}
$text .= Skin::table_suffix();
return $text;
}
示例9: sprintf
{ "type": "line", "values": [ 2, 2, 2, 2, 2, 2, 2 ], "dot-style": { "type": "star", "colour": "#8000FF", "dot-size": 4 }, "width": 1, "colour": "#8000FF", "tip": "Purple #val#", "text": "Mr Purple", "font-size": 10, "loop": true } ],
"title": { "text": "Radar Chart" },
"radar_axis": { "max": 5, "colour": "#DAD5E0", "grid-colour": "#DAD5E0", "labels": { "labels": [ "Zero", "", "", "Middle", "", "High" ], "colour": "#9F819F" }, "spoke-labels": { "labels": [ "Strength", "Smarts", "Sweet Tooth", "Armour", "Max Hit Points", "foo", "bar" ], "colour": "#9F819F" } }, "tooltip": { "mouse": 1 },
"bg_colour": "#ffffff" }';
// [chart]...[/chart]
$context['text'] .= '[title]' . i18n::s('Static chart') . ' [escape][chart]...[/chart][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][chart=320, 256]' . "\n" . $chart_data . "\n" . '[/chart][/escape]</td>' . '<td>[chart=320, 256]' . "\n" . $chart_data . "\n" . '[/chart]</td></tr>' . Skin::table_suffix();
// [execute=tools/echo.php]
$context['text'] .= '[title]' . i18n::s('Execute a local script') . ' [escape][execute=tools/echo.php][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][execute=tools/echo.php][/escape]</td>' . '<td>[execute=tools/echo.php]</td></tr>' . Skin::table_suffix();
// [redirect=tools/echo.php]
$context['text'] .= '[title]' . i18n::s('Redirect to a local address') . ' [escape][redirect=tools/echo.php][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example')), 'header') . '<tr><td class="sample">[escape][redirect=tools/echo.php][/escape]</td></tr>' . Skin::table_suffix();
// [parameter=page_details]
$context['text'] .= '[title]' . i18n::s('Display some parameter') . ' [escape][parameter=site_name][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][parameter=site_name][/escape]</td>' . '<td>[parameter=site_name]</td></tr>' . Skin::table_suffix();
// [escape]...[/escape]
$context['text'] .= '[title]' . i18n::s('Prevent code interpretation') . ' [escape][escape]...[/escape][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][escape]hello world[new][/escape][/escape]</td>' . '<td>[escape]hello world[new][/escape]</td></tr>' . Skin::table_suffix();
// [anonymous]...[/anonymous]
$context['text'] .= '[title]' . i18n::s('Displayed only to anonymous surfers') . ' [escape][anonymous]...[/anonymous][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][anonymous]' . i18n::s('Displayed only to anonymous surfers') . '[/anonymous][/escape]</td>' . '<td>[anonymous]' . i18n::s('Displayed only to anonymous surfers') . '[/anonymous]</td></tr>' . Skin::table_suffix();
// [authenticated]...[/authenticated]
$context['text'] .= '[title]' . i18n::s('Displayed only to authenticated surfers') . ' [escape][authenticated]...[/authenticated][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][authenticated]' . i18n::s('Displayed only to authenticated surfers') . '[/authenticated][/escape]</td>' . '<td>[authenticated]' . i18n::s('Displayed only to authenticated surfers') . '[/authenticated]</td></tr>' . Skin::table_suffix();
// [associate]...[/associate]
$context['text'] .= '[title]' . i18n::s('Displayed only to associates') . ' [escape][associate]...[/associate][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][associate]' . i18n::s('Displayed only to associates') . '[/associate][/escape]</td>' . '<td>[associate]' . i18n::s('Displayed only to associates') . '[/associate]</td></tr>' . Skin::table_suffix();
// transform the text
$context['text'] = Codes::beautify($context['text']);
// general help on this page
$help = '<p>' . sprintf(i18n::s('Please note that actual rendering depends on the selected %s.'), Skin::build_link('skins/', i18n::s('skin'), 'shortcut')) . '</p>';
$context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
// render the skin
render_skin();
示例10: layout
/**
* list articles as slashdot do
*
* @param resource the SQL result
* @return string the rendered text
*
* @see layouts/layout.php
**/
function layout($result)
{
global $context;
// we return some text
$text = '';
// empty list
if (!SQL::count($result)) {
return $text;
}
// layout in a table
$text = Skin::table_prefix('wide');
// 'even' is used for title rows, 'odd' for detail rows
$class_title = 'odd';
$class_detail = 'even';
// build a list of sections
$family = '';
include_once $context['path_to_root'] . 'articles/article.php';
include_once $context['path_to_root'] . 'comments/comments.php';
include_once $context['path_to_root'] . 'links/links.php';
while ($item = SQL::fetch($result)) {
// change the family
if ($item['family'] != $family) {
$family = $item['family'];
// show the family
$text .= Skin::table_suffix() . '<h2><span>' . $family . ' </span></h2>' . "\n" . Skin::table_prefix('wide');
}
// document this section
$content = $prefix = $title = $suffix = $icon = '';
$menu = array();
// permalink
$url = Sections::get_permalink($item);
// get the anchor
$anchor = Anchors::get($item['anchor']);
// get the related overlay, if any
$overlay = Overlay::load($item, 'section:' . $item['id']);
// use the title to label the link
if (is_object($overlay)) {
$title = Codes::beautify_title($overlay->get_text('title', $item));
} else {
$title = Codes::beautify_title($item['title']);
}
// signal restricted and private sections
if ($item['active'] == 'N') {
$prefix .= PRIVATE_FLAG;
} elseif ($item['active'] == 'R') {
$prefix .= RESTRICTED_FLAG;
}
// this is another row of the output
$text .= '<tr class="' . $class_title . '"><th>' . $prefix . Skin::build_link($url, $title, 'basic', i18n::s('View the section')) . $suffix . '</th></tr>' . "\n";
// document most recent page here
$content = $prefix = $title = $suffix = $icon = '';
$menu = array();
// branches of this tree
$anchors = Sections::get_branch_at_anchor('section:' . $item['id']);
// get last post
$article =& Articles::get_newest_for_anchor($anchors, TRUE);
if ($article['id']) {
// permalink
$url = Articles::get_permalink($article);
// get the anchor
$anchor = Anchors::get($article['anchor']);
// get the related overlay, if any
$overlay = Overlay::load($item, 'section:' . $item['id']);
// use the title to label the link
if (is_object($overlay)) {
$title = Codes::beautify_title($overlay->get_text('title', $article));
} else {
$title = Codes::beautify_title($article['title']);
}
// signal restricted and private articles
if ($article['active'] == 'N') {
$prefix .= PRIVATE_FLAG;
} elseif ($article['active'] == 'R') {
$prefix .= RESTRICTED_FLAG;
}
// the icon to put aside
if ($article['thumbnail_url']) {
$icon = $article['thumbnail_url'];
}
// the icon to put aside
if (!$icon && is_callable(array($anchor, 'get_bullet_url'))) {
$icon = $anchor->get_bullet_url();
}
if ($icon) {
$icon = '<a href="' . $context['url_to_root'] . $url . '"><img src="' . $icon . '" class="right_image" alt="" title="' . encode_field(i18n::s('View the page')) . '" /></a>';
}
// the introductory text
if ($article['introduction']) {
$content .= Codes::beautify_introduction($article['introduction']);
} elseif (!is_object($overlay)) {
$handle = new Article();
$handle->load_by_content($article);
//.........这里部分代码省略.........
示例11: stat_related_to
//.........这里部分代码省略.........
$cells[] = i18n::s('Pages');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
}
// stats for related images
include_once $context['path_to_root'] . 'images/images.php';
if (($stats = Images::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Images');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// stats for related locations
include_once $context['path_to_root'] . 'locations/locations.php';
if (($stats = Locations::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Locations');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// stats for related tables
include_once $context['path_to_root'] . 'tables/tables.php';
if (($stats = Tables::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Tables');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// stats for related files
if (($stats = Files::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Files');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// stats for related dates
include_once $context['path_to_root'] . 'dates/dates.php';
if (($stats = Dates::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Dates');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// stats for related comments
include_once $context['path_to_root'] . 'comments/comments.php';
if (($stats = Comments::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Comments');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// stats for related links
include_once $context['path_to_root'] . 'links/links.php';
if (($stats = Links::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Links');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// stats for related versions
include_once $context['path_to_root'] . 'versions/versions.php';
if (($stats = Versions::stat_for_anchor($anchor)) && $stats['count']) {
$cells = array();
$cells[] = i18n::s('Versions');
$cells[] = 'center=' . $stats['count'];
$cells[] = 'center=' . Skin::build_date($stats['oldest_date']);
$cells[] = 'center=' . Skin::build_date($stats['newest_date']);
$related .= Skin::table_row($cells, $lines++);
}
// ensure we have a label
if (!$label) {
$label = i18n::s('Following items are attached to this record and will be impacted as well.');
}
// stats for related items in a neat table
if ($related) {
// make a nice table
$related = '<p>' . $label . "</p>\n" . Skin::table_prefix('') . Skin::table_row(array(i18n::s('Table'), i18n::s('Records'), i18n::s('Creation date'), i18n::s('Last edition')), 'header') . $related . Skin::table_suffix();
// put it in a box
$related = Skin::build_box(i18n::s('Related items'), $related);
}
// job done
return $related;
}
示例12: sprintf
// the title of the page
$context['page_title'] = i18n::s('Codes to format tables');
// the date of last modification
if (Surfer::is_associate()) {
$context['page_details'] .= '<p class="details">' . sprintf(i18n::s('Edited %s'), Skin::build_date(getlastmod())) . '</p>';
}
// page header
$context['text'] .= '<p>' . i18n::s('On this page we are showing how to build simple tables. Use the char |, or tab, or two successive spaces, to separate column elements.') . '</p>';
// add a toc
$context['text'] .= "\n" . '[toc]' . "\n";
// [table]...[/table]
$context['text'] .= '[title]' . i18n::s('Table') . ' [escape][table]...[/table][/escape][/title]' . '<p>' . i18n::s('In this example cells are separated by tabulation characters or by 2 spaces.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][table]' . "\n" . i18n::s('Rabbit') . "\t" . i18n::s('Turtle') . "\n" . i18n::s('Stories') . ' ' . i18n::s('Jean[nl]de la Fontaine') . "\n" . '[/table][/escape]</td>' . '<td>[table]' . "\n" . i18n::s('Rabbit') . "\t" . i18n::s('Turtle') . "\n" . i18n::s('Stories') . ' ' . i18n::s('Jean[nl]de la Fontaine') . "\n" . '[/table]</td></tr>' . Skin::table_suffix();
// [table=grid]...[/table]
$context['text'] .= '[title]' . i18n::s('Table') . ' [escape][table=grid]...[/table][/escape][/title]' . '<p>' . i18n::s('In this example cells are separated by the | character.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][table=grid]' . "\n" . i18n::s('Rabbit|Turtle') . "\n" . i18n::s('Stories|Jean[nl]de la Fontaine') . "\n" . '[/table][/escape]</td>' . '<td>[table=grid]' . "\n" . i18n::s('Rabbit|Turtle') . "\n" . i18n::s('Stories|Jean[nl]de la Fontaine') . "\n" . '[/table]</td></tr>' . Skin::table_suffix();
// [table=tiny]...[/table]
$context['text'] .= '[title]' . i18n::s('Table') . ' [escape][table=tiny]...[/table][/escape][/title]' . '<p>Actually any style can be applied to the generated table.</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][table=tiny]' . "\n" . i18n::s('Rabbit|Turtle') . "\n" . i18n::s('Stories|Jean[nl]de la Fontaine') . "\n" . '[/table][/escape]</td>' . '<td>[table=tiny]' . "\n" . i18n::s('Rabbit|Turtle') . "\n" . i18n::s('Stories|Jean[nl]de la Fontaine') . "\n" . '[/table]</td></tr>' . Skin::table_suffix();
// [table]...[body]...[/table]
$context['text'] .= '[title]' . i18n::s('Separate headers from the body') . ' [escape][table]...[body]...[/table][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][table=grid]' . "\n" . i18n::s('First Name|Last Name') . "\n" . '[body]' . "\n" . i18n::s('Rabbit|Turtle') . "\n" . i18n::s('Stories|Jean[nl]de la Fontaine') . "\n" . '[/table][/escape]</td>' . '<td>[table=grid]' . "\n" . i18n::s('First Name|Last Name') . "\n" . '[body]' . "\n" . i18n::s('Rabbit|Turtle') . "\n" . i18n::s('Stories|Jean[nl]de la Fontaine') . "\n" . '[/table]</td></tr>' . Skin::table_suffix();
// cells alignment
$context['text'] .= '[title]' . i18n::s('Explicit cells alignment') . '[/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][table=grid]' . "\n" . 'left=' . i18n::s('Full Name') . '| center=' . i18n::s('Birth Year') . '| right=' . i18n::s('Net income') . "\n" . '[body]' . "\n" . 'right=' . i18n::s('Speedy Rabbit') . '|center=1888|$11,230' . "\n" . 'center=' . i18n::s('Jean de la Fontaine') . '|center=1675|$234,567' . "\n" . '[/table][/escape]</td>' . '<td>[table=grid]' . "\n" . 'left=' . i18n::s('Full Name') . '| center=' . i18n::s('Birth Year') . '| right=' . i18n::s('Net income') . "\n" . '[body]' . "\n" . 'right=' . i18n::s('Speedy Rabbit') . '|center=1888|$11,230' . "\n" . 'center=' . i18n::s('Jean de la Fontaine') . '|center=1675|$234,567' . "\n" . '[/table]</td></tr>' . Skin::table_suffix();
// [table]...[csv]...[/csv]...[/table]
$context['text'] .= '[title]' . i18n::s('Comma-separated values') . ' [escape][table][csv]...[/csv][/table][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][table=grid]' . "\n" . '[csv]' . "\n" . i18n::s('Net income for the year,$2.310') . "\n" . i18n::s('Net income for last year,$2.100') . "\n" . i18n::s('Net income increase,10%') . "\n" . '[/csv]' . "\n" . '[/table][/escape]</td>' . '<td>[table=grid]' . "\n" . '[csv]' . "\n" . i18n::s('Net income for the year,$2.310') . "\n" . i18n::s('Net income for last year,$2.100') . "\n" . i18n::s('Net income increase,10%') . "\n" . '[/csv]' . "\n" . '[/table]</td></tr>' . Skin::table_suffix();
// [table]...[csv=;]...[/csv]...[/table]
$context['text'] .= '[title]' . i18n::s('Comma-separated values') . ' [escape][table][csv=;]...[/csv][/table][/escape][/title]' . '<p>' . i18n::s('Using a different separator between cells.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][table=grid]' . "\n" . '[csv=;]' . "\n" . i18n::s('Net income for the year;$2.310') . "\n" . i18n::s('Net income for last year;$2.100') . "\n" . i18n::s('Net income increase;10%') . "\n" . '[/csv]' . "\n" . '[/table][/escape]</td>' . '<td>[table=grid]' . "\n" . '[csv=;]' . "\n" . i18n::s('Net income for the year;$2.310') . "\n" . i18n::s('Net income for last year;$2.100') . "\n" . i18n::s('Net income increase;10%') . "\n" . '[/csv]' . "\n" . '[/table]</td></tr>' . Skin::table_suffix();
// transform the text
$context['text'] = Codes::beautify($context['text']);
// general help on this page
$help = '<p>' . sprintf(i18n::s('Please note that actual rendering depends on the selected %s.'), Skin::build_link('skins/', i18n::s('skin'), 'shortcut')) . '</p>';
$context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
// render the skin
render_skin();
示例13: array
}
// the capability field - associate, member, or subscriber
$cells = array();
$cells[] = i18n::s('Your status');
if (Surfer::is_associate()) {
$cells[] = 'left=' . i18n::s('As an associate of this community, you may contribute freely to any part of this server.');
} elseif (Surfer::is_member()) {
$cells[] = 'left=' . i18n::s('As a member of this community, you may access freely most pages of this server.');
} else {
$cells[] = 'left=' . i18n::s('As a subscriber of this community, you may freely access most pages of this server.');
}
if (isset($cells[1])) {
$information .= Skin::table_row($cells, $lines++);
}
// end of the table
$information .= Skin::table_suffix();
// display in a separate panel
$panels[] = array('information', i18n::s('You'), 'information_panel', $information);
//
// assemble all tabs
//
$context['text'] .= Skin::build_tabs($panels);
// follow-up commands
$follow_up = i18n::s('Where do you want to go now?');
$menu = array();
if (isset($_REQUEST['login_forward'])) {
$menu[] = Skin::build_link($_REQUEST['login_forward'], i18n::s('Move forward'), 'button');
} elseif (isset($_SERVER['HTTP_REFERER']) && !preg_match('/users\\/login\\.php/', $_SERVER['HTTP_REFERER'])) {
$menu[] = Skin::build_link($_SERVER['HTTP_REFERER'], i18n::s('Move forward'), 'button');
} else {
$menu[] = Skin::build_link($context['url_to_root'], i18n::s('Front page'), 'button');
示例14: sprintf
// the date of last modification
if (Surfer::is_associate()) {
$context['page_details'] .= '<p class="details">' . sprintf(i18n::s('Edited %s'), Skin::build_date(getlastmod())) . '</p>';
}
// page header
$context['text'] .= '<p>' . i18n::s('On this page we are introducing codes related to widgets and badges.') . '</p>';
// add a toc
$context['text'] .= "\n" . '[toc]' . "\n";
// [newsfeed]
$context['text'] .= '[title]' . i18n::s('Newsfeed') . ' [escape][newsfeed=<url>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][newsfeed=http://www.yacs.fr/feeds/rss.php][/escape]</td>' . '<td>[newsfeed=http://www.yacs.fr/feeds/rss.php]</td></tr>' . Skin::table_suffix();
// [newsfeed.embed]
$context['text'] .= '[title]' . i18n::s('Newsfeed') . ' [escape][newsfeed.embed=<url>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][newsfeed.embed=http://www.yacs.fr/feeds/rss.php][/escape]</td>' . '<td>[newsfeed.embed=http://www.yacs.fr/feeds/rss.php]</td></tr>' . Skin::table_suffix();
// [twitter]
$context['text'] .= '[title]' . i18n::s('Twitter profile') . ' [escape][twitter=<id>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][twitter=bernard357][/escape]</td>' . '<td>[twitter=bernard357]</td></tr>' . Skin::table_suffix();
// [tsearch]
$context['text'] .= '[title]' . i18n::s('Twitter search') . ' [escape][tsearch=<keyword>][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][tsearch=#yacs][/escape]</td>' . '<td>[tsearch=#yacs]</td></tr>' . Skin::table_suffix();
// [iframe]
$context['text'] .= '[title]' . i18n::s('External page') . ' [escape][iframe=<width>, <height>]<url>[/iframe][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][iframe=500, 320]http://www.cisco.com/[/iframe][/escape]</td>' . '<td>[iframe=500, 320]http://www.cisco.com/[/iframe]</td></tr>' . Skin::table_suffix();
// [cloud]
$context['text'] .= '[title]' . i18n::s('Cloud of tags') . ' [escape][cloud] [cloud=<40>][/escape][/title]' . '<p>' . i18n::s('Use the parameter to adjust the number of tags listed.') . '</p>' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][cloud][/escape]</td>' . '<td>[cloud]</td></tr>' . Skin::table_suffix();
// [calendar]
$context['text'] .= '[title]' . i18n::s('Events') . ' [escape][calendar][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][calendar][/escape]</td>' . '<td>[calendar]</td></tr>' . Skin::table_suffix();
// [location=latitude, longitude, label]
$context['text'] .= '[title]' . i18n::s('Direct location') . ' [escape][location=latitude, longitude, label][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][location=48.871264, 2.307558, Paris][/escape]</td>' . '<td>[location=48.871264, 2.307558, Paris]</td></tr>' . Skin::table_suffix();
// transform the text
$context['text'] = Codes::beautify($context['text']);
// general help on this page
$help = '<p>' . sprintf(i18n::s('Please note that actual rendering depends on the selected %s.'), Skin::build_link('skins/', i18n::s('skin'), 'shortcut')) . '</p>';
$context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
// render the skin
render_skin();
示例15: sprintf
// ++...++
$context['text'] .= '[title]' . i18n::s('Wiki insertion') . ' [escape]++...++[/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('This text ++has been inserted++.') . '[/escape]</td>' . '<td>' . i18n::s('This text ++has been inserted++.') . '</td></tr>' . Skin::table_suffix();
// [inserted]...[/inserted]
$context['text'] .= '[title]' . i18n::s('Inserted') . ' [escape][inserted]...[/inserted][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('This text [inserted]has been inserted[/inserted].') . '[/escape]</td>' . '<td>' . i18n::s('This text [inserted]has been inserted[/inserted].') . '</td></tr>' . Skin::table_suffix();
// --...--
$context['text'] .= '[title]' . i18n::s('Wiki deletion') . ' [escape]--...--[/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('This text --has been deleted--.') . '[/escape]</td>' . '<td>' . i18n::s('This text --has been deleted--.') . '</td></tr>' . Skin::table_suffix();
// [deleted]...[/deleted]
$context['text'] .= '[title]' . i18n::s('Deleted') . ' [escape][deleted]...[/deleted][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('This text [deleted]has been deleted[/deleted].') . '[/escape]</td>' . '<td>' . i18n::s('This text [deleted]has been deleted[/deleted].') . '</td></tr>' . Skin::table_suffix();
// [flag]...[/flag]
$context['text'] .= '[title]' . i18n::s('Flag') . ' [escape][flag]...[/flag][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('[flag]important![/flag] Don\'t forget to give something to your cat today.') . '[/escape]</td>' . '<td>' . i18n::s('[flag]important![/flag] Don\'t forget to give something to your cat today.') . '</td></tr>' . Skin::table_suffix();
// [lang=xy]...[/lang]
$context['text'] .= '[title]' . i18n::s('Language') . ' [escape][lang=xy]...[/lang][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][lang=en]This is in English[/lang][lang=fr]Ceci est en français[/lang][/escape]</td>' . '<td>[lang=en]This is in English[/lang][lang=fr]Ceci est en français[/lang]</td></tr>' . Skin::table_suffix();
// [style=serif]...[/style]
$context['text'] .= '[title]' . i18n::s('Serif') . ' [escape][style=serif]...[/style][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][style=serif]' . i18n::s('This text is in Serif.') . '[/style][/escape]</td>' . '<td>[style=serif]' . i18n::s('This text is in Serif.') . '[/style]</td></tr>' . Skin::table_suffix();
// [style=sans-serif]...[/style]
$context['text'] .= '[title]' . i18n::s('Sans-Serif') . ' [escape][style=sans-serif]...[/style][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][style=sans-serif]' . i18n::s('This text is in Sans-Serif.') . '[/style][/escape]</td>' . '<td>[style=sans-serif]' . i18n::s('This text is in Sans-Serif.') . '[/style]</td></tr>' . Skin::table_suffix();
// [style=cursive]...[/style]
$context['text'] .= '[title]' . i18n::s('Cursive') . ' [escape][style=cursive]...[/style][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][style=cursive]' . i18n::s('This text is in Cursive.') . '[/style][/escape]</td>' . '<td>[style=cursive]' . i18n::s('This text is in Cursive.') . '[/style]</td></tr>' . Skin::table_suffix();
// [style=fantasy]...[/style]
$context['text'] .= '[title]' . i18n::s('Fantasy') . ' [escape][style=fantasy]...[/style][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][style=fantasy]' . i18n::s('This text is in Fantasy.') . '[/style][/escape]</td>' . '<td>[style=fantasy]' . i18n::s('This text is in Fantasy.') . '[/style]</td></tr>' . Skin::table_suffix();
// [style=comic]...[/style]
$context['text'] .= '[title]' . i18n::s('Comic') . ' [escape][style=comic]...[/style][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][style=comic]' . i18n::s('This text is in Comic.') . '[/style][/escape]</td>' . '<td>[style=comic]' . i18n::s('This text is in Comic.') . '[/style]</td></tr>' . Skin::table_suffix();
// [style]...[/style]
$context['text'] .= '[title]' . i18n::s('Use any style') . ' [escape][style=<style name>]...[/style][/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape][style=my_style]' . i18n::s('But where will this rabbit be in some minutes? I don\'t know, but it depends also on the turtle speed...') . '[/style][/escape]</td>' . '<td>[style=my_style]' . i18n::s('But where will this rabbit be in some minutes? I don\'t know, but it depends also on the turtle speed...') . '[/style]</td></tr>' . Skin::table_suffix();
// transform the text
$context['text'] = Codes::beautify($context['text']);
// general help on this page
$help = '<p>' . sprintf(i18n::s('Please note that actual rendering depends on the selected %s.'), Skin::build_link('skins/', i18n::s('skin'), 'shortcut')) . '</p>';
$context['components']['boxes'] = Skin::build_box(i18n::s('Help'), $help, 'boxes', 'help');
// render the skin
render_skin();