From: Zach Prezkuta Date: Wed, 28 Nov 2012 02:05:34 +0000 (-0700) Subject: allow admin to force alt-pager use for entire hub X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=15122d8c2100e22e22f15bc66ffbe444143034b6;p=friendica-addons.git allow admin to force alt-pager use for entire hub --- diff --git a/altpager/admin.tpl b/altpager/admin.tpl new file mode 100755 index 00000000..60558808 --- /dev/null +++ b/altpager/admin.tpl @@ -0,0 +1,3 @@ +{{ inc field_radio.tpl with $field=$global }}{{ endinc }} +{{ inc field_radio.tpl with $field=$individual }}{{ endinc }} +
diff --git a/altpager/altpager.php b/altpager/altpager.php index 65f9c0d8..f5ccbe4d 100755 --- a/altpager/altpager.php +++ b/altpager/altpager.php @@ -61,6 +61,10 @@ function altpager_settings(&$a,&$s) { if(! local_user()) return; + $global = get_config("alt_pager", "global"); + if($global == 1) + return; + /* Add our stylesheet to the page so we can make our settings look nice */ $a->page['htmlhead'] .= '' . "\r\n"; @@ -87,3 +91,18 @@ function altpager_settings(&$a,&$s) { $s .= '
'; } + +function altpager_plugin_admin(&$a, &$o){ + $t = file_get_contents( $a->get_baseurl() . "/addon/altpager/admin.tpl" ); + $o = replace_macros($t, array( + '$submit' => t('Submit'), + '$global' => array('altpagerchoice', t('Global'), 1, t('Force global use of the alternate pager'), get_config('alt_pager', 'global') == 1), + '$individual' => array('altpagerchoice', t('Individual'), 2, t('Each user chooses whether to use the alternate pager'), get_config('alt_pager', 'global') == 0) + )); +} + +function altpager_plugin_admin_post(&$a){ + $choice = ((x($_POST,'altpagerchoice')) ? notags(trim($_POST['altpagerchoice'])) : ''); + set_config('alt_pager','global',($choice == 1 ? 1 : 0)); + info( t('Settings updated.'). EOL ); +} diff --git a/ljpost/ljpost.css b/ljpost/ljpost.css index 2087d3f0..e0494c5c 100755 --- a/ljpost/ljpost.css +++ b/ljpost/ljpost.css @@ -1,6 +1,5 @@ #ljpost-enable-label, #ljpost-username-label, #ljpost-password-label, #ljpost-bydefault-label { -<<<<<<< HEAD float: left; width: 200px; margin-top: 10px; @@ -15,18 +14,3 @@ margin-top: 15px; } -======= -float: left; -width: 200px; -margin-top: 10px; -} - -#ljpost-checkbox, #ljpost-username, #ljpost-password, #ljpost-bydefault { -float: left; -margin-top: 10px; -} - -#ljpost-submit { -margin-top: 15px; -} ->>>>>>> 99d9fddb6af9e872266666038447771e42ce13b4