Sha256: 97cbf4232195e272d6cd02e6d4bd9236bcbb7e5c8f32467e3398a6d4e2a52fd8

Contents?: true

Size: 1.82 KB

Versions: 76

Compression:

Stored size: 1.82 KB

Contents

<?php

error_reporting(0); // Set E_ALL for debuging

include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
// Required for MySQL storage connector
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
// Required for FTP connector support
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.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
}

$opts = array(
	// 'debug' => true,
	'roots' => array(
		array(
			'driver'        => 'LocalFileSystem',   // driver for accessing file system (REQUIRED)
			'path'          => '../files/',         // path to files (REQUIRED)
			'URL'           => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
			'accessControl' => 'access'             // disable and hide dot starting files (OPTIONAL)
		)
	)
);

// run elFinder
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();

Version data entries

76 entries across 76 versions & 4 rubygems

Version Path
optimacms-0.1.61 spec/dummy/public/elfinder/php/connector.php
optimacms-0.3.9 spec/dummy/public/elfinder/php/connector.php
optimacms-0.3.8 spec/dummy/public/elfinder/php/connector.php
optimacms-0.3.7 spec/dummy/public/elfinder/php/connector.php
optimacms-0.3.6 spec/dummy/public/elfinder/php/connector.php
optimacms-0.3.5 spec/dummy/public/elfinder/php/connector.php
optimacms-0.3.2 spec/dummy/public/elfinder/php/connector.php
optimacms-0.3.1 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.23 spec/dummy/public/elfinder/php/connector.php
ish_lib-0.0.8 vendor/assets/themeforest/alpona/html/php/connector.php
optimacms-0.2.22 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.21 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.20 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.19 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.18 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.17 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.16 spec/dummy/public/elfinder/php/connector.php
drg_default_html_editor-0.5.1 app/assets/javascripts/drg_default_html_editor/elfinder/php/connector.php
optimacms-0.2.15 spec/dummy/public/elfinder/php/connector.php
optimacms-0.2.14 spec/dummy/public/elfinder/php/connector.php