Beispiel #1
0
 /**
  * Mootools FileManager loader
  * Equiv. to the "manager.php" file in mootools-filemanager Demo folder.
  *
  * @param null $event
  * @param bool $resize
  * @param bool $uploadAuthData
  */
 public function filemanager($event = NULL, $resize = FALSE, $uploadAuthData = FALSE)
 {
     // Get allowed mimes
     $allowed_mimes = implode(',', Settings::get_allowed_mimes());
     $params = array('filesDir' => '' . Settings::get('files_path') . '/', 'thumbsDir' => '' . Settings::get('files_path') . '/.thumbs/.backend/', 'assetsDir' => 'themes/admin/javascript/filemanager/assets/', 'documentRoot' => DOCPATH, 'baseUrl' => base_url(), 'upload' => TRUE, 'destroy' => TRUE, 'create' => TRUE, 'move' => TRUE, 'download' => FALSE, 'thumbSmallSize' => Settings::get('media_thumb_size') != '' ? Settings::get('media_thumb_size') : 120, 'thumbBigSize' => 500, 'maxImageDimension' => array('width' => Settings::get('picture_max_width') != '' ? Settings::get('picture_max_width') : 2000, 'height' => Settings::get('picture_max_height') != '' ? Settings::get('picture_max_height') : 2000), 'maxUploadSize' => intval(substr(ini_get('upload_max_filesize'), 0, -1)) * 1024 * 1024, 'filter' => $allowed_mimes, 'allowed_extensions' => Settings::get_allowed_extensions());
     $this->load->library('Filemanager', $params);
     // Fires the Event called by FileManager.js
     // The answer of this called id a JSON object
     // If no event is givven, it will call the "display" event
     if ($event != 'upload') {
         $this->Filemanager->fireEvent(!is_null($event) ? $event : NULL);
     } else {
         $this->Filemanager->fireEvent($event);
     }
     die;
 }
Beispiel #2
0
 /**
  * @param $filename
  *
  * @return bool
  */
 public function has_allowed_extension($filename)
 {
     $file_extension = pathinfo($filename, PATHINFO_EXTENSION);
     $extensions = Settings::get_allowed_extensions();
     if (in_array($file_extension, $extensions)) {
         return TRUE;
     }
     return FALSE;
 }
?>
,		
		pictureArray:Array('<?php 
echo implode("','", Settings::get_allowed_extensions('picture'));
?>
'),
		musicArray:Array('<?php 
echo implode("','", Settings::get_allowed_extensions('music'));
?>
'),
		videoArray:Array('<?php 
echo implode("','", Settings::get_allowed_extensions('video'));
?>
'),
		fileArray:Array('<?php 
echo implode("','", Settings::get_allowed_extensions('file'));
?>
')
	});

	/* If user's theme has a tinyMCE.css content CSS file, load it.
	 * else, load the standard tinyMCE content CSS file
	 *
	 */

	<?php 
if (is_file(FCPATH . 'themes/' . Settings::get('theme') . '/assets/css/tinyMCE.css')) {
    ?>
		var tinyCSS = '<?php 
    echo base_url() . 'themes/' . Settings::get('theme') . '/assets/css/tinyMCE.css';
    ?>
Beispiel #4
0
 private function _getFilemanagerSettings()
 {
     // Get allowed mimes
     $mimes = Settings::get_allowed_mimes();
     $allowed_mimes = implode(',', $mimes);
     $params = array('filesDir' => '' . Settings::get('files_path') . '/', 'thumbsDir' => '' . Settings::get('files_path') . '/.thumbs/.backend/', 'assetsDir' => 'themes/admin/javascript/filemanager/assets/', 'documentRoot' => DOCPATH, 'baseUrl' => base_url(), 'upload' => TRUE, 'destroy' => TRUE, 'create' => TRUE, 'move' => TRUE, 'cleanFileName' => self::$upload_clean_file_name, 'download' => FALSE, 'thumbSmallSize' => Settings::get('media_thumb_size') != '' ? Settings::get('media_thumb_size') : 120, 'thumbBigSize' => 500, 'maxImageDimension' => array('width' => Settings::get('picture_max_width') != '' ? Settings::get('picture_max_width') : 2000, 'height' => Settings::get('picture_max_height') != '' ? Settings::get('picture_max_height') : 2000), 'maxUploadSize' => (int) substr(ini_get('upload_max_filesize'), 0, -1) * 1024 * 1024, 'filter' => $allowed_mimes, 'allowed_extensions' => Settings::get_allowed_extensions());
     return $params;
 }