protected function open_image_file_picker($img_path) { $img_path = empty($img_path) ? NULL : $this->interpreter_instance->get_image_path($img_path); $f_dialog = new FilePicker($this, $this->interpreter_instance->get_input_folder_path(), $img_path); if (wxID_OK != $f_dialog->ShowModal()) { return FALSE; } $sel_path = $f_dialog->GetValue(); if (empty($sel_path)) { return FALSE; } return $sel_path; }
define('FP_DECIMAL', '.'); // Number of decimals to display [Default: 2] define('FP_DECIMAL_NUM', 2); // How many level of FP_ROOT_PATH that user can visit, 0 means root only [Default: 1] // 0 means root only, -1 means unlimited // @since: 1.1.1 // (Not ready for 1.1 - Nov. 10, 2009) // define('FP_DIR_LEVEL', 1); // --------------------- Configration end -------------------------- header('Content-Type: text/html; charset=UTF-8'); define('FP_SCRIPT_ROOT', dirname(__DIR__)); define('FP_CLASS_ROOT', FP_SCRIPT_ROOT . '/inc'); require_once FP_CLASS_ROOT . '/FilePicker.php'; $fp = new FilePicker(function ($e) { if ($e === "permission_denied") { echo $e; } exit; }); $action = \Request::get('action'); switch ($action) { case 'list': $dir = base64_encode(makeOSPath(\Request::postParam("dir", "/"))); $filter = isset($_POST['filter']) ? $_POST['filter'] : 0; echo $fp->get_list($dir, $filter); break; case 'info': $dir = base64_encode(makeOSPath(\Request::postParam("dir", "/"))); $file = \Request::postParam("file", ""); echo $fp->get_info($dir, $file); break; /*
$strField = Input::get('field'); $this->loadDataContainer($strTable); $objDca = new DC_Table($strTable); // AJAX request if ($_POST && Environment::get('isAjaxRequest')) { $this->objAjax->executePostActions($objDca); } $objFileTree = new $GLOBALS['BE_FFL']['fileSelector'](array('strId' => $strField, 'strTable' => $strTable, 'strField' => $strField, 'strName' => $strField, 'varValue' => explode(',', Input::get('value'))), $objDca); $this->Template->main = $objFileTree->generate(); $this->Template->theme = $this->getTheme(); $this->Template->base = Environment::get('base'); $this->Template->language = $GLOBALS['TL_LANGUAGE']; $this->Template->title = specialchars($GLOBALS['TL_LANG']['MSC']['filepicker']); $this->Template->headline = $GLOBALS['TL_LANG']['MSC']['ppHeadline']; $this->Template->charset = $GLOBALS['TL_CONFIG']['characterSet']; $this->Template->options = $this->createPageList(); $this->Template->expandNode = $GLOBALS['TL_LANG']['MSC']['expandNode']; $this->Template->collapseNode = $GLOBALS['TL_LANG']['MSC']['collapseNode']; $this->Template->loadingData = $GLOBALS['TL_LANG']['MSC']['loadingData']; $this->Template->search = $GLOBALS['TL_LANG']['MSC']['search']; $this->Template->action = ampersand(Environment::get('request')); $this->Template->value = $this->Session->get('file_selector_search'); $GLOBALS['TL_CONFIG']['debugMode'] = false; $this->Template->output(); } } /** * Instantiate the controller */ $objFilePicker = new FilePicker(); $objFilePicker->run();