mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
MediaPicker bbcode (Tinymce) compatibility fixes.
This commit is contained in:
@@ -276,7 +276,7 @@ class media_cat_ui extends e_admin_ui
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function beforeCreate($new_data)
|
public function beforeCreate($new_data, $old_data)
|
||||||
{
|
{
|
||||||
// XXX temporary disable when there is no owners, discuss
|
// XXX temporary disable when there is no owners, discuss
|
||||||
if(!$new_data['media_cat_owner'])
|
if(!$new_data['media_cat_owner'])
|
||||||
@@ -1583,13 +1583,13 @@ class media_admin_ui extends e_admin_ui
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if($this->getQuery('audio') || $this->getQuery('bbcode') == 'audio')
|
if($this->getQuery('audio') || $this->getQuery('bbcode') == 'audio')
|
||||||
{
|
{
|
||||||
$text .= "<div class='tab-pane clearfix {$videoActive}' id='core-media-audio' >";
|
$text .= "<div class='tab-pane clearfix {$videoActive}' id='core-media-audio' >";
|
||||||
$text .= $this->audioTab();
|
$text .= $this->audioTab();
|
||||||
$text .= "</div>";
|
$text .= "</div>";
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if($this->getQuery('glyphs') == 1 || $this->getQuery('bbcode') == 'glyph')
|
if($this->getQuery('glyphs') == 1 || $this->getQuery('bbcode') == 'glyph')
|
||||||
{
|
{
|
||||||
@@ -1832,10 +1832,16 @@ class media_admin_ui extends e_admin_ui
|
|||||||
'perPage' => 8,
|
'perPage' => 8,
|
||||||
'gridClass' => 'col-sm-3 media-carousel-item-image',
|
'gridClass' => 'col-sm-3 media-carousel-item-image',
|
||||||
'bbcode' => 'img', // bbcode tag.
|
'bbcode' => 'img', // bbcode tag.
|
||||||
'close' => 'true'
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$close = true;
|
||||||
|
|
||||||
|
if(!empty($option['bbcode']))
|
||||||
|
{
|
||||||
|
$close = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$items = array();
|
$items = array();
|
||||||
|
|
||||||
$frm = !empty($option['from']) ? $option['from'] : 0;
|
$frm = !empty($option['from']) ? $option['from'] : 0;
|
||||||
@@ -1855,14 +1861,15 @@ class media_admin_ui extends e_admin_ui
|
|||||||
{
|
{
|
||||||
$items[] = array(
|
$items[] = array(
|
||||||
'previewHtml' => $tp->toImage($val['media_url'], array('w'=>210, 'h'=>140)),
|
'previewHtml' => $tp->toImage($val['media_url'], array('w'=>210, 'h'=>140)),
|
||||||
// 'previewUrl' => $tp->thumbUrl($val['media_url'], array('w'=>210, 'h'=>140)),
|
'previewUrl' => $tp->thumbUrl($val['media_url'], array('w'=>210, 'h'=>140)),
|
||||||
'saveValue' => $val['media_url'],
|
'saveValue' => $val['media_url'],
|
||||||
'thumbUrl' => $tp->thumbUrl($val['media_url'], array('w'=>340, 'h'=>220)),
|
'thumbUrl' => $tp->thumbUrl($val['media_url'], array('w'=>340, 'h'=>220)),
|
||||||
'title' => $val['media_name'],
|
'title' => $val['media_name'],
|
||||||
'tooltip' => basename($val['media_url'])." (".$val['media_dimensions'].")",
|
'tooltip' => basename($val['media_url'])." (".$val['media_dimensions'].")",
|
||||||
'slideCaption' => '',
|
'slideCaption' => '',
|
||||||
'slideCategory' => 'bootstrap',
|
'slideCategory' => 'bootstrap',
|
||||||
'mime' => $val['media_type']
|
'mime' => $val['media_type'],
|
||||||
|
'close' => $close
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2701,6 +2708,7 @@ class media_admin_ui extends e_admin_ui
|
|||||||
$text .= "<div id='core-image-show-avatars' class='row'>";
|
$text .= "<div id='core-image-show-avatars' class='row'>";
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
$prevType = '';
|
||||||
while (list($key, $image_name) = each($dirlist))
|
while (list($key, $image_name) = each($dirlist))
|
||||||
{
|
{
|
||||||
//$users = IMALAN_21." | ";
|
//$users = IMALAN_21." | ";
|
||||||
@@ -2831,7 +2839,7 @@ class media_admin_ui extends e_admin_ui
|
|||||||
* Invoked just before item create event
|
* Invoked just before item create event
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function beforeCreate($new_data)
|
public function beforeCreate($new_data, $old_data)
|
||||||
{
|
{
|
||||||
// print_a($_POST);
|
// print_a($_POST);
|
||||||
// return data to be merged with posted model data
|
// return data to be merged with posted model data
|
||||||
@@ -3007,7 +3015,7 @@ class media_admin_ui extends e_admin_ui
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function afterDelete($deleted_data, $id) // call after 'delete' is successfully executed. - delete the file with the db record (optional pref)
|
function afterDelete($deleted_data, $id, $deleted_check) // call after 'delete' is successfully executed. - delete the file with the db record (optional pref)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!empty($deleted_data['media_url']))
|
if(!empty($deleted_data['media_url']))
|
||||||
|
@@ -1364,8 +1364,17 @@ class e_media
|
|||||||
|
|
||||||
private function browserCarouselItemSelector($data)
|
private function browserCarouselItemSelector($data)
|
||||||
{
|
{
|
||||||
$close = (E107_DEBUG_LEVEL > 0) ? "" : " data-close='true' "; //
|
// $close = (E107_DEBUG_LEVEL > 0) ? "" : " data-close='true' "; //
|
||||||
$select = (E107_DEBUG_LEVEL > 0) ? '' : " e-dialog-save e-dialog-close";
|
// $select = (E107_DEBUG_LEVEL > 0) ? '' : " ";
|
||||||
|
$close = '';
|
||||||
|
$select = '';
|
||||||
|
|
||||||
|
if(!empty($data['close']) && E107_DEBUG_LEVEL < 1)
|
||||||
|
{
|
||||||
|
$select .= " e-dialog-save e-dialog-close";
|
||||||
|
$close = " data-close='true' ";
|
||||||
|
}
|
||||||
|
|
||||||
$style = varset($data['style'],'');
|
$style = varset($data['style'],'');
|
||||||
$class = varset($data['class'],'');
|
$class = varset($data['class'],'');
|
||||||
$dataPreview = !empty($data['previewHtml']) ? base64_encode($data['previewHtml']) : '';
|
$dataPreview = !empty($data['previewHtml']) ? base64_encode($data['previewHtml']) : '';
|
||||||
@@ -1397,6 +1406,7 @@ class e_media
|
|||||||
'gridClass' => 'span2 col-md-2',
|
'gridClass' => 'span2 col-md-2',
|
||||||
'bbcode' => '',
|
'bbcode' => '',
|
||||||
'tooltip' => '',
|
'tooltip' => '',
|
||||||
|
'close' => true // close modal window after item selected
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -290,6 +290,7 @@ td.right, th.right { text-align:right }
|
|||||||
|
|
||||||
.mediaselector-preview video { position: absolute; top: 0; }
|
.mediaselector-preview video { position: absolute; top: 0; }
|
||||||
.mediaselector-preview audio { height: 70px }
|
.mediaselector-preview audio { height: 70px }
|
||||||
|
.mediaselector-preview img { max-height: 100%; width: auto; margin-left: auto; margin-right: auto; }
|
||||||
.mediaselector-preview i { /*padding: 20% 40%;*/ }
|
.mediaselector-preview i { /*padding: 20% 40%;*/ }
|
||||||
|
|
||||||
.mediaselector-container .overlay {
|
.mediaselector-container .overlay {
|
||||||
|
@@ -411,6 +411,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
}
|
}
|
||||||
|
|
||||||
preview = atob(previewHTML).trim();
|
preview = atob(previewHTML).trim();
|
||||||
|
e107.mediaManager.eMediaAttribute($this, bbcode);
|
||||||
}
|
}
|
||||||
else if(type === 'glyph')
|
else if(type === 'glyph')
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user