本文整理汇总了PHP中KTUtil::generate_breadcrumbs方法的典型用法代码示例。如果您正苦于以下问题:PHP KTUtil::generate_breadcrumbs方法的具体用法?PHP KTUtil::generate_breadcrumbs怎么用?PHP KTUtil::generate_breadcrumbs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KTUtil
的用法示例。
在下文中一共展示了KTUtil::generate_breadcrumbs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_new
function do_new()
{
$this->oPage->setBreadcrumbDetails(_kt("New Link"));
$this->oPage->setTitle(_kt("New Link"));
$oPermission =& KTPermission::getByName('ktcore.permissions.write');
if (PEAR::isError($oPermission) || !KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument)) {
$this->errorRedirectToMain(_kt('You do not have sufficient permissions to add a document link'), sprintf("fDocumentId=%d", $this->oDocument->getId()));
exit(0);
}
$oParentDocument =& $this->oDocument;
if (PEAR::isError($oParentDocument)) {
$this->errorRedirectToMain(_kt('Invalid parent document selected.'));
exit(0);
}
$oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', $oParentDocument->getFolderID()));
if (PEAR::isError($oFolder) || $oFolder == false) {
$this->errorRedirectToMain(_kt('Invalid folder selected.'));
exit(0);
}
$iFolderId = $oFolder->getId();
// Setup the collection for move display.
$collection = new AdvancedCollection();
$aBaseParams = array('fDocumentId' => $oParentDocument->getId());
$oCR =& KTColumnRegistry::getSingleton();
$col = $oCR->getColumn('ktcore.columns.selection');
$aColOptions = array();
$aColOptions['qs_params'] = kt_array_merge($aBaseParams, array('fFolderId' => $oFolder->getId()));
$aColOptions['show_folders'] = false;
$aColOptions['show_documents'] = true;
$aColOptions['rangename'] = 'linkselection[]';
$col->setOptions($aColOptions);
$collection->addColumn($col);
$col = $oCR->getColumn('ktdocumentlinks.columns.title');
$col->setOptions(array('qs_params' => kt_array_merge($aBaseParams, array('action' => 'new', 'fFolderId' => $oFolder->getId()))));
$collection->addColumn($col);
$qObj = new BrowseQuery($iFolderId);
$collection->setQueryObject($qObj);
$aOptions = $collection->getEnvironOptions();
//$aOptions['is_browse'] = true;
$aResultUrl = $aBaseParams;
$aResultUrl['fFolderId'] = $oFolder->getId();
$aResultUrl['action'] = 'new';
$aOptions['result_url'] = KTUtil::addQueryString($_SERVER['PHP_SELF'], $aResultUrl);
$collection->setOptions($aOptions);
$aURLParams = $aBaseParams;
$aURLParams['action'] = 'new';
$aBreadcrumbs = KTUtil::generate_breadcrumbs($oFolder, $iFolderId, $aURLParams);
// Add an electronic signature
global $default;
if ($default->enableESignatures) {
$sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
$heading = _kt('You are attempting to add a document link');
$submit['type'] = 'button';
$submit['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'ktcore.transactions.add_link', 'document', 'document_add_link_form', 'submit', {$oParentDocument->iId});";
} else {
$submit['type'] = 'submit';
$submit['onclick'] = '';
}
$aTemplateData = array('context' => $this, 'folder' => $oFolder, 'parent' => $oParentDocument, 'breadcrumbs' => $aBreadcrumbs, 'collection' => $collection, 'link_types' => LinkType::getList("id > 0"), 'submit' => $submit);
$oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/link');
return $oTemplate->render($aTemplateData);
}
示例2: do_main
function do_main()
{
$this->aBreadcrumbs[] = array('url' => $_SERVER['PHP_SELF'], 'name' => _kt('Archived Documents'));
$this->oPage->setBreadcrumbDetails(_kt('browse'));
$oFolder = Folder::get(KTUtil::arrayGet($_REQUEST, 'fFolderId', 1));
if (PEAR::isError($oFolder)) {
$this->errorRedirectToMain(_kt('Invalid folder selected.'));
exit(0);
}
// Setup the collection for restore display.
$aBaseParams = array();
$collection = new AdvancedCollection();
$oCR =& KTColumnRegistry::getSingleton();
$col = $oCR->getColumn('ktcore.columns.selection');
$aColOptions = array();
//$aColOptions['qs_params'] = kt_array_merge($aBaseParams, array('fFolderId'=>$oFolder->getId()));
$aColOptions['show_folders'] = false;
$aColOptions['show_documents'] = true;
$aColOptions['rangename'] = '_d[]';
$col->setOptions($aColOptions);
$collection->addColumn($col);
$col = $oCR->getColumn('ktcore.columns.title');
//$col->setOptions(array('qs_params'=>kt_array_merge($aBaseParams, array('action' => 'new', 'fFolderId'=>$oFolder->getId()))));
$col->setOptions(array('link_documents' => false));
$collection->addColumn($col);
//$qObj = new BrowseQuery($iFolderId);
$qObj = new ArchivedBrowseQuery($oFolder->getId());
$collection->setQueryObject($qObj);
$aOptions = $collection->getEnvironOptions();
$aOptions['result_url'] = KTUtil::addQueryString($_SERVER['PHP_SELF'], array(kt_array_merge($aBaseParams, array('fFolderId' => $oFolder->getId()))));
$collection->setOptions($aOptions);
$aURLParams = $aBaseParams;
$aURLParams['action'] = 'restore';
$aBreadcrumbs = KTUtil::generate_breadcrumbs($oFolder, $iFolderId, $aURLParams);
$aTemplateData = array('context' => $this, 'folder' => $oFolder, 'breadcrumbs' => $aBreadcrumbs, 'collection' => $collection);
$oTemplate =& $this->oValidator->validateTemplate('ktcore/document/admin/archivebrowse');
return $oTemplate->render($aTemplateData);
}