Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace js with css for third party types and membres #32614

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

atm-etienne
Copy link
Contributor

Qual #[Remove JS to add styles on third parties and membres types]

As CSS is powerful, we should not use JS to add or remove styles according to a checked value of an input.
In this way, I removed JQuery scripts in third parties and members page, to replace it with some CSS.

The only difference is that I hid the default checkox, since the button colours are significant enough, and it gives a more modern look

image

<label for="physical-input"><?= $langs->trans("Physical") ?></label>
</span>
<span class="nature paddinglarge marginrightonly">
<input type="radio" id="moral-input" name="morphy" value="mor" <?= $checkedNature == "mor" ? 'checked="checked"' : '' ?>>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace <?= with <?php echo
The tag <?= is often disabled on some secured php.

Copy link
Contributor Author

@atm-etienne atm-etienne Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The short echo tag <?= ... ?> can't be disabled, since PHP 5.4
What is disabled in the secured PHP is the short open tag <? ... ?>, which has not effect on the short echo tag

Mentioned in the php.ini

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; https://php.net/short-open-tag
short_open_tag = Off

; Note that this directive does not control the <?= shorthand tag, which can be used regardless of this directive.

I can still replace it, if you prefer, but I think the short echo tag is easier to read und understand, while printing lot of HTML code

@eldy eldy added the PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) label Jan 10, 2025
@hregis
Copy link
Contributor

hregis commented Jan 11, 2025

@atm-etienne @eldy my PR change codesniffer rule to find short open tag "<?" and exclude short echo tag "<?=" : #32634

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants