public function render($stat_id = null)
 {
     global $rm_form_diary;
     echo '<div class="rmagic">';
     //$this->form_number = $rm_form_diary[$this->form_id];
     $form = new Form('form_' . $this->form_id . "_" . $this->form_number);
     $form->configure(array("prevent" => array("bootstrap", "jQuery", "focus"), "action" => "", "class" => "rmagic-form", "name" => "rm_form", "number" => $this->form_number, "view" => new View_UserForm(), "style" => isset($this->form_options->style_form) ? $this->form_options->style_form : null));
     //Render content above the form
     if (!empty($this->form_options->form_custom_text)) {
         $form->addElement(new Element_HTML('<div class="rmheader">' . $this->form_options->form_custom_text . '</div>'));
     }
     if ($this->is_expired()) {
         if ($this->form_options->form_message_after_expiry) {
             echo $this->form_options->form_message_after_expiry;
         } else {
             echo '<div class="rm-no-default-from-notification">' . RM_UI_Strings::get('MSG_FORM_EXPIRY') . '</div>';
         }
         echo '</div>';
         return;
     }
     if ($stat_id) {
         $form->addElement(new Element_HTML('<div id="rm_stat_container" style="display:none">'));
         $form->addElement(new Element_Number('RM_Stats', 'stat_id', array('value' => $stat_id, 'style' => 'display:none')));
         $form->addElement(new Element_HTML('</div>'));
     }
     parent::pre_render();
     $this->base_render($form);
     parent::post_render();
     echo '</div>';
 }
 protected function get_prepared_data_all($request)
 {
     $data = parent::get_prepared_data_all($request);
     if (isset($request['password'])) {
         $data['password'] = (object) array('label' => RM_UI_Strings::get('LABEL_PASSWORD'), 'value' => $request['password'], 'type' => 'password');
     }
     if (isset($request['password_confirmation'])) {
         $data['password_confirmation'] = (object) array('label' => RM_UI_Strings::get('LABEL_PASSWORD_AGAIN'), 'value' => $request['password_confirmation'], 'type' => 'password');
     }
     if (isset($request['username'])) {
         $data['username'] = (object) array('label' => RM_UI_Strings::get('LABEL_USERNAME'), 'value' => $request['username'], 'type' => 'username');
     }
     return $data;
 }