public function get_html_url_in_public_images()
 {
     $image_row = $this->get_element();
     $html_url = new HTMLTags_URL();
     $html_url->set_file('/hc-database-img-cache/' . $image_row->get_id() . '.' . $image_row->get_file_extension());
     return $html_url;
 }
 public function get_rss_titles_ul(RSS_RSS $rss, $limit = 10)
 {
     //                print_r($rss->get_xml());exit;
     $items = $rss->get_items();
     $tempCounter = 0;
     $ul = new HTMLTags_UL();
     $ul->set_attribute_str('class', 'rss');
     foreach ($items as $item) {
         # DISPLAY ONLY 10 ITEMS.
         if ($tempCounter < $limit + 1) {
             $li = new HTMLTags_LI();
             if ($tempCounter % 2 == 0) {
                 $li->set_attribute_str('class', 'odd');
             }
             $a = new HTMLTags_A();
             $url = new HTMLTags_URL();
             $url->set_file($item->get_url_filename());
             $a->set_href($url);
             $a->append($item->get_title());
             $li->append($a);
             $ul->append($li);
         }
         $tempCounter += 1;
     }
     return $ul;
 }
 public static function get_base_url()
 {
     $url = new HTMLTags_URL();
     #$ph_cm = Configuration_ConfigManagerHelper
     #	::get_config_manager(
     #		'haddock',
     #		'public-html'
     #	);
     #if ($ph_cm->server_has_mod_rewrite()) {
     if (PublicHTML_ServerCapabilitiesHelper::has_mod_rewrite()) {
         $url->set_file('/');
     } else {
         $url->set_file('/haddock/public-html/public-html/index.php');
     }
     return $url;
 }
 /**
  * Makes a local URL.
  *
  * Assumes that you want an OO page.
  */
 public static function make_local_url($page_class, $get_variables = NULL)
 {
     $url = new HTMLTags_URL();
     #if (isset($get_variables)) {
     #	$url->set_file('/');
     #
     #	$url->set_get_variable('oo-page');
     #	$url->set_get_variable('page-class', $page_class);
     #
     #	foreach ($get_variables as $k => $v) {
     #		$url->set_get_variable($k, $v);
     #	}
     #} else {
     #	$url->set_file("/$page_class");
     #}
     $url->set_file('/');
     $url->set_get_variable('oo-page');
     $url->set_get_variable('page-class', $page_class);
     if (isset($get_variables)) {
         foreach ($get_variables as $k => $v) {
             $url->set_get_variable($k, $v);
         }
     }
     return $url;
 }
 public function get_admin_section_home_page_href()
 {
     $admin_section_home_page_href = new HTMLTags_URL();
     $admin_section_home_page_href_str = '/admin/hpi/';
     $admin_section_home_page_href_str .= $this->get_identifying_name();
     $admin_section_home_page_href_str .= '/home.html';
     $admin_section_home_page_href->set_file($admin_section_home_page_href_str);
     return $admin_section_home_page_href;
 }
 public static function get_frame_png_thumbnail_img(Oedipus_Frame $frame, $max_width = 250, $max_height = 185)
 {
     $url = new HTMLTags_URL();
     $url->set_file('/frames/images/thumbnails/frame-' . $frame->get_id() . '_' . $max_width . 'x' . $max_height . '.png');
     $img = new HTMLTags_IMG();
     $img->set_src($url);
     $img->set_alt($frame->get_name());
     return $img;
 }
 public static function get_home_page_url()
 {
     $url = new HTMLTags_URL();
     $url->set_file('/');
     return $url;
     // return self
     // ::get_oo_page_url(
     // '/'
     // );
 }
 public function get_image_img()
 {
     $img = new HTMLTags_IMG();
     $url = new HTMLTags_URL();
     $url->set_file($this->image_url);
     $img->set_src($url);
     $img->set_attribute_str('alt', $this->get_name());
     $img->set_attribute_str('title', $this->get_description());
     return $img;
 }
 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;
 }
 /**
  * DEPRECATED!
  *
  * Use PublicHTML_URLHelper::get_pm_page_url(...) instead!
  */
 public static function get_url($section, $module, $page, $type)
 {
     $url = new HTMLTags_URL();
     $url->set_file('/');
     $url->set_get_variable('section', $section);
     if (isset($module)) {
         $url->set_get_variable('module', $module);
     }
     $url->set_get_variable('page', $page);
     $url->set_get_variable('type', $type);
     return $url;
 }
 public function get_admin_page_html_table_tr()
 {
     $page_row = $this->get_element();
     $admin_pages_html_table_tr = new HTMLTags_TR();
     $name_td = new HTMLTags_TD();
     $name_td->append_str_to_content($page_row->get_name());
     $admin_pages_html_table_tr->append_tag_to_content($name_td);
     $author_td = new HTMLTags_TD();
     $author_td->append_str_to_content($page_row->get_author());
     $admin_pages_html_table_tr->append_tag_to_content($author_td);
     $title_td = new HTMLTags_TD();
     #$title_td->append_str_to_content($page_row->get_title());
     $title_td->append_tag_to_content($this->get_title_a());
     $admin_pages_html_table_tr->append_tag_to_content($title_td);
     /*
      * The actions
      */
     $confirmation_url_base = new HTMLTags_URL();
     $confirmation_url_base->set_file('/');
     $confirmation_url_base->set_get_variable('section', 'haddock');
     $confirmation_url_base->set_get_variable('module', 'admin');
     $confirmation_url_base->set_get_variable('page', 'admin-includer');
     $confirmation_url_base->set_get_variable('type', 'html');
     $confirmation_url_base->set_get_variable('admin-section', 'haddock');
     $confirmation_url_base->set_get_variable('admin-module', 'database');
     /*
      * Edit the page's details.
      */
     $edit_td = new HTMLTags_TD();
     $edit_url = clone $confirmation_url_base;
     $edit_url->set_get_variable('admin-page', 'edit-page');
     $edit_url->set_get_variable('page_id', $page_row->get_id());
     $edit_a = new HTMLTags_A('Edit');
     $edit_a->set_href($edit_url);
     $edit_td->append_tag_to_content($edit_a);
     $admin_pages_html_table_tr->append_tag_to_content($edit_td);
     /*
      * Delete the page.
      */
     $delete_td = new HTMLTags_TD();
     $delete_url = clone $confirmation_url_base;
     $delete_url->set_get_variable('admin-page', 'delete-page');
     $delete_url->set_get_variable('page_id', $page_row->get_id());
     $delete_a = new HTMLTags_A('Delete');
     $delete_a->set_href($delete_url);
     $delete_td->append_tag_to_content($delete_a);
     $admin_pages_html_table_tr->append_tag_to_content($delete_td);
     return $admin_pages_html_table_tr;
 }
 public static function get_spans($str_to_split, $num_displayed_char)
 {
     $spans = array();
     $str_to_split_shortened = '';
     # Shorten the string if it needs it
     $max_length = $num_displayed_char;
     if (strlen($str_to_split) > $max_length) {
         # $str_to_split_shortened = substr($str_to_split, 0, $max_length);
         # $pos = strrpos($str_to_split, " ");
         #
         # if($pos === false) {
         #        $str_to_split_shortened = substr($str_to_split, 0, $max_length)."...";
         #
         # }
         #
         #$str_to_split_shortened =  substr($str_to_split, 0, $pos)."...";
         $str_to_split_shortened = substr($str_to_split, 0, $max_length);
         $truncated_span = new HTMLTags_Span();
         $truncated_span->set_attribute_str('class', 'truncated');
         $truncated_span->append_str_to_content($str_to_split_shortened);
         $truncated_span->append_str_to_content('&nbsp;');
         $truncated_span_show_link = new HTMLTags_A('More...');
         #$truncated_span_show_link->set_attribute_str('onclick', 'javascript: showInline(');
         $truncated_span_show_link->set_attribute_str('class', 'show');
         $truncated_span_show_link->set_attribute_str('title', 'Show the rest of this text');
         $truncated_span_show_location = new HTMLTags_URL();
         $truncated_span_show_location->set_file('#');
         $truncated_span_show_link->set_href($truncated_span_show_location);
         $truncated_span->append_tag_to_content($truncated_span_show_link);
         array_push($spans, $truncated_span);
         $full_span = new HTMLTags_Span();
         $full_span->set_attribute_str('class', 'full');
         $full_span->append_str_to_content($str_to_split);
         $full_span->append_str_to_content('&nbsp;');
         $full_span_hide_link = new HTMLTags_A('...Hide');
         $full_span_hide_link->set_attribute_str('class', 'hide');
         $full_span_hide_link->set_attribute_str('title', 'hide the rest of this text');
         $full_span_hide_location = new HTMLTags_URL();
         $full_span_hide_location->set_file('#');
         $full_span_hide_link->set_href($full_span_hide_location);
         $full_span->append_tag_to_content($full_span_hide_link);
         array_push($spans, $full_span);
     } else {
         $full_span = new HTMLTags_Span();
         $full_span->append_str_to_content($str_to_split);
         array_push($spans, $full_span);
     }
     return $spans;
 }
 public function get_body_div_header()
 {
     /*
      * Create the HTML tags objects.
      */
     $div_header = new HTMLTags_Div();
     $div_header->set_attribute_str('id', 'header');
     /* 
      * Project Logo IMG,
      * for filename look in config, 
      * default should be some haddock fish
      */
     $image_div = new HTMLTags_Div();
     $image_div->set_attribute_str('id', 'logo_image');
     $logo_img = new HTMLTags_IMG();
     $logo_src_url = new HTMLTags_URL();
     $cmf = HaddockProjectOrganisation_ConfigManagerFactory::get_instance();
     /*
      * The admin module has been moved to the plug-ins directory.
      *
      * RFI 2009-10-08
      */
     #$config_manager = $cmf->get_config_manager('haddock', 'admin');
     $config_manager = $cmf->get_config_manager('plug-ins', 'admin');
     $logo_config_filename = $config_manager->get_logo_image_filename();
     $logo_src_url->set_file($logo_config_filename);
     $logo_img->set_src($logo_src_url);
     $image_div->append($logo_img);
     $div_header->append($image_div);
     /* 
      * There are two headers: 
      * Project Title Link (H1)
      * and Page Title (H2)
      */
     $h1_title = new HTMLTags_Heading(1);
     $h1_title->append_str_to_content($this->get_body_div_header_project_heading_content());
     $div_header->append_tag_to_content($h1_title);
     $h2_title = new HTMLTags_Heading(2);
     $h2_title->append_str_to_content($this->get_body_div_header_heading_content());
     $div_header->append_tag_to_content($h2_title);
     $div_header->append($this->get_log_in_state_div());
     $div_header->append($this->get_admin_header_navigation_link_div());
     return $div_header;
 }
 public static function get_db_page_url($page_name)
 {
     #$ph_cm = Configuration_ConfigManagerHelper
     #	::get_config_manager(
     #		'haddock',
     #		'public-html'
     #	);
     #
     #if ($ph_cm->server_has_mod_rewrite()) {
     if (PublicHTML_ServerCapabilitiesHelper::has_mod_rewrite()) {
         #echo "has mod_rewrite!\n";
         $url = new HTMLTags_URL();
         $url->set_file("/db-pages/{$page_name}.html");
     } else {
         $url = PublicHTML_URLHelper::get_base_url();
         $url->set_get_variable('oo-page');
         $url->set_get_variable('pcro-factory', 'DBPages_PCROFactory');
         $url->set_get_variable('page', $page_name);
     }
     return $url;
 }
 public function get_first_tier_navigation_ul()
 {
     $pages = $this->get_pages_for_first_tier_navigation();
     $ul = new HTMLTags_UL();
     foreach ($pages as $page) {
         $li = new HTMLTags_LI();
         if (($this->get_current_page_class_string() == 'VideoLibrary_SearchPage' || $this->get_current_page_class_string() == 'VideoLibrary_HomePage') && $page['name'] == 'home' || $this->get_current_page_class_string() == 'VideoLibrary_TagsPage' && $page['name'] == 'tags') {
             $li->set_attribute_str('class', 'selected');
         }
         $a = new HTMLTags_A();
         $url = new HTMLTags_URL();
         $url->set_file($page['href']);
         $a->set_href($url);
         if ($page['open-in-new-window'] == 'yes') {
             $a->set_attribute_str('target', '_blank');
         }
         $span = new HTMLTags_Span($page['title']);
         $a->append($span);
         $li->append($a);
         $ul->append($li);
     }
     return $ul;
 }
 public function get_current_url()
 {
     $current_url = new HTMLTags_URL();
     if ($_SERVER['HTTPS']) {
         $current_url->set_scheme('https');
     } else {
         $current_url->set_scheme('http');
     }
     if (preg_match('/([-\\w.]+):(\\d+)/', $_SERVER['HTTP_HOST'], $matches)) {
         $current_url->set_domain($matches[1]);
         $current_url->set_port($matches[2]);
     } else {
         $current_url->set_domain($_SERVER['HTTP_HOST']);
     }
     $file = $_SERVER['REQUEST_URI'];
     if (preg_match('/(.*)\\?/', $file, $matches)) {
         $file = $matches[1];
     }
     $current_url->set_file($file);
     foreach (array_keys($_GET) as $get_var_key) {
         $current_url->set_get_variable($get_var_key, $_GET[$get_var_key]);
     }
     return $current_url;
 }
