Пример #1
0
 function SetCurrentFolder()
 {
     $currentFolder = null;
     if (isset($this->sArray[GOTOFOLDER])) {
         $this->sArray[FOLDER_ID] = -1;
     }
     if ($this->sArray[FOLDER_ID] > -1) {
         $folderFullName = isset($this->sArray[FOLDER_FULLNAME]) ? $this->sArray[FOLDER_FULLNAME] : 'temp_001';
         $folder =& new Folder($this->account->Id, $this->sArray[FOLDER_ID], $folderFullName);
         $this->processor->GetFolderInfo($folder);
         if ($folder && $folder->Hide) {
             $newfolder = $this->folders ? $this->folders->GetFirstNotHideFolder() : null;
             if ($newfolder) {
                 $currentFolder =& $newfolder;
             }
         } else {
             $currentFolder =& $folder;
         }
     } else {
         if ($this->sArray[FOLDER_ID] == -1) {
             $folderType = FOLDERTYPE_Inbox;
             if (isset($this->sArray[GOTOFOLDER])) {
                 $folderType = $this->sArray[GOTOFOLDER];
                 unset($this->sArray[GOTOFOLDER]);
             }
             $folder =& $this->folders->GetFolderByType($folderType);
             $this->processor->GetFolderInfo($folder);
             if ($folder && $folder->Hide) {
                 $newfolder = $this->folders ? $this->folders->GetFirstNotHideFolder() : null;
                 if ($newfolder) {
                     $currentFolder =& $newfolder;
                 }
             } else {
                 $currentFolder =& $folder;
             }
         }
     }
     $this->currentFolder =& $currentFolder;
     if ($this->currentFolder) {
         $this->processor->GetFolderMessageCount($this->currentFolder);
         $this->sArray[FOLDER_ID] = $this->currentFolder->IdDb;
     } else {
         $this->sArray[FOLDER_ID] = -1;
     }
 }