1<?php
2/**
3 * Noticeboard Plugin
4 *
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author  Zaruba Tomas <zatomik@gmail.com>
7 */
8
9// must be run within Dokuwiki
10if(!defined('DOKU_INC')) die();
11
12if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
13require_once(DOKU_PLUGIN.'syntax.php');
14
15/**
16 * Notice class
17 *
18 * @author Tomas Zaruba
19 */
20class helper_plugin_noticeboard_Notice extends DokuWiki_Plugin{
21
22    private $noticeId;
23    private $name;
24    private $place;
25    private $startTime;
26    private $hasStartTime;
27    private $endTime;
28    private $hasEnd;
29    private $hasEndTime;
30    private $deadline;
31    private $category;
32    private $parentId;
33
34
35
36
37
38    function helper_plugin_noticeboard_Notice(){
39
40    }
41
42    public function setId($id){
43        $this->noticeId = $id;
44    }
45
46    public function getId(){
47        return $this->noticeId;
48    }
49
50    public function setParentId($id){
51        $this->parentId = $id;
52    }
53
54    public function getParentId(){
55        return $this->parentId;
56    }
57
58    public function setName($name){
59        $this->name = $name;
60    }
61
62    public function getName(){
63        return $this->name;
64    }
65
66    public function setPlace($place){
67        $this->place = $place;
68    }
69
70    public function getPlace(){
71        return $this->place;
72    }
73
74    public function setStartTime($time){
75        $this->startTime = $time;
76    }
77
78    public function getStartTime(){
79        return $this->startTime;
80    }
81
82    public function setEndTime($time){
83        $this->endTime = $time;
84        $this->setHasEnd(true);
85    }
86
87    public function getEndTime(){
88        return $this->endTime;
89    }
90
91    public function setHasEnd($boolean){
92        $this->hasEnd = $boolean;
93    }
94
95    public function getHasEnd(){
96        return $this->hasEnd;
97    }
98
99    public function setDeadline($date){
100        $this->deadline = $date;
101    }
102
103    public function getDeadline(){
104        return $this->deadline;
105    }
106
107    public function setCategory($category){
108        $this->category = $category;
109    }
110
111    public function getCategory(){
112        return $this->category;
113    }
114
115    public function setHasEndTime($bool){
116        $this->hasEndTime = $bool;
117    }
118
119    public function hasEndTime(){
120        return $this->hasEndTime;
121    }
122
123    public function setHasStartTime($bool){
124        $this->hasStartTime = $bool;
125    }
126
127    public function hasStartTime(){
128        return $this->hasStartTime;
129    }
130
131
132
133
134
135    public function load($id){
136        $file = metaFN($id, '.noticeboard');
137
138        if (!@file_exists($file)){
139            return false;
140        }
141        // load data
142        if (@file_exists($file)) {
143            $object= unserialize(io_readFile($file, false));
144            $this->name = $object->getName();
145            return $this;
146        }
147    }
148
149
150
151}
152?>
153