thomascube
2006-03-20 8c2e58b42e89ca0216307553a906c2ca776c44f8
program/include/main.inc
@@ -72,12 +72,14 @@
  // prepare DB connection
  require_once('include/rcube_'.(empty($CONFIG['db_backend']) ? 'db' : $CONFIG['db_backend']).'.inc');
  
  $DB = new rcube_db($CONFIG['db_dsnw'], $CONFIG['db_dsnr']);
  $DB = new rcube_db($CONFIG['db_dsnw'], $CONFIG['db_dsnr'], $CONFIG['db_persistent']);
  $DB->sqlite_initials = $INSTALL_PATH.'SQL/sqlite.initial.sql';
  $DB->db_connect('w');
  // we can use the database for storing session data
  // session queries do not work with MDB2
  if ($CONFIG['db_backend']!='mdb2' && is_object($DB))
  if ($CONFIG['db_backend']!='mdb2' && !$DB->is_error())
    include_once('include/session.inc');
@@ -1121,7 +1123,12 @@
      // execute object handler function
      if ($object_handlers[$object] && function_exists($object_handlers[$object]))
        return call_user_func($object_handlers[$object], $attrib);
      else if ($object=='productname')
        {
        $name = !empty($CONFIG['product_name']) ? $CONFIG['product_name'] : 'RoundCube Webmail';
        return rep_specialchars_output($name, 'html', 'all');
        }
      else if ($object=='pagetitle')
        {
        $task = $GLOBALS['_task'];
@@ -1149,7 +1156,7 @@
// create and register a button
function rcube_button($attrib)
  {
  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $BROWSER;
  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $BROWSER, $COMM_PATH, $MAIN_TASKS;
  static $sa_buttons = array();
  static $s_button_count = 100;
  
@@ -1221,6 +1228,7 @@
  // register button in the system
  if ($attrib['command'])
    {
    $OUTPUT->add_script(sprintf("%s.register_button('%s', '%s', '%s', '%s', '%s', '%s');",
                                $JS_OBJECT_NAME,
                                $command,
@@ -1230,6 +1238,11 @@
                                $attirb['imagesel'] ? $skin_path.$attirb['imagesel'] : $attrib['classsel'],
                                $attrib['imageover'] ? $skin_path.$attrib['imageover'] : ''));
    // make valid href to task buttons
    if (in_array($attrib['command'], $MAIN_TASKS))
      $attrib['href'] = ereg_replace('_task=[a-z]+', '_task='.$attrib['command'], $COMM_PATH);
    }
  // overwrite attributes
  if (!$attrib['href'])
    $attrib['href'] = '#';