Horde_Core_Auth_Signup_Form::__construct PHP Method

__construct() public method

Constructor
public __construct ( &$vars )
    public function __construct(&$vars)
    {
        parent::__construct($vars, Horde_Core_Translation::t("Sign up for an account"));
        $this->setButtons(Horde_Core_Translation::t("Sign up"));
        $this->addHidden('', 'url', 'text', false);
        /* Use hooks get any extra fields required in signing up. */
        try {
            $extra = $GLOBALS['injector']->getInstance('Horde_Core_Hooks')->callHook('signup_getextra', 'horde');
        } catch (Horde_Exception_HookNotSet $e) {
        }
        if (!empty($extra)) {
            if (!isset($extra['user_name'])) {
                $this->addVariable(Horde_Core_Translation::t("Choose a username"), 'user_name', 'text', true);
            }
            if (!isset($extra['password'])) {
                $this->addVariable(Horde_Core_Translation::t("Choose a password"), 'password', 'passwordconfirm', true, false, Horde_Core_Translation::t("Type your password twice to confirm"));
            }
            foreach ($extra as $field_name => $field) {
                $readonly = isset($field['readonly']) ? $field['readonly'] : null;
                $desc = isset($field['desc']) ? $field['desc'] : null;
                $required = isset($field['required']) ? $field['required'] : false;
                $field_params = isset($field['params']) ? $field['params'] : array();
                $this->addVariable($field['label'], 'extra[' . $field_name . ']', $field['type'], $required, $readonly, $desc, $field_params);
            }
        } else {
            $this->addVariable(Horde_Core_Translation::t("Choose a username"), 'user_name', 'text', true);
            $this->addVariable(Horde_Core_Translation::t("Choose a password"), 'password', 'passwordconfirm', true, false, Horde_Core_Translation::t("Type your password twice to confirm"));
        }
    }
Horde_Core_Auth_Signup_Form