Implement code style for partials.

Adjust all partials to meet new code style.
This commit is contained in:
Ben Thomson 2022-05-02 16:34:47 +08:00
parent 747122f169
commit 175580aa2f
77 changed files with 707 additions and 381 deletions

View File

@ -33,15 +33,21 @@
<?php if ($importResults->hasMessages): ?>
<?php
$tabs = [
'skipped' => trans('backend::lang.import_export.skipped_rows'),
'warnings' => trans('backend::lang.import_export.warnings'),
'errors' => trans('backend::lang.import_export.errors'),
];
$tabs = [
'skipped' => trans('backend::lang.import_export.skipped_rows'),
'warnings' => trans('backend::lang.import_export.warnings'),
'errors' => trans('backend::lang.import_export.errors'),
];
if (!$importResults->skippedCount) unset($tabs['skipped']);
if (!$importResults->warningCount) unset($tabs['warnings']);
if (!$importResults->errorCount) unset($tabs['errors']);
if (!$importResults->skippedCount) {
unset($tabs['skipped']);
}
if (!$importResults->warningCount) {
unset($tabs['warnings']);
}
if (!$importResults->errorCount) {
unset($tabs['errors']);
}
?>
<div class="control-tabs secondary-tabs" data-control="tab">
<ul class="nav nav-tabs">

View File

@ -1,7 +1,7 @@
<?php foreach ($records as $record): ?>
<li data-record-id="<?= $record->getKey() ?>"
<?php if ($reorderSortMode === 'simple') : ?>
<?php if ($reorderSortMode === 'simple'): ?>
data-record-sort-order="<?= $record->{$record->getSortOrderColumn()} ?>"
<?php endif ?>
>

View File

@ -32,7 +32,7 @@
</button>
</div>
<?php if (is_null(config('cms.backendForceRemember', true))) : ?>
<?php if (is_null(config('cms.backendForceRemember', true))): ?>
<!-- Remember checkbox -->
<div class="form-group checkbox-field horizontal-form remember">
<div class="checkbox custom-checkbox">

View File

@ -1 +1 @@
<?= $this->relationRender('users'); ?>
<?= $this->relationRender('users') ?>

View File

@ -63,4 +63,4 @@
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('backend/users') ?>" class="btn btn-default"><?= e(trans('backend::lang.user.return')) ?></a></p>
</div>
<?php endif ?>
<?php endif ?>

View File

@ -1 +1 @@
<?= $this->listRender() ?>
<?= $this->listRender() ?>

View File

@ -65,4 +65,4 @@
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('backend/users') ?>" class="btn btn-default"><?= e(trans('backend::lang.user.return')) ?></a></p>
</div>
<?php endif ?>
<?php endif ?>

View File

@ -44,7 +44,7 @@
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('backend/users') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
</span>
<?php if ($formModel->trashed()) : ?>
<?php if ($formModel->trashed()): ?>
<button
type="button"
class="wn-icon-user-plus btn-icon info pull-right"
@ -85,4 +85,4 @@
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p><a href="<?= Backend::url('backend/users') ?>" class="btn btn-default"><?= e(trans('backend::lang.user.return')) ?></a></p>
</div>
<?php endif ?>
<?php endif ?>

View File

@ -1,14 +1,27 @@
<div
id="<?= $this->getId() ?>"
class="field-colorpicker <?php if($readOnly || $disabled || $this->previewMode): ?>disabled<?php endif; ?>"
class="
field-colorpicker
<?php if ($readOnly || $disabled || $this->previewMode): ?>
disabled
<?php endif; ?>
"
data-control="colorpicker"
data-formats="<?= e(json_encode($formats)) ?>"
data-available-colors="<?= e(json_encode($availableColors)) ?>"
<?php if ($showAlpha): ?>data-show-alpha="<?= $showAlpha ?>"<?php endif ?>
<?php if ($allowEmpty): ?>data-allow-empty="<?= $allowEmpty ?>"<?php endif ?>
<?php if ($allowCustom): ?>data-allow-custom="<?= $allowCustom ?>"<?php endif ?>
data-data-locker="#<?= $this->getId('input') ?>"
<?php if ($readOnly || $disabled || $this->previewMode): ?>data-disabled="true"<?php endif; ?>
<?php if ($showAlpha): ?>
data-show-alpha="<?= $showAlpha ?>"
<?php endif ?>
<?php if ($allowEmpty): ?>
data-allow-empty="<?= $allowEmpty ?>"
<?php endif ?>
<?php if ($allowCustom): ?>
data-allow-custom="<?= $allowCustom ?>"
<?php endif ?>
<?php if ($readOnly || $disabled || $this->previewMode): ?>
data-disabled="true"
<?php endif; ?>
<?= $this->formField->getAttributes() ?>
>
@ -26,7 +39,9 @@
class="form-control"
placeholder="No color"
value="<?= $value ?>"
<?php if ($disabled): ?> disabled<?php endif ?>
<?php if ($disabled): ?>
disabled
<?php endif ?>
>
<?php endif ?>
<div

View File

@ -10,14 +10,26 @@
id="<?= $this->getId() ?>"
class="field-datepicker"
data-control="datepicker"
<?php if ($formatMoment): ?>data-format="<?= $formatMoment ?>"<?php endif ?>
<?php if ($minDate): ?>data-min-date="<?= $minDate ?>"<?php endif ?>
<?php if ($maxDate): ?>data-max-date="<?= $maxDate ?>"<?php endif ?>
data-mode="<?= $mode ?>"
<?php if ($yearRange): ?>data-year-range="<?= $yearRange ?>"<?php endif ?>
<?php if ($firstDay): ?>data-first-day="<?= $firstDay ?>"<?php endif ?>
data-show-week-number="<?= $showWeekNumber ?>"
<?php if ($ignoreTimezone): ?>data-ignore-timezone<?php endif ?>
<?php if ($formatMoment): ?>
data-format="<?= $formatMoment ?>"
<?php endif ?>
<?php if ($minDate): ?>
data-min-date="<?= $minDate ?>"
<?php endif ?>
<?php if ($maxDate): ?>
data-max-date="<?= $maxDate ?>"
<?php endif ?>
<?php if ($yearRange): ?>
data-year-range="<?= $yearRange ?>"
<?php endif ?>
<?php if ($firstDay): ?>
data-first-day="<?= $firstDay ?>"
<?php endif ?>
<?php if ($ignoreTimezone): ?>
data-ignore-timezone
<?php endif ?>
>
<?php if ($mode == 'date'): ?>

View File

@ -7,8 +7,12 @@
data-error-template="#<?= $this->getId('errorTemplate') ?>"
data-sort-handler="<?= $this->getEventHandler('onSortAttachments') ?>"
data-max-filesize="<?= $maxFilesize ?>"
<?php if ($useCaption): ?>data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"<?php endif ?>
<?php if ($acceptedFileTypes): ?>data-file-types="<?= $acceptedFileTypes ?>"<?php endif ?>
<?php if ($useCaption): ?>
data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"
<?php endif ?>
<?php if ($acceptedFileTypes): ?>
data-file-types="<?= $acceptedFileTypes ?>"
<?php endif ?>
<?= $this->formField->getAttributes() ?>
>

View File

@ -6,8 +6,12 @@
data-template="#<?= $this->getId('template') ?>"
data-error-template="#<?= $this->getId('errorTemplate') ?>"
data-max-filesize="<?= $maxFilesize ?>"
<?php if ($useCaption): ?>data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"<?php endif ?>
<?php if ($acceptedFileTypes): ?>data-file-types="<?= $acceptedFileTypes ?>"<?php endif ?>
<?php if ($useCaption): ?>
data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"
<?php endif ?>
<?php if ($acceptedFileTypes): ?>
data-file-types="<?= $acceptedFileTypes ?>"
<?php endif ?>
<?= $this->formField->getAttributes() ?>
>

View File

@ -4,9 +4,8 @@
<?php else: ?>
<?php switch ($displayMode):
case 'image-single': ?>
<?php switch ($displayMode): ?>
<?php case 'image-single': ?>
<?= $this->makePartial('image_single') ?>
<?php break ?>
@ -21,7 +20,6 @@
<?php case 'file-multi': ?>
<?= $this->makePartial('file_multi') ?>
<?php break ?>
<?php endswitch ?>
<!-- Error template -->
@ -36,4 +34,4 @@
</div>
</script>
<?php endif ?>
<?php endif ?>

View File

@ -7,8 +7,12 @@
data-error-template="#<?= $this->getId('errorTemplate') ?>"
data-sort-handler="<?= $this->getEventHandler('onSortAttachments') ?>"
data-max-filesize="<?= $maxFilesize ?>"
<?php if ($useCaption): ?>data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"<?php endif ?>
<?php if ($acceptedFileTypes): ?>data-file-types="<?= $acceptedFileTypes ?>"<?php endif ?>
<?php if ($useCaption): ?>
data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"
<?php endif ?>
<?php if ($acceptedFileTypes): ?>
data-file-types="<?= $acceptedFileTypes ?>"
<?php endif ?>
<?= $this->formField->getAttributes() ?>
>

View File

@ -8,8 +8,12 @@
data-thumbnail-width="<?= $imageWidth ?: '0' ?>"
data-thumbnail-height="<?= $imageHeight ?: '0' ?>"
data-max-filesize="<?= $maxFilesize ?>"
<?php if ($useCaption): ?>data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"<?php endif ?>
<?php if ($acceptedFileTypes): ?>data-file-types="<?= $acceptedFileTypes ?>"<?php endif ?>
<?php if ($useCaption): ?>
data-config-handler="<?= $this->getEventHandler('onLoadAttachmentConfig') ?>"
<?php endif ?>
<?php if ($acceptedFileTypes): ?>
data-file-types="<?= $acceptedFileTypes ?>"
<?php endif ?>
<?= $this->formField->getAttributes() ?>
>

