]> git.mxchange.org Git - friendica.git/blobdiff - mod/directory.php
Use short form array syntax everywhere
[friendica.git] / mod / directory.php
index 269dc03d3524c1324934711e072b4404be17e193..59a3195b1b54d087fa7c35084b7e6b5fb3e03776 100644 (file)
@@ -1,21 +1,22 @@
 <?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']);
        }
@@ -46,7 +47,7 @@ function directory_content(App $a) {
        $gdirpath = '';
        $dirurl = Config::get('system','directory');
        if(strlen($dirurl)) {
-               $gdirpath = zrl($dirurl,true);
+               $gdirpath = Profile::zrl($dirurl,true);
        }
 
        if($search) {
@@ -143,18 +144,13 @@ function directory_content(App $a) {
 
                        $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,
@@ -162,7 +158,7 @@ function directory_content(App $a) {
                                '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'],
@@ -173,9 +169,9 @@ function directory_content(App $a) {
                                'about' => $about,
                                'photo_menu' => $photo_menu,
 
-                       );
+                       ];
 
-                       $arr = array('contact' => $rr, 'entry' => $entry);
+                       $arr = ['contact' => $rr, 'entry' => $entry];
 
                        call_hooks('directory_item', $arr);
 
@@ -191,7 +187,7 @@ function directory_content(App $a) {
 
                $tpl = get_markup_template('directory_header.tpl');
 
-               $o .= replace_macros($tpl, array(
+               $o .= replace_macros($tpl, [
                        '$search' => $search,
                        '$globaldir' => t('Global Directory'),
                        '$gdirpath' => $gdirpath,
@@ -202,7 +198,7 @@ function directory_content(App $a) {
                        '$title' => t('Site Directory'),
                        '$submit' => t('Find'),
                        '$paginate' => paginate($a),
-               ));
+               ]);
 
        }
        else