testKT3.php
1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require_once("../../../config/dmsDefaults.php");
require_once(KT_LIB_DIR . "/templating/templating.inc.php");
require_once(KT_LIB_DIR . "/templating/kt3template.inc.php");
require_once(KT_LIB_DIR . "/dispatcher.inc.php");
$sectionName = "dashboard";
/*
* example code - tests the frontend behaviour. remember to check ajaxConditional.php
*
*/
class testKT3 extends KTStandardDispatcher {
// Breadcrumbs base - added to in methods
var $aBreadcrumbs = array(
array('action' => 'dashboard', 'name' => 'Test the New UI'),
array('action' => 'test', 'name' => 'Test the New UI'),
array('action' => 'test', 'name' => 'UI2'),
);
function do_main() {
return 'hello world';
}
function handleOutput($data) {
global $main;
$main->setBreadcrumbs($this->aBreadcrumbs);
$main->setBreadcrumbDetails("i, for one, welcome our smarty overlords.");
$main->setPageContents($data);
$main->render();
}
function getMasterFieldInfo($oFieldSet) {
global $default;
$masterField = $oFieldSet->getMasterField();
$sQuery = "SELECT md_cond.document_field_id AS document_field_id, md_cond.metadata_lookup_id AS val, md_lookup.name AS name FROM $default->md_condition_table AS md_cond LEFT JOIN $default->md_condition_chain_table AS md_chain ON (md_cond.id = md_chain.child_condition) LEFT JOIN $default->metadata_table AS md_lookup ON (md_cond.metadata_lookup_id = md_lookup.id) WHERE md_cond.document_field_id = ? ";
return DBUtil::getResultArray(array($sQuery, array($masterField)));
}
}
$oDispatcher = new testKT3();
$oDispatcher->dispatch();
?>