first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{**
|
||||
* templates/form/autocompleteInput.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* an autocomplete input
|
||||
*}
|
||||
<script>
|
||||
$(function() {ldelim}
|
||||
$('#{$FBV_id}_container').pkpHandler('$.pkp.controllers.AutocompleteHandler',
|
||||
{ldelim}
|
||||
{if $FBV_disableSync}disableSync: true,{/if}
|
||||
sourceUrl: {$FBV_autocompleteUrl|json_encode},
|
||||
{rdelim});
|
||||
{rdelim});
|
||||
</script>
|
||||
|
||||
<div id="{$FBV_id}_container" {if $FBV_layoutInfo}{$FBV_layoutInfo}{/if}>
|
||||
{$FBV_textInput}
|
||||
<div class="hidden">
|
||||
<input type="hidden" name="{$FBV_id}" id="{$FBV_id}" {if $FBV_autocompleteValue}value="{$FBV_autocompleteValue}"{/if} {if $FBV_validation}class="{$FBV_validation}"{/if} />
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
{**
|
||||
* templates/form/button.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form button
|
||||
*}
|
||||
{strip}
|
||||
<button class="pkp_button {$FBV_class}" type="{$FBV_type}" {if $FBV_disabled} disabled="disabled"{/if} {$FBV_buttonParams}>
|
||||
{if $FBV_translate}{translate key=$FBV_label}{else}{$FBV_label}{/if}
|
||||
</button>
|
||||
{/strip}
|
||||
@@ -0,0 +1,28 @@
|
||||
{**
|
||||
* templates/form/checkbox.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form checkbox
|
||||
*}
|
||||
|
||||
<li{if $FBV_layoutInfo} class="{$FBV_layoutInfo}"{/if}>
|
||||
{if $FBV_label}
|
||||
<label>
|
||||
{/if}
|
||||
<input type="checkbox" id="{$FBV_id|escape}" {$FBV_checkboxParams} class="field checkbox{if $FBV_validation} {$FBV_validation|escape}{/if}{if $FBV_required} required{/if}"{if $FBV_checked} checked="checked"{/if}{if $FBV_disabled} disabled="disabled"{/if}{if $FBV_required} required aria-required="true"{/if}/>
|
||||
{if $FBV_translate}
|
||||
{translate key=$FBV_label}
|
||||
{else}
|
||||
{if $FBV_keepLabelHtml}
|
||||
{$FBV_label}
|
||||
{else}
|
||||
{$FBV_label}
|
||||
{/if}
|
||||
{/if}
|
||||
{if $FBV_label}
|
||||
</label>
|
||||
{/if}
|
||||
</li>
|
||||
@@ -0,0 +1,37 @@
|
||||
{**
|
||||
* templates/form/checkboxGroup.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form checkboxgroup
|
||||
*}
|
||||
|
||||
{if $FBV_required}{assign var="required" value="required"}{/if}
|
||||
|
||||
{foreach name=checkbox from=$FBV_from item=FBV_label key=FBV_value}
|
||||
{if in_array($FBV_value, $FBV_selected)}
|
||||
{assign var="FBV_checked" value="checked"}
|
||||
{else}
|
||||
{assign var="FBV_checked" value=""}
|
||||
{/if}
|
||||
|
||||
<li{if $FBV_layoutInfo} class="{$FBV_layoutInfo}"{/if}>
|
||||
{capture assign="FBV_inputMarkup"}
|
||||
<input type="checkbox" id="{$FBV_id|escape}-{$smarty.foreach.checkbox.index}" name="{$FBV_id|escape}[]"{$FBV_checkboxParams} class="field checkbox{if $FBV_required} required{/if}"{if $FBV_checked} checked="checked"{/if}{if $FBV_validation}{/if} value="{$FBV_value|escape}"{if $FBV_disabled} disabled="disabled"{/if}{if $FBV_required} required aria-required="true"{/if}/>
|
||||
{/capture}
|
||||
{if $FBV_label}
|
||||
<label for="{$FBV_id|escape}-{$smarty.foreach.checkbox.index}">
|
||||
{$FBV_inputMarkup}
|
||||
{if $FBV_translate}
|
||||
{translate key=$FBV_label}
|
||||
{else}
|
||||
{$FBV_label|strip_unsafe_html}
|
||||
{/if}
|
||||
</label>
|
||||
{else}
|
||||
{$FBV_inputMarkup}
|
||||
{/if}
|
||||
</li>
|
||||
{/foreach}
|
||||
@@ -0,0 +1,14 @@
|
||||
{**
|
||||
* templates/form/fieldLabel.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Form field label
|
||||
*}
|
||||
|
||||
<label{if !$FBV_suppressId} for="{$FBV_name|default:""|escape}"{/if}{if $FBV_class} class="{$FBV_class|default:""|escape}"{/if} >
|
||||
{$FBV_label}{if $FBV_required}<span class="req">*</span>{/if}
|
||||
</label>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{**
|
||||
* templates/form/radioButton.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form radio button
|
||||
*}
|
||||
|
||||
<div class="pkp_form_file_input_container">
|
||||
<input type="file" id="{$FBV_id}" name="{$FBV_name}" class="pkp_form_upload_field"{if $FBV_disabled} disabled="disabled"{/if} />
|
||||
<div class="pkp_form_fakeFile">
|
||||
<input class="pkp_form_fakeInput" {if $FBV_disabled} disabled="disabled"{/if} />
|
||||
<input type="button" value="{translate key='navigation.browse'}..." class="button pkp_form_fakeButton"{if $FBV_disabled} disabled="disabled"{/if}/>
|
||||
</div>
|
||||
</div>
|
||||
{if $FBV_submit}<input type="submit" name="{$FBV_submit}" value="{translate key="common.upload"}" class="button pkp_form_uploadFile"{if $FBV_disabled} disabled="disabled"{/if} />{/if}
|
||||
{$FBV_label_content}
|
||||
@@ -0,0 +1,16 @@
|
||||
{**
|
||||
* templates/form/formArea.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form area
|
||||
*}
|
||||
|
||||
<fieldset {if $FBV_id} id="{$FBV_id}"{/if}{if $FBV_class} class="pkp_formArea {$FBV_class|escape}"{/if}>
|
||||
{if $FBV_title}
|
||||
<legend>{if $FBV_translate}{translate key=$FBV_title}{else}{$FBV_title}{/if}</legend>
|
||||
{/if}
|
||||
{$FBV_content}
|
||||
</fieldset>
|
||||
@@ -0,0 +1,57 @@
|
||||
{**
|
||||
* templates/form/formButtons.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Form button bar
|
||||
* Parameters:
|
||||
* FBV_hideCancel bool hides the cancel button completely.
|
||||
* FBV_cancelAction LinkAction to be executed when the cancel button is pressed.
|
||||
* FBV_cancelUrl string A url to redirect to when cancel is pressed.
|
||||
* FBV_cancelText string The label to go on the cancel button
|
||||
* FBV_confirmSubmit string Text to be used in a confirmation modal before submiting the form.
|
||||
* FBV_submitText string The label to go on the submit button.
|
||||
* FBV_submitDisabled bool disables the submit button.
|
||||
*}
|
||||
|
||||
{fbvFormSection class="formButtons form_buttons"}
|
||||
|
||||
{* Loading indicator *}
|
||||
<span class="pkp_spinner"></span>
|
||||
|
||||
{* Submit button *}
|
||||
{assign var=submitButtonId value="submitFormButton"|concat:"-"|uniqid}
|
||||
|
||||
{* IF we have confirmation dialog text specified, load buttonConfirmationLinkAction for the submit button *}
|
||||
{if $FBV_confirmSubmit}
|
||||
{include file="linkAction/buttonConfirmationLinkAction.tpl"
|
||||
buttonSelector="#"|concat:$submitButtonId
|
||||
dialogText="$FBV_confirmSubmit"}
|
||||
{/if}
|
||||
|
||||
{fbvElement type="submit" class="{if $FBV_saveText}pkp_button_primary{/if} submitFormButton" name="submitFormButton" id=$submitButtonId label=$FBV_submitText translate=$FBV_translate disabled=$FBV_submitDisabled}
|
||||
|
||||
{* Save button *}
|
||||
{if $FBV_saveText}
|
||||
{assign var=saveButtonId value="saveFormButton"|concat:"-"|uniqid}
|
||||
{fbvElement type="submit" class="saveFormButton" name="saveFormButton" id=$saveButtonId label=$FBV_saveText disabled=$FBV_submitDisabled}
|
||||
{/if}
|
||||
|
||||
{* Cancel button (if any) *}
|
||||
{if !$FBV_hideCancel}
|
||||
{assign var=cancelButtonId value="cancelFormButton"|concat:"-"|uniqid}
|
||||
{if $FBV_cancelAction}
|
||||
{include file="linkAction/buttonGenericLinkAction.tpl"
|
||||
buttonSelector="#"|concat:$cancelButtonId
|
||||
action=$FBV_cancelAction}
|
||||
{elseif $FBV_cancelUrl}
|
||||
{include file="linkAction/buttonRedirectLinkAction.tpl"
|
||||
buttonSelector="#"|concat:$cancelButtonId
|
||||
cancelUrl=$FBV_cancelUrl
|
||||
cancelUrlTarget=$FBV_cancelUrlTarget}
|
||||
{/if}
|
||||
<a href="#" id="{$cancelButtonId}" class="cancelButton">{translate key=$FBV_cancelText}</a>
|
||||
{/if}
|
||||
{/fbvFormSection}
|
||||
@@ -0,0 +1,28 @@
|
||||
{**
|
||||
* templates/form/formSection.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Form section.
|
||||
*}
|
||||
|
||||
|
||||
<div {if $FBV_id}id="{$FBV_id|escape}" {/if}class="section {$FBV_class|default:""|escape} {$FBV_layoutInfo|default:""|escape}">
|
||||
{if $FBV_label}
|
||||
{if $FBV_translate}{capture assign="FBV_labelTranslated"}{translate key=$FBV_label|escape}{/capture}
|
||||
{else}{assign var="FBV_labelTranslated" value=$FBV_Label}{/if}
|
||||
{if $FBV_labelFor}<label for="{$FBV_labelFor|escape}">{$FBV_labelTranslated}{if $FBV_required}<span class="req">*</span>{/if}</label>
|
||||
{else}<span class="label">{$FBV_labelTranslated}{if $FBV_required}<span class="req">*</span>{/if}</span>{/if}
|
||||
{/if}
|
||||
{if $FBV_description}<label class="description">{if $FBV_translate}{translate key=$FBV_description}{else}{$FBV_description}{/if}</label>{/if}
|
||||
{if $FBV_listSection}<ul class="checkbox_and_radiobutton">{/if}
|
||||
{if $FBV_title}<label {if $FBV_labelFor} for="{$FBV_labelFor|escape}"{/if}>{if $FBV_translate}{translate key=$FBV_title}{else}{$FBV_title}{/if}{if $FBV_required}<span class="req">*</span>{/if}</label>{/if}
|
||||
{foreach from=$FBV_sectionErrors item=FBV_error}
|
||||
<span class="error">{$FBV_error|escape}</span>
|
||||
{/foreach}
|
||||
|
||||
{$FBV_content}
|
||||
{if $FBV_listSection}</ul>{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
{**
|
||||
* templates/form/hiddenInput.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Hidden input element
|
||||
*}
|
||||
<input type="hidden"
|
||||
id="{$FBV_id|escape}"
|
||||
name="{$FBV_name|escape}"
|
||||
class="{$FBV_class}{if $FBV_validation} {$FBV_validation|escape}{/if}"
|
||||
value="{$FBV_value|default:""|escape}"
|
||||
{$FBV_hiddenInputParams} />
|
||||
@@ -0,0 +1,39 @@
|
||||
{**
|
||||
* templates/user/interestsInput.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Keyword input control for user interests
|
||||
*}
|
||||
<script>
|
||||
$(document).ready(function(){ldelim}
|
||||
$("#{$FBV_id|escape}").find(".interests").tagit({ldelim}
|
||||
fieldName: 'interests[]',
|
||||
allowSpaces: true,
|
||||
autocomplete: {ldelim}
|
||||
source: function(request, response) {ldelim}
|
||||
$.ajax({ldelim}
|
||||
url: {url|json_encode router=\PKP\core\PKPApplication::ROUTE_PAGE page='user' op='getInterests' escape=false},
|
||||
data: {ldelim}'term': request.term{rdelim},
|
||||
dataType: 'json',
|
||||
success: function(jsonData) {ldelim}
|
||||
if (jsonData.status == true) {ldelim}
|
||||
response(jsonData.content);
|
||||
{rdelim}
|
||||
{rdelim}
|
||||
{rdelim});
|
||||
{rdelim}
|
||||
{rdelim}
|
||||
{rdelim});
|
||||
{rdelim});
|
||||
</script>
|
||||
|
||||
<div id="{$FBV_id|escape}">
|
||||
<!-- The container which will be processed by tag-it.js as the interests widget -->
|
||||
<ul class="interests">
|
||||
{if $FBV_interests}{foreach from=$FBV_interests item=interest}<li class="hidden">{$interest|escape}</li>{/foreach}{/if}
|
||||
</ul>
|
||||
{if $FBV_label_content}<span>{$FBV_label_content}</span>{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,99 @@
|
||||
{**
|
||||
* templates/form/keywordInput.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Generic keyword input control
|
||||
*}
|
||||
{assign var="uniqId" value="-"|concat:$FBV_uniqId|escape}
|
||||
{if $FBV_multilingual && count($formLocales) > 1}
|
||||
{foreach name=formLocales from=$formLocales key=thisFormLocale item=thisFormLocaleName}
|
||||
<script>
|
||||
$(document).ready(function(){ldelim}
|
||||
$("#{$thisFormLocale|escape:jqselector}-{$FBV_id}{$uniqId}").tagit({ldelim}
|
||||
fieldName: "keywords[{$thisFormLocale|escape}-{$FBV_id|escape}][]",
|
||||
{if $thisFormLocale != $formLocale && empty($FBV_currentKeywords.$thisFormLocale)}placeholderText: "{$thisFormLocaleName|escape}",{/if}
|
||||
allowSpaces: true,
|
||||
{if $FBV_sourceUrl && !$FBV_disabled}
|
||||
tagSource: function(search, showChoices) {ldelim}
|
||||
$.ajax({ldelim}
|
||||
url: "{$FBV_sourceUrl}&locale={$thisFormLocale|escape}", {* this url should return a JSON array of possible keywords *}
|
||||
data: search,
|
||||
success: function(choices) {ldelim}
|
||||
showChoices(choices);
|
||||
{rdelim}
|
||||
{rdelim});
|
||||
{rdelim}
|
||||
{else}
|
||||
availableTags: {$FBV_availableKeywords.$thisFormLocale|@json_encode}
|
||||
{/if}
|
||||
{rdelim});
|
||||
|
||||
{** Tag-it has no "read-only" option, so we must remove input elements to disable the widget **}
|
||||
{if $FBV_disabled}
|
||||
$("#{$thisFormLocale|escape:jqselector}-{$FBV_id|concat:$uniqId|escape}").find('.tagit-close, .tagit-new').remove();
|
||||
{/if}
|
||||
{rdelim});
|
||||
</script>
|
||||
{/foreach}
|
||||
|
||||
<script>
|
||||
$(function() {ldelim}
|
||||
$('#{$FBV_id|escape:javascript}-localization-popover-container{$uniqId}').pkpHandler(
|
||||
'$.pkp.controllers.form.MultilingualInputHandler'
|
||||
);
|
||||
{rdelim});
|
||||
</script>
|
||||
{* Add localization_popover_container_focus_forced class to multilingual tag-it
|
||||
fields. This is a workaround to a focus bug which prevents a tag-it
|
||||
value from being deleted when it is in a multilingual popover.
|
||||
See: https://github.com/pkp/pkp-lib/issues/3003 *}
|
||||
<span id="{$FBV_id|escape}-localization-popover-container{$uniqId}" class="localization_popover_container localization_popover_container_focus_forced pkpTagit">
|
||||
<ul class="localizable {if $formLocale != $currentLocale} flag flag_{$formLocale|escape}{/if}" id="{$formLocale|escape}-{$FBV_id|escape}{$uniqId}">
|
||||
{if $FBV_currentKeywords}{foreach from=$FBV_currentKeywords.$formLocale item=currentKeyword}<li>{$currentKeyword|escape}</li>{/foreach}{/if}
|
||||
</ul>
|
||||
{if $FBV_label_content}<span>{$FBV_label_content}</span>{/if}
|
||||
<div class="localization_popover">
|
||||
{foreach from=$formLocales key=thisFormLocale item=thisFormLocaleName}{if $formLocale != $thisFormLocale}
|
||||
<ul class="multilingual_extra flag flag_{$thisFormLocale|escape}" id="{$thisFormLocale}-{$FBV_id|escape}{$uniqId}">
|
||||
{if $FBV_currentKeywords}{foreach from=$FBV_currentKeywords.$thisFormLocale item=currentKeyword}<li>{$currentKeyword|escape}</li>{/foreach}{/if}
|
||||
</ul>
|
||||
{/if}{/foreach}
|
||||
</div>
|
||||
</span>
|
||||
|
||||
{else} {* this is not a multilingual keyword field or there is only one locale available *}
|
||||
<script>
|
||||
$(document).ready(function(){ldelim}
|
||||
$("#{$FBV_id|escape:jqselector}{$uniqId}").tagit({ldelim}
|
||||
fieldName: "keywords[{if $FBV_multilingual}{$formLocale|escape}-{/if}{$FBV_id|escape}][]",
|
||||
allowSpaces: true,
|
||||
{if $FBV_sourceUrl && !$FBV_disabled}
|
||||
tagSource: function(search, showChoices) {ldelim}
|
||||
$.ajax({ldelim}
|
||||
url: "{$FBV_sourceUrl}", {* this url should return a JSON array of possible keywords *}
|
||||
data: search,
|
||||
success: function(choices) {ldelim}
|
||||
showChoices(choices);
|
||||
{rdelim}
|
||||
{rdelim});
|
||||
{rdelim}
|
||||
{else}
|
||||
availableTags: {$FBV_availableKeywords.$formLocale|@json_encode}
|
||||
{/if}
|
||||
{rdelim});
|
||||
|
||||
{** Tag-it has no "read-only" option, so we must remove input elements to disable the widget **}
|
||||
{if $FBV_disabled}
|
||||
$("#{$FBV_id|escape}{$uniqId}").find('.tagit-close, .tagit-new').remove();
|
||||
$("#{$FBV_id|escape}{$uniqId}:empty").removeClass('tagit');
|
||||
{/if}
|
||||
{rdelim});
|
||||
</script>
|
||||
|
||||
<!-- The container which will be processed by tag-it.js as the interests widget -->
|
||||
<ul id="{$FBV_id|escape}{$uniqId}">{if $FBV_currentKeywords}{foreach from=$FBV_currentKeywords.$formLocale item=currentKeyword}<li>{$currentKeyword|escape}</li>{/foreach}{/if}</ul>
|
||||
{if $FBV_label_content}<span>{$FBV_label_content}</span>{/if}
|
||||
{/if}
|
||||
@@ -0,0 +1,25 @@
|
||||
{**
|
||||
* templates/form/radioButton.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form radio button
|
||||
*}
|
||||
|
||||
<li{if $FBV_layoutInfo} class="{$FBV_layoutInfo}"{/if}>
|
||||
<label>
|
||||
<input type="radio" id="{$FBV_id|escape}" {$FBV_radioParams} class="field radio"{if $FBV_checked} checked="checked"{/if}{if $FBV_disabled} disabled="disabled"{/if}
|
||||
{if $FBV_required} required aria-required="true"{/if}>
|
||||
{if $FBV_label}
|
||||
{if $FBV_translate}
|
||||
{translate key=$FBV_label}
|
||||
{else}
|
||||
{$FBV_label|escape}
|
||||
{/if}
|
||||
{elseif $FBV_content}
|
||||
{$FBV_content}
|
||||
{/if}
|
||||
</label>
|
||||
</li>
|
||||
@@ -0,0 +1,22 @@
|
||||
{**
|
||||
* templates/form/select.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form select
|
||||
*}
|
||||
|
||||
<div{if $FBV_layoutInfo} class="{$FBV_layoutInfo}"{/if}>
|
||||
<select {$FBV_selectParams}{if $FBV_class} class="{$FBV_class}"{/if}{if $FBV_disabled} disabled="disabled"{/if}{if $FBV_required} required aria-required="true"{/if}>
|
||||
{if $FBV_defaultValue !== null}
|
||||
<option value="{$FBV_defaultValue|escape}">{$FBV_defaultLabel|escape}</option>
|
||||
{/if}
|
||||
{if $FBV_translate}{html_options_translate options=$FBV_from selected=$FBV_selected}{else}{html_options options=$FBV_from selected=$FBV_selected}{/if}
|
||||
</select>
|
||||
|
||||
{if $FBV_label_content}
|
||||
<span>{$FBV_label_content}</span>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{**
|
||||
* templates/form/subLabel.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form label
|
||||
*}
|
||||
|
||||
{if $FBV_uniqId}
|
||||
{if $FBV_multilingual}
|
||||
{assign var="forElement" value=$FBV_id|concat:"-":$formLocale:"-":$FBV_uniqId}
|
||||
{else}
|
||||
{assign var="forElement" value=$FBV_id|concat:"-":$FBV_uniqId}
|
||||
{/if}
|
||||
{else}
|
||||
{assign var="forElement" value=$FBV_id}
|
||||
{/if}
|
||||
<label class="sub_label{if $FBV_error} error{/if}" {if !$FBV_suppressId} for="{$forElement|escape}"{/if}>
|
||||
{if $FBV_subLabelTranslate}{translate key=$FBV_label|escape}{else}{$FBV_label|escape}{/if}{if $FBV_required}<span class="req">*</span>{/if}
|
||||
</label>
|
||||
@@ -0,0 +1,81 @@
|
||||
{**
|
||||
* templates/form/textInput.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form text input
|
||||
*}
|
||||
|
||||
{assign var="uniqId" value="-"|concat:$FBV_uniqId|escape}
|
||||
<div{if $FBV_layoutInfo} class="{$FBV_layoutInfo}"{/if}>
|
||||
{if $FBV_multilingual && count($formLocales) > 1}
|
||||
<script>
|
||||
$(function() {ldelim}
|
||||
$('#{$FBV_id|escape:javascript}-localization-popover-container{$uniqId}').pkpHandler(
|
||||
'$.pkp.controllers.form.MultilingualInputHandler'
|
||||
);
|
||||
{rdelim});
|
||||
</script>
|
||||
{* This is a multilingual control. Enable popover display. *}
|
||||
<span id="{$FBV_id|escape}-localization-popover-container{$uniqId}" class="localization_popover_container">
|
||||
<input type="{if $FBV_isPassword}password{elseif $FBV_isTypeURL}url{else}text{/if}"
|
||||
{$FBV_textInputParams}
|
||||
class="localizable {if $FBV_class}{$FBV_class|escape}{/if}{if $FBV_validation} {$FBV_validation}{/if}{if $formLocale != $currentLocale} locale_{$formLocale|escape}{/if}"
|
||||
{if $FBV_disabled} disabled="disabled"{/if}
|
||||
{if $FBV_readonly} readonly="readonly"{/if}
|
||||
{if $FBV_validation} validation="{$FBV_validation|escape}"{/if}
|
||||
value="{$FBV_value[$formLocale]|default:""|escape}"
|
||||
name="{$FBV_name|escape}[{$formLocale|escape}]"
|
||||
id="{$FBV_id|escape}-{$formLocale|escape}{$uniqId}"
|
||||
{if $FBV_required} required aria-required="true"{/if}
|
||||
/>
|
||||
|
||||
{$FBV_label_content}
|
||||
|
||||
<div class="localization_popover">
|
||||
{foreach from=$formLocales key=thisFormLocale item=thisFormLocaleName}{if $formLocale != $thisFormLocale}
|
||||
<input type="{if $FBV_isPassword}password{else}text{/if}"
|
||||
{$FBV_textInputParams}
|
||||
placeholder="{$thisFormLocaleName|escape}"
|
||||
class="multilingual_extra flag flag_{$thisFormLocale|escape}{if $FBV_sizeInfo} {$FBV_sizeInfo|escape}{/if}"
|
||||
{if $FBV_disabled} disabled="disabled"{/if}
|
||||
{if $FBV_readonly} readonly="readonly"{/if}
|
||||
value="{$FBV_value[$thisFormLocale]|default:""|escape}"
|
||||
name="{$FBV_name|escape}[{$thisFormLocale|escape}]"
|
||||
id="{$FBV_id|escape}-{$thisFormLocale|escape}{$uniqId}"
|
||||
{if $FBV_tabIndex} tabindex="{$FBV_tabIndex|escape}"{/if}
|
||||
{if $FBV_required && $thisFormLocale === $primaryLocale} required aria-required="true"{/if}
|
||||
{if $FBV_validation && $thisFormLocale === $primaryLocale} validation="{$FBV_validation|escape}"{/if}
|
||||
/>
|
||||
<label for="{$FBV_id|escape}-{$thisFormLocale|escape}{$uniqId}" class="locale">({$thisFormLocaleName|escape})</label>
|
||||
{/if}{/foreach}
|
||||
</div>
|
||||
</span>
|
||||
{else}
|
||||
{* This is not a multilingual control or there is only one locale available *}
|
||||
<input type="{if $FBV_isPassword}password{elseif $FBV_isTypeURL}url{elseif $FBV_isTypeSearch}search{elseif $FBV_isTypeEmail}email{elseif $FBV_isTypeTel}tel{else}text{/if}"
|
||||
{$FBV_textInputParams}
|
||||
class="field text{if $FBV_class} {$FBV_class|escape}{/if}{if $FBV_validation} {$FBV_validation}{/if}"
|
||||
{if $FBV_disabled} disabled="disabled"{/if}
|
||||
{if $FBV_readonly} readonly="readonly"{/if}
|
||||
name="{$FBV_name|escape}{if $FBV_multilingual}[{$formLocale|escape}]{/if}"
|
||||
value="{if $FBV_multilingual}{$FBV_value[$formLocale]|default:""|escape}{elseif $FBV_class|default:""|strstr:"datepicker" && $FBV_value!==null}{$FBV_value|date_format:$dateFormatShort|escape}{else}{$FBV_value|default:""|escape}{/if}"
|
||||
id="{$FBV_id|escape}{$uniqId}"
|
||||
{if $FBV_tabIndex} tabindex="{$FBV_tabIndex|escape}"{/if}
|
||||
{if $FBV_required} required aria-required="true"{/if}
|
||||
{if $FBV_validation} validation="{$FBV_validation|escape}"{/if}
|
||||
{if $FBV_urlValidationErrorMessage} data-msg-url="{$FBV_urlValidationErrorMessage|escape}"{/if}
|
||||
/>
|
||||
|
||||
{if $FBV_class|default:""|strstr:"datepicker" !== false}
|
||||
<input data-date-format="{$dateFormatShort|dateformatPHP2JQueryDatepicker}" type="hidden"
|
||||
name="{$FBV_name|escape}"
|
||||
value="{if !empty($FBV_value)}{$FBV_value|date_format:"Y-m-d"|escape}{/if}"
|
||||
id="{$FBV_id|escape}{$uniqId}-altField" />
|
||||
{/if}
|
||||
|
||||
<span>{$FBV_label_content}</span>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,85 @@
|
||||
{**
|
||||
* templates/form/textArea.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2000-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* form text area
|
||||
*}
|
||||
|
||||
{assign var="uniqId" value="-"|concat:$FBV_uniqId|escape}
|
||||
<div{if $FBV_layoutInfo} class="{$FBV_layoutInfo}"{/if}>
|
||||
{if $FBV_multilingual && count($formLocales) > 1}
|
||||
<script>
|
||||
$(function() {ldelim}
|
||||
$('#{$FBV_name|escape:javascript}-localization-popover-container{$uniqId}').pkpHandler(
|
||||
'$.pkp.controllers.form.MultilingualInputHandler'
|
||||
);
|
||||
{rdelim});
|
||||
</script>
|
||||
{* This is a multilingual control. Enable popover display. *}
|
||||
<span id="{$FBV_name|escape}-localization-popover-container{$uniqId}" class="localization_popover_container">
|
||||
{strip}
|
||||
{capture assign="localeDirection"}{locale_direction locale=$formLocale}{/capture}
|
||||
<textarea id="{$FBV_id|escape}-{$formLocale|escape}{$uniqId}" {$FBV_textAreaParams}
|
||||
rows="{$FBV_rows|escape}"
|
||||
cols="{$FBV_cols|escape}"
|
||||
class="localizable {$FBV_class} {$FBV_height}{if $FBV_validation} {$FBV_validation|escape}{/if}{if $formLocale != $currentLocale} locale_{$formLocale|escape}{/if}{if $FBV_rich && !$FBV_disabled} richContent{if $FBV_rich==="extended"} extendedRichContent{/if}{/if}"
|
||||
{if $FBV_disabled} disabled="disabled"{/if}
|
||||
{if $FBV_readonly} readonly="readonly"{/if}
|
||||
{if $FBV_wordCount} wordCount="{$FBV_wordCount|escape}"{/if}
|
||||
{if $FBV_variables} data-variables="{$FBV_variables|@json_encode|escape:"url"}"{/if}
|
||||
{if $FBV_variablesType} data-variablesType="{$FBV_variablesType|@json_encode|escape:"url"}"{/if}
|
||||
{if $FBV_required} required aria-required="true"{/if}
|
||||
{if $FBV_rich && $localeDirection === "rtl"} dir="rtl"{/if}
|
||||
name="{$FBV_name|escape}[{$formLocale|escape}]">{$FBV_value[$formLocale]|default:""|escape}
|
||||
</textarea>
|
||||
{/strip}
|
||||
|
||||
{$FBV_label_content}
|
||||
|
||||
<div class="localization_popover">
|
||||
{foreach from=$formLocales key=thisFormLocale item=thisFormLocaleName}{if $formLocale != $thisFormLocale}
|
||||
{strip}
|
||||
{capture assign="localeDirection"}{locale_direction locale=$thisFormLocale}{/capture}
|
||||
<label for="{$FBV_id|escape}-{$thisFormLocale|escape}{$uniqId}" class="locale_textarea">{$thisFormLocaleName|escape}</label>
|
||||
<textarea id="{$FBV_id|escape}-{$thisFormLocale|escape}{$uniqId}" {$FBV_textAreaParams}
|
||||
placeholder="{$thisFormLocaleName|escape}"
|
||||
class="flag flag_{$thisFormLocale|escape} {$FBV_class} {$FBV_height}{if $FBV_rich && !$FBV_disabled} richContent{if $FBV_rich==="extended"} extendedRichContent{/if}{/if}"
|
||||
{if $FBV_disabled} disabled="disabled"{/if}
|
||||
{if $FBV_readonly} readonly="readonly"{/if}
|
||||
{if $FBV_wordCount} wordCount="{$FBV_wordCount|escape}"{/if}
|
||||
{if $FBV_variables} data-variables="{$FBV_variables|@json_encode|escape:"url"}"{/if}
|
||||
{if $FBV_variablesType} data-variablesType="{$FBV_variablesType|@json_encode|escape:"url"}"{/if}
|
||||
{if $FBV_required} required aria-required="true"{/if}
|
||||
{if $FBV_rich && $localeDirection === "rtl"} dir="rtl"{/if}
|
||||
name="{$FBV_name|escape}[{$thisFormLocale|escape}]">{$FBV_value[$thisFormLocale]|default:""|escape}
|
||||
</textarea>
|
||||
{/strip}
|
||||
{/if}{/foreach}
|
||||
</div>
|
||||
</span>
|
||||
{else}
|
||||
{* This is not a multilingual control or there is only one locale available *}
|
||||
{if $FBV_rich && $FBV_disabled}
|
||||
{if $FBV_multilingual}{$FBV_value[$formLocale]|strip_unsafe_html}{else}{$FBV_value|strip_unsafe_html}{/if}
|
||||
{else}
|
||||
{capture assign="localeDirection"}{locale_direction locale=$formLocale}{/capture}
|
||||
<textarea {$FBV_textAreaParams}
|
||||
class="{$FBV_class} {$FBV_height}{if $FBV_validation} {$FBV_validation|escape}{/if}{if $FBV_rich && !$FBV_disabled} richContent{if $FBV_rich==="extended"} extendedRichContent{/if}{/if}"
|
||||
{if $FBV_disabled} disabled="disabled"{/if}
|
||||
{if $FBV_readonly} readonly="readonly"{/if}
|
||||
{if $FBV_wordCount} wordCount="{$FBV_wordCount|escape}"{/if}
|
||||
{if $FBV_variables} data-variables="{$FBV_variables|@json_encode|escape:"url"}"{/if}
|
||||
{if $FBV_variablesType} data-variablesType="{$FBV_variablesType|@json_encode|escape:"url"}"{/if}
|
||||
{if $FBV_required} required aria-required="true"{/if}
|
||||
{if $FBV_rich && $localeDirection === "rtl"} dir="rtl"{/if}
|
||||
name="{$FBV_name|escape}{if $FBV_multilingual}[{$formLocale|escape}]{/if}"
|
||||
rows="{$FBV_rows|escape}"
|
||||
cols="{$FBV_cols|escape}"
|
||||
id="{$FBV_id|escape}{$uniqId}">{if $FBV_multilingual}{$FBV_value[$formLocale]|default:""|escape}{else}{$FBV_value|default:""|escape}{/if}</textarea>
|
||||
{/if}
|
||||
<span>{$FBV_label_content}</span>
|
||||
{/if}
|
||||
</div>
|
||||
Reference in New Issue
Block a user