本文整理匯總了PHP中ArrayUtils::getLastKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayUtils::getLastKey方法的具體用法?PHP ArrayUtils::getLastKey怎麽用?PHP ArrayUtils::getLastKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ArrayUtils
的用法示例。
在下文中一共展示了ArrayUtils::getLastKey方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _getCheckedOutEContentLinks
private function _getCheckedOutEContentLinks($eContentRecord, $eContentItem, $eContentCheckout)
{
global $configArray;
global $user;
$links = array();
$addDefaultTypeLinks = false;
if ($eContentItem != null) {
if ($eContentRecord->accessType == 'acs' && ($eContentItem->item_type == 'epub' || $eContentItem->item_type == 'pdf')) {
//Protected by ACS server
//Links to read the title online or checkout from ACS server
if ($eContentItem->item_type == 'pdf') {
$links = array_merge($links, $this->_getACSPdfLinks($eContentItem, $eContentCheckout));
} elseif ($eContentItem->item_type == 'epub') {
$links = array_merge($links, $this->_getACSEpubLinks($eContentItem, $eContentCheckout));
}
} else {
//Single usage or free
//default links to read the title or download
$links = array_merge($links, $this->getDefaultEContentLinks($eContentRecord, $eContentItem));
}
} else {
$eContentItems = $eContentRecord->getItems();
foreach ($eContentItems as $item) {
if ($eContentRecord->accessType == 'acs' && ($item->item_type == 'epub' || $item->item_type == 'pdf')) {
//Protected by ACS server
//Links to read the title online or checkout from ACS server
if ($item->item_type == 'pdf') {
$links = array_merge($links, $this->_getACSPdfLinks($item, $eContentCheckout));
} elseif ($item->item_type == 'epub') {
$links = array_merge($links, $this->_getACSEpubLinks($item, $eContentCheckout));
}
} else {
//Single usage or free
//default links to read the title or download
$links = array_merge($links, $this->getDefaultEContentLinks($eContentRecord, $item));
}
$links[ArrayUtils::getLastKey($links)]['item_type'] = $item->item_type;
}
}
//Add a link to return the title
if ($eContentCheckout->downloadedToReader == 0) {
$links[] = array('text' => 'Return Now', 'onclick' => "if (confirm('Are you sure you want to return this title?')){returnEpub('{$configArray['Site']['path']}/EcontentRecord/{$eContentRecord->id}/ReturnTitle')};return false;", 'typeReturn' => 0);
} else {
$links[] = array('text' => 'Return Now', 'onclick' => "alert('Please return this title from your digital reader.');return false;", 'typeReturn' => 1);
}
return $links;
}