setQuery("SELECT * FROM #__matukio_number WHERE year = '$newyear'"); $temp = $database->loadObjectList(); if (count($temp) == 0) { //$neu = new mossemnumber($database); $neu = JTable::getInstance("Number", "Table"); if (!$neu->bind(JRequest::get( 'post' ))) { return JError::raiseError(500, $database->stderr()); } $neu->year = $newyear; $neu->number = "1"; if (!$neu->store()) { return JError::raiseError(500, $database->stderr()); } $neu->checkin(); } else { $database->setQuery("UPDATE #__matukio_number SET number = number+1 WHERE year = '$newyear'"); if (!$database->execute()) { die($database->getErrorMsg(false)); } } $database->setQuery("SELECT * FROM #__matukio_number WHERE year = '$newyear'"); $zaehlers = $database->loadObjectList(); $zaehler = &$zaehlers[0]; return $zaehler->number . "/" . substr($newyear, 2); } // ++++++++++++++++++++++++++++++++++++++ // +++ Waehrung formatieren +++ sem_f044 // ++++++++++++++++++++++++++++++++++++++ public static function getFormatedCurrency($betrag) { return number_format($betrag, MatukioHelperSettings::getSettings('dezimal_stellen', 2), MatukioHelperSettings::getSettings('dezimal_trennzeichen', '.'), ' '); // TODO Improve } // ++++++++++++++++++++++++++++++++++++++ // +++ Seitennavigation bereinigen +++ sem_f039 // ++++++++++++++++++++++++++++++++++++++ public static function cleanSiteNavigation($total, $limit, $limitstart) { $pagenav = array(); $navi = ""; $pageone = 1; $seiten = 1; $kurse = ""; if ($limit > 0) { $pageone = $limitstart / $limit + 1; $seiten = ceil($total / $limit); if ($pageone > 1) { $navi .= "" . JTEXT::_('COM_MATUKIO_START') . ""; $navi .= " - " . JTEXT::_('COM_MATUKIO_PREV') . ""; } else { $navi .= JTEXT::_('COM_MATUKIO_START'); $navi .= " - " . JTEXT::_('COM_MATUKIO_PREV'); } $start = 0; $ende = $seiten; $navi .= " -"; if ($seiten > 5) { if ($pageone > 3) { $navi .= " ..."; if ($seiten - 2 >= $pageone) { $start = $pageone - 3; $ende = $pageone + 2; } else { $start = $seiten - 5; $ende = $seiten; } } else { $ende = 5; } } for ($i = $start; $i < $ende; $i++) { if ($i * $limit != $limitstart) { $navi .= " " . ($i + 1) . ""; } else { $navi .= " " . ($i + 1); $kurs1 = (($i * $limit) + 1); $kurs2 = (($i + 1) * $limit); if ($kurs2 > $total) { $kurs2 = $total; } if ($kurs1 == $kurs2) { $kurse = $kurs2 . "/" . $total; } else { $kurse = $kurs1 . "-" . $kurs2 . "/" . $total; } } } if ($seiten > 5) { if ($pageone + 2 < $seiten) { $navi .= " ..."; } } $navi .= " -"; if ($pageone < $seiten) { $navi .= " " . JTEXT::_('COM_MATUKIO_NEXT') . ""; $navi .= " - " . JTEXT::_('COM_MATUKIO_END') . ""; } else { $navi .= " " . JTEXT::_('COM_MATUKIO_NEXT'); $navi .= " - " . JTEXT::_('COM_MATUKIO_END'); } } $seite = JTEXT::_('COM_MATUKIO_PAGE') . " " . $pageone . "/" . ($seiten); return "\n" . MatukioHelperUtilsEvents::getTableHeader(4) . "" . MatukioHelperUtilsEvents::getTableCell($seite, 'd', 'l', '', 'sem_nav') . MatukioHelperUtilsEvents::getTableCell($navi, 'd', 'c', '', 'sem_nav') . MatukioHelperUtilsEvents::getTableCell($kurse, 'd', 'r', '', 'sem_nav') . "" . MatukioHelperUtilsEvents::getTableHeader('e'); } // ++++++++++++++++++++++++++++++++++++++ // +++ Tabellenkopf ausgeben sem_f023 // ++++++++++++++++++++++++++++++++++++++ public static function getTableHeader() { $args = func_get_args(); if (is_numeric($args[0])) { $html = "\n"; } else { $html = "\n
"; } return $html; } // ++++++++++++++++++++++++++++++++++++++ // +++ Tabellenzelle ausgeben sem_f022 // ++++++++++++++++++++++++++++++++++++++ // sem_f022(text,art,align,width,class,colspan) public static function getTableCell() { $args = func_get_args(); $html = "\n 4) { if ($args[4] != "") { $html .= " class=\"" . $args[4] . "\""; } } if (count($args) > 2) { if ($args[2] != "") { $html .= " style=\"text-align:"; switch ($args[2]) { case "l": $html .= "left"; break; case "r": $html .= "right"; break; case "c": $html .= "center"; break; } $html .= ";\""; } } if (count($args) > 3) { if ($args[3] != "") { $html .= " width=\"" . $args[3] . "\""; } } if (count($args) > 5) { if ($args[5]) { $html .= " colspan=\"" . $args[5] . "\""; } } $html .= ">" . $args[0] . ""; return $html; } // ++++++++++++++++++++++++++++++++++ // +++ Kopf-Bereiche ausgeben +++ sem_f032 // ++++++++++++++++++++++++++++++++++ public static function getEventlistHeader($tab) { $confusers = JComponentHelper::getParams('com_users'); //$reglevel = MatukioHelperUtilsBasic::getUserLevel(); switch ($tab) { case "2": $tabnum = array(0, 1, 0); break; case "3": $tabnum = array(0, 0, 1); break; default: $tabnum = array(1, 0, 0); break; } $html = ""; if (JFactory::getUser()->id > 0) { // Default View // semauf(0,'',''); $defaultlink = JRoute::_("index.php?option=com_matukio"); $html .= "\n"; $html .= "\n"; $linkownevents = JRoute::_("index.php?option=com_matukio&art=2"); if (JFactory::getUser()->authorise('core.edit.own', 'com_matukio') && MatukioHelperSettings::getSettings('frontend_ownereditevent', 1)) { $html .= "\n"; } //} //} } else if (MatukioHelperSettings::getSettings('frontend_unregisteredshowlogin', 1) > 0) { // Joomla > 1.6 com_users ! $baseuserurl = "index.php?option=com_user"; if (MatukioHelperUtilsBasic::getJoomlaVersion() != '1.5') { $baseuserurl = "index.php?option=com_users"; } $registrationurl = "&view=register"; if (MatukioHelperUtilsBasic::getJoomlaVersion() != '1.5') { $registrationurl = "&view=registration"; } $html .= ""; } $html .= "" . MatukioHelperUtilsEvents::getTableHeader('e') . MatukioHelperUtilsEvents::getTableHeader(4) . "" . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'c', '80%', 'sem_nav', 2) . ""; } else if ($art == 2) { if (count($patterns) > 1) { $htxt .= JHTML::_('select.genericlist', $patterns, 'vorlage', 'class="sem_inputbox" size="1" onChange="form.id.value=form.vorlage.value;form.task.value=\'12\';form.submit();"', 'value', 'text', $vorlage); $html = "" . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'c', '80%', 'sem_nav', 2) . ""; } } return $html; } // ++++++++++++++++++++++++++++++++++++++ // +++ Veranstalterliste ausgeben +++ sem_f009 // ++++++++++++++++++++++++++++++++++++++ public static function getOranizerList($pub) { // TODO update !!! // $publevel = MatukioHelperSettings::getSettings('frontend_createevents', 0); //SettingsHelper::getSettings('frontend_createevents', 0); // $database = JFactory::getDBO(); // $where = array(); // $where [] = "usertype<>'Registered'"; // if ($publevel > 3) { // $where [] = "usertype<>'Author'"; // } else if ($publevel > 4) { // $where [] = "usertype<>'Editor'"; // } else if ($publevel > 5) { // $where [] = "usertype<>'Publisher'"; // } else if ($publevel > 6) { // $where [] = "usertype<>'Manager'"; // } else if ($publevel > 7) { // $where [] = "usertype<>'Administrator'"; // } // $database->setQuery("SELECT id AS value, name AS text FROM #__users" // . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") // . "\nORDER BY name" // ); // $benutzer = $database->loadObjectList(); // return JHTML::_('select.genericlist', array_merge($benutzer), 'publisher', 'class="sem_inputbox" size="1"', // 'value', 'text', $pub); return JHTML::_('list.users', "publisher", $pub, false, null, "name", 0); } // ++++++++++++++++++++++++++++++++++++++++++++ // +++ Editierbereich der Seminare ausgeben +++ sem_f008 // ++++++++++++++++++++++++++++++++++++++++++++ public static function getEventEdit($row, $art) { jimport('joomla.database.table'); jimport('joomla.html.pane'); jimport('joomla.html.sliders'); jimport('joomla.html.html.tabs' ); $database = JFactory::getDBO(); $editor = JFactory::getEditor(); $catlist = MatukioHelperUtilsEvents::getCategoryListArray($row->catid); $reglevel = MatukioHelperUtilsBasic::getUserLevel(); $reqfield = " *"; // Vorlage $html = ""; if ($art == 1 OR $art == 2) { $html = ""; } if ($row->id == 0 AND ($art == 1 OR $art == 2)) { $html = MatukioHelperUtilsEvents::getTemplateListSelect($row->vorlage, $art); } $html .= "" . MatukioHelperUtilsEvents::getTableCell(" * " . JTEXT::_('COM_MATUKIO_REQUIRED_FIELD'), 'd', 'r', '100%', 'sem_nav', 2); // Benutzer informieren // if($art!=3) { // $html .= ""; // $radios = array(); // $radios[] = JHTML::_('select.option',1,JTEXT::_('COM_MATUKIO_YES')); // $radios[] = JHTML::_('select.option',0,JTEXT::_('COM_MATUKIO_NO')); // $htx2 .= "
".JHTML::_('select.radiolist',$radios,'inform','class="sem_inputbox"','value','text',0); // $htx2 .= "
".JTEXT::_('COM_MATUKIO_MESSAGE_TEXT').": "; // $html .= "\n".MatukioHelperUtilsEvents::getTableCell($htx2,'d','c','100%','sem_nav',2); // } return $html; } // ++++++++++++++++++++++++++++++++++++++ // +++ Eingabe prüfen +++ sem_f067 // ++++++++++++++++++++++++++++++++++++++ public static function checkRequiredFieldValues($text, $art = 'leer') { $htxt = false; switch ($art) { // texteingabe prüfen - alle eingaben auf leere eingaben prüfen case 'leer': $text = trim($text); if ($text != '') { $htxt = true; } break; // auf nur zahlen prüfen case 'nummer': if (preg_match("#^[0-9]+$#", $text)) { $htxt = true; } break; // auf telefonnummer prüfen mit min. 6 zahlen case 'telefon': if (preg_match("#^[ 0-9\/-+]{6,}+$#", $text)) { $htxt = true; } break; // auf nur buchstaben prüfen case 'buchstabe': if (preg_match("/^[ a-za-zäöüß]+$/i", $text)) { $htxt = true; } break; // auf nur ein wort prüfen case 'wort': if (preg_match("/^[a-za-zäöüß]+$/i", $text)) { $htxt = true; } break; // url prüfen case 'url': $text = trim($text); if (preg_match("#^(http|https)+(://www.)+([a-z0-9-_.]{2,}\.[a-z]{2,4})$#i", $text)) { $htxt = true; } break; // email-adresse prüfen case 'email': $text = trim($text); if ($text != '') { $_pat = "^[_a-za-z0-9-]+(.[_a-za-z0-9-]+)*@([a-z0-9-]{3,})+.([a-za-z]{2,4})$"; if (!preg_match("|$_pat|i", $text)) { $htxt = false; } } else { $htxt = false; } break; // Zahl der Laenge art pruefen default: if (preg_match("/^[0-9]{$art}$/", $text)) { $htxt = true; } break; } return $htxt; } // ++++++++++++++++++++++++++++++++++++++++ // +++ Konstanten in Text austauschen +++ sem_f054 // ++++++++++++++++++++++++++++++++++++++++ public static function replaceSEMConstants($html, $row, $user) { $neudatum = MatukioHelperUtilsDate::getCurrentDate(); $html = str_replace('SEM_IMAGEDIR', MatukioHelperUtilsBasic::getComponentImagePath(), $html); $html = str_replace('SEM_BEGIN_EXPR', JTEXT::_('COM_MATUKIO_BEGIN'), $html); $html = str_replace('SEM_END_EXPR', JTEXT::_('COM_MATUKIO_END'), $html); $html = str_replace('SEM_LOCATION_EXPR', JTEXT::_('COM_MATUKIO_CITY'), $html); $html = str_replace('SEM_TUTOR_EXPR', JTEXT::_('COM_MATUKIO_TUTOR'), $html); $html = str_replace('SEM_DATE_EXPR', JTEXT::_('COM_MATUKIO_DATE'), $html); $html = str_replace('SEM_TIME_EXPR', JTEXT::_('COM_MATUKIO_TIME'), $html); $html = str_replace('SEM_COURSE', $row->title, $html); $html = str_replace('SEM_TITLE', $row->title, $html); $html = str_replace('SEM_COURSENUMBER', $row->semnum, $html); $html = str_replace('SEM_NUMBER', $row->semnum, $html); $html = str_replace('SEM_ID', $row->id, $html); $html = str_replace('SEM_LOCATION', $row->place, $html); $html = str_replace('SEM_TEACHER', $row->teacher, $html); $html = str_replace('SEM_TUTOR', $row->teacher, $html); $html = str_replace('SEM_BEGIN', JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_BEGIN_OVERVIEW', JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_BEGIN_DETAIL', JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_BEGIN_LIST', JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_BEGIN_DATE', JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')), $html); $html = str_replace('SEM_BEGIN_TIME', JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('time_format', 'H:i')), $html); $html = str_replace('SEM_END', JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_END_OVERVIEW', JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_END_DETAIL', JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_END_LIST', JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_END_DATE', JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')), $html); $html = str_replace('SEM_END_TIME', JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('time_format', 'H:i')), $html); $html = str_replace('SEM_TODAY', JHTML::_('date', $neudatum, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')), $html); $html = str_replace('SEM_NOW', JHTML::_('date', $neudatum, MatukioHelperSettings::getSettings('time_format', 'H:i')), $html); $html = str_replace('SEM_NOW_OVERVIEW', JHTML::_('date', $neudatum, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_NOW_DETAIL', JHTML::_('date', $neudatum, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_NOW_LIST', JHTML::_('date', $neudatum, MatukioHelperSettings::getSettings('date_format_small', 'd-m-Y, H:i')), $html); $html = str_replace('SEM_NOW_DATE', JHTML::_('date', $neudatum, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y')), $html); $html = str_replace('SEM_NOW_TIME', JHTML::_('date', $neudatum, MatukioHelperSettings::getSettings('time_format', 'H:i')), $html); $html = str_replace('SEM_NAME', $user->name, $html); $html = str_replace('SEM_EMAIL', $user->email, $html); return $html; } // ++++++++++++++++++++++++++++++++++++++++++++++++ // +++ Name und Beschreibung der Kategorie ausgeben sem_f012 // ++++++++++++++++++++++++++++++++++++++++++++++++ public static function getCategoryDescriptionArray($catid) { $database = JFactory::getDBO(); $database->setQuery("Select * FROM #__categories WHERE extension='com_matukio' AND id = '$catid'"); $rows = $database->loadObjectList(); return array($rows[0]->title, $rows[0]->description); } public static function getAdditionalFieldValue($field, $bookingid){ $database = JFactory::getDBO(); $database->setQuery("Select id, " . $field . " FROM #__matukio_bookings WHERE id = '" . $bookingid . "'"); $row = $database->loadObject(); return $row; } // +++++++++++++++++++++++++++++++++++++++ // +++ Ausgabe des Prozentbalkens sem_f013 // +++++++++++++++++++++++++++++++++++++++ function getProcentBar($max, $frei, $art) { if ($max == 0) { $max = 1; } $hoehe = 30; $hoehefrei = round($frei * $hoehe / $max); $hoehebelegt = $hoehe - $hoehefrei; $html = "" . $max . "
"; $html .= "
"; if ($hoehefrei > 0) { $html .= "
"; } if ($hoehebelegt > 0) { $html .= "
"; } $html .= "
"; $html .= "0"; return $html; } /** * @static * @param $link * @return string */ public static function getRoutedLink($link){ $db = JFactory::getDBO(); //$lang = JFactory::getLanguage()->getTag(); $uri = 'index.php?option=com_matukio&view=eventlist'; //echo $lang; $db->setQuery('SELECT id FROM #__menu WHERE link LIKE '. $db->Quote( $uri .'%' ) .' AND published = 1 LIMIT 1' ); $itemId = ($db->getErrorNum())? 0 : intval($db->loadResult()); $link = $link . "&Itemid=" . $itemId; // Routing of a link $link = JRoute::_($link); return $link; } }
"; $html .= "\n " . JTEXT::_('COM_MATUKIO_EVENTS') . ""; $html .= ""; // Own Booking //javascript:document.FrontForm.limitstart.value='0';semauf(1,'',''); $linkownbook = JRoute::_("index.php?option=com_matukio&art=1"); $html .= "\n " . JTEXT::_('COM_MATUKIO_MY_BOOKINGS') . ""; $html .= "\n"; $html .= "\n " . JTEXT::_('COM_MATUKIO_MY_OFFERS') . ""; $html .= "\n"; $html .= " "; $html .= " "; $html .= ""; $html .= "   "; $html .= " "; $html .= " "; if ($confusers->get('allowUserRegistration', 0) > 0) { $html .= " "; } $html .= " "; $knopfunten = ""; if (JFactory::getUser()->id > 0 and MatukioHelperSettings::getSettings('frontend_unregisteredshowlogin', 1) > 0) { $logoutlink = JRoute::_("index.php?option=com_matukio&view=matukio&task=logoutUser"); $html .= JHTML::_('link', $logoutlink, JHTML::_('image', MatukioHelperUtilsBasic::getComponentImagePath() . '3232.png', null, array('border' => '0', 'align' => 'absmiddle')), array('title' => JTEXT::_('COM_MATUKIO_LOGOUT'))) . "  "; $knopfunten .= "" . JHTML::_('image', MatukioHelperUtilsBasic::getComponentImagePath() . '3216.png', null, array('border' => '0', 'align' => 'absmiddle')) . " " . JTEXT::_('COM_MATUKIO_LOGOUT') . ""; } echo $html; return $knopfunten; } // ++++++++++++++++++++++++++++++++++++++ // +++ Druckfenster im Frontend ausgeben sem_f037 // ++++++++++++++++++++++++++++++++++++++ public static function getPrintWindow($art, $cid, $uid, $knopf, $class = "default") { // if(MatukioHelperUtilsBasic::getUserLevel() > 1) { $dateid = trim(JFactory::getApplication()->input->get('dateid', 1)); $catid = trim(JFactory::getApplication()->input->getInt('catid', 0)); $search = trim(strtolower(JFactory::getApplication()->input->get('search', '', 'string'))); $limit = trim(JFactory::getApplication()->input->getInt('limit', MatukioHelperSettings::getSettings('event_showanzahl', 10))); $limitstart = trim(JFactory::getApplication()->input->getInt('limitstart', 0)); if ($knopf == "") { $image = "1932"; } else { $image = "1916"; } $titel = JTEXT::_('COM_MATUKIO_PRINT'); $href = JURI::ROOT() . "index.php?tmpl=component&s=" . MatukioHelperUtilsBasic::getRandomChar() . "&option=" . JFactory::getApplication()->input->get('option') . "&view=printeventlist&dateid=" . $dateid . "&catid=" . $catid . "&search=" . $search . "&limit=" . $limit . "&limitstart=" . $limitstart . "&cid=" . $cid . "&uid=" . $uid . "&todo="; $x = 800; $y = 600; /** * 65O9805443904 = public ?! -done ? * 653O875032490 = Meine Angebote -- done ? * 6530387504345 = Meine Buchungen / Buchungsbestätigung ?! -- done ? * 4525487566184 = Teilnehmerliste -- done * 3728763872762 = Unterschriftsliste = Teilnehmerliste & art = 1 -- done * 764576O987985 = cert * // print_eventlist, print_booking, print_myevents * */ //die("Art: " . $art); switch ($art) { case 1: // Zertifikat $image = "2900"; $titel = JTEXT::_('COM_MATUKIO_PRINT_CERTIFICATE'); $href .= "certificate"; break; case 2: // Kursuebersicht $href .= "print_eventlist"; break; case 3: // gebuchte Kurse $href .= "print_booking"; break; case 4: // Kursangebot $href .= "print_myevents"; break; case 5: // Teilnehmerliste1 $href .= "print_teilnehmerliste&art=1"; if ($knopf == "") { $image = "2032"; } else { $image = "2016"; } break; case 6: // Buchungsbestaetigung $href .= "1495735268456&task=printbook"; break; case 7: // Teilnehmerliste2 $href .= "print_teilnehmerliste"; break; } // $btnclass = "button"; // // if($class == "modern"){ $btnclass = "mat_button"; //} if (($art > 1 && MatukioHelperSettings::getSettings('frontend_userprintlists', 1) > 0 OR ($art == 1 && MatukioHelperSettings::getSettings('frontend_userprintcertificate', 0) > 0 && MatukioHelperSettings::getSettings('frontend_certificatesystem', 0) > 0))) { if ($knopf == "") { return ""; } else { return " " . $titel . ""; } } else if ($art == 1 AND MatukioHelperSettings::getSettings('frontend_certificatesystem', 0) > 0) { return "\n"; // } else { // return " "; } // } } // ++++++++++++++++++++++++++++++++++++++ // +++ Bewertungsfenster ausgeben sem_f035 // ++++++++++++++++++++++++++++++++++++++ public static function getRatingPopup($dir, $cid, $imgid) { if (MatukioHelperUtilsBasic::getUserLevel() > 1) { $image = "240" . $imgid; $titel = JTEXT::_('COM_MATUKIO_YOUR_RATING'); $href = JURI::ROOT() . "index.php?tmpl=component&s=" . MatukioHelperUtilsBasic::getRandomChar() . "&option=" . JFactory::getApplication()->input->get('option') . "&cid=" . $cid . "&view=rateevent"; $x = 500; $y = 280; return ""; } } // ++++++++++++++++++++++++++++++++++++++ // +++ Ende des Kopfbereichs ausgeben +++ sem_f033 // ++++++++++++++++++++++++++++++++++++++ public static function getEventlistHeaderEnd() { echo "
"; } // +++++++++++++++++++++++++++++++++++++++ // +++ Anzeige der Ueberschrift + sem_f041 // +++++++++++++++++++++++++++++++++++++++ public static function printHeading($temp1, $temp2) { $html = ""; $html .= "\n"; if ($temp2 != "") { $html .= "\n"; } $html .= "\n
" . $temp1 . "
" . $temp2 . "
"; echo $html; } // ++++++++++++++++++++++++++++++++++++++ // +++ Limitbox fuer Seitennavigation +++ sem_f040 // ++++++++++++++++++++++++++++++++++++++ public static function getLimitboxSiteNav($art, $limit, $where = "eventlist", $tmpl = "old") { $limits = array(); $htxt = "FrontForm"; if ($art == 2) { $htxt = "adminForm"; } $limits[] = JHTML::_('select.option', '3'); for ($i = 5; $i <= 30; $i += 5) { $limits[] = JHTML::_('select.option', "$i"); } $limits[] = JHTML::_('select.option', '50'); $limits[] = JHTML::_('select.option', '100'); $limits[] = JHTML::_('select.option', '0', JText::_('all')); $class = "sem_inputbox"; if($tmpl == "modern") $class = "mat_inputbox"; return JHTML::_('select.genericlist', $limits, 'limit', 'class="' . $class . '" size="1" onchange="changeLimitEventlist()"', 'value', 'text', $limit); } // ++++++++++++++++++++++++++++++++++ // +++ ist Kurs noch buchbar sem_f021 // ++++++++++++++++++++++++++++++++++ public static function getEventBookableArray($art, $row, $usrid) // usrid == uid { //echo "Eventbooking"; //var_dump($row); //die("art: " . $art . " usrid : " . $usrid); $database = JFactory::getDBO(); $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='$row->id' ORDER BY id"); $temps = $database->loadObjectList(); $gebucht = 0; foreach ($temps as $el) { $gebucht = $gebucht + $el->nrbooked; } if ($usrid < 0) { $sid = $usrid * -1; $database->setQuery("SELECT * FROM #__matukio_bookings WHERE id='$sid'"); $userid = 0; } else { if ($usrid == 0) { $usrid = -1; } $query = "SELECT * FROM #__matukio_bookings WHERE semid='" . $row->id . "' AND userid = '" . $usrid . "'"; $database->setQuery($query); } $temp = $database->loadObjectList(); $freieplaetze = $row->maxpupil - $gebucht; if ($freieplaetze < 0) { $freieplaetze = 0; } $buchbar = 3; $buchgraf = 2; $altbild = JTEXT::_('COM_MATUKIO_NOT_EXCEEDED'); $reglevel = MatukioHelperUtilsBasic::getUserLevel(); $neudatum = MatukioHelperUtilsDate::getCurrentDate(); if ($neudatum > $row->booked) { $buchbar = 1; $buchgraf = 0; $altbild = JTEXT::_('COM_MATUKIO_REGISTRATION_END'); } else if ($row->cancelled == 1 OR ($freieplaetze < 1 AND $row->stopbooking == 1) OR ($usrid == $row->publisher AND MatukioHelperSettings::getSettings('booking_ownevents', 1) == 0) ) { $buchbar = 1; $buchgraf = 0; $altbild = JTEXT::_('COM_MATUKIO_UNBOOKABLE'); } else if ($freieplaetze < 1 AND ($row->stopbooking == 0 OR $row->stopbooking == 2)) { $buchgraf = 1; $altbild = JTEXT::_('COM_MATUKIO_BOOKING_ON_WAITLIST'); } if (count($temp) > 0) { $buchbar = 2; $buchgraf = 0; $altbild = JTEXT::_('COM_MATUKIO_ALREADY_BOOKED'); } if ($reglevel < 1) { $buchbar = 0; } if ($art == 1) { $buchgraf = 2; $altbild = JTEXT::_('COM_MATUKIO_PARTICIPANT_ASSURED'); $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row); if ($gebucht->booked > $row->maxpupil) { if ($row->stopbooking == 0 OR $row->stopbooking == 2) { $summe = 0; for ($l = 0, $m = count($temps); $l < $m; $l++) { $summe = $summe + $temps[$l]->nrbooked; if ($temps[$l]->userid == $usrid) { break; } } if ($summe > $row->maxpupil) { $buchgraf = 1; $altbild = JTEXT::_('COM_MATUKIO_WAITLIST'); } } else { $buchgraf = 0; $altbild = JTEXT::_('COM_MATUKIO_NO_SPACE_AVAILABLE'); } } if ($row->cancelled == 1) { $buchgraf = 0; $altbild = JTEXT::_('COM_MATUKIO_UNBOOKABLE'); } } if ($art == 2) { $buchgraf = 2; $altbild = JTEXT::_('COM_MATUKIO_EVENT_HAS_NOT_STARTED_YET'); if ($neudatum > $row->end) { $buchgraf = 0; $altbild = JTEXT::_('COM_MATUKIO_EVENT_HAS_EVDED'); } else if ($neudatum > $row->begin) { $buchgraf = 1; $altbild = JTEXT::_('COM_MATUKIO_EVENT_IS_RUNNING'); } } return array($buchbar, $altbild, $temp, $buchgraf, $freieplaetze); } // ++++++++++++++++++++++++++++++++++ // +++ Berechne die gebuchten Plaetze sem_f020 // ++++++++++++++++++++++++++++++++++ public static function calculateBookedPlaces($row) { $zurueck = new stdClass(); $database = JFactory::getDBO(); $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid='" . $row->id . "'"); $temps = $database->loadObjectList(); $gebucht = 0; $zertifiziert = 0; $bezahlt = 0; foreach ($temps as $el) { $gebucht = $gebucht + $el->nrbooked; $zertifiziert = $zertifiziert + $el->certificated; $bezahlt = $bezahlt + $el->paid; } $zurueck->booked = $gebucht; $zurueck->certificated = $zertifiziert; $zurueck->paid = $bezahlt; $zurueck->number = count($temps); return $zurueck; } // ++++++++++++++++++++++++++++++++++ // +++ Farbbeschreibung anzeigen +++ sem_f029 // ++++++++++++++++++++++++++++++++++ public static function getColorDescriptions($green, $yellow, $red) { $html = ''; $html .= ""; if ($green != "") { $html .= MatukioHelperUtilsEvents::getTableCell(" " . $green, 'd', 'c', '', 'sem_nav'); } if ($yellow != "") { $html .= MatukioHelperUtilsEvents::getTableCell(" " . $yellow, 'd', 'c', '', 'sem_nav'); } if ($red != "") { $html .= MatukioHelperUtilsEvents::getTableCell(" " . $red, 'd', 'c', '', 'sem_nav'); } $html .= ""; $html .= "
"; return $html; } // +++++++++++++++++++++++++++++++++++++++++++++++++++ // +++ Anzeige der versteckten Variablen im Frontend + sem_f014 // +++++++++++++++++++++++++++++++++++++++++++++++++++ public static function getHiddenFormElements($task, $catid, $search, $limit, $limitstart, $cid, $dateid, $uid) { $html = ""; $html = ""; $html .= ""; $html .= ""; if ($catid != "") { $html .= ""; } if ($search != "") { $html .= ""; } if ($limit != "") { $html .= ""; } if ($uid != "") { if ($uid == -1) { $uid = ""; } $html .= ""; } if ($dateid != "") { $html .= ""; } return $html; } // ++++++++++++++++++++++++++++++++++ // +++ Aray mit Zusatzfeldern erzeugen sem_f017 // ++++++++++++++++++++++++++++++++++ public static function getAdditionalFieldsFrontend($row) { $zusfeld = array(); $zusfeld[] = array($row->zusatz1, $row->zusatz2, $row->zusatz3, $row->zusatz4, $row->zusatz5, $row->zusatz6, $row->zusatz7, $row->zusatz8, $row->zusatz9, $row->zusatz10, $row->zusatz11, $row->zusatz12, $row->zusatz13, $row->zusatz14, $row->zusatz15, $row->zusatz16, $row->zusatz17, $row->zusatz18, $row->zusatz19, $row->zusatz20); if (isset($row->zusatz1hint)) { $zusfeld[] = array($row->zusatz1hint, $row->zusatz2hint, $row->zusatz3hint, $row->zusatz4hint, $row->zusatz5hint, $row->zusatz6hint, $row->zusatz7hint, $row->zusatz8hint, $row->zusatz9hint, $row->zusatz10hint, $row->zusatz11hint, $row->zusatz12hint, $row->zusatz13hint, $row->zusatz14hint, $row->zusatz15hint, $row->zusatz16hint, $row->zusatz17hint, $row->zusatz18hint, $row->zusatz19hint, $row->zusatz20hint); $zusfeld[] = array($row->zusatz1show, $row->zusatz2show, $row->zusatz3show, $row->zusatz4show, $row->zusatz5show, $row->zusatz6show, $row->zusatz7show, $row->zusatz8show, $row->zusatz9show, $row->zusatz10show, $row->zusatz11show, $row->zusatz12show, $row->zusatz13show, $row->zusatz14show, $row->zusatz15show, $row->zusatz16show, $row->zusatz17show, $row->zusatz18show, $row->zusatz19show, $row->zusatz20show); } return $zusfeld; } // ++++++++++++++++++++++++++++++++++++++ // +++ E-Mail-Fenster ausgeben sem_f034 // ++++++++++++++++++++++++++++++++++++++ public static function getEmailWindow($dir, $cid, $art = 0, $class = "default") { $html = ""; $href = MatukioHelperUtilsBasic::getSitePath() . "index.php?tmpl=component&s=" . MatukioHelperUtilsBasic::getRandomChar() . "&option=" . JFactory::getApplication()->input->get('option') . "&view=contactorganizer&cid=" . $cid . "&art=" .$art . "&task="; $x = 600; $y = 550; $htxt = " 0) { $html = $htxt . "19\" title=\"" . JTEXT::_('COM_MATUKIO_CONTACT') . "\">  " . JTEXT::_('COM_MATUKIO_CONTACT') . ""; } else if ($art == 2 AND MatukioHelperUtilsBasic::getUserLevel() > 1 AND MatukioHelperSettings::getSettings('sendmail_contact', 1) > 0) { $html = $htxt . "19\"> " . JTEXT::_('COM_MATUKIO_CONTACT') . ""; } else if ($art == 3 AND MatukioHelperUtilsBasic::getUserLevel() > 2) { $html = $htxt . "30\" title=\"" . JTEXT::_('COM_MATUKIO_CONTACT') . "\">"; } else if ($art == 4 AND MatukioHelperUtilsBasic::getUserLevel() > 2) { $html = $htxt . "30\"> " . JTEXT::_('COM_MATUKIO_CONTACT') . ""; } else if ($art == 2) { $html = $htxt . "19\"> " . JTEXT::_('COM_MATUKIO_CONTACT') . ""; } else if ($art == "organizer") { $html = $htxt . "19\"> " . JTEXT::_('COM_MATUKIO_CONTACT') . ""; } return $html; } // ++++++++++++++++++++++++++++++++++ // +++ Aray mit Dateien erzeugen sem_f060 // ++++++++++++++++++++++++++++++++++ public static function getEventFileArray($row) { $zusfeld = array(); $zusfeld[] = array($row->file1, $row->file2, $row->file3, $row->file4, $row->file5); $zusfeld[] = array($row->file1desc, $row->file2desc, $row->file3desc, $row->file4desc, $row->file5desc); $zusfeld[] = array($row->file1down, $row->file2down, $row->file3down, $row->file4down, $row->file5down); return $zusfeld; } // ++++++++++++++++++++++++++++++++++++++ // +++ Bestaetigungs-Emails versenden +++ sem_f050 // ++++++++++++++++++++++++++++++++++++++ public static function sendBookingConfirmationMail($cid, $uid, $art, $cancel = false) { jimport('joomla.mail.helper'); jimport( 'joomla.mail.mail' ); $mainframe = JFactory::getApplication(); if (MatukioHelperSettings::getSettings('sendmail_teilnehmer', 1) > 0 OR MatukioHelperSettings::getSettings('sendmail_owner', 1) > 0) { $database = JFactory::getDBO(); $database->setQuery("SELECT * FROM #__matukio WHERE id = '" . $cid . "'"); $event = $database->loadObject(); if(!$cancel) { $database->setQuery("SELECT * FROM #__matukio_bookings WHERE id = " . $uid ); } else { $database->setQuery("SELECT * FROM #__matukio_bookings WHERE semid = " . $cid . " AND userid = " . $uid ); } $booking = $database->loadObject(); if ($booking->userid == 0) { $user = JFactory::getUser(0); $user->name = $booking->name; $user->email = $booking->email; } else { $user = JFactory::getuser($booking->userid); } $publisher = JFactory::getuser($event->publisher); $body1 = "

