X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=widgets%2Fwidgets.php;h=e62932448efc5f2badd7d21e7a3a63c8aaf3ce92;hb=48dcbc6f3fc3edae74e3ea2c823011bfb7c26081;hp=47a6e48a6fe6deea6903fb25b3d8f4244206112a;hpb=1fce805ee97a0f40c558a241ec2e1f15a0d794bc;p=friendica-addons.git diff --git a/widgets/widgets.php b/widgets/widgets.php index 47a6e48a..e6293244 100755 --- a/widgets/widgets.php +++ b/widgets/widgets.php @@ -5,8 +5,9 @@ * Version: 1.0 * Author: Fabio Comuni */ - - + +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'); @@ -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__)); @@ -51,7 +52,8 @@ function widgets_settings(&$a,&$o) { - $t = file_get_contents( dirname(__file__). "/settings.tpl" ); +# $t = file_get_contents( dirname(__file__). "/settings.tpl" ); + $t = get_markup_template("settings.tpl", "addon/widgets/"); $o .= replace_macros($t, array( '$submit' => t('Generate new key'), '$baseurl' => $a->get_baseurl(),