@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | private $chapter_id; |
48 | 48 | |
49 | 49 | /** |
50 | - * Main method of the module |
|
51 | - * |
|
52 | - * @param string $id Module basename |
|
53 | - * @param string $mode Module mode |
|
54 | - */ |
|
50 | + * Main method of the module |
|
51 | + * |
|
52 | + * @param string $id Module basename |
|
53 | + * @param string $mode Module mode |
|
54 | + */ |
|
55 | 55 | public function main($id, $mode) |
56 | 56 | { |
57 | 57 | global $phpbb_container; |
@@ -82,16 +82,16 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
85 | - * Module action: Display (Default) |
|
86 | - */ |
|
85 | + * Module action: Display (Default) |
|
86 | + */ |
|
87 | 87 | private function action_display() |
88 | 88 | { |
89 | 89 | $this->controller->display_chapters($this->parent_id); |
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
93 | - * Module action: Add |
|
94 | - */ |
|
93 | + * Module action: Add |
|
94 | + */ |
|
95 | 95 | private function action_add() |
96 | 96 | { |
97 | 97 | $this->tpl_name = 'acp_bbook_chapters_edit'; |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
103 | - * Module action: Edit |
|
104 | - */ |
|
103 | + * Module action: Edit |
|
104 | + */ |
|
105 | 105 | private function action_edit() |
106 | 106 | { |
107 | 107 | $this->tpl_name = 'acp_bbook_chapters_edit'; |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | - * Module action: Move Down |
|
114 | - */ |
|
113 | + * Module action: Move Down |
|
114 | + */ |
|
115 | 115 | private function action_move_down() |
116 | 116 | { |
117 | 117 | $this->controller->move_chapter($this->chapter_id, 'down'); |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
122 | - * Module action: Move Up |
|
123 | - */ |
|
122 | + * Module action: Move Up |
|
123 | + */ |
|
124 | 124 | private function action_move_up() |
125 | 125 | { |
126 | 126 | $this->controller->move_chapter($this->chapter_id, 'up'); |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * Module action: Delete |
|
132 | - */ |
|
131 | + * Module action: Delete |
|
132 | + */ |
|
133 | 133 | private function action_delete() |
134 | 134 | { |
135 | 135 | if (confirm_box(true)) |
@@ -14,70 +14,70 @@ |
||
14 | 14 | interface bbook_chapter_interface |
15 | 15 | { |
16 | 16 | /** |
17 | - * Get number of chapters |
|
18 | - * |
|
19 | - * @param int $book_id Book ID |
|
20 | - * @return int |
|
21 | - */ |
|
17 | + * Get number of chapters |
|
18 | + * |
|
19 | + * @param int $book_id Book ID |
|
20 | + * @return int |
|
21 | + */ |
|
22 | 22 | public function count_chapters($book_id = 0); |
23 | 23 | |
24 | 24 | /** |
25 | - * Get all chapters |
|
26 | - * |
|
27 | - * @param int $book_id Book ID |
|
28 | - * @param int $parent_id Parent ID |
|
29 | - * @return array |
|
30 | - */ |
|
25 | + * Get all chapters |
|
26 | + * |
|
27 | + * @param int $book_id Book ID |
|
28 | + * @param int $parent_id Parent ID |
|
29 | + * @return array |
|
30 | + */ |
|
31 | 31 | public function get_chapters($book_id = 0, $parent_id = 0); |
32 | 32 | |
33 | 33 | /** |
34 | - * Add a chapter |
|
35 | - * |
|
36 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
37 | - * @param int $parent_id Parent ID |
|
38 | - * @return \vinabb\web\entities\bbook_chapter_interface |
|
39 | - */ |
|
34 | + * Add a chapter |
|
35 | + * |
|
36 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
37 | + * @param int $parent_id Parent ID |
|
38 | + * @return \vinabb\web\entities\bbook_chapter_interface |
|
39 | + */ |
|
40 | 40 | public function add_chapter(\vinabb\web\entities\bbook_chapter_interface $entity, $parent_id = 0); |
41 | 41 | |
42 | 42 | /** |
43 | - * Move a chapter up/down |
|
44 | - * |
|
45 | - * @param int $id Chapter ID |
|
46 | - * @param string $direction The direction: up|down |
|
47 | - * @param int $amount The number of places to move |
|
48 | - * @throws \vinabb\web\exceptions\out_of_bounds |
|
49 | - */ |
|
43 | + * Move a chapter up/down |
|
44 | + * |
|
45 | + * @param int $id Chapter ID |
|
46 | + * @param string $direction The direction: up|down |
|
47 | + * @param int $amount The number of places to move |
|
48 | + * @throws \vinabb\web\exceptions\out_of_bounds |
|
49 | + */ |
|
50 | 50 | public function move_chapter($id, $direction = 'up', $amount = 1); |
51 | 51 | |
52 | 52 | /** |
53 | - * Change the parent |
|
54 | - * |
|
55 | - * @param int $id Chapter ID |
|
56 | - * @param int $new_parent_id New parent ID |
|
57 | - * @throws \vinabb\web\exceptions\out_of_bounds |
|
58 | - */ |
|
53 | + * Change the parent |
|
54 | + * |
|
55 | + * @param int $id Chapter ID |
|
56 | + * @param int $new_parent_id New parent ID |
|
57 | + * @throws \vinabb\web\exceptions\out_of_bounds |
|
58 | + */ |
|
59 | 59 | public function change_parent($id, $new_parent_id); |
60 | 60 | |
61 | 61 | /** |
62 | - * Get a chapter's parent chapters (for use in breadcrumbs) |
|
63 | - * |
|
64 | - * @param int $parent_id Parent ID |
|
65 | - * @return array |
|
66 | - */ |
|
62 | + * Get a chapter's parent chapters (for use in breadcrumbs) |
|
63 | + * |
|
64 | + * @param int $parent_id Parent ID |
|
65 | + * @return array |
|
66 | + */ |
|
67 | 67 | public function get_parents($parent_id); |
68 | 68 | |
69 | 69 | /** |
70 | - * Update the view counter |
|
71 | - * |
|
72 | - * @param int $id Chapter ID |
|
73 | - */ |
|
70 | + * Update the view counter |
|
71 | + * |
|
72 | + * @param int $id Chapter ID |
|
73 | + */ |
|
74 | 74 | public function increase_views($id); |
75 | 75 | |
76 | 76 | /** |
77 | - * Delete a chapter |
|
78 | - * |
|
79 | - * @param int $id Chapter ID |
|
80 | - * @throws \vinabb\web\exceptions\out_of_bounds |
|
81 | - */ |
|
77 | + * Delete a chapter |
|
78 | + * |
|
79 | + * @param int $id Chapter ID |
|
80 | + * @throws \vinabb\web\exceptions\out_of_bounds |
|
81 | + */ |
|
82 | 82 | public function delete_chapter($id); |
83 | 83 | } |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | class nestedset_bbook_chapters extends \phpbb\tree\nestedset |
15 | 15 | { |
16 | 16 | /** |
17 | - * Construct |
|
18 | - * |
|
19 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
20 | - * @param \phpbb\lock\db $lock Lock the table when moving entities around |
|
21 | - * @param string $table_name Table name |
|
22 | - */ |
|
17 | + * Construct |
|
18 | + * |
|
19 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
20 | + * @param \phpbb\lock\db $lock Lock the table when moving entities around |
|
21 | + * @param string $table_name Table name |
|
22 | + */ |
|
23 | 23 | public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\lock\db $lock, $table_name) |
24 | 24 | { |
25 | 25 | parent::__construct( |
@@ -40,32 +40,32 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * Update $this->sql_where to display chapters by the book ID |
|
44 | - * |
|
45 | - * @param int $book_id Book ID |
|
46 | - */ |
|
43 | + * Update $this->sql_where to display chapters by the book ID |
|
44 | + * |
|
45 | + * @param int $book_id Book ID |
|
46 | + */ |
|
47 | 47 | public function set_sql_where($book_id) |
48 | 48 | { |
49 | 49 | $this->sql_where = 'book_id = ' . (int) $book_id; |
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * Get the chapter data from the database |
|
54 | - * |
|
55 | - * @param int $parent_id Parent to display chapters from, 0 for all |
|
56 | - * @return array |
|
57 | - */ |
|
53 | + * Get the chapter data from the database |
|
54 | + * |
|
55 | + * @param int $parent_id Parent to display chapters from, 0 for all |
|
56 | + * @return array |
|
57 | + */ |
|
58 | 58 | public function get_chapter_data($parent_id) |
59 | 59 | { |
60 | 60 | return $parent_id ? $this->get_subtree_data($parent_id, true, false) : $this->get_all_tree_data(); |
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | - * Update the tree for an item inserted in the database |
|
65 | - * |
|
66 | - * @param int $item_id The item to be added |
|
67 | - * @return array |
|
68 | - */ |
|
64 | + * Update the tree for an item inserted in the database |
|
65 | + * |
|
66 | + * @param int $item_id The item to be added |
|
67 | + * @return array |
|
68 | + */ |
|
69 | 69 | public function add_to_nestedset($item_id) |
70 | 70 | { |
71 | 71 | return $this->add_item_to_nestedset($item_id); |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | protected $table_name; |
29 | 29 | |
30 | 30 | /** |
31 | - * Constructor |
|
32 | - * |
|
33 | - * @param ContainerInterface $container Container object |
|
34 | - * @param \vinabb\web\operators\nestedset_bbook_chapters $nestedset Nestedset object for tree functionality |
|
35 | - * @param \phpbb\db\driver\driver_interface $db Database object |
|
36 | - * @param string $table_name Table name |
|
37 | - */ |
|
31 | + * Constructor |
|
32 | + * |
|
33 | + * @param ContainerInterface $container Container object |
|
34 | + * @param \vinabb\web\operators\nestedset_bbook_chapters $nestedset Nestedset object for tree functionality |
|
35 | + * @param \phpbb\db\driver\driver_interface $db Database object |
|
36 | + * @param string $table_name Table name |
|
37 | + */ |
|
38 | 38 | public function __construct( |
39 | 39 | ContainerInterface $container, |
40 | 40 | \phpbb\db\driver\driver_interface $db, |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Get number of chapters |
|
53 | - * |
|
54 | - * @param int $book_id Book ID |
|
55 | - * @return int |
|
56 | - */ |
|
52 | + * Get number of chapters |
|
53 | + * |
|
54 | + * @param int $book_id Book ID |
|
55 | + * @return int |
|
56 | + */ |
|
57 | 57 | public function count_chapters($book_id = 0) |
58 | 58 | { |
59 | 59 | $sql_where = $book_id ? 'WHERE book_id = ' . (int) $book_id : 'WHERE book_id > 0'; |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * Get all chapters |
|
73 | - * |
|
74 | - * @param int $book_id Book ID |
|
75 | - * @param int $parent_id Parent ID |
|
76 | - * @return array |
|
77 | - */ |
|
72 | + * Get all chapters |
|
73 | + * |
|
74 | + * @param int $book_id Book ID |
|
75 | + * @param int $parent_id Parent ID |
|
76 | + * @return array |
|
77 | + */ |
|
78 | 78 | public function get_chapters($book_id = 0, $parent_id = 0) |
79 | 79 | { |
80 | 80 | $entities = []; |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
97 | - * Add a chapter |
|
98 | - * |
|
99 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
100 | - * @param int $parent_id Parent ID |
|
101 | - * @return \vinabb\web\entities\bbook_chapter_interface |
|
102 | - */ |
|
97 | + * Add a chapter |
|
98 | + * |
|
99 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
100 | + * @param int $parent_id Parent ID |
|
101 | + * @return \vinabb\web\entities\bbook_chapter_interface |
|
102 | + */ |
|
103 | 103 | public function add_chapter(\vinabb\web\entities\bbook_chapter_interface $entity, $parent_id = 0) |
104 | 104 | { |
105 | 105 | // Insert the entity to the database |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | - * Move a chapter up/down |
|
126 | - * |
|
127 | - * @param int $id Chapter ID |
|
128 | - * @param string $direction The direction: up|down |
|
129 | - * @param int $amount The number of places to move |
|
130 | - * @throws \vinabb\web\exceptions\out_of_bounds |
|
131 | - */ |
|
125 | + * Move a chapter up/down |
|
126 | + * |
|
127 | + * @param int $id Chapter ID |
|
128 | + * @param string $direction The direction: up|down |
|
129 | + * @param int $amount The number of places to move |
|
130 | + * @throws \vinabb\web\exceptions\out_of_bounds |
|
131 | + */ |
|
132 | 132 | public function move_chapter($id, $direction = 'up', $amount = 1) |
133 | 133 | { |
134 | 134 | $id = (int) $id; |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
148 | - * Change the parent |
|
149 | - * |
|
150 | - * @param int $id Chapter ID |
|
151 | - * @param int $new_parent_id New parent ID |
|
152 | - * @throws \vinabb\web\exceptions\out_of_bounds |
|
153 | - */ |
|
148 | + * Change the parent |
|
149 | + * |
|
150 | + * @param int $id Chapter ID |
|
151 | + * @param int $new_parent_id New parent ID |
|
152 | + * @throws \vinabb\web\exceptions\out_of_bounds |
|
153 | + */ |
|
154 | 154 | public function change_parent($id, $new_parent_id) |
155 | 155 | { |
156 | 156 | $id = (int) $id; |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
171 | - * Get a chapter's parent chapters (for use in breadcrumbs) |
|
172 | - * |
|
173 | - * @param int $parent_id Parent ID |
|
174 | - * @return array |
|
175 | - */ |
|
171 | + * Get a chapter's parent chapters (for use in breadcrumbs) |
|
172 | + * |
|
173 | + * @param int $parent_id Parent ID |
|
174 | + * @return array |
|
175 | + */ |
|
176 | 176 | public function get_parents($parent_id) |
177 | 177 | { |
178 | 178 | $entities = []; |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
192 | - * Update the view counter |
|
193 | - * |
|
194 | - * @param int $id Chapter ID |
|
195 | - */ |
|
192 | + * Update the view counter |
|
193 | + * |
|
194 | + * @param int $id Chapter ID |
|
195 | + */ |
|
196 | 196 | public function increase_views($id) |
197 | 197 | { |
198 | 198 | $sql = 'UPDATE ' . $this->table_name . ' |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
205 | - * Delete a chapter |
|
206 | - * |
|
207 | - * @param int $id Chapter ID |
|
208 | - * @throws \vinabb\web\exceptions\out_of_bounds |
|
209 | - */ |
|
205 | + * Delete a chapter |
|
206 | + * |
|
207 | + * @param int $id Chapter ID |
|
208 | + * @throws \vinabb\web\exceptions\out_of_bounds |
|
209 | + */ |
|
210 | 210 | public function delete_chapter($id) |
211 | 211 | { |
212 | 212 | $id = (int) $id; |
@@ -61,20 +61,20 @@ discard block |
||
61 | 61 | protected $errors; |
62 | 62 | |
63 | 63 | /** |
64 | - * Constructor |
|
65 | - * |
|
66 | - * @param \vinabb\web\controllers\cache\service_interface $cache Cache service |
|
67 | - * @param ContainerInterface $container Container object |
|
68 | - * @param \phpbb\language\language $language Language object |
|
69 | - * @param \phpbb\log\log $log Log object |
|
70 | - * @param \vinabb\web\operators\bbook_chapter_interface $operator Chapter operators |
|
71 | - * @param \phpbb\request\request $request Request object |
|
72 | - * @param \phpbb\template\template $template Template object |
|
73 | - * @param \phpbb\user $user User object |
|
74 | - * @param \vinabb\web\controllers\helper\helper_interface $ext_helper Extension helper |
|
75 | - * @param string $root_path phpBB root path |
|
76 | - * @param string $php_ext PHP file extension |
|
77 | - */ |
|
64 | + * Constructor |
|
65 | + * |
|
66 | + * @param \vinabb\web\controllers\cache\service_interface $cache Cache service |
|
67 | + * @param ContainerInterface $container Container object |
|
68 | + * @param \phpbb\language\language $language Language object |
|
69 | + * @param \phpbb\log\log $log Log object |
|
70 | + * @param \vinabb\web\operators\bbook_chapter_interface $operator Chapter operators |
|
71 | + * @param \phpbb\request\request $request Request object |
|
72 | + * @param \phpbb\template\template $template Template object |
|
73 | + * @param \phpbb\user $user User object |
|
74 | + * @param \vinabb\web\controllers\helper\helper_interface $ext_helper Extension helper |
|
75 | + * @param string $root_path phpBB root path |
|
76 | + * @param string $php_ext PHP file extension |
|
77 | + */ |
|
78 | 78 | public function __construct( |
79 | 79 | \vinabb\web\controllers\cache\service_interface $cache, |
80 | 80 | ContainerInterface $container, |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | - * Set form data |
|
107 | - * |
|
108 | - * @param array $data Form data |
|
109 | - */ |
|
106 | + * Set form data |
|
107 | + * |
|
108 | + * @param array $data Form data |
|
109 | + */ |
|
110 | 110 | public function set_form_data($data) |
111 | 111 | { |
112 | 112 | $this->book_id = $data['book_id']; |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | - * Display chapters |
|
118 | - * |
|
119 | - * @param int $parent_id Parent ID |
|
120 | - */ |
|
117 | + * Display chapters |
|
118 | + * |
|
119 | + * @param int $parent_id Parent ID |
|
120 | + */ |
|
121 | 121 | public function display_chapters($parent_id = 0) |
122 | 122 | { |
123 | 123 | // Grab all from database |
@@ -174,10 +174,10 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
177 | - * Add a chapter |
|
178 | - * |
|
179 | - * @param int $parent_id Parent ID |
|
180 | - */ |
|
177 | + * Add a chapter |
|
178 | + * |
|
179 | + * @param int $parent_id Parent ID |
|
180 | + */ |
|
181 | 181 | public function add_chapter($parent_id = 0) |
182 | 182 | { |
183 | 183 | // Initiate an entity |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
202 | - * Edit a chapter |
|
203 | - * |
|
204 | - * @param int $chapter_id Chapter ID |
|
205 | - */ |
|
202 | + * Edit a chapter |
|
203 | + * |
|
204 | + * @param int $chapter_id Chapter ID |
|
205 | + */ |
|
206 | 206 | public function edit_chapter($chapter_id) |
207 | 207 | { |
208 | 208 | // Initiate and load the entity |
@@ -225,10 +225,10 @@ discard block |
||
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
228 | - * Process data to be added or edited |
|
229 | - * |
|
230 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
231 | - */ |
|
228 | + * Process data to be added or edited |
|
229 | + * |
|
230 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
231 | + */ |
|
232 | 232 | public function add_edit_data(\vinabb\web\entities\bbook_chapter_interface $entity) |
233 | 233 | { |
234 | 234 | $submit = $this->request->is_set_post('submit'); |
@@ -273,8 +273,8 @@ discard block |
||
273 | 273 | } |
274 | 274 | |
275 | 275 | /** |
276 | - * Request data from the form |
|
277 | - */ |
|
276 | + * Request data from the form |
|
277 | + */ |
|
278 | 278 | protected function request_data() |
279 | 279 | { |
280 | 280 | $this->data = [ |
@@ -286,14 +286,14 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
289 | - * Grab the form data's parsing options and set them to the entity |
|
290 | - * |
|
291 | - * If submit, use data from the form |
|
292 | - * In edit mode, use data stored in the entity |
|
293 | - * In add mode, use default values |
|
294 | - * |
|
295 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
296 | - */ |
|
289 | + * Grab the form data's parsing options and set them to the entity |
|
290 | + * |
|
291 | + * If submit, use data from the form |
|
292 | + * In edit mode, use data stored in the entity |
|
293 | + * In add mode, use default values |
|
294 | + * |
|
295 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
296 | + */ |
|
297 | 297 | protected function set_bbcode_options(\vinabb\web\entities\bbook_chapter_interface $entity, $submit) |
298 | 298 | { |
299 | 299 | $entity->text_enable_bbcode($submit ? $this->request->is_set_post('text_bbcode') : ($entity->get_id() ? $entity->text_bbcode_enabled() : true)); |
@@ -302,10 +302,10 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
305 | - * Map the form data fields to setters and set them to the entity |
|
306 | - * |
|
307 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
308 | - */ |
|
305 | + * Map the form data fields to setters and set them to the entity |
|
306 | + * |
|
307 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
308 | + */ |
|
309 | 309 | protected function map_set_data(\vinabb\web\entities\bbook_chapter_interface $entity) |
310 | 310 | { |
311 | 311 | $map_fields = [ |
@@ -334,10 +334,10 @@ discard block |
||
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
337 | - * Insert or update data, then log actions and clear cache if needed |
|
338 | - * |
|
339 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
340 | - */ |
|
337 | + * Insert or update data, then log actions and clear cache if needed |
|
338 | + * |
|
339 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
340 | + */ |
|
341 | 341 | protected function save_data(\vinabb\web\entities\bbook_chapter_interface $entity) |
342 | 342 | { |
343 | 343 | if ($entity->get_id()) |
@@ -376,10 +376,10 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
379 | - * Output entity data to template variables |
|
380 | - * |
|
381 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
382 | - */ |
|
379 | + * Output entity data to template variables |
|
380 | + * |
|
381 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
382 | + */ |
|
383 | 383 | protected function data_to_tpl(\vinabb\web\entities\bbook_chapter_interface $entity) |
384 | 384 | { |
385 | 385 | $this->template->assign_vars([ |
@@ -389,12 +389,12 @@ discard block |
||
389 | 389 | } |
390 | 390 | |
391 | 391 | /** |
392 | - * Move a rule up/down |
|
393 | - * |
|
394 | - * @param int $chapter_id Chapter ID |
|
395 | - * @param string $direction The direction (up|down) |
|
396 | - * @param int $amount The number of places to move |
|
397 | - */ |
|
392 | + * Move a rule up/down |
|
393 | + * |
|
394 | + * @param int $chapter_id Chapter ID |
|
395 | + * @param string $direction The direction (up|down) |
|
396 | + * @param int $amount The number of places to move |
|
397 | + */ |
|
398 | 398 | public function move_chapter($chapter_id, $direction, $amount = 1) |
399 | 399 | { |
400 | 400 | // Check the valid link hash |
@@ -428,10 +428,10 @@ discard block |
||
428 | 428 | } |
429 | 429 | |
430 | 430 | /** |
431 | - * Delete a chapter |
|
432 | - * |
|
433 | - * @param int $chapter_id Chapter ID |
|
434 | - */ |
|
431 | + * Delete a chapter |
|
432 | + * |
|
433 | + * @param int $chapter_id Chapter ID |
|
434 | + */ |
|
435 | 435 | public function delete_chapter($chapter_id) |
436 | 436 | { |
437 | 437 | /** @var \vinabb\web\entities\bbook_chapter_interface $entity */ |
@@ -461,12 +461,12 @@ discard block |
||
461 | 461 | } |
462 | 462 | |
463 | 463 | /** |
464 | - * Generate options of available parents |
|
465 | - * |
|
466 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
467 | - * @param int $parent_id Parent ID |
|
468 | - * @param string $mode Add or edit mode? |
|
469 | - */ |
|
464 | + * Generate options of available parents |
|
465 | + * |
|
466 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
467 | + * @param int $parent_id Parent ID |
|
468 | + * @param string $mode Add or edit mode? |
|
469 | + */ |
|
470 | 470 | protected function build_parent_options(\vinabb\web\entities\bbook_chapter_interface $entity, $parent_id = 0, $mode = 'edit') |
471 | 471 | { |
472 | 472 | $options = $this->operator->get_chapters($this->book_id); |
@@ -14,53 +14,53 @@ |
||
14 | 14 | interface bbook_chapters_interface |
15 | 15 | { |
16 | 16 | /** |
17 | - * Set form data |
|
18 | - * |
|
19 | - * @param array $data Form data |
|
20 | - */ |
|
17 | + * Set form data |
|
18 | + * |
|
19 | + * @param array $data Form data |
|
20 | + */ |
|
21 | 21 | public function set_form_data($data); |
22 | 22 | |
23 | 23 | /** |
24 | - * Display chapters |
|
25 | - * |
|
26 | - * @param int $parent_id Parent ID |
|
27 | - */ |
|
24 | + * Display chapters |
|
25 | + * |
|
26 | + * @param int $parent_id Parent ID |
|
27 | + */ |
|
28 | 28 | public function display_chapters($parent_id = 0); |
29 | 29 | |
30 | 30 | /** |
31 | - * Add a chapter |
|
32 | - * |
|
33 | - * @param int $parent_id Parent ID |
|
34 | - */ |
|
31 | + * Add a chapter |
|
32 | + * |
|
33 | + * @param int $parent_id Parent ID |
|
34 | + */ |
|
35 | 35 | public function add_chapter($parent_id = 0); |
36 | 36 | |
37 | 37 | /** |
38 | - * Edit a chapter |
|
39 | - * |
|
40 | - * @param int $chapter_id Chapter ID |
|
41 | - */ |
|
38 | + * Edit a chapter |
|
39 | + * |
|
40 | + * @param int $chapter_id Chapter ID |
|
41 | + */ |
|
42 | 42 | public function edit_chapter($chapter_id); |
43 | 43 | |
44 | 44 | /** |
45 | - * Process data to be added or edited |
|
46 | - * |
|
47 | - * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
48 | - */ |
|
45 | + * Process data to be added or edited |
|
46 | + * |
|
47 | + * @param \vinabb\web\entities\bbook_chapter_interface $entity Chapter entity |
|
48 | + */ |
|
49 | 49 | public function add_edit_data(\vinabb\web\entities\bbook_chapter_interface $entity); |
50 | 50 | |
51 | 51 | /** |
52 | - * Move a rule up/down |
|
53 | - * |
|
54 | - * @param int $chapter_id Chapter ID |
|
55 | - * @param string $direction The direction (up|down) |
|
56 | - * @param int $amount The number of places to move |
|
57 | - */ |
|
52 | + * Move a rule up/down |
|
53 | + * |
|
54 | + * @param int $chapter_id Chapter ID |
|
55 | + * @param string $direction The direction (up|down) |
|
56 | + * @param int $amount The number of places to move |
|
57 | + */ |
|
58 | 58 | public function move_chapter($chapter_id, $direction, $amount = 1); |
59 | 59 | |
60 | 60 | /** |
61 | - * Delete a chapter |
|
62 | - * |
|
63 | - * @param int $chapter_id Chapter ID |
|
64 | - */ |
|
61 | + * Delete a chapter |
|
62 | + * |
|
63 | + * @param int $chapter_id Chapter ID |
|
64 | + */ |
|
65 | 65 | public function delete_chapter($chapter_id); |
66 | 66 | } |