示例#1
0
$url_read = htmlspecialchars(lwiki_link_page($pageid));
$url_hist = htmlspecialchars(lwiki_link_page($pageid, 'mode=hist'));
$url_diff = htmlspecialchars(lwiki_link_page($pageid, 'hist=last'));
echo ' [ <a href="' . $url_read . '">' . $ht_page_title . '</a>' . ' | <b>編集</b>' . ' | <a href="' . $url_hist . '">履歴</a>' . ' - <a href="' . $url_diff . '">差分</a>]' . PHP_EOL;
echo '</p>';
echo '<p class="lwiki-linkbar-modified">' . page_modified_date() . '</p>';
echo '<div class="lwiki-page-content">';
if ($lwiki_edit_error != '') {
    echo "{$lwiki_edit_error}";
}
echo '<form method="post" action="' . $frag_action . '" style="width:600px;" id="lwiki_form_edit">';
echo '  ' . $frag_partlength;
echo '  <input type="hidden" name="edithash" value="' . $frag_edithash . '" />';
echo '  <input type="hidden" name="sigma" value="' . $frag_xsrfhash . '" />';
echo '  <textarea name="content" rows="20" style="width:590px;padding:5px;">' . $frag_content . '</textarea>';
echo '  <div><label>備考: <input type="text" style="width:500px;" name="remarks" value="' . $frag_remarks . '" /></label></div>';
echo '  <div style="text-align:center;margin:0.5em;">';
echo '    ' . $frag_captcha;
echo '    <input type="submit" name="page_preview" value="プレビュー" />';
echo '    <input type="submit" name="page_update" value="保存" /></div>';
echo '</form>';
//if($_POST['page_preview']||$_POST['page_update']){
require_once '.lwiki/lib/lib.lwiki.php';
echo '<hr/>' . PHP_EOL;
echo '<div class="lwiki-page-preview" id="lwiki_page_preview">';
echo '<h1 id="lwiki_page_preview_head">プレビュー:' . $ht_page_title . ($frag_partlength ? ' (部分)' : '') . '</h1>';
lwiki_include_string(\lwiki\convert\convert($edit_session->content()));
echo '</div>';
//}
echo '</div><!-- end of .lwiki-page-content -->';
lwiki\page\end_document();
示例#2
0
         header('Location: ' . lwiki_link_page($pageid));
         // flush post data
     }
     exit;
 case 'list':
     include '.lwiki/lib/page.list.php';
     exit;
 case 'hist':
     include '.lwiki/lib/page.hist.php';
     exit;
 case 'convert':
     // (preview 等の実装用に content を変換する)
     require_once '.lwiki/lib/lib.lwiki.php';
     require_once '.lwiki/lib/lib.page.php';
     /* for \lwiki\page\generate_dynamic_link() */
     lwiki_include_string(lwiki\convert\convert($_POST['content']));
     exit;
 default:
     if (@$_GET['hist'] != '') {
         include ".lwiki/lib/page.diff.php";
         exit;
     }
     if (@$_GET['command'] == 'comment-regenerate') {
         require_once ".lwiki/lib/mod_comment.php";
         \lwiki\comment\comment_regenerate();
     } else {
         if (@$_GET['command'] == 'page-convert') {
             require_once ".lwiki/lib/lib.page-edit.php";
             \lwiki\edit\page_convert();
         }
     }
示例#3
0
<p class="lwiki-linkbar-modified"><?php 
echo page_modified_date();
?>
</p>
<div class="lwiki-page-content">
<?php 
// content
$fname_content = '.lwiki/data/page.' . $pageid . '.htm';
$content_exists = file_exists($fname_content);
if ($content_exists) {
    include $fname_content;
} else {
    echo '<p><b>Error</b>: 指定された名前「<b>' . $ht_page_title . '</b> (' . $pageid . ')」のページは存在しません。</p>';
}
// comment
if ($content_exists) {
    echo '<h2 class="comment">コメント</h2>';
    $comment_content = @file_get_contents(".lwiki/data/{$comment_id}.htm");
    if ($comment_content == '') {
        echo "<p>コメントは未だありません</p>";
    } else {
        lwiki_include_string($comment_content);
    }
    $comment_action = lwiki_link_page($pageid) . '#comment-form';
    require_once ".lwiki/lib/mod_comment.php";
    \lwiki\comment\output_comment_form();
}
?>
</div>
<?php 
lwiki\page\end_document();
示例#4
0
if ($_hist->error_message) {
    echo $_hist->error_message;
}
?>
<h2>Wikiソース差分</h2>
<p><?php 
echo "<b>{$h2text}</b> {$hist2_date} by {$hist2_auth} / <b>{$h1text}</b> {$hist1_date} by {$hist1_auth}";
?>
</p>
<div class="lwiki-history-source">
<pre class="agh-prog-txt"><?php 
echo $hist_diff;
?>
</pre>
</div><!-- end of lwiki-history-source -->
<h1><?php 
echo $ht_page_title;
?>
</h1>
<?php 
lwiki_include_string($hist2_html);
?>
</div><!-- end of lwiki-page-content -->
<?php 
$hist2_diff = $_hist->get_fields($h2)[2];
if (substr($hist2_diff, 0, 1) === '!') {
    echo '<h2>履歴データ (差分)</h2>' . PHP_EOL;
    $hist2_diff = htmlspecialchars(urldecode(substr($hist2_diff, 1)));
    echo '<pre class="lwiki-language-sed lwiki-implicit-title" data-lwiki-title="sed">' . $hist2_diff . '</pre>';
}
lwiki\page\end_document();