|
|
@ -155,11 +155,11 @@ class ListController extends Controller |
|
|
|
if ($form->load(Yii::$app->request->post())) { |
|
|
|
if ($form->load(Yii::$app->request->post())) { |
|
|
|
$form->image = UploadedFile::getInstance($form, 'image'); |
|
|
|
$form->image = UploadedFile::getInstance($form, 'image'); |
|
|
|
if ($form->image && $form->validate()) { |
|
|
|
if ($form->image && $form->validate()) { |
|
|
|
if (!file_exists(Yii::getAlias('@staticRoot') . '/images/origin/favicon')) { |
|
|
|
if (!file_exists(Yii::getAlias('@staticRoot') . '/origin/favicon')) { |
|
|
|
mkdir(Yii::getAlias('@staticRoot') . '/images/origin/favicon', 0777, true); |
|
|
|
mkdir(Yii::getAlias('@staticRoot') . '/origin/favicon', 0777, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$form->image->saveAs(Yii::getAlias('@staticRoot') . '/images/origin/favicon/favicon.png'); |
|
|
|
$form->image->saveAs(Yii::getAlias('@staticRoot') . '/origin/favicon/favicon.png'); |
|
|
|
$this->_service->newFavicon(); |
|
|
|
$this->_service->newFavicon(); |
|
|
|
Yii::$app->session->setFlash('success', Yii::t('main', 'Favicon generation complete')); |
|
|
|
Yii::$app->session->setFlash('success', Yii::t('main', 'Favicon generation complete')); |
|
|
|
return $this->redirect(['settings/list/index']); |
|
|
|
return $this->redirect(['settings/list/index']); |
|
|
|