示例#1
0
                $Form->hidden('locale', $default_locale);
                block_open(T_('Database you want to install into'));
                ?>
				<p class="text-muted small"><?php 
                echo T_('b2evolution stores blog posts, comments, user permissions, etc. in a MySQL database. You must create this database prior to installing b2evolution and provide the access parameters to this database below. If you are not familiar with this, you can ask your hosting provider to create the database for you.');
                ?>
</p>
				<?php 
                $Form->text('conf_db_host', $conf_db_host, 16, T_('MySQL Host/Server'), sprintf(T_('Typically looks like "localhost" or "sql-6" or "sql-8.yourhost.net"...')), 120);
                $Form->text('conf_db_name', $conf_db_name, 16, T_('MySQL Database'), sprintf(T_('Name of the MySQL database you have created on the server')), 100);
                $Form->text('conf_db_user', $conf_db_user, 16, T_('MySQL Username'), sprintf(T_('Used by b2evolution to access the MySQL database')), 100);
                $Form->text('conf_db_password', $conf_db_password, 16, T_('MySQL Password'), sprintf(T_('Used by b2evolution to access the MySQL database')), 100);
                // no need to hyde this. nobody installs b2evolution from a public place
                // Too confusing for (most) newbies.	form_text( 'conf_db_tableprefix', $conf_db_tableprefix, 16, T_('MySQL tables prefix'), sprintf( T_('All DB tables will be prefixed with this. You need to change this only if you want to have multiple b2evo installations in the same DB.' ) ), 30 );
                block_close();
                block_open(T_('Additional settings'));
                $Form->text('conf_baseurl', $conf_baseurl, 50, T_('Base URL'), sprintf(T_('This is where b2evo and your blogs reside by default. CHECK THIS CAREFULLY or not much will work. If you want to test b2evolution on your local machine, in order for login cookies to work, you MUST use http://<strong>localhost</strong>/path... Do NOT use your machine\'s name!')), 120);
                $Form->text('conf_admin_email', $conf_admin_email, 50, T_('Your email'), sprintf(T_('This is used to create your admin account. You will receive notifications for comments on your blog, etc.')), 80);
                block_close();
                $Form->end_form(array(array('name' => 'submit', 'value' => T_('Update config file'), 'class' => 'btn-primary btn-lg'), array('type' => 'reset', 'value' => T_('Reset'), 'class' => 'btn-default btn-lg')));
                break;
            }
        }
        // if config was already done, move on to main menu:
    // if config was already done, move on to main menu:
    case 'menu':
        /*
         * -----------------------------------------------------------------------------------
         * Menu (STEP 1)
         * -----------------------------------------------------------------------------------
         */
示例#2
0
        block_open(T_('Log in to edit the config of debug'));
        $Form = new Form($_SERVER['PHP_SELF']);
        $Form->switch_template_parts($booststrap_install_form_params);
        $Form->begin_form('form-horizontal');
        $Form->hidden('action', 'login');
        $Form->text('password', '', 16, T_('Password'), T_('Debug password'), 120, '', 'password');
        $Form->end_form(array(array('name' => 'submit', 'value' => T_('Log in'), 'class' => 'btn-primary btn-lg')));
        block_close();
        break;
    case 'config_form':
        /*
         * -----------------------------------------------------------------------------------
         * Form to change the debug config
         * -----------------------------------------------------------------------------------
         */
        block_open(T_('Debug config'));
        $Form = new Form($_SERVER['PHP_SELF']);
        $Form->switch_template_parts($booststrap_install_form_params);
        $Form->begin_form('form-horizontal');
        $Form->hidden('action', 'update_config');
        $Form->hidden('password', $password);
        $Form->textarea_input('content', $file_overrides_content, 20, T_('Config'), array('cols' => 50, 'note' => 'A few possible settings:<br /><br />
$minimum_comment_interval = 1;<br />
$debug = 1;<br />
$debug_jslog = 1;<br />
$allow_po_extraction = 1;<br />
$test_install_all_features = true;<br />
$db_config[\'debug_dump_rows\'] = 20;<br />
$db_config[\'debug_explain_joins\'] = false;<br />
$display_errors_on_production = false;'));
        $Form->end_form(array(array('name' => 'submit', 'value' => T_('Save Changes!'), 'class' => 'btn-primary btn-lg')));
/**
 * Base config recap
 */
function display_base_config_recap()
{
    global $default_locale, $conf_db_user, $conf_db_password, $conf_db_name, $conf_db_host, $db_config, $tableprefix, $baseurl, $admin_email;
    static $base_config_recap_already_displayed = false;
    if ($base_config_recap_already_displayed) {
        return;
    }
    $base_config_recap_already_displayed = true;
    echo '<br />';
    block_open(T_('Base config recap...'));
    ?>
	<p><?php 
    printf(T_('If you don\'t see correct settings here, STOP before going any further, and <a %s>update your base configuration</a>.'), 'href="index.php?action=start&amp;locale=' . $default_locale . '"');
    ?>
</p>

	<?php 
    if (!isset($conf_db_user)) {
        $conf_db_user = $db_config['user'];
    }
    if (!isset($conf_db_password)) {
        $conf_db_password = $db_config['password'];
    }
    if (!isset($conf_db_name)) {
        $conf_db_name = $db_config['name'];
    }
    if (!isset($conf_db_host)) {
        $conf_db_host = isset($db_config['host']) ? $db_config['host'] : 'localhost';
    }
    echo '<samp>' . T_('MySQL Username') . ': ' . $conf_db_user . '<br />' . T_('MySQL Password') . ': ' . ($conf_db_password != 'demopass' ? T_('(Set, but not shown for security reasons)') : 'demopass') . '<br />' . T_('MySQL Database name') . ': ' . $conf_db_name . '<br />' . T_('MySQL Host/Server') . ': ' . $conf_db_host . '<br />' . T_('MySQL tables prefix') . ': ' . $tableprefix . '<br /><br />' . T_('Base URL') . ': ' . $baseurl . '<br /><br />' . T_('Admin email') . ': ' . $admin_email . '</samp>';
    block_close();
}