Esempio n. 1
0
 public function add()
 {
     //name
     $nome = DataHandler::getValueByArrayIndex($_POST, "nome");
     //title
     $sobreNome = DataHandler::getValueByArrayIndex($_POST, "sobreNome");
     //author
     $email = DataHandler::getValueByArrayIndex($_POST, "email");
     //hat
     $companhia = DataHandler::getValueByArrayIndex($_POST, "companhia");
     //slug
     $profissao = DataHandler::getValueByArrayIndex($_POST, "provissao");
     //key_words
     $arquiteto = DataHandler::getValueByArrayIndex($_POST, "arquiteto");
     $erros = array();
     //validação
     if (!Validation::validateEmail($email)) {
         $erros[] = "email inválido";
     }
     if (!$nome) {
         $erros[] = "nome inválido";
     }
     if (!$sobreNome) {
         $erros[] = "sobrenome incorreto";
     }
     $ReturnResultVO = new ReturnResultVO($erros);
     if (!count($erros) > 0) {
         //nao tem erros na validação
         $ContentSiteVO = new ContentSiteVO();
         $ContentSiteVO->setName($nome);
         $ContentSiteVO->setTitle($sobreNome);
         $ContentSiteVO->setAuthor($email);
         $ContentSiteVO->setHat($companhia);
         $ContentSiteVO->setSlug($profissao);
         $ContentSiteVO->setKeyWords($arquiteto);
         $ReturnResultVO = $ContentSiteVO->commit();
         if ($ReturnResultVO->success) {
             //agora poe esse content na categoria correta
             $CategoryVO = new CategoryVO();
             echo "id de category necessária para newslatter funcionar";
             exit;
             $CategoryVO->setId(127, TRUE);
             if ($ContentSiteVO->getId() > 0) {
                 $CategoryVO->addLink("newslatter", $ContentSiteVO->getId());
                 $CategoryVO->commit();
             }
         }
     }
     echo $ReturnResultVO->toJson();
     exit;
 }
Esempio n. 2
0
 public function removeProduct()
 {
     $ReturnResult = new ReturnResultVO();
     $id = DataHandler::getValueByArrayIndex($_GET, "id");
     $product_id = DataHandler::getValueByArrayIndex($_GET, "product_id");
     if ($id > 0 && $product_id > 0) {
         $ContentSiteVO = new ContentSiteVO();
         $ContentSiteVO->setId($id, TRUE);
         $ContentSiteVO->removeLink("content", $product_id);
         $ReturnResult = $ContentSiteVO->commit();
     } else {
         $ReturnResult->success = FALSE;
         $ReturnResult->addMessage("id nao recebido");
     }
     echo $ReturnResult->toJson();
     exit;
 }
Esempio n. 3
0
 public function addClient()
 {
     $ReturnResult = new ReturnResultVO();
     $id = DataHandler::getValueByArrayIndex($_GET, "id");
     $client_id = DataHandler::getValueByArrayIndex($_GET, "client_id");
     if ($id > 0 && $client_id > 0) {
         //abaixo eh a familia
         $ContentSiteVO = new ContentSiteVO();
         $ContentSiteVO->setId($id, TRUE);
         $ContentSiteVO->addLink("content", $client_id);
         $ReturnResult = $ContentSiteVO->commit();
     } else {
         $ReturnResult->success = FALSE;
         $ReturnResult->addMessage("id nao recebido");
     }
     echo $ReturnResult->toJson();
     exit;
 }
Esempio n. 4
0
 protected function getContent($id, $width = "400", $height = "400")
 {
     //pega a CategoryVO
     $ContentVO = new ContentSiteVO();
     $ContentVO->setId($id, TRUE);
     $images = $ContentVO->getImages();
     $stdResult = new stdClass();
     $stdResult->title = $ContentVO->getTitle();
     $stdResult->content = $ContentVO->getContent();
     $stdResult->image_url = array();
     if (count($images) > 0) {
         foreach ($images as $image) {
             $url = Config::getRootPath("/image/get_image/image_id." . $image->id . "/max_width.{$width}/max_height.{$height}/crop.1/");
             //é o link
             $stdResult->image_url[] = $url;
         }
     }
     return $stdResult;
 }
