当前位置: 首页>>代码示例>>PHP>>正文


PHP PublicHTML_PageManager类代码示例

本文整理汇总了PHP中PublicHTML_PageManager的典型用法代码示例。如果您正苦于以下问题:PHP PublicHTML_PageManager类的具体用法?PHP PublicHTML_PageManager怎么用?PHP PublicHTML_PageManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PublicHTML_PageManager类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_instance

 public static function get_instance()
 {
     if (self::$instance == NULL) {
         self::$instance = new PublicHTML_PageManager();
     }
     return self::$instance;
 }
开发者ID:saulhoward,项目名称:haddock-cms,代码行数:7,代码来源:PublicHTML_PageManager.inc.php

示例2:

<?php

/**
 * The content of a page that shows a product.
 *
 * @copyright Clear Line Web Design, 2007-07-26
 */
/*
 * Get instances of the singleton objects.
 */
$mysql_user_factory = Database_MySQLUserFactory::get_instance();
$gvm = Caching_GlobalVarManager::get_instance();
$page_manager = PublicHTML_PageManager::get_instance();
$log_in_manager = Shop_LogInManager::get_instance();
$current_page_url = $page_manager->get_script_uri();
$redirect_script_url = clone $current_page_url;
$redirect_script_url->set_get_variable('type', 'redirect-script');
$cancel_href = $current_page_url;
/*
 * Create other objects.
 */
$mysql_user = $mysql_user_factory->get_for_this_project();
$database = $mysql_user->get_database();
$comments_table = $database->get_table('hpi_shop_comments');
$product_row = $gvm->get('product');
$product_row_renderer = $product_row->get_renderer();
/*
 * Start assembling the display.
 */
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
开发者ID:saulhoward,项目名称:haddock-cms,代码行数:31,代码来源:body.div.content.inc.php

示例3: get_extras_thumbnail_div

 public function get_extras_thumbnail_div(Shop_PhotographRow $photograph_to_ignore)
 {
     $product = $this->get_element();
     $page_manager = PublicHTML_PageManager::get_instance();
     $current_page_url = $page_manager->get_script_uri();
     $extras_thumbnail_div = new HTMLTags_Div();
     $extras_thumbnail_div->set_attribute_str('class', 'extras_thumbnails');
     $extra_photographs = $product->get_extra_photographs();
     $extra_photographs[] = $product->get_main_photograph();
     foreach ($extra_photographs as $extra_photograph) {
         if ($extra_photograph->get_id() != $photograph_to_ignore->get_id()) {
             $thumbnail_action = clone $current_page_url;
             $thumbnail_action->set_get_variable('thumbnail_photograph_id', $extra_photograph->get_id());
             $thumbnail_action->set_get_variable('product_id', $product->get_id());
             $thumbnail_link = new HTMLTags_A();
             $thumbnail_link->set_href($thumbnail_action);
             $renderer = $extra_photograph->get_renderer();
             $thumbnail_link->append_tag_to_content($renderer->get_thumbnail_img());
             $extras_thumbnail_div->append_tag_to_content($thumbnail_link);
         }
     }
     return $extras_thumbnail_div;
 }
开发者ID:saulhoward,项目名称:haddock-cms,代码行数:23,代码来源:Shop_ProductRowRenderer.inc.php

示例4: get_display_shopping_baskets_for_current_session_div

 public function get_display_shopping_baskets_for_current_session_div()
 {
     $page_manager = PublicHTML_PageManager::get_instance();
     $shopping_basket_div = new HTMLTags_Div();
     $shopping_basket_div->set_attribute_str('id', 'shopping-basket-confirmation');
     $heading = new HTMLTags_Heading(3, 'Shopping Basket');
     $shopping_basket_div->append_tag_to_content($heading);
     $shopping_basket_table = $this->get_checkout_shopping_basket_for_current_session_table();
     $shopping_basket_div->append_tag_to_content($shopping_basket_table);
     $go_to_basket_link = new HTMLTags_A('Edit Shopping Basket');
     $go_to_basket_link->set_attribute_str('class', 'edit-shopping-basket');
     $go_to_basket_location = new HTMLTags_URL();
     $go_to_basket_location->set_file('/hpi/shop/shopping-basket.html');
     $go_to_basket_link->set_href($go_to_basket_location);
     $shopping_basket_div->append_tag_to_content($go_to_basket_link);
     return $shopping_basket_div;
 }
开发者ID:saulhoward,项目名称:haddock-cms,代码行数:17,代码来源:Shop_ShoppingBasketsTableRenderer.inc.php

示例5: get_customer_region_selection_div

 public function get_customer_region_selection_div()
 {
     $page_manager = PublicHTML_PageManager::get_instance();
     //                $mysql_user_factory = Database_MySQLUserFactory::get_instance();
     //                $mysql_user = $mysql_user_factory->get_for_this_project();
     //                $database = $mysql_user->get_database();
     #$customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $customer_regions_table = $this->get_element();
     $customer_regions = $customer_regions_table->get_all_rows('sort_order', 'ASC');
     $customer_regions_div = new HTMLTags_Div();
     $customer_regions_div->set_attribute_str('id', 'tabs');
     $customer_regions_ul = new HTMLTags_UL();
     foreach ($customer_regions as $customer_region) {
         $customer_region_li = new HTMLTags_LI();
         $customer_region_link_span = new HTMLTags_Span($customer_region->get_name());
         if ($customer_region->get_id() == $_SESSION['customer_region_id']) {
             $double_span = new HTMLTags_Span();
             $double_span->set_attribute_str('class', 'current');
             $double_span->append_tag_to_content($customer_region_link_span);
             $customer_region_li->append_tag_to_content($double_span);
         } else {
             //$customer_region_link_file = '/';
             //$customer_region_link_location = new HTMLTags_URL();
             //$customer_region_link_location->set_file($customer_region_link_file);
             //$customer_region_link_location->set_get_variable('page', $page_manager->get_page());
             $redirect_script_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'customer-region', 'redirect-script');
             $redirect_script_location->set_get_variable('customer_region_session', $customer_region->get_id());
             $desired_location = $page_manager->get_script_uri();
             if (isset($_GET['product_id'])) {
                 $desired_location->set_get_variable('product_id', $_GET['product_id']);
             }
             if (isset($_GET['product_category_id'])) {
                 $desired_location->set_get_variable('product_category_id', $_GET['product_category_id']);
             }
             $redirect_script_location->set_get_variable('desired_location', urlencode($desired_location->get_as_string()));
             $customer_region_link_anchor = new HTMLTags_A();
             $customer_region_link_anchor->set_href($redirect_script_location);
             $customer_region_link_anchor->set_attribute_str('title', 'Change your location to&nbsp;' . $customer_region->get_name());
             $customer_region_link_anchor->append_tag_to_content($customer_region_link_span);
             $customer_region_li->append_tag_to_content($customer_region_link_anchor);
         }
         $customer_regions_ul->append_tag_to_content($customer_region_li);
     }
     $customer_regions_div->append_tag_to_content($customer_regions_ul);
     #echo $customer_regions_div->get_as_string();
     return $customer_regions_div;
 }
开发者ID:saulhoward,项目名称:haddock-cms,代码行数:47,代码来源:Shop_CustomerRegionsTableRenderer.inc.php

