function getTpl() { $tplName = $this->get["getTpl"]; if ($tplName == "drafts") { $contentID = 0; if (isset($_POST["contentID"]) && $_POST["contentID"]) { $contentID = intval($_POST["contentID"]); } $this->smarty->assign("lists", drafts::getDraftsLists($contentID)); } $file = TPL_PATH . "/ajax/{$tplName}.tpl"; $tplContent = "File not found"; if (file_exists($file)) { $tplContent = $this->smarty->fetch($file); } echo $tplContent; }