Commit 3272527dff77bdb6352c6a1d848354d9171cb441

Authored by Jarrett Jordaan
1 parent 40ed47b9

PT-2492070 : Login wizard cleanup.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/firstlogin/stepAction.php
@@ -84,10 +84,8 @@ class stepAction extends stepActionBase { @@ -84,10 +84,8 @@ class stepAction extends stepActionBase {
84 $vars['left'] = $left; // Set left menu 84 $vars['left'] = $left; // Set left menu
85 $vars['fl_version'] = $this->properties['fl_version']; // Set version 85 $vars['fl_version'] = $this->properties['fl_version']; // Set version
86 $vars['fl_type'] = $this->properties['fl_type']; // Set type 86 $vars['fl_type'] = $this->properties['fl_type']; // Set type
87 - if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active  
88 - $oRegistry =& KTPluginRegistry::getSingleton();  
89 - $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin  
90 - $ft_dir = $oPlugin->getDirs(); 87 + if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active
  88 + $ft_dir = FolderTemplatesPlugin_RDIR . DIRECTORY_SEPARATOR . "KTFolderTemplates.php";
91 } 89 }
92 $vars['ft_handle'] = $ft_dir; // Set type 90 $vars['ft_handle'] = $ft_dir; // Set type
93 return $vars; 91 return $vars;
setup/firstlogin/steps/firstloginComplete.php
@@ -77,10 +77,8 @@ class firstloginComplete extends Step { @@ -77,10 +77,8 @@ class firstloginComplete extends Step {
77 77
78 function doRun() { 78 function doRun() {
79 $ft_dir = ""; 79 $ft_dir = "";
80 - if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active  
81 - $oRegistry =& KTPluginRegistry::getSingleton();  
82 - $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin  
83 - $ft_dir = $oPlugin->getDirs(); 80 + if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active
  81 + $ft_dir = FolderTemplatesPlugin_RDIR . DIRECTORY_SEPARATOR . "KTFolderTemplates.php";
84 } 82 }
85 $this->temp_variables['ft_dir'] = $ft_dir; 83 $this->temp_variables['ft_dir'] = $ft_dir;
86 84
setup/firstlogin/steps/firstloginTemplates.php
@@ -87,10 +87,8 @@ class firstloginTemplates extends Step { @@ -87,10 +87,8 @@ class firstloginTemplates extends Step {
87 87
88 function doRun() { 88 function doRun() {
89 $ft_dir = ""; 89 $ft_dir = "";
90 - if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active  
91 - $oRegistry =& KTPluginRegistry::getSingleton();  
92 - $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin  
93 - $ft_dir = $oPlugin->getDirs(); 90 + if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active
  91 + $ft_dir = FolderTemplatesPlugin_RDIR . DIRECTORY_SEPARATOR . "KTFolderTemplates.php";
94 } 92 }
95 $this->temp_variables['aFolderTemplates'] = $this->getTemplates(); 93 $this->temp_variables['aFolderTemplates'] = $this->getTemplates();
96 $this->temp_variables['ft_dir'] = $ft_dir; 94 $this->temp_variables['ft_dir'] = $ft_dir;
@@ -103,28 +101,18 @@ class firstloginTemplates extends Step { @@ -103,28 +101,18 @@ class firstloginTemplates extends Step {
103 $templateId = KTUtil::arrayGet($_GET, "templateId", 0);// Could be ajax call 101 $templateId = KTUtil::arrayGet($_GET, "templateId", 0);// Could be ajax call
104 } 102 }
105 if($templateId > 0) { 103 if($templateId > 0) {
106 - if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active  
107 - $oRegistry =& KTPluginRegistry::getSingleton();  
108 - $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin  
109 - return $oPlugin->firstLoginAction(1, $templateId); 104 + if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active
  105 + require_once(FolderTemplatesPlugin_DIR . DIRECTORY_SEPARATOR . "FolderTemplate.inc.php");
  106 + return FolderTemplates::firstLoginAction(1, $templateId);
110 } 107 }
111 } 108 }
112 return false; 109 return false;
113 } 110 }
114 111
115 function getTemplates() { 112 function getTemplates() {
116 - if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active  
117 - $oRegistry =& KTPluginRegistry::getSingleton();  
118 - $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin  
119 - return $oPlugin->getFirstLoginTemplates();  
120 - }  
121 - }  
122 -  
123 - function getTemplateNodes() {  
124 - if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active  
125 - $oRegistry =& KTPluginRegistry::getSingleton();  
126 - $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin  
127 - return $oPlugin->getFirstLoginTemplates(); 113 + if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active
  114 + require_once(FolderTemplatesPlugin_DIR . DIRECTORY_SEPARATOR . "FolderTemplate.inc.php");
  115 + return FolderTemplates::getList();
128 } 116 }
129 } 117 }
130 118
setup/firstlogin/templates/templates.tpl
@@ -28,6 +28,9 @@ @@ -28,6 +28,9 @@
28 ?> 28 ?>
29 <tr class="templates" style="display:none;" id="template_<?php echo $oFolderTemplate->getId(); ?>"> 29 <tr class="templates" style="display:none;" id="template_<?php echo $oFolderTemplate->getId(); ?>">
30 <td> 30 <td>
  31 + <div id="tconnector_template_<?php echo $oFolderTemplate->getId(); ?>" class="tree_icon connector-open-first open-first">&nbsp;</div>
  32 + </td>
  33 + <td>
