diff --git a/setup/firstlogin/steps/firstloginTemplates.php b/setup/firstlogin/steps/firstloginTemplates.php index 1703c50..6020c32 100644 --- a/setup/firstlogin/steps/firstloginTemplates.php +++ b/setup/firstlogin/steps/firstloginTemplates.php @@ -70,6 +70,7 @@ class firstloginTemplates extends Step { "step_name"=>"templates", "silent"=>$this->silent); if(!$this->inStep("templates")) { // Landing + $this->doRun(); // Set folder structure templates return 'landing'; } if($this->next()) { // Next click @@ -89,7 +90,16 @@ class firstloginTemplates extends Step { } function applyTemplates() { + $templateId = KTUtil::arrayGet($_POST['data'], "templateId", 0); + if($templateId > 0) { + 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->applyFolderTemplate($templateId, 1); + } + } + return false; } function getTemplates() { diff --git a/setup/firstlogin/templates/templates.tpl b/setup/firstlogin/templates/templates.tpl index 4e7abc6..35c7d84 100644 --- a/setup/firstlogin/templates/templates.tpl +++ b/setup/firstlogin/templates/templates.tpl @@ -1,40 +1,49 @@
-

Apply Applying Templates

+

Apply 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.

-

- -
-
- -

+ - - - - - -
-
+ +
+ + + Folder Template Layout : +
+
+
+ + + + + + + + + + +
+
diff --git a/setup/firstlogin/templates/wizard.tpl b/setup/firstlogin/templates/wizard.tpl index 85c7104..7d9d482 100644 --- a/setup/firstlogin/templates/wizard.tpl +++ b/setup/firstlogin/templates/wizard.tpl @@ -8,8 +8,8 @@ js('jquery.blockUI.js'); ?> js('jquery.hotkeys.js'); ?> js('firstlogin.js'); ?> - css('wizard.css'); ?> css('firstlogin.css'); ?> + css('wizard.css'); ?> css('ie6.css'); ?> css('ie7.css'); ?> css('ie8.css'); ?> @@ -49,5 +49,5 @@ \ No newline at end of file diff --git a/setup/wizard/resources/css/firstlogin.css b/setup/wizard/resources/css/firstlogin.css index d829016..d4ec4f5 100644 --- a/setup/wizard/resources/css/firstlogin.css +++ b/setup/wizard/resources/css/firstlogin.css @@ -9,4 +9,65 @@ float:right; margin-left:5px; margin-top:10px; +} + +.tree_icon { + float:left; + height:16px; + width:16px; + cursor: pointer; +} + +.tree_folder { + background-image:url(../../../../thirdparty/icon-theme/16x16/mimetypes/x-directory-normal.png); +} + +#tree_editable { + float : right; + width: 700px; +} + +.tree_navigation { + align : left; + width:600px; + min-height: 200px; + float:left; +} + +.tree_table { + width:100%; +} + +.tree_table td { + float:left; + line-height:1.8em; + padding: 0px 0px; +} + +.outer { + align : left; +} + +.tree_node_edit { + background-image:url(../../../../thirdparty/icon-theme/16x16/actions/document-properties.png); +} + +.tree_node_delete { + background-image:url(../../../../resources/graphics/delete.png); +} + +.tree_node_add { + background-image:url(../../../../thirdparty/icon-theme/16x16/actions/add.gif); +} + +.tree_node_description { + background-image:url(graphics/question.gif); +} + +#template_options { + width : 20px; +} + +.action_form { + margin-left:35px; } \ No newline at end of file diff --git a/setup/wizard/resources/css/wizard.css b/setup/wizard/resources/css/wizard.css index 73b06bb..514535b 100644 --- a/setup/wizard/resources/css/wizard.css +++ b/setup/wizard/resources/css/wizard.css @@ -54,7 +54,6 @@ th { td { padding: 2px 5px; - /*width: 190px;*/ } select { diff --git a/setup/wizard/resources/js/firstlogin.js b/setup/wizard/resources/js/firstlogin.js index d728630..5372261 100644 --- a/setup/wizard/resources/js/firstlogin.js +++ b/setup/wizard/resources/js/firstlogin.js @@ -1,18 +1,56 @@ -// Class Wizard -var ajaxOn; -var ktfolderAccess = "plugins/commercial/folder-templates/KTFolderTemplates.php?action="; +// Class First Login +//TODO : Plugin path in js +var ktfolderAccess = "../../plugins/commercial/folder-templates/KTFolderTemplates.php?action="; var ktmanageFolderAccess = "admin.php?kt_path_info=misc/adminfoldertemplatesmanagement&action="; -var actionForm = false; +$(function() { // Document is ready + if($("#wrapper").attr('class') != 'wizard') {// Check if we in a wizard, or on the dashboard + showForm(); // Display first login wizard + } +}); -function firstlogin() { +function firstlogin(rootUrl) { + this.ktfolderAccess = rootUrl + "plugins/commercial/folder-templates/KTFolderTemplates.php?action="; + this.ktmanageFolderAccess = rootUrl + "admin.php?kt_path_info=misc/adminfoldertemplatesmanagement&action="; this.ajaxOn = false; } -var showFolderTemplateTree = function(templateId) { - alert($('template_' + templateId).attr('style')); - $('template_' + templateId).attr('style', 'display:block'); // Show template -// var address = this.ktfolderAccess + "getTemplateNodes&templateId="+templateId; -// getUrl("templates_" + templateId, "template_" + templateId, address); +firstlogin.prototype.showFolderTemplateTree = function(templateId) { + this.hideFolderTemplateTrees(); + $('#template_' + templateId).attr('style', 'display:block'); // Show template + $('#templates_' + templateId).attr('style', 'display:block'); // Show template nodes + this.showFolderTemplateNodes(templateId); +} + +firstlogin.prototype.openNode = function(node_id) { + var address = this.ktfolderAccess + "getNodes&node_id="+node_id + "&firstlogin=1"; + this.nodeAction("nodes_" + node_id, "node_" + node_id, address); +} + +firstlogin.prototype.openTemplate = function(templateId) { + var address = this.ktfolderAccess + "getTemplateNodes&templateId="+templateId + "&firstlogin=1"; + this.nodeAction("templates_" + templateId, "template_" + templateId, address); +} + +firstlogin.prototype.showFolderTemplateNodes = function(templateId) { + var address = this.ktfolderAccess + "getTemplateNodes&templateId=" + templateId + "&firstlogin=1"; + getUrl(address, "templates_" + templateId); +} + +firstlogin.prototype.hideFolderTemplateTrees = function() { + $('.templates').each( + function() { + $(this).attr('style', 'display:none'); + } + ); + $('.template_nodes').each( + function() { + $(this).attr('style', 'display:none'); + } + ); +} + +firstlogin.prototype.showNodeOptions = function() { + } /* @@ -55,7 +93,17 @@ var getUrl = function (address, div) { }); } -$(function() { // Document is ready - if($("#wrapper").attr('class') != 'wizard') // Check if we in a wizard, or on the dashboard - showForm(); // Display first login wizard -}); +// Node clicked +firstlogin.prototype.nodeAction = function(updateContentDiv, updateDiv, address) { + var className = $("#"+updateDiv).attr('class'); + state = className.split(' '); + if(state[2] == 'closed') { + getUrl(address, updateContentDiv); + $("#"+updateDiv).attr('class', 'tree_icon tree_folder open'); // Replace the closed class name to open + } else { + $("#"+updateContentDiv).empty(); // Empty out that tree. + $("#"+updateDiv).attr('class', 'tree_icon tree_folder closed'); // Replace the opened class name to close + } +} + +