View File

@ -3,13 +3,26 @@
<?php else: ?>
<div
id="<?= $this->getId() ?>"
class="field-markdowneditor size-<?= $size ?> <?= $stretch?'layout-relative stretch':'' ?> <?php if ($readOnly || $disabled): ?>disabled<?php endif; ?>"
class="
field-markdowneditor
size-<?= $size ?>
<?php if ($stretch): ?>
layout-relative stretch
<?php endif ?>
<?php if ($readOnly || $disabled): ?>
disabled
<?php endif ?>
"
data-control="markdowneditor"
data-refresh-handler="<?= $this->getEventHandler('onRefresh') ?>"
data-view-mode="<?= $mode ?>"
<?php if ($useMediaManager): ?>data-use-media-manager="true"<?php endif ?>
<?php if ($useMediaManager): ?>
data-use-media-manager="true"
<?php endif ?>
data-vendor-path="<?= Url::asset('/modules/backend/formwidgets/codeeditor/assets/vendor/ace') ?>"
<?php if ($readOnly || $disabled): ?>data-disabled="true"<?php endif; ?>
<?php if ($readOnly || $disabled): ?>
data-disabled="true"
<?php endif; ?>
<?= $this->formField->getAttributes() ?>>
<div class="control-toolbar editor-toolbar"></div>

View File

@ -1,6 +1,15 @@
<div
id="<?= $this->getId() ?>"
class="field-mediafinder style-file-single <?= $value ? 'is-populated' : '' ?> <?= $this->previewMode ? 'is-preview' : '' ?>"
class="
field-mediafinder
style-file-single
<?php if ($value): ?>
is-populated
<?php endif ?>
<?php if ($this->previewMode): ?>
is-preview
<?php endif ?>
"
data-control="mediafinder"
<?= $field->getAttributes() ?>
>

View File

@ -1,6 +1,16 @@
<div
id="<?= $this->getId() ?>"
class="field-mediafinder style-image-single is-image <?= $value ? 'is-populated' : '' ?> <?= $this->previewMode ? 'is-preview' : '' ?>"
class="
field-mediafinder
style-image-single
is-image
<?php if ($value): ?>
is-populated
<?php endif ?>
<?php if ($this->previewMode): ?>
is-preview
<?php endif ?>
"
data-control="mediafinder"
data-thumbnail-width="<?= $imageWidth ?: '0' ?>"
data-thumbnail-height="<?= $imageHeight ?: '0' ?>"
@ -18,7 +28,7 @@
<img data-find-image src="<?= $imageUrl ?>" alt="" />
</div>
<?php if (!$imageExists && !empty($imageUrl)) : ?>
<?php if (!$imageExists && !empty($imageUrl)): ?>
<p data-find-error class="help-block">
<?= e(trans('backend::lang.mediafinder.no_image')) ?>
</p>

View File

@ -11,7 +11,7 @@
<th class="permission-type"><?= $firstTab ? e(trans('backend::lang.user.allow')) : '' ?></th>
<?php if ($this->mode === 'radio') : ?>
<?php if ($this->mode === 'radio'): ?>
<th class="permission-type"><?= $firstTab ? e(trans('backend::lang.user.inherit')) : '' ?></th>
<th class="permission-type"><?= $firstTab ? e(trans('backend::lang.user.deny')) : '' ?></th>
<?php endif; ?>
@ -23,28 +23,30 @@
$lastIndex = count($tabPermissions) - 1;
?>
<?php foreach ($tabPermissions as $index => $permission): ?>
<?php
$globalIndex++;
$globalIndex++;
switch ($this->mode) {
case 'radio':
$permissionValue = array_key_exists($permission->code, $permissionsData)
? $permissionsData[$permission->code]
: 0;
break;
case 'switch':
$isChecked = !((int) @$permissionsData[$permission->code] === -1);
break;
case 'checkbox':
default:
$isChecked = array_key_exists($permission->code, $permissionsData);
break;
}
switch ($this->mode) {
case 'radio':
$permissionValue = array_key_exists($permission->code, $permissionsData)
? $permissionsData[$permission->code]
: 0;
break;
case 'switch':
$isChecked = !((int) @$permissionsData[$permission->code] === -1);
break;
case 'checkbox':
default:
$isChecked = array_key_exists($permission->code, $permissionsData);
break;
}
$allowId = $this->getId('permission-' . $globalIndex . '-allow');
$inheritId = $this->getId('permission-' . $globalIndex . '-inherit');
$denyId = $this->getId('permission-' . $globalIndex . '-deny');
$allowId = $this->getId('permission-' . $globalIndex . '-allow');
$inheritId = $this->getId('permission-' . $globalIndex . '-inherit');
$denyId = $this->getId('permission-' . $globalIndex . '-deny');
?>
<tr class="<?= $lastIndex == $index ? 'last-section-row' : '' ?>
<?= $checkboxMode ? 'mode-checkbox' : 'mode-radio' ?>
<?= $checkboxMode && !$isChecked ? 'disabled' : '' ?>
@ -137,9 +139,8 @@
<td></td>
</tr>
<?php endforeach ?>
<?php
$firstTab = false;
?>
<?php $firstTab = false; ?>
<?php endforeach ?>
</table>
<div class="permissions-overlay"></div>

View File

@ -1,8 +1,8 @@
<?php
$previewMode = false;
if ($this->previewMode || $field->readOnly) {
$previewMode = true;
}
$previewMode = false;
if ($this->previewMode || $field->readOnly) {
$previewMode = true;
}
?>
<div
id="<?= $this->getId() ?>"

View File

@ -5,24 +5,59 @@
<div
id="<?= $this->getId() ?>"
class="field-richeditor size-<?= $size ?> <?= $stretch?'layout-relative stretch':'' ?>"
<?php if ($fullPage): ?>data-fullpage="true"<?php endif ?>
<?php if ($readOnly): ?>data-read-only="true"<?php endif ?>
<?php if ($useMediaManager): ?>data-use-media-manager="true"<?php endif ?>
<?php if ($editorLang): ?>data-editor-lang="<?= $editorLang ?>"<?php endif ?>
<?php if ($toolbarButtons): ?>data-toolbar-buttons="<?= implode(',', $toolbarButtons) ?>"
<?php elseif ($globalToolbarButtons): ?>data-toolbar-buttons="<?= str_replace(" ", "", $globalToolbarButtons) ?>"<?php endif ?>
<?php if ($allowEmptyTags): ?>data-allow-empty-tags="<?= e($allowEmptyTags) ?>"<?php endif ?>
<?php if ($allowTags): ?>data-allow-tags="<?= e($allowTags) ?>"<?php endif ?>
<?php if ($allowAttributes): ?>data-allow-attributes="<?= e($allowAttributes) ?>"<?php endif ?>
<?php if ($noWrapTags): ?>data-no-wrap-tags="<?= e($noWrapTags) ?>"<?php endif ?>
<?php if ($removeTags): ?>data-remove-tags="<?= e($removeTags) ?>"<?php endif ?>
<?php if ($lineBreakerTags): ?>data-line-breaker-tags="<?= e($lineBreakerTags) ?>"<?php endif ?>
<?php if (isset($imageStyles)): ?>data-image-styles="<?= e(json_encode($imageStyles)) ?>"<?php endif ?>
<?php if (isset($linkStyles)): ?>data-link-styles="<?= e(json_encode($linkStyles)) ?>"<?php endif ?>
<?php if (isset($paragraphStyles)): ?>data-paragraph-styles="<?= e(json_encode($paragraphStyles)) ?>"<?php endif ?>
<?php if (isset($paragraphFormats)): ?>data-paragraph-format="<?= e(json_encode($paragraphFormats)) ?>"<?php endif ?>
<?php if (isset($tableStyles)): ?>data-table-styles="<?= e(json_encode($tableStyles)) ?>"<?php endif ?>
<?php if (isset($tableCellStyles)): ?>data-table-cell-styles="<?= e(json_encode($tableCellStyles)) ?>"<?php endif ?>
<?php if ($fullPage): ?>
data-fullpage="true"
<?php endif ?>
<?php if ($readOnly): ?>
data-read-only="true"
<?php endif ?>
<?php if ($useMediaManager): ?>
data-use-media-manager="true"
<?php endif ?>
<?php if ($editorLang): ?>
data-editor-lang="<?= $editorLang ?>"
<?php endif ?>
<?php if ($toolbarButtons): ?>
data-toolbar-buttons="<?= implode(',', $toolbarButtons) ?>"
<?php elseif ($globalToolbarButtons): ?>
data-toolbar-buttons="<?= str_replace(" ", "", $globalToolbarButtons) ?>"
<?php endif ?>
<?php if ($allowEmptyTags): ?>
data-allow-empty-tags="<?= e($allowEmptyTags) ?>"
<?php endif ?>
<?php if ($allowTags): ?>
data-allow-tags="<?= e($allowTags) ?>"
<?php endif ?>
<?php if ($allowAttributes): ?>
data-allow-attributes="<?= e($allowAttributes) ?>"
<?php endif ?>
<?php if ($noWrapTags): ?>
data-no-wrap-tags="<?= e($noWrapTags) ?>"
<?php endif ?>
<?php if ($removeTags): ?>
data-remove-tags="<?= e($removeTags) ?>"
<?php endif ?>
<?php if ($lineBreakerTags): ?>
data-line-breaker-tags="<?= e($lineBreakerTags) ?>"
<?php endif ?>
<?php if (isset($imageStyles)): ?>
data-image-styles="<?= e(json_encode($imageStyles)) ?>"
<?php endif ?>
<?php if (isset($linkStyles)): ?>
data-link-styles="<?= e(json_encode($linkStyles)) ?>"
<?php endif ?>
<?php if (isset($paragraphStyles)): ?>
data-paragraph-styles="<?= e(json_encode($paragraphStyles)) ?>"
<?php endif ?>
<?php if (isset($paragraphFormats)): ?>
data-paragraph-format="<?= e(json_encode($paragraphFormats)) ?>"
<?php endif ?>
<?php if (isset($tableStyles)): ?>
data-table-styles="<?= e(json_encode($tableStyles)) ?>"
<?php endif ?>
<?php if (isset($tableCellStyles)): ?>
data-table-cell-styles="<?= e(json_encode($tableCellStyles)) ?>"
<?php endif ?>
data-links-handler="<?= $this->getEventHandler('onLoadPageLinksForm') ?>"
data-upload-handler="<?= $this->getEventHandler('onUpload') ?>"
data-ace-vendor-path="<?= Url::asset('/modules/backend/formwidgets/codeeditor/assets/vendor/ace') ?>"

