1: <?php
2: 3: 4:
5: class Whups_Form_Query_ChooseNameForSave extends Horde_Form
6: {
7: public function __construct(&$vars)
8: {
9: parent::__construct($vars, _("Save Query"), 'Whups_Form_Query_ChooseNameForSave');
10: $this->setButtons(_("Save"));
11:
12: $v = &$this->addVariable(_("Query Name"), 'name', 'text', true);
13: $v->setDefault($GLOBALS['whups_query']->name);
14: $v = &$this->addVariable(_("Query Slug"), 'slug', 'text', false);
15: $v->setDefault($GLOBALS['whups_query']->slug);
16: }
17:
18: public function execute(&$vars)
19: {
20: $GLOBALS['whups_query']->name = $vars->get('name');
21: $GLOBALS['whups_query']->slug = $vars->get('slug');
22: $result = $GLOBALS['whups_query']->save();
23:
24: $this->unsetVars($vars);
25: }
26:
27: }
28: