]> git.mxchange.org Git - friendica.git/blobdiff - mod/photos.php
Many t() calls
[friendica.git] / mod / photos.php
index f399c3ae80a46f564cf54c7b51dc40f7d1dd2fde..076ee1f1d93b73c3b0aeb8fe611fed81909d34fe 100644 (file)
@@ -5,6 +5,8 @@
 use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Content\Nav;
+use Friendica\Core\Addon;
+use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Core\Config;
 use Friendica\Core\Worker;
@@ -166,7 +168,7 @@ function photos_post(App $a)
        }
 
        if (!$can_post) {
-               notice( t('Permission denied.') . EOL );
+               notice(L10n::t('Permission denied.') . EOL );
                killme();
        }
 
@@ -176,7 +178,7 @@ function photos_post(App $a)
        );
 
        if (!DBM::is_result($r)) {
-               notice( t('Contact information unavailable') . EOL);
+               notice(L10n::t('Contact information unavailable') . EOL);
                logger('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
                killme();
        }
@@ -196,7 +198,7 @@ function photos_post(App $a)
                        intval($page_owner_uid)
                );
                if (!DBM::is_result($r)) {
-                       notice( t('Album not found.') . EOL);
+                       notice(L10n::t('Album not found.') . EOL);
                        goaway($_SESSION['photo_return']);
                        return; // NOTREACHED
                }
@@ -510,7 +512,6 @@ function photos_post(App $a)
                        $arr['allow_gid']     = $p[0]['allow_gid'];
                        $arr['deny_cid']      = $p[0]['deny_cid'];
                        $arr['deny_gid']      = $p[0]['deny_gid'];
-                       $arr['last-child']    = 1;
                        $arr['visible']       = $visibility;
                        $arr['origin']        = 1;
 
@@ -687,7 +688,6 @@ function photos_post(App $a)
                                        $arr['allow_gid']     = $p[0]['allow_gid'];
                                        $arr['deny_cid']      = $p[0]['deny_cid'];
                                        $arr['deny_gid']      = $p[0]['deny_gid'];
-                                       $arr['last-child']    = 1;
                                        $arr['visible']       = 1;
                                        $arr['verb']          = ACTIVITY_TAG;
                                        $arr['object-type']   = ACTIVITY_OBJ_PERSON;
@@ -722,7 +722,7 @@ function photos_post(App $a)
 
 
        // default post action - upload a photo
-       call_hooks('photo_post_init', $_POST);
+       Addon::callHooks('photo_post_init', $_POST);
 
        // Determine the album to use
        $album    = x($_REQUEST, 'album') ? notags(trim($_REQUEST['album'])) : '';
@@ -772,7 +772,7 @@ function photos_post(App $a)
 
        $ret = ['src' => '', 'filename' => '', 'filesize' => 0, 'type' => ''];
 