View File

@ -2,7 +2,9 @@
data-control="sensitive"
data-clean="true"
data-event-handler="<?= $this->getEventHandler('onShowValue') ?>"
<?php if ($hideOnTabChange): ?>data-hide-on-tab-change="true"<?php endif ?>
<?php if ($hideOnTabChange): ?>
data-hide-on-tab-change="true"
<?php endif ?>
>
<div class="loading-indicator-container size-form-field">
<div class="input-group">
@ -13,7 +15,9 @@
value="<?= ($hasValue) ? $hiddenPlaceholder : '' ?>"
placeholder="<?= e(trans($this->formField->placeholder)) ?>"
class="form-control"
<?php if ($this->previewMode): ?>disabled="disabled"<?php endif ?>
<?php if ($this->previewMode): ?>
disabled="disabled"
<?php endif ?>
autocomplete="off"
data-input
/>

View File

@ -1,16 +1,16 @@
<?php
$selectedValues = is_array($selectedValues) ? $selectedValues : [];
$availableOptions = $useKey ? $fieldOptions : array_unique(array_merge($selectedValues, $fieldOptions));
$displayOnlyOptions = [];
$selectedValues = is_array($selectedValues) ? $selectedValues : [];
$availableOptions = $useKey ? $fieldOptions : array_unique(array_merge($selectedValues, $fieldOptions));
$displayOnlyOptions = [];
foreach ($availableOptions as $key => $option) {
if (!strlen($option)) {
continue;
}
if (($useKey && in_array($key, $selectedValues)) || (!$useKey && in_array($option, $selectedValues))) {
$displayOnlyOptions[] = $option;
}
foreach ($availableOptions as $key => $option) {
if (!strlen($option)) {
continue;
}
if (($useKey && in_array($key, $selectedValues)) || (!$useKey && in_array($option, $selectedValues))) {
$displayOnlyOptions[] = $option;
}
}
?>
<!-- Tag List -->
<?php if ($this->previewMode || $field->readOnly || $field->disabled): ?>
@ -37,12 +37,18 @@
id="<?= $field->getId() ?>"
name="<?= $field->getName() ?>[]"
class="form-control custom-select <?= !count($fieldOptions) ? 'select-no-dropdown' : '' ?> select-hide-selected"
<?php if (!empty($customSeparators)): ?>data-token-separators="<?= $customSeparators ?>"<?php endif ?>
<?php if (!empty($placeholder)): ?>data-placeholder="<?= e(trans($placeholder)) ?>"<?php endif ?>
<?php if (!empty($customSeparators)): ?>
data-token-separators="<?= $customSeparators ?>"
<?php endif ?>
<?php if (!empty($placeholder)): ?>
data-placeholder="<?= e(trans($placeholder)) ?>"
<?php endif ?>
multiple
<?= $field->getAttributes() ?>>
<?php foreach ($availableOptions as $key => $option): ?>
<?php if (!strlen($option)) continue ?>
<?php if (!strlen($option)) {
continue;
} ?>
<?php if ($useKey): ?>
<option value="<?= e($key) ?>" <?= in_array($key, $selectedValues) ? 'selected="selected"' : '' ?>><?= e(trans($option)) ?></option>
<?php else: ?>

View File

@ -9,64 +9,65 @@
*/
$ua = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : null;
if (!$ua)
if (!$ua) {
return;
}
$g = 'gecko';
$w = 'webkit';
$s = 'safari';
$m = 'mobile';
$b = array();
$b = [];
// browser
if(!preg_match('/opera|webtv/i', $ua) && preg_match('/msie\s(\d)/', $ua, $array)) {
if (!preg_match('/opera|webtv/i', $ua) && preg_match('/msie\s(\d)/', $ua, $array)) {
$b[] = 'ie ie' . $array[1];
} else if(strstr($ua, 'firefox/2')) {
} elseif (strstr($ua, 'firefox/2')) {
$b[] = $g . ' ff2';
} else if(strstr($ua, 'firefox/3.5')) {
} elseif (strstr($ua, 'firefox/3.5')) {
$b[] = $g . ' ff3 ff3_5';
} else if(strstr($ua, 'firefox/3')) {
} elseif (strstr($ua, 'firefox/3')) {
$b[] = $g . ' ff3';
} else if(strstr($ua, 'gecko/')) {
} elseif (strstr($ua, 'gecko/')) {
$b[] = $g;
} else if(preg_match('/opera(\s|\/)(\d+)/', $ua, $array)) {
} elseif (preg_match('/opera(\s|\/)(\d+)/', $ua, $array)) {
$b[] = 'opera opera' . $array[2];
} else if(strstr($ua, 'konqueror')) {
} elseif (strstr($ua, 'konqueror')) {
$b[] = 'konqueror';
} else if(strstr($ua, 'chrome')) {
} elseif (strstr($ua, 'chrome')) {
$b[] = $w . ' ' . $s . ' chrome';
} else if(strstr($ua, 'iron')) {
} elseif (strstr($ua, 'iron')) {
$b[] = $w . ' ' . $s . ' iron';
} else if(strstr($ua, 'applewebkit/')) {
} elseif (strstr($ua, 'applewebkit/')) {
$b[] = (preg_match('/version\/(\d+)/i', $ua, $array)) ? $w . ' ' . $s . ' ' . $s . $array[1] : $w . ' ' . $s;
} else if(strstr($ua, 'mozilla/')) {
} elseif (strstr($ua, 'mozilla/')) {
$b[] = $g;
}
// platform
if(strstr($ua, 'j2me')) {
if (strstr($ua, 'j2me')) {
$b[] = $m . ' j2me';
} else if(strstr($ua, 'iphone')) {
} elseif (strstr($ua, 'iphone')) {
$b[] = $m . ' iphone';
} else if(strstr($ua, 'ipod')) {
} elseif (strstr($ua, 'ipod')) {
$b[] = $m . ' ipod';
} else if(strstr($ua, 'ipad')) {
} elseif (strstr($ua, 'ipad')) {
$b[] = $m . ' ipad';
} else if(strstr($ua, 'android')) {
} elseif (strstr($ua, 'android')) {
$b[] = $m . ' android';
} else if(strstr($ua, 'blackberry')) {
} elseif (strstr($ua, 'blackberry')) {
$b[] = $m . ' blackberry';
} else if(strstr($ua, 'mac')) {
} elseif (strstr($ua, 'mac')) {
$b[] = 'mac';
} else if(strstr($ua, 'darwin')) {
} elseif (strstr($ua, 'darwin')) {
$b[] = 'mac';
} else if(strstr($ua, 'webtv')) {
} elseif (strstr($ua, 'webtv')) {
$b[] = 'webtv';
} else if(strstr($ua, 'win')) {
} elseif (strstr($ua, 'win')) {
$b[] = 'win';
} else if(strstr($ua, 'freebsd')) {
} elseif (strstr($ua, 'freebsd')) {
$b[] = 'freebsd';
} else if(strstr($ua, 'x11') || strstr($ua, 'linux')) {
} elseif (strstr($ua, 'x11') || strstr($ua, 'linux')) {
$b[] = 'linux';
}

View File

@ -12,49 +12,49 @@
<?= e(trans($this->pageTitle)) ?> | <?= e(Backend\Models\BrandSetting::get('app_name')) ?>
</title>
<?php
$coreBuild = System\Models\Parameter::get('system::core.build', 1);
$coreBuild = System\Models\Parameter::get('system::core.build', 1);
// Styles
$styles = [
Url::asset('modules/system/assets/ui/storm.css'),
Backend::skinAsset('assets/css/winter.css'),
];
// Styles
$styles = [
Url::asset('modules/system/assets/ui/storm.css'),
Backend::skinAsset('assets/css/winter.css'),
];
// Scripts
$scripts = [
Backend::skinAsset('assets/js/vendor/jquery.min.js'),
Backend::skinAsset('assets/js/vendor/jquery-migrate.min.js'),
Url::asset('modules/system/assets/js/framework.js'),
Url::asset('modules/system/assets/js/build/manifest.js'),
Url::asset('modules/system/assets/js/build/vendor.js'),
Url::asset('modules/system/assets/js/snowboard/build/snowboard.vendor.js'),
Url::asset('modules/system/assets/js/build/system.js'),
];
if (Config::get('develop.decompileBackendAssets', false)) {
$scripts = array_merge($scripts, Backend::decompileAsset('modules/system/assets/ui/storm.js'));
$scripts = array_merge($scripts, Backend::decompileAsset('assets/js/winter.js', true));
} else {
$scripts = array_merge($scripts, [Url::asset('modules/system/assets/ui/storm-min.js')]);
$scripts = array_merge($scripts, [Backend::skinAsset('assets/js/winter-min.js')]);
}
$scripts = array_merge($scripts, [
Url::asset('modules/system/assets/js/lang/lang.'.App::getLocale().'.js'),
Backend::skinAsset('assets/js/winter.flyout.js'),
Backend::skinAsset('assets/js/winter.tabformexpandcontrols.js'),
]);
// Scripts
$scripts = [
Backend::skinAsset('assets/js/vendor/jquery.min.js'),
Backend::skinAsset('assets/js/vendor/jquery-migrate.min.js'),
Url::asset('modules/system/assets/js/framework.js'),
Url::asset('modules/system/assets/js/build/manifest.js'),
Url::asset('modules/system/assets/js/build/vendor.js'),
Url::asset('modules/system/assets/js/snowboard/build/snowboard.vendor.js'),
Url::asset('modules/system/assets/js/build/system.js'),
];
if (Config::get('develop.decompileBackendAssets', false)) {
$scripts = array_merge($scripts, Backend::decompileAsset('modules/system/assets/ui/storm.js'));
$scripts = array_merge($scripts, Backend::decompileAsset('assets/js/winter.js', true));
} else {
$scripts = array_merge($scripts, [Url::asset('modules/system/assets/ui/storm-min.js')]);
$scripts = array_merge($scripts, [Backend::skinAsset('assets/js/winter-min.js')]);
}
$scripts = array_merge($scripts, [
Url::asset('modules/system/assets/js/lang/lang.'.App::getLocale().'.js'),
Backend::skinAsset('assets/js/winter.flyout.js'),
Backend::skinAsset('assets/js/winter.tabformexpandcontrols.js'),
]);
?>
<?php foreach ($styles as $style) : ?>
<?php foreach ($styles as $style): ?>
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="stylesheet" importance="high">
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="preload" as="style" importance="high">
<?php endforeach; ?>
<?php foreach ($scripts as $script) : ?>
<?php foreach ($scripts as $script): ?>
<script data-cfasync="false" src="<?= $script . '?v=' . $coreBuild; ?>" importance="high"></script>
<link href="<?= $script . '?v=' . $coreBuild; ?>" rel="preload" as="script" importance="high">
<?php endforeach; ?>
<?php if (!Config::get('cms.enableBackendServiceWorkers', false)) : ?>
<?php if (!Config::get('cms.enableBackendServiceWorkers', false)): ?>
<script>
"use strict";
/* Only run on HTTPS connections

View File

@ -1,12 +1,19 @@
<?php if (empty($hintName) || !$this->isBackendHintHidden($hintName)): ?>
<?php
$type = !empty($type) ? $type : 'info';
$cssClasses = ['callout fade in'];
$cssClasses[] = 'callout-'.$type;
if (empty($icon)) $cssClasses[] = 'no-icon';
if (empty($subtitle)) $cssClasses[] = 'no-subheader';
if (!empty($cssClass)) $cssClasses[] = $cssClass;
$type = !empty($type) ? $type : 'info';
$cssClasses = ['callout fade in'];
$cssClasses[] = 'callout-'.$type;
if (empty($icon)) {
$cssClasses[] = 'no-icon';
}
if (empty($subtitle)) {
$cssClasses[] = 'no-subheader';
}
if (!empty($cssClass)) {
$cssClasses[] = $cssClass;
}
?>
<div class="<?= implode(' ', $cssClasses) ?>">
<?php if (!empty($hintName)): ?>
<button
@ -19,9 +26,13 @@
<?php endif ?>
<?php if (!empty($title)): ?>
<div class="header">
<?php if (!empty($icon)): ?><i class="<?= $icon ?>"></i><?php endif ?>
<?php if (!empty($icon)): ?>
<i class="<?= $icon ?>"></i>
<?php endif ?>
<h3><?= $title ?></h3>
<?php if (!empty($subtitle)): ?><p><?= $subtitle ?></p><?php endif ?>
<?php if (!empty($subtitle)): ?>
<p><?= $subtitle ?></p>
<?php endif ?>
</div>
<?php endif ?>
<div class="content">
@ -32,4 +43,4 @@
<?php endif ?>
</div>
</div>
<?php endif ?>
<?php endif ?>

View File

@ -1,8 +1,9 @@
<?php
$activeItem = BackendMenu::getActiveMainMenuItem();
$mySettings = System\Classes\SettingsManager::instance()->listItems('mysettings');
$navbarMode = Backend\Models\BrandSetting::get('menu_mode', 'inline');
$activeItem = BackendMenu::getActiveMainMenuItem();
$mySettings = System\Classes\SettingsManager::instance()->listItems('mysettings');
$navbarMode = Backend\Models\BrandSetting::get('menu_mode', 'inline');
?>
<nav class="navbar control-toolbar navbar-mode-<?= $navbarMode ?>" id="layout-mainmenu" role="navigation">
<div class="toolbar-item toolbar-primary">
<div data-control="toolbar" data-use-native-drag="true">
@ -38,7 +39,9 @@
<span
class="counter <?= !$item->counter ? 'empty' : null ?>"
data-menu-id="<?= e($item->code) ?>"
<?php if ($item->counterLabel): ?>title="<?= e(trans($item->counterLabel)) ?>"<?php endif ?>
<?php if ($item->counterLabel): ?>
title="<?= e(trans($item->counterLabel)) ?>"
<?php endif ?>
>
<?= e($item->counter) ?>
</span>
@ -90,7 +93,7 @@
<li>
<a href="<?= Backend::url('backend/auth/signout') ?>">
<?php if (\BackendAuth::isImpersonator()) : ?>
<?php if (\BackendAuth::isImpersonator()): ?>
<?= e(trans('backend::lang.account.stop_impersonating')) ?>
<?php else: ?>
<?= e(trans('backend::lang.account.sign_out')) ?>

View File

@ -35,7 +35,9 @@
<span
class="counter <?= $item->counter === null ? 'empty' : null ?>"
data-menu-id="<?= e($context->mainMenuCode.'/'.$sideItemCode) ?>"
<?php if ($item->counterLabel): ?>title="<?= e(trans($item->counterLabel)) ?>"<?php endif ?>
<?php if ($item->counterLabel): ?>
title="<?= e(trans($item->counterLabel)) ?>"
<?php endif ?>
>
<?= e($item->counter) ?>
</span>

View File

@ -11,33 +11,33 @@
<title><?= e(trans('backend::lang.auth.title')) ?></title>
<?php
$coreBuild = System\Models\Parameter::get('system::core.build', 1);
$styles = [
Url::asset('modules/system/assets/ui/storm.css'),
Backend::skinAsset('assets/css/winter.css'),
];
$scripts = [
Backend::skinAsset('assets/js/vendor/jquery.min.js'),
Backend::skinAsset('assets/js/vendor/jquery-migrate.min.js'),
Url::asset('modules/system/assets/js/framework.js'),
Url::asset('modules/system/assets/ui/storm-min.js'),
Backend::skinAsset('assets/js/winter-min.js'),
Url::asset('modules/backend/assets/js/auth/auth.js'),
Url::asset('modules/system/assets/js/lang/lang.'.App::getLocale().'.js'),
];
$coreBuild = System\Models\Parameter::get('system::core.build', 1);
$styles = [
Url::asset('modules/system/assets/ui/storm.css'),
Backend::skinAsset('assets/css/winter.css'),
];
$scripts = [
Backend::skinAsset('assets/js/vendor/jquery.min.js'),
Backend::skinAsset('assets/js/vendor/jquery-migrate.min.js'),
Url::asset('modules/system/assets/js/framework.js'),
Url::asset('modules/system/assets/ui/storm-min.js'),
Backend::skinAsset('assets/js/winter-min.js'),
Url::asset('modules/backend/assets/js/auth/auth.js'),
Url::asset('modules/system/assets/js/lang/lang.'.App::getLocale().'.js'),
];
?>
<?php foreach ($styles as $style) : ?>
<?php foreach ($styles as $style): ?>
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="stylesheet" importance="high">
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="preload" as="style" importance="high">
<?php endforeach; ?>
<?php foreach ($scripts as $script) : ?>
<?php foreach ($scripts as $script): ?>
<script data-cfasync="false" src="<?= $script . '?v=' . $coreBuild; ?>" importance="high"></script>
<link href="<?= $script . '?v=' . $coreBuild; ?>" rel="preload" as="script" importance="high">
<?php endforeach; ?>
<?php if (!Config::get('cms.enableBackendServiceWorkers', false)) : ?>
<?php if (!Config::get('cms.enableBackendServiceWorkers', false)): ?>
<script>
"use strict";
/* Only run on HTTPS connections

View File

@ -6,7 +6,7 @@
</head>
<body class="<?= $this->bodyClass ?>">
<div id="layout-canvas">
<?php if (\BackendAuth::isImpersonator()) : ?>
<?php if (\BackendAuth::isImpersonator()): ?>
<div class="global-notice">
<div class="notice-content">
<span class="notice-text">
@ -85,4 +85,4 @@
<div id="layout-flash-messages"><?= $this->makeLayoutPartial('flash_messages') ?></div>
</body>
</html>
</html>

View File

@ -3,7 +3,9 @@
class="filter-scope <?= $scope->value ? 'active' : '' ?>"
href="javascript:;"
data-scope-name="<?= $scope->scopeName ?>"
<?php if ($depends = $this->getScopeDepends($scope)): ?>data-scope-depends="<?= $depends ?>"<?php endif ?>
<?php if ($depends = $this->getScopeDepends($scope)): ?>
data-scope-depends="<?= $depends ?>"
<?php endif ?>
>
<span class="filter-label"><?= e(trans($scope->label)) ?>:</span>
<span class="filter-setting"><?= $scope->value ? count($scope->value) : e(trans('backend::lang.filter.all')) ?></span>

View File

@ -1,9 +1,11 @@
<div
class="form-group <?= $this->previewMode ? 'form-group-preview' : '' ?> <?= $field->type ?>-field span-<?= $field->span ?> <?= $field->required?'is-required':'' ?> <?= $field->stretch?'layout-relative':'' ?> <?= $field->cssClass ?>"
<?php if ($depends = $this->getFieldDepends($field)): ?>data-field-depends="<?= $depends ?>"<?php endif ?>
<?php if ($depends = $this->getFieldDepends($field)): ?>
data-field-depends="<?= $depends ?>"
<?php endif ?>
data-field-name="<?= $field->fieldName ?>"
<?= $field->getAttributes('container') ?>
id="<?= $field->getId('group') ?>"><?=
/* Must be on the same line for :empty selector */
trim($this->makePartial('field', ['field' => $field]))
?></div>
?></div>

View File

@ -1,5 +1,5 @@
<?php
$fieldOptions = $field->options();
$fieldOptions = $field->options();
?>
<!-- Balloon selector -->
<div

View File

@ -1,21 +1,27 @@
<?php
$fieldOptions = $field->options();
$checkedValues = (array) $field->value;
$isScrollable = count($fieldOptions) > 10;
$readOnly = $this->previewMode || $field->readOnly || $field->disabled;
$quickselectEnabled = $field->getConfig('quickselect', $isScrollable);
$fieldOptions = $field->options();
$checkedValues = (array) $field->value;
$isScrollable = count($fieldOptions) > 10;
$readOnly = $this->previewMode || $field->readOnly || $field->disabled;
$quickselectEnabled = $field->getConfig('quickselect', $isScrollable);
?>
<!-- Checkbox List -->
<?php if ($readOnly && $field->value): ?>
<div class="field-checkboxlist">
<?php $index = 0; foreach ($fieldOptions as $value => $option): ?>
<?php
$index++;
$checkboxId = 'checkbox_'.$field->getId().'_'.$index;
if (!in_array($value, $checkedValues)) continue;
if (!is_array($option)) $option = [$option];
<?php
$index = 0;
foreach ($fieldOptions as $value => $option):
$index++;
$checkboxId = 'checkbox_'.$field->getId().'_'.$index;
if (!in_array($value, $checkedValues)) {
continue;
}
if (!is_array($option)) {
$option = [$option];
}
?>
<div class="checkbox custom-checkbox">
<input
type="checkbox"
@ -67,12 +73,16 @@
name="<?= $field->getName() ?>"
value="0" />
<?php $index = 0; foreach ($fieldOptions as $value => $option): ?>
<?php
$index++;
$checkboxId = 'checkbox_'.$field->getId().'_'.$index;
if (!is_array($option)) $option = [$option];
<?php
$index = 0;
foreach ($fieldOptions as $value => $option):
$index++;
$checkboxId = 'checkbox_'.$field->getId().'_'.$index;
if (!is_array($option)) {
$option = [$option];
}
?>
<div class="checkbox custom-checkbox">
<input
type="checkbox"

View File

@ -1,8 +1,9 @@
<?php
$fieldOptions = $field->options();
$useSearch = $field->getConfig('showSearch', true);
$emptyOption = $field->getConfig('emptyOption', $field->placeholder);
$fieldOptions = $field->options();
$useSearch = $field->getConfig('showSearch', true);
$emptyOption = $field->getConfig('emptyOption', $field->placeholder);
?>
<!-- Dropdown -->
<?php if ($this->previewMode || $field->readOnly): ?>
<div class="form-control" <?= $field->readOnly ? 'disabled="disabled"' : ''; ?>>
@ -27,11 +28,15 @@
<?php endif ?>
<?php foreach ($fieldOptions as $value => $option): ?>
<?php
if (!is_array($option)) $option = [$option];
if (!is_array($option)) {
$option = [$option];
}
?>
<option
<?= $field->isSelected($value) ? 'selected="selected"' : '' ?>
<?php if (isset($option[1])): ?>data-<?=strpos($option[1],'.')?'image':'icon'?>="<?= $option[1] ?>"<?php endif ?>
<?php if (isset($option[1])): ?>
data-<?= strpos($option[1], '.') ? 'image' : 'icon' ?>="<?= $option[1] ?>"
<?php endif ?>
value="<?= e($value) ?>"
><?= e(trans($option[0])) ?></option>
<?php endforeach ?>

View File

@ -5,4 +5,4 @@
'model' => $formModel,
'field' => $field,
'value' => $field->value
]) ?>
]) ?>

