Skip to content

Commit

Permalink
Major installer cleanup. Mostly cosmetic, but added some sanity check…
Browse files Browse the repository at this point in the history
…s, and some upgrade versions.
  • Loading branch information
illiphilli committed Apr 6, 2011
1 parent efd7a24 commit 9c34826
Show file tree
Hide file tree
Showing 17 changed files with 337 additions and 330 deletions.
Binary file added install/images/hdrep.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added install/images/info.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added install/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions install/include/sanity.php
Expand Up @@ -109,14 +109,22 @@ function sanity_checkDirectory($dir,$flag) {
function sanity_checkFiles() {
$status = array(
'conf/config.php'=>sanity_checkFile(BASE.'conf/config.php',1,SANITY_CREATEFILE),
'conf/profiles/'=>sanity_checkFile(BASE.'conf/profiles',0,SANITY_READWRITE),
'overrides.php'=>sanity_checkFile(BASE.'overrides.php',1,SANITY_READWRITE),
'install/'=>sanity_checkFile(BASE.'install',0,SANITY_READWRITE),
'modules/'=>sanity_checkFile(BASE.'modules',0,SANITY_READONLY),
'extensionuploads/'=>sanity_checkFile(BASE.'extensionuploads',0,SANITY_READWRITE),
'files/'=>sanity_checkDirectory('files',SANITY_READWRITE),
'framework/modules/'=>sanity_checkDirectory('framework/modules',SANITY_READWRITE),
//'framework/datatypes/'=>sanity_checkDirectory('framework/datatypes',SANITY_READWRITE),
//'conf/profiles/'=>sanity_checkFile(BASE.'conf/profiles',0,SANITY_READWRITE),
//'overrides.php'=>sanity_checkFile(BASE.'overrides.php',1,SANITY_READWRITE),
'install/'=>sanity_checkFile(BASE.'install',0,SANITY_READWRITE),
'modules/'=>sanity_checkFile(BASE.'modules',0,SANITY_READONLY),
'tmp/'=>sanity_checkDirectory('tmp',SANITY_READWRITE),
'tmp/views_c'=>sanity_checkDirectory('tmp/views_c',SANITY_READWRITE)
'tmp/views_c'=>sanity_checkDirectory('tmp/views_c',SANITY_READWRITE),
'tmp/cache'=>sanity_checkDirectory('tmp/cache',SANITY_READWRITE),
'tmp/minify'=>sanity_checkDirectory('tmp/minify',SANITY_READWRITE),
'tmp/pods'=>sanity_checkDirectory('tmp/pods',SANITY_READWRITE),
'tmp/rsscache'=>sanity_checkDirectory('tmp/rsscache',SANITY_READWRITE),
'tmp/mail'=>sanity_checkDirectory('tmp/mail',SANITY_READWRITE),
'tmp/img_cache'=>sanity_checkDirectory('tmp/img_cache',SANITY_READWRITE)
);

return $status;
Expand Down
90 changes: 41 additions & 49 deletions install/index.php
Expand Up @@ -88,9 +88,13 @@
case 'upgrade':
$page_image = 'system';
$page_text = $i18n['upgrade'];
break;
case 'final':

break;
default:
$page_image = '';
$page_image = 'welcome';
$page_text = $i18n['guide'];
break;
}

Expand All @@ -101,62 +105,50 @@
<head>
<title><?php echo $i18n['page_title']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo LANG_CHARSET; ?>" />
<link rel="stylesheet" href="<?php echo YUI3_PATH; ?>cssreset/reset.css" />
<link rel="stylesheet" href="<?php echo YUI3_PATH; ?>cssbase/base.css" />
<link rel="stylesheet" href="<?php echo YUI3_PATH; ?>cssfonts/fonts.css" />
<link rel="stylesheet" href="<?php echo PATH_RELATIVE; ?>framework/core/assets/css/forms.css" />
<link rel="stylesheet" href="<?php echo PATH_RELATIVE; ?>framework/core/assets/css/button.css" />
<link rel="stylesheet" href="<?php echo PATH_RELATIVE; ?>framework/core/assets/css/tables.css" />
<link rel="stylesheet" href="style.css" />
<script type="text/javascript">


<script type="text/javascript" src="<?php echo YUI3_PATH; ?>/yui/yui-min.js"></script>

<script type="text/javascript">
function pop(page) {
url = "popup.php?page="+page;
window.open(url,"pop","height=400,width=600,title=no,titlebar=no,scrollbars=yes");
return false;
var url = "popup.php?page="+page;
window.open(url,"pop","height=400,width=600,title=no,titlebar=no,scrollbars=yes");
}

</script>
<style type="text/css">
div#main2 {
background-image: url(images/mainbar_03.png);
background-repeat: repeat-y;
<?php if ($page_image != '') { ?>
padding-left: 95px;
<?php } else { ?>
padding-left: 15px;
<?php } ?>
padding-right: 15px;
}

