private function createFormData($ReturnResultVO = NULL) { //adiciona o content na url de envio do formulario if ($this->content_id > 0) { $this->my_action .= "/id.{$this->content_id}/"; } $formData = new ContentFormView($this->ContentSiteVO, Config::getRootPath($this->my_action)); $ImageFormView = new ImageFormView(); $ImageFormView->setFormLabel("Selecionar Imagem"); $ImageFormView->setQuantity(0); // $ImageFormView->setDescription(array('label'=>Translation::text('Link'), 'visible'=>false, 'type'=>'simpleText')); $FileFormView = new FileFormView(); $FileFormView->setFormLabel("Selecionar Arquivo"); $FileFormView->setQuantity(0); // $formData->setPersonalInput(array("name"=>"destaque[]","label"=>"Mostrar na Home?", "options"=>array((object) array("name"=>"Palestrantes", "id"=>"33"), (object) array("name"=>"Outros Palestrantes", "id"=>"34")))); //trocando o rótulo para Content // $formData->setContent(array("label"=>"Descrição:")); //trocando o rótulo para Title $formData->setTitle(array("label" => "Titulo:")); $formData->setHat(array("label" => "Url:")); $formData->setCategory(array("visible" => FALSE, "name" => "category[]", "selected" => array($this->category_id))); $formData->setImage($ImageFormView); $formData->setFile($FileFormView); $formData->setMassiveAttr('visible', FALSE, array('Name', 'Description', 'Content', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut')); $formData->setActive(array("value" => "1", "visible" => FALSE)); $this->my_redirect = "admin/menu_top/select/"; parent::edit($formData, TRUE, NULL, $this->my_redirect, NULL, $ReturnResultVO); }
public function setImage($imageFormView = NULL) { if ($imageFormView == NULL) { $imageFormView = new ImageFormView(); } $this->image = $imageFormView; if ($imageFormView->getQuantity() > 0) { // echo Debug::li("dando push de image"); $this->array_validation["selected"][] = "images"; } }
public function edit() { //busca o primeiro content vinculada com essa categoria if ($this->category_id > 0) { $CategoryVO = new CategoryVO(); $CategoryVO->setId($this->category_id, TRUE); $array_content = $CategoryVO->getLinks("content", 1); //se tiver mais de um link if (count($array_content) > 0) { //pega o primeiro pois aqui só importa 1. $LinkVO = $array_content[0]; if (FALSE) { //ajuda aptana $LinkVO = new LinkVO(); } //echo Debug::li("tem content vinculada com id:".$LinkVO->getLinkedTableId()); //inicia a ContentEncVO $this->ContentEncVO->setId($LinkVO->getLinkedTableId(), TRUE); } } //criar o formView $formData = new ContentFormView($this->ContentEncVO, Config::getRootPath($this->my_action)); //trocando o rótulo para Content $formData->setContent(array("label" => "Edite o texto:")); $ImageFormView = new ImageFormView(); $ImageFormView->setFormLabel("Inserir Imagem"); //quando ta em outro idioma que não o padrao, não pode ter imagem $ImageFormView->setQuantity(0); $FileFormView = new FileFormView(); $FileFormView->setFormLabel("Inserir Arquivo"); $FileFormView->setQuantity(0); if ($this->ContentEncVO->getId() > 0) { //se tiver id significa que o content já foi adicionado alguma vez, então deixa queto } else { //seta o id dessa categoria caso não tenha nenhum content vinculado, pois essa categoria só admite 1 content $formData->setCategory(array("selected" => array($this->category_id))); } $formData->setImage($ImageFormView); $formData->setFile($FileFormView); $formData->setMassiveAttr('visible', FALSE, array('Name', 'Title', 'Hat', 'Description', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut', 'Order')); $formData->setSlug(array("value" => "entre_em_contato", "visible" => FALSE)); $formData->setActive(array("value" => "1", "visible" => FALSE)); parent::edit($formData, TRUE, NULL, $this->my_redirect); }
private function createFormData($ReturnResultVO = NULL) { //busca o primeiro content vinculada com essa categoria if ($this->category_id > 0) { $CategoryVO = new CategoryVO(); $CategoryVO->setId($this->category_id, TRUE); $array_content = $CategoryVO->getLinks("content", 1); //se tiver mais de um link if (count($array_content) > 0) { //pega o primeiro pois aqui só importa 1. $LinkVO = $array_content[0]; if (FALSE) { //ajuda aptana $LinkVO = new LinkVO(); } //echo Debug::li("tem content vinculada com id:".$LinkVO->getLinkedTableId()); //inicia a ContentForumVO $this->ContentSiteVO->setId($LinkVO->getLinkedTableId(), TRUE); } } else { if ($this->content_id > 0) { $this->my_action .= "/id.{$this->content_id}/"; } } $formData = new ContentFormView($this->ContentSiteVO, Config::getRootPath($this->my_action)); $ImageFormView = new ImageFormView(); $ImageFormView->setFormLabel("Selecionar Foto"); $ImageFormView->setQuantity(0); // $ImageFormView->setDescription(array('label'=>Translation::text('Link'), 'visible'=>false, 'type'=>'simpleText')); $FileFormView = new FileFormView(); $FileFormView->setFormLabel("Selecionar Arquivo"); $FileFormView->setQuantity(0); // $formData->setPersonalInput(array("name"=>"destaque[]","label"=>"Mostrar em qual Menu?", "options"=>array((object) array("name"=>"Menu Topo", "id"=>"2"), (object) array("name"=>"Menu Rodapé", "id"=>"3")))); //trocando o rótulo para Content $formData->setDescription(array("label" => "Edite a coluna da Esquerda:", 'type' => 'htmlText')); $formData->setContent(array("label" => "Edite a coluna da Direita:")); $formData->setCategory(array("visible" => FALSE, "name" => "category[]", "selected" => array($this->category_id))); $formData->setImage($ImageFormView); $formData->setFile($FileFormView); $formData->setMassiveAttr('visible', FALSE, array('Name', 'Title', 'Hat', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut', 'Order')); $formData->setActive(array("value" => "1", "visible" => FALSE)); $this->my_redirect = "admin/contact/edit/"; parent::edit($formData, TRUE, NULL, $this->my_redirect, NULL, $ReturnResultVO); }
private function createFormData($ReturnResultVO = NULL) { //adiciona o content na url de envio do formulario if ($this->content_id > 0) { $this->my_action .= "/id.{$this->content_id}/"; } //echo $this->my_action; $formData = new ContentFormView($this->ContentSiteVO, Config::getRootPath($this->my_action)); $ImageFormView = new ImageFormView(); $ImageFormView->setFormLabel("Selecionar Foto"); $ImageFormView->setShowImageUrl(TRUE); // $ImageFormView->setName(array("label"=>"link", "visible"=>TRUE)); if ($this->sub == "unidades") { $ImageFormView->setQuantity(0); } else { $ImageFormView->setQuantity(1); } // $ImageFormView->setDescription(array('label'=>Translation::text('Link'), 'visible'=>false, 'type'=>'simpleText')); $FileFormView = new FileFormView(); $FileFormView->setFormLabel("Selecionar Arquivo"); $FileFormView->setQuantity($this->total_files); if ($this->sub == "blog") { //id do blog 36 $CategoryVO = new CategoryVO(); $CategoryVO->setId(36, TRUE); $array_categorias = $CategoryVO->selectCascade(CategoryDAO::RETURN_STD_OBJECT, 1); $selected_category = array(); $LinkDAO = LinkDAO::getInstance(); if (FALSE) { $LinkDAO = new LinkDAO(); } if ($this->ContentSiteVO->id > 0) { $ReturnLinkCategory = $LinkDAO->select(LinkDAO::RETURN_STD_OBJECT, NULL, NULL, "content", $this->ContentSiteVO->id, 1); if ($ReturnLinkCategory->success && $ReturnLinkCategory->count_total > 0) { foreach ($ReturnLinkCategory->result as $link_std) { $selected_category[] = $link_std->table_id; } } } //Debug::print_r($ReturnLinkCategory);exit(); //new ContentSiteVO(); $formData->setCategory(array("visible" => TRUE, "name" => "category[]", "label" => "Categorias", "selected" => $selected_category, "options" => $array_categorias)); } else { $formData->setCategory(array("visible" => FALSE, "name" => "category[]", "selected" => array($this->category_id))); } if ($this->sub == "unidades") { $formData->setContent(array("label" => "Endereço:", "value" => "unidade")); } else { //trocando o rótulo para Content $formData->setContent(array("label" => "Descrição:")); } //trocando o rótulo para Title $formData->setTitle(array("label" => "Titulo:")); // $formData->setHat(array("label"=>"Link:")); $formData->setDate(array("label" => "Data(formato: dd/mm/aaaa hh:mm:ss para 'agora' deixe vazio):")); $formData->setImage($ImageFormView); $formData->setFile($FileFormView); $array_to_visible_false = array('Name', 'Hat', 'Description', 'Author', 'TemplateUrl', 'Slug', 'KeyWords', 'DateIn', 'DateOut', 'Order'); if ($this->sub == "unidades") { $array_to_visible_false = array('Name', 'Description', 'Content', 'TemplateUrl', 'Slug', 'KeyWords', 'Date', 'DateIn', 'DateOut', 'Order'); $formData->setHat(array("label" => "Endereço")); $formData->setAuthor(array("label" => "Link Mapa")); } $formData->setMassiveAttr('visible', FALSE, $array_to_visible_false); $formData->setActive(array("value" => "1", "visible" => FALSE)); //$this->my_redirect = "admin/page/select/"; parent::edit($formData, TRUE, NULL, $this->my_redirect, NULL, $ReturnResultVO); }