View File

@ -5,4 +5,4 @@
'model' => $formModel,
'field' => $field,
'value' => $field->value
]) ?>
]) ?>

View File

@ -1,16 +1,17 @@
<?php
$fieldOptions = $field->options();
$fieldOptions = $field->options();
?>
<!-- Radio List -->
<?php if (count($fieldOptions)): ?>
<?php $index = 0; foreach ($fieldOptions as $value => $option): ?>
<?php
$index++;
if (is_string($option))
$option = array($option);
$index++;
if (is_string($option)) {
$option = array($option);
}
$fieldId = md5(uniqid($field->getId($index), true));
$fieldId = md5(uniqid($field->getId($index), true));
?>
<div class="radio custom-radio">

View File

@ -1,14 +1,14 @@
<?php
$previewMode = false;
if ($this->previewMode || $field->readOnly) {
$previewMode = true;
}
$previewMode = false;
if ($this->previewMode || $field->readOnly) {
$previewMode = true;
}
$on = isset($field->config['on']) ? $field->config['on'] : 'backend::lang.form.field_on';
$off = isset($field->config['off']) ? $field->config['off'] : 'backend::lang.form.field_off';
?>
<!-- Switch -->
<?php
$on = isset($field->config['on']) ? $field->config['on'] : 'backend::lang.form.field_on';
$off = isset($field->config['off']) ? $field->config['off'] : 'backend::lang.form.field_off';
?>
<div class="field-switch">
<label><?= e(trans($field->label)) ?></label>
<?php if ($field->comment): ?>

