*
*/
use Friendica\Core\Config;
function yourls_install() {
register_hook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
register_hook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
}
function yourls_uninstall() {
unregister_hook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
unregister_hook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
Config::set('yourls','url1',trim($_POST['']));
Config::set('yourls','username1',trim($_POST['']));
Config::set('yourls','password1',trim($_POST['']));
Config::set('yourls','ssl1',trim($_POST['']));
}
function yourls_addon_settings(&$a,&$s) {
if(! is_site_admin())
return;
/* Add our stylesheet to the page so we can make our settings look nice */
$a->page['htmlhead'] .= '' . "\r\n";
$yourls_url = Config::get('yourls','url1');
$yourls_username = Config::get('yourls','username1');
$yourls_password = Config::get('yourls', 'password1');
$ssl_enabled = Config::get('yourls','ssl1');
$ssl_checked = (($ssl_enabled) ? ' checked="checked" ' : '');
$yourls_ssl = Config::get('yourls', 'ssl1');
$s .= '';
$s .= '' . t('YourLS') . '
';
$s .= '';
$s .= '