" . JTEXT::_('COM_MATUKIO_PLEASE_DONT_ANSWER_THIS_EMAIL') . "

"; $body2 = $body1; $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($event); $gebucht = $gebucht->booked; switch ($art) { // Booking confirmation case 1: if ($gebucht > $event->maxpupil) { if ($event->stopbooking = 0) { $body1 .= JTEXT::_('COM_MATUKIO_MAX_PARTICIPANT_NUMBER_REACHED'); } else { $body1 .= JTEXT::_('COM_MATUKIO_ADMIN_BOOKED_EVENT_FOR_YOU') . " " . JTEXT::_('COM_MATUKIO_YOU_ARE_BOOKED_ON_THE_WAITING_LIST'); } } else { $body1 .= JTEXT::_('COM_MATUKIO_ADMIN_BOOKED_EVENT_FOR_YOU'); } $body2 .= JTEXT::_('COM_MATUKIO_ADMIN_MADE_FOLLOWING_RESERVATION'); break; case 2: $body1 .= JTEXT::_('COM_MATUKIO_YOU_HAVE_CANCELLED'); $body2 .= JTEXT::_('COM_MATUKIO_BOOKING_FOR_EVENT_CANCELLED'); break; case 3: $body1 .= JTEXT::_('COM_MATUKIO_BOOKING_CANCELED'); $body2 .= JTEXT::_('COM_MATUKIO_THE_ADMIN_CANCELED_THE_BOOKING_OF_FOLLOWING'); break; case 4: $body1 .= JTEXT::_('COM_MATUKIO_ADMIN_DELETED_THE_FOLLOWING_EVENT'); $body2 .= JTEXT::_('COM_MATUKIO_ADMIN_DELETED_EVENT'); break; case 5: $body1 .= JTEXT::_('COM_MATUKIO_ADMIN_PUBLISHED_EVENT_YOUR_BOOKING_IS_VALID'); $body2 .= JTEXT::_('COM_MATUKIO_ADMIN_PUBLISHED_EVENT_THE_BOOKING_OF_PARTICIPANTS_IS_VALID'); break; case 6: $body1 .= JTEXT::_('COM_MATUKIO_THE_ADMIN_CERTIFIED_YOU'); $body2 .= JTEXT::_('COM_MATUKIO_ADMIN_HAS_CERTIFICATED_FOLLOWING_PARTICIPANT'); if (MatukioHelperSettings::getSettings('frontend_userprintcertificate', 0) > 0) { $body1 .= " " . JTEXT::_('COM_MATUKIO_YOU_CAN_PRINT_YOUR_CERTIFICATE'); } break; case 7: $body1 .= JTEXT::_('COM_MATUKIO_CERTIFICAT_REVOKED'); $body2 .= JTEXT::_('COM_MATUKIO_ADMIN_HAS_WITHDRAWN_CERTIFICATE_FOR_FOLLOWNG_PARITICIPANTS'); break; case 8: if ($gebucht > $event->maxpupil) { if ($event->stopbooking = 0) { $body1 .= JTEXT::_('COM_MATUKIO_MAX_PARTICIPANT_NUMBER_REACHED'); } else { $body1 .= JTEXT::_('COM_MATUKIO_ORGANISER_REGISTERED_YOU') . " " . JTEXT::_('COM_MATUKIO_YOU_ARE_BOOKED_ON_THE_WAITING_LIST'); } } else { $body1 .= JTEXT::_('COM_MATUKIO_ORGANISER_REGISTERED_YOU'); } $body2 .= JTEXT::_('COM_MATUKIO_YOU_HAVE_REGISTRED_PARTICIPANT_FOR'); break; case 9: $body1 .= JTEXT::_('COM_MATUKIO_ORGANISER_HAS_REPUBLISHED_EVENT'); $body2 .= JTEXT::_('COM_MATUKIO_THE_BOOKING_OF_THE_PARTICIPANT_IS_VALID_AGAIN'); break; case 10: $body1 .= JTEXT::_('COM_MATUKIO_ORGANISER_CANCELLED'); $body2 .= JTEXT::_('COM_MATUKIO_BOOKING_NO_LONGER_VALID'); break; case 11: $body1 .= JTEXT::_('COM_MATUKIO_ORGANISER_UPDATED_YOUR_BOOKING'); $body2 .= JTEXT::_(''); break; } $abody = "\n\n"; $sender = $mainframe->getCfg('fromname'); $from = $mainframe->getCfg('mailfrom'); $htxt = ""; if ($event->semnum != "") { $htxt = " " . $event->semnum; } $subject = JTEXT::_('COM_MATUKIO_EVENT') . $htxt . ": " . $event->title; $subject = JMailHelper::cleanSubject($subject); if (MatukioHelperSettings::getSettings('sendmail_teilnehmer', 1) > 0 OR $art < 11) { $replyname = $publisher->name; $replyto = $publisher->email; $email = $user->email; if($art == 1 || $art == 2 || $art == 3) { // New booking templates $tmpl_name = MatukioHelperTemplates::getEmailTemplateName($art); $tmpl = MatukioHelperTemplates::getEmailBody($tmpl_name, $event, $booking); if(MatukioHelperSettings::getSettings('email_html', 1)) { $body = $tmpl->value; } else { $body = $tmpl->value_text; } $subject = $tmpl->subject; $mailer = JFactory::getMailer(); if($art != 2 xor $art != 3) { $success = $mailer->sendMail($from, $sender, $email, $subject, $body, MatukioHelperSettings::getSettings('email_html', 1), null, null, null, $replyto, $replyname); } } else { // Old ones $body = $abody . $body1 . MatukioHelperUtilsEvents::getEmailBody($event, $booking, $user); $mailer = JFactory::getMailer(); $success = $mailer->sendMail($from, $sender, $email, $subject, $body, 1, null, null, null, $replyto, $replyname); } //var_dump($email); } if (MatukioHelperSettings::getSettings('sendmail_owner', 1) > 0 AND $art < 11) { $replyname = $user->name; $replyto = $user->email; $email = $publisher->email; if($art == 1 || $art == 2 || $art == 3) { // New booking templates $tmpl_name = MatukioHelperTemplates::getEmailTemplateName($art); $tmpl = MatukioHelperTemplates::getEmailBody($tmpl_name, $event, $booking); if(MatukioHelperSettings::getSettings('email_html', 1)) { $body = $tmpl->value; } else { $body = $tmpl->value_text; } $subject = $tmpl->subject; $mailer = JFactory::getMailer(); $success = $mailer->sendMail($from, $sender, $email, $subject, $body, MatukioHelperSettings::getSettings('email_html', 1), null, null, null, $replyto, $replyname); } else { // Old ones $body = $abody . $body2 . MatukioHelperUtilsEvents::getEmailBody($event, $booking, $user); $mailer = JFactory::getMailer(); $success = $mailer->sendMail($from, $sender, $email, $subject, $body, 1, null, null, null, $replyto, $replyname); } //die($cid . " " . $uid . " " . $art . " " . $success); } } } // ++++++++++++++++++++++++++++++++++++++ // +++ Email-Koerper ausgeben +++ sem_f049 // ++++++++++++++++++++++++++++++++++++++ public static function getEmailBody($row, $buchung, $user) { $gebucht = MatukioHelperUtilsEvents::calculateBookedPlaces($row); $gebucht = $gebucht->booked; $freieplaetze = $row->maxpupil - $gebucht; if ($freieplaetze < 0) { $freieplaetze = 0; } $body = "

