]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile_photo.php
Merge pull request #4243 from MrPetovan/task/switch-to-array-new-style
[friendica.git] / mod / profile_photo.php
index 5b75e654dff95a08a635533f18cf91a30793bc19..f52015155d689646a9acafcca66da18a93ac36f4 100644 (file)
@@ -8,15 +8,16 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 use Friendica\Model\Photo;
+use Friendica\Model\Profile;
 use Friendica\Object\Image;
 
-function profile_photo_init(App $a) {
-
+function profile_photo_init(App $a)
+{
        if (! local_user()) {
                return;
        }
 
-       profile_load($a,$a->user['nickname']);
+       Profile::load($a, $a->user['nickname']);
 }
 
 function profile_photo_post(App $a) {
@@ -253,7 +254,7 @@ function profile_photo_content(App $a) {
 
                $tpl = get_markup_template('profile_photo.tpl');
 
-               $o .= replace_macros($tpl,array(
+               $o .= replace_macros($tpl,[
                        '$user' => $a->user['nickname'],
                        '$lbl_upfile' => t('Upload File:'),
                        '$lbl_profiles' => t('Select a profile:'),
@@ -262,7 +263,7 @@ function profile_photo_content(App $a) {
                        '$profiles' => $profiles,
                        '$form_security_token' => get_form_security_token("profile_photo"),
                        '$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . System::baseUrl() . '">' . t('skip this step') . '</a>' : '<a href="'. System::baseUrl() . '/photos/' . $a->user['nickname'] . '">' . t('select a photo from your photo albums') . '</a>')
-               ));
+               ]);
 
                return $o;
        }
@@ -270,7 +271,7 @@ function profile_photo_content(App $a) {
                $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext'];
                $resolution = $a->config['imagecrop_resolution'];
                $tpl = get_markup_template("cropbody.tpl");
-               $o .= replace_macros($tpl,array(
+               $o .= replace_macros($tpl,[
                        '$filename' => $filename,
                        '$profile' => intval($_REQUEST['profile']),
                        '$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],
@@ -279,7 +280,7 @@ function profile_photo_content(App $a) {
                        '$desc' => t('Please adjust the image cropping for optimum viewing.'),
                        '$form_security_token' => get_form_security_token("profile_photo"),
                        '$done' => t('Done Editing')
-               ));
+               ]);
                return $o;
        }
 
@@ -332,7 +333,7 @@ function profile_photo_crop_ui_head(App $a, Image $Image) {
        $a->config['imagecrop'] = $hash;
        $a->config['imagecrop_resolution'] = $smallest;
        $a->config['imagecrop_ext'] = $Image->getExt();
-       $a->page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), array());
-       $a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), array());
+       $a->page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), []);
+       $a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), []);
        return;
 }