function index(&$Page, &$Contents, $fields) { global $warnings; global $notices; global $languages; $Form = new XMLElement('form'); $Form->setAttribute('action', kINSTALL_FILENAME . ($_GET['lang'] ? '?lang=' . $_GET['lang'] : '')); $Form->setAttribute('method', 'post'); /** * * START ENVIRONMENT SETTINGS * **/ $Environment = new XMLElement('fieldset'); $Environment->appendChild(new XMLElement('legend', __('Environment Settings'))); $Environment->appendChild(new XMLElement('p', __('Symphony is ready to be installed at the following location.'))); $class = NULL; if (defined('kENVIRONMENT_WARNING') && kENVIRONMENT_WARNING == true) { $class = 'warning'; } $Environment->appendChild(Widget::label(__('Root Path'), Widget::input('fields[docroot]', $fields['docroot']), $class)); if (defined('ERROR') && defined('kENVIRONMENT_WARNING')) { $Environment->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $Form->appendChild($Environment); /** END ENVIRONMENT SETTINGS **/ /** * * START LOCALE SETTINGS * **/ $Environment = new XMLElement('fieldset'); $Environment->appendChild(new XMLElement('legend', __('Website Preferences'))); // $Environment->appendChild(new XMLElement('p', '.')); $Environment->appendChild(Widget::label(__('Name'), Widget::input('fields[general][sitename]', $fields['general']['sitename']))); $Fieldset = new XMLElement('fieldset'); $Fieldset->appendChild(new XMLElement('legend', __('Date and Time'))); $Fieldset->appendChild(new XMLElement('p', __('Customise how Date and Time values are displayed throughout the Administration interface.'))); $options = array(); $groups = array(); $system_tz = isset($fields['region']['timezone']) ? $fields['region']['timezone'] : date_default_timezone_get(); foreach (timezone_identifiers_list() as $tz) { if (preg_match('/\\//', $tz)) { $parts = preg_split('/\\//', $tz, 2, PREG_SPLIT_NO_EMPTY); $groups[$parts[0]][] = $parts[1]; } else { $groups[$tz] = $tz; } } foreach ($groups as $key => $val) { if (is_array($val)) { $tmp = array('label' => $key, 'options' => array()); foreach ($val as $zone) { $tmp['options'][] = array("{$key}/{$zone}", "{$key}/{$zone}" == $system_tz, str_replace('_', ' ', $zone)); } $options[] = $tmp; } else { $options[] = array($key, $key == $system_tz, str_replace('_', ' ', $key)); } } $Fieldset->appendChild(Widget::label(__('Region'), Widget::Select('fields[region][timezone]', $options))); //$Div->appendChild(Widget::label('Date Format', Widget::input('fields[general][sitename]', $fields['general']['sitename']))); //$Div->appendChild(Widget::label('Time Format', Widget::input('fields[general][sitename]', $fields['general']['sitename']))); $dateformat = $fields['region']['date_format']; $label = Widget::Label(__('Date Format')); $dateFormats = array(array('Y/m/d', $dateformat == 'Y/m/d', DateTimeObj::get('Y/m/d')), array('m/d/Y', $dateformat == 'm/d/Y', DateTimeObj::get('m/d/Y')), array('m/d/y', $dateformat == 'm/d/y', DateTimeObj::get('m/d/y')), array('d F Y', $dateformat == 'd F Y', DateTimeObj::get('d F Y'))); $label->appendChild(Widget::Select('fields[region][date_format]', $dateFormats)); $Fieldset->appendChild($label); $timeformat = $fields['region']['time_format']; $label = Widget::Label(__('Time Format')); //$label->setAttribute('title', __('Local') . (date('I') == 1 ? ' daylight savings' : '') . ' time for ' . date_default_timezone_get()); //if(date('I') == 1) $label->appendChild(new XMLElement('i', __('Daylight savings time'))); $timeformats = array(array('H:i:s', $timeformat == 'H:i:s', DateTimeObj::get('H:i:s')), array('H:i', $timeformat == 'H:i', DateTimeObj::get('H:i')), array('g:i:s a', $timeformat == 'g:i:s a', DateTimeObj::get('g:i:s a')), array('g:i a', $timeformat == 'g:i a', DateTimeObj::get('g:i a'))); $label->appendChild(Widget::Select('fields[region][time_format]', $timeformats)); $Fieldset->appendChild($label); $Environment->appendChild($Fieldset); $Form->appendChild($Environment); /** END LOCALE SETTINGS **/ /** * * START DATABASE SETTINGS * **/ $Database = new XMLElement('fieldset'); $Database->appendChild(new XMLElement('legend', __('Database Connection'))); $Database->appendChild(new XMLElement('p', __('Please provide Symphony with access to a database.'))); $class = NULL; if (defined('kDATABASE_VERSION_WARNING') && kDATABASE_VERSION_WARNING == true) { $class = ' warning'; } ## fields[database][name] $label = Widget::label(__('Database'), Widget::input('fields[database][name]', $fields['database']['name']), $class); $Database->appendChild($label); if (defined('ERROR') && defined('kDATABASE_VERSION_WARNING')) { $Database->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $class = NULL; if (defined('kDATABASE_CONNECTION_WARNING') && kDATABASE_CONNECTION_WARNING == true) { $class = ' warning'; } $Div = new XMLElement('div'); $Div->setAttribute('class', 'group' . $class); ## fields[database][username] $Div->appendChild(Widget::label(__('Username'), Widget::input('fields[database][username]', $fields['database']['username']))); ## fields[database][password] $Div->appendChild(Widget::label(__('Password'), Widget::input('fields[database][password]', $fields['database']['password'], 'password'))); $Database->appendChild($Div); if (defined('ERROR') && defined('kDATABASE_CONNECTION_WARNING')) { $Database->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $Fieldset = new XMLElement('fieldset'); $Fieldset->appendChild(new XMLElement('legend', __('Advanced Configuration'))); $Fieldset->appendChild(new XMLElement('p', __('Leave these fields unless you are sure they need to be changed.'))); $Div = new XMLElement('div'); $Div->setAttribute('class', 'group'); ## fields[database][host] $Div->appendChild(Widget::label(__('Host'), Widget::input('fields[database][host]', $fields['database']['host']))); ## fields[database][port] $Div->appendChild(Widget::label(__('Port'), Widget::input('fields[database][port]', $fields['database']['port']))); $Fieldset->appendChild($Div); $class = NULL; if (defined('kDATABASE_PREFIX_WARNING') && kDATABASE_PREFIX_WARNING == true) { $class = 'warning'; } ## fields[database][prefix] $Fieldset->appendChild(Widget::label(__('Table Prefix'), Widget::input('fields[database][prefix]', $fields['database']['prefix']), $class)); if (defined('ERROR') && defined('kDATABASE_PREFIX_WARNING')) { $Fieldset->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $Page->setTemplateVar('TABLE-PREFIX', $fields['database']['prefix']); ## fields[database][high-compatibility] $Fieldset->appendChild(Widget::label(__('Use compatibility mode'), Widget::input('fields[database][high-compatibility]', 'yes', 'checkbox'), 'option')); $Fieldset->appendChild(new XMLElement('p', __('Symphony normally specifies UTF-8 character encoding for database entries. With compatibility mode enabled, Symphony will instead use the default character encoding of your database.'))); $Database->appendChild($Fieldset); $Form->appendChild($Database); /** END DATABASE SETTINGS **/ /** * * START PERMISSION SETTINGS * **/ $Permissions = new XMLElement('fieldset'); $Permissions->appendChild(new XMLElement('legend', __('Permission Settings'))); $Permissions->appendChild(new XMLElement('p', __('Symphony needs permission to read and write both files and directories.'))); $Div = new XMLElement('div'); $Div->setAttribute('class', 'group'); $Div->appendChild(Widget::label(__('Files'), Widget::input('fields[permission][file]', $fields['permission']['file']))); $Div->appendChild(Widget::label(__('Directories'), Widget::input('fields[permission][directory]', $fields['permission']['directory']))); $Permissions->appendChild($Div); $Form->appendChild($Permissions); /** END PERMISSION SETTINGS **/ /** * * START USER SETTINGS * **/ $User = new XMLElement('fieldset'); $User->appendChild(new XMLElement('legend', __('User Information'))); $User->appendChild(new XMLElement('p', __('Once installed, you will be able to login to the Symphony admin with these user details.'))); $class = NULL; if (defined('kUSER_USERNAME_WARNING') && kUSER_PASSWORD_WARNING == true) { $class = 'warning'; } ## fields[user][username] $User->appendChild(Widget::label(__('Username'), Widget::input('fields[user][username]', $fields['user']['username']), $class)); if (defined('ERROR') && defined('kUSER_USERNAME_WARNING')) { $User->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $class = NULL; if (defined('kUSER_PASSWORD_WARNING') && kUSER_PASSWORD_WARNING == true) { $class = ' warning'; } $Div = new XMLElement('div'); $Div->setAttribute('class', 'group' . $class); ## fields[user][password] $Div->appendChild(Widget::label(__('Password'), Widget::input('fields[user][password]', $fields['user']['password'], 'password'))); ## fields[user][confirm-password] $Div->appendChild(Widget::label(__('Confirm Password'), Widget::input('fields[user][confirm-password]', $fields['user']['confirm-password'], 'password'))); $User->appendChild($Div); if (defined('ERROR') && defined('kUSER_PASSWORD_WARNING')) { $User->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $Fieldset = new XMLElement('fieldset'); $Fieldset->appendChild(new XMLElement('legend', __('Personal Information'))); $Fieldset->appendChild(new XMLElement('p', __('Please add the following personal details for this user.'))); $class = NULL; if (defined('kUSER_NAME_WARNING') && kUSER_EMAIL_WARNING == true) { $class = ' warning'; } $Div = new XMLElement('div'); $Div->setAttribute('class', 'group' . $class); ## fields[database][host] $Div->appendChild(Widget::label(__('First Name'), Widget::input('fields[user][firstname]', $fields['user']['firstname']))); ## fields[database][port] $Div->appendChild(Widget::label(__('Last Name'), Widget::input('fields[user][lastname]', $fields['user']['lastname']))); $Fieldset->appendChild($Div); if (defined('ERROR') && defined('kUSER_NAME_WARNING')) { $Fieldset->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $class = NULL; if (defined('kUSER_EMAIL_WARNING') && kUSER_EMAIL_WARNING == true) { $class = 'warning'; } ## fields[user][email] $Fieldset->appendChild(Widget::label(__('Email Address'), Widget::input('fields[user][email]', $fields['user']['email']), $class)); if (defined('ERROR') && defined('kUSER_EMAIL_WARNING')) { $Fieldset->appendChild(new XMLElement('p', $warnings[ERROR], array('class' => 'warning'))); } $User->appendChild($Fieldset); $Form->appendChild($User); /** END USER SETTINGS **/ /** * * START FORM SUBMIT AREA * **/ $Form->appendChild(new XMLElement('h2', __('Install Symphony'))); $Form->appendChild(new XMLElement('p', __('Make sure that you delete <code>' . kINSTALL_FILENAME . '</code> file after Symphony has installed successfully.'))); $Submit = new XMLElement('div'); $Submit->setAttribute('class', 'submit'); ### submit $Submit->appendChild(Widget::input('submit', __('Install Symphony'), 'submit')); ### action[install] $Submit->appendChild(Widget::input('action[install]', 'true', 'hidden')); $Form->appendChild($Submit); $Contents->appendChild($Form); /** END FORM SUBMIT AREA **/ $Page->setTemplateVar('title', __('Install Symphony')); $Page->setTemplateVar('tagline', __('Version %s', array(kVERSION))); $Page->setTemplateVar('languages', $languages); }
protected function viewConfiguration() { /* ----------------------------------------------- * Populating fields array * ----------------------------------------------- */ $fields = isset($_POST['fields']) ? $_POST['fields'] : $this->_params['default-config']; /* ----------------------------------------------- * Welcome * ----------------------------------------------- */ $div = new XMLElement('div'); $div->appendChild(new XMLElement('h2', __('Find something sturdy to hold on to because things are about to get awesome.'))); $div->appendChild(new XMLElement('p', __('Think of this as a pre-game warm up. You know you\'re going to kick-ass, so you\'re savouring every moment before the show. Welcome to the Symphony install page.'))); $this->Form->appendChild($div); if (!empty($this->_params['errors'])) { $this->Form->appendChild(Widget::Error(new XMLElement('p'), __('Oops, a minor hurdle on your path to glory! There appears to be something wrong with the details entered below.'))); } /* ----------------------------------------------- * Environment settings * ----------------------------------------------- */ $fieldset = new XMLElement('fieldset'); $div = new XMLElement('div'); $this->__appendError(array('no-write-permission-root', 'no-write-permission-workspace'), $div); if ($div->getNumberOfChildren() > 0) { $fieldset->appendChild($div); $this->Form->appendChild($fieldset); } /* ----------------------------------------------- * Website & Locale settings * ----------------------------------------------- */ $Environment = new XMLElement('fieldset'); $Environment->appendChild(new XMLElement('legend', __('Website Preferences'))); $label = Widget::label(__('Name'), Widget::Input('fields[general][sitename]', $fields['general']['sitename'])); $this->__appendError(array('general-no-sitename'), $label); $Environment->appendChild($label); $Fieldset = new XMLElement('fieldset', null, array('class' => 'frame')); $Fieldset->appendChild(new XMLElement('legend', __('Date and Time'))); $Fieldset->appendChild(new XMLElement('p', __('Customise how Date and Time values are displayed throughout the Administration interface.'))); // Timezones $options = DateTimeObj::getTimezonesSelectOptions(isset($fields['region']['timezone']) && !empty($fields['region']['timezone']) ? $fields['region']['timezone'] : date_default_timezone_get()); $Fieldset->appendChild(Widget::label(__('Region'), Widget::Select('fields[region][timezone]', $options))); // Date formats $options = DateTimeObj::getDateFormatsSelectOptions($fields['region']['date_format']); $Fieldset->appendChild(Widget::Label(__('Date Format'), Widget::Select('fields[region][date_format]', $options))); // Time formats $options = DateTimeObj::getTimeFormatsSelectOptions($fields['region']['time_format']); $Fieldset->appendChild(Widget::Label(__('Time Format'), Widget::Select('fields[region][time_format]', $options))); $Environment->appendChild($Fieldset); $this->Form->appendChild($Environment); /* ----------------------------------------------- * Database settings * ----------------------------------------------- */ $Database = new XMLElement('fieldset'); $Database->appendChild(new XMLElement('legend', __('Database Connection'))); $Database->appendChild(new XMLElement('p', __('Please provide Symphony with access to a database.'))); // Database name $label = Widget::label(__('Database'), Widget::Input('fields[database][db]', $fields['database']['db']), $class); $this->__appendError(array('database-incorrect-version', 'unknown-database'), $label); $Database->appendChild($label); // Database credentials $Div = new XMLElement('div', null, array('class' => 'two columns')); $Div->appendChild(Widget::label(__('Username'), Widget::Input('fields[database][user]', $fields['database']['user']), 'column')); $Div->appendChild(Widget::label(__('Password'), Widget::Input('fields[database][password]', $fields['database']['password'], 'password'), 'column')); $this->__appendError(array('database-invalid-credentials'), $Div); $Database->appendChild($Div); // Advanced configuration $Fieldset = new XMLElement('fieldset', null, array('class' => 'frame')); $Fieldset->appendChild(new XMLElement('legend', __('Advanced Configuration'))); $Fieldset->appendChild(new XMLElement('p', __('Leave these fields unless you are sure they need to be changed.'))); // Advanced configuration: Host, Port $Div = new XMLElement('div', null, array('class' => 'two columns')); $Div->appendChild(Widget::label(__('Host'), Widget::Input('fields[database][host]', $fields['database']['host']), 'column')); $Div->appendChild(Widget::label(__('Port'), Widget::Input('fields[database][port]', $fields['database']['port']), 'column')); $this->__appendError(array('no-database-connection'), $Div); $Fieldset->appendChild($Div); // Advanced configuration: Table Prefix $label = Widget::label(__('Table Prefix'), Widget::Input('fields[database][tbl_prefix]', $fields['database']['tbl_prefix'])); $this->__appendError(array('database-table-clash'), $label); $Fieldset->appendChild($label); $Database->appendChild($Fieldset); $this->Form->appendChild($Database); /* ----------------------------------------------- * Permission settings * ----------------------------------------------- */ $Permissions = new XMLElement('fieldset'); $Permissions->appendChild(new XMLElement('legend', __('Permission Settings'))); $Permissions->appendChild(new XMLElement('p', __('Symphony needs permission to read and write both files and directories.'))); $Div = new XMLElement('div', null, array('class' => 'two columns')); $Div->appendChild(Widget::label(__('Files'), Widget::Input('fields[file][write_mode]', $fields['file']['write_mode']), 'column')); $Div->appendChild(Widget::label(__('Directories'), Widget::Input('fields[directory][write_mode]', $fields['directory']['write_mode']), 'column')); $Permissions->appendChild($Div); $this->Form->appendChild($Permissions); /* ----------------------------------------------- * User settings * ----------------------------------------------- */ $User = new XMLElement('fieldset'); $User->appendChild(new XMLElement('legend', __('User Information'))); $User->appendChild(new XMLElement('p', __('Once installed, you will be able to login to the Symphony admin with these user details.'))); // Username $label = Widget::label(__('Username'), Widget::Input('fields[user][username]', $fields['user']['username'])); $this->__appendError(array('user-no-username'), $label); $User->appendChild($label); // Password $Div = new XMLElement('div', null, array('class' => 'two columns')); $Div->appendChild(Widget::label(__('Password'), Widget::Input('fields[user][password]', $fields['user']['password'], 'password'), 'column')); $Div->appendChild(Widget::label(__('Confirm Password'), Widget::Input('fields[user][confirm-password]', $fields['user']['confirm-password'], 'password'), 'column')); $this->__appendError(array('user-no-password', 'user-password-mismatch'), $Div); $User->appendChild($Div); // Personal information $Fieldset = new XMLElement('fieldset', null, array('class' => 'frame')); $Fieldset->appendChild(new XMLElement('legend', __('Personal Information'))); $Fieldset->appendChild(new XMLElement('p', __('Please add the following personal details for this user.'))); // Personal information: First Name, Last Name $Div = new XMLElement('div', null, array('class' => 'two columns')); $Div->appendChild(Widget::label(__('First Name'), Widget::Input('fields[user][firstname]', $fields['user']['firstname']), 'column')); $Div->appendChild(Widget::label(__('Last Name'), Widget::Input('fields[user][lastname]', $fields['user']['lastname']), 'column')); $this->__appendError(array('user-no-name'), $Div); $Fieldset->appendChild($Div); // Personal information: Email Address $label = Widget::label(__('Email Address'), Widget::Input('fields[user][email]', $fields['user']['email'])); $this->__appendError(array('user-invalid-email'), $label); $Fieldset->appendChild($label); $User->appendChild($Fieldset); $this->Form->appendChild($User); /* ----------------------------------------------- * Submit area * ----------------------------------------------- */ $this->Form->appendChild(new XMLElement('h2', __('Install Symphony'))); $this->Form->appendChild(new XMLElement('p', __('The installation process goes by really quickly. Make sure to take a deep breath before you press that sweet button.', array('<code>' . basename(INSTALL_URL) . '</code>')))); $Submit = new XMLElement('div', null, array('class' => 'submit')); $Submit->appendChild(Widget::Input('lang', Lang::get(), 'hidden')); $Submit->appendChild(Widget::Input('action[install]', __('Install Symphony'), 'submit')); $this->Form->appendChild($Submit); }
function index(&$Page, &$Contents, $fields) { global $warnings; global $notices; $Form = new XMLElement('form'); $Form->setAttribute('action', 'install.php'); $Form->setAttribute('method', 'post'); /** * * START ENVIRONMENT SETTINGS * **/ /* <fieldset> <legend>Environment Settings</legend> <p>Symphony is ready to be installed at the following location.</p> <label class="warning">Root Path <input name="" value="/users/21degre/public_html/" /></label> <p class="warning">No <code>/symphony</code> directory was found at this location. Please upload the contents of Symphony's install package here.</p> <p class="note">An existing <code>/workspace</code> directory was found at this location. Symphony will use this workspace.</p> <p class="warning">Symphony does not have write permission to the existing <code>/workspace</code> directory. Please modify permission settings on this directory and its contents to allow this, such as with a recursive <code>chmod -R</code> command.</p> <p class="warning">Symphony does not have write permission to the <code>/manifest</code> directory. Please modify permission settings on this directory and its contents to allow this, such as with a recursive <code>chmod -R</code> command.</p> </fieldset> */ $Environment = new XMLElement('fieldset'); $Environment->addChild(new XMLElement('legend', 'Environment Settings')); $Environment->addChild(new XMLElement('p', 'Symphony is ready to be installed at the following location.')); $class = NULL; if (defined('kENVIRONMENT_WARNING') && kENVIRONMENT_WARNING == true) { $class = 'warning'; } $Environment->addChild(Widget::label('Root Path', Widget::input('fields[docroot]', $fields['docroot']), $class)); if (defined('ERROR') && defined('kENVIRONMENT_WARNING')) { $Environment->addChild(Widget::warning($warnings[ERROR])); } ## CHECK FOR AN EXISTING WORKSPACE FOLDER if (!defined('ERROR') && @is_file($fields['docroot'] . '/workspace/workspace.conf')) { $Environment->addChild(Widget::note($notices['existing-workspace'])); } $Form->addChild($Environment); /** END ENVIRONMENT SETTINGS **/ /** * * START DATABASE SETTINGS * **/ /* <fieldset> <legend>Database Connection</legend> <p>Please provide Symphony with access to a database.</p> <label class="warning">Database <input name="" /></label> <div class="group warning"> <label>Username <input name="" /></label> <label>Password <input name="" type="password" /></label> </div> <p class="warning">Symphony was unable to connect to the specified database. You may need to modify host or port settings.</p> ... </fieldset> */ $Database = new XMLElement('fieldset'); $Database->addChild(new XMLElement('legend', 'Database Connection')); $Database->addChild(new XMLElement('p', 'Please provide Symphony with access to a database.')); $class = NULL; if (defined('kDATABASE_CONNECTION_WARNING') && kDATABASE_CONNECTION_WARNING == true) { $class = ' warning'; } ## fields[database][name] $Database->addChild(Widget::label('Database', Widget::input('fields[database][name]', $fields['database']['name']))); $Div = new XMLElement('div'); $Div->setAttribute('class', 'group' . $class); ## fields[database][username] $Div->addChild(Widget::label('Username', Widget::input('fields[database][username]', $fields['database']['username']))); ## fields[database][password] $Div->addChild(Widget::label('Password', Widget::input('fields[database][password]', $fields['database']['password'], NULL, 'password'))); $Database->addChild($Div); if (defined('ERROR') && defined('kDATABASE_CONNECTION_WARNING')) { $Database->addChild(Widget::warning($warnings[ERROR])); } /* ... <fieldset> <legend>Advanced Configuration</legend> <p>Leave these fields unless you are sure they need to be changed.</p> <div class="group"> <label>Host <input name="" value="localhost" /></label> <label>Port <input name="" value="3306" /></label> </div> <label class="warning">Table Prefix <input name="" value="sym_" /></label> <p class="warning">The table prefix <code>sym_</code> is already in use. Please choose a different prefix to use with Symphony.</p> <label class="option"><input name="" type="checkbox" /> Use compatibility mode</label> <p>Symphony normally specifies UTF-8 character encoding for database entries. With compatibility mode enabled, Symphony will instead use the default character encoding of your database.</p> </fieldset> */ $Fieldset = new XMLElement('fieldset'); $Fieldset->addChild(new XMLElement('legend', 'Advanced Configuration')); $Fieldset->addChild(new XMLElement('p', 'Leave these fields unless you are sure they need to be changed.')); $Div = new XMLElement('div'); $Div->setAttribute('class', 'group'); ## fields[database][host] $Div->addChild(Widget::label('Host', Widget::input('fields[database][host]', $fields['database']['host']))); ## fields[database][port] $Div->addChild(Widget::label('Port', Widget::input('fields[database][port]', $fields['database']['port']))); $Fieldset->addChild($Div); $class = NULL; if (defined('kDATABASE_PREFIX_WARNING') && kDATABASE_PREFIX_WARNING == true) { $class = 'warning'; } ## fields[database][prefix] $Fieldset->addChild(Widget::label('Table Prefix', Widget::input('fields[database][prefix]', $fields['database']['prefix']), $class)); if (defined('ERROR') && defined('kDATABASE_PREFIX_WARNING')) { $Fieldset->addChild(Widget::warning($warnings[ERROR])); } $Page->setTemplateVar('TABLE-PREFIX', $fields['database']['prefix']); ## fields[database][high-compatibility] $Fieldset->addChild(Widget::label('Use compatibility mode', Widget::input('fields[database][high-compatibility]', 'yes', NULL, 'checkbox'), 'option')); $Fieldset->addChild(new XMLElement('p', 'Symphony normally specifies UTF-8 character encoding for database entries. With compatibility mode enabled, Symphony will instead use the default character encoding of your database.')); $Database->addChild($Fieldset); $Form->addChild($Database); /** END DATABASE SETTINGS **/ /** * * START PERMISSION SETTINGS * **/ /* <fieldset> <legend>Permission Settings</legend> <p>Symphony needs permission to read and write both files and directories.</p> <div class="group"> <label>Files <select name=""> <option value="0777">0777</option> </select> </label> <label>Directories <select name=""> <option value="0777">0777</option> </select> </label> </div> </fieldset> */ $Permissions = new XMLElement('fieldset'); $Permissions->addChild(new XMLElement('legend', 'Permission Settings')); $Permissions->addChild(new XMLElement('p', 'Symphony needs permission to read and write both files and directories.')); $Div = new XMLElement('div'); $Div->setAttribute('class', 'group'); ## fields[permission][file] $Div->addChild(Widget::label('Files', Widget::select('fields[permission][file]', array('0777', '0775', '0755', '0666', '0644', '0444'), $fields['permission']['file']))); ## fields[permission][directory] $Div->addChild(Widget::label('Directories', Widget::select('fields[permission][directory]', array('0777', '0775', '0755', '0666', '0644', '0444'), $fields['permission']['directory']))); $Permissions->addChild($Div); $Form->addChild($Permissions); /** END PERMISSION SETTINGS **/ /** * * START USER SETTINGS * **/ /* <fieldset> <legend>User Information</legend> <p>Once installed, you will be able to login to the Symphony admin with these user details.</p> <label>Username <input name="" /></label> <div class="group warning"> <label>Password <input name="" type="password" /></label> <label>Confirm Password <input name="" type="password" /></label> </div> <p class="warning">The password and confirmation did not match. Please retype your password.</p> ... </fieldset> */ $User = new XMLElement('fieldset'); $User->addChild(new XMLElement('legend', 'User Information')); $User->addChild(new XMLElement('p', 'Once installed, you will be able to login to the Symphony admin with these user details.')); $class = NULL; if (defined('kUSER_USERNAME_WARNING') && kUSER_PASSWORD_WARNING == true) { $class = 'warning'; } ## fields[user][username] $User->addChild(Widget::label('Username', Widget::input('fields[user][username]', $fields['user']['username']), $class)); if (defined('ERROR') && defined('kUSER_USERNAME_WARNING')) { $User->addChild(Widget::warning($warnings[ERROR])); } $class = NULL; if (defined('kUSER_PASSWORD_WARNING') && kUSER_PASSWORD_WARNING == true) { $class = ' warning'; } $Div = new XMLElement('div'); $Div->setAttribute('class', 'group' . $class); ## fields[user][password] $Div->addChild(Widget::label('Password', Widget::input('fields[user][password]', $fields['user']['password'], NULL, 'password'))); ## fields[user][confirm-password] $Div->addChild(Widget::label('Confirm Password', Widget::input('fields[user][confirm-password]', $fields['user']['confirm-password'], NULL, 'password'))); $User->addChild($Div); if (defined('ERROR') && defined('kUSER_PASSWORD_WARNING')) { $User->addChild(Widget::warning($warnings[ERROR])); } /* ... <fieldset> <legend>Personal Information</legend> <p>Please add the following personal details for this user.</p> <div class="group"> <label>First Name <input name="" /></label> <label>Last Name <input name="" /></label> </div> <label class="warning">Email Address <input name="" /></label> <p class="warning">This is not a valid email address. You must provide an email address since you will need it if you forget your password.</p> </fieldset> */ $Fieldset = new XMLElement('fieldset'); $Fieldset->addChild(new XMLElement('legend', 'Personal Information')); $Fieldset->addChild(new XMLElement('p', 'Please add the following personal details for this user.')); $class = NULL; if (defined('kUSER_NAME_WARNING') && kUSER_EMAIL_WARNING == true) { $class = ' warning'; } $Div = new XMLElement('div'); $Div->setAttribute('class', 'group' . $class); ## fields[database][host] $Div->addChild(Widget::label('First Name', Widget::input('fields[user][firstname]', $fields['user']['firstname']))); ## fields[database][port] $Div->addChild(Widget::label('Last Name', Widget::input('fields[user][lastname]', $fields['user']['lastname']))); $Fieldset->addChild($Div); if (defined('ERROR') && defined('kUSER_NAME_WARNING')) { $Fieldset->addChild(Widget::warning($warnings[ERROR])); } $class = NULL; if (defined('kUSER_EMAIL_WARNING') && kUSER_EMAIL_WARNING == true) { $class = 'warning'; } ## fields[user][email] $Fieldset->addChild(Widget::label('Email Address', Widget::input('fields[user][email]', $fields['user']['email']), $class)); if (defined('ERROR') && defined('kUSER_EMAIL_WARNING')) { $Fieldset->addChild(Widget::warning($warnings[ERROR])); } $User->addChild($Fieldset); $Form->addChild($User); /** END USER SETTINGS **/ /** * * START FORM SUBMIT AREA * **/ $Form->addChild(new XMLElement('h2', 'Install Symphony')); $Form->addChild(new XMLElement('p', 'Make sure that you delete the <code>install.php</code> file after Symphony has installed successfully.')); $Submit = new XMLElement('div'); $Submit->setAttribute('class', 'submit'); ### submit $Submit->addChild(Widget::input('submit', 'Install Symphony', NULL, 'submit')); ### action[install] $Submit->addChild(Widget::input('action[install]', 'true', NULL, 'hidden')); $Form->addChild($Submit); $Contents->addChild($Form); /** END FORM SUBMIT AREA **/ $Page->setTemplateVar('title', 'Install Symphony'); $Page->setTemplateVar('tagline', 'Version ' . kVERSION); }