*/
use Friendica\App;
use Friendica\Content\Feature;
+use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
-require_once "include/contact_widgets.php";
require_once "mod/proxy.php";
/**
$group_count = 0;
}
- $sql_extra2 .= " ".unavailable_networks();
+ $sql_extra2 .= " ".Widget::unavailableNetworks();
if ($type == '' || $type == 'c') {
// autocomplete for editor mentions
*/
use Friendica\App;
use Friendica\Content\ContactSelector;
+use Friendica\Content\Widget;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
-require_once 'include/contact_widgets.php';
require_once 'mod/proxy.php';
function contacts_init(App $a)
$networks_widget = '';
} else {
$vcard_widget = '';
- $networks_widget = networks_widget('contacts', $nets);
+ $networks_widget = Widget::networks('contacts', $nets);
if (isset($_GET['add'])) {
- $follow_widget = follow_widget($_GET['add']);
+ $follow_widget = Widget::follow($_GET['add']);
} else {
- $follow_widget = follow_widget();
+ $follow_widget = Widget::follow();
}
- $findpeople_widget = findpeople_widget();
+ $findpeople_widget = Widget::findPeople();
}
$groups_widget = Group::sidebarWidget('contacts', 'group', 'full', 0, $contact_id);
$total = $r[0]['total'];
}
- $sql_extra3 = unavailable_networks();
+ $sql_extra3 = Widget::unavailableNetworks();
$contacts = array();
* @file mod/directory.php
*/
use Friendica\App;
+use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
$a->set_pager_itemspage(60);
if(local_user()) {
- require_once('include/contact_widgets.php');
+ $a->page['aside'] .= Widget::findPeople();
- $a->page['aside'] .= findpeople_widget();
-
- $a->page['aside'] .= follow_widget();
- }
- else {
+ $a->page['aside'] .= Widget::follow();
+ } else {
unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']);
}
*/
use Friendica\App;
use Friendica\Content\ContactSelector;
+use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
-require_once 'include/contact_widgets.php';
require_once 'mod/contacts.php';
function dirfind_init(App $a) {
$a->page['aside'] = '';
}
- $a->page['aside'] .= findpeople_widget();
+ $a->page['aside'] .= Widget::findPeople();
- $a->page['aside'] .= follow_widget();
+ $a->page['aside'] .= Widget::follow();
}
function dirfind_content(App $a, $prefix = "") {
* @file mod/match.php
*/
use Friendica\App;
+use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
require_once 'include/text.php';
-require_once 'include/contact_widgets.php';
require_once 'mod/proxy.php';
/**
return;
}
- $a->page['aside'] .= findpeople_widget();
- $a->page['aside'] .= follow_widget();
+ $a->page['aside'] .= Widget::findPeople();
+ $a->page['aside'] .= Widget::follow();
$_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
+use Friendica\Content\Widget;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Module\Login;
require_once 'include/conversation.php';
-require_once 'include/contact_widgets.php';
require_once 'include/items.php';
require_once 'include/acl_selectors.php';
$a->page['aside'] = '';
}
- $a->page['aside'] .= (Feature::isEnabled(local_user(),'groups') ? Group::sidebarWidget('network/0','network','standard',$group_id) : '');
+ $a->page['aside'] .= (Feature::isEnabled(local_user(), 'groups') ? Group::sidebarWidget('network/0', 'network', 'standard', $group_id) : '');
$a->page['aside'] .= (Feature::isEnabled(local_user(), 'forumlist_widget') ? ForumManager::widget(local_user(), $cid) : '');
- $a->page['aside'] .= posted_date_widget('network',local_user(),false);
- $a->page['aside'] .= networks_widget('network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
+ $a->page['aside'] .= posted_date_widget('network', local_user(),false);
+ $a->page['aside'] .= Widget::networks('network', (x($_GET, 'nets') ? $_GET['nets'] : ''));
$a->page['aside'] .= saved_searches($search);
- $a->page['aside'] .= fileas_widget('network',(x($_GET, 'file') ? $_GET['file'] : ''));
+ $a->page['aside'] .= Widget::fileAs('network', (x($_GET, 'file') ? $_GET['file'] : ''));
}
function saved_searches($search) {
* @file mod/profile.php
*/
use Friendica\App;
+use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Module\Login;
use Friendica\Protocol\DFRN;
-require_once 'include/contact_widgets.php';
-
function profile_init(App $a)
{
if (!x($a->page, 'aside')) {
return $o;
}
- $o .= common_friends_visitor_widget($a->profile['profile_uid']);
+ $o .= Widget::commonFriendsVisitor($a->profile['profile_uid']);
if (x($_SESSION, 'new_member') && $is_owner) {
$o .= '<a href="newmember" id="newmember-tips" style="font-size: 1.2em;"><b>' . t('Tips for New Members') . '</b></a>' . EOL;
$commvisitor = $commpage && $remote_contact;
$a->page['aside'] .= posted_date_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'], true);
- $a->page['aside'] .= categories_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (x($category) ? xmlify($category) : ''));
+ $a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (x($category) ? xmlify($category) : ''));
$a->page['aside'] .= tagcloud_wall_widget();
if (can_write_wall($a->profile['profile_uid'])) {
*/
use Friendica\App;
use Friendica\Content\ContactSelector;
+use Friendica\Content\Widget;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
-require_once 'include/contact_widgets.php';
-
function suggest_init(App $a) {
if (! local_user()) {
return;
}
-
-
-
-
function suggest_content(App $a) {
require_once("mod/proxy.php");
$_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
- $a->page['aside'] .= findpeople_widget();
- $a->page['aside'] .= follow_widget();
+ $a->page['aside'] .= Widget::findPeople();
+ $a->page['aside'] .= Widget::follow();
$r = GContact::suggestionQuery(local_user());
class Widget
{
- function follow_widget($value = "")
+ /**
+ * Return the follow widget
+ *
+ * @param string $value optional, default empty
+ */
+ public static function follow($value = "")
{
return replace_macros(get_markup_template('follow.tpl'), array(
'$connect' => t('Add New Contact'),
));
}
- function findpeople_widget()
+ /**
+ * Return Find People widget
+ */
+ public static function findPeople()
{
$a = get_app();
$global_dir = Config::get('system', 'directory');
));
}
- function unavailable_networks()
+ /**
+ * Return unavailable networks
+ */
+ public static function unavailableNetworks()
{
$networks = array();
return $network_filter;
}
- function networks_widget($baseurl, $selected = '')
+ /**
+ * Return networks widget
+ *
+ * @param string $baseurl baseurl
+ * @param string $selected optional, default empty
+ */
+ public static function networks($baseurl, $selected = '')
{
if (!local_user()) {
return '';
return '';
}
- $extra_sql = unavailable_networks();
+ $extra_sql = self::unavailableNetworks();
$r = dba::p("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = ? AND `network` != '' $extra_sql ORDER BY `network`",
local_user()
));
}
- function fileas_widget($baseurl, $selected = '')
+ /**
+ * Return file as widget
+ *
+ * @param string $baseurl baseurl
+ * @param string $selected optional, default empty
+ */
+ public static function fileAs($baseurl, $selected = '')
{
if (!local_user()) {
return '';
));
}
- function categories_widget($baseurl, $selected = '')
+ /**
+ * Return categories widget
+ *
+ * @param string $baseurl baseurl
+ * @param string $selected optional, default empty
+ */
+ public static function categories($baseurl, $selected = '')
{
$a = get_app();
));
}
- function common_friends_visitor_widget($profile_uid)
+ /**
+ * Return common friends visitor widget
+ *
+ * @param string $profile_uid uid
+ */
+ public static function commonFriendsVisitor($profile_uid)
{
if (local_user() == $profile_uid) {
return;
<?php
-
/*
* Name: frio
* Description: Bootstrap V3 theme. The theme is currently under construction, so it is far from finished. For further information have a look at the <a href="https://github.com/friendica/friendica/tree/develop/view/theme/frio/README.md">ReadMe</a>.
* Author: Rabuzarus <https://friendica.kommune4.de/profile/rabuzarus>
*
*/
-
use Friendica\App;
+use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
$total = $r[0]["total"];
}
- $sql_extra3 = unavailable_networks();
+ $sql_extra3 = Widget::unavailableNetworks();
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `pending` $sql_extra $sql_extra3 ORDER BY `name` ASC LIMIT 100 ",
intval($_SESSION['uid'])