This commit is contained in:
cutemeli
2025-12-22 10:35:30 +00:00
parent 0bfc6c8425
commit 5ce7ca2c5d
38927 changed files with 0 additions and 4594700 deletions

View File

@@ -1,41 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function () {
var databaseControlsState = function () {
if (0 == document.getElementById('database').value) {
document.getElementById('default').closest('.form-row').style.display = 'none';
} else {
document.getElementById('default').closest('.form-row').style.display = '';
}
};
var dbServerControlState = function (event) {
var dbServerElement = document.getElementById('dbServer');
var dbElement = document.getElementById('database');
var dbList = JSON.parse(document.getElementById('dbList').value);
dbElement.innerHTML = (
Object.keys(dbList[dbServerElement.value]).map(function (value) {
return '<option value="' + value + '">' + dbList[dbServerElement.value][value] + '</option>';
}).join('')
);
var dbWebAdmins = JSON.parse(document.getElementById('dbWebAdmins').value);
var dbDefaultLabel = <?php echo $this->jsLmsg('smb.components.forms.database.user.default') ?>;
document.querySelectorAll('label[for="default"]').forEach(function (el) {
el.innerHTML = dbDefaultLabel.replace('%%webadmin%%', dbWebAdmins[dbServerElement.value]);
});
databaseControlsState();
Jsw.Observer.notify(event, 'dbServer');
};
document.getElementById('database').addEventListener('change', databaseControlsState);
document.getElementById('dbServer').addEventListener('change', dbServerControlState);
databaseControlsState();
});
//]]>
</script>

View File

@@ -1,88 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<div class='form-row'>
<div class='field-name'>
<label for="<?php echo $this->element->getId(); ?>">
<?php echo $this->element->getLabel(); ?>
</label>
</div>
<div class='field-value'>
<?php echo $this->elementPart($this->element)->content(); ?>
<span class="field-errors" style="display: none;"></span>
<?php echo $this->element->getView()->elementPart($this->element)->description()?>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function () {
var dbUserRoles = <?php echo Zend_Json::encode($this->dbUserRoles); ?>;
var dbPrivilegesSections = ['dataAccess', 'structureAccess1', 'structureAccess2'];
var sectionsToObserve = ['dbPrivileges-dataAccess-form-row', 'dbPrivileges-structureAccess-form-row'];
function onDbRoleChange() {
var element = document.getElementById('<?php echo $this->element->getId(); ?>');
if (!dbUserRoles[element.value]) {
return;
}
for (var index = 0; index < dbPrivilegesSections.length; index++) {
document.querySelectorAll('[name="dbPrivileges[' + dbPrivilegesSections[index] + '][]"]').forEach(function (el) {
el.checked = false;
});
}
var rolePrivileges = dbUserRoles[element.value];
for (var index = 0; index < rolePrivileges.length; index++) {
var roleName = rolePrivileges[index].replace(/\s+/g, '');
for(var sectionIndex in dbPrivilegesSections) {
var privilegeElement = document.getElementById('dbPrivileges-' + dbPrivilegesSections[sectionIndex] + '-' + roleName);
if (!privilegeElement) {
continue;
}
privilegeElement.checked = true;
}
}
}
function onDbPrivilegeChange() {
var currentPrivileges = [];
for (var dbSectionIndex = 0; dbSectionIndex < sectionsToObserve.length; dbSectionIndex++) {
document.getElementById(sectionsToObserve[dbSectionIndex]).querySelectorAll('input[type="checkbox"]').forEach(function (element) {
if (element.checked) {
currentPrivileges.push(element.value);
}
});
}
var dbRoleValue = 'custom';
var currentPrivilegesCount = currentPrivileges.length;
for (var dbRoleIndex in dbUserRoles) {
var rolePrivilegesCount = dbUserRoles[dbRoleIndex].length;
if (currentPrivilegesCount != rolePrivilegesCount) {
continue;
}
var comparedPrivilegesCount = 0;
for (var priviligeIndex = 0; priviligeIndex < rolePrivilegesCount; priviligeIndex++) {
if (-1 != currentPrivileges.indexOf(dbUserRoles[dbRoleIndex][priviligeIndex])) {
comparedPrivilegesCount++;
}
}
if (comparedPrivilegesCount === rolePrivilegesCount) {
dbRoleValue = dbRoleIndex;
}
}
document.getElementById('<?php echo $this->element->getId(); ?>').value = dbRoleValue;
}
document.getElementById('<?php echo $this->element->getId(); ?>').addEventListener('change', onDbRoleChange);
onDbRoleChange();
for (var dbSectionIndex = 0; dbSectionIndex < sectionsToObserve.length; dbSectionIndex++) {
document.getElementById(sectionsToObserve[dbSectionIndex]).querySelectorAll('input[type="checkbox"]').forEach(function (element) {
element.addEventListener('change', onDbPrivilegeChange);
});
}
});
//]]>
</script>

View File

