This commit has been accessed 620 times via Git panel.
commit b1c0981d7f7cda47f8254436fe146714f9ec0454
tree 58a052ba18074a557bbd5efe67eea9671fae920e
parent a6889934bb5014dccad08cfe66f53a8658fdd76a
author Engels Antonio <engels@majcms.org> 1341686781 +0800
committer Engels Antonio <engels@majcms.org> 1341686781 +0800
Fix sort order of special folders
diff --git a/core.php b/core.php
index 994a6bb..ad550b2 100644
--- a/core.php
+++ b/core.php
@@ -359,9 +359,49 @@ function kartero_sort_folders($host,$array) {
unset($trash);
}
}
+
+ if (in_array("{$host}Spam",$array)) {
+ $spam = array_search("{$host}Spam",$array);
+ unset($array[$spam]);
+ }
+ else {
+ if (isset($spam)) {
+ unset($spam);
+ }
+ }
+ if (in_array("{$host}Drafts",$array)) {
+ $drafts = array_search("{$host}Drafts",$array);
+ unset($array[$drafts]);
+ }
+ else {
+ if (isset($drafts)) {
+ unset($drafts);
+ }
+ }
+
+ if (in_array("{$host}Junk",$array)) {
+ $junk = array_search("{$host}Junk",$array);
+ unset($array[$junk]);
+ }
+ else {
+ if (isset($junk)) {
+ unset($junk);
+ }
+ }
+
sort($array);
+ if (isset($junk)) {
+ array_unshift($array,"{$host}Junk");
+ unset($junk);
+ }
+
+ if (isset($spam)) {
+ array_unshift($array,"{$host}Spam");
+ unset($spam);
+ }
+
if (isset($trash)) {
array_unshift($array,"{$host}Trash");
unset($trash);
@@ -372,6 +412,11 @@ function kartero_sort_folders($host,$array) {
unset($sent);
}
+ if (isset($drafts)) {
+ array_unshift($array,"{$host}Drafts");
+ unset($drafts);
+ }
+
array_unshift($array,"{$host}INBOX");
reset($array);
tree 58a052ba18074a557bbd5efe67eea9671fae920e
parent a6889934bb5014dccad08cfe66f53a8658fdd76a
author Engels Antonio <engels@majcms.org> 1341686781 +0800
committer Engels Antonio <engels@majcms.org> 1341686781 +0800
Fix sort order of special folders
diff --git a/core.php b/core.php
index 994a6bb..ad550b2 100644
--- a/core.php
+++ b/core.php
@@ -359,9 +359,49 @@ function kartero_sort_folders($host,$array) {
unset($trash);
}
}
+
+ if (in_array("{$host}Spam",$array)) {
+ $spam = array_search("{$host}Spam",$array);
+ unset($array[$spam]);
+ }
+ else {
+ if (isset($spam)) {
+ unset($spam);
+ }
+ }
+ if (in_array("{$host}Drafts",$array)) {
+ $drafts = array_search("{$host}Drafts",$array);
+ unset($array[$drafts]);
+ }
+ else {
+ if (isset($drafts)) {
+ unset($drafts);
+ }
+ }
+
+ if (in_array("{$host}Junk",$array)) {
+ $junk = array_search("{$host}Junk",$array);
+ unset($array[$junk]);
+ }
+ else {
+ if (isset($junk)) {
+ unset($junk);
+ }
+ }
+
sort($array);
+ if (isset($junk)) {
+ array_unshift($array,"{$host}Junk");
+ unset($junk);
+ }
+
+ if (isset($spam)) {
+ array_unshift($array,"{$host}Spam");
+ unset($spam);
+ }
+
if (isset($trash)) {
array_unshift($array,"{$host}Trash");
unset($trash);
@@ -372,6 +412,11 @@ function kartero_sort_folders($host,$array) {
unset($sent);
}
+ if (isset($drafts)) {
+ array_unshift($array,"{$host}Drafts");
+ unset($drafts);
+ }
+
array_unshift($array,"{$host}INBOX");
reset($array);