echo $_SERVER['SCRIPT_NAME']; ?> '</p> <h3>FM 'view' output</h3> <pre> <?php $dump = '{}'; ob_start(); $_POST = array(); $_POST['directory'] = ''; $_POST['filter'] = ''; $browser->fireEvent('view'); $dump = ob_get_clean(); echo "input:\n"; var_dump($_POST); echo "\n\noutput for event 'view':\n\n"; $json = json_decode($dump); var_dump($json); ?> <hr />
*/ return true; default: // unknown operation. Internal server error. return false; } } if (01) { // fake a POST submit through a GET request so we can easily diag/debug event requests: if (!isset($_POST)) { $_POST = array(); } foreach ($_GET as $k => $v) { $_POST[$k] = $v; } } /* when you want to pass absolute paths into FileManger, be reminded that ALL paths (except for the [mimeTypesPath] one!) are paths in URI space, i.e. the 'root' is assumed to be DocumentRoot. Below is a quick example how a physical filesystem path /could/ be transformed to a URI path -- assumed you don't get buggered by having Aliases apply to this particular path, in which case you are between a rock and a hard place. */ $fm_basedir = str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), '', dirname(str_replace('\\', '/', __FILE__))) . '/'; $browser = new FileManagerWithAliasSupport(array('directory' => 'Files/', 'thumbnailPath' => 'Files/Thumbnails/', 'assetBasePath' => '../Assets', 'chmod' => 0777, 'allowExtChange' => true, 'UploadIsAuthorized_cb' => 'FM_IsAuthorized', 'DownloadIsAuthorized_cb' => 'FM_IsAuthorized', 'CreateIsAuthorized_cb' => 'FM_IsAuthorized', 'DestroyIsAuthorized_cb' => 'FM_IsAuthorized', 'MoveIsAuthorized_cb' => 'FM_IsAuthorized', 'Aliases' => array('/c/lib/includes/js/mootools-filemanager/Demos/Files/alias' => "D:/xxx", '/c/lib/includes/js/mootools-filemanager/Demos/Files/d' => "D:/xxx.tobesorted", '/c/lib/includes/js/mootools-filemanager/Demos/Files/u' => "D:/websites-uploadarea", '/c/lib/includes/js/mootools-filemanager/Demos/Files' => "D:/experiment"))); // log request data: //FM_vardumper($browser, 'init' . (!empty($_GET['event']) ? '-' . $_GET['event'] : null)); $browser->fireEvent(!empty($_GET['event']) ? $_GET['event'] : null);
<h3>FM 'view' output</h3> <pre> <?php $dump = '{}'; ob_start(); $_POST = array(); $_POST['directory'] = '/'; // '/bugger/'; $_POST['file'] = '0[]~!@()-._ 90826039_1_1_3.jpg'; $_POST['type'] = 'thumb'; $browser->fireEvent('detail'); $dump = ob_get_clean(); echo "input:\n"; var_dump($_POST); echo "\n\noutput for event 'detail':\n\n"; $json = json_decode($dump); var_dump($json); ?> <hr /> <pre> <?php $dump = '{}'; ob_start(); $_POST = array();