/**
 * Title div for the header of an admin-includer page.
 *
 * @copyright Clear Line Web Design, 2007-08-23
 */
/* Code copied from new style Admin_HTMLPage
 * to give old-style admin pages the same look
 */
$image_div = new HTMLTags_Div();
$image_div->set_attribute_str('id', 'logo_image');
$logo_img = new HTMLTags_IMG();
$logo_src_url = new HTMLTags_URL();
$cmf = HaddockProjectOrganisation_ConfigManagerFactory::get_instance();
$config_manager = $cmf->get_config_manager('haddock', 'admin');
$logo_config_filename = $config_manager->get_logo_image_filename();
$logo_src_url->set_file($logo_config_filename);
$logo_img->set_src($logo_src_url);
$image_div->append($logo_img);
echo $image_div->get_as_string();
$h1_title = new HTMLTags_Heading(1);
$home_link = new HTMLTags_A(HaddockProjectOrganisation_ProjectInformationHelper::get_title());
$home_link->set_href(new HTMLTags_URl('/'));
$h1_title->append_tag_to_content($home_link);
echo $h1_title->get_as_string();
$gvm = Caching_GlobalVarManager::get_instance();
echo "<h2>\n";
//
//echo "Admin\n";
//
//echo "&nbsp;&gt;&nbsp;\n";
#echo $current_module_directory->get_admin_section_title();
<?php

