* 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_unistall() function.
+ * system will call the name_uninstall() function.
*
*/
/**
*
- * Then we'll attach into the settings page, on both the
- * form and post hooks so that we can create and update
+ * Then we'll attach into the plugin settings page, and also the
+ * settings post hook so that we can create and update
* user preferences.
*
*/
- register_hook('settings_form', 'addon/randplace/randplace.php', 'randplace_settings');
- register_hook('settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+ register_hook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
+ register_hook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
logger("installed randplace");
}
*/
unregister_hook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
- unregister_hook('settings_form', 'addon/randplace/randplace.php', 'randplace_settings');
- unregister_hook('settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+ unregister_hook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
+ unregister_hook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
logger("removed randplace");
$cities = array();
$zones = timezone_identifiers_list();
foreach($zones as $zone) {
- if(strpos($zone,'/'))
+ if((strpos($zone,'/')) && (! stristr($zone,'US/')) && (! stristr($zone,'Etc/')))
$cities[] = str_replace('_', ' ',substr($zone,strpos($zone,'/') + 1));
}
}
-/*
- * Called from the end of the settings form.
+/**
+ *
+ * Called from the Plugin Setting form.
* Add our own settings info to the page.
*
*/
if(! local_user())
return;
+ /* Add our stylesheet to the page so we can make our settings look nice */
+
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/randplace/randplace.css' . '" media="all" />' . "\r\n";
+ /* Get the current state of our config variable */
+
$enabled = get_pconfig(local_user(),'randplace','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');
+ /* Add some HTML to the existing form */
+
$s .= '<h3>' . t('Randplace Settings') . '</h3>';
$s .= '<div id="randplace-enable-wrapper">';
- $s .= '<label id="randplace-enable-label" for="randplace-enable">' . t('Enable Randplace Plugin') . '</label>';
+ $s .= '<label id="randplace-enable-label" for="randplace-checkbox">' . t('Enable Randplace Plugin') . '</label>';
$s .= '<input id="randplace-checkbox" type="checkbox" name="randplace" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
- // provide another submit button
+ /* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="submit" class="settings-submit" value="' . t('Submit') . '" /></div>';