Esempio n. 5
0
 public function init()
 {
     //busca todas as paginas cadastradas na tabela content
     $returnResult = new HttpResult();
     //iniciando o resultado para o html
     $retornoDaPaginaHTML = new HttpContentModule();
     $slug_category = "404";
     //id das demais categorias que nao vao ser agrupadas
     $category_id = 86;
     if (count($this->arrayRestFolder) > 1) {
         $slug_category = $this->arrayRestFolder[1];
         $category_id = $this->arrayRestFolder[0] == "segmento" ? 125 : 126;
     } else {
         $slug_category = $this->arrayRestFolder[0];
     }
     $ContentDAO = ContentDAO::getInstance();
     $ReturnDataVO = $ContentDAO->selectBySlugAndTableId($slug_category, "category", $category_id, NULL, ContentDAO::RETURN_VO);
     //		"category", $ReturnDataVO->result[0]->id, ContentDAO::RETURN_VO);
     //echo Debug::print_r($ReturnDataVO);exit();
     //iniciando o retorno padrao em http result
     //fazendo o que precisa fazer para ter os dados
     //setando sucesso true caso tenha dado certo
     $returnResult->setSuccess(count($ReturnDataVO->result) > 0);
     //Debug::print_r($retornoDaPaginaHTML);
     $retornoDaPaginaHTML->content_module = count($ReturnDataVO->result) > 0 ? $ReturnDataVO->result[0] : NULL;
     if ($retornoDaPaginaHTML->content_module) {
         $contentSiteVO = new ContentSiteVO();
         $contentSiteVO->setId($retornoDaPaginaHTML->content_module->id, TRUE);
         $retornoDaPaginaHTML->content_module = $contentSiteVO;
     }
     $retornoDaPaginaHTML->arrayVariable = $this->arrayVariable;
     $retornoDaPaginaHTML->array_segment = $this->getContents(125);
     $retornoDaPaginaHTML->array_estrutura = $this->getContents(126);
     //Debug::print_r($retornoDaPaginaHTML);
     //salvando o objeto de resultado de html no retorno
     $returnResult->setHttpContentResult($retornoDaPaginaHTML);
     return $returnResult;
 }
