]> git.mxchange.org Git - friendica.git/commitdiff
Simplify dfrn_request and auto_request templates
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 6 Feb 2020 03:41:04 +0000 (22:41 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 8 Feb 2020 22:08:01 +0000 (17:08 -0500)
- Limit template variables

mod/dfrn_request.php
mod/follow.php
mod/settings.php
view/templates/auto_request.tpl
view/templates/dfrn_request.tpl
view/theme/frio/templates/auto_request.tpl
view/theme/frio/templates/dfrn_request.tpl

index 4079e6ccac215acc2be80b027fa10b650de65d4a..4a860a97a981319058bac69c6c8f7a9d89ecc4d7 100644 (file)
@@ -626,28 +626,21 @@ function dfrn_request_content(App $a)
                        $tpl = Renderer::getMarkupTemplate('auto_request.tpl');
                }
 
-               $page_desc = DI::l10n()->t("Please enter your 'Identity Address' from one of the following supported communications networks:");
-
-               $invite_desc = DI::l10n()->t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.', Search::getGlobalDirectory() . '/servers');
-
                $o = Renderer::replaceMacros($tpl, [
-                       '$header' => DI::l10n()->t('Friend/Connection Request'),
-                       '$desc' => DI::l10n()->t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
-                       '$pls_answer' => DI::l10n()->t('Please answer the following:'),
-                       '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $a->profile['name'])],
-                       '$add_note' => DI::l10n()->t('Add a personal note:'),
-                       '$page_desc' => $page_desc,
-                       '$friendica' => DI::l10n()->t('Friendica'),
-                       '$statusnet' => DI::l10n()->t("GNU Social \x28Pleroma, Mastodon\x29"),
-                       '$diaspora' => DI::l10n()->t("Diaspora \x28Socialhome, Hubzilla\x29"),
-                       '$diasnote' => DI::l10n()->t(' - please do not use this form.  Instead, enter %s into your Diaspora search bar.', $target_addr),
-                       '$your_address' => DI::l10n()->t('Your Identity Address:'),
-                       '$invite_desc' => $invite_desc,
-                       '$submit' => DI::l10n()->t('Submit Request'),
-                       '$cancel' => DI::l10n()->t('Cancel'),
-                       '$nickname' => $a->argv[1],
-                       '$name' => $a->profile['name'],
-                       '$myaddr' => $myaddr
+                       '$header'        => DI::l10n()->t('Friend/Connection Request'),
+                       '$page_desc'     => DI::l10n()->t('Enter your Webfinger address (user@domain.tld) or profile URL here. If this isn\'t supported by your system (for example it doesn\'t work with Diaspora), you have to subscribe to <strong>%s</strong> directly on your system', $target_addr),
+                       '$invite_desc'   => DI::l10n()->t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica node and join us today</a>.', Search::getGlobalDirectory() . '/servers'),
+                       '$your_address'  => DI::l10n()->t('Your Webfinger address or profile URL:'),
+                       '$pls_answer'    => DI::l10n()->t('Please answer the following:'),
+                       '$submit'        => DI::l10n()->t('Submit Request'),
+                       '$cancel'        => DI::l10n()->t('Cancel'),
+
+                       '$request'       => 'dfrn_request/' . $a->argv[1],
+                       '$name'          => $a->profile['name'],
+                       '$myaddr'        => $myaddr,
+
+                       '$does_know_you' => ['knowyou', DI::l10n()->t('%s knows me', $a->profile['name'])],
+                       '$addnote_field' => ['dfrn-request-message', DI::l10n()->t('Add a personal note:')],
                ]);
                return $o;
        }
