#0 | App\Models\Tree->ancestorsAndSelf /var/www/vhosts/bdv-service.de/app/Controllers/Web/ContentController.php (233) <?php namespace App\Controllers\Web; use Phery\Phery; use Phery\PheryResponse; use App\Models\Tree; use App\Models\Content; // index use App\Models\News; // models use App\Models\Team; use App\Models\Kosten; use App\Models\Snippet; use App\Models\Partner; use App\Models\Kontakt; use App\Models\Formular; use App\Models\Beratung; use App\Models\Broschuere; use App\Models\Mitarbeiter; use App\Models\FacebookPost; use App\Models\TwitterTweet; use App\Models\FaqKategorie; use App\Models\Versicherung; use App\Models\Stellenangebot; use App\Models\FaqSubkategorie; use App\Models\BroschuereListe; use App\Models\MusterbriefListe; // system and helper use App\Helper\FilterSegment; use App\Controllers\Web\BaseController; // widgets use App\Widgets\Web\MitgliedLoginWidget; // plugins use App\Plugins\Web\Suche as SuchePlugin; use App\Plugins\Web\Logout as LogoutPlugin; use App\Plugins\Web\Kontakt as KontaktPlugin; use App\Plugins\Web\Beratung as BeratungPlugin; use App\Plugins\Web\Bewerbung as BewerbungPlugin; use App\Plugins\Web\Schaden as SchadenPlugin; use App\Plugins\Web\Broschuere as BroschuerePlugin; use App\Plugins\Web\QuickConnect as QuickConnectPlugin; use App\Plugins\Web\BedarfsCheck as BedarfsCheckPlugin; use App\Plugins\Web\ContentPopup as ContentPopupPlugin; use App\Plugins\Web\MitgliedLogin as MitgliedLoginPlugin; class ContentController extends BaseController { public function indexAction() { parent::setBaseValues(); $footer_text = Snippet::getSnippetTextByPerma("FooterText"); $this->view->setVar('footer_text', $footer_text); if (!Phery::is_ajax()) { $this->setView(); } elseif (!$this->isIndex() and (!$this->setContent() or !$this->isValidNavi())) { // ToDo: phery error } else { $phery_request = $this->request->getPost('phery'); $remote = array_get($phery_request, "remote"); $this->setPhery($remote); } } private function setView() { $this->view->setVar("Content", null); $this->view->setVar('page_arg', false); $this->view->setVar("param", $this->param); $this->view->setVar("cookie", ($this->cookies->has("cookie-check") ? true : false)); if ($this->isIndex() and !$this->setIndex()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isIndex() and !$this->setContent()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isValidNavi()) { $this->redirToIndex(); } if ($this->Content) { $this->Content->parseContentText(); $this->view->setVar("Content", $this->Content); $this->view->setVar("is_mitglied", $this->is_mitglied); $this->view->setVar('is_bedingungen', false); parent::setTreeNavis(); if ($this->isIndex()) { $this->view->setVar("is_index", true); $this->setViewIndexVars(); } if (strlen($this->Content->layout_id) and ($Layout = $this->Content->getLayout())) { //die("1".$this->Content->id); $this->view->setLayout($Layout->volt_file); } if (strlen($this->Content->versicherung_id) and ($this->Versicherung = $this->Content->getVersicherung())) { $this->setViewVersicherungVars($this->Versicherung); } if (strlen($this->Content->liste_id) and ($this->Liste = $this->Content->getListe())) { $this->setViewListeVars($this->Liste); } if (strlen($this->Content->modul_id) and ($this->Modul = $this->Content->getModul())) { $this->setViewModulVars($this->Modul); $this->procModulAction($this->Modul); } $this->setMetaTitle(); $this->setMetaKeywords(); $this->setMetaDescription(); if (!$this->isIndex() and !$this->isValidArgs()) { $this->get404Page(); } } } private function isIndex() { if (empty($this->perma)) { return true; } return false; } private function setIndex() { return $this->Content = Content::getContentIndex(); } private function setContent() { if ($this->setNavi() and $this->isValidPath()) { return $this->Content = $this->Navi->getContent(); } return false; } private function setNavi() { $anz_folders = count($this->folders); if (!is_array($this->folders) or $anz_folders == 0) { return false; } elseif (($this->Navi = Tree::findNaviByPermaAndDepth($this->perma, ($anz_folders + 1)))) { if (count($this->args) == 0) { $this->args = null; } return true; } return $this->setArgs(); } private function setArgs() { $args = array_pop($this->folders); array_unshift($this->args, $args); $this->perma = end($this->folders); return $this->setNavi(); } private function isValidArgs() { if (!$this->args) { return true; } elseif ($this->Modul) { if ("Broschuere" == $this->Modul->modul_class and count($this->args) <= 2) { return true; } elseif ("Musterbrief" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } elseif ("Beratung" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } } elseif ($this->Liste) { if ("Faq" == $this->Liste->liste_class and count($this->args) <= 3) { return true; } } elseif ($this->Versicherung) { if (count($this->args) <= 1 and "formulare-bedingungen" === array_get($this->args, 0)) { return true; } elseif (count($this->args) <= 1 and "unterlagen-bestellen" === array_get($this->args, 0)) { return true; } } return false; } private function isValidNavi() { if (empty($this->perma)) { return true; } elseif ("nein" == $this->Navi->is_protected) { return true; } elseif ("ja" == $this->Navi->is_protected and !$this->is_mitglied) { return false; } elseif ("nor" == $this->Navi->is_protected and $this->is_mitglied) { return false; } return true; } private function isValidPath() { $node_ary = []; if (($nodes = $this->Navi->ancestorsAndSelf())) { foreach ($nodes as $Node) { $node_ary[] = $Node->node_perma; } return true; #return ($this->folders === $node_ary); } return false; } private function setViewIndexVars() { if (($news = self::getNewsPage())) { $this->view->setVar("news", $news); } if (($facebookPosts = FacebookPost::getFacebookPosts())) { $this->view->setVar("facebook_posts", $facebookPosts); } else { $facebookPosts = []; } if (($twitterTweets = TwitterTweet::getTwitterTweets())) { $this->view->setVar("twitter_tweets", $twitterTweets); } else { $twitterTweets = []; } } private function setViewListeVars($Liste) { $this->view->setVar("Liste", $Liste); if ("Team" == $Liste->liste_class) { if (($PageObj = self::getTeamPage())) { $this->view->setVar('team', $PageObj); } } elseif ("Mitarbeiter" == $Liste->liste_class) { if (($PageObj = self::getMitarbeiterPage())) { $this->view->setVar('mitarbeiter', $PageObj); } } elseif ("Kosten" == $Liste->liste_class) { if (($PageObj = self::getKostenPage())) { $this->view->setVar('kosten', $PageObj); } } elseif ("Stellenangebot" == $Liste->liste_class) { if (($PageObj = self::getStellenangebotPage())) { $this->view->setVar('stellenangebot', $PageObj); } } elseif ("Partner" == $Liste->liste_class) { if (($PageObj = self::getPartnerPage())) { $this->view->setVar('partner', $PageObj); } } elseif ("Faq" == $Liste->liste_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $subkategorie_filter = $FilterSegments->subkategorie_filter; $this->view->setVar('kategorie_filter', false); $this->view->setVar('subkategorie_filter', false); $this->view->setVar('kategorie_ary', FaqKategorie::getFaqKategoriePage()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($Kategorie = FaqKategorie::getKategorieByPerma($kategorie_filter))) { $this->view->setVar('Kategorie', $Kategorie); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('subkategorie_ary', $Kategorie->subkategorien); if ($subkategorie_filter and ($Subkategorie = FaqSubkategorie::getSubkategorieByPerma($subkategorie_filter))) { $this->view->setVar('subkategorie_filter', $subkategorie_filter); $this->view->setVar('Subkategorie', $Subkategorie); } } } } private function setViewModulVars($Modul) { if (strlen($Modul->modul_template)) { $this->view->setVar("Modul", $Modul); } if ("Suche" == $Modul->modul_class) { $search_string = $this->request->getPost("search_string"); $Suche = new SuchePlugin(); $Suche->setPathAry($this->path_ary); $this->view->setVar("search_string", $search_string); $this->view->setVar("search_result", $Suche->getSearchResultByPostRequest($search_string)); } elseif ("Musterbrief" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('kategorie_filter', "alle"); $this->view->setVar('liste_ary', MusterbriefListe::getMusterbriefListen()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and $PageObj = self::getMusterbriefListePage($FilterSegments)) { $this->view->setVar('musterbrief_liste', $PageObj); $this->view->setVar('kategorie_filter', $FilterSegments->kategorie_filter); } else { $this->view->setVar('musterbrief_liste', self::getMusterbriefListePage()); } $this->view->setVar('hat_beliebte_musterbriefe', false); if (MusterbriefListe::getMusterbriefListen(["is_beliebt" => true])) { $this->view->setVar('hat_beliebte_musterbriefe', true); } } elseif ("Broschuere" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('broschuere_ok', 'Test'); $this->view->setVar('kategorie_filter', false); $this->view->setVar('liste_ary', BroschuereListe::getBroschuereListen([])); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($BroschuereListe = BroschuereListe::getListeByPerma($kategorie_filter))) { $this->view->setVar('BroschuereListe', $BroschuereListe); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('broschuere_ary', Broschuere::getBroschuerePage(["liste_id" => $BroschuereListe->getKey(), "is_online" => "ja"])); } } elseif ("Beratung" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $perma = null; $Beratung = null; $beratungen = null; $this->view->setVar('perma', $perma); $this->view->setVar('Beratung', $Beratung); $this->view->setVar('beratungen', $beratungen); $this->view->setVar("versicherungen", Versicherung::find(["order" => "name"])); if (($beratungen = self::getBeratungPage())) { if (!$perma = $FilterSegments->kategorie_filter) { $perma = $beratungen->getFirst()->perma; } $this->view->setVar('beratungen', $beratungen); $this->view->setVar('perma', $perma); } if ($perma) { if (($this->Beratung = Beratung::findFirst('perma = "' . $perma . '"'))) { $this->view->setVar('Beratung', $this->Beratung); } else { $this->get404Page(); } } $this->view->setVar('page_link', '/' . implode("/", $this->folders)); } elseif ("Kontakt" === $Modul->modul_class) { $this->view->setVar('anliegen', []); if (($anliegen = Kontakt::find(["order" => "pos"]))) { $this->view->setVar('anliegen', $anliegen); } } elseif ("Bewerbung" === $Modul->modul_class) { $this->view->setVar('widerruf', ""); $this->view->setVar('stellenangebote', []); if (($stellenangebote = self::getStellenangebotPage()) and $stellenangebote->count()) { $this->view->setVar('stellenangebote', self::getStellenangebotPage()); } if (($widerruf = Snippet::getSnippetTextByPerma("BewerbungWiderruf"))) { $this->view->setVar('widerruf', strip_tags($widerruf, "<a>")); } } } private function setViewVersicherungVars($Versicherung) { $this->view->setVar('page_arg', false); $this->view->setVar('calc_plugin', false); $this->view->setVar('is_bedingungen', false); $this->view->setVar("Versicherung", $Versicherung); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($this->args and count($this->args) == 1) { if ("formulare-bedingungen" === array_get($this->args, 0)) { $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } elseif ("unterlagen-bestellen" === array_get($this->args, 0)) { $Snippet = Snippet::findFirst(["snippet_perma = 'BoxUnterlagenBestellung'"]); $this->view->setVar('BoxUnterlagenBestellung', $Snippet->snippet_text); $this->view->setVar('unterlagen_bestellen_bool', true); $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } } else { $class_name = $Versicherung->class; $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class)) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); $this->view->setVar('calc_plugin', $Rechenkern->getForm()); } } } private function procModulAction($Modul) { if ("Logout" === $Modul->modul_class) { (new LogoutPlugin())->procAction(); } } /* * Pages */ private static function getNewsPage() { $args = ["limit" => 3]; return News::getNewsPage($args); } private static function getKostenPage() { return Kosten::find(["order" => "pos"]); } private static function getPartnerPage() { $args = ["is_online" => "ja"]; return Partner::getPartnerPage($args); } private static function getBeratungPage() { $args = ["is_online" => "ja"]; return Beratung::getBeratungPage($args); } private static function getMitarbeiterPage() { $args = ["is_online" => "ja"]; return Mitarbeiter::getMitarbeiterPage($args); } private static function getTeamPage() { $args = ["is_online" => "ja"]; return Team::getTeamPage($args); } private static function getStellenangebotPage() { $args = ["is_online" => "ja"]; return Stellenangebot::getStellenangebotPage($args); } private static function getMusterbriefListePage($FilterSegments = null) { $args = []; if ($FilterSegments) { if ("beliebteste" == $FilterSegments->kategorie_filter) { array_set($args, "is_beliebt", "ja"); } else { array_set($args, "liste_perma", $FilterSegments->kategorie_filter); } } return MusterbriefListe::getMusterbriefListePage($args); } /* * phery action */ public function procKontaktForm($args) { return (new KontaktPlugin())->procAction($args); } public function procBewerbungForm($args) { return (new BewerbungPlugin())->procAction($args); } public function procBeratungForm($args) { return (new BeratungPlugin())->procAction($args); } public function procSchadenForm($args) { return (new SchadenPlugin())->procAction($args); } public function procBedarfsCheckForm($args) { return (new BedarfsCheckPlugin())->procAction($args); } public function procQuickConnectForm($args) { return (new QuickConnectPlugin())->procAction($args); } public function procBroschuereForm($args) { return (new BroschuerePlugin())->procAction($args); } public function procSucheForm($args) { parent::setTreeNavis(); $SuchePlugin = new SuchePlugin(); $SuchePlugin->setPathAry($this->path_ary); return $SuchePlugin->procAction($args); } public function procGetMitgliedLoginForm() { $request_uri = strtok($this->request->getURI(), "?"); return (new MitgliedLoginWidget())->getForm($request_uri); } public function procSendMitgliedLoginForm($args) { return (new MitgliedLoginPlugin())->procAction($args); } public function procIsLoggedIn() { $tmp_ary = ["status" => $this->is_mitglied]; return PheryResponse::factory()->json($tmp_ary); } public function procSendCalcForm($args) { if (($class_name = array_get($args, "calc_typ"))) { $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class) and ($Versicherung = Versicherung::findFirst("class = '" . $class_name . "'"))) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); return $Rechenkern->getBerechnung($args); } } } /* * formulare */ public function procButtonBeratung($args) { $Phry = PheryResponse::factory(); $id = intval(array_get($args, "id")); if (($Formular = Formular::findFirst($id))) { $out = ''; $out .= '<div id="formular-result">'; $out .= '<a onclick="removeElmt(\'formular-result\');" id="close-formular-result" href="javascript:void(0);">×</a>'; $out .= $Formular->text_beratung; $out .= '</div>'; $Phry->jquery("#formular-result")->remove(); $Phry->jquery("#content-popup-container")->append($out); } return $Phry; } /* * stuff */ public function procGetContentPopup($args) { $Phry = (new ContentPopupPlugin())->procAction($args); return $Phry; } public function procSetCookieCheck() { $time = time() + 15 * 86400; setcookie("cookie-check", "ja", $time); } /* * Phery */ private function setPhery($remote = null) { $Phry = Phery::instance(); if ("kontakt" === $remote) { $Phry->set([$remote => [$this, 'procKontaktForm']]); } elseif ("bewerbung" == $remote) { $Phry->set([$remote => [$this, 'procBewerbungForm']]); } elseif ("broschuere" === $remote) { $Phry->set([$remote => [$this, 'procBroschuereForm']]); } elseif ("beratung" === $remote) { $Phry->set([$remote => [$this, 'procBeratungForm']]); } elseif ("schadenmelden" === $remote) { $Phry->set([$remote => [$this, 'procSchadenForm']]); } elseif ("bedarfscheck" === $remote) { $Phry->set([$remote => [$this, 'procBedarfsCheckForm']]); } elseif ("quick_connect" === $remote) { $Phry->set([$remote => [$this, 'procQuickConnectForm']]); } elseif ("send_suche_form" === $remote) { $Phry->set([$remote => [$this, 'procSucheForm']]); } // mitglied login stuff elseif ("get_login_form" === $remote) { $Phry->set([$remote => [$this, 'procGetMitgliedLoginForm']]); } elseif ("send_login_form" === $remote) { $Phry->set([$remote => [$this, 'procSendMitgliedLoginForm']]); } elseif ("is_logged_in" === $remote) { $Phry->set([$remote => [$this, 'procIsLoggedIn']]); } // Rechenkerne elseif ("send_calc_form" === $remote) { $Phry->set([$remote => [$this, 'procSendCalcForm']]); } // Formulare elseif ("button_beratung" === $remote) { $Phry->set([$remote => [$this, 'procButtonBeratung']]); } // stuff elseif ("get_content_popup" === $remote) { $Phry->set([$remote => [$this, 'procGetContentPopup']]); } elseif ("set_cookie_check" === $remote) { $Phry->set([$remote => [$this, 'procSetCookieCheck']]); } $Phry->process(); } } |
#1 | App\Controllers\Web\ContentController->isValidPath /var/www/vhosts/bdv-service.de/app/Controllers/Web/ContentController.php (154) <?php namespace App\Controllers\Web; use Phery\Phery; use Phery\PheryResponse; use App\Models\Tree; use App\Models\Content; // index use App\Models\News; // models use App\Models\Team; use App\Models\Kosten; use App\Models\Snippet; use App\Models\Partner; use App\Models\Kontakt; use App\Models\Formular; use App\Models\Beratung; use App\Models\Broschuere; use App\Models\Mitarbeiter; use App\Models\FacebookPost; use App\Models\TwitterTweet; use App\Models\FaqKategorie; use App\Models\Versicherung; use App\Models\Stellenangebot; use App\Models\FaqSubkategorie; use App\Models\BroschuereListe; use App\Models\MusterbriefListe; // system and helper use App\Helper\FilterSegment; use App\Controllers\Web\BaseController; // widgets use App\Widgets\Web\MitgliedLoginWidget; // plugins use App\Plugins\Web\Suche as SuchePlugin; use App\Plugins\Web\Logout as LogoutPlugin; use App\Plugins\Web\Kontakt as KontaktPlugin; use App\Plugins\Web\Beratung as BeratungPlugin; use App\Plugins\Web\Bewerbung as BewerbungPlugin; use App\Plugins\Web\Schaden as SchadenPlugin; use App\Plugins\Web\Broschuere as BroschuerePlugin; use App\Plugins\Web\QuickConnect as QuickConnectPlugin; use App\Plugins\Web\BedarfsCheck as BedarfsCheckPlugin; use App\Plugins\Web\ContentPopup as ContentPopupPlugin; use App\Plugins\Web\MitgliedLogin as MitgliedLoginPlugin; class ContentController extends BaseController { public function indexAction() { parent::setBaseValues(); $footer_text = Snippet::getSnippetTextByPerma("FooterText"); $this->view->setVar('footer_text', $footer_text); if (!Phery::is_ajax()) { $this->setView(); } elseif (!$this->isIndex() and (!$this->setContent() or !$this->isValidNavi())) { // ToDo: phery error } else { $phery_request = $this->request->getPost('phery'); $remote = array_get($phery_request, "remote"); $this->setPhery($remote); } } private function setView() { $this->view->setVar("Content", null); $this->view->setVar('page_arg', false); $this->view->setVar("param", $this->param); $this->view->setVar("cookie", ($this->cookies->has("cookie-check") ? true : false)); if ($this->isIndex() and !$this->setIndex()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isIndex() and !$this->setContent()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isValidNavi()) { $this->redirToIndex(); } if ($this->Content) { $this->Content->parseContentText(); $this->view->setVar("Content", $this->Content); $this->view->setVar("is_mitglied", $this->is_mitglied); $this->view->setVar('is_bedingungen', false); parent::setTreeNavis(); if ($this->isIndex()) { $this->view->setVar("is_index", true); $this->setViewIndexVars(); } if (strlen($this->Content->layout_id) and ($Layout = $this->Content->getLayout())) { //die("1".$this->Content->id); $this->view->setLayout($Layout->volt_file); } if (strlen($this->Content->versicherung_id) and ($this->Versicherung = $this->Content->getVersicherung())) { $this->setViewVersicherungVars($this->Versicherung); } if (strlen($this->Content->liste_id) and ($this->Liste = $this->Content->getListe())) { $this->setViewListeVars($this->Liste); } if (strlen($this->Content->modul_id) and ($this->Modul = $this->Content->getModul())) { $this->setViewModulVars($this->Modul); $this->procModulAction($this->Modul); } $this->setMetaTitle(); $this->setMetaKeywords(); $this->setMetaDescription(); if (!$this->isIndex() and !$this->isValidArgs()) { $this->get404Page(); } } } private function isIndex() { if (empty($this->perma)) { return true; } return false; } private function setIndex() { return $this->Content = Content::getContentIndex(); } private function setContent() { if ($this->setNavi() and $this->isValidPath()) { return $this->Content = $this->Navi->getContent(); } return false; } private function setNavi() { $anz_folders = count($this->folders); if (!is_array($this->folders) or $anz_folders == 0) { return false; } elseif (($this->Navi = Tree::findNaviByPermaAndDepth($this->perma, ($anz_folders + 1)))) { if (count($this->args) == 0) { $this->args = null; } return true; } return $this->setArgs(); } private function setArgs() { $args = array_pop($this->folders); array_unshift($this->args, $args); $this->perma = end($this->folders); return $this->setNavi(); } private function isValidArgs() { if (!$this->args) { return true; } elseif ($this->Modul) { if ("Broschuere" == $this->Modul->modul_class and count($this->args) <= 2) { return true; } elseif ("Musterbrief" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } elseif ("Beratung" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } } elseif ($this->Liste) { if ("Faq" == $this->Liste->liste_class and count($this->args) <= 3) { return true; } } elseif ($this->Versicherung) { if (count($this->args) <= 1 and "formulare-bedingungen" === array_get($this->args, 0)) { return true; } elseif (count($this->args) <= 1 and "unterlagen-bestellen" === array_get($this->args, 0)) { return true; } } return false; } private function isValidNavi() { if (empty($this->perma)) { return true; } elseif ("nein" == $this->Navi->is_protected) { return true; } elseif ("ja" == $this->Navi->is_protected and !$this->is_mitglied) { return false; } elseif ("nor" == $this->Navi->is_protected and $this->is_mitglied) { return false; } return true; } private function isValidPath() { $node_ary = []; if (($nodes = $this->Navi->ancestorsAndSelf())) { foreach ($nodes as $Node) { $node_ary[] = $Node->node_perma; } return true; #return ($this->folders === $node_ary); } return false; } private function setViewIndexVars() { if (($news = self::getNewsPage())) { $this->view->setVar("news", $news); } if (($facebookPosts = FacebookPost::getFacebookPosts())) { $this->view->setVar("facebook_posts", $facebookPosts); } else { $facebookPosts = []; } if (($twitterTweets = TwitterTweet::getTwitterTweets())) { $this->view->setVar("twitter_tweets", $twitterTweets); } else { $twitterTweets = []; } } private function setViewListeVars($Liste) { $this->view->setVar("Liste", $Liste); if ("Team" == $Liste->liste_class) { if (($PageObj = self::getTeamPage())) { $this->view->setVar('team', $PageObj); } } elseif ("Mitarbeiter" == $Liste->liste_class) { if (($PageObj = self::getMitarbeiterPage())) { $this->view->setVar('mitarbeiter', $PageObj); } } elseif ("Kosten" == $Liste->liste_class) { if (($PageObj = self::getKostenPage())) { $this->view->setVar('kosten', $PageObj); } } elseif ("Stellenangebot" == $Liste->liste_class) { if (($PageObj = self::getStellenangebotPage())) { $this->view->setVar('stellenangebot', $PageObj); } } elseif ("Partner" == $Liste->liste_class) { if (($PageObj = self::getPartnerPage())) { $this->view->setVar('partner', $PageObj); } } elseif ("Faq" == $Liste->liste_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $subkategorie_filter = $FilterSegments->subkategorie_filter; $this->view->setVar('kategorie_filter', false); $this->view->setVar('subkategorie_filter', false); $this->view->setVar('kategorie_ary', FaqKategorie::getFaqKategoriePage()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($Kategorie = FaqKategorie::getKategorieByPerma($kategorie_filter))) { $this->view->setVar('Kategorie', $Kategorie); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('subkategorie_ary', $Kategorie->subkategorien); if ($subkategorie_filter and ($Subkategorie = FaqSubkategorie::getSubkategorieByPerma($subkategorie_filter))) { $this->view->setVar('subkategorie_filter', $subkategorie_filter); $this->view->setVar('Subkategorie', $Subkategorie); } } } } private function setViewModulVars($Modul) { if (strlen($Modul->modul_template)) { $this->view->setVar("Modul", $Modul); } if ("Suche" == $Modul->modul_class) { $search_string = $this->request->getPost("search_string"); $Suche = new SuchePlugin(); $Suche->setPathAry($this->path_ary); $this->view->setVar("search_string", $search_string); $this->view->setVar("search_result", $Suche->getSearchResultByPostRequest($search_string)); } elseif ("Musterbrief" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('kategorie_filter', "alle"); $this->view->setVar('liste_ary', MusterbriefListe::getMusterbriefListen()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and $PageObj = self::getMusterbriefListePage($FilterSegments)) { $this->view->setVar('musterbrief_liste', $PageObj); $this->view->setVar('kategorie_filter', $FilterSegments->kategorie_filter); } else { $this->view->setVar('musterbrief_liste', self::getMusterbriefListePage()); } $this->view->setVar('hat_beliebte_musterbriefe', false); if (MusterbriefListe::getMusterbriefListen(["is_beliebt" => true])) { $this->view->setVar('hat_beliebte_musterbriefe', true); } } elseif ("Broschuere" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('broschuere_ok', 'Test'); $this->view->setVar('kategorie_filter', false); $this->view->setVar('liste_ary', BroschuereListe::getBroschuereListen([])); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($BroschuereListe = BroschuereListe::getListeByPerma($kategorie_filter))) { $this->view->setVar('BroschuereListe', $BroschuereListe); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('broschuere_ary', Broschuere::getBroschuerePage(["liste_id" => $BroschuereListe->getKey(), "is_online" => "ja"])); } } elseif ("Beratung" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $perma = null; $Beratung = null; $beratungen = null; $this->view->setVar('perma', $perma); $this->view->setVar('Beratung', $Beratung); $this->view->setVar('beratungen', $beratungen); $this->view->setVar("versicherungen", Versicherung::find(["order" => "name"])); if (($beratungen = self::getBeratungPage())) { if (!$perma = $FilterSegments->kategorie_filter) { $perma = $beratungen->getFirst()->perma; } $this->view->setVar('beratungen', $beratungen); $this->view->setVar('perma', $perma); } if ($perma) { if (($this->Beratung = Beratung::findFirst('perma = "' . $perma . '"'))) { $this->view->setVar('Beratung', $this->Beratung); } else { $this->get404Page(); } } $this->view->setVar('page_link', '/' . implode("/", $this->folders)); } elseif ("Kontakt" === $Modul->modul_class) { $this->view->setVar('anliegen', []); if (($anliegen = Kontakt::find(["order" => "pos"]))) { $this->view->setVar('anliegen', $anliegen); } } elseif ("Bewerbung" === $Modul->modul_class) { $this->view->setVar('widerruf', ""); $this->view->setVar('stellenangebote', []); if (($stellenangebote = self::getStellenangebotPage()) and $stellenangebote->count()) { $this->view->setVar('stellenangebote', self::getStellenangebotPage()); } if (($widerruf = Snippet::getSnippetTextByPerma("BewerbungWiderruf"))) { $this->view->setVar('widerruf', strip_tags($widerruf, "<a>")); } } } private function setViewVersicherungVars($Versicherung) { $this->view->setVar('page_arg', false); $this->view->setVar('calc_plugin', false); $this->view->setVar('is_bedingungen', false); $this->view->setVar("Versicherung", $Versicherung); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($this->args and count($this->args) == 1) { if ("formulare-bedingungen" === array_get($this->args, 0)) { $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } elseif ("unterlagen-bestellen" === array_get($this->args, 0)) { $Snippet = Snippet::findFirst(["snippet_perma = 'BoxUnterlagenBestellung'"]); $this->view->setVar('BoxUnterlagenBestellung', $Snippet->snippet_text); $this->view->setVar('unterlagen_bestellen_bool', true); $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } } else { $class_name = $Versicherung->class; $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class)) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); $this->view->setVar('calc_plugin', $Rechenkern->getForm()); } } } private function procModulAction($Modul) { if ("Logout" === $Modul->modul_class) { (new LogoutPlugin())->procAction(); } } /* * Pages */ private static function getNewsPage() { $args = ["limit" => 3]; return News::getNewsPage($args); } private static function getKostenPage() { return Kosten::find(["order" => "pos"]); } private static function getPartnerPage() { $args = ["is_online" => "ja"]; return Partner::getPartnerPage($args); } private static function getBeratungPage() { $args = ["is_online" => "ja"]; return Beratung::getBeratungPage($args); } private static function getMitarbeiterPage() { $args = ["is_online" => "ja"]; return Mitarbeiter::getMitarbeiterPage($args); } private static function getTeamPage() { $args = ["is_online" => "ja"]; return Team::getTeamPage($args); } private static function getStellenangebotPage() { $args = ["is_online" => "ja"]; return Stellenangebot::getStellenangebotPage($args); } private static function getMusterbriefListePage($FilterSegments = null) { $args = []; if ($FilterSegments) { if ("beliebteste" == $FilterSegments->kategorie_filter) { array_set($args, "is_beliebt", "ja"); } else { array_set($args, "liste_perma", $FilterSegments->kategorie_filter); } } return MusterbriefListe::getMusterbriefListePage($args); } /* * phery action */ public function procKontaktForm($args) { return (new KontaktPlugin())->procAction($args); } public function procBewerbungForm($args) { return (new BewerbungPlugin())->procAction($args); } public function procBeratungForm($args) { return (new BeratungPlugin())->procAction($args); } public function procSchadenForm($args) { return (new SchadenPlugin())->procAction($args); } public function procBedarfsCheckForm($args) { return (new BedarfsCheckPlugin())->procAction($args); } public function procQuickConnectForm($args) { return (new QuickConnectPlugin())->procAction($args); } public function procBroschuereForm($args) { return (new BroschuerePlugin())->procAction($args); } public function procSucheForm($args) { parent::setTreeNavis(); $SuchePlugin = new SuchePlugin(); $SuchePlugin->setPathAry($this->path_ary); return $SuchePlugin->procAction($args); } public function procGetMitgliedLoginForm() { $request_uri = strtok($this->request->getURI(), "?"); return (new MitgliedLoginWidget())->getForm($request_uri); } public function procSendMitgliedLoginForm($args) { return (new MitgliedLoginPlugin())->procAction($args); } public function procIsLoggedIn() { $tmp_ary = ["status" => $this->is_mitglied]; return PheryResponse::factory()->json($tmp_ary); } public function procSendCalcForm($args) { if (($class_name = array_get($args, "calc_typ"))) { $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class) and ($Versicherung = Versicherung::findFirst("class = '" . $class_name . "'"))) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); return $Rechenkern->getBerechnung($args); } } } /* * formulare */ public function procButtonBeratung($args) { $Phry = PheryResponse::factory(); $id = intval(array_get($args, "id")); if (($Formular = Formular::findFirst($id))) { $out = ''; $out .= '<div id="formular-result">'; $out .= '<a onclick="removeElmt(\'formular-result\');" id="close-formular-result" href="javascript:void(0);">×</a>'; $out .= $Formular->text_beratung; $out .= '</div>'; $Phry->jquery("#formular-result")->remove(); $Phry->jquery("#content-popup-container")->append($out); } return $Phry; } /* * stuff */ public function procGetContentPopup($args) { $Phry = (new ContentPopupPlugin())->procAction($args); return $Phry; } public function procSetCookieCheck() { $time = time() + 15 * 86400; setcookie("cookie-check", "ja", $time); } /* * Phery */ private function setPhery($remote = null) { $Phry = Phery::instance(); if ("kontakt" === $remote) { $Phry->set([$remote => [$this, 'procKontaktForm']]); } elseif ("bewerbung" == $remote) { $Phry->set([$remote => [$this, 'procBewerbungForm']]); } elseif ("broschuere" === $remote) { $Phry->set([$remote => [$this, 'procBroschuereForm']]); } elseif ("beratung" === $remote) { $Phry->set([$remote => [$this, 'procBeratungForm']]); } elseif ("schadenmelden" === $remote) { $Phry->set([$remote => [$this, 'procSchadenForm']]); } elseif ("bedarfscheck" === $remote) { $Phry->set([$remote => [$this, 'procBedarfsCheckForm']]); } elseif ("quick_connect" === $remote) { $Phry->set([$remote => [$this, 'procQuickConnectForm']]); } elseif ("send_suche_form" === $remote) { $Phry->set([$remote => [$this, 'procSucheForm']]); } // mitglied login stuff elseif ("get_login_form" === $remote) { $Phry->set([$remote => [$this, 'procGetMitgliedLoginForm']]); } elseif ("send_login_form" === $remote) { $Phry->set([$remote => [$this, 'procSendMitgliedLoginForm']]); } elseif ("is_logged_in" === $remote) { $Phry->set([$remote => [$this, 'procIsLoggedIn']]); } // Rechenkerne elseif ("send_calc_form" === $remote) { $Phry->set([$remote => [$this, 'procSendCalcForm']]); } // Formulare elseif ("button_beratung" === $remote) { $Phry->set([$remote => [$this, 'procButtonBeratung']]); } // stuff elseif ("get_content_popup" === $remote) { $Phry->set([$remote => [$this, 'procGetContentPopup']]); } elseif ("set_cookie_check" === $remote) { $Phry->set([$remote => [$this, 'procSetCookieCheck']]); } $Phry->process(); } } |
#2 | App\Controllers\Web\ContentController->setContent /var/www/vhosts/bdv-service.de/app/Controllers/Web/ContentController.php (90) <?php namespace App\Controllers\Web; use Phery\Phery; use Phery\PheryResponse; use App\Models\Tree; use App\Models\Content; // index use App\Models\News; // models use App\Models\Team; use App\Models\Kosten; use App\Models\Snippet; use App\Models\Partner; use App\Models\Kontakt; use App\Models\Formular; use App\Models\Beratung; use App\Models\Broschuere; use App\Models\Mitarbeiter; use App\Models\FacebookPost; use App\Models\TwitterTweet; use App\Models\FaqKategorie; use App\Models\Versicherung; use App\Models\Stellenangebot; use App\Models\FaqSubkategorie; use App\Models\BroschuereListe; use App\Models\MusterbriefListe; // system and helper use App\Helper\FilterSegment; use App\Controllers\Web\BaseController; // widgets use App\Widgets\Web\MitgliedLoginWidget; // plugins use App\Plugins\Web\Suche as SuchePlugin; use App\Plugins\Web\Logout as LogoutPlugin; use App\Plugins\Web\Kontakt as KontaktPlugin; use App\Plugins\Web\Beratung as BeratungPlugin; use App\Plugins\Web\Bewerbung as BewerbungPlugin; use App\Plugins\Web\Schaden as SchadenPlugin; use App\Plugins\Web\Broschuere as BroschuerePlugin; use App\Plugins\Web\QuickConnect as QuickConnectPlugin; use App\Plugins\Web\BedarfsCheck as BedarfsCheckPlugin; use App\Plugins\Web\ContentPopup as ContentPopupPlugin; use App\Plugins\Web\MitgliedLogin as MitgliedLoginPlugin; class ContentController extends BaseController { public function indexAction() { parent::setBaseValues(); $footer_text = Snippet::getSnippetTextByPerma("FooterText"); $this->view->setVar('footer_text', $footer_text); if (!Phery::is_ajax()) { $this->setView(); } elseif (!$this->isIndex() and (!$this->setContent() or !$this->isValidNavi())) { // ToDo: phery error } else { $phery_request = $this->request->getPost('phery'); $remote = array_get($phery_request, "remote"); $this->setPhery($remote); } } private function setView() { $this->view->setVar("Content", null); $this->view->setVar('page_arg', false); $this->view->setVar("param", $this->param); $this->view->setVar("cookie", ($this->cookies->has("cookie-check") ? true : false)); if ($this->isIndex() and !$this->setIndex()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isIndex() and !$this->setContent()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isValidNavi()) { $this->redirToIndex(); } if ($this->Content) { $this->Content->parseContentText(); $this->view->setVar("Content", $this->Content); $this->view->setVar("is_mitglied", $this->is_mitglied); $this->view->setVar('is_bedingungen', false); parent::setTreeNavis(); if ($this->isIndex()) { $this->view->setVar("is_index", true); $this->setViewIndexVars(); } if (strlen($this->Content->layout_id) and ($Layout = $this->Content->getLayout())) { //die("1".$this->Content->id); $this->view->setLayout($Layout->volt_file); } if (strlen($this->Content->versicherung_id) and ($this->Versicherung = $this->Content->getVersicherung())) { $this->setViewVersicherungVars($this->Versicherung); } if (strlen($this->Content->liste_id) and ($this->Liste = $this->Content->getListe())) { $this->setViewListeVars($this->Liste); } if (strlen($this->Content->modul_id) and ($this->Modul = $this->Content->getModul())) { $this->setViewModulVars($this->Modul); $this->procModulAction($this->Modul); } $this->setMetaTitle(); $this->setMetaKeywords(); $this->setMetaDescription(); if (!$this->isIndex() and !$this->isValidArgs()) { $this->get404Page(); } } } private function isIndex() { if (empty($this->perma)) { return true; } return false; } private function setIndex() { return $this->Content = Content::getContentIndex(); } private function setContent() { if ($this->setNavi() and $this->isValidPath()) { return $this->Content = $this->Navi->getContent(); } return false; } private function setNavi() { $anz_folders = count($this->folders); if (!is_array($this->folders) or $anz_folders == 0) { return false; } elseif (($this->Navi = Tree::findNaviByPermaAndDepth($this->perma, ($anz_folders + 1)))) { if (count($this->args) == 0) { $this->args = null; } return true; } return $this->setArgs(); } private function setArgs() { $args = array_pop($this->folders); array_unshift($this->args, $args); $this->perma = end($this->folders); return $this->setNavi(); } private function isValidArgs() { if (!$this->args) { return true; } elseif ($this->Modul) { if ("Broschuere" == $this->Modul->modul_class and count($this->args) <= 2) { return true; } elseif ("Musterbrief" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } elseif ("Beratung" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } } elseif ($this->Liste) { if ("Faq" == $this->Liste->liste_class and count($this->args) <= 3) { return true; } } elseif ($this->Versicherung) { if (count($this->args) <= 1 and "formulare-bedingungen" === array_get($this->args, 0)) { return true; } elseif (count($this->args) <= 1 and "unterlagen-bestellen" === array_get($this->args, 0)) { return true; } } return false; } private function isValidNavi() { if (empty($this->perma)) { return true; } elseif ("nein" == $this->Navi->is_protected) { return true; } elseif ("ja" == $this->Navi->is_protected and !$this->is_mitglied) { return false; } elseif ("nor" == $this->Navi->is_protected and $this->is_mitglied) { return false; } return true; } private function isValidPath() { $node_ary = []; if (($nodes = $this->Navi->ancestorsAndSelf())) { foreach ($nodes as $Node) { $node_ary[] = $Node->node_perma; } return true; #return ($this->folders === $node_ary); } return false; } private function setViewIndexVars() { if (($news = self::getNewsPage())) { $this->view->setVar("news", $news); } if (($facebookPosts = FacebookPost::getFacebookPosts())) { $this->view->setVar("facebook_posts", $facebookPosts); } else { $facebookPosts = []; } if (($twitterTweets = TwitterTweet::getTwitterTweets())) { $this->view->setVar("twitter_tweets", $twitterTweets); } else { $twitterTweets = []; } } private function setViewListeVars($Liste) { $this->view->setVar("Liste", $Liste); if ("Team" == $Liste->liste_class) { if (($PageObj = self::getTeamPage())) { $this->view->setVar('team', $PageObj); } } elseif ("Mitarbeiter" == $Liste->liste_class) { if (($PageObj = self::getMitarbeiterPage())) { $this->view->setVar('mitarbeiter', $PageObj); } } elseif ("Kosten" == $Liste->liste_class) { if (($PageObj = self::getKostenPage())) { $this->view->setVar('kosten', $PageObj); } } elseif ("Stellenangebot" == $Liste->liste_class) { if (($PageObj = self::getStellenangebotPage())) { $this->view->setVar('stellenangebot', $PageObj); } } elseif ("Partner" == $Liste->liste_class) { if (($PageObj = self::getPartnerPage())) { $this->view->setVar('partner', $PageObj); } } elseif ("Faq" == $Liste->liste_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $subkategorie_filter = $FilterSegments->subkategorie_filter; $this->view->setVar('kategorie_filter', false); $this->view->setVar('subkategorie_filter', false); $this->view->setVar('kategorie_ary', FaqKategorie::getFaqKategoriePage()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($Kategorie = FaqKategorie::getKategorieByPerma($kategorie_filter))) { $this->view->setVar('Kategorie', $Kategorie); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('subkategorie_ary', $Kategorie->subkategorien); if ($subkategorie_filter and ($Subkategorie = FaqSubkategorie::getSubkategorieByPerma($subkategorie_filter))) { $this->view->setVar('subkategorie_filter', $subkategorie_filter); $this->view->setVar('Subkategorie', $Subkategorie); } } } } private function setViewModulVars($Modul) { if (strlen($Modul->modul_template)) { $this->view->setVar("Modul", $Modul); } if ("Suche" == $Modul->modul_class) { $search_string = $this->request->getPost("search_string"); $Suche = new SuchePlugin(); $Suche->setPathAry($this->path_ary); $this->view->setVar("search_string", $search_string); $this->view->setVar("search_result", $Suche->getSearchResultByPostRequest($search_string)); } elseif ("Musterbrief" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('kategorie_filter', "alle"); $this->view->setVar('liste_ary', MusterbriefListe::getMusterbriefListen()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and $PageObj = self::getMusterbriefListePage($FilterSegments)) { $this->view->setVar('musterbrief_liste', $PageObj); $this->view->setVar('kategorie_filter', $FilterSegments->kategorie_filter); } else { $this->view->setVar('musterbrief_liste', self::getMusterbriefListePage()); } $this->view->setVar('hat_beliebte_musterbriefe', false); if (MusterbriefListe::getMusterbriefListen(["is_beliebt" => true])) { $this->view->setVar('hat_beliebte_musterbriefe', true); } } elseif ("Broschuere" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('broschuere_ok', 'Test'); $this->view->setVar('kategorie_filter', false); $this->view->setVar('liste_ary', BroschuereListe::getBroschuereListen([])); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($BroschuereListe = BroschuereListe::getListeByPerma($kategorie_filter))) { $this->view->setVar('BroschuereListe', $BroschuereListe); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('broschuere_ary', Broschuere::getBroschuerePage(["liste_id" => $BroschuereListe->getKey(), "is_online" => "ja"])); } } elseif ("Beratung" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $perma = null; $Beratung = null; $beratungen = null; $this->view->setVar('perma', $perma); $this->view->setVar('Beratung', $Beratung); $this->view->setVar('beratungen', $beratungen); $this->view->setVar("versicherungen", Versicherung::find(["order" => "name"])); if (($beratungen = self::getBeratungPage())) { if (!$perma = $FilterSegments->kategorie_filter) { $perma = $beratungen->getFirst()->perma; } $this->view->setVar('beratungen', $beratungen); $this->view->setVar('perma', $perma); } if ($perma) { if (($this->Beratung = Beratung::findFirst('perma = "' . $perma . '"'))) { $this->view->setVar('Beratung', $this->Beratung); } else { $this->get404Page(); } } $this->view->setVar('page_link', '/' . implode("/", $this->folders)); } elseif ("Kontakt" === $Modul->modul_class) { $this->view->setVar('anliegen', []); if (($anliegen = Kontakt::find(["order" => "pos"]))) { $this->view->setVar('anliegen', $anliegen); } } elseif ("Bewerbung" === $Modul->modul_class) { $this->view->setVar('widerruf', ""); $this->view->setVar('stellenangebote', []); if (($stellenangebote = self::getStellenangebotPage()) and $stellenangebote->count()) { $this->view->setVar('stellenangebote', self::getStellenangebotPage()); } if (($widerruf = Snippet::getSnippetTextByPerma("BewerbungWiderruf"))) { $this->view->setVar('widerruf', strip_tags($widerruf, "<a>")); } } } private function setViewVersicherungVars($Versicherung) { $this->view->setVar('page_arg', false); $this->view->setVar('calc_plugin', false); $this->view->setVar('is_bedingungen', false); $this->view->setVar("Versicherung", $Versicherung); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($this->args and count($this->args) == 1) { if ("formulare-bedingungen" === array_get($this->args, 0)) { $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } elseif ("unterlagen-bestellen" === array_get($this->args, 0)) { $Snippet = Snippet::findFirst(["snippet_perma = 'BoxUnterlagenBestellung'"]); $this->view->setVar('BoxUnterlagenBestellung', $Snippet->snippet_text); $this->view->setVar('unterlagen_bestellen_bool', true); $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } } else { $class_name = $Versicherung->class; $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class)) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); $this->view->setVar('calc_plugin', $Rechenkern->getForm()); } } } private function procModulAction($Modul) { if ("Logout" === $Modul->modul_class) { (new LogoutPlugin())->procAction(); } } /* * Pages */ private static function getNewsPage() { $args = ["limit" => 3]; return News::getNewsPage($args); } private static function getKostenPage() { return Kosten::find(["order" => "pos"]); } private static function getPartnerPage() { $args = ["is_online" => "ja"]; return Partner::getPartnerPage($args); } private static function getBeratungPage() { $args = ["is_online" => "ja"]; return Beratung::getBeratungPage($args); } private static function getMitarbeiterPage() { $args = ["is_online" => "ja"]; return Mitarbeiter::getMitarbeiterPage($args); } private static function getTeamPage() { $args = ["is_online" => "ja"]; return Team::getTeamPage($args); } private static function getStellenangebotPage() { $args = ["is_online" => "ja"]; return Stellenangebot::getStellenangebotPage($args); } private static function getMusterbriefListePage($FilterSegments = null) { $args = []; if ($FilterSegments) { if ("beliebteste" == $FilterSegments->kategorie_filter) { array_set($args, "is_beliebt", "ja"); } else { array_set($args, "liste_perma", $FilterSegments->kategorie_filter); } } return MusterbriefListe::getMusterbriefListePage($args); } /* * phery action */ public function procKontaktForm($args) { return (new KontaktPlugin())->procAction($args); } public function procBewerbungForm($args) { return (new BewerbungPlugin())->procAction($args); } public function procBeratungForm($args) { return (new BeratungPlugin())->procAction($args); } public function procSchadenForm($args) { return (new SchadenPlugin())->procAction($args); } public function procBedarfsCheckForm($args) { return (new BedarfsCheckPlugin())->procAction($args); } public function procQuickConnectForm($args) { return (new QuickConnectPlugin())->procAction($args); } public function procBroschuereForm($args) { return (new BroschuerePlugin())->procAction($args); } public function procSucheForm($args) { parent::setTreeNavis(); $SuchePlugin = new SuchePlugin(); $SuchePlugin->setPathAry($this->path_ary); return $SuchePlugin->procAction($args); } public function procGetMitgliedLoginForm() { $request_uri = strtok($this->request->getURI(), "?"); return (new MitgliedLoginWidget())->getForm($request_uri); } public function procSendMitgliedLoginForm($args) { return (new MitgliedLoginPlugin())->procAction($args); } public function procIsLoggedIn() { $tmp_ary = ["status" => $this->is_mitglied]; return PheryResponse::factory()->json($tmp_ary); } public function procSendCalcForm($args) { if (($class_name = array_get($args, "calc_typ"))) { $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class) and ($Versicherung = Versicherung::findFirst("class = '" . $class_name . "'"))) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); return $Rechenkern->getBerechnung($args); } } } /* * formulare */ public function procButtonBeratung($args) { $Phry = PheryResponse::factory(); $id = intval(array_get($args, "id")); if (($Formular = Formular::findFirst($id))) { $out = ''; $out .= '<div id="formular-result">'; $out .= '<a onclick="removeElmt(\'formular-result\');" id="close-formular-result" href="javascript:void(0);">×</a>'; $out .= $Formular->text_beratung; $out .= '</div>'; $Phry->jquery("#formular-result")->remove(); $Phry->jquery("#content-popup-container")->append($out); } return $Phry; } /* * stuff */ public function procGetContentPopup($args) { $Phry = (new ContentPopupPlugin())->procAction($args); return $Phry; } public function procSetCookieCheck() { $time = time() + 15 * 86400; setcookie("cookie-check", "ja", $time); } /* * Phery */ private function setPhery($remote = null) { $Phry = Phery::instance(); if ("kontakt" === $remote) { $Phry->set([$remote => [$this, 'procKontaktForm']]); } elseif ("bewerbung" == $remote) { $Phry->set([$remote => [$this, 'procBewerbungForm']]); } elseif ("broschuere" === $remote) { $Phry->set([$remote => [$this, 'procBroschuereForm']]); } elseif ("beratung" === $remote) { $Phry->set([$remote => [$this, 'procBeratungForm']]); } elseif ("schadenmelden" === $remote) { $Phry->set([$remote => [$this, 'procSchadenForm']]); } elseif ("bedarfscheck" === $remote) { $Phry->set([$remote => [$this, 'procBedarfsCheckForm']]); } elseif ("quick_connect" === $remote) { $Phry->set([$remote => [$this, 'procQuickConnectForm']]); } elseif ("send_suche_form" === $remote) { $Phry->set([$remote => [$this, 'procSucheForm']]); } // mitglied login stuff elseif ("get_login_form" === $remote) { $Phry->set([$remote => [$this, 'procGetMitgliedLoginForm']]); } elseif ("send_login_form" === $remote) { $Phry->set([$remote => [$this, 'procSendMitgliedLoginForm']]); } elseif ("is_logged_in" === $remote) { $Phry->set([$remote => [$this, 'procIsLoggedIn']]); } // Rechenkerne elseif ("send_calc_form" === $remote) { $Phry->set([$remote => [$this, 'procSendCalcForm']]); } // Formulare elseif ("button_beratung" === $remote) { $Phry->set([$remote => [$this, 'procButtonBeratung']]); } // stuff elseif ("get_content_popup" === $remote) { $Phry->set([$remote => [$this, 'procGetContentPopup']]); } elseif ("set_cookie_check" === $remote) { $Phry->set([$remote => [$this, 'procSetCookieCheck']]); } $Phry->process(); } } |
#3 | App\Controllers\Web\ContentController->setView /var/www/vhosts/bdv-service.de/app/Controllers/Web/ContentController.php (66) <?php namespace App\Controllers\Web; use Phery\Phery; use Phery\PheryResponse; use App\Models\Tree; use App\Models\Content; // index use App\Models\News; // models use App\Models\Team; use App\Models\Kosten; use App\Models\Snippet; use App\Models\Partner; use App\Models\Kontakt; use App\Models\Formular; use App\Models\Beratung; use App\Models\Broschuere; use App\Models\Mitarbeiter; use App\Models\FacebookPost; use App\Models\TwitterTweet; use App\Models\FaqKategorie; use App\Models\Versicherung; use App\Models\Stellenangebot; use App\Models\FaqSubkategorie; use App\Models\BroschuereListe; use App\Models\MusterbriefListe; // system and helper use App\Helper\FilterSegment; use App\Controllers\Web\BaseController; // widgets use App\Widgets\Web\MitgliedLoginWidget; // plugins use App\Plugins\Web\Suche as SuchePlugin; use App\Plugins\Web\Logout as LogoutPlugin; use App\Plugins\Web\Kontakt as KontaktPlugin; use App\Plugins\Web\Beratung as BeratungPlugin; use App\Plugins\Web\Bewerbung as BewerbungPlugin; use App\Plugins\Web\Schaden as SchadenPlugin; use App\Plugins\Web\Broschuere as BroschuerePlugin; use App\Plugins\Web\QuickConnect as QuickConnectPlugin; use App\Plugins\Web\BedarfsCheck as BedarfsCheckPlugin; use App\Plugins\Web\ContentPopup as ContentPopupPlugin; use App\Plugins\Web\MitgliedLogin as MitgliedLoginPlugin; class ContentController extends BaseController { public function indexAction() { parent::setBaseValues(); $footer_text = Snippet::getSnippetTextByPerma("FooterText"); $this->view->setVar('footer_text', $footer_text); if (!Phery::is_ajax()) { $this->setView(); } elseif (!$this->isIndex() and (!$this->setContent() or !$this->isValidNavi())) { // ToDo: phery error } else { $phery_request = $this->request->getPost('phery'); $remote = array_get($phery_request, "remote"); $this->setPhery($remote); } } private function setView() { $this->view->setVar("Content", null); $this->view->setVar('page_arg', false); $this->view->setVar("param", $this->param); $this->view->setVar("cookie", ($this->cookies->has("cookie-check") ? true : false)); if ($this->isIndex() and !$this->setIndex()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isIndex() and !$this->setContent()) { parent::setTreeNavis(); $this->get404Page(); } elseif (!$this->isValidNavi()) { $this->redirToIndex(); } if ($this->Content) { $this->Content->parseContentText(); $this->view->setVar("Content", $this->Content); $this->view->setVar("is_mitglied", $this->is_mitglied); $this->view->setVar('is_bedingungen', false); parent::setTreeNavis(); if ($this->isIndex()) { $this->view->setVar("is_index", true); $this->setViewIndexVars(); } if (strlen($this->Content->layout_id) and ($Layout = $this->Content->getLayout())) { //die("1".$this->Content->id); $this->view->setLayout($Layout->volt_file); } if (strlen($this->Content->versicherung_id) and ($this->Versicherung = $this->Content->getVersicherung())) { $this->setViewVersicherungVars($this->Versicherung); } if (strlen($this->Content->liste_id) and ($this->Liste = $this->Content->getListe())) { $this->setViewListeVars($this->Liste); } if (strlen($this->Content->modul_id) and ($this->Modul = $this->Content->getModul())) { $this->setViewModulVars($this->Modul); $this->procModulAction($this->Modul); } $this->setMetaTitle(); $this->setMetaKeywords(); $this->setMetaDescription(); if (!$this->isIndex() and !$this->isValidArgs()) { $this->get404Page(); } } } private function isIndex() { if (empty($this->perma)) { return true; } return false; } private function setIndex() { return $this->Content = Content::getContentIndex(); } private function setContent() { if ($this->setNavi() and $this->isValidPath()) { return $this->Content = $this->Navi->getContent(); } return false; } private function setNavi() { $anz_folders = count($this->folders); if (!is_array($this->folders) or $anz_folders == 0) { return false; } elseif (($this->Navi = Tree::findNaviByPermaAndDepth($this->perma, ($anz_folders + 1)))) { if (count($this->args) == 0) { $this->args = null; } return true; } return $this->setArgs(); } private function setArgs() { $args = array_pop($this->folders); array_unshift($this->args, $args); $this->perma = end($this->folders); return $this->setNavi(); } private function isValidArgs() { if (!$this->args) { return true; } elseif ($this->Modul) { if ("Broschuere" == $this->Modul->modul_class and count($this->args) <= 2) { return true; } elseif ("Musterbrief" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } elseif ("Beratung" == $this->Modul->modul_class and count($this->args) <= 3) { return true; } } elseif ($this->Liste) { if ("Faq" == $this->Liste->liste_class and count($this->args) <= 3) { return true; } } elseif ($this->Versicherung) { if (count($this->args) <= 1 and "formulare-bedingungen" === array_get($this->args, 0)) { return true; } elseif (count($this->args) <= 1 and "unterlagen-bestellen" === array_get($this->args, 0)) { return true; } } return false; } private function isValidNavi() { if (empty($this->perma)) { return true; } elseif ("nein" == $this->Navi->is_protected) { return true; } elseif ("ja" == $this->Navi->is_protected and !$this->is_mitglied) { return false; } elseif ("nor" == $this->Navi->is_protected and $this->is_mitglied) { return false; } return true; } private function isValidPath() { $node_ary = []; if (($nodes = $this->Navi->ancestorsAndSelf())) { foreach ($nodes as $Node) { $node_ary[] = $Node->node_perma; } return true; #return ($this->folders === $node_ary); } return false; } private function setViewIndexVars() { if (($news = self::getNewsPage())) { $this->view->setVar("news", $news); } if (($facebookPosts = FacebookPost::getFacebookPosts())) { $this->view->setVar("facebook_posts", $facebookPosts); } else { $facebookPosts = []; } if (($twitterTweets = TwitterTweet::getTwitterTweets())) { $this->view->setVar("twitter_tweets", $twitterTweets); } else { $twitterTweets = []; } } private function setViewListeVars($Liste) { $this->view->setVar("Liste", $Liste); if ("Team" == $Liste->liste_class) { if (($PageObj = self::getTeamPage())) { $this->view->setVar('team', $PageObj); } } elseif ("Mitarbeiter" == $Liste->liste_class) { if (($PageObj = self::getMitarbeiterPage())) { $this->view->setVar('mitarbeiter', $PageObj); } } elseif ("Kosten" == $Liste->liste_class) { if (($PageObj = self::getKostenPage())) { $this->view->setVar('kosten', $PageObj); } } elseif ("Stellenangebot" == $Liste->liste_class) { if (($PageObj = self::getStellenangebotPage())) { $this->view->setVar('stellenangebot', $PageObj); } } elseif ("Partner" == $Liste->liste_class) { if (($PageObj = self::getPartnerPage())) { $this->view->setVar('partner', $PageObj); } } elseif ("Faq" == $Liste->liste_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $subkategorie_filter = $FilterSegments->subkategorie_filter; $this->view->setVar('kategorie_filter', false); $this->view->setVar('subkategorie_filter', false); $this->view->setVar('kategorie_ary', FaqKategorie::getFaqKategoriePage()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($Kategorie = FaqKategorie::getKategorieByPerma($kategorie_filter))) { $this->view->setVar('Kategorie', $Kategorie); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('subkategorie_ary', $Kategorie->subkategorien); if ($subkategorie_filter and ($Subkategorie = FaqSubkategorie::getSubkategorieByPerma($subkategorie_filter))) { $this->view->setVar('subkategorie_filter', $subkategorie_filter); $this->view->setVar('Subkategorie', $Subkategorie); } } } } private function setViewModulVars($Modul) { if (strlen($Modul->modul_template)) { $this->view->setVar("Modul", $Modul); } if ("Suche" == $Modul->modul_class) { $search_string = $this->request->getPost("search_string"); $Suche = new SuchePlugin(); $Suche->setPathAry($this->path_ary); $this->view->setVar("search_string", $search_string); $this->view->setVar("search_result", $Suche->getSearchResultByPostRequest($search_string)); } elseif ("Musterbrief" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('kategorie_filter', "alle"); $this->view->setVar('liste_ary', MusterbriefListe::getMusterbriefListen()); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and $PageObj = self::getMusterbriefListePage($FilterSegments)) { $this->view->setVar('musterbrief_liste', $PageObj); $this->view->setVar('kategorie_filter', $FilterSegments->kategorie_filter); } else { $this->view->setVar('musterbrief_liste', self::getMusterbriefListePage()); } $this->view->setVar('hat_beliebte_musterbriefe', false); if (MusterbriefListe::getMusterbriefListen(["is_beliebt" => true])) { $this->view->setVar('hat_beliebte_musterbriefe', true); } } elseif ("Broschuere" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $kategorie_filter = $FilterSegments->kategorie_filter; $this->view->setVar('broschuere_ok', 'Test'); $this->view->setVar('kategorie_filter', false); $this->view->setVar('liste_ary', BroschuereListe::getBroschuereListen([])); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($kategorie_filter and ($BroschuereListe = BroschuereListe::getListeByPerma($kategorie_filter))) { $this->view->setVar('BroschuereListe', $BroschuereListe); $this->view->setVar('kategorie_filter', $kategorie_filter); $this->view->setVar('broschuere_ary', Broschuere::getBroschuerePage(["liste_id" => $BroschuereListe->getKey(), "is_online" => "ja"])); } } elseif ("Beratung" == $Modul->modul_class) { $FilterSegments = FilterSegment::getFilterSegments($this->args); $perma = null; $Beratung = null; $beratungen = null; $this->view->setVar('perma', $perma); $this->view->setVar('Beratung', $Beratung); $this->view->setVar('beratungen', $beratungen); $this->view->setVar("versicherungen", Versicherung::find(["order" => "name"])); if (($beratungen = self::getBeratungPage())) { if (!$perma = $FilterSegments->kategorie_filter) { $perma = $beratungen->getFirst()->perma; } $this->view->setVar('beratungen', $beratungen); $this->view->setVar('perma', $perma); } if ($perma) { if (($this->Beratung = Beratung::findFirst('perma = "' . $perma . '"'))) { $this->view->setVar('Beratung', $this->Beratung); } else { $this->get404Page(); } } $this->view->setVar('page_link', '/' . implode("/", $this->folders)); } elseif ("Kontakt" === $Modul->modul_class) { $this->view->setVar('anliegen', []); if (($anliegen = Kontakt::find(["order" => "pos"]))) { $this->view->setVar('anliegen', $anliegen); } } elseif ("Bewerbung" === $Modul->modul_class) { $this->view->setVar('widerruf', ""); $this->view->setVar('stellenangebote', []); if (($stellenangebote = self::getStellenangebotPage()) and $stellenangebote->count()) { $this->view->setVar('stellenangebote', self::getStellenangebotPage()); } if (($widerruf = Snippet::getSnippetTextByPerma("BewerbungWiderruf"))) { $this->view->setVar('widerruf', strip_tags($widerruf, "<a>")); } } } private function setViewVersicherungVars($Versicherung) { $this->view->setVar('page_arg', false); $this->view->setVar('calc_plugin', false); $this->view->setVar('is_bedingungen', false); $this->view->setVar("Versicherung", $Versicherung); $this->view->setVar('page_link', '/' . implode("/", $this->folders)); if ($this->args and count($this->args) == 1) { if ("formulare-bedingungen" === array_get($this->args, 0)) { $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } elseif ("unterlagen-bestellen" === array_get($this->args, 0)) { $Snippet = Snippet::findFirst(["snippet_perma = 'BoxUnterlagenBestellung'"]); $this->view->setVar('BoxUnterlagenBestellung', $Snippet->snippet_text); $this->view->setVar('unterlagen_bestellen_bool', true); $this->view->setVar('is_bedingungen', true); $this->view->setVar('page_arg', array_get($this->args, 0)); } } else { $class_name = $Versicherung->class; $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class)) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); $this->view->setVar('calc_plugin', $Rechenkern->getForm()); } } } private function procModulAction($Modul) { if ("Logout" === $Modul->modul_class) { (new LogoutPlugin())->procAction(); } } /* * Pages */ private static function getNewsPage() { $args = ["limit" => 3]; return News::getNewsPage($args); } private static function getKostenPage() { return Kosten::find(["order" => "pos"]); } private static function getPartnerPage() { $args = ["is_online" => "ja"]; return Partner::getPartnerPage($args); } private static function getBeratungPage() { $args = ["is_online" => "ja"]; return Beratung::getBeratungPage($args); } private static function getMitarbeiterPage() { $args = ["is_online" => "ja"]; return Mitarbeiter::getMitarbeiterPage($args); } private static function getTeamPage() { $args = ["is_online" => "ja"]; return Team::getTeamPage($args); } private static function getStellenangebotPage() { $args = ["is_online" => "ja"]; return Stellenangebot::getStellenangebotPage($args); } private static function getMusterbriefListePage($FilterSegments = null) { $args = []; if ($FilterSegments) { if ("beliebteste" == $FilterSegments->kategorie_filter) { array_set($args, "is_beliebt", "ja"); } else { array_set($args, "liste_perma", $FilterSegments->kategorie_filter); } } return MusterbriefListe::getMusterbriefListePage($args); } /* * phery action */ public function procKontaktForm($args) { return (new KontaktPlugin())->procAction($args); } public function procBewerbungForm($args) { return (new BewerbungPlugin())->procAction($args); } public function procBeratungForm($args) { return (new BeratungPlugin())->procAction($args); } public function procSchadenForm($args) { return (new SchadenPlugin())->procAction($args); } public function procBedarfsCheckForm($args) { return (new BedarfsCheckPlugin())->procAction($args); } public function procQuickConnectForm($args) { return (new QuickConnectPlugin())->procAction($args); } public function procBroschuereForm($args) { return (new BroschuerePlugin())->procAction($args); } public function procSucheForm($args) { parent::setTreeNavis(); $SuchePlugin = new SuchePlugin(); $SuchePlugin->setPathAry($this->path_ary); return $SuchePlugin->procAction($args); } public function procGetMitgliedLoginForm() { $request_uri = strtok($this->request->getURI(), "?"); return (new MitgliedLoginWidget())->getForm($request_uri); } public function procSendMitgliedLoginForm($args) { return (new MitgliedLoginPlugin())->procAction($args); } public function procIsLoggedIn() { $tmp_ary = ["status" => $this->is_mitglied]; return PheryResponse::factory()->json($tmp_ary); } public function procSendCalcForm($args) { if (($class_name = array_get($args, "calc_typ"))) { $class = 'App\Plugins\Web\Rechenkerne\\' . $class_name; if (class_exists($class) and ($Versicherung = Versicherung::findFirst("class = '" . $class_name . "'"))) { $Rechenkern = new $class(); $Rechenkern->setVersicherung($Versicherung); return $Rechenkern->getBerechnung($args); } } } /* * formulare */ public function procButtonBeratung($args) { $Phry = PheryResponse::factory(); $id = intval(array_get($args, "id")); if (($Formular = Formular::findFirst($id))) { $out = ''; $out .= '<div id="formular-result">'; $out .= '<a onclick="removeElmt(\'formular-result\');" id="close-formular-result" href="javascript:void(0);">×</a>'; $out .= $Formular->text_beratung; $out .= '</div>'; $Phry->jquery("#formular-result")->remove(); $Phry->jquery("#content-popup-container")->append($out); } return $Phry; } /* * stuff */ public function procGetContentPopup($args) { $Phry = (new ContentPopupPlugin())->procAction($args); return $Phry; } public function procSetCookieCheck() { $time = time() + 15 * 86400; setcookie("cookie-check", "ja", $time); } /* * Phery */ private function setPhery($remote = null) { $Phry = Phery::instance(); if ("kontakt" === $remote) { $Phry->set([$remote => [$this, 'procKontaktForm']]); } elseif ("bewerbung" == $remote) { $Phry->set([$remote => [$this, 'procBewerbungForm']]); } elseif ("broschuere" === $remote) { $Phry->set([$remote => [$this, 'procBroschuereForm']]); } elseif ("beratung" === $remote) { $Phry->set([$remote => [$this, 'procBeratungForm']]); } elseif ("schadenmelden" === $remote) { $Phry->set([$remote => [$this, 'procSchadenForm']]); } elseif ("bedarfscheck" === $remote) { $Phry->set([$remote => [$this, 'procBedarfsCheckForm']]); } elseif ("quick_connect" === $remote) { $Phry->set([$remote => [$this, 'procQuickConnectForm']]); } elseif ("send_suche_form" === $remote) { $Phry->set([$remote => [$this, 'procSucheForm']]); } // mitglied login stuff elseif ("get_login_form" === $remote) { $Phry->set([$remote => [$this, 'procGetMitgliedLoginForm']]); } elseif ("send_login_form" === $remote) { $Phry->set([$remote => [$this, 'procSendMitgliedLoginForm']]); } elseif ("is_logged_in" === $remote) { $Phry->set([$remote => [$this, 'procIsLoggedIn']]); } // Rechenkerne elseif ("send_calc_form" === $remote) { $Phry->set([$remote => [$this, 'procSendCalcForm']]); } // Formulare elseif ("button_beratung" === $remote) { $Phry->set([$remote => [$this, 'procButtonBeratung']]); } // stuff elseif ("get_content_popup" === $remote) { $Phry->set([$remote => [$this, 'procGetContentPopup']]); } elseif ("set_cookie_check" === $remote) { $Phry->set([$remote => [$this, 'procSetCookieCheck']]); } $Phry->process(); } } |
#4 | App\Controllers\Web\ContentController->indexAction |
#5 | Phalcon\Dispatcher\AbstractDispatcher->callActionMethod |
#6 | Phalcon\Dispatcher\AbstractDispatcher->dispatch |
#7 | Phalcon\Mvc\Application->handle /var/www/vhosts/bdv-service.de/httpdocs/index.php (70) <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL ^ E_DEPRECATED); date_default_timezone_set("Europe/Amsterdam"); use Phalcon\Mvc\Application; use App\Helper\ErrorHandler; use Phalcon\Config\Adapter\Ini as ConfigIni; // Phery Bugfix if(!function_exists('get_magic_quotes_gpc')){ function get_magic_quotes_gpc(){return false;} } // Bugfix ende try { require_once(__DIR__.'/../app/config/constants.php'); $vendor_path = APP_PATH.'vendor/'; $config_path = APP_PATH.'app/config/'; $config_path_web = $config_path.'web/'; /* * Read the configuration */ if ($_SERVER['HTTP_HOST'] == 'weblab.bdv-service.de') { $Config = new ConfigIni($config_path.'testing.ini'); } elseif($_SERVER['HTTP_HOST'] == 'localhost:8080') { $Config = new ConfigIni($config_path.'developing.ini'); } else { $Config = new ConfigIni($config_path.'production.ini'); } /** * Auto-loader configuration */ require $vendor_path.'autoload.php'; require $config_path_web.'loader.php'; /* * set ErrorHandler */ $ErrorHandler = new ErrorHandler(); set_error_handler([$ErrorHandler, "errorHandler"]); /* * load application services */ require $config_path_web.'services.php'; /* * Handle the request */ $App = new Application($di); /* * Handle debugbar */ if($Config->web->useDebugbar) { $di['app'] = $App; (new Snowair\Debugbar\ServiceProvider($config_path_web.'debugbar.php'))->start(); } echo $App->handle($_SERVER['REQUEST_URI'])->getContent(); } catch (\Exception $e) { echo get_class($e), ": ", $e->getMessage(), "\n"; echo " File=", $e->getFile(), "\n"; echo " Line=", $e->getLine(), "\n"; echo $e->getTraceAsString(); } |
Key | Value |
---|---|
_url | /unser-versicherungsangebot/private-haftpflicht |
Key | Value |
---|---|
USER | bdvservi |
HOME | /var/www/vhosts/bdv-service.de |
SCRIPT_NAME | /index.php |
REQUEST_URI | /unser-versicherungsangebot/private-haftpflicht |
QUERY_STRING | _url=/unser-versicherungsangebot/private-haftpflicht |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/1.0 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_URL | /unser-versicherungsangebot/private-haftpflicht |
REDIRECT_QUERY_STRING | _url=/unser-versicherungsangebot/private-haftpflicht |
REMOTE_PORT | 54348 |
SCRIPT_FILENAME | /var/www/vhosts/bdv-service.de/httpdocs/index.php |
SERVER_ADMIN | root@localhost |
CONTEXT_DOCUMENT_ROOT | /var/www/vhosts/bdv-service.de/httpdocs |
CONTEXT_PREFIX | |
REQUEST_SCHEME | https |
DOCUMENT_ROOT | /var/www/vhosts/bdv-service.de/httpdocs |
REMOTE_ADDR | 18.119.104.238 |
SERVER_PORT | 443 |
SERVER_ADDR | 46.229.46.62 |
SERVER_NAME | www.bdv-service.de |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin |
HTTP_REFERER | http://www.bdv-service.de/unser-versicherungsangebot/private-haftpflicht |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
HTTP_ACCEPT | */* |
HTTP_CONNECTION | close |
HTTP_X_ACCEL_INTERNAL | /internal-nginx-static-location |
HTTP_X_REAL_IP | 18.119.104.238 |
HTTP_HOST | www.bdv-service.de |
proxy-nokeepalive | 1 |
HTTPS | on |
PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY | 0 |
PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY | 0 |
PERL5LIB | /usr/share/awstats/lib:/usr/share/awstats/plugins |
SCRIPT_URI | https://www.bdv-service.de/unser-versicherungsangebot/private-haftpflicht |
SCRIPT_URL | /unser-versicherungsangebot/private-haftpflicht |
UNIQUE_ID | ZiOQm00f8s@MDUT0xZLNywAAAIc |
REDIRECT_STATUS | 200 |
REDIRECT_HTTPS | on |
REDIRECT_PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY | 0 |
REDIRECT_PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY | 0 |
REDIRECT_PERL5LIB | /usr/share/awstats/lib:/usr/share/awstats/plugins |
REDIRECT_SCRIPT_URI | https://www.bdv-service.de/unser-versicherungsangebot/private-haftpflicht |
REDIRECT_SCRIPT_URL | /unser-versicherungsangebot/private-haftpflicht |
REDIRECT_UNIQUE_ID | ZiOQm00f8s@MDUT0xZLNywAAAIc |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1713606811.426 |
REQUEST_TIME | 1713606811 |
# | Path |
---|---|
0 | /var/www/vhosts/bdv-service.de/httpdocs/index.php |
1 | /var/www/vhosts/bdv-service.de/app/config/constants.php |
2 | /var/www/vhosts/bdv-service.de/vendor/autoload.php |
3 | /var/www/vhosts/bdv-service.de/vendor/composer/autoload_real.php |
4 | /var/www/vhosts/bdv-service.de/vendor/composer/platform_check.php |
5 | /var/www/vhosts/bdv-service.de/vendor/composer/ClassLoader.php |
6 | /var/www/vhosts/bdv-service.de/vendor/composer/autoload_static.php |
7 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-mbstring/bootstrap.php |
8 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-mbstring/bootstrap80.php |
9 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-intl-normalizer/bootstrap.php |
10 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php |
11 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-ctype/bootstrap.php |
12 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-ctype/bootstrap80.php |
13 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-php72/bootstrap.php |
14 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-intl-grapheme/bootstrap.php |
15 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-intl-idn/bootstrap.php |
16 | /var/www/vhosts/bdv-service.de/vendor/symfony/var-dumper/Resources/functions/dump.php |
17 | /var/www/vhosts/bdv-service.de/vendor/symfony/string/Resources/functions.php |
18 | /var/www/vhosts/bdv-service.de/vendor/symfony/deprecation-contracts/function.php |
19 | /var/www/vhosts/bdv-service.de/vendor/symfony/polyfill-php80/bootstrap.php |
20 | /var/www/vhosts/bdv-service.de/vendor/psy/psysh/src/functions.php |
21 | /var/www/vhosts/bdv-service.de/vendor/snowair/phalcon-debugbar/src/Debug.php |
22 | /var/www/vhosts/bdv-service.de/app/Helper/functions.php |
23 | /var/www/vhosts/bdv-service.de/app/Helper/array.php |
24 | /var/www/vhosts/bdv-service.de/app/config/web/loader.php |
25 | /var/www/vhosts/bdv-service.de/app/Helper/ErrorHandler.php |
26 | /var/www/vhosts/bdv-service.de/app/config/web/services.php |
27 | /var/www/vhosts/bdv-service.de/app/Controllers/Web/ContentController.php |
28 | /var/www/vhosts/bdv-service.de/app/Controllers/Web/BaseController.php |
29 | /var/www/vhosts/bdv-service.de/app/Models/Snippet.php |
30 | /var/www/vhosts/bdv-service.de/app/Models/BaseModel.php |
31 | /var/www/vhosts/bdv-service.de/vendor/phery/phery/src/Phery/Phery.php |
32 | /var/www/vhosts/bdv-service.de/app/Models/Tree.php |
33 | /var/www/vhosts/bdv-service.de/app/Traits/File.php |
34 | /var/www/vhosts/bdv-service.de/app/Models/NestedSet.php |
35 | /var/www/vhosts/bdv-service.de/app/Helper/NestedSet.php |
Memory | |
---|---|
Usage | 2097152 |