global $row_stats;
// for hit functions
$Form = new Form(NULL, 'antispam_add', 'post', 'compact');
$Form->begin_form('fform', $display_mode == 'js' ? '' : T_('Add a banned keyword'));
$Form->add_crumb('antispam');
$Form->hidden_ctrl();
$Form->hidden('action', 'ban');
$button = array('submit', 'submit', T_('Check & ban...'), 'SaveButton');
if ($display_mode == 'js') {
    $Form->output = false;
    $button_html = $Form->button($button);
    $Form->output = true;
} else {
    $button_html = '';
}
$Form->text_input('keyword', $keyword, 50, T_('Keyword/phrase to ban'), '', array('maxlength' => 80, 'input_suffix' => $button_html));
// TODO: add note
/*
 * TODO: explicitly add a domain?
 * $add_Form->text( 'domain', $domain, 30, T_('Add a banned domain'), 'note..', 80 ); // TODO: add note
 */
if ($display_mode != 'js') {
    $Form->buttons(array($button));
}
$Form->end_form();
$Form = new Form(NULL, 'antispam_ban', 'post', 'compact');
$redirect_to = param('redirect_to', 'url', NULL);
if ($redirect_to == NULL) {
    $redirect_to = regenerate_url('action');
}
$Form->global_icon(T_('Cancel!'), 'close', $redirect_to, '', 3, 2, array('class' => 'action_icon', 'id' => 'close_button'));
 /**
  * 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;
 }
Example #3
0
/**
 * 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>';
    }
}
Example #4
0
if ($edited_Group->ID == 0) {
    $Form->begin_form('fform', T_('Creating new group'));
} else {
    $title = ($action == 'edit' ? T_('Editing group:') : T_('Viewing group:')) . ' ' . (isset($edited_grp_oldname) ? $edited_grp_oldname : $edited_Group->dget('name')) . ' (' . T_('ID') . ' ' . $edited_Group->ID . ')';
    $Form->begin_form('fform', $title);
}
$Form->add_crumb('group');
$Form->hidden_ctrl();
$Form->hidden('action', 'update');
$Form->hidden('grp_ID', $edited_Group->ID);
$perm_none_option = array('none', T_('No Access'));
$perm_view_option = array('view', T_('View details'));
$perm_edit_option = array('edit', T_('Edit/delete all'));
$Form->begin_fieldset(T_('General') . get_manual_link('group_properties_general'));
$Form->text('edited_grp_name', $edited_Group->name, 50, T_('Name'), '', 50, 'large');
$Form->text_input('edited_grp_level', $edited_Group->get('level'), 2, T_('Group level'), '[0 - 10]', array('required' => true));
display_pluggable_permissions($Form, 'core_general');
$Form->end_fieldset();
$Form->begin_fieldset(T_('Blogging permissions') . get_manual_link('group_properties_blogging'));
$Form->radio('edited_grp_perm_blogs', $edited_Group->get('perm_blogs'), array(array('user', T_('Depending on each blog\'s permissions')), array('viewall', T_('View all blogs')), array('editall', T_('Full Access') . get_admin_badge('coll', '#', '#', T_('Select to give Collection Admin permission')))), T_('Collections'), false);
$Form->radio('perm_xhtmlvalidation', $edited_Group->get('perm_xhtmlvalidation'), array(array('always', T_('Force valid XHTML + strong security'), T_('The security filters below will be strongly enforced.')), array('never', T_('Basic security checking'), T_('Security filters below will still be enforced but with potential lesser accuracy.'))), T_('XHTML validation'), true);
$Form->radio('perm_xhtmlvalidation_xmlrpc', $edited_Group->get('perm_xhtmlvalidation_xmlrpc'), array(array('always', T_('Force valid XHTML + strong security'), T_('The security filters below will be strongly enforced.')), array('never', T_('Basic security checking'), T_('Security filters below will still be enforced but with potential lesser accuracy.'))), T_('XHTML validation on XML-RPC calls'), true);
$Form->checklist(array(array('prevent_css_tweaks', 1, T_('Prevent CSS tweaks'), !$edited_Group->get('perm_xhtml_css_tweaks'), false, T_('WARNING: if allowed, users may deface the site, add hidden text, etc.')), array('prevent_iframes', 1, T_('Prevent iframes'), !$edited_Group->get('perm_xhtml_iframes'), false, T_('WARNING: if allowed, users may do XSS hacks, steal passwords from other users, etc.')), array('prevent_javascript', 1, T_('Prevent javascript'), !$edited_Group->get('perm_xhtml_javascript'), false, T_('WARNING: if allowed, users can easily do XSS hacks, steal passwords from other users, etc.')), array('prevent_objects', 1, T_('Prevent objects'), !$edited_Group->get('perm_xhtml_objects'), false, T_('WARNING: if allowed, users can spread viruses and malware through this blog.'))), 'xhtml_security', T_('Security filters'));
$Form->checkbox('apply_antispam', !$edited_Group->get('perm_bypass_antispam'), T_('Antispam filtering'), T_('Inputs from these users will be checked against the antispam blacklist.'));
// Display pluggable permissions:
display_pluggable_permissions($Form, 'blogging');
$Form->end_fieldset();
$Form->begin_fieldset(T_('Additional permissions') . get_manual_link('group_properties_additional_permissions'));
$Form->radio('edited_grp_perm_stats', $edited_Group->get('perm_stats'), array($perm_none_option, array('user', T_('View stats for specific blogs'), T_('Based on each blog\'s edit permissions')), array('view', T_('View stats for all blogs')), array('edit', T_('Full Access'), T_('Includes deleting/reassigning of stats'))), T_('Stats'), true);
// Display pluggable permissions:
display_pluggable_permissions($Form, 'additional');
Example #5
0
// These params need to be memorized and passed through regenerated urls: (this allows to come back to the right list order & page)
param('results_goals_page', 'integer', '', true);
param('results_goals_order', 'string', '', true);
$Form = new Form(NULL, 'goal_checkchanges', 'post', 'compact');
if (!$creating) {
    $Form->global_icon(T_('Delete this goal!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('goal')));
}
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', $creating ? T_('New goal') : T_('Goal'));
$Form->add_crumb('goal');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',goal_ID' : '')));
// (this allows to come back to the right list order & page)
$GoalCategoryCache =& get_GoalCategoryCache();
$GoalCategoryCache->load_all();
$Form->select_input_object('goal_gcat_ID', $edited_Goal->gcat_ID, $GoalCategoryCache, T_('Category'), array('required' => true));
$Form->text_input('goal_name', $edited_Goal->name, 40, T_('Name'), '', array('maxlength' => 50, 'required' => true));
$Form->text_input('goal_key', $edited_Goal->key, 32, T_('Key'), T_('Should be URL friendly'), array('required' => true));
$Form->text_input('goal_redir_url', $edited_Goal->redir_url, 60, T_('Normal Redirection URL'), '', array('maxlength' => 255, 'class' => 'large', 'required' => true));
$Form->text_input('goal_temp_redir_url', $edited_Goal->temp_redir_url, 60, T_('Temporary Redirection URL'), '', array('maxlength' => 255, 'class' => 'large'));
$Form->date_input('goal_temp_start_date', is_int($edited_Goal->temp_start_ts) ? date2mysql($edited_Goal->temp_start_ts) : $edited_Goal->temp_start_ts, T_('Temporary Start Date'));
$Form->time_input('goal_temp_start_time', is_int($edited_Goal->temp_start_ts) ? date2mysql($edited_Goal->temp_start_ts) : $edited_Goal->temp_start_ts, T_('Temporary Start Time'));
$Form->date_input('goal_temp_end_date', is_int($edited_Goal->temp_end_ts) ? date2mysql($edited_Goal->temp_end_ts) : $edited_Goal->temp_end_ts, T_('Temporary End Date'));
$Form->time_input('goal_temp_end_time', is_int($edited_Goal->temp_end_ts) ? date2mysql($edited_Goal->temp_end_ts) : $edited_Goal->temp_end_ts, T_('Temporary End Time'));
$Form->text_input('goal_default_value', $edited_Goal->default_value, 15, T_('Default value'), '');
$Form->textarea('goal_notes', $edited_Goal->get('notes'), 15, T_('Notes'), '', 50);
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
?>
Example #6
0
 */
