Commit c0b42cf0641c4f71a2a11b19f2df7ccbf7127075

Authored by Megan Watson
1 parent 756972b5

KTS-4276 Moved the templates into the templates directory and removed the addLocation function

"Templating "addLocation" not in plugin setup method"
Fixed.

Committed by: Megan Watson
plugins/search2/reporting/ExtractorInfo.php
... ... @@ -6,42 +6,42 @@
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
8 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
22   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 23 * California 94120-7775, or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 34 * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 *
37 37 */
38   -
  38 +
39 39 require_once(KT_LIB_DIR . '/dispatcher.inc.php');
40 40 require_once(KT_LIB_DIR . '/templating/templating.inc.php');
41 41 require_once(KT_LIB_DIR . '/mime.inc.php');
42 42  
43 43 class ExtractorInfoDispatcher extends KTAdminDispatcher {
44   -
  44 +
45 45  
46 46 function check() {
47 47 $this->aBreadcrumbs[] = array(
... ... @@ -52,60 +52,58 @@ class ExtractorInfoDispatcher extends KTAdminDispatcher {
52 52 }
53 53  
54 54 function do_main() {
55   -
  55 +
56 56 //registerTypes registers the mime types and populates the needed tables.
57 57 $indexer = Indexer::get();
58 58 $indexer->registerTypes();
59   -
  59 +
60 60 $oTemplating =& KTTemplating::getSingleton();
61   - $oTemplating->addLocation('Extractor Information', '/plugins/search2/reporting/templates');
62   -
63   - $oTemplate =& $oTemplating->loadTemplate('extractorinfo');
64   -
  61 + $oTemplate =& $oTemplating->loadTemplate('ktcore/search2/reporting/extractorinfo');
  62 +
65 63 $aExtractorInfo = KTMime::getMimeExtractorInformation();
66   -
  64 +
67 65 if(empty($aExtractorInfo))
68 66 {
69 67 $oTemplate->setData(array(
70 68 'context' => $this,
71 69 'extractor_info' => $aExtractorInfo
72 70 ));
73   -
74   - return $oTemplate;
  71 +
  72 + return $oTemplate;
75 73 }
76   -
  74 +
77 75 foreach($aExtractorInfo as $key=>$info)
78 76 {
79 77 $extractorClass = $info['name'];
80 78 $extractor = $indexer->getExtractor($extractorClass);
81 79 $info['mimeTypes'] = array();
82 80 $aMimeTypes = $this->getSupportedMimeTypesDB($extractorClass);//$extractor->getSupportedMimeTypes();
83   -
84   -
  81 +
  82 +
85 83 foreach($aMimeTypes as $mimeType)
86 84 {
87   - $sMimeInfo = KTMime::getFriendlyNameAndExtension($mimeType);
88   -
  85 + $sMimeInfo = KTMime::getFriendlyNameAndExtension($mimeType);
  86 +
89 87 $info['mimeTypes'][$mimeType] = array('description'=>$sMimeInfo[0]['friendly_name'], 'extensions'=>array($sMimeInfo[0]['filetypes']));
90   -
  88 +
91 89 $extensions = array();
92   - foreach($sMimeInfo as $item)
  90 + foreach($sMimeInfo as $item)
93 91 {
94 92 $extensions[] = $item['filetypes'];
95 93 }
96 94 $info['mimeTypes'][$mimeType]['extensions'] = implode(', ', $extensions);
97 95 }
98   -
99   - $aExtractorInfo[$key] = $info;
  96 +
  97 + $aExtractorInfo[$key] = $info;
100 98 }
101   -
  99 +
102 100 $oTemplate->setData(array(
103 101 'context' => $this,
104 102 'extractor_info' => $aExtractorInfo
105 103 ));
106 104 return $oTemplate;
107 105 }
108   -
  106 +
109 107 function getSupportedMimeTypesDB($sExtractorName)
110 108 {
111 109 $sQuery = "SELECT MT.mimetypes FROM mime_extractors as ME LEFT JOIN mime_types as MT ON " .
... ... @@ -118,7 +116,7 @@ class ExtractorInfoDispatcher extends KTAdminDispatcher {
118 116 if(!in_array($aTempRes[$i]['mimetypes'], $aRes))
119 117 {
120 118 $aRes[] = $aTempRes[$i]['mimetypes'];
121   -
  119 +
122 120 }
123 121 }
124 122 return $aRes;
... ...
plugins/search2/reporting/IndexErrors.php
... ... @@ -90,9 +90,7 @@ class IndexErrorsDispatcher extends KTAdminDispatcher {
90 90 }
91 91  
92 92 $oTemplating =& KTTemplating::getSingleton();
93   - $oTemplating->addLocation('Index Errors', '/plugins/search2/reporting/templates');
94   -
95   - $oTemplate =& $oTemplating->loadTemplate('indexerrors');
  93 + $oTemplate =& $oTemplating->loadTemplate('ktcore/search2/reporting/indexerrors');
96 94  
97 95 $aIndexerValues = Indexer::getIndexingQueue();
98 96 foreach($aIndexerValues as $key=>$doc)
... ...
plugins/search2/reporting/ManageMimeTypes.php
... ... @@ -6,40 +6,40 @@
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
8 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
22   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 23 * California 94120-7775, or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 34 * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 *
37 37 */
38   -require_once(KT_LIB_DIR . '/dispatcher.inc.php');
39   -require_once(KT_LIB_DIR . '/templating/templating.inc.php');
  38 +require_once(KT_LIB_DIR . '/dispatcher.inc.php');
  39 +require_once(KT_LIB_DIR . '/templating/templating.inc.php');
40 40 require_once(KT_LIB_DIR . '/mime.inc.php');
41 41  
42   -class ManageMimeTypesDispatcher extends KTAdminDispatcher {
  42 +class ManageMimeTypesDispatcher extends KTAdminDispatcher {
43 43  
44 44 function check() {
45 45 $this->aBreadcrumbs[] = array(
... ... @@ -50,23 +50,21 @@ class ManageMimeTypesDispatcher extends KTAdminDispatcher {
50 50 }
51 51  
52 52 function do_main() {
53   -
54   - //registerTypes registers the mime types and populates the needed tables.
  53 +
  54 + //registerTypes registers the mime types and populates the needed tables.
55 55 $indexer = Indexer::get();
56 56 $indexer->registerTypes();
57   -
  57 +
58 58 $oTemplating =& KTTemplating::getSingleton();
59   - $oTemplating->addLocation('Manage Mime Type Plugin', '/plugins/search2/reporting/templates');
  59 + $oTemplate =& $oTemplating->loadTemplate('ktcore/search2/reporting/managemimetypes');
60 60  
61   - $oTemplate =& $oTemplating->loadTemplate('managemimetypes');
62   -
63 61 $aMimeTypes = KTMime::getAllMimeTypesInformation();
64   -
65   - $indexer = Indexer::get();
66   -
  62 +
  63 + $indexer = Indexer::get();
  64 +
67 65 $numExtensions = 0;
68 66 $numIndexedExtensions = 0;
69   -
  67 +
70 68 foreach($aMimeTypes as $key=>$mimeType)
71 69 {
72 70 $extractorClass = $mimeType['extractor'];
... ... @@ -78,21 +76,21 @@ class ManageMimeTypesDispatcher extends KTAdminDispatcher {
78 76 $extractor = $indexer->getExtractor($extractorClass);
79 77 $aMimeTypes[$key]['extractor'] = $extractor->getDisplayName();
80 78 $numIndexedExtensions++;
81   - }
82   -
  79 + }
  80 +
83 81 $indexedPercentage = 0;
84 82 if ($numExtensions > 0)
85 83 {
86 84 $indexedPercentage = number_format(($numIndexedExtensions * 100)/$numExtensions,2,'.',',');
87 85 }
88   -
  86 +
89 87 $oTemplate->setData(array(
90 88 'context' => $this,
91 89 'mime_types' => $aMimeTypes,
92 90 'numExtensions'=>$numExtensions,
93 91 'numIndexedExtensions'=>$numIndexedExtensions,
94 92 'indexedPercentage'=>$indexedPercentage
95   -
  93 +
96 94 ));
97 95 return $oTemplate;
98 96 }
... ...
plugins/search2/reporting/PendingDocuments.php
... ... @@ -6,31 +6,31 @@
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
8 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
22   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 23 * California 94120-7775, or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 34 * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 *
... ... @@ -69,8 +69,7 @@ class PendingDocumentsDispatcher extends KTAdminDispatcher
69 69 }
70 70  
71 71 $oTemplating =& KTTemplating::getSingleton();
72   - $oTemplating->addLocation('Pending Documents', '/plugins/search2/reporting/templates');
73   - $oTemplate =& $oTemplating->loadTemplate('pendingdocuments');
  72 + $oTemplate =& $oTemplating->loadTemplate('ktcore/search2/reporting/pendingdocuments');
74 73  
75 74 $config = KTConfig::getSingleton();
76 75 $rootUrl = $config->get('KnowledgeTree/rootUrl');
... ...
plugins/search2/reporting/RescheduleDocuments.php
... ... @@ -6,40 +6,40 @@
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
8 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
22   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 23 * California 94120-7775, or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 34 * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 *
37 37 */
38   -
39   -require_once(KT_LIB_DIR . '/dispatcher.inc.php');
40   -require_once(KT_LIB_DIR . '/templating/templating.inc.php');
41 38  
42   -class RescheduleDocumentsDispatcher extends KTAdminDispatcher
  39 +require_once(KT_LIB_DIR . '/dispatcher.inc.php');
  40 +require_once(KT_LIB_DIR . '/templating/templating.inc.php');
  41 +
  42 +class RescheduleDocumentsDispatcher extends KTAdminDispatcher
43 43 {
44 44 function check() {
45 45 $this->aBreadcrumbs[] = array(
... ... @@ -50,17 +50,14 @@ class RescheduleDocumentsDispatcher extends KTAdminDispatcher
50 50 }
51 51  
52 52 function do_main() {
53   -
54   - //registerTypes registers the mime types and populates the needed tables.
  53 +
  54 + //registerTypes registers the mime types and populates the needed tables.
55 55 $indexer = Indexer::get();
56 56 $indexer->registerTypes();
57   -
  57 +
58 58 $oTemplating =& KTTemplating::getSingleton();
59   - $oTemplating->addLocation('Reschedule Documents', '/plugins/search2/reporting/templates');
60   -
61   -
62   - $oTemplate =& $oTemplating->loadTemplate('rescheduledocuments');
63   -
  59 + $oTemplate =& $oTemplating->loadTemplate('ktcore/search2/reporting/rescheduledocuments');
  60 +
64 61 if ($_REQUEST['rescheduleValue'] == 'reschedule')
65 62 {
66 63 Indexer::indexAll();
... ... @@ -70,14 +67,14 @@ class RescheduleDocumentsDispatcher extends KTAdminDispatcher
70 67 ));
71 68 return $oTemplate;
72 69 }
73   -
  70 +
74 71 $oTemplate->setData(array(
75 72 'context' => $this,
76 73 'rescheduleDone' => false
77   -
  74 +
78 75 ));
79 76 return $oTemplate;
80   - }
  77 + }
81 78 }
82 79  
83 80 ?>
... ...
plugins/search2/reporting/templates/extractorinfo.smarty renamed to templates/ktcore/search2/reporting/extractorinfo.smarty
plugins/search2/reporting/templates/indexerrors.smarty renamed to templates/ktcore/search2/reporting/indexerrors.smarty
plugins/search2/reporting/templates/managemimetypes.smarty renamed to templates/ktcore/search2/reporting/managemimetypes.smarty
plugins/search2/reporting/templates/pendingdocuments.smarty renamed to templates/ktcore/search2/reporting/pendingdocuments.smarty
plugins/search2/reporting/templates/rescheduledocuments.smarty renamed to templates/ktcore/search2/reporting/rescheduledocuments.smarty