*
*/
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
function yourls_install() {
Addon::registerHook('addon_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
Addon::registerHook('addon_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
}
function yourls_uninstall() {
Addon::unregisterHook('addon_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
Addon::unregisterHook('addon_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 .= '' . L10n::t('YourLS') . '
';
$s .= '';
$s .= '