mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-10-15 11:16:59 +00:00
Merge branch '3.6-rc'
This commit is contained in:
commit
39dd3dffe0
733 changed files with 10943 additions and 8237 deletions
|
@ -1,28 +1,29 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Name: Yourls
|
||||
* Description: Defines a YourLS url shortener for the Statusnet & Twitter plugins
|
||||
* Description: Defines a YourLS url shortener for the Statusnet & Twitter addons
|
||||
* Version: 1.0
|
||||
* Author: Keith Fernie <http://friendika.me4.it/profile/keith>
|
||||
*
|
||||
* Status: Unsupported
|
||||
*/
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
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');
|
||||
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() {
|
||||
unregister_hook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
|
||||
unregister_hook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
|
||||
set_config('yourls','url1',trim($_POST['']));
|
||||
set_config('yourls','username1',trim($_POST['']));
|
||||
set_config('yourls','password1',trim($_POST['']));
|
||||
set_config('yourls','ssl1',trim($_POST['']));
|
||||
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['']));
|
||||
|
||||
}
|
||||
|
||||
|
@ -52,34 +53,34 @@ function yourls_addon_settings(&$a,&$s) {
|
|||
$yourls_ssl = get_config('yourls', 'ssl1');
|
||||
|
||||
$s .= '<span id="settings_yourls_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_yourls_expanded\'); openClose(\'settings_yourls_inflated\');">';
|
||||
$s .= '<h3>' . t('YourLS') . '</h3>';
|
||||
$s .= '<h3>' . L10n::t('YourLS') . '</h3>';
|
||||
$s .= '</span>';
|
||||
$s .= '<div id="settings_yourls_expanded" class="settings-block" style="display: none;">';
|
||||
$s .= '<span class="fakelink" onclick="openClose(\'settings_yourls_expanded\'); openClose(\'settings_yourls_inflated\');">';
|
||||
$s .= '<h3>' . t('YourLS') . '</h3>';
|
||||
$s .= '<h3>' . L10n::t('YourLS') . '</h3>';
|
||||
$s .= '</span>';
|
||||
|
||||
$s .= '<div id="yourls-url-wrapper">';
|
||||
$s .= '<label id="yourls-url-label" for="yourls-url">' . t('URL: http://') . '</label>';
|
||||
$s .= '<label id="yourls-url-label" for="yourls-url">' . L10n::t('URL: http://') . '</label>';
|
||||
$s .= '<input id="yourls-url" type="text" name="yourls_url" value="' . $yourls_url .'" />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="yourls-username-wrapper">';
|
||||
$s .= '<label id="yourls-username-label" for="yourls-username">' . t('Username:') . '</label>';
|
||||
$s .= '<label id="yourls-username-label" for="yourls-username">' . L10n::t('Username:') . '</label>';
|
||||
$s .= '<input id="yourls-username" type="text" name="yourls_username" value="' . $yourls_username .'" />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="yourls-password-wrapper">';
|
||||
$s .= '<label id="yourls-password-label" for="yourls-password">' . t('Password:') . '</label>';
|
||||
$s .= '<label id="yourls-password-label" for="yourls-password">' . L10n::t('Password:') . '</label>';
|
||||
$s .= '<input id="yourls-password" type="password" name="yourls_password" value="' . $yourls_password .'" />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div id="yourls-ssl-wrapper">';
|
||||
$s .= '<label id="yourls-ssl-label" for="yourls-ssl">' . t('Use SSL ') . '</label>';
|
||||
$s .= '<label id="yourls-ssl-label" for="yourls-ssl">' . L10n::t('Use SSL ') . '</label>';
|
||||
$s .= '<input id="yourls-ssl" type="checkbox" name="yourls_ssl" value="1" ' . $ssl_checked . ' />';
|
||||
$s .= '</div><div class="clear"></div>';
|
||||
|
||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="yourls-submit" name="yourls-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
|
||||
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="yourls-submit" name="yourls-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
|
||||
|
||||
return;
|
||||
|
||||
|
@ -91,10 +92,10 @@ function yourls_addon_settings_post(&$a,&$b) {
|
|||
return;
|
||||
|
||||
if($_POST['yourls-submit']) {
|
||||
set_config('yourls','url1',trim($_POST['yourls_url']));
|
||||
set_config('yourls','username1',trim($_POST['yourls_username']));
|
||||
set_config('yourls','password1',trim($_POST['yourls_password']));
|
||||
set_config('yourls','ssl1',intval($_POST['yourls_ssl']));
|
||||
info( t('yourls Settings saved.') . EOL);
|
||||
Config::set('yourls','url1',trim($_POST['yourls_url']));
|
||||
Config::set('yourls','username1',trim($_POST['yourls_username']));
|
||||
Config::set('yourls','password1',trim($_POST['yourls_password']));
|
||||
Config::set('yourls','ssl1',intval($_POST['yourls_ssl']));
|
||||
info(L10n::t('yourls Settings saved.') . EOL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue