]> git.mxchange.org Git - friendica.git/blobdiff - mod/photos.php
Merge remote-tracking branch 'friendica/stable' into develop
[friendica.git] / mod / photos.php
index 65e8651b20f514a87c37fa6b4e17efae20297365..3b2fa0c3a8d80c40a8024253735248e1a168f674 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\Content\Nav;
 use Friendica\Content\Pager;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\ACL;
+use Friendica\Core\Addon;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
@@ -1038,7 +1039,6 @@ function photos_content(App $a)
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'post',
                                '$message' => DI::l10n()->t('Do you really want to delete this photo album and all its photos?'),
-                               '$extra_inputs' => [],
                                '$confirm' => DI::l10n()->t('Delete Album'),
                                '$confirm_url' => $drop_url,
                                '$confirm_name' => 'dropalbum',
@@ -1145,7 +1145,6 @@ function photos_content(App $a)
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'post',
                                '$message' => DI::l10n()->t('Do you really want to delete this photo?'),
-                               '$extra_inputs' => [],
                                '$confirm' => DI::l10n()->t('Delete Photo'),
                                '$confirm_url' => $drop_url,
                                '$confirm_name' => 'delete',
@@ -1378,6 +1377,16 @@ function photos_content(App $a)
 
                        if (!DBA::isResult($items)) {
                                if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+                                       /*
+                                        * Hmmm, code depending on the presence of a particular addon?
+                                        * This should be better if done by a hook
+                                        */
+                                       $qcomment = null;
+                                       if (Addon::isEnabled('qcomment')) {
+                                               $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+                                               $qcomment = $words ? explode("\n", $words) : [];
+                                       }
+
                                        $comments .= Renderer::replaceMacros($cmnt_tpl, [
                                                '$return_path' => '',
                                                '$jsreload' => $return_path,
@@ -1392,7 +1401,7 @@ function photos_content(App $a)
                                                '$preview' => DI::l10n()->t('Preview'),
                                                '$loading' => DI::l10n()->t('Loading...'),
                                                '$sourceapp' => DI::l10n()->t($a->sourcename),
-                                               '$ww' => '',
+                                               '$qcomment' => $qcomment,
                                                '$rand_num' => Crypto::randomDigits(12)
                                        ]);
                                }
@@ -1425,6 +1434,16 @@ function photos_content(App $a)
                                }
 
                                if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+                                       /*
+                                        * Hmmm, code depending on the presence of a particular addon?
+                                        * This should be better if done by a hook
+                                        */
+                                       $qcomment = null;
+                                       if (Addon::isEnabled('qcomment')) {
+                                               $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+                                               $qcomment = $words ? explode("\n", $words) : [];
+                                       }
+
                                        $comments .= Renderer::replaceMacros($cmnt_tpl,[
                                                '$return_path' => '',
                                                '$jsreload' => $return_path,
@@ -1438,7 +1457,7 @@ function photos_content(App $a)
                                                '$submit' => DI::l10n()->t('Submit'),
                                                '$preview' => DI::l10n()->t('Preview'),
                                                '$sourceapp' => DI::l10n()->t($a->sourcename),
-                                               '$ww' => '',
+                                               '$qcomment' => $qcomment,
                                                '$rand_num' => Crypto::randomDigits(12)
                                        ]);
                                }
@@ -1488,6 +1507,16 @@ function photos_content(App $a)
                                        ]);
 
                                        if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+                                               /*
+                                                * Hmmm, code depending on the presence of a particular addon?
+                                                * This should be better if done by a hook
+                                                */
+                                               $qcomment = null;
+                                               if (Addon::isEnabled('qcomment')) {
+                                                       $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+                                                       $qcomment = $words ? explode("\n", $words) : [];
+                                               }
+
                                                $comments .= Renderer::replaceMacros($cmnt_tpl, [
                                                        '$return_path' => '',
                                                        '$jsreload' => $return_path,
@@ -1501,7 +1530,7 @@ function photos_content(App $a)
                                                        '$submit' => DI::l10n()->t('Submit'),
                                                        '$preview' => DI::l10n()->t('Preview'),
                                                        '$sourceapp' => DI::l10n()->t($a->sourcename),
-                                                       '$ww' => '',
+                                                       '$qcomment' => $qcomment,
                                                        '$rand_num' => Crypto::randomDigits(12)
                                                ]);
                                        }