Beispiel #1
0
function showusermod()
{
    global $lang;
    global $conf;
    global $user;
    global $admin;
    global $site;
    global $userid;
    $site->title($lang['admin']['modifyusers']);
    $site->addfooter("help.php?on=admin#user", "help", $lang['menu']['help'], $lang['menu']['helpalt']);
    if ($_POST['cancel']) {
        redirect("admin.php");
    }
    $form1 = new CodeKBForm("admin.php", "modifyuser");
    $form1->addhidden("user", $userid);
    $form1->addtext("name", $admin->username($userid));
    $form1->addlabel("name", $lang['general']['username']);
    $form1->setrequired("name");
    $form1->addpassword("password");
    $form1->addlabel("password", $lang['admin']['password']);
    $form1->addcheckbox("delete", $lang['admin']['deleteuser']);
    $form1->addsubmit("changeuser");
    $form1->addcancel();
    $form2 = new CodeKBForm("admin.php", "modifyuser");
    $form2->addhidden("user", $userid);
    $groups = $admin->listgroups();
    foreach ($groups as $val) {
        if (!is_null($val['name'])) {
            $form2->addcombo("group", $val['id'], $val['name']);
        }
    }
    $form2->addsubmit("joingroup");
    $form2->addcancel();
    $form3 = new CodeKBForm("admin.php", "modifyuser");
    $form3->addhidden("user", $userid);
    $usersgroups = $admin->usersgroups($userid);
    foreach ($usersgroups as $val) {
        if (!is_null($val['name'])) {
            $form3->addcheckbox("group_" . $val['id'], $val['name'] . " (" . url("admin.php?group=" . $val['id'] . "&action=modifygroup", $lang['general']['modify']) . ")");
        }
    }
    $form3->addsubmit("partgroup", $lang['general']['delete']);
    $form3->addcancel();
    if ($_POST['changeuser']) {
        if (!$form1->fill()) {
            $site->addcontent(notice($lang['general']['missing']));
        } else {
            if ($form1->value("delete")) {
                try {
                    $admin->deleteuser($userid);
                    redirect("admin.php?action=users");
                } catch (Exception $e) {
                    if ($e->getCode() == 1) {
                        $site->addcontent(notice($lang['admin']['deleteadmin']));
                    } else {
                        $site->addcontent(notice($lang['admin']['faileddeluser']));
                    }
                }
            } else {
                try {
                    $admin->changeuser($userid, $form1->value("name"), $form1->value("password"));
                    $site->addcontent(notice($lang['admin']['changeusersucc']));
                    $form1->addpassword("password", "");
                } catch (Exception $e) {
                    if ($e->getCode() == 1) {
                        $site->addcontent(notice($lang['admin']['duplicateuser']));
                        $form1->setmissing("name");
                    } else {
                        $site->addcontent(notice($lang['admin']['failesuserchange']));
                    }
                }
            }
        }
    }
    if ($_POST['joingroup'] && $form2->fill() && $form2->value("group")) {
        try {
            $admin->joingroup($userid, $form2->value("group"));
            $site->addcontent(notice($lang['admin']['joinsucc']));
            $form3->addcheckbox("group_" . $form2->value("group"), $admin->groupname($form2->value("group")) . " (" . url("admin.php?group=" . $form2->value("group") . "&action=modifygroup", $lang['general']['modify']) . ")");
        } catch (Exception $e) {
            if ($e->getCode() == 1) {
                $site->addcontent(notice($lang['admin']['alreadyingroup']));
            } else {
                $site->addcontent(notice($lang['admin']['failedjoin']));
            }
        }
    }
    if ($_POST['partgroup'] && $form3->fill()) {
        try {
            foreach ($usersgroups as $val) {
                if ($form3->value("group_" . $val['id'])) {
                    $admin->partgroup($userid, $val['id']);
                    $notice = $lang['admin']['partsucc'];
                    $form3->remove("group_" . $val['id']);
                }
            }
        } catch (Exception $e) {
            $notice = $lang['admin']['failedpart'];
        }
        $site->addcontent(notice($notice));
    }
    $dialog = new CodeKBTemplate("dialog");
    $dialog->push("legend", $lang['admin']['modifyusers']);
    $dialogitem1 = new CodeKBTemplate("dialogitem");
    $content = $form1->head();
    $content .= $lang['admin']['changeuserexplain'] . "<br /><br />\n";
    $dialogitem1->push("head", $content);
    $dialogitem1->push("content1", $form1->get());
    $dialogitem1->push("tail", $form1->tail());
    $dialogitem2 = new CodeKBTemplate("dialogitem");
    $content = $form2->head();
    $content .= $lang['admin']['joinuserexplain'] . "<br /><br />\n";
    $dialogitem2->push("head", $content);
    $dialogitem2->push("content1", $form2->get());
    $dialogitem2->push("tail", $form2->tail());
    $dialogitem3 = new CodeKBTemplate("dialogitem");
    $content = $form3->head();
    $content .= $lang['admin']['partuserexplain'] . "<br /><br />\n";
    $dialogitem3->push("head", $content);
    $content = "<div class = \"forms\">";
    $content .= $form3->get();
    $content .= "</div>";
    $dialogitem3->push("content1", $content);
    $dialogitem3->push("tail", $form3->tail());
    $dialogcode = $dialogitem1->__toString();
    $dialogcode .= $dialogitem2->__toString();
    $dialogcode .= $dialogitem3->__toString();
    $dialog->push("content", $dialogcode);
    $site->addcontent($dialog);
    return true;
}
Beispiel #2
0
function showinput()
{
    global $lang;
    global $conf;
    global $user;
    global $site;
    global $catid;
    global $file;
    $site->title($lang['file']['modify']);
    $site->addfooter("help.php?on=file#change", "help", $lang['menu']['help'], $lang['menu']['helpalt']);
    if (!$user->entrycan("changeentry", $file->entry())) {
        $site->addcontent(notice($lang['entry']['nochangeallowed']));
        return false;
    }
    if ($_POST['cancel']) {
        redirect("entry.php?id=" . $file->entry()->id());
    }
    $form = new CodeKBForm("file.php", "modify");
    $form->addhidden("id", $file->id());
    $form->addhidden("cat", $catid);
    $form->addtext("name", $file->name());
    $form->addlabel("name", $lang['file']['name']);
    $form->setrequired("name");
    $form->addfile("upload");
    $form->addlabel("upload", $lang['file']['upload']);
    $form->addcombo("highlight", $conf['highlight']['binary'], null, $conf['highlight']['binary'] == $file->highlight());
    foreach ($conf['highlight']['languages'] as $language) {
        $form->addcombo("highlight", $language, null, $language == $file->highlight());
    }
    $form->addlabel("highlight", $lang['file']['language']);
    $db = new CodeKBDatabase();
    $db->dosql("SELECT name, symbol " . "FROM symbols " . "WHERE symbol LIKE 'type_%'");
    while ($val = $db->row()) {
        $form->addradio("symbol", $val['name'], icon($val['name'], $val['name']), $val['name'] == $file->symbol(), false);
    }
    $form->addbutton("submit");
    $form->addbutton("cancel");
    if ($_POST['submit']) {
        if (!$form->fill()) {
            $site->addcontent(notice($lang['general']['missing']));
        } else {
            global $HTTP_POST_FILES;
            if (is_uploaded_file($HTTP_POST_FILES['upload']['tmp_name'])) {
                $upload = "upload";
            } else {
                $upload = false;
            }
            try {
                $file->change($form->value("name"), $form->value("highlight"), $form->value("symbol"), $upload);
                if ($form->value("highlight") == $conf['highlight']['binary']) {
                    redirect("entry.php?id=" . $file->entry()->id() . "&cat=" . $catid);
                } else {
                    redirect("file.php?id=" . $file->id() . "&cat=" . $catid);
                }
            } catch (Exception $e) {
                $site->addcontent(notice($lang['entry']['failedfilechange']));
            }
        }
    }
    $dialog = new CodeKBTemplate("dialog");
    $dialog->push("legend", $lang['file']['modify']);
    $dialogitem = new CodeKBTemplate("dialogitem");
    $content = $form->head();
    $content .= $form->get("name");
    $dialogitem->push("top", $content);
    $dialogitem->push("head", "(" . $lang['file']['newuploadexplain'] . ")<br />\n");
    $dialogitem->push("content1", $form->get());
    $dialogitem->push("tail", $form->tail());
    $dialog->push("content", $dialogitem);
    $site->addcontent($dialog);
    return true;
}
function showinput()
{
    global $lang;
    global $user;
    global $site;
    global $conf;
    global $category;
    $site->addfooter("help.php?on=category#add", "help", $lang['menu']['help'], $lang['menu']['helpalt']);
    if ($site->action() == "change") {
        $change = true;
    } else {
        $change = false;
    }
    if ($change) {
        $site->title($lang['category']['change']);
    } else {
        $site->title($lang['category']['add']);
    }
    if ($change && !$user->can("changecat", $category)) {
        $site->addcontent(notice($lang['category']['nochangeallowed']));
        return false;
    }
    if (!$change && !$user->can("addcat", $category)) {
        $site->addcontent(notice($lang['category']['noaddallowed']));
        return false;
    }
    if ($_POST['cancel']) {
        redirect("category.php?id=" . $category->id());
    }
    $form = new CodeKBForm("category.php", $change ? "change" : "new");
    $form->addhidden("id", $category->id());
    $form->addtext("name", $change ? $category->name() : "");
    $form->addlabel("name", $lang['category']['name']);
    $form->setrequired("name");
    $form->addtext("description", $change ? $category->description() : "");
    $form->addlabel("description", $lang['category']['description']);
    if ($change) {
        if ($user->can("addcat", $a = 0)) {
            $form->addcombo("parent", "0", $lang['category']['root'], $category->parent() == 0);
        }
        $array = $category->listcategories("name", 1, 0);
        foreach ($array as $val) {
            if ($user->can("addcat", $val['id'])) {
                $form->addcombo("parent", $val['id'], str_repeat("-", $val['reclevel'] * 2) . " " . $val['name'], $category->parent() == $val['id']);
            }
        }
        $form->addlabel("parent", $lang['category']['parent']);
    }
    $form->addbutton("submit");
    $form->addbutton("cancel");
    if ($_POST['submit']) {
        if ($change) {
            // Change category
            if (!$form->fill()) {
                $site->addcontent(notice($lang['general']['missing']));
            } else {
                try {
                    $category->change($form->value("name"), $form->value("description"), $form->value("parent"));
                    redirect("category.php?id=" . $category->id());
                } catch (Exception $e) {
                    switch ($e->getCode()) {
                        case 1:
                            $site->addcontent(notice($lang['category']['childnoparent']));
                            $form->setmissing("parent");
                            break;
                        case 2:
                            $site->addcontent(notice($lang['category']['duplicate']));
                            $form->setmissing("name");
                            break;
                        default:
                            $site->addcontent(notice($lang['category']['failedchange']));
                    }
                }
            }
        } else {
            // Add category
            if (!$form->fill()) {
                $site->addcontent(notice($lang['general']['missing']));
            } else {
                try {
                    $category->addsubcat($form->value("name"), $form->value("description"));
                    redirect("category.php?id=" . $category->id());
                } catch (Exception $e) {
                    switch ($e->getCode()) {
                        case 1:
                            $site->addcontent(notice($lang['category']['duplicate']));
                            $form->setmissing("name");
                            break;
                        default:
                            $site->addcontent(notice($lang['category']['failedadd']));
                    }
                }
            }
        }
    }
    $dialog = new CodeKBTemplate("dialog");
    if ($change) {
        $dialog->push("legend", $lang['category']['change']);
    } else {
        $dialog->push("legend", $lang['category']['add']);
    }
    $dialogitem = new CodeKBTemplate("dialogitem");
    $content = $form->head();
    $content .= $form->get("name");
    $dialogitem->push("top", $content);
    $dialogitem->push("content1", $form->get());
    $dialogitem->push("tail", $form->tail());
    $dialog->push("content", $dialogitem);
    $site->addcontent($dialog);
    return true;
}
Beispiel #4
0
function showregister()
{
    global $lang;
    global $site;
    global $user;
    $site->title($lang['register']['title']);
    $site->addfooter("help.php?on=login", "help", $lang['menu']['help'], $lang['menu']['helpalt']);
    if ($_POST['cancel']) {
        redirect("home.php");
    }
    $form = new CodeKBForm("login.php", "register");
    $form->addtext("user");
    $form->addlabel("user", $lang['general']['username']);
    $form->setrequired("user");
    $form->addpassword("password");
    $form->addlabel("password", $lang['general']['password']);
    $form->setrequired("password");
    $form->addpassword("password2");
    $form->addlabel("password2", $lang['register']['passwordagain']);
    $form->setrequired("password2");
    $form->addsubmit();
    $form->addcancel();
    if ($_POST['submit']) {
        if (!$form->fill()) {
            $site->addcontent(notice($lang['general']['missing']));
        } else {
            if ($form->value("password") != $form->value("password2")) {
                $site->addcontent(notice($lang['register']['wrongpass']));
                $form->setmissing("password");
                $form->setmissing("password2");
            } else {
                try {
                    $user->register($form->value("user"), $form->value("password"));
                    redirect("login.php?action=registered");
                } catch (Exception $e) {
                    if ($e->getCode() == 1) {
                        $site->addcontent(notice($lang['register']['duplicate']));
                        $form->setmissing("user");
                        $form->setmissing("password");
                        $form->setmissing("password2");
                    } else {
                        $site->addcontent(notice($lang['register']['failed']));
                    }
                }
            }
        }
    }
    $dialog = new CodeKBTemplate("dialog");
    $dialog->push("legend", $lang['register']['title']);
    $content = $form->head();
    $content .= $lang['register']['description'] . "<br /><br />\n";
    $content .= $form->get();
    $content .= $form->tail();
    $dialog->push("content", $content);
    $site->addcontent($dialog);
    return true;
}
Beispiel #5
0
function showinput()
{
    global $lang;
    global $user;
    global $site;
    global $category;
    global $entry;
    $site->addfooter("help.php?on=entry#add", "help", $lang['menu']['help'], $lang['menu']['helpalt']);
    if ($site->action() == "modify") {
        $change = true;
        $site->title($lang['entry']['change']);
    } else {
        $change = false;
        $site->title($lang['entry']['add']);
    }
    if (!$change && !$user->can("addentry", $category)) {
        $site->addcontent(notice($lang['entry']['noaddallowed']));
        return false;
    }
    if ($change && !$user->entrycan("changeentry", $entry)) {
        $site->addcontent(notice($lang['entry']['nochangeallowed']));
        return false;
    }
    if ($category) {
        $cat = $category->id();
    }
    if ($_POST['cancel']) {
        if ($change) {
            redirect("entry.php?id=" . $entry->id() . "&cat=" . $cat);
        } else {
            redirect("category.php?id=" . $cat);
        }
    }
    $form = new CodeKBForm("entry.php", $change ? "modify" : "new");
    $form->addhidden("cat", $cat);
    if ($change) {
        $form->addhidden("id", $entry->id());
    }
    $form->addtext("title", $change ? $entry->name() : "");
    $form->addlabel("title", $lang['entry']['name']);
    $form->setrequired("title");
    $form->addtext("author", $change ? $entry->author() : "");
    $form->addlabel("author", $lang['entry']['author']);
    $form->addtext("description", $change ? $entry->description() : "");
    $form->addlabel("description", $lang['entry']['description']);
    $db = new CodeKBDatabase();
    $db->dosql("SELECT name, symbol " . "FROM symbols " . "WHERE symbol LIKE 'type_%'");
    if ($entry) {
        $symbol = $entry->symbol();
    } else {
        $symbol = false;
    }
    while ($val = $db->row()) {
        $form->addradio("symbol", $val['name'], icon($val['name'], $val['name']), !$change && $val['name'] == "Unkown" || $val['name'] == $symbol, false);
    }
    $form->addtextarea("documentation", $change ? $entry->documentation() : "");
    $form->addlabel("documentation", $lang['entry']['documentation'] . " (" . url("help.php?on=bbcode", $lang['entry']['bbcode'], null, true) . ")");
    $form->addsubmit();
    $form->addpreview();
    $form->addcancel();
    if ($_POST['submit'] || $_POST['preview']) {
        $fill = $form->fill();
        if (!$fill) {
            $site->addcontent(notice($lang['general']['missing']));
        }
    }
    if ($_POST['submit'] && $fill) {
        if ($change) {
            // Change the entry
            try {
                $entry->change($form->value("title"), $form->value("author"), $form->value("symbol"), $form->value("description"), $form->value("documentation"));
                redirect("entry.php?id=" . $entry->id() . "&cat=" . $cat);
            } catch (Exception $e) {
                $site->addcontent(notice($lang['entry']['failedchange']));
            }
        } else {
            // Add the new entry
            try {
                $ret = $category->addentry($form->value("title"), $form->value("author"), $form->value("symbol"), $form->value("description"), $form->value("documentation"));
                if (is_numeric($ret)) {
                    if ($user->entrycan("changeentry", $ret)) {
                        redirect("entry.php?id=" . $ret . "&cat=" . $category->id() . "&action=change");
                    } else {
                        redirect("entry.php?id=" . $ret . "&cat=" . $category->id());
                    }
                } else {
                    throw new CodeKBException(__METHOD__, "entry", "failedadd");
                }
            } catch (Exception $e) {
                $site->addcontent(notice($lang['entry']['failedadd']));
            }
        }
    }
    $dialog = new CodeKBTemplate("dialog");
    if ($change) {
        $dialog->push("legend", $lang['entry']['change']);
    } else {
        $dialog->push("legend", $lang['entry']['add']);
    }
    $dialogitem = new CodeKBTemplate("dialogitem");
    $content = $form->head();
    $content .= $form->get("title") . "<br />\n";
    $content .= $form->get("author");
    $dialogitem->push("top", $content);
    $dialogitem->push("content1", $form->get());
    $dialogitem->push("tail", $form->tail());
    $dialogcode = $dialogitem->__toString();
    if ($_POST['preview']) {
        $dialogitem2 = new CodeKBTemplate("dialogitem");
        $dialogitem2->push("head", "<em><strong>" . $lang['general']['preview'] . "</strong></em><br /><br />");
        $dialogitem2->push("content1", parsebbcode($form->value("documentation")));
        $dialogcode .= $dialogitem2->__toString();
    }
    $dialog->push("content", $dialogcode);
    $site->addcontent($dialog);
    return true;
}
Beispiel #6
0
function showinput()
{
    global $lang;
    global $conf;
    global $user;
    global $site;
    global $catid;
    global $category;
    global $entry;
    $site->addfooter("help.php?on=entry#add", "help", $lang['menu']['help'], $lang['menu']['helpalt']);
    if ($site->action() == "modify") {
        $change = true;
        $site->title($lang['entry']['change']);
    } else {
        $change = false;
        $site->title($lang['entry']['add']);
    }
    if (!$change && !$user->can("addentry", $category)) {
        $site->addcontent(notice($lang['entry']['noaddallowed']));
        return false;
    }
    if ($change && !$user->entrycan("changeentry", $entry)) {
        $site->addcontent(notice($lang['entry']['nochangeallowed']));
        return false;
    }
    if ($_POST['cancel']) {
        if ($change) {
            redirect("entry.php?id=" . $entry->id() . "&cat=" . $catid);
        } else {
            redirect("category.php?id=" . $catid);
        }
    }
    $form = new CodeKBForm("entry.php", $change ? "modify" : "new");
    $form->addhidden("cat", $catid);
    if ($change) {
        $form->addhidden("id", $entry->id());
    }
    $form->addtext("title", $change ? $entry->name() : "");
    $form->addlabel("title", $lang['entry']['name']);
    $form->setrequired("title");
    $form->addtext("author", $change ? $entry->author() : "");
    $form->addlabel("author", $lang['entry']['author']);
    $form->addtext("description", $change ? $entry->description() : "");
    $form->addlabel("description", $lang['entry']['description']);
    $db = new CodeKBDatabase();
    $db->dosql("SELECT name, symbol " . "FROM symbols " . "WHERE symbol LIKE 'type_%'");
    if ($entry) {
        $symbol = $entry->symbol();
    } else {
        $symbol = false;
    }
    while ($val = $db->row()) {
        $form->addradio("symbol", $val['name'], icon($val['name'], $val['name']), !$change && $val['name'] == "Unkown" || $val['name'] == $symbol, false);
    }
    $form->addtextarea("documentation", $change ? $entry->documentation() : "");
    $form->addlabel("documentation", $lang['entry']['documentation'] . " (" . url("help.php?on=bbcode", $lang['entry']['bbcode'], null, true) . ")");
    $form->addbutton("submit");
    $form->addbutton("preview", $lang['general']['preview']);
    $form->addbutton("cancel");
    if ($_POST['submit'] || $_POST['preview']) {
        $fill = $form->fill();
        if (!$fill) {
            $site->addcontent(notice($lang['general']['missing']));
        }
    }
    if ($_POST['submit'] && $fill) {
        if ($change) {
            // Change the entry
            try {
                $entry->change($form->value("title"), $form->value("author"), $form->value("symbol"), $form->value("description"), $form->value("documentation"));
                redirect("entry.php?id=" . $entry->id() . "&cat=" . $catid);
            } catch (Exception $e) {
                $site->addcontent(notice($lang['entry']['failedchange']));
            }
        } else {
            // Add the new entry
            try {
                $ret = $category->addentry($form->value("title"), $form->value("author"), $form->value("symbol"), $form->value("description"), $form->value("documentation"));
                if (is_numeric($ret)) {
                    if ($user->entrycan("changeentry", $ret)) {
                        redirect("entry.php?id=" . $ret . "&cat=" . $category->id() . "&action=change");
                    } else {
                        redirect("entry.php?id=" . $ret . "&cat=" . $category->id());
                    }
                } else {
                    throw new CodeKBException(__METHOD__, "entry", "failedadd");
                }
            } catch (Exception $e) {
                $site->addcontent(notice($lang['entry']['failedadd']));
            }
        }
    }
    $dialog = new CodeKBTemplate("dialog");
    if ($change) {
        $dialog->push("legend", $lang['entry']['change']);
    } else {
        $dialog->push("legend", $lang['entry']['add']);
    }
    $dialogitem = new CodeKBTemplate("dialogitem");
    $content = $form->head();
    $content .= $form->get("title") . "<br />\n";
    $content .= $form->get("author");
    $dialogitem->push("top", $content);
    $content = $form->get("description") . "<br /><br />\n";
    $content .= $form->get("symbol") . "<br /><br />\n";
    if ($conf['general']['javascript']) {
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[b][/b]';\" value=\"{$lang['bbcode']['bold']}\" title=\"{$lang['bbcode']['boldalt']}\" style=\"width: auto; font-weight: bold; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[i][/i]';\" value=\"{$lang['bbcode']['italic']}\" title=\"{$lang['bbcode']['italicalt']}\" style=\"width: auto; font-style: italic; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[u][/u]';\" value=\"{$lang['bbcode']['underline']}\" title=\"{$lang['bbcode']['underlinealt']}\" style=\"width: auto; text-decoration:underline; padding-left:3px; padding-right:3px;\" />\n";
        $content .= $lang['bbcode']['size'];
        $content .= "<select name=\"bbsize\" size=\"1\" onchange=\"this.form.documentation.value=this.form.documentation.value+'[size='+this.form.bbsize.value+'][/size]';\">\n";
        $content .= "<option value=\"1\">1</option>\n";
        $content .= "<option value=\"2\">2</option>\n";
        $content .= "<option value=\"3\">3</option>\n";
        $content .= "<option value=\"4\">4</option>\n";
        $content .= "<option value=\"5\">5</option>\n";
        $content .= "<option value=\"6\">6</option>\n";
        $content .= "<option value=\"7\">7</option>\n";
        $content .= "</select>\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[center][/center]';\" value=\"{$lang['bbcode']['center']}\" title=\"{$lang['bbcode']['centeralt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[-]';\" value=\"{$lang['bbcode']['indent']}\" title=\"{$lang['bbcode']['indentalt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[--]';\" value=\"{$lang['bbcode']['line']}\" title=\"{$lang['bbcode']['linealt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[list]\\n[*]{$lang['bbcode']['listitem']}\\n[/list]';\" value=\"{$lang['bbcode']['list']}\" title=\"{$lang['bbcode']['listalt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[olist]\\n[*]{$lang['bbcode']['listitem']}\\n[/olist]';\" value=\"{$lang['bbcode']['olist']}\" title=\"{$lang['bbcode']['olistalt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[url][/url]';\" value=\"{$lang['bbcode']['url']}\" title=\"{$lang['bbcode']['urlalt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[anker= ]';\" value=\"{$lang['bbcode']['anker']}\" title=\"{$lang['bbcode']['ankeralt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[img][/img]';\" value=\"{$lang['bbcode']['image']}\" title=\"{$lang['bbcode']['imagealt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= "<input type=\"button\" onclick=\"this.form.documentation.value=this.form.documentation.value+'[pre][/pre]';\" value=\"{$lang['bbcode']['pre']}\" title=\"{$lang['bbcode']['prealt']}\" style=\"width: auto; padding-left:3px; padding-right:3px;\" />\n";
        $content .= $lang['bbcode']['code'];
        $content .= "<select name=\"bbhigh\" size=\"1\" onchange=\"this.form.documentation.value=this.form.documentation.value+'[code='+this.form.bbhigh.value+'][/code]';\">\n";
        foreach ($conf['highlight']['languages'] as $val) {
            $content .= "<option value=\"" . htmlentities($val) . "\">{$val}</option>\n";
        }
        $content .= "</select>\n";
    }
    $content .= $form->get("documentation") . "<br /><br />\n";
    $dialogitem->push("content1", $content);
    $dialogitem->push("tail", $form->tail());
    $dialogcode = $dialogitem->__toString();
    if ($_POST['preview']) {
        $dialogitem2 = new CodeKBTemplate("dialogitem");
        $dialogitem2->push("head", "<em><strong>" . $lang['general']['preview'] . "</strong></em><br /><br />");
        $dialogitem2->push("content1", parsebbcode($form->value("documentation")));
        $dialogcode .= $dialogitem2->__toString();
    }
    $dialog->push("content", $dialogcode);
    $site->addcontent($dialog);
    return true;
}