]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #12002 from MrPetovan/task/11941-compose-setting
authorMichael Vogel <icarus@dabo.de>
Sun, 16 Oct 2022 21:50:37 +0000 (23:50 +0200)
committerGitHub <noreply@github.com>
Sun, 16 Oct 2022 21:50:37 +0000 (23:50 +0200)
[frio] Add new frio.always_open_compose setting

src/Content/Conversation.php
src/Module/Item/Compose.php
view/lang/C/messages.po
view/templates/item/compose.tpl
view/theme/frio/config.php
view/theme/frio/js/theme.js
view/theme/frio/templates/jot.tpl
view/theme/frio/templates/theme_settings.tpl

index 744e9ed18ff2bd0988e641229c502985f8bcbf4f..84f75cff326e607767821af7c83423c2299e9402 100644 (file)
@@ -328,7 +328,7 @@ class Conversation
                        $created_at = '';
                }
 
-               $tpl = Renderer::getMarkupTemplate("jot.tpl");
+               $tpl = Renderer::getMarkupTemplate('jot.tpl');
 
                $o .= Renderer::replaceMacros($tpl, [
                        '$new_post'            => $this->l10n->t('New Post'),
@@ -393,7 +393,8 @@ class Conversation
                        '$message' => $this->l10n->t('Message'),
                        '$browser' => $this->l10n->t('Browser'),
 
-                       '$compose_link_title' => $this->l10n->t('Open Compose page'),
+                       '$compose_link_title'  => $this->l10n->t('Open Compose page'),
+                       '$always_open_compose' => $this->pConfig->get(local_user(), 'frio', 'always_open_compose', false),
                ]);
 
 
index a3ca4296a2685d6fcffb83b2c7361a94c2556f3d..bd531d484b596d8becb3055e48596fff20e0082f 100644 (file)
 namespace Friendica\Module\Item;
 
 use DateTime;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Content\Feature;
 use Friendica\Core\ACL;
+use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\Hook;
+use Friendica\Core\L10n;
+use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
 use Friendica\Core\Theme;
 use Friendica\Database\DBA;
@@ -33,13 +37,44 @@ use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
 use Friendica\Model\User;
+use Friendica\Module\Response;
 use Friendica\Module\Security\Login;
+use Friendica\Navigation\SystemMessages;
 use Friendica\Network\HTTPException\NotImplementedException;
+use Friendica\Util\ACLFormatter;
 use Friendica\Util\Crypto;
+use Friendica\Util\Profiler;
 use Friendica\Util\Temporal;