\n"; $body .= "\n"; $body .= "\n"; if (count($buchung) > 0) { $body .= "\n"; $body .= "\n"; $body .= "\n"; $zusfeld = MatukioHelperUtilsEvents::getAdditionalFieldsFrontend($row); $zusbuch = MatukioHelperUtilsEvents::getAdditionalFieldsFrontend($buchung); for ($i = 0; $i < count($zusfeld[0]); $i++) { if ($zusfeld[0][$i] != "") { $zusart = explode("|", $zusfeld[0][$i]); $body .= "\n"; } } if ($row->nrbooked > 1) { $body .= "\n"; } } $body .= "\n"; $body .= "\n"; $body .= "\n"; if ($row->semnum != "") { $body .= "\n"; } if ($row->showbegin > 0) { $body .= "\n"; } if ($row->showend > 0) { $body .= "\n"; } if ($row->showbooked > 0) { $body .= "\n"; } if ($row->teacher != "") { $body .= "\n"; } if ($row->target != "") { $body .= "\n"; } $body .= "\n"; if (MatukioHelperSettings::getSettings('event_showinfoline', 1) > 0) { $body .= "\n"; $body .= "\n"; $body .= "\n"; } if ($row->fees > 0) { $body .= "\n"; } if ($row->description != "") { $body .= "\n"; } $body .= "
" . JTEXT::_('COM_MATUKIO_NAME') . ": " . $buchung->name . " (" . $user->name . ")" . "
" . JTEXT::_('COM_MATUKIO_EMAIL') . ": " . $user->email . "
" . JTEXT::_('COM_MATUKIO_BOOKING_ID') . ": " . MatukioHelperUtilsBooking::getBookingId($buchung->id) . "

