public function __construct(Oedipus_Frame $frame, $name)
 {
     parent::__construct('form', NULL);
     $method = 'POST';
     $this->set_attribute_str('name', $name);
     $this->set_attribute_str('method', $method);
     $this->set_attribute_str('class', 'frame-form');
     $this->input_lis = array();
     $this->frame = $frame;
     # action
     $this_action = $this->get_frame_editor_form_action_url();
     $this->set_action($this_action);
     //                # cancel
     //                $this_cancel = $this->get_frame_editor_form_cancel_url();
     //                $this->set_cancel_location($this_cancel);
     # Hidden Inputs
     $this->add_hidden_input('frame_id', $frame->get_id());
     /*
      *If we're on the edit_frame section of Drama Page,
      * pass this on to set the return to correctly
      */
     if (isset($_GET['edit_frame'])) {
         $this->add_hidden_input('return_to_get', 'edit_frame');
     }
     $this->set_submit_text('Save');
 }
 public function __construct(Oedipus_Frame $frame)
 {
     parent::__construct();
     $this->set_attribute_str('class', 'oedipus');
     $this->frame = $frame;
     $this->characters = $frame->get_characters();
 }
 private function get_oedipus_png_frame(Oedipus_Frame $frame)
 {
     $max_width = 100;
     $max_height = 100;
     $url = new HTMLTags_URL();
     $url->set_file('/frames/images/thumbnails/option-frame-' . $frame->get_id() . '_' . $max_width . 'x' . $max_height . '.png');
     $img = new HTMLTags_IMG();
     $img->set_src($url);
     return $img;
 }
 public static function get_frame_png_thumbnail_img_a(Oedipus_Frame $frame, $max_width = 250, $max_height = 185)
 {
     $url = Oedipus_DramaHelper::get_drama_page_url_for_frame_id($frame->get_id());
     $a = new HTMLTags_A();
     $a->set_href($url);
     $a->set_attribute_str('title', 'View this Frame');
     $img = self::get_frame_png_thumbnail_img($frame, $max_width, $max_height);
     $a->append_tag_to_content($img);
     return $a;
 }
 public function __construct($drama_id, Oedipus_Frame $frame)
 {
     parent::__construct('add-frame-note');
     # Note Text Input
     $this->add_textarea_with_value('note_text', '', 'Note');
     # action
     $this_action = $this->get_frame_note_editor_form_action_url();
     $this->set_action($this_action);
     # Hidden Inputs
     $this->add_hidden_input('drama_id', $drama_id);
     $this->add_hidden_input('frame_id', $frame->get_id());
     $this->add_hidden_input('add_note', 1);
 }
    public static function add_note_to_frame(Oedipus_Frame $frame, $note_text)
    {
        // ADD NOTE TO DATABASE
        $dbh = DB::m();
        $note_sql = <<<SQL
INSERT INTO
\toedipus_notes
SET
\tnote_text = '{$note_text}',
\tadded = NOW()
SQL;
        //                print_r($sql);exit;
        $note_result = mysql_query($note_sql, $dbh);
        $note_id = mysql_insert_id($dbh);
        // ADD LINK TO DATABASE
        $frame_id = $frame->get_id();
        $link_sql = <<<SQL
INSERT INTO
\toedipus_frame_to_note_links
SET
\tframe_id = '{$frame_id}',
\tnote_id = '{$note_id}'
SQL;
        //                                print_r($link_sql);exit;
        $link_result = mysql_query($link_sql, $dbh);
        $link_id = mysql_insert_id($dbh);
        return new Oedipus_Note($note_id, $note_text, date());
    }
 private function get_next_navigation_div(Oedipus_Frame $frame, $child_frames)
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('id', 'next-frames');
     $div->append(new HTMLTags_Heading(4, 'Next Frames'));
     $ul = new HTMLTags_UL();
     foreach ($child_frames as $child) {
         $li = new HTMLTags_LI();
         $li->append(new HTMLTags_Heading(5, $child->get_name()));
         $li->append(Oedipus_FrameImageHelper::get_frame_png_thumbnail_img_a($child, 150, 100));
         $ul->append($li);
     }
     if ($frame->is_editable()) {
         $li = new HTMLTags_LI();
         $li->append(self::get_add_node_a($frame));
         $ul->append($li);
     }
     $div->append($ul);
     return $div;
 }
 public function get_drama_url_for_frame(Oedipus_Frame $frame)
 {
     return PublicHTML_URLHelper::get_oo_page_url('Oedipus_DramaPage', array('drama_id' => $frame->get_drama_id()));
 }
 public function add_frame(Oedipus_Frame $frame)
 {
     //                $this->frames[$frame->get_name()] = $frame;
     $this->frames[$frame->get_id()] = $frame;
 }