get_logic(); //if ( $activity =& $game->get_activity($_GET['activity']) ) { if ( $activity =& $game->get_action('A', @$_GET['activity']) ) { //kui on existeeriv activity: if (isset($_POST['activity'])) { //kas nii palju subject-e kui vaja? $subjects = @$_POST['person_id']; //may be null //echo 'subj: '; //var_dump($subjects); /* */ if ($activity->commit($subjects)) { //$compObj = include('result.comp.php'); //$compObj->compose($parent_tpl, $activity, $place); $this->add_comp('result', NULL, $activity); return; } //$activity->commit peaks väärtustama $activity->message } $this->def_tplfile('activityoption.tpl.php'); //$this = & new Template('body.activity.tpl.php'); //$parent_tpl->add_template($place, $this); $this->set('name', $activity->name); $this->set('heading', $activity->heading); $this->set('description', $activity->description); $this->set('weeks', $activity->time_cost); $this->set('hint', $activity->hint); $this->set('message', $activity->message); if ($activity->subject_count > 0) { $this->set('people', 'inimesi vaja: '.$activity->subject_count); $personlist =& new ListView('listview.tpl.php'); $this->add_template('person_list', $personlist); //$personlist->set_items($game->get_persons()); $personlist->set_items($game->get_action_items('P')); $personlist->set('headerLabelsMap', array('name'=>'nimi','profname'=>'amet','picture'=>'pilt','asked'=>'infokaart','person_id'=>'')); $inputType = ($activity->subject_count > 1) ? 'checkbox' : 'radio'; $inputTypeMap['person_id'] = $inputType; $personlist->set('inputTypeMap', $inputTypeMap); /* //echo $activity->subject_count; $compObj = include('page.personlist.php'); $compObj->compose($this, $game, 'person_list'); $this->templates['person_list']->set('inputTypeMap', array('person_id'=>'checkbox')); $personlist = & new ListView('listview.tpl.php'); $parent_tpl->add_template($place, $personlist); $this->set('person_list', $peronlist->render()); */ } } else redirect('?page=maingame'); if (isset($_SESSION['debug'])) $this->add_comp('result_debug', 'debug_info', $activity); } } ?>