]> git.mxchange.org Git - friendica-addons.git/blobdiff - planets/planets.php
Merge pull request #275 from swathe/master
[friendica-addons.git] / planets / planets.php
index 1c6ed43b94ac8624a2e691e3fc3c99f51ab3f8f3..d40e6c61a1b34ba1c92ea390c632e4a1820da122 100755 (executable)
@@ -4,22 +4,7 @@
  * Description: Sample Friendica plugin/addon. Set a random planet from the Emprire when posting.
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
- * Author: Darth Baldwin <darthvader@death.star>
- * 
- * 
- * 
- *
- * Addons are registered with the system in the
- * .htconfig.php file.
- *
- * $a->config['system']['addon'] = 'plugin1,plugin2,etc.';
- *
- * When registration is detected, the system calls the plugin
- * name_install() function, located in 'addon/name/name.php',
- * where 'name' is the name of the addon.
- * If the addon is removed from the configuration list, the 
- * system will call the name_uninstall() function.
- *
+ * Author: Tony Baldwin <https://free-haven.org/profile/tony>
  */
 
 
@@ -107,15 +92,8 @@ 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');
-#      $zones = timezone_identifiers_list();
-#      foreach($zones as $zone) {
-#              if((strpos($zone,'/')) && (! stristr($zone,'US/')) && (! stristr($zone,'Etc/')))
-#                      $planets[] = str_replace('_', ' ',substr($zone,strpos($zone,'/') + 1));
-#      }
-# 
-#      if(! count($planets))
-#              return;
+       $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];
 
@@ -168,15 +146,23 @@ function planets_settings(&$a,&$s) {
 
        /* Add some HTML to the existing form */
 
-       $s .= '<div class="settings-block">';
+    $s .= '<span id="settings_planets_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_planets_expanded\'); openClose(\'settings_planets_inflated\');">';
+       $s .= '<h3>' . t('Planets') . '</h3>';
+       $s .= '</span>';
+       $s .= '<div id="settings_planets_expanded" class="settings-block" style="display: none;">';
+       $s .= '<span class="fakelink" onclick="openClose(\'settings_planets_expanded\'); openClose(\'settings_planets_inflated\');">';
+       $s .= '<h3>' . t('Planets') . '</h3>';
+       $s .= '</span>';
+
+    $s .= '<div class="settings-block">';
        $s .= '<h3>' . t('Planets Settings') . '</h3>';
        $s .= '<div id="planets-enable-wrapper">';
        $s .= '<label id="planets-enable-label" for="planets-checkbox">' . t('Enable Planets Plugin') . '</label>';
        $s .= '<input id="planets-checkbox" type="checkbox" name="planets" value="1" ' . $checked . '/>';
-       $s .= '</div><div class="clear"></div>';
+       $s .= '</div><div class="clear"></div></div>';
 
        /* provide a submit button */
 
-       $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="planets-submit" class="settings-submit" value="' . t('Submit') . '" /></div></div>';
+       $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="planets-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
 
 }