Exemplo n.º 1
0
 function DrawPublicationEditor($uid, $formname = '', $id = '')
 {
     $tmp = '';
     if ($id == '') {
         $id = $this->dbids[$this->uids[$uid]];
     }
     if (!$this->GetAllowed('EDITINFO')) {
         return;
     }
     content_url_var_push_global('redirect');
     content_url_var_push_global('function');
     content_url_var_push_global('uid');
     $r = db_row_value($this->settings['content'], '`id`=' . $id);
     $c = $this->SpawnDataset();
     $c->SetFieldValues($r);
     if ($tmp != '') {
         println('<span class="contentSub">Редактирование публикации за <b>' . format_ltime($r['timestamp']) . '</b></span>');
     }
     $c->DrawEditorForm($formname, content_url_get_full() . '&id=' . $id);
 }
Exemplo n.º 2
0
 function DrawCatItemHistory($cat_id, $uid)
 {
     $data = $this->GetCatItemHistory($cat_id, $uid);
     $n = count($data);
     println('<ul id="history">');
     $delinfo = $this->GetAllowed('DELETEINFO');
     $editinfo = $this->GetAllowed('EDITINFO');
     $full = content_url_get_full();
     for ($i = 0; $i < $n; $i++) {
         $r = $data[$i];
         $actions = '';
         $time = '<a href="' . $full . '&iid=' . $r['id'] . '">' . format_ltime($r['timestamp']) . '</a>';
         $user = user_generate_info_string($r['user_id']);
         if ($editinfo) {
             $actions .= '[<a href="' . $full . '&action=rollback&iid=' . $r['id'] . '">Вернуться к этой версии</a>]';
         }
         if ($delinfo) {
             $actions .= stencil_ibtnav('minus_s.gif', $full . '&action=delete&iid=' . $r['id'], 'Удалить', 'Удалить этот эдемент?');
         }
         println('<li><div' . ($i < 2 ? ' class="top"' : '') . '>' . "{$time} | {$user}" . ($actions != '' ? " | {$actions}" : '') . '</div></li>');
     }
     println('</ul>');
 }
