本文整理汇总了PHP中Settings::get_allowed_extensions方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::get_allowed_extensions方法的具体用法?PHP Settings::get_allowed_extensions怎么用?PHP Settings::get_allowed_extensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::get_allowed_extensions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filemanager
/**
* 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;
}
示例2: has_allowed_extension
/**
* @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;
}
示例3: implode
?>
,
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';
?>
示例4: _getFilemanagerSettings
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;
}