Skip to content

Commit

Permalink
Phase 1 convert BRANCH to PSR-12
Browse files Browse the repository at this point in the history
  • Loading branch information
joomla-bot committed Jun 27, 2022
1 parent 13a9df7 commit 8715bf5
Show file tree
Hide file tree
Showing 2 changed files with 187 additions and 189 deletions.
52 changes: 26 additions & 26 deletions layouts/joomla/form/field/textarea.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package Joomla.Site
* @subpackage Layout
Expand Down Expand Up @@ -54,36 +55,35 @@
*/

// Initialize some field attributes.
if ($charcounter)
{
// Load the js file
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('short-and-sweet');
if ($charcounter) {
// Load the js file
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('short-and-sweet');

// Set the css class to be used as the trigger
$charcounter = ' charcount';
// Set the text
$counterlabel = 'data-counter-label="' . $this->escape(Text::_('JFIELD_META_DESCRIPTION_COUNTER')) . '"';
// Set the css class to be used as the trigger
$charcounter = ' charcount';
// Set the text
$counterlabel = 'data-counter-label="' . $this->escape(Text::_('JFIELD_META_DESCRIPTION_COUNTER')) . '"';
}

$attributes = array(
$columns ? (is_numeric($columns) ? 'cols="' . $columns . '"' : $columns) : '',
$rows ? (is_numeric($rows) ? 'rows="' . $rows . '"' : $rows) : '',
!empty($class) ? 'class="form-control ' . $class . $charcounter . '"' : 'class="form-control' . $charcounter . '"',
!empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$onchange ? 'onchange="' . $onchange . '"' : '',
$onclick ? 'onclick="' . $onclick . '"' : '',
$required ? 'required' : '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete . '"' : '',
$autofocus ? 'autofocus' : '',
$spellcheck ? '' : 'spellcheck="false"',
$maxlength ? (is_numeric($maxlength) ? 'maxlength="' . $maxlength . '"' : $maxlength) : '',
!empty($counterlabel) ? $counterlabel : '',
$dataAttribute,
$columns ? (is_numeric($columns) ? 'cols="' . $columns . '"' : $columns) : '',
$rows ? (is_numeric($rows) ? 'rows="' . $rows . '"' : $rows) : '',
!empty($class) ? 'class="form-control ' . $class . $charcounter . '"' : 'class="form-control' . $charcounter . '"',
!empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$onchange ? 'onchange="' . $onchange . '"' : '',
$onclick ? 'onclick="' . $onclick . '"' : '',
$required ? 'required' : '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete . '"' : '',
$autofocus ? 'autofocus' : '',
$spellcheck ? '' : 'spellcheck="false"',
$maxlength ? (is_numeric($maxlength) ? 'maxlength="' . $maxlength . '"' : $maxlength) : '',
!empty($counterlabel) ? $counterlabel : '',
$dataAttribute,
);
?>
<textarea name="<?php
Expand Down

0 comments on commit 8715bf5

Please sign in to comment.