<?php
-
+/**
+ * @file mod/directory.php
+ */
use Friendica\App;
+use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Database\DBM;
-use Friendica\Object\Contact;
+use Friendica\Model\Contact;
+use Friendica\Model\Profile;
function directory_init(App $a) {
$a->set_pager_itemspage(60);
if(local_user()) {
- require_once('include/contact_widgets.php');
-
- $a->page['aside'] .= findpeople_widget();
+ $a->page['aside'] .= Widget::findPeople();
- $a->page['aside'] .= follow_widget();
- }
- else {
+ $a->page['aside'] .= Widget::follow();
+ } else {
unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']);
}
$gdirpath = '';
$dirurl = Config::get('system','directory');
if(strlen($dirurl)) {
- $gdirpath = zrl($dirurl,true);
+ $gdirpath = Profile::zrl($dirurl,true);
}
if($search) {
$about = ((x($profile,'about') == 1) ? t('About:') : False);
- if($a->theme['template_engine'] === 'internal') {
- $location_e = template_escape($location);
- }
- else {
- $location_e = $location;
- }
+ $location_e = $location;
- $photo_menu = array(
- 'profile' => array(t("View Profile"), zrl($profile_link))
- );
+ $photo_menu = [
+ 'profile' => [t("View Profile"), Profile::zrl($profile_link)]
+ ];
- $entry = array(
+ $entry = [
'id' => $rr['id'],
'url' => $profile_link,
'itemurl' => $itemurl,
'img_hover' => $rr['name'],
'name' => $rr['name'],
'details' => $details,
- 'account_type' => account_type($rr),
+ 'account_type' => Contact::getAccountType($rr),
'profile' => $profile,
'location' => $location_e,
'tags' => $rr['pub_keywords'],
'about' => $about,
'photo_menu' => $photo_menu,
- );
+ ];
- $arr = array('contact' => $rr, 'entry' => $entry);
+ $arr = ['contact' => $rr, 'entry' => $entry];
call_hooks('directory_item', $arr);
$tpl = get_markup_template('directory_header.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$search' => $search,
'$globaldir' => t('Global Directory'),
'$gdirpath' => $gdirpath,
'$title' => t('Site Directory'),
'$submit' => t('Find'),
'$paginate' => paginate($a),
- ));
+ ]);
}
else