-       call_hooks('photo_post_file', $ret);
+       Addon::callHooks('photo_post_file', $ret);
 
        if (x($ret, 'src') && x($ret, 'filesize')) {
                $src      = $ret['src'];
@@ -791,26 +791,26 @@ function photos_post(App $a)
        if ($error !== UPLOAD_ERR_OK) {
                switch ($error) {
                        case UPLOAD_ERR_INI_SIZE:
-                               notice(t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
+                               notice(L10n::t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
                                break;
                        case UPLOAD_ERR_FORM_SIZE:
-                               notice(t('Image exceeds size limit of %s', formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL);
+                               notice(L10n::t('Image exceeds size limit of %s', formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL);
                                break;
                        case UPLOAD_ERR_PARTIAL:
-                               notice(t('Image upload didn\'t complete, please try again') . EOL);
+                               notice(L10n::t('Image upload didn\'t complete, please try again') . EOL);
                                break;
                        case UPLOAD_ERR_NO_FILE:
-                               notice(t('Image file is missing') . EOL);
+                               notice(L10n::t('Image file is missing') . EOL);
                                break;
                        case UPLOAD_ERR_NO_TMP_DIR:
                        case UPLOAD_ERR_CANT_WRITE:
                        case UPLOAD_ERR_EXTENSION:
-                               notice(t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
+                               notice(L10n::t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
                                break;
                }
                @unlink($src);
                $foo = 0;
-               call_hooks('photo_post_end', $foo);
+               Addon::callHooks('photo_post_end', $foo);
                return;
        }
 
@@ -823,18 +823,18 @@ function photos_post(App $a)
        $maximagesize = Config::get('system', 'maximagesize');
 
        if ($maximagesize && ($filesize > $maximagesize)) {
-               notice(t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
+               notice(L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
                @unlink($src);
                $foo = 0;
-               call_hooks('photo_post_end', $foo);
+               Addon::callHooks('photo_post_end', $foo);
                return;
        }
 
        if (!$filesize) {
-               notice(t('Image file is empty.') . EOL);
+               notice(L10n::t('Image file is empty.') . EOL);
                @unlink($src);
                $foo = 0;
-               call_hooks('photo_post_end', $foo);
+               Addon::callHooks('photo_post_end', $foo);
                return;
        }
 
@@ -846,10 +846,10 @@ function photos_post(App $a)
 
        if (!$Image->isValid()) {
                logger('mod/photos.php: photos_post(): unable to process image' , LOGGER_DEBUG);
-               notice(t('Unable to process image.') . EOL);
+               notice(L10n::t('Unable to process image.') . EOL);
                @unlink($src);
                $foo = 0;
-               call_hooks('photo_post_end',$foo);
+               Addon::callHooks('photo_post_end',$foo);
                killme();
        }
 
@@ -875,7 +875,7 @@ function photos_post(App $a)
 
        if (!$r) {
                logger('mod/photos.php: photos_post(): image store failed' , LOGGER_DEBUG);
-               notice(t('Image upload failed.') . EOL);
+               notice(L10n::t('Image upload failed.') . EOL);
                killme();
        }
 
@@ -924,7 +924,6 @@ function photos_post(App $a)
        $arr['allow_gid']     = $str_group_allow;
        $arr['deny_cid']      = $str_contact_deny;
        $arr['deny_gid']      = $str_group_deny;
-       $arr['last-child']    = 1;
        $arr['visible']       = $visible;
        $arr['origin']        = 1;
 
@@ -940,7 +939,7 @@ function photos_post(App $a)
                Worker::add(PRIORITY_HIGH, "Notifier", 'wall-new', $item_id);
        }
 
-       call_hooks('photo_post_end', intval($item_id));
+       Addon::callHooks('photo_post_end', intval($item_id));
 
        // addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook
        // if they do not wish to be redirected
@@ -961,7 +960,7 @@ function photos_content(App $a)
        // photos/name/image/xxxxx/edit
 
        if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
-               notice( t('Public access denied.') . EOL);
+               notice(L10n::t('Public access denied.') . EOL);
                return;
        }
 
@@ -970,7 +969,7 @@ function photos_content(App $a)
        require_once 'include/conversation.php';
 
        if (!x($a->data,'user')) {
-               notice( t('No photos selected') . EOL );
+               notice(L10n::t('No photos selected') . EOL );
                return;
        }
 
@@ -1066,7 +1065,7 @@ function photos_content(App $a)
        }
 
        if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
-               notice( t('Access to this item is restricted.') . EOL);
+               notice(L10n::t('Access to this item is restricted.') . EOL);
                return;
        }
 
@@ -1081,7 +1080,7 @@ function photos_content(App $a)
        // Display upload form
        if ($datatype === 'upload') {
                if (!$can_post) {
-                       notice(t('Permission denied.'));
+                       notice(L10n::t('Permission denied.'));
                        return;
                }
 
@@ -1106,7 +1105,7 @@ function photos_content(App $a)
                                'addon_text' => $uploader,
                                'default_upload' => true];
 
-               call_hooks('photo_upload_form',$ret);
+               Addon::callHooks('photo_upload_form',$ret);
 
                $default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), []);
                $default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), [
@@ -1266,9 +1265,9 @@ function photos_content(App $a)
                                dbesc($datum)
                        );
                        if (DBM::is_result($ph)) {
-                               notice(t('Permission denied. Access to this item may be restricted.'));
+                               notice(L10n::t('Permission denied. Access to this item may be restricted.'));
                        } else {
-                               notice(t('Photo not available') . EOL );
+                               notice(L10n::t('Photo not available') . EOL );
                        }
                        return;
                }
@@ -1513,7 +1512,7 @@ function photos_content(App $a)
                        }
 
                        if (!DBM::is_result($r)) {
-                               if (($can_post || can_write_wall($owner_uid)) && $link_item['last-child']) {
+                               if (($can_post || can_write_wall($owner_uid))) {
                                        $comments .= replace_macros($cmnt_tpl, [
                                                '$return_path' => '',
                                                '$jsreload' => $return_url,
@@ -1552,7 +1551,7 @@ function photos_content(App $a)
                                        $dislike = format_like($conv_responses['dislike'][$link_item['uri']], $conv_responses['dislike'][$link_item['uri'] . '-l'], 'dislike', $link_item['id']);
                                }
 
-                               if (($can_post || can_write_wall($owner_uid)) && $link_item['last-child']) {
+                               if (($can_post || can_write_wall($owner_uid))) {
                                        $comments .= replace_macros($cmnt_tpl,[
                                                '$return_path' => '',
                                                '$jsreload' => $return_url,
@@ -1625,7 +1624,7 @@ function photos_content(App $a)
                                                '$comment' => $comment
                                        ]);
 
-                                       if (($can_post || can_write_wall($owner_uid)) && $item['last-child']) {
+                                       if (($can_post || can_write_wall($owner_uid))) {
                                                $comments .= replace_macros($cmnt_tpl, [
                                                        '$return_path' => '',
                                                        '$jsreload' => $return_url,