mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Small fixes to Media Manager.
This commit is contained in:
@@ -129,10 +129,12 @@ class media_cat_ui extends e_admin_ui
|
|||||||
{
|
{
|
||||||
$this->fields['media_cat_owner']['writeParms'] = array(
|
$this->fields['media_cat_owner']['writeParms'] = array(
|
||||||
"_common" => "_common",
|
"_common" => "_common",
|
||||||
|
"_icon" => "_icon",
|
||||||
"news" => "news",
|
"news" => "news",
|
||||||
"page" => "page",
|
"page" => "page",
|
||||||
"download" => "download",
|
"gallery" => "gallery",
|
||||||
"gallery" => "gallery"
|
"download" => "download"
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
@@ -334,6 +336,11 @@ class media_admin_ui extends e_admin_ui
|
|||||||
$this->batchImport();
|
$this->batchImport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(varset($_POST['update_options']))
|
||||||
|
{
|
||||||
|
$this->updateSettings();
|
||||||
|
}
|
||||||
|
|
||||||
if($this->getQuery('iframe'))
|
if($this->getQuery('iframe'))
|
||||||
{
|
{
|
||||||
$this->getResponse()->setIframeMod();
|
$this->getResponse()->setIframeMod();
|
||||||
@@ -595,17 +602,21 @@ class media_admin_ui extends e_admin_ui
|
|||||||
foreach($files as $f)
|
foreach($files as $f)
|
||||||
{
|
{
|
||||||
|
|
||||||
$text .= "<tr>
|
$text .= "
|
||||||
<td class='center'>".$frm->checkbox("batch_selected[$c]",$f['fname'])."</td>
|
|
||||||
|
<tr>
|
||||||
|
<td class='center'>".$frm->checkbox("batch_selected[".$c."]",$f['fname'])."</td>
|
||||||
<td class='center'>".$this->preview($f)."</td>
|
<td class='center'>".$this->preview($f)."</td>
|
||||||
<td>".$f['fname']."</td>
|
<td>".$f['fname']."</td>
|
||||||
<td>".$frm->text('batch_import_name[$c]', $f['fname'])."</td>
|
<td>".$frm->text('batch_import_name['.$c.']', ($_POST['batch_import_name'][$c] ? $_POST['batch_import_name'][$c] : $f['fname']))."</td>
|
||||||
<td>".$frm->textarea('batch_import_diz[$c]', $_POST['batch_import_diz'][$c])."</td>
|
<td>".$frm->textarea('batch_import_diz['.$c.']', $_POST['batch_import_diz'][$c])."</td>
|
||||||
<td>".$f['mime']."</td>
|
<td>".$f['mime']."</td>
|
||||||
<td>".$f['fsize']."</td>
|
<td>".$f['fsize']."</td>
|
||||||
<td>".e107::getDateConvert()->convert_date($f['modified'])."</td>
|
<td>".e107::getDateConvert()->convert_date($f['modified'])."</td>
|
||||||
<td class='center last'>".$f['img-width']." x ".$f['img-height']."</td>
|
<td class='center last'>".$f['img-width']." x ".$f['img-height']."</td>
|
||||||
</tr>";
|
</tr>
|
||||||
|
|
||||||
|
\n";
|
||||||
|
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
@@ -726,6 +737,14 @@ class media_admin_ui extends e_admin_ui
|
|||||||
// continue;
|
// continue;
|
||||||
$f['fname'] = $file;
|
$f['fname'] = $file;
|
||||||
|
|
||||||
|
if(file_exists($newpath) || $sql->db_Select("core_media","media_url = '".$tp->createConstants($newpath,'rel')."' LIMIT 1") )
|
||||||
|
{
|
||||||
|
$mes->addWarning($newpath." already exists and was ignored during import.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(rename($oldpath,$newpath))
|
if(rename($oldpath,$newpath))
|
||||||
{
|
{
|
||||||
$insert = array(
|
$insert = array(
|
||||||
@@ -781,6 +800,43 @@ class media_admin_ui extends e_admin_ui
|
|||||||
return $this->cats;
|
return $this->cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* UPDATE IMAGE OPTIONS - MAIN SCREEN
|
||||||
|
*/
|
||||||
|
function updateSettings()
|
||||||
|
{
|
||||||
|
global $pref,$admin_log,$tp;
|
||||||
|
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
|
$tmp = array();
|
||||||
|
$tmp['image_post'] = intval($_POST['image_post']);
|
||||||
|
$tmp['resize_method'] = $tp->toDB($_POST['resize_method']);
|
||||||
|
$tmp['im_path'] = trim($tp->toDB($_POST['im_path']));
|
||||||
|
$tmp['image_post_class'] = intval($_POST['image_post_class']);
|
||||||
|
$tmp['image_post_disabled_method'] = intval($_POST['image_post_disabled_method']);
|
||||||
|
$tmp['enable_png_image_fix'] = intval($_POST['enable_png_image_fix']);
|
||||||
|
|
||||||
|
if($_POST['img_import_resize_w'] && $_POST['img_import_resize_h'])
|
||||||
|
{
|
||||||
|
$tmp['img_import_resize'] = intval($_POST['img_import_resize_w'])."x".intval($_POST['img_import_resize_h']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($admin_log->logArrayDiffs($tmp, $pref, 'IMALAN_04'))
|
||||||
|
{
|
||||||
|
save_prefs(); // Only save if changes
|
||||||
|
$mes->add(IMALAN_9, E_MESSAGE_SUCCESS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mes->add(IMALAN_20, E_MESSAGE_INFO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -973,34 +1029,7 @@ if (isset($_POST['submit_avdelete_multi']))
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* UPDATE IMAGE OPTIONS - MAIN SCREEN
|
|
||||||
*/
|
|
||||||
if (isset($_POST['update_options']))
|
|
||||||
{
|
|
||||||
$tmp = array();
|
|
||||||
$tmp['image_post'] = intval($_POST['image_post']);
|
|
||||||
$tmp['resize_method'] = $tp->toDB($_POST['resize_method']);
|
|
||||||
$tmp['im_path'] = trim($tp->toDB($_POST['im_path']));
|
|
||||||
$tmp['image_post_class'] = intval($_POST['image_post_class']);
|
|
||||||
$tmp['image_post_disabled_method'] = intval($_POST['image_post_disabled_method']);
|
|
||||||
$tmp['enable_png_image_fix'] = intval($_POST['enable_png_image_fix']);
|
|
||||||
|
|
||||||
if($_POST['img_import_resize_w'] && $_POST['img_import_resize_h'])
|
|
||||||
{
|
|
||||||
$tmp['img_import_resize'] = intval($_POST['img_import_resize_w'])."x".intval($_POST['img_import_resize_h']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($admin_log->logArrayDiffs($tmp, $pref, 'IMALAN_04'))
|
|
||||||
{
|
|
||||||
save_prefs(); // Only save if changes
|
|
||||||
$emessage->add(IMALAN_9, E_MESSAGE_SUCCESS);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$emessage->add(IMALAN_20, E_MESSAGE_INFO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SHOW AVATARS SCREEN
|
* SHOW AVATARS SCREEN
|
||||||
|
@@ -249,7 +249,7 @@ class e_media
|
|||||||
/**
|
/**
|
||||||
* Return an array of Images in a particular category
|
* Return an array of Images in a particular category
|
||||||
*/
|
*/
|
||||||
public function getImages($cat = '')
|
public function getImages($cat,$from='',$amount='')
|
||||||
{
|
{
|
||||||
if(!$cat) return;
|
if(!$cat) return;
|
||||||
// TODO check the category is valid.
|
// TODO check the category is valid.
|
||||||
|
@@ -322,6 +322,7 @@ define("LAN_EXECUTE","Execute");
|
|||||||
define("LAN_SEFURL","SEF URL");
|
define("LAN_SEFURL","SEF URL");
|
||||||
define("LAN_COPY","Copy");
|
define("LAN_COPY","Copy");
|
||||||
define("LAN_KEYWORDS","Keywords");
|
define("LAN_KEYWORDS","Keywords");
|
||||||
|
define("LAN_IMAGE","Image");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user