getPages() public method

public getPages ( $fax_id, $num_pages )
Esempio n. 1
0
$form->setButtons(_("Send"), true);
$form->addHidden('', 'url', 'text', false);
$form->addHidden('', 'fax_id', 'int', false);
$form->addVariable(_("Fax destination"), 'fax_number', 'text', true, false, null, array('/^\\d+$/'));
if ($form->validate($vars)) {
    $form->getInfo($vars, $info);
    $send = $hylax->storage->send($info['fax_id'], $info['fax_number']);
    if (is_a($send, 'PEAR_Error')) {
        $notification->push(sprintf(_("Could not send fax ID \"%s\". %s"), $info['fax_id'], $send->getMessage()), 'horde.error');
    } else {
        $notification->push(sprintf(_("Fax ID \"%s\" submitted successfully."), $info['fax_id']), 'horde.success');
    }
    Horde::url($url, true)->redirect();
}
/* Get the preview pages. */
$pages = Hylax::getPages($fax_id, $fax['fax_pages']);
/* Render the form. */
require_once 'Horde/Form/Renderer.php';
$renderer = new Horde_Form_Renderer();
Horde::startBuffer();
$form->renderActive($renderer, $vars, Horde::url('send.php'), 'post');
$send_form = Horde::endBuffer();
/* Set up template. */
$template = $injector->createInstance('Horde_Template');
$template->set('form', $send_form);
$template->set('pages', $pages);
$template->set('menu', $menu->getMenu());
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
$template->set('notify', Horde::endBuffer());
$page_output->header(array('title' => $title));