/** * Topic Management constructor * calls parent constructor too. * * @param string $action represents the action to do ('add', 'mod', 'del') * @param int $id topic id * @param int $id_test test id */ public function __construct($action, $id = null, $id_test = null) { parent::__construct($action, $id); if ($_POST && $_POST['id_nodo_parent'] == $id_test) { $this->what = translateFN('sessione'); } else { $this->what = translateFN('argomento'); } $this->id_test = $id_test; }
/** * Management constructor. the $action parameter must be 'add', 'mod' or 'del' * * @global db $dh * * @param string $action * @param int $id node id * @param int $id_test test node id */ public function __construct($action, $id = null, $id_test = null) { $dh = $GLOBALS['dh']; parent::__construct($action, $id); $this->what = translateFN('domanda'); if (is_null($id_test)) { $q = $dh->test_getNode($id); if (AMATestDataHandler::isError($q) || empty($q)) { return; } $id_test = $q['id_nodo_radice']; } $test = $dh->test_getNode($id_test); if (AMATestDataHandler::isError($test) || empty($test)) { return; } $this->test = $test; }