Esempio n. 1
0
 function stencil_updownbtn($num, $count, $id = -1, $url = '.', $idcode = 'id', $actcode = 'action', $suffix = '')
 {
     $res = '';
     $s = $suffix != '' ? ($suffix[0] == '#' ? '' : '&') . $suffix : '';
     if ($url[strlen($url) - 1] == '.' || $url[strlen($url) - 1] == '/') {
         $url .= '?';
     } else {
         $url .= '&';
     }
     if ($num < $count - 1) {
         $res .= stencil_ibtnav('arrdown_blue.gif', $url . $actcode . '=down&' . $idcode . '=' . $id . $s, 'Опустить');
     } else {
         $res .= stencil_ibtnav('arrdown_d.gif', '', 'Опустить');
     }
     if ($num > 0) {
         $res .= stencil_ibtnav('arrup_blue.gif', $url . $actcode . '=up&' . $idcode . '=' . $id . $s, 'Поднять');
     } else {
         $res .= stencil_ibtnav('arrup_d.gif', '', 'Поднять');
     }
     return $res;
 }
Esempio n. 2
0
 function GetStatusRow($contest_id, $r, $n, $c, $perPage, $full = '', $acl = array())
 {
     $pr = $this->problem_container->GetById($r['problem_id']);
     $letter = $this->problem_container->GetProblemLetter($contest_id, $r['problem_id']);
     $redirect = urlencode($full);
     $title = $letter . '. <a href="?page=problems&act=view&id=' . $pr['id'] . '&redirect=' . $redirect . '">' . htmlspecialchars($pr['name']) . '</a>';
     $status = $this->TaskStatus($r);
     $points = $this->TaskPoints($r);
     $try = $r['try'];
     $class = '';
     $actions = stencil_ibtnav('detail.gif', $full . '&action=view&id=' . $r['id'] . '&redirect=' . $redirect, 'Просмотреть решение');
     if ($c == $perPage - 1 || $c == $n - 1) {
         $class = 'last';
     }
     if ($r['status'] == 2 && $r['errors'] == 'OK') {
         $class .= ($class != '' ? ' ' : '') . 'subactive';
     }
     return '<tr' . ($class != '' ? ' class="' . $class . '"' : '') . '><td>' . $title . '</td><td align="center">' . $try . '</td>' . '<td>' . $status . '</td><td align="center">' . $points . '</td>' . '<td align="right" width="48">' . $actions . '</td></tr>';
 }
Esempio n. 3
0
 function Editor_EditForm_DrawItems($formname = '')
 {
     global $ids;
     $id = $this->Editor_EditForm_CurCatId();
     $depth = $this->Editor_EditForm_CurCatDepth();
     $pid = $this->Editor_EditForm_CurCatPID();
     $items = $this->GetCatalogueData($depth, $pid);
     $n = count($items);
     if ($n <= 0) {
         return;
     }
     $title_id = $this->GetCatTitleField($id);
     $url = '.?wiki=edit';
     $full = content_url_get_full();
     $max_depth = $this->MaxDepth();
     $mids = $ids . ($ids != '' ? ',' : '');
     $del = $this->GetAllowed('DELETEINFO');
     $edit = $this->GetAllowed('EDIT');
     $editinfo = $this->GetAllowed('EDITINFO');
     formo('title=Элементы в текущем подкаталоге;');
     println('<table class="list" width="100%">');
     for ($i = 0; $i < $n; $i++) {
         $it = $items[$i];
         $class = $i == $n - 1 ? 'last' : '';
         $title = htmlspecialchars($it[$title_id]);
         $actions = '';
         if ($editinfo) {
             $actions .= stencil_ibtnav('edit.gif', $full . '&action=edit&id=' . $it['uid']);
         }
         if ($edit) {
             $actions .= stencil_updownbtn($i, $n, $it['uid'], $full);
         }
         if ($del) {
             $actions .= stencil_ibtnav('cross.gif', $full . '&action=delete&id=' . $it['uid'], 'Удалить', 'Удалить этот элемент и все его вложения?');
         }
         if ($depth < $max_depth - 1) {
             $title = '<a href="' . $url . '&ids=' . $mids . $it['uid'] . '">' . $title . '</a>';
         }
         println('<tr' . ($class != '' ? " class=\"{$class}\"" : '') . '><td class="n">' . ($i + 1) . '.</td><td>' . $title . '</td><td width="96" align="right">' . $actions . '</td></tr>');
     }
     println('</table>');
     formc();
 }
Esempio n. 4
0
 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>');
 }
Esempio n. 5
0
 function ibtnav($img, $nav, $title = '', $confirm = '')
 {
     println(stencil_ibtnav($img, $nav, $title, $confirm));
 }
Esempio n. 6
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>');
     }
 }
Esempio n. 7
0
    }
    $pages = new CVCPagintation();
    $pages->Init('', ($group != '' ? 'urlprefix=?group\\=' . $group . ';' : '') . 'bottomPages=false;skiponcepage=true;');
    $i = 0;
    $n = count($list);
    if ($page != '') {
        $pageid = '&page=' . $page;
    }
    while ($i < $n) {
        $c = 0;
        $pageSrc = '<table class="list">' . "\n";
        $pageSrc .= '<tr class="h"><th class="n first">№</th><th width="20%">Логин</th><th width="20%">Имя</th><th width="20%">E-Mail</th><th>Уровень доступа</th><th width="48" class="last">&nbsp;</th></tr>' . "\n";
        while ($c < $perPage && $i < $n) {
            $it = $list[$i];
            $d = !user_is_system($it['id']);
            $pageSrc .= '<tr' . ($i == $n - 1 || $c == $perPage - 1 ? ' class="last"' : '') . '><td class="n">' . ($i + 1) . '.</td>' . '<td><a href=".?action=edit&id=' . $it['id'] . '&' . get_filters() . $pageid . '">' . $it['login'] . '</a></td>' . '<td>' . $it['name'] . '</td><td><a href="mailto:' . $it['email'] . '" title="Отправить письмо">' . $it['email'] . '</a></td>' . '<td>' . security_access_title($it['access']) . '</td>' . '<td align="right">' . stencil_ibtnav('edit.gif', '?action=edit&id=' . $it['id'] . '&' . get_filters() . $pageid, 'Изменить элемент') . stencil_ibtnav($d ? 'cross.gif' : 'cross_d.gif', $d ? '?action=delete&id=' . $it['id'] . '&' . get_filters() . $pageid : '', 'Удалить этот элемент', 'Удалить этот элемент?') . '</td></tr>' . "\n";
            $c++;
            $i++;
        }
        $pageSrc .= '</table>' . "\n";
        $pages->AppendPage($pageSrc);
    }
    $pages->Draw();
} else {
    info('В этой группе нет пользователей');
}
?>
  <div class="f">
    <form action="." method="POST" onsubmit="update (); return false;" onkeypress="if (event.keyCode==13) update ();">
      <b>Критерии выборки:</b>
      <table width="100%"><tr>