From e7fecfdb6ecdd556bf267290dd06561fa9231dc3 Mon Sep 17 00:00:00 2001 From: Jarrett Jordaan Date: Fri, 26 Feb 2010 11:12:55 +0200 Subject: [PATCH] PT:2492070 : Fist Login wizard added --- setup/firstlogin/config/community_config.xml | 6 +++--- setup/firstlogin/config/config.xml | 4 ++-- setup/firstlogin/firstlogin.php | 9 +++++---- setup/firstlogin/firstloginWizard.php | 2 +- setup/firstlogin/steps/firstloginComplete.php | 2 +- setup/firstlogin/steps/firstloginTemplates.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++--- setup/firstlogin/templates/complete.tpl | 12 +++++++----- setup/firstlogin/templates/error.tpl | 2 +- setup/firstlogin/templates/templates.tpl | 38 ++++++++++++++++++++++++++++++++++++-- setup/firstlogin/templates/wizard.tpl | 6 +++--- setup/firstlogin/wSession.php | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup/migrate/migrateWizard.php | 2 +- setup/migrate/templates/error.tpl | 2 +- setup/migrate/templates/wizard.tpl | 2 +- setup/migrate/wSession.php | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup/upgrade/templates/error.tpl | 2 +- setup/upgrade/templates/progress.tpl | 2 +- setup/upgrade/templates/wizard.tpl | 2 +- setup/wizard/installWizard.php | 2 +- setup/wizard/lib/helpers/htmlHelper.php | 2 +- setup/wizard/path.php | 4 ++-- setup/wizard/resources/css/firstlogin.css | 8 +++++++- setup/wizard/resources/js/firstlogin.js | 34 +++++++++++++++++++++++++--------- setup/wizard/share/stepBase.php | 16 ++++++++++++++++ setup/wizard/templates/error.tpl | 2 +- setup/wizard/templates/wizard.tpl | 2 +- setup/wizard/wSession.php | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 27 files changed, 358 insertions(+), 47 deletions(-) create mode 100644 setup/firstlogin/wSession.php create mode 100644 setup/migrate/wSession.php create mode 100644 setup/wizard/wSession.php diff --git a/setup/firstlogin/config/community_config.xml b/setup/firstlogin/config/community_config.xml index 1197f86..1b91e4c 100644 --- a/setup/firstlogin/config/community_config.xml +++ b/setup/firstlogin/config/community_config.xml @@ -4,12 +4,12 @@ Document : config.xml Created on : 01 July 2009, 9:57 AM Author : KnowledgeTree Team - Description: First login steps + Description: Commercial steps --> - + templates complete - \ No newline at end of file + \ No newline at end of file diff --git a/setup/firstlogin/config/config.xml b/setup/firstlogin/config/config.xml index 1197f86..46e0ae9 100644 --- a/setup/firstlogin/config/config.xml +++ b/setup/firstlogin/config/config.xml @@ -7,9 +7,9 @@ Description: First login steps --> - + templates complete - \ No newline at end of file + \ No newline at end of file diff --git a/setup/firstlogin/firstlogin.php b/setup/firstlogin/firstlogin.php index 7555a53..c84393f 100644 --- a/setup/firstlogin/firstlogin.php +++ b/setup/firstlogin/firstlogin.php @@ -489,11 +489,9 @@ class firstlogin { private function loadNeeded() { $this->_readXml(); // Xml steps - // Make sure session is cleared - $this->_resetSessions(); + $this->_resetSessions(); // Make sure session is cleared $this->_loadFromSessions(); - if(isset($_POST['Next'])) { - $this->action = 'next'; + if(isset($_POST['Next'])) { $this->action = 'next'; $this->response = 'next'; } elseif (isset($_POST['Previous'])) { $this->action = 'previous'; @@ -504,6 +502,9 @@ class firstlogin { } elseif (isset($_POST['Edit'])) { $this->action = 'edit'; $this->response = 'next'; + } elseif (isset($_POST['Skip'])) { + $this->action = 'next'; + $this->response = 'next'; } else { $this->response = ''; $this->action = ''; diff --git a/setup/firstlogin/firstloginWizard.php b/setup/firstlogin/firstloginWizard.php index 0ddae3a..186ffdd 100644 --- a/setup/firstlogin/firstloginWizard.php +++ b/setup/firstlogin/firstloginWizard.php @@ -80,7 +80,7 @@ class firstloginWizard extends WizardBase { $ins = new firstlogin(); // Instantiate $ins->resolveErrors($response); // Run step } else { - $ins = new firstlogin(new Session()); // Instantiate and pass the session class + $ins = new firstlogin(new wSession()); // Instantiate and pass the session class $ins->step(); // Run step } } diff --git a/setup/firstlogin/steps/firstloginComplete.php b/setup/firstlogin/steps/firstloginComplete.php index 44717b6..d58aa14 100644 --- a/setup/firstlogin/steps/firstloginComplete.php +++ b/setup/firstlogin/steps/firstloginComplete.php @@ -68,7 +68,7 @@ class firstloginComplete extends Step { } function doRun() { - + return 'landing'; } diff --git a/setup/firstlogin/steps/firstloginTemplates.php b/setup/firstlogin/steps/firstloginTemplates.php index b3815d0..1703c50 100644 --- a/setup/firstlogin/steps/firstloginTemplates.php +++ b/setup/firstlogin/steps/firstloginTemplates.php @@ -43,6 +43,11 @@ * @version Version 0.1 */ +// Load needed system files. +require_once(SYSTEM_DIR . "config/dmsDefaults.php"); +require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); +require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); + class firstloginTemplates extends Step { /** * Flag if step needs to run silently @@ -62,18 +67,61 @@ class firstloginTemplates extends Step { */ function doStep() { $this->temp_variables = array( - "step_name"=>"folderstructures", + "step_name"=>"templates", "silent"=>$this->silent); - return $this->doRun(); + if(!$this->inStep("templates")) { // Landing + return 'landing'; + } + if($this->next()) { // Next click + $this->applyTemplates(); // Apply folder template structures + return 'next'; // And go to next step + } else if($this->skip()) { // Skip Step + return 'next'; + } + + $this->doRun(); // Set folder structure templates + return 'landing'; // Default to landing } function doRun() { - + $this->temp_variables['aFolderTemplates'] = $this->getTemplates(); return 'landing'; } + function applyTemplates() { + + } + + function getTemplates() { + if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active + $oRegistry =& KTPluginRegistry::getSingleton(); + $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin + return $oPlugin->getFirstLoginTemplates(); + } + } + + function getTemplateNodes() { + if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active + $oRegistry =& KTPluginRegistry::getSingleton(); + $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin + return $oPlugin->getFirstLoginTemplates(); + } + } + public function getErrors() { return $this->error; } + + /** + * Stores varibles used by template + * + * @author KnowledgeTree Team + * @params none + * @access public + * @return array + */ + public function getStepVars() { + return $this->temp_variables; + } } ?> \ No newline at end of file diff --git a/setup/firstlogin/templates/complete.tpl b/setup/firstlogin/templates/complete.tpl index 6fb0cd6..d5cb001 100644 --- a/setup/firstlogin/templates/complete.tpl +++ b/setup/firstlogin/templates/complete.tpl @@ -1,9 +1,11 @@ -
+

Preferences Completed

- -

Your system preferences have been applied

- - +

Your system preferences have been applied

+
+
+ js('form.js'); } ?> \ No newline at end of file diff --git a/setup/firstlogin/templates/error.tpl b/setup/firstlogin/templates/error.tpl index 5bd3fe9..bf75326 100644 --- a/setup/firstlogin/templates/error.tpl +++ b/setup/firstlogin/templates/error.tpl @@ -17,7 +17,7 @@ -
+
diff --git a/setup/firstlogin/templates/templates.tpl b/setup/firstlogin/templates/templates.tpl index 203c3ad..4e7abc6 100644 --- a/setup/firstlogin/templates/templates.tpl +++ b/setup/firstlogin/templates/templates.tpl @@ -1,8 +1,42 @@
-

Apply A Folder Template to KnowledgeTree

+

Apply Applying Templates

+

You can select a base folder layout to apply to your root folder of KnowledgeTree.

+
+

Choose a template, if you would like to generate predefined folders.

+

+
- +
+ + + + + + + + +
+
+
+
\ No newline at end of file diff --git a/setup/firstlogin/wSession.php b/setup/firstlogin/wSession.php new file mode 100644 index 0000000..fcd3d55 --- /dev/null +++ b/setup/firstlogin/wSession.php @@ -0,0 +1,62 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* Contributor( s): ______________________________________ +*/ + +/** +* +* @copyright 2008-2010, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package First Login +* @version Version 0.1 +*/ +class wSession extends SessionBase +{ + public $salt = 'firstlogin'; + + /** + * Constructs session object + * + * @author KnowledgeTree Team + * @access public + * @param none + */ + public function __construct() { + $this->setSalt($this->salt); + $this->startSession(); + } + +} +?> \ No newline at end of file diff --git a/setup/migrate/migrateWizard.php b/setup/migrate/migrateWizard.php index d695513..14ead3f 100644 --- a/setup/migrate/migrateWizard.php +++ b/setup/migrate/migrateWizard.php @@ -80,7 +80,7 @@ class MigrateWizard extends WizardBase { $ins = new Migrater(); // Instantiate the migrater $ins->resolveErrors($response); // Run step } else { - $ins = new Migrater(new Session()); // Instantiate the migrater and pass the session class + $ins = new Migrater(new wSession()); // Instantiate the migrater and pass the session class $ins->step(); // Run step } } diff --git a/setup/migrate/templates/error.tpl b/setup/migrate/templates/error.tpl index 0b2f86b..1f49699 100644 --- a/setup/migrate/templates/error.tpl +++ b/setup/migrate/templates/error.tpl @@ -17,7 +17,7 @@
-
+
diff --git a/setup/migrate/templates/wizard.tpl b/setup/migrate/templates/wizard.tpl index 717ca52..28493c2 100644 --- a/setup/migrate/templates/wizard.tpl +++ b/setup/migrate/templates/wizard.tpl @@ -26,7 +26,7 @@
-
+
-
+
-
+
-
+
-
+
diff --git a/setup/wizard/templates/wizard.tpl b/setup/wizard/templates/wizard.tpl index 9d3447d..e1d1209 100644 --- a/setup/wizard/templates/wizard.tpl +++ b/setup/wizard/templates/wizard.tpl @@ -25,7 +25,7 @@
-
+