+use Psr\Log\LoggerInterface;
 
 class Compose extends BaseModule
 {
+       /** @var SystemMessages */
+       private $systemMessages;
+
+       /** @var ACLFormatter */
+       private $ACLFormatter;
+
+       /** @var App\Page */
+       private $page;
+
+       /** @var IManagePersonalConfigValues */
+       private $pConfig;
+
+       /** @var IManageConfigValues */
+       private $config;
+
+       public function __construct(IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->systemMessages = $systemMessages;
+               $this->ACLFormatter   = $ACLFormatter;
+               $this->page           = $page;
+               $this->pConfig        = $pConfig;
+               $this->config         = $config;
+       }
+
        protected function post(array $request = [])
        {
                if (!empty($_REQUEST['body'])) {
@@ -47,23 +82,22 @@ class Compose extends BaseModule
                        require_once 'mod/item.php';
                        item_post(DI::app());
                } else {
-                       notice(DI::l10n()->t('Please enter a post body.'));
+                       $this->systemMessages->addNotice($this->l10n->t('Please enter a post body.'));
                }
        }
 
        protected function content(array $request = []): string
        {
                if (!local_user()) {
-                       return Login::form('compose', false);
+                       return Login::form('compose');
                }
 
                $a = DI::app();
 
                if ($a->getCurrentTheme() !== 'frio') {
-                       throw new NotImplementedException(DI::l10n()->t('This feature is only available with the frio theme.'));
+                       throw new NotImplementedException($this->l10n->t('This feature is only available with the frio theme.'));
                }
 
-               /// @TODO Retrieve parameter from router
                $posttype = $this->parameters['type'] ?? Item::PT_ARTICLE;
                if (!in_array($posttype, [Item::PT_ARTICLE, Item::PT_PERSONAL_NOTE])) {
                        switch ($posttype) {
@@ -78,16 +112,14 @@ class Compose extends BaseModule
 
                $user = User::getById(local_user(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'default-location']);
 
-               $aclFormatter = DI::aclFormatter();
-
-               $contact_allow_list = $aclFormatter->expand($user['allow_cid']);
-               $group_allow_list   = $aclFormatter->expand($user['allow_gid']);
-               $contact_deny_list  = $aclFormatter->expand($user['deny_cid']);
-               $group_deny_list    = $aclFormatter->expand($user['deny_gid']);
+               $contact_allow_list = $this->ACLFormatter->expand($user['allow_cid']);
+               $group_allow_list   = $this->ACLFormatter->expand($user['allow_gid']);
+               $contact_deny_list  = $this->ACLFormatter->expand($user['deny_cid']);
+               $group_deny_list    = $this->ACLFormatter->expand($user['deny_gid']);
 
                switch ($posttype) {
                        case Item::PT_PERSONAL_NOTE:
-                               $compose_title = DI::l10n()->t('Compose new personal note');
+                               $compose_title = $this->l10n->t('Compose new personal note');
                                $type = 'note';
                                $doesFederate = false;
                                $contact_allow_list = [$a->getContactId()];
@@ -96,7 +128,7 @@ class Compose extends BaseModule
                                $group_deny_list = [];
                                break;
                        default:
-                               $compose_title = DI::l10n()->t('Compose new post');
+                               $compose_title = $this->l10n->t('Compose new post');
                                $type = 'post';
                                $doesFederate = true;
 
@@ -129,13 +161,13 @@ class Compose extends BaseModule
                Hook::callAll('jot_tool', $jotplugins);
 
                // Output
-               DI::page()->registerFooterScript(Theme::getPathForFile('js/ajaxupload.js'));
-               DI::page()->registerFooterScript(Theme::getPathForFile('js/linkPreview.js'));
-               DI::page()->registerFooterScript(Theme::getPathForFile('js/compose.js'));
+               $this->page->registerFooterScript(Theme::getPathForFile('js/ajaxupload.js'));
+               $this->page->registerFooterScript(Theme::getPathForFile('js/linkPreview.js'));
+               $this->page->registerFooterScript(Theme::getPathForFile('js/compose.js'));
 
                $contact = Contact::getById($a->getContactId());
 
-               if (DI::config()->get(local_user(), 'system', 'set_creation_date')) {
+               if ($this->pConfig->get(local_user(), 'system', 'set_creation_date')) {
                        $created_at = Temporal::getDateTimeField(
                                new \DateTime(DBA::NULL_DATETIME),
                                new \DateTime('now'),
@@ -149,39 +181,45 @@ class Compose extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate('item/compose.tpl');
                return Renderer::replaceMacros($tpl, [
-                       '$compose_title'=> $compose_title,
-                       '$visibility_title'=> DI::l10n()->t('Visibility'),
+                       '$l10n' => [
+                               'compose_title'        => $compose_title,
+                               'default'              => '',
+                               'visibility_title'     => $this->l10n->t('Visibility'),
+                               'mytitle'              => $this->l10n->t('This is you'),
+                               'submit'               => $this->l10n->t('Submit'),
+                               'edbold'               => $this->l10n->t('Bold'),
+                               'editalic'             => $this->l10n->t('Italic'),
+                               'eduline'              => $this->l10n->t('Underline'),
+                               'edquote'              => $this->l10n->t('Quote'),
+                               'edcode'               => $this->l10n->t('Code'),
+                               'edimg'                => $this->l10n->t('Image'),
+                               'edurl'                => $this->l10n->t('Link'),
+                               'edattach'             => $this->l10n->t('Link or Media'),
+                               'prompttext'           => $this->l10n->t('Please enter a image/video/audio/webpage URL:'),
+                               'preview'              => $this->l10n->t('Preview'),
+                               'location_set'         => $this->l10n->t('Set your location'),
+                               'location_clear'       => $this->l10n->t('Clear the location'),
+                               'location_unavailable' => $this->l10n->t('Location services are unavailable on your device'),
+                               'location_disabled'    => $this->l10n->t('Location services are disabled. Please check the website\'s permissions on your device'),
+                               'wait'                 => $this->l10n->t('Please wait'),
+                               'placeholdertitle'     => $this->l10n->t('Set title'),
+                               'placeholdercategory'  => Feature::isEnabled(local_user(),'categories') ? $this->l10n->t('Categories (comma-separated list)') : '',
+                               'always_open_compose'  => $this->pConfig->get(local_user(), 'frio', 'always_open_compose',
+                                       $this->config->get('frio', 'always_open_compose', false)) ? '' :
+                                               $this->l10n->t('You can make this page always open when you use the New Post button in the <a href="/settings/display">Theme Customization settings</a>.'),
+                       ],
+
                        '$id'           => 0,
                        '$posttype'     => $posttype,
                        '$type'         => $type,
                        '$wall'         => $wall,
-                       '$default'      => '',
-                       '$mylink'       => DI::baseUrl()->remove($contact['url']),
-                       '$mytitle'      => DI::l10n()->t('This is you'),
-                       '$myphoto'      => DI::baseUrl()->remove($contact['thumb']),
-                       '$submit'       => DI::l10n()->t('Submit'),
-                       '$edbold'       => DI::l10n()->t('Bold'),
-                       '$editalic'     => DI::l10n()->t('Italic'),
-                       '$eduline'      => DI::l10n()->t('Underline'),
-                       '$edquote'      => DI::l10n()->t('Quote'),
-                       '$edcode'       => DI::l10n()->t('Code'),
-                       '$edimg'        => DI::l10n()->t('Image'),
-                       '$edurl'        => DI::l10n()->t('Link'),
-                       '$edattach'     => DI::l10n()->t('Link or Media'),
-                       '$prompttext'   => DI::l10n()->t('Please enter a image/video/audio/webpage URL:'),
-                       '$preview'      => DI::l10n()->t('Preview'),
-                       '$location_set' => DI::l10n()->t('Set your location'),
-                       '$location_clear' => DI::l10n()->t('Clear the location'),
-                       '$location_unavailable' => DI::l10n()->t('Location services are unavailable on your device'),
-                       '$location_disabled' => DI::l10n()->t('Location services are disabled. Please check the website\'s permissions on your device'),
-                       '$wait'         => DI::l10n()->t('Please wait'),
-                       '$placeholdertitle' => DI::l10n()->t('Set title'),
-                       '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t('Categories (comma-separated list)') : ''),
+                       '$mylink'       => $this->baseUrl->remove($contact['url']),
+                       '$myphoto'      => $this->baseUrl->remove($contact['thumb']),
                        '$scheduled_at' => Temporal::getDateTimeField(
                                new DateTime(),
                                new DateTime('now + 6 months'),
                                null,
-                               DI::l10n()->t('Scheduled at'),
+                               $this->l10n->t('Scheduled at'),
                                'scheduled_at'
                        ),
                        '$created_at'   => $created_at,
@@ -197,7 +235,7 @@ class Compose extends BaseModule
 
                        '$jotplugins'   => $jotplugins,
                        '$rand_num'     => Crypto::randomDigits(12),
-                       '$acl_selector'  => ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), $doesFederate, [
+                       '$acl_selector'  => ACL::getFullSelectorHTML($this->page, $a->getLoggedInUserId(), $doesFederate, [
                                'allow_cid' => $contact_allow_list,
                                'allow_gid' => $group_allow_list,
                                'deny_cid'  => $contact_deny_list,
index 1552d9cf3ab05d4ad3cb9a6ba7b0c7e145adb7e9..eed5286895078ca51124194cbb47c57da9c3090a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 2022.12-dev\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-10-14 22:46+0000\n"
+"POT-Creation-Date: 2022-10-16 12:38-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -212,7 +212,7 @@ msgid "audio link"
 msgstr ""
 
 #: mod/editpost.php:103 src/Content/Conversation.php:352
-#: src/Module/Item/Compose.php:173
+#: src/Module/Item/Compose.php:200
 msgid "Set your location"
 msgstr ""
 
@@ -230,7 +230,7 @@ msgstr ""
 
 #: mod/editpost.php:107 mod/message.php:200 mod/message.php:358
 #: mod/photos.php:1489 mod/wallmessage.php:142 src/Content/Conversation.php:368
-#: src/Content/Conversation.php:713 src/Module/Item/Compose.php:177
+#: src/Content/Conversation.php:714 src/Module/Item/Compose.php:204
 #: src/Object/Post.php:538
 msgid "Please wait"
 msgstr ""
@@ -248,12 +248,12 @@ msgid "Public post"
 msgstr ""
 
 #: mod/editpost.php:120 src/Content/Conversation.php:357
-#: src/Module/Item/Compose.php:178
+#: src/Module/Item/Compose.php:205
 msgid "Set title"
 msgstr ""
 
 #: mod/editpost.php:122 src/Content/Conversation.php:359
-#: src/Module/Item/Compose.php:179
+#: src/Module/Item/Compose.php:206
 msgid "Categories (comma-separated list)"
 msgstr ""
 
@@ -263,7 +263,7 @@ msgstr ""
 
 #: mod/editpost.php:128 mod/events.php:513 mod/photos.php:1337
 #: mod/photos.php:1393 mod/photos.php:1467 src/Content/Conversation.php:383
-#: src/Module/Item/Compose.php:172 src/Object/Post.php:1003
+#: src/Module/Item/Compose.php:199 src/Object/Post.php:1003
 msgid "Preview"
 msgstr ""
 
@@ -276,37 +276,37 @@ msgid "Cancel"
 msgstr ""
 
 #: mod/editpost.php:134 src/Content/Conversation.php:343
-#: src/Module/Item/Compose.php:163 src/Object/Post.php:994
+#: src/Module/Item/Compose.php:190 src/Object/Post.php:994
 msgid "Bold"
 msgstr ""
 
 #: mod/editpost.php:135 src/Content/Conversation.php:344
-#: src/Module/Item/Compose.php:164 src/Object/Post.php:995
+#: src/Module/Item/Compose.php:191 src/Object/Post.php:995
 msgid "Italic"
 msgstr ""
 
 #: mod/editpost.php:136 src/Content/Conversation.php:345
-#: src/Module/Item/Compose.php:165 src/Object/Post.php:996
+#: src/Module/Item/Compose.php:192 src/Object/Post.php:996
 msgid "Underline"
 msgstr ""
 
 #: mod/editpost.php:137 src/Content/Conversation.php:346
-#: src/Module/Item/Compose.php:166 src/Object/Post.php:997
+#: src/Module/Item/Compose.php:193 src/Object/Post.php:997
 msgid "Quote"
 msgstr ""
 
 #: mod/editpost.php:138 src/Content/Conversation.php:347
-#: src/Module/Item/Compose.php:167 src/Object/Post.php:998
+#: src/Module/Item/Compose.php:194 src/Object/Post.php:998
 msgid "Code"
 msgstr ""
 
 #: mod/editpost.php:139 src/Content/Conversation.php:349
-#: src/Module/Item/Compose.php:169 src/Object/Post.php:1000
+#: src/Module/Item/Compose.php:196 src/Object/Post.php:1000
 msgid "Link"
 msgstr ""
 
 #: mod/editpost.php:140 src/Content/Conversation.php:350
-#: src/Module/Item/Compose.php:170 src/Object/Post.php:1001
+#: src/Module/Item/Compose.php:197 src/Object/Post.php:1001
 msgid "Link or Media"
 msgstr ""
 
@@ -415,9 +415,9 @@ msgstr ""
 #: src/Module/Delegation.php:148 src/Module/FriendSuggest.php:144
 #: src/Module/Install.php:252 src/Module/Install.php:294
 #: src/Module/Install.php:331 src/Module/Invite.php:178
-#: src/Module/Item/Compose.php:162 src/Module/Profile/Profile.php:247
+#: src/Module/Item/Compose.php:189 src/Module/Profile/Profile.php:247
 #: src/Module/Settings/Profile/Index.php:222 src/Object/Post.php:992
-#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160
+#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:171
 #: view/theme/quattro/config.php:71 view/theme/vier/config.php:119
 msgid "Submit"
 msgstr ""
@@ -1070,7 +1070,7 @@ msgid "Rotate CCW (left)"
 msgstr ""
 
 #: mod/photos.php:1333 mod/photos.php:1389 mod/photos.php:1463
-#: src/Module/Contact.php:547 src/Module/Item/Compose.php:160
+#: src/Module/Contact.php:547 src/Module/Item/Compose.php:188
 #: src/Object/Post.php:989
 msgid "This is you"
 msgstr ""
@@ -1080,11 +1080,11 @@ msgstr ""
 msgid "Comment"
 msgstr ""
 
-#: mod/photos.php:1424 src/Content/Conversation.php:629 src/Object/Post.php:256
+#: mod/photos.php:1424 src/Content/Conversation.php:630 src/Object/Post.php:256
 msgid "Select"
 msgstr ""
 
-#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:630
+#: mod/photos.php:1425 mod/settings.php:350 src/Content/Conversation.php:631
 #: src/Module/Admin/Users/Active.php:139 src/Module/Admin/Users/Blocked.php:140
 #: src/Module/Admin/Users/Index.php:153
 msgid "Delete"
@@ -1947,7 +1947,7 @@ msgid "%s attends maybe."
 msgstr ""
 
 #: src/Content/Conversation.php:222 src/Content/Conversation.php:260
-#: src/Content/Conversation.php:873
+#: src/Content/Conversation.php:874
 #, php-format
 msgid "%s reshared this."
 msgstr ""
@@ -2020,7 +2020,7 @@ msgstr ""
 msgid "Visible to <strong>everybody</strong>"
 msgstr ""
 
-#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:171
+#: src/Content/Conversation.php:308 src/Module/Item/Compose.php:198
 #: src/Object/Post.php:1002
 msgid "Please enter a image/video/audio/webpage URL:"
 msgstr ""
@@ -2041,7 +2041,7 @@ msgstr ""
 msgid "Delete item(s)?"
 msgstr ""
 
-#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:143
+#: src/Content/Conversation.php:324 src/Module/Item/Compose.php:175
 msgid "Created at"
 msgstr ""
 
@@ -2053,7 +2053,7 @@ msgstr ""
 msgid "Share"
 msgstr ""
 
-#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:168
+#: src/Content/Conversation.php:348 src/Module/Item/Compose.php:195
 #: src/Object/Post.php:999
 msgid "Image"
 msgstr ""
@@ -2062,117 +2062,117 @@ msgstr ""
 msgid "Video"
 msgstr ""
 
-#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:184
+#: src/Content/Conversation.php:364 src/Module/Item/Compose.php:222
 msgid "Scheduled at"
 msgstr ""
 
-#: src/Content/Conversation.php:657 src/Object/Post.php:244
+#: src/Content/Conversation.php:658 src/Object/Post.php:244
 msgid "Pinned item"
 msgstr ""
 
-#: src/Content/Conversation.php:673 src/Object/Post.php:486
+#: src/Content/Conversation.php:674 src/Object/Post.php:486
 #: src/Object/Post.php:487
 #, php-format
 msgid "View %s's profile @ %s"
 msgstr ""
 
-#: src/Content/Conversation.php:686 src/Object/Post.php:474
+#: src/Content/Conversation.php:687 src/Object/Post.php:474
 msgid "Categories:"
 msgstr ""
 
-#: src/Content/Conversation.php:687 src/Object/Post.php:475
+#: src/Content/Conversation.php:688 src/Object/Post.php:475
 msgid "Filed under:"
 msgstr ""
 
-#: src/Content/Conversation.php:695 src/Object/Post.php:500
+#: src/Content/Conversation.php:696 src/Object/Post.php:500
 #, php-format
 msgid "%s from %s"
 msgstr ""
 
-#: src/Content/Conversation.php:711
+#: src/Content/Conversation.php:712
 msgid "View in context"
 msgstr ""
 
-#: src/Content/Conversation.php:776
+#: src/Content/Conversation.php:777
 msgid "remove"
 msgstr ""
 
-#: src/Content/Conversation.php:780
+#: src/Content/Conversation.php:781
 msgid "Delete Selected Items"
 msgstr ""
 
-#: src/Content/Conversation.php:845 src/Content/Conversation.php:848
-#: src/Content/Conversation.php:851 src/Content/Conversation.php:854
+#: src/Content/Conversation.php:846 src/Content/Conversation.php:849
+#: src/Content/Conversation.php:852 src/Content/Conversation.php:855
 #, php-format
 msgid "You had been addressed (%s)."
 msgstr ""
 
-#: src/Content/Conversation.php:857
+#: src/Content/Conversation.php:858
 #, php-format
 msgid "You are following %s."
 msgstr ""
 
-#: src/Content/Conversation.php:860
+#: src/Content/Conversation.php:861
 msgid "You subscribed to one or more tags in this post."
 msgstr ""
 
-#: src/Content/Conversation.php:875
+#: src/Content/Conversation.php:876
 msgid "Reshared"
 msgstr ""
 
-#: src/Content/Conversation.php:875
+#: src/Content/Conversation.php:876
 #, php-format
 msgid "Reshared by %s <%s>"
 msgstr ""
 
-#: src/Content/Conversation.php:878
+#: src/Content/Conversation.php:879
 #, php-format
 msgid "%s is participating in this thread."
 msgstr ""
 
-#: src/Content/Conversation.php:881
+#: src/Content/Conversation.php:882
 msgid "Stored for general reasons"
 msgstr ""
 
-#: src/Content/Conversation.php:884
+#: src/Content/Conversation.php:885
 msgid "Global post"
 msgstr ""
 
-#: src/Content/Conversation.php:887
+#: src/Content/Conversation.php:888
 msgid "Sent via an relay server"
 msgstr ""
 
-#: src/Content/Conversation.php:887
+#: src/Content/Conversation.php:888
 #, php-format
 msgid "Sent via the relay server %s <%s>"
 msgstr ""
 
-#: src/Content/Conversation.php:890
+#: src/Content/Conversation.php:891
 msgid "Fetched"
 msgstr ""
 
-#: src/Content/Conversation.php:890
+#: src/Content/Conversation.php:891
 #, php-format
 msgid "Fetched because of %s <%s>"
 msgstr ""
 
-#: src/Content/Conversation.php:893
+#: src/Content/Conversation.php:894
 msgid "Stored because of a child post to complete this thread."
 msgstr ""
 
-#: src/Content/Conversation.php:896
+#: src/Content/Conversation.php:897
 msgid "Local delivery"
 msgstr ""
 
-#: src/Content/Conversation.php:899
+#: src/Content/Conversation.php:900
 msgid "Stored because of your activity (like, comment, star, ...)"
 msgstr ""
 
-#: src/Content/Conversation.php:902
+#: src/Content/Conversation.php:903
 msgid "Distributed"
 msgstr ""
 
-#: src/Content/Conversation.php:905
+#: src/Content/Conversation.php:906
 msgid "Pushed to us"
 msgstr ""
 
@@ -2628,39 +2628,39 @@ msgstr ""
 msgid "last"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1867
-#: src/Content/Text/BBCode.php:1868
+#: src/Content/Text/BBCode.php:1002 src/Content/Text/BBCode.php:1883
+#: src/Content/Text/BBCode.php:1884
 msgid "Image/photo"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1222
+#: src/Content/Text/BBCode.php:1238
 #, php-format
 msgid ""
 "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1247 src/Model/Item.php:3429
+#: src/Content/Text/BBCode.php:1263 src/Model/Item.php:3429
 #: src/Model/Item.php:3435 src/Model/Item.php:3436
 msgid "Link to source"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1785 src/Content/Text/HTML.php:940
+#: src/Content/Text/BBCode.php:1801 src/Content/Text/HTML.php:940
 msgid "Click to open/close"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1816
+#: src/Content/Text/BBCode.php:1832
 msgid "$1 wrote:"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1872 src/Content/Text/BBCode.php:1873
+#: src/Content/Text/BBCode.php:1888 src/Content/Text/BBCode.php:1889
 msgid "Encrypted content"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:2093
+#: src/Content/Text/BBCode.php:2109
 msgid "Invalid source protocol"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:2108
+#: src/Content/Text/BBCode.php:2124
 msgid "Invalid link protocol"
 msgstr ""
 
@@ -8094,40 +8094,46 @@ msgid ""
 "important, please visit http://friendi.ca"
 msgstr ""
 
-#: src/Module/Item/Compose.php:50
+#: src/Module/Item/Compose.php:85
 msgid "Please enter a post body."
 msgstr ""
 
-#: src/Module/Item/Compose.php:63
+#: src/Module/Item/Compose.php:98
 msgid "This feature is only available with the frio theme."
 msgstr ""
 
-#: src/Module/Item/Compose.php:90
+#: src/Module/Item/Compose.php:122
 msgid "Compose new personal note"
 msgstr ""
 
-#: src/Module/Item/Compose.php:99
+#: src/Module/Item/Compose.php:131
 msgid "Compose new post"
 msgstr ""
 
-#: src/Module/Item/Compose.php:153
+#: src/Module/Item/Compose.php:187
 msgid "Visibility"
 msgstr ""
 
-#: src/Module/Item/Compose.php:174
+#: src/Module/Item/Compose.php:201
 msgid "Clear the location"
 msgstr ""
 
-#: src/Module/Item/Compose.php:175
+#: src/Module/Item/Compose.php:202
 msgid "Location services are unavailable on your device"
 msgstr ""
 
-#: src/Module/Item/Compose.php:176
+#: src/Module/Item/Compose.php:203
 msgid ""
 "Location services are disabled. Please check the website's permissions on "
 "your device"
 msgstr ""
 
+#: src/Module/Item/Compose.php:209
+msgid ""
+"You can make this page always open when you use the New Post button in the "
+"<a href=\"/settings/display\">Theme Customization settings</a>."
+msgstr ""
+
 #: src/Module/Item/Follow.php:52
 msgid "Unable to follow this item."
 msgstr ""
@@ -9456,7 +9462,7 @@ msgid "Content Settings"
 msgstr ""
 
 #: src/Module/Settings/Display.php:205 view/theme/duepuntozero/config.php:70
-#: view/theme/frio/config.php:161 view/theme/quattro/config.php:72
+#: view/theme/frio/config.php:172 view/theme/quattro/config.php:72
 #: view/theme/vier/config.php:120
 msgid "Theme settings"
 msgstr ""
@@ -11119,113 +11125,124 @@ msgstr ""
 msgid "Variations"
 msgstr ""
 
-#: view/theme/frio/config.php:142
+#: view/theme/frio/config.php:153
 msgid "Light (Accented)"
 msgstr ""
 
-#: view/theme/frio/config.php:143
+#: view/theme/frio/config.php:154
 msgid "Dark (Accented)"
 msgstr ""
 
-#: view/theme/frio/config.php:144
+#: view/theme/frio/config.php:155
 msgid "Black (Accented)"
 msgstr ""
 
-#: view/theme/frio/config.php:156
+#: view/theme/frio/config.php:167
 msgid "Note"
 msgstr ""
 
-#: view/theme/frio/config.php:156
+#: view/theme/frio/config.php:167
 msgid "Check image permissions if all users are allowed to see the image"
 msgstr ""
 
-#: view/theme/frio/config.php:162
+#: view/theme/frio/config.php:173
 msgid "Custom"
 msgstr ""
 
-#: view/theme/frio/config.php:163
+#: view/theme/frio/config.php:174
 msgid "Legacy"
 msgstr ""
 
-#: view/theme/frio/config.php:164
+#: view/theme/frio/config.php:175
 msgid "Accented"
 msgstr ""
 
-#: view/theme/frio/config.php:165
+#: view/theme/frio/config.php:176
 msgid "Select color scheme"
 msgstr ""
 
-#: view/theme/frio/config.php:166
+#: view/theme/frio/config.php:177
 msgid "Select scheme accent"
 msgstr ""
 
-#: view/theme/frio/config.php:166
+#: view/theme/frio/config.php:177
 msgid "Blue"
 msgstr ""
 
-#: view/theme/frio/config.php:166
+#: view/theme/frio/config.php:177
 msgid "Red"
 msgstr ""
 
-#: view/theme/frio/config.php:166
+#: view/theme/frio/config.php:177
 msgid "Purple"
 msgstr ""
 
-#: view/theme/frio/config.php:166
+#: view/theme/frio/config.php:177
 msgid "Green"
 msgstr ""
 
-#: view/theme/frio/config.php:166
+#: view/theme/frio/config.php:177
 msgid "Pink"
 msgstr ""
 
-#: view/theme/frio/config.php:167
+#: view/theme/frio/config.php:178
 msgid "Copy or paste schemestring"
 msgstr ""
 
-#: view/theme/frio/config.php:167
+#: view/theme/frio/config.php:178
 msgid ""
 "You can copy this string to share your theme with others. Pasting here "
 "applies the schemestring"
 msgstr ""
 
-#: view/theme/frio/config.php:168
+#: view/theme/frio/config.php:179
 msgid "Navigation bar background color"
 msgstr ""
 
-#: view/theme/frio/config.php:169
+#: view/theme/frio/config.php:180
 msgid "Navigation bar icon color "
 msgstr ""
 
-#: view/theme/frio/config.php:170
+#: view/theme/frio/config.php:181
 msgid "Link color"
 msgstr ""
 
-#: view/theme/frio/config.php:171
+#: view/theme/frio/config.php:182
 msgid "Set the background color"
 msgstr ""
 
-#: view/theme/frio/config.php:172
+#: view/theme/frio/config.php:183
 msgid "Content background opacity"
 msgstr ""
 
-#: view/theme/frio/config.php:173
+#: view/theme/frio/config.php:184
 msgid "Set the background image"
 msgstr ""
 
-#: view/theme/frio/config.php:174
+#: view/theme/frio/config.php:185
 msgid "Background image style"
 msgstr ""
 
-#: view/theme/frio/config.php:179
+#: view/theme/frio/config.php:188
+msgid "Always open Compose page"
+msgstr ""
+
+#: view/theme/frio/config.php:188
+msgid ""
+"The New Post button always open the <a href=\"/compose\">Compose page</a> "
+"instead of the modal form. When this is disabled, the Compose page can be "
+"accessed with a middle click on the link or from the modal."
+msgstr ""
+
+#: view/theme/frio/config.php:192
 msgid "Login page background image"
 msgstr ""
 
-#: view/theme/frio/config.php:183
+#: view/theme/frio/config.php:196
 msgid "Login page background color"
 msgstr ""
 
-#: view/theme/frio/config.php:183
+#: view/theme/frio/config.php:196
 msgid "Leave background image and color empty for theme defaults"
 msgstr ""
 
index cbab655d2c5fe66326200e329f23651baecd3b04..5583650e048c222b2470bc2fab2c6d159c2c39ae 100644 (file)
@@ -1,5 +1,8 @@
 <div class="generic-page-wrapper">
-       <h2>{{$compose_title}}</h2>
+       <h2>{{$l10n.compose_title}}</h2>
+    {{if $l10n.always_open_compose}}
+       <p>{{$l10n.always_open_compose nofilter}}</p>
+       {{/if}}
        <div id="profile-jot-wrapper">
                <form class="comment-edit-form" data-item-id="{{$id}}" id="comment-edit-form-{{$id}}" action="compose/{{$type}}" method="post">
                    {{*<!--<input type="hidden" name="return" value="{{$return_path}}" />-->*}}
                        <input type="hidden" name="wall" value="{{$wall}}" />
 
                        <div id="jot-title-wrap">
-                               <input type="text" name="title" id="jot-title" class="jothidden jotforms form-control" placeholder="{{$placeholdertitle}}" title="{{$placeholdertitle}}" value="{{$title}}" tabindex="1" dir="auto" />
+                               <input type="text" name="title" id="jot-title" class="jothidden jotforms form-control" placeholder="{{$l10n.placeholdertitle}}" title="{{$l10n.placeholdertitle}}" value="{{$title}}" tabindex="1" dir="auto" />
                        </div>
-                   {{if $placeholdercategory}}
+                   {{if $l10n.placeholdercategory}}
                                <div id="jot-category-wrap">
-                                       <input name="category" id="jot-category" class="jothidden jotforms form-control" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" tabindex="2" dir="auto" />
+                                       <input name="category" id="jot-category" class="jothidden jotforms form-control" type="text" placeholder="{{$l10n.placeholdercategory}}" title="{{$l10n.placeholdercategory}}" value="{{$category}}" tabindex="2" dir="auto" />
                                </div>
                    {{/if}}
 
                        <p class="comment-edit-bb-{{$id}} comment-icon-list">
                                <span>
-                                       <button type="button" class="btn btn-sm icon bb-img" aria-label="{{$edimg}}" title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}" tabindex="7">
+                                       <button type="button" class="btn btn-sm icon bb-img" aria-label="{{$l10n.edimg}}" title="{{$l10n.edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}" tabindex="7">
                                                <i class="fa fa-picture-o"></i>
                                        </button>
-                                       <button type="button" class="btn btn-sm icon bb-attach" aria-label="{{$edattach}}" title="{{$edattach}}" ondragenter="return commentLinkDrop(event, {{$id}});" ondragover="return commentLinkDrop(event, {{$id}});" ondrop="commentLinkDropper(event);" onclick="commentGetLink({{$id}}, '{{$prompttext}}');" tabindex="8">
+                                       <button type="button" class="btn btn-sm icon bb-attach" aria-label="{{$l10n.edattach}}" title="{{$l10n.edattach}}" ondragenter="return commentLinkDrop(event, {{$id}});" ondragover="return commentLinkDrop(event, {{$id}});" ondrop="commentLinkDropper(event);" onclick="commentGetLink({{$id}}, '{{$l10n.prompttext}}');" tabindex="8">
                                                <i class="fa fa-paperclip"></i>
                                        </button>
                                </span>
                                <span>
-                                       <button type="button" class="btn btn-sm icon bb-url" aria-label="{{$edurl}}" title="{{$edurl}}" onclick="insertFormatting('url',{{$id}});" tabindex="9">
+                                       <button type="button" class="btn btn-sm icon bb-url" aria-label="{{$l10n.edurl}}" title="{{$l10n.edurl}}" onclick="insertFormatting('url',{{$id}});" tabindex="9">
                                                <i class="fa fa-link"></i>
                                        </button>
-                                       <button type="button" class="btn btn-sm icon underline" aria-label="{{$eduline}}" title="{{$eduline}}" onclick="insertFormatting('u',{{$id}});" tabindex="10">
+                                       <button type="button" class="btn btn-sm icon underline" aria-label="{{$l10n.eduline}}" title="{{$l10n.eduline}}" onclick="insertFormatting('u',{{$id}});" tabindex="10">
                                                <i class="fa fa-underline"></i>
                                        </button>
-                                       <button type="button" class="btn btn-sm icon italic" aria-label="{{$editalic}}" title="{{$editalic}}" onclick="insertFormatting('i',{{$id}});" tabindex="11">
+                                       <button type="button" class="btn btn-sm icon italic" aria-label="{{$l10n.editalic}}" title="{{$l10n.editalic}}" onclick="insertFormatting('i',{{$id}});" tabindex="11">
                                                <i class="fa fa-italic"></i>
                                        </button>
-                                       <button type="button" class="btn btn-sm icon bold" aria-label="{{$edbold}}" title="{{$edbold}}" onclick="insertFormatting('b',{{$id}});" tabindex="12">
+                                       <button type="button" class="btn btn-sm icon bold" aria-label="{{$l10n.edbold}}" title="{{$l10n.edbold}}" onclick="insertFormatting('b',{{$id}});" tabindex="12">
                                                <i class="fa fa-bold"></i>
                                        </button>
-                                       <button type="button" class="btn btn-sm icon quote" aria-label="{{$edquote}}" title="{{$edquote}}" onclick="insertFormatting('quote',{{$id}});" tabindex="13">
+                                       <button type="button" class="btn btn-sm icon quote" aria-label="{{$l10n.edquote}}" title="{{$l10n.edquote}}" onclick="insertFormatting('quote',{{$id}});" tabindex="13">
                                                <i class="fa fa-quote-left"></i>
                                        </button>
                                </span>
                        </p>
                        <p>
-                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text form-control text-autosize" name="body" placeholder="{{$default}}" rows="7" tabindex="3" dir="auto" dir="auto">{{$body}}</textarea>
+                               <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text form-control text-autosize" name="body" placeholder="{{$l10n.default}}" rows="7" tabindex="3" dir="auto" dir="auto">{{$body}}</textarea>
                        </p>
 
                        <p class="comment-edit-submit-wrapper">
 {{if $type == 'post'}}
                                <span role="presentation" class="form-inline">
-                                       <input type="text" name="location" class="form-control" id="jot-location" value="{{$location}}" placeholder="{{$location_set}}"/>
+                                       <input type="text" name="location" class="form-control" id="jot-location" value="{{$location}}" placeholder="{{$l10n.location_set}}"/>
                                        <button type="button" class="btn btn-sm icon" id="profile-location"
-                                               data-title-set="{{$location_set}}"
-                                               data-title-disabled="{{$location_disabled}}"
-                                               data-title-unavailable="{{$location_unavailable}}"
-                                               data-title-clear="{{$location_clear}}"
-                                               title="{{$location_set}}"
+                                               data-title-set="{{$l10n.location_set}}"
+                                               data-title-disabled="{{$l10n.location_disabled}}"
+                                               data-title-unavailable="{{$l10n.location_unavailable}}"
+                                               data-title-clear="{{$l10n.location_clear}}"
+                                               title="{{$l10n.location_set}}"
                                                tabindex="6">
                                                <i class="fa fa-map-marker" aria-hidden="true"></i>
                                        </button>
                                </span>
 {{/if}}
                                <span role="presentation" id="profile-rotator-wrapper">
-                                       <img role="presentation" id="profile-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
+                                       <img role="presentation" id="profile-rotator" src="images/rotator.gif" alt="{{$l10n.wait}}" title="{{$l10n.wait}}" style="display: none;" />
                                </span>
                                <span role="presentation" id="character-counter" class="grey text-info"></span>
-                       {{if $preview}}
-                                       <button type="button" class="btn btn-defaul btn-sm" onclick="preview_comment({{$id}});" id="comment-edit-preview-link-{{$id}}" tabindex="5"><i class="fa fa-eye"></i> {{$preview}}</button>
-                       {{/if}}
-                               <button type="submit" class="btn btn-primary btn-sm" id="comment-edit-submit-{{$id}}" name="submit" tabindex="4"><i class="fa fa-envelope"></i> {{$submit}}</button>
+                               <button type="button" class="btn btn-defaul btn-sm" onclick="preview_comment({{$id}});" id="comment-edit-preview-link-{{$id}}" tabindex="5"><i class="fa fa-eye"></i> {{$l10n.preview}}</button>
+                               <button type="submit" class="btn btn-primary btn-sm" id="comment-edit-submit-{{$id}}" name="submit" tabindex="4"><i class="fa fa-envelope"></i> {{$l10n.submit}}</button>
                        </p>
 
                        <div id="comment-edit-preview-{{$id}}" class="comment-edit-preview" style="display:none;"></div>
 
 {{if $type == 'post'}}
-                       <h3>{{$visibility_title}}</h3>
+                       <h3>{{$l10n.visibility_title}}</h3>
                        {{$acl_selector nofilter}}
 
                        <div class="jotplugins">
index 7445155f9d24f49a758ed32a9eb655d838f4514e..2dcf0020487a6f323e0ee833a8cba408ae861c60 100644 (file)
@@ -43,7 +43,8 @@ function theme_post(App $a)
                        'background_image',
                        'bg_image_option',
                        'login_bg_image',
-                       'login_bg_color'
+                       'login_bg_color',
+                       'always_open_compose',
                ] as $field) {
                        if (isset($_POST['frio_' . $field])) {
                                DI::pConfig()->set(local_user(), 'frio', $field, $_POST['frio_' . $field]);
@@ -73,7 +74,8 @@ function theme_admin_post(App $a)
                        'background_image',
                        'bg_image_option',
                        'login_bg_image',
-                       'login_bg_color'
+                       'login_bg_color',
+                       'always_open_compose',
                ] as $field) {
                        if (isset($_POST['frio_' . $field])) {
                                DI::config()->set('frio', $field, $_POST['frio_' . $field]);
@@ -84,48 +86,57 @@ function theme_admin_post(App $a)
        }
 }
 
-function theme_content(App $a)
+function theme_content(): string
 {
        if (!local_user()) {
-               return;
+               return '';
        }
-       $arr = [];
-
-       $node_scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'scheme'));
 
-       $arr['scheme']           = DI::pConfig()->get(local_user(), 'frio', 'scheme', DI::pConfig()->get(local_user(), 'frio', 'schema', $node_scheme));
-       $arr['scheme_accent']    = DI::pConfig()->get(local_user(), 'frio', 'scheme_accent'   , DI::config()->get('frio', 'scheme_accent'));
-       $arr['share_string']     = '';
-       $arr['nav_bg']           = DI::pConfig()->get(local_user(), 'frio', 'nav_bg'          , DI::config()->get('frio', 'nav_bg'));
-       $arr['nav_icon_color']   = DI::pConfig()->get(local_user(), 'frio', 'nav_icon_color'  , DI::config()->get('frio', 'nav_icon_color'));
-       $arr['link_color']       = DI::pConfig()->get(local_user(), 'frio', 'link_color'      , DI::config()->get('frio', 'link_color'));
-       $arr['background_color'] = DI::pConfig()->get(local_user(), 'frio', 'background_color', DI::config()->get('frio', 'background_color'));
-       $arr['contentbg_transp'] = DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp', DI::config()->get('frio', 'contentbg_transp'));
-       $arr['background_image'] = DI::pConfig()->get(local_user(), 'frio', 'background_image', DI::config()->get('frio', 'background_image'));
-       $arr['bg_image_option']  = DI::pConfig()->get(local_user(), 'frio', 'bg_image_option' , DI::config()->get('frio', 'bg_image_option'));
+       $arr = [
+               'scheme' => DI::pConfig()->get(local_user(), 'frio', 'scheme',
+                       DI::pConfig()->get(local_user(), 'frio', 'schema',
+                               DI::config()->get('frio', 'scheme',
+                                       DI::config()->get('frio', 'schema')
+                               )
+                       )
+               ),
+
+               'share_string'        => '',
+               'scheme_accent'       => DI::pConfig()->get(local_user(), 'frio', 'scheme_accent'      , DI::config()->get('frio', 'scheme_accent')),
+               'nav_bg'              => DI::pConfig()->get(local_user(), 'frio', 'nav_bg'             , DI::config()->get('frio', 'nav_bg')),
+               'nav_icon_color'      => DI::pConfig()->get(local_user(), 'frio', 'nav_icon_color'     , DI::config()->get('frio', 'nav_icon_color')),
+               'link_color'          => DI::pConfig()->get(local_user(), 'frio', 'link_color'         , DI::config()->get('frio', 'link_color')),
+               'background_color'    => DI::pConfig()->get(local_user(), 'frio', 'background_color'   , DI::config()->get('frio', 'background_color')),
+               'contentbg_transp'    => DI::pConfig()->get(local_user(), 'frio', 'contentbg_transp'   , DI::config()->get('frio', 'contentbg_transp')),
+               'background_image'    => DI::pConfig()->get(local_user(), 'frio', 'background_image'   , DI::config()->get('frio', 'background_image')),
+               'bg_image_option'     => DI::pConfig()->get(local_user(), 'frio', 'bg_image_option'    , DI::config()->get('frio', 'bg_image_option')),
+               'always_open_compose' => DI::pConfig()->get(local_user(), 'frio', 'always_open_compose', DI::config()->get('frio', 'always_open_compose', false)),
+       ];
 
        return frio_form($arr);
 }
 
-function theme_admin(App $a)
+function theme_admin(): string
 {
        if (!local_user()) {
-               return;
+               return '';
        }
-       $arr = [];
-
-       $arr['scheme']           = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema'));
-       $arr['scheme_accent']    = DI::config()->get('frio', 'scheme_accent');
-       $arr['share_string']     = '';
-       $arr['nav_bg']           = DI::config()->get('frio', 'nav_bg');
-       $arr['nav_icon_color']   = DI::config()->get('frio', 'nav_icon_color');
-       $arr['link_color']       = DI::config()->get('frio', 'link_color');
-       $arr['background_color'] = DI::config()->get('frio', 'background_color');
-       $arr['contentbg_transp'] = DI::config()->get('frio', 'contentbg_transp');
-       $arr['background_image'] = DI::config()->get('frio', 'background_image');
-       $arr['bg_image_option']  = DI::config()->get('frio', 'bg_image_option');
-       $arr['login_bg_image']   = DI::config()->get('frio', 'login_bg_image');
-       $arr['login_bg_color']   = DI::config()->get('frio', 'login_bg_color');
+
+       $arr = [
+               'scheme'              => DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')),
+               'scheme_accent'       => DI::config()->get('frio', 'scheme_accent'),
+               'share_string'        => '',
+               'nav_bg'              => DI::config()->get('frio', 'nav_bg'),
+               'nav_icon_color'      => DI::config()->get('frio', 'nav_icon_color'),
+               'link_color'          => DI::config()->get('frio', 'link_color'),
+               'background_color'    => DI::config()->get('frio', 'background_color'),
+               'contentbg_transp'    => DI::config()->get('frio', 'contentbg_transp'),
+               'background_image'    => DI::config()->get('frio', 'background_image'),
+               'bg_image_option'     => DI::config()->get('frio', 'bg_image_option'),
+               'login_bg_image'      => DI::config()->get('frio', 'login_bg_image'),
+               'login_bg_color'      => DI::config()->get('frio', 'login_bg_color'),
+               'always_open_compose' => DI::config()->get('frio', 'always_open_compose', false),
+       ];
 
        return frio_form($arr);
 }
@@ -173,6 +184,8 @@ function frio_form($arr)
                '$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', DI::l10n()->t('Set the background image'), $arr['background_image'], $background_image_help, false],
                '$bg_image_options_title' => DI::l10n()->t('Background image style'),
                '$bg_image_options' => Image::get_options($arr),
+
+               '$always_open_compose' => ['frio_always_open_compose', DI::l10n()->t('Always open Compose page'), $arr['always_open_compose'], DI::l10n()->t('The New Post button always open the <a href="/compose">Compose page</a> instead of the modal form. When this is disabled, the Compose page can be accessed with a middle click on the link or from the modal.')],
        ];
 
        if (array_key_exists('login_bg_image', $arr) && !array_key_exists('login_bg_image', $disable)) {
@@ -183,7 +196,5 @@ function frio_form($arr)
                $ctx['$login_bg_color'] = ['frio_login_bg_color', DI::l10n()->t('Login page background color'), $arr['login_bg_color'], DI::l10n()->t('Leave background image and color empty for theme defaults'), false];
        }
 
-       $o = Renderer::replaceMacros($t, $ctx);
-
-       return $o;
+       return Renderer::replaceMacros($t, $ctx);
 }
index edd7282f792e06bc5bae83e76f77292aceac3ea5..60aa88ba581bd23c73f20a496a19766c42303012 100644 (file)
@@ -87,10 +87,12 @@ $(document).ready(function () {
                if ($("#jot-popup").is(":hidden")) {
                        $jotButton.hide();
                }
-               $jotButton.on("click", function (e) {
-                       e.preventDefault();
-                       jotShow();
-               });
+               if ($jotButton.hasClass('modal-open')) {
+                       $jotButton.on("click", function (e) {
+                               e.preventDefault();
+                               jotShow();
+                       });
+               }
        }
 
        let $body = $("body");
index 0f878d4c53b6e2b2cecb7c05ce22c19703d8590d..c38e8531c6e7feeb2a4397404c7e640d676aba75 100644 (file)
@@ -1,5 +1,5 @@
 {{* The button to open the jot - in This theme we move the button with js to the second nav bar *}}
-<a class="btn btn-sm btn-primary pull-right" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o fa-2x"></i></a>
+<a class="btn btn-sm btn-primary pull-right{{if !$always_open_compose}} modal-open{{/if}}" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o fa-2x"></i></a>
 
 <div id="jot-content">
        <div id="jot-sections">
index 7dfc49719ad17dff0eab77fb8348bce0048ef8d5..3c3c9cc2e209b79d388a9d9cad42d10f1dd9f058 100644 (file)
        });
 </script>
 
+{{include file="field_checkbox.tpl" field=$always_open_compose}}
+
 <div class="settings-submit-wrapper pull-right">
        <button type="submit" value="{{$submit}}" class="settings-submit btn btn-primary" name="frio-settings-submit">{{$submit}}</button>
 </div>