private function getFormCss() { $form = new Stuffpress_Form(); // Add the form element details $form->setMethod('post'); $form->setName('formCss'); // Enabled $e = $form->createElement('checkbox', 'css_enabled', array('label' => 'Enable CSS', 'decorators' => $form->elementDecorators)); $form->addElement($e); // Content $e = $form->createElement('textarea', 'css_content', array('label' => 'User css', 'decorators' => $form->elementDecorators)); $form->AddElement($e); // use addElement() as a factory to create 'Post' button: $form->addElement('button', 'save', array('label' => 'Save', 'onclick' => "submitFormCss();", 'decorators' => $form->buttonDecorators)); return $form; }
private function getForm() { $form = new Stuffpress_Form(); // Add the form element details $form->setMethod('post'); $form->setName('formProfile'); // First name $e = $form->createElement('text', 'first_name', array('label' => 'First name', 'class' => 'width1', 'decorators' => $form->elementDecorators)); $e->addFilter('StripTags'); $form->addElement($e); // Last name $e = $form->createElement('text', 'last_name', array('label' => 'Last name', 'class' => 'width1', 'decorators' => $form->elementDecorators)); $e->addFilter('StripTags'); $form->AddElement($e); // Short Bio $e = $form->createElement('textarea', 'bio', array('label' => 'Short bio', 'class' => 'width1', 'decorators' => $form->elementDecorators)); $e->addFilter('StripTags'); $form->AddElement($e); // Location $e = $form->createElement('text', 'location', array('label' => 'Location', 'class' => 'width1', 'decorators' => $form->elementDecorators)); $e->addFilter('StripTags'); $form->AddElement($e); // use addElement() as a factory to create 'Post' button: $form->addElement('button', 'save', array('label' => 'Save', 'onclick' => "submitFormProfile();", 'decorators' => $form->buttonDecorators)); return $form; }