function __construct($action_name, $params=[], $method= "GET"){ $this->action_name= $action_name; $this->method= $method; $this->params= $params; if(!is_callable([$this, $action_name])) throw new ActionNotDefined; Flash::run(); if(is_callable([$this, "before_action"])) $this->before_action(); $this->$action_name(); if($this->rendered())exit; $this->render(); }
*/ public function run() { if (!strlen($this->strId)) { return; } $this->import('String'); $this->import('Database'); $objArticle = $this->Database->prepare("SELECT * FROM tl_flash WHERE flashID=?")->limit(1)->execute($this->strId); if ($objArticle->numRows < 1) { $this->log('Could not find a content element with flashID "' . $this->Input->post('flashID') . '"', 'Flash run()', TL_ERROR); echo 'content=<p class="error">Could not find element "' . $this->Input->post('flashID') . '"!</p>'; return; } // Strip all tags that Flash can not handle $ce = $this->String->decodeEntities($objArticle->content); $ce = strip_tags($ce, '<a><b><br><font><img><i><li><p><span><textformat><u>'); // Convert <br /> to <br> and remove all line-breaks as they might get transformed into additional <br> tags $ce = preg_replace('/<br \\/>/i', '<br>', $ce); $ce = preg_replace('/[\\n\\r]+/i', '', $ce); $objTemplate = new FrontendTemplate('mod_flash_content'); $objTemplate->text = 'content=' . trim(urlencode($ce)); echo $objTemplate->parse(); } } /** * Instantiate controller */ $objFlash = new Flash(); $objFlash->run();