Exemplo n.º 3
0
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
global $self, $wiki, $action, $history, $id;
$content = content_lookup(dirname(dirname($self)));
if ($content != null) {
    if (!$content->GetAllowed('EDIT')) {
        header('Location: .');
    } else {
        ?>
<div id="navigator"><?php 
        echo $content->GetName();
        echo $history != '' ? ' (' . format_ltime($cur_version['timestamp']) . ')' : '';
        ?>
</div>
<div class="contentSub">Журнал изменений</div>
${information}
<?php 
        if (user_id() < 0) {
            add_info('Вы не представились системе. Выйдите из этого раздела, если вы не нуждаетесь во внесении изменений в эту статью. ' . 'Так или иначае, Ваш IP-адрес протрассирован и сохранен, все Ваши действия журналируются. Если Вы совершите противозаконные действия, оговорённые УК РФ, то мы оставляем за собой право сообщить об этих действиях в правоохранительные органы.');
        }
        $content->Editor_DrawHistory();
    }
} else {
    print '${information}';
    add_info('Невозмонжно отобразить страницу, так как запрашиваемый раздел поврежден или не существует. Извините.');
}
Exemplo n.º 4
0
 *
 * Data script for catalogue
 *
 * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**>
 *
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
global $self, $wiki, $action, $history, $id, $oldid;
$content = content_lookup(dirname($self));
$subnav = '';
if ($content != null) {
    if ($content->GetAllowed('READ')) {
        $pIFACE = $content->GetData();
        if ($oldid != '' && $content->GetAllowed('EDIT')) {
            $subnav = '<div class="contentSub">Содержимое статьи на: <b>' . format_ltime($pIFACE->GetTimestamp()) . '</b></div>';
        }
        $content->Editor_DrawContent(array('subnav' => $subnav));
        draw_template('Статья / Нижний колонтитул');
    } else {
        print '${information}';
        add_info('Извините, но просмотр содержимого этого разделя для Вас запрещен.');
    }
} else {
    print '${information}';
    add_info('Невозмонжно отобразить страницу, так как запрашиваемый раздел поврежден или не существует. Извините.');
}
Exemplo n.º 5
0
 * Page generation script for pyblication entry
 *
 * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**>
 *
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
global $self, $uid, $oldid, $pIFACE;
$content = content_lookup(dirname(dirname($self)));
$subnav = '';
if ($content != null) {
    if ($content->GetAllowed('READ')) {
        $pIFACE = $content->GetData();
        if ($oldid != '' && $content->GetAllowed('EDIT')) {
            $data = $pIFACE->GetListRowbyId($oldid);
            $subnav = '<div class="contentSub">Содержимое статьи на: <b>' . format_ltime($data['timestamp']) . '</b></div>';
        }
        $pIFACE->Editor_DrawItem($uid, array('subnav' => $subnav));
        draw_template('Статья / Нижний колонтитул');
    } else {
        print '${information}';
        add_info('Извините, но просмотр содержимого этого разделя для Вас запрещен.');
    }
} else {
    print '${information}';
    add_info('Невозмонжно отобразить страницу, так как запрашиваемый раздел поврежден или не существует. Извините.');
}
Exemplo n.º 6
0
        function Editor_LogView()
        {
            global $CORE;
            $CORE->AddStyle('log');
            formo('title=Просмотр журналов');
            global $count, $display;
            if ($count != 512 && $count != 1024 && $count != -1) {
                $count = 256;
            }
            $clause = '';
            if ($display == 'error') {
                $clause = '`status`="ERROR"';
            }
            if ($display == 'warning') {
                $clause = '`status`="WARNING"';
            }
            if ($display == 'message') {
                $clause = '`status`<>"WARNING" AND `status`<>"ERROR"';
            }
            $q = db_select('log', array('*'), $clause, 'ORDER BY `timestamp` DESC ' . ($count > 0) ? 'LIMIT ' . $count : '');
            ?>
          <script language="JavaScript" type="text/javascript">
              function update () {
                var prefix = '<?php 
            echo content_url_get_full();
            ?>
';
                var count = getElementById ('count').value;
                var display = getElementById ('display').value;
                nav (prefix + '&count=' + count + '&display = '+display);
              }
           </script>

          <table width="100%"><tr>
            <td width="196">
              Количество записей:&nbsp;&nbsp;<select id="count">
                <option value="256"<?php 
            echo $count == 256 ? ' selected' : '';
            ?>
>256</option>
                <option value="512"<?php 
            echo $count == 512 ? ' selected' : '';
            ?>
>512</option>
                <option value="1024"<?php 
            echo $count == 1024 ? ' selected' : '';
            ?>
>1024</option>
                <option value="-1"<?php 
            echo $count == -1 ? ' selected' : '';
            ?>
>Все</option>
              </select>
            </td>

            <td width="208">
              Отображать:&nbsp;&nbsp;<select id="display">
                <option value="all"<?php 
            echo $display == 'all' ? ' selected' : '';
            ?>
>Все сообщения</option>
                <option value="warning"<?php 
            echo $display == 'warning' ? ' selected' : '';
            ?>
>Предупреждения</option>
                <option value="error"<?php 
            echo $display == 'error' ? ' selected' : '';
            ?>
>Ошибки</option>
                <option value="message"<?php 
            echo $display == 'message' ? ' selected' : '';
            ?>
>Сообщения</option>
              </select>
            </td>

            <td align="right">
              <button class="submitBtn" onclick="update ();">Обновить</button>
            </td>
          </tr></table><div id="hr"></div>
<?php 
            if (db_affected() > 0) {
                println('<div class="scroll" style="height: 320px; margin-top: 4px;" id="log">');
                while ($r = db_row($q)) {
                    $class = "msg";
                    if ($r['status'] == 'ERROR') {
                        $class = 'err';
                    }
                    if ($r['status'] == 'WARNING') {
                        $class = 'warning';
                    }
                    $status = 'Сообщение';
                    if ($r['status'] == 'ERROR') {
                        $status = 'Ошибка';
                    }
                    if ($r['status'] == 'WARNING') {
                        $status = 'Предупреждение';
                    }
                    println('<div class="' . $class . '"><table><tr><td class="time">' . format_ltime($r['timestamp']) . '</td><td class="module">' . $r['module'] . '</td><td class="status">' . $status . '</td><td class="msg">' . $r['message'] . '</td></tr></table></div>');
                }
                println('</div>');
            } else {
                println('<center><i>Файл журнала пуст</i></center>');
            }
            formc();
        }
Exemplo n.º 7
0
 function Editor_DrawHistory()
 {
     global $action, $id;
     $del = $this->GetAllowed('DELETE');
     $edit = $this->GetAllowed('EDIT');
     if ($action == 'delete') {
         redirector_add_skipvar('id');
         if ($del) {
             $this->DeleteContentById($id);
         }
     } else {
         if ($action == 'rollback') {
             redirector_add_skipvar('action', 'rollback');
             redirector_add_skipvar('id');
             if ($edit) {
                 $this->Rollback($id);
             }
         }
     }
     $q = db_select($this->settings['content'], array('*'), '', 'ORDER BY `timestamp` DESC');
     if (db_affected() > 0) {
         println('<ul id="history">');
         $i = 0;
         while ($r = db_row($q)) {
             $time = format_ltime($r['timestamp']);
             $time = '<a href=".?oldid=' . $r['id'] . '">' . $time . '</a>';
             $user = user_generate_info_string($r['user_id']);
             $actions = '';
             if ($edit) {
                 $actions .= '[<a href=".?wiki=history&action=rollback&id=' . $r['id'] . '">Вернуться к этой версии</a>]';
             }
             if ($del) {
                 $actions .= stencil_ibtnav('minus_s.gif', content_url_get_full() . '&action=delete&id=' . $r['id'], 'Удалить', 'Удалить эту версию статьи?');
             }
             if ($actions != '') {
                 $actions = ' | ' . $actions;
             }
             if ($i < 2) {
                 println('  <li><div class="top">' . $time . ' | ' . $user . ' ' . $actions . '</div></li>');
             } else {
                 println('  <li><div>' . $time . ' | ' . $user . ' ' . $actions . '</div></li>');
             }
             $i++;
         }
         println('</ul>');
     } else {
         println('<span class="contentSub2">' . '<i>Журнал изменений пуст</i></span>');
     }
 }