Пример #1
0
/**
 * generate html string displaying geoPaths completed by user (power trail) medals
 * @author Andrzej Łza Woźniak, 2013-11-23
 */
function getPowerTrailsCompletedByUser($userId)
{
    $ptTypes = powerTrailBase::getPowerTrailTypes();
    $ptCompletedList = powerTrailBase::getPowerTrailsCompletedByUser($userId);
    // var_dump($ptCompletedList);
    $result = '<table width="100%"><tr><td>';
    foreach ($ptCompletedList as $pt) {
        if ($pt['image'] == '') {
            $pt['image'] = 'tpl/stdstyle/images/blue/powerTrailGenericLogo.png';
        }
        $result .= '<div class="ptMedal"><table style="padding-top: 7px;" align="center" height="51" width="51"><tr><td width=52 height=52 valign="center" align="center"><a title="' . $pt['name'] . '" href="powerTrail.php?ptAction=showSerie&ptrail=' . $pt['id'] . '"><img class="imgPtMedal" src="' . $pt['image'] . '"></a></td></tr><tr><td align="center"><img src="' . $ptTypes[$pt["type"]]['icon'] . '" /></td></tr></table></div><div class="ptMedalSpacer"></div>';
    }
    return $result . '</td></tr><tr><td></td></tr></table><br /><br />';
}
Пример #2
0
function displayPtTypesSelector($htmlid, $selectedId = 0, $witchZeroOption = false)
{
    $ptTypesArr = powerTrailBase::getPowerTrailTypes();
    $selector = '<select id="' . $htmlid . '" name="' . $htmlid . '">';
    if ($witchZeroOption) {
        $selector .= '<option value="0">' . tr('pt165') . '</option>';
    }
    foreach ($ptTypesArr as $id => $type) {
        if ($selectedId == $id) {
            $selected = 'selected';
        } else {
            $selected = '';
        }
        $selector .= '<option ' . $selected . ' value="' . $id . '">' . tr($type['translate']) . '</option>';
    }
    $selector .= '</select>';
    return $selector;
}
Пример #3
0
    if ($usr['userid'] == 9067) {
    } else {
        if (!(isset($usr['admin']) && $usr['admin'] == 1)) {
            print tr('pt236');
            exit;
        }
    }
    tpl_set_var("selPtDiv", 'none');
    tpl_set_var("PtDetailsDiv", 'none');
    tpl_set_var('language4js', $lang);
    if (isset($_REQUEST['ptSelector'])) {
        $powerTrail = new PowerTrail(array('id' => $_REQUEST['ptSelector']));
        $_SESSION['ptRmByCog'] = 1;
        $ptData = powerTrailBase::getPtDbRow($_REQUEST['ptSelector']);
        $ptStatus = \lib\Controllers\PowerTrailController::getPowerTrailStatus();
        $ptType = powerTrailBase::getPowerTrailTypes();
        tpl_set_var("ptCaches", preparePtCaches($powerTrail));
        tpl_set_var("ptStatSelect", generateStatusSelector($powerTrail->getStatus()));
        tpl_set_var("ptId", $powerTrail->getId());
        tpl_set_var("ptName", $powerTrail->getName());
        tpl_set_var("ptType", tr($ptType[$ptData['type']]['translate']));
        tpl_set_var("ptStatus", tr($ptStatus[$ptData['status']]['translate']));
        tpl_set_var("PtDetailsDiv", 'block');
    } else {
        tpl_set_var("ptSelector", makePtSelector(powerTrailBase::getAllPt('AND status != 2'), 'ptSelector'));
        tpl_set_var("selPtDiv", 'block');
    }
}
tpl_BuildTemplate();
function makePtSelector($ptAll, $id)
{
Пример #4
0
<?php

$poweTrailMarkers = powerTrailBase::getPowerTrailTypes();
function icon_log_type($icon_small, $text)
{
    global $stylepath;
    return "<img src='{$stylepath}/images/{$icon_small}' class='icon16' alt='{$text}' title='{$text}'/>";
}
function icon_cache_status($status, $text)
{
    global $stylepath;
    switch ($status) {
        case 1:
            $icon = "log/16x16-go.png";
            break;
        case 2:
            $icon = "log/16x16-stop.png";
            break;
        case 3:
            $icon = "log/16x16-trash.png";
            break;
        case 4:
            $icon = "log/16x16-wattend.png";
            break;
        case 5:
            $icon = "log/16x16-wattend.png";
            break;
        case 6:
            $icon = "log/16x16-stop.png";
            break;
        default: