本文整理汇总了PHP中Skin::table方法的典型用法代码示例。如果您正苦于以下问题:PHP Skin::table方法的具体用法?PHP Skin::table怎么用?PHP Skin::table使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skin
的用法示例。
在下文中一共展示了Skin::table方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$context['text'] .= Skin::build_block(i18n::s('Ping interface'), 'title', 'ping');
$context['text'] .= '<p>' . i18n::s('To spread updates') . '</p>';
$rows = array();
$rows[] = array(i18n::s('URL:'), '<b>' . $context['url_to_home'] . $context['url_to_root'] . 'services/ping.php</b>');
$rows[] = array(i18n::s('Documentation:'), Skin::build_link('services/ping.php', NULL, 'script'));
$rows[] = array(i18n::s('Specifications:'), Skin::build_link('http://www.hixie.ch/specs/pingback/pingback', 'Pingback specification', 'external') . ', ' . Skin::build_link('http://www.xmlrpc.com/spec', 'XML-RPC Specification', 'external'));
$context['text'] .= Skin::table(NULL, $rows);
// search.php
$context['text'] .= Skin::build_block(i18n::s('Search'), 'title', 'search');
$context['text'] .= '<p>' . i18n::s('Build a customised RSS feed based on any keyword') . '</p>';
$rows = array();
$rows[] = array(i18n::s('URL:'), '<b>' . $context['url_to_home'] . $context['url_to_root'] . 'services/search.php</b>');
$rows[] = array(i18n::s('Documentation:'), Skin::build_link('services/search.php', NULL, 'script'));
$rows[] = array(i18n::s('Specifications:'), Skin::build_link('http://blogs.law.harvard.edu/tech/rss', 'RSS 2.0 Specification', 'external'));
$context['text'] .= Skin::table(NULL, $rows);
// xml_rpc.php
$context['text'] .= Skin::build_block(i18n::s('Generic XML-RPC interface'), 'title', 'xml-rpc');
$context['text'] .= '<p>' . i18n::s('Bound to hooked back-end scripts') . '</p>';
$rows = array();
$rows[] = array(i18n::s('URL:'), '<b>' . $context['url_to_home'] . $context['url_to_root'] . 'services/xml_rpc.php</b>');
$rows[] = array(i18n::s('Documentation:'), Skin::build_link('services/xml_rpc.php', NULL, 'script'));
$rows[] = array(i18n::s('Specification:'), Skin::build_link('http://www.xmlrpc.com/spec', 'XML-RPC Specification', 'external'));
$context['text'] .= Skin::table(NULL, $rows);
// page tools
if (Surfer::is_associate()) {
$context['page_tools'][] = Skin::build_link('services/configure.php', i18n::s('Configure'), 'basic');
}
// referrals, if any
$context['components']['referrals'] = Skin::build_referrals('services/index.php');
// render the skin
render_skin();
示例2: array
$box['bar'] += array(Sections::get_url($item['id'], 'mail') => SECTIONS_EMAIL_IMG . i18n::s('Notify participants'));
}
// manage editors, for owners
if (Sections::is_owned($item, $anchor, TRUE) || Surfer::is_associate()) {
Skin::define_img('SECTIONS_ASSIGN_IMG', 'sections/assign.gif');
$box['bar'] += array(Users::get_url('section:' . $item['id'], 'select') => SECTIONS_ASSIGN_IMG . i18n::s('Manage participants'));
// leave this section, for editors
} elseif (Sections::is_assigned($item['id'])) {
Skin::define_img('SECTIONS_ASSIGN_IMG', 'sections/assign.gif');
$box['bar'] += array(Users::get_url('section:' . $item['id'], 'leave') => SECTIONS_ASSIGN_IMG . i18n::s('Leave this section'));
}
// headers
$headers = array(i18n::s('Person'), i18n::s('Watcher'), i18n::s('Editor'), i18n::s('Owner'));
// layout columns
if ($rows) {
$box['text'] .= Skin::table($headers, $rows, 'grid');
}
// actually render the html
$users .= Skin::build_content(NULL, NULL, $box['text'], $box['bar']);
}
// display in a separate panel
if ($users) {
$label = i18n::s('Persons');
if ($users_count) {
$label .= ' (' . $users_count . ')';
}
$panels[] = array('users', $label, 'users_panel', $users);
}
//
// assemble all tabs
//
示例3: time
/**
* display the content of one instance
*
* @see overlays/overlay.php
*
* @param array the hosting record
* @return some HTML to be inserted into the resulting page
*/
function &get_view_text($host = NULL)
{
global $context;
// we may look at enrolments
include_once $context['path_to_root'] . 'shared/enrolments.php';
// minutes to go
if (isset($this->attributes['date_stamp']) && $this->attributes['date_stamp'] > NULL_DATE) {
$this->minutes_before_start = (sql::strtotime($this->attributes['date_stamp']) - time()) / 60;
} else {
$this->minutes_before_start = 120;
}
// prevent automatic start
// minutes since the end of the event
if (isset($this->attributes['duration']) && $this->attributes['duration']) {
$this->minutes_since_stop = -($this->attributes['duration'] + $this->minutes_before_start);
} else {
$this->minutes_since_stop = -120;
}
// prevent automatic stop
// tabular information
$rows = array();
// initialize feed-back to end-user
$this->feed_back = array('message' => '', 'status' => array(), 'menu' => array(), 'commands' => array(), 'reload_this_page' => FALSE);
// maybe a bare instance
if (!isset($this->attributes['status'])) {
$this->attributes['status'] = 'created';
}
// step 5 - end of the event
if ($this->attributes['status'] == 'stopped') {
// list enrolment for this meeting
$query = "SELECT * FROM " . SQL::table_name('enrolments') . " WHERE anchor LIKE '" . SQL::escape($this->anchor->get_reference()) . "'";
if ($result = SQL::query($query)) {
// browse the list
$items = array();
while ($item = SQL::fetch($result)) {
// a user registered on this server
if ($item['user_id'] && ($user = Users::get($item['user_id']))) {
// make an url
$url = Users::get_permalink($user);
// gather information on this user
if (isset($user['full_name']) && $user['full_name']) {
$label = $user['full_name'] . ' (' . $user['nick_name'] . ')';
} else {
$label = $user['nick_name'];
}
$items[] = Skin::build_link($url, $label, 'user');
// we only have some e-mail address
} else {
$items[] = $item['user_email'];
}
}
// shape a compact list
if (count($items)) {
$this->feed_back['status'][] = Skin::build_folded_box(i18n::s('Enrolment') . ' (' . count($items) . ')', Skin::finalize_list($items, 'compact'));
}
}
// signal that the event is over
$this->feed_back['status'][] = i18n::s('Event is over');
// display the follow-up message
if (isset($this->attributes['follow_up_message']) && $this->attributes['follow_up_message']) {
$this->feed_back['message'] .= Codes::render($this->attributes['follow_up_message']);
}
// possible transition to state 'stopped'
} else {
$this->transition_to_stopped();
}
// step 4 - event has started
if ($this->attributes['status'] == 'started') {
// display the welcome message
if (isset($this->attributes['welcome_message'])) {
$this->feed_back['message'] .= Codes::render($this->attributes['welcome_message']);
}
// possible transition to state 'started'
} else {
$this->transition_to_started();
}
// step 3 - waiting for event start
if ($this->attributes['status'] == 'lobby') {
// display the lobby message
if (isset($this->attributes['lobby_message'])) {
$this->feed_back['message'] .= Codes::render($this->attributes['lobby_message']);
}
// possible transition to state 'lobby'
} else {
$this->transition_to_lobby();
}
// step 2 - enrolment has been opened
if ($this->attributes['status'] == 'open') {
// display the induction message
if (isset($this->attributes['induction_message'])) {
$this->feed_back['message'] .= Codes::render($this->attributes['induction_message']);
}
//.........这里部分代码省略.........
示例4: layout
//.........这里部分代码省略.........
// flag articles updated recently
if ($item['expiry_date'] > NULL_DATE && $item['expiry_date'] <= $context['now']) {
$title .= ' ' . EXPIRED_FLAG;
} elseif ($item['create_date'] >= $context['fresh']) {
$title .= ' ' . NEW_FLAG;
} elseif ($item['edit_date'] >= $context['fresh']) {
$title .= ' ' . UPDATED_FLAG;
}
// the icon
if ($item['thumbnail_url']) {
$abstract .= '<a href="' . $context['url_to_root'] . $url . '"><img src="' . $item['thumbnail_url'] . '" class="right_image" alt="" /></a>';
}
// the introductory text
if (is_object($overlay)) {
$abstract .= Codes::beautify_introduction($overlay->get_text('introduction', $item));
} elseif ($item['introduction']) {
$abstract .= Codes::beautify_introduction($item['introduction']);
}
// insert overlay data, if any
if (is_object($overlay)) {
$abstract .= $overlay->get_text('list', $item);
}
// make some abstract out of main text
if (!$item['introduction'] && $context['skins_with_details'] == 'Y') {
$abstract .= Skin::cap(Codes::beautify($item['description'], $item['options']), 50);
}
// attachment details
$details = array();
// info on related files
if ($count = Files::count_for_anchor('article:' . $item['id'], TRUE)) {
Skin::define_img('FILES_LIST_IMG', 'files/list.gif');
$details[] = FILES_LIST_IMG . sprintf(i18n::ns('%d file', '%d files', $count), $count);
}
// info on related links
if ($count = Links::count_for_anchor('article:' . $item['id'], TRUE)) {
Skin::define_img('LINKS_LIST_IMG', 'links/list.gif');
$details[] = LINKS_LIST_IMG . sprintf(i18n::ns('%d link', '%d links', $count), $count);
}
// comments
if ($count = Comments::count_for_anchor('article:' . $item['id'], TRUE)) {
Skin::define_img('COMMENTS_LIST_IMG', 'comments/list.gif');
$details[] = Skin::build_link(Comments::get_url('article:' . $item['id'], 'list'), COMMENTS_LIST_IMG . sprintf(i18n::ns('%d comment', '%d comments', $count), $count));
}
// describe attachments
if (count($details)) {
$abstract .= '<p style="margin: 3px 0;">' . join(', ', $details) . '</p>';
}
// anchors
$anchors = array();
if ($members =& Members::list_categories_by_title_for_member('article:' . $item['id'], 0, 7, 'raw')) {
foreach ($members as $category_id => $attributes) {
// add background color to distinguish this category against others
if (isset($attributes['background_color']) && $attributes['background_color']) {
$attributes['title'] = '<span style="background-color: ' . $attributes['background_color'] . '; padding: 0 3px 0 3px;">' . $attributes['title'] . '</span>';
}
$anchors[] = Skin::build_link(Categories::get_permalink($attributes), $attributes['title'], 'basic');
}
}
if (@count($anchors)) {
$abstract .= '<p class="tags" style="margin: 3px 0">' . implode(' ', $anchors) . '</p>';
}
// poster name
if (isset($context['with_author_information']) && $context['with_author_information'] == 'Y') {
if ($item['create_name']) {
$author = Users::get_link($item['create_name'], $item['create_address'], $item['create_id']);
} else {
$author = Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id']);
}
}
// more details
$details =& Articles::build_dates($anchor, $item);
// rating
if ($item['rating_count'] && !(is_object($anchor) && $anchor->has_option('without_rating'))) {
$details[] = Skin::build_link(Articles::get_url($item['id'], 'like'), Skin::build_rating_img((int) round($item['rating_sum'] / $item['rating_count'])), 'basic');
}
// page details
if (count($details)) {
$details = '<p class="details">' . join(', ', $details) . '</p>';
}
// this is another row of the output -- title, abstract, (author,) details
if (isset($context['with_author_information']) && $context['with_author_information'] == 'Y') {
$cells = array($title, $abstract, $author, $details);
} else {
$cells = array($title, $abstract, $details);
}
// append this row
$rows[] = $cells;
}
// end of processing
SQL::free($result);
// headers
if (isset($context['with_author_information']) && $context['with_author_information'] == 'Y') {
$headers = array(i18n::s('Topic'), i18n::s('Abstract'), i18n::s('Poster'), i18n::s('Details'));
} else {
$headers = array(i18n::s('Topic'), i18n::s('Abstract'), i18n::s('Details'));
}
// return a sortable table
$text .= Skin::table($headers, $rows, 'grid');
return $text;
}
示例5: layout
//.........这里部分代码省略.........
$hover = i18n::s('View the page');
if (Surfer::is_member()) {
$hover .= ' [article=' . $item['id'] . ']';
}
// use the title as a link to the page
$title = $prefix . Skin::build_link($url, ucfirst($title), 'basic', $hover) . $suffix;
$suffix = '';
// the introductory text
$introduction = '';
if (is_object($overlay)) {
$introduction = $overlay->get_text('introduction', $item);
} elseif ($item['introduction']) {
$introduction = $item['introduction'];
}
if ($introduction) {
$suffix .= BR . Codes::beautify_introduction($introduction);
}
// insert overlay data, if any
if (is_object($overlay)) {
$suffix .= $overlay->get_text('list', $item);
}
// shortcuts to comments pages
if (isset($item['comments_count']) && ($pages = (int) ceil($item['comments_count'] / $layout->items_per_page())) && $pages > 1) {
$suffix .= '<p class="details">Pages ';
for ($index = 1; $index <= $pages; $index++) {
$suffix .= Skin::build_link('comments/list.php?id=article:' . $item['id'] . '&page=' . $index, $index, 'basic', i18n::s('One page of comments')) . ' ';
}
$suffix .= Skin::build_link('comments/list.php?id=article:' . $item['id'] . '&page=' . $pages, MORE_IMG, 'basic', i18n::s('Most recent comments')) . '</p>';
}
// links to sections and categories
$anchors = array();
// the main anchor link
if (is_object($anchor) && (!isset($this->focus) || $item['anchor'] != $this->focus)) {
$anchors[] = Skin::build_link($anchor->get_url(), ucfirst($anchor->get_title()), 'basic', i18n::s('In this section'));
}
// list categories by title, if any
if ($members =& Members::list_categories_by_title_for_member('article:' . $item['id'], 0, 7, 'raw')) {
foreach ($members as $category_id => $attributes) {
// add background color to distinguish this category against others
if (isset($attributes['background_color']) && $attributes['background_color']) {
$attributes['title'] = '<span style="background-color: ' . $attributes['background_color'] . '; padding: 0 3px 0 3px;">' . $attributes['title'] . '</span>';
}
if (!isset($this->focus) || $this->focus != 'category:' . $category_id) {
$anchors[] = Skin::build_link(Categories::get_permalink($attributes), $attributes['title'], 'basic', i18n::s('Related topics'));
}
}
}
// list section and categories in the suffix
if (@count($anchors)) {
$suffix .= '<p class="tags">' . implode(' ', $anchors) . '</p>';
}
// the creator of this article
$starter = '';
if ($item['create_name']) {
$starter = '<span class="details">' . Users::get_link($item['create_name'], $item['create_address'], $item['create_id']) . '</span>';
}
// the last editor
$details = '';
if ($item['edit_date']) {
// find a name, if any
$user = '';
if ($item['edit_name']) {
// label the action
if (isset($item['edit_action'])) {
$user .= Anchors::get_action_label($item['edit_action']) . ' ';
}
// name of last editor
$user .= sprintf(i18n::s('by %s'), Users::get_link($item['edit_name'], $item['edit_address'], $item['edit_id']));
}
$details .= $user . ' ' . Skin::build_date($item['edit_date']);
}
// signal locked articles
if (isset($item['locked']) && $item['locked'] == 'Y' && Articles::is_owned($item, $anchor)) {
$details .= ', ' . LOCKED_FLAG;
}
// poster details
if ($details) {
$details = '<p class="details">' . $details . "</p>\n";
}
if (!isset($item['comments_count'])) {
$item['comments_count'] = 0;
}
// this is another row of the output
$cells = array($title . $suffix, 'center=' . $starter, 'center=' . $item['comments_count'], 'center=' . Skin::build_number($item['hits']), $details);
if (THREAD_IMG) {
$cells = array_merge(array($icon), $cells);
}
$rows[] = $cells;
}
// end of processing
SQL::free($result);
// headers
$headers = array(i18n::s('Topic'), 'center=' . i18n::s('Poster'), 'center=' . i18n::s('Replies'), 'center=' . i18n::s('Views'), i18n::s('Last post'));
if (THREAD_IMG) {
$headers = array_merge(array(''), $headers);
}
// make a sortable table
$output = Skin::table($headers, $rows, 'yabb');
return $output;
}
示例6: array
/**
* display content of main panel
*
* Everything is in a separate panel
*
* @param array the hosting record, if any
* @return some HTML to be inserted into the resulting page
*/
function &get_view_text($host = NULL)
{
$text = '';
$rows = array();
// this page has an explicit owner
if (isset($host['owner_id']) && ($user = Users::get($host['owner_id']))) {
// allow for click-to-call
$click_to_call = Users::get_click_to_call($user);
// display information on the owner
$rows[] = array(i18n::s('Owner'), Users::get_link($user['full_name'], NULL, $user['id']) . ' ' . $click_to_call);
}
// show progress
$rows[] = array(i18n::s('Progress'), $this->get_progress_value());
// type
$rows[] = array(i18n::s('Workflow'), self::get_type_value());
// the status and history
$history = self::get_history();
$rows[] = array(i18n::s('Status'), self::get_status_label($this->attributes['status']) . $history);
$text = Skin::table(NULL, $rows, 'grid');
return $text;
}
示例7: array
$rows[] = array(i18n::s('Windows Live Messenger'), Skin::build_presence($item['msn_address'], 'msn') . ' ' . $item['msn_address']);
}
// a clickable aim address
if (isset($item['aim_address']) && $item['aim_address']) {
$rows[] = array(i18n::s('AIM'), Skin::build_presence($item['aim_address'], 'aim') . ' ' . $item['aim_address']);
}
// a clickable irc address
if (isset($item['irc_address']) && $item['irc_address']) {
$rows[] = array(i18n::s('IRC'), Skin::build_presence($item['irc_address'], 'irc') . ' ' . $item['irc_address']);
}
// a clickable icq number
if (isset($item['icq_address']) && $item['icq_address']) {
$rows[] = array(i18n::s('ICQ'), Skin::build_presence($item['icq_address'], 'icq') . ' ' . $item['icq_address']);
}
if (count($rows)) {
$box['text'] .= Skin::table(NULL, $rows, 'wide');
}
}
// a full box
if ($box['text']) {
$information .= Skin::build_box(i18n::s('Instant communication'), $box['text'], 'folded');
}
// pgp key
if (isset($item['pgp_key']) && $item['pgp_key']) {
$information .= Skin::build_box(i18n::s('Public key'), '<span style="font-size: 50%">' . $item['pgp_key'] . '</span>', 'folded');
}
// show preferences only to related surfers and to associates
//
if (Surfer::get_id() == $item['id'] || Surfer::is_associate()) {
$box = '';
// public or restricted or hidden profile
示例8: encode_field
}
// nothing has been posted
} else {
$context['page_title'] = i18n::s('Add a file');
// preserve referer address
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) {
$link = $_SERVER['HTTP_REFERER'];
} else {
$link = 'skins/flexible/configure.php';
}
// the form to select the file to upload
$context['text'] = '<form method="post" action="' . $context['script_url'] . '" enctype="multipart/form-data">' . '<p style="margin: 0; padding: 0;">' . '<input type="file" name="upload" size="30" title="' . encode_field(i18n::s('Press to select a local file')) . '" />' . Skin::build_submit_button(i18n::s('Submit')) . '<input type="hidden" name="directory" value="' . $_REQUEST['directory'] . '" />' . '<input type="hidden" name="referer" value="' . $link . '" />' . '</p>' . '</form>';
$headers = array(i18n::s('Suffix'), i18n::s('Alignment'), i18n::s('Style'), i18n::s('Example'));
$rows = array();
$rows[] = array('<tt>-x</tt>', i18n::s('repeat horizontally'), '<tt>repeat-x top left</tt>', '<tt>light_gray_bevel-x.jpg</tt>');
$rows[] = array('<tt>-m</tt>', i18n::s('center at the top'), '<tt>no-repeat top center</tt>', '<tt>ephemeral_header05-m.jpg</tt>');
$rows[] = array('<tt>-l</tt>', i18n::s('anchor to top left'), '<tt>no-repeat top left</tt>', '<tt>bar-grey-l.png</tt>');
$rows[] = array('<tt>-r</tt>', i18n::s('anchor to top right'), '<tt>no-repeat top right</tt>', '<tt>flowers-r.jpg</tt>');
$rows[] = array('<tt>-b</tt>', i18n::s('align to bottom, then repeat horizontally'), '<tt>repeat-x bottom left</tt>', '<tt>chrom_menu-b.png</tt>');
$rows[] = array('<tt>-bm</tt>', i18n::s('center at the bottom'), '<tt>no-repeat bottom center</tt>', '<tt>bamboo2-bm.gif</tt>');
$rows[] = array('<tt>-bl</tt>', i18n::s('anchor to bottom left'), '<tt>no-repeat bottom left</tt>', '<tt>bar-bl.gif</tt>');
$rows[] = array('<tt>-br</tt>', i18n::s('anchor to bottom right'), '<tt>no-repeat bottom right</tt>', '<tt>shadow_alpha-br.png</tt>');
$rows[] = array('<tt>-y</tt>', i18n::s('align to left, then repeat vertically'), '<tt>repeat-y top left</tt>', '<tt>sidebar-bg-y.png</tt>');
$rows[] = array('<tt>-ym</tt>', i18n::s('center, then repeat vertically'), '<tt>repeat-y top center</tt>', '<tt>hgradient-ym.jpg</tt>');
$rows[] = array('<tt>-yr</tt>', i18n::s('align to right, then repeat vertically'), '<tt>repeat-y top right</tt>', '<tt>sidebar-bg-yr.png</tt>');
$rows[] = array(i18n::s('other cases'), i18n::s('repeat horizontally and vertically'), '<tt>repeat</tt>', '<tt>p-chrom_degh.png</tt>');
// some suggestions
$context['text'] .= '<p>' . i18n::s('Image will be aligned depending of its suffix, as depicted in the following table.') . '</p>' . Skin::table($headers, $rows);
}
// render the skin
render_skin();
示例9: layout
//.........这里部分代码省略.........
$overlay = Overlay::load($item, 'article:' . $item['id']);
// get the anchor
$anchor = Anchors::get($item['anchor']);
// the url to view this item
$url = Articles::get_permalink($item);
// reset everything
$id = $summary = $owner = $type = $status = $update = $progress = '';
// link to the page
$id = Skin::build_link($url, $item['id'], 'basic');
// signal articles to be published
if (!isset($item['publish_date']) || $item['publish_date'] <= NULL_DATE || $item['publish_date'] > gmstrftime('%Y-%m-%d %H:%M:%S')) {
$summary .= DRAFT_FLAG;
}
// signal restricted and private articles
if ($item['active'] == 'N') {
$summary .= PRIVATE_FLAG;
} elseif ($item['active'] == 'R') {
$summary .= RESTRICTED_FLAG;
}
// indicate the id in the hovering popup
$hover = i18n::s('View the page');
if (Surfer::is_member()) {
$hover .= ' [article=' . $item['id'] . ']';
}
// use the title to label the link
if (is_object($overlay)) {
$label = Codes::beautify_title($overlay->get_text('title', $item));
} else {
$label = Codes::beautify_title($item['title']);
}
// use the title as a link to the page
$summary .= Skin::build_link($url, $label, 'basic', $hover);
// signal locked articles
if (isset($item['locked']) && $item['locked'] == 'Y' && Articles::is_owned($item, $anchor)) {
$summary .= ' ' . LOCKED_FLAG;
}
// flag articles updated recently
if ($item['expiry_date'] > NULL_DATE && $item['expiry_date'] <= $context['now']) {
$summary .= ' ' . EXPIRED_FLAG;
} elseif ($item['create_date'] >= $context['fresh']) {
$summary .= ' ' . NEW_FLAG;
} elseif ($item['edit_date'] >= $context['fresh']) {
$summary .= ' ' . UPDATED_FLAG;
}
// attachment details
$details = array();
// info on related files
if ($count = Files::count_for_anchor('article:' . $item['id'])) {
Skin::define_img('FILES_LIST_IMG', 'files/list.gif');
$details[] = FILES_LIST_IMG . sprintf(i18n::ns('%d file', '%d files', $count), $count);
}
// info on related links
if ($count = Links::count_for_anchor('article:' . $item['id'], TRUE)) {
Skin::define_img('LINKS_LIST_IMG', 'links/list.gif');
$details[] = LINKS_LIST_IMG . sprintf(i18n::ns('%d link', '%d links', $count), $count);
}
// comments
if ($count = Comments::count_for_anchor('article:' . $item['id'], TRUE)) {
Skin::define_img('COMMENTS_LIST_IMG', 'comments/list.gif');
$details[] = Skin::build_link(Comments::get_url('article:' . $item['id'], 'list'), COMMENTS_LIST_IMG . sprintf(i18n::ns('%d comment', '%d comments', $count), $count));
}
// combine in-line details
if (count($details)) {
$summary .= ' <span class="details">' . trim(implode(' ', $details)) . '</span>';
}
// dates
$summary .= BR . '<span class="details">' . join(BR, Articles::build_dates($anchor, $item)) . '</span>';
// display all tags
if ($item['tags']) {
$summary .= BR . '<span class="tags">' . Skin::build_tags($item['tags'], 'article:' . $item['id']) . '</span>';
}
// page owner
if (isset($item['owner_id']) && ($owner = Users::get($item['owner_id']))) {
$owner = Users::get_link($owner['full_name'], $owner['email'], $owner['id']);
}
// type is provided by the overlay
if (is_object($overlay)) {
$type = $overlay->get_value('type', '');
}
// status value
if (is_object($overlay)) {
$status = $overlay->get_value('status', '');
}
// progress value
if (is_object($overlay)) {
$progress = $overlay->get_value('progress', '');
}
// this is another row of the output
$cells = array($id, $summary, $owner, $type, $status, $progress);
// append this row
$rows[] = $cells;
}
// end of processing
SQL::free($result);
// headers
$headers = array(i18n::s('Number'), i18n::s('Information'), i18n::s('Owner'), i18n::s('Type'), i18n::s('Status'), i18n::s('Progress'));
// return a sortable table
$text .= Skin::table($headers, $rows, 'grid');
return $text;
}
示例10: layout
//.........这里部分代码省略.........
// get the anchor
$anchor = Anchors::get($item['anchor']);
// the url to view this item
$url = Articles::get_permalink($item);
// reset everything
$summary = $update = $owner = $editor = $watcher = '';
// signal articles to be published
if (!isset($item['publish_date']) || $item['publish_date'] <= NULL_DATE || $item['publish_date'] > gmstrftime('%Y-%m-%d %H:%M:%S')) {
$summary .= DRAFT_FLAG;
}
// signal restricted and private articles
if ($item['active'] == 'N') {
$summary .= PRIVATE_FLAG;
} elseif ($item['active'] == 'R') {
$summary .= RESTRICTED_FLAG;
}
// indicate the id in the hovering popup
$hover = i18n::s('View the page');
if (Surfer::is_member()) {
$hover .= ' [article=' . $item['id'] . ']';
}
// use the title to label the link
if (is_object($overlay)) {
$label = Codes::beautify_title($overlay->get_text('title', $item));
} else {
$label = Codes::beautify_title($item['title']);
}
// use the title as a link to the page
$summary .= Skin::build_link($url, $label, 'basic', $hover);
// signal locked articles
if (isset($item['locked']) && $item['locked'] == 'Y' && Articles::is_owned($item, $anchor)) {
$summary .= ' ' . LOCKED_FLAG;
}
// flag articles updated recently
if ($item['expiry_date'] > NULL_DATE && $item['expiry_date'] <= $context['now']) {
$summary .= ' ' . EXPIRED_FLAG;
} elseif ($item['create_date'] >= $context['fresh']) {
$summary .= ' ' . NEW_FLAG;
} elseif ($item['edit_date'] >= $context['fresh']) {
$summary .= ' ' . UPDATED_FLAG;
}
// insert overlay data, if any
if (is_object($overlay)) {
$summary .= $overlay->get_text('list', $item);
}
// attachment details
$details = array();
// info on related files
if ($count = Files::count_for_anchor('article:' . $item['id'], TRUE)) {
$details[] = sprintf(i18n::ns('%d file', '%d files', $count), $count);
}
// info on related links
if ($count = Links::count_for_anchor('article:' . $item['id'], TRUE)) {
$details[] = sprintf(i18n::ns('%d link', '%d links', $count), $count);
}
// comments
if ($count = Comments::count_for_anchor('article:' . $item['id'], TRUE)) {
$details[] = sprintf(i18n::ns('%d comment', '%d comments', $count), $count);
}
// the main anchor link
if (is_object($anchor) && (!isset($this->focus) || $item['anchor'] != $this->focus)) {
$details[] = sprintf(i18n::s('in %s'), Skin::build_link($anchor->get_url(), ucfirst($anchor->get_title()), 'basic'));
}
// combine in-line details
if (count($details)) {
$summary .= BR . '<span class="details">' . trim(implode(' · ', $details)) . '</span>';
}
// display all tags
if ($item['tags']) {
$summary .= BR . '<span class="tags">' . Skin::build_tags($item['tags'], 'article:' . $item['id']) . '</span>';
}
// dates
// $update = '<span class="details">'.join(BR, Articles::build_dates($anchor, $item)).'</span>';
// watcher
if (Articles::is_watched($item['id'], $this->focus)) {
$watcher = CHECKED_IMG;
}
// editor
if (Articles::is_assigned($item['id'], $this->focus)) {
$editor = CHECKED_IMG;
}
// owner
if (isset($item['owner_id']) && $item['owner_id'] == $this->focus) {
$owner = CHECKED_IMG;
}
// this is another row of the output
// $cells = array($summary, $update, $watcher, $editor, $owner);
$cells = array($summary, $watcher, $editor, $owner);
// append this row
$rows[] = $cells;
}
// end of processing
SQL::free($result);
// headers
// $headers = array(i18n::s('Page'), i18n::s('Dates'), i18n::s('Watcher'), i18n::s('Editor'), i18n::s('Owner'));
$headers = array(i18n::s('Page'), i18n::s('Watcher'), i18n::s('Editor'), i18n::s('Owner'));
// return a sortable table
$text .= Skin::table($headers, $rows, 'grid');
return $text;
}
示例11: array
$content = '<form method="post" action="' . $context['script_url'] . '" id="main_form"><div>';
// name of the new virtual host
$content .= '<p>' . i18n::s('Virtual host to be created') . ' <input type="text" name="id" size="30" />';
// the submit button
$content .= '<input type="hidden" name="action" value="new" />' . Skin::build_submit_button(i18n::s('Create'), NULL, NULL, 'go', 'no_spin_on_click');
// end of this form
$content .= '</p></div></form>';
// insert a box
$context['text'] .= Skin::build_box(i18n::s('Add a new virtual host'), $content);
// set the focus on the backup button
Page::insert_script('$("#id").focus();');
// list available configuration files
if ($items = Safe::glob($context['path_to_root'] . 'parameters/virtual_*.include.php')) {
$rows = array();
foreach ($items as $item) {
if (preg_match('/parameters\\/virtual_(.+).include.php/', $item, $matches)) {
$link = 'control/virtual.php?id=' . urlencode($matches[1]);
$menu = array();
$menu[] = '<a href="' . $context['url_to_root'] . $link . '">' . i18n::s('view') . '</a>';
$menu[] = '<a href="' . $context['url_to_root'] . $link . '&action=edit">' . i18n::s('edit') . '</a>';
$menu[] = '<a href="' . $context['url_to_root'] . $link . '&action=delete">' . i18n::s('delete') . '</a>';
$rows[] = array($matches[1], '<a href="' . $context['url_to_root'] . $link . '">' . $matches[0] . '</a>', Skin::build_list($menu, 'menu'));
}
}
// insert a box
$row_headers = array(i18n::s('Host'), i18n::s('Configuration file'), i18n::s('Commands'));
$context['text'] .= Skin::build_box(i18n::s('Configured virtual hosts'), Skin::table($row_headers, $rows));
}
}
// render the skin
render_skin();