index 2a5241a0ca47673f853fb25c94a742421887a719..e1d8b0ea7d8aa22f379983e0c8e1898ebca89b4f 100644 (file)
@@ -163,29 +163,22 @@ function follow_content(App $a)
 
        $o = Renderer::replaceMacros($tpl, [
                '$header'        => DI::l10n()->t('Connect/Follow'),
-               '$desc'          => '',
                '$pls_answer'    => DI::l10n()->t('Please answer the following:'),
-               '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $ret['name'])],
-               '$add_note'      => DI::l10n()->t('Add a personal note:'),
-               '$page_desc'     => '',
-               '$friendica'     => '',
-               '$statusnet'     => '',
-               '$diaspora'      => '',
-               '$diasnote'      => '',
                '$your_address'  => DI::l10n()->t('Your Identity Address:'),
-               '$invite_desc'   => '',
-               '$emailnet'      => '',
+               '$url_label'     => DI::l10n()->t('Profile URL'),
+               '$keywords_label'=> DI::l10n()->t('Tags:'),
                '$submit'        => $submit,
                '$cancel'        => DI::l10n()->t('Cancel'),
-               '$nickname'      => '',
+
+               '$request'       => $request,
                '$name'          => $ret['name'],
                '$url'           => $ret['url'],
                '$zrl'           => Profile::zrl($ret['url']),
-               '$url_label'     => DI::l10n()->t('Profile URL'),
                '$myaddr'        => $myaddr,
-               '$request'       => $request,
                '$keywords'      => $r[0]['keywords'],
-               '$keywords_label'=> DI::l10n()->t('Tags:')
+
+               '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $ret['name'])],
+               '$addnote_field' => ['dfrn-request-message', DI::l10n()->t('Add a personal note:')],
        ]);
 
        DI::page()['aside'] = '';
index 30d406d59abc3e43aa8118c25982f940f0d52224..ddb3fb76cbfbf5e432530bcf6de5dd182ce0bd92 100644 (file)
@@ -792,8 +792,8 @@ function settings_content(App $a)
                Hook::callAll('connector_settings', $settings_connectors);
 
                if (is_site_admin()) {
-                       $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled')));
-                       $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t("GNU Social \x28OStatus\x29"), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled')));
+                       $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora (Socialhome, Hubzilla)'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled')));
+                       $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('OStatus (GNU Social)'), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled')));
                } else {
                        $diasp_enabled = "";
                        $ostat_enabled = "";
index 84039fa4fd79d51c3d107fe5b55aa1769df9c448..0f960a4a2ef3595009672ed43986b82dc9502fce 100644 (file)
@@ -1,57 +1,20 @@
 <h1>{{$header}}</h1>
 
-{{if !$myaddr}}
-<p id="dfrn-request-intro">
-       {{$page_desc}}
-</p>
-<ul id="dfrn-request-networks">
-       <li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li>
-       <li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li>
-       <li><a href="https://gnu.io/social/" title="{{$statusnet}}">{{$statusnet}}</a></li>
-</ul>
-<p>
-       {{$invite_desc nofilter}}
-</p>
-<p>
-       {{$desc nofilter}}
-</p>
-{{/if}}
-
-<form action="{{$request|default:"dfrn_request/$nickname"}}" method="post">
-{{if $photo}}
-       <img src="{{$photo}}" alt="" id="dfrn-request-photo">
-{{/if}}
-
+<form action="{{$request}}" method="post">
        <dl>
-{{if $url}}
                <dt>{{$url_label}}</dt>
                <dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd>
-{{/if}}
-{{if $location}}
-               <dt>{{$location_label}}</dt>
-               <dd>{{$location}}</dd>
-{{/if}}
 {{if $keywords}}
                <dt>{{$keywords_label}}</dt>
                <dd>{{$keywords}}</dd>
-{{/if}}
-{{if $about}}
-               <dt>{{$about_label}}</dt>
-               <dd>{{$about nofilter}}</dd>
 {{/if}}
        </dl>
 
        <div id="dfrn-request-url-wrapper">
                <label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
-{{if $myaddr}}
                {{$myaddr}}
                <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
-{{else}}
-               <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}">
-{{/if}}
-{{if $url}}
                <input type="hidden" name="url" id="url" value="{{$url}}">
-{{/if}}
                <div id="dfrn-request-url-end"></div>
        </div>
 
index c35285fd6874d5beb2595c09287c4f1aae84d5c8..f1ef7c4695cff21996f584f4a569b6162ab46065 100644 (file)
@@ -2,45 +2,14 @@
 
 {{if !$myaddr}}
 <p id="dfrn-request-intro">
-       {{$page_desc}}
+       {{$page_desc nofilter}}
 </p>
-<ul id="dfrn-request-networks">
-       <li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li>
-       <li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li>
-       <li><a href="https://gnu.io/social/" title="{{$statusnet}}">{{$statusnet}}</a></li>
-</ul>
 <p>
        {{$invite_desc nofilter}}
 </p>
-<p>
-       {{$desc nofilter}}
-</p>
-{{/if}}
-
-<form action="{{$request|default:"dfrn_request/$nickname"}}" method="post">
-{{if $photo}}
-       <img src="{{$photo}}" alt="" id="dfrn-request-photo">
 {{/if}}
 
