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


PHP KTUtil::kt_url方法代码示例

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


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

示例1: renderData

 function renderData($aDataRow)
 {
     // only _ever_ show this for documents.
     if ($aDataRow["type"] === "folder") {
         return ' ';
     }
     $sUrl = KTUtil::kt_url() . '/' . $this->sPluginPath . '/documentPreview.php';
     $sDir = KT_DIR;
     $iDelay = 1000;
     // milliseconds
     $iDocumentId = $aDataRow['document']->getId();
     $sTitle = _kt('Property Preview');
     $sLoading = _kt('Loading...');
     $width = 500;
     // Check for existence of thumbnail plugin
     if (KTPluginUtil::pluginIsActive('thumbnails.generator.processor.plugin')) {
         // hook into thumbnail plugin to get display for thumbnail
         include_once KT_DIR . '/plugins/thumbnails/thumbnails.php';
         $thumbnailer = new ThumbnailViewlet();
         $thumbnailwidth = $thumbnailer->get_width($iDocumentId);
         $width += $thumbnailwidth + 30;
     }
     //$link = '<a name = "ktP'.$iDocumentId.'" href = "#ktP'.$iDocumentId.'" class="ktAction ktPreview" id = "box_'.$iDocumentId.'" ';
     $link = '<a href = "#browseForm" class="ktAction ktPreview" id = "box_' . $iDocumentId . '" ';
     if ($this->sActivation == 'mouse-over') {
         $sJs = "javascript: this.t = setTimeout('showInfo(\\'{$iDocumentId}\\', \\'{$sUrl}\\', \\'{$sDir}\\', \\'{$sLoading}\\', {$width})', {$iDelay});";
         $link .= 'onmouseover = "' . $sJs . '" onmouseout = "clearTimeout(this.t);">';
     } else {
         $sJs = "javascript: showInfo('{$iDocumentId}', '{$sUrl}', '{$sDir}', '{$sLoading}', {$width});";
         $link .= 'onclick = "' . $sJs . '" title="' . $sTitle . '">';
     }
     return $link . $sTitle . '</a>';
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:33,代码来源:documentPreviewPlugin.php

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

示例3: getDisplayName

 function getDisplayName()
 {
     global $default;
     // The generation of the pdf is done through the PDF Converter plugin.
     // The PDF's are generated in the background by the document processor
     if (!empty($this->oDocument)) {
         $iDocId = $this->oDocument->iId;
         // Build the display name and url
         $sDisplayName = _kt('Generate PDF');
         $sHostPath = KTUtil::kt_url();
         $icon = "<img src='{$sHostPath}/resources/mimetypes/pdf.gif' alt='PDF' border=0 />";
         $link = KTUtil::ktLink('action.php', 'ktstandard.pdf.generate', array('fDocumentId' => $this->oDocument->getId(), 'action' => 'pdfdownload'));
         $sDisplayLink = "&nbsp;<a href=\"{$link}\">{$icon}</a>";
         // First check if the pdf has already been generated
         $dir = $default->pdfDirectory;
         $file = $dir . '/' . $iDocId . '.pdf';
         if (file_exists($file)) {
             // Display the download link
             return $sDisplayName . $sDisplayLink;
         }
         // If the file does not exist, check if the document has the correct mimetype
         $converter = new pdfConverter();
         $mimeTypes = $converter->getSupportedMimeTypes();
         $docType = $this->getMimeExtension();
         if ($mimeTypes === true || in_array($docType, $mimeTypes)) {
             // Display the download link
             return $sDisplayName . $sDisplayLink;
         }
     } else {
         // If the document is empty then we are probably in the workflow admin - action restrictions section, so we can display the name.
         return $sDisplayName;
     }
     return '';
     /*
     		//$cmdpath = KTUtil::findCommand('externalBinary/python');
     // Check if openoffice and python are available
     
     if($cmdpath != false && file_exists($cmdpath) && !empty($cmdpath)) {
         $sDocType = $this->getMimeExtension();
         // make sure that the selected document is of an acceptable extension
         foreach($this->aAcceptedMimeTypes as $acceptType){
             if($acceptType == $sDocType){
         	            // build server path
         	            $sHostPath = KTUtil::kt_url();
                 // create image
                 $icon = "<img src='{$sHostPath}/resources/mimetypes/pdf.gif' alt='PDF' border=0 />";
                 $link = KTUtil::ktLink('action.php', 'ktstandard.pdf.generate', array( 'fDocumentId' => $this->oDocument->getId(), 'action' => 'pdfdownload'));
                 return _kt('Generate PDF') . "&nbsp;<a href=\"{$link}\">{$icon}</a>";
             }
         }
         // If the document is empty then we are probably in the workflow admin - action restrictions section, so we can display the name.
         if(empty($this->oDocument)){
             return _kt('Generate PDF');
         }
     }
     return '';
     */
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:58,代码来源:PDFGeneratorAction.php

示例4: render

 function render()
 {
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('ktcore/search2/external_resources');
     $sUrl = KTUtil::kt_url();
     foreach ($this->resources as $k => $v) {
         $this->resources[$k]['status'] = str_replace(array("\n", _kt('Administrator Guide')), array('<br>', sprintf("<a target='_blank' href=\"http://www.knowledgetree.com/go/ktAdminManual\">%s</a>", _kt('Administrator Guide'))), $v['status']);
     }
     $aTemplateData = array('context' => $this, 'resources' => $this->resources, 'url' => $sUrl);
     return $oTemplate->render($aTemplateData);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:11,代码来源:ExternalDashlet.php

示例5: takeover

 function takeover()
 {
     $oRegistry =& KTPluginRegistry::getSingleton();
     $oPlugin =& $oRegistry->getPlugin('password.reset.plugin');
     $dispatcherURL = $oPlugin->getURLPath('loginResetDispatcher.php');
     $redirect = KTUtil::arrayGet($_REQUEST, 'redirect');
     $url = KTUtil::kt_url() . $dispatcherURL;
     $url .= !empty($redirect) ? '?redirect=' . $redirect : '';
     redirect($url);
     exit(0);
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:11,代码来源:passwordResetPlugin.php

示例6: takeover

 function takeover()
 {
     $oRegistry =& KTPluginRegistry::getSingleton();
     $oPlugin =& $oRegistry->getPlugin('password.reset.plugin');
     $dispatcherURL = $oPlugin->getURLPath('loginResetDispatcher.php');
     $queryString = $_SERVER['QUERY_STRING'];
     $redirect = KTUtil::arrayGet($_REQUEST, 'redirect');
     $redirect = urlencode($redirect);
     $url = KTUtil::kt_url() . $dispatcherURL;
     $url .= !empty($queryString) ? '?' . $queryString : '';
     redirect($url);
     exit(0);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:13,代码来源:passwordResetPlugin.php

示例7: render

 function render()
 {
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate('ktstandard/ktwebdavdashlet/dashlet');
     $sURL = KTUtil::kt_url();
     // Check if this is a commercial installation - before displaying the KT Tools webdav link
     // Shortcut: Check if the the wintools plugin exists and set to true.
     // Long way: Check that a license is installed - this is only text so having a license is not a requirement.
     $isComm = false;
     if (KTPluginUtil::pluginIsActive('ktdms.wintools')) {
         $isComm = true;
     }
     $webdavUrl = $sURL . '/ktwebdav/ktwebdav.php';
     $aTemplateData = array('url' => $sURL, 'webdav_url' => $webdavUrl, 'hasLicense' => $isComm);
     return $oTemplate->render($aTemplateData);
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:16,代码来源:KTWebDAVDashletPlugin.php

示例8: renderData

 function renderData($aDataRow)
 {
     // only _ever_ show this for documents.
     if ($aDataRow["type"] === "folder") {
         return '&nbsp;';
     }
     $sUrl = KTUtil::kt_url() . '/' . $this->sPluginPath . '/documentPreview.php';
     $sDir = KT_DIR;
     $iDelay = 1000;
     // milliseconds
     $iDocumentId = $aDataRow['document']->getId();
     $sTitle = _kt('Property Preview');
     $sLoading = _kt('Loading...');
     $link = '<a href = "#" class="ktAction ktPreview" id = "box_' . $iDocumentId . '" ';
     if ($this->sActivation == 'mouse-over') {
         $sJs = "javascript: this.t = setTimeout('showInfo(\\'{$iDocumentId}\\', \\'{$sUrl}\\', \\'{$sDir}\\', \\'{$sLoading}\\')', {$iDelay});";
         $link .= 'onmouseover = "' . $sJs . '" onmouseout = "clearTimeout(this.t);">';
     } else {
         $sJs = "javascript: showInfo('{$iDocumentId}', '{$sUrl}', '{$sDir}', '{$sLoading}');";
         $link .= 'onclick = "' . $sJs . '" title="' . $sTitle . '">';
     }
     return $link . $sTitle . '</a>';
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:23,代码来源:documentPreviewPlugin.php

示例9: do_refreshDashboardStatus

 function do_refreshDashboardStatus()
 {
     session_unregister('ExternalResourceStatus');
     session_unregister('IndexingStatus');
     redirect(KTUtil::kt_url() . '/dashboard.php');
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:6,代码来源:search2.php

示例10: do_checkCookie

 function do_checkCookie()
 {
     $cookieTest = KTUtil::arrayGet($_COOKIE, "CookieTestCookie", null);
     $cookieVerify = KTUtil::arrayGet($_REQUEST, 'cookieVerify', null);
     $url = $_SERVER["PHP_SELF"];
     $queryParams = array();
     $redirect = strip_tags(KTUtil::arrayGet($_REQUEST, 'redirect'));
     if (!empty($redirect)) {
         $queryParams[] = 'redirect=' . urlencode($redirect);
     }
     if ($cookieTest !== $cookieVerify) {
         Session::destroy();
         $this->simpleRedirectToMain(_kt('You must have cookies enabled to use the document management system.'), $url, $queryParams);
         exit(0);
     }
     // check for a location to forward to
     if (!empty($redirect)) {
         $url = $redirect;
         // else redirect to the dashboard if there is none
     } else {
         $url = KTUtil::kt_url();
         $config = KTConfig::getSingleton();
         $redirectToBrowse = $config->get('KnowledgeTree/redirectToBrowse', false);
         $redirectToDashboardList = $config->get('KnowledgeTree/redirectToBrowseExceptions', '');
         if ($redirectToBrowse) {
             $exceptionsList = explode(',', str_replace(' ', '', $redirectToDashboardList));
             $user = User::get($_SESSION['userID']);
             $username = $user->getUserName();
             $url .= in_array($username, $exceptionsList) ? '/dashboard.php' : '/browse.php';
         } else {
             $url .= '/dashboard.php';
         }
     }
     exit(redirect($url));
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:35,代码来源:loginResetDispatcher.php

示例11: render

 function render()
 {
     global $default;
     $oConfig = KTConfig::getSingleton();
     if (empty($this->contents)) {
         $this->contents = "";
     }
     if (is_string($this->contents) && trim($this->contents) === "") {
         $this->addError(_kt("This page did not produce any content"));
         $this->contents = "";
     }
     if (!is_string($this->contents)) {
         $this->contents = $this->contents->render();
     }
     // if we have no portlets, make the ui a tad nicer.
     if (empty($this->portlets)) {
         $this->show_portlets = false;
     }
     if (empty($this->title)) {
         if (!empty($this->breadcrumbDetails)) {
             $this->title = $this->breadcrumbDetails;
         } else {
             if (!empty($this->breadcrumbs)) {
                 $this->title = array_slice($this->breadcrumbs, -1);
                 $this->title = $this->title[0]['label'];
             } else {
                 if (!empty($this->breadcrumbSection)) {
                     $this->title = $this->breadcrumbSection['label'];
                 } else {
                     $this->title = $this->componentLabel;
                 }
             }
         }
     }
     $this->userMenu = array();
     $sBaseUrl = KTUtil::kt_url();
     if (!(PEAR::isError($this->user) || is_null($this->user) || $this->user->isAnonymous())) {
         if ($oConfig->get("user_prefs/restrictPreferences", false) && !Permission::userIsSystemAdministrator($this->user->getId())) {
             $this->userMenu['logout'] = array('label' => _kt('Logout'), 'url' => $sBaseUrl . '/presentation/logout.php');
         } else {
             if ($default->enableESignatures) {
                 $sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
                 $heading = _kt('You are attempting to modify Preferences');
                 $this->userMenu['preferences']['url'] = '#';
                 $this->userMenu['preferences']['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'dms.administration.accessing_preferences', 'system', '{$sBaseUrl}/preferences.php', 'redirect');";
             } else {
                 $this->userMenu['preferences']['url'] = $sBaseUrl . '/preferences.php';
             }
             //	        $this->userMenu['preferences'] = array('label' => _kt('Preferences'), 'url' => $sBaseUrl.'/preferences.php');
             $this->userMenu['preferences']['label'] = _kt('Preferences');
             $this->userMenu['aboutkt'] = array('label' => _kt('About'), 'url' => $sBaseUrl . '/about.php');
             $this->userMenu['logout'] = array('label' => _kt('Logout'), 'url' => $sBaseUrl . '/presentation/logout.php');
         }
     } else {
         $this->userMenu['login'] = array('label' => _kt('Login'), 'url' => $sBaseUrl . '/login.php');
     }
     // FIXME we need a more complete solution to navigation restriction
     if (!is_null($this->menu['administration']) && !is_null($this->user)) {
         if (!Permission::userIsSystemAdministrator($this->user->getId())) {
             unset($this->menu['administration']);
         }
     }
     $sContentType = 'Content-type: ' . $this->contentType;
     if (!empty($this->charset)) {
         $sContentType .= '; charset=' . $this->charset;
     }
     header($sContentType);
     $savedSearches = SearchHelper::getSavedSearches($_SESSION['userID']);
     $oTemplating =& KTTemplating::getSingleton();
     $oTemplate = $oTemplating->loadTemplate($this->template);
     $aTemplateData = array("page" => $this, "systemversion" => $default->systemVersion, "versionname" => $default->versionName, 'smallVersion' => substr($default->versionName, -17), 'savedSearches' => $savedSearches);
     if ($oConfig->get("ui/automaticRefresh", false)) {
         $aTemplateData['refreshTimeout'] = (int) $oConfig->get("session/sessionTimeout") + 3;
     }
     // unlike the rest of KT, we use echo here.
     echo $oTemplate->render($aTemplateData);
 }
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:77,代码来源:kt3template.inc.php

示例12: catchFatalErrors

    function catchFatalErrors()
    {
        ini_set('display_errors', 'On');
        $phperror = '><div id="phperror" style="display:none">';
        ini_set('error_prepend_string', $phperror);
        $CustomErrorPage = KTUtil::kt_url() . '/customerrorpage.php';
        $phperror = '</div>><form name="catcher" action="' . $CustomErrorPage . '" method="post" ><input type="hidden" name="fatal" value=""></form>
		<script> document.catcher.fatal.value = document.getElementById("phperror").innerHTML; document.catcher.submit();</script>';
        ini_set('error_append_string', $phperror);
    }
开发者ID:5haman,项目名称:knowledgetree,代码行数:10,代码来源:dmsDefaults.php

示例13: getEmailAlertContent

 /**
  * This function generates the email that will be sent for subscription notifications
  *
  * @author KnowledgeTree Team
  * @access public
  * @param object $oKTNotification: The notification object
  * @return string $str: The html string that will be sent via email
  */
 function getEmailAlertContent($oKTNotification, $bulk_action = 0)
 {
     if ($bulk_action == 0) {
         $bulk_action = false;
     }
     // set up logo and title
     $rootUrl = KTUtil::kt_url();
     $info = $this->_getSubscriptionData($oKTNotification);
     // set up email text
     $addFolderText = _kt('The folder "') . $info['object_name'] . _kt('" was added');
     $removeSubscribedFolderText = _kt('The folder "') . $info['object_name'] . _kt('" to which you were subscribed, has been removed');
     $removeChildFolderText = _kt('The folder "') . $info['object_name'] . _kt('" has been removed');
     $addDocumentText = _kt('The document "') . $info['object_name'] . _kt('" was added');
     $removeSubscribedDocumentText = _kt('The document "') . $info['object_name'] . _kt('" to which you were subscribed, has been removed');
     $removeChildDocumentText = _kt('The document "') . $info['object_name'] . _kt('" has been removed');
     $modifyDocumentText = _kt('The document "') . $info['object_name'] . _kt('" has been changed');
     $checkInDocumentText = _kt('The document "') . $info['object_name'] . _kt('" has been checked in');
     $checkOutDocumentText = _kt('The document "') . $info['object_name'] . _kt('" has been checked out');
     $moveDocumentText = _kt('The document "') . $info['object_name'] . _kt('" has been moved');
     $copiedDocumentText = _kt('The document "') . $info['object_name'] . _kt('" has been copied');
     $archivedDocumentText = _kt('The document "') . $info['object_name'] . _kt('"');
     $restoreArchivedDocumentText = _kt('The document "') . $info['object_name'] . _kt('" has been restored by an administrator');
     $downloadDocumentText = _kt('The document "') . $info['object_name'] . _kt('"');
     $documentAlertText = _kt('An alert on the document "') . $info['object_name'] . _kt('" has been added or modified');
     if ($info['location_name'] !== NULL && !$bulk_action) {
         $addFolderText .= _kt(' to "') . $info['location_name'] . _kt('"');
         $removeChildFolderText .= _kt(' from the folder "') . $info['location_name'] . _kt('"');
         $addDocumentText .= _kt(' to "') . $info['location_name'] . _kt('"');
         $removeChildDocumentText .= _kt(' from the folder "') . $info['location_name'] . _kt('" to which you are subscribed');
         $modifyDocumentText .= _kt(' in the folder "') . $info['location_name'] . _kt('"');
         $checkInDocumentText .= _kt(', in the folder "') . $info['location_name'] . _kt('"');
         $checkOutDocumentText .= _kt(', from the folder "') . $info['location_name'] . _kt('"');
         $moveDocumentText .= _kt(' to the folder "') . $info['location_name'] . _kt('"');
         $copiedDocumentText .= _kt(' to the folder "') . $info['location_name'] . _kt('"');
         $archivedDocumentText .= _kt(' in the folder "') . $info['location_name'] . _kt('" has been archived');
         $downloadDocumentText .= _kt(' in the folder "') . $info['location_name'] . _kt('" has been downloaded');
         $documentAlertText .= _kt(' in the folder "') . $info['location_name'] . _kt('"');
     }
     if ($bulk_action && $info['event_type'] != "RemoveSubscribedFolder") {
         $browse = "{$rootUrl}/browse.php?fFolderId={$bulk_action}";
         $subFolder = '<a href="' . $browse . '">' . _kt('View Subscription Folder ') . '</a>';
     }
     // set up links
     switch ($info['event_type']) {
         case 'AddFolder':
             $text = $addFolderText;
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'];
             if (!$bulk_action) {
                 $links = '<a href="' . $url . '">' . _kt('View New Folder') . '</a>';
             }
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'] . '&notify_action=clear';
             $links .= '&#160;|&#160;<a href="' . $url . '">' . _kt('Clear Alert') . '</a>';
             break;
         case 'RemoveSubscribedFolder':
             $text = $removeSubscribedFolderText;
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'] . '&notify_action=clear';
             $links = '<a href="' . $url . '">' . _kt('Clear Alert') . '</a>';
             break;
         case 'RemoveChildFolder':
             $text = $removeChildFolderText;
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'];
             if (!$bulk_action) {
                 $links = '<a href="' . $url . '">' . _kt('View Folder') . '</a>';
             }
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'] . '&notify_action=clear';
             $links .= '&#160;|&#160;<a href="' . $url . '">' . _kt('Clear Alert') . '</a>';
             break;
         case 'AddDocument':
             $text = $addDocumentText;
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'];
             if (!$bulk_action) {
                 $links = '<a href="' . $url . '">' . _kt('View Document') . '</a>';
             }
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'] . '&notify_action=clear';
             $links .= '&#160;|&#160;<a href="' . $url . '">' . _kt('Clear Alert') . '</a>';
             break;
         case 'RemoveSubscribedDocument':
             $text = $removeSubscribedDocumentText;
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'] . '&notify_action=clear';
             $links = '<a href="' . $url . '">' . _kt('Clear Alert') . '</a>';
             break;
         case 'RemoveChildDocument':
             $text = $removeChildDocumentText;
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'] . '&notify_action=clear';
             $links = '<a href="' . $url . '">' . _kt('Clear Alert') . '</a>';
             break;
         case 'ModifyDocument':
             $text = $modifyDocumentText;
             $url = $rootUrl . '/notify.php?id=' . $info['notify_id'];
             if (!$bulk_action) {
                 $links = '<a href="' . $url . '">' . _kt('View Document') . '</a>';
             }
//.........这里部分代码省略.........
开发者ID:jpbauer,项目名称:knowledgetree,代码行数:101,代码来源:subscriptions.inc.php

示例14: renderThumbnail

 public function renderThumbnail($documentId)
 {
     // Set up the template
     $oKTTemplating =& KTTemplating::getSingleton();
     $oTemplate =& $oKTTemplating->loadTemplate('thumbnail_viewlet');
     if (is_null($oTemplate)) {
         return '';
     }
     // Check that the thumbnail exists on disk
     global $default;
     $varDir = $default->varDirectory;
     $thumbnailCheck = $varDir . '/thumbnails/' . $documentId . '.jpg';
     // Use correct slashes for windows
     if (strpos(PHP_OS, 'WIN') !== false) {
         $thumbnailCheck = str_replace('/', '\\', $thumbnailCheck);
     }
     // if the thumbnail doesn't exist try to create it
     if (!file_exists($thumbnailCheck)) {
         $thumbnailer = new thumbnailGenerator();
         $thumbnailer->setDocument($this->oDocument);
         $thumbnailer->processDocument();
         // if it still doesn't exist, return an empty string
         if (!file_exists($thumbnailCheck)) {
             return '';
         }
     }
     // check for existence and status of the instant view plugin
     $url = '';
     if (KTPluginUtil::pluginIsActive('instaview.processor.plugin')) {
         require_once KTPluginUtil::getPluginPath('instaview.processor.plugin') . 'instaViewLinkAction.php';
         $ivLinkAction = new instaViewLinkAction();
         $url = $ivLinkAction->getViewLink($documentId, 'document');
     }
     // Get the url to the thumbnail and render it
     // Ensure url has correct slashes
     $sHostPath = KTUtil::kt_url();
     $plugin_path = KTPluginUtil::getPluginPath('thumbnails.generator.processor.plugin');
     $thumbnailUrl = $plugin_path . 'thumbnail_view.php?documentId=' . $documentId;
     $thumbnailUrl = str_replace('\\', '/', $thumbnailUrl);
     $thumbnailUrl = str_replace(KT_DIR, $sHostPath, $thumbnailUrl);
     $oTemplate->setData(array('thumbnail' => $thumbnailUrl, 'url' => $url));
     return $oTemplate->render();
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:43,代码来源:thumbnails.php

示例15: arrayToXML

 function arrayToXML($aItems)
 {
     $hostPath = KTUtil::kt_url() . '/';
     $head = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n\n    \t       <rss version=\"2.0\">\n\n    \t           <channel>\n\n    \t               <title>" . APP_NAME . " RSS</title>\n\n    \t               <copyright>(c) 2008 KnowledgeTree Inc.</copyright>\n\n    \t               <link>" . $hostPath . "</link>\n\n    \t               <description>KT-RSS</description>\n\n    \t               <image>\n\n        \t               <title>" . APP_NAME . " RSS</title>\n\n        \t               <width>140</width>\n\n        \t               <height>28</height>\n        \t               <link>" . $hostPath . "</link>\n\n        \t               <url>" . $hostPath . "resources/graphics/ktlogo_rss.png</url>\n\n    \t               </image>\n";
     $feed = '';
     foreach ($aItems as $aItem) {
         $aItemHead = $aItem[0][0];
         $aItemList = $aItem[1];
         if ($aItem[0][itemType] == 'folder') {
             $sTypeSelect = 'folder.transactions&fFolderId';
         } elseif ($aItem[0][itemType] == 'document') {
             $sTypeSelect = 'document.transactionhistory&fDocumentId';
         }
         if ($aItem[0][0][owner]) {
             $owner = $aItem[0][0][owner];
         } else {
             $owner = _kt('None');
         }
         $type = '';
         if ($aItem[0][0][type]) {
             $type = '<tr><td>Document type: ' . $aItem[0][0][type] . "</td>\n<td></td></tr>\n";
         }
         if ($aItem[0][0][workflow_status]) {
             $workflow = $aItem[0][0][workflow_status];
         } else {
             $workflow = _kt('No Workflow');
         }
         $xmlItemHead = "<item>\n\n\t    \t      <title>" . htmlspecialchars($aItem[0][0][name], ENT_QUOTES, 'UTF-8') . "</title>\n\n\t    \t      <link>" . $hostPath . "action.php?kt_path_info=ktcore.actions." . htmlspecialchars($sTypeSelect, ENT_QUOTES, 'UTF-8') . "=" . $aItem[0][0]['id'] . "</link>\n\n\t    \t      <description>\n";
         $htmlItem = "<table border='0' width='90%'>\n\n\t    \t      <tr>\n\n\t    \t          <td width='5%' height='16px'>\n\t    \t              <a href='" . $hostPath . "action.php?kt_path_info=ktcore.actions." . $sTypeSelect . "=" . $aItem[0][0][id] . "' >\n\t    \t              <img src='" . $aItem[0][mimeTypeIcon] . "' align='left' height='16px' width='16px' alt='' border='0' /></a>\n\t    \t          </td>\n\n\t    \t          <td align='left'> " . $aItem[0][mimeTypeFName] . "</td>\n\n\t    \t      </tr>\n\n\t    \t      <tr>\n\n    \t    \t      <td colspan='2'>\n\n        \t    \t      " . ucfirst($aItem[0]['itemType']) . " Information (ID: " . $aItem[0][0][id] . ")</>\n\n        \t    \t      <hr>\n\n\n        \t    \t      <table width='95%'>\n\n        \t    \t          <tr>\n\n        \t    \t              <td>" . _kt('Filename') . ": " . htmlspecialchars($aItem[0][0][filename], ENT_QUOTES, 'UTF-8') . "</td>\n\n        \t    \t          </tr>\n\n        \t    \t          <tr>\n\n        \t    \t              <td>" . _kt('Author') . ": " . htmlspecialchars($aItem[0][0][author], ENT_QUOTES, 'UTF-8') . "</td>\n\n        \t    \t          </tr>\n\n        \t    \t          <tr>\n\n            \t    \t          <td>" . _kt('Owner') . ": " . htmlspecialchars($owner, ENT_QUOTES, 'UTF-8') . "</td>\n\n            \t    \t          <td></td>\n\n        \t    \t          </tr>\n\n        \t    \t          " . $type . "\n\n        \t    \t          <tr>\n\n        \t    \t              <td>" . _kt('Workflow status') . ": " . htmlspecialchars($workflow, ENT_QUOTES, 'UTF-8') . "</td>\n\n        \t    \t              <td></td>\n\n        \t    \t          </tr>\n\n        \t    \t      </table><br>\n\n\n        \t    \t      " . _kt('Transaction Summary (Last 4)') . "\n\n        \t    \t      <hr>\n\n\n\t    \t                  <table width='100%'>\n";
         foreach ($aItem[1] as $item) {
             $htmlItem .= "<tr>\n\n                            \t    \t        <td>" . $item[type] . " name:</td>\n\n                            \t    \t        <td>" . htmlspecialchars($item[name], ENT_QUOTES, 'UTF-8') . "</td>\n\n                        \t    \t        </tr>\n\n                        \t    \t        <tr>\n\n                        \t    \t            <td>Path:</td>\n\n                        \t    \t            <td>" . htmlspecialchars($item[fullpath], ENT_QUOTES, 'UTF-8') . "</td>\n\n                        \t    \t        </tr>\n\n                        \t    \t        <tr>\n\n                        \t    \t            <td>Transaction:</td>\n\n                        \t    \t            <td>" . htmlspecialchars($item[transaction_name], ENT_QUOTES, 'UTF-8') . "</td>\n\n                        \t    \t        </tr>\n\n                        \t    \t        <tr>\n\n                        \t    \t            <td>Comment:</td>\n\n                        \t    \t            <td>" . htmlspecialchars($item[comment], ENT_QUOTES, 'UTF-8') . "</td>\n\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n";
             if ($item[version]) {
                 $htmlItem .= "<td>Version:</td>\n\n                        \t    \t                <td>" . $item[version] . "</td>\n";
             }
             $htmlItem .= "</tr>\n\n                        \t    \t        <tr>\n\n                        \t    \t            <td>Date:</td>\n\n                        \t    \t            <td>" . $item[datetime] . "</td>\n\n                        \t    \t        </tr>\n\n                        \t    \t        <tr>\n\n                        \t    \t            <td>User:</td>\n\n                        \t    \t            <td>" . htmlspecialchars($item[user_name], ENT_QUOTES, 'UTF-8') . "</td>\n\n                        \t    \t        </tr>\n\n                        \t    \t        <tr>\n\n                        \t    \t            <td colspan='2'><hr width='100' align='left'></td>\n\n                        \t    \t        </tr>\n";
         }
         $htmlItem .= "</table>\n\n                      </td>\n\n                  </tr>\n\n              </table>";
         $xmlItemFooter = "</description>\n</item>\n";
         // Use htmlspecialchars to allow html tags in the xml.
         $htmlItem = htmlspecialchars($htmlItem, ENT_QUOTES, 'UTF-8');
         $feed .= $xmlItemHead . $htmlItem . $xmlItemFooter;
     }
     $footer = "</channel>\n</rss>\n";
     return $head . $feed . $footer;
 }
开发者ID:5haman,项目名称:knowledgetree,代码行数:45,代码来源:KTrss.inc.php


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