@@ -1,61 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<div id="issue-list">
</div>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function() {
new Jsw.Panel({
cls: 'list-box',
renderTo: 'issue-list',
items: [
new Jsw.List({
id: 'database-issue-list',
pageable: false,
sortable: false,
data: <?php echo Zend_Json::encode($this->issuesList->fetchData()); ?>,
columns: [
{
header: <?php echo $this->issuesList->jsLmsg('type'); ?>,
headerCls: 'icon',
sortable: false,
dataIndex: 'iconName',
cls: 'min',
renderer: function(item) {
var icon = item.iconName == 'warning'
? '<?php echo $this->skinUrl('/icons/16/plesk/warning.png') ?>'
: '<?php echo $this->skinUrl('/icons/16/plesk/att.png') ?>';
return '<img width="16" height="16"' + ' title="' + item.iconTitle + '"' + ' src="' + icon + '"/>';
}
}, {
<?php if ($this->type == 'mssql') : ?>
header: <?php echo $this->issuesList->jsLmsg('code'); ?>,
sortable: false,
dataIndex: 'code'
}, {
<?php else: ?>
header: <?php echo $this->issuesList->jsLmsg('table'); ?>,
sortable: false,
dataIndex: 'table'
}, {
<?php endif; ?>
header: <?php echo $this->issuesList->jsLmsg('problem'); ?>,
sortable: false,
dataIndex: 'problem'
}
<?php if ($this->type == 'mysql' && $this->hasFurtherActions) : ?>
,
Jsw.list.COLUMN_SELECTION
<?php endif; ?>
]
})
]
});
});
//]]>
</script>

View File

@@ -1,5 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<?php echo $this->form ?>
<?php echo $this->partial('database/_form/db-server.phtml', null, $this); ?>

View File

@@ -1,52 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<?php echo $this->form ?>
<?php echo $this->partial('database/_form/db-server.phtml', null, $this); ?>
<script type="text/javascript">
//<![CDATA[
Jsw.namespace('Smb.Views.Database');
Smb.Views.Database.dbUserPresubmitHandler = function(form) {
if (
document.getElementById('dbPrivileges-globalAccessStateChanged') &&
'true' === document.getElementById('dbPrivileges-globalAccessStateChanged').value &&
document.querySelectorAll('input[id^="dbPrivileges-globalAccess-"]:checked').length > 0
) {
Jsw.messageBox.show({
type: Jsw.messageBox.TYPE_YESNO,
buttonTitles: {
yes: <?php echo $this->jsLmsg('confirmationYes'); ?>,
no: <?php echo $this->jsLmsg('confirmationNo'); ?>,
wait: <?php echo $this->jsLmsg('confirmationWait'); ?>
},
text: <?php echo $this->jsLmsg('confirmText'); ?>,
subtype: 'toggle',
onYesClick: function () {
document.getElementById('dbPrivileges-globalAccessStateChanged').value = 'false';
Jsw.submit(document.getElementById(form._applyTargetId));
}
});
return false;
}
return true;
};
Jsw.onReady(function () {
document.querySelectorAll('input[id^="dbPrivileges-globalAccess-"]').forEach(function (checkbox) {
checkbox.addEventListener('change', function () {
document.getElementById('dbPrivileges-globalAccessStateChanged').value = 'true';
});
});
if (document.getElementById('dbPrivileges')) {
document.getElementById('dbPrivileges').classList.add('b-collapsible');
new Jsw.Panel({
title: <?php echo $this->jsLmsg('showPrivileges'); ?>,
hideContentTitle: <?php echo $this->jsLmsg('hidePrivileges'); ?>,
applyTo: 'dbPrivileges'
});
}
});
//]]>
</script>

View File

@@ -1,4 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<?php echo $this->form ?>

View File

@@ -1,11 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<?php echo $this->form ?>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function () {
document.getElementById('btn-cancel').firstElementChild.focus();
});
//]]>
</script>

View File

@@ -1,42 +0,0 @@
<?php
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
?>
<?php echo $this->form ?>
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function () {
document.querySelectorAll('.checkbox').forEach(function (checkboxElement) {
checkboxElement.checked = true;
checkboxElement.addEventListener('change', function () {
var list = Jsw.getComponent('database-issue-list');
var selected = list.getSelectedItemsIds();
var button = document.getElementById('btn-send');
if (selected.length) {
button.disabled = false;
button.classList.remove('disabled');
} else {
button.disabled = true;
button.classList.add('disabled');
}
});
});
document.getElementById('btn-send').addEventListener('click', function (event) {
event.preventDefault();
var list = Jsw.getComponent('database-issue-list');
var beginOffset = Element.cumulativeOffset(event.target);
var progressBar = Jsw.getComponent('asyncProgressBarWrapper');
progressBar.fly(beginOffset,
<?php echo $this->jsLmsg('smb.components.lists.databases.taskRepairDatabase'); ?>,
function () {
Jsw.redirectPost('/database/repair-tables/id/' + document.getElementById('databaseId').value, {
tables: list.getSelectedItemsIds(),
taskId: document.getElementById('taskId').value
});
}
);
});
});
//]]>
</script>