示例6: render_body_div_content

    public function render_body_div_content()
    {
        /*
         * Get the database objects.
         */
        $mysql_user_factory = Database_MySQLUserFactory::get_instance();
        $mysql_user = $mysql_user_factory->get_for_this_project();
        $database = $mysql_user->get_database();
        $products_table = $database->get_table('hpi_shop_products');
        $table_renderer = $products_table->get_renderer();
        $page_manager = PublicHTML_PageManager::get_instance();
        $gvm = Caching_GlobalVarManager::get_instance();
        /*
         * Assemble the HTML
         */
        $content_div = new HTMLTags_Div();
        $content_div->set_attribute_str('id', 'content');
        /*
         * Cloned repeatedly throughout.
         */
        #$current_page_url = $gvm->get('current_page_admin_url');
        #$redirect_script_url = $gvm->get('redirect_script_admin_url');
        $current_page_url = new HTMLTags_URL();
        $current_page_url->set_file('/haddock/public-html/public-html/index.php');
        $current_page_url->set_get_variable('oo-page');
        $current_page_url->set_get_variable('page-class', 'Shop_AdminProductsPage');
        $redirect_script_url = Admin_AdminIncluderURLFactory::get_url('plug-ins', 'shop', 'products', 'redirect-script');
        $cancel_href = $current_page_url;
        ########################################################################
        #
        # Forms for changing the contents of the database.
        #
        ########################################################################
        if (isset($_GET['delete_all'])) {
            /**
             * Confirm deleting all the rows in the table.
             */
            $action_div = new HTMLTags_Div();
            $action_div->set_attribute_str('id', 'action-div');
            $question_delete_all_p = new HTMLTags_P('Are you sure that you want to delete all of the products?');
            $action_div->append_tag_to_content($question_delete_all_p);
            $confirm_delete_all_p = new HTMLTags_P();
            $delete_all_href = clone $redirect_script_url;
            $delete_all_href->set_get_variable('delete_all');
            $delete_all_a = new HTMLTags_A('DELETE ALL');
            $delete_all_a->set_attribute_str('class', 'cool_button');
            $delete_all_a->set_attribute_str('id', 'inline');
            $delete_all_a->set_href($delete_all_href);
            $confirm_delete_all_p->append_tag_to_content($delete_all_a);
            $confirm_delete_all_p->append_str_to_content('&nbsp;');
            $cancel_a = new HTMLTags_A('Cancel');
            $cancel_a->set_attribute_str('class', 'cool_button');
            $cancel_a->set_attribute_str('id', 'inline');
            $cancel_a->set_href($cancel_href);
            $confirm_delete_all_p->append_tag_to_content($cancel_a);
            $action_div->append_tag_to_content($confirm_delete_all_p);
            $content_div->append_tag_to_content($action_div);
        } elseif (isset($_GET['delete_id'])) {
            /**
             * Confirm deleting a row.
             */
            $row = $products_table->get_row_by_id($_GET['delete_id']);
            $question_p = new HTMLTags_P();
            $question_p->set_attribute_str('class', 'question');
            $question_p->append_str_to_content('Are you sure that you want to delete this row?');
            $content_div->append_tag_to_content($question_p);
            /**
             * Show the user the data in the row.
             */
            $row_renderer = $row->get_renderer();
            $content_div->append_tag_to_content($row_renderer->get_all_data_html_table());
            # ------------------------------------------------------------------
            $answer_p = new HTMLTags_P();
            $answer_p->set_attribute_str('class', 'answer');
            $delete_link = new HTMLTags_A('DELETE');
            $delete_href = clone $redirect_script_url;
            $delete_href->set_get_variable('delete_id', $row->get_id());
            $delete_link->set_href($delete_href);
            $delete_link->set_attribute_str('class', 'cool_button');
            $delete_link->set_attribute_str('id', 'inline');
            $answer_p->append_tag_to_content($delete_link);
            $cancel_link = new HTMLTags_A('Cancel');
            $cancel_link->set_href($cancel_href);
            $cancel_link->set_attribute_str('class', 'cool_button');
            $cancel_link->set_attribute_str('id', 'inline');
            $answer_p->append_tag_to_content($cancel_link);
            $content_div->append_tag_to_content($answer_p);
        } elseif (isset($_GET['edit_id'])) {
            /*
             * Edit the values of this product.
             */
            $row_editing_url = clone $redirect_script_url;
            $row_editing_url->set_get_variable('edit_id', $_GET['edit_id']);
            $product_row = $products_table->get_row_by_id($_GET['edit_id']);
            $row_editing_url->set_get_variable('plu_code', $product_row->get_plu_code());
            $product_row_renderer = $product_row->get_renderer();
            $row_editing_form = $product_row_renderer->get_product_editing_form($row_editing_url, $cancel_href);
            $content_div->append_tag_to_content($row_editing_form);
            $explanation_div = new HTMLTags_Div();
            $explanation_text = <<<TXT
//.........这里部分代码省略.........
开发者ID:saulhoward,项目名称:haddock-cms,代码行数:101,代码来源:Shop_AdminProductsPage.inc.php


注:本文中的PublicHTML_PageManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。