]> git.mxchange.org Git - friendica-addons.git/blobdiff - widgets/widgets.php
Remove references to include/group.php
[friendica-addons.git] / widgets / widgets.php
old mode 100755 (executable)
new mode 100644 (file)
index 72534ce..a232d9e
@@ -5,8 +5,9 @@
  * Version: 1.0
  * Author: Fabio Comuni <http://kirgroup.com/profile/fabrix/>
  */
-        
+
+use Friendica\Core\PConfig;
+
 function widgets_install() {
        register_hook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings'); 
        register_hook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
@@ -22,7 +23,7 @@ function widgets_settings_post(){
        if(! local_user())
                return;
        if (isset($_POST['widgets-submit'])){
-               del_pconfig(local_user(), 'widgets', 'key');
+               PConfig::delete(local_user(), 'widgets', 'key');
                
        }
 }
@@ -32,8 +33,8 @@ function widgets_settings(&$a,&$o) {
                return;         
        
        
-       $key = get_pconfig(local_user(), 'widgets', 'key' );
-       if ($key=='') { $key = mt_rand(); set_pconfig(local_user(), 'widgets', 'key', $key); }
+       $key = PConfig::get(local_user(), 'widgets', 'key' );
+       if ($key=='') { $key = mt_rand(); PConfig::set(local_user(), 'widgets', 'key', $key); }
 
        $widgets = array();
        $d = dir(dirname(__file__));