View File

@ -2,4 +2,4 @@
<?php
$widget = $this->makeFormFieldWidget($field);
?>
<?= $widget->render() ?>
<?= $widget->render() ?>

View File

@ -1,21 +1,24 @@
<?php
$type = $tabs->section;
$type = $tabs->section;
$navCss = '';
$contentCss = '';
$paneCss = '';
$navCss = '';
$contentCss = '';
$paneCss = '';
if ($tabs->stretch) {
$navCss = 'layout-row min-size';
$contentCss = 'layout-row';
$paneCss = 'layout-cell';
}
if ($tabs->stretch) {
$navCss = 'layout-row min-size';
$contentCss = 'layout-row';
$paneCss = 'layout-cell';
}
?>
<div class="<?= $navCss ?>">
<ul class="nav nav-tabs" <?= $tabs->linkable ? 'data-linkable' : '' ?>>
<?php $index = 0; foreach ($tabs as $name => $fields):
<?php
$index = 0;
foreach ($tabs as $name => $fields):
$lazy = in_array($name, $tabs->lazy);
?>
?>
<li class="<?= ($index++ === 0) ? 'active' : '' ?> <?= $lazy ? 'tab-lazy' : '' ?>">
<a
href="#<?= $type . 'tab-' . ($tabs->linkable ? str_slug($name) : $index) ?>"
@ -27,7 +30,9 @@
>
<span class="title">
<span>
<?php if ($tabs->getIcon($name)): ?><span class="<?= $tabs->getIcon($name) ?>"></span><?php endif; ?>
<?php if ($tabs->getIcon($name)): ?>
<span class="<?= $tabs->getIcon($name) ?>"></span>
<?php endif; ?>
<?= e(trans($name)) ?>
</span>
</span>
@ -42,15 +47,16 @@
$index = 0;
foreach ($tabs as $name => $fields):
$lazy = in_array($name, $tabs->lazy);
?>
<div
class="tab-pane <?= $lazy ? 'lazy' : '' ?> <?= e($tabs->getPaneCssClass($index, $name)) ?> <?= ($index++ === 0) ? 'active' : '' ?> <?= $paneCss ?>"
id="<?= $type . 'tab-' . $index ?>">
<?php if ($lazy): ?>
<?= $this->makePartial('form_tabs_lazy', ['fields' => $fields]) ?>
<?php else: ?>
<?= $this->makePartial('form_fields', ['fields' => $fields]) ?>
<?php endif ?>
</div>
?>
<div
class="tab-pane <?= $lazy ? 'lazy' : '' ?> <?= e($tabs->getPaneCssClass($index, $name)) ?> <?= ($index++ === 0) ? 'active' : '' ?> <?= $paneCss ?>"
id="<?= $type . 'tab-' . $index ?>">
<?php if ($lazy): ?>
<?= $this->makePartial('form_tabs_lazy', ['fields' => $fields]) ?>
<?php else: ?>
<?= $this->makePartial('form_fields', ['fields' => $fields]) ?>
<?php endif ?>
</div>
<?php endforeach ?>
</div>

View File

