• メインページ
  • データ構造
  • ファイル
  • ファイル一覧

PageBodyGoogleMap.php

00001 <?php
00002 /*
00003  * PageBodyGoogleMap.php
00004  * 
00005  * Copyright (c) 2010 ValueCommerce, Co. Ltd.
00006  */
00007 require_once('PageSectionBase.php');
00008 require_once('FormattedItem.php');
00009 require_once('Pagination.php');
00010 
00012 if (!defined('VCSDBSAMPLE_NO_RESULTS')) define('VCSDBSAMPLE_NO_RESULTS','検索結果がありません');
00013 
00015 if (!defined('VCSDBSAMPLE_HTTP_FAILURE')) define('VCSDBSAMPLE_HTTP_FAILURE','ウェブサービスデータベースが異常な値を返しました。');
00016 
00018 if (!defined('VCSDBSAMPLE_XML_PARSE_ERROR')) define('VCSDBSAMPLE_XML_PARSE_ERROR','ウェブサービスデータベースのXMLに異常があります。');
00019 
00021 if (!defined('VCSDBSAMPLE_DATA_STRUCT_ERROR')) define('VCSDBSAMPLE_DATA_STRUCT_ERROR','ウェブサービスデータベースから受け取ったデータに構造上の問題があります。');
00022 
00024 if (!defined('VCSDBSAMPLE_UNKNOWN_EROR')) define('VCSDBSAMPLE_UNKNOWN_EROR','不明なエラー');
00025 
00026 
00032 class PageBodyGoogleMap extends PageSectionBase {
00033 
00035         protected $view;        
00036         
00038         private $items;
00039         
00041         private $pagination;
00042         
00044         private $errorMessage;
00045 
00052         public function __construct($itemViewFile, $response, $is_mobile=false) {
00053                 $itemView = $this->loadFile($itemViewFile);
00054 
00055                 if (gettype($response) != "object") {
00056                         $this->items = null;
00057 
00058                         switch ($response) {
00059                         case VCSDBDriverBase::STATUS_HTTP_CONNECTION_FAILURE:
00060                           $this->errorMessage = VCSDBSAMPLE_HTTP_FAILURE;
00061                           break;
00062                         case VCSDBDriverBase::STATUS_XML_PARSE_ERROR:
00063                           $this->errorMessage = VCSDBSAMPLE_XML_PARSE_ERROR;
00064                           break;
00065                         case VCSDBDriverBase::STATUS_DATA_STRUCTURAL_ERROR:
00066                           $this->errorMessage = VCSDBSAMPLE_DATA_STRUCT_ERROR;
00067                           break;
00068                         case VCSDBDriverBase::STATUS_NO_PARAMETER_ERROR:
00069                           $this->errorMessage = "";
00070                           break;
00071                         default:
00072                           $this->errorMessage = VCSDBSAMPLE_UNKNOWN_EROR;
00073                         }
00074                 } else {
00075                         $this->items = FormattedItem::getItems($itemView,$response);
00076                 }
00077         }
00078 
00085         function render($show_container=true) {
00086                 $output = '';
00087                 
00088                 if (gettype($this->items) == "array") {
00089                         if (count($this->items) > 0 ) {
00090                                 error_log("count ".count($this->items));
00091                                 
00092                                 if ($show_container) {
00093                                         $output .= '<table class="results">';
00094                                 }
00095                                 
00096                                 foreach ($this->items as $item) {
00097                                         $output .= $item->toString();
00098                                 }
00099                                 
00100                                 if ($show_container) {
00101                                         $output .= '</table>';
00102                                 }
00103                                 
00104                         } else {
00105                                 $output .= VCSDBSAMPLE_NO_RESULTS;
00106                         }       
00107                 } else {
00108                   $output .= $this->errorMessage;
00109                 }
00110                         
00111                 return $output;
00112         }       
00113         
00117         public function show($show_container=true) {
00118                 print $this->render($show_container);
00119         }
00120 }
00121 ?>

バリューコマース ウェブサービス トラベルAPIサンプル ドキュメンテーションに対してTue Jan 11 2011 19:25:16に生成されました。  doxygen 1.7.2