Subversion Repositories personal-webbase

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
  4.  
  5.         echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'suchbegriff\').focus();"', $header);
  6.  
  7.  
  8. echo '<h1>'.htmlentities($module_information->caption).'</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>';
  28.                 wb_draw_table_begin();
  29.                 $etwas_gefunden = false;
  30.                 wb_draw_table_content('30', '', '', '<b>Modul</b>', '', '<b>ID</b>', '', '<b>Titel</b>', '', '', '', '');
  31.                 $res = db_query("SELECT `module`, `table` FROM `".$WBConfig->getMySQLPrefix()."modules` WHERE `is_searchable` = '1'");
  32.                 while ($row = db_fetch($res))
  33.                 {
  34.                         $module_information = WBModuleHandler::get_module_information($row['module']);
  35.  
  36.                         $module_information->caption_a = $module_information->caption;
  37.  
  38.                         if (($wb_user_type >= $module_information->rights) && ((file_exists('modules/'.$row['module'].'/page/edit.inc.php')) || (file_exists('modules/'.$row['module'].'/page/view.inc.php'))))
  39.                         {
  40.                                 $que = generate_search_query($row['table'], 0, $suchbegriff);
  41.                                 $res2 = db_query($que);
  42.  
  43.                                 while ($row2 = db_fetch($res2))
  44.                                 {
  45.                                         if (isset($tables_database[$WBConfig->getMySQLPrefix().$row['table']]['name']))
  46.                                         {
  47.                                                 $res3 = db_query("SELECT `name` FROM `".$WBConfig->getMySQLPrefix().db_escape($row['table'])."` WHERE `id` = '".$row2['id']."'");
  48.                                                 $row3 = db_fetch($res3);
  49.                                                 if ($row3['name'] != '')
  50.                                                         $titel = $row3['name'];
  51.                                                 else
  52.                                                         $titel = '<i>Keine Angabe</i>';
  53.                                         }
  54.                                         else
  55.                                                 $titel = '<i>Keine Modulbetitelung</i>';
  56.  
  57.                                         $etwas_gefunden = true;
  58.  
  59.                                         if (file_exists('modules/'.$row['module'].'/images/menu/32.gif'))
  60.                                                 $g = 'modules/'.$row['module'].'/images/menu/32.gif';
  61.                                         else if (file_exists('modules/'.$row['module'].'/images/menu/32.png'))
  62.                                                 $g = 'modules/'.$row['module'].'/images/menu/32.png';
  63.                                         else
  64.                                                 $g = 'designs/spacer.gif';
  65.  
  66.                                         if (file_exists('modules/'.$row['module'].'/images/menu/16.gif'))
  67.                                                 $k = 'modules/'.$row['module'].'/images/menu/16.gif';
  68.                                         else if (file_exists('modules/'.$row['module'].'/images/menu/16.png'))
  69.                                                 $k = 'modules/'.$row['module'].'/images/menu/16.png';
  70.                                         else
  71.                                         {
  72.                                                 if (file_exists('modules/'.$modul.'/item.gif'))
  73.                                                         $k = 'modules/'.$modul.'/item.gif';
  74.                                                 else if (file_exists('modules/'.$modul.'/item.png'))
  75.                                                         $k = 'modules/'.$modul.'/item.png';
  76.                                                 else
  77.                                                         $k = 'designs/spacer.gif';
  78.                                         }
  79.  
  80.                                         $a = '';
  81.                                         $b = '';
  82.  
  83.                                         if ($row['module'] == 'user_folders')
  84.                                         {
  85.                                                 $res4 = db_query("SELECT `category` FROM `".$WBConfig->getMySQLPrefix()."folders` WHERE `id` = '".$row2['id']."'");
  86.                                                 $row4 = db_fetch($res4);
  87.  
  88.                                                 $module_information = WBModuleHandler::get_module_information($row4['category']);
  89.  
  90.                                                 $module_information->caption_b = $module_information->caption;
  91.  
  92.                                                 if (file_exists('modules/'.$row4['category'].'/page/main.inc.php'))
  93.                                                         $a = '<a href="javascript:oop2(\''.$_SERVER['PHP_SELF'].'?seite=main&amp;modul='.$row4['category'].'#folder'.$row2['id'].'\', \''.$module_information->caption_a.'\', \''.$g.'\');" class="menu">&Ouml;ffnen</a>';
  94.  
  95.                                                 if (file_exists('modules/'.$row4['category'].'/page/main.inc.php'))
  96.                                                         $c = '<a href="'.oop_link_to_modul($row4['category']).'" class="menu">'.$module_information->caption_b.'</a> ('.$module_information->caption_a.')';
  97.                                                 else
  98.                                                         $c = $module_information->caption_b.' ('.$module_information->caption_a.')';
  99.                                         }
  100.                                         else
  101.                                         {
  102.                                                 if (file_exists('modules/'.$row['module'].'/page/view.inc.php'))
  103.                                                         $a = '<a href="javascript:oop2(\''.$_SERVER['PHP_SELF'].'?seite=view&amp;modul='.$row['module'].'&amp;id='.$row2['id'].'\', \''.$module_information->caption_a.'\', \''.$g.'\');" class="menu">&Ouml;ffnen</a>';
  104.  
  105.                                                 if (file_exists('modules/'.$row['module'].'/page/edit.inc.php'))
  106.                                                         $b = '<a href="javascript:oop2(\''.$_SERVER['PHP_SELF'].'?seite=edit&amp;modul='.$row['module'].'&amp;aktion=edit&amp;id='.$row2['id'].'\', \''.$module_information->caption_a.'\', \''.$g.'\');" class="menu">Bearbeiten</a>';
  107.  
  108.                                                 if (file_exists('modules/'.$row['module'].'/page/main.inc.php'))
  109.                                                         $c = '<a href="'.oop_link_to_modul($row['module']).'" class="menu">'.$module_information->caption_a.'</a>';
  110.                                                 else
  111.                                                         $c = $module_information->caption_a;
  112.                                         }
  113.  
  114.                                         wb_draw_table_content('', '<img src="'.$k.'" alt="" width="16" height="16">', '', $c, '', $row2['id'], '', $titel, '100', $a, '100', $b);
  115.                                 }
  116.                         }
  117.                 }
  118.                 if (!$etwas_gefunden)
  119.                         wb_draw_table_content('', 'Kein Datensatz gefunden!', '', '', '', '', '', '', '', '', '', '');
  120.                 wb_draw_table_end();
  121.         }
  122.  
  123.         echo $footer;
  124.  
  125. ?>