diff options
author | svncommit <devs@roundcube.net> | 2006-06-27 21:56:44 +0000 |
---|---|---|
committer | svncommit <devs@roundcube.net> | 2006-06-27 21:56:44 +0000 |
commit | c8c1e0ef3b229a82e74c70aeacc29f2ba021afbe (patch) | |
tree | 8ee6b05456b33c8d80e8cf7bf86fb14ae7c3b338 /program/include | |
parent | b068a07db2c519cde6bf1715e725cb70f2bbbc35 (diff) |
Renameable folders, mail-checking changes, other fixes (richs)
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/main.inc | 22 | ||||
-rw-r--r-- | program/include/rcube_imap.inc | 25 |
2 files changed, 37 insertions, 10 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 0a158dcb6..cc019af67 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -289,11 +289,11 @@ function get_sequence_name($sequence) // check the given string and returns language properties function rcube_language_prop($lang, $prop='lang') { - global $INSTLL_PATH; + global $INSTALL_PATH; static $rcube_languages, $rcube_language_aliases, $rcube_charsets; if (empty($rcube_languages)) - @include($INSTLL_PATH.'program/localization/index.inc'); + @include($INSTALL_PATH.'program/localization/index.inc'); // check if we have an alias for that language if (!isset($rcube_languages[$lang]) && isset($rcube_language_aliases[$lang])) @@ -357,7 +357,7 @@ function load_gui() $OUTPUT->set_charset($CONFIG['charset']); // add some basic label to client - rcube_add_label('loading'); + rcube_add_label('loading','checkingmail'); } @@ -764,13 +764,13 @@ function rcube_list_languages() if (!sizeof($sa_languages)) { - @include($INSTLL_PATH.'program/localization/index.inc'); + @include($INSTALL_PATH.'program/localization/index.inc'); - if ($dh = @opendir($INSTLL_PATH.'program/localization')) + if ($dh = @opendir($INSTALL_PATH.'program/localization')) { while (($name = readdir($dh)) !== false) { - if ($name{0}=='.' || !is_dir($INSTLL_PATH.'program/localization/'.$name)) + if ($name{0}=='.' || !is_dir($INSTALL_PATH.'program/localization/'.$name)) continue; if ($label = $rcube_languages[$name]) @@ -1192,6 +1192,7 @@ function rcube_xml_command($command, $str_attrib, $a_attrib=NULL) 'identityform' => 'rcube_identity_form', 'foldersubscription' => 'rcube_subscription_form', 'createfolder' => 'rcube_create_folder_form', + 'renamefolder' => 'rcube_rename_folder_form', 'composebody' => 'rcmail_compose_body' ); @@ -1317,7 +1318,7 @@ function rcube_button($attrib) $attrib['id'], $attrib['type'], $attrib['imageact'] ? $skin_path.$attrib['imageact'] : $attrib['classact'], - $attirb['imagesel'] ? $skin_path.$attirb['imagesel'] : $attrib['classsel'], + $attrib['imagesel'] ? $skin_path.$attrib['imagesel'] : $attrib['classsel'], $attrib['imageover'] ? $skin_path.$attrib['imageover'] : '')); // make valid href to task buttons @@ -1338,6 +1339,11 @@ function rcube_button($attrib) $attrib['onmouseout'] = sprintf("return %s.button_out('%s','%s')", $JS_OBJECT_NAME, $command, $attrib['id']); } + if ($command && $attrib['imagesel']) + { + $attrib['onmousedown'] = sprintf("return %s.button_sel('%s','%s')", $JS_OBJECT_NAME, $command, $attrib['id']); + $attrib['onmouseup'] = sprintf("return %s.button_out('%s','%s')", $JS_OBJECT_NAME, $command, $attrib['id']); + } $out = ''; @@ -1350,7 +1356,7 @@ function rcube_button($attrib) if ($attrib['label']) $btn_content .= ' '.$attrib['label']; - $link_attrib = array('href', 'onclick', 'onmouseover', 'onmouseout', 'title'); + $link_attrib = array('href', 'onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'title'); } else if ($attrib['type']=='link') { diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index dccd64fc9..7ad4ad082 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -1262,9 +1262,30 @@ class rcube_imap // set a new name to an existing mailbox - function rename_mailbox($mbox_name, $new_name) + function rename_mailbox($mbox_name, $new_name, $subscribe=TRUE) { - // not implemented yet + $result = FALSE; + + // replace backslashes + $name = preg_replace('/[\\\]+/', '-', $new_name); + + $name_enc = UTF7EncodeString($new_name); + + // reduce mailbox name to 100 chars + $name_enc = substr($name_enc, 0, 100); + + $abs_name = $this->_mod_mailbox($name_enc); + $a_mailbox_cache = $this->get_cache('mailboxes'); + + if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array($abs_name, $a_mailbox_cache))) + $result = iil_C_RenameFolder($this->conn, $mbox_name, $abs_name); + + // update mailboxlist cache + if ($result && $subscribe) + $this->unsubscribe($mbox_name); + $this->subscribe($name_enc); + + return $result ? $name : FALSE; } |