本文整理汇总了PHP中Surfer::has_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Surfer::has_all方法的具体用法?PHP Surfer::has_all怎么用?PHP Surfer::has_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Surfer
的用法示例。
在下文中一共展示了Surfer::has_all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$input = Articles::build_options_input($item);
$hint = Articles::build_options_hint($item);
$fields[] = array($label, $input, $hint);
}
// language of this page
$label = i18n::s('Language');
$input = i18n::get_languages_select(isset($item['language']) ? $item['language'] : '');
$hint = i18n::s('Select the language used for this page');
$fields[] = array($label, $input, $hint);
// meta information
$label = i18n::s('Meta information');
$input = '<textarea name="meta" rows="10" cols="50">' . encode_field(isset($item['meta']) ? $item['meta'] : '') . '</textarea>';
$hint = i18n::s('Type here any XHTML tags to be put in page header.');
$fields[] = array($label, $input, $hint);
// associates can change the overlay --complex interface
if (Surfer::is_associate() && Surfer::has_all()) {
// current type
$overlay_type = '';
if (is_object($overlay)) {
$overlay_type = $overlay->get_type();
}
// list overlays available on this system
$label = i18n::s('Change the overlay');
$input = '<select name="overlay_type">';
if ($overlay_type) {
$input .= '<option value="none">(' . i18n::s('none') . ")</option>\n";
$hint = i18n::s('If you change the overlay you may loose some data.');
} else {
$hint = i18n::s('No overlay has been selected yet.');
$input .= '<option value="" selected="selected">' . i18n::s('none') . "</option>\n";
}
示例2:
}
$context['text'] .= Skin::finalize_list($menu, 'assistant_bar');
// optional checkboxes
$context['text'] .= '<p>';
// do not process notifications for draft articles
if (strncmp($anchor->get_reference(), 'article:', strlen('article:')) || $anchor->get_value('publish_date', NULL_DATE) > NULL_DATE) {
// notify watchers
$context['text'] .= '<input type="checkbox" name="notify_watchers" value="Y" checked="checked" /> ' . i18n::s('Notify watchers') . BR;
// notify people following me
if (Surfer::get_id() && !$anchor->is_hidden()) {
$context['text'] .= '<input type="checkbox" name="notify_followers" value="Y" /> ' . i18n::s('Notify my followers') . BR;
}
}
// associates may decide to not stamp changes, but only for changes -- complex command
if (Surfer::is_associate() && isset($anchor) && Surfer::has_all()) {
if ((Surfer::is_associate() || is_object($anchor) && $anchor->is_assigned()) && Surfer::has_all()) {
$context['text'] .= '<input type="checkbox" name="silent" value="Y" /> ' . i18n::s('Do not change modification date of the main page.') . BR;
}
}
// validate page content
$context['text'] .= '<input type="checkbox" name="option_validate" value="Y" checked="checked" /> ' . i18n::s('Ensure this post is valid XHTML.') . '</p>';
}
// transmit the id as a hidden field
if (isset($item['id']) && $item['id']) {
$context['text'] .= '<input type="hidden" name="id" value="' . $item['id'] . '" />';
}
// other hidden fields
if (is_object($anchor)) {
$context['text'] .= '<input type="hidden" name="anchor" value="' . $anchor->get_reference() . '" />';
}
// end of the form
示例3: array
//
// extra boxes
//
$links = array();
$links[] = Skin::build_link('sections/', i18n::s('Site map'), 'shortcut');
$links[] = Skin::build_link('categories/', i18n::s('Categories'), 'shortcut');
$links[] = Skin::build_link('users/', i18n::s('People'), 'shortcut');
// the hook for more tools
if (is_callable(array('Hooks', 'link_scripts')) && ($more_links = Hooks::link_scripts('control/index.php#tools', 'array'))) {
$links = array_merge($links, $more_links);
}
$links[] = Skin::build_link('help/', i18n::s('Help'), 'shortcut');
// list modules in an extra box
$context['components']['boxes'] = Skin::build_box(i18n::s('See also'), Skin::finalize_list($links, 'compact'), 'boxes', 'tools_box');
// list modules if a skin has been defined -- complex command
if (class_exists('Skin') && Surfer::has_all()) {
$links = array();
if (Surfer::is_associate()) {
$links[] = Skin::build_link('agents/', 'agents', 'shortcut');
}
$links[] = Skin::build_link('articles/', 'articles', 'shortcut');
if (Surfer::is_associate()) {
$links[] = Skin::build_link('behaviors/', 'behaviors', 'shortcut');
}
$links[] = Skin::build_link('categories/', 'categories', 'shortcut');
$links[] = Skin::build_link('codes/', 'codes', 'shortcut');
if (Surfer::is_associate()) {
$links[] = Skin::build_link('comments/', 'comments', 'shortcut');
}
$links[] = Skin::build_link('dates/', 'dates', 'shortcut');
$links[] = Skin::build_link('feeds/', 'feeds', 'shortcut');
示例4: array_merge
if (Categories::allow_assign($item, $anchor)) {
$items = array_merge($items, array(Categories::get_url('section:' . $item['id'], 'select') => i18n::s('Assign categories')));
}
// actually render the html for the section
if (@count($box['bar'])) {
$box['text'] .= Skin::build_list($box['bar'], 'menu_bar');
}
if (is_array($items)) {
$box['text'] .= Skin::build_list($items, 'compact');
}
if ($box['text']) {
$context['components']['categories'] = Skin::build_box(i18n::s('See also'), $box['text'], 'categories', 'categories');
}
}
// offer bookmarklets if submissions are allowed -- complex command
if (Surfer::has_all() && (!isset($context['pages_without_bookmarklets']) || $context['pages_without_bookmarklets'] != 'Y')) {
// accessible bookmarklets
$bookmarklets = array();
// blogging bookmarklet uses YACS codes
if ($cur_section->allows('creation', 'article')) {
$bookmarklet = "javascript:function findFrame(f){var i;try{isThere=f.document.selection.createRange().text;}catch(e){isThere='';}if(isThere==''){for(i=0;i<f.frames.length;i++){findFrame(f.frames[i]);}}else{s=isThere}return s}" . "var s='';" . "d=document;" . "s=d.selection?findFrame(window):window.getSelection();" . "window.location='" . $context['url_to_home'] . $context['url_to_root'] . "articles/edit.php?" . "blogid=" . $item['id'] . "&title='+escape(d.title)+'" . "&text='+escape('%22'+s+'%22%5Bnl]-- %5Blink='+d.title+']'+d.location+'%5B/link]')+'" . "&source='+escape(d.location);";
$bookmarklets[] = '<a href="' . $bookmarklet . '">' . sprintf(i18n::s('Blog at %s'), $item['title']) . '</a>';
}
// bookmark bookmarklet, if links are allowed
if ($cur_section->allows('creation', 'link')) {
$bookmarklet = "javascript:function findFrame(f){var i;try{isThere=f.document.selection.createRange().text;}catch(e){isThere='';}if(isThere==''){for(i=0;i<f.frames.length;i++){findFrame(f.frames[i]);}}else{s=isThere}return s}" . "var s='';" . "d=document;" . "s=d.selection?findFrame(window):window.getSelection();" . "window.location='" . $context['url_to_home'] . $context['url_to_root'] . "links/edit.php?" . "link='+escape(d.location)+'" . "&anchor='+escape('section:" . $item['id'] . "')+'" . "&title='+escape(d.title)+'" . "&text='+escape(s);";
if ($item['nick_name'] == 'bookmarks') {
$name = strip_tags($context['site_name']);
} else {
$name = strip_tags($item['title']);
}
示例5: elseif
if ($whole_rendering) {
// the submit button
$menu[] = Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's');
// cancel button
if (isset($item['id'])) {
$menu[] = Skin::build_link(Sections::get_permalink($item), i18n::s('Cancel'), 'span');
} elseif (is_object($anchor)) {
$menu[] = Skin::build_link($anchor->get_url(), i18n::s('Cancel'), 'span');
}
}
// several options to check
$suffix = array();
// notify watchers
$suffix[] = '<input type="checkbox" name="notify_watchers" value="Y" /> ' . i18n::s('Notify watchers');
// do not stamp edition date -- complex command
if (isset($item['id']) && Surfer::has_all()) {
$suffix[] = '<input type="checkbox" name="silent" value="Y" /> ' . i18n::s('Do not change modification date.');
}
// validate page content
$suffix[] = '<input type="checkbox" name="option_validate" value="Y" checked="checked" /> ' . i18n::s('Ensure this post is valid XHTML.');
// an assistant-like rendering at page bottom
$context['text'] .= Skin::build_assistant_bottom('', $menu, $suffix, isset($item['tags']) ? $item['tags'] : '');
// transmit the id as a hidden field
if (isset($item['id']) && $item['id']) {
$context['text'] .= '<input type="hidden" name="id" value="' . $item['id'] . '" />';
}
// end of the form
$context['text'] .= '</div></form>';
// append the script used for data checking on the browser
Page::insert_script('func' . 'tion validateDocumentPost(container) {' . "\n" . ' if(!Yacs.trim(container.title.value)) {' . "\n" . ' alert("' . i18n::s('Please provide a meaningful title.') . '");' . "\n" . ' Yacs.stopWorking();' . "\n" . ' return false;' . "\n" . ' }' . "\n" . ' return true;' . "\n" . '}' . "\n" . 'if( $("#index_title").val()=="" || $("#index_title").val()==$("#title").val()) {' . "\n" . ' $("#title").change(function() {' . "\n" . ' $("#index_title").val($("#title").val());' . "\n" . ' });' . "\n" . '}' . "\n" . '$("#index_title").change( function() {' . "\n" . ' $("#title").unbind("change");' . "\n" . '});' . "\n" . '$("#main_form textarea, #main_form input, #main_form select").change(function() {' . "\n" . ' $("#preferred_editor").attr("disabled",true);' . "\n" . '});' . "\n" . '$("#title").focus();' . "\n" . '$(function() {' . "\n" . ' Yacs.autocomplete_m("tags", "' . $context['url_to_root'] . 'categories/complete.php");' . "\n" . '}); ');
// content of the help box
示例6: array
//
$menu = array();
if ($whole_rendering) {
// the submit button
$menu[] = Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's');
// cancel button
if (isset($item['id'])) {
$menu[] = Skin::build_link(Categories::get_permalink($item), i18n::s('Cancel'), 'span');
}
// insert the menu in the page
$context['text'] .= Skin::finalize_list($menu, 'assistant_bar');
}
// several options to check
$input = array();
// do not stamp edition date -- complex command
if (Surfer::is_empowered() && isset($item['id']) && Surfer::has_all()) {
$input[] = '<input type="checkbox" name="silent" value="Y" /> ' . i18n::s('Do not change modification date.');
}
// validate page content
$input[] = '<input type="checkbox" name="option_validate" value="Y" checked="checked" /> ' . i18n::s('Ensure this post is valid XHTML.');
// append post-processing options
if ($input) {
$context['text'] .= '<p>' . implode(BR, $input) . '</p>';
}
// transmit the id as a hidden field
if (isset($item['id']) && $item['id']) {
$context['text'] .= '<input type="hidden" name="id" value="' . $item['id'] . '" />';
}
// end of the form
$context['text'] .= '</div></form>';
// append the script used for data checking on the browser