Exemple #1
0
 /**
  * @before _secure, changeLayout, _admin
  */
 public function imagetext()
 {
     $this->seo(array("title" => "ImageText Game", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $fields = array("src_x", "src_y", "src_h", "src_w", "usr_x", "usr_y", "txt_x", "txt_y", "usr_w", "usr_h", "txt_size", "txt_angle", "txt_color", "utxt_x", "utxt_y", "utxt_size", "utxt_angle", "utxt_color");
     if (RequestMethods::post("action") == "campaign") {
         $imagetext = new \ImageText(array("base_im" => $this->_upload("base_im")));
         foreach ($fields as $key => $value) {
             $imagetext->{$value} = RequestMethods::post($value, "0");
         }
         $imagetext->live = true;
         $imagetext->save();
         $campaign = new \Campaign(array("title" => RequestMethods::post("title"), "description" => RequestMethods::post("description"), "image" => $this->_upload("promo_im"), "type" => "imagetext", "type_id" => $imagetext->id));
         $campaign->save();
         $this->redirect("/config/imagetextitem/" . $imagetext->id);
     }
 }