Exemple #1
0
 /**
  * Get the actions from the custom Registrar class
  */
 public static function getActions()
 {
     $registrars = Registrars::getList(false);
     $actions = array();
     foreach ($registrars as $id => $name) {
         $registrar = Registrars::find($id, null, true);
         if (!empty($registrar[0]['class']) && class_exists($registrar[0]['class'])) {
             $class = $registrar[0]['class'];
             $reg = new $class();
             $actions[$name] = $reg->getActions();
         }
     }
     return $actions;
 }
 /**
  * editAction
  * Get a record and populate the application form 
  * @return unknown_type
  */
 public function editAction()
 {
     $form = $this->getForm('/admin/registrars/process');
     $id = $this->getRequest()->getParam('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/registrars/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/registrars/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)));
     $this->view->description = "Here you can edit the registrar data.";
     if (!empty($id) && is_numeric($id)) {
         $rs = Registrars::find($id, null, true);
         if (!empty($rs[0])) {
             $this->view->title = $this->translator->_("Registrar edit: %s", $rs[0]['name']);
             // Create the registrar custom form
             list($form, $config) = Admin_Form_RegistrarsForm::createRegistrarForm($form, $rs[0]['name']);
             if (!empty($config->general->description)) {
                 $this->view->description = (string) $config->general->description;
             }
             if (!empty($config->general->help)) {
                 $this->view->help = (string) $config->general->help;
             }
             // Get the custom registrar settings
             $rs[0]['settings'] = json_decode($rs[0]['config'], true);
             $form->populate($rs[0]);
         }
         $this->view->buttons[] = array("url" => "/admin/registrars/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => null));
     }
     $this->view->mex = $this->getRequest()->getParam('mex');
     $this->view->mexstatus = $this->getRequest()->getParam('status');
     $this->view->form = $form;
     $this->render('applicantform');
 }