$manager = new Indicator_Manager($_POST['trace']); } $a = $manager->getIndicator($name); if (isset($_POST['trace'])) { $ind = new Indicator($_POST['trace']); } $res = $ind->refresh($a, $after, $before); $r = json_encode($res); echo $r; } if ($_POST['reason'] == 'share') { if (isset($_POST['trace'])) { $store = new Indicator_Store($_POST['trace']); $manager = new Indicator_Manager($_POST['trace']); if (isset($_POST['nameind'])) { $ind = $manager->getIndicator($_POST['nameind']); } $res = $store->addToStore($ind); } echo json_encode($res); } if ($_POST['reason'] == 'getForView') { if (isset($_POST['trace'])) { $manager = new Indicator_Manager($_POST['trace']); } if (isset($_POST['nameind'])) { $ind = $manager->getIndicatorForView($_POST['nameind']); } echo json_encode($ind); } }