-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcompose.php
61 lines (51 loc) · 2.03 KB
/
compose.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* The Hylax script to compose a new fax.
*
* Copyright 2005-2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Joel Vandal <[email protected]>
*/
require_once __DIR__ . '/lib/Application.php';
$hylax = Horde_Registry::appInit('hylax');
/* Load Cover Page templates */
require HYLAX_BASE . '/config/covers.php';
/* 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());
$page_output->header();
echo $template->fetch(HYLAX_TEMPLATES . '/compose/compose.html');
$renderer = new Horde_Form_Renderer();
$form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
$page_output->footer();