Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
顯示
檢視
拆分
統一
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
比對精度
智能
語法
無
變更外觀
處理
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
AdminController::delete - CategoriesController::delete
建立於
7 年前
差異永不過期
清除
匯出
分享
解釋
9 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
36 行
全部複製
6 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
34 行
全部複製
public function delete()
public function delete()
{
{
複製
已複製
複製
已複製
// Check for request forgeries
$this->checkToken();
$this->checkToken();
// Get items to remove from the request.
// Get items to remove from the request.
$cid = $this->input->get('cid', array(), 'array');
$cid = $this->input->get('cid', array(), 'array');
複製
已複製
複製
已複製
$extension = $this->input->getCmd('extension', null);
if (!is_array($cid) || count($cid) < 1)
if (!is_array($cid) || count($cid) < 1)
{
{
複製
已複製
複製
已複製
$this->app->
getLogger()->warning
(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'),
array('category' => 'jerror'))
;
$this->app->
enqueueMessage
(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'),
'warning')
;
}
}
else
else
{
{
// Get the model.
// Get the model.
複製
已複製
複製
已複製
/** @var \Joomla\Component\Categories\Administrator\Model\CategoryModel $model */
$model = $this->getModel();
$model = $this->getModel();
// Make sure the item ids are integers
// Make sure the item ids are integers
$cid = ArrayHelper::toInteger($cid);
$cid = ArrayHelper::toInteger($cid);
// Remove the items.
// Remove the items.
if ($model->delete($cid))
if ($model->delete($cid))
{
{
$this->setMessage(Text::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
$this->setMessage(Text::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
}
}
else
else
{
{
複製
已複製
複製
已複製
$this->setMessage($model->getError()
, 'error'
);
$this->setMessage($model->getError()
);
}
}
複製
已複製
複製
已複製
// Invoke the postDelete method to allow for the child class to access the model.
$this->postDeleteHook($model, $cid);
}
}
複製
已複製
複製
已複製
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&
view
=' . $
this->view_list
, false));
$this->setRedirect(Route::_('index.php?option=' . $this->option . '&
extension
=' . $
extension
, false));
}
}
已保存差異
原始文本
開啟檔案
public function delete() { // Check for request forgeries $this->checkToken(); // Get items to remove from the request. $cid = $this->input->get('cid', array(), 'array'); if (!is_array($cid) || count($cid) < 1) { $this->app->getLogger()->warning(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'), array('category' => 'jerror')); } else { // Get the model. $model = $this->getModel(); // Make sure the item ids are integers $cid = ArrayHelper::toInteger($cid); // Remove the items. if ($model->delete($cid)) { $this->setMessage(Text::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid))); } else { $this->setMessage($model->getError(), 'error'); } // Invoke the postDelete method to allow for the child class to access the model. $this->postDeleteHook($model, $cid); } $this->setRedirect(Route::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); }
更改後文本
開啟檔案
public function delete() { $this->checkToken(); // Get items to remove from the request. $cid = $this->input->get('cid', array(), 'array'); $extension = $this->input->getCmd('extension', null); if (!is_array($cid) || count($cid) < 1) { $this->app->enqueueMessage(Text::_($this->text_prefix . '_NO_ITEM_SELECTED'), 'warning'); } else { // Get the model. /** @var \Joomla\Component\Categories\Administrator\Model\CategoryModel $model */ $model = $this->getModel(); // Make sure the item ids are integers $cid = ArrayHelper::toInteger($cid); // Remove the items. if ($model->delete($cid)) { $this->setMessage(Text::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid))); } else { $this->setMessage($model->getError()); } } $this->setRedirect(Route::_('index.php?option=' . $this->option . '&extension=' . $extension, false)); }
尋找差異