function edit($id = null) { $this->permission(3); if ($id === null || !is_numeric($id)) { $this->redirect('cockpit/configuration'); return false; } $this->loadModel('Configuration'); $d['id'] = $id; $this->set($d); if ($this->request->data) { $key = $this->request->data->keyword; $this->request->data->value = $this->request->data->{$key}; unset($this->request->data->{$key}); $id = $this->Configuration->save($this->request->data); if (!is_numeric($id)) { $this->logger->LogError($this->request->controller, $this->request->action, $_SESSION[USER]->login, ErrorsTranslate::getLabel(DB) . '/id:' . $id); $this->Session->setAlert(ErrorsTranslate::getLabel(DB) . $id, DANGER); $this->redirect('cockpit/configuration/edit/' . $d['id']); return false; } $this->logger->LogInfo($this->request->controller, $this->request->action, $_SESSION[USER]->login, dashboardTranslate::getLabel('updatedConfig') . '/id:' . $id); $this->redirect('cockpit/configuration'); return false; } else { $this->request->data = $this->Configuration->findFirst(array('conditions' => array('id' => $id))); } }
"><?php echo MenuTranslate::getLabel(HOME); ?> </a> </li> <li class="active"> <?php echo dashboardTranslate::getLabel('configuration'); ?> </li> </ol> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title"><span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> <?php echo dashboardTranslate::getLabel('configuration'); ?> </h3> </div> <div class="panel-body"> <table class="table table-bordered table-hover"> <thead> <?php if ($this->Session->user('category') > 2) { ?> <tr><th colspan="3"><?php echo FormsTranslate::getLabel(USER); ?> </th></tr> <?php } else {
?> <form action="<?php echo Router::generateURL('cockpit/configuration/edit/' . $id); ?> " method="post" class="form-horizontal"> <?php echo $this->FormField->hidden('id'); ?> <?php echo $this->FormField->hidden('keyword'); ?> <div class="panel panel-warning"> <div class="panel-heading"> <h3 class="panel-title"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span> <?php echo dashboardTranslate::getLabel(UPDATE); ?> </h3> </div> <div class="panel-body"> <?php echo $this->FormField->text($this->request->data->keyword, false, 'form-control'); ?> </div> <div class="panel-footer text-right"> <?php echo $this->FormSubmit->update(); ?> <?php echo $this->FormLink->listing('cockpit/configuration'); ?>