" . JTEXT::_('COM_MATUKIO_ADDITIONAL_INFO') . "
" . $zusart[0] . ": " . $zusbuch[0][$i] . "
" . JTEXT::_('COM_MATUKIO_BOOKED_PLACES') . ": " . $buchung->nrbooked . "

" . $row->title . "
" . $row->shortdesc . "
" . JTEXT::_('COM_MATUKIO_NUMBER') . ": " . $row->semnum . "
" . JTEXT::_('COM_MATUKIO_BEGIN') . ": " . JHTML::_('date', $row->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . "
" . JTEXT::_('COM_MATUKIO_END') . ": " . JHTML::_('date', $row->end, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . "
" . JTEXT::_('COM_MATUKIO_CLOSING_DATE') . ": " . JHTML::_('date', $row->booked, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i')) . "
" . JTEXT::_('COM_MATUKIO_TUTOR') . ": " . $row->teacher . "
" . JTEXT::_('COM_MATUKIO_TARGET_GROUP') . ": " . $row->target . "
" . JTEXT::_('COM_MATUKIO_CITY') . ": " . $row->place . "
" . JTEXT::_('COM_MATUKIO_MAX_PARTICIPANT') . ": " . $row->maxpupil . "
" . JTEXT::_('COM_MATUKIO_BOOKINGS') . ": " . $gebucht . "
" . JTEXT::_('COM_MATUKIO_BOOKABLE') . ": " . $freieplaetze . "
" . JTEXT::_('COM_MATUKIO_FEES') . ": " . MatukioHelperSettings::getSettings('currency_symbol', '$') . " " . $buchung->payment_brutto; if (MatukioHelperSettings::getSettings('frontend_usermehrereplaetze', 1) > 0) { // $body .= " " . JTEXT::_('COM_MATUKIO_PRO_PERSON'); } $body .= "
" . MatukioHelperUtilsEvents::getCleanedMailText($row->description) . "

"; $htxt = str_replace('SEM_HOMEPAGE', "" . JURI::root() . "", JTEXT::_('COM_MATUKIO_FOR_MORE_INFO_VISIT')); $body .= $htxt . ""; return $body; } // ++++++++++++++++++++++++++++++++++++++ // +++ Ausgabe saeubern +++ sem_f066 // ++++++++++++++++++++++++++++++++++++++ public static function getCleanedMailText($text) { preg_match_all("`\[sem_[^\]]+\](.*)\[/sem_[^\]]+\]`U", $text, $ausgabe); for ($i = 0; $i < count($ausgabe[0]); $i++) { $text = str_replace($ausgabe[0][$i], "", $text); } preg_match_all("`\{[^\}]+\}`U", $text, $ausgabe); for ($i = 0; $i < count($ausgabe[0]); $i++) { $text = str_replace($ausgabe[0][$i], "", $text); } return $text; } // ++++++++++++++++++++++++++++++++++++++ // +++ Kategorienliste ausgeben +++ sem_f010 // ++++++++++++++++++++++++++++++++++++++ // TODO update to ACL!! public static function getCategoryListArray($catid) { jimport('joomla.database.table'); $database = JFactory::getDBO(); $reglevel = MatukioHelperUtilsBasic::getUserLevel(); $accesslvl = 1; if ($reglevel >= 6) { $accesslvl = 3; } else if ($reglevel >= 2) { $accesslvl = 2; } $categories[] = JHTML::_('select.option', '0', JTEXT::_('COM_MATUKIO_CHOOSE_CATEGORY')); // $database->setQuery( "SELECT id AS value, title AS text, image AS image FROM #__categories". " WHERE extension='".JFactory::getApplication()->input->get('option')."'" ); $database->setQuery("Select id AS value, title AS text FROM #__categories WHERE extension='com_matukio'"); $dats = $database->loadObjectList(); $categories = array_merge($categories, (array)$dats); $clist = JHTML::_('select.genericlist', $categories, 'caid', 'class="sem_inputbox" size="1"', 'value', 'text', intval($catid)); $ilist = array(); foreach ((array)$dats as $el) { $el->image = ""; $bild = ""; if ($el->image != "") { $bild->id = $el->value; $bild->image = $el->image; $ilist[] = $bild; } } return array($clist, $ilist); } // +++++++++++++++++++++++++++++++++++++++++++++++ // +++ Templateliste erstellen +++ sem_f057 // +++++++++++++++++++++++++++++++++++++++++++++++ public static function getTemplateListSelect($vorlage, $art) { $html = ""; $database = JFactory::getDBO(); $my = JFactory::getuser(); $where = array(); // Nur veroeffentlichte Kurse anzeigen $where[] = "published = '1'"; $where[] = "pattern != ''"; $where[] = "publisher = '" . $my->id . "'"; // nur Kurse anzeigen, deren Kategorie fuer den Benutzer erlaubt ist $reglevel = MatukioHelperUtilsBasic::getUserLevel(); $accesslvl = 1; if ($reglevel >= 6) { $accesslvl = 3; } else if ($reglevel >= 2) { $accesslvl = 2; } $database->setQuery("SELECT id, access FROM #__categories WHERE extension='" . JFactory::getApplication()->input->get('option') . "'"); $cats = $database->loadObjectList(); $allowedcat = array(); $allowedcat[] = 0; foreach ((array)$cats AS $cat) { if ($cat->access < $accesslvl) { $allowedcat[] = $cat->id; } } if (count($allowedcat) > 0) { $allowedcat = implode(',', $allowedcat); $where[] = "catid IN ($allowedcat)"; } $database->setQuery("SELECT * FROM #__matukio" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nORDER BY pattern" ); $rows = $database->loadObjectList(); $patterns = array(); $patterns[] = JHTML::_('select.option', '', JTEXT::_('COM_MATUKIO_CHOOSE_TEMPLATE')); foreach ($rows AS $row) { $patterns[] = JHTML::_('select.option', $row->id, $row->pattern); } $htxt = JTEXT::_('COM_MATUKIO_TEMPLATE') . ": "; $disabled = ""; if ($vorlage == 0) { $disabled = " disabled"; } if ($art == 1) { if (count($patterns) > 1) { $htxt .= JHTML::_('select.genericlist', $patterns, 'vorlage', 'class="sem_inputbox" size="1" onChange="form.cid.value=form.vorlage.value;form.task.value=9;form.submit();"', 'value', 'text', $vorlage); $htxt .= " "; } else { $htxt .= ""; } $htxt .= " "; $htxt .= " "; $html = "