-       <dl>
-{{if $url}}
-               <dt>{{$url_label}}</dt>
-               <dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd>
-{{/if}}
-{{if $location}}
-               <dt>{{$location_label}}</dt>
-               <dd>{{$location}}</dd>
-{{/if}}
-{{if $keywords}}
-               <dt>{{$keywords_label}}</dt>
-               <dd>{{$keywords}}</dd>
-{{/if}}
-{{if $about}}
-               <dt>{{$about_label}}</dt>
-               <dd>{{$about nofilter}}</dd>
-{{/if}}
-       </dl>
-
+<form action="{{$request}}" method="post">
        <div id="dfrn-request-url-wrapper">
                <label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
 {{if $myaddr}}
@@ -48,9 +17,6 @@
                <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
 {{else}}
                <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}">
-{{/if}}
-{{if $url}}
-               <input type="hidden" name="url" id="url" value="{{$url}}">
 {{/if}}
                <div id="dfrn-request-url-end"></div>
        </div>
        </p>
 
        <div id="dfrn-request-info-wrapper">
-
                {{include file="field_checkbox.tpl" field=$does_know_you}}
-               {{*
-               <p id="doiknowyou">
-               {{$does_know}}
-               </p>
-
-               <div id="dfrn-request-know-yes-wrapper">
-               <label id="dfrn-request-knowyou-yes-label" for="dfrn-request-knowyouyes">{{$yes}}</label>
-               <input type="radio" name="knowyou" id="knowyouyes" value="1" >
 
-               <div id="dfrn-request-knowyou-break" ></div>    
-               </div>
-               <div id="dfrn-request-know-no-wrapper">
-               <label id="dfrn-request-knowyou-no-label" for="dfrn-request-knowyouno">{{$no}}</label>
-               <input type="radio" name="knowyou" id="knowyouno" value="0" checked="checked" >
-
-               <div id="dfrn-request-knowyou-end"></div>
-               </div>
-               *}}
-
-               <p id="dfrn-request-message-desc">
-                       {{$add_note}}
-               </p>
-               <div id="dfrn-request-message-wrapper">
-                       <textarea name="dfrn-request-message" rows="4" cols="64"></textarea>
-               </div>
+               {{include file="field_textarea.tpl" field=$addnote_field}}
        </div>
 
        <div id="dfrn-request-submit-wrapper">
-{{if $submit}}
                <input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
-{{/if}}
                <input type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}">
        </div>
 </form>
index e9c4c825091bb133e83eb025d91c3269fc85f46f..c803c3d8aee1c5ed2e379ae1d45fb2b9d0cae943 100644 (file)
@@ -1,65 +1,28 @@
 <div class="generic-page-wrapper">
        <h1>{{$header}}</h1>
 
-{{if !$myaddr}}
-       <p id="dfrn-request-intro">
-               {{$page_desc}}
-       </p>
-       <ul id="dfrn-request-networks">
-               <li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li>
-               <li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li>
-               <li><a href="https://gnu.io/social/" title="{{$statusnet}}">{{$statusnet}}</a></li>
-       </ul>
-       <p>
-               {{$invite_desc nofilter}}
-       </p>
-       <p>
-               {{$desc}}
-       </p>
-{{/if}}
-
-       <form action="{{$request|default:"dfrn_request/$nickname"}}" method="post">
-
-{{if $photo}}
-               <img src="{{$photo}}" alt="" id="dfrn-request-photo">
-{{/if}}
+       <form action="{{$request}}" method="post">
                <dl>
-{{if $url}}
                        <dt>{{$url_label}}</dt>
                        <dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd>
-{{/if}}
-{{if $location}}
-                       <dt>{{$location_label}}</dt>
-                       <dd>{{$location}}</dd>
-{{/if}}
 {{if $keywords}}
                        <dt>{{$keywords_label}}</dt>
                        <dd>{{$keywords}}</dd>
-{{/if}}
-{{if $about}}
-                       <dt>{{$about_label}}</dt>
-                       <dd>{{$about}}</dd>
 {{/if}}
                </dl>
 
                <div id="dfrn-request-url-wrapper">
                        <label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
-                       {{if $myaddr}}
-                               {{$myaddr}}
-                               <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
-                       {{else}}
-                               <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}">
-                       {{/if}}
-                       {{if $url}}
-                               <input type="hidden" name="url" id="url" value="{{$url}}">
-                       {{/if}}
+                       {{$myaddr}}
+                       <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
+                       <input type="hidden" name="url" id="url" value="{{$url}}">
                        <div id="dfrn-request-url-end"></div>
                </div>
 
                <div id="dfrn-request-submit-wrapper">
