1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: 15: 16: 17: 18: 19: 20: 21: 22:
23: class IMP_Prefs_Special_InitialPage implements Horde_Core_Prefs_Ui_Special
24: {
25: 26:
27: public function init(Horde_Core_Prefs_Ui $ui)
28: {
29: }
30:
31: 32:
33: public function display(Horde_Core_Prefs_Ui $ui)
34: {
35: global $injector, $prefs;
36:
37: $view = new Horde_View(array(
38: 'templatePath' => IMP_TEMPLATES . '/prefs'
39: ));
40: $view->addHelper('FormTag');
41: $view->addHelper('Horde_Core_View_Helper_Label');
42: $view->addHelper('Tag');
43:
44: $iterator = new IMP_Ftree_IteratorFilter(
45: $injector->getInstance('IMP_Ftree')
46: );
47: $iterator->add($iterator::REMOTE);
48:
49: if (!($initial_page = $prefs->getValue('initial_page'))) {
50: $initial_page = 'INBOX';
51: }
52: $view->folder_page = IMP_Mailbox::formTo(IMP::INITIAL_FOLDERS);
53: $view->folder_sel = ($initial_page == IMP::INITIAL_FOLDERS);
54: $view->flist = new IMP_Ftree_Select(array(
55: 'basename' => true,
56: 'inc_vfolder' => true,
57: 'iterator' => $iterator,
58: 'selected' => $initial_page
59: ));
60:
61: return $view->render('initialpage');
62: }
63:
64: 65:
66: public function update(Horde_Core_Prefs_Ui $ui)
67: {
68: return $GLOBALS['prefs']->setValue('initial_page', strval(IMP_Mailbox::formFrom($ui->vars->initial_page)));
69: }
70:
71: }
72: