/** * Display the view * * @param string $tpl Template name * * @return void * * @throws Exception */ public function display($tpl = null) { require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $app = JFactory::getApplication(); $user = JFactory::getUser(); $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->params = $app->getParams('com_einsatzkomponente'); $this->orga_fahrzeuge = EinsatzkomponenteHelper::getOrga_fahrzeuge($this->item->id); $document = JFactory::getDocument(); if ($this->params->get('display_orga_bootstrap', '1')) { // Import Bootstrap $document->addScript('components/com_einsatzkomponente/assets/bootstrap/js/bootstrap.min.js'); $document->addStyleSheet('components/com_einsatzkomponente/assets/bootstrap/css/bootstrap.min.css'); $document->addStyleSheet('components/com_einsatzkomponente/assets/bootstrap/css/bootstrap-responsive.min.css'); } $document->addStyleDeclaration($this->params->get('organisation_css', '')); if (!empty($this->item)) { $this->form = $this->get('Form'); } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } if ($this->_layout == 'edit') { $authorised = $user->authorise('core.create', 'com_einsatzkomponente'); if ($authorised !== true) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); } } $this->_prepareDocument(); parent::display($tpl); }
<?php } ?> </tr> <?php if ($this->params->get('show_orga_fahrzeuge', '1')) { ?> <tr> <td style="border:0px !important;" colspan="<?php echo isset($this->items[0]) ? count(get_object_vars($this->items[0])) : 10; ?> "> <?php $orga_fahrzeuge = EinsatzkomponenteHelper::getOrga_fahrzeuge($item->id); $array = array(); foreach ((array) $orga_fahrzeuge as $value) { if (!is_array($value)) { $array[] = $value; } } ?> <?php foreach ($array as $value) { ?> <?php if ($value->state == '2') { $value->name = $value->name . ' (a.D.)'; } ?>
<?php echo $results[0]->name; ?> <br/> <?php } ?> <?php } ?> <?php } ?> <?php if ($this->item->vehicles) { $orga_fahrzeuge = EinsatzkomponenteHelper::getOrga_fahrzeuge($results[0]->id); $array = array(); foreach ((array) $orga_fahrzeuge as $value) { if (!is_array($value)) { $array[] = $value; } } $array_vehicle = array(); foreach ((array) $this->item->vehicles as $value) { if (!is_array($value)) { $array_vehicle[] = $value; } } echo '<div class="items"><ul class="items_list">'; foreach ($array as $value) { // sonstige Fahrzeuge anzeigen lassen
/** * Display the view */ public function display($tpl = null) { require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $app = JFactory::getApplication(); $user = JFactory::getUser(); $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->params = $app->getParams('com_einsatzkomponente'); $this->form = $this->get('Form'); $this->gmap_config = EinsatzkomponenteHelper::load_gmap_config(); // GMap-Config aus helper laden //print_r ($this->item);break; $this->orga_fahrzeuge = EinsatzkomponenteHelper::getOrga_fahrzeuge($this->item->id); $document = JFactory::getDocument(); if ($this->params->get('gmap_action', '0') == '1') { $orga_image = ''; $standort = new StdClass(); $standort->gmap_latitude = '0'; $standort->gmap_longitude = '0'; $organisationen = '[["",1,1,0],["",1,1,0] ]'; $display_map_route = 'false'; $einsatzgebiet = '[[0,0]]'; $display_detail_popup = 'false'; $marker1_title = $this->item->name; $marker1_lat = $this->item->gmap_latitude; $marker1_lng = $this->item->gmap_longitude; $marker1_image = '../../images/com_einsatzkomponente/images/map/icons/' . $this->params->get('detail_orga_image', 'haus_rot.png'); $marker2_title = ''; // leer $marker2_lat = ''; // leer $marker2_lng = ''; // leer $marker2_image = ''; // leer $center_lat = $this->item->gmap_latitude; $center_lng = $this->item->gmap_longitude; $gmap_zoom_level = $this->params->get('detail_gmap_zoom_level', '12'); $gmap_onload = $this->params->get('detail_gmap_onload', 'HYBRID'); $zoom_control = 'true'; $document->addScript('https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false'); $document->addScriptDeclaration(EinsatzkomponenteHelper::getGmap($marker1_title, $marker1_lat, $marker1_lng, $marker1_image, $marker2_title, $marker2_lat, $marker2_lng, $marker2_image, $center_lat, $center_lng, $gmap_zoom_level, $gmap_onload, $zoom_control, $organisationen, $orga_image, $einsatzgebiet, $display_detail_popup, $standort, $display_map_route)); } if ($this->params->get('gmap_action', '0') == '2') { $orga_image = ''; $standort = new StdClass(); $standort->gmap_latitude = '0'; $standort->gmap_longitude = '0'; $organisationen = '[["",1,1,0],["",1,1,0] ]'; $einsatzgebiet = '[[0,0]]'; $display_map_route = 'false'; $display_detail_popup = 'false'; $marker1_title = $this->item->name; $marker1_lat = $this->item->gmap_latitude; $marker1_lng = $this->item->gmap_longitude; $marker1_image = '../../images/com_einsatzkomponente/images/map/icons/' . $this->params->get('detail_orga_image', 'haus_rot.png'); $marker2_title = ''; // leer $marker2_lat = ''; // leer $marker2_lng = ''; // leer $marker2_image = ''; // leer $center_lat = $this->item->gmap_latitude; $center_lng = $this->item->gmap_longitude; $gmap_zoom_level = $this->params->get('detail_gmap_zoom_level', '12'); $gmap_onload = $this->params->get('detail_gmap_onload', 'HYBRID'); $zoom_control = 'true'; $document->addScript('components/com_einsatzkomponente/assets/osm/util.js'); $document->addScript('http://www.openlayers.org/api/OpenLayers.js'); $document->addScript('http://www.openstreetmap.org/openlayers/OpenStreetMap.js'); $document->addStyleSheet('components/com_einsatzkomponente/assets/osm/map.css'); $document->addStyleSheet('components/com_einsatzkomponente/assets/osm/ie_map.css'); $document->addScript('components/com_einsatzkomponente/assets/osm/OpenLayers_Map_minZoom_maxZoom_Patch.js'); $document->addScriptDeclaration(EinsatzkomponenteHelper::getOsm($marker1_title, $marker1_lat, $marker1_lng, $marker1_image, $marker2_title, $marker2_lat, $marker2_lng, $marker2_image, $center_lat, $center_lng, $gmap_zoom_level, $gmap_onload, $zoom_control, $organisationen, $orga_image, $einsatzgebiet, $display_detail_popup, $standort, $display_map_route)); } $document->addStyleDeclaration($this->params->get('organisation_css', '')); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } if ($this->_layout == 'edit') { $authorised = $user->authorise('core.create', 'com_einsatzkomponente'); if ($authorised !== true) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); } } if ($this->item->state === '0') { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), '0'); } if ($this->item->state === '2') { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), '2'); } if ($this->item->state === '-2') { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR'), '-2'); } $this->_prepareDocument(); parent::display($tpl); }