Subversion Repositories personal-webbase

Rev

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

Rev Author Line No. Line
12 daniel-mar 1
<?php
2
 
14 daniel-mar 3
if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
12 daniel-mar 4
 
5
  echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'suchbegriff\').focus();"', $header);
6
 
7
if ($modulueberschrift == '') $modulueberschrift = $modul;
8
echo '<h1>'.my_htmlentities($modulueberschrift).'</h1>';
9
 
10
  if (!isset($suchbegriff)) $suchbegriff = '';
11
 
12
  echo 'Hier k&ouml;nnen Sie Ihre Personal WebBase-Datenbank durchsuchen.
13
  Bitte beachten Sie, dass nur Datenbankeintr&auml;ge von Modulen gefunden werden
14
  k&ouml;nnen, die von den Entwicklern mit einer Suchschnittstelle ausgestattet wurden.
15
  Es werden in der Regel nur die Datens&auml;tze durchsucht, keine Systeme von Drittanbietern
16
  (z.B. Posteinfach oder Inhalte von Datenbanken/FTP-Servern etc).<br><br>
17
 
18
<form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'">
19
<input type="hidden" name="seite" value="'.$seite.'">
20
<input type="hidden" name="modul" value="'.$modul.'">
21
Suchbegriff:<br><input type="text" name="suchbegriff" value="'.$suchbegriff.'" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" size="50">
22
<input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Suchen">
23
</form>';
24
 
25
  if ($suchbegriff != '')
26
  {
27
    echo '<b>Suchergebnisse f&uuml;r &quot;'.$suchbegriff.'&quot;:</b><br><br>';
15 daniel-mar 28
    wb_draw_table_begin();
12 daniel-mar 29
    $etwas_gefunden = false;
15 daniel-mar 30
    wb_draw_table_content('30', '', '', '<b>Modul</b>', '', '<b>ID</b>', '', '<b>Titel</b>', '', '', '', '');
12 daniel-mar 31
    $res = db_query("SELECT `modul`, `table` FROM `".$mysql_zugangsdaten['praefix']."module` WHERE `is_searchable` = '1'");
32
    while ($row = db_fetch($res))
33
    {
34
      $modulueberschrift = $row['modul'];
35
      $modulsekpos = '';
36
      $modulpos = '';
37
      $modulrechte = '';
38
      $autor = '';
39
      $version = '';
40
      $menuevisible = '';
41
      $license = '';
42
      $deaktiviere_zugangspruefung = 0;
43
 
44
      if (file_exists('modules/'.wb_dir_escape($row['modul']).'/var.inc.php'))
45
        include 'modules/'.wb_dir_escape($row['modul']).'/var.inc.php';
46
 
47
      $modulueberschrift_a = $modulueberschrift;
48
 
14 daniel-mar 49
      if (($wb_user_type >= $modulrechte) && ((file_exists('modules/'.wb_dir_escape($row['modul']).'/pages/edit.inc.php')) || (file_exists('modules/'.wb_dir_escape($row['modul']).'/pages/view.inc.php'))))
12 daniel-mar 50
      {
51
        $que = generate_search_query($row['table'], 0, $suchbegriff);
52
        $res2 = db_query($que);
53
 
54
        while ($row2 = db_fetch($res2))
55
        {
56
          if (isset($datenbanktabellen[$mysql_zugangsdaten['praefix'].$row['table']]['name']))
57
          {
58
            $res3 = db_query("SELECT `name` FROM `".$mysql_zugangsdaten['praefix'].db_escape($row['table'])."` WHERE `id` = '".$row2['id']."'");
59
            $row3 = db_fetch($res3);
60
            if ($row3['name'] != '')
61
              $titel = $row3['name'];
62
            else
63
              $titel = '<i>Keine Angabe</i>';
64
          }
65
          else
66
            $titel = '<i>Keine Modulbetitelung</i>';
67
 
68
          $etwas_gefunden = true;
69
 
70
          if (file_exists('modules/'.wb_dir_escape($row['modul']).'/images/menu/32.png'))
71
            $g = 'modules/'.wb_dir_escape($row['modul']).'/images/menu/32.png';
72
          else if (file_exists('modules/'.wb_dir_escape($row['modul']).'/images/menu/32.gif'))
73
            $g = 'modules/'.wb_dir_escape($row['modul']).'/images/menu/32.gif';
74
          else
75
            $g = 'design/spacer.gif';
76
 
77
                  if (file_exists('modules/'.wb_dir_escape($row['modul']).'/images/menu/16.png'))
78
                    $k = 'modules/'.wb_dir_escape($row['modul']).'/images/menu/16.png';
79
          else if (file_exists('modules/'.wb_dir_escape($row['modul']).'/images/menu/16.gif'))
80
                    $k = 'modules/'.wb_dir_escape($row['modul']).'/images/menu/16.gif';
81
                  else
82
                  {
83
                    if (file_exists('modules/'.wb_dir_escape($modul).'/item.gif'))
84
              $k = 'modules/'.wb_dir_escape($modul).'/item.gif';
85
                    else if (file_exists('modules/'.wb_dir_escape($modul).'/item.png'))
86
              $k = 'modules/'.wb_dir_escape($modul).'/item.png';
87
                    else
88
              $k = 'design/spacer.gif';
89
          }
90
 
91
          $a = '';
92
          $b = '';
93
 
94
          if ($row['modul'] == 'user_ordner')
95
          {
96
            $res4 = db_query("SELECT `kategorie` FROM `".$mysql_zugangsdaten['praefix']."ordner` WHERE `id` = '".$row2['id']."'");
97
            $row4 = db_fetch($res4);
98
 
99
            $modulueberschrift = $row4['kategorie'];
100
                        $modulsekpos = '';
101
                        $modulpos = '';
102
                        $modulrechte = '';
103
                        $autor = '';
104
                        $version = '';
105
                        $menuevisible = '';
106
                        $license = '';
107
                        $deaktiviere_zugangspruefung = 0;
108
 
109
                if (file_exists('modules/'.wb_dir_escape($row4['kategorie']).'/var.inc.php'))
110
              include 'modules/'.wb_dir_escape($row4['kategorie']).'/var.inc.php';
111
 
112
            $modulueberschrift_b = $modulueberschrift;
113
 
114
            if (file_exists('modules/'.wb_dir_escape($row4['kategorie']).'/pages/inhalt.inc.php'))
115
              $a = '<a href="javascript:oop2(\''.$_SERVER['PHP_SELF'].'?seite=inhalt&amp;modul='.urlencode($row4['kategorie']).'#ordner'.$row2['id'].'\', \''.$modulueberschrift_a.'\', \''.$g.'\');" class="menu">&Ouml;ffnen</a>';
116
 
117
            if (file_exists('modules/'.wb_dir_escape($row4['kategorie']).'/pages/inhalt.inc.php'))
118
              $c = '<a href="'.oop_link_to_modul($row4['kategorie']).'" class="menu">'.$modulueberschrift_b.'</a> ('.$modulueberschrift_a.')';
119
            else
120
              $c = $modulueberschrift_b.' ('.$modulueberschrift_a.')';
121
          }
122
          else
123
          {
124
            if (file_exists('modules/'.wb_dir_escape($row['modul']).'/pages/view.inc.php'))
125
              $a = '<a href="javascript:oop2(\''.$_SERVER['PHP_SELF'].'?seite=view&amp;modul='.urlencode($row['modul']).'&amp;id='.urlencode($row2['id']).'\', \''.$modulueberschrift_a.'\', \''.$g.'\');" class="menu">&Ouml;ffnen</a>';
126
 
127
            if (file_exists('modules/'.wb_dir_escape($row['modul']).'/pages/edit.inc.php'))
128
              $b = '<a href="javascript:oop2(\''.$_SERVER['PHP_SELF'].'?seite=edit&amp;modul='.urlencode($row['modul']).'&amp;aktion=edit&amp;id='.urlencode($row2['id']).'\', \''.$modulueberschrift_a.'\', \''.$g.'\');" class="menu">Bearbeiten</a>';
129
 
130
            if (file_exists('modules/'.wb_dir_escape($row['modul']).'/pages/inhalt.inc.php'))
131
              $c = '<a href="'.oop_link_to_modul($row['modul']).'" class="menu">'.$modulueberschrift_a.'</a>';
132
            else
133
              $c = $modulueberschrift_a;
134
          }
135
 
15 daniel-mar 136
          wb_draw_table_content('', '<img src="'.$k.'" alt="" width="16" height="16">', '', $c, '', $row2['id'], '', $titel, '100', $a, '100', $b);
12 daniel-mar 137
        }
138
      }
139
    }
140
    if (!$etwas_gefunden)
15 daniel-mar 141
      wb_draw_table_content('', 'Kein Datensatz gefunden!', '', '', '', '', '', '', '', '', '', '');
142
    wb_draw_table_end();
12 daniel-mar 143
  }
144
 
145
  echo $footer;
146
 
147
?>