Esempio n. 1
0
    public function __construct()
    {
        parent::__construct('hint-form');
        $this->setAjax(TRUE);
        $this->setAction(OW::getRouter()->urlForRoute('profileprogressbar.admin_hint'));
        $this->setAjaxResetOnSuccess(FALSE);
        $this->bindJsFunction('success', 'function(data)
        {
            $("#profile-progressbar").tipTip({content: data.content});

            OW.info("Settings successfully saved");
        }');
        $checkBox = new CheckboxField('show-hint');
        if ((bool) OW::getConfig()->getValue('profileprogressbar', 'show_hint')) {
            $checkBox->addAttribute('checked', 'checked');
        }
        $checkBox->setLabel(OW::getLanguage()->text('profileprogressbar', 'show_hint_label'));
        $checkBox->setDescription(OW::getLanguage()->text('profileprogressbar', 'show_hint_desc'));
        $this->addElement($checkBox);
        $hintText = new WysiwygTextarea('hint-text');
        $hintText->setRequired();
        $hintText->setSize(WysiwygTextarea::SIZE_L);
        $hintText->setValue(OW::getLanguage()->text('profileprogressbar', 'hint_text'));
        $hintText->setLabel(OW::getLanguage()->text('profileprogressbar', 'hint_label'));
        $hintText->setDescription(OW::getLanguage()->text('profileprogressbar', 'hint_desc'));
        $this->addElement($hintText);
        $submit = new Submit('save');
        $submit->setValue('Save');
        $this->addElement($submit);
    }