function mod_pick_style() { $styles = array("Standardstil" => "css/aviscms.css", "Thormod" => "http://www.stud.ntnu.no/~nordram/thorstyle.css", "Heimegut" => "http://www.festsiden.org/_tore/heimegut.css", "Blogspot" => "http://www.festsiden.org/_tore/blogspot.css", "Galápagos" => "css/galapagos.css"); global $stylestatus, $layout, $css_file, $languageChoice; echo '<div class="options"><div class="optionsheader">Stilvelger</div>'; form_start_get(); echo '<select name="chosenstyle">'; foreach ($styles as $stylename => $stylefile) { if ($stylefile == $css_file) { echo '<option value="' . $stylefile . '" selected="selected">' . $stylename . '</option>'; } else { echo '<option value="' . $stylefile . '">' . $stylename . '</option>'; } } echo "</select>"; form_hidden("module_right_2", "mod_pick_style"); form_hidden("styleselect", "styleselect"); echo "<br/>"; echo "<br/>"; echo '<div class="optionsheader">Velg layout</div>'; ?> <select name="chosenlayout"> <?php echo '<option value="1">En kolonne</option>'; echo '<option value="2">To kolonner</option>'; echo '<option value="3">Tre kolonner</option>'; echo '<option value="4">Fire kolonne</option>'; ?> </select> <?php form_hidden("redirect", "true"); form_hidden("module_right_2", "mod_pick_style"); form_hidden("layoutselect", "layoutselect"); echo "<br/>"; echo "<br/>"; echo '<div class="optionsheader">Velg språk</div>'; $arrayWithAllLanguageIds = getAllLanguageIds(); $arrayWithAllLanguageNames = getAllLanguageNames(); // Add a choice for viewing articles in all languages array_unshift($arrayWithAllLanguageIds, "-1"); array_unshift($arrayWithAllLanguageNames, "Alle språk"); debug("fra cookie..:" . $languageChoice . "!"); debug("fra cookie..:" . $_REQUEST['languageChoice'] . "!"); form_dropdown("languageChoice", $arrayWithAllLanguageIds, $arrayWithAllLanguageNames, $languageChoice + 1); echo "<br/>"; echo "<br/>"; form_submit("submitlayout", "Endre"); form_end(); echo "</div>"; }
function editArticle() { // Check if session contains variables from previous entry attempt if (isset($_SESSION['save_attempted'])) { $formContents = buildArticleArray($_SESSION); } else { $temp = getAnyArticle($_REQUEST['articleid']); $formContents = buildArticleArray($temp[0]); } if ($formContents['comment_to'] == "NULL") { h3("Rediger artikkel"); } else { h3("Rediger kommentar"); } table_open(); form_start_post(); tr_open(); td_open(1); echo "Tittel"; td_close(); td_open(1); form_textfield("title", fix_quotes($formContents['title'])); td_close(); tr_close(); if ($formContents['comment_to'] == "NULL") { tr_open(); td_open(1); echo "Publiseringsdato"; td_close(); td_open(1); form_datewidget($formContents['date_posted']); td_close(); tr_close(); tr_open(); td_open(1); echo "Publiseringstidspunkt"; td_close(); td_open(1); form_timewidget($formContents['time_posted']); td_close(); tr_close(); tr_open(); td_open(1); echo "Bare lagre, ikke publiser"; td_close(); td_open(1); if ($formContents['is_draft'] == "1") { form_checkbox("is_draft", "1", "1"); } else { form_checkbox("is_draft", "1", "0"); } td_close(); tr_close(); tr_open(); td_open(1); echo "Språk"; td_close(); td_open(1); form_dropdown("language", getAllLanguageIds(), getAllLanguageNames(), $formContents['language']); td_close(); tr_close(); } tr_open(); td_open(2); echo "Tekst"; td_close(); tr_close(); tr_open(); td_open(2); form_textarea("body", stripslashes($formContents['body']), 50, 20); td_close(); tr_close(); tr_open(); td_open(1); form_submit("submit", "Legg opp"); form_submit("submit", "Forhåndsvis"); form_submit("submit", "Avbryt"); td_close(); td_open(1); td_close(); tr_close(); form_hidden("author", $formContents['author']); form_hidden("category", "0"); form_hidden("m_c", "addArticleGUI"); br(); form_hidden("articleid", $formContents['articleid']); form_hidden("comment_to", $formContents['comment_to']); form_hidden("author_username", $formContents['author_username']); form_end(); table_close(); }