global $edited_Subregion;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'subregion_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Delete this sub-region!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('subregion')));
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', ($creating ? T_('New sub-region') : T_('Sub-region')) . get_manual_link('subregions-editing'));
$Form->add_crumb('subregion');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',subrg_ID' : '')));
// (this allows to come back to the right list order & page)
$CountryCache =& get_CountryCache();
$Form->select_country('subrg_ctry_ID', $edited_Subregion->ctry_ID, $CountryCache, T_('Country'), array('allow_none' => true, 'required' => true));
$Form->select_input_options('subrg_rgn_ID', get_regions_option_list($edited_Subregion->ctry_ID, $edited_Subregion->rgn_ID, array('none_option_text' => T_('Unknown'))), T_('Region'), '', array('required' => true));
$Form->text_input('subrg_code', $edited_Subregion->code, 6, T_('Code'), '', array('maxlength' => 6, 'required' => true));
$Form->text_input('subrg_name', $edited_Subregion->name, 40, T_('Name'), '', array('maxlength' => 40, 'required' => true));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
?>
<script type="text/javascript">
jQuery( '#subrg_ctry_ID' ).change( function ()
{	// Load option list with regions for seleted country
	jQuery.ajax( {
	type: 'POST',
	url: '<?php 
echo get_samedomain_htsrv_url();
?>
Example #7
0
 * 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 = '&nbsp;';
$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') . ' &raquo;</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();
 /**
  * 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;
 }
global $instance_name;
$Form = new Form(NULL, 'settings_checkchanges');
$Form->begin_form('fform', '', array('onsubmit' => 'var es=this.elements; for( var i=0; i < es.length; i++ ) { es[i].disabled=false; };'));
$Form->add_crumb('collectionsettings');
$Form->hidden('ctrl', 'collections');
$Form->hidden('tab', get_param('tab'));
$Form->hidden('action', 'update_settings_site');
// --------------------------------------------
if ($current_User->check_perm('users', 'edit')) {
    $Form->begin_fieldset(T_('Locking down b2evolution for maintenance, upgrade or server switching...') . get_manual_link('system-lock'));
    $Form->checkbox_input('system_lock', $Settings->get('system_lock'), T_('Lock system'), array('note' => T_('check this to prevent login (except for admins) and sending comments/messages. This prevents the DB from receiving updates (other than logging)') . '<br />' . T_('Note: for a more complete lock down, rename the file /conf/_maintenance.html to /conf/maintenance.html (complete lock) or /conf/imaintenance.html (gives access to /install)')));
    $Form->end_fieldset();
}
// --------------------------------------------
$Form->begin_fieldset(T_('Global Site Settings') . get_manual_link('global-site-settings'));
$Form->text_input('site_code', $Settings->get('site_code'), 10, T_('Site code'), '$instance_name = ' . $instance_name, array('maxlength' => 20));
$Form->color_input('site_color', $Settings->get('site_color'), T_('Site color'), T_('E-g: #ff0000 for red'));
$Form->text_input('notification_short_name', $Settings->get('notification_short_name'), 50, T_('Short site name'), T_('Shared with email settings'), array('maxlength' => 127, 'required' => true));
$Form->text_input('notification_long_name', $Settings->get('notification_long_name'), 50, T_('Long site name'), T_('Shared with email settings'), array('maxlength' => 255));
$Form->text_input('notification_logo', $Settings->get('notification_logo'), 50, T_('Small site logo (URL)'), T_('Shared with email settings'), array('maxlength' => 5000));
$Form->text_input('notification_logo_large', $Settings->get('notification_logo_large'), 50, T_('Large site logo (URL)'), '', array('maxlength' => 5000));
$Form->text_input('site_footer_text', $Settings->get('site_footer_text'), 50, T_('Site footer text'), '', array('maxlength' => 5000));
$Form->checkbox_input('site_skins_enabled', $Settings->get('site_skins_enabled'), T_('Enable site skins'), array('note' => T_('Enables a sitewide header and footer')));
$Form->text_input('site_terms', $Settings->get('site_terms'), 7, T_('Terms & Conditions'), T_('Enter ID of the page containing the terms & conditions.'), array('maxlength' => 11));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('Default collections') . get_manual_link('default-collections'));
$BlogCache =& get_BlogCache();
$create_new_blog_link = ' <a href="' . $admin_url . '?ctrl=collections&action=new">' . T_('Create new collection') . ' &raquo;</a>';
$Form->select_input_object('default_blog_ID', $Settings->get('default_blog_ID'), $BlogCache, get_icon('coll_default') . ' ' . T_('Default collection to display'), array('note' => T_('This collection will be displayed on index.php.') . $create_new_blog_link, 'allow_none' => true, 'loop_object_method' => 'get_maxlen_name'));
$Form->select_input_object('info_blog_ID', $Settings->get('info_blog_ID'), $BlogCache, get_icon('coll_info') . ' ' . T_('Collection for info pages'), array('note' => T_('The pages in this collection will be added to the site menu.') . $create_new_blog_link, 'allow_none' => true, 'loop_object_method' => 'get_maxlen_name'));
Example #10
0
 * under any OSI approved OSS license (http://www.opensource.org/licenses/).
 * }}
 *
 * @package maintenance
 *
 * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
 * @author fplanque: Francois Planque.
 *
 * @version $Id: _upgrade_svn.form.php 2193 2012-10-19 11:01:47Z yura $
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * @var action
 */
global $action;
switch ($action) {
    case 'start':
        global $updates, $UserSettings;
        $Form = new Form(NULL, 'upgrade_form', 'post', 'compact');
        $Form->hiddens_by_key(get_memorized('action'));
        $Form->begin_form('fform', T_('Upgrade from SVN') . get_manual_link('upgrade-from-svn'));
        $Form->text_input('svn_url', $UserSettings->get('svn_upgrade_url'), 80, T_('URL of repository'), T_('e.g. https://server.com/svn/repository/'), array('maxlength' => 300, 'required' => true));
        $Form->text_input('svn_folder', $UserSettings->get('svn_upgrade_folder'), 80, T_('SVN folder'), T_('e.g. trunk/blogs/'), array('maxlength' => 300));
        $Form->text_input('svn_user', $UserSettings->get('svn_upgrade_user'), 32, T_('Login'), '', array('maxlength' => 300));
        $Form->password_input('svn_password', get_param('svn_password'), 32, T_('Password'), '', array('maxlength' => 300));
        $Form->text_input('svn_revision', $UserSettings->get('svn_upgrade_revision'), 7, T_('Revision'), T_('Leave blank to get the latest revision'));
        $Form->end_form(array(array('submit', 'actionArray[upgrade_svn]', T_('Export revision from SVN...'), 'SaveButton')));
        break;
}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * @var GoalCategory
 */
global $edited_GoalCategory;
// Determine if we are creating or updating...
global $action;
$creating = in_array($action, array('cat_new', 'cat_copy', 'cat_create', 'cat_create_new', 'cat_create_copy'));
$Form = new Form(NULL, 'goalcat_checkchanges', 'post', 'compact');
if (!$creating) {
    $Form->global_icon(T_('Delete this goal category!'), 'delete', regenerate_url('action', 'action=cat_delete&amp;' . url_crumb('goalcat')));
}
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action,gcat_ID'));
$Form->begin_form('fform', $creating ? T_('New goal category') : T_('Goal category'));
$Form->add_crumb('goalcat');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',gcat_ID' : '')));
// (this allows to come back to the right list order & page)
$Form->text_input('gcat_name', $edited_GoalCategory->name, 40, T_('Name'), '', array('maxlength' => 50, 'required' => true));
$Form->color_input('gcat_color', $edited_GoalCategory->color, T_('Color'), T_('E-g: #ff0000 for red'), array('required' => true));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[cat_create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[cat_create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[cat_create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[cat_update]', T_('Save Changes!'), 'SaveButton')));
}
Example #12
0
        $form_title_item_ID = sprintf(T_('Duplicating Item %s'), '<a href="' . $admin_url . '?ctrl=items&amp;blog=' . $Blog->ID . '&amp;p=' . $original_item_ID . '" class="post_type_link">#' . $original_item_ID . '</a>');
    } else {
        // Set form title for creating new item:
        $form_title_item_ID = T_('New Item');
    }
}
$Form->begin_fieldset($form_title_item_ID . get_manual_link('post-contents-panel') . '<span class="pull-right">' . sprintf(T_('Type: %s'), $item_type_link) . '</span>', array('id' => 'itemform_content'));
$Form->switch_layout('none');
echo '<table cellspacing="0" class="compose_layout" align="center"><tr>';
$display_title_field = $edited_Item->get_type_setting('use_title') != 'never';
if ($display_title_field) {
    // Display title
    $field_required = $edited_Item->get_type_setting('use_title') == 'required' ? $required_star : '';
    echo '<td width="1%" class="label">' . $field_required . '<strong>' . T_('Title') . ':</strong></td>';
    echo '<td width="97%" class="input">';
    $Form->text_input('post_title', $item_title, 20, '', '', array('maxlength' => 255, 'style' => 'width: 100%;'));
    echo '</td>';
} else {
    // Hide title
    $Form->hidden('post_title', $item_title);
}
// -- Language chooser BEGIN --
$locale_options = locale_options($edited_Item->get('locale'), false, true);
if (is_array($locale_options)) {
    // We've only one enabled locale.
    // Tblue> The locale name is not really needed here, but maybe we
    //        want to display the name of the only locale?
    $Form->hidden('post_locale', $locale_options[0]);
    //pre_dump( $locale_options );
} else {
    // More than one locale => select field.
Example #13
0
}
$current_User->check_perm('options', 'edit', true);
global $Settings;
$BlogCache =& get_BlogCache();
$Form = new Form(NULL, 'msg_settings');
$Form->begin_form('fform', '');
$Form->add_crumb('msgsettings');
$Form->hidden('ctrl', 'msgsettings');
$Form->hidden('action', 'update');
$Form->begin_fieldset(T_('General settings'));
// set link to options
$messages_link_to = $Settings->get('messages_link_to');
$admin_selected = $messages_link_to == 'admin' ? 'selected="selected"' : '';
$link_to_options = '<option value="admin" ' . $admin_selected . '>admin</option>';
$link_to_options .= $BlogCache->get_option_list($messages_link_to);
$Form->select_input_options('messages_link_to', $link_to_options, T_('Messaging emails link to'));
$Form->end_fieldset();
$Form->begin_fieldset(T_('Welcome message after account activation'));
$Form->checkbox_input('welcomepm_enabled', $Settings->get('welcomepm_enabled'), T_('Send Welcome PM'), array('note' => T_('Check to automatically send a welcome message to users when they activate their account.')));
$UserCache =& get_UserCache();
$User = $UserCache->get_by_login($Settings->get('welcomepm_from'));
if (!$User) {
    // Use login of the current user if user login is incorrect
    $User = $current_User;
}
$Form->username('welcomepm_from', $User, T_('From'), T_('User login.'));
$Form->text_input('welcomepm_title', $Settings->get('welcomepm_title'), 58, T_('Title'), '', array('maxlength' => 5000));
$Form->textarea_input('welcomepm_message', $Settings->get('welcomepm_message'), 15, T_('Message'), array('cols' => 45));
$Form->end_fieldset();
$Form->buttons(array(array('submit', 'submit', T_('Save !'), 'SaveButton')));
$Form->end_form();
Example #14
0
        echo '<div class="red center">' . T_('This is just a test run. Nothing will be posted to the database nor will your inbox be altered') . '</div>';
    }
    // Display scrollable div
    echo '<div style="padding: 6px; margin:5px; border: 1px solid #CCC; overflow:scroll; height: 350px">' . $eblog_test_output . '</div>';
}
$Form->end_fieldset();
$Form->begin_fieldset(T_('General settings') . get_manual_link('post-by-email-general-settings'));
if (extension_loaded('imap')) {
    $imap_extenssion_status = T_('(INSTALLED)');
} else {
    $imap_extenssion_status = '<b class="red">' . T_('(NOT INSTALLED)') . '</b>';
}
$Form->checkbox_input('eblog_enabled', $Settings->get('eblog_enabled'), T_('Enable Post by email'), array('note' => sprintf(T_('Note: This feature needs the php_imap extension %s.'), $imap_extenssion_status)));
$eblog_test_mode_value = isset($eblog_saved_test_mode_value) ? $eblog_saved_test_mode_value : $Settings->get('eblog_test_mode');
$Form->checkbox_input('eblog_test_mode', $eblog_test_mode_value, T_('Test Mode'), array('note' => T_('Check to run Post by Email in test mode. Nothing will be posted to the database nor will your inbox be altered.')));
$Form->text_input('eblog_server_host', $Settings->get('eblog_server_host'), 25, T_('Mail Server'), T_('Hostname or IP address of your incoming mail server.'), array('maxlength' => 255));
$Form->radio('eblog_method', $Settings->get('eblog_method'), array(array('pop3', T_('POP3')), array('imap', T_('IMAP'))), T_('Retrieval method'));
$Form->radio('eblog_encrypt', $Settings->get('eblog_encrypt'), array(array('none', T_('None')), array('ssl', T_('SSL')), array('tls', T_('TLS'))), T_('Encryption method'));
$eblog_novalidatecert_params = array('lines' => true);
if ($Settings->get('eblog_encrypt') == 'none') {
    $eblog_novalidatecert_params['disabled'] = 'disabled';
}
$Form->radio_input('eblog_novalidatecert', $Settings->get('eblog_novalidatecert'), array(array('value' => 0, 'label' => T_('Do not validate the certificate from the TLS/SSL server. Check this if you are using a self-signed certificate.')), array('value' => 1, 'label' => T_('Validate that the certificate from the TLS/SSL server can be trusted. Use this if you have a correctly signed certificate.'))), T_('Certificate validation'), $eblog_novalidatecert_params);
$Form->text_input('eblog_server_port', $Settings->get('eblog_server_port'), 5, T_('Port Number'), T_('Port number of your incoming mail server (Defaults: POP3: 110, IMAP: 143, SSL/TLS: 993).'), array('maxlength' => 6));
$Form->text_input('eblog_username', $Settings->get('eblog_username'), 25, T_('Account Name'), T_('User name for authenticating on your mail server. Usually it\'s your email address or a part before the @ sign.'), array('maxlength' => 255));
$Form->password_input('eblog_password', $Settings->get('eblog_password'), 25, T_('Password'), array('maxlength' => 255, 'note' => T_('Password for authenticating on your mail server.')));
$Form->checkbox('eblog_delete_emails', $Settings->get('eblog_delete_emails'), T_('Delete processed emails'), T_('Check this if you want processed messages to be deleted form server after successful processing.'));
$Form->end_fieldset();
$Form->begin_fieldset(T_('Posting settings') . get_manual_link('post-by-email-posting-settings'));
// TODO: provide a list of categories to choose from
$Form->text_input('eblog_default_category', $Settings->get('eblog_default_category'), 5, T_('Default Category ID'), sprintf(T_('This is a default category for your posts.') . '<br />' . T_('You can use the following code in message body to define categories: %s. In this example 2 will be main category and 5, 47 extra categories.'), '<b>&lt;category&gt;2, 5, 47&lt;/category&gt;</b>'), array('maxlength' => 6));
    die('Please, do not access this page directly.');
}
/**
 * @var Organization
 */
global $edited_Organization;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'organization_checkchanges', 'post', 'compact');
if (!$creating) {
    $Form->global_icon(T_('Delete this organization!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('organization')));
}
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action,org_ID'));
$Form->begin_form('fform', ($creating ? T_('New organization') : T_('Organization')) . get_manual_link('organization-form'));
$Form->add_crumb('organization');
$Form->hiddens_by_key(get_memorized('action'));
// (this allows to come back to the right list order & page)
$Form->text_input('org_name', $edited_Organization->name, 32, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('org_url', $edited_Organization->url, 32, T_('Url'), '', array('maxlength' => 2000));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
if ($edited_Organization->ID > 0) {
    // Display users of this organization
    users_results_block(array('org_ID' => $edited_Organization->ID, 'filterset_name' => 'orgusr_' . $edited_Organization->ID, 'results_param_prefix' => 'orgusr_', 'results_title' => T_('Users of this organization') . get_manual_link('users_and_groups'), 'results_order' => '/uorg_accepted/D', 'page_url' => get_dispctrl_url('organizations', 'action=edit&amp;org_ID=' . $edited_Organization->ID), 'display_orgstatus' => true, 'display_ID' => false, 'display_btn_adduser' => false, 'display_btn_addgroup' => false, 'display_blogs' => false, 'display_source' => false, 'display_regdate' => false, 'display_regcountry' => false, 'display_update' => false, 'display_lastvisit' => false, 'display_contact' => false, 'display_reported' => false, 'display_group' => false, 'display_level' => false, 'display_status' => false, 'display_actions' => false, 'display_newsletter' => false));
}
// AJAX changing of an accept status of organizations for each user
echo_user_organization_js();
Example #16
0
$Form->hidden('action', 'update');
// --------------------------------------------
if ($current_User->check_perm('users', 'edit')) {
    $Form->begin_fieldset(T_('Locking down b2evolution for maintenance, upgrade or server switching...'));
    $Form->checkbox_input('system_lock', $Settings->get('system_lock'), T_('Lock system'), array('note' => T_('check this to prevent login (except for admins) and sending comments/messages. This prevents the DB from receiving updates (other than logging)') . '<br />' . T_('Note: for a more complete lock down, rename the file /conf/_maintenance.html to /conf/maintenance.html (complete lock) or /conf/imaintenance.html (gives access to /install)')));
    $Form->end_fieldset();
}
// --------------------------------------------
$Form->begin_fieldset(T_('Caching'));
$Form->checkbox_input('general_cache_enabled', $Settings->get('general_cache_enabled'), T_('Enable general cache'), array('note' => T_('Cache rendered pages that are not controlled by a skin. See Blog Settings for skin output caching.')));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('Online Help') . get_manual_link('online help'));
$Form->checkbox_input('webhelp_enabled', $Settings->get('webhelp_enabled'), T_('Online Help links'), array('note' => T_('Online help links provide context sensitive help to certain features.')));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('Hit & session logging') . get_manual_link('hit_logging'));
$Form->checklist(array(array('log_public_hits', 1, T_('on every public page'), $Settings->get('log_public_hits')), array('log_admin_hits', 1, T_('on every admin page'), $Settings->get('log_admin_hits'))), 'log_hits', T_('Log hits'));
// TODO: draw a warning sign if set to off
$Form->radio_input('auto_prune_stats_mode', $Settings->get('auto_prune_stats_mode'), array(array('value' => 'off', 'label' => T_('Off'), 'note' => T_('Not recommended! Your database will grow very large!'), 'onclick' => 'jQuery("#auto_prune_stats_container").hide();'), array('value' => 'page', 'label' => T_('On every page'), 'note' => T_('This is guaranteed to work but uses extra resources with every page displayed.'), 'onclick' => 'jQuery("#auto_prune_stats_container").show();'), array('value' => 'cron', 'label' => T_('With a scheduled job'), 'note' => T_('Recommended if you have your scheduled jobs properly set up.'), 'onclick' => 'jQuery("#auto_prune_stats_container").show();')), T_('Auto pruning'), array('note' => T_('Note: Even if you don\'t log hits, you still need to prune sessions!'), 'lines' => true));
echo '<div id="auto_prune_stats_container">';
$Form->text_input('auto_prune_stats', $Settings->get('auto_prune_stats'), 5, T_('Prune after'), T_('days. How many days of hits & sessions do you want to keep in the database for stats?'));
echo '</div>';
if ($Settings->get('auto_prune_stats_mode') == 'off') {
    // hide the "days" input field, if mode set to off:
    echo '<script type="text/javascript">jQuery("#auto_prune_stats_container").hide();</script>';
}
$Form->end_fieldset();
if ($current_User->check_perm('options', 'edit')) {
    $Form->end_form(array(array('submit', 'submit', T_('Save !'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
}
Example #17
0
 /**
  * Event handler: Gets invoked when our tab is selected and should get displayed.
  *
  * @see Plugin::AdminTabPayload()
  */
 function AdminTabPayload()
 {
     echo 'Hello, this is the AdminTabPayload for the TEST plugin.';
     echo $this->text_from_AdminTabAction;
     // TODO: this is tedious.. should either be a global function (get_admin_Form()) or a plugin helper..
     $Form = new Form();
     $Form->begin_form();
     $Form->add_crumb('plugin_test');
     $Form->hidden_ctrl();
     // needed to pass the "ctrl=tools" param
     $Form->hiddens_by_key(get_memorized());
     // needed to pass all other memorized params, especially "tab"
     $Form->text_input($this->get_class_id() . '_text', $this->param_text, '20', 'Text');
     $Form->button_input();
     // default "submit" button
     $Form->end_form();
 }
Example #18
0
$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 . '&amp;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));
}
$Form->checkbox_input('cat_meta', $edited_Chapter->meta, T_('Meta category'), array('note' => T_('If you check this box you will not be able to put any posts into this category.')));
$Form->checkbox_input('cat_lock', $edited_Chapter->lock, T_('Locked category'), array('note' => T_('Check this to lock all posts under this category. (Note: for posts with multiple categories, the post is only locked if *all* its categories are locked.)')));
$Form->end_fieldset();
if ($creating) {
    $Form->end_form(array(array('submit', 'submit', T_('Record'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
} else {
    $Form->end_form(array(array('submit', 'submit', T_('Update'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
}
Example #19
0
$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));
}
$Form->date_input('cjob_date', date2mysql($edited_Cronjob->start_timestamp), T_('Schedule date'), array('required' => true));
$Form->time_input('cjob_time', date2mysql($edited_Cronjob->start_timestamp), T_('Schedule time'), array('required' => true));
$Form->duration_input('cjob_repeat_after', $edited_Cronjob->repeat_after, T_('Repeat every'), 'days', 'minutes', array('minutes_step' => 1));
$Form->end_fieldset();
if (!$creating) {
    // We can edit only pending cron jobs, Show this field just for info
    $Form->begin_fieldset(T_('Execution details') . get_manual_link('scheduled-job-execution-details'));
    $Form->info(T_('Status'), 'pending');
    $Form->end_fieldset();
}
$Form->end_form(array(array('submit', 'submit', $creating ? T_('Create') : T_('Save Changes!'), 'SaveButton')));
Example #20
0
global $force_upload_forbiddenext;
global $rsc_path;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'ftyp_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Delete this filetype!'), 'delete', regenerate_url('action', 'action=delete'));
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', $creating ? T_('New file type') : T_('File type'));
$Form->add_crumb('filetype');
$Form->hidden_ctrl();
$Form->hidden('action', $creating ? 'create' : 'update');
if (!$creating) {
    $Form->hidden('ftyp_ID', $edited_Filetype->ID);
}
$Form->text_input('ftyp_extensions', $edited_Filetype->extensions, 40, T_('Extensions'), '', array('maxlength' => 30, 'required' => true, 'note' => sprintf('E.g. &laquo;%s&raquo;' . ', ' . T_('separated by whitespace'), 'html')));
$Form->text_input('ftyp_name', $edited_Filetype->name, 40, T_('File type name'), sprintf('E.g. &laquo;%s&raquo;', 'HTML file'), array('maxlength' => 30, 'required' => true));
$Form->text_input('ftyp_mimetype', $edited_Filetype->mimetype, 40, T_('Mime type'), sprintf('E.g. &laquo;%s&raquo;', 'text/html'), array('maxlength' => 50, 'required' => true));
$Form->select_input_array('ftyp_icon', $edited_Filetype->icon, get_available_filetype_icons(), T_('Icon'));
$Form->radio('ftyp_viewtype', $edited_Filetype->viewtype, array(array('browser', T_('Open with browser (popup)'), T_('Let the browser handle the file in a popup.')), array('text', T_('Open with text viewer (popup)'), T_('Use the online text viewer (recommended for .txt)')), array('image', T_('Open with image viewer (popup)'), T_('Use the online image viewer (recommended for .gif .png .jpg)')), array('external', T_('Open with external app (no popup)'), T_('Let the browser handle the file in a popup. Note: if you do not want Word to open inside of IE, you must uncheck "browse in same window" in Windows\' file types.')), array('download', T_('Download to disk (no popup)'), T_('Tell the browser to save the file to disk instead of displaying it.'))), T_('View type'), true);
// Check if the extension is in the array of the not allowed upload extensions from _advanced.php
$not_allowed = false;
$extensions = explode(' ', $edited_Filetype->extensions);
foreach ($extensions as $extension) {
    if (in_array($extension, $force_upload_forbiddenext)) {
        $not_allowed = true;
        continue;
    }
}
$Form->radio('ftyp_allowed', $edited_Filetype->allowed, array(array('any', T_('Allow anyone (including anonymous users) to upload/rename files of this type')), array('registered', T_('Allow only registered users to upload/rename files of this type')), array('admin', T_('Allow only admins to upload/rename files of this type'))), T_('Allow upload'), true);
if ($creating) {
    if (isset($module_contacts_list_params['form_hiddens']) && !empty($module_contacts_list_params['form_hiddens'])) {
        // Append the hidden input elements from module
        foreach ($module_contacts_list_params['form_hiddens'] as $hidden_input) {
            $Form->hidden($hidden_input['name'], $hidden_input['value']);
        }
    }
    $Form->combo_box('group', param('group_combo', 'string', ''), get_contacts_groups_options(param('group', 'string', '-1'), false), $multi_action_icon . T_('Add all selected contacts to this group'), array('new_field_size' => '8'));
    $Form->buttons(array(array('submit', 'actionArray[add_group]', T_('Add'), 'SaveButton btn-primary btn-sm')));
    echo '</span>';
    if (isset($group_filtered)) {
        // Contacts list is filtered by group
        echo '<div id="edit_group_contacts" style="white-space:normal">';
        $Form->hidden('group_ID', $group_filtered->ID);
        echo '<p class="center">' . sprintf(T_('Selected group: <b>%s</b>'), $group_filtered->name) . '</p>';
        echo '<input id="send_group_recipients" type="button" onclick="location.href=\'' . $module_contacts_list_params['recipients_link'] . '&amp;group_ID=' . $group_filtered->ID . '\'" value="' . sprintf($module_contacts_list_params['title_group'], $group_filtered->count_users, $group_filtered->name) . '" style="margin: 1ex 0" /><br />';
        $Form->text_input('name', $group_filtered->name, 20, T_('Rename this group to'));
        $Form->button_input(array('name' => 'actionArray[rename_group]', 'value' => T_('Rename'), 'class' => 'SaveButton'));
        echo ' &nbsp; <b class="nowrap" style="padding-top:1em;line-height:32px">' . T_('or') . ' &nbsp; ';
        $Form->button_input(array('name' => 'actionArray[delete_group]', 'value' => T_('Delete this group'), 'class' => 'SaveButton', 'onclick' => 'return confirm("' . TS_('Are you sure want to delete this group?') . '")'));
        echo '</b>';
        echo '</div>';
    }
    $Form->end_form();
    $Form->switch_layout(NULL);
    ?>
<script type="text/javascript">
jQuery( '#send_selected_recipients' ).click( function()
{ // Add selected users to this link
	var recipients_param = '';
	var recipients = get_selected_users();
	if( recipients.length > 0 )
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * @var Slug
 */
global $edited_IPRange;
// Determine if we are creating or updating...
global $action;
$creating = $action == 'iprange_new';
$Form = new Form(NULL, 'iprange_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action,iprange_ID'));
$Form->begin_form('fform', ($creating ? T_('New IP Range') : T_('IP Range')) . get_manual_link('ip-range-editing'));
$Form->add_crumb('iprange');
$Form->hidden('action', $creating ? 'iprange_create' : 'iprange_update');
$Form->hidden_ctrl();
$Form->hidden('tab', get_param('tab'));
$Form->hidden('tab3', get_param('tab3'));
$Form->hidden('iprange_ID', param('iprange_ID', 'integer', 0));
$Form->select_input_array('aipr_status', $edited_IPRange->get('status'), aipr_status_titles(), T_('Status'), '', array('force_keys_as_values' => true, 'background_color' => aipr_status_colors(), 'required' => true));
$Form->text_input('aipr_IPv4start', int2ip($edited_IPRange->get('IPv4start')), 50, T_('IP Range Start'), '', array('maxlength' => 15, 'required' => true));
$Form->text_input('aipr_IPv4end', int2ip($edited_IPRange->get('IPv4end')), 50, T_('IP Range End'), '', array('maxlength' => 15, 'required' => true));
$Form->date_input('aipr_IP_timestamp', date2mysql($edited_IPRange->IP_timestamp), T_('Date'), array('required' => true));
$Form->info(T_('User count'), (int) $edited_IPRange->get('user_count'));
$Form->info(T_('Block count'), (int) $edited_IPRange->get('block_count'));
$Form->end_form(array(array('submit', 'submit', $creating ? T_('Record') : T_('Save Changes!'), 'SaveButton')));
 *
 * @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&amp;action=change_users&amp;ecmp_ID=' . $edited_EmailCampaign->ID . '">' . T_('Change selection') . ' &gt;&gt;</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();
$buttons = array();
Example #24
0
	<?php 
$Form->begin_fieldset(T_('Comment contents') . get_manual_link('editing-comments'));
echo '<table cellspacing="0" class="compose_layout" align="center">';
echo '<tr><td width="1%"><strong>' . T_('In response to') . ':</strong></td>';
echo '<td>';
$comment_Item =& $edited_Comment->get_Item();
$comment_Item->title(array('link_type' => 'admin_view', 'max_length' => '30'));
echo '</td>';
$Blog_owner_User =& $Blog->get_owner_User();
if ($Blog_owner_User->ID == $current_User->ID || $current_User->check_perm('blog_admin', 'edit', false, $Blog->ID)) {
    // User has prmission to change comment's post, because user is the owner of the current blog, or user has admin full access permission for current blog
    $Form->switch_layout('none');
    // Move to another post
    echo '<td width="1%">&nbsp;&nbsp;<strong>' . T_('Move to post ID') . ':</strong></td>';
    echo '<td class="input">';
    $Form->text_input('moveto_post', $comment_Item->ID, 20, '', '', array('maxlength' => 100, 'style' => 'width:25%;'));
    echo '</td>';
    $Form->switch_layout(NULL);
}
echo '</tr></table>';
if ($Blog->get_setting('threaded_comments')) {
    // Display a reply comment ID only when this feature is enabled in blog settings
    echo '<table cellspacing="0" class="compose_layout" align="center">';
    echo '<tr><td width="1%"><strong>' . T_('In reply to comment ID') . ':</strong></td>';
    echo '<td class="input">';
    $Form->switch_layout('none');
    $Form->text_input('in_reply_to_cmt_ID', $edited_Comment->in_reply_to_cmt_ID, 10, '');
    $Form->switch_layout(NULL);
    echo '&nbsp;<span class="note">' . T_('(leave blank for normal comments)') . '</span>';
    echo '</td>';
    echo '</tr></table>';
<?php

/**
 * This file display the form to create sample users for testing
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.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/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $Settings, $GroupCache;
$Form = new Form(NULL, 'create_users', 'user', 'compact');
$Form->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', T_('Create sample users'));
$Form->add_crumb('tools');
$Form->hidden('ctrl', 'tools');
$Form->hidden('action', 'create_sample_users');
$Form->hidden('tab3', get_param('tab3'));
$Form->select_object('group_ID', $Settings->get('newusers_grp_ID'), $GroupCache, T_('Group for new users'));
$Form->text_input('num_users', 10, 11, T_('How many users'), '', array('maxlength' => 10, 'required' => true));
$Form->end_form(array(array('submit', 'submit', T_('Create'), 'SaveButton')));
 * @copyright (c)2009-2015 by Francois Planque - {@link http://fplanque.com/}
 * 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.');
}
load_class('users/model/_userfieldgroup.class.php', 'UserfieldGroup');
/**
 * @var Userfield
 */
global $edited_UserfieldGroup;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'userfieldgroup_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Delete this user field group!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('userfieldgroup')));
$Form->global_icon(T_('Cancel editing!'), 'close', '?ctrl=userfields');
$Form->begin_form('fform', $creating ? T_('New user field group') : T_('User field group'));
$Form->add_crumb('userfieldgroup');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',ufgp_ID' : '')));
// (this allows to come back to the right list order & page)
$Form->hidden('ufgp_ID', $edited_UserfieldGroup->ID);
$Form->text_input('ufgp_name', $edited_UserfieldGroup->name, 50, T_('Name'), '', array('maxlength' => 255, 'required' => true));
$Form->text_input('ufgp_order', $edited_UserfieldGroup->order, 50, T_('Order number'), '', array('maxlength' => 11, 'required' => true));
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
    $Form->end_form(array(array('submit', 'actionArray[update]', T_('Save Changes!'), 'SaveButton')));
}
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link http://sourceforge.net/projects/evocms/}.
 *
 * @copyright (c)2003-2013 by Francois Planque - {@link http://fplanque.com/}.
 * 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 efy-asimo: Attila Simo.
 *
 * @version $Id: _create_messages.form.php 9 2011-10-24 22:32:00Z fplanque $
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $threads_count;
$Form = new Form(NULL, 'create_messages', 'post', 'compact');
$Form->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', T_('Create sample messages for testing moderation'));
$Form->add_crumb('tools');
$Form->hidden('ctrl', 'tools');
$Form->hidden('action', 'create_sample_messages');
$Form->hidden('tab3', get_param('tab3'));
$Form->text_input('num_loops', 3, 50, T_('How many loops'), '', array('maxlength' => 11, 'required' => true, 'note' => sprintf(T_('1 loop will create %d conversations'), $threads_count)));
$Form->text_input('num_messages', 5, 50, T_('How many messages in each conversation'), '', array('maxlength' => 11, 'required' => true));
$Form->text_input('num_words', 3, 50, T_('How many words in each message'), '', array('maxlength' => 11, 'required' => true));
$Form->text_input('max_users', 3, 50, T_('Max # of participants in a conversation'), '', array('maxlength' => 11, 'required' => true));
$Form->end_form(array(array('submit', 'submit', T_('Create'), 'SaveButton')));
Example #28
0
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>';
}
// Skin type
echo '<div class="skin_setting_row">';
echo '<label>' . T_('Skin type') . ':</label>';
echo '<span>' . $edited_Skin->type . '</span>';
echo '</div>';
// Containers
if ($skin_containers = $edited_Skin->get_containers()) {
    $container_ul = '<ul><li>' . implode('</li><li>', $skin_containers) . '</li></ul>';
} else {
    $container_ul = '-';
}
echo '<div class="skin_setting_row">';
echo '<label>' . T_('Containers') . ':</label>';
echo '<span>' . $container_ul . '</span>';
echo '</div>';
echo '</div>';
echo '<div class="skin_settings_form">';
$Form->begin_fieldset(T_('System Settings for this skin') . get_manual_link('skin-system-settings'));
$Form->text_input('skin_name', $edited_Skin->name, 32, T_('Skin name'), T_('As seen by blog owners'), array('required' => true));
$Form->radio('skin_type', $edited_Skin->type, array(array('normal', T_('Normal'), T_('Normal skin for general browsing')), array('mobile', T_('Mobile'), T_('Mobile skin for mobile phones browsers')), array('tablet', T_('Tablet'), T_('Tablet skin for tablet browsers')), array('feed', T_('XML Feed'), T_('Special system skin for XML feeds like RSS and Atom')), array('sitemap', T_('XML Sitemap'), T_('Special system skin for XML sitemaps'))), T_('Skin type'), true);
$Form->end_fieldset();
echo '</div>';
$Form->end_fieldset();
$Form->end_form(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton')));
Example #29
0
 case 'get_user_new_org':
     // Used in the identity user form to add a new organization
     if (!is_logged_in()) {
         // User must be logged in
         break;
     }
     $first_org = param('first_org', 'integer', 0);
     // Use the glyph or font-awesome icons if it is defined by skin
     param('b2evo_icons_type', 'string', '');
     $Form = new Form();
     $OrganizationCache =& get_OrganizationCache();
     $OrganizationCache->clear();
     $OrganizationCache->load_all();
     $Form->output = false;
     $Form->switch_layout('none');
     $org_suffix = ' &nbsp; <strong>' . T_('Role') . ':</strong> ' . $Form->text_input('org_roles[]', '', 20, '', '', array('maxlength' => 255)) . ' &nbsp; ';
     $Form->switch_layout(NULL);
     $Form->output = true;
     // Special form template that will be replaced to current skin on ajax response
     $Form->fieldstart = '#fieldstart#';
     $Form->fieldend = '#fieldend#';
     $Form->labelclass = '#labelclass#';
     $Form->labelstart = '#labelstart#';
     $Form->labelend = '#labelend#';
     $Form->inputstart = '#inputstart#';
     $Form->inputend = '#inputend#';
     $org_suffix .= ' ' . get_icon('add', 'imgtag', array('class' => 'add_org', 'style' => 'cursor:pointer'));
     $org_suffix .= ' ' . get_icon('minus', 'imgtag', array('class' => 'remove_org', 'style' => 'cursor:pointer'));
     $Form->select_input_object('organizations[]', 0, $OrganizationCache, T_('Organization'), array('allow_none' => $first_org ? true : false, 'field_suffix' => $org_suffix));
     break;
 case 'autocomplete_usernames':
Example #30
-1
/**
 * This file display the form to create sample posts for testing
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link http://sourceforge.net/projects/evocms/}.
 *
 * @copyright (c)2003-2013 by Francois Planque - {@link http://fplanque.com/}.
 * 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 efy-asimo: Attila Simo.
 *
 * @version $Id: _create_posts.form.php 3328 2013-03-26 11:44:11Z yura $
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
$Form = new Form(NULL, 'create_posts', 'post', 'compact');
$Form->global_icon(T_('Cancel!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', T_('Create sample post for testing moderation'));
$Form->add_crumb('tools');
$Form->hidden('ctrl', 'tools');
$Form->hidden('action', 'create_sample_posts');
$Form->hidden('tab3', get_param('tab3'));
$Form->text_input('blog_ID', 1, 50, T_('Blog ID'), '', array('maxlength' => 11, 'required' => true));
$Form->text_input('num_posts', 3, 50, T_('How many posts'), '', array('maxlength' => 11, 'required' => true));
$Form->end_form(array(array('submit', 'submit', T_('Create'), 'SaveButton')));