mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Issue #3276 Fix encoding on '+' in media categories. Mediapicker fixes. Media class cleanup.
This commit is contained in:
@@ -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)
|
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(!$label) $label = ' Upload an image or file';
|
||||||
if($tagid) $cat .= '&tagid='.$tagid;
|
if($tagid) $cat .= '&tagid='.$tagid;
|
||||||
|
|
||||||
|
@@ -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)
|
if(strpos($cat,"+") || !$cat)
|
||||||
{
|
{
|
||||||
$cat = str_replace("+","",$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;
|
$catArray[] = '_common_'.$type;
|
||||||
}
|
}
|
||||||
if($cat)
|
if($cat)
|
||||||
@@ -499,13 +496,8 @@ class e_media
|
|||||||
{
|
{
|
||||||
$catArray[] = $cat;
|
$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.
|
// TODO check the category is valid.
|
||||||
|
|
||||||
if($search)
|
if($search)
|
||||||
@@ -525,9 +517,6 @@ class e_media
|
|||||||
$query = "SELECT ".$fields." FROM #core_media WHERE `media_category` REGEXP '(^|,)".implode("|",$catArray)."(,|$)'
|
$query = "SELECT ".$fields." FROM #core_media WHERE `media_category` REGEXP '(^|,)".implode("|",$catArray)."(,|$)'
|
||||||
AND `media_userclass` IN (".USERCLASS_LIST.")
|
AND `media_userclass` IN (".USERCLASS_LIST.")
|
||||||
AND `media_type` LIKE '".$type."/%' " ;
|
AND `media_type` LIKE '".$type."/%' " ;
|
||||||
// $query = "SELECT ".$fields." FROM #core_media WHERE media_userclass IN (".USERCLASS_LIST.") AND ( ".implode(" OR ",$inc)." ) " ;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($search)
|
if($search)
|
||||||
{
|
{
|
||||||
|
@@ -40,7 +40,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
|
|
||||||
$(context).find('.e-media-select').once('media-manager-e-media-select').each(function ()
|
$(context).find('.e-media-select').once('media-manager-e-media-select').each(function ()
|
||||||
{
|
{
|
||||||
$(this).click(function ()
|
$(this).on('click', function ()
|
||||||
{
|
{
|
||||||
e107.mediaManager.eMediaSelect(this);
|
e107.mediaManager.eMediaSelect(this);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user