Skip to content

Commit

Permalink
Fixed issue #10412: Installer still partially unstyled
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Feb 12, 2016
1 parent 9fc3b63 commit e225aa4
Show file tree
Hide file tree
Showing 7 changed files with 697 additions and 39 deletions.
11 changes: 9 additions & 2 deletions application/controllers/InstallerController.php
Expand Up @@ -759,11 +759,18 @@ private function _check_requirements(&$aData)
* check image HTML template
*
* @param bool $result
* @return string Span with check if $result is true; otherwise a span with warning
*/
function check_HTML_image($result)
{
$aLabelYesNo = array('wrong', 'right');
return sprintf('<img src="%s/installer/images/tick-%s.png" alt="Found" />', Yii::app()->baseUrl, $aLabelYesNo[$result]);
if ($result)
{
return "<span class='fa fa-check text-success' alt='right'></span>";
}
else
{
return "<span class='fa fa-exclamation-triangle text-danger' alt='wrong'></span>";
}
}


Expand Down
2 changes: 2 additions & 0 deletions application/helpers/admin/htmleditor_helper.php
Expand Up @@ -149,6 +149,8 @@ function getEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=null,$q
}
if ( $surveyID && getEmailFormat($surveyID) != 'html' && substr($fieldtype,0,6)==="email-" )// email but survey as text email
{
//echo '<pre>'; var_dump(getEmailFormat($surveyID)); echo '</pre>';
//echo '<pre>'; var_dump('here'); echo '</pre>';die;
return '';
}

Expand Down
38 changes: 20 additions & 18 deletions application/views/installer/dbconfig_view.php
Expand Up @@ -6,50 +6,52 @@
<?php echo CHtml::beginForm($this->createUrl('installer/database'), 'post', array('class' => 'form-horizontal')); ?>
<h2><?php echo $title; ?></h2>
<p><?php echo $descp; ?></p>
<div style="color:red; font-size:12px;">
<?php echo CHtml::errorSummary($model, null, null, array('class' => 'errors')); ?>
</div>
<?php eT("Note: All fields marked with (*) are required."); ?>
<?php if (CHtml::errorSummary($model, null, null, array('class' => 'errors'))): ?>
<div class='alert alert-danger'>
<?php echo CHtml::errorSummary($model, null, null, array('class' => 'errors')); ?>
</div>
<?php endif; ?>
<p><?php eT("Note: All fields marked with (*) are required."); ?></p>
<legend><?php eT("Database configuration"); ?></legend>
<?php
$rows = array();
$rows[] = array(
'label' => CHtml::activeLabelEx($model, 'dbtype', array('class' => 'control-label', 'label' => gT("Database type"))),
'label' => CHtml::activeLabelEx($model, 'dbtype', array('class' => 'control-label col-sm-2', 'label' => gT("Database type"))),
'control' => CHtml::activeDropDownList($model, 'dbtype', $model->supported_db_types, array('required' => 'required', 'class'=>'form-control', 'autofocus' => 'autofocus')),
'description' => gT("The type of your database management system")
);
$rows[] = array(
'label' => CHtml::activeLabelEx($model, 'dblocation', array('class' => 'control-label', 'label' => gT("Database location"))),
'control' => CHtml::activeTextField($model, 'dblocation', array('required' => 'required')),
'label' => CHtml::activeLabelEx($model, 'dblocation', array('class' => 'control-label col-sm-2', 'label' => gT("Database location"))),
'control' => CHtml::activeTextField($model, 'dblocation', array('required' => 'required', 'class' => 'form-control')),
'description' => gT('Set this to the IP/net location of your database server. In most cases "localhost" will work. You can force Unix socket with complete socket path.').' '.gT('If your database is using a custom port attach it using a colon. Example: db.host.com:5431')
);
$rows[] = array(
'label' => CHtml::activeLabelEx($model, 'dbuser', array('class' => 'control-label', 'label' => gT("Database user"))),
'control' => CHtml::activeTextField($model, 'dbuser', array('required' => 'required','autocomplete'=>'off')),
'label' => CHtml::activeLabelEx($model, 'dbuser', array('class' => 'control-label col-sm-2', 'label' => gT("Database user"))),
'control' => CHtml::activeTextField($model, 'dbuser', array('required' => 'required','autocomplete'=>'off', 'class' => 'form-control')),
'description' => gT('Your database server user name. In most cases "root" will work.')
);
$rows[] = array(
'label' => CHtml::activeLabelEx($model, 'dbpwd', array('class' => 'control-label', 'label' => gT("Database password"))),
'control' => CHtml::activePasswordField($model, 'dbpwd',array('autocomplete'=>'off')),
'label' => CHtml::activeLabelEx($model, 'dbpwd', array('class' => 'control-label col-sm-2', 'label' => gT("Database password"))),
'control' => CHtml::activePasswordField($model, 'dbpwd',array('autocomplete'=>'off', 'class' => 'form-control')),
'description' => gT("Your database server password.")
);
$rows[] = array(
'label' => CHtml::activeLabelEx($model, 'dbname', array('class' => 'control-label', 'label' => gT("Database name"))),
'control' => CHtml::activeTextField($model, 'dbname', array('required' => 'required','autocomplete'=>'off')),
'label' => CHtml::activeLabelEx($model, 'dbname', array('class' => 'control-label col-sm-2', 'label' => gT("Database name"))),
'control' => CHtml::activeTextField($model, 'dbname', array('required' => 'required','autocomplete'=>'off', 'class' => 'form-control')),
'description' => gT("If the database does not yet exist it will be created (make sure your database user has the necessary permissions). In contrast, if there are existing LimeSurvey tables in that database they will be upgraded automatically after installation.")
);

