Ejemplo n.º 1
0
 $template->width = $_POST['width'];
 $template->height = $_POST['height'];
 $template->status = isset($_POST['status']) ? 1 : 0;
 $template->save();
 if ($isNewTemplate) {
     $template->hash = generateUniqueHash('t', $template->id);
     $template->display_order = $template->id;
     $template->save();
 }
 if (!empty($_FILES['thumb']['name'])) {
     if (!$template->uploadThumbOnAmazon($_FILES['thumb']['tmp_name'], $err)) {
         Messages::addError($err);
     }
 }
 if (!empty($_FILES['background']['name'])) {
     if (!$template->uploadBgImageOnAmazon($_FILES['background']['tmp_name'], $err)) {
         Messages::addError($err);
     }
 }
 if (!empty($_FILES['xml']['name'])) {
     if (!$template->uploadXmlOnAmazon($_FILES['xml']['tmp_name'], $err)) {
         Messages::addError($err);
     }
 }
 if (!empty($_FILES['swf']['name'])) {
     if (!$template->uploadSwfOnAmazon($_FILES['swf']['tmp_name'], $err)) {
         Messages::addError($err);
     }
 }
 Messages::addNotice('Saved');
 jump('?page=templates');