-                       {{if $submit}}
-                               <input class="btn btn-primary" type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
-                       {{/if}}
+{{if $submit}}
+                       <input class="btn btn-primary" type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
+{{/if}}
                        <input class="btn btn-default" type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}">
                </div>
        </form>
index 45d4aeafd656e0565433c98fecebf6858567a0aa..65f84fd7cc406046871ea09656af840ea082dbc6 100644 (file)
@@ -3,56 +3,22 @@
 
 {{if !$myaddr}}
        <p id="dfrn-request-intro">
-               {{$page_desc}}
+               {{$page_desc nofilter}}
        </p>
-       <ul id="dfrn-request-networks">
-               <li><a href="http://friendi.ca" title="{{$friendica}}">{{$friendica}}</a></li>
-               <li><a href="https://diasporafoundation.org" title="{{$diaspora}}">{{$diaspora}}</a> {{$diasnote}}</li>
-               <li><a href="https://gnu.io/social/" title="{{$statusnet}}">{{$statusnet}}</a></li>
-       </ul>
        <p>
                {{$invite_desc nofilter}}
        </p>
-       <p>
-               {{$desc}}
-       </p>
-{{/if}}
-
-       <form action="{{$request|default:"dfrn_request/$nickname"}}" method="post">
-
-{{if $photo}}
-               <img src="{{$photo}}" alt="" id="dfrn-request-photo">
-{{/if}}
-               <dl>
-{{if $url}}
-                       <dt>{{$url_label}}</dt>
-                       <dd><a target="blank" href="{{$zrl}}">{{$url}}</a></dd>
-{{/if}}
-{{if $location}}
-                       <dt>{{$location_label}}</dt>
-                       <dd>{{$location}}</dd>
 {{/if}}
-{{if $keywords}}
-                       <dt>{{$keywords_label}}</dt>
-                       <dd>{{$keywords}}</dd>
-{{/if}}
-{{if $about}}
-                       <dt>{{$about_label}}</dt>
-                       <dd>{{$about}}</dd>
-{{/if}}
-               </dl>
 
+       <form action="{{$request}}" method="post">
                <div id="dfrn-request-url-wrapper">
                        <label id="dfrn-url-label" for="dfrn-url">{{$your_address}}</label>
-               {{if $myaddr}}
+{{if $myaddr}}
                        {{$myaddr}}
                        <input type="hidden" name="dfrn_url" id="dfrn-url" value="{{$myaddr}}">
-               {{else}}
+{{else}}
                        <input type="text" name="dfrn_url" id="dfrn-url" size="32" value="{{$myaddr}}">
-               {{/if}}
-               {{if $url}}
-                       <input type="hidden" name="url" id="url" value="{{$url}}">
-               {{/if}}
+{{/if}}
                        <div id="dfrn-request-url-end"></div>
                </div>
 
 
                <div id="dfrn-request-info-wrapper">
                        {{include file="field_checkbox.tpl" field=$does_know_you}}
-                       {{*
-                       <p id="doiknowyou">
-                       {{$does_know}}
-                       </p>
-
-                       <div id="dfrn-request-know-yes-wrapper">
-                       <label id="dfrn-request-knowyou-yes-label" for="dfrn-request-knowyouyes">{{$yes}}</label>
-                       <input type="radio" name="knowyou" id="knowyouyes" value="1" >
 
-                       <div id="dfrn-request-knowyou-break" ></div>
-                       </div>
-                       <div id="dfrn-request-know-no-wrapper">
-                       <label id="dfrn-request-knowyou-no-label" for="dfrn-request-knowyouno">{{$no}}</label>
-                       <input type="radio" name="knowyou" id="knowyouno" value="0" checked="checked" >
-
-                       <div id="dfrn-request-knowyou-end"></div>
-                       </div>
-                       *}}
-
-                       <p id="dfrn-request-message-desc">
-                               {{$add_note}}
-                       </p>
-                       <div id="dfrn-request-message-wrapper">
-                               <textarea name="dfrn-request-message" rows="4" cols="64"></textarea>
-                       </div>
+                       {{include file="field_textarea.tpl" field=$addnote_field}}
                </div>
 
                <div id="dfrn-request-submit-wrapper">
-{{if $submit}}
                        <input class="btn btn-primary" type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit}}">
-{{/if}}
                        <input class="btn btn-default" type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel}}">
                </div>
        </form>