$rows[] = array(
'label' => CHtml::activeLabelEx($model, 'dbprefix', array('class' => 'control-label', 'label' => gT("Table prefix"))),
'control' => CHtml::activeTextField($model, 'dbprefix', array('value' => 'lime_','autocomplete'=>'off')),
'label' => CHtml::activeLabelEx($model, 'dbprefix', array('class' => 'control-label col-sm-2', 'label' => gT("Table prefix"))),
'control' => CHtml::activeTextField($model, 'dbprefix', array('value' => 'lime_','autocomplete'=>'off', 'class' => 'form-control')),
'description' => gT('If your database is shared, recommended prefix is "lime_" else you can leave this setting blank.')
);

foreach ($rows as $row)
{
echo CHtml::openTag('div', array('class' => 'control-group'));
echo $row['label'];
echo CHtml::tag('div', array('class' => 'controls'), $row['control'] . CHtml::tag('div', array('class' => 'description-field'), $row['description']));
echo CHtml::openTag('div', array('class' => 'form-group'));
echo $row['label'];
echo CHtml::tag('div', array('class' => 'controls col-sm-8'), $row['control'] . CHtml::tag('p', array('class' => 'help-block'), $row['description']));
echo CHtml::closeTag('div');
}

Expand Down
22 changes: 11 additions & 11 deletions application/views/installer/precheck_view.php
Expand Up @@ -25,7 +25,7 @@ function dirReport($dir, $write)

if ($error)
{
return '<font color="red">'.$a.' &amp; '.$b.'</font>';
return '<h3 class="label label-danger" style="font-size: 100%;">'.$a.' &amp; '.$b.'</h3>';
}
else
{
Expand All @@ -43,7 +43,7 @@ function dirReport($dir, $write)
<p><?php echo $descp; ?></p>
<legend><?php eT("Minimum requirements"); ?></legend>

<table class='table-striped'>
<table class='table-striped table'>
<thead>
<tr>
<th>&nbsp;</th>
Expand Down Expand Up @@ -73,12 +73,12 @@ function dirReport($dir, $write)
</tr>
<tr>
<td><?php eT("PHP mbstring library"); ?></td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Yes" /></td>
<td><span class='fa fa-check text-success' alt="Yes"></span></td>
<td><?php echo $mbstringPresent; ?></td>
</tr>
<tr>
<td><?php eT("PHP/PECL JSON library"); ?></td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Yes" /></td>
<td><span class='fa fa-check text-success' alt="Yes"></span></td>
<td><?php echo $bJSONPresent; ?></td>
</tr>
<tr>
Expand All @@ -98,14 +98,14 @@ function dirReport($dir, $write)
</tr>
<tr>
<td><?php eT("Session writable"); ?></td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Check" /></td>
<td><span class='fa fa-check text-success' alt="Yes"></span></td>
<td><?php echo $sessionWritableImg; if (!$sessionWritable) echo '<br/>session.save_path: ' . session_save_path(); ?></td>
</tr>
</tbody>
</table>
<br/>
<legend><?php eT('Optional modules'); ?></legend>
<table class='table-striped'>
<table class='table-striped table'>
<thead>
<tr>
<th>&nbsp;</th>
Expand All @@ -116,27 +116,27 @@ function dirReport($dir, $write)
<tbody>
<tr>
<td>PHP GD library</td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Check" /></td>
<td><span class='fa fa-check text-success' alt="Check"></span></td>
<td><?php echo $gdPresent ; ?></td>
</tr>
<tr>
<td>PHP LDAP library</td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Check" /></td>
<td><span class='fa fa-check text-success' alt="Check"></span></td>
<td><?php echo $ldapPresent ; ?></td>
</tr>
<tr>
<td>PHP zip library</td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Check" /></td>
<td><span class='fa fa-check text-success' alt="Check"></span></td>
<td><?php echo $zipPresent ; ?></td>
</tr>
<tr>
<td>PHP zlib library</td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Check" /></td>
<td><span class='fa fa-check text-success' alt="Check"></span></td>
<td><?php echo $zlibPresent ; ?></td>
</tr>
<tr>
<td>PHP imap library</td>
<td><img src="<?php echo Yii::app()->baseUrl; ?>/installer/images/tick-right.png" alt="Check" /></td>
<td><span class='fa fa-check text-success' alt="Check"></span></td>
<td><?php echo $bIMAPPresent ; ?></td>
</tr>
</tbody>
Expand Down
2 changes: 2 additions & 0 deletions application/views/layouts/installer.php
Expand Up @@ -13,6 +13,8 @@
App()->bootstrap->register();
App()->getClientScript()->registerCssFile(App()->baseUrl . '/styles/Sea_Green/css/lime-admin.css');
App()->getClientScript()->registerCssFile(App()->baseUrl . '/installer/css/main.css');
App()->getClientScript()->registerCssFile(App()->baseUrl . '/installer/css/fonts.css');
App()->getClientScript()->registerCssFile(App()->baseUrl . '/third_party/font-awesome/css/font-awesome.min.css');

$script = "$(function() {
$('.on').animate({
Expand Down

0 comments on commit e225aa4

Please sign in to comment.