本文整理汇总了PHP中Skin::build_submit_button方法的典型用法代码示例。如果您正苦于以下问题:PHP Skin::build_submit_button方法的具体用法?PHP Skin::build_submit_button怎么用?PHP Skin::build_submit_button使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skin
的用法示例。
在下文中一共展示了Skin::build_submit_button方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_body
/**
* dynamically generate the page
*
* @see skins/index.php
*/
function send_body()
{
global $context;
// only associates can proceed
if (!Surfer::is_associate()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
echo '<p>' . i18n::s('You are not allowed to perform this operation.') . "</p>\n";
// forward to the index page
$menu = array('scripts/' => i18n::s('Server software'));
echo Skin::build_list($menu, 'menu_bar');
// ask for confirmation
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET') {
// the splash message
echo '<p>' . i18n::s('This tool will include most of the running reference PHP scripts. Any syntax error should be spotted easily.') . '</p>';
// the submit button
echo '<form method="post" action="' . $context['script_url'] . '" id="main_form"><p>' . Skin::build_submit_button(i18n::s('Yes, I want to validate scripts'), NULL, NULL, 'confirmed') . '</p></form>';
// set the focus on the button
Page::insert_script('$("#confirmed").focus();');
// this may take some time
echo '<p>' . i18n::s('When you will click on the button the server will be immediately requested to proceed. However, because of the so many things to do on the back-end, you may have to wait for minutes before getting a response displayed. Thank you for your patience.') . '</p>';
// just do it
} else {
// the splash message
echo '<p>' . i18n::s('All reference scripts are included, to show evidence of possible syntax errors.') . "</p>\n";
// list running scripts
echo '<p>' . i18n::s('Listing files...') . BR . "\n";
// locate script files starting at root
$scripts = Scripts::list_scripts_at(NULL);
if (is_array($scripts) && count($scripts)) {
echo BR . sprintf(i18n::s('%d scripts have been found.'), count($scripts)) . "\n";
natsort($scripts);
}
echo "</p>\n";
// including scripts
echo '<p>' . i18n::s('Including reference scripts...') . BR . "\n";
// strip as much output as possible
$_SERVER['REQUEST_METHOD'] = 'HEAD';
// we will finalize this page later on
global $finalizing_fuse;
$finalizing_fuse = FALSE;
// take care of dependancies
include_once '../behaviors/behavior.php';
include_once '../services/codec.php';
include_once '../users/authenticator.php';
// analyse each script
$included_files = 0;
$links_to_be_checked_manually = array();
foreach ($scripts as $file) {
// ensure we have enough time to process this script
Safe::set_time_limit(30);
// skip run once scripts
if (strpos($file, 'run_once/')) {
continue;
}
// don't include ourself
if ($file == 'scripts/validate.php') {
continue;
}
// process only reference scripts
if (!Scripts::hash($file)) {
continue;
}
// check file content
if (!($handle = Safe::fopen($file, 'rb'))) {
echo sprintf(i18n::s('%s has no readable content.'), $file) . BR . "\n";
continue;
}
// look at the beginning of the file
if (!($header = fread($handle, 16384))) {
echo sprintf(i18n::s('%s has no readable content.'), $file) . BR . "\n";
fclose($handle);
continue;
}
fclose($handle);
// skip scripts that generate content asynchronously
if (stripos($header, 'send_body') || stripos($header, 'page::content')) {
$links_to_be_checked_manually[$file] = '(asynchronous)';
continue;
}
// skip scripts that would redefine our skin
if (stripos($header, 'extends skin_skeleton')) {
$links_to_be_checked_manually[$file] = '(skin)';
continue;
}
// log script inclusion on development host
if ($context['with_debug'] == 'Y') {
logger::remember('scripts/validate.php: inclusion of ' . $file, '', 'debug');
}
// include the script and display any error
$included_files += 1;
$validate_stamp = time();
echo sprintf(i18n::s('inclusion of %s'), $file) . "\n";
Safe::chdir($context['path_to_root'] . dirname($file));
include_once $context['path_to_root'] . $file;
$duration = time() - $validate_stamp;
//.........这里部分代码省略.........
示例2: sprintf
$context['text'] .= sprintf(i18n::s('%d transmission errors have been encountered.'), $recipients_errors) . BR . "\n";
}
// save digest stamp, if any
if (isset($_REQUEST['digest_stamp']) && $_REQUEST['digest_stamp'] > NULL_DATE) {
Values::set('letters.digest.stamp', $_REQUEST['digest_stamp']);
}
// display the execution time
$time = round(get_micro_time() - $context['start_time'], 2);
$context['text'] .= '<p>' . sprintf(i18n::s('Script terminated in %.2f seconds.'), $time) . '</p>';
// forward to the index page
$menu = array('letters/' => i18n::s('Newsletters'));
$context['text'] .= Skin::build_list($menu, 'menu_bar');
// make the user select an option
} else {
// the splash message
$context['text'] .= '<p>' . i18n::s('This script will help you to prepare and to send a electronic message to community members. Please select below the action you would like to perform. Depending on your choice, the assistant may ask for additional parameters on successive panels.') . '</p>' . "\n";
// the form
$context['text'] .= '<form method="get" action="' . $context['script_url'] . '" id="main_form">' . "\n";
// a digest of most recent articles
$context['text'] .= '<p><input type="radio" name="action" value="digest" selected="selected" /> ' . i18n::s('Send a digest of articles published recently') . '</p>' . "\n";
// list featured pages
$context['text'] .= '<p><input type="radio" name="action" value="featured" /> ' . i18n::s('List featured pages') . '</p>' . "\n";
// some announcement
$context['text'] .= '<p><input type="radio" name="action" value="announcement" /> ' . i18n::s('Send one announcement to community members') . '</p>' . "\n";
// the submit button
$context['text'] .= '<p>' . Skin::build_submit_button(i18n::s('Next step'), i18n::s('Press [s] to continue'), 's') . '</p>' . "\n";
// end of the form
$context['text'] .= '</form>' . "\n";
}
// render the skin
render_skin();
示例3:
} else {
// if the server is currently switched off
if (file_exists($context['path_to_root'] . 'parameters/switch.off')) {
// server status
Logger::error(i18n::s('The server is currently switched off. All users are redirected to the closed page.'));
// the confirmation question
$context['text'] .= '<b>' . i18n::s('You are about to open the server again. Are you sure?') . "</b>\n";
// the menu for this page
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '"><p>' . Skin::build_submit_button(i18n::s('Yes, I do want to switch this server on')) . '<input type="hidden" name="action" value="on" />' . '</p></form>' . "\n";
// else the server is currently switched on
} else {
// server status
$context['text'] .= '<p>' . i18n::s('The server is currently switched on. Pages are provided normally to surfers.') . "</p>\n";
// the confirmation question
$context['text'] .= '<p><b>' . i18n::s('You are about to close the server. Are you sure?') . "</b></p>\n";
// the menu for this page
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '"><div>' . Skin::build_submit_button(i18n::s('Yes, I do want to switch this server off')) . '<input type="hidden" name="action" value="off" />';
// redirect
$label = i18n::s('Option: redirect requests to the following address');
$input = '<input type="text" name="switch_target" size="45" maxlength="255" />';
$context['text'] .= '<p>' . $label . BR . $input . "</p>\n";
// contact information
$label = i18n::s('Option: contact information, such as an email address');
$input = '<input type="text" name="switch_contact" size="45" maxlength="255" />';
$context['text'] .= '<p>' . $label . BR . $input . "</p>\n";
// end of the form
$context['text'] .= '</div></form>' . "\n";
}
}
// render the skin
render_skin();
示例4: sprintf
}
} else {
$errors_count = 0;
}
}
}
// ending message
$context['text'] .= sprintf(i18n::s('%d records have been processed'), $count) . BR . "\n";
// display the execution time
$time = round(get_micro_time() - $context['start_time'], 2);
$context['text'] .= '<p>' . sprintf(i18n::s('Script terminated in %.2f seconds.'), $time) . '</p>';
// forward to the index page
$menu = array('comments/' => i18n::s('Threads'));
$context['text'] .= Skin::build_list($menu, 'menu_bar');
// which check?
} else {
// the splash message
$context['text'] .= '<p>' . i18n::s('Please select the action to perform.') . "</p>\n";
// the form
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" id="main_form">';
// look for orphan articles
$context['text'] .= '<p><input type="radio" name="action" id="action" value="orphans" /> ' . i18n::s('Look for orphan records') . '</p>';
// the submit button
$context['text'] .= '<p>' . Skin::build_submit_button(i18n::s('Start')) . '</p>' . "\n";
// end of the form
$context['text'] .= '</form>';
// set the focus on the button
Page::insert_script('$("#action").focus();');
}
// render the skin
render_skin();
示例5: sprintf
if (isset($item['avatar_url']) && $item['avatar_url']) {
$context['text'] .= '<p>' . sprintf(i18n::s('Current picture: %s'), BR . '<img src="' . $item['avatar_url'] . '" alt="" style="avatar" />') . '</p>' . "\n";
} else {
$context['text'] .= '<p>' . i18n::s('No picture has been set for this profile.') . '</p>';
}
// list available avatars, except on error
if (!count($context['error']) && isset($item['id'])) {
// upload an image
//
if (Images::allow_creation($item, null, 'user')) {
// the form to post an image
$text = '<form method="post" action="' . $context['url_to_root'] . 'images/edit.php" id="main_form" enctype="multipart/form-data"><div>' . '<input type="hidden" name="anchor" value="user:' . $item['id'] . '" />' . '<input type="hidden" name="action" value="set_as_avatar" />';
$fields = array();
// the image
$text .= '<input type="file" name="upload" id="upload" size="30" accesskey="i" title="' . encode_field(i18n::s('Press to select a local file')) . '" />';
$text .= ' ' . Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's');
$text .= BR . '<span class="details">' . i18n::s('Select a .png, .gif or .jpeg image.') . ' (< ' . Skin::build_number($image_maximum_size, i18n::s('bytes')) . ')</span>';
// end of the form
$text .= '</div></form>';
// the script used for form handling at the browser
Page::insert_script('$("#upload").focus();');
$context['text'] .= Skin::build_content(NULL, i18n::s('Upload an image'), $text);
}
// use the library
//
// where images are
$path = 'skins/_reference/avatars';
// browse the path to list directories and files
if ($dir = Safe::opendir($context['path_to_root'] . $path)) {
$text = '';
if (Surfer::may_upload()) {
示例6: load_skin
load_skin('services');
// the title of the page
$context['page_title'] = i18n::s('Sample blog client');
// make a target
$target = '';
if (isset($_REQUEST['target'])) {
$target = $_REQUEST['target'];
} elseif (isset($context['host_name'])) {
$target = $context['host_name'] . rtrim($context['url_to_root'], '/');
}
$user_name = isset($_REQUEST['user_name']) ? $_REQUEST['user_name'] : '';
$user_password = isset($_REQUEST['user_password']) ? $_REQUEST['user_password'] : '';
// display a specific form
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" id="main_form"><div>';
$label = i18n::s('Server address');
$input = '<input type="text" name="target" id="target" size="30" maxlength="128" value="' . encode_field($target) . '" />' . "\n" . ' ' . Skin::build_submit_button(i18n::s('Go'));
$hint = i18n::s('The name or the IP address of the yacs server');
$fields[] = array($label, $input, $hint);
$label = i18n::s('User name');
$input = '<input type="text" name="user_name" size="30" maxlength="128" value="' . encode_field($user_name) . '" />';
$fields[] = array($label, $input);
$label = i18n::s('User password');
$input = '<input type="password" name="user_password" size="30" maxlength="128" value="' . $user_password . '" />';
$fields[] = array($label, $input);
$context['text'] .= Skin::build_form($fields);
$context['text'] .= '</div></form>';
// set the focus at the first field
Page::insert_script('$("#target").focus();');
// do the test
if (isset($_REQUEST['target'])) {
// call blog web service
示例7: list
list($server_ping, $server_label) = $attributes;
$milestone = get_micro_time();
$result = @Call::invoke($server_ping, 'weblogUpdates.ping', array(strip_tags($context['site_name']), $context['url_to_home'] . $context['url_to_root']), 'XML-RPC');
if ($result[0]) {
$label = round(get_micro_time() - $milestone, 2) . ' sec.';
} else {
$label = @$result[1];
}
$context['text'] .= '<li>' . $server_label . ' (' . $label . ')</li>';
}
$context['text'] .= '</ul>';
// no server to ping
} else {
$context['text'] .= '<p>' . i18n::s('No server has been created yet.') . '</p>';
}
// back to the index of servers
$menu = array('servers/' => i18n::s('Servers'));
$context['text'] .= Skin::build_list($menu, 'menu_bar');
// remember this in log as well
Logger::remember('servers/ping.php: The cloud has been pinged');
// operation has to be confirmed
} else {
// introductory text
$context['text'] .= '<p>' . i18n::s('This script will ping (<code>weblogUpdates.ping</code>) every server configured to be part of our cloud. Normally, the publication script does this automatically. However, no ping occurs for pages submitted by XML-RPC or by e-mail. Therefore, you should launch this script at least once per month to ensure everybody knows about this site.') . '</p>';
// the submit button
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" id="main_form"><p>' . '<input type="hidden" name="action" value="ping" />' . Skin::build_submit_button(i18n::s('Yes, I want to ping the cloud')) . '</p></form>';
// set the focus on the backup button
Page::insert_script('$("#go").focus();');
}
// render the skin
render_skin();
示例8: natsort
if ($file == $item) {
$checked = ' selected="selected"';
}
$items[] = '<option value="' . $item . '"' . $checked . '>skin/' . $skin . '/' . $item . "</option>\n";
}
Safe::closedir($dir);
// list items by alphabetical order
if (@count($items)) {
natsort($items);
foreach ($items as $item) {
$context['text'] .= $item;
}
}
}
$context['text'] .= '</select> ' . Skin::build_submit_button(i18n::s('Go')) . '</p></form>';
// allow for content modification
if ($file) {
// start of the form
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '"><div>' . '<input type="hidden" name="skin" value="' . encode_field($skin) . '" />' . '<input type="hidden" name="file" value="' . encode_field($file) . '" />';
// load file content
if (!($content = Safe::file_get_contents('../skins/' . $skin . '/' . $file))) {
Logger::error(i18n::s('No file has been transmitted.'));
}
// textarea to edit the file
$context['text'] .= '<textarea name="content" rows="25" cols="50" accesskey="c">' . encode_field($content) . '</textarea>';
// button to upload changes
$context['text'] .= BR . Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's') . '</div></form>' . "\n";
}
}
// render the skin
render_skin();
示例9: sprintf
} else {
$context['text'] .= '<p>' . sprintf(i18n::s('You have been assigned as an editor of %s, and this allows you to contribute to this page, and to be notified of changes.'), Skin::build_link($anchor->get_url(), $anchor->get_title())) . '</p>';
}
// cautioon on private areas
if ($anchor->get_active() == 'N') {
if ($type == 'section') {
$context['text'] .= '<p>' . i18n::s('Access to this section is restricted. If you continue, it will become invisible to you, and you will not be able to even browse its content anymore.') . '</p>';
} else {
$context['text'] .= '<p>' . i18n::s('Access to this page is restricted. If you continue, it will become invisible to you, and you will not be able to even browse its content anymore.') . '</p>';
}
}
// ask for confirmation
if ($type == 'section') {
$context['text'] .= '<p>' . i18n::s('You are about to suppress all your editing rights on this section.') . '</p>';
} else {
$context['text'] .= '<p>' . i18n::s('You are about to suppress all your editing rights on this page.') . '</p>';
}
$bottom = '<p>' . i18n::s('Are you sure?') . '</p>';
// commands
$menu = array();
$menu[] = Skin::build_submit_button(i18n::s('Yes'), NULL, NULL, 'confirmed');
$menu[] = Skin::build_link($anchor->get_url(), i18n::s('No'), 'span');
// render commands
$bottom .= '<form method="post" action="' . $context['script_url'] . '" id="main_form"><p>' . "\n" . Skin::finalize_list($menu, 'menu_bar') . '<input type="hidden" name="id" value="' . $anchor->get_reference() . '" />' . "\n" . '<input type="hidden" name="action" value="leave" />' . "\n" . '</p></form>' . "\n";
//
$context['text'] .= Skin::build_block($bottom, 'bottom');
// set the focus
Page::insert_script('$("confirmed").focus();');
}
// render the skin
render_skin();
示例10: elseif
}
}
// deletion has to be confirmed
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
Logger::error(i18n::s('The action has not been confirmed.'));
} else {
// commands
$menu = array();
$delete_label = '';
if (is_object($overlay)) {
$delete_label = $overlay->get_label('delete_confirmation', 'comments');
}
if (!$delete_label) {
$delete_label = i18n::s('Yes, I want to delete this comment');
}
$menu[] = Skin::build_submit_button($delete_label, NULL, NULL, 'confirmed', $render_overlaid ? 'button submit-overlaid' : 'button');
if (isset($item['id']) && !$render_overlaid) {
$menu[] = Skin::build_link(Comments::get_url($item['id']), i18n::s('Cancel'), 'span');
} elseif ($render_overlaid) {
$menu[] = '<a href="javascript:;" onclick="Yacs.closeModalBox()">' . i18n::s('Cancel') . '</a>' . "\n";
}
// the submit button
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" id="main_form">' . "\n" . Skin::finalize_list($menu, 'menu_bar') . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="confirm" value="yes" />' . "\n" . (isset($_REQUEST['follow_up']) ? '<input type="hidden" name="follow_up" value="' . $_REQUEST['follow_up'] . '" />' . "\n" : '') . '</form>' . "\n";
// set the focus
Page::insert_script('$("#confirmed").focus();');
// display the full comment
$context['text'] .= '<div style="padding: 1em; background-color:#CCC;">' . Codes::beautify($item['description']) . '</div>' . "\n";
// details
$details = array();
// the poster of this comment
$details[] = sprintf(i18n::s('by %s %s'), Users::get_link($item['create_name'], $item['create_address'], $item['create_id']), Skin::build_date($item['create_date']));
示例11: array
$fields[] = array($label, $input);
// the password has to be repeated for confirmation
$label = i18n::s('Password confirmation');
$input = '<input type="password" name="confirm" size="20" value="' . encode_field(isset($_REQUEST['confirm']) ? $_REQUEST['confirm'] : '') . '" />';
$fields[] = array($label, $input);
// append the script used for data checking on the browser
Page::insert_script('$("#password").focus();');
}
// stop replay attacks and robots
if ($field = Surfer::get_robot_stopper()) {
$fields[] = $field;
}
// build the form
$context['text'] .= Skin::build_form($fields);
// cancel link
if (!isset($item['id'])) {
$cancel_url = $context['url_to_home'] . $context['url_to_root'];
} else {
$cancel_url = Users::get_permalink($item);
}
// bottom commands
$context['text'] .= Skin::finalize_list(array(Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's'), Skin::build_link($cancel_url, i18n::s('Cancel'), 'span')), 'assistant_bar');
// hidden field that have to be saved as well
if (isset($item['id']) && $item['id']) {
$context['text'] .= '<input type="hidden" name="id" value="' . $item['id'] . '" />';
}
// end of the form
$context['text'] .= '</div></form>';
}
// render the skin
render_skin();
示例12: load_skin
* @author Bernard Paques
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once '../shared/global.php';
// load localized strings
i18n::bind('tools');
// load the skin
load_skin('tools');
// the path to this page
$context['path_bar'] = array('tools/' => i18n::s('Tools'));
// page title
$context['page_title'] = i18n::s('AJAX demonstration');
// working overlay
$context['text'] .= '<p style="margin-bottom: 1em;">' . Skin::build_submit_button(i18n::s('Working overlay')) . ' - ' . i18n::s('Click on the button, then click on the overlay to hide it') . '</p>' . "\n";
// a modal box
$context['text'] .= '<p style="margin-bottom: 1em;"><a href="#" onclick="Yacs.displayModalBox({ title: "' . i18n::s('AJAX demonstration') . '",' . 'body: "Lorem ipsum dolor sit amet, consectetur adipisicing elit,<br />sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",' . 'button_TRUE: "' . i18n::s('OK') . '"}, function(choice) { alert(\'' . i18n::s('OK') . '\') } ); return false;" class="button"><span>' . i18n::s('Modal box') . '</span></a> - ' . i18n::s('Click on the button, then handle the modal box') . '</p>' . "\n";
// an alert box
$context['text'] .= '<p style="margin-bottom: 1em;"><a href="#" onclick="Yacs.alert(\'' . i18n::s('AJAX demonstration') . '\', function() { alert(\'' . i18n::s('OK') . '\') })" class="button"><span>' . i18n::s('Alert box') . '</span></a> - ' . i18n::s('Click on the button to show the alert message') . '</p>' . "\n";
// a confirmation dialog box
$context['text'] .= '<p style="margin-bottom: 1em;"><a href="#" onclick="Yacs.confirm(\'' . i18n::s('AJAX demonstration') . '\', function(choice) { if(choice) { alert(\'' . i18n::s('OK') . '\') } })" class="button"><span>' . i18n::s('Confirmation box') . '</span></a> - ' . i18n::s('Click on the button to make your choice') . '</p>' . "\n";
// notifications
$context['text'] .= '<p style="margin-bottom: 1em;"><a href="#" onclick="Yacs.handleAlertNotification({ title: "' . i18n::s('Alert notification') . '",' . 'nick_name: "Foo Bar",' . 'address: "http://www.google.com/" })" class="button"><span>' . i18n::s('Alert notification') . '</span></a>' . ' <a href="#" onclick="Yacs.handleBrowseNotification({ message: "' . i18n::s('Browse notification') . '",' . 'nick_name: "Foo Bar",' . 'address: "http://www.google.com/" })" class="button"><span>' . i18n::s('Browse notification') . '</span></a>' . ' <a href="#" onclick="Yacs.handleHelloNotification({ message: "' . i18n::s('Hello notification') . '",' . 'nick_name: "Foo Bar" })" class="button"><span>' . i18n::s('Hello notification') . '</span></a> - ' . i18n::s('Click on buttons to process notifications') . '</p>' . "\n";
// a scaled iframe for preview
$context['text'] .= '<p style="margin-bottom: 1em;"><a href="http://www.cisco.com/" class="button tipsy_preview"><span>' . i18n::s('Cisco') . '</span></a> - ' . i18n::s('Hover the button to display a preview') . '</p>' . "\n";
// a popup box
$context['text'] .= '<p style="margin-bottom: 1em;"><a href="http://www.cisco.com/" onclick="Yacs.popup( { url: this.href, width: \'100%\', height: \'100%\' } ); return false;" class="button"><span>' . i18n::s('Cisco') . '</span></a> - ' . i18n::s('Click on the button to trigger the popup window') . '</p>' . "\n";
// a JSON-RPC call -- see services/rpc_echo_hook.php
$context['text'] .= '<p style="margin-bottom: 1em;"><a href="#" onclick="Yacs.call( { method: \'echo\', params: { message: \'' . i18n::s('AJAX demonstration') . '\' }, id: 123 }, function(s) { if(s.message) { alert(s.message); } else { alert(\'failed!\'); } } ); return false;" class="button"><span>JSON-RPC echo</span></a> - ' . i18n::s('Click on the button to call a remote function') . '</p>' . "\n";
// another JSON-RPC call -- see services/rpc_activity_hook.php
示例13: while
// owners of parent containers
$reference = $item['anchor'];
while ($reference) {
if (!($parent = Anchors::get($reference))) {
break;
}
if (($owner_id = $parent->get_value('owner_id')) && ($user = Users::get($owner_id)) && $user['email']) {
$owners[] = $user['id'];
}
$reference = $parent->get_value('anchor');
}
// suggest to query one of available owners
if ($owners) {
$context['text'] .= '<div>' . i18n::ns('Following person is entitled to invite you to participate:', 'Following persons are entitled to invite you to participate:', count($owners)) . '</div>';
// the form
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" id="main_form"><div>' . Users::list_for_ids($owners, 'request') . Skin::finalize_list(array(Skin::build_submit_button(i18n::s('Submit a request to get access'))), 'menu_bar') . '<input type="hidden" name="id" value="' . $item['id'] . '">' . '</div></form>';
}
}
// re-enforce the canonical link
} elseif (!$zoom_type && $page == 1 && $context['self_url'] && $whole_rendering && strncmp($context['self_url'], $context['page_link'], strlen($context['page_link']))) {
Safe::header('Status: 301 Moved Permanently', TRUE, 301);
Safe::header('Location: ' . $context['page_link']);
Logger::error(Skin::build_link($context['page_link']));
// display the article
} else {
// behaviors can change page menu
if (is_object($behaviors)) {
$context['page_menu'] = $behaviors->add_commands('articles/view.php', 'article:' . $item['id'], $context['page_menu']);
}
// remember surfer visit
Surfer::is_visiting(Articles::get_permalink($item), Codes::beautify_title($item['title']), 'article:' . $item['id'], $item['active']);
示例14: elseif
// notify sysops
Logger::notify('articles/duplicate.php: ' . $label, $description);
}
// action has to be confirmed
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
Logger::error(i18n::s('The action has not been confirmed.'));
// please confirm
} else {
// the article or the anchor icon, if any
$context['page_image'] = $item['icon_url'];
if (!$context['page_image'] && is_object($anchor)) {
$context['page_image'] = $anchor->get_icon_url();
}
// commands
$menu = array();
$menu[] = Skin::build_submit_button(i18n::s('Yes, I want to duplicate this page'), NULL, NULL, 'confirmed');
if (isset($item['id'])) {
$menu[] = Skin::build_link(Articles::get_permalink($item), i18n::s('Cancel'), 'span');
}
// render commands
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '" id="main_form"><p>' . "\n" . Skin::finalize_list($menu, 'menu_bar') . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="duplicate" />' . "\n" . '</p></form>' . "\n";
// set the focus
Page::insert_script('$("#confirmed").focus();');
// the title of the action
$context['text'] .= Skin::build_block($item['title'], 'title');
// the introduction text, if any
$context['text'] .= '<div style="margin: 1em 0;">' . Codes::beautify($item['introduction']) . '</div>' . "\n";
// get text related to the overlay, if any
if (is_object($overlay)) {
$context['text'] .= $overlay->get_text('view', $item);
}
示例15: elseif
} elseif (!strncmp($key, 'temporary/cache_i18n_locale_', 28)) {
} elseif (!strncmp(substr($key, -4), '.php', 4)) {
// one of the parameter files created by yacs
if (preg_match('/parameters\\/(agents|control|feeds|files|hooks|letters|root|scripts|services|skins|users|virtual_.+)\\.include\\.php$/i', $key)) {
} elseif (isset($footprints[$key])) {
$expected = $footprints[$key];
$actual = Scripts::hash($node);
if ($expected[0] != $actual[0] || $expected[1] != $actual[1]) {
$context['text'] .= sprintf(i18n::s('ERROR: File %s is missing or corrupted.'), $key) . BR . "\n";
}
} else {
$context['text'] .= sprintf(i18n::s('File %s is not part of Yacs.'), $key) . BR . "\n";
}
// not a safe file
} elseif (!preg_match('/\\.(bak|bat|css|done|dtd|fdb|flv|gif|ico|jpeg|jpg|js|jsmin|htc|htm|html|mo|off|on|pdf|png|po|pot|reg|sh|sql|swf|tgz|txt|xml|zip)$/i', $key)) {
$context['text'] .= sprintf(i18n::s('File %s is not part of Yacs.'), $key) . BR . "\n";
}
}
// ensure enough execution time
// Safe::set_time_limit(30);
// list of updated scripts
$context['text'] .= '<p>' . i18n::s('Checking scripts...') . BR . "\n";
Scripts::walk_files_at($context['path_to_root'], 'check_file');
} else {
// splash message
$context['text'] .= '<p>' . i18n::s('Click on the button below to check running scripts on your server.') . "</p>\n";
// propose to update the server
$context['text'] .= '<form method="post" action="' . $context['script_url'] . '"><p>' . Skin::build_submit_button(i18n::s('Yes, I want to check scripts on this server')) . '<input type="hidden" name="action" value="confirmed" />' . '</p></form>' . "\n";
}
// render the skin
render_skin();