1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Issue #3276 Fix encoding on '+' in media categories. Mediapicker fixes. Media class cleanup.

This commit is contained in:
Cameron
2018-07-26 20:14:42 -07:00
parent f1329535a5
commit 96037d5ac9
3 changed files with 6 additions and 17 deletions

View File

@@ -969,12 +969,12 @@ class e_form
}
/**
* Internal Function used by imagepicker and filepicker
* Internal Function used by imagepicker, filepicker, mediapicker()
*/
private function mediaUrl($category = '', $label = '', $tagid='', $extras=null)
{
$cat = ($category) ? '&for='.$category : "";
$cat = ($category) ? '&for='.urlencode($category) : "";
if(!$label) $label = ' Upload an image or file';
if($tagid) $cat .= '&tagid='.$tagid;

View File

@@ -436,9 +436,9 @@ class e_media
}
public function getFiles($from=0, $amount = null, $search = null)
public function getFiles($cat, $from=0, $amount = null, $search = null)
{
return $this->getImages('_common_file', $from, $amount, $search);
return $this->getMedia('application', $from, $amount, $search);
}
@@ -484,9 +484,6 @@ class e_media
if(strpos($cat,"+") || !$cat)
{
$cat = str_replace("+","",$cat);
// $inc[] = "media_category = '_common_image' ";
// $inc[] = "media_category REGEXP '(^|,)(_common_image)(,|$)' ";
// $inc[] = "media_category LIKE '%_common_image%' ";
$catArray[] = '_common_'.$type;
}
if($cat)
@@ -499,13 +496,8 @@ class e_media
{
$catArray[] = $cat;
}
// $inc[] = "media_category LIKE '%".$cat."%' "; // for multiple category field.
// $inc[] = "media_category REGEXP '(^|,)(".$cat.")(,|$)' "; // for multiple category field.
}
// $inc[] = "media_category REGEXP '(^|,)_common_image|banner_image(,|$)' ";
// TODO check the category is valid.
if($search)
@@ -525,9 +517,6 @@ class e_media
$query = "SELECT ".$fields." FROM #core_media WHERE `media_category` REGEXP '(^|,)".implode("|",$catArray)."(,|$)'
AND `media_userclass` IN (".USERCLASS_LIST.")
AND `media_type` LIKE '".$type."/%' " ;
// $query = "SELECT ".$fields." FROM #core_media WHERE media_userclass IN (".USERCLASS_LIST.") AND ( ".implode(" OR ",$inc)." ) " ;
if($search)
{

View File

@@ -40,7 +40,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$(context).find('.e-media-select').once('media-manager-e-media-select').each(function ()
{
$(this).click(function ()
$(this).on('click', function ()
{
e107.mediaManager.eMediaSelect(this);
});