* License: MIT * ******************************************************************/ function cal_install() { register_hook('plugin_settings', 'addon/cal/cal.php', 'cal_addon_settings'); register_hook('plugin_settings_post', 'addon/cal/cal.php', 'cal_addon_settings_post'); } function cal_uninstall() { unregister_hook('plugin_settings', 'addon/cal/cal.php', 'cal_addon_settings'); unregister_hook('plugin_settings_post', 'addon/cal/cal.php', 'cal_addon_settings_post'); } function cal_module() { } /* pathes * /cal/$user/export/$format */ function cal_content() { $a = get_app(); $o = ""; if ($a->argc == 1) { $o = "
".t('Some text to explain what this does.')."
"; } elseif ($a->argc==4) { $username = $a->argv[1]; $do = $a->argv[2]; $format = $a->argv[3]; $o = "".$do." calendar for ".$username." as ".$format." file.
"; } else { $o = "".t('Wrong number of parameters')."
"; } return $o; } function cal_addon_settings_post ( &$a, &$b ) { if (! local_user()) return; if (!x($_POST,'cal-submit')) return; set_pconfig(local_user(),'cal','enable',intval($_POST['cal-enable'])); } function cal_addon_settings ( &$a, &$s ) { if (! local_user()) return; $enabled = get_pconfig(local_user(), 'cal', 'enable'); $checked = (($enabled) ? ' checked="checked" ' : ''); $url = $a->get_baseurl().'/cal/'.$a->user['nickname'].'/export/ical'; $s .= ''.t('If this is enabled, you public events will be available at').' '.$url.'
'; $s .= '