Exemplo n.º 1
0
function admRename(&$session, $message)
{
    global $rename_oldname, $rename_newname, $rename_backlinks;
    $session->trace(TC_Gui1, 'admRename');
    guiHeader($session, 'Umbenennen einer Seite');
    guiHeadline($session, 1, 'Umbenennen einer Seite');
    if (!empty($message)) {
        guiParagraph($session, $message, false);
    }
    guiStartForm($session, 'Form', P_Rename);
    echo '<table border="0">';
    echo '<tr><td>Bisheriger Name:</td><td>';
    guiTextField('rename_oldname', $rename_oldname, 64, 64);
    echo '<tr><td>Neuer Name:</td><td>';
    guiTextField('rename_newname', $rename_newname, 64, 64);
    echo '</td></tr>' . "\n";
    echo '<tr><td></td><td>';
    guiButton('rename_info', 'Info');
    if (!empty($rename_oldname) && !empty($rename_newname)) {
        echo ' | ';
    }
    guiButton('rename_rename', 'Umbenennen');
    echo '<br>';
    guiCheckBox('rename_backlinks', 'Alle Verweise umbenennen', !isset($rename_backlinks) || $rename_backlinks == C_CHECKBOX_TRUE);
    echo '</td></tr></table>' . "\n";
    guiFinishForm($session);
    if (!empty($rename_oldname) && dbPageId($session, $rename_oldname) > 0) {
        $row = dbFirstRecord($session, 'select page,text,createdby,createdat from ' . dbTable($session, T_Text) . ' where replacedby is null and text like ' . dbSqlString($session, "%{$rename_oldname}%"));
        if (!$row) {
            guiParagraph($session, '+++ keine Verweise gefunden', false);
        } else {
            echo '<table border="1"><tr><td>Seite:</td><td>Typ:</td>' . '<td>von</td><td>Letzte &Auml;nderung</td><td>Fundstelle</td></tr>';
            while ($row) {
                $pagerecord = dbGetRecordById($session, T_Page, $row[0], 'name,type');
                $text = findTextInLine($row[1], $rename_oldname, 10, true);
                if (!empty($text)) {
                    echo "\n<tr><td>";
                    guiInternLink($session, encodeWikiName($session, $pagerecord[0]), $pagerecord[0], M_Base);
                    echo '</td><td>';
                    echo $pagerecord[1];
                    echo '</td><td>';
                    echo $row[2];
                    echo '</td><td>';
                    echo htmlentities($row[3]);
                    echo '</td><td>';
                    echo $text;
                    echo "</td><tr>\n";
                }
                $row = dbNextRecord($session);
            }
            echo "\n</table>\n";
        }
    }
    guiFinishBody($session, null);
}
Exemplo n.º 2
0
function guiPageLinks(&$session, $prefix, $page_no, $pages)
{
    $session->trace(TC_Gui2, 'guiPageLinks');
    if ($pages != 1) {
        if ($page_no == 1) {
            echo 'Seite 1';
        } else {
            guiInternLink($session, $prefix . '&page_no=1', 'Seite 1');
        }
        $min = $page_no < 5 ? 2 : $page_no - 2;
        $max = $page_no > $pages - 3 ? $pages : $page_no + 2;
        for ($ii = $min; $ii <= $max; $ii++) {
            echo $ii == $min && $min > 2 ? '...' : ', ';
            if ($ii == $page_no) {
                echo $ii;
            } else {
                guiInternLink($session, $prefix . '&page_no=' . $ii, $ii);
            }
        }
        if ($max < $pages) {
            echo $max < $pages - 1 ? '...' : ', ';
            guiInternLink($session, $prefix . '&page_no=' . $pages, $pages);
        }
    }
}
Exemplo n.º 3
0
function modStandardLinks(&$session)
{
    guiInternLink($session, P_Home, "Überblick", "index");
    echo ' | ';
    baseStandardLink($session, P_ForumHome);
    echo ' | ';
    baseStandardLink($session, P_ForumSearch);
}
Exemplo n.º 4
0
function writeWikiName($name, $text, &$status)
{
    $status->trace(TC_Util2, "WriteWikiName: {$name} / {$text}");
    if ($text == '') {
        $text = $name;
    }
    if (substr($name, 0, 1) == "!") {
        echo htmlentities(substr($name, 1));
    } else {
        normWikiName($status->fSession, $name);
        if (dbPageId($status->fSession, $name) > 0) {
            guiInternLink($status->fSession, $name, $text);
        } else {
            guiPageReference($status->fSession, $name, $text);
        }
    }
}
Exemplo n.º 5
0
function admHome(&$session)
{
    global $session_id, $session_user;
    guiHeader($session, 'Adminstration-Startseite f&uuml;r ' . $session->fUserName);
    guiParagraph($session, 'Willkommen ' . $session->fUserName, false);
    echo '<p>';
    guiInternLink($session, A_Param, "Parameter");
    echo '</p>';
    echo '<p>';
    guiInternLink($session, A_Forum, "Forum");
    echo '</p>';
    echo '<p>';
    guiInternLink($session, A_ExportPages, "Seitenexport");
    echo '</p>';
    // echo 'Session-Id: ' . $session_id . ' User: ' . $session_user . '<br>';
    guiFinishBody($session, null);
}
Exemplo n.º 6
0
function baseLastChanges(&$session)
{
    global $last_days;
    $headline = 'Übersicht über die letzten Änderungen';
    guiStandardHeader($session, $headline, Th_StandardHeader, Th_StandardBodyStart);
    if (!isset($last_days) || $last_days < 1) {
        $last_days = 7;
    }
    guiStartForm($session);
    echo '<p>Zeitraum: die letzten ';
    guiTextField('last_days', $last_days, 3, 4);
    echo ' Tage ';
    guiButton('last_refresh', 'Aktualisieren');
    echo '</p>' . "\n";
    echo '<table border="0">' . "\n";
    for ($day = 0; $day <= $last_days; $day++) {
        $date = localtime(time() - $day * 86400);
        $time_0 = strftime('%Y.%m.%d', time() - $day * 86400);
        $time_2 = mktime(0, 0, 0, $date[4] + 1, $date[3], $date[5]);
        $time_1 = dbSqlDateTime($session, $time_2);
        $condition = 't.createdat>=' . $time_1 . ' and t.createdat<=' . str_replace('00:00:00', '23:59:59', $time_1);
        $rec = dbFirstRecord($session, 'select t.id,p.name,t.createdby,t.createdat,t.replacedby,p.id from ' . dbTable($session, T_Text) . ' t, ' . dbTable($session, T_Page) . ' p where p.id=t.page and ' . $condition . ' order by createdat desc');
        if ($rec) {
            echo '<tr><td><b>';
            echo $time_0;
            echo '</b></td></tr>' . "\n";
            do {
                echo '<tr><td>';
                echo dbSingleValue($session, 'select min(id) from ' . dbTable($session, T_Text) . ' where page=' . $rec[5]) == $rec[0] ? 'Neu' : 'Änderung';
                echo '</td><td>';
                echo $rec[0];
                echo '</td><td>';
                echo guiInternLink($session, $rec[1], $rec[1]);
                echo '</td><td>';
                guiAuthorLink($session, $rec[2]);
                echo '</td><td>';
                echo dbSqlDateToText($session, $rec[3]);
                $pred_rec = dbSingleValue($session, 'select max(id) from ' . dbTable($session, T_Text) . ' where page=' . $rec[5] . ' and createdat<' . dbSqlDateTime($session, $time_2));
                if ($pred_rec > 0) {
                    echo '</td><td>';
                    guiInternLink($session, $rec[5] . '?action=' . A_Diff . '&text_id=' . $rec[0] . '&text_id2=' . $pred_rec, 'Unterschied zum Vortag (' . $pred_rec . ')');
                }
                echo '</td></tr>' . "\n";
            } while (($rec = dbNextRecord($session)) != null);
        }
        /*		if (false){
        		$ids = dbIdList2 ($session, T_Text, 'distinct page', $condition);
        		if ($ids) {
        			echo '<tr><td><b>';
        			echo $time_0;
        			echo'</b></td></tr>' . "\n";
        			foreach ($ids as $ii => $pageid) {
        				$page = dbGetRecordById ($session, T_Page, $pageid, 'name');
        				$text = dbFirstRecord ($session,
        					'select id,createdby,createdat,replacedby from '
        				. dbTable ($session, T_Text) . ' where page=' . (0 + $pageid)
        				. ' and ' . $condition . ' order by id desc');
        				$count = 0;
        				while ($text) {
        					$pred_text = dbSingleValue ($session, 'select max(id) from '
        						. dbTable ($session, T_Text) . ' where page=' . $pageid
        						. ' and createdat<'
        						. dbSqlDateTime ($session, $time_2));
        					echo '<tr><td>';
        					echo dbSingleValue ($session, 'select min(id) from '
        						. dbTable ($session, T_Text) . ' where page=' . $pageid)
        						== $text [0] ? 'Neu' : 'Änderung';
        					echo '</td><td>';
        					echo $text [0];
        					echo '</td><td>';
        					echo $count++ > 0 ? htmlentities ($page [0])
        						: guiInternLink ($session, $page [0], $page [0]);
        					echo '</td><td>';
        					guiAuthorLink ($session, $text [1]);
        					echo '</td><td>';
        					echo dbSqlDateToText ($session, $text [2]);
        					if ($pred_text > 0) {
        						echo '</td><td>';
        						guiInternLink ($session, $page [0] . '?action=' . A_Diff
        							. '&text_id=' . $pred_text . '&text_id2=' . $text [0],
        							'Unterschied zum Vortag (' . $pred_text . ')');
        					}
        					echo '</td></tr>' . "\n";
        					$text = dbNextRecord ($session);
        				}
        			}
        		}
        		} */
    }
    echo '</table>';
    guiStandardBodyEnd($session, Th_StandardBodyEnd);
}