div#sidebar {
padding-top: 70px;
background-image: url(images/<?php echo $page_image; ?>.png);
background-repeat: no-repeat;
}
</style>
</head>
<body>
<div id="installer">
<?php if ($page_image != '') { ?>
<div id="side">
<div id="side1"><!-- Empty div for background-images on CSS-capable browsers --></div>
<div id="side2">
<div id="sidebar" class="bodytext">
<?php echo $page_text; ?>
</div>
</div>
<div id="side3"><!-- Empty div for background-images on CSS-capable browsers --></div>
</div>
<?php } ?>
<div id="main">
<div id="main1"><!-- Empty div for background-images on CSS-capable browsers --></div>
<div id="main2" class="bodytext">
<h1 id="maintitle"><span class="noncss"><?php echo $i18n['installer_title']; ?></span></h1>
<?php
if (file_exists('pages/'.$page.'.php')) {
include('pages/'.$page.'.php');
} else {
echo sprintf($i18n['unknown_page'],strip_tags($page));
}
?>
<br />
</div>
<div id="main3"><!-- Empty div for background-images on CSS-capable browsers --></div>
<div id="hd">
<h1 id="logo">
<a href="http://www.exponentcms.org/" target="_blank">
Exponent CMS
</a>
</h1>
</div>
<div id="bd">
<div id="leftcol">
<?php
if (file_exists('pages/'.$page.'.php')) {
include('pages/'.$page.'.php');
} else {
echo sprintf($i18n['unknown_page'],strip_tags($page));
}
?>
</div>
<?php if ($page_image != '') { ?>
<div id="rightcol">
<p>
<?php echo $page_text; ?>
</p>
</div>
<?php } ?>
</div>
</div>
</body>
Expand Down
12 changes: 6 additions & 6 deletions install/pages/admin_user.php
Expand Up @@ -42,14 +42,14 @@ function checkPassword(f){
<input type="hidden" name="page" value="save_admin" />
<div class="form_section">
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['username']; ?>: </span>
<span class="label"><?php echo $i18n['username']; ?>: </span>
<input class="text" type="text" name="username" value="<?php echo $i18n['username_default']; ?>" />
<div class="control_help">
<?php echo $i18n['username_desc']; ?>
</div>
</div>
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['password']; ?>: </span>
<span class="label"><?php echo $i18n['password']; ?>: </span>
<input class="text" type="password" name="password" value="" />
<?php
//FJD - this isn't working well and it's unnecessary
Expand Down Expand Up @@ -108,22 +108,22 @@ function checkPassword(f){
</div>
</div>
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['password2']; ?>: </span>
<span class="label"><?php echo $i18n['password2']; ?>: </span>
<input class="text" type="password" name="password2" value="" />
<div class="control_help">
<?php echo $i18n['password_desc2']; ?>
</div>
</div>
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['firstname']; ?>: </span>
<span class="label"><?php echo $i18n['firstname']; ?>: </span>
<input class="text" type="text" name="firstname" value="<?php echo $i18n['firstname_default']; ?>" />
</div>
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['lastname']; ?>: </span>
<span class="label"><?php echo $i18n['lastname']; ?>: </span>
<input class="text" type="text" name="lastname" value="<?php echo $i18n['lastname_default']; ?>" />
</div>
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['email']; ?>: </span>
<span class="label"><?php echo $i18n['email']; ?>: </span>
<input class="text" type="text" name="email" value="" />
</div>
</div>
Expand Down
19 changes: 13 additions & 6 deletions install/pages/dbcheck.php
Expand Up @@ -23,8 +23,14 @@
$i18n = exponent_lang_loadFile('install/pages/dbcheck.php');

?>
<h2 id="subtitle"><?php echo $i18n['subtitle']; ?></h2>
<table>
<h1><?php echo $i18n['subtitle']; ?></h1>
<table class="exp-skin-table">
<thead>
<tr>
<th colspan=2><?php echo expLang::gettext('Results'); ?></th>
<tr>
<thead>
<tbody>
<?php

function echoStart($msg) {
Expand Down Expand Up @@ -273,6 +279,7 @@ function isAllGood($str) {
}

?>
</tbody>
</table>
<?php

Expand All @@ -284,9 +291,9 @@ function isAllGood($str) {
$db->dropTable(str_replace($db->prefix,'',$t));
}
}
echo '<br /><br />';
echo '<p>';
echo $i18n['passed'];
echo '<br /><br />';
echo '</p>';

if (isset($_POST['install_default'])) {
if (!defined('SYS_BACKUP')) include_once(BASE.'subsystems/backup.php');
Expand All @@ -302,11 +309,11 @@ function isAllGood($str) {
}
}
?>
<br /><br /><a href='?page=admin_user'><?php echo $i18n['continue']; ?></a>.
<a class="awesome green large" href='?page=admin_user'><?php echo $i18n['continue']; ?></a>.
<?php
} else {
?>
<br /><br /><a href="?page=dbconfig" onclick="history.go(-1); return false;"><?php echo $i18n['back']; ?></a>
<a class="awesome red large" href="?page=dbconfig" onclick="history.go(-1); return false;"><?php echo $i18n['back']; ?></a>
<?php
}
?>
38 changes: 18 additions & 20 deletions install/pages/dbconfig.php
Expand Up @@ -55,15 +55,15 @@ function showOptions(engine) {
}
}
</script>
<h2 id="subtitle"><?php echo $i18n['subtitle']; ?></h2>
<h2><?php echo $i18n['subtitle']; ?></h2>

