<?php $rootpath = __DIR__ . '/../'; require_once __DIR__ . '/../lib/common.inc.php'; db_disconnect(); $powerTrail = new \lib\Objects\PowerTrail\PowerTrail(array('id' => (int) $_REQUEST['ptrail'])); if (isset($_REQUEST['choseFinalCaches'])) { $choseFinalCaches = true; } else { $choseFinalCaches = false; } print displayAllCachesOfPowerTrail($powerTrail, $choseFinalCaches); 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>';
tpl_set_var('ptTypeUserActions', '<a href="javascript:void(0)" class="editPtDataButton" onclick="togglePtTypeEdit();">' . tr('pt046') . '</a>'); tpl_set_var('ptDateUserActions', '<a href="javascript:void(0)" class="editPtDataButton" onclick="togglePtDateEdit();">' . tr('pt045') . '</a>'); tpl_set_var('cacheCountUserActions', '<a href="javascript:void(0)" class="editPtDataButton" onclick="ajaxCountPtCaches(' . $powerTrail->getId() . ')">' . tr('pt033') . '</a>'); tpl_set_var('ownerListUserActions', '<a id="dddx" href="javascript:void(0)" class="editPtDataButton" onclick="clickShow(\'addUser\', \'dddx\'); ">' . tr('pt030') . '</a> <span style="display: none" id="addUser">' . tr('pt028') . '<input type="text" id="addNewUser2pt" /><br /><a href="javascript:void(0)" class="editPtDataButton" onclick="cancellAddNewUser2pt()" >' . tr('pt031') . '</a><a href="javascript:void(0)" class="editPtDataButton" onclick="ajaxAddNewUser2pt(' . $powerTrail->getId() . ')" >' . tr('pt032') . '</a></span>'); tpl_set_var('ptTypesSelector', displayPtTypesSelector('ptType1', $powerTrail->getType())); } else { tpl_set_var('ptStatus', ''); tpl_set_var('percentDemandUserActions', 'none'); tpl_set_var('displayAddCachesButtons', 'none'); tpl_set_var('ptTypeUserActions', ''); tpl_set_var('ptDateUserActions', ''); tpl_set_var('cacheCountUserActions', ''); tpl_set_var('ownerListUserActions', ''); } if ($usr || !$hide_coords) { tpl_set_var('ptList4map', displayAllCachesOfPowerTrail($powerTrail)); } } else { tpl_set_var('mapOuterdiv', 'none'); tpl_set_var('mainPtInfo', tr('pt018')); } break; default: tpl_set_var('PowerTrails', displayPTrails($pt->getpowerTrails()), false); tpl_set_var('displayPowerTrails', 'block'); break; } // exit; tpl_BuildTemplate(); } // budujemy kod html ktory zostaje wsylany do przegladraki