Subversion Repositories personal-webbase

Rev

Rev 14 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9 daniel-mar 1
<?php
2
 
14 daniel-mar 3
if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
9 daniel-mar 4
 
5
function gfx_zeichneordnerbox($modul, $append, $dir = 0, $einzug = 0, $auszuwaehlen = 0, $ausschluss = 0)
6
{
7
  global $mysql_zugangsdaten;
8
 
9
  $ary = liste_ordner($modul, $append, $dir, $ausschluss);
10
  if ($dir == 0)
11
  {
12
        echo '<select name="folder" id="folder">';
13
    echo '<option value="0">Wurzelverzeichnis</option>';
14
  }
15
  for ($i=1; isset($ary[$i]['id']); $i++)
16
  {
17
    $x = '';
18
    for ($j=0; $j<=$einzug; $j++) $x .= '-- ';
19
    $y = '';
20
    if ($auszuwaehlen == $ary[$i]['id']) $y = ' selected';
21
        echo '<option value="'.$ary[$i]['id'].'"'.$y.'>'.$x.$ary[$i]['name'].'</option>';
22
        gfx_zeichneordnerbox($modul, $append, $ary[$i]['id'], $einzug+1, $auszuwaehlen, $ausschluss);
23
  }
24
  if ($einzug == 0) echo '</select>';
25
}
26
 
27
function gfx_zeichneordner($modul, $table, $append, $dir = 0, $einzug = 0)
28
{
29
  global $ordnereinzug, $mysql_zugangsdaten;
30
 
31
  $ary = liste_ordner($modul, '', $dir);
32
  $durchlauf = 0;
33
  for ($i=1; isset($ary[$i]['id']); $i++)
34
  {
35
    $durchlauf++;
36
    if (file_exists('modules/user_ordner/menueeintrag.inc.php'))
37
      include 'modules/user_ordner/menueeintrag.inc.php';
38
    echo "\n";
39
    gfx_zeichneordner($modul, $table, $append, $ary[$i]['id'], $einzug+1);
40
    $durchlauf += gfx_zeichneitems($modul, $table, $append, $ary[$i]['id'], $einzug+1);
41
  }
42
 
43
  if ($einzug == 0)
44
  {
45
    $durchlauf += gfx_zeichneitems($modul, $table, $append, $dir);
46
    if ($durchlauf == 0)
15 daniel-mar 47
    wb_draw_table_content('100%', 'Es sind keine Elemente in dieser Sektion vorhanden.', '', '', '', '', '', '');
9 daniel-mar 48
  }
49
}
50
 
51
function liste_ordner($modul, $append, $dir = 0, $ausschluss = 0)
52
{
53
  global $benutzer, $mysql_zugangsdaten;
54
  $i = 0;
55
 
56
  if (!isset($erg)) $erg = array();
57
 
58
  $res = db_query("SELECT * FROM `".$mysql_zugangsdaten['praefix']."ordner` WHERE `folder` = '".db_escape($dir)."' AND `kategorie` = '".db_escape($modul)."' AND `user` = '".$benutzer['id']."' $append");
59
  while ($row = db_fetch($res))
60
  {
61
        if (($ausschluss == 0) || (($ausschluss != 0) && ($row['id'] != $ausschluss)))
62
        {
63
          $i++;
64
      $erg[$i] = $row;
65
        }
66
  }
67
 
68
  return $erg;
69
}
70
 
71
$ordnereinzug = 23;
72
 
73
?>