function DrawPublicationHistory($uid, $formname = '', $args = '', $head = true) { if ($head) { println('<span class="contentSub">История публикации:</span>'); } $q = db_select($this->settings['content'], array('id', 'user_id', 'ip', 'timestamp'), '`uid`=' . $uid, 'ORDER BY `timestamp` DESC'); println('<ul id="history" style="margin-top: 4px;">'); $i = 0; $del = $this->GetAllowed('DELETE'); $delinfo = $this->GetAllowed('DELETEINFO'); $editinfo = $this->GetAllowed('DELETEINFO'); content_url_var_push_global('function'); content_url_var_push_global('uid'); $url = content_url_get_full(); $one = db_affected() <= 1; if ($args == '') { $args = 'action=edit&id'; } while ($r = db_row($q)) { $time = '<a href="' . $url . '&' . $args . '=' . $r['id'] . '">' . format_ltime($r['timestamp']) . '</a>'; $user = user_generate_info_string($r['user_id']); $actions = ''; if ($editinfo) { $actions .= '[<a href="' . content_url_get_full() . '&action=rollback&id=' . $r['id'] . '">Вернуться к этой версии</a>]'; } if ($delinfo && !($one && !$del)) { $actions .= stencil_ibtnav('minus_s.gif', content_url_get_full() . '&action=delete&id=' . $r['id'], 'Удалить', 'Удалить эту версию публикации?'); } if ($actions != '') { $actions = ' | ' . $actions; } println(' <li><div' . ($i < 2 ? ' class="top"' : '') . '>' . $time . ' | ' . $user . $actions . '</div></li>'); $i++; } println('</ul>'); }
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>'); }
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>'); } }