mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Fix for SVG icon import.
This commit is contained in:
@@ -1481,6 +1481,8 @@ class pluginManager{
|
|||||||
$med = e107::getMedia();
|
$med = e107::getMedia();
|
||||||
$icons = $med->listIcons(e_PLUGIN.$plug['plugin_path']);
|
$icons = $med->listIcons(e_PLUGIN.$plug['plugin_path']);
|
||||||
|
|
||||||
|
$iconText = '';
|
||||||
|
|
||||||
if(count($icons)>0)
|
if(count($icons)>0)
|
||||||
{
|
{
|
||||||
foreach($icons as $key=>$val)
|
foreach($icons as $key=>$val)
|
||||||
@@ -1488,6 +1490,8 @@ class pluginManager{
|
|||||||
$iconText .= "<img src='".$tp->replaceConstants($val)."' alt='' />";
|
$iconText .= "<img src='".$tp->replaceConstants($val)."' alt='' />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$iconText = '<div class="icon-pool-preview">'.$iconText.'</div>';
|
||||||
|
|
||||||
$opts['delete_ipool'] = array(
|
$opts['delete_ipool'] = array(
|
||||||
'label' => EPL_ADLAN_231,
|
'label' => EPL_ADLAN_231,
|
||||||
'preview' => $iconText,
|
'preview' => $iconText,
|
||||||
@@ -1495,8 +1499,12 @@ class pluginManager{
|
|||||||
'itemList' => array(1=>LAN_YES,0=>LAN_NO),
|
'itemList' => array(1=>LAN_YES,0=>LAN_NO),
|
||||||
'itemDefault' => 1
|
'itemDefault' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(is_readable(e_PLUGIN.$plug['plugin_path']."/".$plug['plugin_path']."_setup.php"))
|
if(is_readable(e_PLUGIN.$plug['plugin_path']."/".$plug['plugin_path']."_setup.php"))
|
||||||
{
|
{
|
||||||
include_once(e_PLUGIN.$plug['plugin_path']."/".$plug['plugin_path']."_setup.php");
|
include_once(e_PLUGIN.$plug['plugin_path']."/".$plug['plugin_path']."_setup.php");
|
||||||
|
@@ -123,7 +123,7 @@ if (!$dont_check_update)
|
|||||||
$LAN_UPDATE_5 = deftrue('LAN_UPDATE_5', "Core database structure");
|
$LAN_UPDATE_5 = deftrue('LAN_UPDATE_5', "Core database structure");
|
||||||
|
|
||||||
|
|
||||||
// $dbupdate['212_to_213'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.2','2.1.3')), 'message'=> null, 'hide_when_complete'=>true);
|
$dbupdate['214_to_215'] = array('master'=>false, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('2.1.4','2.1.5')), 'message'=> null, 'hide_when_complete'=>true);
|
||||||
|
|
||||||
|
|
||||||
$dbupdate['706_to_800'] = array('master'=>true, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('1.x','2.0')), 'message'=> LAN_UPDATE_29, 'hide_when_complete'=>true);
|
$dbupdate['706_to_800'] = array('master'=>true, 'title'=> e107::getParser()->lanVars($LAN_UPDATE_4, array('1.x','2.0')), 'message'=> LAN_UPDATE_29, 'hide_when_complete'=>true);
|
||||||
@@ -556,13 +556,29 @@ function update_core_database($type = '')
|
|||||||
* @param string $type
|
* @param string $type
|
||||||
* @return bool true = no update required, and false if update required.
|
* @return bool true = no update required, and false if update required.
|
||||||
*/
|
*/
|
||||||
function update_212_to_213($type='')
|
function update_214_to_215($type='')
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$log = e107::getLog();
|
$log = e107::getLog();
|
||||||
$just_check = ($type == 'do') ? false : true;
|
$just_check = ($type == 'do') ? false : true;
|
||||||
|
|
||||||
|
|
||||||
|
if(!$sql->select('core_media_cat', 'media_cat_id', "media_cat_category = '_icon_svg' LIMIT 1"))
|
||||||
|
{
|
||||||
|
if($just_check)
|
||||||
|
{
|
||||||
|
return update_needed("Missing Media-category for SVG");
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = "INSERT INTO `#core_media_cat` (media_cat_id, media_cat_owner, media_cat_category, media_cat_title, media_cat_sef, media_cat_diz, media_cat_class, media_cat_image, media_cat_order) VALUES (NULL, '_icon', '_icon_svg', 'Icons SVG', '', 'Available where icons are used in admin.', '253', '', '0');";
|
||||||
|
|
||||||
|
return $sql->gen($query);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// List of changed menu locations.
|
// List of changed menu locations.
|
||||||
/*
|
/*
|
||||||
$changeMenuPaths = array(
|
$changeMenuPaths = array(
|
||||||
|
@@ -3867,9 +3867,9 @@ class e_parser
|
|||||||
public function toIcon($icon='',$parm = array())
|
public function toIcon($icon='',$parm = array())
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!vartrue($icon))
|
if(empty($icon))
|
||||||
{
|
{
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strpos($icon,'e_MEDIA_IMAGE')!==false)
|
if(strpos($icon,'e_MEDIA_IMAGE')!==false)
|
||||||
|
@@ -242,7 +242,7 @@ class e_media
|
|||||||
|
|
||||||
$path = $tp->createConstants($epath, 'rel');
|
$path = $tp->createConstants($epath, 'rel');
|
||||||
|
|
||||||
$status = ($sql->gen("SELECT * FROM `#core_media` WHERE `media_url` LIKE '".$path."%' AND media_category REGEXP '_icon_16|_icon_32|_icon_48|_icon_64,_icon_svg' ")) ? TRUE : FALSE;
|
$status = ($sql->gen("SELECT * FROM `#core_media` WHERE `media_url` LIKE '".$path."%' AND media_category REGEXP '_icon_16|_icon_32|_icon_48|_icon_64|_icon_svg' ")) ? TRUE : FALSE;
|
||||||
while ($row = $sql->fetch())
|
while ($row = $sql->fetch())
|
||||||
{
|
{
|
||||||
$ret[] = $row['media_url'];
|
$ret[] = $row['media_url'];
|
||||||
@@ -669,7 +669,7 @@ class e_media
|
|||||||
$w = 64;
|
$w = 64;
|
||||||
$h = 64;
|
$h = 64;
|
||||||
$total = 500;
|
$total = 500;
|
||||||
$total = $this->countImages("_icon_16|_icon_32|_icon_48|_icon_64",$search);
|
$total = $this->countImages("_icon_16|_icon_32|_icon_48|_icon_64|_icon_svg",$search);
|
||||||
$onclick_clear = "parent.document.getElementById('{$tagid}').value = '';
|
$onclick_clear = "parent.document.getElementById('{$tagid}').value = '';
|
||||||
parent.document.getElementById('".$prevId."').innerHTML= '';
|
parent.document.getElementById('".$prevId."').innerHTML= '';
|
||||||
return false;";
|
return false;";
|
||||||
@@ -721,15 +721,11 @@ class e_media
|
|||||||
|
|
||||||
if($bbcode == null) // e107 Media Manager - new-image mode.
|
if($bbcode == null) // e107 Media Manager - new-image mode.
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO LAN.
|
|
||||||
$text .= "<a title='".IMALAN_165."' class='e-tip thumbnail {$class} ".$classN." media-select-none e-dialog-close' data-src='".varset($im['media_url'])."' style='vertical-align:middle;display:block;float:left;' href='#' onclick=\"{$onclick_clear}\" >
|
$text .= "<a title='".IMALAN_165."' class='e-tip thumbnail {$class} ".$classN." media-select-none e-dialog-close' data-src='".varset($im['media_url'])."' style='vertical-align:middle;display:block;float:left;' href='#' onclick=\"{$onclick_clear}\" >
|
||||||
<span>".$tp->toGlyph('fa-ban')."</span>
|
<span>".$tp->toGlyph('fa-ban')."</span>
|
||||||
</a>";
|
</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$srch = array("{MEDIA_URL}","{MEDIA_PATH}");
|
|
||||||
|
|
||||||
$w = false; //
|
$w = false; //
|
||||||
$h = false;
|
$h = false;
|
||||||
$defaultResizeWidth = 400;
|
$defaultResizeWidth = 400;
|
||||||
@@ -751,25 +747,32 @@ class e_media
|
|||||||
$media_path : Inserted into html tags eg. <img src='here'...
|
$media_path : Inserted into html tags eg. <img src='here'...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// print_a($images);
|
|
||||||
// return;
|
|
||||||
|
|
||||||
foreach($images as $im)
|
foreach($images as $im)
|
||||||
{
|
{
|
||||||
list($dbWidth,$dbHeight) = explode(" x ",$im['media_dimensions']);
|
list($dbWidth,$dbHeight) = explode(" x ",$im['media_dimensions']);
|
||||||
|
|
||||||
$w = ($dbWidth > $defaultResizeWidth) ? $defaultResizeWidth : intval($dbWidth);
|
$w = ($dbWidth > $defaultResizeWidth) ? $defaultResizeWidth : intval($dbWidth);
|
||||||
// $w = vartrue($w,0);
|
|
||||||
// $h = vartrue($w,0);
|
if($category === '_icon')
|
||||||
|
{
|
||||||
$class = ($category !='_icon') ? "media-select-image" : "media-select-icon";
|
$class = "media-select-icon";
|
||||||
$media_path = ($w || $h) ? $tp->thumbUrl($im['media_url'], "&w={$w}") : $tp->thumbUrl($im['media_url']); // $tp->replaceConstants($im['media_url'],'full'); // max-size
|
$media_path = $tp->replaceConstants($im['media_url']); // $tp->replaceConstants($im['media_url'],'full'); // max-size
|
||||||
|
$realPath = $media_path;
|
||||||
$realPath = $tp->thumbUrl($im['media_url'], $prevAtt); // Parsed back to Form as Preview Image.
|
$img_url = $media_path;
|
||||||
|
|
||||||
|
}
|
||||||
|
else // Regular image.
|
||||||
|
{
|
||||||
|
|
||||||
|
$class = "media-select-image";
|
||||||
|
$media_path = ($w || $h) ? $tp->thumbUrl($im['media_url'], "&w={$w}") : $tp->thumbUrl($im['media_url']); // $tp->replaceConstants($im['media_url'],'full'); // max-size
|
||||||
|
$realPath = $tp->thumbUrl($im['media_url'], $prevAtt); // Parsed back to Form as Preview Image.
|
||||||
|
$img_url = e107::getParser()->thumbUrl($im['media_url'], $thumbAtt);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$diz = $tp->toAttribute(varset($im['media_name']))." (".str_replace(" ","", varset($im['media_dimensions'])).")";
|
$diz = $tp->toAttribute(varset($im['media_name']))." (".str_replace(" ","", varset($im['media_dimensions'])).")";
|
||||||
$repl = array($im['media_url'],$media_path);
|
|
||||||
|
|
||||||
$media_alt = $tp->toAttribute(vartrue($im['media_caption']));
|
$media_alt = $tp->toAttribute(vartrue($im['media_caption']));
|
||||||
|
|
||||||
if($bbcode == null) // e107 Media Manager
|
if($bbcode == null) // e107 Media Manager
|
||||||
@@ -794,8 +797,7 @@ class e_media
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data_bb = ($bbcode) ? "img" : "";
|
$data_bb = ($bbcode) ? "img" : "";
|
||||||
|
|
||||||
$img_url = (!empty($cat)) ? e107::getParser()->thumbUrl($im['media_url'], $thumbAtt) : $media_path;
|
|
||||||
|
|
||||||
$text .= "<a data-toggle='context' class='thumbnail {$class} e-tip' data-id='{$im['media_id']}' data-width='{$w}' data-height='{$h}' data-src='{$media_path}' data-bbcode='{$data_bb}' data-target='{$tagid}' data-path='{$im['media_url']}' data-preview='{$realPath}' data-alt=\"".$media_alt."\" title=\"".$diz."\" style='float:left' href='#' onclick=\"{$onclicki}\" >";
|
$text .= "<a data-toggle='context' class='thumbnail {$class} e-tip' data-id='{$im['media_id']}' data-width='{$w}' data-height='{$h}' data-src='{$media_path}' data-bbcode='{$data_bb}' data-target='{$tagid}' data-path='{$im['media_url']}' data-preview='{$realPath}' data-alt=\"".$media_alt."\" title=\"".$diz."\" style='float:left' href='#' onclick=\"{$onclicki}\" >";
|
||||||
$text .= "<img class='image-rounded' src='".$img_url."' alt=\"".$im['media_title']."\" title=\"{$diz}\" />";
|
$text .= "<img class='image-rounded' src='".$img_url."' alt=\"".$im['media_title']."\" title=\"{$diz}\" />";
|
||||||
|
Reference in New Issue
Block a user