correct POST-param naming for XP-level managing
This commit is contained in:
parent
625ba60f13
commit
8cc3bb1366
2 changed files with 9 additions and 9 deletions
|
|
@ -83,14 +83,14 @@
|
|||
$action = null;
|
||||
if($this->request->getRequestMethod() == 'POST')
|
||||
{
|
||||
// Get params
|
||||
$xplevelsValues = $this->request->getPostParam('xplevels');
|
||||
$deletes = $this->request->getPostParam('deletes');
|
||||
|
||||
// Edit and delete XP-levels
|
||||
if(!is_null($this->request->getPostParam('edit')))
|
||||
{
|
||||
$action = 'edit';
|
||||
|
||||
// Get params
|
||||
$xplevelsValues = $this->request->getPostParam('xplevels');
|
||||
$deletes = $this->request->getPostParam('deletes');
|
||||
|
||||
// Validate params
|
||||
if(!is_array($deletes)) {
|
||||
|
|
@ -145,16 +145,16 @@
|
|||
$action = 'create';
|
||||
|
||||
// Get params and validate them
|
||||
$xplevel = $xplevelsValues['new'];
|
||||
$validations[$action] = $this->Validation->validateParams($xplevel, array('xps'));
|
||||
|
||||
$xplevelnew = $this->request->getPostParam('xplevelnew');
|
||||
$validations[$action] = $this->Validation->validateParams($xplevelnew, array('xps'));
|
||||
|
||||
// Create
|
||||
if($validations[$action] === true)
|
||||
{
|
||||
$this->Xplevels->createXPLevel(
|
||||
$this->Auth->getUserId(),
|
||||
$seminary['id'],
|
||||
$xplevel['xps']
|
||||
$xplevelnew['xps']
|
||||
);
|
||||
|
||||
// Redirect
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
<?php endif ?>
|
||||
<form method="post">
|
||||
<fieldset>
|
||||
<input id="xplevel-new-xps" type="number" name="xplevels[new][xps]" value="<?=(count($xplevels) > 0) ? $xplevels[count($xplevels)-1]['xps']+1 : 0 ?>" min="<?=(count($xplevels) > 0) ? $xplevels[count($xplevels)-1]['xps']+1 : 0 ?>" <?=($validations['create'] !== true && array_key_exists('xps', $validations['create'])) ? 'class="invalid"' : null?> />
|
||||
<input id="xplevel-new-xps" type="number" name="xplevelnew[xps]" value="<?=(count($xplevels) > 0) ? $xplevels[count($xplevels)-1]['xps']+1 : 0 ?>" min="<?=(count($xplevels) > 0) ? $xplevels[count($xplevels)-1]['xps']+1 : 0 ?>" <?=($validations['create'] !== true && array_key_exists('xps', $validations['create'])) ? 'class="invalid"' : null?> />
|
||||
<label for="xplevel-new-xps"><?=_('XPs')?></label>
|
||||
</fieldset>
|
||||
<input type="submit" name="create" value="<?=_('create')?>" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue