private static function get_link_p_to_admin_section(HTMLTags_A $a)
 {
     $p = new HTMLTags_P();
     $p->set_attribute_str('class', 'haddock_admin');
     $p->append($a);
     return $p;
 }
 protected function get_message_div($msg)
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('id', 'message');
     $p = new HTMLTags_P();
     $p->append($msg);
     $div->append($p);
     return $div;
 }
 protected function get_last_action_div()
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('class', 'last-action-div');
     /*
      * See if we edited anything
      */
     if (isset($_GET['edited']) && isset($_GET['message'])) {
         $p = new HTMLTags_P();
         if (isset($_GET['error'])) {
             $div->append('<p><em>Please contact your Website Administrator</em></p>');
             $p->append(urldecode($_GET['error']));
             $div->set_attribute_str('id', 'error');
         } else {
             $p->append($_GET['message']);
         }
         $div->append($p);
     }
     return $div;
 }
 public function get_drama_url_div(Oedipus_Drama $drama)
 {
     $div = new HTMLTags_Div();
     $div->append('<h3>Web address for this drama:</h3>');
     $p = new HTMLTags_P();
     $p->append(self::get_unique_link_for_drama($drama));
     $div->append($p);
     return $div;
 }
    public function get_widget_content()
    {
        $mysql_user_factory = Database_MySQLUserFactory::get_instance();
        $mysql_user = $mysql_user_factory->get_for_this_project();
        $database = $mysql_user->get_database();
        $people_table = $database->get_table('hpi_mailing_list_people');
        $widget_div = new HTMLTags_Div();
        $rows_html_ul = new HTMLTags_UL();
        $rows_html_ul->set_attribute_str('class', 'people');
        $query = <<<SQL
SELECT *
FROM hpi_mailing_list_people
WHERE status = 'new' OR status = 'accepted'
ORDER BY `added` DESC
LIMIT 0, 5
SQL;
        try {
            $rows = $people_table->get_rows_for_select($query);
        } catch (Exception $e) {
        }
        if (count($rows) > 0) {
            $explanation_p = new HTMLTags_P();
            $explanation_txt = <<<TXT
The last five people to join the list:
TXT;
            $explanation_p->append($explanation_txt);
            $widget_div->append($explanation_p);
            foreach ($rows as $row) {
                $li = new HTMLTags_LI();
                $li->append_str_to_content($row->get_name() . '&nbsp;(' . $row->get_email() . ')');
                $rows_html_ul->append_tag_to_content($li);
            }
        } else {
            $no_people_p = new HTMLTags_P();
            $no_people_txt = <<<TXT
There are no people in the Mailing List.
TXT;
            $no_people_p->append($no_people_txt);
            $widget_div->append($no_people_p);
        }
        $widget_div->append_tag_to_content($rows_html_ul);
        $widget_div->append(self::get_mailing_list_links_ul());
        return $widget_div;
    }