Example #1
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 . '&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')));
}
}
$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 #3
0
 * @var Sub-region
 */
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();
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @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 Chapter
 */
global $edited_Chapter;
/**
 * @var BlogCache
 */
global $BlogCache;
global $action;
$Form = new Form(NULL, 'form');
$Form->global_icon(T_('Cancel move!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', T_('Move category'));
$Form->add_crumb('element');
$Form->hidden('action', 'update_move');
$Form->hiddens_by_key(get_memorized('action'));
$Form->begin_fieldset(T_('Properties'));
$Form->info(T_('Name'), $edited_Chapter->name);
// We're essentially double checking here...
$edited_Blog =& $edited_Chapter->get_Blog();
$Form->select_input_options($edited_Chapter->dbprefix . 'coll_ID', $BlogCache->get_option_list($edited_Blog->ID), T_('Attached to blog'), T_('If you select a new blog, you will be able to choose a position within this blog on the next screen.'));
$Form->end_fieldset();
$Form->end_form(array(array('submit', 'submit', T_('Save Changes!'), 'SaveButton')));
Example #5
0
 * @var City
 */
global $edited_City;
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
$Form = new Form(NULL, 'city_checkchanges', 'post', 'compact');
$Form->global_icon(T_('Delete this city!'), 'delete', regenerate_url('action', 'action=delete&amp;' . url_crumb('city')));
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', ($creating ? T_('New city') : T_('City')) . get_manual_link('cities-editing'));
$Form->add_crumb('city');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',city_ID' : '')));
// (this allows to come back to the right list order & page)
$CountryCache =& get_CountryCache();
$Form->select_country('city_ctry_ID', $edited_City->ctry_ID, $CountryCache, T_('Country'), array('allow_none' => true, 'required' => true));
$Form->select_input_options('city_rgn_ID', get_regions_option_list($edited_City->ctry_ID, $edited_City->rgn_ID, array('none_option_text' => T_('Unknown'))), T_('Region'));
$Form->select_input_options('city_subrg_ID', get_subregions_option_list($edited_City->rgn_ID, $edited_City->subrg_ID, array('none_option_text' => T_('Unknown'))), T_('Sub-region'));
$Form->text_input('city_postcode', $edited_City->postcode, 12, T_('Post code'), '', array('maxlength' => 12, 'required' => true));
$Form->text_input('city_name', $edited_City->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( '#city_ctry_ID' ).change( function ()
{	// Load option list with regions for seleted country
	jQuery.ajax( {
	type: 'POST',
	url: '<?php 
 * @var User
 */
global $current_User;
/**
 * @var GeneralSettings
 */
global $Settings;
$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', 'blog_settings');
$Form->hidden('action', 'update_settings_blog');
// --------------------------------------------
$Form->begin_fieldset(T_('Display options') . get_manual_link('collections-display-options'));
$Form->select_input_options('blogs_order_by', array_to_option_list(get_coll_sort_options(), $Settings->get('blogs_order_by')), T_('Order blogs by'), T_('Select blog list order.'));
$Form->select_input_options('blogs_order_dir', array_to_option_list(array('ASC' => T_('Ascending'), 'DESC' => T_('Descending')), $Settings->get('blogs_order_dir')), T_('Order direction'), T_('Select default blog list order direction.'));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('Caching') . get_manual_link('collections-caching-settings'));
$Form->checkbox_input('general_cache_enabled', $Settings->get('general_cache_enabled'), get_icon('page_cache_on') . ' ' . T_('Enable general cache'), array('note' => T_('Cache rendered pages that are not controlled by a skin. See Blog Settings for skin output caching.')));
$cache_note = '(' . T_('See Blog Settings for existing') . ')';
$Form->checklist(array(array('newblog_cache_enabled', 1, T_('Enable page cache for NEW blogs'), $Settings->get('newblog_cache_enabled'), false, $cache_note), array('newblog_cache_enabled_widget', 1, T_('Enable widget cache for NEW blogs'), $Settings->get('newblog_cache_enabled_widget'), false, $cache_note)), 'new_blogs_cahe', T_('Enable for new blogs'));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('After each new post or comment...') . get_manual_link('after_each_post_settings'));
$Form->radio_input('outbound_notifications_mode', $Settings->get('outbound_notifications_mode'), array(array('value' => 'off', 'label' => T_('Off'), 'note' => T_('No notification about your new content will be sent out.')), array('value' => 'immediate', 'label' => T_('Immediate'), 'note' => T_('This is guaranteed to work but may create an annoying delay after each post or comment publication.')), array('value' => 'cron', 'label' => T_('Asynchronous'), 'note' => T_('Recommended if you have your scheduled jobs properly set up.'))), T_('Outbound pings & email notifications'), array('lines' => true));
$Form->end_fieldset();
// --------------------------------------------
$Form->begin_fieldset(T_('Categories') . get_manual_link('categories_global_settings'), array('id' => 'categories'));
$Form->checkbox_input('allow_moving_chapters', $Settings->get('allow_moving_chapters'), T_('Allow moving categories'), array('note' => T_('Check to allow moving categories accross blogs. (Caution: can break pre-existing permalinks!)')));
    $Form->end_form(array(array('', 'actionArray[confirm_update]', T_('Confirm')), array('', 'actionArray[abort_update]', T_('Abort'))));
} else {
    // show main form
    $Form = new Form($pagenow, 'loc_checkchanges');
    $Form->begin_form('fform');
    $Form->add_crumb('locales');
    $Form->hidden('ctrl', 'locales');
    $Form->hidden('action', 'update');
    $Form->hidden('loc_transinfo', $loc_transinfo);
    $Form->begin_fieldset(T_('Regional settings') . get_manual_link('locales-tab'));
    if (!isset($locales[$Settings->get('default_locale')]) || !$locales[$Settings->get('default_locale')]['enabled']) {
        // default locale is not enabled
        param_error('newdefault_locale', T_('Note: default locale is not enabled.'));
    }
    $locale_options = locale_options($Settings->get('default_locale'), false);
    $Form->select_input_options('newdefault_locale', $locale_options, T_('Default locale'), T_('Overridden by browser config, user locale or blog locale (in this order).'));
    // $Form->select( 'newdefault_locale', $Settings->get('default_locale'), 'locale_options_return', T_('Default locale'), T_('Overridden by browser config, user locale or blog locale (in this order).'));
    $Form->end_fieldset();
    $Form->begin_fieldset(T_('Available locales') . get_manual_link('locales-tab'));
    echo '<p class="center">';
    if ($loc_transinfo) {
        global $messages_pot_file_info;
        $messages_pot_file_info = locale_file_po_info($locales_path . 'messages.pot');
        $messages_DB_info = $DB->get_var('SELECT COUNT(iost_ID) FROM T_i18n_original_string');
        echo '<a href="' . $pagenow . '?ctrl=locales&amp;loc_transinfo=0">' . T_('Hide translation info'), '</a><br /><br />';
        $Form->output = false;
        $button_generate_POT_file = $Form->button(array('submit', 'actionArray[generate_pot]', T_('(Re)generate POT file'), 'SaveButton'));
        $button_import_POT_file = $Form->button(array('submit', 'actionArray[import_pot]', T_('(Re)import POT file'), 'SaveButton'));
        $Form->output = true;
        echo sprintf(T_('# strings in .POT file: %s - # strings in DB: %s '), $messages_pot_file_info['all'] . ' ' . $button_generate_POT_file, $messages_DB_info . ' ' . $button_import_POT_file) . '<br />';
        if ($current_User->check_perm('options', 'edit') && !$allow_po_extraction) {
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
/**
 * @var GenericCategory
 */
global $edited_GenericCategory;
/**
 * @var GenericCategoryCache
 */
global $GenericCategoryCache;
global $action, $subset_ID, $edited_name_maxlen;
// Determine if we are creating or updating...
$creating = is_create_action($action);
$Form = new Form(NULL, 'form');
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', $creating ? T_('New category') : T_('Category'));
$Form->add_crumb('element');
$Form->hidden('action', $creating ? 'create' : 'update');
$Form->hidden('ctrl', $ctrl);
$Form->hiddens_by_key(get_memorized('action, ctrl'));
$Form->begin_fieldset(T_('Properties'));
$Form->select_input_options($edited_GenericCategory->dbprefix . 'parent_ID', $GenericCategoryCache->recurse_select($edited_GenericCategory->parent_ID, $subset_ID, true), T_('Parent'));
$Form->text_input($edited_GenericCategory->dbprefix . 'name', $edited_GenericCategory->name, $edited_name_maxlen, T_('name'), '', array('required' => true));
$Form->end_fieldset();
if ($creating) {
    $Form->end_form(array(array('submit', 'submit', T_('Record'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
} else {
    $Form->hidden($edited_GenericCategory->dbIDname, $edited_GenericCategory->ID);
    $Form->end_form(array(array('submit', 'submit', T_('Update'), 'SaveButton'), array('reset', '', T_('Reset'), 'ResetButton')));
}