<!-- Filter helper buttons. Disabled in this version -->  

<!-- <div class="filter-control">
	<span class="fc-button fc-state-default" id="all_exps" style="-moz-user-select: none;">Select all experiments</span>
	<span class="fc-button fc-state-default" id="clear_exps" style="-moz-user-select: none;">Clear experiment filter</span>
	<span class="fc-button fc-state-default" id="all_parts" style="-moz-user-select: none;">Select all participants</span>
	<span class="fc-button fc-state-default" id="clear_parts" style="-moz-user-select: none;">Clear participant filter</span>
</div>-->

<div class="filter" style="margin-bottom: 10px;">
	<select class="chosen-select select-experiment" multiple data-placeholder="<?php 
echo lang('filter_experiment');
?>
">
		<?php 
foreach (experiment_options($experiments) as $id => $option) {
    echo '<option value="' . $id . '">' . $option . '</option>\\n';
}
?>
	</select>
	
	<select class="chosen-select select-participant" multiple data-placeholder="<?php 
echo lang('filter_participant');
?>
">
		<?php 
foreach (participant_options($participants) as $id => $option) {
    echo '<option value="' . $id . '">' . $option . '</option>\\n';
}
?>
	</select>
 /** Add view for ad hoc participation */
 public function add()
 {
     $this->admin_only();
     $participants = $this->participantModel->get_all_participants();
     $experiments = $this->experimentModel->get_all_experiments();
     $leaders = array_merge($this->userModel->get_all_leaders(), $this->userModel->get_all_admins());
     $data['page_title'] = lang('ad_hoc_participation');
     $data['action'] = 'participation/add_submit';
     $data['experiments'] = experiment_options($experiments);
     $data['participants'] = participant_options($participants);
     $data['leaders'] = leader_options($leaders);
     $this->load->view('templates/header', $data);
     $this->load->view('participation_add_view', $data);
     $this->load->view('templates/footer');
 }
 /** Specifies the contents of the edit experiment page */
 public function edit($experiment_id)
 {
     if (is_leader() && !$this->leaderModel->is_leader_for_experiment(current_user_id(), $experiment_id)) {
         show_error("You are not a leader for this experiment.");
     }
     $experiment = $this->experimentModel->get_experiment_by_id($experiment_id);
     $leaders = array_merge($this->userModel->get_all_leaders(), $this->userModel->get_all_admins());
     $callers = $this->userModel->get_all_users();
     $experiments = $this->experimentModel->get_all_experiments(TRUE, $experiment_id);
     $data['page_title'] = lang('edit_experiment');
     $data['action'] = 'experiment/edit_submit/' . $experiment_id;
     $data = add_fields($data, 'experiment', $experiment);
     $data['date_start'] = output_date($experiment->date_start, TRUE);
     $data['date_end'] = output_date($experiment->date_end, TRUE);
     $data['locations'] = $this->locationModel->get_all_locations();
     $data['callers'] = caller_options($callers);
     $data['leaders'] = leader_options($leaders);
     $data['experiments'] = experiment_options($experiments);
     $data['location_id'] = $this->locationModel->get_location_by_experiment($experiment)->id;
     $data['current_caller_ids'] = $this->callerModel->get_caller_ids_by_experiment($experiment_id);
     $data['current_leader_ids'] = $this->leaderModel->get_leader_ids_by_experiment($experiment_id);
     $data['current_prerequisite_ids'] = $this->relationModel->get_relation_ids_by_experiment($experiment_id, RelationType::Prerequisite);
     $data['current_exclude_ids'] = $this->relationModel->get_relation_ids_by_experiment($experiment_id, RelationType::Excludes);
     $data['current_combination_ids'] = $this->relationModel->get_relation_ids_by_experiment($experiment_id, RelationType::Combination);
     $this->load->view('templates/header', $data);
     $this->load->view('experiment_edit_view', $data);
     $this->load->view('templates/footer');
 }