$inputTitle = new \html_library\HTMLInputElement(); $inputTitle->add_attribute(new \html_library\HTMLAttribute('type', 'text')); $inputTitle->add_attribute(new \html_library\HTMLAttribute('name', 'title')); $inputTitle->add_attribute(new \html_library\HTMLAttribute('id', 'name')); $inputTitle->add_attribute(new \html_library\HTMLAttribute('maxlength', 100)); $inputTitle->add_attribute(new \html_library\HTMLAttribute('value', $pictureTitle)); $inputTitle->add_attribute(new \html_library\HTMLAttribute('required', null)); $fieldset->add_child($inputTitle); $fieldset->add_child(new \html_library\HTMLBrElement()); //description $labelDescription = new \html_library\HTMLLabelElement(); $labelDescription->add_attribute(new \html_library\HTMLAttribute('for', 'description')); $labelDescription->add_child(new \html_library\HTMLTextNode('Description: ')); $fieldset->add_child($labelDescription); $textArea = new \html_library\HTMLTextAreaElement(); $textArea->add_attribute(new \html_library\HTMLAttribute('name', 'description')); $textArea->add_attribute(new \html_library\HTMLAttribute('form', 'pic_upload')); $textArea->add_attribute(new \html_library\HTMLAttribute('maxlength', 500)); $fieldset->add_child($textArea); $textArea->add_child(new \html_library\HTMLTextNode($pictureDescription)); $fieldset->add_child(new \html_library\HTMLBrElement()); //gallery $labelGallery = new \html_library\HTMLLabelElement(); $labelGallery->add_attribute(new \html_library\HTMLAttribute('for', 'gallery')); $labelGallery->add_child(new \html_library\HTMLTextNode('Gallery: ')); $fieldset->add_child($labelGallery); $selectGallery = new \html_library\HTMLSelectElement(); $selectGallery->add_attribute(new \html_library\HTMLAttribute('name', 'galleryOption')); $galleries = DAO::getConnection()->getGalleriesByUserId($_SESSION['user_id']); //napravi izbor korisnikovih galerija foreach ($galleries as $galleryId => $gallery) {
$inputTitle = new \html_library\HTMLInputElement(); $inputTitle->add_attribute(new \html_library\HTMLAttribute('type', 'text')); $inputTitle->add_attribute(new \html_library\HTMLAttribute('name', 'name')); $inputTitle->add_attribute(new \html_library\HTMLAttribute('id', 'name')); $inputTitle->add_attribute(new \html_library\HTMLAttribute('maxlength', 100)); $inputTitle->add_attribute(new \html_library\HTMLAttribute('placeholder', 'Name of your gallery')); $inputTitle->add_attribute(new \html_library\HTMLAttribute('required', null)); $fieldset->add_child($inputTitle); $fieldset->add_child(new \html_library\HTMLBrElement()); //description $labelDescription = new \html_library\HTMLLabelElement(); $labelDescription->add_attribute(new \html_library\HTMLAttribute('for', 'description')); $labelDescription->add_child(new \html_library\HTMLTextNode('Description: ')); $fieldset->add_child($labelDescription); $textArea = new \html_library\HTMLTextAreaElement(); $textArea->add_attribute(new \html_library\HTMLAttribute('name', 'description')); $textArea->add_attribute(new \html_library\HTMLAttribute('form', 'new_gallery')); $textArea->add_attribute(new \html_library\HTMLAttribute('maxlength', 500)); $fieldset->add_child($textArea); $fieldset->add_child(new \html_library\HTMLBrElement()); //submit $inputSubmit = new \html_library\HTMLInputElement(); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('type', 'submit')); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('name', 'Submit')); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('value', 'Submit')); $fieldset->add_child($inputSubmit); $link1 = new html_library\HTMLAElement(); $link1->add_attribute(new html_library\HTMLAttribute('href', 'index.php')); $link1->add_child(new html_library\HTMLTextNode('Home page')); $body->add_child($link1); $body->add_child(new \html_library\HTMLBrElement());
$form->add_attribute(new \html_library\HTMLAttribute('method', 'post')); $form->add_attribute(new \html_library\HTMLAttribute('accept-charset', 'UTF-8')); $fieldset = new \html_library\HTMLFieldsetElement(); $form->add_child($fieldset); $legend = new html_library\HTMLLegendElement(); $legend->add_child(new \html_library\HTMLTextNode('Add comment')); $fieldset->add_child($legend); $submitInput = new \html_library\HTMLInputElement(); $submitInput->add_attribute(new \html_library\HTMLAttribute('type', 'hidden')); $submitInput->add_attribute(new \html_library\HTMLAttribute('name', 'submitted')); $submitInput->add_attribute(new \html_library\HTMLAttribute('id', 'submitted')); $submitInput->add_attribute(new \html_library\HTMLAttribute('value', '1')); $fieldset->add_child($submitInput); //comment $textArea = new \html_library\HTMLTextAreaElement(); $textArea->add_attribute(new \html_library\HTMLAttribute('name', 'comment_data')); $textArea->add_attribute(new \html_library\HTMLAttribute('form', 'comment')); $textArea->add_attribute(new \html_library\HTMLAttribute('required', null)); $textArea->add_attribute(new \html_library\HTMLAttribute('placeholder', 'Type your comment here..')); $textArea->add_attribute(new \html_library\HTMLAttribute('maxlength', 500)); $fieldset->add_child($textArea); $fieldset->add_child(new \html_library\HTMLBrElement()); //submit $inputSubmit = new \html_library\HTMLInputElement(); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('type', 'submit')); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('name', 'Submit')); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('value', 'Submit')); $fieldset->add_child($inputSubmit); $link1 = new html_library\HTMLAElement(); $link1->add_attribute(new html_library\HTMLAttribute('href', 'index.php')); $link1->add_child(new html_library\HTMLTextNode('Home page'));