Update functions and calls
Update function names and calls.
This commit is contained in:
parent
300b1b6af8
commit
a3ef9e35ec
14 changed files with 151 additions and 154 deletions
|
|
@ -6,6 +6,7 @@
|
|||
* @todo Automatically detect if incoming data is HTML or BBCode
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Config;
|
||||
|
|
@ -38,7 +39,6 @@ require_once 'include/html2plain.php';
|
|||
require_once 'mod/share.php';
|
||||
require_once 'mod/item.php';
|
||||
require_once 'include/security.php';
|
||||
require_once 'include/contact_selectors.php';
|
||||
require_once 'include/html2bbcode.php';
|
||||
require_once 'mod/wall_upload.php';
|
||||
require_once 'mod/proxy.php';
|
||||
|
|
@ -610,7 +610,7 @@ function api_get_user(App $a, $contact_id = null)
|
|||
}
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
$network_name = network_to_name($r[0]['network'], $r[0]['url']);
|
||||
$network_name = ContactSelector::networkToName($r[0]['network'], $r[0]['url']);
|
||||
|
||||
// If no nick where given, extract it from the address
|
||||
if (($r[0]['nick'] == "") || ($r[0]['name'] == $r[0]['nick'])) {
|
||||
|
|
@ -734,7 +734,7 @@ function api_get_user(App $a, $contact_id = null)
|
|||
$uinfo[0]['nick'] = api_get_nick($uinfo[0]["url"]);
|
||||
}
|
||||
|
||||
$network_name = network_to_name($uinfo[0]['network'], $uinfo[0]['url']);
|
||||
$network_name = ContactSelector::networkToName($uinfo[0]['network'], $uinfo[0]['url']);
|
||||
|
||||
$pcontact_id = Contact::getIdForURL($uinfo[0]['url'], 0, true);
|
||||
|
||||
|
|
@ -1405,9 +1405,9 @@ function api_status_show($type)
|
|||
}
|
||||
|
||||
if (($lastwall['item_network'] != "") && ($status["source"] == 'web')) {
|
||||
$status_info["source"] = network_to_name($lastwall['item_network'], $user_info['url']);
|
||||
} elseif (($lastwall['item_network'] != "") && (network_to_name($lastwall['item_network'], $user_info['url']) != $status_info["source"])) {
|
||||
$status_info["source"] = trim($status_info["source"].' ('.network_to_name($lastwall['item_network'], $user_info['url']).')');
|
||||
$status_info["source"] = ContactSelector::networkToName($lastwall['item_network'], $user_info['url']);
|
||||
} elseif (($lastwall['item_network'] != "") && (ContactSelector::networkToName($lastwall['item_network'], $user_info['url']) != $status_info["source"])) {
|
||||
$status_info["source"] = trim($status_info["source"].' ('.ContactSelector::networkToName($lastwall['item_network'], $user_info['url']).')');
|
||||
}
|
||||
|
||||
// "uid" and "self" are only needed for some internal stuff, so remove it from here
|
||||
|
|
@ -1496,11 +1496,11 @@ function api_users_show($type)
|
|||
}
|
||||
|
||||
if (($lastwall['item_network'] != "") && ($user_info["status"]["source"] == 'web')) {
|
||||
$user_info["status"]["source"] = network_to_name($lastwall['item_network'], $user_info['url']);
|
||||
$user_info["status"]["source"] = ContactSelector::networkToName($lastwall['item_network'], $user_info['url']);
|
||||
}
|
||||
|
||||
if (($lastwall['item_network'] != "") && (network_to_name($lastwall['item_network'], $user_info['url']) != $user_info["status"]["source"])) {
|
||||
$user_info["status"]["source"] = trim($user_info["status"]["source"] . ' (' . network_to_name($lastwall['item_network'], $user_info['url']) . ')');
|
||||
if (($lastwall['item_network'] != "") && (ContactSelector::networkToName($lastwall['item_network'], $user_info['url']) != $user_info["status"]["source"])) {
|
||||
$user_info["status"]["source"] = trim($user_info["status"]["source"] . ' (' . ContactSelector::networkToName($lastwall['item_network'], $user_info['url']) . ')');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3131,9 +3131,9 @@ function api_format_items($r, $user_info, $filter_user = false, $type = "json")
|
|||
}
|
||||
|
||||
if (($item['item_network'] != "") && ($status["source"] == 'web')) {
|
||||
$status["source"] = network_to_name($item['item_network'], $user_info['url']);
|
||||
} elseif (($item['item_network'] != "") && (network_to_name($item['item_network'], $user_info['url']) != $status["source"])) {
|
||||
$status["source"] = trim($status["source"].' ('.network_to_name($item['item_network'], $user_info['url']).')');
|
||||
$status["source"] = ContactSelector::networkToName($item['item_network'], $user_info['url']);
|
||||
} elseif (($item['item_network'] != "") && (ContactSelector::networkToName($item['item_network'], $user_info['url']) != $status["source"])) {
|
||||
$status["source"] = trim($status["source"].' ('.ContactSelector::networkToName($item['item_network'], $user_info['url']).')');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file include/contact_widgets.php
|
||||
*/
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Config;
|
||||
|
|
@ -10,8 +10,6 @@ use Friendica\Core\PConfig;
|
|||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\GContact;
|
||||
|
||||
require_once 'include/contact_selectors.php';
|
||||
|
||||
function follow_widget($value = "")
|
||||
{
|
||||
return replace_macros(get_markup_template('follow.tpl'), array(
|
||||
|
|
@ -119,7 +117,7 @@ function networks_widget($baseurl, $selected = '')
|
|||
while ($rr = dba::fetch($r)) {
|
||||
/// @TODO If 'network' is not there, this triggers an E_NOTICE
|
||||
if ($rr['network']) {
|
||||
$nets[] = array('ref' => $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
|
||||
$nets[] = array('ref' => $rr['network'], 'name' => ContactSelector::networkToName($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
|
||||
}
|
||||
}
|
||||
dba::close($r);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* @file include/conversation.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
|
|
@ -776,7 +777,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
'id' => (($preview) ? 'P0' : $item['item_id']),
|
||||
'guid' => (($preview) ? 'Q0' : $item['guid']),
|
||||
'network' => $item['item_network'],
|
||||
'network_name' => network_to_name($item['item_network'], $profile_link),
|
||||
'network_name' => ContactSelector::networkToName($item['item_network'], $profile_link),
|
||||
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
|
||||
'profile_url' => $profile_link,
|
||||
'item_photo_menu' => item_photo_menu($item),
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* @file include/text.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Content\Smilies;
|
||||
use Friendica\Core\Config;
|
||||
|
|
@ -2048,16 +2049,14 @@ function formatBytes($bytes, $precision = 2) {
|
|||
*/
|
||||
function format_network_name($network, $url = 0) {
|
||||
if ($network != "") {
|
||||
require_once 'include/contact_selectors.php';
|
||||
if ($url != "") {
|
||||
$network_name = '<a href="'.$url.'">'.network_to_name($network, $url)."</a>";
|
||||
$network_name = '<a href="'.$url.'">'.ContactSelector::networkToName($network, $url)."</a>";
|
||||
} else {
|
||||
$network_name = network_to_name($network);
|
||||
$network_name = ContactSelector::networkToName($network);
|
||||
}
|
||||
|
||||
return $network_name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue