/** * @param string $name * @param Entity $entity * @param string $method */ function __construct($name, $entity, $method = "POST") { /* can the name of the form be given in an automated way, using maybe an identified which is generated from the timestamp ? */ $this->name = $name; $this->formHash = md5($name); $this->method = $method; $this->enctype = "multipart/form-data"; /* this is used to control the visibility of the "delete" button in the form while the EDIT mode */ $this->noDelete = false; /* this is used to denote that the form has a POSITION widget type */ $this->withPosition = false; /* the following denotes that the current form will be triggered by some other form, the invoking form is referred in triggerForm */ $this->triggered = false; $this->triggeredForm = false; $this->triggeredForms = false; $this->moderationMode = false; /* the following is the DTML template path */ $this->labels[ADD] = "Aggiungi"; $this->labels[EDIT] = "Modifica"; $this->labels[DELETE] = "Rimuovi"; $this->labels['MSG_SURE'] = "Sei sicuro"; $this->labels['MSG_UPDATE'] = "The item has been correctly updated!"; $this->entity = $entity; $this->reportTemplate = "report/" . $this->entity->entityName . "_report"; parent::__construct("form.html"); $this->reportContent = new Content($entity); /*if( $entity->existsField('father') ) $this->reportContent->setOrderFields('father');*/ }