Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions modules/backend/widgets/form/partials/_field_phone.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!-- URL -->
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Incorrect comment: should be "Phone" not "URL".

This appears to be a copy-paste artifact from another field partial.

Suggested fix
-<!-- URL -->
+<!-- Phone -->
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<!-- URL -->
<!-- Phone -->
🤖 Prompt for AI Agents
In `@modules/backend/widgets/form/partials/_field_phone.php` at line 1, The file’s
top HTML comment incorrectly reads "URL" due to copy-paste; update the comment
in the _field_phone.php partial to say "Phone" (or a more descriptive "Phone
field") so it accurately reflects the field purpose; locate the comment token at
the top of the partial and replace the text "URL" with "Phone".

<?php
$fieldOptions = $field->options();
$hasOptions = is_array($fieldOptions) && count($fieldOptions);
$listId = $hasOptions ? $field->getId() . '-list' : null;
?>
<div class="input-group static">
<span class="input-group-addon">
<i class="empty wn-icon-phone"></i>
</span>
<?php if ($this->previewMode): ?>
<?php if ($field->value): ?>
<a
href="tel:<?= e($field->value) ?>"
target="_blank"
rel="noopener noreferrer"
class="form-control"
>
<?= e($field->value) ?>
</a>
<?php else: ?>
<span class="form-control">&nbsp;</span>
<?php endif ?>
<?php else: ?>
<input
type="tel"
id="<?= $field->getId() ?>"
name="<?= $field->getName() ?>"
value="<?= e($field->value) ?>"
class="form-control"
<?= isset($field->autocomplete) && is_string($field->autocomplete) ? 'autocomplete="' . e($field->autocomplete) . '"' : '' ?>
<?= isset($field->maxlength) && is_numeric($field->maxlength) ? 'maxlength="' . e($field->maxlength) . '"' : '' ?>
<?= isset($field->minlength) && is_numeric($field->minlength) ? 'minlength="' . e($field->minlength) . '"' : '' ?>
<?= isset($field->pattern) && is_string($field->pattern) ? 'pattern="' . e($field->pattern) . '"' : '' ?>
<?= isset($field->placeholder) && is_string($field->placeholder) ? 'placeholder="' . e($field->placeholder) . '"' : '' ?>
<?= isset($field->size) && is_numeric($field->size) ? 'size="' . e($field->size) . '"' : '' ?>
<?= $field->getAttributes() ?>
<?= $listId ? 'list="' . e($listId) . '"' : '' ?>
/>
<?php if ($hasOptions): ?>
<datalist id="<?= e($listId) ?>">
<?php foreach ($fieldOptions as $value => $label): ?>
<?php $value = is_int($value) ? $label : $value ?>
<option value="<?= e($value) ?>"<?= $value !== $label ? ' label="' . e(trans($label)) . '"' : '' ?>></option>
<?php endforeach ?>
</datalist>
<?php endif ?>
<?php endif ?>
</div>
Loading