$inputUsername = new \html_library\HTMLInputElement(); $inputUsername->add_attribute(new \html_library\HTMLAttribute('type', 'text')); $inputUsername->add_attribute(new \html_library\HTMLAttribute('name', 'username')); $inputUsername->add_attribute(new \html_library\HTMLAttribute('required', null)); $li1->add_child($labelUsername); $li1->add_child($inputUsername); //password $labelPassword = new \html_library\HTMLLabelElement(); $labelPassword->add_attribute(new \html_library\HTMLAttribute('for', 'password')); $labelPassword->add_child(new \html_library\HTMLTextNode('Password')); $inputPassword = new \html_library\HTMLInputElement(); $inputPassword->add_attribute(new \html_library\HTMLAttribute('type', 'password')); $inputPassword->add_attribute(new \html_library\HTMLAttribute('name', 'password')); $inputPassword->add_attribute(new \html_library\HTMLAttribute('placeholder', 'password')); $inputPassword->add_attribute(new \html_library\HTMLAttribute('required', null)); $li2->add_child($labelPassword); $li2->add_child($inputPassword); $inputSubmit = new \html_library\HTMLInputElement(); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('type', 'submit')); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('value', 'Login')); $li3->add_child($inputSubmit); $homePageLink = new \html_library\HTMLAElement(); $homePageLink->add_attribute(new \html_library\HTMLAttribute('href', 'index.php')); $homePageLink->add_child(new \html_library\HTMLTextNode('Home page')); $body->add_child($homePageLink); $body->add_child(new \html_library\HTMLBrElement()); $registrationLink = new \html_library\HTMLAElement(); $registrationLink->add_attribute(new \html_library\HTMLAttribute('href', 'registration.php')); $registrationLink->add_child(new \html_library\HTMLTextNode('Registration')); $body->add_child($registrationLink); echo $page;
$input->add_attribute(new \html_library\HTMLAttribute('name', 'submitted')); $input->add_attribute(new \html_library\HTMLAttribute('id', 'submitted')); $input->add_attribute(new \html_library\HTMLAttribute('value', '1')); $form->add_child($input); //search tags $labelTags = new \html_library\HTMLLabelElement(); $labelTags->add_attribute(new \html_library\HTMLAttribute('for', 'tags')); $labelTags->add_child(new \html_library\HTMLTextNode('Tags to search image for')); $inputTags = new \html_library\HTMLInputElement(); $inputTags->add_attribute(new \html_library\HTMLAttribute('type', 'text')); $inputTags->add_attribute(new \html_library\HTMLAttribute('name', 'tags')); $inputTags->add_attribute(new \html_library\HTMLAttribute('maxlength', 500)); $inputTags->add_attribute(new \html_library\HTMLAttribute('required', null)); $form->add_child($labelTags); $form->add_child($inputTags); $inputSubmit = new \html_library\HTMLInputElement(); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('type', 'submit')); $inputSubmit->add_attribute(new \html_library\HTMLAttribute('value', 'Search')); $form->add_child($inputSubmit); $homePageLink = new \html_library\HTMLAElement(); $homePageLink->add_attribute(new \html_library\HTMLAttribute('href', 'index.php')); $homePageLink->add_child(new \html_library\HTMLTextNode('Home page')); $body->add_child($homePageLink); $body->add_child(new \html_library\HTMLBrElement()); if (!empty($results)) { $listElements = new \html_library\HTMLUlElement(); foreach ($results as $imageId) { $listElement = new \html_library\HTMLLiElement(); $picLink = new \html_library\HTMLAElement(); $picLink->add_attribute(new \html_library\HTMLAttribute('href', "aboutPicture.php?id=" . $imageId)); $imgContent = new \html_library\HTMLImageElement();
$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()); $link1 = new html_library\HTMLAElement(); $link1->add_attribute(new html_library\HTMLAttribute('href', 'mypictures.php')); $link1->add_child(new html_library\HTMLTextNode('My pictures')); $body->add_child($link1); echo $page;
foreach ($galleries as $galleryId => $gallery) { $option = new \html_library\HTMLOptionElement(); $option->add_attribute(new \html_library\HTMLAttribute('value', $galleryId)); $option->add_child(new \html_library\HTMLTextNode($gallery->getTitle())); if ($galleryId === $picture->getGalleryId()) { $option->add_attribute(new \html_library\HTMLAttribute('selected', 'selected')); } $selectGallery->add_child($option); } $fieldset->add_child($selectGallery); $submitInput = new \html_library\HTMLInputElement(); $submitInput->add_attribute(new \html_library\HTMLAttribute('type', 'submit')); $submitInput->add_attribute(new \html_library\HTMLAttribute('name', 'btnSubmit')); $submitInput->add_attribute(new \html_library\HTMLAttribute('value', 'Save changes')); $fieldset->add_child($submitInput); $deleteInput = new \html_library\HTMLInputElement(); $deleteInput->add_attribute(new \html_library\HTMLAttribute('type', 'submit')); $deleteInput->add_attribute(new \html_library\HTMLAttribute('name', 'btnDelete')); $deleteInput->add_attribute(new \html_library\HTMLAttribute('value', 'Delete image')); $fieldset->add_child($deleteInput); //links $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()); $link1 = new html_library\HTMLAElement(); $link1->add_attribute(new html_library\HTMLAttribute('href', 'mypictures.php')); $link1->add_child(new html_library\HTMLTextNode('My pictures')); $body->add_child($link1); echo $page;