Esempio n. 6
0
 /**
  * baixar o zip do mal
  * ?products={product_id:N,gallery:true,dimensions:true,files:[]}|{product_id:N,gallery:true,dimensions:true,files:[]}
  */
 public function getZip()
 {
     if (!UserClient::getId() > 0) {
         //nao tem permissao
         Navigation::redirect("405");
         exit;
     }
     set_time_limit(0);
     //tratando variaveis enviadas
     $files_id = DataHandler::getValueByArrayIndex($_POST, "file_id");
     $imagens = DataHandler::getValueByArrayIndex($_POST, "imagens");
     $pdf = DataHandler::getValueByArrayIndex($_POST, "pdf");
     //precisa saber quais sao os produtos envolvidos
     $array_products_id = array();
     $array_files = array();
     if ($files_id) {
         foreach ($files_id as $file_id) {
             $temp_array = explode("_", $file_id);
             $product_id = $temp_array[0];
             if (!in_array($product_id, $array_products_id)) {
                 $array_products_id[] = $product_id;
                 $array_files[] = $product_id;
             }
         }
     }
     if ($imagens) {
         foreach ($imagens as $product_id) {
             if (!in_array($product_id, $array_products_id)) {
                 $array_products_id[] = $product_id;
             }
         }
     }
     if ($pdf) {
         foreach ($pdf as $product_id) {
             if (!in_array($product_id, $array_products_id)) {
                 $array_products_id[] = $product_id;
             }
         }
     }
     $ReturnResultVO = new ReturnResultVO();
     $ProductVO = new ContentSiteVO();
     $FileVO = new FileVO();
     //se tiver produtos para tratar
     if (count($array_products_id) > 0) {
         //a pasta zip precisa existir
         $zip_path = "upload/zip/";
         DataHandler::createFolderIfNotExist($zip_path);
         $array_products_to_zip = array();
         $unique_str = "";
         //nome final do zip que vai baixar, adiciona alguns parametros indicadores
         $zip_name = "teto";
         if (count($array_products_id) > 0) {
             //sao varios produtos
             $zip_name = $zip_name . "_produtos";
         }
         //cada indice dessa array, tem que ser array, terá um json com as info:
         foreach ($array_products_id as $product_id) {
             $resultProduto = $ProductVO->setId($product_id, TRUE);
             if ($resultProduto->success) {
                 $stdProduct = $ProductVO->toStdClass();
                 $array_products_to_zip[] = $stdProduct;
                 $array_images = array();
                 if ($imagens) {
                     if (in_array($product_id, $imagens)) {
                         $array_gallery = $ProductVO->getImages(NULL, "gallery", true);
                         foreach ($array_gallery as $imageVO) {
                             $array_images[] = $imageVO->getURL();
                             $unique_str .= "|" . $imageVO->getId();
                             //add a imagem na pasta
                         }
                         //
                         $array_dimensions = $ProductVO->getImages(NULL, "dimensions", true);
                         foreach ($array_dimensions as $imageVO) {
                             $array_images[] = $imageVO->getURL();
                             //add a imagem na pasta
                             $unique_str .= "|" . $imageVO->getId();
                         }
                     }
                 }
                 $stdProduct->images = $array_images;
                 $array_file_vo = array();
                 //cria a pasta do produto no zip
                 $product_folder_name = DataHandler::strToURL($stdProduct->title);
                 if (count($array_files) > 0) {
                     if (in_array($product_id, $array_files)) {
                         //esse produto pediu algum file
                         $temp_array_files = $ProductVO->getFiles();
                         foreach ($temp_array_files as $FileVO) {
                             if (in_array($FileVO->id, $files_id)) {
                                 $array_file_vo[] = $FileVO;
                                 $unique_str .= "|f." . $file_id;
                                 //add a url do arquivo no zip na pasta
                             }
                         }
                     }
                 }
                 $stdProduct->files = $array_file_vo;
                 $stdProduct->pdf = null;
                 //verificar se quer o pdf
                 if (count($pdf) > 0) {
                     $unique_str .= "|pdf!|";
                     //quero pdf
                     //ver com onde foi salvo
                     if (in_array($product_id, $pdf)) {
                         //ele quer esse pdf, provavelmente se chegou aqui é porque ele realmente exite
                         //mas vou conferir de novo
                         $pdf_url = "upload/pdf/{$product_id}/" . $ProductVO->slug . ".pdf";
                         if (file_exists($pdf_url)) {
                             $stdProduct->pdf = $pdf_url;
                         }
                     }
                 }
             }
             //end if produto sucess
         }
         $folder_name = md5($unique_str);
         DataHandler::createFolderIfNotExist($zip_path . $folder_name . "/");
         $zip_name = $zip_path . $folder_name . "/" . $zip_name . ".zip";
         //echo $zip_name;exit();
         if (!file_exists($zip_name)) {
             //echo Debug::li($zip_name);exit();
             $Zip = new ZipArchive();
             $Zip->open($zip_name, ZipArchive::CREATE);
             //adicionando os arquivos escolhidos
             foreach ($array_products_to_zip as $ProductStd) {
                 $product_slug_folder = $ProductStd->id . "_" . DataHandler::strToURL($ProductStd->title);
                 foreach ($ProductStd->files as $FileVO) {
                     $url = $FileVO->getUrl();
                     $array = explode("/", $url);
                     $file = $array[count($array) - 1];
                     $Zip->addFile($url, $product_slug_folder . "/arquivos/" . $file);
                 }
                 foreach ($ProductStd->images as $url) {
                     //$url 	= $ImageVO->getUrl();
                     $array = explode("/", $url);
                     $file = $array[count($array) - 1];
                     $file = str_replace("original_", "", $file);
                     $Zip->addFile($url, $product_slug_folder . "/imagens/" . $file);
                 }
                 if ($ProductStd->pdf) {
                     $url = $ProductStd->pdf;
                     $array = explode("/", $url);
                     $file = $array[count($array) - 1];
                     $Zip->addFile($url, $product_slug_folder . "/ficha_tecnica.pdf");
                 }
             }
             $Zip->close();
         }
         header("Location: " . Config::getRootPath($zip_name));
         exit;
     }
     exit;
 }
