Changeset 4198 in subversion for trunk/roundcubemail/program/include/rcube_imap_generic.php
- Timestamp:
- Nov 9, 2010 2:54:34 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap_generic.php
r4187 r4198 550 550 551 551 /** 552 * Gets the root directory and delimiter (of personal namespace) 553 * 554 * @return mixed A root directory name, or false. 555 */ 556 function getRootDir() 557 { 558 if (isset($this->prefs['rootdir']) && is_string($this->prefs['rootdir'])) { 559 return $this->prefs['rootdir']; 560 } 561 562 if (!is_array($data = $this->getNamespace())) { 563 return false; 564 } 565 566 $user_space_data = $data['personal']; 567 if (!is_array($user_space_data)) { 568 return false; 569 } 570 571 $first_userspace = $user_space_data[0]; 572 if (count($first_userspace) !=2) { 573 return false; 574 } 575 576 $rootdir = $first_userspace[0]; 577 $this->prefs['delimiter'] = $first_userspace[1]; 578 $this->prefs['rootdir'] = $rootdir ? substr($rootdir, 0, -1) : ''; 579 580 return $this->prefs['rootdir']; 581 } 582 583 /** 584 * Gets the delimiter, for example: 585 * INBOX.foo -> . 586 * INBOX/foo -> / 587 * INBOX\foo -> \ 588 * 589 * @return mixed A delimiter (string), or false. 590 * @see connect() 552 * Gets the delimiter 553 * 554 * @return string The delimiter 591 555 */ 592 556 function getHierarchyDelimiter() … … 594 558 if ($this->prefs['delimiter']) { 595 559 return $this->prefs['delimiter']; 596 }597 if (!empty($this->prefs['delimiter'])) {598 return $this->prefs['delimiter'];599 560 } 600 561 … … 612 573 } 613 574 614 // if that fails, try namespace extension 615 // try to fetch namespace data 616 if (!is_array($data = $this->getNamespace())) { 617 return false; 618 } 619 620 // extract user space data (opposed to global/shared space) 621 $user_space_data = $data['personal']; 622 if (!is_array($user_space_data)) { 623 return false; 624 } 625 626 // get first element 627 $first_userspace = $user_space_data[0]; 628 if (!is_array($first_userspace)) { 629 return false; 630 } 631 632 // extract delimiter 633 return $this->prefs['delimiter'] = $first_userspace[1]; 575 return NULL; 634 576 } 635 577 … … 831 773 $this->clearCapability(); 832 774 } 833 $this->getRootDir();834 775 $this->logged = true; 835 776 … … 1944 1885 } 1945 1886 1946 if (empty($ref) && $this->prefs['rootdir']) {1947 $ref = $this->prefs['rootdir'];1948 }1949 1950 1887 $args = array(); 1951 1888
Note: See TracChangeset
for help on using the changeset viewer.
