本文整理汇总了PHP中get_secure_htsrv_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_secure_htsrv_url函数的具体用法?PHP get_secure_htsrv_url怎么用?PHP get_secure_htsrv_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_secure_htsrv_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: str_replace
$message = $unsaved_message_params['message'];
$email_author = $unsaved_message_params['sender_name'];
$email_author_address = $unsaved_message_params['sender_address'];
}
echo str_replace('$form_title$', $params['msgform_form_title'], $params['skin_form_before']);
$Form = new Form($submit_url);
$Form->switch_template_parts($params['skin_form_params']);
$Form->begin_form('bComment');
$Form->add_crumb('newmessage');
if (isset($Blog)) {
$Form->hidden('blog', $Blog->ID);
}
$Form->hidden('recipient_id', $recipient_id);
$Form->hidden('post_id', $post_id);
$Form->hidden('comment_id', $comment_id);
$Form->hidden('redirect_to', url_rel_to_same_host($redirect_to, get_secure_htsrv_url()));
$Form->info(T_('To'), $recipient_link);
// Note: we use funky field names in order to defeat the most basic guestbook spam bots:
// email form
$Form->text_input($dummy_fields['name'], $email_author, 40, T_('From'), T_('Your name.'), array('maxlength' => 50, 'class' => 'wide_input', 'required' => true));
$Form->text_input($dummy_fields['email'], $email_author_address, 40, T_('Email'), T_('Your email address. (Will <strong>not</strong> be displayed on this site.)'), array('maxlength' => 150, 'class' => 'wide_input', 'required' => true));
$Form->text_input($dummy_fields['subject'], $subject, 40, T_('Subject'), T_('Subject of your message.'), array('maxlength' => 255, 'class' => 'wide_input', 'required' => true));
$Form->textarea($dummy_fields['content'], $message, 15, T_('Message'), T_('Plain text only.'), 35, 'wide_textarea', true);
$Plugins->trigger_event('DisplayMessageFormFieldset', array('Form' => &$Form, 'recipient_ID' => &$recipient_id, 'item_ID' => $post_id, 'comment_ID' => $comment_id));
// Form buttons:
echo $Form->begin_field(NULL, '');
// Standard button to send a message
$Form->button_input(array('name' => 'submit_message_' . $recipient_id, 'class' => 'submit', 'value' => T_('Send message')));
// Additional buttons from plugins
$Plugins->trigger_event('DisplayMessageFormButton', array('Form' => &$Form, 'recipient_ID' => &$recipient_id, 'item_ID' => $post_id, 'comment_ID' => $comment_id));
echo $Form->end_field();
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_contact_msg.form.php
示例2: get_rotate_avatar_icons
/**
* Get the rotate avatar icons
*
* @param integer File ID
* @param array Params
* @return string HTML text with 3 icons to rotate avatar
*/
function get_rotate_avatar_icons($file_ID, $params = array())
{
// Make sure we are not missing any param:
$params = array_merge(array('before' => '<br />', 'after' => '', 'text' => '', 'user_tab' => 'avatar'), $params);
// Init links to rotate avatar
if (is_admin_page()) {
// Back-office
$url_rotate_90_left = regenerate_url('', 'user_tab=' . $params['user_tab'] . '&user_ID=' . $this->ID . '&action=rotate_avatar_90_left&file_ID=' . $file_ID . '&' . url_crumb('user'), '', '&');
$url_rotate_180 = regenerate_url('', 'user_tab=' . $params['user_tab'] . '&user_ID=' . $this->ID . '&action=rotate_avatar_180&file_ID=' . $file_ID . '&' . url_crumb('user'), '', '&');
$url_rotate_90_right = regenerate_url('', 'user_tab=' . $params['user_tab'] . '&user_ID=' . $this->ID . '&action=rotate_avatar_90_right&file_ID=' . $file_ID . '&' . url_crumb('user'), '', '&');
} else {
// Front-office
global $Blog;
$url_rotate_90_left = get_secure_htsrv_url() . 'profile_update.php?user_tab=' . $params['user_tab'] . '&blog=' . $Blog->ID . '&user_ID=' . $this->ID . '&action=rotate_avatar_90_left&file_ID=' . $file_ID . '&' . url_crumb('user');
$url_rotate_180 = get_secure_htsrv_url() . 'profile_update.php?user_tab=' . $params['user_tab'] . '&blog=' . $Blog->ID . '&user_ID=' . $this->ID . '&action=rotate_avatar_180&file_ID=' . $file_ID . '&' . url_crumb('user');
$url_rotate_90_right = get_secure_htsrv_url() . 'profile_update.php?user_tab=' . $params['user_tab'] . '&blog=' . $Blog->ID . '&user_ID=' . $this->ID . '&action=rotate_avatar_90_right&file_ID=' . $file_ID . '&' . url_crumb('user');
}
$html = $params['before'];
$html .= action_icon(T_('Rotate this picture 90° to the left'), 'rotate_left', $url_rotate_90_left, '', 0, 0, array('style' => 'margin-right:4px'));
$html .= action_icon(T_('Rotate this picture 180°'), 'rotate_180', $url_rotate_180, '', 0, 0, array('style' => 'margin-right:4px'));
$html .= action_icon(T_('Rotate this picture 90° to the right'), 'rotate_right', $url_rotate_90_right, $params['text'], empty($params['text']) ? 0 : 3, empty($params['text']) ? 0 : 4);
$html .= $params['after'];
return $html;
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_user.class.php
示例3: param
// Load the AdminUI class for the skin.
$user_tab = param('user_tab', 'string');
global $current_User, $UserSettings, $is_admin_page;
$admin_skin = $UserSettings->get('admin_skin', $current_User->ID);
$is_admin_page = true;
require_once $adminskins_path . $admin_skin . '/_adminUI.class.php';
$AdminUI = new AdminUI();
} else {
// Load Blog skin
$BlogCache =& get_BlogCache();
$Blog =& $BlogCache->get_by_ID($blog_ID, true);
$skin_ID = $Blog->get_skin_ID();
$SkinCache =& get_SkinCache();
$Skin =& $SkinCache->get_by_ID($skin_ID);
}
$display_mode = 'js';
$form_action = get_secure_htsrv_url() . 'profile_update.php';
require $inc_path . 'users/views/_user_groups.form.php';
break;
default:
$Ajaxlog->add(T_('Incorrect action!'), 'error');
break;
}
$disp = NULL;
$ctrl = NULL;
if ($current_debug || $current_debug_jslog) {
// debug is ON
$Ajaxlog->display(NULL, NULL, true, 'all', array('error' => array('class' => 'jslog_error', 'divClass' => false), 'note' => array('class' => 'jslog_note', 'divClass' => false)), 'ul', 'jslog');
}
echo '<!-- Ajax response end -->';
exit(0);
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:anon_async.php
示例4: die
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
load_class('regional/model/_country.class.php', 'Country');
global $Blog, $Session, $Messages, $inc_path;
global $action, $user_profile_only, $edited_User, $form_action;
if (!is_logged_in()) {
// must be logged in!
echo '<p class="error">' . T_('You are not logged in.') . '</p>';
return;
}
// set params
if (!isset($params)) {
$params = array();
}
$params = array_merge(array('display_profile_tabs' => true, 'profile_tabs' => array('block_start' => '<div class="tabs">', 'item_start' => '<div class="option">', 'item_end' => '</div>', 'item_selected_start' => '<div class="selected">', 'item_selected_end' => '</div>', 'block_end' => '</div><div class="clear"></div>'), 'form_action' => get_secure_htsrv_url() . 'profile_update.php'), $params);
$form_action = $params['form_action'];
$user_profile_only = true;
// check if there is unsaved User object stored in Session
$edited_User = $Session->get('core.unsaved_User');
if ($edited_User == NULL) {
// edited_User is the current_User
$edited_User = $current_User;
} else {
// unsaved user exists, delete it from Session
$Session->delete('core.unsaved_User');
if ($edited_User->ID != $current_User->ID) {
// edited user ID must be the same as current User
debug_die('Inconsistent state, you are allowed to edit only your profile');
}
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_profile.disp.php
示例5: init_autocomplete_login_js
/**
* Registers headlines required to autocomplete the user logins
*
* @param string alias, url or filename (relative to rsc/css, rsc/js) for JS/CSS files
*/
function init_autocomplete_login_js($relative_to = 'rsc_url')
{
require_js('#jquery#', $relative_to);
// dependency
// Use hintbox plugin of jQuery
// Add jQuery hintbox (autocompletion).
// Form 'username' field requires the following JS and CSS.
// fp> TODO: think about a way to bundle this with other JS on the page -- maybe always load hintbox in the backoffice
// dh> Handle it via http://www.appelsiini.net/projects/lazyload ?
// dh> TODO: should probably also get ported to use jquery.ui.autocomplete (or its successor)
require_css('jquery/jquery.hintbox.css', $relative_to);
require_js('jquery/jquery.hintbox.min.js', $relative_to);
add_js_headline('jQuery( document ).ready( function()
{
jQuery( "input.autocomplete_login" ).hintbox(
{
url: "' . get_secure_htsrv_url() . 'async.php?action=get_login_list",
matchHint: true,
autoDimentions: true
} );
} );');
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:27,代码来源:_template.funcs.php
示例6: display
/**
* Display the widget!
*
* @param array MUST contain at least the basic display params
*/
function display($params)
{
global $Blog, $Settings, $Session, $redirect_to, $dummy_fields;
if (is_logged_in()) {
// No display when user is already registered
return false;
}
if ($Settings->get('newusers_canregister') != 'yes' || !$Settings->get('quick_registration')) {
// Display error message when quick registration is disabled
echo '<p class="error">' . T_('Quick registration is currently disabled on this system.') . '</p>';
return false;
}
// Restore the typed in params from the redirected page:
$widget_param_input_err_messages = $Session->get('param_input_err_messages_' . $this->ID);
$widget_param_input_values = $Session->get('param_input_values_' . $this->ID);
if (!empty($widget_param_input_err_messages)) {
// Convert param errors to global $param_input_err_messages that is used to display an error text under input field
global $param_input_err_messages;
$param_input_err_messages = $widget_param_input_err_messages;
}
// Clear the temp session vars
$Session->delete('param_input_err_messages_' . $this->ID);
$Session->delete('param_input_values_' . $this->ID);
$Session->dbsave();
$this->init_display($params);
if (isset($this->BlockCache)) {
// Do NOT cache some of these links are using a redirect_to param, which makes it page dependent.
// Note: also beware of the source param.
// so this will be cached by the PageCache; there is no added benefit to cache it in the BlockCache
// (which could have been shared between several pages):
$this->BlockCache->abort_collect();
}
echo $this->disp_params['block_start'];
$redirect_to = param('redirect_to', 'url', regenerate_url('', '', '', '&'));
$this->disp_title();
echo $this->disp_params['block_body_start'];
if (!empty($this->disp_params['intro'])) {
// Intro text
echo '<p>' . $this->disp_params['intro'] . '</p>';
}
$Form = new Form(get_secure_htsrv_url() . 'register.php', 'register_form', 'post');
$Form->begin_form();
$Form->add_crumb('regform');
$Form->hidden('action', 'quick_register');
$Form->hidden('inskin', true);
$Form->hidden('blog', $Blog->ID);
$Form->hidden('widget', $this->ID);
$Form->hidden('redirect_to', $redirect_to);
// E-mail
$email_value = isset($widget_param_input_values[$dummy_fields['email']]) ? $widget_param_input_values[$dummy_fields['email']] : '';
$Form->text_input($dummy_fields['email'], $email_value, 50, T_('Your email'), '', array('maxlength' => 255, 'class' => 'input_text', 'required' => true));
if ($this->disp_params['ask_firstname'] != 'no') {
// First name
$firstname_value = isset($widget_param_input_values['firstname']) ? $widget_param_input_values['firstname'] : '';
$Form->text_input('firstname', $firstname_value, 18, T_('First name'), '', array('maxlength' => 50, 'class' => 'input_text', 'required' => $this->disp_params['ask_firstname'] == 'required'));
}
if ($this->disp_params['ask_lastname'] != 'no') {
// Last name
$lastname_value = isset($widget_param_input_values['lastname']) ? $widget_param_input_values['lastname'] : '';
$Form->text_input('lastname', $lastname_value, 18, T_('Last name'), '', array('maxlength' => 50, 'class' => 'input_text', 'required' => $this->disp_params['ask_lastname'] == 'required'));
}
// Submit button
$Form->begin_fieldset('', array('class' => 'fieldset field_register_btn'));
$Form->button_input(array('value' => $this->disp_params['button'], 'class' => 'submit'));
$Form->end_fieldset();
$Form->end_form();
echo $this->disp_params['block_body_end'];
echo $this->disp_params['block_end'];
if (!empty($widget_param_input_err_messages)) {
// Clear param errors here because we already display them above
// Don't display them twice on another widget form
$param_input_err_messages = NULL;
}
return true;
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:80,代码来源:_user_register.widget.php
示例7: action_icon
if ($action != 'view') {
// We can edit the values:
if ($action != 'new') {
// Get other pictures (not main avatar)
$user_avatars = $edited_User->get_avatar_Links();
$forbid_link = '';
if (is_admin_page()) {
$ctrl_param = '?ctrl=user&user_tab=avatar&user_ID=' . $edited_User->ID;
if ($current_User->can_moderate_user($edited_User->ID)) {
$forbid_link = action_icon(T_('Forbid using as main profile picture'), 'move_down_orange', $ctrl_param . '&action=forbid_avatar&' . url_crumb('user'), ' ' . T_('Forbid using as main profile picture'), 3, 4) . '<br />';
}
$remove_picture_url = $ctrl_param . '&action=remove_avatar&' . url_crumb('user');
$delete_picture_url = $ctrl_param . '&action=delete_avatar&file_ID=' . $edited_User->avatar_file_ID . '&' . url_crumb('user');
} else {
$remove_picture_url = get_secure_htsrv_url() . 'profile_update.php?user_tab=avatar&blog=' . $Blog->ID . '&action=remove_avatar&' . url_crumb('user');
$delete_picture_url = get_secure_htsrv_url() . 'profile_update.php?user_tab=avatar&blog=' . $Blog->ID . '&action=delete_avatar&file_ID=' . $edited_User->avatar_file_ID . '&' . url_crumb('user');
}
if ($edited_User->has_avatar() || count($user_avatars)) {
// If user uploaded at least one profile picture
$change_picture_title = T_('Change') . ' »';
$change_picture_icon = 'edit';
} else {
// If user has no profile picture yet
$change_picture_title = T_('Upload now') . ' »';
$change_picture_icon = 'move_up_green';
}
// Main profile picture with action icons to modify it
$user_pictures = '<div class="avatartag main image_rounded">' . $edited_User->get_avatar_imgtag('crop-top-320x320', 'avatar', 'top', true, '', 'user', '160x160') . '<div class="avatar_actions">' . action_icon($change_picture_title, $change_picture_icon, get_user_settings_url('avatar', $edited_User->ID), ' ' . $change_picture_title, 3, 4);
if ($edited_User->has_avatar() && ($avatar_Link =& $edited_User->get_avatar_Link())) {
// Display these actions only for existing avatar file
$user_pictures .= '<br />' . action_icon(T_('No longer use this as main profile picture'), 'move_down', $remove_picture_url, ' ' . T_('No longer use this as main profile picture'), 3, 4) . '<br />' . $forbid_link . action_icon(T_('Delete this profile picture'), 'delete', $delete_picture_url, ' ' . T_('Delete this profile picture'), 3, 4, array('onclick' => 'return confirm(\'' . TS_('Are you sure want to delete this picture?') . '\');')) . '<br />' . $edited_User->get_rotate_avatar_icons($edited_User->avatar_file_ID, array('before' => '', 'after' => '<br />', 'text' => ' ' . T_('Rotate'), 'user_tab' => 'avatar')) . $edited_User->get_crop_avatar_icon($edited_User->avatar_file_ID, array('before' => '', 'after' => '', 'text' => ' ' . T_('Crop'), 'user_tab' => 'avatar', 'onclick' => 'return user_crop_avatar( ' . $edited_User->ID . ', ' . $edited_User->avatar_file_ID . ', \'avatar\' )'));
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_user_identity.form.php
示例8: echo_user_actions
$form_title = '';
$form_class = 'fform user_report_form';
$Form->title_fmt = '<span style="float:right">$global_icons$</span><div>$title$</div>' . "\n";
if ($display_mode != 'js') {
if (!$user_profile_only) {
echo_user_actions($Form, $edited_User, $action);
}
$form_text_title = T_('Report User');
// used for js confirmation message on leave the changed form
$form_title = get_usertab_header($edited_User, '', $form_text_title);
}
$Form->begin_form($form_class, $form_title, array('title' => isset($form_text_title) ? $form_text_title : $form_title));
$Form->hidden_ctrl();
if (is_admin_page()) {
// Params for backoffice
$Form->hidden('user_tab', $user_tab);
$Form->hidden('is_backoffice', 1);
} else {
// Params for frontoffice
global $Blog;
$Form->hidden('blog', $Blog->ID);
}
$close_icon = '';
if ($display_mode == 'js') {
// Display a close link for popup window
$close_icon = action_icon(T_('Close this window'), 'close', '', '', 0, 0, array('id' => 'close_button', 'class' => 'floatright'));
}
$Form->begin_fieldset(T_('Report User') . $close_icon, array('class' => 'fieldset clear'));
user_report_form(array('Form' => $Form, 'user_ID' => $edited_User->ID, 'crumb_name' => 'user', 'cancel_url' => get_secure_htsrv_url() . 'profile_update.php?' . (is_admin_page() ? 'is_backoffice=1&' : '') . 'action=remove_report&' . 'user_ID=' . $edited_User->ID . '&' . (empty($Blog) || is_admin_page() ? '' : 'blog=' . $Blog->ID . '&') . url_crumb('user')));
$Form->end_fieldset();
$Form->end_form();
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_user_report.form.php
示例9: die
<?php
/**
* This is the form to change a password
*
* This file is part of the evoCore framework - {@link http://evocore.net/}
* See also {@link https://github.com/b2evolution/b2evolution}.
*
* @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
*
* @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
*
* @package htsrv
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
// Header
$page_title = T_('Change password');
$wrap_width = '650px';
require dirname(__FILE__) . '/_html_header.inc.php';
// Change password form
$params = array('display_profile_tabs' => false, 'display_abandon_link' => false, 'button_class' => ' btn-lg', 'skin_form_params' => $login_form_params, 'form_action' => get_secure_htsrv_url() . 'login.php', 'form_button_action' => 'updatepwd', 'form_hidden_crumb' => 'regform', 'check_User_from_Session' => false);
$disp = 'pwdchange';
// Select a form to change a password
$Session->set('core.unsaved_User', $forgetful_User);
require skin_fallback_path('_profile.disp.php', 6);
// Footer
require dirname(__FILE__) . '/_html_footer.inc.php';
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:29,代码来源:_reset_pwd_form.main.php
示例10: foreach
// fp> TODO: a javascript REFRAME feature would ne neat here: selecting a square area of the img and saving it as a new avatar image
if ($current_User->ID == $edited_User->ID || $current_User->check_perm('users', 'edit')) {
// Upload or select:
global $Settings;
if ($Settings->get('upload_enabled') && $Settings->get('fm_enable_roots_user')) {
// Upload is enabled and we have permission to use it...
$user_avatars = $edited_User->get_avatar_Files();
if (count($user_avatars) > 0) {
$info_content = '';
foreach ($user_avatars as $uFile) {
if (is_admin_page()) {
$url_update = regenerate_url('', 'user_tab=avatar&user_ID=' . $edited_User->ID . '&action=update_avatar&file_ID=' . $uFile->ID . '&' . url_crumb('user'), '', '&');
$url_delete = regenerate_url('', 'user_tab=avatar&user_ID=' . $edited_User->ID . '&action=delete_avatar&file_ID=' . $uFile->ID . '&' . url_crumb('user'), '', '&');
} else {
$url_update = get_secure_htsrv_url() . 'profile_update.php?user_tab=avatar&blog=' . $Blog->ID . '&user_ID=' . $edited_User->ID . '&action=update_avatar&file_ID=' . $uFile->ID . '&' . url_crumb('user');
$url_delete = get_secure_htsrv_url() . 'profile_update.php?user_tab=avatar&blog=' . $Blog->ID . '&user_ID=' . $edited_User->ID . '&action=delete_avatar&file_ID=' . $uFile->ID . '&' . url_crumb('user');
}
$info_content .= '<div class="avatartag avatar_rounded">';
$info_content .= $uFile->get_tag('', '', '', '', 'crop-top-80x80', 'original', $edited_User->login, 'lightbox[user_pictures]');
$info_content .= '<br />' . action_icon(T_('Use as main picture'), 'move_up', $url_update, T_('Main'), 3, 4, array(), array('style' => 'margin-right:4px'));
$info_content .= '<br />' . action_icon(T_('Delete this picture'), 'xross', $url_delete, T_('Delete'), 3, 4, array('onclick' => 'return confirm(\'' . TS_('Are you sure want to delete this picture?') . '\');'), array('style' => 'margin-right:4px'));
$info_content .= $edited_User->get_rotate_avatar_icons($uFile->ID);
$info_content .= '</div>';
}
$Form->info(T_('Other pictures'), $info_content);
}
$Form->hidden('action', 'upload_avatar');
// The following is mainly a hint to the browser.
$Form->hidden('MAX_FILE_SIZE', $Settings->get('upload_maxkb') * 1024);
// Upload
$info_content = '<input name="uploadfile[]" type="file" size="10" />';
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_user_avatar.form.php
示例11: is_admin_page
$info_content .= '<div class="avatartag avatar_rounded">';
$info_content .= $user_Link->get_tag(array('before_image' => '', 'before_image_legend' => '', 'after_image_legend' => '', 'after_image' => '', 'image_size' => 'crop-top-160x160', 'image_link_title' => $edited_User->login, 'image_link_rel' => 'lightbox[user_pictures]'));
if ($user_Link->File->get('can_be_main_profile')) {
// Link to set picture as Main
$url_update = is_admin_page() ? regenerate_url('', 'user_tab=avatar&user_ID=' . $edited_User->ID . '&action=update_avatar&file_ID=' . $user_Link->File->ID . '&' . url_crumb('user'), '', '&') : get_secure_htsrv_url() . 'profile_update.php?user_tab=avatar&blog=' . $Blog->ID . '&user_ID=' . $edited_User->ID . '&action=update_avatar&file_ID=' . $user_Link->File->ID . '&' . url_crumb('user');
$info_content .= '<br />' . action_icon(T_('Use as main picture'), 'move_up', $url_update, T_('Main'), 3, 4, array(), array('style' => 'margin-right:4px'));
} elseif (is_admin_page() && $can_moderate_user) {
// Link to Restore picture if it was forbidden (only for admins)
$url_restore = regenerate_url('', 'user_tab=avatar&user_ID=' . $edited_User->ID . '&action=restore_avatar&file_ID=' . $user_Link->File->ID . '&' . url_crumb('user'), '', '&');
$info_content .= '<br />' . action_icon(T_('Restore to use as main picture'), 'move_up', $url_restore, T_('Restore'), 3, 4, array(), array('style' => 'margin-right:4px'));
} else {
// Display empty line
$info_content .= '<br />';
}
// Link to Delete picture
$url_delete = is_admin_page() ? regenerate_url('', 'user_tab=avatar&user_ID=' . $edited_User->ID . '&action=delete_avatar&file_ID=' . $user_Link->File->ID . '&' . url_crumb('user'), '', '&') : get_secure_htsrv_url() . 'profile_update.php?user_tab=avatar&blog=' . $Blog->ID . '&user_ID=' . $edited_User->ID . '&action=delete_avatar&file_ID=' . $user_Link->File->ID . '&' . url_crumb('user');
$info_content .= '<br />' . action_icon(T_('Delete this picture'), 'delete', $url_delete, T_('Delete'), 3, 4, array('onclick' => 'return confirm(\'' . TS_('Are you sure want to delete this picture?') . '\');'), array('style' => 'margin-right:4px'));
// Links to rotate picture
$info_content .= $edited_User->get_rotate_avatar_icons($user_Link->File->ID);
$info_content .= $edited_User->get_crop_avatar_icon($user_Link->File->ID, array('onclick' => 'return user_crop_avatar( ' . $edited_User->ID . ', ' . $user_Link->File->ID . ' )'));
if (is_admin_page() && $can_moderate_user) {
// Only if current user can edit this user
// Display a message about the duplicated profile picture
$info_content .= $user_Link->File->get_duplicated_files_message(array('message' => '<div class="duplicated_avatars">' . get_icon('warning_yellow', 'imgtag', array('style' => 'padding-left:16px')) . ' ' . T_('Also used by: %s') . '</div>'));
}
$info_content .= '</div>';
}
$Form->info(T_('Other pictures'), $info_content);
}
$Form->hidden('action', 'upload_avatar');
// The following is mainly a hint to the browser.
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_user_avatar.form.php
示例12: jQuery
}
});
} );
<?php
global $current_User;
if (is_admin_page() && is_logged_in() && $current_User->check_perm('users', 'moderate', false)) {
// If user can edit the users - Init js to edit user level by AJAX
?>
jQuery(document).ready( function()
{
jQuery('.user_level_edit').each( function()
{
if( jQuery( this ).find( 'a' ).length == 0 )
{
jQuery( this ).removeClass( 'user_level_edit' );
}
} );
<?php
$user_levels = array();
for ($l = 0; $l <= 10; $l++) {
$user_levels[$l] = $l;
}
// Print JS to edit an user level
echo_editable_column_js(array('column_selector' => '.user_level_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=user_level_edit&' . url_crumb('userlevel'), 'options' => $user_levels, 'new_field_name' => 'new_user_level', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'user_ID', 'print_init_tags' => false));
?>
});
<?php
}
?>
</script>
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_user_js.funcs.php
示例13: echo_user_crop_avatar_window
/**
* Open crop user modal window
*/
function echo_user_crop_avatar_window()
{
global $admin_url;
if (is_admin_page()) {
// Ajax params for backoffice
$ajax_url = $admin_url;
$ajax_params = "'ctrl': 'user',\n\t\t\t\t'user_tab': 'crop',\n\t\t\t\t'user_tab_from': user_tab_from,\r\n";
} else {
// Ajax params for frontoffice
global $blog;
$ajax_url = get_secure_htsrv_url() . 'anon_async.php';
$ajax_params = "'blog': '{$blog}',\n\t\t\t\t'disp': 'avatar',\n\t\t\t\t'action': 'crop',\r\n";
}
?>
<script type="text/javascript">
<?php
// Initialize JavaScript to build and open window
echo_modalwindow_js();
?>
function user_crop_avatar( user_ID, file_ID, user_tab_from )
{
if( typeof( user_tab_from ) == 'undefined' )
{
user_tab_from = 'avatar';
}
var max_size = 750;
var min_size = 320;
var viewport_width = jQuery( window ).width();
var viewport_height = jQuery( window ).height();
//console.log( 'viewport', viewport_width, viewport_height );
// Set sizes for modal window:
var window_width = viewport_width;
var window_height = viewport_height;
// Limit window with max & min sizes:
window_height = ( window_height > max_size ) ? max_size : ( ( window_height < min_size ) ? min_size : window_height );
window_width = ( window_width > max_size ) ? max_size : ( ( window_width < min_size ) ? min_size : window_width );
//console.log( 'window', window_width, window_height );
// Set margins for normal view of wide screens:
var margin_size_width = 170;
var margin_size_height = viewport_height > max_size ? 170 : 205;
if( viewport_width <= 900 )
{ // When width is less than 900px then preview thumbnails are located under big picture, so height margin should be more
margin_size_width = 35;
margin_size_height = 325;
}
//console.log( 'margins', margin_size_width, margin_size_height );
// Set image sizes:
var image_width = window_width - margin_size_width;
var image_height = window_height - margin_size_height;
var image_min_size = 130;
// Limit image with min size:
image_width = ( image_width < image_min_size ) ? image_min_size : image_width;
image_height = ( image_height < image_min_size ) ? image_min_size : image_height;
//console.log( 'image', image_width, image_height );
// Open modal window with loading animation while ajax request is executing below:
openModalWindow( '<span class="loader_img loader_user_report absolute_center" title="<?php
echo T_('Loading...');
?>
"></span>',
window_width+'px', window_height+'px', true,
'<?php
echo TS_('Crop profile picture');
?>
',
[ '<?php
echo TS_('Crop');
?>
', 'btn-primary hide' ], true );
// Execute ajax request to load a crop tool:
jQuery.ajax(
{
type: 'POST',
url: '<?php
echo $ajax_url;
?>
',
data:
{
<?php
echo $ajax_params;
?>
'user_ID': user_ID,
'file_ID': file_ID,
'image_width' : image_width,
'image_height' : image_height,
'display_mode': 'js',
'crumb_user': '<?php
echo get_crumb('user');
?>
',
//.........这里部分代码省略.........
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:101,代码来源:_user.funcs.php
示例14: utf8_strtolower
$email = utf8_strtolower(param($dummy_fields['email'], 'string', ''));
$firstname = param('firstname', 'string', '');
$gender = param('gender', 'string', false);
$source = param('source', 'string', 'register form');
$redirect_to = param('redirect_to', 'url', '');
$return_to = param('return_to', 'url', '');
if ($register_user = $Session->get('core.register_user')) {
// Get an user data from predefined session (after adding of a comment)
$login = preg_replace('/[^a-z0-9 ]/i', '', $register_user['name']);
$login = str_replace(' ', '_', $login);
$login = substr($login, 0, 20);
$email = $register_user['email'];
$Session->delete('core.register_user');
}
// set secure htsrv url with the same domain as the request has
$secure_htsrv_url = get_secure_htsrv_url();
echo str_replace('$form_title$', $params['register_form_title'], $params['skin_form_before']);
$Form = new Form($secure_htsrv_url . 'register.php', 'register_form', 'post');
if (!is_null($params['register_form_params'])) {
// Use another template param from skin
$Form->switch_template_parts($params['register_form_params']);
}
$Form->add_crumb('regform');
$Form->hidden('inskin', true);
if (isset($Blog)) {
// for in-skin form
$Form->hidden('blog', $Blog->ID);
}
// disp register form
$Form->begin_form($params['form_class_register']);
$Plugins->trigger_event('DisplayRegisterFormBefore', array('Form' => &$Form, 'inskin' => true));
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_register.disp.php
示例15: array
}
$Results->cols[] = array('th' => T_('Back-office access'), 'order' => 'gset_value', 'td' => '%grp_row_backoffice( #gset_value# )%', 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap');
$Results->cols[] = array('th' => T_('Level'), 'th_class' => 'shrinkwrap small', 'td_class' => 'shrinkwrap small' . ($has_perm_users_edit ? ' group_level_edit' : ''), 'order' => 'grp_level', 'default_dir' => 'D', 'td' => $has_perm_users_edit ? '<a href="#" rel="$grp_level$">$grp_level$</a>' : '$grp_level$');
function grp_actions(&$row)
{
global $usedgroups, $Settings, $current_User;
$r = '';
if ($current_User->check_perm('users', 'edit', false)) {
$r = action_icon(T_('Edit this group...'), 'edit', regenerate_url('ctrl,action', 'ctrl=groups&action=edit&grp_ID=' . $row->grp_ID));
$r .= action_icon(T_('Duplicate this group...'), 'copy', regenerate_url('ctrl,action', 'ctrl=groups&action=new&grp_ID=' . $row->grp_ID));
if ($row->grp_ID != 1 && $row->grp_ID != $Settings->get('newusers_grp_ID') && !in_array($row->grp_ID, $usedgroups)) {
// delete
$r .= action_icon(T_('Delete this group!'), 'delete', regenerate_url('ctrl,action', 'ctrl=groups&action=delete&grp_ID=' . $row->grp_ID . '&' . url_crumb('group')));
} else {
$r .= get_icon('delete', 'noimg');
}
}
return $r;
}
$Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap small', 'td_class' => 'shrinkwrap', 'td' => '%grp_actions( {row} )%');
// Display results:
$Results->display();
if ($current_User->check_perm('users', 'edit', false)) {
// If user can edit the users - Init js to edit group level by AJAX
$group_levels = array();
for ($l = 0; $l <= 10; $l++) {
$group_levels[$l] = $l;
}
// Print JS to edit a group level
echo_editable_column_js(array('column_selector' => '.group_level_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=group_level_edit&' . url_crumb('grouplevel'), 'options' => $group_levels, 'new_field_name' => 'new_group_level', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'group_ID'));
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_group.view.php
示例16: array
$Results->cols[] = array('th' => T_('Anon. contact form submits'), 'td' => '$aipr_contact_email_count$', 'order' => 'aipr_contact_email_count', 'default_dir' => 'D');
$Results->cols[] = array('th' => T_('Block count'), 'td' => '$aipr_block_count$', 'order' => 'aipr_block_count', 'default_dir' => 'D');
// Get additional columns from the Plugins
$Plugins->trigger_event('GetAdditionalColumnsTable', array('table' => 'ipranges', 'column' => 'aipr_IPv4start', 'Results' => $Results));
if ($current_User->check_perm('spamblacklist', 'edit')) {
// Check permission to edit IP ranges:
/**
* Get actions links for IP range
*
* @param integer IP range ID
* @param string Current tab value
* @return string HTML links to edit and delete IP range
*/
function antispam_ipranges_actions($aipr_ID, $tab_param)
{
global $admin_url;
// A link to edit IP range
$r = action_icon(T_('Edit this IP range...'), 'properties', $admin_url . '?ctrl=antispam' . $tab_param . '&tab3=ipranges&iprange_ID=' . $aipr_ID . '&action=iprange_edit');
// A link to delete IP range
$r .= action_icon(T_('Delete this IP range!'), 'delete', regenerate_url('iprange_ID,action', 'iprange_ID=' . $aipr_ID . '&action=iprange_delete&' . url_crumb('iprange')));
return $r;
}
$Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => '%antispam_ipranges_actions( #aipr_ID#, "' . $tab_param . '" )%');
}
$Results->global_icon(T_('Add a new IP range...'), 'new', regenerate_url('action', 'action=iprange_new'), T_('New IP range') . ' »', 3, 4, array('class' => 'action_icon btn-primary'));
$Results->display();
if ($current_User->check_perm('spamblacklist', 'edit')) {
// Check permission to edit IP ranges:
// Print JS to edit status of IP range
echo_editable_column_js(array('column_selector' => '.iprange_status_edit', 'ajax_url' => get_secure_htsrv_url() . 'async.php?action=iprange_status_edit&' . url_crumb('iprange'), 'options' => aipr_status_titles(), 'new_field_name' => 'new_status', 'ID_value' => 'jQuery( ":first", jQuery( this ).parent() ).text()', 'ID_name' => 'iprange_ID', 'colored_cells' => true));
}
开发者ID:Edind304,项目名称:b2evolution,代码行数:31,代码来源:_antispam_ipranges.view.php
示例17: init_autocomplete_login_js
/**
* Registers headlines required to autocomplete the user logins
*
* @param string alias, url or filename (relative to rsc/css, rsc/js) for JS/CSS files
* @param string Library: 'hintbox', 'typeahead'
*/
function init_autocomplete_login_js($relative_to = 'rsc_url', $library = 'hintbox')
{
global $blog;
require_js('#jquery#', $relative_to);
// dependency
switch ($library) {
case 'typeahead':
// Use typeahead library of bootstrap
add_js_headline('jQuery( document ).ready( function()
{
jQuery( "input.autocomplete_login" ).typeahead( null,
{
displayKey: "login",
source: function ( query, cb )
{
jQuery.ajax(
{
url: "' . get_secure_htsrv_url() . 'async.php?action=get_login_list",
type: "post",
data: { q: query, data_type: "json" },
dataType: "JSON",
success: function( logins )
{
var json = new Array();
for( var l in logins )
{
json.push( { login: logins[ l ] } );
}
cb( json );
}
} );
}
} );
' . get_prevent_key_enter_js('input.autocomplete_login') . '
} );');
break;
case 'hintbox':
default:
// Use hintbox plugin of jQuery
// Add jQuery hintbox (autocompletion).
// Form 'username' field requires the following JS and CSS.
// fp> TODO: think about a way to bundle this with other JS on the page -- maybe always load hintbox in the backoffice
// dh> Handle it via http://www.appelsiini.net/projects/lazyload ?
// dh> TODO: should probably also get ported to use jquery.ui.autocomplete (or its successor)
require_css('jquery/jquery.hintbox.css', $relative_to);
require_js('jquery/jquery.hintbox.min.js', $relative_to);
add_js_headline('jQuery( document ).on( "focus", "input.autocomplete_login", function()
{
var ajax_params = "";
if( jQuery( this ).hasClass( "only_assignees" ) )
{
ajax_params = "&user_type=assignees&blog=' . $blog . '";
}
jQuery( this ).hintbox(
{
url: "' . get_secure_htsrv_url() . 'async.php?action=get_login_list" + ajax_params,
matchHint: true,
autoDimentions: true
} );
' . get_prevent_key_enter_js('input.autocomplete_login') . '
} );');
break;
}
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:70,代码来源:_template.funcs.php
|
请发表评论