affinity slider as app

This commit is contained in:
phani00
2019-02-14 09:56:53 +01:00
committed by Mario
parent 7b8eb84cb8
commit fc223f5924
6 changed files with 91 additions and 8 deletions

View File

@@ -2,20 +2,25 @@
namespace Zotlabs\Widget;
use Zotlabs\Lib\Apps;
class Affinity {
function widget($arr) {
if(! local_channel())
return '';
$default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
$default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
// replace feature_enabled(local_channel() with
// Apps::system_app_installed(local_channel()
$default_cmin = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
$default_cmax = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
$cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin);
$cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax);
if(feature_enabled(local_channel(),'affinity')) {
if(Apps::system_app_installed(local_channel(),'Affinity Tool')) {
$affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1));
if ($affinity_locked) {