/* Add our stylesheet to the page so we can make our settings look nice */
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n";
- $words = PConfig::get(local_user(), 'blockem', 'words');
+ $words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if (!$words) {
$words = '';
function blockem_enotify_store(App $a, array &$b)
{
- $words = PConfig::get($b['uid'], 'blockem', 'words');
+ $words = DI::pConfig()->get($b['uid'], 'blockem', 'words');
if ($words) {
$arr = explode(',', $words);
$profiles_string = null;
if (local_user()) {
- $profiles_string = PConfig::get(local_user(), 'blockem', 'words');
+ $profiles_string = DI::pConfig()->get(local_user(), 'blockem', 'words');
}
if ($profiles_string) {
return;
}
- $words = PConfig::get(local_user(), 'blockem', 'words');
+ $words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if ($words) {
$a->data['blockem'] = explode(',', $words);
return;
}
- $words = PConfig::get(local_user(), 'blockem', 'words');
+ $words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if (array_key_exists('block', $_GET) && $_GET['block']) {
if (strlen($words)) {
return;
}
- if (PConfig::get(local_user(), 'blogger', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'blogger', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'blogger_enable',
L10n::t('Post to blogger'),
- PConfig::get(local_user(), 'blogger', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'blogger', 'post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(), 'blogger', 'post');
+ $enabled = DI::pConfig()->get(local_user(), 'blogger', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(), 'blogger', 'post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(), 'blogger', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $bl_username = PConfig::get(local_user(), 'blogger', 'bl_username');
- $bl_password = PConfig::get(local_user(), 'blogger', 'bl_password');
- $bl_blog = PConfig::get(local_user(), 'blogger', 'bl_blog');
+ $bl_username = DI::pConfig()->get(local_user(), 'blogger', 'bl_username');
+ $bl_password = DI::pConfig()->get(local_user(), 'blogger', 'bl_password');
+ $bl_blog = DI::pConfig()->get(local_user(), 'blogger', 'bl_blog');
/* Add some HTML to the existing form */
$s .= '<span id="settings_blogger_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_blogger_expanded\'); openClose(\'settings_blogger_inflated\');">';
return;
}
- $bl_post = intval(PConfig::get(local_user(), 'blogger', 'post'));
+ $bl_post = intval(DI::pConfig()->get(local_user(), 'blogger', 'post'));
$bl_enable = (($bl_post && !empty($_REQUEST['blogger_enable'])) ? intval($_REQUEST['blogger_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(), 'blogger', 'post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'blogger', 'post_by_default'))) {
$bl_enable = 1;
}
return;
}
- $bl_username = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_username'));
- $bl_password = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_password'));
- $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog');
+ $bl_username = XML::escape(DI::pConfig()->get($b['uid'], 'blogger', 'bl_username'));
+ $bl_password = XML::escape(DI::pConfig()->get($b['uid'], 'blogger', 'bl_password'));
+ $bl_blog = DI::pConfig()->get($b['uid'], 'blogger', 'bl_blog');
if ($bl_username && $bl_password && $bl_blog) {
$title = '<title>' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . '</title>';
return;
}
- if (PConfig::get(local_user(), 'buffer', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'buffer', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'buffer_enable',
L10n::t('Post to Buffer'),
- PConfig::get(local_user(), 'buffer', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'buffer', 'post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(),'buffer','post');
+ $enabled = DI::pConfig()->get(local_user(),'buffer','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(),'buffer','post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(),'buffer','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */
$client_id = Config::get("buffer", "client_id");
$client_secret = Config::get("buffer", "client_secret");
- $access_token = PConfig::get(local_user(), "buffer", "access_token");
+ $access_token = DI::pConfig()->get(local_user(), "buffer", "access_token");
$s .= '<div id="buffer-password-wrapper">';
return;
}
- $buffer_post = intval(PConfig::get(local_user(),'buffer','post'));
+ $buffer_post = intval(DI::pConfig()->get(local_user(),'buffer','post'));
$buffer_enable = (($buffer_post && !empty($_REQUEST['buffer_enable'])) ? intval($_REQUEST['buffer_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'buffer','post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'buffer','post_by_default'))) {
$buffer_enable = 1;
}
$client_id = Config::get("buffer", "client_id");
$client_secret = Config::get("buffer", "client_secret");
- $access_token = PConfig::get($b['uid'], "buffer","access_token");
+ $access_token = DI::pConfig()->get($b['uid'], "buffer","access_token");
$callback_url = "";
if ($access_token) {
'$usecat' => L10n::t('Use Cat as Avatar'),
'$morecat' => L10n::t('More Random Cat!'),
'$emailcat' => L10n::t('Reset to email Cat'),
- '$seed' => PConfig::get(local_user(), 'catavatar', 'seed', false),
+ '$seed' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false),
'$header' => L10n::t('Cat Avatar Settings'),
]);
}
'account_expired' => false, 'account_removed' => false];
$user = DBA::selectFirst('user', ['email'], $condition);
- $seed = PConfig::get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email']))));
+ $seed = DI::pConfig()->get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email']))));
if (!empty($_POST['catavatar-usecat'])) {
$url = DI::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time();
throw new NotFoundException();
}
- $seed = PConfig::get($uid, "catavatar", "seed", md5(trim(strtolower($user['email']))));
+ $seed = DI::pConfig()->get($uid, "catavatar", "seed", md5(trim(strtolower($user['email']))));
// ...Or start generation
ob_start();
$now = new DateTime();
if (!is_null($cached)) {
- $cdate = PConfig::get(local_user(), 'curweather', 'last');
+ $cdate = DI::pConfig()->get(local_user(), 'curweather', 'last');
$cached = unserialize($cached);
if ($cdate + $cachetime > $now->getTimestamp()) {
function curweather_network_mod_init(App $a, &$b)
{
- if (!intval(PConfig::get(local_user(), 'curweather', 'curweather_enable'))) {
+ if (!intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable'))) {
return;
}
// those parameters will be used to get: cloud status, temperature, preassure
// and relative humidity for display, also the relevent area of the map is
// linked from lat/log of the reply of OWMp
- $rpt = PConfig::get(local_user(), 'curweather', 'curweather_loc');
+ $rpt = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc');
// Set the language to the browsers language or default and use metric units
$lang = Session::get('language', Config::get('system', 'language'));
- $units = PConfig::get( local_user(), 'curweather', 'curweather_units');
+ $units = DI::pConfig()->get( local_user(), 'curweather', 'curweather_units');
$appid = Config::get('curweather', 'appid');
$cachetime = intval(Config::get('curweather', 'cachetime'));
}
/* Get the current state of our config variable */
- $curweather_loc = PConfig::get(local_user(), 'curweather', 'curweather_loc');
- $curweather_units = PConfig::get(local_user(), 'curweather', 'curweather_units');
+ $curweather_loc = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc');
+ $curweather_units = DI::pConfig()->get(local_user(), 'curweather', 'curweather_units');
$appid = Config::get('curweather', 'appid');
if ($appid == "") {
$noappidtext = '';
}
- $enable = intval(PConfig::get(local_user(), 'curweather', 'curweather_enable'));
+ $enable = intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable'));
$enable_checked = (($enable) ? ' checked="checked" ' : '');
// load template and replace the macros
return;
}
- if (PConfig::get(local_user(), 'diaspora', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'diaspora', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'diaspora_enable',
L10n::t('Post to Diaspora'),
- PConfig::get(local_user(), 'diaspora', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'diaspora', 'post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(),'diaspora','post');
+ $enabled = DI::pConfig()->get(local_user(),'diaspora','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(),'diaspora','post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(),'diaspora','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $handle = PConfig::get(local_user(), 'diaspora', 'handle');
- $password = PConfig::get(local_user(), 'diaspora', 'password');
- $aspect = PConfig::get(local_user(),'diaspora','aspect');
+ $handle = DI::pConfig()->get(local_user(), 'diaspora', 'handle');
+ $password = DI::pConfig()->get(local_user(), 'diaspora', 'password');
+ $aspect = DI::pConfig()->get(local_user(),'diaspora','aspect');
$status = "";
return;
}
- $diaspora_post = intval(PConfig::get(local_user(),'diaspora','post'));
+ $diaspora_post = intval(DI::pConfig()->get(local_user(),'diaspora','post'));
$diaspora_enable = (($diaspora_post && !empty($_REQUEST['diaspora_enable'])) ? intval($_REQUEST['diaspora_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'diaspora','post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'diaspora','post_by_default'))) {
$diaspora_enable = 1;
}
Logger::log('diaspora_send: prepare posting', Logger::DEBUG);
- $handle = PConfig::get($b['uid'],'diaspora','handle');
- $password = PConfig::get($b['uid'],'diaspora','password');
- $aspect = PConfig::get($b['uid'],'diaspora','aspect');
+ $handle = DI::pConfig()->get($b['uid'],'diaspora','handle');
+ $password = DI::pConfig()->get($b['uid'],'diaspora','password');
+ $aspect = DI::pConfig()->get($b['uid'],'diaspora','aspect');
if ($handle && $password) {
Logger::log('diaspora_send: all values seem to be okay', Logger::DEBUG);
use Friendica\Core\Renderer;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Util\XML;
use Friendica\Content\Text\Markdown;
return;
}
- $enabled = intval(PConfig::get(local_user(), 'discourse', 'enabled'));
+ $enabled = intval(DI::pConfig()->get(local_user(), 'discourse', 'enabled'));
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/discourse/');
$s .= Renderer::replaceMacros($t, [
return;
}
- if (!PConfig::get($message['item']['uid'], 'discourse', 'enabled')) {
+ if (!DI::pConfig()->get($message['item']['uid'], 'discourse', 'enabled')) {
return;
}
return;
}
- if (PConfig::get(local_user(), 'dwpost', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'dwpost', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'dwpost_enable',
L10n::t('Post to Dreamwidth'),
- PConfig::get(local_user(), 'dwpost', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default')
]
];
}
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/dwpost/dwpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(), 'dwpost', 'post');
+ $enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
- $def_enabled = PConfig::get(local_user(), 'dwpost', 'post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $dw_username = PConfig::get(local_user(), 'dwpost', 'dw_username');
- $dw_password = PConfig::get(local_user(), 'dwpost', 'dw_password');
+ $dw_username = DI::pConfig()->get(local_user(), 'dwpost', 'dw_username');
+ $dw_password = DI::pConfig()->get(local_user(), 'dwpost', 'dw_password');
/* Add some HTML to the existing form */
$s .= '<span id="settings_dwpost_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_dwpost_expanded\'); openClose(\'settings_dwpost_inflated\');">';
return;
}
- $dw_post = intval(PConfig::get(local_user(),'dwpost','post'));
+ $dw_post = intval(DI::pConfig()->get(local_user(),'dwpost','post'));
$dw_enable = (($dw_post && !empty($_REQUEST['dwpost_enable'])) ? intval($_REQUEST['dwpost_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'dwpost','post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'dwpost','post_by_default'))) {
$dw_enable = 1;
}
$tz = $x[0]['timezone'];
}
- $dw_username = PConfig::get($b['uid'],'dwpost','dw_username');
- $dw_password = PConfig::get($b['uid'],'dwpost','dw_password');
+ $dw_username = DI::pConfig()->get($b['uid'],'dwpost','dw_username');
+ $dw_password = DI::pConfig()->get($b['uid'],'dwpost','dw_password');
$dw_blog = 'http://www.dreamwidth.org/interface/xmlrpc';
if ($dw_username && $dw_password && $dw_blog) {
/* Get the current state of our config variable */
- $fromapp = PConfig::get(local_user(), 'fromapp', 'app', '');
+ $fromapp = DI::pConfig()->get(local_user(), 'fromapp', 'app', '');
- $force = intval(PConfig::get(local_user(), 'fromapp', 'force'));
+ $force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force'));
$force_enabled = (($force) ? ' checked="checked" ' : '');
return;
}
- $app = PConfig::get(local_user(), 'fromapp', 'app');
- $force = intval(PConfig::get(local_user(), 'fromapp', 'force'));
+ $app = DI::pConfig()->get(local_user(), 'fromapp', 'app');
+ $force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force'));
if (is_null($app) || (! strlen($app))) {
return;
/* Retrieve our personal config setting */
$geo_account = Config::get('geonames', 'username');
- $active = PConfig::get(local_user(), 'geonames', 'enable');
+ $active = DI::pConfig()->get(local_user(), 'geonames', 'enable');
if (!$geo_account || !$active) {
return;
DI::page()->registerStylesheet($stylesheetPath);
/* Get the current state of our config variable */
- $enabled = intval(PConfig::get(local_user(), 'geonames', 'enable'));
+ $enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable'));
$t = Renderer::getMarkupTemplate('settings.tpl', __DIR__);
$s .= Renderer::replaceMacros($t, [
/* Get the current state of our config variable */
- $gnot = intval(PConfig::get(local_user(),'gnot','enable'));
+ $gnot = intval(DI::pConfig()->get(local_user(),'gnot','enable'));
$gnot_checked = (($gnot) ? ' checked="checked" ' : '' );
function gnot_enotify_mail(&$a,&$b) {
- if((! $b['uid']) || (! intval(PConfig::get($b['uid'], 'gnot','enable'))))
+ if((! $b['uid']) || (! intval(DI::pConfig()->get($b['uid'], 'gnot','enable'))))
return;
if($b['type'] == NOTIFY_COMMENT)
$b['subject'] = L10n::t('[Friendica:Notify] Comment to conversation #%d', $b['parent']);
/* Get the current state of our config variable */
- $enabled = PConfig::get(local_user(),'system','groupedit_image_limit');
+ $enabled = DI::pConfig()->get(local_user(),'system','groupedit_image_limit');
$checked = (($enabled) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */
return;
}
- $key = PConfig::get(local_user(), 'ifttt', 'key');
+ $key = DI::pConfig()->get(local_user(), 'ifttt', 'key');
if (!$key) {
$key = Strings::getRandomHex(20);
$key = $_REQUEST['key'];
// Check the key
- if ($key != PConfig::get($uid, 'ifttt', 'key')) {
+ if ($key != DI::pConfig()->get($uid, 'ifttt', 'key')) {
Logger::log('Invalid key for user ' . $uid, Logger::DEBUG);
return;
}
return;
}
- if (PConfig::get(local_user(), 'ijpost', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'ijpost', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'ijpost_enable',
L10n::t('Post to Insanejournal'),
- PConfig::get(local_user(), 'ijpost', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(), 'ijpost', 'post');
+ $enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
- $def_enabled = PConfig::get(local_user(), 'ijpost', 'post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $ij_username = PConfig::get(local_user(), 'ijpost', 'ij_username');
- $ij_password = PConfig::get(local_user(), 'ijpost', 'ij_password');
+ $ij_username = DI::pConfig()->get(local_user(), 'ijpost', 'ij_username');
+ $ij_password = DI::pConfig()->get(local_user(), 'ijpost', 'ij_password');
/* Add some HTML to the existing form */
$s .= '<span id="settings_ijpost_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_ijpost_expanded\'); openClose(\'settings_ijpost_inflated\');">';
return;
}
- $ij_post = intval(PConfig::get(local_user(), 'ijpost', 'post'));
+ $ij_post = intval(DI::pConfig()->get(local_user(), 'ijpost', 'post'));
$ij_enable = (($ij_post && !empty($_REQUEST['ijpost_enable'])) ? intval($_REQUEST['ijpost_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(), 'ijpost', 'post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default'))) {
$ij_enable = 1;
}
$tz = $x[0]['timezone'];
}
- $ij_username = PConfig::get($b['uid'], 'ijpost', 'ij_username');
- $ij_password = PConfig::get($b['uid'], 'ijpost', 'ij_password');
+ $ij_username = DI::pConfig()->get($b['uid'], 'ijpost', 'ij_username');
+ $ij_password = DI::pConfig()->get($b['uid'], 'ijpost', 'ij_password');
$ij_blog = 'http://www.insanejournal.com/interface/xmlrpc';
if ($ij_username && $ij_password && $ij_blog) {
// DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n";
/* setting popular channels, auto connect channels */
- $sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */
- $autochans = PConfig::get( local_user(), 'irc','autochans'); /* auto connect chans */
+ $sitechats = DI::pConfig()->get( local_user(), 'irc','sitechats'); /* popular channels */
+ $autochans = DI::pConfig()->get( local_user(), 'irc','autochans'); /* auto connect chans */
$t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" );
$s .= Renderer::replaceMacros($t, [
/* set the list of popular channels */
if (local_user()) {
- $sitechats = PConfig::get( local_user(), 'irc', 'sitechats');
+ $sitechats = DI::pConfig()->get( local_user(), 'irc', 'sitechats');
if (!$sitechats)
$sitechats = Config::get('irc', 'sitechats');
} else {
/* setting the channel(s) to auto connect */
if (local_user()) {
- $autochans = PConfig::get(local_user(), 'irc', 'autochans');
+ $autochans = DI::pConfig()->get(local_user(), 'irc', 'autochans');
if (!$autochans)
$autochans = Config::get('irc','autochans');
} else {
}
// do not return an address if user deactivated addon
- $activated = PConfig::get($uid, 'jappixmini', 'activate');
+ $activated = DI::pConfig()->get($uid, 'jappixmini', 'activate');
if (!$activated) {
exit();
}
// return the requested Jabber address
try {
- $username = PConfig::get($uid, 'jappixmini', 'username');
- $server = PConfig::get($uid, 'jappixmini', 'server');
+ $username = DI::pConfig()->get($uid, 'jappixmini', 'username');
+ $server = DI::pConfig()->get($uid, 'jappixmini', 'server');
$address = "$username@$server";
$encrypted_address = "";
function jappixmini_settings(App $a, &$s)
{
// addon settings for a user
- $activate = PConfig::get(local_user(), 'jappixmini', 'activate');
+ $activate = DI::pConfig()->get(local_user(), 'jappixmini', 'activate');
$activate = intval($activate) ? ' checked="checked"' : '';
- $dontinsertchat = PConfig::get(local_user(), 'jappixmini', 'dontinsertchat');
+ $dontinsertchat = DI::pConfig()->get(local_user(), 'jappixmini', 'dontinsertchat');
$insertchat = !(intval($dontinsertchat) ? ' checked="checked"' : '');
$defaultbosh = Config::get("jappixmini", "bosh_address");
PConfig::set(local_user(), 'jappixmini', 'bosh', $defaultbosh);
}
- $username = PConfig::get(local_user(), 'jappixmini', 'username');
+ $username = DI::pConfig()->get(local_user(), 'jappixmini', 'username');
$username = htmlentities($username);
- $server = PConfig::get(local_user(), 'jappixmini', 'server');
+ $server = DI::pConfig()->get(local_user(), 'jappixmini', 'server');
$server = htmlentities($server);
- $bosh = PConfig::get(local_user(), 'jappixmini', 'bosh');
+ $bosh = DI::pConfig()->get(local_user(), 'jappixmini', 'bosh');
$bosh = htmlentities($bosh);
- $password = PConfig::get(local_user(), 'jappixmini', 'password');
- $autosubscribe = PConfig::get(local_user(), 'jappixmini', 'autosubscribe');
+ $password = DI::pConfig()->get(local_user(), 'jappixmini', 'password');
+ $autosubscribe = DI::pConfig()->get(local_user(), 'jappixmini', 'autosubscribe');
$autosubscribe = intval($autosubscribe) ? ' checked="checked"' : '';
- $autoapprove = PConfig::get(local_user(), 'jappixmini', 'autoapprove');
+ $autoapprove = DI::pConfig()->get(local_user(), 'jappixmini', 'autoapprove');
$autoapprove = intval($autoapprove) ? ' checked="checked"' : '';
- $encrypt = intval(PConfig::get(local_user(), 'jappixmini', 'encrypt'));
+ $encrypt = intval(DI::pConfig()->get(local_user(), 'jappixmini', 'encrypt'));
$encrypt_checked = $encrypt ? ' checked="checked"' : '';
$encrypt_disabled = $encrypt ? '' : ' disabled="disabled"';
$purge = intval($b['jappixmini-purge']);
$username = trim($b['jappixmini-username']);
- $old_username = PConfig::get($uid, 'jappixmini', 'username');
+ $old_username = DI::pConfig()->get($uid, 'jappixmini', 'username');
if ($username != $old_username) {
$purge = 1;
}
$server = trim($b['jappixmini-server']);
- $old_server = PConfig::get($uid, 'jappixmini', 'server');
+ $old_server = DI::pConfig()->get($uid, 'jappixmini', 'server');
if ($server != $old_server) {
$purge = 1;
}
return;
}
- $activate = PConfig::get(local_user(), 'jappixmini', 'activate');
- $dontinsertchat = PConfig::get(local_user(), 'jappixmini', 'dontinsertchat');
+ $activate = DI::pConfig()->get(local_user(), 'jappixmini', 'activate');
+ $dontinsertchat = DI::pConfig()->get(local_user(), 'jappixmini', 'dontinsertchat');
if (!$activate || $dontinsertchat) {
return;
}
DI::page()['htmlhead'] .= '<script type="text/javascript" src="' . DI::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n";
- $username = PConfig::get(local_user(), 'jappixmini', 'username');
+ $username = DI::pConfig()->get(local_user(), 'jappixmini', 'username');
$username = str_replace("'", "\\'", $username);
- $server = PConfig::get(local_user(), 'jappixmini', 'server');
+ $server = DI::pConfig()->get(local_user(), 'jappixmini', 'server');
$server = str_replace("'", "\\'", $server);
- $bosh = PConfig::get(local_user(), 'jappixmini', 'bosh');
+ $bosh = DI::pConfig()->get(local_user(), 'jappixmini', 'bosh');
$bosh = str_replace("'", "\\'", $bosh);
- $encrypt = PConfig::get(local_user(), 'jappixmini', 'encrypt');
+ $encrypt = DI::pConfig()->get(local_user(), 'jappixmini', 'encrypt');
$encrypt = intval($encrypt);
- $password = PConfig::get(local_user(), 'jappixmini', 'password');
+ $password = DI::pConfig()->get(local_user(), 'jappixmini', 'password');
$password = str_replace("'", "\\'", $password);
- $autoapprove = PConfig::get(local_user(), 'jappixmini', 'autoapprove');
+ $autoapprove = DI::pConfig()->get(local_user(), 'jappixmini', 'autoapprove');
$autoapprove = intval($autoapprove);
- $autosubscribe = PConfig::get(local_user(), 'jappixmini', 'autosubscribe');
+ $autosubscribe = DI::pConfig()->get(local_user(), 'jappixmini', 'autosubscribe');
$autosubscribe = intval($autosubscribe);
// set proxy if necessary
}
// check if jabber address already present
- $present = PConfig::get($uid, "jappixmini", "id:" . $dfrn_id);
+ $present = DI::pConfig()->get($uid, "jappixmini", "id:" . $dfrn_id);
$now = intval(time());
if ($present) {
// $present has format "timestamp:jabber_address"
$base = substr($request, 0, $pos) . "/jappixmini?role=$role";
// construct own address
- $username = PConfig::get($uid, 'jappixmini', 'username');
+ $username = DI::pConfig()->get($uid, 'jappixmini', 'username');
if (!$username) {
continue;
}
- $server = PConfig::get($uid, 'jappixmini', 'server');
+ $server = DI::pConfig()->get($uid, 'jappixmini', 'server');
if (!$server) {
continue;
}
/* Retrieve our personal config setting */
- $active = PConfig::get(local_user(), 'krynn', 'enable');
+ $active = DI::pConfig()->get(local_user(), 'krynn', 'enable');
if(! $active)
return;
/* Get the current state of our config variable */
- $enabled = PConfig::get(local_user(),'krynn','enable');
+ $enabled = DI::pConfig()->get(local_user(),'krynn','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');
return;
}
- $enable_checked = (intval(PConfig::get(local_user(), 'langfilter', 'disable')) ? '' : ' checked="checked" ');
- $languages = PConfig::get(local_user(), 'langfilter', 'languages');
- $minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence') * 100;
- $minlength = PConfig::get(local_user(), 'langfilter', 'minlength');
+ $enable_checked = (intval(DI::pConfig()->get(local_user(), 'langfilter', 'disable')) ? '' : ' checked="checked" ');
+ $languages = DI::pConfig()->get(local_user(), 'langfilter', 'languages');
+ $minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence') * 100;
+ $minlength = DI::pConfig()->get(local_user(), 'langfilter', 'minlength');
$t = Renderer::getMarkupTemplate("settings.tpl", "addon/langfilter/");
$s .= Renderer::replaceMacros($t, [
}
// Don't filter if language filter is disabled
- if (PConfig::get($logged_user, 'langfilter', 'disable')) {
+ if (DI::pConfig()->get($logged_user, 'langfilter', 'disable')) {
return;
}
$naked_body = BBCode::toPlaintext($hook_data['item']['body'], false);
// Don't filter if body lenght is below minimum
- $minlen = PConfig::get(local_user(), 'langfilter', 'minlength', 32);
+ $minlen = DI::pConfig()->get(local_user(), 'langfilter', 'minlength', 32);
if (!$minlen) {
$minlen = 32;
}
return;
}
- $read_languages_string = PConfig::get(local_user(), 'langfilter', 'languages');
- $minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence');
+ $read_languages_string = DI::pConfig()->get(local_user(), 'langfilter', 'languages');
+ $minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence');
// Don't filter if no spoken languages are configured
if (!$read_languages_string) {
return;
}
- if (PConfig::get(local_user(), 'libertree', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'libertree', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'libertree_enable',
L10n::t('Post to libertree'),
- PConfig::get(local_user(), 'libertree', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'libertree', 'post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(),'libertree','post');
+ $enabled = DI::pConfig()->get(local_user(),'libertree','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(),'libertree','post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(),'libertree','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $ltree_api_token = PConfig::get(local_user(), 'libertree', 'libertree_api_token');
- $ltree_url = PConfig::get(local_user(), 'libertree', 'libertree_url');
+ $ltree_api_token = DI::pConfig()->get(local_user(), 'libertree', 'libertree_api_token');
+ $ltree_url = DI::pConfig()->get(local_user(), 'libertree', 'libertree_url');
/* Add some HTML to the existing form */
return;
}
- $ltree_post = intval(PConfig::get(local_user(),'libertree','post'));
+ $ltree_post = intval(DI::pConfig()->get(local_user(),'libertree','post'));
$ltree_enable = (($ltree_post && !empty($_REQUEST['libertree_enable'])) ? intval($_REQUEST['libertree_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'libertree','post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'libertree','post_by_default'))) {
$ltree_enable = 1;
}
return;
}
- $ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token');
- $ltree_url = PConfig::get($b['uid'],'libertree','libertree_url');
+ $ltree_api_token = DI::pConfig()->get($b['uid'],'libertree','libertree_api_token');
+ $ltree_url = DI::pConfig()->get($b['uid'],'libertree','libertree_url');
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
$ltree_source = DI::baseUrl()->getHostname();
return;
}
- if (PConfig::get(local_user(),'ljpost','post')) {
+ if (DI::pConfig()->get(local_user(),'ljpost','post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'ljpost_enable',
L10n::t('Post to LiveJournal'),
- PConfig::get(local_user(),'ljpost','post_by_default')
+ DI::pConfig()->get(local_user(),'ljpost','post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(),'ljpost','post');
+ $enabled = DI::pConfig()->get(local_user(),'ljpost','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
- $def_enabled = PConfig::get(local_user(),'ljpost','post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(),'ljpost','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $lj_username = PConfig::get(local_user(), 'ljpost', 'lj_username');
- $lj_password = PConfig::get(local_user(), 'ljpost', 'lj_password');
+ $lj_username = DI::pConfig()->get(local_user(), 'ljpost', 'lj_username');
+ $lj_password = DI::pConfig()->get(local_user(), 'ljpost', 'lj_password');
/* Add some HTML to the existing form */
if($b['private'] || $b['parent'])
return;
- $lj_post = intval(PConfig::get(local_user(),'ljpost','post'));
+ $lj_post = intval(DI::pConfig()->get(local_user(),'ljpost','post'));
$lj_enable = (($lj_post && !empty($_REQUEST['ljpost_enable'])) ? intval($_REQUEST['ljpost_enable']) : 0);
- if($b['api_source'] && intval(PConfig::get(local_user(),'ljpost','post_by_default')))
+ if($b['api_source'] && intval(DI::pConfig()->get(local_user(),'ljpost','post_by_default')))
$lj_enable = 1;
if(! $lj_enable)
if($x && strlen($x[0]['timezone']))
$tz = $x[0]['timezone'];
- $lj_username = XML::escape(PConfig::get($b['uid'],'ljpost','lj_username'));
- $lj_password = XML::escape(PConfig::get($b['uid'],'ljpost','lj_password'));
- $lj_journal = XML::escape(PConfig::get($b['uid'],'ljpost','lj_journal'));
+ $lj_username = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_username'));
+ $lj_password = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_password'));
+ $lj_journal = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_journal'));
// if(! $lj_journal)
// $lj_journal = $lj_username;
- $lj_blog = XML::escape(PConfig::get($b['uid'],'ljpost','lj_blog'));
+ $lj_blog = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_blog'));
if(! strlen($lj_blog))
$lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc');
}
function mailstream_post_hook(&$a, &$item) {
- if (!PConfig::get($item['uid'], 'mailstream', 'enabled')) {
+ if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
Logger::debug('mailstream: not enabled for item ' . $item['id']);
return;
}
Logger::debug('mailstream: no plink for item ' . $item['id']);
return;
}
- if (PConfig::get($item['uid'], 'mailstream', 'nolikes')) {
+ if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) {
if ($item['verb'] == Activity::LIKE) {
Logger::debug('mailstream: like item ' . $item['id']);
return;
}
function mailstream_do_images($a, &$item, &$attachments) {
- if (!PConfig::get($item['uid'], 'mailstream', 'attachimg')) {
+ if (!DI::pConfig()->get($item['uid'], 'mailstream', 'attachimg')) {
return;
}
$attachments = [];
if ($frommail == "") {
$frommail = 'friendica@localhost.local';
}
- $address = PConfig::get($item['uid'], 'mailstream', 'address');
+ $address = DI::pConfig()->get($item['uid'], 'mailstream', 'address');
if (!$address) {
$address = $user['email'];
}
}
function mailstream_addon_settings(&$a,&$s) {
- $enabled = PConfig::get(local_user(), 'mailstream', 'enabled');
- $address = PConfig::get(local_user(), 'mailstream', 'address');
- $nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes');
- $attachimg= PConfig::get(local_user(), 'mailstream', 'attachimg');
+ $enabled = DI::pConfig()->get(local_user(), 'mailstream', 'enabled');
+ $address = DI::pConfig()->get(local_user(), 'mailstream', 'address');
+ $nolikes = DI::pConfig()->get(local_user(), 'mailstream', 'nolikes');
+ $attachimg= DI::pConfig()->get(local_user(), 'mailstream', 'attachimg');
$template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/');
$s .= Renderer::replaceMacros($template, [
'$enabled' => [
use Friendica\Core\Renderer;
use Friendica\Core\PConfig;
use Friendica\Core\L10n;
+use Friendica\DI;
function markdown_install() {
Hook::register('post_local_start', __FILE__, 'markdown_post_local_start');
return;
}
- $enabled = intval(PConfig::get(local_user(), 'markdown', 'enabled'));
+ $enabled = intval(DI::pConfig()->get(local_user(), 'markdown', 'enabled'));
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
$s .= Renderer::replaceMacros($t, [
}
function markdown_post_local_start(App $a, &$request) {
- if (empty($request['body']) || !PConfig::get(local_user(), 'markdown', 'enabled')) {
+ if (empty($request['body']) || !DI::pConfig()->get(local_user(), 'markdown', 'enabled')) {
return;
}
return;
}
- $use = PConfig::get(local_user(), 'mathjax', 'use', false);
+ $use = DI::pConfig()->get(local_user(), 'mathjax', 'use', false);
$tpl = Renderer::getMarkupTemplate('settings.tpl', __DIR__);
$s .= Renderer::replaceMacros($tpl, [
{
// if the visitor of the page is not a local_user, use MathJax
// otherwise check the users settings.
- if (!local_user() || PConfig::get(local_user(), 'mathjax', 'use', false)) {
+ if (!local_user() || DI::pConfig()->get(local_user(), 'mathjax', 'use', false)) {
DI::page()->registerFooterScript(__DIR__ . '/asset/MathJax.js?config=TeX-MML-AM_CHTML');
DI::page()->registerFooterScript(__DIR__ . '/mathjax.js');
}
/* Get the current state of our config variable */
- $notimeline = PConfig::get(local_user(), 'system', 'no_wall_archive_widget', false);
+ $notimeline = DI::pConfig()->get(local_user(), 'system', 'no_wall_archive_widget', false);
$notimeline_checked = (($notimeline) ? ' checked="checked" ' : '');
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/nsfw/nsfw.css' . '" media="all" />' . "\r\n";
- $enable_checked = (intval(PConfig::get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
- $words = PConfig::get(local_user(), 'nsfw', 'words');
+ $enable_checked = (intval(DI::pConfig()->get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
+ $words = DI::pConfig()->get(local_user(), 'nsfw', 'words');
if (!$words) {
$words = 'nsfw,';
}
function nsfw_prepare_body_content_filter(\Friendica\App $a, &$hook_data)
{
$words = null;
- if (PConfig::get(local_user(), 'nsfw', 'disable')) {
+ if (DI::pConfig()->get(local_user(), 'nsfw', 'disable')) {
return;
}
if (local_user()) {
- $words = PConfig::get(local_user(), 'nsfw', 'words');
+ $words = DI::pConfig()->get(local_user(), 'nsfw', 'words');
}
if ($words) {
/* Get the current state of our config variable */
- $numfriends = PConfig::get(local_user(), 'system', 'display_friend_count', 24);
+ $numfriends = DI::pConfig()->get(local_user(), 'system', 'display_friend_count', 24);
/* Add some HTML to the existing form */
/* Retrieve our personal config setting */
- $active = PConfig::get(local_user(), 'planets', 'enable');
+ $active = DI::pConfig()->get(local_user(), 'planets', 'enable');
if(! $active)
return;
/* Get the current state of our config variable */
- $enabled = PConfig::get(local_user(),'planets','enable');
+ $enabled = DI::pConfig()->get(local_user(),'planets','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');
function pumpio_check_item_notification($a, &$notification_data)
{
- $hostname = PConfig::get($notification_data["uid"], 'pumpio', 'host');
- $username = PConfig::get($notification_data["uid"], "pumpio", "user");
+ $hostname = DI::pConfig()->get($notification_data["uid"], 'pumpio', 'host');
+ $username = DI::pConfig()->get($notification_data["uid"], "pumpio", "user");
$notification_data["profiles"][] = "https://".$hostname."/".$username;
}
function pumpio_connect(App $a)
{
// Define the needed keys
- $consumer_key = PConfig::get(local_user(), 'pumpio', 'consumer_key');
- $consumer_secret = PConfig::get(local_user(), 'pumpio', 'consumer_secret');
- $hostname = PConfig::get(local_user(), 'pumpio', 'host');
+ $consumer_key = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_key');
+ $consumer_secret = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_secret');
+ $hostname = DI::pConfig()->get(local_user(), 'pumpio', 'host');
if ((($consumer_key == "") || ($consumer_secret == "")) && ($hostname != "")) {
Logger::log("pumpio_connect: register client");
PConfig::set(local_user(), 'pumpio', 'consumer_key', $clientdata->client_id);
PConfig::set(local_user(), 'pumpio', 'consumer_secret', $clientdata->client_secret);
- $consumer_key = PConfig::get(local_user(), 'pumpio', 'consumer_key');
- $consumer_secret = PConfig::get(local_user(), 'pumpio', 'consumer_secret');
+ $consumer_key = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_key');
+ $consumer_secret = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_secret');
Logger::log("pumpio_connect: ckey: ".$consumer_key." csecrect: ".$consumer_secret, Logger::DEBUG);
}
return;
}
- if (PConfig::get(local_user(), 'pumpio', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'pumpio', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'pumpio_enable',
L10n::t('Post to pumpio'),
- PConfig::get(local_user(), 'pumpio', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'pumpio', 'post_by_default')
]
];
}
/* Get the current state of our config variables */
- $import_enabled = PConfig::get(local_user(), 'pumpio', 'import');
+ $import_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'import');
$import_checked = (($import_enabled) ? ' checked="checked" ' : '');
- $enabled = PConfig::get(local_user(), 'pumpio', 'post');
+ $enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(), 'pumpio', 'post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $public_enabled = PConfig::get(local_user(), 'pumpio', 'public');
+ $public_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'public');
$public_checked = (($public_enabled) ? ' checked="checked" ' : '');
- $mirror_enabled = PConfig::get(local_user(), 'pumpio', 'mirror');
+ $mirror_enabled = DI::pConfig()->get(local_user(), 'pumpio', 'mirror');
$mirror_checked = (($mirror_enabled) ? ' checked="checked" ' : '');
- $servername = PConfig::get(local_user(), "pumpio", "host");
- $username = PConfig::get(local_user(), "pumpio", "user");
+ $servername = DI::pConfig()->get(local_user(), "pumpio", "host");
+ $username = DI::pConfig()->get(local_user(), "pumpio", "user");
/* Add some HTML to the existing form */
$s .= '</div><div class="clear"></div>';
if (($username != '') && ($servername != '')) {
- $oauth_token = PConfig::get(local_user(), "pumpio", "oauth_token");
- $oauth_token_secret = PConfig::get(local_user(), "pumpio", "oauth_token_secret");
+ $oauth_token = DI::pConfig()->get(local_user(), "pumpio", "oauth_token");
+ $oauth_token_secret = DI::pConfig()->get(local_user(), "pumpio", "oauth_token_secret");
$s .= '<div id="pumpio-password-wrapper">';
if (($oauth_token == "") || ($oauth_token_secret == "")) {
return;
}
- if (PConfig::get($post['uid'], 'pumpio', 'import')) {
+ if (DI::pConfig()->get($post['uid'], 'pumpio', 'import')) {
// Don't fork if it isn't a reply to a pump.io post
if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::PUMPIO])) {
Logger::log('No pump.io parent found for item ' . $post['id']);
return;
}
- $pumpio_post = intval(PConfig::get(local_user(), 'pumpio', 'post'));
+ $pumpio_post = intval(DI::pConfig()->get(local_user(), 'pumpio', 'post'));
$pumpio_enable = (($pumpio_post && !empty($_REQUEST['pumpio_enable'])) ? intval($_REQUEST['pumpio_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(), 'pumpio', 'post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'pumpio', 'post_by_default'))) {
$pumpio_enable = 1;
}
function pumpio_send(App $a, array &$b)
{
- if (!PConfig::get($b["uid"], 'pumpio', 'import') && ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))) {
+ if (!DI::pConfig()->get($b["uid"], 'pumpio', 'import') && ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))) {
return;
}
// Support for native shares
// http://<hostname>/api/<type>/shares?id=<the-object-id>
- $oauth_token = PConfig::get($b['uid'], "pumpio", "oauth_token");
- $oauth_token_secret = PConfig::get($b['uid'], "pumpio", "oauth_token_secret");
- $consumer_key = PConfig::get($b['uid'], "pumpio","consumer_key");
- $consumer_secret = PConfig::get($b['uid'], "pumpio","consumer_secret");
+ $oauth_token = DI::pConfig()->get($b['uid'], "pumpio", "oauth_token");
+ $oauth_token_secret = DI::pConfig()->get($b['uid'], "pumpio", "oauth_token_secret");
+ $consumer_key = DI::pConfig()->get($b['uid'], "pumpio","consumer_key");
+ $consumer_secret = DI::pConfig()->get($b['uid'], "pumpio","consumer_secret");
- $host = PConfig::get($b['uid'], "pumpio", "host");
- $user = PConfig::get($b['uid'], "pumpio", "user");
- $public = PConfig::get($b['uid'], "pumpio", "public");
+ $host = DI::pConfig()->get($b['uid'], "pumpio", "host");
+ $user = DI::pConfig()->get($b['uid'], "pumpio", "user");
+ $public = DI::pConfig()->get($b['uid'], "pumpio", "public");
if ($oauth_token && $oauth_token_secret) {
$title = trim($b['title']);
function pumpio_action(App $a, $uid, $uri, $action, $content = "")
{
// Don't do likes and other stuff if you don't import the timeline
- if (!PConfig::get($uid, 'pumpio', 'import')) {
+ if (!DI::pConfig()->get($uid, 'pumpio', 'import')) {
return;
}
- $ckey = PConfig::get($uid, 'pumpio', 'consumer_key');
- $csecret = PConfig::get($uid, 'pumpio', 'consumer_secret');
- $otoken = PConfig::get($uid, 'pumpio', 'oauth_token');
- $osecret = PConfig::get($uid, 'pumpio', 'oauth_token_secret');
- $hostname = PConfig::get($uid, 'pumpio', 'host');
- $username = PConfig::get($uid, "pumpio", "user");
+ $ckey = DI::pConfig()->get($uid, 'pumpio', 'consumer_key');
+ $csecret = DI::pConfig()->get($uid, 'pumpio', 'consumer_secret');
+ $otoken = DI::pConfig()->get($uid, 'pumpio', 'oauth_token');
+ $osecret = DI::pConfig()->get($uid, 'pumpio', 'oauth_token_secret');
+ $hostname = DI::pConfig()->get($uid, 'pumpio', 'host');
+ $username = DI::pConfig()->get($uid, "pumpio", "user");
$orig_post = Item::selectFirst([], ['uri' => $uri, 'uid' => $uid]);
pumpio_fetchinbox($a, $rr['uid']);
// check for new contacts once a day
- $last_contact_check = PConfig::get($rr['uid'], 'pumpio', 'contact_check');
+ $last_contact_check = DI::pConfig()->get($rr['uid'], 'pumpio', 'contact_check');
if ($last_contact_check) {
$next_contact_check = $last_contact_check + 86400;
} else {
function pumpio_fetchtimeline(App $a, $uid)
{
- $ckey = PConfig::get($uid, 'pumpio', 'consumer_key');
- $csecret = PConfig::get($uid, 'pumpio', 'consumer_secret');
- $otoken = PConfig::get($uid, 'pumpio', 'oauth_token');
- $osecret = PConfig::get($uid, 'pumpio', 'oauth_token_secret');
- $lastdate = PConfig::get($uid, 'pumpio', 'lastdate');
- $hostname = PConfig::get($uid, 'pumpio', 'host');
- $username = PConfig::get($uid, "pumpio", "user");
+ $ckey = DI::pConfig()->get($uid, 'pumpio', 'consumer_key');
+ $csecret = DI::pConfig()->get($uid, 'pumpio', 'consumer_secret');
+ $otoken = DI::pConfig()->get($uid, 'pumpio', 'oauth_token');
+ $osecret = DI::pConfig()->get($uid, 'pumpio', 'oauth_token_secret');
+ $lastdate = DI::pConfig()->get($uid, 'pumpio', 'lastdate');
+ $hostname = DI::pConfig()->get($uid, 'pumpio', 'host');
+ $username = DI::pConfig()->get($uid, "pumpio", "user");
// get the application name for the pump.io app
// 1st try personal config, then system config and fallback to the
// hostname of the node if neither one is set.
- $application_name = PConfig::get($uid, 'pumpio', 'application_name');
+ $application_name = DI::pConfig()->get($uid, 'pumpio', 'application_name');
if ($application_name == "") {
$application_name = Config::get('pumpio', 'application_name');
}
function pumpio_fetchinbox(App $a, $uid)
{
- $ckey = PConfig::get($uid, 'pumpio', 'consumer_key');
- $csecret = PConfig::get($uid, 'pumpio', 'consumer_secret');
- $otoken = PConfig::get($uid, 'pumpio', 'oauth_token');
- $osecret = PConfig::get($uid, 'pumpio', 'oauth_token_secret');
- $lastdate = PConfig::get($uid, 'pumpio', 'lastdate');
- $hostname = PConfig::get($uid, 'pumpio', 'host');
- $username = PConfig::get($uid, "pumpio", "user");
+ $ckey = DI::pConfig()->get($uid, 'pumpio', 'consumer_key');
+ $csecret = DI::pConfig()->get($uid, 'pumpio', 'consumer_secret');
+ $otoken = DI::pConfig()->get($uid, 'pumpio', 'oauth_token');
+ $osecret = DI::pConfig()->get($uid, 'pumpio', 'oauth_token_secret');
+ $lastdate = DI::pConfig()->get($uid, 'pumpio', 'lastdate');
+ $hostname = DI::pConfig()->get($uid, 'pumpio', 'host');
+ $username = DI::pConfig()->get($uid, "pumpio", "user");
$own_id = "https://".$hostname."/".$username;
$client->access_token = $otoken;
$client->access_token_secret = $osecret;
- $last_id = PConfig::get($uid, 'pumpio', 'last_id');
+ $last_id = DI::pConfig()->get($uid, 'pumpio', 'last_id');
$url = 'https://'.$hostname.'/api/user/'.$username.'/inbox';
function pumpio_getallusers(App &$a, $uid)
{
- $ckey = PConfig::get($uid, 'pumpio', 'consumer_key');
- $csecret = PConfig::get($uid, 'pumpio', 'consumer_secret');
- $otoken = PConfig::get($uid, 'pumpio', 'oauth_token');
- $osecret = PConfig::get($uid, 'pumpio', 'oauth_token_secret');
- $hostname = PConfig::get($uid, 'pumpio', 'host');
- $username = PConfig::get($uid, "pumpio", "user");
+ $ckey = DI::pConfig()->get($uid, 'pumpio', 'consumer_key');
+ $csecret = DI::pConfig()->get($uid, 'pumpio', 'consumer_secret');
+ $otoken = DI::pConfig()->get($uid, 'pumpio', 'oauth_token');
+ $osecret = DI::pConfig()->get($uid, 'pumpio', 'oauth_token_secret');
+ $hostname = DI::pConfig()->get($uid, 'pumpio', 'host');
+ $username = DI::pConfig()->get($uid, "pumpio", "user");
$client = new oauth_client_class;
$client->oauth_version = '1.0a';
return $receiver;
}
- $public = PConfig::get($b['uid'], "pumpio", "public");
+ $public = DI::pConfig()->get($b['uid'], "pumpio", "public");
if ($public) {
$receiver["to"][] = [
function pumpio_fetchallcomments(App $a, $uid, $id)
{
- $ckey = PConfig::get($uid, 'pumpio', 'consumer_key');
- $csecret = PConfig::get($uid, 'pumpio', 'consumer_secret');
- $otoken = PConfig::get($uid, 'pumpio', 'oauth_token');
- $osecret = PConfig::get($uid, 'pumpio', 'oauth_token_secret');
- $hostname = PConfig::get($uid, 'pumpio', 'host');
- $username = PConfig::get($uid, "pumpio", "user");
+ $ckey = DI::pConfig()->get($uid, 'pumpio', 'consumer_key');
+ $csecret = DI::pConfig()->get($uid, 'pumpio', 'consumer_secret');
+ $otoken = DI::pConfig()->get($uid, 'pumpio', 'oauth_token');
+ $osecret = DI::pConfig()->get($uid, 'pumpio', 'oauth_token_secret');
+ $hostname = DI::pConfig()->get($uid, 'pumpio', 'host');
+ $username = DI::pConfig()->get($uid, "pumpio", "user");
Logger::log("pumpio_fetchallcomments: completing comment for user ".$uid." post id ".$id);
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/qcomment/qcomment.css' . '" media="all" />' . "\r\n";
- $words = PConfig::get(local_user(), 'qcomment', 'words', L10n::t(':-)') . "\n" . L10n::t(':-(') . "\n" . L10n::t('lol'));
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words', L10n::t(':-)') . "\n" . L10n::t(':-(') . "\n" . L10n::t('lol'));
$s .= '<div class="settings-block">';
$s .= '<h3>' . L10n::t('Quick Comment Settings') . '</h3>';
/* Retrieve our personal config setting */
- $active = PConfig::get(local_user(), 'randplace', 'enable');
+ $active = DI::pConfig()->get(local_user(), 'randplace', 'enable');
if(! $active)
return;
/* Get the current state of our config variable */
- $enabled = PConfig::get(local_user(),'randplace','enable');
+ $enabled = DI::pConfig()->get(local_user(),'randplace','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');
/* Get the current state of our config variable */
- $remote_perms = PConfig::get(local_user(),'remote_perms','show');
+ $remote_perms = DI::pConfig()->get(local_user(),'remote_perms','show');
/* Add some HTML to the existing form */
if(! $r)
return;
- if(PConfig::get($r[0]['uid'],'remote_perms','show') == 0)
+ if(DI::pConfig()->get($r[0]['uid'],'remote_perms','show') == 0)
return;
}
return;
}
- $enable = intval(PConfig::get(local_user(), 'securemail', 'enable'));
- $publickey = PConfig::get(local_user(), 'securemail', 'pkey');
+ $enable = intval(DI::pConfig()->get(local_user(), 'securemail', 'enable'));
+ $publickey = DI::pConfig()->get(local_user(), 'securemail', 'pkey');
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/securemail/');
$uid = $b['uid'];
- $enable_checked = PConfig::get($uid, 'securemail', 'enable');
+ $enable_checked = DI::pConfig()->get($uid, 'securemail', 'enable');
if (!$enable_checked) {
return;
}
- $public_key_ascii = PConfig::get($uid, 'securemail', 'pkey');
+ $public_key_ascii = DI::pConfig()->get($uid, 'securemail', 'pkey');
preg_match('/-----BEGIN ([A-Za-z ]+)-----/', $public_key_ascii, $matches);
$marker = empty($matches[1]) ? 'MESSAGE' : $matches[1];
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/showmore/showmore.css'.'" media="all"/>'."\r\n";
- $enable_checked = (intval(PConfig::get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"');
- $chars = PConfig::get(local_user(), 'showmore', 'chars', 1100);
+ $enable_checked = (intval(DI::pConfig()->get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"');
+ $chars = DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100);
$s .= '<span id="settings_showmore_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_showmore_expanded\'); openClose(\'settings_showmore_inflated\');">';
$s .= '<h3>' . L10n::t('"Show more" Settings').'</h3>';
return;
}
- if (PConfig::get(local_user(), 'showmore', 'disable')) {
+ if (DI::pConfig()->get(local_user(), 'showmore', 'disable')) {
return;
}
- $chars = (int) PConfig::get(local_user(), 'showmore', 'chars', 1100);
+ $chars = (int) DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100);
if (get_body_length($hook_data['html']) > $chars) {
$found = true;
return;
}
- $page = PConfig::get(local_user(), 'startpage', 'startpage');
+ $page = DI::pConfig()->get(local_user(), 'startpage', 'startpage');
if (strlen($page)) {
DI::baseUrl()->redirect($page);
}
/* Get the current state of our config variable */
- $page = PConfig::get(local_user(), 'startpage', 'startpage');
+ $page = DI::pConfig()->get(local_user(), 'startpage', 'startpage');
/* Add some HTML to the existing form */
function statusnet_check_item_notification(App $a, &$notification_data)
{
- if (PConfig::get($notification_data["uid"], 'statusnet', 'post')) {
- $notification_data["profiles"][] = PConfig::get($notification_data["uid"], 'statusnet', 'own_url');
+ if (DI::pConfig()->get($notification_data["uid"], 'statusnet', 'post')) {
+ $notification_data["profiles"][] = DI::pConfig()->get($notification_data["uid"], 'statusnet', 'own_url');
}
}
return;
}
- if (PConfig::get(local_user(), 'statusnet', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'statusnet', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'statusnet_enable',
L10n::t('Post to GNU Social'),
- PConfig::get(local_user(), 'statusnet', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default')
]
];
}
} else {
if (isset($_POST['statusnet-pin'])) {
// if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen
- $api = PConfig::get(local_user(), 'statusnet', 'baseapi');
- $ckey = PConfig::get(local_user(), 'statusnet', 'consumerkey');
- $csecret = PConfig::get(local_user(), 'statusnet', 'consumersecret');
+ $api = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi');
+ $ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret');
// the token and secret for which the PIN was generated were hidden in the settings
// form as token and token2, we need a new connection to GNU Social using these token
// and secret to request a Access Token with the PIN
* allow the user to cancel the connection process at this step
* 3) Checkbox for "Send public notices (respect size limitation)
*/
- $api = PConfig::get(local_user(), 'statusnet', 'baseapi');
- $ckey = PConfig::get(local_user(), 'statusnet', 'consumerkey');
- $csecret = PConfig::get(local_user(), 'statusnet', 'consumersecret');
- $otoken = PConfig::get(local_user(), 'statusnet', 'oauthtoken');
- $osecret = PConfig::get(local_user(), 'statusnet', 'oauthsecret');
- $enabled = PConfig::get(local_user(), 'statusnet', 'post');
+ $api = DI::pConfig()->get(local_user(), 'statusnet', 'baseapi');
+ $ckey = DI::pConfig()->get(local_user(), 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get(local_user(), 'statusnet', 'consumersecret');
+ $otoken = DI::pConfig()->get(local_user(), 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get(local_user(), 'statusnet', 'oauthsecret');
+ $enabled = DI::pConfig()->get(local_user(), 'statusnet', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
- $defenabled = PConfig::get(local_user(), 'statusnet', 'post_by_default');
+ $defenabled = DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default');
$defchecked = (($defenabled) ? ' checked="checked" ' : '');
- $mirrorenabled = PConfig::get(local_user(), 'statusnet', 'mirror_posts');
+ $mirrorenabled = DI::pConfig()->get(local_user(), 'statusnet', 'mirror_posts');
$mirrorchecked = (($mirrorenabled) ? ' checked="checked" ' : '');
- $import = PConfig::get(local_user(), 'statusnet', 'import');
+ $import = DI::pConfig()->get(local_user(), 'statusnet', 'import');
$importselected = ["", "", ""];
$importselected[$import] = ' selected="selected"';
- //$importenabled = PConfig::get(local_user(),'statusnet','import');
+ //$importenabled = DI::pConfig()->get(local_user(),'statusnet','import');
//$importchecked = (($importenabled) ? ' checked="checked" ' : '');
- $create_userenabled = PConfig::get(local_user(), 'statusnet', 'create_user');
+ $create_userenabled = DI::pConfig()->get(local_user(), 'statusnet', 'create_user');
$create_userchecked = (($create_userenabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
return;
}
- if (PConfig::get($post['uid'], 'statusnet', 'import')) {
+ if (DI::pConfig()->get($post['uid'], 'statusnet', 'import')) {
// Don't fork if it isn't a reply to a GNU Social post
if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::STATUSNET])) {
Logger::log('No GNU Social parent found for item ' . $post['id']);
return;
}
- $statusnet_post = PConfig::get(local_user(), 'statusnet', 'post');
+ $statusnet_post = DI::pConfig()->get(local_user(), 'statusnet', 'post');
$statusnet_enable = (($statusnet_post && !empty($_REQUEST['statusnet_enable'])) ? intval($_REQUEST['statusnet_enable']) : 0);
// if API is used, default to the chosen settings
- if ($b['api_source'] && intval(PConfig::get(local_user(), 'statusnet', 'post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'statusnet', 'post_by_default'))) {
$statusnet_enable = 1;
}
function statusnet_action(App $a, $uid, $pid, $action)
{
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
- $ckey = PConfig::get($uid, 'statusnet', 'consumerkey');
- $csecret = PConfig::get($uid, 'statusnet', 'consumersecret');
- $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
+ $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret');
+ $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret');
$connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret);
/**
* Post to GNU Social
*/
- if (!PConfig::get($b["uid"], 'statusnet', 'import')) {
+ if (!DI::pConfig()->get($b["uid"], 'statusnet', 'import')) {
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))
return;
}
- $api = PConfig::get($b["uid"], 'statusnet', 'baseapi');
+ $api = DI::pConfig()->get($b["uid"], 'statusnet', 'baseapi');
$hostname = preg_replace("=https?://([\w\.]*)/.*=ism", "$1", $api);
if ($b['parent'] != $b['id']) {
DI::pConfig()->load($b['uid'], 'statusnet');
- $api = PConfig::get($b['uid'], 'statusnet', 'baseapi');
- $ckey = PConfig::get($b['uid'], 'statusnet', 'consumerkey');
- $csecret = PConfig::get($b['uid'], 'statusnet', 'consumersecret');
- $otoken = PConfig::get($b['uid'], 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($b['uid'], 'statusnet', 'oauthsecret');
+ $api = DI::pConfig()->get($b['uid'], 'statusnet', 'baseapi');
+ $ckey = DI::pConfig()->get($b['uid'], 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($b['uid'], 'statusnet', 'consumersecret');
+ $otoken = DI::pConfig()->get($b['uid'], 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($b['uid'], 'statusnet', 'oauthsecret');
if ($ckey && $csecret && $otoken && $osecret) {
// If it's a repeated message from GNU Social then do a native retweet and exit
}
if ($b["preview"]) {
- $max_char = PConfig::get(local_user(), 'statusnet', 'max_char');
+ $max_char = DI::pConfig()->get(local_user(), 'statusnet', 'max_char');
if (intval($max_char) == 0) {
$max_char = 140;
}
function statusnet_fetchtimeline(App $a, $uid)
{
- $ckey = PConfig::get($uid, 'statusnet', 'consumerkey');
- $csecret = PConfig::get($uid, 'statusnet', 'consumersecret');
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
- $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret');
- $lastid = PConfig::get($uid, 'statusnet', 'lastid');
+ $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
+ $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret');
+ $lastid = DI::pConfig()->get($uid, 'statusnet', 'lastid');
require_once 'mod/item.php';
// get the application name for the SN app
// 1st try personal config, then system config and fallback to the
// hostname of the node if neither one is set.
- $application_name = PConfig::get($uid, 'statusnet', 'application_name');
+ $application_name = DI::pConfig()->get($uid, 'statusnet', 'application_name');
if ($application_name == "") {
$application_name = Config::get('statusnet', 'application_name');
}
function statusnet_fetchuser(App $a, $uid, $screen_name = "", $user_id = "")
{
- $ckey = PConfig::get($uid, 'statusnet', 'consumerkey');
- $csecret = PConfig::get($uid, 'statusnet', 'consumersecret');
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
- $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret');
+ $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
+ $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret');
require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'codebirdsn.php';
{
Logger::log("statusnet_createpost: start", Logger::DEBUG);
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
$hostname = preg_replace("=https?://([\w\.]*)/.*=ism", "$1", $api);
$postarray = [];
}
// Is it me?
- $own_url = PConfig::get($uid, 'statusnet', 'own_url');
+ $own_url = DI::pConfig()->get($uid, 'statusnet', 'own_url');
if ($content->user->id == $own_url) {
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
$postarray['author-avatar'] = $content->user->profile_image_url;
// To-Do: Maybe unreliable? Can the api be entered without trailing "/"?
- $hostname = str_replace("/api/", "/notice/", PConfig::get($uid, 'statusnet', 'baseapi'));
+ $hostname = str_replace("/api/", "/notice/", DI::pConfig()->get($uid, 'statusnet', 'baseapi'));
$postarray['plink'] = $hostname . $content->id;
$postarray['app'] = strip_tags($content->source);
{
$conversations = [];
- $ckey = PConfig::get($uid, 'statusnet', 'consumerkey');
- $csecret = PConfig::get($uid, 'statusnet', 'consumersecret');
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
- $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret');
- $create_user = PConfig::get($uid, 'statusnet', 'create_user');
+ $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
+ $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret');
+ $create_user = DI::pConfig()->get($uid, 'statusnet', 'create_user');
// "create_user" is deactivated, since currently you cannot add users manually by now
$create_user = true;
if ($mode == 1) {
// Fetching timeline
- $lastid = PConfig::get($uid, 'statusnet', 'lasthometimelineid');
+ $lastid = DI::pConfig()->get($uid, 'statusnet', 'lasthometimelineid');
//$lastid = 1;
$first_time = ($lastid == "");
}
// Fetching mentions
- $lastid = PConfig::get($uid, 'statusnet', 'lastmentionid');
+ $lastid = DI::pConfig()->get($uid, 'statusnet', 'lastmentionid');
$first_time = ($lastid == "");
if ($lastid != "") {
function statusnet_complete_conversation(App $a, $uid, $self, $create_user, $nick, $conversation)
{
- $ckey = PConfig::get($uid, 'statusnet', 'consumerkey');
- $csecret = PConfig::get($uid, 'statusnet', 'consumersecret');
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
- $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret');
- $own_url = PConfig::get($uid, 'statusnet', 'own_url');
+ $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
+ $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret');
+ $own_url = DI::pConfig()->get($uid, 'statusnet', 'own_url');
$connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret);
function statusnet_fetch_own_contact(App $a, $uid)
{
- $ckey = PConfig::get($uid, 'statusnet', 'consumerkey');
- $csecret = PConfig::get($uid, 'statusnet', 'consumersecret');
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
- $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret');
- $own_url = PConfig::get($uid, 'statusnet', 'own_url');
+ $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
+ $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret');
+ $own_url = DI::pConfig()->get($uid, 'statusnet', 'own_url');
$contact_id = 0;
$link = $matches[1];
}
- $ckey = PConfig::get($uid, 'statusnet', 'consumerkey');
- $csecret = PConfig::get($uid, 'statusnet', 'consumersecret');
- $api = PConfig::get($uid, 'statusnet', 'baseapi');
- $otoken = PConfig::get($uid, 'statusnet', 'oauthtoken');
- $osecret = PConfig::get($uid, 'statusnet', 'oauthsecret');
+ $ckey = DI::pConfig()->get($uid, 'statusnet', 'consumerkey');
+ $csecret = DI::pConfig()->get($uid, 'statusnet', 'consumersecret');
+ $api = DI::pConfig()->get($uid, 'statusnet', 'baseapi');
+ $otoken = DI::pConfig()->get($uid, 'statusnet', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'statusnet', 'oauthsecret');
$hostname = preg_replace("=https?://([\w\.]*)/.*=ism", "$1", $api);
$id = preg_replace("=https?://" . $hostname . "/notice/(.*)=ism", "$1", $link);
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/superblock/superblock.css' . '" media="all" />' . "\r\n";
- $words = PConfig::get(local_user(), 'system', 'blocked');
+ $words = DI::pConfig()->get(local_user(), 'system', 'blocked');
if (!$words) {
$words = '';
}
function superblock_enotify_store(&$a,&$b) {
- $words = PConfig::get($b['uid'], 'system', 'blocked');
+ $words = DI::pConfig()->get($b['uid'], 'system', 'blocked');
if ($words) {
$arr = explode(',', $words);
} else {
return;
}
- $words = PConfig::get(local_user(), 'system', 'blocked');
+ $words = DI::pConfig()->get(local_user(), 'system', 'blocked');
if ($words) {
$a->data['superblock'] = explode(',', $words);
}
return;
}
- $words = PConfig::get(local_user(), 'system', 'blocked');
+ $words = DI::pConfig()->get(local_user(), 'system', 'blocked');
if (array_key_exists('block', $_GET) && $_GET['block']) {
if (strlen($words))
return;
}
- if (PConfig::get(local_user(),'tumblr','post')) {
+ if (DI::pConfig()->get(local_user(),'tumblr','post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'tumblr_enable',
L10n::t('Post to Tumblr'),
- PConfig::get(local_user(),'tumblr','post_by_default')
+ DI::pConfig()->get(local_user(),'tumblr','post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(), 'tumblr', 'post');
+ $enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(), 'tumblr', 'post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(), 'tumblr', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$s .= '<input id="tumblr-bydefault" type="checkbox" name="tumblr_bydefault" value="1" ' . $def_checked . '/>';
$s .= '</div><div class="clear"></div>';
- $oauth_token = PConfig::get(local_user(), "tumblr", "oauth_token");
- $oauth_token_secret = PConfig::get(local_user(), "tumblr", "oauth_token_secret");
+ $oauth_token = DI::pConfig()->get(local_user(), "tumblr", "oauth_token");
+ $oauth_token_secret = DI::pConfig()->get(local_user(), "tumblr", "oauth_token_secret");
$s .= '<div id="tumblr-page-wrapper">';
if (($oauth_token != "") && ($oauth_token_secret != "")) {
- $page = PConfig::get(local_user(), 'tumblr', 'page');
+ $page = DI::pConfig()->get(local_user(), 'tumblr', 'page');
$consumer_key = Config::get('tumblr', 'consumer_key');
$consumer_secret = Config::get('tumblr', 'consumer_secret');
return;
}
- $tmbl_post = intval(PConfig::get(local_user(), 'tumblr', 'post'));
+ $tmbl_post = intval(DI::pConfig()->get(local_user(), 'tumblr', 'post'));
$tmbl_enable = (($tmbl_post && !empty($_REQUEST['tumblr_enable'])) ? intval($_REQUEST['tumblr_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(), 'tumblr', 'post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'tumblr', 'post_by_default'))) {
$tmbl_enable = 1;
}
return;
}
- $oauth_token = PConfig::get($b['uid'], "tumblr", "oauth_token");
- $oauth_token_secret = PConfig::get($b['uid'], "tumblr", "oauth_token_secret");
- $page = PConfig::get($b['uid'], "tumblr", "page");
+ $oauth_token = DI::pConfig()->get($b['uid'], "tumblr", "oauth_token");
+ $oauth_token_secret = DI::pConfig()->get($b['uid'], "tumblr", "oauth_token_secret");
+ $page = DI::pConfig()->get($b['uid'], "tumblr", "page");
$tmbl_blog = 'blog/' . $page . '/post';
if ($oauth_token && $oauth_token_secret && $tmbl_blog) {
function twitter_check_item_notification(App $a, array &$notification_data)
{
- $own_id = PConfig::get($notification_data["uid"], 'twitter', 'own_id');
+ $own_id = DI::pConfig()->get($notification_data["uid"], 'twitter', 'own_id');
$own_user = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `alias` = '%s' LIMIT 1",
intval($notification_data["uid"]),
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($uid, 'twitter', 'oauthtoken');
- $osecret = PConfig::get($uid, 'twitter', 'oauthsecret');
+ $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
// If the addon is not configured (general or for this user) quit here
if (empty($ckey) || empty($csecret) || empty($otoken) || empty($osecret)) {
return;
}
- if (PConfig::get(local_user(), 'twitter', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'twitter', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'twitter_enable',
L10n::t('Post to Twitter'),
- PConfig::get(local_user(), 'twitter', 'post_by_default')
+ DI::pConfig()->get(local_user(), 'twitter', 'post_by_default')
]
];
}
*/
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get(local_user(), 'twitter', 'oauthtoken');
- $osecret = PConfig::get(local_user(), 'twitter', 'oauthsecret');
+ $otoken = DI::pConfig()->get(local_user(), 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get(local_user(), 'twitter', 'oauthsecret');
- $enabled = intval(PConfig::get(local_user(), 'twitter', 'post'));
- $defenabled = intval(PConfig::get(local_user(), 'twitter', 'post_by_default'));
- $mirrorenabled = intval(PConfig::get(local_user(), 'twitter', 'mirror_posts'));
- $importenabled = intval(PConfig::get(local_user(), 'twitter', 'import'));
- $create_userenabled = intval(PConfig::get(local_user(), 'twitter', 'create_user'));
+ $enabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'post'));
+ $defenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'post_by_default'));
+ $mirrorenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'mirror_posts'));
+ $importenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'import'));
+ $create_userenabled = intval(DI::pConfig()->get(local_user(), 'twitter', 'create_user'));
$css = (($enabled) ? '' : '-disabled');
return;
}
- if (PConfig::get($post['uid'], 'twitter', 'import')) {
+ if (DI::pConfig()->get($post['uid'], 'twitter', 'import')) {
// Don't fork if it isn't a reply to a twitter post
if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::TWITTER])) {
Logger::notice('No twitter parent found', ['item' => $post['id']]);
return;
}
- $twitter_post = intval(PConfig::get(local_user(), 'twitter', 'post'));
+ $twitter_post = intval(DI::pConfig()->get(local_user(), 'twitter', 'post'));
$twitter_enable = (($twitter_post && !empty($_REQUEST['twitter_enable'])) ? intval($_REQUEST['twitter_enable']) : 0);
// if API is used, default to the chosen settings
- if ($b['api_source'] && intval(PConfig::get(local_user(), 'twitter', 'post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'twitter', 'post_by_default'))) {
$twitter_enable = 1;
}
{
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($uid, 'twitter', 'oauthtoken');
- $osecret = PConfig::get($uid, 'twitter', 'oauthsecret');
+ $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
function twitter_post_hook(App $a, array &$b)
{
// Post to Twitter
- if (!PConfig::get($b["uid"], 'twitter', 'import')
+ if (!DI::pConfig()->get($b["uid"], 'twitter', 'import')
&& ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited']))) {
return;
}
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($b['uid'], 'twitter', 'oauthtoken');
- $osecret = PConfig::get($b['uid'], 'twitter', 'oauthsecret');
+ $otoken = DI::pConfig()->get($b['uid'], 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($b['uid'], 'twitter', 'oauthsecret');
if ($ckey && $csecret && $otoken && $osecret) {
Logger::log('twitter: we have customer key and oauth stuff, going to send.', Logger::DEBUG);
/*
// To-Do
// check for new contacts once a day
- $last_contact_check = PConfig::get($rr['uid'],'pumpio','contact_check');
+ $last_contact_check = DI::pConfig()->get($rr['uid'],'pumpio','contact_check');
if($last_contact_check)
$next_contact_check = $last_contact_check + 86400;
else
{
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($uid, 'twitter', 'oauthtoken');
- $osecret = PConfig::get($uid, 'twitter', 'oauthsecret');
- $lastid = PConfig::get($uid, 'twitter', 'lastid');
+ $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
+ $lastid = DI::pConfig()->get($uid, 'twitter', 'lastid');
$application_name = Config::get('twitter', 'application_name');
{
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($uid, 'twitter', 'oauthtoken');
- $osecret = PConfig::get($uid, 'twitter', 'oauthsecret');
+ $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
intval($uid));
}
// Is it me?
- $own_id = PConfig::get($uid, 'twitter', 'own_id');
+ $own_id = DI::pConfig()->get($uid, 'twitter', 'own_id');
if ($post->user->id_str == $own_id) {
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
if (!empty($posts)) {
foreach ($posts as $post) {
- $postarray = twitter_createpost($a, $uid, $post, $self, false, !PConfig::get($uid, 'twitter', 'create_user'), false);
+ $postarray = twitter_createpost($a, $uid, $post, $self, false, !DI::pConfig()->get($uid, 'twitter', 'create_user'), false);
if (empty($postarray['body'])) {
continue;
{
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($uid, 'twitter', 'oauthtoken');
- $osecret = PConfig::get($uid, 'twitter', 'oauthsecret');
- $create_user = PConfig::get($uid, 'twitter', 'create_user');
- $mirror_posts = PConfig::get($uid, 'twitter', 'mirror_posts');
+ $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
+ $create_user = DI::pConfig()->get($uid, 'twitter', 'create_user');
+ $mirror_posts = DI::pConfig()->get($uid, 'twitter', 'mirror_posts');
Logger::log("Fetching timeline for user " . $uid, Logger::DEBUG);
$parameters = ["exclude_replies" => false, "trim_user" => false, "contributor_details" => true, "include_rts" => true, "tweet_mode" => "extended", "include_ext_alt_text" => true];
//$parameters["count"] = 200;
// Fetching timeline
- $lastid = PConfig::get($uid, 'twitter', 'lasthometimelineid');
+ $lastid = DI::pConfig()->get($uid, 'twitter', 'lasthometimelineid');
$first_time = ($lastid == "");
Logger::log('Last timeline ID for user ' . $uid . ' is now ' . $lastid, Logger::DEBUG);
// Fetching mentions
- $lastid = PConfig::get($uid, 'twitter', 'lastmentionid');
+ $lastid = DI::pConfig()->get($uid, 'twitter', 'lastmentionid');
$first_time = ($lastid == "");
{
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($uid, 'twitter', 'oauthtoken');
- $osecret = PConfig::get($uid, 'twitter', 'oauthsecret');
+ $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
- $own_id = PConfig::get($uid, 'twitter', 'own_id');
+ $own_id = DI::pConfig()->get($uid, 'twitter', 'own_id');
$contact_id = 0;
$ckey = Config::get('twitter', 'consumerkey');
$csecret = Config::get('twitter', 'consumersecret');
- $otoken = PConfig::get($uid, 'twitter', 'oauthtoken');
- $osecret = PConfig::get($uid, 'twitter', 'oauthsecret');
+ $otoken = DI::pConfig()->get($uid, 'twitter', 'oauthtoken');
+ $osecret = DI::pConfig()->get($uid, 'twitter', 'oauthsecret');
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
$result = $connection->post('statuses/retweet/' . $id);
return;
- $key = PConfig::get(local_user(), 'widgets', 'key' );
+ $key = DI::pConfig()->get(local_user(), 'widgets', 'key' );
if ($key=='') { $key = mt_rand(); PConfig::set(local_user(), 'widgets', 'key', $key); }
$widgets = [];
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/windowsphonepush/windowsphonepush.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(), 'windowsphonepush', 'enable');
+ $enabled = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable');
$checked_enabled = (($enabled) ? ' checked="checked" ' : '');
- $senditemtext = PConfig::get(local_user(), 'windowsphonepush', 'senditemtext');
+ $senditemtext = DI::pConfig()->get(local_user(), 'windowsphonepush', 'senditemtext');
$checked_senditemtext = (($senditemtext) ? ' checked="checked" ' : '');
- $device_url = PConfig::get(local_user(), 'windowsphonepush', 'device_url');
+ $device_url = DI::pConfig()->get(local_user(), 'windowsphonepush', 'device_url');
/* Add some HTML to the existing form */
$s .= '<div class="settings-block">';
if (count($r)) {
foreach ($r as $rr) {
// load stored information for the user-id of the current loop
- $device_url = PConfig::get($rr['uid'], 'windowsphonepush', 'device_url');
- $lastpushid = PConfig::get($rr['uid'], 'windowsphonepush', 'lastpushid');
+ $device_url = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'device_url');
+ $lastpushid = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'lastpushid');
// pushing only possible if device_url (the URI on Microsoft server) is available or not "NA" (which will be sent
// by app if user has switched the server setting in app - sending blank not possible as this would return an update error)
if (intval($count[0]['max']) > intval($lastpushid)) {
// user can define if he wants to see the text of the item in the push notification
// this has been implemented as the device_url is not a https uri (not so secure)
- $senditemtext = PConfig::get($rr['uid'], 'windowsphonepush', 'senditemtext');
+ $senditemtext = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'senditemtext');
if ($senditemtext == 1) {
// load item with the max id
$item = Item::selectFirst(['author-name', 'body'], ['id' => $count[0]['max']]);
return;
}
- $enable = PConfig::get(local_user(), 'windowsphonepush', 'enable');
- $device_url = PConfig::get(local_user(), 'windowsphonepush', 'device_url');
- $senditemtext = PConfig::get(local_user(), 'windowsphonepush', 'senditemtext');
- $lastpushid = PConfig::get(local_user(), 'windowsphonepush', 'lastpushid');
- $counterunseen = PConfig::get(local_user(), 'windowsphonepush', 'counterunseen');
+ $enable = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable');
+ $device_url = DI::pConfig()->get(local_user(), 'windowsphonepush', 'device_url');
+ $senditemtext = DI::pConfig()->get(local_user(), 'windowsphonepush', 'senditemtext');
+ $lastpushid = DI::pConfig()->get(local_user(), 'windowsphonepush', 'lastpushid');
+ $counterunseen = DI::pConfig()->get(local_user(), 'windowsphonepush', 'counterunseen');
$addonversion = "2.0";
if (!$device_url) {
}
// no updating if user hasn't enabled the addon
- $enable = PConfig::get(local_user(), 'windowsphonepush', 'enable');
+ $enable = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable');
if (!$enable) {
return "Plug-in not enabled";
}
}
// no updating if user hasn't enabled the addon
- $enable = PConfig::get(local_user(), 'windowsphonepush', 'enable');
+ $enable = DI::pConfig()->get(local_user(), 'windowsphonepush', 'enable');
if (!$enable) {
return "Plug-in not enabled";
}
return;
}
- if (PConfig::get(local_user(),'wppost','post')) {
+ if (DI::pConfig()->get(local_user(),'wppost','post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'wppost_enable',
L10n::t('Post to Wordpress'),
- PConfig::get(local_user(),'wppost','post_by_default')
+ DI::pConfig()->get(local_user(),'wppost','post_by_default')
]
];
}
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(),'wppost','post');
+ $enabled = DI::pConfig()->get(local_user(),'wppost','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(),'wppost','post_by_default');
- $back_enabled = PConfig::get(local_user(),'wppost','backlink');
- $shortcheck_enabled = PConfig::get(local_user(),'wppost','shortcheck');
+ $def_enabled = DI::pConfig()->get(local_user(),'wppost','post_by_default');
+ $back_enabled = DI::pConfig()->get(local_user(),'wppost','backlink');
+ $shortcheck_enabled = DI::pConfig()->get(local_user(),'wppost','shortcheck');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$back_checked = (($back_enabled) ? ' checked="checked" ' : '');
$shortcheck_checked = (($shortcheck_enabled) ? ' checked="checked" ' : '');
- $wp_username = PConfig::get(local_user(), 'wppost', 'wp_username');
- $wp_password = PConfig::get(local_user(), 'wppost', 'wp_password');
- $wp_blog = PConfig::get(local_user(), 'wppost', 'wp_blog');
- $wp_backlink_text = PConfig::get(local_user(), 'wppost', 'wp_backlink_text');
+ $wp_username = DI::pConfig()->get(local_user(), 'wppost', 'wp_username');
+ $wp_password = DI::pConfig()->get(local_user(), 'wppost', 'wp_password');
+ $wp_blog = DI::pConfig()->get(local_user(), 'wppost', 'wp_blog');
+ $wp_backlink_text = DI::pConfig()->get(local_user(), 'wppost', 'wp_backlink_text');
/* Add some HTML to the existing form */
return;
}
- $wp_post = intval(PConfig::get(local_user(),'wppost','post'));
+ $wp_post = intval(DI::pConfig()->get(local_user(),'wppost','post'));
$wp_enable = (($wp_post && !empty($_REQUEST['wppost_enable'])) ? intval($_REQUEST['wppost_enable']) : 0);
- if ($b['api_source'] && intval(PConfig::get(local_user(),'wppost','post_by_default'))) {
+ if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'wppost','post_by_default'))) {
$wp_enable = 1;
}
return;
}
- $wp_username = XML::escape(PConfig::get($b['uid'], 'wppost', 'wp_username'));
- $wp_password = XML::escape(PConfig::get($b['uid'], 'wppost', 'wp_password'));
- $wp_blog = PConfig::get($b['uid'],'wppost','wp_blog');
- $wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text');
+ $wp_username = XML::escape(DI::pConfig()->get($b['uid'], 'wppost', 'wp_username'));
+ $wp_password = XML::escape(DI::pConfig()->get($b['uid'], 'wppost', 'wp_password'));
+ $wp_blog = DI::pConfig()->get($b['uid'],'wppost','wp_blog');
+ $wp_backlink_text = DI::pConfig()->get($b['uid'],'wppost','wp_backlink_text');
if ($wp_backlink_text == '') {
$wp_backlink_text = L10n::t('Read the original post and comment stream on Friendica');
}
if ($wp_username && $wp_password && $wp_blog) {
$wptitle = trim($b['title']);
- if (intval(PConfig::get($b['uid'], 'wppost', 'shortcheck'))) {
+ if (intval(DI::pConfig()->get($b['uid'], 'wppost', 'shortcheck'))) {
// Checking, if its a post that is worth a blog post
$postentry = false;
$siteinfo = BBCode::getAttachedData($b["body"]);
$post = $title.$post;
- $wp_backlink = intval(PConfig::get($b['uid'],'wppost','backlink'));
+ $wp_backlink = intval(DI::pConfig()->get($b['uid'],'wppost','backlink'));
if($wp_backlink && $b['plink']) {
$post .= EOL . EOL . '<a href="' . $b['plink'] . '">'
. $wp_backlink_text . '</a>' . EOL . EOL;
/* Get the current state of our config variable */
- $enabled = intval(PConfig::get(local_user(), 'xmpp', 'enabled'));
+ $enabled = intval(DI::pConfig()->get(local_user(), 'xmpp', 'enabled'));
$enabled_checked = (($enabled) ? ' checked="checked" ' : '');
- $individual = intval(PConfig::get(local_user(), 'xmpp', 'individual'));
+ $individual = intval(DI::pConfig()->get(local_user(), 'xmpp', 'individual'));
$individual_checked = (($individual) ? ' checked="checked" ' : '');
- $bosh_proxy = PConfig::get(local_user(), "xmpp", "bosh_proxy");
+ $bosh_proxy = DI::pConfig()->get(local_user(), "xmpp", "bosh_proxy");
/* Add some HTML to the existing form */
$s .= '<span id="settings_xmpp_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_xmpp_expanded\'); openClose(\'settings_xmpp_inflated\');">';
$s .= '<div class="clear"></div>';
}
- if (!Config::get("xmpp", "central_userbase") || PConfig::get(local_user(), "xmpp", "individual")) {
+ if (!Config::get("xmpp", "central_userbase") || DI::pConfig()->get(local_user(), "xmpp", "individual")) {
$s .= '<label id="xmpp-bosh-proxy-label" for="xmpp-bosh-proxy">' . L10n::t('Jabber BOSH host') . '</label>';
$s .= ' <input id="xmpp-bosh-proxy" type="text" name="xmpp_bosh_proxy" value="' . $bosh_proxy . '" />';
$s .= '<div class="clear"></div>';
return;
}
- if (!PConfig::get(local_user(), "xmpp", "enabled")) {
+ if (!DI::pConfig()->get(local_user(), "xmpp", "enabled")) {
return;
}
DI::page()['htmlhead'] .= '<link type="text/css" rel="stylesheet" media="screen" href="addon/xmpp/converse/css/converse.css" />' . "\n";
DI::page()['htmlhead'] .= '<script src="addon/xmpp/converse/builds/converse.min.js"></script>' . "\n";
- if (Config::get("xmpp", "central_userbase") && !PConfig::get(local_user(), "xmpp", "individual")) {
+ if (Config::get("xmpp", "central_userbase") && !DI::pConfig()->get(local_user(), "xmpp", "individual")) {
$bosh_proxy = Config::get("xmpp", "bosh_proxy");
- $password = PConfig::get(local_user(), "xmpp", "password", '', true);
+ $password = DI::pConfig()->get(local_user(), "xmpp", "password", '', true);
if ($password == "") {
$password = Strings::getRandomHex(16);
password: '$password',
allow_logout: false,";
} else {
- $bosh_proxy = PConfig::get(local_user(), "xmpp", "bosh_proxy");
+ $bosh_proxy = DI::pConfig()->get(local_user(), "xmpp", "bosh_proxy");
$auto_login = "";
}