Beispiel #1
0
 /**
  * accountAction
  * Manage the Isp account settings.
  * @return void
  */
 public function editAction()
 {
     $id = $this->getRequest()->getParam('id');
     $form = $this->getForm('/admin/servers/process', $id);
     // Create the buttons in the edit form
     $this->view->buttons = array(array("url" => "#", "label" => $this->translator->translate('Save'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/servers/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/servers/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)));
     if (!empty($id) && is_numeric($id)) {
         $rs = Servers::getAll($id);
         if (!empty($rs)) {
             $panel_id = isset($rs['panel_id']) ? $rs['panel_id'] : null;
             $arrCustomAttributes = CustomAttributes::getElementsValues($id, 'servers', $panel_id);
             $rs += $arrCustomAttributes;
             $form->populate($rs);
             $this->view->buttons[] = array("url" => "/admin/servers/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => null));
         }
     }
     $this->view->form = $form;
     $this->view->mex = $this->getRequest()->getParam('mex');
     $this->view->mexstatus = $this->getRequest()->getParam('status');
     $this->view->title = $this->translator->translate("Edit Server");
     $this->view->description = $this->translator->translate("Edit the server parameters.");
     $this->render('applicantform');
 }