Commit 778e46c5f894e7bb9ad6174aa9a058f6602bf405

Authored by Paul Barrett
2 parents 24752237 2b01a285

Merge branch 'edge' of github.com:ktgit/knowledgetree into edge

ktwebservice/KTUploadManager.inc.php
@@ -201,7 +201,7 @@ class KTUploadManager @@ -201,7 +201,7 @@ class KTUploadManager
201 { 201 {
202 $filename=basename($filename); 202 $filename=basename($filename);
203 $now=date('Y-m-d H:i:s'); 203 $now=date('Y-m-d H:i:s');
204 - $now_str=date('YmdHis'); 204 + $now_str=date('YmdHis') + rand(0, 32768);
205 205
206 // Ensure the temp directory exists otherwise an error is thrown. 206 // Ensure the temp directory exists otherwise an error is thrown.
207 if (realpath($this->temp_dir) == FALSE) { 207 if (realpath($this->temp_dir) == FALSE) {
setup/firstlogin/steps/firstloginTemplates.php
@@ -91,19 +91,24 @@ class firstloginTemplates extends Step { @@ -91,19 +91,24 @@ class firstloginTemplates extends Step {
91 $ft_dir = FolderTemplatesPlugin_RDIR . DIRECTORY_SEPARATOR . "KTFolderTemplates.php"; 91 $ft_dir = FolderTemplatesPlugin_RDIR . DIRECTORY_SEPARATOR . "KTFolderTemplates.php";
92 } 92 }
93 $this->temp_variables['aFolderTemplates'] = $this->getTemplates(); 93 $this->temp_variables['aFolderTemplates'] = $this->getTemplates();
  94 + $ftr = new FolderTemplateRenders(1);
  95 + $this->temp_variables['aTemplates'] = $ftr->renderTemplates();
94 $this->temp_variables['ft_dir'] = $ft_dir; 96 $this->temp_variables['ft_dir'] = $ft_dir;
95 return 'landing'; 97 return 'landing';
96 } 98 }
97 99
98 function applyTemplates() { 100 function applyTemplates() {
99 $templateId = KTUtil::arrayGet($_POST['data'], "templateId", 0); 101 $templateId = KTUtil::arrayGet($_POST['data'], "templateId", 0);
  102 + $folderId = KTUtil::arrayGet($_POST['data'], "folderId", 1);
100 if($templateId < 1) { 103 if($templateId < 1) {
101 $templateId = KTUtil::arrayGet($_GET, "templateId", 0);// Could be ajax call 104 $templateId = KTUtil::arrayGet($_GET, "templateId", 0);// Could be ajax call
102 } 105 }
103 if($templateId > 0) { 106 if($templateId > 0) {
104 if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active 107 if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active
  108 +
105 require_once(FolderTemplatesPlugin_DIR . DIRECTORY_SEPARATOR . "FolderTemplate.inc.php"); 109 require_once(FolderTemplatesPlugin_DIR . DIRECTORY_SEPARATOR . "FolderTemplate.inc.php");
106 - return FolderTemplates::firstLoginAction(1, $templateId); 110 +
  111 + return FolderTemplates::firstLoginAction($folderId, $templateId);
107 } 112 }
108 } 113 }
109 return false; 114 return false;
@@ -112,6 +117,7 @@ class firstloginTemplates extends Step { @@ -112,6 +117,7 @@ class firstloginTemplates extends Step {
112 function getTemplates() { 117 function getTemplates() {
113 if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active 118 if (KTPluginUtil::pluginIsActive('folder.templates.plugin')) { // Check if folder templates plugin is active
114 require_once(FolderTemplatesPlugin_DIR . DIRECTORY_SEPARATOR . "FolderTemplate.inc.php"); 119 require_once(FolderTemplatesPlugin_DIR . DIRECTORY_SEPARATOR . "FolderTemplate.inc.php");
  120 +
115 return FolderTemplates::getList(); 121 return FolderTemplates::getList();
116 } 122 }
117 } 123 }
setup/firstlogin/templates/templates.tpl
@@ -16,39 +16,56 @@ @@ -16,39 +16,56 @@
16 ?> 16 ?>
17 </select> 17 </select>
18 </div> 18 </div>
19 -<!-- <br>-->  
20 -<!-- <br>-->  
21 Folder Template Layout : 19 Folder Template Layout :
22 <br> 20 <br>
23 <br> 21 <br>
24 - <div class="tree_navigation">  
25 - <table cellspacing="0" class="tree_table">  
26 - <?php  
27 - foreach ($aFolderTemplates as $oFolderTemplate) {  
28 - ?>  
29 - <tr class="templates" style="display:none;" id="template_<?php echo $oFolderTemplate->getId(); ?>">  
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>  
34 - <div class="tree_icon tree_folder closed">&nbsp;</div>  
35 - </td>  
36 - <td>  
37 - <label>  
38 - <?php  
39 - echo $oFolderTemplate->getName();  
40 - ?>  
41 - </label>  
42 - </td>  
43 - </tr>  
44 - <tr>  
45 - <td id="templates_<?php echo $oFolderTemplate->getId(); ?>" class="templates"></td>  
46 - </tr>  
47 - <?php  
48 - }  
49 - ?>  
50 - </table>  
51 - </div> 22 + <div class="tree_navigation">
  23 + <table class="tree_table main" cellspacing="0" cellpadding="0">
  24 + <tbody>
  25 + <tr>
  26 + <td>
  27 + <div id="tree_edit"></div>
  28 + </td>
  29 + </tr>
  30 + <tr>
  31 + <td>
  32 + <div id="templatesNode">
  33 + <table class="tree_table aContainer" cellspacing="0" cellpadding="0">
  34 + <tbody>
  35 + <tr>
  36 + <td>
  37 + <?php
  38 + foreach ($aFolderTemplates as $oFolderTemplate) {
  39 + ?>
  40 + <table class="templates" cellspacing="0" cellpadding="0" id="template_<?php echo $oFolderTemplate->getId(); ?>" style="display:none;">
  41 + <tr>
  42 + <td><div id="tconnector_template_<?php echo $oFolderTemplate->getId(); ?>" class="tree_icon connector-open-first open-first">&nbsp;</div></td>
  43 + <td>
  44 + <div class="tree_icon tree_folder closed">&nbsp;</div>
  45 + </td>
  46 + <td>
  47 + <label> <?php echo $oFolderTemplate->getName(); ?> </label>
  48 + </td>
  49 + </tr>
  50 + </table>
  51 + <table class="tree_table" cellspacing="0" cellpadding="0">
  52 + <tr>
  53 + <td id="templates_<?php echo $oFolderTemplate->getId(); ?>" class="template_nodes"></td>
  54 + </tr>
  55 + </table>
  56 + <?php
  57 + }
  58 + ?>
  59 + <td>
  60 + </tr>
  61 + </tbody>
  62 + </table>
  63 + </div>
  64 + </td>
  65 + </tr>
  66 + </tbody>
  67 + </table>
  68 + </div>
52 </div> 69 </div>
53 <input id="skip" type="submit" name="Skip" value="Skip" class="button_skip"/> 70 <input id="skip" type="submit" name="Skip" value="Skip" class="button_skip"/>
54 <input id="next" type="submit" name="Next" value="Next" class="button_next"/> 71 <input id="next" type="submit" name="Next" value="Next" class="button_next"/>
setup/firstlogin/templates/wizard.tpl
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
12 <?php if(AGENT == "IE6") echo $html->css('ie6.css'); ?> 12 <?php if(AGENT == "IE6") echo $html->css('ie6.css'); ?>
13 <?php if(AGENT == "IE7") echo $html->css('ie7.css'); ?> 13 <?php if(AGENT == "IE7") echo $html->css('ie7.css'); ?>
14 <?php if(AGENT == "IE8") echo $html->css('ie8.css'); ?> 14 <?php if(AGENT == "IE8") echo $html->css('ie8.css'); ?>
  15 + <?php if(AGENT == "ff2") echo $html->css('ff2.css'); ?>
15 <?php if(INSTALL_TYPE == "community") echo $html->css('community.css'); ?> 16 <?php if(INSTALL_TYPE == "community") echo $html->css('community.css'); ?>
16 <meta http-equiv=Content-Type content="text/html; charset=utf-8"> 17 <meta http-equiv=Content-Type content="text/html; charset=utf-8">
17 </head> 18 </head>
setup/wizard/path.php
@@ -51,6 +51,8 @@ @@ -51,6 +51,8 @@
51 define('AGENT', 'IE7'); 51 define('AGENT', 'IE7');
52 } else if(preg_match("/MSIE 8\.\d/", $browser)) { 52 } else if(preg_match("/MSIE 8\.\d/", $browser)) {
53 define('AGENT', 'IE8'); 53 define('AGENT', 'IE8');
  54 + } else if(preg_match("/Firefox\/2\.\d/", $browser)) {
  55 + define('AGENT', 'FF2');
54 } else { 56 } else {
55 define('AGENT', 'OTHER'); 57 define('AGENT', 'OTHER');
56 } 58 }
setup/wizard/resources/css/ff2.css 0 โ†’ 100644
  1 +.tree_table { /* Override */
  2 + width:700px;
  3 +}
setup/wizard/resources/css/firstlogin.css
1 -#outer-wrapper {  
2 - width:900px;  
3 -}  
4 -  
5 #logo { 1 #logo {
6 right:70%; 2 right:70%;
7 } 3 }
@@ -19,11 +15,9 @@ @@ -19,11 +15,9 @@
19 margin-top:10px; 15 margin-top:10px;
20 } 16 }
21 17
22 -.tree_icon {  
23 - float:left;  
24 - height:16px;  
25 - width:16px;  
26 - cursor: pointer; 18 +
  19 +#template_options {
  20 + width : 20px;
27 } 21 }
28 22
29 .tree_folder { 23 .tree_folder {
@@ -59,32 +53,6 @@ @@ -59,32 +53,6 @@
59 background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-end-minus.gif); 53 background-image:url(../../../../thirdpartyjs/extjs/resources/images/default/tree/elbow-end-minus.gif);
60 } 54 }
61 55
62 -#tree_editable {  
63 - float : right;  
64 - width: 700px;  
65 -}  
66 -  
67 -.tree_navigation {  
68 - align : left;  
69 - width:600px;  
70 - min-height: 200px;  
71 - float:left;  
72 -}  
73 -  
74 -.tree_table {  
75 - width:100%;  
76 -}  
77 -  
78 -.tree_table td {  
79 - float:left;  
80 - line-height:1.8em;  
81 - padding: 0px 0px;  
82 -}  
83 -  
84 -.outer {  
85 - align : left;  
86 -}  
87 -  
88 .tree_node_edit { 56 .tree_node_edit {
89 background-image:url(../../../../thirdparty/icon-theme/16x16/actions/document-properties.png); 57 background-image:url(../../../../thirdparty/icon-theme/16x16/actions/document-properties.png);
90 } 58 }
@@ -101,10 +69,23 @@ @@ -101,10 +69,23 @@
101 background-image:url(graphics/question.gif); 69 background-image:url(graphics/question.gif);
102 } 70 }
103 71
104 -#template_options {  
105 - width : 20px; 72 +#tree_editable {
  73 + float : right;
  74 + width: 700px;
  75 +}
  76 +
  77 +.tree_table td {
  78 + float:left;
  79 + padding: 1px 1px;
106 } 80 }
107 81
108 .action_form { 82 .action_form {
109 margin-left:35px; 83 margin-left:35px;
  84 +}
  85 +
  86 +.tree_icon {
  87 + float:left;
  88 + height:16px;
  89 + width:16px;
  90 + cursor: pointer;
110 } 91 }
111 \ No newline at end of file 92 \ No newline at end of file
setup/wizard/resources/css/ie7.css
1 #logo { 1 #logo {
2 right:70%; 2 right:70%;
3 } 3 }
  4 +
setup/wizard/resources/js/firstlogin.js
@@ -10,7 +10,6 @@ jQuery(function() { // Document is ready @@ -10,7 +10,6 @@ jQuery(function() { // Document is ready
10 function firstlogin(rootUrl, pluginHandle) { 10 function firstlogin(rootUrl, pluginHandle) {
11 this.rootUrl = rootUrl + "/"; 11 this.rootUrl = rootUrl + "/";
12 this.ktfolderAccess = rootUrl + "/" + pluginHandle + "?action="; 12 this.ktfolderAccess = rootUrl + "/" + pluginHandle + "?action=";
13 - this.ktmanageFolderAccess = rootUrl + "/" + "admin.php?kt_path_info=misc/adminfoldertemplatesmanagement&action=";  
14 this.ajaxOn = false; 13 this.ajaxOn = false;
15 } 14 }
16 15