forked from lianglee/HtmlSidebar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathossn_com.php
46 lines (45 loc) · 1.19 KB
/
ossn_com.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Open Source Social Network
*
* @packageOpen Source Social Network
* @author Open Social Website Core Team <[email protected]>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://www.opensource-socialnetwork.org/licence
* @link http://www.opensource-socialnetwork.org/licence
*/
define('__HTML_SIDEBAR__', ossn_route()->com . 'HtmlSidebar/');
/**
* Home sidebar initlize the component
*
* return void
*/
function html_sidebar(){
ossn_add_hook('newsfeed', "sidebar:right", 'html_widget');
ossn_register_com_panel('HtmlSidebar', 'settings');
if (ossn_isAdminLoggedin()) {
ossn_register_action('html/sidebar/save', __HTML_SIDEBAR__ . 'actions/save.php');
}
}
/**
* Show a html on sidebar
*
* return array
*/
function html_widget($hook, $tye, $return){
$return[] = ossn_plugin_view('htmlsidebar/contents');
return $return;
}
/**
* Convert save data into html code
*
* @param string $text encoded html code.
*
* return void|string
*/
function html_sidebar_output($text = ''){
if(!empty($text)){
return html_entity_decode($text, ENT_COMPAT, 'utf-8');
}
}
ossn_register_callback('ossn', 'init', 'html_sidebar');