示例#1
0
function toolbar($page, $args)
{
    // view
    toolbar_button($args['button_view'] ? viewURL($args['headlink']) : '', 'View', $args['button_selected'] == 'view');
    // edit
    $edit_label = 'Edit';
    if (isset($args['editver']) && $args['editver'] > -1) {
        if ($args['editver'] == 0) {
            $edit_url = editURL($args['headlink']);
        } else {
            $edit_url = editURL($args['headlink'], $args['editver']);
            $edit_label = 'Edit Archive';
        }
    } else {
        $edit_url = '';
    }
    toolbar_button($edit_url, $edit_label, $args['button_selected'] == 'edit');
    // diff
    $diff_url = isset($args['timestamp']) && $args['timestamp'] != '' ? historyURL($args['headlink']) : '';
    toolbar_button($diff_url, 'Diff', $args['button_selected'] == 'diff');
    // backlinks
    $backlinks_url = $args['button_backlinks'] && $args['headlink'] ? backlinksURL($args['headlink']) : '';
    toolbar_button($backlinks_url, 'Backlinks', $args['button_selected'] == 'backlinks');
    // toolbar buttons added by macros
    global $macroToolbarButtons;
    ksort($macroToolbarButtons);
    foreach ($macroToolbarButtons as $macro => $label) {
        toolbar_button(macroURL($page, $macro, ''), $label, false);
    }
}
示例#2
0
function action_rss()
{
    global $pagestore, $min, $days;
    $itemseq = '';
    $itemdesc = '';
    if ($min == 0) {
        $min = 10;
    }
    if ($days == 0) {
        $days = 2;
    }
    $pages = $pagestore->allpages();
    usort($pages, 'catSort');
    $now = time();
    for ($i = 0; $i < count($pages); $i++) {
        $editTime = mktime(substr($pages[$i][0], 8, 2), substr($pages[$i][0], 10, 2), substr($pages[$i][0], 12, 2), substr($pages[$i][0], 4, 2), substr($pages[$i][0], 6, 2), substr($pages[$i][0], 0, 4));
        if ($days >= 0 && $now - $editTime > $days * 24 * 60 * 60 && $i >= $min) {
            break;
        }
        $itemseq = $itemseq . '                <rdf:li rdf:resource="' . viewURL($pages[$i][1], $pages[$i][7]) . '" />' . "\n";
        $itemdesc = $itemdesc . '    <item rdf:about="' . viewURL($pages[$i][1], $pages[$i][7]) . '">' . "\n" . '        <title>' . $pages[$i][1] . '</title>' . "\n" . '        <link>' . viewURL($pages[$i][1]) . '</link>' . "\n" . '        <description>' . $pages[$i][5] . '</description>' . "\n" . '        <dc:date>' . html_gmtime($pages[$i][0]) . '</dc:date>' . "\n" . '        <dc:contributor>' . "\n" . '            <rdf:Description wiki:host="' . $pages[$i][2] . '"' . ($pages[$i][3] == '' ? '' : ' link="' . viewURL($pages[$i][3]) . '"') . '>' . "\n" . ($pages[$i][3] == '' ? '' : '                <rdf:value>' . $pages[$i][3] . '</rdf:value>' . "\n") . '            </rdf:Description>' . "\n" . '        </dc:contributor>' . "\n" . '        <wiki:status>updated</wiki:status>' . "\n" . '        <wiki:importance>major</wiki:importance>' . "\n" . '        <wiki:diff>' . historyURL($pages[$i][1]) . '</wiki:diff>' . "\n" . '        <wiki:version>' . $pages[$i][7] . '</wiki:version>' . "\n" . '        <wiki:history>' . historyURL($pages[$i][1]) . '</wiki:history>' . "\n" . '    </item>' . "\n";
    }
    template_rss(array('itemseq' => $itemseq, 'itemdesc' => $itemdesc));
}
function template_common_epilogue($args)
{
    global $FindScript, $pagestore, $PrefsScript, $AdminScript;
    //echo "<p>template_common_epilogue(".print_r($args,True).")</p>";
    ?>
<div id="footer">
<hr align=left width=99% />
<?php 
    if (!$args['nosearch']) {
        ?>
	
    <form method="POST" action="<?php 
        print $FindScript;
        ?>
" name="thesearch">
      <div class="form">
        <input type="hidden" name="action" value="find" />
<?php 
    }
    if ($args['edit']) {
        if ($args['editver'] == 0) {
            echo '<a href="' . editURL($args['edit']) . '">' . lang('Edit this document') . '</a>';
        } else {
            if ($args['editver'] == -1) {
                echo lang('This page can not be edited.');
            } else {
                echo '<a href="' . editURL($args['edit'], $args['editver']) . '">' . lang('Edit this <em>ARCHIVE VERSION</em> of this document') . '</a>';
            }
        }
        if ($args['history']) {
            print ' | ';
        }
    }
    if ($args['history']) {
        echo '<a href="' . historyURL($args['history']) . '">' . lang('View document history') . '</a>';
        echo ' | <a href="' . $PrefsScript . '">' . lang('Preferences') . '</a>';
        if (!$args['nosearch']) {
            echo '| ' . lang('Search') . ': <input type="text" name="find" size="20" />';
        }
        echo "<br />";
    }
    if ($args['timestamp']) {
        echo lang('Document last modified') . ' ' . html_time($args['timestamp']) . '<br />';
    }
    ?>
      </div>
    </form>
<?php 
    if ($args['twin'] != '') {
        if (count($twin = $pagestore->twinpages($args['twin']))) {
            echo lang('Twin pages') . ': ';
            for ($i = 0; $i < count($twin); $i++) {
                print html_twin($twin[$i][0], $twin[$i][1]) . ' ';
            }
            ?>
<br /><?php 
        }
    }
    if (!$args['nosearch'] && $args['history']) {
        echo "\n<hr align=left width=99% />\n";
    }
    ?>
</div>
<?php 
    //</body>
    //</html>
    /*
      $size = ob_get_length();
      ##header("Content-Length: $size");
      ob_end_flush();
    */
}
示例#4
0
function latex_fullhistory($page, $count)
{
    return '<tr><td colspan="3"><strong><a href="' . historyURL($page, 1) . '">' . PARSE_CompleteListStart . $count . PARSE_CompleteListEnd . '</a></strong></td></tr>';
}
示例#5
0
function html_fullhistory($page, $count)
{
    return '<tr><td colspan="3"><strong><a href="' . historyURL($page, 1) . '" class="wiki">' . lang('See complete list (%1 entries)', $count) . '</a></strong></td></tr>';
}
示例#6
0
function html_fullhistory($page, $count)
{
    return '<tr><td colspan="3"><strong><a href="' . historyURL($page, 1) . '">' . 'See complete list (' . $count . ' entries)</a></strong></td></tr>';
}
示例#7
0
function template_common_epilogue($args)
{
    global $FindScript, $pagestore;
    ?>
<div id="footer">
<hr />
<div id="toolbar-bottom">
<?php 
    if ($args['edit']) {
        if ($args['editver'] == 0) {
            echo '<a href="' . editUrl($args['edit']) . '">' . TMPL_EditDocument . '</a>';
        } else {
            if ($args['editver'] == -1) {
                echo TMPL_NoEditDocument;
            } else {
                echo '<a href="' . editUrl($args['edit'], $args['editver']) . '">' . TMPL_EditArchiveVersion . '</a>';
            }
        }
        if ($args['history']) {
            print ' | ';
        }
    }
    if ($args['history']) {
        echo '<a href="' . historyURL($args['history']) . '">' . TMPL_ViewDocHistory . '</a><br />';
    }
    if ($args['timestamp']) {
        echo "\n</div>\n" . TMPL_DocLastModified . ' ' . html_time($args['timestamp']) . '<br />';
    }
    if ($args['twin'] != '') {
        if (count($twin = $pagestore->twinpages($args['twin']))) {
            echo TMPL_TwinPages . ' ';
            for ($i = 0; $i < count($twin); $i++) {
                print html_twin($twin[$i][0], $twin[$i][1]) . ' <br />';
            }
        }
    }
    if (!$args['nosearch']) {
        ?>
<form method="get" action="<?php 
        print $FindScript;
        ?>
">
<div class="form">
  <input type="hidden" name="action" value="find" />
  <?php 
        print TMPL_Search;
        ?>
 <input type="text" name="find" size="20" />
</div>
</form>
<?php 
    }
    ?>
</div>
<!-- Commented out since this is done via Group-Office framework
</body>
</html>
-->
<?php 
    // Following three lines are commented out since this is done via Group-Office framework
    //  $size = ob_get_length();
    //  header("Content-Length: $size");
    //  ob_end_flush();
}