Replace obsolete calls to $APP->is_mobile in templates
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 23 Dec 2020 08:25:55 +0000 (03:25 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 23 Dec 2020 08:25:55 +0000 (03:25 -0500)
include/conversation.php
mod/editpost.php
src/Module/Notifications/Introductions.php
view/templates/jot-header.tpl
view/theme/frio/templates/notifications/intros.tpl

index c87c8cb..f681155 100644 (file)
@@ -1177,7 +1177,8 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                '$term'      => DI::l10n()->t('Tag term:'),
                '$fileas'    => DI::l10n()->t('Save to Folder:'),
                '$whereareu' => DI::l10n()->t('Where are you right now?'),
-               '$delitems'  => DI::l10n()->t("Delete item\x28s\x29?")
+               '$delitems'  => DI::l10n()->t("Delete item\x28s\x29?"),
+               '$is_mobile' => DI::mode()->isMobile(),
        ]);
 
        $jotplugins = '';
index 209fbcf..ff2d0f5 100644 (file)
@@ -66,7 +66,8 @@ function editpost_content(App $a)
        DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$ispublic' => '&nbsp;', // DI::l10n()->t('Visible to <strong>everybody</strong>'),
                '$geotag' => $geotag,
-               '$nickname' => $a->user['nickname']
+               '$nickname' => $a->user['nickname'],
+               '$is_mobile' => DI::mode()->isMobile(),
        ]);
 
        if (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])) {
index 2a8a6ef..ccd5963 100644 (file)
@@ -112,6 +112,7 @@ class Introductions extends BaseNotifications
                                                '$note'                  => $notification->getNote(),
                                                '$ignore'                => DI::l10n()->t('Ignore'),
                                                '$discard'               => DI::l10n()->t('Discard'),
+                                               '$is_mobile'             => DI::mode()->isMobile(),
                                        ]);
                                        break;
 
@@ -190,6 +191,7 @@ class Introductions extends BaseNotifications
                                                '$ignore'                => DI::l10n()->t('Ignore'),
                                                '$discard'               => $discard,
                                                '$action'                => $action,
+                                               '$is_mobile'              => DI::mode()->isMobile(),
                                        ]);
                                        break;
                        }
index aa00c5d..8f9d59d 100644 (file)
@@ -8,7 +8,7 @@ var textlen = 0;
 function initEditor(callback) {
        if (editor == false) {
                var  colorbox_options = {
-                       {{if $APP->is_mobile}}
+                       {{if $is_mobile}}
                        'width' : '100%',
                        'height' : '100%',
                        {{/if}}
index f460829..710cd4a 100644 (file)
                        <div class="intro-note intro-note-{{$intro_id}}">{{$note}}</div>
                </div>
 
+               {{* On mobile touch devices we use buttons for approve, ingnore && discard to have a better UX *}}
+               {{if $is_mobile}}
+               <div class="intro-action-buttons">
+                       <form class="intro-form pull-left" action="notification/{{$intro_id}}" method="post">
+                               <button class="btn btn-small btn-default intro-submit-ignore" type="submit" name="submit" value="{{$ignore}}">{{$ignore}}</button>
+                               {{if $discard}}<button class="btn btn-small btn-default intro-submit-discard" type="submit" name="submit" value="{{$discard}}">{{$discard}}</button>&nbsp;{{/if}}
+                       </form>
+                       <button class="btn btn-small btn-primary intro-submit-approve pull-right" onclick="addElmToModal('#intro-approve-wrapper-{{$intro_id}}')">{{$approve}}</button>
+               </div>
+               <div class="clear"></div>
+               {{else}}
                {{* The intro actions like approve, ignore, discard intro*}}
                <div class="intro-actions pull-right nav-pills preferences">
                        <button class="btn-link intro-action-link" onclick="addElmToModal('#intro-approve-wrapper-{{$intro_id}}');" aria-label="{{$approve}}" title="{{$approve}}" data-toggle="tooltip"><i class="fa fa-check" aria-hidden="true"></i></button>
@@ -45,6 +56,7 @@
                                {{if $discard}}<button class="btn-link intro-submit-discard intro-action-link" type="submit" name="submit" value="{{$discard}}" aria-label="{{$discard}}" title="{{$discard}}" data-toggle="tooltip"><i class="fa fa-trash-o" aria-hidden="true"></i></button>{{/if}}
                        </form>
                </div>
+               {{/if}}
 
                {{* This sections contains special settings for contact approval. We hide it by default and load this section in
                a bootstrap modal in the case of approval *}}
                        </form>
                </div>
        </div>
-
-       {{* On mobile touch devices we use buttons for approve, ingnore && discard to have a better UX *}}
-       {{if $APP->is_mobile}}
-       <div class="intro-action-buttons">
-               <form class="intro-form pull-left" action="notification/{{$intro_id}}" method="post">
-                       <button class="btn btn-small btn-default intro-submit-ignore" type="submit" name="submit" value="{{$ignore}}">{{$ignore}}</button>
-                       {{if $discard}}<button class="btn btn-small btn-default intro-submit-discard" type="submit" name="submit" value="{{$discard}}">{{$discard}}</button>&nbsp;{{/if}}
-               </form>
-               <button class="btn btn-small btn-primary intro-submit-approve pull-right" onclick="addElmToModal('#intro-approve-wrapper-{{$intro_id}}')">{{$approve}}</button>
-       </div>
-       <div class="clear"></div>
-       {{/if}}
 </div>
 <div class="intro-end"></div>