1 | <?php |
||
15 | class MslsBlogCollection extends MslsRegistryInstance { |
||
16 | |||
17 | /** |
||
18 | * ID of the current blog |
||
19 | * @var int |
||
20 | */ |
||
21 | private $current_blog_id; |
||
22 | |||
23 | /** |
||
24 | * True if the current blog should be in the output |
||
25 | * @var bool |
||
26 | */ |
||
27 | private $current_blog_output; |
||
28 | |||
29 | /** |
||
30 | * Collection of MslsBlog-objects |
||
31 | * @var array |
||
32 | */ |
||
33 | private $objects = array(); |
||
34 | |||
35 | /** |
||
36 | * Order output by language or description |
||
37 | * @var string |
||
38 | */ |
||
39 | private $objects_order; |
||
40 | |||
41 | /** |
||
42 | * Active plugins in the whole network |
||
43 | * @var array |
||
44 | */ |
||
45 | private $active_plugins; |
||
46 | |||
47 | /** |
||
48 | * Constructor |
||
49 | */ |
||
50 | public function __construct() { |
||
98 | |||
99 | /** |
||
100 | * Returns the description of an configured blog or false if it is not configured |
||
101 | * |
||
102 | * @param int $blog_id |
||
103 | * @param string|bool $description |
||
104 | * |
||
105 | * @return string|bool |
||
106 | */ |
||
107 | public static function get_configured_blog_description( $blog_id, $description = false ) { |
||
119 | |||
120 | /** |
||
121 | * Gets the list of the blogs of the reference user |
||
122 | * The first available user of the blog will be used if there is no |
||
123 | * refrence user configured |
||
124 | * |
||
125 | * @param MslsOptions $options |
||
126 | * |
||
127 | * @return array |
||
128 | */ |
||
129 | public function get_blogs_of_reference_user( MslsOptions $options ) { |
||
147 | |||
148 | /** |
||
149 | * Gets blog(s) by language |
||
150 | */ |
||
151 | public function get_blog_id( $language ) { |
||
163 | |||
164 | /** |
||
165 | * Get the id of the current blog |
||
166 | * @return int |
||
167 | */ |
||
168 | public function get_current_blog_id() { |
||
171 | |||
172 | /** |
||
173 | * Checks if blog is the current blog |
||
174 | * @param MslsBlog $blog |
||
175 | * |
||
176 | * @return bool |
||
177 | */ |
||
178 | public function is_current_blog( MslsBlog $blog ) { |
||
181 | |||
182 | /** |
||
183 | * Checks if current blog is in the collection |
||
184 | * |
||
185 | * @return bool |
||
186 | */ |
||
187 | public function has_current_blog() { |
||
190 | |||
191 | /** |
||
192 | * Gets current blog as object |
||
193 | * @return MslsBlog|null |
||
194 | */ |
||
195 | public function get_current_blog() { |
||
198 | |||
199 | /** |
||
200 | * Gets an array with all blog-objects |
||
201 | * @return MslsBlog[] |
||
202 | */ |
||
203 | public function get_objects() { |
||
206 | |||
207 | /** |
||
208 | * Is plugin active in the blog with that blog_id |
||
209 | * |
||
210 | * @param int $blog_id |
||
211 | * |
||
212 | * @return bool |
||
213 | */ |
||
214 | public function is_plugin_active( $blog_id ) { |
||
230 | |||
231 | /** |
||
232 | * Gets only blogs where the plugin is active |
||
233 | * @return array |
||
234 | */ |
||
235 | public function get_plugin_active_blogs() { |
||
246 | |||
247 | /** |
||
248 | * Gets an array of all - but not the current - blog-objects |
||
249 | * @return MslsBlog[] |
||
250 | */ |
||
251 | public function get() { |
||
260 | |||
261 | /** |
||
262 | * Gets an array with filtered blog-objects |
||
263 | * |
||
264 | * @param bool $filter |
||
265 | * |
||
266 | * @return MslsBlog[] |
||
267 | */ |
||
268 | public function get_filtered( $filter = false ) { |
||
275 | |||
276 | /** |
||
277 | * Gets the registered users of the current blog |
||
278 | * |
||
279 | * @param string $fields |
||
280 | * @param int|string $number |
||
281 | * |
||
282 | * @return array |
||
283 | */ |
||
284 | public function get_users( $fields = 'all', $number = '' ) { |
||
294 | |||
295 | /** |
||
296 | * Returns a specific blog language. |
||
297 | * |
||
298 | * @param int $blog_id |
||
299 | * |
||
300 | * @return string |
||
301 | */ |
||
302 | public static function get_blog_language( $blog_id = null ) { |
||
313 | |||
314 | } |
||
315 |