diff --git a/fromapp.tgz b/fromapp.tgz index dbe45ebe..30d84e90 100644 Binary files a/fromapp.tgz and b/fromapp.tgz differ diff --git a/fromapp/fromapp.css b/fromapp/fromapp.css index 90aeec49..422624a1 100644 --- a/fromapp/fromapp.css +++ b/fromapp/fromapp.css @@ -1,13 +1,13 @@ -#fromapp-label { +#fromapp-label, #fromapp-force-label { float: left; width: 200px; margin-bottom: 25px; } -#fromapp { +#fromapp-input, #fromapp-force { float: left; } diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index 51c95906..9a9fa12b 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -32,7 +32,9 @@ function fromapp_settings_post($a,$post) { if(! local_user() || (! x($_POST,'fromapp-submit'))) return; - set_pconfig(local_user(),'fromapp','app',$_POST['fromapp']); + set_pconfig(local_user(),'fromapp','app',$_POST['fromapp-input']); + set_pconfig(local_user(),'fromapp','force',intval($_POST['fromapp-force'])); + info( t('Fromapp settings updated.') . EOL); } @@ -50,14 +52,24 @@ function fromapp_settings(&$a,&$s) { $fromapp = get_pconfig(local_user(),'fromapp','app'); if($fromapp === false) $fromapp = ''; + + $force = intval(get_pconfig(local_user(),'fromapp','force')); + + $force_enabled = (($force) ? ' checked="checked" ' : ''); + /* Add some HTML to the existing form */ $s .= '
'; $s .= '

' . t('FromApp Settings') . '

'; $s .= '
'; - $s .= ''; - $s .= ''; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= ''; + $s .= ''; + $s .= '
'; /* provide a submit button */ @@ -74,10 +86,14 @@ function fromapp_post_hook(&$a,&$item) { return; $app = get_pconfig(local_user(), 'fromapp', 'app'); + $force = intval(get_pconfig(local_user(), 'fromapp','force')); if(($app === false) || (! strlen($app))) return; + if(strlen(trim($item['app'])) && (! $force)) + return; + $apps = explode(',',$app); $item['app'] = trim($apps[mt_rand(0,count($apps)-1)]); return;