"; $options = array( 'onActive' => 'function(title, description){ description.setStyle("display", "block"); title.addClass("open").removeClass("closed"); }', 'onBackground' => 'function(title, description){ description.setStyle("display", "none"); title.addClass("closed").removeClass("open"); }', 'allowAllClose' => false, 'startOffset' => 0, // 0 starts on the first tab, 1 starts the second, etc$ 'useCookie' => true, // this must not be a string. Don't use quotes. ); $html .= JHtml::_('sliders.start', 'mat_group', $options); // echo "WTF"; //$html .= $pane->startPane('pane'); //$html .= Html::_('sliders.panel'); // ### Panel 1 ### //$html .= $pane->startPanel(JTEXT::_('COM_MATUKIO_BASIC_SETTINGS'), 'panel1'); $html .= JHtml::_('sliders.panel', JText::_( 'COM_MATUKIO_BASIC_SETTINGS' ), 'panel1' ); $html .= ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_SETTINGS_NEEDED'), 'd', 'l', '100%', 'sem_edit', 2) . ""; // Vorlagenname und Besitzer if ($art == 3) { $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_TEMPLATE') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell( "pattern . "\" />" . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_OWNER') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell(MatukioHelperUtilsEvents::getOranizerList($row->publisher) . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; $reqfield = ""; } // ID der Veranstaltung if ($row->id < 1) { $htxt = JTEXT::_('COM_MATUKIO_ID_NOT_CREATED'); $htx2 = JTEXT::_('COM_MATUKIO_SHOULD_REGISTERED_USERS_RECEIVE_MAIL'); $htx3 = JTEXT::_('COM_MATUKIO_NEW_EVENT_PUBLISHED_INTERESTED_SEE_HOMEPAGE'); $htx4 = ""; $htx5 = " checked=\"checked\""; } else { $htxt = $row->id; $htx2 = JTEXT::_('COM_MATUKIO_INFORM_PER_EMAIL'); $htx3 = JTEXT::_('COM_MATUKIO_EVENTS_DATAS_CHANGED'); if ($row->cancelled == 0) { $htx4 = ""; $htx5 = " checked=\"checked\""; if ($art != 3) { $htx4 = " onClick=\"infotext.value='" . JTEXT::_('COM_MATUKIO_ORGANISER_CANCELLED') . "'\""; $htx5 = " onClick=\"infotext.value='" . JTEXT::_('COM_MATUKIO_EVENTS_DATAS_CHANGED') . "'\"" . $htx5; } } else { $htx4 = " checked=\"checked\""; $htx5 = ""; if ($art != 3) { $htx4 = " onClick=\"infotext.value='" . JTEXT::_('COM_MATUKIO_EVENTS_DATAS_CHANGED') . "'\"" . $htx4; $htx5 = " onClick=\"infotext.value='" . JTEXT::_('COM_MATUKIO_ORGANISER_HAS_REPUBLISHED_EVENT') . "'\""; } } } $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_ID') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_AUTO_ID')), 'd', 'r', '20%', 'sem_edit'); $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; // Kursnummer $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_NUMBER') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_UNIQUE_NUMBER')), 'd', 'r', '20%', 'sem_edit'); $html .= MatukioHelperUtilsEvents::getTableCell("semnum . "\" />" . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; // Abgesagt $htxt = ""; $html .= "\n" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_CANCELLED') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_CANCELLED_EVENT_NO_BOOKINGS')), 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt . $reqfield, 'd', 'l', '80%', 'sem_edit') . "cancelled . "\">"; // Titel $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_TITLE') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell("title . "\" />" . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; // Kategorie $htxt = $catlist[0]; if (MatukioHelperSettings::getSettings('event_image', 1) == 1) { foreach ($catlist[1] as $el) { $htxt .= "id . "\" value=\"" . $el->image . "\">"; } } $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_CATEGORY') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_EVENT_ASSIGNED_CATEGORY')), 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; $radios = array(); $radios[] = JHTML::_('select.option', 1, JTEXT::_('COM_MATUKIO_YES')); $radios[] = JHTML::_('select.option', 0, JTEXT::_('COM_MATUKIO_NO')); if($row->showbegin == "") { $row->showbegin = 1; } if($row->showend == "") { $row->showend = 1; } if($row->showbooked == "") { $row->showbooked = 1; } // Veranstaltungsbeginn $htxt = JHTML::_('calendar', JHtml::_('date',$row->begin, 'Y-m-d H:i:s'), '_begin_date', '_begin_date', '%Y-%m-%d %H:%M:%S', array('class' => 'inputbox', 'size' => '22')); $htxt .= $reqfield . " - " . JTEXT::_('COM_MATUKIO_DISPLAY') . " " . JHTML::_('select.radiolist', $radios, 'showbegin', 'class="sem_inputbox"', 'value', 'text', $row->showbegin); $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BEGIN') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_DATE_TIME_FORMAT')), 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; // Veranstaltungsende $htxt = JHTML::_('calendar', JHtml::_('date',$row->end, 'Y-m-d H:i:s'), '_end_date', '_end_date', '%Y-%m-%d %H:%M:%S', array('class' => 'inputbox', 'size' => '22')); $htxt .= $reqfield . " - " . JTEXT::_('COM_MATUKIO_DISPLAY') . " " . JHTML::_('select.radiolist', $radios, 'showend', 'class="sem_inputbox"', 'value', 'text', $row->showend); $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_END') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_DATE_TIME_FORMAT')), 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; // Anmeldeschluss $htxt = JHTML::_('calendar', JHtml::_('date',$row->booked, 'Y-m-d H:i:s'), '_booked_date', '_booked_date', '%Y-%m-%d %H:%M:%S', array('class' => 'inputbox', 'size' => '22', 'filter' => 'USER_UTC')); $htxt .= $reqfield . " - " . JTEXT::_('COM_MATUKIO_DISPLAY') . " " . JHTML::_('select.radiolist', $radios, 'showbooked', 'class="sem_inputbox"', 'value', 'text', $row->showbooked); $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_CLOSING_DATE') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_DATE_TIME_FORMAT')), 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; // Kurzbeschreibung $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_BRIEF_DESCRIPTION') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_BRIEF_DESCRIPTION_DESC')), 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell("" . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; // Veranstaltungsort $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_CITY') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell("" . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; // Veranstalter if ($art != 3) { $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_ORGANISER') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_ORGANISER_MANAGE_FRONTEND')), 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell(MatukioHelperUtilsEvents::getOranizerList($row->publisher) . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; } if($row->webinar == 0) { $webinar = ""; } else { $webinar = ""; } $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_WEBINAR') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($webinar, 'd', 'l', '80%', 'sem_edit') . ""; // Plätze $htxt = "maxpupil . "\" /> - " . JTEXT::_('COM_MATUKIO_IF_FULLY_BOOKED') . ": "; $radios = array(); $radios[] = JHTML::_('select.option', 0, JTEXT::_('COM_MATUKIO_WAITLIST')); $radios[] = JHTML::_('select.option', 1, JTEXT::_('COM_MATUKIO_END_BOOKING')); $radios[] = JHTML::_('select.option', 2, JTEXT::_('COM_MATUKIO_HIDE_EVENT')); $htxt .= JHTML::_('select.genericlist', $radios, 'stopbooking', 'class="sem_inputbox" ', 'value', 'text', $row->stopbooking); $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_MAX_PARTICIPANT') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; // max. Buchung $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_MAX_BOOKABLE_PLACES') . ':' . MatukioHelperUtilsBasic::createToolTip(JTEXT::_('COM_MATUKIO_CANNOT_BOOK_ONLINE')), 'd', 'r', '20%', 'sem_edit'); $bookableplaces = $row->nrbooked; if($bookableplaces == "") { $bookableplaces = 1; } if (MatukioHelperSettings::getSettings('frontend_usermehrereplaetze', 2) > 0) { $htxt = ""; } else { $radios = array(); $radios[] = JHTML::_('select.option', 0, "0"); $radios[] = JHTML::_('select.option', 1, "1"); $htxt = JHTML::_('select.genericlist', $radios, 'nrbooked', 'class="sem_inputbox" ', 'value', 'text', $row->nrbooked); } $html .= MatukioHelperUtilsEvents::getTableCell($htxt . $reqfield, 'd', 'l', '80%', 'sem_edit') . ""; $html .= "
"; //$html .= $pane->endPanel(); // ### Panel 2 ### //$html .= $pane->startPanel(JTEXT::_('COM_MATUKIO_ADDITIONAL_SETTINGS'), 'panel2'); $html .= JHtml::_('sliders.panel', JText::_( 'COM_MATUKIO_ADDITIONAL_SETTINGS' ), 'panel2' ); $html .= ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_ADDITIONAL_SETTINGS_DESC'), 'd', 'l', '100%', 'sem_edit', 2) . ""; // Beschreibung $name = "editor1"; $htxt = $editor->display("description", $row->description, "500", "300", "50", "5"); $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_DESCRIPTION') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_USE_FOLLOWING_TAGS') . $htxt, 'd', 'l', '80%', 'sem_edit') . ""; // Veranstaltungsbild if (MatukioHelperSettings::getSettings('event_image', 1) == 1) { jimport('joomla.filesystem.folder'); $htxt = ""; if (MatukioHelperSettings::getSettings('image_path', '') != "") { $htxt = trim(MatukioHelperSettings::getSettings('image_path', ''), "/") . "/"; } $htxt = JPATH_SITE . "/images/" . $htxt; if (!is_dir($htxt)) { mkdir($htxt, 0755); } $imageFiles = JFolder::files($htxt); $images = array(JHTML::_('select.option', '', '- ' . JText::_('COM_MATUKIO_STANDARD_IMAGE') . ' -')); foreach ($imageFiles as $file) { if (preg_match("/jpg|png|gif/i", $file)) { $images[] = JHTML::_('select.option', $file); } } $imagelist = JHTML::_('select.genericlist', $images, 'image', 'class="sem_inputbox" size="1" ', 'value', 'text', $row->image); $htxt = ""; $htxt .= $imagelist . " "; // $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_IMAGE_FOR_OVERVIEW') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; } // Google-Map $htxt = "gmaploc . "\" /> "; $actform = "FrontForm"; $gmaphref = JURI::BASE(); if (strstr($gmaphref, "/administrator")) { $actform = "adminForm"; } // TODO implement map function with js // $maplink = JRoute::_('index.php?option=com_matukio&view=map&tmpl=component&event_id='.$this->event->id); // // $htxt .= "'));\" rel=\"{handler: 'iframe', size: {x: 500, y: 350}}\">" // . JTEXT::_('COM_MATUKIO_TEST_GMPAS') . ""; // // $knopfoben .= "event->id ) // . "\" rel=\"{handler: 'iframe', size: {x: 500, y: 350}}\">" . JTEXT::_('COM_MATUKIO_TEST_GMPAS') . ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_GMAPS_LOCATION') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; // Leitung $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_TUTOR') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell("teacher . "\" />", 'd', 'l', '80%', 'sem_edit') . ""; // Zielgruppe $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_TARGET_GROUP') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell("target . "\" />", 'd', 'l', '80%', 'sem_edit') . ""; // Gebuehr $htxt = MatukioHelperSettings::getSettings('currency_symbol', '$') . " fees . "\" />"; if (MatukioHelperSettings::getSettings('frontend_usermehrereplaetze', 2) > 0) { $htxt .= " " . JTEXT::_('COM_MATUKIO_PRO_PERSON'); } $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_FEES') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; // Top event $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_TOP_EVENT') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell(JHTML::_("select.booleanlist", "top_event", 'class="mat_inputbox"', $row->top_event), 'd', 'l', '80%', 'sem_edit') . ""; // Hot event $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_HOT_EVENT') . ':', 'd', 'r', '20%', 'sem_edit') . MatukioHelperUtilsEvents::getTableCell(JHTML::_("select.booleanlist", "hot_event", 'class="mat_inputbox"', $row->hot_event), 'd', 'l', '80%', 'sem_edit') . ""; $html .= "
"; // ### Panel 3 ### $html .= JHtml::_('sliders.panel', JText::_( 'COM_MATUKIO_GENERAL_INPUT_FIELDS' ), 'panel3' ); $html .= ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_FILLED_IN_ONCE') . "
 
" . JTEXT::_('COM_MATUKIO_FIELD_INPUT_SPECIFIED') . "
 
" . JTEXT::_('COM_MATUKIO_FIELD_TIPS_SPECIFIED') . "
 
", 'd', 'l', '100%', 'sem_edit', 2) . ""; // Zusatzfelder $zusfeld = MatukioHelperUtilsEvents::getAdditionalFieldsFrontend($row); if(!empty($zusfeld)) { for ($i = 0; $i < count($zusfeld[0]); $i++) { $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_INPUT') . " " . ($i + 1) . ":", 'd', 'r', '20%', 'sem_edit'); $htxt = ""; $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(" ", 'd', 'r', '20%', 'sem_edit'); if(!empty($zusfeld[1])){ $htxt = JTEXT::_('COM_MATUKIO_FIELD_TIP') . ": "; $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; } $html .= "" . MatukioHelperUtilsEvents::getTableCell(" ", 'd', 'r', '20%', 'sem_edit'); $radios = array(); $radios[] = JHTML::_('select.option', 1, JTEXT::_('COM_MATUKIO_YES')); $radios[] = JHTML::_('select.option', 0, JTEXT::_('COM_MATUKIO_NO')); $htxt = str_replace("SEM_FNUM", $i + 1, JTEXT::_('COM_MATUKIO_DISPLAY_SEM_FNUM')); if(!empty($zusfeld[2])){ $htxt = $htxt . " " . JHTML::_('select.radiolist', $radios, 'zusatz' . ($i + 1) . 'show', 'class="sem_inputbox" ', 'value', 'text', $zusfeld[2][$i]); $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; } } } $html .= "
"; //$html .= $pane->endPanel(); // ### Panel 5 ### if (MatukioHelperSettings::getSettings('file_maxsize', 500) > 0) { //$html .= $pane->startPanel(JTEXT::_('COM_MATUKIO_FILES'), 'panel4'); $html .= JHtml::_('sliders.panel', JText::_( 'COM_MATUKIO_FILES' ), 'panel4' ); $htxt = str_replace("SEM_FILESIZE", MatukioHelperSettings::getSettings('file_maxsize', 500), JTEXT::_('COM_MATUKIO_FILE_SIZE_UP_TO')); $htxt = str_replace("SEM_FILETYPES", strtoupper(MatukioHelperSettings::getSettings('file_endings', 'txt pdf zip jpg')), $htxt); $html .= ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '100%', 'sem_edit', 2) . ""; $datfeld = MatukioHelperUtilsEvents::getEventFileArray($row); $select = array(); $select[] = JHTML::_('select.option', 0, JTEXT::_('COM_MATUKIO_EVERYONE')); $select[] = JHTML::_('select.option', 1, JTEXT::_('COM_MATUKIO_REGISTERED_USERS')); $select[] = JHTML::_('select.option', 2, JTEXT::_('COM_MATUKIO_USERS_BOOKED_EVENT')); $select[] = JHTML::_('select.option', 3, JTEXT::_('COM_MATUKIO_USERS_PAID_FOR_EVENT')); for ($i = 0; $i < count($datfeld[0]); $i++) { $html .= "" . MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_FILE') . " " . ($i + 1) . ":", 'd', 'r', '20%', 'sem_edit'); if ($datfeld[0][$i] != "") { $htxt = "" . $datfeld[0][$i] . " - " . JTEXT::_('COM_MATUKIO_DELETE_FILE'); $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(" ", 'd', 'r', '20%', 'sem_edit'); } $htxt = ""; $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(" ", 'd', 'r', '20%', 'sem_edit'); $htxt = JTEXT::_('COM_MATUKIO_DESCRIPTION') . ": "; $html .= MatukioHelperUtilsEvents::getTableCell($htxt, 'd', 'l', '80%', 'sem_edit') . ""; $html .= "" . MatukioHelperUtilsEvents::getTableCell(" ", 'd', 'r', '20%', 'sem_edit'); $htxt = JHTML::_('select.genericlist', $select, 'file' . ($i + 1) . 'down', 'class="sem_inputbox" ', 'value', 'text', $datfeld[2][$i]); $html .= MatukioHelperUtilsEvents::getTableCell(JTEXT::_('COM_MATUKIO_WHO_MAY_DOWNLOAD') . " " . $htxt, 'd', 'l', '80%', 'sem_edit') . ""; } $html .= "
"; // $html .= $pane->endPanel(); } $html .= JHtml::_('sliders.panel', JText::_( 'COM_MATUKIO_OVERRIDES' ), 'panel5' ); $editor = JFactory::getEditor(); $html .= ""; $html .= ""; $html .= ""; $html .= ""; $html .= ""; $html .= ""; $html .= "
" . JText::_("COM_MATUKIO_OVERRIDES_INTRO") . "
" . JText::_("COM_MATUKIO_CUSTOM_BOOKING_MAIL_TEXT") . ":
" . $editor->display("booking_mail", $row->booking_mail, 800, 300, 40, 20, 1) . "
" . JText::_("COM_MATUKIO_CUSTOM_CERTIFICATE_CODE") . ":
" . $editor->display("certificate_code", $row->certificate_code, 800, 300, 40, 20, 1) . "
"; //$html .= $pane->endPane(); $html .= JHtml::_('sliders.end'); $html .= "\n