|
@@ 146-163 (lines=18) @@
|
| 143 |
|
* |
| 144 |
|
* @return DataResponse |
| 145 |
|
*/ |
| 146 |
|
public function updateWebsiteTheme($siteId, $theme) { |
| 147 |
|
|
| 148 |
|
try { |
| 149 |
|
$website = $this->websitesService->getWebsiteFromId($siteId); |
| 150 |
|
|
| 151 |
|
$website->hasToBeOwnedBy($this->userId); |
| 152 |
|
$website->setTheme((string)$theme); |
| 153 |
|
|
| 154 |
|
$this->themesService->hasToBeAValidTheme($theme); |
| 155 |
|
$this->websitesService->updateWebsite($website); |
| 156 |
|
|
| 157 |
|
return $this->miscService->success( |
| 158 |
|
['websites' => $this->websitesService->getWebsitesFromUser($this->userId)] |
| 159 |
|
); |
| 160 |
|
} catch (Exception $e) { |
| 161 |
|
return $this->miscService->fail(['error' => $e->getMessage()]); |
| 162 |
|
} |
| 163 |
|
} |
| 164 |
|
|
| 165 |
|
|
| 166 |
|
/** |
|
@@ 175-191 (lines=17) @@
|
| 172 |
|
* |
| 173 |
|
* @return DataResponse |
| 174 |
|
*/ |
| 175 |
|
public function editPersonalWebsiteOption($siteId, $option, $value) { |
| 176 |
|
|
| 177 |
|
try { |
| 178 |
|
$website = $this->websitesService->getWebsiteFromId($siteId); |
| 179 |
|
|
| 180 |
|
$website->hasToBeOwnedBy($this->userId); |
| 181 |
|
$website->setOption((string)$option, (string)$value); |
| 182 |
|
|
| 183 |
|
$this->websitesService->updateWebsite($website); |
| 184 |
|
|
| 185 |
|
return $this->miscService->success( |
| 186 |
|
['websites' => $this->websitesService->getWebsitesFromUser($this->userId)] |
| 187 |
|
); |
| 188 |
|
} catch (Exception $e) { |
| 189 |
|
return $this->miscService->fail(['error' => $e->getMessage()]); |
| 190 |
|
} |
| 191 |
|
} |
| 192 |
|
|
| 193 |
|
|
| 194 |
|
/** |