* @file include/text.php
*/
use Friendica\App;
+use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Content\Smilies;
use Friendica\Core\Config;
$redir = false;
if ($redirect) {
- $a = get_app();
$redirect_url = 'redir/' . $contact['id'];
if (local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === NETWORK_DFRN)) {
$redir = true;
* @param boolean $savedsearch show save search button
*/
function search($s, $id = 'search-box', $url = 'search', $save = false, $aside = true) {
- $a = get_app();
-
$values = array(
'$s' => htmlspecialchars($s),
'$id' => $id,
* ]
* ]
*/
-function get_cats_and_terms($item) {
-
- $a = get_app();
+function get_cats_and_terms($item)
+{
$categories = array();
$folders = array();
function file_tag_save_file($uid, $item, $file) {
require_once "include/files.php";
- $result = false;
- if (! intval($uid))
+ if (! intval($uid)) {
return false;
+ }
+
$r = q("SELECT `file` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($item),
intval($uid)
function file_tag_unsave_file($uid, $item, $file, $cat = false) {
require_once "include/files.php";
- $result = false;
- if (! intval($uid))
+ if (! intval($uid)) {
return false;
+ }
if ($cat == true) {
$pattern = '<' . file_tag_encode($file) . '>' ;
$termtype = TERM_FILE;
}
-
$r = q("SELECT `file` FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($item),
intval($uid)
dbesc($file),
intval(TERM_OBJ_POST),
intval($termtype),
- intval($uid));
-
+ intval($uid)
+ );
if (!DBM::is_result($r)) {
$saved = PConfig::get($uid, 'system', 'filetags');
PConfig::set($uid, 'system', 'filetags', str_replace($pattern, '', $saved));
*/
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;
}
-
}
/**