[1] | 1 | <?php |
---|
| 2 | |
---|
| 3 | class dc_news extends data |
---|
| 4 | { |
---|
| 5 | |
---|
| 6 | # ---------------------------------------------------------------------------------------- |
---|
| 7 | # categories |
---|
| 8 | # |
---|
| 9 | |
---|
| 10 | function news_categories() |
---|
| 11 | { return $this->categories(array("root", "news")); |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | function all_news_categories() |
---|
| 15 | { return $this->categories(array("root", "news"), 0, null, "", true); |
---|
| 16 | } |
---|
| 17 | |
---|
| 18 | function news_categorie($id) |
---|
| 19 | { return $this->categorie($id); |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | function add_news_categorie($titre, $icone, $description) |
---|
| 23 | { return $this->add_categorie(null, $titre, $icone, $description, "", $this->id_categorie(array("root", "news"))); |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | function set_news_categorie($id, $titre, $icone, $description) |
---|
| 27 | { return $this->set_categorie($id, null, $titre, $icone, $description); |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | function del_news_categorie($id, $dest) |
---|
| 31 | { if($this->move_contenus($id, $dest)) return $this->del_categorie($id); |
---|
| 32 | return false; |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | # ---------------------------------------------------------------------------------------- |
---|
| 36 | # contenus |
---|
| 37 | # |
---|
| 38 | |
---|
| 39 | function news($path, $start = 0, $depth = 0, $public = false, $max = null) |
---|
| 40 | { return $this->contenus($path, $start, $max, $public ? " AND public=1 AND date_publication <= NOW()" : "", $depth); |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | function add_news($categorie, $titre, $contenu, $auteur, $date_publication, $public) |
---|
| 44 | { return $this->add_contenu(null, $categorie, $titre, "", $contenu, $auteur, $date_publication, $public); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | function set_news($id, $categorie, $titre, $contenu, $auteur, $date_publication, $public) |
---|
| 48 | { return $this->set_contenu($id, null, $categorie, $titre, "", $contenu, $auteur, $date_publication, $public); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | function del_news($id) |
---|
| 52 | { return $this->del_contenu($id); |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | ?> |
---|