public function __construct(Oedipus_Frame $frame, Oedipus_Character $character) { parent::__construct($frame, 'character_editor'); // $this->frame = $frame; # Name Input $this->add_input_name_with_value('character_name', $character->get_name(), 'character'); # color Input $this->add_input_name_with_value('character_color', $character->get_color(), 'Color'); # Hidden Inputs $this->add_hidden_input('character_id', $character->get_id()); }
private function get_characters_background_color(Oedipus_Character $character) { // define some colors // These are full bright colours // $red = imagecolorallocate($this->image, 255, 0, 0); // $blue = imagecolorallocate($this->image, 0, 0, 255); // These are at 50% saturation $red = imagecolorallocate($this->image, 255, 128, 128); $blue = imagecolorallocate($this->image, 128, 128, 255); $green = imagecolorallocate($this->image, 128, 255, 128); $orange = imagecolorallocate($this->image, 255, 228, 128); $color = $character->get_color(); switch ($color) { case 'red': return $red; case 'blue': return $blue; case 'green': return $green; case 'orange': return $orange; default: return $red; } }
public function get_stated_intention_tile(Oedipus_StatedIntention $stated_intention, Oedipus_Character $character, $explanation) { // <a href="#" class="si-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_stated_intention' => 1, 'stated_intention_id' => $stated_intention->get_id(), 'stated_intention_tile' => $stated_intention->get_tile(), 'stated_intention_doubt' => $stated_intention->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($stated_intention->get_tile() . $stated_intention->get_doubt()); $html_tile->set_href($html_tile_link); /** * 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($character->get_name()) . " Stated Intention" . '|' . $explanation); $html_tile->set_attribute_str('class', 'si-tile'); $html_tile_id = $character->get_color() . $stated_intention->get_tile() . $this->add_q_to_doubt($stated_intention->get_doubt()); $html_tile->set_attribute_str('id', $html_tile_id); return $html_tile; }