svncommit
2005-10-20 1038d554e41b4007461a0c74a89625fd03107f7f
program/include/main.inc
@@ -30,7 +30,7 @@
  // check client
  $BROWSER = rcube_browser();
  // load config file
  include_once('config/main.inc.php');
  $CONFIG = is_array($rcmail_config) ? $rcmail_config : array();
@@ -54,6 +54,8 @@
  // 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->sqlite_initials = $INSTALL_PATH.'SQL/sqlite.initial.sql';
@@ -423,6 +425,33 @@
  }
// read directory program/localization/ and return a list of available languages
function rcube_list_languages()
  {
  global $CONFIG, $INSTALL_PATH;
  static $sa_languages = array();
  if (!sizeof($sa_languages))
    {
    @include_once($INSTLL_PATH.'program/localization/index.inc');
    if ($dh = @opendir($INSTLL_PATH.'program/localization'))
      {
      while (($name = readdir($dh)) !== false)
        {
        if ($name{0}=='.' || !is_dir($INSTLL_PATH.'program/localization/'.$name))
          continue;
        if ($label = $rcube_languages[$name])
          $sa_languages[$name] = $label ? $label : $name;
        }
      closedir($dh);
      }
    }
  return $sa_languages;
  }
// ************** template parsing and gui functions **************
@@ -671,7 +700,7 @@
// create and register a button
function rcube_button($attrib)
  {
  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME;
  global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $BROWSER;
  static $sa_buttons = array();
  static $s_button_count = 100;
  
@@ -728,7 +757,14 @@
  if ($attrib['alt'])
    $attrib['alt'] = rep_specialchars_output(rcube_label($attrib['alt']));
  // set title to alt attribute for IE browsers
  if ($BROWSER['ie'] && $attrib['title'] && !$attrib['alt'])
    {
    $attrib['alt'] = $attrib['title'];
    unset($attrib['title']);
    }
  // add empty alt attribute for XHTML compatibility
  if (!isset($attrib['alt']))
    $attrib['alt'] = '';
@@ -820,7 +856,7 @@
  $table .= "<thead><tr>\n";
  foreach ($a_show_cols as $col)
    $table .= '<td class="'.$col.'">' . rcube_label($col) . "</td>\n";
    $table .= '<td class="'.$col.'">' . rep_specialchars_output(rcube_label($col)) . "</td>\n";
  $table .= "</tr></thead>\n<tbody>\n";