Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/smart-sl.../Nextend/Framewor.../Image
File: ControllerAjaxImage.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
namespace Nextend\Framework\Image;
[3] Fix | Delete
[4] Fix | Delete
[5] Fix | Delete
use Nextend\Framework\Controller\Admin\AdminVisualManagerAjaxController;
[6] Fix | Delete
use Nextend\Framework\Notification\Notification;
[7] Fix | Delete
use Nextend\Framework\Request\Request;
[8] Fix | Delete
[9] Fix | Delete
class ControllerAjaxImage extends AdminVisualManagerAjaxController {
[10] Fix | Delete
[11] Fix | Delete
protected $type = 'image';
[12] Fix | Delete
[13] Fix | Delete
public function actionLoadVisualForImage() {
[14] Fix | Delete
$this->validateToken();
[15] Fix | Delete
$model = $this->getModel();
[16] Fix | Delete
$image = Request::$REQUEST->getVar('image');
[17] Fix | Delete
$visual = $model->getVisual($image);
[18] Fix | Delete
if (!empty($visual)) {
[19] Fix | Delete
$this->response->respond(array(
[20] Fix | Delete
'visual' => $visual
[21] Fix | Delete
));
[22] Fix | Delete
} else {
[23] Fix | Delete
[24] Fix | Delete
if (($visual = $model->addVisual($image, ImageStorage::$emptyImage))) {
[25] Fix | Delete
$this->response->respond(array(
[26] Fix | Delete
'visual' => $visual
[27] Fix | Delete
));
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
Notification::error(n2_('Unexpected error'));
[32] Fix | Delete
$this->response->error();
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
public function actionAddVisual() {
[36] Fix | Delete
$this->validateToken();
[37] Fix | Delete
[38] Fix | Delete
$image = Request::$REQUEST->getVar('image');
[39] Fix | Delete
$this->validateVariable(!empty($image), 'image');
[40] Fix | Delete
[41] Fix | Delete
$model = $this->getModel();
[42] Fix | Delete
[43] Fix | Delete
if (($visual = $model->addVisual($image, Request::$REQUEST->getVar('value')))) {
[44] Fix | Delete
$this->response->respond(array(
[45] Fix | Delete
'visual' => $visual
[46] Fix | Delete
));
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
Notification::error(n2_('Unexpected error'));
[50] Fix | Delete
$this->response->error();
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
public function actionDeleteVisual() {
[54] Fix | Delete
$this->validateToken();
[55] Fix | Delete
[56] Fix | Delete
$visualId = Request::$REQUEST->getInt('visualId');
[57] Fix | Delete
$this->validateVariable($visualId > 0, 'image');
[58] Fix | Delete
[59] Fix | Delete
$model = $this->getModel();
[60] Fix | Delete
[61] Fix | Delete
if (($visual = $model->deleteVisual($visualId))) {
[62] Fix | Delete
$this->response->respond(array(
[63] Fix | Delete
'visual' => $visual
[64] Fix | Delete
));
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
Notification::error(n2_('Not editable'));
[68] Fix | Delete
$this->response->error();
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
public function actionChangeVisual() {
[72] Fix | Delete
$this->validateToken();
[73] Fix | Delete
[74] Fix | Delete
$visualId = Request::$REQUEST->getInt('visualId');
[75] Fix | Delete
$this->validateVariable($visualId > 0, 'image');
[76] Fix | Delete
[77] Fix | Delete
$model = $this->getModel();
[78] Fix | Delete
[79] Fix | Delete
if (($visual = $model->changeVisual($visualId, Request::$REQUEST->getVar('value')))) {
[80] Fix | Delete
$this->response->respond(array(
[81] Fix | Delete
'visual' => $visual
[82] Fix | Delete
));
[83] Fix | Delete
}
[84] Fix | Delete
[85] Fix | Delete
Notification::error(n2_('Unexpected error'));
[86] Fix | Delete
$this->response->error();
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
public function getModel() {
[90] Fix | Delete
return new ModelImage($this);
[91] Fix | Delete
}
[92] Fix | Delete
}
[93] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function