mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 15:16:30 +02:00
Delete confirm screen for media manager
This commit is contained in:
@@ -591,6 +591,8 @@ class media_admin_ui extends e_admin_ui
|
|||||||
protected $batchDelete = true;
|
protected $batchDelete = true;
|
||||||
// protected $defaultOrder = 'desc';
|
// protected $defaultOrder = 'desc';
|
||||||
protected $listOrder = 'm.media_id desc'; // show newest images first.
|
protected $listOrder = 'm.media_id desc'; // show newest images first.
|
||||||
|
public $deleteConfirmScreen = true;
|
||||||
|
public $deleteConfirmMessage = 'You are about to delete %d records and <strong>ALL CORRESPONDING FILES</strong>! Please confirm to continue!';
|
||||||
|
|
||||||
//TODO - finish 'user' type, set 'data' to all editable fields, set 'noedit' for all non-editable fields
|
//TODO - finish 'user' type, set 'data' to all editable fields, set 'noedit' for all non-editable fields
|
||||||
/*
|
/*
|
||||||
|
@@ -3044,8 +3044,8 @@ class e_admin_controller_ui extends e_admin_controller
|
|||||||
{
|
{
|
||||||
if($this->_alias_parsed) return $this; // already parsed!!!
|
if($this->_alias_parsed) return $this; // already parsed!!!
|
||||||
|
|
||||||
|
$this->joinAlias(); // generate Table Aliases from listQry
|
||||||
/* OUTDATED.
|
|
||||||
if($this->getJoinData())
|
if($this->getJoinData())
|
||||||
{
|
{
|
||||||
foreach ($this->getJoinData() as $table => $att)
|
foreach ($this->getJoinData() as $table => $att)
|
||||||
@@ -3069,11 +3069,7 @@ class e_admin_controller_ui extends e_admin_controller
|
|||||||
$this->setJoinData($table, $att);
|
$this->setJoinData($table, $att);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
$this->joinAlias(); // generate Table Aliases from listQry
|
|
||||||
|
|
||||||
// check for table & field aliases
|
// check for table & field aliases
|
||||||
$fields = array(); // preserve order
|
$fields = array(); // preserve order
|
||||||
foreach ($this->fields as $field => $att)
|
foreach ($this->fields as $field => $att)
|
||||||
@@ -3084,14 +3080,14 @@ class e_admin_controller_ui extends e_admin_controller
|
|||||||
$tmp = explode('.', $field, 2);
|
$tmp = explode('.', $field, 2);
|
||||||
$table = $this->getTableFromAlias($tmp[0]);
|
$table = $this->getTableFromAlias($tmp[0]);
|
||||||
$att['table'] = $table;
|
$att['table'] = $table;
|
||||||
$att['alias'] = $field;
|
$att['alias'] = $tmp[0];
|
||||||
$att['field'] = $tmp[1];
|
$att['field'] = $tmp[1];
|
||||||
$att['__tableField'] = $field;
|
$att['__tableField'] = $field;
|
||||||
$att['__tableFrom'] = "`#".$table."`.".$tmp[1]." AS ".$field;
|
$att['__tablePath'] = $att['alias'].'.';
|
||||||
|
$att['__tableFrom'] = "`#".$table."`.".$tmp[1];//." AS ".$att['alias'];
|
||||||
$field = $att['alias'] ? $tmp[1] : $tmp[0];
|
$field = $att['alias'] ? $tmp[1] : $tmp[0];
|
||||||
|
|
||||||
$fields[$field] = $att;
|
$fields[$field] = $att;
|
||||||
|
|
||||||
unset($tmp);
|
unset($tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3105,7 +3101,8 @@ class e_admin_controller_ui extends e_admin_controller
|
|||||||
$att['table'] = $table;
|
$att['table'] = $table;
|
||||||
$att['alias'] = $newField;
|
$att['alias'] = $newField;
|
||||||
$att['__tableField'] = $newField;
|
$att['__tableField'] = $newField;
|
||||||
$att['__tableFrom'] = "`#".$table."`.".$field." AS ".$newField;
|
// $att['__tablePath'] = $newField; ????!!!!!
|
||||||
|
$att['__tableFrom'] = "`#".$table."`.".$field;//." AS ".$newField;
|
||||||
}
|
}
|
||||||
elseif(isset($this->joinAlias[$this->table]) && $field !='checkboxes' && $field !='options')
|
elseif(isset($this->joinAlias[$this->table]) && $field !='checkboxes' && $field !='options')
|
||||||
{
|
{
|
||||||
@@ -3186,6 +3183,23 @@ class e_admin_controller_ui extends e_admin_controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
elseif($this->tableJoin)
|
||||||
|
{
|
||||||
|
foreach ($this->tableJoin as $tbl => $data)
|
||||||
|
{
|
||||||
|
$matches = explode('.', $tbl, 2);
|
||||||
|
$this->joinAlias[$matches[1]] = $matches[0]; // array. eg $this->joinAlias['core_media'] = 'm';
|
||||||
|
//'user_name'=>'u.user_name'
|
||||||
|
if(isset($data['fields']) && $data['fields'] !== '*')
|
||||||
|
{
|
||||||
|
$tmp = explode(',', $data['fields']);
|
||||||
|
foreach ($tmp as $field)
|
||||||
|
{
|
||||||
|
$this->joinField[$field] = $matches[0].'.'.$field;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3247,9 +3261,9 @@ class e_admin_controller_ui extends e_admin_controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// select FROM... for main table
|
// select FROM... for main table
|
||||||
if($var['alias'] && vartrue($var['__tableFrom']))
|
if($var['alias'] && vartrue($var['__tableField']))
|
||||||
{
|
{
|
||||||
$tableSFieldsArr[] = $var['__tableFrom'];
|
$tableSFieldsArr[] = $var['__tableField'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// filter for WHERE and FROM clauses
|
// filter for WHERE and FROM clauses
|
||||||
@@ -3566,6 +3580,12 @@ class e_admin_ui extends e_admin_controller_ui
|
|||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $deleteConfirmScreen = false;
|
public $deleteConfirmScreen = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Confirm screen custom message
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $deleteConfirmMessage = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -4430,8 +4450,11 @@ class e_admin_form_ui extends e_form
|
|||||||
$forms = array();
|
$forms = array();
|
||||||
$id_array = explode(',', $ids);
|
$id_array = explode(',', $ids);
|
||||||
$delcount = count($id_array);
|
$delcount = count($id_array);
|
||||||
|
|
||||||
e107::getMessage()->addWarning(sprintf(LAN_UI_DELETE_WARNING, $delcount));
|
if(!empty($controller->deleteConfirmMessage))
|
||||||
|
e107::getMessage()->addWarning(sprintf($controller->deleteConfirmMessage, $delcount));
|
||||||
|
else
|
||||||
|
e107::getMessage()->addWarning(sprintf(LAN_UI_DELETE_WARNING, $delcount));
|
||||||
|
|
||||||
$fieldsets['confirm'] = array(
|
$fieldsets['confirm'] = array(
|
||||||
'fieldset_pre' => '', // markup to be added before opening fieldset element
|
'fieldset_pre' => '', // markup to be added before opening fieldset element
|
||||||
|
Reference in New Issue
Block a user