$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;
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;