diff options
author | thomascube <thomas@roundcube.net> | 2006-03-20 22:11:35 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2006-03-20 22:11:35 +0000 |
commit | 8c2e58b42e89ca0216307553a906c2ca776c44f8 (patch) | |
tree | 438c532eb3c7842009dc79c0b14b53e7c2702291 /program/include/main.inc | |
parent | 93ee836858aa4a3223a466f12ffb07a16889a8a5 (diff) |
Minor improvements and bugfixes (see changelog)
Diffstat (limited to 'program/include/main.inc')
-rw-r--r-- | program/include/main.inc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index e6a26b773..d3ee5e95c 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -72,7 +72,7 @@ function rcmail_startup($task='mail') // 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'); @@ -1123,7 +1123,12 @@ function rcube_xml_command($command, $str_attrib, $a_attrib=NULL) // 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']; @@ -1151,7 +1156,7 @@ function rcube_xml_command($command, $str_attrib, $a_attrib=NULL) // 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; @@ -1223,6 +1228,7 @@ function rcube_button($attrib) // 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, @@ -1232,6 +1238,11 @@ function rcube_button($attrib) $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'] = '#'; |