本文整理汇总了PHP中cache::getCacheIconsSet方法的典型用法代码示例。如果您正苦于以下问题:PHP cache::getCacheIconsSet方法的具体用法?PHP cache::getCacheIconsSet怎么用?PHP cache::getCacheIconsSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache
的用法示例。
在下文中一共展示了cache::getCacheIconsSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkCacheStatusByUser
public static function checkCacheStatusByUser($record, $userId)
{
$cacheTypesIcons = cache::getCacheIconsSet();
if ($record['user_id'] == $userId) {
return $cacheTypesIcons[$record['cache_type']]['iconSet'][1]['iconSmallOwner'];
} elseif (self::is_cache_found($record['cache_id'], $userId)) {
return $cacheTypesIcons[$record['cache_type']]['iconSet'][1]['iconSmallFound'];
} else {
return $cacheTypesIcons[$record['cache_type']]['iconSet'][1]['iconSmall'];
}
}
示例2: userMedals
private function userMedals()
{
/* lang test */
/* get locale from browser */
$userPrefferedLanguages = explode(';', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$mostPrefferedLanguage = explode(',', $userPrefferedLanguages[0]);
$locale = str_replace('-', '_', $mostPrefferedLanguage[0]);
if (isset($_REQUEST['locale'])) {
/* get locale from $_REQUEST*/
$locale = $_REQUEST['locale'];
}
$putenv = putenv("LANG={$locale}");
$setlocale = setlocale(LC_ALL, $locale);
// d($locale, $putenv, $setlocale);
bindtextdomain("medals", __DIR__ . '/../languages');
bind_textdomain_codeset('medals', 'UTF-8');
textdomain("medals");
// print gettext('level');
// print '<BR>';
/* end lang test*/
$ocConfig = \lib\Objects\OcConfig\OcConfig::instance();
$smarty = new \Smarty();
$smarty->setCompileDir($ocConfig->getDynamicFilesPath() . 'tmp/templates_c');
$smarty->debugging = false;
$smarty->caching = false;
$smarty->setTemplateDir(__DIR__ . '/../../tpl/smarty');
$smarty->setCacheDir($ocConfig->getDynamicFilesPath() . 'tmp/smarty_cache');
$user = new \lib\Objects\User\User(array('userId' => $this->request['userId']));
$user->loadMedalsFromDb();
// d($user, $user->getMedals());
/* @var $medal \lib\Objects\Medals\Medal */
foreach ($user->getMedals() as $medal) {
$medal->checkConditionsForUser($user);
$smartyMedals['medals'][] = array('imgSrc' => $medal->getImage(), 'name' => $medal->getName(), 'profile' => $medal->getMedalProfile(), 'level' => $medal->getLevel(), 'levelName' => $medal->getLevelName(), 'currentLevelInfo' => $medal->getLevelInfo(), 'nextLevelInfo' => $medal->getLevelInfo($medal->getLevel() + 1));
}
$smartyMedals['tr'] = array('level' => _('level'), 'user' => _('user'), 'medals' => _('medals'), 'nextLevelRequirements' => _('Next level Requirements'), 'currentLevelRequirements' => _('Level achievements'), 'medalInfo' => _('Medal Profile'), 'cacheTypes' => _('Geocache types'));
$smarty->assign('geocacheIcons', \cache::getCacheIconsSet());
$smarty->assign('user', $user->getUserInformation());
$smarty->assign("smartyMedals", $smartyMedals);
$smarty->assign("bgImage", $this->shuffleBackgroundImage());
$smarty->display('medals.tpl');
}
示例3: displayAllCachesOfPowerTrail
function displayAllCachesOfPowerTrail(\lib\Objects\PowerTrail\PowerTrail $powerTrail, $choseFinalCaches)
{
isset($_SESSION['user_id']) ? $userId = $_SESSION['user_id'] : ($userId = -9999);
$powerTrailCachesUserLogsByCache = $powerTrail->getFoundCachsByUser($userId);
$geocacheFoundArr = array();
foreach ($powerTrailCachesUserLogsByCache as $geocache) {
$geocacheFoundArr[$geocache['geocacheId']] = $geocache;
}
if (count($powerTrail->getCacheCount()) == 0) {
return '<br /><br />' . tr('pt082');
}
$statusIcons = array(1 => '/tpl/stdstyle/images/log/16x16-published.png', 2 => '/tpl/stdstyle/images/log/16x16-temporary.png', 3 => '/tpl/stdstyle/images/log/16x16-trash.png', 5 => '/tpl/stdstyle/images/log/16x16-need-maintenance.png');
$statusDesc = array(1 => tr('pt141'), 2 => tr('pt142'), 3 => tr('pt143'), 5 => tr('pt144'));
$cacheTypesIcons = cache::getCacheIconsSet();
$cacheRows = '<table class="ptCacheTable" align="center" width="90%"><tr>
<th>' . tr('pt075') . '</th>
<th>' . tr('pt076') . '</th>';
if ($choseFinalCaches) {
$cacheRows .= '<th></th>';
}
$cacheRows .= ' <th>' . tr('pt077') . '</th>
<th><img src="tpl/stdstyle/images/log/16x16-found.png" /></th>
<th>' . tr('pt078') . '</th>
<th><img src="images/rating-star.png" /></th>
</tr>';
$totalFounds = 0;
$totalTopRatings = 0;
$bgcolor = '#ffffff';
$cachetypes = array(1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 9 => 0, 10 => 0);
$cacheSize = array(2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0);
unset($_SESSION['geoPathCacheList']);
/* @var $geocache lib\Objects\GeoCache\GeoCache*/
foreach ($powerTrail->getGeocaches() as $geocache) {
$_SESSION['geoPathCacheList'][] = $geocache->getCacheId();
$totalFounds += $geocache->getFounds();
$totalTopRatings += $geocache->getRecommendations();
$cachetypes[$geocache->getCacheType()]++;
$cacheSize[$geocache->getSizeId()]++;
// powerTrailController::debug($cache); exit;
if ($bgcolor == '#eeeeff') {
$bgcolor = '#ffffff';
} else {
$bgcolor = '#eeeeff';
}
if ($geocache->isIsPowerTrailFinalGeocache()) {
$bgcolor = '#000000';
$fontColor = '<font color ="#ffffff">';
} else {
$fontColor = '';
}
$cacheRows .= '<tr bgcolor="' . $bgcolor . '">';
//display icon found/not found depend on current user
if (isset($geocacheFoundArr[$geocache->getCacheId()])) {
$cacheRows .= '<td align="center"><img src="' . $cacheTypesIcons[$geocache->getCacheType()]['iconSet'][1]['iconSmallFound'] . '" /></td>';
} elseif ($geocache->getOwner()->getUserId() == $userId) {
$cacheRows .= '<td align="center"><img src="' . $cacheTypesIcons[$geocache->getCacheType()]['iconSet'][1]['iconSmallOwner'] . '" /></td>';
} else {
$cacheRows .= '<td align="center"><img src="' . $cacheTypesIcons[$geocache->getCacheType()]['iconSet'][1]['iconSmall'] . '" /></td>';
}
//cachename, username
$cacheRows .= '<td><b><a href="' . $geocache->getWaypointId() . '">' . $fontColor . $geocache->getCacheName() . '</b></a> (' . $geocache->getOwner()->getUserName() . ') ';
if ($geocache->isIsPowerTrailFinalGeocache()) {
$cacheRows .= '<span class="finalCache">' . tr('pt148') . '</span>';
}
$cacheRows .= '</td>';
//chose final caches
if ($choseFinalCaches) {
if ($geocache->isIsPowerTrailFinalGeocache()) {
$checked = 'checked = "checked"';
} else {
$checked = '';
}
$cacheRows .= '<td><span class="ownerFinalChoice"><input type="checkbox" id="fcCheckbox' . $geocache->getCacheId() . '" onclick="setFinalCache(' . $geocache->getCacheId() . ')" ' . $checked . ' /></span></td>';
}
//status
$cacheRows .= '<td align="center"><img src="' . $statusIcons[$geocache->getStatus()] . '" title="' . $statusDesc[$geocache->getStatus()] . '"/></td>';
//FoundCount
$cacheRows .= '<td align="center">' . $fontColor . $geocache->getFounds() . '</td>';
//score, toprating
$cacheRows .= '<td align="center">' . ratings($geocache->getScore(), $geocache->getRatingVotes()) . '</td>';
$cacheRows .= '<td align="center">' . $fontColor . $geocache->getRecommendations() . '</td>';
'</tr>';
}
$cacheRows .= '
<tr bgcolor="#efefff">
<td></td>
<td style="font-size: 9px;">' . tr('pt085') . '</td>
<td></td>
<td align="center" style="font-size: 9px;">' . $totalFounds . '</td>
<td></td>
<td align="center" style="font-size: 9px;">' . $totalTopRatings . '</td>
</tr>
</table>';
$restCaches = $cachetypes[4] + $cachetypes[5] + $cachetypes[6] + $cachetypes[8] + $cachetypes[9] + $cachetypes[10];
$countCaches = $powerTrail->getCacheCount();
$restCachesPercent = round($restCaches * 100 / $countCaches);
foreach ($cachetypes as $key => $value) {
$cachePercent[$key] = round($value * 100 / $countCaches);
}
foreach ($cacheSize as $key => $value) {
//.........这里部分代码省略.........
示例4: displayAllCachesOfPowerTrail
function displayAllCachesOfPowerTrail(\lib\Objects\PowerTrail\PowerTrail $powerTrail)
{
isset($_SESSION['user_id']) ? $userId = $_SESSION['user_id'] : ($userId = -9999);
$powerTrailCachesUserLogsByCache = $powerTrail->getPowerTrailCachesLogsForCurrentUser();
$cacheTypesIcons = cache::getCacheIconsSet();
$pTrailCaches = $powerTrail->getGeocaches();
$cacheRows = '';
/* @var $geocache \lib\Objects\Geocache\Geocache */
foreach ($pTrailCaches as $geocache) {
// avoid crash js on quotas (');
$cacheName = str_replace("'", ''', $geocache->getCacheName());
if (isset($powerTrailCachesUserLogsByCache[$geocache->getCacheId()])) {
$image = $cacheTypesIcons[$geocache->getCacheType()]['iconSet'][1]['iconSmallFound'];
} elseif ($geocache->getOwner()->getUserId() == $userId) {
$image = $cacheTypesIcons[$geocache->getCacheType()]['iconSet'][1]['iconSmallOwner'];
} else {
$image = $cacheTypesIcons[$geocache->getCacheType()]['iconSet'][1]['iconSmall'];
}
$cacheRows .= '[' . $geocache->getCoordinates()->getLatitude() . "," . $geocache->getCoordinates()->getLongitude() . ",'<a href=" . $geocache->getWaypointId() . " target=_new>" . $cacheName . "</a>'," . "'{$image}','" . $cacheName . "',],";
}
$cacheRows = rtrim($cacheRows, ",");
return $cacheRows;
}