/** * Add the page title and toolbar. */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; if (isset($this->item->checked_out)) { $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); } else { $checkedOut = false; } $canDo = EinsatzkomponenteHelper::getActions(); JToolBarHelper::title(JText::_('COM_EINSATZKOMPONENTE_TITLE_GMAPKONFIGURATION'), 'gmapkonfiguration.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('gmapkonfiguration.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('gmapkonfiguration.save', 'JTOOLBAR_SAVE'); } // If an existing item, can save to a copy. // if (!$isNew && $canDo->get('core.create')) { // JToolBarHelper::custom('gmapkonfiguration.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); // } if (empty($this->item->id)) { JToolBarHelper::cancel('gmapkonfiguration.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('gmapkonfiguration.cancel', 'JTOOLBAR_CLOSE'); } JToolBarHelper::divider(); if (!$checkedOut && $canDo->get('core.admin')) { //JToolBarHelper::custom('gmapkonfiguration.reset', 'save-new.png', 'save-new_f2.png', 'Einstellungen zurücksetzen', false); JToolBarHelper::custom('gmapkonfiguration.reset', 'refresh.png', 'refresh_f2.png', 'Alle Werte zurücksetzen', false); } }
/** * 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); }
/** * 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(); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_einsatzkomponente'); //print_r ($this->items);break; //Komponentenversion aus Datenbank lesen $this->version = EinsatzkomponenteHelper::getVersion(); $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('organisationen_css', '')); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
/** * Add the page title and toolbar. */ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $isNew = $this->item->id == 0; if (isset($this->item->checked_out)) { $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); } else { $checkedOut = false; } $canDo = EinsatzkomponenteHelper::getActions(); JToolBarHelper::title(JText::_('COM_EINSATZKOMPONENTE_TITLE_AUSRUESTUNG'), 'ausruestung.png'); // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { JToolBarHelper::apply('ausruestung.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('ausruestung.save', 'JTOOLBAR_SAVE'); } if (!$checkedOut && $canDo->get('core.create')) { JToolBarHelper::custom('ausruestung.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::custom('ausruestung.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } if (empty($this->item->id)) { JToolBarHelper::cancel('ausruestung.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('ausruestung.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/einsatzkomponente.php'; $state = $this->get('State'); $canDo = EinsatzkomponenteHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_EINSATZKOMPONENTE_TITLE_KATEGORIEN'), 'kategorien.png'); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/kategorie'; if (file_exists($formPath)) { if ($canDo->get('core.create')) { JToolBarHelper::addNew('kategorie.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit') && isset($this->items[0])) { JToolBarHelper::editList('kategorie.edit', 'JTOOLBAR_EDIT'); } } if ($canDo->get('core.edit.state')) { if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::custom('kategorien.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('kategorien.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else { if (isset($this->items[0])) { //If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'kategorien.delete', 'JTOOLBAR_DELETE'); } } // if (isset($this->items[0]->state)) { // JToolBarHelper::divider(); // JToolBarHelper::archiveList('kategorien.archive','JTOOLBAR_ARCHIVE'); // } if (isset($this->items[0]->checked_out)) { JToolBarHelper::custom('kategorien.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } } //Show trash and delete for components that uses the state field if (isset($this->items[0]->state)) { if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'kategorien.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } else { if ($canDo->get('core.edit.state')) { //JToolBarHelper::trash('kategorien.trash','JTOOLBAR_TRASH'); JToolBarHelper::deleteList('', 'kategorien.delete', 'JTOOLBAR_DELETE'); JToolBarHelper::divider(); } } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_einsatzkomponente'); } //Set sidebar action - New in 3.0 JHtmlSidebar::setAction('index.php?option=com_einsatzkomponente&view=kategorien'); $options = ''; $options[] = JHtml::_('select.option', '1', 'JPUBLISHED'); $options[] = JHtml::_('select.option', '0', 'JUNPUBLISHED'); $options[] = JHtml::_('select.option', '*', 'JALL'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.state'), true)); $this->extra_sidebar = ''; }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 3.0 */ protected function getInput() { $document = JFactory::getDocument(); require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; $html = array(); $val = ''; $val = EinsatzkomponenteHelper::getValidation(); if ($val == '12') { $html[] = '<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert">x</button><span aria-hidden="true" class="icon-cancel"></span> ' . JText::_('<p>Diese Version von <b>Einsatzkomponente</b> ist validiert. <br/> Vielen Dank für Ihre Unterstützung.</p><p>- Die Copyrights im Frontend, sollten jetzt alle entfernt sein.</p>'); } else { $html[] = '<div class="alert alert-error"><button type="button" class="close" data-dismiss="alert">x</button><span aria-hidden="true" class="icon-cancel"></span>Diese Version von <b>Einsatzkomponente</b> ist nicht validiert. Sie können selbstverständlich <b>alle Funktionen</b> kostenlos nutzen,<br/> aber über eine kleine Unterstützung an die Entwickler, würden wir uns natürlich sehr freuen. <br/>Helfen Sie uns, damit wir Ihnen dieses und weitere Projekte auch in Zukunft kostenlos und ohne Werbung anbieten können. <br/><br/>Schicken Sie eine Anfrage via Mail an validate@einsatzkomponente.de und holen Sie sich heute noch den Validation-Schlüssel.<br/><br/><p>kleiner Vorteil:<br/>- Das Copyright im Frontend wird dadurch entfernt. ;-)<br/>- und bevorzugten Support im Forum und via Email</p></div><a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9HDFKVJSKSEFY"><div>Spende über PAYPAL : <img border=0 src="https://www.paypalobjects.com/de_DE/DE/i/btn/btn_donateCC_LG.gif" /></div></a><br/><br/> '; if ($val == '1') { $html[] = '<span class="label label-important">Achtung !! Dies ist keine gültige URL. (Wenden Sie sich bitte an den Support im Forum)</span>'; } if ($val == '2') { $html[] = '<span class="label label-important">Achtung !! Dies ist kein gültiges Passwort. (Wenden Sie sich bitte an den Support im Forum)</span>'; } } $html[] = '<h2>Einsatzkomponente Version 3.x</h2>'; if ($val == '12') { $html[] = ''; } else { $html[] = '<h3>Entwickler-Version</h3>'; } $html[] = '<p></p>'; $html[] = '<p><a href="http://www.einsatzkomponente.de/" target="_blank">Supportforum: http://www.einsatzkomponente.de/</a></p>'; return implode($html); }
function display($tpl = null) { require_once JPATH_COMPONENT . '/helpers/einsatzkomponente.php'; EinsatzkomponenteHelper::getValidation(); $this->addToolBar(); // Display the template parent::display($tpl); }
public function pdf() { // Check for request forgeries JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $cid = JFactory::getApplication()->input->get('id', array(), 'array'); if (!is_array($cid) || count($cid) < 1) { JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror'); } else { $msg = EinsatzkomponenteHelper::pdf($cid); $this->setRedirect('index.php?option=com_einsatzkomponente&view=einsatzbericht&layout=edit&id=' . $cid[0], $msg); } }
/** * 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 // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $document = JFactory::getDocument(); // 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->addStyleSheet('components/com_einsatzkomponente/assets/css/einsatzkomponente.css'); $document->addStyleDeclaration($this->params->get('edit_css', '')); //JHtml::_('jquery.framework',true); //$document->addScript('components/com_einsatzkomponente/assets/jquery/jquery1.9.1.js'); //$document->addScript('//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'); //$document->addScript('components/com_einsatzkomponente/assets/jquery/jquery.MultiFile.js'); // Enter-Taste abstellen echo '<script type="text/javascript"> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } document.onkeypress = stopRKey; </script> '; 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); }
/** * Display the view */ public function display($tpl = null) { $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = JComponentHelper::getParams('com_einsatzkomponente'); //$this->gmap_config = EinsatzkomponenteHelper::load_gmap_config(); // GMap-Config aus helper laden // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } EinsatzkomponenteHelper::addSubmenu('kontrollcenter'); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
/** * 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->canSave = $this->get('CanSave'); $this->form = $this->get('Form'); $this->gmap_config = EinsatzkomponenteHelper::load_gmap_config(); // GMap-Config aus helper laden // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
/** * 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(); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_einsatzkomponente'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); $document = JFactory::getDocument(); // Import CSS $document->addStyleSheet('components/com_einsatzkomponente/assets/css/einsatzkomponente.css'); $document->addStyleSheet('components/com_einsatzkomponente/assets/css/responsive.css'); if ($this->params->get('display_home_bootstrap', '0')) { // 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('main_css', '')); //Komponentenversion aus Datenbank lesen $this->version = EinsatzkomponenteHelper::getVersion(); // Monatsnamen auf Deutsch $this->monate = array(1 => "Januar", 2 => "Februar", 3 => "März", 4 => "April", 5 => "Mai", 6 => "Juni", 7 => "Juli", 8 => "August", 9 => "September", 10 => "Oktober", 11 => "November", 12 => "Dezember"); //----Modulposition laden ---- $this->modulepos_1 = '<div class="mod_eiko1">' . EinsatzkomponenteHelper::module('eiko1') . '</div>'; $this->modulepos_2 = '<div class="mod_eiko2">' . EinsatzkomponenteHelper::module('eiko2') . '</div>'; // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
/** * 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(); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_einsatzkomponente'); $this->gmap_config = EinsatzkomponenteHelper::load_gmap_config(); // GMap-Config aus helper laden //print_r ($this->params);break; require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $aktuelles_Datum = getdate(); $selectedYear = $aktuelles_Datum["year"]; //if (!$app->input->get(year)) : //if ($this->params->get('anzeigejahr')) : $selectedYear = $this->params->get('anzeigejahr'); endif; //endif; //if ($app->input->get(year)) : $selectedYear = $app->input->get(year); endif; //if ($app->input->get(year)) : //----Modulposition laden ---- $this->modulepos_1 = '<div class="mod_eiko1">' . EinsatzkomponenteHelper::module('eiko1') . '</div>'; $this->modulepos_2 = '<div class="mod_eiko2">' . EinsatzkomponenteHelper::module('eiko2') . '</div>'; $selectedYear = $app->getUserStateFromRequest("com_einsatzkomponente.selectedYear", 'year', $selectedYear); $selectedEinsatzart = ''; $selectedEinsatzart = $app->getUserStateFromRequest("com_einsatzkomponente.selectedEinsatzart", 'selectedEinsatzart', ''); $selectedOrga = ''; $selectedOrga = $app->getUserStateFromRequest("com_einsatzkomponente.selectedOrga", 'selectedOrga', '0'); //print_r ($selectedEinsatzart); //endif; if ($this->params->get('anzeigejahr')) { $selectedYear = $this->params->get('anzeigejahr'); } $this->selectedYear = $selectedYear; $this->selectedEinsatzart = $selectedEinsatzart; $app->setUserState("com_einsatzkomponente.selectedYear", $selectedYear); $app->setUserState("com_einsatzkomponente.selectedEinsatzart", $selectedEinsatzart); if ($this->params->get('abfragewehr', '1')) { if ($this->params->get('anzeigewehr')) { $selectedOrga = $this->params->get('anzeigewehr'); } $this->selectedOrga = $selectedOrga; $this->selectedOrga = $app->setUserState("com_einsatzkomponente.selectedOrga", $selectedOrga); } else { $selectedOrga = $app->getUserStateFromRequest("com_einsatzkomponente.selectedOrga", 'selectedOrga', '0'); $this->selectedOrga = $selectedOrga; } //Komponentenversion aus Datenbank lesen $this->version = EinsatzkomponenteHelper::getVersion(); //Limitstart und Limit für Pagination if ($this->params->get('display_home_pagination')) { $limitstart = $this->pagination->limitstart; $limitstart = $app->getUserStateFromRequest("com_einsatzkomponente.limitstart", 'limitstart', $limitstart); $limit = $this->pagination->limit; } else { $limitstart = '0'; $limit = '10000'; } //Einsatzdaten aus der Datenbank holen $count = EinsatzkomponenteHelper::count_einsatz_daten_bestimmtes_jahr($selectedYear); $this->pagination->total = count($count); $this->pagination->pagesTotal = ceil(count($count) / $limit); $this->pagination->pagesStop = ceil(count($count) / $limit); $this->reports = EinsatzkomponenteHelper::einsatz_daten_bestimmtes_jahr($selectedYear, $limit, $limitstart); if ($selectedYear == '9999') { $count = EinsatzkomponenteHelper::count_einsatz_daten_bestimmtes_jahr(''); $this->pagination->total = count($count); $this->pagination->pagesTotal = ceil(count($count) / $limit); $this->pagination->pagesStop = ceil(count($count) / $limit); $this->reports = EinsatzkomponenteHelper::einsatz_daten_bestimmtes_jahr('', $limit, $limitstart); } if (!$this->reports) { $count = EinsatzkomponenteHelper::count_einsatz_daten_bestimmtes_jahr($aktuelles_Datum["year"] - 1); $this->pagination->total = count($count); $this->pagination->pagesTotal = ceil(count($count) / $limit); $this->pagination->pagesStop = ceil(count($count) / $limit); $this->reports = EinsatzkomponenteHelper::einsatz_daten_bestimmtes_jahr($aktuelles_Datum["year"] - 1, $limit, $limitstart); // Falls Jahr ohne Einsatz per Menülink aufgerufen wird, dann kein anderes Jahr anzeigen if ($this->params->get('anzeigejahr') == $selectedYear) { $this->reports = ''; } } //print_r ($this->reports);break; $this->years = EinsatzkomponenteHelper::getYear(); // Alle Jahre der Einsatzdaten ermitteln $this->einsatzarten = EinsatzkomponenteHelper::getEinsatzarten(); // Alle Einsatzarten der Einsatzdaten ermitteln $this->organisationen = EinsatzkomponenteHelper::getOrganisationen(); // Alle Einsatzarten der Einsatzdaten ermitteln //print_r ($this->einsatzarten); $layout_detail = $this->params->get('layout_detail', ''); // Detailbericht Layout $this->layout_detail_link = ''; if ($layout_detail) { $this->layout_detail_link = '&layout=' . $layout_detail; } // Detailbericht Layout 'default' ? $document = JFactory::getDocument(); // Import CSS $document->addStyleSheet('components/com_einsatzkomponente/assets/css/einsatzkomponente.css'); $document->addStyleSheet('components/com_einsatzkomponente/assets/css/responsive.css'); if ($this->params->get('display_home_bootstrap', '0')) { // 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('main_css', '')); // Import Jquery JHtml::_('jquery.framework', false); // prüfen ob jquery geladen wurde echo "<script type=\"text/javascript\">\n\t\tif(typeof jQuery == \"function\")\n\t\telse\n\t\t alert(\"jQuery nicht geladen\");\n\t\t</script>"; if ($this->params->get('gmap_action', '0') == '1') { $standort = new StdClass(); $standort->gmap_latitude = '0'; $standort->gmap_longitude = '0'; $orga = EinsatzkomponenteHelper::getOrganisationen(); if ($this->params->get('display_detail_organisationen', '1')) { $orga = EinsatzkomponenteHelper::getOrganisationen(); $organisationen = '['; // Feuerwehr Details ------> $n = 0; for ($i = 0; $i < count($orga); $i++) { $orga_image = $orga[$i]->gmap_icon_orga; if (!$orga_image) { $orga_image = 'images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png'); } if ($i == $n - 1) { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"]'; } else { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"'; $organisationen = $organisationen . '],'; } } $organisationen = substr($organisationen, 0, strlen($organisationen) - 1); $organisationen = $organisationen . ' ];'; } else { $organisationen = '[["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"],["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"] ]'; } $display_map_route = 'false'; $alarmareas1 = $this->gmap_config->gmap_alarmarea; // Einsatzgebiet ----> $alarmareas = explode('|', $alarmareas1); $einsatzgebiet = '[ '; for ($i = 0; $i < count($alarmareas) - 1; $i++) { $areas = explode(',', $alarmareas[$i]); $einsatzgebiet = $einsatzgebiet . 'new google.maps.LatLng(' . $areas[0] . ',' . $areas[1] . '),'; } $areas = explode(',', $alarmareas[0]); $einsatzgebiet = $einsatzgebiet . 'new google.maps.LatLng(' . $areas[0] . ',' . $areas[1] . '),'; $einsatzgebiet = substr($einsatzgebiet, 0, strlen($einsatzgebiet) - 1); $einsatzgebiet = $einsatzgebiet . ' ]'; if (!$this->params->get('display_home_einsatzgebiet', '1')) { $einsatzgebiet = '[[0,0]]'; } $display_detail_popup = 'false'; $marker1_title = ''; // leer $marker1_lat = '1'; // leer $marker1_lng = '1'; // leer $marker1_image = '../../images/com_einsatzkomponente/images/map/icons/' . $this->params->get('detail_pointer1_image', 'circle.png'); $marker2_title = ''; // leer $marker2_lat = ''; // leer $marker2_lng = ''; // leer $marker2_image = ''; // leer $marker2_lat = ''; // leer $marker2_lng = ''; // leer $center_lat = $this->gmap_config->start_lat; $center_lng = $this->gmap_config->start_lang; $gmap_zoom_level = $this->gmap_config->gmap_zoom_level; $gmap_onload = $this->gmap_config->gmap_onload; $zoom_control = 'true'; $document->addScript('https://maps.googleapis.com/maps/api/js?v=3.exp'); $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') { $standort = new StdClass(); $standort->gmap_latitude = '0'; $standort->gmap_longitude = '0'; $orga = EinsatzkomponenteHelper::getOrganisationen(); if ($this->params->get('display_detail_organisationen', '1')) { $orga = EinsatzkomponenteHelper::getOrganisationen(); $organisationen = '['; // Feuerwehr Details ------> $n = 0; for ($i = 0; $i < count($orga); $i++) { $orga_image = $orga[$i]->gmap_icon_orga; if (!$orga_image) { $orga_image = 'images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png'); } if ($i == $n - 1) { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"]'; } else { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"'; $organisationen = $organisationen . '],'; } } $organisationen = substr($organisationen, 0, strlen($organisationen) - 1); $organisationen = $organisationen . ' ];'; } else { $organisationen = '[["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"],["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"] ]'; } $alarmareas1 = $this->gmap_config->gmap_alarmarea; // Einsatzgebiet ----> $alarmareas = explode('|', $alarmareas1); $einsatzgebiet = '[ '; for ($i = 0; $i < count($alarmareas) - 1; $i++) { $areas = explode(',', $alarmareas[$i]); $einsatzgebiet = $einsatzgebiet . '[' . $areas[1] . ',' . $areas[0] . '],'; } $areas = explode(',', $alarmareas[0]); $einsatzgebiet = $einsatzgebiet . '[' . $areas[1] . ',' . $areas[0] . '],'; $einsatzgebiet = substr($einsatzgebiet, 0, strlen($einsatzgebiet) - 1); $einsatzgebiet = $einsatzgebiet . ' ]'; if (!$this->params->get('display_home_einsatzgebiet', '1')) { $einsatzgebiet = '[[0,0]]'; } $display_map_route = 'false'; $display_detail_popup = 'false'; $marker1_title = '1'; // leer $marker1_lat = '1'; // leer $marker1_lng = '1'; // leer $marker1_image = '../../images/com_einsatzkomponente/images/map/icons/' . $this->params->get('detail_pointer1_image', 'circle.png'); $marker2_title = ''; // leer $marker2_lat = ''; // leer $marker2_lng = ''; // leer $marker2_image = ''; // leer $marker2_lat = ''; // leer $marker2_lng = ''; // leer $center_lat = $this->gmap_config->start_lat; $center_lng = $this->gmap_config->start_lang; $gmap_zoom_level = $this->gmap_config->gmap_zoom_level; $gmap_onload = $this->gmap_config->gmap_onload; $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)); } if ($this->params->get('display_home_rss', '1')) { // RSS-Feed in den Dokumenten-Header einfügen $href = 'index.php?option=com_einsatzkomponente&view=einsatzberichte&format=feed&type=rss'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink($href, 'alternate', 'rel', $attribs); } $this->monate = array(1 => "Januar", 2 => "Februar", 3 => "März", 4 => "April", 5 => "Mai", 6 => "Juni", 7 => "Juli", 8 => "August", 9 => "September", 10 => "Oktober", 11 => "November", 12 => "Dezember"); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/einsatzkomponente.php'; $state = $this->get('State'); $canDo = EinsatzkomponenteHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_EINSATZKOMPONENTE_TITLE_EINSATZBILDMANAGER'), 'einsatzbildmanager.png'); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/einsatzbilderbearbeiten'; if (file_exists($formPath)) { if ($canDo->get('core.create')) { JToolBarHelper::addNew('einsatzbilderbearbeiten.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit') && isset($this->items[0])) { JToolBarHelper::editList('einsatzbilderbearbeiten.edit', 'JTOOLBAR_EDIT'); } } if ($canDo->get('core.edit.state')) { if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::custom('einsatzbildmanager.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('einsatzbildmanager.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else { if (isset($this->items[0])) { //If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'einsatzbildmanager.delete', 'JTOOLBAR_DELETE'); } } // if (isset($this->items[0]->state)) { // JToolBarHelper::divider(); // JToolBarHelper::archiveList('einsatzbildmanager.archive','JTOOLBAR_ARCHIVE'); // } if (isset($this->items[0]->checked_out)) { JToolBarHelper::custom('einsatzbildmanager.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } } JToolBarHelper::custom('einsatzbildmanager.thumb', 'edit', 'edit', 'Thumbs erstellen', true); JToolBarHelper::custom('einsatzbildmanager.repid', 'upload', 'upload', 'Flash Uploader', false); //Show trash and delete for components that uses the state field if (isset($this->items[0]->state)) { if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'einsatzbildmanager.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } else { if ($canDo->get('core.edit.state')) { //JToolBarHelper::trash('einsatzbildmanager.trash','JTOOLBAR_TRASH'); JToolBarHelper::deleteList('', 'einsatzbildmanager.delete', 'JTOOLBAR_DELETE'); JToolBarHelper::divider(); } } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_einsatzkomponente'); } //Set sidebar action - New in 3.0 JHtmlSidebar::setAction('index.php?option=com_einsatzkomponente&view=einsatzbildmanager'); //Filter for the field created_by $this->extra_sidebar .= '<small><label for="filter_created_by">Created by</label></small>'; $this->extra_sidebar .= JHtmlList::users('filter_created_by', $this->state->get('filter.created_by'), 1, 'onchange="this.form.submit();"'); $options = ''; $options[] = JHtml::_('select.option', '1', 'JPUBLISHED'); $options[] = JHtml::_('select.option', '0', 'JUNPUBLISHED'); $options[] = JHtml::_('select.option', '*', 'JALL'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.state'), true)); $this->extra_sidebar = ''; }
/** * Display the view */ public function display($tpl = null) { $this->next_id[0] = new stdClass(); require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $app = JFactory::getApplication(); $selectedOrga = $app->getUserStateFromRequest("com_einsatzkomponente.selectedOrga", 'selectedOrga', 'alle Organisationen'); //echo $selectedOrga; $user = JFactory::getUser(); //$id = $app->input->get(id); $this->state = $this->get('State'); $this->item = $this->get('Data'); $this->images = EinsatzkomponenteHelper::getEinsatzbilder($this->item->id); $this->prev_id = EinsatzkomponenteHelper::getPrev_id($this->item->date1, $selectedOrga); $this->next_id = EinsatzkomponenteHelper::getNext_id($this->item->date1, $selectedOrga); $this->params = $app->getParams('com_einsatzkomponente'); $this->form = $this->get('Form'); $this->gmap_config = EinsatzkomponenteHelper::load_gmap_config(); // GMap-Config aus helper laden $this->einsatzlogo = EinsatzkomponenteHelper::getEinsatzlogo($this->item->data1); $this->tickerKat = EinsatzkomponenteHelper::getTickerKat($this->item->tickerkat); $this->alarmierungsart = EinsatzkomponenteHelper::getAlarmierungsart($this->item->alerting); // Get active menu $app = JFactory::getApplication(); $menus = $app->getMenu(); $this->menu = $menus->getActive(); //print_r ($this->menu); //echo $this->menu->anzeigejahr; // Import CSS + JS $document = JFactory::getDocument(); $document->addStyleSheet('components/com_einsatzkomponente/assets/css/einsatzkomponente.css'); $document->addStyleSheet('components/com_einsatzkomponente/assets/css/responsive.css'); $document->addScript('components/com_einsatzkomponente/assets/highslide/highslide-with-gallery.js'); $document->addScript('components/com_einsatzkomponente/assets/highslide/highslide.config.js'); $document->addStyleSheet('components/com_einsatzkomponente/assets/highslide/highslide.css'); //print_r ($this->menu); $this->social = EinsatzkomponenteHelper::getSocial($this->params, $this->item->id, $this->item->summary); // $sef = ''; // $sef_rewrite = ''; // $conf = JFactory::getConfig(); // @$sef = $conf[sef]; // @$sef_rewrite = $conf[sef_rewrite]; //if ($sef_rewrite) : @($this->navbar = EinsatzkomponenteHelper::getNavbar($this->params, $this->prev_id['0']->id, $this->next_id['0']->id, $this->item->id, $this->menu->link . '&Itemid=' . $this->menu->id)); //endif; //if (!$sef_rewrite) : //@$this->navbar = EinsatzkomponenteHelper::getNavbar($this->params,$this->prev_id['0']->id,$this->next_id['0']->id,$this->item->id,$this->menu->link.'&Itemid='.$this->params->get('homelink','').''); //endif; if ($this->params->get('gmap_action', '0') == '1') { if ($this->params->get('display_detail_organisationen', '1')) { $orga = EinsatzkomponenteHelper::getOrganisationen(); $organisationen = '['; // Feuerwehr Details ------> $n = 0; for ($i = 0; $i < count($orga); $i++) { $orga_image = $orga[$i]->gmap_icon_orga; if (!$orga_image) { $orga_image = 'images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png'); } if ($i == $n - 1) { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"]'; } else { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"'; $organisationen = $organisationen . '],'; } } $organisationen = substr($organisationen, 0, strlen($organisationen) - 1); $organisationen = $organisationen . ' ];'; } else { $organisationen = '[["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"],["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"] ]'; } $standort = EinsatzkomponenteHelper::getStandort_orga($this->item->auswahl_orga); $display_map_route = $this->params->get('display_map_route', 'true'); // echo $standort->gmap_latitude; // echo $standort->gmap_longitude; // echo $standort->name; if ($this->params->get('display_detail_einsatzgebiet', '1')) { $alarmareas1 = $this->gmap_config->gmap_alarmarea; // Einsatzgebiet ----> $alarmareas = explode('|', $alarmareas1); $einsatzgebiet = '[ '; for ($i = 0; $i < count($alarmareas) - 1; $i++) { $areas = explode(',', $alarmareas[$i]); $einsatzgebiet = $einsatzgebiet . 'new google.maps.LatLng(' . $areas[0] . ',' . $areas[1] . '),'; } $areas = explode(',', $alarmareas[0]); $einsatzgebiet = $einsatzgebiet . 'new google.maps.LatLng(' . $areas[0] . ',' . $areas[1] . '),'; $einsatzgebiet = substr($einsatzgebiet, 0, strlen($einsatzgebiet) - 1); $einsatzgebiet = $einsatzgebiet . ' ]'; } else { $einsatzgebiet = '[[0,0]]'; } $display_detail_popup = $this->params->get('display_detail_popup', 'false'); $marker1_title = ''; $marker1_lat = ''; $marker1_lng = ''; $marker1_image = ''; $marker2_title = ''; $marker2_lat = ''; $marker2_lng = ''; $marker2_image = ''; if ($this->params->get('display_detail_einsatz_marker', '1') && $this->item->gmap == '1') { $marker1_title = $this->item->summary; $marker1_lat = $this->item->gmap_report_latitude; $marker1_lng = $this->item->gmap_report_longitude; $marker1_image = $this->einsatzlogo->icon; //$marker1_image = 'images/com_einsatzkomponente/images/map/icons/'.$this->params->get('detail_pointer1_image','circle.png'); } else { $marker1_lat = '1'; $marker1_lng = '1'; } $center_lat = $this->item->gmap_report_latitude; $center_lng = $this->item->gmap_report_longitude; $gmap_zoom_level = $this->params->get('detail_gmap_zoom_level', '12'); $gmap_onload = $this->params->get('detail_gmap_onload', 'HYBRID'); $zoom_control = $this->params->get('detail_zoom_control', 'false'); $document->addScript('https://maps.googleapis.com/maps/api/js?v=3.exp'); $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') { if ($this->params->get('display_detail_organisationen', '1')) { $orga = EinsatzkomponenteHelper::getOrganisationen(); $organisationen = '['; // Feuerwehr Details ------> $n = 0; for ($i = 0; $i < count($orga); $i++) { $orga_image = $orga[$i]->gmap_icon_orga; if (!$orga_image) { $orga_image = 'images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png'); } if ($i == $n - 1) { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"]'; } else { $organisationen = $organisationen . '["' . $orga[$i]->name . '",' . $orga[$i]->gmap_latitude . ',' . $orga[$i]->gmap_longitude . ',' . $i . ',"' . $orga_image . '"'; $organisationen = $organisationen . '],'; } } $organisationen = substr($organisationen, 0, strlen($organisationen) - 1); $organisationen = $organisationen . ' ];'; } else { $organisationen = '[["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"],["",1,1,0,"images/com_einsatzkomponente/images/map/icons/' . $this->params->get('einsatzkarte_orga_image', 'haus_rot.png') . '"] ]'; } if ($this->params->get('display_detail_einsatzgebiet', '1')) { $alarmareas1 = $this->gmap_config->gmap_alarmarea; // Einsatzgebiet ----> $alarmareas = explode('|', $alarmareas1); $einsatzgebiet = '[ '; for ($i = 0; $i < count($alarmareas) - 1; $i++) { $areas = explode(',', $alarmareas[$i]); $einsatzgebiet = $einsatzgebiet . '[' . $areas[1] . ',' . $areas[0] . '],'; } $areas = explode(',', $alarmareas[0]); $einsatzgebiet = $einsatzgebiet . '[' . $areas[1] . ',' . $areas[0] . '],'; $einsatzgebiet = substr($einsatzgebiet, 0, strlen($einsatzgebiet) - 1); $einsatzgebiet = $einsatzgebiet . ' ]'; } else { $einsatzgebiet = '[[0,0]]'; } $standort = EinsatzkomponenteHelper::getStandort_orga($this->item->auswahl_orga); $display_map_route = $this->params->get('$display_map_route', 'true'); $display_detail_popup = $this->params->get('display_detail_popup', 'false'); $marker1_title = ''; $marker1_lat = ''; $marker1_lng = ''; $marker1_image = ''; $marker2_title = ''; $marker2_lat = ''; $marker2_lng = ''; $marker2_image = ''; if ($this->params->get('display_detail_einsatz_marker', '1')) { $marker1_title = $this->item->summary; $marker1_lat = $this->item->gmap_report_latitude; $marker1_lng = $this->item->gmap_report_longitude; $marker1_image = $this->einsatzlogo->icon; //$marker1_image = 'images/com_einsatzkomponente/images/map/icons/'.$this->params->get('detail_pointer1_image','circle.png'); } else { $marker1_title = $this->item->summary; $marker1_lat = '1'; $marker1_lng = '1'; $marker1_image = $this->einsatzlogo->icon; } $center_lat = $this->item->gmap_report_latitude; $center_lng = $this->item->gmap_report_longitude; $gmap_zoom_level = $this->params->get('detail_gmap_zoom_level', '12'); $gmap_onload = $this->params->get('detail_gmap_onload', 'HYBRID'); $zoom_control = $this->params->get('detail_zoom_control', 'false'); $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)); } if ($this->params->get('display_detail_bootstrap', '0')) { // 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('detail_css', '')); ?> <script type="text/javascript"> // override Highslide settings here // instead of editing the highslide.js file hs.graphicsDir = '<?php echo JURI::Root(); ?> components/com_einsatzkomponente/assets/highslide/graphics/'; </script> <?php // Facebook OpenGraph if ($this->item->summary) { $summary = strip_tags($this->item->summary); $opengraph = '<meta property="og:title" content="#Einsatzinfo: ' . $summary . '"/>'; } $opengraph .= '<meta property="og:type" content="article"/>'; $opengraph .= '<meta property="og:url" content="' . JURI::current() . '"/>'; $opengraph .= '<meta property="og:site_name" content="#Einsatzinfo: ' . $this->einsatzlogo->title . '"/>'; if ($this->item->summary) { $summary = strip_tags($this->item->summary); $opengraph .= '<meta property="og:description" content="Datum: ' . date('d.m.Y', strtotime($this->item->date1)) . ' --- Ort: #' . $this->item->address . ' --- #' . $summary . '" />'; } if ($this->item->desc) { $desc = strip_tags($this->item->desc); $opengraph .= '<meta property="og:description" content="Datum: ' . date('d.m.Y', strtotime($this->item->date1)) . ' --- Ort: #' . $this->item->address . ' --- #' . $desc . '" />'; } if ($this->einsatzlogo->list_icon) { $fileName_image = str_replace(' ', '%20', $this->einsatzlogo->list_icon); $opengraph .= '<meta property="og:image" content="' . JURI::base() . $fileName_image . '"/>'; } //$opengraph .= '<meta property="article:publisher" content="https://www.einsatzkomponente.de" />'; if ($this->item->image) { $fileName_image = str_replace(' ', '%20', $this->item->image); $opengraph .= '<meta property="og:image" content="' . JURI::base() . $fileName_image . '"/>'; } if ($this->images) { for ($i = 0; $i < count($this->images); ++$i) { $fileName_image = str_replace(' ', '%20', $this->images[$i]->image); $opengraph .= '<meta property="og:image" content="' . JURI::base() . $fileName_image . '"/>'; } } $document->addCustomTag($opengraph); // Wenn Titlebild in Bildergalerie enthalten, dann dieses aus der Bildergalerie löschen // if ($this->images and $this->item->image) : // $i='0'; // while ($i < count($this->images)){ // if ($this->images[$i]->image == $this->item->image) : // unset($this->images[$i]);$this->images[$i] = ''; // endif; // $i++; // } // endif; // 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'); } // Increment the hit counter of the event. $model = $this->getModel(); $model->hit(); $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.)'; } ?>
/** * 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); }
protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/einsatzkomponente.php'; $state = $this->get('State'); $canDo = EinsatzkomponenteHelper::getActions($state->get('filter.category_id')); $user = JFactory::getUser(); JRequest::setVar('hidemainmenu', true); $text = JText::_('Flash-Uploader für Einsatzbilder'); JToolBarHelper::title(JText::_('Flash-Uploader für Einsatzbilder'), 'upload'); JToolBarHelper::preferences('com_einsatzkomponente'); }
* @author Ralf Meyer <*****@*****.**> - http://einsatzkomponente.de */ // no direct access defined('_JEXEC') or die; JHtml::_('behavior.keepalive'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); JHtml::_('formbehavior.chosen', 'select'); //Load admin language file $lang = JFactory::getLanguage(); $lang->load('com_einsatzkomponente', JPATH_ADMINISTRATOR); require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $app = JFactory::getApplication(); $params = $app->getParams('com_einsatzkomponente'); $gmap_config = EinsatzkomponenteHelper::load_gmap_config(); // GMap-Config aus helper laden // Daten aus der Bilder-Galerie holen if (!$this->item->id == 0) { if ($params->get('eiko')) { $db = JFactory::getDBO(); $query = 'SELECT id, thumb, comment FROM `#__eiko_images` WHERE `report_id`="' . $this->item->id . '" AND `state`="1" ORDER BY `ordering` ASC'; $db->setQuery($query); $rImages = $db->loadObjectList(); } } // Import CSS $document = JFactory::getDocument(); $document->addStyleSheet('components/com_einsatzkomponente/assets/css/edit.css'); $gmap_latitude = $this->item->gmap_report_latitude; $gmap_longitude = $this->item->gmap_report_longitude;
/** * 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(); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->params = $app->getParams('com_einsatzkomponente'); $this->gmap_config = EinsatzkomponenteHelper::load_gmap_config(); // GMap-Config aus helper laden //print_r ($this->params);break; require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $aktuelles_Datum = getdate(); //Komponentenversion aus Datenbank lesen $this->version = EinsatzkomponenteHelper::getVersion(); //Limitstart und Limit für Pagination // if ($this->params->get('display_home_pagination')) : // $limitstart = $this->pagination->limitstart; // $limitstart = $app->getUserStateFromRequest( "com_einsatzkomponente.limitstart", 'limitstart', $limitstart ); // $limit = $this->pagination->limit; // else: // $limitstart = '0'; // $limit = '10000'; // endif; //Einsatzdaten aus der Datenbank holen $count = EinsatzkomponenteHelper::count_einsatz_daten_bestimmtes_jahr(''); // $this->pagination->total = count($count); // $this->pagination->pagesTotal = ceil(count($count)/$limit); // $this->pagination->pagesStop = ceil(count($count)/$limit); $this->reports = EinsatzkomponenteHelper::einsatz_daten_bestimmtes_jahr('', '99999', '0'); $this->years = EinsatzkomponenteHelper::getYear(); // Alle Jahre der Einsatzdaten ermitteln $this->einsatzarten = EinsatzkomponenteHelper::getEinsatzarten(); // Alle Einsatzarten der Einsatzdaten ermitteln $this->organisationen = EinsatzkomponenteHelper::getOrganisationen(); // Alle Einsatzarten der Einsatzdaten ermitteln $layout_detail = $this->params->get('layout_detail', ''); // Detailbericht Layout $this->layout_detail_link = ''; if ($layout_detail) { $this->layout_detail_link = '&layout=' . $layout_detail; } // Detailbericht Layout 'default' ? $document = JFactory::getDocument(); // Import CSS $document->addStyleSheet('components/com_einsatzkomponente/assets/css/einsatzkomponente.css'); $document->addStyleSheet('components/com_einsatzkomponente/assets/css/responsive.css'); if ($this->params->get('display_einsatzkarte_bootstrap', '0')) { $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('gmap_css', '')); //$document->addStyleSheet('components/com_einsatzkomponente/assets/jquery/JQRangeSlider/iThing.css'); //$document->addScript('components/com_einsatzkomponente/assets/jquery/JQRangeSlider/jQDateRangeSlider-withRuler-min.js'); if ($this->params->get('display_home_rss', '1')) { // RSS-Feed in den Dokumenten-Header einfügen $href = 'index.php?option=com_einsatzkomponente&view=einsatzberichte&format=feed&type=rss'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink($href, 'alternate', 'rel', $attribs); } $this->monate = array(1 => "Januar", 2 => "Februar", 3 => "März", 4 => "April", 5 => "Mai", 6 => "Juni", 7 => "Juli", 8 => "August", 9 => "September", 10 => "Oktober", 11 => "November", 12 => "Dezember"); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } $this->_prepareDocument(); parent::display($tpl); }
echo $value->name; $vehicles_images .= ' <img style="padding-right:3px;margin-right:3px;" class="eiko_img-rounded eiko_image_fahrzeugaufgebot" src="' . JURI::Root() . $value->image . '" alt="' . $value->name . '" title="' . $value->name . ' ' . $value->detail2 . '"/>'; } echo '</li>'; } } } echo '</ul></div>'; } } // sonstige Fahrzeuge anzeigen lassen if ($this->item->vehicles) { if ($sonstige = EinsatzkomponenteHelper::getFahrzeuge_mission($array_vehicle, '', 'sonstige Kräfte')) { echo $sonstige; } if ($sonstige = EinsatzkomponenteHelper::getFahrzeuge_mission_image($array_vehicle, '')) { $vehicles_images .= $sonstige; } } ?> <?php } ?> </td></tr></table> </td> <td class="eiko_td4_2"></td>
public function article($cid) { // Check for request forgeries JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); // Get items to remove from the request. $cid = JFactory::getApplication()->input->get('cid', array(), 'array'); if (!is_array($cid) || count($cid) < 1) { JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror'); } else { //$model = $this->getModel(); $params = JComponentHelper::getParams('com_einsatzkomponente'); // Make sure the item ids are integers jimport('joomla.utilities.arrayhelper'); JArrayHelper::toInteger($cid); foreach ($cid as $key => $val) { $query = 'SELECT * FROM `#__eiko_einsatzberichte` WHERE `id` = "' . $val . '" and state ="1" LIMIT 1'; $db = JFactory::getDBO(); $db->setQuery($query); $result = $db->loadObjectList(); $kat = EinsatzkomponenteHelper::getTickerKat($result[0]->tickerkat); $db = JFactory::getDbo(); $db->setQuery('SELECT MAX(asset_id) FROM #__content'); $max = $db->loadResult(); $asset_id = $max + 1; $link = JRoute::_(JURI::root() . 'index.php?option=com_einsatzkomponente&view=einsatzbericht&id=' . $result[0]->id); $image_intro = str_replace('/', '\\/', $result[0]->image); $image_intro = $db->escape($image_intro); if (str_replace('\\/com_einsatzkomponente\\/einsatzbilder\\/thumbs', '', $image_intro)) { $image_fulltext = str_replace('\\/thumbs', '', $image_intro); } $user = JFactory::getUser(); $db = JFactory::getDbo(); $query = $db->getQuery(true); // !important, true for every new query $query->insert('#__content'); // #__table_name = databse prefix + table name $query->set('`id`=NULL'); $query->set('`asset_id`="' . $asset_id . '"'); $query->set('`title`="' . $result[0]->summary . '"'); $alias = strtolower($result[0]->summary); $alias = str_replace(" ", "-", $alias) . '_' . date("Y-m-d", strtotime($result[0]->date1)); $query->set('`alias`="' . $alias . '"'); $intro = $result[0]->desc; $intro = preg_replace("#(?<=.{" . $params->get('article_max_intro', '400') . "}?\\b)(.*)#is", " ...", $intro, 1); $query->set('`introtext`="' . $db->escape($intro) . '"'); if ($params->get('article_orgas', '1')) { $data = array(); foreach (explode(',', $result[0]->auswahl_orga) as $value) { $db = JFactory::getDbo(); $sql = $db->getQuery(true); $sql->select('name')->from('`#__eiko_organisationen`')->where('id = "' . $value . '"'); $db->setQuery($sql); $results = $db->loadObjectList(); if (count($results)) { $data[] = '' . $results[0]->name . ''; } } $auswahl_orga = implode(',', $data); $orgas = str_replace(",", " +++ ", $auswahl_orga); $orgas = '<br/><div class=\\"eiko_article_orga\\">Eingesetzte Kräfte: ' . $orgas . '</div>'; $query->set('`fulltext`="' . $db->escape($result[0]->desc) . $orgas . '"'); } else { $query->set('`fulltext`="' . $db->escape($result[0]->desc) . '"'); } $query->set('`state`="1"'); $query->set('`catid`="' . $params->get('article_category', '0') . '"'); $query->set('`created`="' . date("Y-m-d H:i:s", strtotime($result[0]->date1)) . '"'); $query->set('`created_by`="' . $user->id . '"'); $query->set('`created_by_alias`=""'); $query->set('`modified`=""'); $query->set('`modified_by`="' . $user->id . '"'); $query->set('`checked_out`="0"'); $query->set('`checked_out_time`="0000-00-00 00:00:00.000000"'); $query->set('`publish_up`="' . date("Y-m-d H:i:s", strtotime($result[0]->date1)) . '"'); $query->set('`publish_down`="0000-00-00 00:00:00.000000"'); $query->set('`images`="{\\"image_intro\\":\\"' . $image_intro . '\\",\\"float_intro\\":\\"\\",\\"image_intro_alt\\":\\"\\",\\"image_intro_caption\\":\\"\\",\\"image_fulltext\\":\\"' . $image_fulltext . '\\",\\"float_fulltext\\":\\"\\",\\"image_fulltext_alt\\":\\"\\",\\"image_fulltext_caption\\":\\"\\"}"'); $query->set('`urls`="{\\"urla\\":\\"' . $link . '\\",\\"urlatext\\":\\"Weitere Informationen über diesen Einsatz im Detailbericht\\",\\"targeta\\":\\"\\",\\"urlb\\":\\"' . $result[0]->presse . '\\",\\"urlbtext\\":\\"' . $result[0]->presse_label . '\\",\\"targetb\\":\\"\\",\\"urlc\\":\\"' . $result[0]->presse2 . '\\",\\"urlctext\\":\\"' . $result[0]->presse2_label . '\\",\\"targetc\\":\\"\\"}"'); $query->set('`attribs`="{\\"show_title\\":"",\\"link_titles\\":"",\\"show_tags\\":"",\\"show_intro\\":"",\\"info_block_position\\":"",\\"show_category\\":"",\\"link_category\\":"",\\"show_parent_category\\":"",\\"link_parent_category\\":"",\\"show_author\\":"",\\"link_author\\":"",\\"show_create_date\\":"",\\"show_modify_date\\":"",\\"show_publish_date\\":"",\\"show_item_navigation\\":"",\\"show_icons\\":"",\\"show_print_icon\\":"",\\"show_email_icon\\":"",\\"show_vote\\":"",\\"show_hits\\":"",\\"show_noauth\\":"",\\"urls_position\\":"",\\"alternative_readmore\\":"",\\"article_layout\\":"",\\"show_publishing_options\\":"",\\"show_article_options\\":"",\\"show_urls_images_backend\\":"",\\"show_urls_images_frontend\\":""}"'); $query->set('`version`="1"'); $query->set('`ordering`="0"'); $query->set('`metakey`="' . $auswahl_orga . ',' . $params->get('article_meta_key', 'feuerwehr,einsatzbericht,unfall,feuer,hilfeleistung,polizei,thw,rettungsdienst,hilfsorganisation') . ',einsatzkomponente"'); $query->set('`metadesc`="' . $params->get('article_meta_desc', 'Einsatzbericht') . '"'); $query->set('`access`="1"'); $query->set('`hits`="0"'); $query->set('`metadata`="{\\"robots\\":\\"\\",\\"author\\":\\"' . $user->username . '\\",\\"rights\\":\\"\\",\\"xreference\\":\\"\\"}"'); $query->set('`featured`="1"'); $query->set('`language`="*"'); $query->set('`xreference`=""'); /* or something like this: $query->columns('`1`,`2`,`3`'); $query->values('"one","two","three"'); */ $db->setQuery($query); try { // Execute the query in Joomla 3.0. $db->execute(); } catch (Exception $e) { //print the errors print_r($e) . ''; } $content_id = $db->insertId(); // Joomla-Artikel Id in Einsatzbericht eintragen $query = "UPDATE `#__eiko_einsatzberichte` SET `article_id` = '" . $content_id . "' WHERE `id` = '" . $result[0]->id . "'"; $db = JFactory::getDBO(); $db->setQuery($query); $db->query(); if ($params->get('article_frontpage', '1')) { // Artikel als Haupteintrag-Eintrag markieren $frontpage_query = "INSERT INTO `#__content_frontpage` SET `content_id`='" . $content_id . "'"; $db = JFactory::getDBO(); $db->setQuery($frontpage_query); $db->query(); } } $msg = count($cid) . ' Artikel erstellt'; } return $msg; }
/** * Display the view */ public function display($tpl = null) { $app = JFactory::getApplication(); $this->params = $app->getParams('com_einsatzkomponente'); $this->pagination = $this->get('Pagination'); require_once JPATH_SITE . '/administrator/components/com_einsatzkomponente/helpers/einsatzkomponente.php'; // Helper-class laden $layout_detail = $this->params->get('layout_detail', ''); // Detailbericht Layout $this->layout_detail_link = ''; if ($layout_detail) { $this->layout_detail_link = '&layout=' . $layout_detail; } // Detailbericht Layout 'default' ? $rows = EinsatzkomponenteHelper::letze_x_einsatzdaten($this->params->get('rss_items', '10')); $years = EinsatzkomponenteHelper::getYear(); foreach ($years as $year) { $yeararray[$year->id] = EinsatzkomponenteHelper::einsatz_daten_bestimmtes_jahr($year->id, 9999, 0); $eicount[$year->id] = count($yeararray[$year->id]); } $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); $this->document->link = JRoute::_('index.php?option=com_einsatzkomponente&view=einsatzberichte&Itemid=' . $menu->id); foreach ($rows as $row) { $data = array(); foreach (explode(',', $row->auswahl_orga) as $value) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('name')->from('`#__eiko_organisationen`')->where('id = "' . $value . '"'); $db->setQuery($query); $results = $db->loadObjectList(); if (count($results)) { $data[] = '' . $results[0]->name . ''; } } $auswahl_orga = implode(',', $data); $auswahl_orga = str_replace(",", " +++ ", $auswahl_orga); $title = html_entity_decode($title); $summary = $this->escape($row->summary); $title = html_entity_decode($summary); $desc = strip_tags($row->desc); $desc = strlen($desc) > $this->params->get('rss_chars', '1000') ? substr($desc, 0, strrpos(substr($desc, 0, $this->params->get('rss_chars', '1000') + 1), ' ')) . ' ...' : $desc; // url link to article // & used instead of & as this is converted by feed creator $link = JRoute::_('index.php?option=com_einsatzkomponente&view=einsatzbericht' . $this->layout_detail_link . '&id=' . $row->id); // strip html from feed item description text /*$description = ($params->get('feed_summary', 0) ? $row->introtext.$row->fulltext : $row->introtext); $author = $row->created_by_alias ? $row->created_by_alias : $row->author; */ // load individual item creator class $item = new JFeedItem(); $itemyear = date("Y", strtotime($row->date1)); $rssnr = $eicount[$itemyear]; $item->title = "+++ Einsatz Nr: " . $rssnr . " - " . $title . " +++"; $item->link = $link; $item->description .= '<table>'; if ($this->params->get('show_rss_image', '1')) { if ($row->foto) { $item->description .= '<tr><td><img src="' . JURI::base() . $row->foto . '" width="' . $this->params->get('rss_image_width', '150px') . '" height="' . $this->params->get('rss_image_height', '') . '" /></td></tr>'; } } if ($row->desc) { $item->description .= '<tr><td>' . $desc . '</td></tr>'; } if ($row->auswahl_orga) { $item->description .= '<tr><td><b>Einsatzkräfte</b>: +++ ' . $auswahl_orga . '</td></tr>'; } $item->date = date('r', strtotime($row->date1)); $item->description .= '</table>'; /*$item->category = $row->category; $item->author = $author; if ($feedEmail == 'site') { $item->authorEmail = $siteEmail; } else { $item->authorEmail = $row->author_email; } */ // loads item info into rss array $this->document->addItem($item); $eicount[$itemyear]--; } // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); } parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { require_once JPATH_COMPONENT . '/helpers/einsatzkomponente.php'; $state = $this->get('State'); $canDo = EinsatzkomponenteHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_EINSATZKOMPONENTE_TITLE_EINSATZBERICHTE'), 'einsatzberichte.png'); //Check if the form exists before showing the add/edit buttons $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/einsatzbericht'; if (file_exists($formPath)) { if ($canDo->get('core.create')) { JToolBarHelper::addNew('einsatzbericht.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit') && isset($this->items[0])) { JToolBarHelper::editList('einsatzbericht.edit', 'JTOOLBAR_EDIT'); } } if ($canDo->get('core.edit.state')) { if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::custom('einsatzberichte.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::custom('einsatzberichte.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); } else { if (isset($this->items[0])) { //If this component does not use state then show a direct delete button as we can not trash JToolBarHelper::deleteList('', 'einsatzberichte.delete', 'JTOOLBAR_DELETE'); } } if (isset($this->items[0]->checked_out)) { JToolBarHelper::custom('einsatzberichte.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); } } //Show trash and delete for components that uses the state field if (isset($this->items[0]->state)) { if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'einsatzberichte.delete', 'JTOOLBAR_EMPTY_TRASH'); JToolBarHelper::divider(); } else { if ($canDo->get('core.edit.state')) { //JToolBarHelper::trash('einsatzberichte.trash','JTOOLBAR_TRASH'); JToolBarHelper::deleteList('', 'einsatzberichte.delete', 'JTOOLBAR_DELETE'); JToolBarHelper::divider(); } } } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_einsatzkomponente'); if ($this->params->get('send_mail_backend', '0')) { JToolBarHelper::custom('einsatzberichte.sendMail', 'edit', 'edit', 'Als Mail versenden', true); } } $version = new JVersion(); if ($version->isCompatible('3.0')) { if ($canDo->get('core.create')) { JToolBarHelper::custom('einsatzberichte.article', 'edit', 'edit', 'Als Artikel erstellen', true); } JToolBarHelper::custom('einsatzberichte.pdf', 'upload', 'upload', 'Als PDF exportieren', true); } if ($canDo->get('core.create')) { if (isset($this->items[0]->state)) { JToolBarHelper::divider(); JToolBarHelper::archiveList('einsatzberichte.archive', 'Als Folgeeinsatz markieren'); } } //Set sidebar action - New in 3.0 JHtmlSidebar::setAction('index.php?option=com_einsatzkomponente&view=einsatzberichte'); $this->extra_sidebar = ''; //Filter for the field auswahl_orga; jimport('joomla.form.form'); $options = array(); JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); $form = JForm::getInstance('com_einsatzkomponente.einsatzbericht', 'einsatzbericht'); $field = $form->getField('auswahl_orga'); $query = $form->getFieldAttribute('filter_auswahl_orga', 'query'); $translate = $form->getFieldAttribute('filter_auswahl_orga', 'translate'); $key = $form->getFieldAttribute('filter_auswahl_orga', 'key_field'); $value = $form->getFieldAttribute('filter_auswahl_orga', 'value_field'); // Get the database object. $db = JFactory::getDBO(); // Set the query and get the result list. $db->setQuery($query); $items = $db->loadObjectlist(); // Build the field options. if (!empty($items)) { foreach ($items as $item) { if ($translate == true) { $options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value})); } else { $options[] = JHtml::_('select.option', $item->{$key}, $item->{$value}); } } } JHtmlSidebar::addFilter('$auswahl_orga', 'filter_auswahl_orga', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.auswahl_orga')), true); //Filter for the field tickerkat; jimport('joomla.form.form'); $options = array(); JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); $form = JForm::getInstance('com_einsatzkomponente.einsatzbericht', 'einsatzbericht'); $field = $form->getField('tickerkat'); $query = $form->getFieldAttribute('filter_tickerkat', 'query'); $translate = $form->getFieldAttribute('filter_tickerkat', 'translate'); $key = $form->getFieldAttribute('filter_tickerkat', 'key_field'); $value = $form->getFieldAttribute('filter_tickerkat', 'value_field'); // Get the database object. $db = JFactory::getDBO(); // Set the query and get the result list. $db->setQuery($query); $items = $db->loadObjectlist(); // Build the field options. if (!empty($items)) { foreach ($items as $item) { if ($translate == true) { $options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value})); } else { $options[] = JHtml::_('select.option', $item->{$key}, $item->{$value}); } } } JHtmlSidebar::addFilter('$tickerkat', 'filter_tickerkat', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.tickerkat')), true); //Filter for the field data1; jimport('joomla.form.form'); $options = array(); JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); $form = JForm::getInstance('com_einsatzkomponente.einsatzbericht', 'einsatzbericht'); $field = $form->getField('data1'); $query = $form->getFieldAttribute('filter_data1', 'query'); $translate = $form->getFieldAttribute('filter_data1', 'translate'); $key = $form->getFieldAttribute('filter_data1', 'key_field'); $value = $form->getFieldAttribute('filter_data1', 'value_field'); // Get the database object. $db = JFactory::getDBO(); // Set the query and get the result list. $db->setQuery($query); $items = $db->loadObjectlist(); // Build the field options. if (!empty($items)) { foreach ($items as $item) { if ($translate == true) { $options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value})); } else { $options[] = JHtml::_('select.option', $item->{$key}, $item->{$value}); } } } JHtmlSidebar::addFilter('$data1', 'filter_data1', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.data1')), true); //Filter for the field alerting; jimport('joomla.form.form'); $options = array(); JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); $form = JForm::getInstance('com_einsatzkomponente.einsatzbericht', 'einsatzbericht'); $field = $form->getField('alerting'); $query = $form->getFieldAttribute('filter_alerting', 'query'); $translate = $form->getFieldAttribute('filter_alerting', 'translate'); $key = $form->getFieldAttribute('filter_alerting', 'key_field'); $value = $form->getFieldAttribute('filter_alerting', 'value_field'); // Get the database object. $db = JFactory::getDBO(); // Set the query and get the result list. $db->setQuery($query); $items = $db->loadObjectlist(); // Build the field options. if (!empty($items)) { foreach ($items as $item) { if ($translate == true) { $options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value})); } else { $options[] = JHtml::_('select.option', $item->{$key}, $item->{$value}); } } } JHtmlSidebar::addFilter('$alerting', 'filter_alerting', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.alerting')), true); //Filter for the field date1 $this->extra_sidebar .= '<div class="div_side_filter">'; $this->extra_sidebar .= '<small><label for="filter_from_date1">ab Datum</label></small>'; $this->extra_sidebar .= JHtml::_('calendar', $this->state->get('filter.date1.from'), 'filter_from_date1', 'filter_from_date1', '%Y-%m-%d', array('style' => 'width:142px;', 'onchange' => 'this.form.submit();')); $this->extra_sidebar .= '<small><label for="filter_to_date1">bis Datum</label></small>'; $this->extra_sidebar .= JHtml::_('calendar', $this->state->get('filter.date1.to'), 'filter_to_date1', 'filter_to_date1', '%Y-%m-%d', array('style' => 'width:142px;', 'onchange' => 'this.form.submit();')); $this->extra_sidebar .= '<hr class="hr-condensed">'; $this->extra_sidebar .= '</div>'; $options = ''; $options[] = JHtml::_('select.option', '1', 'JPUBLISHED'); $options[] = JHtml::_('select.option', '0', 'JUNPUBLISHED'); $options[] = JHtml::_('select.option', '2', 'Folgeeinsatz'); $options[] = JHtml::_('select.option', '*', 'JALL'); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.state'), true)); //Filter for the field created_by $this->extra_sidebar .= '<div class="div_side_filter">'; $this->extra_sidebar .= '<small><label for="filter_created_by">Erstellt von</label></small>'; $this->extra_sidebar .= JHtmlList::users('filter_created_by', $this->state->get('filter.created_by'), 1, 'onchange="this.form.submit();"'); $this->extra_sidebar .= '</div>'; }