ossn.lib.components.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Open Source Social Network
4  *
5  * @package (Informatikon.com).ossn
6  * @author OSSN Core Team <[email protected]>
7  * @copyright 2014 iNFORMATIKON TECHNOLOGIES
8  * @license General Public Licence http://www.opensource-socialnetwork.org/licence
9  * @link http://www.opensource-socialnetwork.org/licence
10  */
11 /**
12  * Get components object
13  *
14  * @return OssnComponents
15  */
16 function ossn_components() {
17  $coms = new OssnComponents;
18  return $coms;
19 }
20 
21 /**
22  * Check whether component is active or not.
23  *
24  * @param string $comn Component id
25  *
26  * @return bool
27  */
28 function com_is_active($comn) {
29  $com = new OssnComponents;
30  if($com->isActive($comn)) {
31  return true;
32  }
33  return false;
34 }
35 
36 /**
37  * Count total components
38  *
39  * @return integer
40  */
42  $com = new OssnComponents;
43  return $com->total();
44 }
45 
46 /**
47  * Load the locales
48  *
49  * @return array
50  */
52 
53 /**
54  * Includes all components and active theme
55  *
56  * @return bool
57  */
58 
59 //loads active theme
61 $theme->loadActive();
62 
63 //load active components
65 $coms->loadComs();
66 
67 /**
68  * Initialize components
69  *
70  * @return false|null
71  * @access private;
72  */
73 
75  $panels = ossn_registered_com_panel();
76  if(!$panels) {
77  return false;
78  }
79  foreach($panels as $configure) {
80  ossn_register_menu_item('topbar_admin', array(
81  'name' => OssnTranslit::urlize($configure),
82  'text' => $configure,
83  'parent' => 'configure',
84  'href' => ossn_site_url("administrator/component/{$configure}")
85  ));
86  }
87 }
88 
89 ossn_register_callback('ossn', 'init', 'ossn_components_init');