Esempio n. 7
0
 /**
  * 
  * Para acessar isso aqui seria a url: pdf_download/produto/id.N/
  */
 public function cliente($id = false)
 {
     if ($id == FALSE) {
         $id = DataHandler::forceInt(DataHandler::getValueByArrayIndex($this->arrayVariable, "id"));
     }
     if ($id > 0) {
         $ContentSiteVO = new ContentSiteVO();
         $ReturnResult_vo = $ContentSiteVO->setId($id, TRUE);
         if ($ReturnResult_vo->success) {
             $stdProduct = $ContentSiteVO->toStdClass();
             $stdProduct->array_gallery = $ContentSiteVO->getImages(NULL, "gallery", true);
             $stdProduct->array_tagged = $ContentSiteVO->getImages(NULL, "tagged", true);
             $html_start = "<html><body>";
             $html_end = "</body></html>";
             $detail_page = file_get_contents(Config::getFolderView("/PdfDownload/detail.tpl"));
             $image_page = file_get_contents(Config::getFolderView("/PdfDownload/image.tpl"));
             $dimension_page = file_get_contents(Config::getFolderView("/PdfDownload/dimension.tpl"));
             $tpl_img_path = "view/site/";
             //Config::getAsset() ;
             $recover_logo = $stdProduct->hat == 1 ? '<img style=" margin-top: 4px; margin-left: 5px; " src="' . $tpl_img_path . '/PdfDownload/recover_logo.png" />' : "";
             $stdProduct->description = utf8_decode($stdProduct->description);
             $stdProduct->title = utf8_decode($stdProduct->title);
             $stdProduct->content = utf8_decode($stdProduct->content);
             $common_tpl_data = array("###IMG_TPL_PATH###", "###content###", "###title###", "###PRODUCT_URI###", "###recover_logo###");
             $common_data = array($tpl_img_path, $stdProduct->content, $stdProduct->title, Config::getRootPath('produto/id.' . $stdProduct->id . '/' . $stdProduct->slug), $recover_logo);
             $detail_page = str_replace($common_tpl_data, $common_data, $detail_page);
             $image_page = str_replace($common_tpl_data, $common_data, $image_page);
             $dimension_page = str_replace($common_tpl_data, $common_data, $dimension_page);
             $detail_page = str_replace("###description###", $stdProduct->description, $detail_page);
             $html = $html_start . $detail_page;
             foreach ($stdProduct->array_gallery as $image) {
                 $w = 600;
                 $h = 550;
                 $img_url = "image/get_image/image_id." . $image->id . "/max_width.{$w}/max_height.{$h}/";
                 // Debug::print_r( $img_url ) ;
                 // $tmp = file_get_contents( $img_url ) ;
                 // unset( $tmp ) ;
                 // $new_page = str_replace( "###IMAGE_SRC###" , Config::getRootPath( "image/get_image/image_id." .  $image->id . "/max_width.600/max_height.525/" )  , $image_page ) ;
                 // $new_page = str_replace( "###IMAGE_SRC###" , $image->url  , $image_page ) ;
                 $img_name = preg_replace("/\\.jpg\$/", "", $image->url);
                 // $sys_img = $img_name . "_w{$w}_h{$h}_m_no_crop.jpg"  ;
                 $sys_img = $img_name . "_w{$w}_h{$h}_m_cache_crop.jpg";
                 // Debug::print_r($sys_img ) ;
                 // var_dump( file_exists($sys_img) ) ;
                 // die;
                 $new_page = str_replace("###IMAGE_SRC###", $sys_img, $image_page);
                 // Debug::print_r( $image ) ; die;
                 $html .= $new_page;
                 // break;
             }
             $html .= $html_end;
             // echo $html ; die;
             $dompdf = new DOMPDF();
             $dompdf->load_html($html);
             $dompdf->render();
             //$dompdf->stream( "upload/pdf/" . $stdProduct->id . "/" . $stdProduct->slug . ".pdf") ;
             $file = $stdProduct->slug . ".pdf";
             $path = "upload/pdf/" . $stdProduct->id . "/";
             if (!dir($path)) {
                 mkdir($path, 0777, true);
             }
             $html_file = "print.html";
             $html = str_replace("src=\"", "src=\"" . Config::getRootPath(), $html);
             $fp = fopen($path . $html_file, "w");
             fwrite($fp, $html);
             fclose($fp);
             $pdfoutput = $dompdf->output();
             // $filename = $output;
             $fp = fopen($path . $file, "w");
             fwrite($fp, $pdfoutput);
             fclose($fp);
             return true;
         } else {
             //não achou um produto com esse id
             return false;
             Navigation::redirect("");
         }
     } else {
         return false;
         //não mandou o id, vai pra listagem ((!?) TODO: ver se é isso mesmo)
         Navigation::redirect("clientes");
     }
 }
