X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=qcomment%2Fqcomment.php;h=f4b951843a82a8db18fe65bc622c824bc3c69c6d;hb=4b05d70b94033bf2bcf7a63ee5f9928a56504bd9;hp=2c98cba72335fe3be6fbd6c5f2f91178e25acf26;hpb=5c5c23acb062960dff33bf5fe86f32ff20515389;p=friendica-addons.git diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php old mode 100755 new mode 100644 index 2c98cba7..f4b95184 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -20,6 +20,8 @@ * */ +use Friendica\Core\PConfig; + function qcomment_install() { register_hook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); register_hook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); @@ -37,32 +39,30 @@ function qcomment_uninstall() { -function qcomment_addon_settings(&$a,&$s) { - - if(! local_user()) +function qcomment_addon_settings(&$a, &$s) +{ + if (! local_user()) { return; + } - /* Add our stylesheet to the page so we can make our settings look nice */ + /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - $words = get_pconfig(local_user(),'qcomment','words'); - if($words === false) - $words = t(':-)') . "\n" . t(':-(') . "\n" . t('lol'); + $words = PConfig::get(local_user(), 'qcomment', 'words', t(':-)') . "\n" . t(':-(') . "\n" . t('lol')); - $s .= '
'; - $s .= '

' . t('Quick Comment Settings') . '

'; - $s .= '
'; + $s .= '
'; + $s .= '

' . t('Quick Comment Settings') . '

'; + $s .= '
'; $s .= '
' . t("Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies.") . '
'; - $s .= ''; - $s .= ''; - $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; - $s .= '
'; + $s .= '
'; $s .= '
'; return; - } function qcomment_addon_settings_post(&$a,&$b) { @@ -71,7 +71,7 @@ function qcomment_addon_settings_post(&$a,&$b) { return; if($_POST['qcomment-submit']) { - set_pconfig(local_user(),'qcomment','words',xmlify($_POST['qcomment-words'])); + PConfig::set(local_user(),'qcomment','words',xmlify($_POST['qcomment-words'])); info( t('Quick Comment settings saved.') . EOL); } }