public function switchToDefaultTemplates($coverData) { $userId = (int) $coverData['userId']; $this->service->deleteAllUserCovers($userId); $template = $this->service->findDefaultTemplateForUser($userId); $data = array('position' => array('top' => 0, 'left' => 0)); $src = null; $ratio = null; $templateId = null; if ($template !== null) { $data = $template->getSettings(); $src = $template->getSrc(); $ratio = $template->getRatio(); $templateId = $template->id; } $message = OW::getLanguage()->text('uheader', 'cover_restore_success'); return array('message' => $message, 'src' => $src, 'data' => $data, "defaultTemplateMode" => $templateId !== null, "templateId" => $templateId, 'ratio' => $ratio); }