Example #1
0
//PGRFileManagerConfig::$urlPath = "";
//    !!!How to determine rootPath and urlPath!!!
//    1. Copy mypath.php file to directory which you want to use with PGRFileManager
//    2. Run mypath.php script, i.e http://my-super-web-page/gallery/mypath.php
//    3. Insert correct values to myconfig.php
//    4. Delete mypath.php from your root directory
//Max file upload size in bytes
PGRFileManagerConfig::$fileMaxSize = 1024 * 1024 * 10;
//Allowed file extensions
//PGRFileManagerConfig::$allowedExtensions = '' means all files
PGRFileManagerConfig::$allowedExtensions = '';
//Allowed image extensions
PGRFileManagerConfig::$imagesExtensions = 'jpg|gif|jpeg|png|bmp';
//Max image file height in px
PGRFileManagerConfig::$imageMaxHeight = 724;
//Max image file width in px
PGRFileManagerConfig::$imageMaxWidth = 1280;
//Thanks to Cycle.cz
//Allow or disallow edit, delete, move, upload, rename files and folders
PGRFileManagerConfig::$allowEdit = true;
// true - false
//Autorization
PGRFileManagerConfig::$authorize = false;
// true - false
PGRFileManagerConfig::$authorizeUser = '******';
PGRFileManagerConfig::$authorizePass = '******';
//Path to CKEditor script
//i.e. http://mypage/ckeditor/ckeditor.js
//PGRFileManagerConfig::$ckEditorScriptPath = '/ckeditor/ckeditor.js';
//File extensions editable by CKEditor
//PGRFileManagerConfig::$ckEditorExtensions = 'html|html|txt';
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
include_once dirname(__FILE__) . '/config.php';
$arr = (require dirname(__FILE__) . '/../../../../../../../../../config/ckedit.php');
PGRFileManagerConfig::$rootPath = $arr['rootPath'];
PGRFileManagerConfig::$urlPath = $arr['urlPath'];
PGRFileManagerConfig::$fileMaxSize = $arr['fileMaxSize'];
PGRFileManagerConfig::$allowedExtensions = $arr['allowedExtensions'];
PGRFileManagerConfig::$imagesExtensions = $arr['imagesExtensions'];
PGRFileManagerConfig::$imageMaxHeight = $arr['imageMaxHeight'];
PGRFileManagerConfig::$imageMaxWidth = $arr['imageMaxWidth'];
PGRFileManagerConfig::$allowEdit = $arr['allowEdit'];
PGRFileManagerConfig::$authorize = $arr['authorize'];
PGRFileManagerConfig::$authorizeUser = $arr['authorizeUser'];
PGRFileManagerConfig::$authorizePass = $arr['authorizePass'];
PGRFileManagerConfig::$rootDir = PGRFileManagerConfig::$rootPath;
//Lang
if (isset($_GET['langCode'])) {
    $PGRLang = $_GET['langCode'];
} else {
    $PGRLang = 'en';
}
include_once dirname(__FILE__) . '/auth.php';
$PGRUploaderDescription = 'all files';
//For fckeditor
if (isset($_GET['type'])) {
    $type = $_GET['type'];
    if ($type === 'Image') {
        PGRFileManagerConfig::$allowedExtensions = PGRFileManagerConfig::$imagesExtensions;