Example #1
0
        }
    }
    if (floatval($s) < 10) {
        return floor(floatval($s) * 1024 * 1024);
    }
    if (floatval($s) < 1024) {
        return floor(floatval($s) * 1024);
    }
    // Kilobytes
    return intval($s);
    // Bytes
}
require_once 'config.php';
switch (@$_REQUEST["__function"]) {
    case 'read-config':
        // This is used so that the javascript can read the config
        // so we don't have to have a js config and a php config duplicating
        // settings
        echo xinha_to_js($IMConfig);
        break;
    case 'image-manager':
        include 'mootools-filemanager/Backend/FileManager.php';
        $browser = new FileManager(array('directory' => $IMConfig['images_dir'], 'baseURL' => $IMConfig['images_url'], 'assetBasePath' => $IMConfig['base_url'] . '/mootools-filemanager/Assets', 'upload' => $IMConfig['allow_images_upload'], 'maxUploadSize' => size_to_bytes($IMConfig['max_images_upload_size']), 'suggestedMaxImageDimension' => $IMConfig['suggested_images_image_dimension'], 'destroy' => $IMConfig['allow_images_delete'], 'filter' => 'image/'));
        $browser->fireEvent(!empty($_REQUEST['event']) ? $_REQUEST['event'] : null);
        break;
    case 'file-manager':
        include 'mootools-filemanager/Backend/FileManager.php';
        $browser = new FileManager(array('directory' => $IMConfig['files_dir'], 'baseURL' => $IMConfig['files_url'], 'assetBasePath' => $IMConfig['base_url'] . '/mootools-filemanager/Assets', 'upload' => $IMConfig['allow_files_upload'], 'maxUploadSize' => size_to_bytes($IMConfig['max_files_upload_size']), 'suggestedMaxImageDimension' => $IMConfig['suggested_files_image_dimension'], 'destroy' => $IMConfig['allow_files_delete']));
        $browser->fireEvent(!empty($_REQUEST['event']) ? $_REQUEST['event'] : null);
        break;
}
Example #2
0
 /**
  * Build receiver config
  * 
  * @return
  */
 protected function buildReceiverConfig()
 {
     $return = [];
     if ($this->app['config']['inoplate.media.library.size.max']) {
         $return['maximum_upload_size'] = size_to_bytes($this->app['config']['inoplate.media.library.size.max'] . 'm');
     }
     if ($this->app['config']['inoplate.media.library.extensions']) {
         $return['allowed_extension'] = $this->app['config']['inoplate.media.library.extensions'];
     }
     if ($this->app['config']['inoplate.media.library.chunks_temp_path']) {
         $return['chunks_temp_path'] = $this->app['config']['inoplate.media.library.chunks_temp_path'];
     }
     return $return;
 }