function template_find($args) { template_common_prologue(array('norobots' => 1, 'title' => 'Find ' . $args['find'], 'heading' => $args['find'] . ' and related pages', 'headlink' => '', 'headsufx' => '', 'toolbar' => 1, 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); ?> <div class="content"> <?php $find = $args['find']; global $pagestore; $searchpage = $pagestore->page($find); $pageExists = $searchpage->exists(); if ($pageExists) { print "<h3>You're probably looking for " . html_ref($find, $find) . ".</h3>"; } else { print "<h3>'" . htmlentities($find) . "' isn't currently a page in the wiki.</h3>"; } if ($args['pages']) { print '<p>Search results for "' . htmlentities($find) . '":<ul>'; if ($args['branch_search']) { print 'Restricted to children of ' . $args['branch_search'] . '<br>'; } print $args['pages'] . "</ul>"; } global $HomePage; print "<p>(Back to " . html_ref($HomePage, $HomePage) . ".)"; ?> </div> <?php template_common_epilogue(array('twin' => '', 'edit' => '', 'editver' => -1, 'history' => '', 'timestamp' => '', 'headlink' => '', 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); }
function template_history($args) { global $DiffScript; //echo "<p>template_history(".print_r($args,True).")</p>"; template_common_prologue(array('norobots' => 1, 'title' => lang('History of') . ' ' . get_title($args['page']), 'heading' => lang('History of') . ' ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1)); ?> <div id="body"> <form method="get" action="<?php print $DiffScript; ?> "> <div class="form"> <input type="hidden" name="action" value="diff" /> <input type="hidden" name="page" value="<?php print $args['page']['name']; ?> " /> <input type="hidden" name="lang" value="<?php print $args['page']['lang']; ?> " /> <table border="0"> <tr><td><strong><?php echo lang('Older'); ?> </strong></td> <td><strong><?php echo lang('Newer'); ?> </strong></td><td></td></tr> <?php print $args['history']; ?> <tr><td colspan="3"> <input type="submit" value="<?php echo lang('Compute Difference'); ?> " /></td></tr> </table> </div> </form> <hr /><br /> <strong><?php echo lang('Changes by last author'); ?> :</strong><br /><br /> <?php print $args['diff']; ?> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => 0, 'history' => '', 'timestamp' => '', 'nosearch' => 0)); }
function template_view($args) { template_common_prologue(array('norobots' => $args['archive'], 'title' => $args['page'], 'heading' => '', 'headlink' => $args['page'], 'headsufx' => $args['archive'] ? ' (' . html_timestamp($args['timestamp']) . ')' : '', 'toolbar' => 1)); ?> <div id="body" align="left"> <?php print $args['html']; ?> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => $args['page'], 'editver' => !$args['editable'] ? -1 : ($args['archive'] ? $args['version'] : 0), 'history' => $args['page'], 'timestamp' => $args['timestamp'], 'nosearch' => 0)); }
function template_find($args) { template_common_prologue(array('norobots' => 1, 'title' => lang('Find') . ' ' . htmlspecialchars($args['find']), 'heading' => lang('Find') . ' ' . htmlspecialchars($args['find']), 'headlink' => '', 'headsufx' => '', 'toolbar' => 1)); ?> <div id="body"> <?php print $args['pages']; ?> </div> <?php template_common_epilogue(array('twin' => '', 'edit' => '', 'editver' => 0, 'history' => '', 'timestamp' => '', 'nosearch' => 0)); }
function template_admin($args) { template_common_prologue(array('norobots' => 1, 'title' => TMPL_Administration, 'heading' => TMPL_Administration, 'headlink' => '', 'headsufx' => '', 'toolbar' => 0)); ?> <div id="body"> <?php print $args['html']; ?> </div> <?php template_common_epilogue(array('twin' => '', 'edit' => '', 'editver' => 0, 'history' => '', 'timestamp' => '', 'nosearch' => 1)); }
function template_admin($args) { template_common_prologue(array('norobots' => 1, 'title' => 'Administration', 'heading' => 'Administration', 'headlink' => '', 'headsufx' => '', 'toolbar' => 0, 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); ?> <div id="body"> <?php print $args['html']; ?> </div> <?php template_common_epilogue(array('nosearch' => 1, 'headlink' => '', 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); }
function template_history($args) { global $DiffScript; template_common_prologue(array('norobots' => 1, 'title' => TMPL_HistoryOf . ' ' . $args['page'], 'heading' => TMPL_HistoryOf . ' ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1)); ?> <div id="body"> <form method="get" action="<?php print $DiffScript; ?> "> <div class="form"> <input type="hidden" name="action" value="diff" /> <input type="hidden" name="page" value="<?php print $args['page']; ?> " /> <table border="0"> <tr><td><strong><?php echo TMPL_Older; ?> </strong></td> <td><strong><?php echo TMPL_Newer; ?> </strong></td><td></td></tr> <?php print $args['history']; ?> <tr><td colspan="3"> <input type="submit" value="<?php echo TMPL_ButtonComputeDifference; ?> " /></td></tr> </table> </div> </form> <hr /><br /> <strong><?php echo TMPL_ChangesLastAuthor; ?> </strong><br /><br /> <?php print $args['diff']; ?> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => 0, 'history' => '', 'timestamp' => '', 'nosearch' => 0)); }
function template_view($args) { template_common_prologue(array('heading' => '', 'headlink' => $args['page'], 'headsufx' => $args['archive'] ? ' (' . html_timestamp($args['timestamp']) . ')' : '', 'norobots' => $args['archive'], 'quote' => 1, 'redirect_from' => $args['redirect_from'], 'title' => $args['page'], 'toolbar' => 1, 'tree' => 1, 'button_selected' => $args['view_source'] ? '' : 'view', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'editver' => $args['editver'], 'button_backlinks' => 1)); ?> <div class="content"> <?php print $args['html']; // Aligns the browser with an HTML anchor, showing the last added comment (or // quote). See: action/save.php, template/save.php, template/view.php. ?> <a name="pageContentBottom"> </div> <?php template_common_epilogue(array('subscribe' => $args['page'], 'twin' => $args['page'], 'edit' => $args['page'], 'editver' => !$args['editable'] ? -1 : ($args['archive'] ? $args['version'] : 0), 'history' => $args['page'], 'euser' => $args['edituser'], 'timestamp' => $args['timestamp'], 'page_length' => $args['page_length'], 'toolbar' => 1, 'headlink' => $args['page'], 'button_selected' => $args['view_source'] ? '' : 'view', 'button_view' => 1, 'button_backlinks' => 1)); }
function template_subscriptions($args) { template_common_prologue(array('norobots' => 1, 'title' => 'Page Subscriptions', 'heading' => 'Page Subscriptions', 'headlink' => '', 'headsufx' => '', 'toolbar' => 0, 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); ?> <form name="subscriptionsForm" action="<?php print $SubscriptionsScript; ?> " method="POST"> <input type="hidden" name="subscribed_pages[]" value=""> <?php if ($args['subscriptions']) { ?> <p> Uncheck any pages you want to remove from your subscriptions. <p> <?php foreach ($args['subscriptions'] as $page) { print '<input type="checkbox" name="subscribed_pages[]" value="' . urlencode($page) . '" checked>'; print ' <a href="' . viewURL($page) . '">' . $page . "</a><br>\n"; } ?> <p> <input type="submit" value="Save"> <?php } else { ?> <p> You have no page subscriptions. <?php } ?> </form> <?php template_common_epilogue(array('nosearch' => 1, 'headlink' => '', 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); }
function template_diff($args) { template_common_prologue(array('norobots' => 1, 'title' => TMPL_DifferencesIn . ' ' . $args['page'], 'heading' => TMPL_DifferencesIn . ' ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1)); ?> <div id="body"> <strong><?php echo TMPL_DifferenceBetweenVersions; ?> </strong><br /><br /> <?php print $args['diff_html']; ?> <hr /> <?php print $args['html']; ?> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => $args['page'], 'editver' => $args['editable'] ? 0 : -1, 'history' => $args['page'], 'timestamp' => $args['timestamp'], 'nosearch' => 0)); }
function template_diff($args) { template_common_prologue(array('norobots' => 1, 'title' => 'Differences in ' . $args['page'], 'heading' => 'Differences in ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1, 'button_selected' => 'diff', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'editver' => $args['editver'], 'button_backlinks' => 1)); ?> <strong>Difference between versions:</strong><br><br> <div class="diff"> <?php print $args['diff_html']; ?> </div> <hr> <strong>Newer version:</strong><br><br> <?php print $args['html']; ?> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => $args['page'], 'editver' => $args['editable'] ? 0 : -1, 'history' => $args['page'], 'timestamp' => $args['timestamp'], 'headlink' => $args['page'], 'button_selected' => 'diff', 'button_view' => 1, 'button_backlinks' => 1)); }
function template_children($args) { template_common_prologue(array('norobots' => 1, 'title' => 'Children of ' . $args['page'], 'heading' => 'Children of ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1, 'button_selected' => '', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'editver' => $args['editver'], 'button_backlinks' => 1)); global $pagestore; $page = $args['page']; $children = $args['children']; ?> <div class="content childtree"> <p> <table cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> <p> <?php if ($children) { $tree = array(); $tree[$page] = array(); foreach ($children as $child) { $tree[$page][$child] = array(); } drawTree($tree); } else { print 'No children'; } ?> </td> </tr> </table> </div> <?php template_common_epilogue(array('twin' => '', 'edit' => '', 'editver' => 0, 'history' => '', 'euser' => $args['edituser'], 'timestamp' => $args['timestamp'], 'headlink' => $args['page'], 'button_selected' => '', 'button_view' => 1, 'button_backlinks' => 1)); }
function template_prefs() { global $PrefsScript, $HTTP_REFERER, $HistMax, $TimeZoneOff; global $AuthorDiff, $EditRows, $EditCols, $UserName, $DayLimit, $MinEntries; template_common_prologue(array('norobots' => 1, 'title' => TMPL_Prefs, 'heading' => TMPL_Prefs, 'headlink' => '', 'headsufx' => '', 'toolbar' => 0)); ?> <div id="body"> <form action="<?php print $PrefsScript; ?> " method="post"> <div class="form"> <input type="hidden" name="referrer" value="<?php print $HTTP_REFERER; ?> " /> <strong>User name</strong><br /><br /> This feature displays your name on RecentChanges to the right of pages you edit. If left blank, your IP address will be displayed instead.<br /><br /> <input type="text" name="user" value="<?php print $UserName; ?> " /><br /> <hr /> <strong>Edit box</strong><br /><br /> Rows: <input type="text" name="rows" value="<?php print $EditRows; ?> " /><br /> Columns: <input type="text" name="cols" value="<?php print $EditCols; ?> " /><br /> <hr /> <strong>History lists</strong><br /><br /> Enter here the maximum number of entries to display in a document's history list.<br /><br /> <input type="text" name="hist" value="<?php print $HistMax; ?> " /><br /><br /> <strong>RecentChanges</strong><br /><br /> Choose your current time here, so the server may figure out what time zone you are in.<br /><br /> <select name="tzoff"> <?php for ($i = -23.5 * 60; $i <= 23.5 * 60; $i += 30) { ?> <option value="<?php print $i; ?> "<?php if ($i == $TimeZoneOff) { print ' selected="selected"'; } ?> ><?php print date('Y-m-d H:i', time() + $i * 60); ?> </option> <?php } ?> </select><br /><br /> Enter here the number of days of edits to display on RecentChanges or any other subscription list. Set this to zero if you wish to see all pages in RecentChanges, regardless of how recently they were edited.<br /><br /> <input type="text" name="days" value="<?php print $DayLimit; ?> " /><br /><br /> <em>But</em> display at least this many entries in RecentChanges and other subscription lists:<br /><br /> <input type="text" name="min" value="<?php print $MinEntries; ?> " /><br /><br /> <input type="checkbox" name="auth"<?php if ($AuthorDiff) { print ' checked="checked"'; } ?> /> History display should show <em>all</em> changes made by the latest author. Otherwise, show only the last change made.<br /> <hr /><br /> <input type="submit" name="Save" value="Save" /> </div> </form> </div> <?php template_common_epilogue(array('twin' => '', 'edit' => '', 'editver' => 0, 'history' => '', 'timestamp' => '', 'nosearch' => 1)); }
function template_conflict($args) { global $EditRows, $EditCols, $UserName, $PrefsScript; template_common_prologue(array('norobots' => 1, 'title' => lang('Editing') . ' ' . $args['page'], 'heading' => lang('Editing') . ' ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1)); ?> <div id="body"> <p class="warning"> <?php echo lang('Warning: since you started editing, this document has been changed by someone else. Please merge your edits into the current version of this document.'); ?> </p> <h1><?php echo lang('Current Version'); ?> </h1> <form method="post" action="<?php print saveURL($args['page']); ?> "> <div class="form"> <input type="submit" name="Save" value="<?php echo lang('Save'); ?> " /> <input type="submit" name="Preview" value="<?php echo lang('Preview'); ?> " /> <?php if ($UserName != '') { print lang('Your user name is "%1".', html_ref($UserName, $UserName)); } else { echo lang('Visit %1 to set your user name', '<a href="' . $PrefsScript . '">' . lang('Preferences') . '</a>'); } ?> <br /> <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?> " /> <textarea name="document" rows="<?php print $EditRows; ?> " cols="<?php print $EditCols; ?> " wrap="virtual"><?php print str_replace('<', '<', str_replace('&', '&', $args['text'])); ?> </textarea><br /> <?php echo lang('Summary of change'); ?> : <input type="text" name="comment" size="40" value="" /><br /> <?php echo lang('Add document to category'); ?> : <input type="text" name="categories" size="40" value="" /> <hr /> <h1><?php echo lang('Your changes'); ?> </h1> <textarea name="discard" rows="<?php print $EditRows; ?> " cols="<?php print $EditCols; ?> " wrap="virtual"><?php print str_replace('<', '<', str_replace('&', '&', $args['usertext'])); ?> </textarea><br /> </div> </form> <h1><?php echo lang('Preview of Current Version'); ?> </h1> <?php print $args['html']; ?> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => 0, 'history' => $args['page'], 'timestamp' => $args['timestamp'], 'nosearch' => 0)); }
function template_prefs() { global $DayLimit, $EditRows, $EmailSuffix, $EnableSubscriptions, $HistMax; global $HTTP_REFERER, $invalid_nick, $MinEntries, $NickName, $prefs_from; global $PrefsScript, $SubscriptionsScript, $TimeZoneOff, $UseHotPages; global $UserName; template_common_prologue(array('norobots' => 1, 'title' => 'UserOptions', 'heading' => 'UserOptions', 'headlink' => '', 'headsufx' => '', 'toolbar' => 0, 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); $referrer = $prefs_from ? $prefs_from : $HTTP_REFERER; ?> <div class="content"> <form action="<?php print $PrefsScript; ?> " method="post"> <div class="form"> <input type="hidden" name="referrer" value="<?php echo htmlspecialchars($referrer); ?> "> <?php if ($UserName) { ?> <strong>You are currently logged in as <?php print $UserName; ?> </strong><br><br> Your login name will appear on the RecentChanges page to the right of pages you edit. <?php } else { ?> <strong>You are not currently logged in.</strong><br><br> If you wish, you may provide a nickname to use on this wiki, it will be used when adding comments and will appear on the RecentChanges page.<br><br> <?php if ($invalid_nick) { ?> <span style="color:red;"><b>WARNING:</b></span> Invalid nickname: "<b><?php echo htmlspecialchars($invalid_nick); ?> </b>". The nickname you provided can not be used since it is already a valid username. Please choose another one.<br><br> <?php } ?> Nickname: <input type="text" name="nickname" value="<?php echo htmlspecialchars($NickName); ?> "> <?php } ?> <br><br> <hr> <?php if ($EnableSubscriptions && isset($EmailSuffix) && $UserName != '') { ?> <strong>Subscriptions</strong><br /><br /> <input type="button" value="Manage subscriptions" onClick="location='<?php print $SubscriptionsScript; ?> '"><br /><br /> <hr /> <?php } ?> <strong>Edit box</strong><br /><br /> Rows: <input type="text" name="rows" value="<?php print $EditRows; ?> " /><br /><br /> <hr /> <strong>History lists</strong><br /><br /> Enter here the maximum number of entries to display in a document's history list.<br /><br /> <input type="text" name="hist" value="<?php print $HistMax; ?> " /><br /><br /> <hr /> <strong>RecentChanges</strong><br /><br /> Choose your current time here, so the server may figure out what time zone you are in.<br /><br /> <select name="tzoff"> <?php for ($i = -23.5 * 60; $i <= 23.5 * 60; $i += 30) { ?> <option value="<?php print $i; ?> "<?php if ($i == $TimeZoneOff) { print ' selected="selected"'; } ?> ><?php print date('Y-m-d H:i', time() + $i * 60); ?> </option> <?php } ?> </select><br /><br /> Enter here the number of days of edits to display on RecentChanges or any other subscription list. Set this to zero if you wish to see all pages in RecentChanges, regardless of how recently they were edited.<br /><br /> <input type="text" name="days" value="<?php print $DayLimit; ?> " /><br /><br /> <em>But</em> display at least this many entries in RecentChanges and other subscription lists:<br /><br /> <input type="text" name="min" value="<?php print $MinEntries; ?> " /><br /><br /> <input type="checkbox" name="hotpages"<?php if ($UseHotPages) { print ' checked="checked"'; } ?> /> Use the Hot Pages flag to indicate pages modified at least 5 times during the last week. This ignores minor edits and multiple subsequent updates by the same user. Note that this might slow down access to the RecentChanges page.<br /><br /> <hr /><br /> <input type="submit" name="Save" value="Save" /> </div> </form> </div> <?php template_common_epilogue(array('nosearch' => 1, 'headlink' => '', 'button_selected' => '', 'button_view' => 0, 'button_backlinks' => 0)); }
function template_history($args) { global $DiffScript, $EnableWordDiff, $full, $ver1; template_common_prologue(array('norobots' => 1, 'title' => 'History of ' . $args['page'], 'heading' => 'History of ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1, 'tree' => 1, 'spam_revert' => 1, 'button_selected' => 'diff', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'editver' => $args['editver'], 'button_backlinks' => 1)); if ($args['diff_mode'] == 1) { $regular_diff_checked = ''; $word_diff_checked = ' checked'; } else { $regular_diff_checked = ' checked'; $word_diff_checked = ''; } ?> <div class="content"> <form method="get" action="<?php print $DiffScript; ?> "> <input type="hidden" name="action" value="history"> <input type="hidden" name="page" value="<?php print $args['page']; ?> "> <?php if ($full) { print '<input type="hidden" name="full" value="1">'; } ?> <div class="form"> <table border="0"> <tr> <td><strong>Older</strong></td> <td><strong>Newer</strong></td> <td></td> </tr> <?php print $args['history']; ?> <tr><td colspan="3"> <input type="submit" value="Compute Difference"> <?php if ($EnableWordDiff) { ?> <input type="radio" id="regular_diff" name="diff_mode" value="0"<?php echo $regular_diff_checked; ?> ><label for="regular_diff">Regular diff</label> <input type="radio" id="word_diff" name="diff_mode" value="1"<?php echo $word_diff_checked; ?> ><label for="word_diff">Word diff</label> <?php } ?> </td></tr> </table> </div> </form> <hr><br> <?php print '<strong>'; if ($ver1) { print 'Difference between versions:'; } else { print 'Changes by last author:'; } print '</strong><br><br>'; if ($args['diff']) { print '<div class="diff">'; print $args['diff']; print '</div>'; } else { print 'There were no differences between the selected versions.'; } ?> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => $args['editver'], 'history' => $args['page'], 'euser' => $args['edituser'], 'timestamp' => $args['timestamp'], 'toolbar' => 1, 'headlink' => $args['page'], 'button_selected' => 'diff', 'button_view' => 1, 'button_backlinks' => 1)); }
function template_conflict($args) { global $categories, $comment, $EditCols, $EditRows, $MaxPostLen, $minoredit; global $PrefsScript, $ShowCategoryBox, $template, $UserName; template_common_prologue(array('norobots' => 1, 'title' => 'Editing ' . $args['page'], 'heading' => 'Editing ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1, 'button_selected' => '', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'button_backlinks' => 1)); if ($args['merge']) { $conflictDoc = $args['merge']; $editBoxTitle = 'Merged Version With Conflicts'; $conflictWarning = 'Please merge the conflicts marked with brackets ' . 'in the box below.'; } else { $conflictDoc = $args['text']; $editBoxTitle = 'Current Version'; $conflictWarning = 'Please merge your edits into the current version ' . 'of this document.'; } ?> <div id="body"> <p class="warning"> <b>Warning! Since you started editing, this document has been changed by someone else. <?php print $conflictWarning; ?> </b> </p> <h1><?php print $editBoxTitle; ?> </h1> <form method="post" action="<?php print saveURL($args['page']); ?> "> <input type="hidden" name="pagesizelimit" value="<?php echo $MaxPostLen; ?> "> <div class="form"> <input type="submit" name="Save" value="Save" onClick="return sizeLimitCheck(this.form, 'document');"> <input type="submit" name="Preview" value="Preview" onClick="return sizeLimitCheck(this.form, 'document');"> <?php if ($UserName != '') { print 'Your user name is ' . html_ref($UserName, $UserName); } else { ?> Visit <a href="<?php print $PrefsScript; ?> ">Preferences</a> to set your user name<?php } ?> <br /> <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?> " /> <textarea name="document" rows="<?php print $EditRows; ?> " cols="<?php print $EditCols; ?> " wrap="virtual"><?php print str_replace('<', '<', str_replace('&', '&', $conflictDoc)); ?> </textarea><br /> <?php print '<input id="minoredit" type="checkbox" name="minoredit" value="1"'; if ($minoredit) { print ' CHECKED'; } print '><label for="minoredit">Minor edit</label> '; print '<input id="template" type="checkbox" name="template" value="1"'; if ($template) { print ' CHECKED'; } print '><label for="template">This page is a template</label> '; ?> <br> Summary of change: <input type="text" name="comment" size="40" maxlength="80" value="" /> <?php if ($ShowCategoryBox) { ?> <br /> Add document to category: <input type="text" name="categories" size="40" value="" /> <?php } ?> <?php if (!$args['merge']) { ?> <hr /> <h1>Your changes</h1> <textarea name="discard" rows="<?php print $EditRows; ?> " cols="<?php print $EditCols; ?> " wrap="virtual"><?php print str_replace('<', '<', str_replace('&', '&', $args['usertext'])); ?> </textarea><br /> <?php } ?> </div> </form> <h1>Preview of Current Version</h1> <?php print $args['html']; ?> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => 0, 'history' => $args['page'], 'timestamp' => $args['timestamp'], 'headlink' => $args['page'], 'button_selected' => '', 'button_view' => 1, 'button_backlinks' => 1)); }
function template_preview($args) { global $categories, $comment, $EditCols, $EditRows, $EnableWordDiff; global $MaxPostLen, $PrefsScript, $ShowCategoryBox, $UserName; $section_title = $args['section'] ? 'section of ' : ''; template_common_prologue(array('norobots' => 1, 'title' => 'Previewing ' . $section_title . $args['page'], 'heading' => 'Previewing ' . $section_title, 'headlink' => $args['page'], 'headsufx' => '', 'tree' => 1, 'toolbar' => 1, 'button_selected' => '', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'button_backlinks' => 1)); if ($args['diff_mode'] == 1) { $regular_diff_checked = ''; $word_diff_checked = ' checked'; } else { $regular_diff_checked = ' checked'; $word_diff_checked = ''; } ?> <div class="editform"> <form method="post" action="<?php print saveURL($args['page']); ?> "> <input type="hidden" name="pagesizelimit" value="<?php echo $MaxPostLen; ?> "> <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?> "> <input type="hidden" name="pagefrom" value="<?php print $args['pagefrom']; ?> "> <input type="hidden" name="section" value="<?php print intval($args['section']); ?> "> <input type="hidden" name="text_before" value="<?php print htmlspecialchars($args['text_before']); ?> "> <input type="hidden" name="text_after" value="<?php print htmlspecialchars($args['text_after']); ?> "> <?php if ($args['archive']) { ?> <input type="hidden" name="archive" value="1" /> <?php } ?> <textarea name="document" rows="<?php print $EditRows; ?> " cols="<?php print $EditCols; ?> " wrap="virtual"><?php print str_replace('<', '<', str_replace('&', '&', $args['text'])); ?> </textarea> <p> <?php print '<input id="minoredit" type="checkbox" name="minoredit" value="1"'; if ($args['minoredit']) { print ' CHECKED'; } print '><label for="minoredit">Minor edit</label> '; print '<input id="template" type="checkbox" name="template" value="1"'; if ($args['template']) { print ' CHECKED'; } print '><label for="template">This page is a template</label> '; ?> <p> Summary of change: <input type="text" name="comment" size="40" maxlength="80" value="<?php print htmlspecialchars($comment); ?> " /><br /> <?php if ($ShowCategoryBox) { ?> Add document to category: <input type="text" name="categories" size="40" value="<?php print htmlspecialchars($categories); ?> " /><br /> <?php } ?> <p> <input type="submit" name="Save" value="Save" onClick="return sizeLimitCheck(this.form, 'document', 'text_before', 'text_after');"> <input type="submit" name="Preview" value="Preview" onClick="return sizeLimitCheck(this.form, 'document', 'text_before', 'text_after');"> <?php if ($UserName != '') { print 'Your user name is ' . html_ref($UserName, $UserName); } else { ?> Visit <a href="<?php print $PrefsScript; ?> ">Preferences</a> to set your user name<?php } if ($args['diff']) { ?> | <a href="#changes">View changes in this edit</a> <?php } ?> <div class="content"> <h1>Preview</h1> <hr /> <?php print $args['html']; ?> </div> <br> <strong>Confirm changes to above document?</strong><br> <input type="submit" name="Save" value="Save" onClick="return sizeLimitCheck(this.form.document);"> <input type="submit" name="Preview" value="Preview" onClick="return sizeLimitCheck(this.form.document);"> <p> <?php if ($args['diff']) { ?> <a name="changes"></a> <div class="content"> <h1>Changes in this edit</h1><p> <?php if ($EnableWordDiff) { ?> Diff method: <input type="radio" id="regular_diff" name="diff_mode" value="0"<?php echo $regular_diff_checked; ?> ><label for="regular_diff">Regular diff</label> <input type="radio" id="word_diff" name="diff_mode" value="1"<?php echo $word_diff_checked; ?> ><label for="word_diff">Word diff</label> <?php } ?> <?php if ($args['diff']) { print '<div class="diff">' . $args['diff'] . '</div>'; } else { print 'There were no changes made in this edit.'; } ?> </div> <?php } ?> </div> </form> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => -1, 'history' => $args['page'], 'euser' => $args['edituser'], 'timestamp' => $args['timestamp'], 'headlink' => $args['page'], 'button_selected' => '', 'button_view' => 1, 'button_backlinks' => 1)); }
function template_edit($args) { global $EditRows, $EditCols, $UserName, $PrefsScript; template_common_prologue(array('norobots' => 1, 'title' => TMPL_Editing . ' ' . $args['page'], 'heading' => TMPL_Editing . ' ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1)); ?> <div id="body"> <form method="post" action="<?php print saveURL($args['page']); ?> "> <div class="form"> <input type="submit" name="Save" value="<?php echo TMPL_ButtonSave; ?> " /> <input type="submit" name="Preview" value="<?php echo TMPL_ButtonPreview; ?> " /> <?php if ($UserName != '') { print TMPL_YourUsername . ' ' . html_ref($UserName, $UserName); } else { echo TMPL_VisitPrefs . "\n"; } ?> <br /> <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?> " /> <?php if ($args['archive']) { ?> <input type="hidden" name="archive" value="1" /> <?php } ?> <textarea name="document" rows="<?php print $EditRows; ?> " cols="<?php print $EditCols; ?> " wrap="virtual"><?php print str_replace('<', '<', str_replace('&', '&', $args['text'])); ?> </textarea><br /> <?php echo TMPL_SummaryOfChange; ?> <input type="text" name="comment" size="40" value="" /><br /> <?php echo TMPL_AddToCategory; ?> <input type="text" name="categories" size="40" value="" /> </div> </form> </div> <?php template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => '', 'history' => $args['page'], 'timestamp' => $args['timestamp'], 'nosearch' => 0)); }
function template_edit($args) { global $EditCols, $EditRows, $MaxPostLen, $PrefsScript, $ShowCategoryBox; global $UserName; $section_title = $args['section'] ? 'section of ' : ''; template_common_prologue(array('norobots' => 1, 'title' => 'Editing ' . $section_title . $args['page'], 'heading' => 'Editing ' . $section_title, 'headlink' => $args['page'], 'headsufx' => '', 'tree' => 1, 'toolbar' => 1, 'button_selected' => 'edit', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'editver' => $args['editver'], 'button_backlinks' => 1)); ?> <div class="editform"> <form method="post" action="<?php print saveURL($args['page']); ?> "> <input type="hidden" name="pagesizelimit" value="<?php echo $MaxPostLen; ?> "> <input type="hidden" name="nextver" value="<?php print $args['nextver']; ?> "> <input type="hidden" name="pagefrom" value="<?php print $args['pagefrom']; ?> "> <input type="hidden" name="section" value="<?php print intval($args['section']); ?> "> <input type="hidden" name="text_before" value="<?php print htmlspecialchars($args['text_before']); ?> "> <input type="hidden" name="text_after" value="<?php print htmlspecialchars($args['text_after']); ?> "> <?php if ($args['archive']) { print '<input type="hidden" name="archive" value="1">'; } ?> <div class="form"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td> </td> <td align="right"> </td> </tr> </table> <?php print "<textarea name=\"document\" rows=\"{$EditRows}\" cols=\"{$EditCols}\" wrap=\"virtual\">"; print htmlspecialchars($args['text']); print '</textarea>'; ?> <br> <div align=right> <?php if ($args['templates'] && !$args['section']) { print 'Templates: <select name="templateName">' . "\n"; print '<option value="">-- Select a template --' . "\n"; foreach ($args['templates'] as $template_name) { print '<option value="' . htmlspecialchars($template_name) . '"'; if ($template_name == $args['use_template']) { print ' selected'; } print '>' . htmlspecialchars($template_name) . "\n"; } print '</select>' . "\n"; $js_page = str_replace('\\', '\\\\', $args['page']); $js_page = str_replace('\'', '\\\'', $js_page); print '<input type="button" name="useTemplateButton" value="Use" ' . 'onClick="useTemplate(this.form.templateName, ' . "'{$js_page}'" . ')">' . "\n"; } ?> </div> <?php $minorEditChecked = substr($args['page'], -8) == 'Schedule' ? ' checked' : ''; print '<input id="minoredit" type="checkbox" name="minoredit" value="1"' . $minorEditChecked . '><label for="minoredit">Minor edit</label> '; print '<input id="template" type="checkbox" name="template" value="1"' . ($args['template'] ? ' checked' : '') . '>' . '<label for="template">This page is a template</label> '; ?> <p> Summary of change: <input type="text" name="comment" size="40" maxlength="80" value=""><br> <?php if ($ShowCategoryBox) { ?> Add document to category: <input type="text" name="categories" size="40" value=""><br> <?php } ?> <p> <input type="submit" name="Save" value="Save" onClick="return sizeLimitCheck(this.form, 'document', 'text_before', 'text_after');"> <input type="submit" name="Preview" value="Preview" onClick="return sizeLimitCheck(this.form, 'document', 'text_before', 'text_after');"> <?php if ($UserName != '') { print 'Your user name is ' . html_ref($UserName, $UserName); } else { print "Visit <a href=\"{$PrefsScript}\">Preferences</a> to set your user name"; } ?> <br> </div> <!-- Class form --> </form> </div> <!-- Body --> <?php template_common_epilogue(array('twin' => $args['page'], 'history' => $args['page'], 'euser' => $args['edituser'], 'timestamp' => $args['timestamp'], 'headlink' => $args['page'], 'button_selected' => 'edit', 'button_view' => 1, 'editver' => $args['editver'], 'button_backlinks' => 1)); }
function template_backlinks($args) { template_common_prologue(array('norobots' => 1, 'title' => 'Backlinks of ' . $args['page'], 'heading' => 'Backlinks of ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1, 'tree' => 1, 'button_selected' => 'backlinks', 'button_view' => 1, 'timestamp' => $args['timestamp'], 'editver' => $args['editver'], 'button_backlinks' => 1)); global $pagestore, $UserName; $page = $args['page']; $backlinks = $args['backlinks']; $parents = $args['parents']; $form_action = $UserName ? reparentURL($page) : '?'; ?> <div class="content"> <?php if ($args['haschildren']) { ?> <p>See <a href="<?php echo childrenURL($page); ?> ">children of <?php echo $page; ?> </a>. <?php } else { ?> <p>No children exist for <?php echo $page; ?> . <?php } ?> <form name="reparentForm" action="<?php print $form_action; ?> " method="POST"> <div class="form"> <p> <?php print html_ref($page, $page); ?> is linked on the following pages: <p> <table cellspacing="0" cellpadding="0" border="0"> <tr class="backlinksHeader"> <td><b>Parent?</b></td> <td> </td> <td><b>Backlink</b></td> </tr> <?php foreach ($backlinks as $backlink) { if ($backlink != $page) { if (in_array($backlink, $parents)) { $checked = " checked"; } else { $checked = ""; } print '<tr>'; print '<td align="center"><input type="checkbox" name="parents[]" value="' . $backlink . '"' . $checked . '></td>'; print '<td> </td>'; print '<td>' . html_ref($backlink, $backlink) . '</td>'; print '</tr>'; } } ?> </table> </p> <?php $tempText = ''; foreach ($parents as $parent) { if (!in_array($parent, $backlinks)) { $tempText .= '<tr>'; $tempText .= '<td align="center"><input type="checkbox" name="parents[]" value="' . $parent . '" checked></td>'; $tempText .= '<td> </td>'; $tempText .= '<td>' . html_ref($parent, $parent) . '</td>'; $tempText .= '</tr>'; } } if ($tempText) { print html_ref($page, $page) . ' is NOT linked on the following pages but is still referring to them as parents:'; print '<p>'; print '<table cellspacing="0" cellpadding="0" border="0">'; print '<tr class="notBacklinksHeader">'; print '<td><b>Parent?</b></td>'; print '<td> </td>'; print '<td><b>Not backlink</b></td>'; print '</tr>'; print $tempText; print '</table>'; print '</p>'; } ?> <?php if ($UserName) { ?> <p> <input type="submit" name="reparentButton" value="Reparent"> </p> <?php } ?> </div> </form> </div> <?php template_common_epilogue(array('twin' => '', 'edit' => '', 'editver' => 0, 'history' => '', 'euser' => $args['edituser'], 'timestamp' => $args['timestamp'], 'toolbar' => 1, 'headlink' => $args['page'], 'button_selected' => 'backlinks', 'button_view' => 1, 'button_backlinks' => 1)); }