本文整理汇总了PHP中CMbArray::getPrevNextKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbArray::getPrevNextKeys方法的具体用法?PHP CMbArray::getPrevNextKeys怎么用?PHP CMbArray::getPrevNextKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbArray
的用法示例。
在下文中一共展示了CMbArray::getPrevNextKeys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetPrevNextKeysHasRightReturn
public function testGetPrevNextKeysHasRightReturn()
{
$resArray = array("prev" => null, "next" => "key2");
$this->assertEquals($resArray, $this->stub->getPrevNextKeys(array("key1" => "val1", "key2" => "val2"), "key1"));
$resArray = array("prev" => "key1", "next" => "key3");
$this->assertEquals($resArray, $this->stub->getPrevNextKeys(array("key1" => "val1", "key2" => "val2", "key3" => "val3"), "key2"));
$resArray = array("prev" => "key1", "next" => null);
$this->assertEquals($resArray, $this->stub->getPrevNextKeys(array("key1" => "val1", "key2" => "val2"), "key2"));
}
示例2: foreach
}
if (CValue::get("reloadzones") == 1) {
$smarty->display("inc_zones_fields.tpl");
} else {
if (!$compte_rendu_id && !$switch_mode && ($compte_rendu->fast_edit || $force_fast_edit || $compte_rendu->fast_edit_pdf && $pdf_thumbnails && $pdf_and_thumbs)) {
$printers = $function->loadBackRefs("printers");
if (is_array($printers)) {
/** @var $_printer CPrinter */
foreach ($printers as $_printer) {
$_printer->loadTargetObject();
}
}
$smarty->assign("_source", $templateManager->document);
$smarty->assign("printers", $printers);
$smarty->assign("object_guid", CValue::get("object_guid"));
$smarty->assign("unique_id", CValue::get("unique_id"));
$smarty->display("fast_mode.tpl");
} else {
// Charger le document précédent et suivant
$prevnext = array();
if ($compte_rendu->_id) {
$object->loadRefsDocs();
$prevnext = CMbArray::getPrevNextKeys($object->_ref_documents, $compte_rendu->_id);
}
$templateManager->initHTMLArea();
$smarty->assign("switch_mode", CValue::get("switch_mode", 0));
$smarty->assign("templateManager", $templateManager);
$smarty->assign("prevnext", $prevnext);
$smarty->display("edit_compte_rendu.tpl");
}
}
示例3: array
$smarty->assign("file_id", $file_id);
$smarty->assign("isConverted", $isConverted);
$smarty->assign("show_editor", $show_editor);
$smarty->assign("display_as_is", $display_as_is);
if ($popup == 1) {
$listCat = null;
$fileprev = null;
$filenext = null;
if ($object) {
$affichageFile = CFile::loadDocItemsByObject($object);
// Récupération du fichier/doc préc et suivant
$aAllFilesDocs = array();
foreach ($affichageFile as $keyCat => $currCat) {
$aAllFilesDocs = array_merge($aAllFilesDocs, $affichageFile[$keyCat]["items"]);
}
$aFilePrevNext = CMbArray::getPrevNextKeys($aAllFilesDocs, $keyFileSel);
foreach ($aFilePrevNext as $key => $value) {
if ($value) {
$aFile =& $aAllFilesDocs[$aFilePrevNext[$key]];
$keyFile = $aFile->_spec->key;
${"file" . $key} = array("elementId" => $aFile->{$keyFile}, "elementClass" => $aFile->_class);
}
}
// Récupération des destinataires pour l'envoi par mail
$destinataires = array();
CDestinataire::makeAllFor($object);
$list_destinataires = CDestinataire::$destByClass;
foreach ($list_destinataires as $_destinataires_by_class) {
foreach ($_destinataires_by_class as $_destinataire) {
if (!isset($_destinataire->nom) || strlen($_destinataire->nom) == 0 || $_destinataire->nom === " ") {
continue;