Horde_Form::appendButtons PHP 메소드

appendButtons() 공개 메소드

public appendButtons ( $submit )
    function appendButtons($submit)
    {
        if (!is_array($submit)) {
            $submit = array($submit);
        }
        $this->_submit = array_merge($this->_submit, $submit);
    }

Usage Example

예제 #1
0
파일: compose.php 프로젝트: horde/horde
/* Get Cover Page template name */
$covers = array();
foreach ($_covers as $id => $cover) {
    $covers[$id] = $cover['name'];
}
$tpl = Horde_Util::getFormData('template', 'default');
if (empty($_covers[$tpl])) {
    throw new Horde_Exception(_("The requested Cover Page does not exist."));
}
/* Load Form Actions */
$action = Horde_Form_Action::factory('submit');
/* Create Form */
$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Compose a new Fax"), 'compose');
$form->setButtons(_("Send"));
$form->appendButtons(_("Preview"));
/* Cover Page section */
$form->addVariable(_("Cover Page"), 'fromhdr', 'header', false);
$form->addVariable(_("Template"), 'template', 'enum', true, false, null, array($covers));
$form->addVariable(_("Fax Number"), 'faxnum', 'text', true);
$form->addVariable(_("Name"), 'name', 'text', false);
$form->addVariable(_("Company"), 'company', 'text', false);
$form->addVariable(_("Subject"), 'subject', 'text', false, false, null, array(false, 60));
$form->addVariable(_("Comment"), 'comment', 'longtext', false, false, null, array(4, 80));
/* Set up template. */
$template = $injector->createInstance('Horde_Template');
$template->set('form', '');
$template->set('menu', Hylax::getMenu('string'));
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
$template->set('notify', Horde::endBuffer());