本文整理汇总了PHP中KTTemplating类的典型用法代码示例。如果您正苦于以下问题:PHP KTTemplating类的具体用法?PHP KTTemplating怎么用?PHP KTTemplating使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KTTemplating类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_main
function do_main()
{
//registerTypes registers the mime types and populates the needed tables.
$indexer = Indexer::get();
$indexer->registerTypes();
$oTemplating =& KTTemplating::getSingleton();
$oTemplating->addLocation('Extractor Information', '/plugins/search2/reporting/templates');
$oTemplate =& $oTemplating->loadTemplate('extractorinfo');
$aExtractorInfo = KTMime::getMimeExtractorInformation();
if (empty($aExtractorInfo)) {
$oTemplate->setData(array('context' => $this, 'extractor_info' => $aExtractorInfo));
return $oTemplate;
}
foreach ($aExtractorInfo as $key => $info) {
$extractorClass = $info['name'];
$extractor = $indexer->getExtractor($extractorClass);
$info['mimeTypes'] = array();
$aMimeTypes = $this->getSupportedMimeTypesDB($extractorClass);
//$extractor->getSupportedMimeTypes();
foreach ($aMimeTypes as $mimeType) {
$sMimeInfo = KTMime::getFriendlyNameAndExtension($mimeType);
$info['mimeTypes'][$mimeType] = array('description' => $sMimeInfo[0]['friendly_name'], 'extensions' => array($sMimeInfo[0]['filetypes']));
$extensions = array();
foreach ($sMimeInfo as $item) {
$extensions[] = $item['filetypes'];
}
$info['mimeTypes'][$mimeType]['extensions'] = implode(', ', $extensions);
}
$aExtractorInfo[$key] = $info;
}
$oTemplate->setData(array('context' => $this, 'extractor_info' => $aExtractorInfo));
return $oTemplate;
}
示例2: do_main
function do_main()
{
//registerTypes registers the mime types and populates the needed tables.
$indexer = Indexer::get();
$indexer->registerTypes();
$oTemplating =& KTTemplating::getSingleton();
$oTemplate =& $oTemplating->loadTemplate('ktcore/search2/reporting/managemimetypes');
$aMimeTypes = KTMime::getAllMimeTypesInformation();
$indexer = Indexer::get();
$numExtensions = 0;
$numIndexedExtensions = 0;
foreach ($aMimeTypes as $key => $mimeType) {
$extractorClass = $mimeType['extractor'];
$numExtensions++;
if (empty($extractorClass)) {
continue;
}
$extractor = $indexer->getExtractor($extractorClass);
$aMimeTypes[$key]['extractor'] = $extractor->getDisplayName();
$numIndexedExtensions++;
}
$indexedPercentage = 0;
if ($numExtensions > 0) {
$indexedPercentage = number_format($numIndexedExtensions * 100 / $numExtensions, 2, '.', ',');
}
$oTemplate->setData(array('context' => $this, 'mime_types' => $aMimeTypes, 'numExtensions' => $numExtensions, 'numIndexedExtensions' => $numIndexedExtensions, 'indexedPercentage' => $indexedPercentage));
return $oTemplate;
}
示例3: render
function render()
{
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate('ktcore/search2/lucene_migration');
$config = KTConfig::getSingleton();
$batchDocuments = $config->get('indexer/batchMigrateDocuments');
$migratedDocuments = KTUtil::getSystemSetting('migratedDocuments', 0);
$migratingDocuments = $this->migratingDocuments;
$migrationStart = KTUtil::getSystemSetting('migrationStarted');
if (is_null($migrationStart)) {
$migrationStartString = _kt('Not started');
$migrationPeriod = _kt('N/A');
$estimatedTime = _kt('Unknown');
$estimatedPeriod = $estimatedTime;
} else {
$migrationStartString = date('Y-m-d H:i:s', $migrationStart);
$migrationTime = KTUtil::getSystemSetting('migrationTime', 0);
$migrationPeriod = KTUtil::computePeriod($migrationTime, '');
// Cannot divide by zero so make it 1
$divMigratedDocuments = $migratedDocuments > 0 ? $migratedDocuments : 1;
$timePerDocument = $migrationTime / $divMigratedDocuments;
$estimatedPeriod = $timePerDocument * $migratingDocuments;
$estimatedTime = date('Y-m-d H:i:s', $migrationStart + $estimatedPeriod);
$estimatedPeriod = KTUtil::computePeriod($estimatedPeriod, '');
}
$aTemplateData = array('context' => $this, 'batchDocuments' => $batchDocuments, 'batchPeriod' => 'Periodically', 'migrationStart' => $migrationStartString, 'migrationPeriod' => $migrationPeriod, 'migratedDocuments' => $migratedDocuments, 'migratingDocuments' => $migratingDocuments, 'estimatedTime' => $estimatedTime, 'estimatedPeriod' => $estimatedPeriod);
return $oTemplate->render($aTemplateData);
}
示例4: setup
function setup()
{
$this->registerDashlet('BrowseableFolderDashlet', 'nbm.browseable.dashlet', 'BrowseableDashlet.php');
require_once KT_LIB_DIR . "/templating/templating.inc.php";
$oTemplating =& KTTemplating::getSingleton();
$oTemplating->addLocation('browseabledashlet', '/plugins/browseabledashlet/templates');
}
示例5: do_main
function do_main()
{
header('Content-Type: application/javascript; charset=UTF-8');
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate("ktcore/javascript_i18n");
return $oTemplate->render();
}
示例6: render
function render()
{
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate('ktcore/search2/lucene_statistics');
$aTemplateData = array('context' => $this, 'stats' => $this->stats);
return $oTemplate->render($aTemplateData);
}
示例7: setup
function setup()
{
$this->registerDashlet('DiskUsageDashlet', 'ktcore.diskusage.dashlet', 'DiskUsageDashlet.inc.php');
$this->registerDashlet('FolderUsageDashlet', 'ktcore.folderusage.dashlet', 'FolderUsageDashlet.inc.php');
$oTemplating =& KTTemplating::getSingleton();
$oTemplating->addLocation('housekeeper', '/plugins/housekeeper/templates');
}
示例8: do_main
function do_main()
{
$this->oPage->setBreadcrumbDetails(_kt("transactions"));
$this->oPage->setTitle(_kt('Folder transactions'));
$folder_data = array();
$folder_data["folder_id"] = $this->oFolder->getId();
$this->oPage->setSecondaryTitle($this->oFolder->getName());
$aTransactions = array();
// FIXME do we really need to use a raw db-access here? probably...
$sQuery = "SELECT DTT.name AS transaction_name, FT.transaction_namespace, U.name AS user_name, FT.comment AS comment, FT.datetime AS datetime " . "FROM " . KTUtil::getTableName("folder_transactions") . " AS FT LEFT JOIN " . KTUtil::getTableName("users") . " AS U ON FT.user_id = U.id " . "LEFT JOIN " . KTUtil::getTableName("transaction_types") . " AS DTT ON DTT.namespace = FT.transaction_namespace " . "WHERE FT.folder_id = ? ORDER BY FT.datetime DESC";
$aParams = array($this->oFolder->getId());
$res = DBUtil::getResultArray(array($sQuery, $aParams));
if (PEAR::isError($res)) {
var_dump($res);
// FIXME be graceful on failure.
exit(0);
}
// FIXME roll up view transactions
$aTransactions = $res;
// Set the namespaces where not in the transactions lookup
foreach ($aTransactions as $key => $transaction) {
if (empty($transaction['transaction_name'])) {
$aTransactions[$key]['transaction_name'] = $this->_getActionNameForNamespace($transaction['transaction_namespace']);
}
}
// render pass.
$this->oPage->title = _kt("Folder History");
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate("kt3/view_folder_history");
$aTemplateData = array("context" => $this, "folder_id" => $folder_id, "folder" => $this->oFolder, "transactions" => $aTransactions);
return $oTemplate->render($aTemplateData);
}
示例9: do_main
function do_main()
{
$this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Role Management'));
$this->oPage->setTitle(_kt('Role Management'));
$edit_fields = array();
$role_id = KTUtil::arrayGet($_REQUEST, 'role_id', null);
if (is_null($role_id)) {
$oRole = null;
// handle broken case of role == -1
} else {
$oRole = Role::get($role_id);
}
if (PEAR::isError($oRole) || $oRole == false) {
$for_edit = false;
} else {
$for_edit = true;
$edit_fields[] = new KTStringWidget(_kt('Name'), _kt('A short, human-readable name for the role.'), 'name', $oRole->getName(), $this->oPage, true);
}
$aRoles =& Role::getList('id > 0');
$add_fields = array();
$add_fields[] = new KTStringWidget(_kt('Name'), _kt('A short, human-readable name for the role.'), 'name', null, $this->oPage, true);
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate('ktcore/principals/roleadmin');
$oTemplate->setData(array("context" => $this, "add_fields" => $add_fields, "for_edit" => $for_edit, 'edit_role' => $oRole, 'edit_fields' => $edit_fields, 'roles' => $aRoles));
return $oTemplate;
}
示例10: do_verifyAndUpdate
function do_verifyAndUpdate()
{
header('Content-Type: text/xml');
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate("ktcore/conditional_ajax_verifyAndUpdate");
$aTemplateData = array();
return $oTemplate->render($aTemplateData);
}
示例11: setup
function setup()
{
$this->registerDashlet('MyDropDocumentsDashlet', 'klive.mydropdocuments.dashlet', 'MyDropDocumentsDashlet.php');
$this->registerPage('MyDropDocuments', 'MyDropDocumentsPage', 'MyDropDocumentsPage.php');
require_once KT_LIB_DIR . "/templating/templating.inc.php";
$oTemplating =& KTTemplating::getSingleton();
$oTemplating->addLocation('MyDropDocumentsDashlet', '/plugins/MyDropDocumentsPlugin/templates');
}
示例12: render
function render()
{
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate('ktcore/search2/indexing_status');
$url = KTUtil::kt_url();
$aTemplateData = array('context' => $this, 'indexerName' => $this->indexerName, 'indexerDiagnosis' => $this->indexerDiagnosis, 'extractorDiagnosis' => $this->extractorDiagnosis, 'rootUrl' => $url);
return $oTemplate->render($aTemplateData);
}
示例13: render
function render()
{
global $main;
$main->requireJSResource("resources/js/reorder.js");
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate("kt3/reorderdisplay");
$aTemplateData = array("context" => $this, "items" => $this->aItems);
return $oTemplate->render($aTemplateData);
}
示例14: do_main
function do_main()
{
$aPlugins = KTPluginEntity::getAvailable();
$aEnabledPluginIds = KTPluginEntity::getEnabledPlugins();
$oTemplating =& KTTemplating::getSingleton();
$oTemplate =& $oTemplating->loadTemplate('ktcore/plugins/list');
$oTemplate->setData(array('context' => $this, 'plugins' => $aPlugins, 'enabled_plugins' => $aEnabledPluginIds));
return $oTemplate;
}
示例15: do_main
/**
* Dispatch function
*/
function do_main()
{
$this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Document Indexer Statistics'));
$indexer = Indexer::get();
$stats = $indexer->getIndexStatistics();
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate('ktcore/search2/lucene_statistics');
$aTemplateData = array('context' => $this, 'stats' => $stats);
return $oTemplate->render($aTemplateData);
}