@ -9,7 +9,9 @@
$ignoredTypes = ['section', 'partial'];
foreach ($fields as $field):
if (in_array($field->type, $ignoredTypes)) continue;
if (in_array($field->type, $ignoredTypes)) {
continue;
}
$isMultiValue = is_array($field->value);
foreach (array_wrap($field->value) as $index => $value):
@ -20,14 +22,16 @@ foreach ($fields as $field):
foreach (array_wrap($value) as $index => $value):
// Set the correct array keys if the value is an array (repeater form fields).
$currentFieldName = $valueIsArray ? sprintf('%s[%s]', $fieldName, $index) : $fieldName;
?>
<input
type="hidden"
name="<?= $currentFieldName ?>"
id="<?= $this->nameToId($currentFieldName) ?>"
value="<?= e($value) ?>"
<?= $field->getAttributes() ?>
/>
?>
<input
type="hidden"
name="<?= $currentFieldName ?>"
id="<?= $this->nameToId($currentFieldName) ?>"
value="<?= e($value) ?>"
<?= $field->getAttributes() ?>
/>
<?php endforeach ?>
<?php endforeach ?>
<?php endforeach ?>

View File

@ -1,11 +1,11 @@
<?php
$type = $tabs->section;
$type = $tabs->section;
$containerCss = 'layout-row min-size';
$containerCss = 'layout-row min-size';
if ($tabs->stretch) {
$containerCss = 'layout-row';
}
if ($tabs->stretch) {
$containerCss = 'layout-row';
}
?>
<!-- <?= ucfirst($type) ?> Tabs -->
<div class="<?= $containerCss ?>">

View File

@ -1,7 +1,7 @@
<?php
$expanded = $showTree ? $this->isTreeNodeExpanded($record) : null;
$childRecords = $showTree ? $record->getChildren() : null;
$treeLevelClass = $showTree ? 'list-tree-level-'.$treeLevel : '';
$expanded = $showTree ? $this->isTreeNodeExpanded($record) : null;
$childRecords = $showTree ? $record->getChildren() : null;
$treeLevelClass = $showTree ? 'list-tree-level-'.$treeLevel : '';
?>
<tr class="<?= $treeLevelClass ?> <?= $this->getRowClass($record) ?>">
<?php if ($showCheckboxes): ?>

View File

@ -1,3 +1,3 @@
<?php foreach ($records as $record): ?>
<?= $this->makePartial('list_body_row', ['record' => $record, 'treeLevel' => $treeLevel]) ?>
<?php endforeach ?>
<?php endforeach ?>

View File

@ -13,4 +13,4 @@
<i class="icon-plus-square-o"></i>
<?php endif ?>
</a>
</td>
</td>

View File

@ -17,7 +17,9 @@
<?php foreach ($columns as $key => $column): ?>
<?php if ($showSorting && $column->sortable): ?>
<th
<?php if ($column->width): ?>style="width: <?= $column->width ?>"<?php endif ?>
<?php if ($column->width): ?>
style="width: <?= $column->width ?>"
<?php endif ?>
class="<?= $this->sortColumn==$column->columnName?'sort-'.$this->sortDirection.' active':'sort-desc' ?> list-cell-name-<?= $column->getName() ?> list-cell-type-<?= $column->type ?> <?= $column->getAlignClass() ?> <?= $column->headCssClass ?>"
>
<a
@ -30,7 +32,9 @@
</th>
<?php else: ?>
<th
<?php if ($column->width): ?>style="width: <?= $column->width ?>"<?php endif ?>
<?php if ($column->width): ?>
style="width: <?= $column->width ?>"
<?php endif ?>
class="list-cell-name-<?= $column->getName() ?> list-cell-type-<?= $column->type ?> <?= $column->getAlignClass() ?> <?= $column->headCssClass ?>"
>
<span><?= $this->getHeaderValue($column) ?></span>

View File

@ -36,7 +36,7 @@
data-request="<?= $this->getEventHandler('onPaginate') ?>"
data-load-indicator="<?= e(trans('backend::lang.list.loading')) ?>"
autocomplete="off">
<?php for($i = 1; $i <= $pageLast ; $i++): ?>
<?php for ($i = 1; $i <= $pageLast; $i++): ?>
<option value="<?= $i ?>" <?= $i === $pageCurrent ? 'selected' : '' ?>><?= $i ?></option>
<?php endfor ?>
</select>

View File

@ -9,7 +9,7 @@
<?= e(trans('backend::lang.media.insert')) ?>
</button>
<?php if (!$this->readOnly) : ?>
<?php if (!$this->readOnly): ?>
<button
type="button"
data-command="popup-command"

View File

@ -1,12 +1,11 @@
<?php
$selectionModes = [
Backend\Widgets\MediaManager::SELECTION_MODE_NORMAL => trans('backend::lang.media.selection_mode_normal'),
Backend\Widgets\MediaManager::SELECTION_MODE_FIXED_RATIO => trans('backend::lang.media.selection_mode_fixed_ratio'),
Backend\Widgets\MediaManager::SELECTION_MODE_FIXED_SIZE => trans('backend::lang.media.selection_mode_fixed_size')
];
$selectionModes = [
Backend\Widgets\MediaManager::SELECTION_MODE_NORMAL => trans('backend::lang.media.selection_mode_normal'),
Backend\Widgets\MediaManager::SELECTION_MODE_FIXED_RATIO => trans('backend::lang.media.selection_mode_fixed_ratio'),
Backend\Widgets\MediaManager::SELECTION_MODE_FIXED_SIZE => trans('backend::lang.media.selection_mode_fixed_size')
];
$sizeDisabledAttr = $currentSelectionMode == Backend\Widgets\MediaManager::SELECTION_MODE_NORMAL ? 'disabled="disabled"' : null;
$sizeDisabledAttr = $currentSelectionMode == Backend\Widgets\MediaManager::SELECTION_MODE_NORMAL ? 'disabled="disabled"' : null;
?>
<div class="control-toolbar toolbar-padded">
@ -23,7 +22,7 @@
<label for="mmcropimagewidth"><?= e(trans('backend::lang.media.selection_mode')) ?></label>
<select name="selectionMode" class="form-control custom-select w-150" data-control="selection-mode">
<?php foreach ($selectionModes as $mode=>$name): ?>
<?php foreach ($selectionModes as $mode => $name): ?>
<option <?= $mode == $currentSelectionMode ? 'selected="selected"' : null ?> value="<?= $mode ?>"><?= e($name) ?></option>
<?php endforeach ?>
</select>
@ -38,4 +37,4 @@
</div>
</div>
</div>
</div>

View File

@ -1,39 +1,64 @@
<h3 class="section"><?= e(trans('backend::lang.media.display')) ?></h3>
<ul class="nav nav-stacked selector-group">
<li role="presentation" <?php if ($currentFilter == Backend\Widgets\MediaManager::FILTER_EVERYTHING): ?>class="active"<?php endif ?>>
<li
role="presentation"
<?php if ($currentFilter == Backend\Widgets\MediaManager::FILTER_EVERYTHING): ?>
class="active"
<?php endif ?>
>
<a href="#" data-command="set-filter" data-filter="<?= Backend\Widgets\MediaManager::FILTER_EVERYTHING ?>">
<i class="icon-recycle"></i>
<?= e(trans('backend::lang.media.filter_everything')) ?>
</a>
</li>
<li role="presentation" <?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_IMAGE): ?>class="active"<?php endif ?>>
<li
role="presentation"
<?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_IMAGE): ?>
class="active"
<?php endif ?>
>
<a href="#" data-command="set-filter" data-filter="<?= System\Classes\MediaLibraryItem::FILE_TYPE_IMAGE ?>">
<i class="icon-picture-o"></i>
<?= e(trans('backend::lang.media.filter_images')) ?>
</a>
</li>
<li role="presentation" <?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_VIDEO): ?>class="active"<?php endif ?>>
<li
role="presentation"
<?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_VIDEO): ?>
class="active"
<?php endif ?>
>
<a href="#" data-command="set-filter" data-filter="<?= System\Classes\MediaLibraryItem::FILE_TYPE_VIDEO ?>">
<i class="icon-video-camera"></i>
<?= e(trans('backend::lang.media.filter_video')) ?>
</a>
</li>
<li role="presentation" <?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_AUDIO): ?>class="active"<?php endif ?>>
<li
role="presentation"
<?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_AUDIO): ?>
class="active"
<?php endif ?>
>
<a href="#" data-command="set-filter" data-filter="<?= System\Classes\MediaLibraryItem::FILE_TYPE_AUDIO ?>">
<i class="icon-volume-up"></i>
<?= e(trans('backend::lang.media.filter_audio')) ?>
</a>
</li>
<li role="presentation" <?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_DOCUMENT): ?>class="active"<?php endif ?>>
<li
role="presentation"
<?php if ($currentFilter == System\Classes\MediaLibraryItem::FILE_TYPE_DOCUMENT): ?>
class="active"
<?php endif ?>
>
<a href="#" data-command="set-filter" data-filter="<?= System\Classes\MediaLibraryItem::FILE_TYPE_DOCUMENT ?>">
<i class="icon-file"></i>
<?= e(trans('backend::lang.media.filter_documents')) ?>
</a>
</li>
</ul>
</ul>

View File

@ -37,7 +37,7 @@
<h4 title="<?= e(basename($item->path)) ?>">
<?= e(basename($item->path)) ?>
<?php if (!$this->readOnly) : ?>
<?php if (!$this->readOnly): ?>
<a
href="#"
data-rename

View File

