function DefineBrowsingDirectory()
 {
     $this->RetrieveConfigurationPropertiesFromXml($this->CurrentWorkingDirectory);
     // Check for subfolder ids if
     if (count($this->aFolderID) > 0) {
         for ($i = 0; $i < count($this->aFolderID); $i++) {
             $CurrentFolderKey = ForceInt($this->aFolderID[$i], 0);
             $this->CurrentBrowsingDirectory = CheckForFolder($this->CurrentBrowsingDirectory, $CurrentFolderKey, $this);
             if (!$this->CurrentBrowsingDirectory) {
                 // IF the current browsing directory wasn't found, wipe out all directory settings and start from the root
                 $this->CurrentBrowsingDirectory = $this->CurrentWorkingDirectory;
                 $this->FolderIDs = "";
                 $this->aFolderID = array();
                 break;
             }
         }
     }
 }
Example #2
0
        return $this->ErrorManager->Iif();
    }
}
// Define required variables for the application
$ErrorManager = new ErrorManager();
$Config = new Configuration();
$Config->ErrorManager =& $ErrorManager;
// ------------------------------------
// 1. RETRIEVE CONFIGURATION PROPERTIES
// ------------------------------------
$Config->RetrieveConfigurationPropertiesFromXml($Config->CurrentWorkingDirectory);
// Check for subfolder ids if directory browsing is allowed and some folder ids were supplied
if ($Config->BrowseSubFolders && count($Config->aFolderID) > 0) {
    for ($i = 0; $i < count($Config->aFolderID); $i++) {
        $CurrentFolderKey = ForceInt($Config->aFolderID[$i], 0);
        $Config->CurrentBrowsingDirectory = CheckForFolder($Config->CurrentBrowsingDirectory, $CurrentFolderKey, $Config);
        if (!$Config->CurrentBrowsingDirectory) {
            // IF the current browsing directory wasn't found, wipe out all directory settings and start from the root
            $Config->CurrentBrowsingDirectory = $Config->CurrentWorkingDirectory;
            $Config->FolderIDs = "";
            $Config->aFolderID = array();
            break;
        }
    }
}
// If the folder exists, and there is a _config.xml file in the folder, reconfigure the filebrowser
if ($Config->CurrentWorkingDirectory != $Config->CurrentBrowsingDirectory) {
    $Config->RetrieveConfigurationPropertiesFromXml($Config->CurrentBrowsingDirectory);
}
// -----------------------------------
// 2. RETRIEVE FILE EXTENSION SETTINGS