public function offsetGet($offset, $subset) { $helper = new TaskerHelper(); switch ($offset) { case 'add': Site::$response = $helper->addItem(); break; case 'delete': if (isset($_POST['id'])) { Site::$response = $helper->hideItem($_POST['id']); } break; case 'undo': if (isset($_POST['id'])) { Site::$response = $helper->setItemUndone($_POST['id']); } break; case 'do': if (isset($_POST['id'])) { Site::$response = $helper->setItemDone($_POST['id']); } break; case 'tasks': $list = new Lists(); $list->offsetGet($subset); Site::$response = $this->writeLists(); break; case 'interpret': Site::$response = $this->interpret($_POST['raw']); break; case 'keys': $keys = new Keywords(); Site::$response = $keys->outputAsideGUI(); break; case 'dates': Site::$response = Time::getDates($_POST['dates']); break; case 'date': Site::$response = Time::getDateFromString(Site::$subsection); break; case 'view': $helper->getItem(Site::$subsection); break; case 'update': $helper->getItem(Site::$subsection); break; case 'import': self::getImportInterface(); break; case 'setup': self::setupDB(); break; default: #FB::error($offset, 'OFFSET NOT KNOWN'); self::$keywords = new Keywords(); $list = new Lists(); $list->offsetGet($offset); self::getInterface(); break; } return true; }