本文整理汇总了PHP中ServiceUtil::getImageArray方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceUtil::getImageArray方法的具体用法?PHP ServiceUtil::getImageArray怎么用?PHP ServiceUtil::getImageArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServiceUtil
的用法示例。
在下文中一共展示了ServiceUtil::getImageArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleDataSpace
private function handleDataSpace(&$data, $searchName)
{
//require_once 'Globals.php';
require_once 'ServiceUtil.php';
$util = new ServiceUtil();
$newName = $searchName;
if (strcasecmp($searchName, "cell") == 0) {
$newName = $searchName;
} else {
if (strcasecmp($searchName, "neuron") == 0) {
$newName = $searchName;
} else {
if ($util->endsWith($searchName, "%20cell")) {
$tempName = substr($searchName, 0, strlen($searchName) - strlen("%20cell"));
$newName = $tempName;
} else {
if ($util->endsWith($searchName, "%20neuron")) {
$tempName = substr($searchName, 0, strlen($searchName) - strlen("%20neuron"));
$newName = $tempName;
}
}
}
}
//echo "<p>----------------NewName:".$newName;
$source_search_result = array();
$sources = $data["config_array"]->sources;
$category_to_source = $data["category_to_source"];
$categories = $data["config_array"]->categories;
$category_count_array = array();
foreach ($sources as $source) {
$source_search_result[$source->curie] = $util->searchWithinSource($newName, $source->curie, 20, 0);
}
foreach ($categories as $category) {
$category_count_array[$category] = 0;
$categorySources = $category_to_source[$category];
foreach ($categorySources as $csource) {
$sourceResult = $source_search_result[$csource->curie];
if (!is_null($sourceResult)) {
$category_count_array[$category] = $category_count_array[$category] + $sourceResult->result->resultCount;
}
}
}
$data["source_search_result"] = $source_search_result;
//var_dump($category_count_array);
$data["category_count_array"] = $category_count_array;
$data['cilImages'] = array();
$data['originalCILImages'] = array();
$data['neuroMorphoImages'] = array();
foreach ($sources as $source) {
if ($source->has_images) {
$tempImages = $util->getImageArray($source_search_result[$source->curie], 20);
if (strcmp($source->curie, "nif-0000-37639-1") == 0) {
$data['originalCILImages'] = $tempImages;
//echo "------originalCILImages source:".$source->curie;
} else {
if (strcmp($source->curie, "nif-0000-00006-1") == 0) {
$data['neuroMorphoImages'] = $tempImages;
//echo "------neuroMorphoImages source:".$source->curie;
}
}
$data['cilImages'] = array_merge($tempImages, $data['cilImages']);
}
}
$imageGallery = array();
if (strcmp($data['title'], "Neocortical pyramidal cell") == 0) {
$gimage = " <a href=\"http://celltypes.brain-map.org/mouse/experiment/morphology/330080937\" target=\"_blank\">" . " <img width=\"84\" height=\"100\" src=\"http://celltypes.brain-map.org/cgi-bin/imageservice?path=/external/mousecelltypes/prod210/specimen_324466858/min_xy_324466858.aff&mime=2\"/>" . " </a>";
array_push($imageGallery, $gimage);
}
if (count($data['originalCILImages']) > 0) {
array_push($imageGallery, $data['originalCILImages'][0]);
}
if (count($data['originalCILImages']) > 1) {
array_push($imageGallery, $data['originalCILImages'][1]);
}
if (count($data['neuroMorphoImages']) > 0) {
foreach ($data['neuroMorphoImages'] as $gimage) {
array_push($imageGallery, $gimage);
if (count($imageGallery) == 3) {
break;
}
}
}
if (count($data['originalCILImages']) > 2) {
$cindex = 0;
foreach ($data['originalCILImages'] as $gimage) {
if (count($imageGallery) == 3) {
break;
}
if ($cindex > 1) {
array_push($imageGallery, $gimage);
}
$cindex++;
}
}
$data['imageGallery'] = $imageGallery;
/*
$data['neuroElectroResult'] = searchWithinSource($newName, $neuroElectro, 20);
$data['neuroMorphoResult'] = searchWithinSource($newName, $neuroMorpho, 20);
$data['genSatResult'] = searchWithinSource($newName, $genSat, 20);
$data['neuronDBResult'] = searchWithinSource($newName, $neuronDB, 20);
//.........这里部分代码省略.........