X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=planets%2Fplanets.php;h=a8371c85f007ac51f38483d77e37d2ee733d982a;hb=c3e93f1ed9a487f823bcc75ddd43024334c25bfc;hp=0df91d7c3aa2ea60250ff9971cff9deb3b3dfa4f;hpb=9ac891c4949ea5a429fc59ada2816a992633ac1f;p=friendica-addons.git diff --git a/planets/planets.php b/planets/planets.php index 0df91d7c..a8371c85 100755 --- a/planets/planets.php +++ b/planets/planets.php @@ -7,6 +7,7 @@ * Author: Tony Baldwin */ +use Friendica\Core\PConfig; function planets_install() { @@ -78,7 +79,7 @@ function planets_post_hook($a, &$item) { /* Retrieve our personal config setting */ - $active = get_pconfig(local_user(), 'planets', 'enable'); + $active = PConfig::get(local_user(), 'planets', 'enable'); if(! $active) return; @@ -92,7 +93,7 @@ function planets_post_hook($a, &$item) { * */ - $planets = array('Alderaan','Tatooine','Dagoba','Polis Massa','Coruscant','Hoth','Endor','Kamino','Rattatak','Mustafar','Iego','Geonosis','Felucia','Dantooine','Ansion','Artaru','Bespin','Boz Pity','Cato Neimoidia','Christophsis','Kashyyk','Kessel','Malastare','Mygeeto','Nar Shaddaa','Ord Mantell','Saleucami','Subterrel','Death Star','Teth','Tund','Utapau','Yavin'); + $planets = array('Alderaan','Tatooine','Dagobah','Polis Massa','Coruscant','Hoth','Endor','Kamino','Rattatak','Mustafar','Iego','Geonosis','Felucia','Dantooine','Ansion','Artaru','Bespin','Boz Pity','Cato Neimoidia','Christophsis','Kashyyyk','Kessel','Malastare','Mygeeto','Nar Shaddaa','Ord Mantell','Saleucami','Subterrel','Death Star','Teth','Tund','Utapau','Yavin'); $planet = array_rand($planets,1); $item['location'] = $planets[$planet]; @@ -116,7 +117,7 @@ function planets_settings_post($a,$post) { if(! local_user()) return; if($_POST['planets-submit']) - set_pconfig(local_user(),'planets','enable',intval($_POST['planets'])); + PConfig::set(local_user(),'planets','enable',intval($_POST['planets'])); } @@ -140,21 +141,29 @@ function planets_settings(&$a,&$s) { /* Get the current state of our config variable */ - $enabled = get_pconfig(local_user(),'planets','enable'); + $enabled = PConfig::get(local_user(),'planets','enable'); $checked = (($enabled) ? ' checked="checked" ' : ''); /* Add some HTML to the existing form */ - $s .= '
'; + $s .= ''; + $s .= '

' . t('Planets') . '

'; + $s .= '
'; + $s .= ''; /* provide a submit button */ - $s .= '
'; + $s .= '
'; }