Do setup default value handling in the controller not the template
This commit is contained in:
parent
bca725dc32
commit
12a900de25
|
@ -33,11 +33,21 @@ class Controller {
|
|||
}
|
||||
|
||||
public function display($post) {
|
||||
$defaults = array(
|
||||
'adminlogin' => '',
|
||||
'adminpass' => '',
|
||||
'dbuser' => '',
|
||||
'dbpass' => '',
|
||||
'dbname' => '',
|
||||
'dbtablespace' => '',
|
||||
'dbhost' => '',
|
||||
);
|
||||
$parameters = array_merge($defaults, $post);
|
||||
|
||||
\OC_Util::addScript( '3rdparty', 'strengthify/jquery.strengthify' );
|
||||
\OC_Util::addStyle( '3rdparty', 'strengthify/strengthify' );
|
||||
\OC_Util::addScript('setup');
|
||||
\OC_Template::printGuestPage('', 'installation', $post);
|
||||
\OC_Template::printGuestPage('', 'installation', $parameters);
|
||||
}
|
||||
|
||||
public function finishSetup() {
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
<legend><?php print_unescaped($l->t( 'Create an <strong>admin account</strong>' )); ?></legend>
|
||||
<p class="infield grouptop">
|
||||
<input type="text" name="adminlogin" id="adminlogin" placeholder=""
|
||||
value="<?php p(OC_Helper::init_var('adminlogin')); ?>" autocomplete="off" autofocus required />
|
||||
value="<?php p($_['adminlogin']); ?>" autocomplete="off" autofocus required />
|
||||
<label for="adminlogin" class="infield"><?php p($l->t( 'Username' )); ?></label>
|
||||
<img class="svg" src="<?php p(image_path('', 'actions/user.svg')); ?>" alt="" />
|
||||
</p>
|
||||
<p class="infield groupbottom">
|
||||
<input type="password" name="adminpass" data-typetoggle="#show" id="adminpass" placeholder=""
|
||||
value="<?php p(OC_Helper::init_var('adminpass')); ?>" required />
|
||||
value="<?php p($_['adminpass']); ?>" required />
|
||||
<label for="adminpass" class="infield"><?php p($l->t( 'Password' )); ?></label>
|
||||
<img class="svg" id="adminpass-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt="" />
|
||||
<input type="checkbox" id="show" name="show" />
|
||||
|
@ -75,7 +75,7 @@
|
|||
<label for="directory"><?php p($l->t( 'Data folder' )); ?></label>
|
||||
<input type="text" name="directory" id="directory"
|
||||
placeholder="<?php p(OC::$SERVERROOT."/data"); ?>"
|
||||
value="<?php p(OC_Helper::init_var('directory', $_['directory'])); ?>" />
|
||||
value="<?php p($_['directory']); ?>" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
|
@ -149,11 +149,11 @@
|
|||
<p class="infield grouptop">
|
||||
<label for="dbuser" class="infield"><?php p($l->t( 'Database user' )); ?></label>
|
||||
<input type="text" name="dbuser" id="dbuser" placeholder=""
|
||||
value="<?php p(OC_Helper::init_var('dbuser')); ?>" autocomplete="off" />
|
||||
value="<?php p($_['dbuser']); ?>" autocomplete="off" />
|
||||
</p>
|
||||
<p class="infield groupmiddle">
|
||||
<input type="password" name="dbpass" id="dbpass" placeholder="" data-typetoggle="#dbpassword"
|
||||
value="<?php p(OC_Helper::init_var('dbpass')); ?>" />
|
||||
value="<?php p($_['dbpass']); ?>" />
|
||||
<label for="dbpass" class="infield"><?php p($l->t( 'Database password' )); ?></label>
|
||||
<input type="checkbox" id="dbpassword" name="dbpassword" />
|
||||
<label for="dbpassword"></label>
|
||||
|
@ -161,7 +161,7 @@
|
|||
<p class="infield groupmiddle">
|
||||
<label for="dbname" class="infield"><?php p($l->t( 'Database name' )); ?></label>
|
||||
<input type="text" name="dbname" id="dbname" placeholder=""
|
||||
value="<?php p(OC_Helper::init_var('dbname')); ?>"
|
||||
value="<?php p($_['dbname']); ?>"
|
||||
autocomplete="off" pattern="[0-9a-zA-Z$_-]+" />
|
||||
</p>
|
||||
<?php if($_['hasOracle']): ?>
|
||||
|
@ -169,14 +169,14 @@
|
|||
<p class="infield groupmiddle">
|
||||
<label for="dbtablespace" class="infield"><?php p($l->t( 'Database tablespace' )); ?></label>
|
||||
<input type="text" name="dbtablespace" id="dbtablespace" placeholder=""
|
||||
value="<?php p(OC_Helper::init_var('dbtablespace')); ?>" autocomplete="off" />
|
||||
value="<?php p($_['dbtablespace']); ?>" autocomplete="off" />
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<p class="infield groupbottom">
|
||||
<label for="dbhost" class="infield"><?php p($l->t( 'Database host' )); ?></label>
|
||||
<input type="text" name="dbhost" id="dbhost" placeholder=""
|
||||
value="<?php p(OC_Helper::init_var('dbhost')); ?>" />
|
||||
value="<?php p($_['dbhost']); ?>" />
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
|
Loading…
Reference in New Issue