/** * Prepares the document */ protected function _prepareDocument() { jimport('joomla.filesystem.file'); $title = JText::_('COM_HTRAININGLOGS_EDITTRAINING'); $this->document->setTitle($title); $doc = JFactory::getDocument(); $doc->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/site.stylesheet.css'); $doc->addStyleSheet('http://dev.openlayers.org/theme/default/style.css'); $doc->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_style.css'); $doc->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_map_style.css'); LayoutHelper::parseMap($doc); }
/** * function_description * * @param object $tpl template * * @return return_description */ public function display($tpl = null) { // ToDo split in jtg and geoposition $user = JFactory::getUser(); $user_id = (int) $user->id; // $mainframe = JFactory::getApplication(); // $cfg = HTraininglogsHelper::getConfig(); //$gpsData = new GpsDataClass($cfg->unit); $document = JFactory::getDocument(); jimport('joomla.filesystem.file'); // Load Openlayers stylesheet first (for overridding) // TODO add openlayers style in JTrackGallery (url may vary!) $document->addStyleSheet('http://dev.openlayers.org/theme/default/style.css'); $document->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_style.css'); $document->addStyleSheet(JUri::base(true) . '/media/com_htraininglogs/css/jtg_map_style.css'); // Then load jtg_map stylesheet // Then override style with user templates //$template = $mainframe->getTemplate(); //$template_jtg_map_style = 'templates/' . $template . '/css/jtg_map_style.css'; /*if ( JFile::exists($template_jtg_map_style)) { $document->addStyleSheet(JUri::base(true) . '/templates/' . $template . '/css/jtg_map_style.css'); }*/ //$sitename = $document->getTitle() . " - " . $mainframe->getCfg('sitename'); //$mapsxml = JPATH_COMPONENT_ADMINISTRATOR . '/views/maps/maps.xml'; //$this->params_maps = new JRegistry('com_htraininglogs', $mapsxml); //$params = JComponentHelper::getParams('com_htraininglogs'); //print_r($params);exit; LayoutHelper::parseMap($document); // Show Tracks in Overview-Map? //$tracks = (bool) $params->get('jtg_param_tracks'); // $model = $this->getModel(); // $latlons=$model->getlatlons($user_id); // $cats = $model->getCatsData(); // $sortedcats = $model->getCatsData(true); // $where = LayoutHelper::filterTracks($cats); // $access = HtraininglogsHelper::giveAccessLevel(); //$otherfiles = $params->get('jtg_param_otherfiles'); //$mayisee = HtraininglogsHelper::MayIsee($where, $access, $otherfiles); /* $boxlinktext = array( 0 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_PUBLIC'), 1 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_REGISTERED'), 2 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_SPECIAL'), 9 => JText::_('COM_HTRAININGLOGS_LINK_VIEWABLE_FOR_PRIVATE') ); /* if ((bool) $params->get('jtg_param_lh')) { $lh = LayoutHelper::navigation(); } else { $lh = null; }*/ // $footer = LayoutHelper::footer(); // $disclaimericons = LayoutHelper::disclaimericons(); // $rows = $model->getTracksData(null, null, $where); $geo = JRoute::_('index.php?option=com_htraininglogs&view=getpos', false); // $this->newest = null; /* if ($params->get('jtg_param_newest') != 0) { $this->newest = LayoutHelper::parseTopNewest($where, $mayisee, $model, $params->get('jtg_param_newest')); } $this->hits = null; if ($params->get('jtg_param_mostklicks') != 0) { $this->hits = LayoutHelper::parseTopHits($where, $mayisee, $model, $params->get('jtg_param_mostklicks')); } $this->best = null; if ($params->get('jtg_param_best') != 0) { $this->best = LayoutHelper::parseTopBest($where, $mayisee, $model, $params->get('jtg_param_best'), $params->get('jtg_param_vote_show_stars')); } $this->rand = null; if ($params->get('jtg_param_rand') != 0) { $this->rand = LayoutHelper::parseTopRand($where, $mayisee, $model, $params->get('jtg_param_rand')); } // $toptracks = LayoutHelper::parseToptracks($params); $published = "\na.published = 1 AND a.hidden = 0"; switch ($mayisee) { case null: switch ($where) { case "": $where = " WHERE " . $published; break; default: $where = " WHERE " . $where . " AND " . $published; break; } break; default: $where = " WHERE " . $mayisee . " AND " . $published; break; } */ // $this->lh = $lh; // $this->latlons = $latlons; // $this->boxlinktext = $boxlinktext; // $this->footer = $footer; // $this->disclaimericons = $disclaimericons; // $this->gpsData = $gpsData; //$this->rows = $rows; //$this->where = $where; //$this->cats = $cats; //$this->sortedcats = $sortedcats; // $this->cfg = $cfg; $this->geo = $geo; // $this->toptracks = $toptracks; // $this->tracks = $tracks; // $this->params = $params; parent::display($tpl); }