本文整理汇总了PHP中Sections::allow_message方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::allow_message方法的具体用法?PHP Sections::allow_message怎么用?PHP Sections::allow_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sections
的用法示例。
在下文中一共展示了Sections::allow_message方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// count
if ($users_count) {
$box['bar'] += array('_count' => sprintf(i18n::ns('%d participant', '%d participants', $users_count), $users_count));
}
// add to the watch list -- $in_watch_list is set in sections/view.php
if (Surfer::get_id() && $in_watch_list == 'N') {
Skin::define_img('TOOLS_WATCH_IMG', 'tools/watch.gif');
$box['bar'] += array(Users::get_url('section:' . $item['id'], 'track') => TOOLS_WATCH_IMG . i18n::s('Watch this section'));
}
// invite participants, for owners
if (Sections::is_owned($item, $anchor, TRUE) && isset($context['with_email']) && $context['with_email'] == 'Y') {
Skin::define_img('SECTIONS_INVITE_IMG', 'sections/invite.gif');
$box['bar'] += array(Sections::get_url($item['id'], 'invite') => SECTIONS_INVITE_IMG . i18n::s('Invite participants'));
}
// notify participants
if ($count > 1 && Sections::allow_message($item, $anchor) && isset($context['with_email']) && $context['with_email'] == 'Y') {
Skin::define_img('SECTIONS_EMAIL_IMG', 'sections/email.gif');
$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
示例2: strip_tags
$id = $context['arguments'][0];
}
$id = strip_tags($id);
// get the item from the database
$item = Sections::get($id);
// get the related anchor, if any
$anchor = NULL;
if (isset($item['anchor'])) {
$anchor = Anchors::get($item['anchor']);
}
$overlay = NULL;
if (isset($item['overlay'])) {
$overlay = Overlay::load($item, 'section:' . $item['id']);
}
// check surfer capability
if (Sections::allow_message($item, $anchor)) {
$permitted = TRUE;
} else {
$permitted = FALSE;
}
// load the skin, maybe with a variant
load_skin('sections', $anchor, isset($item['options']) ? $item['options'] : '');
// clear the tab we are in, if any
if (is_object($anchor)) {
$context['current_focus'] = $anchor->get_focus();
}
// path to this page
if (is_object($anchor)) {
$context['path_bar'] = $anchor->get_path_bar();
} else {
$context['path_bar'] = array('sections/' => i18n::s('Site map'));