本文整理汇总了PHP中Form::begin_fieldset方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::begin_fieldset方法的具体用法?PHP Form::begin_fieldset怎么用?PHP Form::begin_fieldset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::begin_fieldset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Form
global $edited_Chapter;
/**
* @var ChapterCache
*/
global $ChapterCache;
global $Settings, $action, $subset_ID;
// Determine if we are creating or updating...
$creating = is_create_action($action);
$Form = new Form(NULL, 'form');
$close_url = get_chapter_redirect_url(get_param('redirect_page'), $edited_Chapter->parent_ID, $edited_Chapter->ID);
$Form->global_icon(T_('Cancel editing!'), 'close', $close_url);
$Form->begin_form('fform', $creating ? T_('New category') : T_('Category'));
$Form->add_crumb('element');
$Form->hidden('action', $creating ? 'create' : 'update');
$Form->hiddens_by_key(get_memorized('action'));
$Form->begin_fieldset(T_('Properties') . get_manual_link('categories-tab'));
// We're essentially double checking here...
$edited_Blog =& $edited_Chapter->get_Blog();
$move = '';
if ($Settings->get('allow_moving_chapters') && !$creating) {
// If moving cats between blogs is allowed:
$move = ' ' . action_icon(T_('Move to a different blog...'), 'file_move', regenerate_url('action,cat_ID', 'cat_ID=' . $edited_Chapter->ID . '&action=move'), T_('Move'));
}
$Form->info(T_('Collection'), $edited_Blog->get_maxlen_name() . $move);
$Form->select_input_options('cat_parent_ID', $ChapterCache->recurse_select($edited_Chapter->parent_ID, $subset_ID, true, NULL, 0, array($edited_Chapter->ID)), T_('Parent category'));
$Form->text_input('cat_name', $edited_Chapter->name, 40, T_('Name'), '', array('required' => true, 'maxlength' => 255));
$Form->text_input('cat_urlname', $edited_Chapter->urlname, 40, T_('URL "slug"'), T_('Used for clean URLs. Must be unique.'), array('maxlength' => 255));
$Form->text_input('cat_description', $edited_Chapter->description, 40, T_('Description'), T_('May be used as a title tag and/or meta description.'), array('maxlength' => 255));
$parent_cat_order = $edited_Chapter->get_parent_subcat_ordering();
if ($parent_cat_order == 'manual') {
$Form->text_input('cat_order', $edited_Chapter->order, 5, T_('Order'), T_('For manual ordering of the categories.'), array('maxlength' => 11));
示例2: Form
$edited_Chapter =& $edited_GenericCategory;
/**
* @var GenericCategoryCache
*/
global $GenericCategoryCache;
global $Settings, $action, $subset_ID;
// Determine if we are creating or updating...
$creating = is_create_action($action);
$Form = new Form(NULL, 'form');
$close_url = get_chapter_redirect_url(get_param('redirect_page'), $edited_Chapter->parent_ID, $edited_Chapter->ID);
$Form->global_icon(T_('Cancel editing!'), 'close', $close_url);
$Form->begin_form('fform', $creating ? T_('New category') : T_('Category'));
$Form->add_crumb('element');
$Form->hidden('action', $creating ? 'create' : 'update');
$Form->hiddens_by_key(get_memorized('action'));
$Form->begin_fieldset(T_('Properties'));
// We're essentially double checking here...
$edited_Blog =& $edited_Chapter->get_Blog();
$move = '';
if ($Settings->get('allow_moving_chapters') && !$creating) {
// If moving cats between blogs is allowed:
$move = ' ' . action_icon(T_('Move to a different blog...'), 'file_move', regenerate_url('action,cat_ID', 'cat_ID=' . $edited_Chapter->ID . '&action=move'), T_('Move'));
}
$Form->info(T_('Blog'), $edited_Blog->get_maxlen_name() . $move);
$Form->select_input_options('cat_parent_ID', $GenericCategoryCache->recurse_select($edited_Chapter->parent_ID, $subset_ID, true, NULL, 0, array($edited_Chapter->ID)), T_('Parent category'));
$Form->text_input('cat_name', $edited_Chapter->name, 40, T_('Name'), '', array('required' => true, 'maxlength' => 255));
$Form->text_input('cat_urlname', $edited_Chapter->urlname, 40, T_('URL "slug"'), T_('Used for clean URLs. Must be unique.'), array('maxlength' => 255));
$Form->text_input('cat_description', $edited_Chapter->description, 40, T_('Description'), T_('May be used as a title tag and/or meta description.'), array('maxlength' => 255));
if ($Settings->get('chapter_ordering') == 'manual') {
$Form->text_input('cat_order', $edited_Chapter->order, 5, T_('Order'), T_('For manual ordering of the categories.'), array('maxlength' => 11));
}
示例3: die
* @package admin
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
global $localtimenow, $edited_Cronjob;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'cronjob');
$Form->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', $creating ? T_('New scheduled job') : T_('Edit scheduled job'));
$Form->add_crumb('crontask');
$Form->hiddens_by_key(get_memorized('action'));
$Form->hidden('action', $creating ? 'create' : 'update');
$Form->begin_fieldset(T_('Job details') . get_manual_link('scheduled-job-form'));
if ($creating && $action != 'copy') {
// New cronjob
$cron_jobs_names = get_cron_jobs_config('name');
// Exclude these cron jobs from manual creating
unset($cron_jobs_names['send-post-notifications']);
unset($cron_jobs_names['send-comment-notifications']);
$Form->select_input_array('cjob_type', get_param('cjob_type'), $cron_jobs_names, T_('Job type'));
} else {
// Edit cronjob
if ($action == 'edit') {
$Form->info(T_('Job #'), $edited_Cronjob->ID);
}
$Form->info(T_('Default job name'), cron_job_name($edited_Cronjob->key, '', $edited_Cronjob->params));
$Form->text_input('cjob_name', $edited_Cronjob->name, 50, T_('Job name'), '', array('maxlength' => 255));
}
示例4: array
$comment_options[] = '<label><input type="checkbox" class="checkbox" name="comment_cookies" tabindex="7"' . ($comment_cookies ? ' checked="checked"' : '') . ' value="1" /> ' . T_('Remember me') . '</label>' . ' <span class="note">(' . T_('For my next comment on this site') . ')</span>';
// TODO: If we got info from cookies, Add a link called "Forget me now!" (without posting a comment).
$msgform_class_start = '';
$msgform_class_end = '';
if ($email_is_detected) {
// Set a class when comment contains a email
$msgform_class_start = '<div class="comment_recommended_option">';
$msgform_class_end = '</div>';
}
$comment_options[] = $msgform_class_start . '<label><input type="checkbox" class="checkbox" name="comment_allow_msgform" tabindex="8"' . ($comment_allow_msgform ? ' checked="checked"' : '') . ' value="1" /> ' . T_('Allow message form') . '</label>' . ' <span class="note">(' . T_('Allow users to contact me through a message form -- Your email will <strong>not</strong> be revealed!') . ')</span>' . $msgform_class_end;
// TODO: If we have an email in a cookie, Add links called "Add a contact icon to all my previous comments" and "Remove contact icon from all my previous comments".
}
// Display renderers
$comment_renderer_checkboxes = $Plugins->get_renderer_checkboxes(array('default'), array('Blog' => &$Blog, 'setting_name' => 'coll_apply_comment_rendering'));
if (!empty($comment_renderer_checkboxes)) {
$Form->begin_fieldset();
echo '<div class="label">' . T_('Text Renderers') . ':</div>';
echo '<div class="input">';
echo $comment_renderer_checkboxes;
echo '</div>';
$Form->end_fieldset();
}
$Plugins->trigger_event('DisplayCommentFormFieldset', array('Form' => &$Form, 'Item' => &$Item));
$Form->begin_fieldset();
echo '<div class="input">';
$preview_text = $Item->can_attach() ? T_('Preview/Add file') : T_('Preview');
$Form->button_input(array('name' => 'submit_comment_post_' . $Item->ID . '[save]', 'class' => 'submit', 'value' => $params['form_submit_text'], 'tabindex' => 10));
$Form->button_input(array('name' => 'submit_comment_post_' . $Item->ID . '[preview]', 'class' => 'preview', 'value' => $preview_text, 'tabindex' => 9));
$Plugins->trigger_event('DisplayCommentFormButton', array('Form' => &$Form, 'Item' => &$Item));
echo '</div>';
$Form->end_fieldset();
示例5: die
* Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
*
* @package evocore
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
global $admin_url, $tab;
global $users_numbers, $edited_EmailCampaign;
$Form = new Form(NULL, 'campaign_form');
$Form->begin_form('fform');
$Form->add_crumb('campaign');
$Form->hidden('ctrl', 'campaigns');
$Form->hidden('current_tab', $tab);
$Form->hidden('ecmp_ID', $edited_EmailCampaign->ID);
$Form->begin_fieldset(T_('Campaign info') . get_manual_link('creating-an-email-campaign'));
$Form->text_input('ecmp_name', $edited_EmailCampaign->get('name'), 60, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('ecmp_email_title', $edited_EmailCampaign->get('email_title'), 60, T_('Email title'), '', array('maxlength' => 255, 'required' => true));
$Form->info(T_('Campaign created'), mysql2localedatetime_spans($edited_EmailCampaign->get('date_ts'), 'M-d'));
$Form->info(T_('Last sent'), $edited_EmailCampaign->get('sent_ts') ? mysql2localedatetime_spans($edited_EmailCampaign->get('sent_ts'), 'M-d') : T_('Not sent yet'));
$Form->end_fieldset();
$Form->begin_fieldset(T_('Newsletter recipients'));
if (!empty($users_numbers)) {
// We know this data only one time after selecting users
$Form->info(T_('Number of accounts in filterset'), $users_numbers['all']);
$Form->info(T_('Number of active accounts in filterset'), $users_numbers['active']);
}
$Form->info(T_('Currently selected recipients'), $edited_EmailCampaign->get_users_count(), '(' . T_('Accounts which accept newsletter emails') . ') - <a href="' . $admin_url . '?ctrl=campaigns&action=change_users&ecmp_ID=' . $edited_EmailCampaign->ID . '">' . T_('Change selection') . ' >></a>');
$Form->info(T_('Already received'), $edited_EmailCampaign->get_users_count('accept'), '(' . T_('Accounts which have already been sent this newsletter') . ')');
$Form->info(T_('Ready to send'), $edited_EmailCampaign->get_users_count('wait'), '(' . T_('Accounts which have not been sent this newsletter yet') . ')');
$Form->end_fieldset();
示例6: die
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
/**
* @var Skin
*/
global $edited_Skin;
$Form = new Form(NULL, 'skin_checkchanges');
$Form->global_icon(T_('Uninstall this skin!'), 'delete', regenerate_url('action', 'action=delete&' . url_crumb('skin')));
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', T_('Skin properties'));
$Form->add_crumb('skin');
$Form->hidden_ctrl();
$Form->hidden('action', 'update');
$Form->hidden('skin_ID', $edited_Skin->ID);
$Form->begin_fieldset(T_('Skin properties') . get_manual_link('skin-system-settings'));
echo '<div class="skin_settings well">';
$disp_params = array('skinshot_class' => 'coll_settings_skinshot');
Skin::disp_skinshot($edited_Skin->folder, $edited_Skin->name, $disp_params);
// Skin name
echo '<div class="skin_setting_row">';
echo '<label>' . T_('Skin name') . ':</label>';
echo '<span>' . $edited_Skin->name . '</span>';
echo '</div>';
if (isset($edited_Skin->version)) {
// Skin version
echo '<div class="skin_setting_row">';
echo '<label>' . T_('Skin version') . ':</label>';
echo '<span>' . $edited_Skin->version . '</span>';
echo '</div>';
}
示例7: die
*
* @package admin
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
global $dispatcher, $flush_action;
phpbb_display_steps(6);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 6: Import replies'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'messages');
if ($flush_action == 'replies') {
$Form->begin_fieldset(T_('Import log'));
// Import the replies into the comments
phpbb_import_replies();
$Form->end_fieldset();
}
$Form->begin_fieldset(T_('Report of the replies import'));
$Form->info(T_('Count of the imported replies'), '<b>' . (int) phpbb_get_var('replies_count_imported') . '</b>');
$Form->info(T_('Count of the imported topics'), (int) phpbb_get_var('topics_count_imported'));
$Form->info(T_('Count of the imported forums'), (int) phpbb_get_var('forums_count_imported'));
$Form->info(T_('Count of the imported users'), (int) phpbb_get_var('users_count_imported'));
$Form->info(T_('Count of the updated users'), (int) phpbb_get_var('users_count_updated'));
$BlogCache =& get_BlogCache();
$Blog =& $BlogCache->get_by_ID(phpbb_get_var('blog_ID'));
$Form->info(T_('Collection'), $Blog->get('name'), '');
$Form->end_fieldset();
$Form->buttons(array(array('submit', 'submit', T_('Continue!'), 'SaveButton')));
示例8: display_activateinfo
/**
* Display user activate info form content
*
* @param Object activateinfo Form
*/
function display_activateinfo($params)
{
global $current_User, $Settings, $UserSettings, $Plugins;
global $secure_htsrv_url, $rsc_path, $rsc_url, $dummy_fields;
if (!is_logged_in()) {
// if this happens, it means the code is not correct somewhere before this
debug_die("You must log in to see this page.");
}
// init force request new email address param
$force_request = param('force_request', 'boolean', false);
// get last activation email timestamp from User Settings
$last_activation_email_date = $UserSettings->get('last_activation_email', $current_User->ID);
if ($force_request || empty($last_activation_email_date)) {
// notification email was not sent yet, or user needs another one ( forced request )
$params = array_merge(array('form_action' => $secure_htsrv_url . 'login.php', 'form_name' => 'form_validatemail', 'form_class' => 'fform', 'form_layout' => 'fieldset', 'inskin' => false), $params);
$Form = new Form($params['form_action'], $params['form_name'], 'post', $params['form_layout']);
$Form->begin_form($params['form_class']);
$Form->add_crumb('validateform');
$Form->hidden('action', 'req_validatemail');
$Form->hidden('redirect_to', $params['redirect_to']);
if ($params['inskin']) {
$Form->hidden('inskin', $params['inskin']);
$Form->hidden('blog', $params['blog']);
}
$Form->hidden('req_validatemail_submit', 1);
// to know if the form has been submitted
$Form->begin_fieldset();
echo '<ol>';
echo '<li>' . T_('Please confirm your email address below:') . '</li>';
echo '</ol>';
// set email text input content only if this is not a forced request. This way the user may have bigger chance to write a correct email address.
$user_email = $force_request ? '' : $current_User->email;
// fp> note: 45 is the max length for evopress skin.
$Form->text_input($dummy_fields['email'], $user_email, 45, T_('Your email'), '', array('maxlength' => 255, 'class' => 'input_text', 'required' => true));
$Form->end_fieldset();
// Submit button:
$submit_button = array(array('name' => 'submit', 'value' => T_('Send me a new activation email now!'), 'class' => 'submit'));
$Form->buttons_input($submit_button);
if (!$params['inskin']) {
$Plugins->trigger_event('DisplayValidateAccountFormFieldset', array('Form' => &$Form));
}
$Form->end_form();
return;
}
// get notification email from general Settings
$notification_email = $Settings->get('notification_sender_email');
// convert date to timestamp
$last_activation_email_ts = mysql2timestamp($last_activation_email_date);
// get difference between local time and server time
$time_difference = $Settings->get('time_difference');
// get last activation email local date and time
$last_email_date = date(locale_datefmt(), $last_activation_email_ts + $time_difference);
$last_email_time = date(locale_shorttimefmt(), $last_activation_email_ts + $time_difference);
$user_email = $current_User->email;
echo '<ol start="1" class="expanded">';
$instruction = sprintf(T_('Open your email account for %s and find a message we sent you on %s at %s with the following title:'), $user_email, $last_email_date, $last_email_time);
echo '<li>' . $instruction . '<br /><b>' . sprintf(T_('Activate your account: %s'), $current_User->login) . '</b>';
$request_validation_url = 'href="' . regenerate_url('', 'force_request=1&validate_required=true&redirect_to=' . $params['redirect_to']) . '"';
echo '<p>' . sprintf(T_('NOTE: If you don\'t find it, check your "Junk", "Spam" or "Unsolicited email" folders. If you really can\'t find it, <a %s>request a new activation email</a>.'), $request_validation_url) . '</p></li>';
echo '<li>' . sprintf(T_('Add us (%s) to your contacts to make sure you receive future email notifications, especially when someone sends you a private message.'), '<b><span class="nowrap">' . $notification_email . '</span></b>') . '</li>';
echo '<li><b class="red">' . T_('Click on the activation link in the email.') . '</b>';
echo '<p>' . T_('If this does not work, please copy/paste that link into the address bar of your browser.') . '</p>';
echo '<p>' . sprintf(T_('If you need assistance, please send an email to %s'), '<b><a href="mailto:"' . $notification_email . '"><span class="nowrap">' . $notification_email . '</span></a></b>') . '</p></li>';
echo '</ol>';
if ((strpos($user_email, '@hotmail.') || strpos($user_email, '@live.') || strpos($user_email, '@msn.')) && file_exists($rsc_path . 'img/login_help/hotmail-validation.png')) {
// The user is on hotmail and we have a help screen to show him: (needs to be localized and include correct site name)
echo '<div class="center" style="margin: 2em auto"><img src="' . $rsc_url . 'img/login_help/hotmail-validation.png" /></div>';
}
}
示例9: Form
/**
* @global string
*/
global $fm_mode;
/**
* @global Filelist
*/
global $fm_source_Filelist;
/**
* @global array
*/
global $new_names;
global $filename_max_length;
$Form = new Form(NULL, 'fm_copymove_checkchanges');
$Form->global_icon(T_('Quit copy/move mode!'), 'close', regenerate_url('fm_sources,fm_mode'));
$Form->begin_form('fform', $fm_mode == 'file_copy' ? T_('Copy') : T_('Move'));
$Form->add_crumb('file');
$Form->hidden_ctrl();
$Form->hiddens_by_key(get_memorized());
$Form->hidden('confirm', 1);
$fm_source_Filelist->restart();
while ($loop_src_File =& $fm_source_Filelist->get_next()) {
$Form->begin_fieldset(T_('Source') . ': ' . $loop_src_File->get_rdfp_rel_path());
if (isset($overwrite[$loop_src_File->get_md5_ID()])) {
$Form->checkbox('overwrite[' . $loop_src_File->get_md5_ID() . ']', $overwrite[$loop_src_File->get_md5_ID()], T_('Overwrite'), T_('Check to overwrite the existing file'));
}
$Form->text('new_names[' . $loop_src_File->get_md5_ID() . ']', $new_names[$loop_src_File->get_md5_ID()], 32, T_('New name'), $loop_src_File->dget('title'), $filename_max_length);
$Form->end_fieldset();
}
$Form->end_form(array(array('submit', 'submit', $fm_mode == 'file_copy' ? T_('Copy') : T_('Move'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
echo '<p class="notes"><strong>' . T_('You are in copy/move mode.') . '</strong> ' . T_('Please navigate to the desired target location.') . '</p>';
示例10: Form
case 'info':
if ($edit_Plugin->status == 'broken') {
break;
}
// Display plugin info:
load_funcs('plugins/_plugin.funcs.php');
$Form = new Form($pagenow);
if ($edit_Plugin->ID > 0 && $current_User->check_perm('options', 'edit', false)) {
// Edit settings button (if installed):
$Form->global_icon(T_('Edit plugin settings!'), 'edit', $admin_url . '?ctrl=plugins&action=edit_settings&plugin_ID=' . $edit_Plugin->ID);
}
// Close button:
$Form->global_icon(T_('Close info!'), 'close', regenerate_url());
$Form->begin_form('fform', ' ');
$Form->hidden('ctrl', 'plugins');
$Form->begin_fieldset('Plugin info', array('class' => 'fieldset'));
$Form->info_field(T_('Name'), $edit_Plugin->name);
$Form->info_field(T_('Code'), empty($edit_Plugin->code) ? ' - ' : $edit_Plugin->code, array('note' => T_('This 8-32 character code identifies the plugin when it needs to be called directly and specifically. This is especially useful for renderer plugins and widgets (SkinTags).')));
$Form->info_field(T_('Short desc'), $edit_Plugin->short_desc);
$Form->info_field(T_('Long desc'), $edit_Plugin->long_desc);
if ($edit_Plugin->ID > 0) {
// do not display ID for non registered Plugins
$Form->info_field(T_('ID'), $edit_Plugin->ID);
}
$Form->info_field(T_('Version'), $edit_Plugin->version);
$Form->info_field(T_('Classname'), $edit_Plugin->classname);
$Form->info_field(T_('Class file'), rel_path_to_base($edit_Plugin->classfile_path));
// Help icons (to homepage and README.html), if available:
$help_icons = array();
if ($help_www = $edit_Plugin->get_help_link('$help_url')) {
$help_icons[] = $help_www;
示例11: die
*
* @package admin
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
* @author fplanque: Francois PLANQUE.
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
/**
* @var Blog
*/
global $edited_Blog;
global $action, $next_action, $blogtemplate, $blog, $tab, $admin_url;
$Form = new Form();
$Form->begin_form('fform');
$Form->add_crumb('collection');
$Form->hidden_ctrl();
$Form->hidden('action', 'update_type');
$Form->hidden('tab', $tab);
$Form->hidden('blog', $blog);
$Form->begin_fieldset(T_('Collection type') . get_manual_link('collection-change-type'));
$collection_kinds = get_collection_kinds();
$radio_options = array();
foreach ($collection_kinds as $kind_value => $kind) {
$radio_options[] = array($kind_value, $kind['name'], $kind['desc']);
}
$Form->radio('type', $edited_Blog->get('type'), $radio_options, T_('Type'), true);
$Form->checkbox_input('reset', 0, T_('Reset'), array('input_suffix' => ' ' . T_('Reset all parameters as for a new collection.'), 'note' => T_('(Only keep collection name, owner, URL, categories and content).')));
$Form->end_fieldset();
$Form->buttons(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton')));
$Form->end_form();
示例12: Form
* @var Blog
*/
global $edited_Blog;
global $action, $next_action, $blogtemplate, $blog, $tab;
$Form = new Form();
$Form->begin_form('fform');
$Form->hidden_ctrl();
$Form->hidden('action', $next_action);
$Form->hidden('tab', $tab);
if ($next_action == 'create') {
$Form->hidden('kind', get_param('kind'));
$Form->hidden('skin_ID', get_param('skin_ID'));
} else {
$Form->hidden('blog', $blog);
}
$Form->begin_fieldset(T_('General parameters'), array('class' => 'fieldset clear'));
$Form->text('blog_name', $edited_Blog->get('name'), 50, T_('Title'), T_('Will be displayed on top of the blog.'));
$Form->text('blog_shortname', $edited_Blog->get('shortname', 'formvalue'), 12, T_('Short name'), T_('Will be used in selection menus and throughout the admin interface.'));
if ($current_User->check_perm('blog_admin', 'edit', false, $edited_Blog->ID)) {
// Permission to edit advanced admin settings
}
$owner_User =& $edited_Blog->get_owner_User();
if ($current_User->check_perm('blog_admin', 'edit', false, $edited_Blog->ID)) {
// Permission to edit advanced admin settings
$Form->text('blog_urlname', $edited_Blog->get('urlname'), 20, T_('URL "filename"'), sprintf(T_('"slug" used to uniquely identify this blog in URLs. Also used as <a %s>default media folder</a>.'), 'href="?ctrl=coll_settings&tab=advanced&blog=' . $blog . '"'), 255);
// fp> Note: There are 2 reasons why we don't provide a select here:
// 1. If there are 1000 users, it's a pain.
// 2. A single blog owner is not necessarily allowed to see all other users.
$Form->text('owner_login', $owner_User->login, 20, T_('Owner'), T_('Login of this blog\'s owner.'));
} else {
$Form->info(T_('URL Name'), $edited_Blog->get('urlname'), T_('Used to uniquely identify this blog in URLs.'));
示例13: CaptchaPayload
/**
* When a comment form gets displayed, we inject our captcha and an input field to
* enter the answer.
*
* The question ID is saved into the user's Session and in the DB table "ip_question".
*
* @param array Associative array of parameters
* - 'Form': the form where payload should get added (by reference, OPTIONALLY!)
* - 'form_use_fieldset':
* - 'key': A key that is associated to the caller of the event (string, OPTIONALLY!)
* @param string Form type ( comment|register|message )
* @return boolean|NULL true, if displayed; false, if error; NULL if it does not apply
*/
function CaptchaPayload(&$params, $form_type)
{
global $DB, $Session;
if (!$this->does_apply($params, $form_type)) {
return;
}
$question = $this->CaptchaQuestion();
if (empty($question)) {
// No the defined questions
return;
}
$this->debug_log('Question ID is: (' . $this->question_ID . ')');
if (!isset($params['Form'])) {
// there's no Form where we add to, but we create our own form:
$Form = new Form(regenerate_url());
$Form->begin_form();
} else {
$Form =& $params['Form'];
if (!isset($params['form_use_fieldset']) || $params['form_use_fieldset']) {
$Form->begin_fieldset();
}
}
$Form->info($this->T_('Captcha question'), $question->cptq_question);
$Form->text_input('captcha_qstn_' . $this->ID . '_answer', param('captcha_qstn_' . $this->ID . '_answer', 'string', ''), 10, $this->T_('Captcha answer'), $this->T_('Please answer on question above.'));
if (!isset($params['Form'])) {
// there's no Form where we add to, but our own form:
$Form->end_form(array(array('submit', 'submit', $this->T_('Validate me'), 'ActionButton')));
} else {
if (!isset($params['form_use_fieldset']) || $params['form_use_fieldset']) {
$Form->end_fieldset();
}
}
return true;
}
示例14: die
* Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
*
* @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
*
* @package admin
*
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
* @author fplanque: Francois PLANQUE.
*
* @version $Id: _wpxml_file.view.php 505 2011-12-09 20:54:21Z fplanque $
*/
if (!defined('EVO_MAIN_INIT')) {
die('Please, do not access this page directly.');
}
global $dispatcher;
$Form = new Form(NULL, '', 'post', NULL, 'multipart/form-data');
$Form->begin_form('fform', T_('WordPress XML Importer'));
$Form->add_crumb('wpxml');
$Form->hidden_ctrl();
$Form->hidden('action', 'import');
$Form->begin_fieldset(T_('Select XML file'));
$Form->text_input('wp_file', '', 20, T_('WordPress XML File'), '', array('type' => 'file', 'required' => true));
$Form->end_fieldset();
$Form->begin_fieldset(T_('Select a blog for import'));
$BlogCache =& get_BlogCache();
$BlogCache->none_option_text = ' ';
$Form->select_input_object('wp_blog_ID', param('wp_blog_ID', 'integer', 0), $BlogCache, T_('Blog for import'), array('note' => T_('This blog will be used for import.') . ' <a href="' . $dispatcher . '?ctrl=collections&action=new">' . T_('Create new blog') . ' »</a>', 'allow_none' => true, 'required' => true));
$Form->radio_input('import_type', param('import_type', 'string', 'replace'), array(array('value' => 'replace', 'label' => T_('Replace existing contents'), 'note' => T_('WARNING: this option will permanently remove existing Posts, comments, categories and tags from the selected blog.')), array('value' => 'append', 'label' => T_('Append to existing contents'))), '', array('lines' => true));
$Form->end_fieldset();
$Form->buttons(array(array('submit', 'submit', T_('Continue !'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
$Form->end_form();
示例15: upgrade_b2evo_tables
//.........这里部分代码省略.........
load_class('plugins/model/_plugins.class.php', 'Plugins');
$Plugins = new Plugins();
}
task_begin('Recreate autogenerated post excerpts...');
$upgrade_continue_url = $baseurl . 'install/index.php?locale=' . $locale . '&action=' . $upgrade_action . '&exec_general_tasks=0&recreate_excerpts=1';
$all_excerpt = param('all_excerpt', 'integer', 0);
recreate_autogenerated_excerpts($upgrade_continue_url, $all_excerpt == 0);
task_end();
}
// Update the progress bar status
update_install_progress_bar();
/*
* -----------------------------------------------
* Check to make sure the DB schema is up to date:
* -----------------------------------------------
*/
echo "Starting to check DB...<br/>\n";
evo_flush();
$upgrade_db_deltas = array();
// This holds changes to make, if any (just all queries)
global $debug;
foreach ($schema_queries as $table => $query_info) {
// For each table in the schema, check diffs...
if ($debug) {
echo '<br />Checking table: ' . $table . ': ';
}
$updates = db_delta($query_info[1], array('drop_column', 'drop_index'), false, true);
if (empty($updates)) {
if ($debug) {
echo 'ok';
}
} else {
if ($debug) {
echo 'NEEDS UPDATE!';
}
foreach ($updates as $table => $queries) {
foreach ($queries as $qinfo) {
foreach ($qinfo['queries'] as $query) {
// subqueries for this query (usually one, but may include required other queries)
$upgrade_db_deltas[] = $query;
}
}
}
}
}
if ($debug) {
echo '<br />';
}
if (empty($upgrade_db_deltas)) {
// no upgrades needed:
echo '<p>' . T_('The database schema is up to date.') . '</p>';
} else {
// Upgrades are needed:
$confirmed_db_upgrade = param('confirmed', 'integer', 0);
// force confirmation
$upgrade_db_deltas_confirm_md5 = param('upgrade_db_deltas_confirm_md5', 'string', '');
if (!$confirmed_db_upgrade) {
if (!empty($upgrade_db_deltas_confirm_md5)) {
// received confirmation from form
if ($upgrade_db_deltas_confirm_md5 != md5(implode('', $upgrade_db_deltas))) {
// unlikely to happen
echo '<p class="text-danger"><evo:error>' . T_('The DB schema has been changed since confirmation.') . '</evo:error></p>';
} else {
$confirmed_db_upgrade = true;
}
}
}
if (!$confirmed_db_upgrade) {
global $action, $form_action;
load_class('_core/ui/forms/_form.class.php', 'Form');
if (!empty($form_action)) {
$Form = new Form($form_action, '', 'post');
} else {
$Form = new Form(NULL, '', 'post');
}
$Form->begin_form('fform', T_('Upgrade database'));
$Form->begin_fieldset();
$Form->hidden('upgrade_db_deltas_confirm_md5', md5(implode('', $upgrade_db_deltas)));
$Form->hidden('action', $action);
$Form->hidden('locale', $locale);
echo '<p>' . T_('The version number is correct, but we have detected changes in the database schema. This can happen if you\'ve been using development versions directly off GitHub...') . '</p>';
echo '<p>' . T_('The following database changes will be carried out. If you are not sure what this means, it will probably be alright.') . '</p>';
echo '<ul>';
foreach ($upgrade_db_deltas as $l_delta) {
#echo '<li><code>'.nl2br($l_delta).'</code></li>';
echo '<li><pre>' . str_replace("\t", ' ', $l_delta) . '</pre></li>';
}
echo '</ul>';
$Form->submit(array('', T_('Try to Repair/Upgrade database now!'), 'btn-warning'));
$Form->end_form();
return 'need-fix';
}
// Alter DB to match DB schema:
install_make_db_schema_current(true);
}
// Force MySQL strict mode
$DB->query('SET sql_mode = "TRADITIONAL"', 'Force MySQL "strict" mode (and make sure server is not configured with a weird incompatible mode)');
track_step('upgrade-success');
return true;
}