diff --git a/search2/indexing/extractors/OpenOfficeTextExtractor.inc.php b/search2/indexing/extractors/OpenOfficeTextExtractor.inc.php
index 548a4f3..2878e7c 100644
--- a/search2/indexing/extractors/OpenOfficeTextExtractor.inc.php
+++ b/search2/indexing/extractors/OpenOfficeTextExtractor.inc.php
@@ -1,5 +1,7 @@
unzip = KTUtil::findCommand("import/unzip", 'unzip');
$this->unzip = str_replace('\\','/',$this->unzip);
$this->unzip_params = $config->get('extractorParameters/unzip', '"{source}" "{part}" -d "{target_dir}"');
+ */
parent::__construct();
}
@@ -94,6 +98,14 @@ class OpenOfficeTextExtractor extends ExternalDocumentExtractor
$this->sourcefile = str_replace('\\','/',$this->sourcefile);
$this->openxml_dir = str_replace('\\','/',$this->openxml_dir);
+ $archive = new PclZip($this->sourcefile);
+
+ if ($archive->extract(PCLZIP_OPT_PATH, $this->openxml_dir) == 0){
+ $this->output = _kt('Failed to extract content');
+ return false;
+ }
+
+ /* *** Original code using the unzip binary ***
$cmd = '"' . $this->unzip . '"' . ' ' . str_replace(
array('{source}','{part}', '{target_dir}'),
array($this->sourcefile, 'content.xml',$this->openxml_dir), $this->unzip_params);
@@ -105,6 +117,7 @@ class OpenOfficeTextExtractor extends ExternalDocumentExtractor
$this->output = _kt('Failed to execute command: ') . $cmd;
return false;
}
+ *** End unzip code *** */
$filename = $this->openxml_dir . '/content.xml';
if (!file_exists($filename))
@@ -134,4 +147,4 @@ class OpenOfficeTextExtractor extends ExternalDocumentExtractor
}
-?>
+?>
\ No newline at end of file
diff --git a/search2/indexing/extractors/OpenXmlTextExtractor.inc.php b/search2/indexing/extractors/OpenXmlTextExtractor.inc.php
index 79ac182..c710a39 100644
--- a/search2/indexing/extractors/OpenXmlTextExtractor.inc.php
+++ b/search2/indexing/extractors/OpenXmlTextExtractor.inc.php
@@ -43,9 +43,11 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor
{
$config = KTConfig::getSingleton();
+ /* ** Using peclzip instead of the unzip binary **
$this->unzip = KTUtil::findCommand("import/unzip", 'unzip');
$this->unzip = str_replace('\\','/',$this->unzip);
$this->unzip_params = $config->get('extractorParameters/unzip', '"{source}" "{part}" -d "{target_dir}"');
+ */
parent::__construct();
}
@@ -158,6 +160,14 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor
$this->sourcefile = str_replace('\\','/',$this->sourcefile);
$this->openxml_dir = str_replace('\\','/',$this->openxml_dir);
+ $archive = new PclZip($this->sourcefile);
+
+ if ($archive->extract(PCLZIP_OPT_PATH, $this->openxml_dir) == 0){
+ $this->output = _kt('Failed to extract content');
+ return false;
+ }
+
+ /* *** Original code using the unzip binary ***
$cmd = '"' . $this->unzip . '"' . ' ' . str_replace(
array('{source}','{part}', '{target_dir}'),
array($this->sourcefile, '*Content_Types*.xml',$this->openxml_dir), $this->unzip_params);
@@ -169,6 +179,7 @@ class OpenXmlTextExtractor extends ExternalDocumentExtractor
$this->output = _kt('Failed to execute command: ') . $cmd;
return false;
}
+ *** End unzip code *** */
$filename = $this->openxml_dir . '/[Content_Types].xml';
if (!file_exists($filename))
diff --git a/setup/migrate/stepAction.php b/setup/migrate/stepAction.php
index e804976..1037f86 100644
--- a/setup/migrate/stepAction.php
+++ b/setup/migrate/stepAction.php
@@ -76,7 +76,7 @@ class stepAction {
* @var boolean
*/
protected $displayFirst = false;
-
+
/**
* List of migrate properties
*
@@ -85,7 +85,7 @@ class stepAction {
* @var boolean
*/
protected $migrateProperties = array();
-
+
/**
* Reference to session object
*
@@ -131,7 +131,7 @@ class stepAction {
$this->loadSession($session);
$this->setMigrateProperties($migrateProperties);
}
-
+
/**
* Sets steps class names in string format
*
@@ -179,7 +179,7 @@ class stepAction {
public function setDisplayFirst($displayFirst) {
$this->displayFirst = $displayFirst;
}
-
+
/**
* Sets session object
*
@@ -191,7 +191,7 @@ class stepAction {
public function loadSession($ses) {
$this->session = $ses;
}
-
+
/**
* Sets migrate properties
*
@@ -203,7 +203,7 @@ class stepAction {
public function setMigrateProperties($migrateProperties) {
$this->migrateProperties = $migrateProperties;
}
-
+
/**
* Main control to handle the steps actions
*
@@ -228,7 +228,7 @@ class stepAction {
$this->stepName = 'errors';
$this->action = $this->createStep();
$this->action->error = array('Class File Missing in Step Directory');
-
+
}
if ($response == 'error') {
$this->_handleErrors(); // Send Errors to session
@@ -248,7 +248,7 @@ class stepAction {
*/
public function createStep() {
$step_class = "migrate".$this->makeCamelCase($this->stepName);
-
+
return new $step_class();
}
@@ -281,7 +281,7 @@ class stepAction {
return $str;
}
-
+
/**
* Returns current step name
*
@@ -306,32 +306,35 @@ class stepAction {
*/
public function getLeftMenu()
{
- $menu = '';
+ $sideMenuElements = array();
$active = false;
if($this->stepClassNames) {
- foreach ($this->stepClassNames as $step) {
+ $ele = array();
+ foreach ($this->stepClassNames as $k=>$step) {
+ $ele['step'] = $step;
if($this->step_names[$step] != '') {
- $item = $this->step_names[$step];
+ $ele['name'] = $this->step_names[$step];
} else {
- $item = $this->makeHeading($step);
+ $ele['name'] = $this->makeHeading($step);
}
if($step == $this->stepName) {
- $class = 'current';
- $active = true;
+ $ele['class'] = 'current';
+ $active = true;
} else {
- if($active){
- $class = 'inactive';
- }else{
- $class = 'indicator';
- $item = "{$item} ";
+ if($active) {
+ $ele['class'] = 'inactive';
+ } else {
+ $ele['class'] = 'indicator';
}
}
-
- $menu .= "$item ";
+ $sideMenuElements[] = $ele;
}
}
-// $menu .= '';
- return $menu;
+ $step_tpl = new Template("..".DS."wizard".DS."templates".DS."sidemenu.tpl"); // Create template
+ $step_tpl->set("sideMenuElements", $sideMenuElements); // Set side menu elements
+ $step_tpl->set("ajax", AJAX); // Set ajax state
+
+ return $step_tpl->fetch();
}
/**
@@ -357,7 +360,7 @@ class stepAction {
public function displayFirst() {
return $this->displayFirst;
}
-
+
/**
* Returns session object
*
@@ -379,7 +382,6 @@ class stepAction {
* @return string
*/
public function paintAction() {
-
$step_errors = $this->action->getErrors(); // Get errors
$step_warnings = $this->action->getWarnings(); // Get warnings
if($this->displayConfirm()) { // Check if theres a confirm step
@@ -396,18 +398,33 @@ class stepAction {
$step_tpl->set("warnings", $step_warnings); // Set template warnings
$step_vars = $this->action->getStepVars(); // Get template variables
$step_tpl->set("step_vars", $step_vars); // Set template errors
- foreach ($step_vars as $key => $value) { // Set template variables
- $step_tpl->set($key, $value); // Load values to session
- if($this->action->storeInSession()) { // Check if class values need to be stored in session
- $this->_loadValueToSession($this->stepName, $key, $value);
+ $this->loadToSes($step_vars);
+ $this->loadToTpl($step_tpl, $step_vars);
+ // TODO: Force because it does not always recognize ajax request
+ if(AJAX && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
+ echo $step_tpl->fetch();
+ } else {
+ $content = $step_tpl->fetch();
+ $tpl = new Template("templates/wizard.tpl");
+ $vars = $this->getVars(); // Get template variables
+ $tpl->set("vars", $vars); // Set template errors
+ $tpl->set('content', $content);
+ echo $tpl->fetch();
+ }
+ }
+
+ public function loadToSes($step_vars) {
+ if($this->action->storeInSession()) { // Check if class values need to be stored in session
+ foreach ($step_vars as $key => $value) { // Set template variables
+ $this->_loadValueToSession($this->stepName, $key, $value);
}
}
- $content = $step_tpl->fetch();
- $tpl = new Template("templates/wizard.tpl");
- $vars = $this->getVars(); // Get template variables
- $tpl->set("vars", $vars); // Set template errors
- $tpl->set('content', $content);
- echo $tpl->fetch();
+ }
+
+ public function loadToTpl($step_tpl, $step_vars) {
+ foreach ($step_vars as $key => $value) { // Set template variables
+ $step_tpl->set($key, $value); // Load values to session
+ }
}
public function getVars() {
diff --git a/setup/migrate/templates/installation.tpl b/setup/migrate/templates/installation.tpl
index 8df8c50..9eadc2b 100644
--- a/setup/migrate/templates/installation.tpl
+++ b/setup/migrate/templates/installation.tpl
@@ -26,11 +26,17 @@
- Enter the full path of the installation you wish to upgrade:
+ Enter the full path of the installation you wish to upgrade:
The default is 'C:\Program Files\ktdms' on Windows and '/opt/ktdms' or '/home/username /ktdms/' on other operating systems.
+
+
+ Make sure that the services are running for that installation.
+
+
+
checkPassword($username, $password);
-
+
if (!$authenticated)
{
session_unset();
@@ -81,10 +81,10 @@ class upgradeWelcome extends step {
}
$_SESSION['setup_user'] = $username;
-
+
return true;
}
-
+
private function checkPassword($username, $password) {
$upgradeOnly = false;
@@ -121,11 +121,11 @@ class upgradeWelcome extends step {
return false;
}
-
+
public function getErrors() {
return $this->error;
}
-
+
/**
* Returns step variables
*
@@ -138,9 +138,9 @@ class upgradeWelcome extends step {
{
return $this->temp_variables;
}
-
+
public function storeSilent() {
-
+
}
}
diff --git a/setup/upgrade/templates/database.tpl b/setup/upgrade/templates/database.tpl
index 8f78772..6c4c51d 100644
--- a/setup/upgrade/templates/database.tpl
+++ b/setup/upgrade/templates/database.tpl
@@ -66,4 +66,5 @@
else { ?>
-
\ No newline at end of file
+
+js('form.js'); } ?>
\ No newline at end of file
diff --git a/setup/upgrade/templates/installation.tpl b/setup/upgrade/templates/installation.tpl
index b51f7a1..ad1b10a 100644
--- a/setup/upgrade/templates/installation.tpl
+++ b/setup/upgrade/templates/installation.tpl
@@ -18,4 +18,5 @@
-
\ No newline at end of file
+
+js('form.js'); } ?>
\ No newline at end of file
diff --git a/setup/upgrade/templates/welcome.tpl b/setup/upgrade/templates/welcome.tpl
index f88f999..b456d78 100644
--- a/setup/upgrade/templates/welcome.tpl
+++ b/setup/upgrade/templates/welcome.tpl
@@ -13,7 +13,7 @@
Password
Could Not Authenticate User
-
+
\ No newline at end of file
+
+js('form.js'); } ?>
\ No newline at end of file
diff --git a/setup/wizard/config/config.xml b/setup/wizard/config/config.xml
index 8aa533b..8a2ac31 100644
--- a/setup/wizard/config/config.xml
+++ b/setup/wizard/config/config.xml
@@ -11,7 +11,7 @@
welcome
license
-
+ installtype
dependencies
configuration
services
diff --git a/setup/wizard/installUtil.php b/setup/wizard/installUtil.php
index 2d8d31a..699c968 100644
--- a/setup/wizard/installUtil.php
+++ b/setup/wizard/installUtil.php
@@ -245,6 +245,7 @@ class InstallUtil {
*/
public function _checkPermission($dir)
{
+ return true; // TODO: remove
if(is_readable($dir) && is_writable($dir)) {
return true;
} else {
diff --git a/setup/wizard/installWizard.php b/setup/wizard/installWizard.php
index b1da685..825b74d 100644
--- a/setup/wizard/installWizard.php
+++ b/setup/wizard/installWizard.php
@@ -85,7 +85,7 @@ class InstallWizard {
* @var mixed
*/
protected $debugLevel = 0;
-
+
/**
* Reference to installer utility object
*
@@ -114,7 +114,7 @@ class InstallWizard {
private function isSystemInstalled() {
return $this->util->isSystemInstalled();
}
-
+
/**
* Display the wizard
*
@@ -132,7 +132,7 @@ class InstallWizard {
$ins->step(); // Run step
}
}
-
+
/**
* Set bypass flag
*
@@ -144,7 +144,7 @@ class InstallWizard {
private function setBypass($bypass) {
$this->bypass = $bypass;
}
-
+
/**
* Set debug level
*
@@ -157,7 +157,7 @@ class InstallWizard {
define('DEBUG', $debug);
$this->debugLevel = $debug;
}
-
+
/**
* Set util reference
*
@@ -169,7 +169,7 @@ class InstallWizard {
private function setIUtil($util) {
$this->util = $util;
}
-
+
/**
* Get bypass flag
*
@@ -181,7 +181,7 @@ class InstallWizard {
public function getBypass() {
return $this->bypass;
}
-
+
/**
* Bypass and force an install
*
@@ -191,9 +191,9 @@ class InstallWizard {
* @return boolean
*/
private function bypass() {
-
+
}
-
+
/**
* Create install file
*
@@ -205,7 +205,7 @@ class InstallWizard {
private function createInstallFile() {
@touch(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock");
}
-
+
/**
* Remove install file
*
@@ -218,7 +218,7 @@ class InstallWizard {
if(file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock"))
@unlink(SYSTEM_DIR.'var'.DS.'bin'.DS."install.lock");
}
-
+
/**
* Load default values
*
@@ -238,7 +238,7 @@ class InstallWizard {
}
$this->setIUtil(new InstallUtil());
}
-
+
/**
* Run pre-installation system checks
*
@@ -264,7 +264,7 @@ class InstallWizard {
break;
}
}
-
+
/**
* Control all requests to wizard
*
@@ -282,7 +282,7 @@ class InstallWizard {
}
if(!$this->isSystemInstalled()) { // Check if the systems not installed
if($this->util->migrationSpecified()) { // Check if the migrator needs to be accessed
- $this->util->redirect('../migrate/index.php');
+ $this->util->redirect('../migrate/index.php?');
} elseif ($this->util->upgradeSpecified()) {
$this->util->redirect('../upgrade/index.php?action=installer');
}
diff --git a/setup/wizard/path.php b/setup/wizard/path.php
index 676230b..d89017c 100644
--- a/setup/wizard/path.php
+++ b/setup/wizard/path.php
@@ -64,34 +64,25 @@
}
$wizard = realpath(dirname(__FILE__));
// Define environment root
+ $wizard = realpath(dirname(__FILE__));
+ $xdir = explode(DS, $wizard);
+ array_pop($xdir);
+ $sys = '';
+ foreach ($xdir as $k=>$v) {
+ $sys .= $v.DS;
+ }
if(isset($_GET['type'])) {
switch ($_GET['type']) {
case 'migrate' :
- $wizard = realpath(dirname(__FILE__));
- $xdir = explode(DS, $wizard);
- array_pop($xdir);
- $sys = '';
- foreach ($xdir as $k=>$v) {
- $sys .= $v.DS;
- }
$wizard = $sys.'migrate';
break;
case 'upgrade' :
- $wizard = realpath(dirname(__FILE__));
- $xdir = explode(DS, $wizard);
- array_pop($xdir);
- $sys = '';
- foreach ($xdir as $k=>$v) {
- $sys .= $v.DS;
- }
$wizard = $sys.'upgrade';
break;
default:
-
+
break;
}
- } else {
-// die("Environment Error");
}
$xdir = explode(DS, $wizard);
array_pop($xdir);
diff --git a/setup/wizard/resources/css/ie6.css b/setup/wizard/resources/css/ie6.css
index e69de29..947b34e 100644
--- a/setup/wizard/resources/css/ie6.css
+++ b/setup/wizard/resources/css/ie6.css
@@ -0,0 +1,3 @@
+#logo {
+ right:70%;
+}
\ No newline at end of file
diff --git a/setup/wizard/resources/css/migrate.css b/setup/wizard/resources/css/migrate.css
index 15f0dcb..87c9855 100644
--- a/setup/wizard/resources/css/migrate.css
+++ b/setup/wizard/resources/css/migrate.css
@@ -2,26 +2,26 @@
border: 1px solid rgb(207, 207, 207);
overflow: auto;
padding: 5px;
- min-height:365px;
+ /*min-height:365px;*/min-height:300px;
}
#step_content_services {
border: 1px solid rgb(207, 207, 207);
overflow: auto;
padding: 5px;
- min-height:340px;
+ /*min-height:340px;*/min-height:285px;
}
#step_content_database {
border: 1px solid rgb(207, 207, 207);
overflow: auto;
padding: 5px;
- min-height:380px;
+ /*min-height:380px;*/min-height:315px;
}
#step_content_complete {
border: 1px solid rgb(207, 207, 207);
overflow: auto;
padding: 5px;
- min-height:360px;
+ /*min-height:360px;*/min-height:295px;
}
diff --git a/setup/wizard/resources/css/wizard.css b/setup/wizard/resources/css/wizard.css
index 233dc55..303973b 100644
--- a/setup/wizard/resources/css/wizard.css
+++ b/setup/wizard/resources/css/wizard.css
@@ -64,20 +64,20 @@ select {
/* *** Layout Styles *** */
#wrapper {
- background: white;
+ background: white; min-height:410px;
}
#outer-wrapper {
border:1px solid #B7B7B7;
margin-top:20px;
- width:1024px;
+ /*width:1024px;*/width:964px;
}
#header {
background: transparent url("../graphics/dame/installer_head.png") repeat scroll 0% 0%;
- text-align: right;
- font-size: 100%;
- color: rgb(167, 167, 167);
+ text-align: right;
+ font-size: 100%;
+ color: rgb(167, 167, 167);
font-family: sans-serif;
height: 71px;
font-family:sans-serif;
@@ -87,11 +87,12 @@ select {
#container {
background: white url("../graphics/left.png") repeat-y left;
overflow:auto;
+ /*min-height:630px;height:410px;*/min-height:410px;
}
#content {
margin-left: 220px;
- height:515px;
+ /*height:515px;*/height:400px;
}
#content_container {
@@ -104,43 +105,49 @@ select {
border: 1px solid rgb(207, 207, 207);
padding: 5px;
overflow: auto;
- min-height: 400px;
+ /*min-height: 400px;*/min-height: 300px;
}
#step_content_dependencies {
border: 1px solid rgb(207, 207, 207);
- padding: 5px;
- min-height:270px;
+ /*padding: 5px;*/padding: 12px;
+ /*min-height:270px;*/min-height:170px;
}
#step_content_configuration {
border: 1px solid rgb(207, 207, 207);
padding: 5px;
- min-height:320px;
+ /*min-height:320px;*//*height:330px*/min-height:130px;
+}
+
+#step_content_services {
+ border: 1px solid rgb(207, 207, 207);
+ padding: 5px;
+ min-height:230px;
}
#step_content_registration {
border: 1px solid rgb(207, 207, 207);
padding: 5px;
- min-height:320px;
+ /*min-height:320px;*/min-height:100px;
}
#step_content_registration_confirm {
border: 1px solid rgb(207, 207, 207);
padding: 5px;
- min-height:400px;
+ /*min-height:400px;*/min-height:300px;
}
#step_content_install {
border: 1px solid rgb(207, 207, 207);
padding: 5px;
- min-height:400px;
+ /*min-height:400px;*/min-height:150px;
}
#step_content_database {
border: 1px solid rgb(207, 207, 207);
padding: 5px;
- min-height:365px;
+ /*min-height:365px;*/min-height:240px;
}
#step_content_database_confirm {
@@ -157,15 +164,15 @@ select {
.license_agreement {
overflow: scroll;
- height:370px;
+ /*height:370px;*/height:270px;
overflow-x:hidden;
border:1px solid #CFCFCF;
}
#sidebar {
font-size: 85%;
- color: grey;
- font-family: sans-serif;
+ color: grey;
+ font-family: sans-serif;
margin-top: 0px;
float: left;
padding-top: 20px;
@@ -197,8 +204,8 @@ select {
#logo {
position:relative;
- right:760px;
- top:20px;
+ /*right:760px;*/right:75%;
+ /*top:20px;*/top:25%;
}
#install_details {
@@ -208,26 +215,26 @@ select {
}
.indicator a {
- background:url("../graphics/dame/tick1.png") no-repeat left;
- padding-top:15px;
- padding-bottom:10px;
- padding-left:30px;
- color: #1c9e00;
+ background:url("../graphics/dame/tick1.png") no-repeat left;
+ padding-top:15px;
+ padding-bottom:10px;
+ padding-left:30px;
+ color: #1c9e00;
}
.active {
- background:url("../graphics/dame/tick1.png") no-repeat left;
- padding-top:15px;
- padding-bottom:10px;
- padding-left:30px;
- color: #1c9e00;
+ background:url("../graphics/dame/tick1.png") no-repeat left;
+ padding-top:15px;
+ padding-bottom:10px;
+ padding-left:30px;
+ color: #1c9e00;
}
.inactive {
background:url("../graphics/dame/tick2.png") no-repeat left;
padding-top:15px;
padding-bottom:10px;
- padding-left:30px;
+ padding-left:30px;
color:#a7a7a7;
}
@@ -238,7 +245,7 @@ select {
padding-left:30px;
color: #f36a00;
}
-
+
.tick {
background: url("../graphics/tick.png") no-repeat;
height: 16px;
@@ -275,7 +282,7 @@ select {
}
.conf_paths {
- width:755px;
+ /*width:755px;*/width:100%;
}
.errors {
@@ -361,7 +368,7 @@ select {
.onclick {
cursor: pointer;
color: #EC7725;
- width: 150px;
+ /*width: 150px;*/width:350px;top:12px;position:relative;
}
.description {
@@ -397,7 +404,7 @@ table#dbconf tr td {
}
table#dbconf tr td input{
-
+
}
.options {
@@ -408,17 +415,17 @@ table#dbconf tr td input{
padding: 5px 8px;
}
-#section {
+/*#section {
-}
+}*/
.php_ext_details table {
width:745px;
}
-.php_ext_details table tr {
-
-}
+/*.php_ext_details table tr {
+
+}*/
td.ext_indicator {
width:10px;
@@ -449,7 +456,7 @@ td.dir_description {
}
.php_con_details table {
- width:745px;
+ /*width:745px;*/width:675px;
}
.error_message {
@@ -471,7 +478,7 @@ td.dir_description {
margin-bottom:0.75em;
font-weight:bold;
}
-
+
.continue_message {
border:none;
width:550px;
@@ -533,7 +540,7 @@ td.dir_description {
#loading {
bottom:250px;
- left:500px;
+ /*left:500px;*/left:400px;
position:relative;
height:0px;
width:0px;
@@ -548,4 +555,42 @@ td.dir_description {
#left_space {
float:left;
width:50%;
+ font-size:11pt;
+}
+
+#welcome_license_dependencies {
+ height:100px;
+}
+
+.dependency_details {
+ top:12px;
+ position:relative;
+ width:650px;
+}
+
+.dependencies {
+ position:relative;
+ right:30%;
+}
+
+.registration_template {
+ width:90%;
+}
+
+.registration_select {
+ width: 270px;
+}
+
+.description_complete {
+ position:relative;
+ right:35%;
+ width:100%;
+}
+
+.space {
+ padding-bottom:5px;
+}
+
+.advoptions {
+ top:0px;
}
\ No newline at end of file
diff --git a/setup/wizard/resources/graphics/loader.gif b/setup/wizard/resources/graphics/loader.gif
new file mode 100755
index 0000000..245debd
--- /dev/null
+++ b/setup/wizard/resources/graphics/loader.gif
diff --git a/setup/wizard/resources/js/form.js b/setup/wizard/resources/js/form.js
index e286d41..270a17b 100644
--- a/setup/wizard/resources/js/form.js
+++ b/setup/wizard/resources/js/form.js
@@ -9,8 +9,8 @@ $(document).ready(function() {
var options = {target: '#content_container', beforeSubmit: w.validateRegistration, success: w.adjustMenu($('form').attr('id'))};
$('form').ajaxForm(options);
}
- $(document).bind('keydown', 'Ctrl+n',function (evt){alert("n"); return false; });
- $(document).bind('keydown', 'Ctrl+p',function (evt){alert("p"); return false; });
- $(document).bind('keydown', 'Ctrl+e',function (evt){alert("e"); return false; });
- $(document).bind('keydown', 'Ctrl+i',function (evt){alert("i"); return false; });
+ $(document).bind('keydown', 'Ctrl+n',function (evt){ });
+ $(document).bind('keydown', 'Ctrl+p',function (evt){ });
+ $(document).bind('keydown', 'Ctrl+e',function (evt){ });
+ $(document).bind('keydown', 'Ctrl+i',function (evt){ });
});
\ No newline at end of file
diff --git a/setup/wizard/resources/js/wizard.js b/setup/wizard/resources/js/wizard.js
index f308d64..275e828 100644
--- a/setup/wizard/resources/js/wizard.js
+++ b/setup/wizard/resources/js/wizard.js
@@ -1,5 +1,7 @@
// Class Wizard
-function wizard() {
+var ajaxOn = false;
+function wizard() {
+ this.ajaxOn = false;
}
// Toggle Advance Database options
@@ -10,12 +12,20 @@ wizard.prototype.toggleClass = function(ele, option) { //adv_options|php_details
var patt1=/none/gi; // preg match
var patt2=/block/gi;
if(style.match(patt1) == 'none') {
- $('.'+ele).attr('style', 'display: block;');
+ if(this.ajaxOn) {
+ w.slideElement($('.'+ele), 'down');
+ } else {
+ $('.'+ele).attr('style', 'display: block;');
+ }
if($('#'+option).attr('innerHTML') != ' Advanced Options') {
$('#'+option).attr('innerHTML', 'Hide Details');
}
} else if(style.match(patt2) == 'block') {
- $('.'+ele).attr('style', 'display: none;');
+ if(this.ajaxOn) {
+ w.slideElement($('.'+ele), 'up');
+ } else {
+ $('.'+ele).attr('style', 'display: none;');
+ }
if($('#'+option).attr('innerHTML') != ' Advanced Options') {
$('#'+option).attr('innerHTML', 'Show Details');
}
@@ -23,6 +33,13 @@ wizard.prototype.toggleClass = function(ele, option) { //adv_options|php_details
}
}
+wizard.prototype.slideElement = function(el, dir) {
+ if(dir == 'down')
+ $(el).slideDown("slow");
+ else
+ $(el).slideUp("slow");
+}
+
// Focus on element
wizard.prototype.focusElement = function(el) {
el.focus();
@@ -59,7 +76,7 @@ wizard.prototype.validateRegistration = function() {
$('#sendAll').attr('value', 'previous');
return true;
}
-
+
return false;
}
@@ -92,7 +109,7 @@ wizard.prototype.valRegHelper = function() {
w.focusElement(email);
return false;
}
-
+
return true;
}
@@ -107,7 +124,7 @@ wizard.prototype.nameCheck = function(str) {
}
// Validate Registration Page Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
-wizard.prototype.emailCheck = function(str) {
+wizard.prototype.emailCheck = function(str) {
str = w.trim(str);
var at="@";
var dot=".";
@@ -141,12 +158,12 @@ wizard.prototype.emailCheck = function(str) {
wizard.prototype.trim = function (str, chars) {
return w.ltrim(w.rtrim(str, chars), chars);
}
-
+
wizard.prototype.ltrim = function (str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
-
+
wizard.prototype.rtrim = function (str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
@@ -170,17 +187,18 @@ wizard.prototype.adjustMenu = function (form_id, previous) {
}
wizard.prototype.dummy = function () {
-
+
}
-// pre-submit callback
+// pre-submit callback
wizard.prototype.showRequest = function (formData, jqForm, options) {
- $.blockUI({message:''});
+ //$.blockUI({message:''});
+ $.blockUI({overlayCSS:{opacity:0.1}, fadeIn:500, fadeOut:500, message:''});
$('#loading').attr('style', 'display:block;');
}
-// post-submit callback
-wizard.prototype.showResponse = function (responseText, statusText) {
+// post-submit callback
+wizard.prototype.showResponse = function (responseText, statusText) {
$.unblockUI();
$('#loading').attr('style', 'display:none;');
}
@@ -194,12 +212,12 @@ wizard.prototype.refresh = function (page) {
type: "GET",
cache: false,
beforeSubmit: w.showRequest,
- success: function(data){
- $("#"+div).empty();
- $("#"+div).append(data);
- w.showResponse;
- return;
- }
+ success: function(data) {
+ $("#"+div).empty();
+ $("#"+div).append(data);
+ w.showResponse;
+ return;
+ }
});
}
@@ -210,7 +228,7 @@ wizard.prototype.getUrl = function (address, div) {
dataType: "html",
type: "GET",
cache: false,
- success: function(data){
+ success: function(data) {
$("#"+div).empty();
$("#"+div).append(data);
return;
@@ -227,11 +245,5 @@ wizard.prototype.sendRegistration = function () {
}
wizard.prototype.clearSessions = function () {
-// var address = 'session.php?action=destroyAll';
-// $.ajax({
-// url: address,
-// dataType: "html",
-// type: "POST",
-// cache: false,
-// });
+
}
\ No newline at end of file
diff --git a/setup/wizard/stepAction.php b/setup/wizard/stepAction.php
index 5fde474..cdcd1e9 100644
--- a/setup/wizard/stepAction.php
+++ b/setup/wizard/stepAction.php
@@ -1,6 +1,6 @@
loadSession($session);
$this->setInstallProperties($installProperties);
}
-
+
/**
* Sets steps class names in string format
*
@@ -179,7 +179,7 @@ class stepAction {
public function setDisplayFirst($displayFirst) {
$this->displayFirst = $displayFirst;
}
-
+
/**
* Sets session object
*
@@ -191,7 +191,7 @@ class stepAction {
public function loadSession($ses) {
$this->session = $ses;
}
-
+
/**
* Sets install properties
*
@@ -203,7 +203,7 @@ class stepAction {
public function setInstallProperties($installProperties) {
$this->installProperties = $installProperties;
}
-
+
/**
* Main control to handle the steps actions
*
@@ -279,7 +279,7 @@ class stepAction {
return $str;
}
-
+
/**
* Returns current step name
*
@@ -334,7 +334,7 @@ class stepAction {
return $step_tpl->fetch();
}
-
+
/**
* Returns confirmation page flag
*
@@ -358,7 +358,7 @@ class stepAction {
public function displayFirst() {
return $this->displayFirst;
}
-
+
/**
* Returns session object
*
@@ -401,7 +401,7 @@ class stepAction {
// TODO: Force because it does not always recognize ajax request
if(AJAX && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
echo $step_tpl->fetch();
- } else {
+ } else {
$content = $step_tpl->fetch();
$tpl = new Template("templates/wizard.tpl");
$vars = $this->getVars(); // Get template variables
@@ -418,17 +418,17 @@ class stepAction {
}
}
}
-
+
public function loadToTpl($step_tpl, $step_vars) {
foreach ($step_vars as $key => $value) { // Set template variables
$step_tpl->set($key, $value); // Load values to session
}
}
-
+
public function getStepVars() {
return $this->action->getStepVars();
}
-
+
public function getVars() {
$left = $this->getLeftMenu();
$vars['left'] = $left; // Set left menu
@@ -436,6 +436,7 @@ class stepAction {
$vars['install_type'] = $this->installProperties['install_type']; // Set type
return $vars;
}
+
/**
* Load class to session
*
diff --git a/setup/wizard/steps/complete.php b/setup/wizard/steps/complete.php
index a8a233d..3eaba68 100644
--- a/setup/wizard/steps/complete.php
+++ b/setup/wizard/steps/complete.php
@@ -1,6 +1,6 @@
temp_variables = array("step_name"=>"complete", "silent"=>$this->silent);
$this->doRun();
return 'landing';
}
-
+
function doRun() {
$this->checkFileSystem(); // check filesystem (including location of document directory and logging)
$this->checkDb(); // check database
@@ -69,7 +72,7 @@ class complete extends Step {
$this->checkInstallType();// Set silent mode variables
$this->storeSilent();// Set silent mode variables
}
-
+
private function checkFileSystem()
{
// defaults
@@ -81,36 +84,33 @@ class complete extends Step {
$this->temp_variables['config'] = '';
$this->temp_variables['docLocation'] = '';
$docRoot = '';
- // retrieve path information from session
- $config = $this->getDataFromSession("configuration");
+ $config = $this->getDataFromSession("configuration"); // retrieve path information from session
$paths = $config['paths'];
-
$html = '
'
. '%s ';
$pathhtml = '
'
. '%s '
. '%s ';
- // check paths are writeable
- if(is_array($paths)) {
+ if(is_array($paths)) { // check paths are writeable
foreach ($paths as $path)
{
$output = '';
$path['path'] = $class = strtolower(substr($path['path'],0,1)).substr($path['path'],1); // Damn you windows
$result = $this->util->checkPermission($path['path']);
- $output = sprintf($pathhtml, $result['class'], $path['path'],
- (($result['class'] == 'tick') ? 'class="green"' : 'class="error"' ),
+ $output = sprintf($pathhtml, $result['class'], $path['path'],
+ (($result['class'] == 'tick') ? 'class="green"' : 'class="error"' ),
(($result['class'] == 'tick') ? 'Writeable' : 'Not Writeable' ));
$this->temp_variables[($path['setting'] != '') ? $path['setting'] : 'config'] = $output;
if($result['class'] != 'tick') {
+ $this->pathsSection = false;
$this->paths_check = $result['class'];
}
// for document location check
if ($path['setting'] == 'documentRoot') {
- $docRoot = $path['path'];
+ $docRoot = $path['path'];
}
}
}
-
// check document path internal/external to web root
// compare SYSTEM_DIR to root path of documentRoot
// NOTE preg_replace is to ensure all slash separators are the same (forward slash)
@@ -121,15 +121,15 @@ class complete extends Step {
. 'Your document directory is set to the default, which is inside the web root. '
. 'This may present a security problem if your documents can be accessed from the web, '
. 'working around the permission system in KnowledgeTree. ';
- if($this->paths_check == 'tick')
- $this->paths_check = 'cross_orange';
- $this->warnings[] = 'Move var directory';
+ $this->paths_check = 'cross_orange';
+ $this->warnings[] = 'Move var directory';
+ $this->pathsSection = false;
}
else {
$this->temp_variables['docLocation'] = sprintf($html, 'tick', '', 'Your document directory is outside the web root.');
}
}
-
+
private function checkDb()
{
// defaults
@@ -146,16 +146,17 @@ class complete extends Step {
$loaded = $this->util->dbUtilities->getDatabaseLink();
if (!$loaded) {
$this->temp_variables['dbConnectAdmin'] .= '
'
- . 'Unable to connect to database (user: '
+ . ' Unable to connect to database (user: '
. $dbconf['dmsname'] . ') ';
$this->database_check = 'cross';
$this->temp_variables['dbConnectAdmin'] .= sprintf($html, 'cross', 'class="error"', 'Unable to connect to database (user: ' . $dbconf['dmsname'] . ')');
+ $this->privilegesSection = false;
}
else
{
$this->temp_variables['dbConnectAdmin'] .= sprintf($html, 'tick', '', 'Database connectivity successful (user: ' . $dbconf['dmsname'] . ')');
}
-
+
// make db connection - user
$this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dport'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']);
$loaded = $this->util->dbUtilities->getDatabaseLink();
@@ -170,17 +171,16 @@ class complete extends Step {
{
$this->temp_variables['dbPrivileges'] .= '
'
. ''
- . 'Unable to do a basic database query. Error: ' . $this->util->dbUtilities->getLastError()
- . ' ';
- $this->privileges_check = 'cross';
+ . 'Unable to do a basic database query. Error: ' . $this->util->dbUtilities->getLastError() . '';
$this->privileges_check = 'cross';
+ $this->privilegesSection = false;
}
else
{
$this->temp_variables['dbPrivileges'] .= sprintf($html, 'tick', '', 'Basic database query successful');
-
+
}
-
+
// check transaction support
$sTable = 'system_settings';
$this->util->dbUtilities->startTransaction();
@@ -190,6 +190,7 @@ class complete extends Step {
if (!$res) {
$this->temp_variables['dbTransaction'] .= sprintf($html, 'cross', 'class="error"', 'Transaction support not available in database');
$this->privileges_check = 'cross';
+ $this->privilegesSection = false;
} else {
$this->temp_variables['dbTransaction'] .= sprintf($html, 'tick', '', 'Database has transaction support');
}
@@ -200,7 +201,7 @@ class complete extends Step {
$this->temp_variables['dbConnectUser'] .= sprintf($html, 'cross', 'class="error"', 'Unable to connect to database (user: ' . $dbconf['dmsusername'] . ')');
}
}
-
+
private function checkServices()
{
$services = new services();
@@ -215,10 +216,10 @@ class complete extends Step {
$this->temp_variables[$serviceName."Status"] = 'cross_orange';
$this->services_check = 'cross_orange';
}
- }
+ }
return true;
}
-
+
function checkInstallType() {
if ($this->util->isMigration()) {
$this->migrate_check = true;
@@ -226,7 +227,7 @@ class complete extends Step {
$this->migrate_check = false;
}
}
-
+
/**
* Set all silent mode varibles
*
@@ -238,6 +239,10 @@ class complete extends Step {
$this->temp_variables['database_check'] = $this->database_check;
$this->temp_variables['migrate_check'] = $this->migrate_check;
$this->temp_variables['servicesValidation'] = $this->servicesValidation;
+ //if(!$this->pathsSection) {die;} else {echo 'huh';}
+ $this->temp_variables['pathsSection'] = $this->pathsSection;
+ $this->temp_variables['databaseSection'] = $this->databaseSection;
+ $this->temp_variables['privilegesSection'] = $this->privilegesSection;
}
}
?>
\ No newline at end of file
diff --git a/setup/wizard/steps/dependencies.php b/setup/wizard/steps/dependencies.php
index 5fc3c66..3dda4d4 100644
--- a/setup/wizard/steps/dependencies.php
+++ b/setup/wizard/steps/dependencies.php
@@ -48,7 +48,7 @@ class dependencies extends Step
private $versionSection = false;
private $extensionSection = false;
private $configurationSection = false;
-
+
/**
* Flag to store class information in session
*
@@ -167,7 +167,7 @@ class dependencies extends Step
public function getWarnings() {
return $this->warnings;
}
-
+
/**
* Get the variables to be passed to the template
*
@@ -264,7 +264,7 @@ class dependencies extends Step
}
$check['class'] = 'tick';
$check['version'] = "You are running version {$phpversion} .";
-
+
return $check;
}
@@ -337,7 +337,7 @@ class dependencies extends Step
array('extension' => 'mysql', 'required' => 'yes', 'name' => 'MySQL', 'details' => 'Used for accessing a MySQL database.'),
array('extension' => 'curl', 'required' => 'yes', 'name' => 'cURL', 'details' => 'Allows the connection and communication between different servers types using various protocols.'),
array('extension' => 'xmlrpc', 'required' => 'yes', 'name' => 'XMLRPC', 'details' => 'Used with XML-RPC servers and clients.'),
- array('extension' => 'win32', 'required' => 'no', 'name' => 'Win32', 'details' => 'Allows control of Microsoft Windows services.'),
+ array('extension' => 'win32service', 'required' => 'no', 'name' => 'Win32 Services', 'details' => 'Allows control of Microsoft Windows services.'),
array('extension' => 'mbstring', 'required' => 'no', 'name' => 'Multi Byte Strings', 'details' => 'Used in the manipulation of multi-byte strings.'),
array('extension' => 'ldap', 'required' => 'no', 'name' => 'LDAP', 'details' => 'Used to access LDAP directory servers.'),
array('extension' => 'json', 'required' => 'yes', 'name' => 'JSON', 'details' => 'Implements the javascript object notation (json) data-interchange format.'),
@@ -392,7 +392,7 @@ class dependencies extends Step
array('name' => 'Memory limit', 'configuration' => 'memory_limit', 'recommended' => '32M', 'type' => 'int'),
);
}
-
+
public function storeSilent() {
$this->temp_variables['versionSection'] = $this->versionSection;
$this->temp_variables['extensionSection'] = $this->extensionSection;
diff --git a/setup/wizard/steps/registration.php b/setup/wizard/steps/registration.php
index 2b3166c..9271790 100644
--- a/setup/wizard/steps/registration.php
+++ b/setup/wizard/steps/registration.php
@@ -127,7 +127,10 @@ class registration extends Step
return true;
}
$this->setInSession();
-
+ // Flip
+ $countries = $this->temp_variables['countries'];
+ $fcountries = array_flip($countries);
+ $_POST['submitted']['country'] = $fcountries[$_POST['submitted']['country']];
// Post the form using curl
$this->curlForm($_POST);
@@ -280,6 +283,15 @@ class registration extends Step
);
$countries = array(
+ 'noneselected' => 'Select Country...',
+ 'US' => 'UNITED STATES',
+ 'GB' => 'UNITED KINGDOM',
+ 'DE' => 'GERMANY',
+ 'FR' => 'FRANCE',
+ 'IT' => 'ITALY',
+ 'ES' => 'SPAIN',
+ 'AU' => 'AUSTRALIA',
+ 'IN' => 'INDIA',
'AF' => 'AFGHANISTAN',
'AX' => 'ÅLAND ISLANDS',
'AL' => 'ALBANIA',
@@ -293,7 +305,6 @@ class registration extends Step
'AR' => 'ARGENTINA',
'AM' => 'ARMENIA',
'AW' => 'ARUBA',
- 'AU' => 'AUSTRALIA',
'AT' => 'AUSTRIA',
'AZ' => 'AZERBAIJAN',
'BS' => 'BAHAMAS',
@@ -353,14 +364,12 @@ class registration extends Step
'FO' => 'FAROE ISLANDS',
'FJ' => 'FIJI',
'FI' => 'FINLAND',
- 'FR' => 'FRANCE',
'GF' => 'FRENCH GUIANA',
'PF' => 'FRENCH POLYNESIA',
'TF' => 'FRENCH SOUTHERN TERRITORIES',
'GA' => 'GABON',
'GM' => 'GAMBIA',
'GE' => 'GEORGIA',
- 'DE' => 'GERMANY',
'GH' => 'GHANA',
'GI' => 'GIBRALTAR',
'GR' => 'GREECE',
@@ -380,16 +389,13 @@ class registration extends Step
'HK' => 'HONG KONG',
'HU' => 'HUNGARY',
'IS' => 'ICELAND',
- 'IN' => 'INDIA',
'ID' => 'INDONESIA',
'IR' => 'IRAN, ISLAMIC REPUBLIC OF',
'IQ' => 'IRAQ',
'IE' => 'IRELAND',
'IM' => 'ISLE OF MAN',
'IL' => 'ISRAEL',
- 'IT' => 'ITALY',
'JM' => 'JAMAICA',
- 'JP' => 'JAPAN',
'JE' => 'JERSEY',
'JO' => 'JORDAN',
'KZ' => 'KAZAKHSTAN',
@@ -486,7 +492,6 @@ class registration extends Step
'SO' => 'SOMALIA',
'ZA' => 'SOUTH AFRICA',
'GS' => 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS',
- 'ES' => 'SPAIN',
'LK' => 'SRI LANKA',
'SD' => 'SUDAN',
'SR' => 'SURINAME',
@@ -512,8 +517,6 @@ class registration extends Step
'UG' => 'UGANDA',
'UA' => 'UKRAINE',
'AE' => 'UNITED ARAB EMIRATES',
- 'GB' => 'UNITED KINGDOM',
- 'US' => 'UNITED STATES',
'UM' => 'UNITED STATES MINOR OUTLYING ISLANDS',
'UY' => 'URUGUAY',
'UZ' => 'UZBEKISTAN',
@@ -528,7 +531,6 @@ class registration extends Step
'ZM' => 'ZAMBIA',
'ZW' => 'ZIMBABWE'
);
-
$this->temp_variables['countries'] = $countries;
$this->temp_variables['industries'] = $industries;
$this->temp_variables['org_size'] = $sizes;
diff --git a/setup/wizard/template.php b/setup/wizard/template.php
index ba0f088..7f52075 100644
--- a/setup/wizard/template.php
+++ b/setup/wizard/template.php
@@ -40,63 +40,63 @@
* @version Version 0.1
*/
-class Template
+class Template
{
/**
* Hold all the variables that are going to be imported into the template file
* @var array
*/
- var $template_vars = Array();
+ var $template_vars = Array();
+
-
/**
* Constructor
- *
+ *
* @author KnowledgeTree Team
* @param string $file the file name you want to load
* @access public
* @return void
*/
- public function Template($file = null)
+ public function Template($file = null)
{
$this->file = $file;
}
-
+
/**
* Set a variable into the template
* If the variable is a template object, go and call its template::fetch() method
- *
+ *
* @author KnowledgeTree Team
* @param string $name The name for this value in the template file
* @param string $value The value to show in the template file
* @access public
* @return void
*/
- public function set($name, $value)
+ public function set($name, $value)
{
//if(is_a($value, 'Template')) {
$class = 'Template';
$isA = $value instanceof $class;
if($isA) {
- $value = $value->fetch();
+ $value = $value->fetch();
}
$this->template_vars[$name] = $value;
}
-
+
/**
* Create the template and import its variables
- *
+ *
* @author KnowledgeTree Team
* @param string $file The file to use as the template
* @access public
* @return string The parsed template
*/
- public function fetch($file = null)
+ public function fetch($file = null)
{
if (is_null($file)) $file = $this->file;
-
+
$file = WIZARD_DIR . $file;
if (!file_exists($file)) {
trigger_error('Template file '.$file.' does not exist ', E_USER_ERROR);
@@ -105,10 +105,10 @@ class Template
extract($this->template_vars); // Extract the vars to local namespace
ob_start();
include($file);
- $contents = ob_get_contents();
- ob_end_clean();
+ $contents = ob_get_contents();
+ ob_end_clean();
return $contents;
}
-
+
}
?>
\ No newline at end of file
diff --git a/setup/wizard/templates/complete.tpl b/setup/wizard/templates/complete.tpl
index 1b59b8f..108994d 100644
--- a/setup/wizard/templates/complete.tpl
+++ b/setup/wizard/templates/complete.tpl
@@ -1,48 +1,71 @@