%PDF- %PDF-
Direktori : /home/jalalj2hb/public_html/ftm-admin/file_manager/php/ |
Current File : /home/jalalj2hb/public_html/ftm-admin/file_manager/php/connector_wysiwyg.minimal.php |
<?php error_reporting(0); // Set E_ALL for debuging // elFinder autoload require './autoload.php'; // =============================================== /** * Simple function to demonstrate how to control file access using "accessControl" callback. * This method will disable accessing files/folders starting from '.' (dot) * * @param string $attr attribute name (read|write|locked|hidden) * @param string $path file path relative to volume root directory started with directory separator * @return bool|null **/ function access($attr, $path, $data, $volume) { return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot) ? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true : null; // else elFinder decide it itself } // Documentation for connector options: // https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options $opts = array( //'debug' => true, 'roots' => array( array( 'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED) 'path' => '../../assets/img/gallery/', // path to files (REQUIRED) 'tmbPath' => '../files/thumbnails/', 'tmbURL' => dirname($_SERVER['PHP_SELF']) . '/../files/thumbnails', 'URL' => dirname($_SERVER['PHP_SELF']) . '/../../assets/img/gallery/', // URL to files (REQUIRED) 'uploadDeny' => array('all'), // All Mimetypes not allowed to upload 'uploadAllow' => array('image', 'text/plain'),// Mimetype `image` and `text/plain` allowed to upload 'uploadOrder' => array('deny', 'allow'), // allowed Mimetype `image` and `text/plain` only 'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL) ) ) ); // run elFinder $connector = new elFinderConnector(new elFinder($opts)); $connector->run();