* [refactor] use zin to render conference admin page.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
function bindEditEvent() {
|
||||
const editButton = document.getElementById('edit-button');
|
||||
const saveButton = document.getElementById('save-button');
|
||||
const cancelButton = document.getElementById('cancel-button');
|
||||
const enabledCheckbox = document.getElementsByName('enabled')[0];
|
||||
const domainInput = document.getElementsByName('domain')[0];
|
||||
|
||||
if (!(editButton && saveButton && cancelButton && enabledCheckbox && domainInput)) {
|
||||
return;
|
||||
}
|
||||
editButton.addEventListener('click', function () {
|
||||
editButton.style.display = 'none';
|
||||
saveButton.style.display = 'inline-block';
|
||||
cancelButton.style.display = 'inline-block';
|
||||
enabledCheckbox.disabled = false;
|
||||
enabledCheckbox.parentElement.classList.remove('disabled');
|
||||
domainInput.disabled = false;
|
||||
});
|
||||
cancelButton.addEventListener('click', function () {
|
||||
editButton.style.display = 'inline-block';
|
||||
saveButton.style.display = 'none';
|
||||
cancelButton.style.display = 'none';
|
||||
enabledCheckbox.disabled = true;
|
||||
enabledCheckbox.parentElement.classList.add('disabled');
|
||||
domainInput.disabled = true;
|
||||
});
|
||||
}
|
||||
bindEditEvent();
|
||||
|
||||
window.afterPageUpdate = bindEditEvent;
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* The admin view file of conference module of XXB.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd., www.zentao.net)
|
||||
* @license ZOSL (https://zpl.pub/page/zoslv1.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package conference
|
||||
* @version $Id$
|
||||
* @link https://xuanim.com
|
||||
*/
|
||||
namespace zin;
|
||||
?>
|
||||
<style>
|
||||
#enabledRow {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#save-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#cancel-button {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
formPanel(
|
||||
set::title($lang->conference->common),
|
||||
set::labelWidth('140px'),
|
||||
set::actions(
|
||||
array(
|
||||
array('text' => $lang->save, 'id' => 'save-button', 'class' => 'btn primary', 'btnType' => 'submit'),
|
||||
array('text' => $lang->cancel, 'id' => 'cancel-button', 'class' => 'btn secondary'),
|
||||
array('text' => $lang->edit, 'id' => 'edit-button', 'class' => 'btn primary')
|
||||
)
|
||||
),
|
||||
formGroup(
|
||||
set::label($lang->conference->enabled),
|
||||
set::id('enabledRow'),
|
||||
checkbox(
|
||||
set::name('enabled'),
|
||||
set::disabled(true),
|
||||
set::checked($enabled),
|
||||
$lang->conference->enabledTip
|
||||
)
|
||||
),
|
||||
formGroup(
|
||||
set::label($lang->conference->domain),
|
||||
input(
|
||||
set::name('domain'),
|
||||
width('1/4'),
|
||||
set::disabled(true),
|
||||
set::value(empty($domain) ? $lang->conference->notset : $domain)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
render();
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The admin view file of conference module of XXB.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd., www.zentao.net)
|
||||
* @license ZOSL (https://zpl.pub/page/zoslv1.html)
|
||||
* @author Wenrui LI <liwenrui@easycorp.ltd>
|
||||
* @package conference
|
||||
* @version $Id$
|
||||
* @link https://xuanim.com
|
||||
*/
|
||||
?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
|
||||
<div class='panel'>
|
||||
<div class="panel-heading">
|
||||
<?php echo $lang->conference->common; ?>
|
||||
</div>
|
||||
<form method='post' id='ajaxForm' class="form-ajax<?php if ($enabled) echo ' conference-enabled'; ?>">
|
||||
<table class="table table-form">
|
||||
<tr>
|
||||
<th class="w-150px"><?php echo $lang->conference->enabled; ?></th>
|
||||
<td class="w-400px">
|
||||
<?php if ($type != 'edit') : ?>
|
||||
<div class="checkbox-primary disabled <?php if ($enabled) echo 'checked'; ?>">
|
||||
<label><?php echo $lang->conference->enabledTip; ?></label>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="checkbox-primary">
|
||||
<input type="checkbox" name="enabled" id='enabled' value="true" <?php if ($enabled) echo 'checked'; ?> <?php if ($type != 'edit') echo 'disabled'; ?>>
|
||||
<label for='enabled'><?php echo $lang->conference->enabledTip; ?></label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php if ($type == 'edit' || $enabled) : ?>
|
||||
<tr class='edit-row common-row'>
|
||||
<th class="w-120px"><?php echo $lang->conference->domain; ?></th>
|
||||
<td class="w-400px code">
|
||||
<?php if ($type == 'edit') : ?>
|
||||
<div class='required required-wrapper'></div>
|
||||
<?php echo html::input('domain', $domain, "class='form-control'"); ?>
|
||||
<?php else : echo empty($domain) ? $lang->conference->notset : $domain;
|
||||
endif; ?>
|
||||
</td>
|
||||
<?php if($type == 'edit'): ?>
|
||||
<td class="text-muted" style="padding-left: 20px;"><?php echo $lang->conference->serverAddrTip; ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td colspan='2'>
|
||||
<?php if ($type == 'edit') echo html::submitButton(); ?>
|
||||
<?php if ($type != 'edit') echo '<a class="btn btn-primary" href="' . helper::createLink('conference', 'admin', 'type=edit') . '">' . $lang->edit; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.edit-row {
|
||||
display: none
|
||||
}
|
||||
|
||||
#ajaxForm.conference-enabled .edit-row {
|
||||
display: table-row
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#enabled').on('change', function() {
|
||||
$('#ajaxForm').toggleClass('conference-enabled', $('#enabled').is(':checked'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?php
|
||||
$config->index->oldPages[] = 'conference-admin';
|
||||
Reference in New Issue
Block a user