示例#1
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();
 }
示例#2
0
文件: button.php 项目: Nazg-Gul/gate
 function updownbtn($num, $count, $id = -1, $url = '.', $idcode = 'id', $actcode = 'action', $suffix = '')
 {
     println(stencil_updownbtn($num, $count, $id, $url, $idcode, $actcode, $suffix));
 }
示例#3
0
 function DrawPublistEntry($formname, $titleField, $data)
 {
     println('<table class="list smb">');
     content_url_var_push_global('function');
     $n = count($data);
     $url = content_url_get_full();
     $del = $this->GetAllowed('DELETE');
     $edit = $this->GetAllowed('EDIT');
     for ($i = 0; $i < $n; $i++) {
         $this->dataset->SetFieldValues($data[$i]);
         $t = $this->dataset->Field($titleField);
         $title = $t->Value();
         $title = htmlspecialchars($title);
         if (trim($title) == '') {
             $title = '<i>Нет значения</i>';
         }
         $title = '<a href="' . $url . '&uid=' . $data[$i]['uid'] . '">' . $title . '</a>';
         println('  <tr' . ($i == $n - 1 ? ' class="last"' : '') . '><td class="n">' . ($i + 1) . '.</td><td>' . $title . '</td>');
         $actions = '';
         if ($edit) {
             $actions = stencil_updownbtn($i, $n, $data[$i]['uid'], $url);
         }
         if ($del) {
             $actions .= stencil_ibtnav('cross.gif', content_url_get_full() . '&action=delete&pid=' . $data[$i]['uid'], 'Удалить', 'Удалить эту публикацию?');
         }
         if ($actions == '') {
             $actions = '&nbsp;';
         }
         println('<td align="right">' . $actions . '</td>');
         println('</tr>');
     }
     $this->dataset->FreeValues();
     println('</table>');
 }