当前位置: 首页>>代码示例>>PHP>>正文


PHP _kt函数代码示例

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


在下文中一共展示了_kt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: do_main

 function do_main()
 {
     $this->oPage->setShowPortlets(false);
     // retrieve action items for the user.
     // FIXME what is the userid?
     $oDashletRegistry =& KTDashletRegistry::getSingleton();
     $aDashlets = $oDashletRegistry->getDashlets($this->oUser);
     $this->sSection = "dashboard";
     $this->oPage->setBreadcrumbDetails(_kt("Home"));
     $this->oPage->title = _kt("Dashboard");
     // simplistic improvement over the standard rendering:  float half left
     // and half right.  +Involves no JS -can leave lots of white-space at the bottom.
     $aDashletsLeft = array();
     $aDashletsRight = array();
     $i = 0;
     foreach ($aDashlets as $oDashlet) {
         if ($i == 0) {
             $aDashletsLeft[] = $oDashlet;
         } else {
             $aDashletsRight[] = $oDashlet;
         }
         $i += 1;
         $i %= 2;
     }
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard");
     $aTemplateData = array("context" => $this, "dashlets_left" => $aDashletsLeft, "dashlets_right" => $aDashletsRight);
     return $oTemplate->render($aTemplateData);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:29,代码来源:olddashboard.php

示例2: thumbnailsPlugin

 function thumbnailsPlugin($sFilename = null)
 {
     $res = parent::KTPlugin($sFilename);
     $this->sFriendlyName = _kt('Thumbnail Generator');
     $this->sSQLDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR;
     return $res;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:7,代码来源:thumbnailsPlugin.php

示例3: __construct

 public function __construct()
 {
     $config = KTConfig::getSingleton();
     $params = $config->get('extractorParameters/pstotext', '"{source}" > "{target}"');
     $this->ignorePS = $config->get('indexer/ignorePS', false);
     parent::__construct('externalBinary', 'pstotext', 'pstotext', _kt('PostScript Text Extractor'), $params);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:7,代码来源:PSExtractor.inc.php

示例4: do_main

 function do_main()
 {
     $notifications = (array) KTNotification::getList(array("user_id = ?", $this->oUser->getId()));
     $num_notifications = count($notifications);
     $PAGE_SIZE = 5;
     $page = (int) KTUtil::arrayGet($_REQUEST, 'page', 0);
     $page_count = ceil($num_notifications / $PAGE_SIZE);
     if ($page >= $page_count) {
         $page = $page_count - 1;
     }
     if ($page < 0) {
         $page = 0;
     }
     // slice the notification array.
     $notifications = array_slice($notifications, $page * $PAGE_SIZE, $PAGE_SIZE);
     // prepare the batch html.  easier to do this here than in the template.
     $batch = array();
     for ($i = 0; $i < $page_count; $i++) {
         if ($i == $page) {
             $batch[] = sprintf("<strong>%d</strong>", $i + 1);
         } else {
             $batch[] = sprintf('<a href="%s">%d</a>', KTUtil::addQueryStringSelf($this->meldPersistQuery(array("page" => $i), "main", true)), $i + 1);
         }
     }
     $batch_html = implode(' &middot; ', $batch);
     $count_string = sprintf(_kt("Showing Notifications %d - %d of %d"), $page * $PAGE_SIZE + 1, min(($page + 1) * $PAGE_SIZE, $num_notifications), $num_notifications);
     $this->oPage->setTitle(_kt("Items that require your attention"));
     $oTemplate =& $this->oValidator->validateTemplate("ktcore/misc/notification_overflow");
     $oTemplate->setData(array('count_string' => $count_string, 'batch_html' => $batch_html, 'notifications' => $notifications));
     return $oTemplate->render();
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:31,代码来源:KTMiscPages.php

示例5: 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

示例6: close

 /**
  * Take care of getting rid of any active resources.
  */
 function close()
 {
     if (is_null($this->fh)) {
         return PEAR::raiseError(_kt('Not open'));
     }
     return fclose($this->fh);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:10,代码来源:fsfilelike.inc.php

示例7: diagnose

 public function diagnose()
 {
     if (!function_exists('exif_read_data')) {
         return sprintf(_kt('The Exif extractor requires the module exif php extension. Please include this in the php.ini.'));
     }
     return null;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:7,代码来源:ExifExtractor.inc.php

示例8: __construct

 public function __construct()
 {
     parent::__construct('modified_user_id', 'documents', _kt('Modified By'));
     $this->setAlias('ModifiedBy');
     $this->joinTo('users', 'id');
     $this->matchField('name');
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:7,代码来源:ModifiedByField.inc.php

示例9: exec

 protected function exec($cmd)
 {
     global $default;
     $res = parent::exec($cmd);
     if (false === $res && (strpos($this->output, 'Copying of text from this document is not allowed') !== false || strpos($this->output, 'Incorrect password') !== false)) {
         $this->output = '';
         file_put_contents($this->targetfile, _kt('Security properties on the PDF document prevent text from being extracted.'));
         $default->log->info('Security properties on the PDF document prevent text from being extracted.');
         return true;
     }
     if (false === $res && strpos($this->output, 'PDF file is damaged') !== false) {
         $this->output = '';
         $default->log->info('PDF file is damaged');
         return true;
     }
     if (false === $res && strpos($this->output, '(continuing anyway)') !== false) {
         $this->output = '';
         return true;
     }
     if (false === $res && strpos($this->output, 'font') !== false) {
         $this->output = '';
         return true;
     }
     if (filesize($this->targetfile) > 0) {
         $this->output = '';
         return true;
     }
     return $res;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:29,代码来源:PDFExtractor.inc.php

示例10: is_active

 function is_active($oUser)
 {
     if (!Permission::userIsSystemAdministrator()) {
         return false;
     }
     $indexerDiagnosis = KTUtil::getSystemSetting('indexerDiagnostics');
     $extractorDiagnosis = KTUtil::getSystemSetting('extractorDiagnostics');
     if (!empty($indexerDiagnosis)) {
         $indexerDiagnosis = unserialize($indexerDiagnosis);
     }
     if (!empty($extractorDiagnosis)) {
         $extractorDiagnosis = unserialize($extractorDiagnosis);
     }
     if (empty($indexerDiagnosis) && empty($extractorDiagnosis)) {
         return false;
     }
     $this->indexerDiagnosis = $indexerDiagnosis;
     $this->extractorDiagnosis = array();
     $result = array();
     foreach ($extractorDiagnosis as $class => $diagnosis) {
         $name = $diagnosis['name'];
         $diag = $diagnosis['diagnosis'];
         $result[$diag][] = $name;
     }
     foreach ($result as $problem => $indexers) {
         if (empty($problem)) {
             continue;
         }
         $this->extractorDiagnosis[] = array('problem' => $problem, 'indexers' => $indexers);
     }
     $this->indexerDiagnosis = str_replace(array("\n", 'Administrator Guide'), array('<br>', sprintf("<a target='_blank' href=\"http://www.knowledgetree.com/go/ktAdminManual\">%s</a>", _kt('Administrator Guide'))), $this->indexerDiagnosis);
     return true;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:33,代码来源:IndexingStatusDashlet.php

示例11: __construct

 public function __construct()
 {
     parent::__construct('full_path', 'documents', _kt('Folder'));
     $this->setAlias('Folder');
     // do want values quoted for folder db search
     /*$this->isValueQuoted(false);*/
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:7,代码来源:FolderField.inc.php

示例12: 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

示例13: __DocumentIndexer

 /**
  * Method to get help associated with Document Indexer Service
  * @return string help message
  */
 private function __DocumentIndexer()
 {
     $str = _kt('This could be due to the indexer not having been started, OR not configured correctly');
     $str .= '</li><li>';
     $str .= _kt('For more information, please see');
     $str .= ': <a href="http://wiki.knowledgetree.com/Troubleshooting_the_Document_Indexer">http://wiki.knowledgetree.com/Troubleshooting_the_Document_Indexer</a>';
     return $str;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:12,代码来源:IndexingHelp.php

示例14: pdfConverterPlugin

 function pdfConverterPlugin($sFilename = null)
 {
     $res = parent::KTPlugin($sFilename);
     $this->sFriendlyName = _kt('Document PDF Converter');
     $this->dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
     $this->sSQLDir = $this->dir . 'sql' . DIRECTORY_SEPARATOR;
     return $res;
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:8,代码来源:pdfConverterPlugin.php

示例15: getDiagnostic

 function getDiagnostic()
 {
     $sCommand = $this->findLocalCommand();
     // can't find the local command.
     if (empty($sCommand)) {
         return sprintf(_kt('Unable to find required command for indexing.  Please ensure that <strong>%s</strong> is installed and in the %s Path.  For more information on indexers and helper applications, please <a href="%s">visit the %s site</a>.'), $this->command, APP_NAME, $this->support_url, APP_NAME);
     }
     return null;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:9,代码来源:PowerpointIndexer.php


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