@ -1,9 +1,11 @@
<div class="icon-container <?= $itemType ?>">
<div class="icon-wrapper"><i class="<?= $this->itemTypeToIconClass($item, $itemType) ?>"></i></div>
<?php if ($itemType == System\Classes\MediaLibraryItem::FILE_TYPE_IMAGE):
<?php
if ($itemType == System\Classes\MediaLibraryItem::FILE_TYPE_IMAGE):
$thumbnailPath = $this->thumbnailExists($thumbnailParams, $item->path, $item->lastModified);
?>
?>
<div>
<?php if (!$thumbnailPath): ?>
<div class="image-placeholder"
@ -23,4 +25,4 @@
<?php endif ?>
</div>
<?php endif ?>
</div>
</div>

View File

@ -19,7 +19,8 @@
<?php foreach ($items as $item):
$itemType = $item->getFileType();
?>
?>
<tr data-type="media-item"
data-item-type="<?= $item->type ?>"
data-path="<?= e($item->path) ?>"
@ -36,7 +37,7 @@
<div class="item-title no-wrap-text">
<i class="<?= $this->itemTypeToIconClass($item, $itemType) ?>"></i> <?= e(basename($item->path)) ?>
<?php if (!$this->readOnly) : ?>
<?php if (!$this->readOnly): ?>
<a
href="#"
data-rename

View File

@ -1 +1 @@
<?= $this->makePartial('generic-list', ['listClass'=>'list']) ?>
<?= $this->makePartial('generic-list', ['listClass' => 'list']) ?>

View File

@ -1 +1 @@
<?= $this->makePartial('generic-list', ['listClass'=>'tiles']) ?>
<?= $this->makePartial('generic-list', ['listClass' => 'tiles']) ?>

View File

@ -11,7 +11,7 @@
name="dest"
data-placeholder="<?= e(trans('backend::lang.media.move_please_select')) ?>">
<option></option>
<?php foreach ($folders as $path=>$folder):?>
<?php foreach ($folders as $path => $folder): ?>
<option value="<?= e($path) ?>"><?= e($folder) ?></option>
<?php endforeach ?>
</select>

View File

@ -1,14 +1,14 @@
<?php
$sortModes = [
System\Classes\MediaLibrary::SORT_BY_TITLE => trans('backend::lang.media.title'),
System\Classes\MediaLibrary::SORT_BY_SIZE => trans('backend::lang.media.size'),
System\Classes\MediaLibrary::SORT_BY_MODIFIED => trans('backend::lang.media.last_modified')
];
$sortModes = [
System\Classes\MediaLibrary::SORT_BY_TITLE => trans('backend::lang.media.title'),
System\Classes\MediaLibrary::SORT_BY_SIZE => trans('backend::lang.media.size'),
System\Classes\MediaLibrary::SORT_BY_MODIFIED => trans('backend::lang.media.last_modified')
];
$sortDirections = [
System\Classes\MediaLibrary::SORT_DIRECTION_ASC => trans('backend::lang.media.direction_asc'),
System\Classes\MediaLibrary::SORT_DIRECTION_DESC => trans('backend::lang.media.direction_desc')
];
$sortDirections = [
System\Classes\MediaLibrary::SORT_DIRECTION_ASC => trans('backend::lang.media.direction_asc'),
System\Classes\MediaLibrary::SORT_DIRECTION_DESC => trans('backend::lang.media.direction_desc')
];
?>
<div class="sidebar-group">
@ -19,7 +19,7 @@
class="form-control custom-select select-no-search"
data-control="sorting"
data-sort="by">
<?php foreach ($sortModes as $code=>$title): ?>
<?php foreach ($sortModes as $code => $title): ?>
<option
<?= $code == $sortBy ? 'selected="selected"' : '' ?>
value="<?= $code ?>"
@ -36,7 +36,7 @@
class="form-control custom-select select-no-search"
data-control="sorting"
data-sort="direction">
<?php foreach ($sortDirections as $code=>$title): ?>
<?php foreach ($sortDirections as $code => $title): ?>
<option
<?= $code == $sortDirection ? 'selected="selected"' : '' ?>
value="<?= $code ?>"

View File

@ -2,7 +2,7 @@
<div class="control-toolbar toolbar-padded">
<div class="toolbar-item toolbar-primary">
<div data-control="toolbar">
<?php if (!$this->readOnly) : ?>
<?php if (!$this->readOnly): ?>
<div class="btn-group offset-right">
<button type="button" class="btn btn-primary wn-icon-upload" data-control="upload"><?= e(trans('backend::lang.media.upload')) ?></button>
<button type="button" class="btn btn-primary wn-icon-folder" data-command="create-folder"><?= e(trans('backend::lang.media.add_folder')) ?></button>
@ -11,7 +11,7 @@
<button type="button" class="btn btn-default wn-icon-refresh empty offset-right" data-command="refresh"></button>
<?php if (!$this->readOnly) : ?>
<?php if (!$this->readOnly): ?>
<div class="btn-group offset-right">
<button type="button" class="btn btn-default wn-icon-reply-all" data-command="move"><?= e(trans('backend::lang.media.move')) ?></button>
<button type="button" class="btn btn-default wn-icon-trash" data-command="delete"><?= e(trans('backend::lang.media.delete')) ?></button>

View File

@ -19,7 +19,7 @@
</a>
</li>
<li role="separator" class="divider"></li>
<?php if (\BackendAuth::getUser()->hasAccess('backend.manage_default_dashboard')) : ?>
<?php if (\BackendAuth::getUser()->hasAccess('backend.manage_default_dashboard')): ?>
<li role="presentation">
<a
role="menuitem"
@ -45,4 +45,4 @@
</a>
</li>
</ul>
</div>
</div>

View File

@ -1,9 +1,14 @@
<button
type="button"
class="btn btn-danger wn-icon-download <?php if (!$canCommit): ?>hide<?php endif ?>"
class="
btn btn-danger wn-icon-download
<?php if (!$canCommit): ?>
hide
<?php endif ?>
"
data-request="onCommit"
data-request-confirm="<?= e(trans('cms::lang.editor.commit_confirm')) ?>"
data-load-indicator="<?= e(trans('cms::lang.editor.committing')) ?>"
data-control="commit-button">
<?= e(trans('cms::lang.editor.commit')) ?>
</button>
</button>

View File

@ -1,9 +1,14 @@
<button
type="button"
class="btn btn-danger wn-icon-bomb <?php if (!$canReset): ?>hide<?php endif ?>"
class="
btn btn-danger wn-icon-bomb
<?php if (!$canReset): ?>
hide
<?php endif ?>
"
data-request="onReset"
data-request-confirm="<?= e(trans('cms::lang.editor.reset_confirm')) ?>"
data-load-indicator="<?= e(trans('cms::lang.editor.resetting')) ?>"
data-control="reset-button">
<?= e(trans('cms::lang.editor.reset')) ?>
</button>
</button>

View File

@ -4,11 +4,16 @@
<button
type="button"
class="btn btn-danger empty wn-icon-trash-o <?php if (!$templatePath): ?>hide<?php endif ?>"
class="
btn btn-danger empty wn-icon-trash-o
<?php if (!$templatePath): ?>
hide
<?php endif ?>
"
data-request="onDelete"
data-request-confirm="<?= e(trans('cms::lang.' . $toolbarSource . '.delete_confirm_single')) ?>"
data-request-success="$.wn.cmsPage.updateTemplateList('<?= $toolbarSource ?>'); $(this).trigger('close.oc.tab', [{force: true}])"
data-control="delete-button">
</button>
<?= $this->makePartial('button_lastmodified'); ?>
<?= $this->makePartial('button_lastmodified'); ?>

View File

@ -14,7 +14,12 @@
<a
href="<?= Url::to($pageUrl) ?>"
target="_blank"
class="btn btn-primary wn-icon-crosshairs <?php if (!$templatePath): ?>hide<?php endif ?>"
class="
btn btn-primary wn-icon-crosshairs
<?php if (!$templatePath): ?>
hide
<?php endif ?>
"
data-control="preview-button">
<?= e(trans('cms::lang.editor.preview')) ?>
</a>

View File

@ -1,17 +1,20 @@
<div class="layout-cell <?= e($component->componentCssClass) ?> <?= $component->isHidden ? 'hidden' : null ?>">
<div
class="<?= 'wn-'.$component->pluginIcon ?> layout-relative"
<?php if ($component->inspectorEnabled): ?>data-inspectable<?php endif ?>
<?php if ($component->inspectorEnabled): ?>
data-inspectable
<?php endif ?>
data-inspector-title="<?= $name = e($this->getComponentName($component)) ?>"
data-inspector-description="<?= $description = e($this->getComponentDescription($component)) ?>"
data-inspector-config="<?= e($this->getComponentsPropertyConfig($component)) ?>"
data-inspector-class="<?= get_class($component) ?>">
<span class="name"><?= $name ?></span>
<span class="description"><?= $description ?></span>
<span class="alias wn-icon-code"><?= e($component->alias) ?></span>
<input type="hidden" name="component_properties[]" data-inspector-values value="<?= e($this->getComponentPropertyValues($component)) ?>" />
<input type="hidden" name="component_names[]" value="<?= e($component->name) ?>" />
<input type="hidden" name="component_aliases[]" value="<?= e($component->alias) ?>" />
<a href="#" class="remove">&times;</a>
data-inspector-class="<?= get_class($component) ?>"
>
<span class="name"><?= $name ?></span>
<span class="description"><?= $description ?></span>
<span class="alias wn-icon-code"><?= e($component->alias) ?></span>
<input type="hidden" name="component_properties[]" data-inspector-values value="<?= e($this->getComponentPropertyValues($component)) ?>" />
<input type="hidden" name="component_names[]" value="<?= e($component->name) ?>" />
<input type="hidden" name="component_aliases[]" value="<?= e($component->alias) ?>" />
<a href="#" class="remove">&times;</a>
</div>
</div>
</div>

View File

@ -1,8 +1,8 @@
<?php
$searchMode = $this->isSearchMode();
$searchMode = $this->isSearchMode();
if (($upPath = $this->getUpPath()) !== null && !$searchMode):
?>
if (($upPath = $this->getUpPath()) !== null && !$searchMode):
?>
<p class="parent">
<a href="<?= $upPath ?>" data-path="<?= $upPath ?>" class="link"><?= $this->getCurrentRelativePath() ?></a>
</p>
@ -12,8 +12,16 @@
<ul class="list">
<?php foreach ($items as $item):
$dataId = 'asset-'.$this->theme->getDirName().'-'.ltrim($item->path, '/');
?>
<li class="<?= $item->type ?>" <?php if ($item->editable): ?>data-editable<?php endif ?> data-item-path="<?= e(ltrim($item->path, '/')) ?>" data-item-theme="<?= e($this->theme->getDirName()) ?>" data-item-type="asset" data-id="<?= e($dataId) ?>">
?>
<li
class="<?= $item->type ?>"
<?php if ($item->editable): ?>
data-editable
<?php endif ?>
data-item-path="<?= e(ltrim($item->path, '/')) ?>"
data-item-theme="<?= e($this->theme->getDirName()) ?>"
data-item-type="asset" data-id="<?= e($dataId) ?>"
>
<a class="link" target="_blank" data-path="<?= $item->path ?>" href="<?= $this->getThemeFileUrl($item->path) ?>">
<?= e($item->name) ?>

View File

@ -16,7 +16,7 @@
name="dest"
data-placeholder="<?= e(trans('backend::lang.media.move_please_select')) ?>">
<option></option>
<?php foreach ($directories as $path=>$directory):?>
<?php foreach ($directories as $path => $directory): ?>
<option value="<?= e($path) ?>"><?= e($directory) ?></option>
<?php endforeach ?>
</select>

View File

@ -9,9 +9,9 @@
</li>
<?php endif ?>
<?php else: ?>
<?php
<?php
$dataId = $this->itemType.'-'.$this->theme->getDirName().'-'.$item->fileName;
?>
?>
<li
class="item"
data-item-path="<?= e($item->fileName) ?>"
@ -56,4 +56,4 @@
<?php if (!isset($nested)): ?>
<input type="hidden" name="theme" value="<?= e($this->theme->getDirName()) ?>">
<?php endif ?>
<?php endif ?>

View File

@ -1,5 +1,10 @@
<?php foreach ($this->sortingProperties as $propertyName=>$propertyTitle): ?>
<li role="presentation" <?php if ($this->getSortingProperty() == $propertyName): ?>class="active"<?php endif ?>>
<?php foreach ($this->sortingProperties as $propertyName => $propertyTitle): ?>
<li
role="presentation"
<?php if ($this->getSortingProperty() == $propertyName): ?>
class="active"
<?php endif ?>
>
<a role="menuitem" tabindex="-1" href="javascript:;" data-stripe-load-indicator data-request="<?= $this->getEventHandler('onApplySorting') ?>" data-request-data="sortProperty: '<?= e($propertyName) ?>'">
<?= e(trans($propertyTitle)) ?>
</a>

View File

@ -1 +1 @@
<?= e($record->summary) ?>
<?= e($record->summary) ?>

View File

@ -1,19 +1,16 @@
<?php
$icon = null;
$icon = null;
if ($record->is_disabled) {
$icon = 'eye-slash';
}
elseif ($record->disabledBySystem) {
$icon = 'exclamation';
}
elseif ($record->orphaned) {
$icon = 'question';
}
elseif ($record->is_frozen) {
$icon = 'lock';
}
if ($record->is_disabled) {
$icon = 'eye-slash';
} elseif ($record->disabledBySystem) {
$icon = 'exclamation';
} elseif ($record->orphaned) {
$icon = 'question';
} elseif ($record->is_frozen) {
$icon = 'lock';
}
?>
<span class="<?= $icon ? 'wn-icon-'.$icon : '' ?>">
<?= $value ?>
</span>
</span>

View File

@ -6,7 +6,9 @@
type="checkbox"
name="disable_<?= $record->id ?>"
value="<?= !$record->is_disabled ?>"
<?php if (!$record->is_disabled) : ?>checked=checked<?php endif; ?>
<?php if (!$record->is_disabled): ?>
checked="checked"
<?php endif ?>
data-stripe-load-indicator
>

View File

@ -6,7 +6,9 @@
type="checkbox"
name="freeze_<?= $record->id ?>"
value="<?= !$record->is_frozen ?>"
<?php if (!$record->is_frozen) : ?>checked=checked<?php endif; ?>
<?php if (!$record->is_frozen): ?>
checked="checked"
<?php endif; ?>
data-stripe-load-indicator
>

View File

@ -71,7 +71,7 @@
<?= e(trans('system::lang.plugins.enable_label')) ?>
</a>
</li>
<?php if (\Config::get('app.debug', false) && \BackendAuth::getUser()->is_superuser) : ?>
<?php if (\Config::get('app.debug', false) && \BackendAuth::getUser()->is_superuser): ?>
<li role="separator" class="divider"></li>
<li>
<a href="javascript:;" class="wn-icon-bomb"

View File

@ -1,15 +1,17 @@
<?php
$context = System\Classes\SettingsManager::instance()->getContext();
$collapsedGroups = explode('|',
isset($_COOKIE['sidenav_treegroupStatus']) ? $_COOKIE['sidenav_treegroupStatus'] : null
);
$context = System\Classes\SettingsManager::instance()->getContext();
$collapsedGroups = explode(
'|',
isset($_COOKIE['sidenav_treegroupStatus']) ? $_COOKIE['sidenav_treegroupStatus'] : null
);
?>
<ul class="top-level">
<?php foreach ($items as $category => $items):
$collapsed = in_array($category, $collapsedGroups);
?>
?>
<li data-group-code="<?= e($category) ?>" <?= $collapsed ? 'data-status="collapsed"' : null ?>>
<div class="group">
<h3><?= e(trans($category)) ?></h3>
@ -28,4 +30,4 @@
</ul>
</li>
<?php endforeach ?>
</ul>
</ul>

View File

@ -52,7 +52,9 @@
<span class="status-icon"><i class="icon-exclamation-triangle"></i></span>
<span class="status-text">
<?= e(trans('backend::lang.dashboard.status.event_log')) ?>
<?php if ($eventLogMsg): ?>&nbsp;<a href="<?= Backend::url('system/settings/update/winter/system/log_settings') ?>"><i class="icon-exclamation-triangle text-warning" title="<?= e(trans('system::lang.updates.disabled')) ?>" data-toggle="tooltip" data-placement="right"></i></a><?php endif ?>
<?php if ($eventLogMsg): ?>
&nbsp;<a href="<?= Backend::url('system/settings/update/winter/system/log_settings') ?>"><i class="icon-exclamation-triangle text-warning" title="<?= e(trans('system::lang.updates.disabled')) ?>" data-toggle="tooltip" data-placement="right"></i></a>
<?php endif ?>
</span>
<a href="<?= Backend::url('system/eventlogs') ?>" class="status-label primary"><?= $eventLog ?></a>
</li>
@ -60,7 +62,9 @@
<span class="status-icon"><i class="icon-file-o"></i></span>
<span class="status-text">
<?= e(trans('backend::lang.dashboard.status.request_log')) ?>
<?php if ($requestLogMsg): ?>&nbsp;<a href="<?= Backend::url('system/settings/update/winter/system/log_settings') ?>"><i class="icon-exclamation-triangle text-warning" title="<?= e(trans('system::lang.updates.disabled')) ?>" data-toggle="tooltip" data-placement="right"></i></a><?php endif ?>
<?php if ($requestLogMsg): ?>
&nbsp;<a href="<?= Backend::url('system/settings/update/winter/system/log_settings') ?>"><i class="icon-exclamation-triangle text-warning" title="<?= e(trans('system::lang.updates.disabled')) ?>" data-toggle="tooltip" data-placement="right"></i></a>
<?php endif ?>
</span>
<a href="<?= Backend::url('system/requestlogs') ?>" class="status-label primary"><?= $requestLog ?></a>
</li>

View File

@ -9,9 +9,8 @@
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
<!--
We're not enforcing a line length limit
-->
<!-- We're not enforcing a line length limit -->
<exclude name="Generic.Files.LineLength" />
</rule>
@ -22,10 +21,29 @@
</properties>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
<!--
Migration files and tests do not need a namespace defined
Ignore correct spacing for control structure in partial templates - spacing may be useful for templates to
easily deduce HTML code that is conditional
-->
<exclude-pattern>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<!-- Migration files and tests do not need a namespace defined -->
<exclude-pattern>*/database/migrations/*\.php</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
@ -38,6 +56,68 @@
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PSR2.Files.ClosingTag.NotAllowed">
<!--
Partials may finish on a closing tag, especially when using the short echo "<?= ?>" tag. We'll allow this.
-->
<exclude-pattern>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineCASE">
<!--
Partials may have HTML within switch/case statements, which look neater when inline. PHPCS also has difficulty
interpreting a short echo tag on a new line within a switch/case statement.
-->
<exclude-pattern>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakNotNewLine">
<!--
Partials may have HTML within switch/case statements, which look neater when inline. PHPCS also has difficulty
interpreting a short echo tag on a new line within a switch/case statement.
-->
<exclude-pattern>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/partials/*\.php</exclude-pattern>
</rule>
<arg name="extensions" value="php" />
<arg name="colors" />