public function get_explanation_for_position(Oedipus_Character $character, Oedipus_Position $position, Oedipus_Option $option) { /* *Set the Phrases */ $owner_of_position = $position->get_character()->get_name(); $owner_of_position_is_plural = self::is_plural($owner_of_position); if ($owner_of_position == $character->get_name()) { if ($owner_of_position_is_plural) { $owner_of_option = ' they '; } else { $owner_of_option = ' he/she '; } } else { $owner_of_option = $character->get_name(); } $should_or_shouldnt = self::get_position_str($position, $owner_of_position_is_plural); /* *Construct the sentence */ $explanation = ''; $explanation .= $owner_of_position . ' '; if ($owner_of_position_is_plural) { $explanation .= 'say '; } else { $explanation .= 'says '; } $explanation .= 'that ' . $owner_of_option . ' '; $explanation .= $should_or_shouldnt . ' '; $explanation .= $option->get_name() . '.'; return $explanation; }
public function get_position_tile(Oedipus_Position $position, $explanation) { // <a href="#" class="position-tile" id="character1-option1">0</a> if ($this->frame->is_editable()) { $html_tile_link = PublicHTML_URLHelper::get_oo_page_url('Oedipus_EditFrameRedirectScript', array('frame_id' => $this->frame->get_id(), 'edit_position' => 1, 'position_id' => $position->get_id(), 'position_tile' => $position->get_tile(), 'position_doubt' => $position->get_doubt())); if (isset($_GET['edit_frame'])) { $html_tile_link->set_get_variable('return_to_get', 'edit_frame'); } } else { $html_tile_link = new HTMLTags_URL(); $html_tile_link->set_file('#'); } $html_tile = new HTMLTags_A($position->get_tile() . $position->get_doubt()); /** * An explanation for the position is set here in the * title attribute, for the javascript to use as a * cool -tip */ $html_tile->set_attribute_str('title', Oedipus_LanguageHelper::get_possessive($position->get_character()->get_name()) . " Position" . '|' . $explanation); $html_tile->set_href($html_tile_link); $html_tile->set_attribute_str('class', 'position-tile'); $character = $position->get_character(); $html_tile_id = $character->get_color() . $position->get_tile() . $this->add_q_to_doubt($position->get_doubt()); $html_tile->set_attribute_str('id', $html_tile_id); return $html_tile; }