Exemplo n.º 1
0
$link1->add_child(new html_library\HTMLTextNode('Home page'));
$body->add_child($link1);
$body->add_child(new \html_library\HTMLBrElement());
$link2 = new html_library\HTMLAElement();
$link2->add_attribute(new html_library\HTMLAttribute('href', 'upload.php'));
$link2->add_child(new html_library\HTMLTextNode('Upload a new photo'));
$body->add_child($link2);
$body->add_child(new \html_library\HTMLBrElement());
$link1 = new html_library\HTMLAElement();
$link1->add_attribute(new html_library\HTMLAttribute('href', 'new_gallery.php'));
$link1->add_child(new html_library\HTMLTextNode('Create a new gallery'));
$body->add_child($link1);
$body->add_child(new \html_library\HTMLBrElement());
$gallery = new \models\Galerija();
$images = \db\DAO::getConnection()->getAllImagesInGallery($_GET['id']);
$gallery->load($_GET['id']);
$title = new \html_library\HTMLTitleElement();
$title->add_child(new \html_library\HTMLTextNode($gallery->__get('title') . ' (' . count($images) . ')'));
$body->add_child($title);
$body->add_child(new \html_library\HTMLBrElement());
$listElements = new \html_library\HTMLUlElement();
foreach ($images as $image) {
    $values = get_object_vars($image);
    $listElement = new \html_library\HTMLLiElement();
    $picLink = new \html_library\HTMLAElement();
    $picLink->add_attribute(new \html_library\HTMLAttribute('href', "aboutPicture.php?id=" . $values['ID']));
    $imgContent = new \html_library\HTMLImageElement();
    $imgContent->add_attribute(new \html_library\HTMLAttribute('src', "picture.php?id=" . $values['ID'] . "&size=small"));
    $picLink->add_child($imgContent);
    $imgTitle = new \html_library\HTMLTitleElement(3);
    $imgTitle->add_child(new \html_library\HTMLTextNode($values['title']));