Esempio n. 8
0
 public function sendToFriend()
 {
     $returnResult = new HttpResult();
     $retornoDaPaginaHTML = new HttpRoot();
     $returnResult->setHttpContentResult($retornoDaPaginaHTML);
     if (!isset($_POST["action"])) {
         $protuct_id = DataHandler::forceInt(DataHandler::getValueByArrayIndex($this->arrayVariable, "id"));
         $retornoDaPaginaHTML->form_action = Config::getRootPath("produto/send_to_friend");
         $retornoDaPaginaHTML->view = "form";
         $retornoDaPaginaHTML->product_id = $protuct_id;
     } else {
         $postData = (object) $_POST;
         $ContentSiteVO = new ContentSiteVO();
         $ReturnResult_vo = $ContentSiteVO->setId($postData->id, TRUE);
         if ($ReturnResult_vo->success) {
             $stdProduct = $ContentSiteVO->toStdClass();
             $stdProduct->array_gallery = $ContentSiteVO->getImages(NULL, "gallery", true);
             // Debug::print_r($stdProduct);  die;
             $template = file_get_contents(Config::getFolderView("/templates/email_produto.php"));
             $tpl_img_path = Config::getRootPath(Config::getFolderView());
             $recover_logo = $stdProduct->hat == 1 ? '<img style="" src="' . $tpl_img_path . '/assets/images/recover-min.png" />' : "";
             $first_image = sprintf("<img width='400px' src='%s' />", Config::getRootPath($stdProduct->array_gallery[0]->url));
             $replace_from = array("###PRODUCT_URI###", "###IMG_PATH###", "###TITLE###", "###HAT###", "###CONTENT###", "###IMG###", "###SENDER_NAME###", "###SENDER_EMAIL###", "###RECEIVER_NAME###", "###RECEIVER_MAIL###", "###RECEIVER_MESSAGE###");
             $replace_to = array(Config::getRootPath('produto/id.' . $stdProduct->id . '/' . $stdProduct->slug), $tpl_img_path, utf8_decode($stdProduct->title), $recover_logo, $stdProduct->content, $first_image, $postData->sender_name, $postData->sender_email, $postData->receiver_name, $postData->receiver_email, $postData->receiver_message);
             $template = str_replace($replace_from, $replace_to, $template);
             // var_dump( $stdProduct , $postData ) ;
             // echo $template ; die;
             $host = Config::SYSTEM_MAIL_SMTP;
             $mail = Config::SYSTEM_MAIL_LOGIN;
             $senha = Config::SYSTEM_MAIL_PASSWORD;
             // var_dump( $host , $mail , $senha ) ; die ;
             ob_start();
             $smtp = new Smtp($host, 587);
             $smtp->user = $mail;
             $smtp->pass = $senha;
             $smtp->debug = true;
             // $from = "'" . $postData->sender_name . "' <" . Config::SYSTEM_MAIL_FROM . ">" ;
             // $to = "'" . $postData->sender_name . "' <" . $postData->receiver_mail . ">" ;
             $from = Config::SYSTEM_MAIL_FROM;
             $to = $postData->receiver_email;
             $subject = "Indicação de produto";
             $msg = $template;
             $retornoDaPaginaHTML->sucess = $smtp->Send($to, $from, $subject, $msg, "text/html") ? true : false;
             ob_end_clean();
             //var_dump( $send ) ;
         }
         $retornoDaPaginaHTML->view = "result";
     }
     return $returnResult;
 }
