1 | <?php |
||
15 | class MslsBlogCollection implements IMslsRegistryInstance { |
||
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() { |
||
99 | |||
100 | /** |
||
101 | * Returns the description of an configured blog or false if it is not configured |
||
102 | * |
||
103 | * @param int $blog_id |
||
104 | * @param string|bool $description |
||
105 | * |
||
106 | * @return string|bool |
||
107 | */ |
||
108 | public static function get_configured_blog_description( $blog_id, $description = false ) { |
||
120 | |||
121 | /** |
||
122 | * Gets the list of the blogs of the reference user |
||
123 | * The first available user of the blog will be used if there is no |
||
124 | * refrence user configured |
||
125 | * |
||
126 | * @param MslsOptions $options |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | public function get_blogs_of_reference_user( MslsOptions $options ) { |
||
148 | |||
149 | /** |
||
150 | * Gets blog(s) by language |
||
151 | */ |
||
152 | public function get_blog_id( $language ) { |
||
161 | |||
162 | /** |
||
163 | * Get the id of the current blog |
||
164 | * @return int |
||
165 | */ |
||
166 | public function get_current_blog_id() { |
||
169 | |||
170 | /** |
||
171 | * Checks if current blog is in the collection |
||
172 | * |
||
173 | * @return bool |
||
174 | */ |
||
175 | public function has_current_blog() { |
||
178 | |||
179 | /** |
||
180 | * Gets current blog as object |
||
181 | * @return MslsBlog|null |
||
182 | */ |
||
183 | public function get_current_blog() { |
||
190 | |||
191 | /** |
||
192 | * Gets an array with all blog-objects |
||
193 | * @return MslsBlog[] |
||
194 | */ |
||
195 | public function get_objects() { |
||
198 | |||
199 | /** |
||
200 | * Is plugin active in the blog with that blog_id |
||
201 | * |
||
202 | * @param int $blog_id |
||
203 | * |
||
204 | * @return bool |
||
205 | */ |
||
206 | public function is_plugin_active( $blog_id ) { |
||
222 | |||
223 | /** |
||
224 | * Gets only blogs where the plugin is active |
||
225 | * @return array |
||
226 | */ |
||
227 | public function get_plugin_active_blogs() { |
||
238 | |||
239 | /** |
||
240 | * Gets an array of all - but not the current - blog-objects |
||
241 | * @return array |
||
242 | */ |
||
243 | public function get() { |
||
251 | |||
252 | /** |
||
253 | * Gets an array with filtered blog-objects |
||
254 | * |
||
255 | * @param bool $filter |
||
256 | * |
||
257 | * @return array |
||
258 | */ |
||
259 | public function get_filtered( $filter = false ) { |
||
266 | |||
267 | /** |
||
268 | * Gets the registered users of the current blog |
||
269 | * |
||
270 | * @param string $fields |
||
271 | * @param int|string $number |
||
272 | * |
||
273 | * @return array |
||
274 | */ |
||
275 | public function get_users( $fields = 'all', $number = '' ) { |
||
285 | |||
286 | /** |
||
287 | * Gets or creates an instance of MslsBlogCollection |
||
288 | * @todo Until PHP 5.2 is not longer the minimum for WordPress ... |
||
289 | * @return MslsBlogCollection |
||
290 | */ |
||
291 | public static function instance() { |
||
299 | |||
300 | } |
||
301 |