本文整理汇总了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;
}