예제 #1
0
파일: Contact.php 프로젝트: reytuty/facil
 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);
 }