This commit is contained in:
tianshujie
2022-07-08 10:15:18 +08:00
parent 102326db4f
commit 2c6aeb6c19
2 changed files with 8 additions and 6 deletions
+6 -4
View File
@@ -138,10 +138,11 @@ class action extends control
* Undelete an object.
*
* @param int $actionID
* @param string $browseType
* @access public
* @return void
*/
public function undelete($actionID)
public function undelete($actionID, $browseType = 'all')
{
$oldAction = $this->action->getById($actionID);
$extra = $oldAction->extra == ACTIONMODEL::BE_HIDDEN ? 'hidden' : 'all';
@@ -149,7 +150,7 @@ class action extends control
$this->action->undelete($actionID);
$sameTypeObjects = $this->action->getTrashes($oldAction->objectType, $extra, 'id_desc', null);
$browseType = $sameTypeObjects ? $oldAction->objectType : 'all';
$browseType = ($sameTypeObjects and $browseType != 'all') ? $oldAction->objectType : 'all';
return print(js::locate($this->createLink('action', 'trash', "browseType=$browseType&type=$extra"), 'parent'));
}
@@ -158,17 +159,18 @@ class action extends control
* Hide an deleted object.
*
* @param int $actionID
* @param string $browseType
* @access public
* @return void
*/
public function hideOne($actionID)
public function hideOne($actionID, $browseType = 'all')
{
$oldAction = $this->action->getById($actionID);
$this->action->hideOne($actionID);
$sameTypeObjects = $this->action->getTrashes($oldAction->objectType, 'all', 'id_desc', null);
$browseType = $sameTypeObjects ? $oldAction->objectType : 'all';
$browseType = ($sameTypeObjects and $browseType != 'all') ? $oldAction->objectType : 'all';
return print(js::locate($this->createLink('action', 'trash', "browseType=$browseType"), 'parent'));
}
+2 -2
View File
@@ -139,8 +139,8 @@
<td><?php echo $action->date;?></td>
<td>
<?php
common::printLink('action', 'undelete', "actionid=$action->id", $lang->action->undelete, 'hiddenwin');
if($type == 'all') common::printLink('action', 'hideOne', "actionid=$action->id", $lang->action->hideOne, 'hiddenwin');
common::printLink('action', 'undelete', "actionid=$action->id&browseType=$currentObjectType", $lang->action->undelete, 'hiddenwin');
if($type == 'all') common::printLink('action', 'hideOne', "actionid=$action->id&browseType=$currentObjectType", $lang->action->hideOne, 'hiddenwin');
?>
</td>
</tr>