$name = "sites[]";
$html['content'] .= $T->add_form_field(array("name" => $name, "label" => "<u>Z</u>ielbereiche ausw&auml;hlen", "key" => "q", "type" => "site_select", "values" => $PS->get_all($_SESSION['id']), "help" => "W&auml;hlen Sie die Bereiche aus, auf denen sp&auml;ter der Artikel erscheinen soll.\nEine Mehrfachauswahl mit mit gedr&uuml;ckter STRG-Taste m&ouml;glich"));
// footer with buttons
$T->append($T->form_button("ex__ok_reset") . "</table>");
//$html['content']  .= $T->form_button("ex__ok_reset") . "</table>";
// Fill into Template --------------------------------------------------------------
// form after buttons, beause of "example hiddenfield, onchange..."
$T->add_form("index.php", true);
// action, checksubmit/checkreset, special
$T->add_menu($menu_links);
$T->add_content($html['content']);
$T->add_js("js/entry_examples.js");
$T->add_js("js/entry_check.js");
if ($send == 1) {
    $r = $T->check_form();
    if ($r) {
        $PE->import($r) && $PE->write();
        if (empty($PE->error_cmsg)) {
            $T2 = new template($DBG);
            $T2->add_title("Presseintrag erstellen");
            $T2->add_css("css/nentry.css");
            $T2->add_menu($menu_links);
            $T2->leadin("<div class=\"error\">" . $formerror['main'] . "</div>" . "<div class=\"status\">" . $status . "</div>" . "<table summary=\"form table (as layout)\" width=\"100%\">\n");
            $T2->add_content("<tr><td>Der Eintrag wurde erfolgreich angelegt.</td></tr>" . "<tr><td>M&ouml;chten Sie einen <a href='?menu=entry'>weiteren Eintrag anlegen</a>" . " oder " . "<a href='?menu=logout'>sich abmelden</a>?</td></tr> ");
            $T2->append("</table>");
            $T2->show();
        }
    }
} else {
    $T->show();
}
Esempio n. 2
0
$ret = $PENTRIES->set_link("www.heiny.de");
it("link ok www", $ret, true, $PENTRIES->error_cmsg);
echo "<h3>Date</h3>";
$ret = $PENTRIES->set_date("13-11");
it("set date 13-11 (fail)", $ret, false, $PENTRIES->error_cmsg);
$ret = $PENTRIES->set_date("11.13.");
it("set date 11.13. (fail)", $ret, false, $PENTRIES->error_cmsg);
$ret = $PENTRIES->set_date("11.13.2005");
it("set date 11.13.2005 (fail)", $ret, false, $PENTRIES->error_cmsg);
$ret = $PENTRIES->set_date("1.8.05");
it("set date 1.8.05", $ret, "2005-08-01", $PENTRIES->error_cmsg);
$ret = $PENTRIES->set_date("11-13");
it("set date 11-13", $ret, strftime("%Y") . "-11-13", $PENTRIES->error_cmsg);
$ret = $PENTRIES->set_date("1.8.2005");
it("set date 1.8.2005", $ret, "2005-08-01", $PENTRIES->error_cmsg);
$ret = $PENTRIES->write();
it("write entry", $ret, true, $ret . " - " . $PENTRIES->error_cmsg);
/* * * * Keywords * * * */
echo "<h2>KEYWORDS</h2>";
$sql = "SELECT id FROM " . $prefix . "press_keywords WHERE keyword = '" . strtolower($key[0]) . "'";
$ret = $SQL->select($sql);
it("keyword written", $ret[0]['id'], 1, "keyword not written!");
$sql = "SELECT id FROM " . $prefix . "press_keywords WHERE keyword = '" . strtolower($key[1]) . "'";
$ret = $SQL->select($sql);
it("keyword written, strtolower", $ret[0]['id'], 2, "keyword not written!");
/* * * * Sources * * * */
echo "<h2>SOURCES</h2>";
$sql = "SELECT id FROM " . $prefix . "press_sources WHERE name = '" . $psource . "'";
$ret = $SQL->select($sql);
it("source exists?", $ret[0]['id'], 1, "source not created???");
/* Titel, id, Quelle (klartext)