• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP KTTemplating类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中KTTemplating的典型用法代码示例。如果您正苦于以下问题:PHP KTTemplating类的具体用法?PHP KTTemplating怎么用?PHP KTTemplating使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了KTTemplating类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:33,代码来源:ExtractorInfo.php


示例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;
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:28,代码来源:ManageMimeTypes.php


示例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);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:28,代码来源:MigrationDashlet.php


示例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');
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:7,代码来源:BrowseableDashletPlugin.php


示例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();
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:7,代码来源:i18nJavascript.php


示例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);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:7,代码来源:LuceneStatisticsDashlet.php


示例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');
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:7,代码来源:HouseKeeperPlugin.php


示例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);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:32,代码来源:Transactions.php


示例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;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:26,代码来源:roleManagement.php


示例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);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:8,代码来源:ajaxConditional.php


示例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');
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:8,代码来源:MyDropDocumentsPlugin.php


示例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);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:8,代码来源:IndexingStatusDashlet.php


示例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);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:9,代码来源:reorderdisplay.inc.php


示例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;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:9,代码来源:plugins.php


示例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);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:13,代码来源:LuceneStatistics.php


示例16: render

 function render()
 {
     global $main;
     $main->requireJSResource("plugins/MyDropDocumentsPlugin/js/update.js");
     $oPlugin =& $this->oPlugin;
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('MyDropDocumentsPlugin/dashlet');
     $aTemplateData = array('context' => $this, 'url' => $oPlugin->getPagePath('MyDropDocuments'));
     return $oTemplate->render($aTemplateData);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:10,代码来源:MyDropDocumentsDashlet.php


示例17: do_main

 /**
  * Dispatch function
  */
 function do_main()
 {
     $this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Document Indexer Statistics'));
     $stats = KTUtil::getSystemSetting('indexerStats');
     $this->stats = unserialize($stats);
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('ktcore/search2/lucene_statistics');
     $aTemplateData = array('context' => $this, 'stats' => $this->stats);
     return $oTemplate->render($aTemplateData);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:13,代码来源:LuceneStatistics.php


示例18: render

 /**
  * Render function for template
  *
  * @return unknown
  */
 function render()
 {
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('TagCloud/dashlet');
     $aTags = $this->get_tag_weightings($aTags);
     $oRegistry =& KTPluginRegistry::getSingleton();
     $oPlugin =& $oRegistry->getPlugin('ktcore.tagcloud.plugin');
     $url = $oPlugin->getPagePath('TagCloudRedirection');
     $aTemplateData = array('tags' => $aTags, 'url' => $url);
     return $oTemplate->render($aTemplateData);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:16,代码来源:TagCloudDashlet.php


示例19: do_main

 function do_main()
 {
     //get document object
     $oDocument = $this->oDocument;
     // get document id
     $iDId = $oDocument->getID();
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('RSSPlugin/rssdocumentaction');
     $aTemplateData = array('context' => $this, 'link' => KTrss::getRssLink($iDId, 'document'), 'linkIcon' => KTrss::getImageLink($iDId, 'document'));
     return $oTemplate->render($aTemplateData);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:11,代码来源:RSSDocumentLinkAction.php


示例20: do_main

 function do_main()
 {
     //get folder object
     $oFolder = $this->oFolder;
     // get folder id
     $iFId = $oFolder->getID();
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('RSSPlugin/rssfolderaction');
     $aTemplateData = array('context' => $this, 'link' => KTrss::getRssLink($iFId, 'folder'), 'linkIcon' => KTrss::getImageLink($iFId, 'folder'), 'folderName' => $this->oFolder->getName());
     return $oTemplate->render($aTemplateData);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:11,代码来源:RSSFolderLinkAction.php



注:本文中的KTTemplating类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP KTUtil类代码示例发布时间:2022-05-23
下一篇:
PHP KTConfig类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap