$row['parent_id'] = 0; $row['title'] = ''; $row['comment'] = ''; $row['content'] = '<b>nothing</b> yet'; if (isset($_POST['wysiwyg']) || isset($_POST['preview'])) { $row['id'] = $_POST['page_id']; $row['parent_id'] = $_POST['parent_id']; $row['title'] = $_POST['title']; $row['comment'] = $_POST['comment']; if (isset($_POST['content'])) { $row['content'] = $_POST['content']; } } elseif (isset($_GET['id'])) { $page = $db->sql_ufetchrow("SELECT * FROM " . $module_prefix . "_pages WHERE id=" . intval($_GET['id']), SQL_ASSOC); if (!empty($page['id'])) { $row = $page; $row['content'] = $page['body']; unset($row['body']); } unset($page); } $wysiwyg = new Wysiwyg('wiki_content', 'content', '100%', '400px', $row['content']); $wysiwyg->setHeader(); require_once 'header.php'; if (isset($_POST['preview'])) { $cpgtpl->assign_block_vars('preview', array('S_TITLE' => $row['title'], 'S_COMMENT' => $row['comment'], 'S_BODY' => $row['content'])); } $cpgtpl->assign_vars(array('G_STARTFORM' => open_form(URL::index('&file=manage'), 'wiki_content', "Manage {$module_name} Content") . '<input type="hidden" name="page_id" value="' . $row['id'] . '" />', 'G_ENDFORM' => close_form(), 'S_WYSSEL' => $wysiwyg->getSelect(), 'S_TITLE' => 'Title: <input type="text" name="title" value="' . htmlspecialchars($row['title']) . '" style="width: 50%" />', 'S_COMMENT' => 'Comment: <input type="text" name="comment" value="' . htmlspecialchars($row['comment']) . '" style="width: 50%" />', 'S_PARENT' => 'Parent page: ' . wiki_create_select($row['parent_id']), 'S_WYSIWYG' => $wysiwyg->getHTML(), 'S_PREVIEW' => '<input type="submit" name="preview" value="Preview" />', 'S_SUBMIT' => isset($_POST['preview']) ? '<input type="submit" name="add_wiki" value="Submit" />' : '')); $cpgtpl->set_filenames(array('body' => 'wiki/manage.html')); $cpgtpl->display('body'); }
<input type="hidden" name="n_group" value="' . $group . '" />'; } // Load the required wysiwyg class require CORE_PATH . 'wysiwyg/wysiwyg.inc'; // Create as many wysiwyg instances as you need $wysiwyg = new Wysiwyg('newsletter', 'content', '90%', '300px', $content); // Set all the required wysiwyg headers $wysiwyg->setHeader(); require 'header.php'; GraphicAdmin('_AMENU5'); OpenTable(); echo '<form name="newsletter" action="' . URL::admin() . '" method="post" enctype="multipart/form-data" accept-charset="utf-8"> ' . $wysiwyg->getSelect() . ' <table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline" style="margin:auto;"> <tr> <td align="center" class="catleft" colspan="2"><b><span class="gen">' . $title . '</span></b></td> </tr>' . $preview . '<tr> <td class="row1"><span class="gen">' . _SUBJECT . '</span></td> <td class="row2"><input type="text" name="subject" size="50" maxlength="255" value="' . htmlprepare($subject) . '" /></td> </tr><tr> <td class="row1"><span class="gen">' . _CONTENT . '</span></td> <td class="row2">' . $wysiwyg->getHTML() . '</td> </tr><tr> <td class="row1"><span class="gen">' . _NL_RECIPS . '</span></td> <td class="row2">' . newsletter_selection('group', $group) . '</td> </tr>' . $notes . '<tr> <td class="catbottom" colspan="2" align="center" height="28"> <input type="submit" name="preview" value="' . _PREVIEW . '" class="mainoption" />' . $submit . ' </td> </tr></table></form>'; CloseTable();
<label class="ulog" for="subject">' . _SUBTITLE . '</label> <input type="text" name="subject" id="subject" size="65" maxlength="80" value="' . $subject . '" /><br /><br /> <label class="ulog" for="topic">' . _TOPIC . '</label> <select name="topic" id="topic">'; $result = $db->sql_query('SELECT topicid, topictext FROM ' . $prefix . '_topics ORDER BY topictext'); echo '<option value="">' . _SELECTTOPIC . "</option>\n"; while ($row = $db->sql_fetchrow($result)) { $sel = $row['topicid'] == $topic ? 'selected="selected" ' : ''; echo "<option {$sel} value=\"{$row['topicid']}\">{$row['topictext']}</option>\n"; } echo '</select><br /><br />'; if ($MAIN_CFG['global']['multilingual']) { echo ' <label class="ulog" for="alanguage">' . _LANGUAGE . '</label> ' . lang_selectbox($alanguage) . '<br /><br />'; } echo ' <label class="ulog">' . _EDITOR_STYLE . '</label> ' . $story_editor->getSelect() . '<br /><br /> ' . _STORYTEXT . '<br /> ' . $story_editor->getHTML() . '<br /> ' . _EXTENDEDTEXT . '<br /> ' . $storyext_editor->getHTML() . '<br /><br /> <div style="text-align:center;"><input type="submit" value="' . _PREVIEW . '" />'; if ($story != '') { echo ' <input type="submit" name="submit" value="' . _OK . '" />'; } echo '</div>' . close_form(); CloseTable(); } }