- This setting allows the New Post button to always open the Compose page instead of the modal by default
'$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),
]);
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;
/** @var IManagePersonalConfigValues */
private $pConfig;
- public function __construct(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 = [])
+ /** @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->ACLFormatter = $ACLFormatter;
$this->page = $page;
$this->pConfig = $pConfig;
+ $this->config = $config;
}
protected function post(array $request = [])
'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,
<div class="generic-page-wrapper">
<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}}" />-->*}}
'bg_image_option',
'login_bg_image',
'login_bg_color',
+ 'always_open_compose',
] as $field) {
if (isset($_POST['frio_' . $field])) {
DI::pConfig()->set(local_user(), 'frio', $field, $_POST['frio_' . $field]);
'bg_image_option',
'login_bg_image',
'login_bg_color',
+ 'always_open_compose',
] as $field) {
if (isset($_POST['frio_' . $field])) {
DI::config()->set('frio', $field, $_POST['frio_' . $field]);
'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);
'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);
'$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)) {
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");
{{* 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">
});
</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>