31 <div class="tree_icon tree_folder closed">&nbsp;</div> 34 <div class="tree_icon tree_folder closed">&nbsp;</div>
32 </td> 35 </td>
33 <td> 36 <td>
setup/wizard/resources/css/firstlogin.css
@@ -27,7 +27,36 @@ @@ -27,7 +27,36 @@
27 } 27 }
28 28
29 .tree_folder { 29 .tree_folder {
30 - background-image:url(../../../../thirdparty/icon-theme/16x16/mimetypes/x-directory-normal.png); 30 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/folder.gif);
  31 +}
  32 +
  33 +.open {
  34 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/folder-open.gif);
  35 +}
  36 +/* TODO: Check connectors again */
  37 +
  38 +.connector-closed {
  39 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-plus.gif);
  40 +}
  41 +
  42 +.connector-closed-first {
  43 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-plus.gif);
  44 +}
  45 +
  46 +.connector-closed-end {
  47 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-end-plus.gif);
  48 +}
  49 +
  50 +.connector-open {
  51 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-minus.gif);
  52 +}
  53 +
  54 +.connector-open-first {
  55 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-minus.gif);
  56 +}
  57 +
  58 +.connector-open-end {
  59 + background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-end-minus.gif);
31 } 60 }
32 61
33 #tree_editable { 62 #tree_editable {
setup/wizard/resources/js/firstlogin.js
@@ -27,6 +27,11 @@ firstlogin.prototype.openNode = function(node_id) { @@ -27,6 +27,11 @@ firstlogin.prototype.openNode = function(node_id) {
27 this.nodeAction("nodes_" + node_id, "node_" + node_id, address); 27 this.nodeAction("nodes_" + node_id, "node_" + node_id, address);
28 } 28 }
29 29
  30 +firstlogin.prototype.getNodes = function(node_id) {
  31 + var address = this.ktfolderAccess + "getNodes&node_id="+node_id;
  32 + this.nodeAction("nodes_" + node_id, "node_" + node_id, address);
  33 +};
  34 +
30 firstlogin.prototype.openTemplate = function(templateId) { 35 firstlogin.prototype.openTemplate = function(templateId) {
31 var address = this.ktfolderAccess + "getTemplateNodes&templateId="+templateId + "&firstlogin=1"; 36 var address = this.ktfolderAccess + "getTemplateNodes&templateId="+templateId + "&firstlogin=1";
32 this.nodeAction("templates_" + templateId, "template_" + templateId, address); 37 this.nodeAction("templates_" + templateId, "template_" + templateId, address);