Esempio n. 9
0
 /**
  * Da redirect
  * Envie redirect_with_id para o seu redirect_to ir com o parametro id no final
  * @return void
  */
 public function commit($redirect_page = TRUE, $link_table = "image")
 {
     $contentVO = new ContentSiteVO();
     if (isset($_POST["id"])) {
         $contentVO->setId($_POST["id"], TRUE);
     }
     $contentVO->setFetchArray($_POST);
     //antes de tudo, faz a validação
     $ValidationReturnResultVO = new ReturnResultVO();
     $ValidationReturnResultVO->success = TRUE;
     if (DataHandler::getValueByArrayIndex($_POST, "array_validation")) {
         $array_validation = DataHandler::getValueByArrayIndex($_POST, "array_validation");
         //array de fields que deveriam ser validados e estão errados
         $array_fields_errors = array();
         if (is_array($array_validation)) {
             //se for array, valida a array
             //varre a validação
             foreach ($array_validation as $field_name) {
                 $temp_ReturnResultVO = $this->validateContentFields($field_name, $contentVO);
                 if (!$temp_ReturnResultVO->success) {
                     //echo Debug::li("Content.php erro na validacao : $field_name ");
                     //da o push na array_fields error
                     $array_fields_errors[] = $field_name;
                     //já muda o success do result para false para saber que não precisa mais commitar
                     $ValidationReturnResultVO->success = FALSE;
                 }
             }
         } else {
             if (is_string($array_validation)) {
                 //se for só uma string valida só 1 deles
                 $temp_ReturnResultVO = $this->validateContentFields($field_name, $contentVO);
                 if (!$temp_ReturnResultVO->success) {
                     //da o push na array_fields error
                     $array_fields_errors[] = $field_name;
                     //já muda o success do result para false para saber que não precisa mais commitar
                     $ValidationReturnResultVO->success = FALSE;
                 }
             }
         }
     }
     if (!$ValidationReturnResultVO->success) {
         //coloco na result a array de fields com error
         $ValidationReturnResultVO->result = $array_fields_errors;
         //retorna para o edit de quem extends essa classe
         return $this->{$my_edit_method}($ValidationReturnResultVO);
         //daqui nao passa
         exit;
     }
     //vai criar as key_words do content
     $key_words = "";
     $key_words .= " " . DataHandler::removeAccent($contentVO->getAuthor());
     $key_words .= " " . DataHandler::removeAccent($contentVO->getContent());
     $key_words .= " " . DataHandler::removeAccent($contentVO->getDescription());
     $key_words .= " " . DataHandler::removeAccent($contentVO->getHat());
     $key_words .= " " . DataHandler::removeAccent($contentVO->getName());
     $key_words .= " " . DataHandler::removeAccent($contentVO->getSlug());
     $key_words .= " " . DataHandler::removeAccent($contentVO->getTitle());
     $contentVO->setKeyWords($key_words);
     $returnResultVO = $contentVO->commit();
     $content_id = $contentVO->getId();
     //adicionando link com categoria(s) enviada(s)
     //pega a instancia
     $LinkDAO = LinkDAO::getInstance();
     if (FALSE) {
         $LinkDAO = new LinkDAO();
     }
     //deleta vinculos com categoria
     $LinkDAO->deleteAllFromLinkedTableByTableAndTableId('content', $content_id, 'category');
     $have_category_to_commit = FALSE;
     if (!is_array($_POST["category"])) {
         $_POST["category"] = array($_POST["category"]);
     }
     $arrayCategory = $_POST["category"];
     //Debug::print_r($arrayCategory);exit();
     $order = 10;
     if (!is_array($_POST["order"])) {
         $order = $_POST["order"];
     }
     foreach ($arrayCategory as $category_id) {
         ///print_r($category_id);
         //echo Debug::li("categoria id:".$category_id);
         //cada categoria enviada é mais um link com categoria que deve ser adicionado
         //echo $order;exit();
         $LinkDAO->insert('category', $category_id, 'content', $contentVO->getId(), 1, $order);
         // $contentVO->addLink("category", $category_id);
         $have_category_to_commit = TRUE;
     }
     //exit();
     //caso tenha o que adicionar como link em categoria, commita
     if ($have_category_to_commit) {
         $contentVO->commit();
     }
     //fim da adição do content em categoria
     //-----------------------------==================================== [[[  add imagens ]]]
     $array_image_file = DataHandler::getValueByArrayIndex($_FILES, "image");
     include_once "library/facil3/core/controller/image/FacilImage.php";
     $FacilImage = new FacilImage();
     //echo Debug::li(":link_table   [".$link_table."]");exit();
     $FacilImage->moduleName = $link_table;
     $FacilImage->defaultFolderForNewImages = "upload/image/";
     for ($i = 0; $i < count($array_image_file["name"]); $i++) {
         //Debug::print_r($array_image_file);
         $file_image = array();
         $file_image["name"] = $array_image_file["name"][$i];
         $file_image["type"] = $array_image_file["type"][$i];
         $file_image["tmp_name"] = $array_image_file["tmp_name"][$i];
         $file_image["error"] = $array_image_file["error"][$i];
         $file_image["size"] = $array_image_file["size"][$i];
         //adicionar cada image utilizando o módulo de imagem
         $array_config_info_post = array();
         $image_id = NULL;
         if (DataHandler::getValueByArrayIndex($_POST, "image_info_id")) {
             if (DataHandler::getValueByArrayIndex($_POST["image_info_id"], $i)) {
                 $image_id = $_POST["image_info_id"][$i];
             }
         }
         $array_config_info_post["image_info_id"] = $image_id;
         $array_config_info_post["image_info_name"] = isset($_POST["image_info_name"]) ? $_POST["image_info_name"][$i] : "";
         $array_config_info_post["image_info_description"] = isset($_POST["image_info_description"]) ? $_POST["image_info_description"][$i] : "";
         $array_config_info_post["image_info_order"] = isset($_POST["image_info_order"]) ? $_POST["image_info_order"][$i] : "";
         $array_config_info_post["image_info_locale"] = NULL;
         //$_POST["image_info_locale"][$i];
         $array_config_info_post["image_info_author"] = isset($_POST["image_info_author"][$i]) ? $_POST["image_info_author"][$i] : "";
         $array_config_info_post["table"] = "content";
         $array_config_info_post["table_id"] = $content_id;
         $array_config_info_post["Filedata"] = $file_image;
         $ImageInfoPostVO = new ImageInfoPostVO($array_config_info_post);
         //agora inicia o módulo passando esse info post configurado
         $FacilImage->resetInfoPost($ImageInfoPostVO);
         $ReturnResultVO = $FacilImage->insert();
     }
     //-----------------------------==================================== [[[  add file ]]]
     $array_image_file = DataHandler::getValueByArrayIndex($_FILES, "file");
     include_once "library/facil3/core/controller/file/FacilFile.php";
     $FacilFile = new FacilFile();
     //nome do módulo no sistema
     $FacilFile->moduleName = "file";
     $FacilFile->defaultFolderForNewFiles = "upload/file/";
     for ($i = 0; $i < count($array_image_file["name"]); $i++) {
         $file_image = array();
         $file_image["name"] = $array_image_file["name"][$i];
         $file_image["type"] = $array_image_file["type"][$i];
         $file_image["tmp_name"] = $array_image_file["tmp_name"][$i];
         $file_image["error"] = $array_image_file["error"][$i];
         $file_image["size"] = $array_image_file["size"][$i];
         //adicionar cada image utilizando o módulo de imagem
         $array_config_info_post = array();
         $array_config_info_post["file_info_id"] = isset($_POST["file_info_id"]) ? $_POST["file_info_id"][$i] : "";
         //$_POST["file_info_id"][$i];
         $array_config_info_post["file_info_name"] = isset($_POST["file_info_name"]) ? $_POST["file_info_name"][$i] : "";
         //$_POST["file_info_name"][$i];
         $array_config_info_post["file_info_description"] = isset($_POST["file_info_description"]) ? $_POST["file_info_description"][$i] : "";
         //$_POST["file_info_description"][$i];
         $array_config_info_post["file_info_order"] = isset($_POST["file_info_order"]) ? $_POST["file_info_order"][$i] : "";
         //$_POST["file_info_order"][$i];
         $array_config_info_post["file_info_locale"] = NULL;
         //$_POST["file_info_locale"][$i];
         $array_config_info_post["file_info_author"] = isset($_POST["file_info_author"]) ? $_POST["file_info_author"][$i] : "";
         //$_POST["file_info_author"][$i];
         $array_config_info_post["table"] = "content";
         $array_config_info_post["table_id"] = $content_id;
         $array_config_info_post["Filedata"] = $file_image;
         $FileInfoPostVO = new FileInfoPostVO($array_config_info_post);
         //agora inicia o módulo passando esse info post configurado
         $FacilFile->resetInfoPost($FileInfoPostVO);
         $FacilFile->insert();
     }
     //falta terminar
     //Navigation::redirect("admin/content/");
     $redirect_to = $this->my_redirect;
     if (DataHandler::getValueByArrayIndex($_POST, "redirect_to")) {
         $redirect_to = DataHandler::getValueByArrayIndex($_POST, "redirect_to");
     }
     if ($this->redirect_with_id) {
         $redirect_to .= "/id." . $content_id;
     }
     if ($redirect_page) {
         Navigation::redirect($redirect_to);
         exit;
     } else {
         return $contentVO;
     }
 }