<form method="post" action="index.php">
<input type="hidden" name="page" value="dbcheck" />

<div class="form_section_header"><?php echo $i18n['server_info']; ?></div>
<h2><?php echo $i18n['server_info']; ?></h2>
<div class="form_section">
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['backend']; ?>: </span>
<span class="label"><?php echo $i18n['backend']; ?>: </span>
<select name="c[db_engine]" onchange="showOptions(this.value);">
<?php
require_once(BASE.'subsystems/database.php');
Expand All @@ -85,7 +85,7 @@ function showOptions(engine) {


<div class="control" id="mysql_options">
&#0149; <span class="control_caption"><?php echo $i18n['DB_ENCODING']; ?>: </span>
<span class="label"><?php echo $i18n['DB_ENCODING']; ?>: </span>
<select name="c[DB_ENCODING]" value="<?php echo $config['DB_ENCODING']; ?>" >
<?PHP
if (!defined('SYS_CONFIG')) {
Expand All @@ -105,7 +105,7 @@ function showOptions(engine) {
</div>

<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['address']; ?>: </span>
<span class="label"><?php echo $i18n['address']; ?>: </span>
<input class="text" type="text" name="c[db_host]" value="<?php echo $config['db_host']; ?>" />
<div class="control_help">
<?php echo $i18n['address_desc']; ?>
Expand All @@ -115,7 +115,7 @@ function showOptions(engine) {
</div>

<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['port'];?>: </span>
<span class="label"><?php echo $i18n['port'];?>: </span>
<input class="text" type="text" name="c[db_port]" value="<?php echo $config['db_port']; ?>" size="5" />
<div class="control_help">
<?php echo $i18n['port_desc']; ?>
Expand All @@ -125,18 +125,16 @@ function showOptions(engine) {
</div>
</div>

<div class="form_section_header"><?php echo $i18n['database_info']; ?></div>
<h2><?php echo $i18n['database_info']; ?></h2>
<div class="form_section">
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['dbname']; ?>: </span>
<span class="label"><?php echo $i18n['dbname']; ?>: </span>
<input class="text" type="text" name="c[db_name]" value="<?php echo $config['db_name']; ?>" />
<div class="control_help">
<?php echo $i18n['dbname']; ?>
</div>

</div>

<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['username']; ?>: </span>
<span class="label"><?php echo $i18n['username']; ?>: </span>
<input class="text" type="text" name="c[db_user]" value="<?php echo $config['db_user']; ?>" />
<div class="control_help">
<?php echo $i18n['username_desc']; ?>
Expand All @@ -145,15 +143,15 @@ function showOptions(engine) {
</div>
</div>
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['password']; ?>: </span>
<span class="label"><?php echo $i18n['password']; ?>: </span>
<input class="text" type="password" name="c[db_pass]" value="<?php echo $config['db_pass']; ?>" />
<div class="control_help">
<?php echo $i18n['password_desc']; ?>
</div>
</div>

<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['prefix']; ?>: </span>
<span class="label"><?php echo $i18n['prefix']; ?>: </span>
<input class="text" type="text" name="c[db_table_prefix]" value="<?php echo $config['db_table_prefix']; ?>" />
<div class="control_help">
<?php echo $i18n['prefix_desc']; ?>
Expand All @@ -163,10 +161,10 @@ function showOptions(engine) {
</div>
</div>

<!--div class="form_section_header"><?php echo $i18n['default_content']; ?></div>
<!--h2><?php echo $i18n['default_content']; ?></h2>
<div class="form_section">
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['install']; ?></span>
<span class="label"><?php echo $i18n['install']; ?></span>
<input type="checkbox" name="install_default" checked="checked" />
<div class="control_help">
<?php echo $i18n['install_desc']; ?>
Expand All @@ -175,10 +173,10 @@ function showOptions(engine) {
</div>
</div-->

<div class="form_section_header"><?php echo $i18n['sef']; ?></div>
<h2><?php echo $i18n['sef']; ?></h2>
<div class="form_section">
<div class="control">
&#0149; <span class="control_caption"><?php echo $i18n['enable_sef']; ?></span>
<span class="label"><?php echo $i18n['enable_sef']; ?></span>
<input type="checkbox" name="c[sef_urls]" checked="checked" />
<div class="control_help">
<?php echo $i18n['sef_desc']; ?>
Expand All @@ -187,14 +185,14 @@ function showOptions(engine) {
</div>
</div>

<div class="form_section_header"><?php echo $i18n['verify']; ?></div>
<h2><?php echo $i18n['verify']; ?></h2>
<div class="form_section">
<div class="control">
<div class="control_help">
<?php echo $i18n['verify_desc']; ?>
<br /><br />
</div>
<input type="submit" value="<?php echo $i18n['test_settings']; ?>" class="text" />
<button class="awesome large green"><?php echo $i18n['test_settings']; ?></button>
</div>
</div>
</form>
2 changes: 1 addition & 1 deletion install/pages/final.php
Expand Up @@ -52,5 +52,5 @@

?>
<br /><br />
<a href="<?php echo URL_FULL; ?>login.php">Now go log in and add some content!</a>
<a class="awesome large green" href="<?php echo URL_FULL; ?>login.php">Now go log in and add some content!</a>
<?php exponent_sessions_clearAllSessionData();?>

0 comments on commit 9c34826

Please sign in to comment.