1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 10:04:35 +02:00

Cleaned up the Default Image Size in Media-Manager Preference area. Remove 'width=' from [img] when it matches the default size.

This commit is contained in:
Cameron
2018-01-26 15:54:54 -08:00
parent 4d3ef86bb7
commit c162981fbd
6 changed files with 63 additions and 34 deletions

View File

@@ -593,41 +593,51 @@ class media_form_ui extends e_admin_form_ui
{
$text = "";
$frm = e107::getForm();
$pref = e107::getPref();
$options = array(
"news-image" => LAN_IMA_O_001,
"news-bbcode" => LAN_IMA_O_002,
"page-bbcode" => LAN_IMA_O_003,
// "news-image" => LAN_IMA_O_001,
// "news-bbcode" => LAN_IMA_O_002,
// "page-bbcode" => LAN_IMA_O_003,
// "featurebox-image" => LAN_IMA_O_004,
// "featurebox-bbcode" => LAN_IMA_O_005,
);
if(vartrue($pref['e_imageresize']) && is_array($pref['e_imageresize']))
$options = $pref['resize_dimensions'];
/* @deprecated */
if(!empty($pref['e_imageresize']) && is_array($pref['e_imageresize']))
{
foreach($pref['e_imageresize'] as $k=>$val)
{
$options[$k] = ucfirst($k)." ".LAN_IMA_O_006;
}
}
$options = $pref['resize_dimensions'];
unset($options['news-image']); /* @deprecated */
$text = "<table class='table table-striped table-condensed table-bordered' style='width:400px; margin-bottom:0'>
<tr>
<th>".LAN_TYPE."</th>
<th class='text-right'>".LAN_WIDTH."</th>
<th class='text-right'>".LAN_HEIGHT."</th>
</tr>\n";
foreach($options as $key=>$title)
{
$title = ucwords(str_replace("-"," ",$key));
$valW = vartrue($curval[$key]['w']);
$valH = vartrue($curval[$key]['h']);
$text .= "<div style='margin-bottom:8px; text-align:right; width:400px'>".$title.": ";
$text .= "<input class='e-tip e-spinner input-small' placeholder='ex. 400' style='text-align:right' type='text' name='resize_dimensions[{$key}][w]' value='$valW' size='5' title='maximum width in pixels' /> X ";
$text .= "<input class='e-tip e-spinner input-small' placeholder='ex. 400' style='text-align:right' type='text' name='resize_dimensions[{$key}][h]' value='$valH' size='5' title='maximum height in pixels' />";
$text .= "</div>";
// $text .= $frm->text("resize_dimensions[{$key}]",$val, 5, array('size'=>'5')).$title."<br />";
}
$text .= "<tr><td style='width:45%'>".$title."</td><td class='text-right'>";
$text .= "<input class='e-tip e-spinner input-small' placeholder='ex. 400' style='text-align:right' type='text' name='resize_dimensions[{$key}][w]' value='$valW' size='5' title='maximum width in pixels' />";
$text .= "</td><td class='text-right'><input class='e-tip e-spinner input-small' placeholder='ex. 400' style='text-align:right' type='text' name='resize_dimensions[{$key}][h]' value='$valH' size='5' title='maximum height in pixels' />";
$text .= "</td></tr>";
}
$text .= "</table>";
// $text .= "<div><br />Warning: This feature is experimental.</div>";
@@ -886,7 +896,7 @@ class media_admin_ui extends e_admin_ui
'im_width' => array('title'=> IMALAN_75, 'type'=>'number', 'data'=>'int', 'writeParms'=>'', 'help'=>IMALAN_76),
'im_height' => array('title'=> IMALAN_77, 'type'=>'number', 'data'=>'int', 'writeParms'=>'', 'help'=>IMALAN_76),
'resize_dimensions' => array('title'=> IMALAN_79, 'type'=>'method', 'data'=>'str'),
'resize_dimensions' => array('title'=> IMALAN_184, 'type'=>'method', 'data'=>'str'),
'watermark_activate' => array('title'=> IMALAN_80, 'tab'=>1, 'type' => 'number', 'data' => 'str', 'help'=>IMALAN_81), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
'watermark_text' => array('title'=> IMALAN_82,'tab'=>1, 'type' => 'text', 'data' => 'str', 'help'=>IMALAN_83), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),