Esempio n. 1
0
 public function getTaskLists()
 {
     $lists = Nag::listTasklists();
     $results = array();
     foreach ($lists as $name => $list) {
         $tasklist = new Nag_Tasklist($list);
         $results[$name] = $tasklist->toHash();
     }
     $return = new stdClass();
     $return->tasklists = $results;
     return $return;
 }
Esempio n. 2
0
 /**
  * Add base javascript variables to the page.
  */
 protected function _addBaseVars()
 {
     global $page_output, $prefs;
     // Nag::VIEW_* constant
     switch ($prefs->getValue('show_completed')) {
         case Nag::VIEW_INCOMPLETE:
             $show_completed = 'incomplete';
             break;
         case Nag::VIEW_ALL:
             $show_completed = 'all';
             break;
         case Nag::VIEW_COMPLETE:
             $show_completed = 'complete';
             break;
         case Nag::VIEW_FUTURE:
             $show_completed = 'future';
             break;
         case Nag::VIEW_FUTURE_INCOMPLETE:
             $show_completed = 'future-incomplete';
             break;
     }
     // Tasklists. Needed in case we deep link to an existing list.
     $lists = Nag::listTasklists();
     $tasklists = array();
     foreach ($lists as $name => $list) {
         $task = new Nag_Tasklist($list);
         $tasklists[$name] = $task->toHash();
     }
     $code = array('conf' => array('showCompleted' => $show_completed, 'icons' => array('completed' => strval(Horde_Themes::img('checked.png')), 'uncompleted' => strval(Horde_Themes::img('unchecked.png')), 'smartlist' => strval(Horde_Themes::img('smart.png')), 'tasklist' => strval(Horde_Themes::img('tasklists.png')))), 'strings' => array('all' => _("All Tasks"), 'newTask' => _("New Task")), 'tasklists' => $tasklists);
     $page_output->addInlineJsVars(array('var Nag' => $code), array('top' => true));
 }