/**
 * The p the link to the page for all the products.
 * 
 * @copyright Clear Line Web Design, 2007-07-26
 */
$all_products_link = new HTMLTags_A('See All Products');
$all_products_location = new HTMLTags_URL();
$all_products_location->set_file('/');
$all_products_location->set_get_variable('section', 'plug-ins');
$all_products_location->set_get_variable('module', 'shop');
$all_products_location->set_get_variable('page', 'products');
$all_products_location->set_get_variable('type', 'html');
$all_products_link->set_href($all_products_location);
$all_products_link_p = new HTMLTags_P();
$all_products_link_p->append_tag_to_content($all_products_link);
echo $all_products_link_p->get_as_string();
 public function get_script_uri()
 {
     $script_uri = new HTMLTags_URL();
     $script_uri->set_file('/');
     $script_uri->set_get_variable('section', $this->get_section());
     if ($this->get_section() != 'project-specific') {
         $script_uri->set_get_variable('module', $this->get_module());
     }
     $script_uri->set_get_variable('page', $this->get_page());
     $script_uri->set_get_variable('type', $this->get_type());
     return $script_uri;
 }
    public function get_edited_confirmation_div()
    {
        $order = $this->get_element();
        $product = $order->get_product();
        $confirmation_div = new HTMLTags_Div();
        $confirmation_text = <<<TXT
You have changed the amount of&nbsp;
TXT;
        $confirmation_text .= $product->get_name();
        $confirmation_text .= <<<TXT
&nbsp;in your Shopping Basket.
TXT;
        $confirmation_text_p = new HTMLTags_P($confirmation_text);
        $confirmation_div->append_tag_to_content($confirmation_text_p);
        $all_products_link = new HTMLTags_A('View All Products');
        //            $all_products_link->set_attribute_str('class', 'all_products');
        $all_products_location = new HTMLTags_URL();
        $all_products_location->set_file('/products.html');
        //            $all_products_location->set_get_variable('page', 'orders');
        $all_products_link->set_href($all_products_location);
        $confirmation_div->append_tag_to_content($all_products_link);
        return $confirmation_div;
    }
 public function get_log_out_url()
 {
     $log_out_url = new HTMLTags_URL();
     $log_out_url->set_file('/');
     $log_out_url->set_get_variable('section', 'haddock');
     $log_out_url->set_get_variable('module', 'admin');
     $log_out_url->set_get_variable('page', 'log-out');
     $log_out_url->set_get_variable('type', 'redirect-script');
     return $log_out_url;
 }
    public function get_changed_confirmation_div()
    {
        $customer_region = $this->get_element();
        $confirmation_div = new HTMLTags_Div();
        $confirmation_text = <<<TXT
You have changed your region to&nbsp;
TXT;
        $confirmation_text .= $customer_region->get_name_with_the();
        $confirmation_text .= <<<TXT
.
TXT;
        $confirmation_text_p = new HTMLTags_P($confirmation_text);
        $confirmation_div->append_tag_to_content($confirmation_text_p);
        $all_products_link = new HTMLTags_A('View Products Available in&nbsp;' . $customer_region->get_name_with_the());
        //            $all_products_link->set_attribute_str('class', 'all_products');
        $all_products_location = new HTMLTags_URL();
        $all_products_location->set_file('/');
        $all_products_location->set_get_variable('section', 'plug-ins');
        $all_products_location->set_get_variable('module', 'shop');
        $all_products_location->set_get_variable('page', 'products');
        $all_products_location->set_get_variable('type', 'html');
        $all_products_location->set_get_variable('customer_region_session', $customer_region->get_id());
        $all_products_link->set_href($all_products_location);
        $confirmation_div->append_tag_to_content($all_products_link);
        return $confirmation_div;
    }
 public function get_comment_adding_form()
 {
     $mysql_user_factory = Database_MySQLUserFactory::get_instance();
     $mysql_user = $mysql_user_factory->get_for_this_project();
     $database = $mysql_user->get_database();
     $comments_table = $database->get_table('hpi_shop_comments');
     $commenters_table = $database->get_table('hpi_shop_commenters');
     $redirect_script_url = new HTMLTags_URL();
     $redirect_script_url->set_file('/admin/redirect-script.php');
     $redirect_script_url->set_get_variable('type', 'redirect-script');
     $redirect_script_url->set_get_variable('module', 'shop');
     $redirect_script_url->set_get_variable('page', 'comments');
     $cancel_location = new HTMLTags_URL();
     $cancel_location->set_file('/admin/shop/comments.html');
     $comment_adding_form = new HTMLTags_SimpleOLForm('comment_adding');
     $comment_adding_action = clone $redirect_script_url;
     $comment_adding_action->set_get_variable('add_comment');
     $comment_adding_form->set_action($comment_adding_action);
     $comment_adding_form->set_legend_text('Add a comment');
     #Added 	Status 	Front Page 	Name 	Comment
     /*
      * The name
      */
     $name_field = $commenters_table->get_field('name');
     $name_field_renderer = $name_field->get_renderer();
     $input_tag = $name_field_renderer->get_form_input();
     $input_tag->set_attribute_str('id', 'name');
     $comment_adding_form->add_input_tag('name', $input_tag);
     /*
      * The email
      */
     $email_field = $commenters_table->get_field('email');
     $email_field_renderer = $email_field->get_renderer();
     $input_tag = $email_field_renderer->get_form_input();
     $input_tag->set_attribute_str('id', 'email');
     $comment_adding_form->add_input_tag('email', $input_tag);
     /*
      * The homepage_title
      */
     $homepage_title_field = $commenters_table->get_field('homepage_title');
     $homepage_title_field_renderer = $homepage_title_field->get_renderer();
     $input_tag = $homepage_title_field_renderer->get_form_input();
     $input_tag->set_attribute_str('id', 'homepage_title');
     $comment_adding_form->add_input_tag('homepage_title', $input_tag);
     /*
      * The url
      */
     $url_field = $commenters_table->get_field('url');
     $url_field_renderer = $url_field->get_renderer();
     $input_tag = $url_field_renderer->get_form_input();
     $input_tag->set_attribute_str('id', 'url');
     $comment_adding_form->add_input_tag('url', $input_tag, 'URL');
     /*
      * The comment
      */
     $comment_field = $comments_table->get_field('comment');
     $comment_field_renderer = $comment_field->get_renderer();
     $input_tag = $comment_field_renderer->get_form_input();
     $input_tag->set_attribute_str('id', 'comment');
     $comment_adding_form->add_input_tag('comment', $input_tag);
     /*
      * The status enum
      */
     $status_field = $comments_table->get_field('status');
     $status_field_renderer = $status_field->get_renderer();
     $input_tag = $status_field_renderer->get_form_input();
     $input_tag->set_attribute_str('id', 'status');
     $comment_adding_form->add_input_tag('status', $input_tag);
     /*
      * The front_page enum
      */
     $front_page_field = $comments_table->get_field('front_page');
     $front_page_field_renderer = $front_page_field->get_renderer();
     $input_tag = $front_page_field_renderer->get_form_input();
     $input_tag->set_attribute_str('id', 'front_page');
     $comment_adding_form->add_input_tag('front_page', $input_tag);
     /*
      * The update button.
      */
     $comment_adding_form->set_submit_text('Add');
     $comment_adding_form->set_cancel_location($cancel_location);
     return $comment_adding_form;
 }
        $redirect_script_url->set_get_variable('return_to', $_GET['return_to']);
    }
    $cancel_href = new HTMLTags_URL();
    $cancel_href->set_file('/log-in.html');
    $customer_log_in_form = $customers_table_renderer->get_customer_log_in_form($redirect_script_url, $cancel_href);
    $log_in_to_account_div->append_tag_to_content($customer_log_in_form);
}
$content_div->append_tag_to_content($log_in_to_account_div);
// Create new account (go to customer-details.html)
$create_new_customer_div = new HTMLTags_Div();
$create_new_customer_div->set_attribute_str('id', 'create_new_customer_div');
$create_new_customer_link = new HTMLTags_A('Create New Customer');
$create_new_customer_link->set_attribute_str('class', 'cool_button');
$create_new_customer_link->set_attribute_str('id', 'create_new_customer_button');
$create_new_customer_location = new HTMLTags_URL();
$create_new_customer_location->set_file('/');
$create_new_customer_location->set_get_variable('page', 'customer-details');
if (isset($_GET['return_to'])) {
    $create_new_customer_location->set_get_variable('return_to', $_GET['return_to']);
}
$create_new_customer_link->set_href($create_new_customer_location);
$create_new_customer_div->append_tag_to_content($create_new_customer_link);
$content_div->append_tag_to_content($create_new_customer_div);
// Blurb at bottom
$p_text = <<<TXT
We hope you have a pleasant login experience.
TXT;
$content_div->append_tag_to_content(new HTMLTags_P($p_text));
// Links to all products and checkout
//$shopping_basket_checkout_links_ul =
//        $shopping_baskets_table_renderer->
             * If a MySQL user for this project has not yet been created,
             * ask the user if they want to create one now.
             */
            if (!$root_mysql_user->has_user_for_this_project()) {
                $db_user_not_yet_p = new HTMLTags_P();
                $db_user_not_yet_p->set_attribute_str('class', 'error');
                $db_user_not_yet_p->append_str_to_content('The database user for this project does not exist yet!');
                $content_div->append_tag_to_content($db_user_not_yet_p);
                /*
                 * -------------------------------------------------------------
                 */
                $create_db_user_p = new HTMLTags_P();
                $create_db_user_p->append_str_to_content('Click ');
                $create_db_user_a = new HTMLTags_A('here');
                $create_db_user_url = new HTMLTags_URL();
                $create_db_user_url->set_file('/admin/redirect-script.php');
                $create_db_user_url->set_get_variable('module', 'database');
                $create_db_user_url->set_get_variable('page', 'user-management');
                $create_db_user_url->set_get_variable('create_db_user');
                $create_db_user_a->set_href($create_db_user_url);
                $create_db_user_p->append_tag_to_content($create_db_user_a);
                $create_db_user_p->append_str_to_content(' to create it.');
                $content_div->append_tag_to_content($create_db_user_p);
            } else {
                $db_user_already_p = new HTMLTags_P();
                $db_user_already_p->append_str_to_content('The database user for this project exists.');
                $content_div->append_tag_to_content($db_user_already_p);
            }
        }
    }
}
 protected function get_current_url_just_file()
 {
     $url = new HTMLTags_URL();
     $url->set_file($this->get_current_url_file_str());
     return $url;
 }
    #--------------------------------
    $comment_form_div = new HTMLTags_Div();
    $comment_form_div->set_attribute_str('class', 'comment-form');
    $form_notification_div = new HTMLTags_Div();
    $form_notification_div->set_attribute_str('id', 'form_notification_div');
    if (isset($_GET['last_added_id'])) {
        $form_notification_div->append_tag_to_content(new HTMLTags_P('Thank you for your comment.<br />
						Comments can take up to 24 hours to 
						appear in the guestbook.'));
    }
    if (isset($_GET['form_incomplete'])) {
        $form_notification_div->append_tag_to_content(new HTMLTags_P('Please complete name, email and comment'));
    }
    $comment_form_div->append_tag_to_content($form_notification_div);
    $comment_adding_action_url = new HTMLTags_URL();
    $comment_adding_action_url->set_file('/');
    $comment_adding_action_url->set_get_variable('section', 'plug-ins');
    $comment_adding_action_url->set_get_variable('module', 'shop');
    $comment_adding_action_url->set_get_variable('page', 'product');
    $comment_adding_action_url->set_get_variable('type', 'redirect-script');
    $comment_adding_action_url->set_get_variable('product_id', $_GET['product_id']);
    $cancel_location = new HTMLTags_URL();
    $cancel_location->set_file('/');
    $cancel_location->set_get_variable('section', 'plug-ins');
    $cancel_location->set_get_variable('module', 'shop');
    $cancel_location->set_get_variable('page', 'product');
    $cancel_location->set_get_variable('product_id', $_GET['product_id']);
    $comment_adding_form = new HTMLTags_SimpleOLForm('comment_adding');
    $comment_adding_form->set_attribute_str('class', 'cmxform');
    $comment_adding_form->set_attribute_str('id', 'comment-form');
    $comment_adding_action = $comment_adding_action_url;
Esempio n. 28
0
<?php

/**
 * Security for the admin pages.
 *
 * @copyright Clear Line Web Design, 2007-08-06
 */
$admin_login_manager = Admin_LoginManager::get_instance();
if (!$admin_login_manager->is_logged_in()) {
    $page_manager = PublicHTML_PageManager::get_instance();
    unset($_SESSION['admin-login-data']);
    #$_SESSION['admin-login-data']['desired-url'] = $page_manager->get_script_uri();
    $script_uri = $page_manager->get_script_uri();
    $desired_uri = new HTMLTags_URL();
    $desired_uri->set_file('/');
    foreach (array_keys($_GET) as $key) {
        $desired_uri->set_get_variable($key, $_GET[$key]);
    }
    $suggv = $script_uri->get_get_variables();
    foreach (array_keys($suggv) as $key) {
        $desired_uri->set_get_variable($key, $suggv[$key]);
    }
    //$_SESSION['admin-login-data']['desired-url'] = '/';
    //
    //$first = TRUE;
    //foreach (array_keys($desired_get_vars) as $key) {
    //    if ($first) {
    //        $first = FALSE;
    //    } else {
    //        $_SESSION['admin-login-data']['desired-url'] = '&';
    //    }
 protected function get_admin_url()
 {
     $admin_url = new HTMLTags_URL();
     $admin_url->set_file('/');
     $admin_url->set_get_variable('section', 'haddock');
     $admin_url->set_get_variable('module', 'admin');
     $admin_url->set_get_variable('page', 'admin-includer');
     $admin_url->set_get_variable('admin-section', 'haddock');
     $admin_url->set_get_variable('admin-module', 'database');
     $admin_url->set_get_variable('admin-page', 'table');
     $table = $this->get_element();
     $admin_url->set_get_variable('table', $table->get_name());
     return $admin_url;
 }
$redirect_script_url->set_get_variable('type', 'redirect-script');
$cancel_href = $current_page_url;
$mysql_user_factory = Database_MySQLUserFactory::get_instance();
$mysql_user = $mysql_user_factory->get_for_this_project();
$database = $mysql_user->get_database();
$customers_table = $database->get_table('hpi_shop_customers');
$customers_table_renderer = $customers_table->get_renderer();
$customer_regions_table = $database->get_table('hpi_shop_customer_regions');
$shopping_baskets_table = $database->get_table('hpi_shop_shopping_baskets');
$shopping_baskets_table_renderer = $shopping_baskets_table->get_renderer();
$paypal_form_div = new HTMLTags_Div();
$paypal_form_div->set_attribute_str('id', 'paypal_form_div');
$paypal_form = new HTMLTags_Form();
$paypal_form_action = new HTMLTags_URL();
//$paypal_form_action->set_file('https://www.paypal.com/cgi-bin/webscr'); 	# The real thing
$paypal_form_action->set_file('https://www.sandbox.paypal.com/cgi-bin/webscr');
# The sandbox
$paypal_form->set_action($paypal_form_action);
$paypal_form->set_attribute_str('method', 'post');
// Overall Settings
$customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
$currency = $customer_region->get_currency();
$paypal_form->add_hidden_input('cmd', '_cart');
$paypal_form->add_hidden_input('upload', '1');
//$paypal_form->add_hidden_input('business', '*****@*****.**');	# The Real Thing
$paypal_form->add_hidden_input('business', '*****@*****.**');
# The Sandbox
$paypal_form->add_hidden_input('currency_code', $currency->get_iso_4217_code());
$paypal_form->add_hidden_input('custom', session_id());
# NOTIFY URL -urlencode, + it can only have one get variable
$secret = 'shhhh';