modulul se ocupa de gestionarea bookmark-urilor si e compus din mai multe pagini:
bookmarks.php:
va contine o lista (sau tabel) cu toate bookmark-urile utilizatorului conectat si optini de editare, stergere
daca utilizatorul are mai mult de 20 de bookmark-uri, se aplica paginare.
new_bookmark.php
va contine un formular in care se pot introduce informatiile:
titlu - obligatoriu - daca lipseste se genereaza eroare
URL - obligatoriu - daca lipseste se genereaza eroare
descriere - optional
categorie (dropdown) - optional
daca formularul este validat, se salveaza bookmark-ul in DB
bookmark.php:
va contine doar un singur bookmark(pagina asteapta in variabila $_GET id-ul bookmark-ului.
aici se vor putea aduce modificari la bookmark-ul incarcat (titlu, URL, descriere, categorie).
In cazul in care pagina nu primeste un id, primeste un id invalid sau id-ul bookmark-ului nu apartine utilizatorului conectat se genereaza o eroare specifica si utilizatorul este redirectat in bookmarks.php
in cazul in care toate verificarile trec, se afiseaza un formular cu informatiile existente pre-completate si posibilitate de a fii modificate si un buton "Save"
daca formularul este salvat se fac urmatoarele verificari:
campul titlul nu este gol si este diferit de valoarea actuala - altfel se genereaza eroare
campul URL-ul nu este gol si este diferit de valoara actuala - altfel se genereaza eroare
campul descriere poate sa nu contina o valoare
campul categorie poate sa nu contina o valoare
delete_bookmark:
pagina necesita id-ul bookmark-ului care va fii sters in variabila $_GET
in cazul in care pagina nu primeste un id valid (exista in DB si apartine utilizatorului conectat) va genera un mesaj de eroare si se ofera utilizatorului optiunea de a naviga la pagina de la care a venit
in cazul in care toate verificarile trec, un mesaj de succes va fii afisat
Gestionarea bookmark-urilor
bookmarks.php:
new_bookmark.php
bookmark.php:
delete_bookmark: