OSDN Git Service

Add Error for Viewing PC From Ktai
authorcake_67 <cake_67@46fa8b77-3530-0410-9d82-d95c44d28aba>
Thu, 15 Oct 2009 07:44:02 +0000 (07:44 +0000)
committercake_67 <cake_67@46fa8b77-3530-0410-9d82-d95c44d28aba>
Thu, 15 Oct 2009 07:44:02 +0000 (07:44 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/trpgtools-onweb/src/trunk/cakePHP_frame@85 46fa8b77-3530-0410-9d82-d95c44d28aba

app/controllers/app_controller.php
app/error.php [new file with mode: 0644]
app/views/errors/error_pc_view.ctp [new file with mode: 0644]

index 24d71e7..df7841c 100644 (file)
@@ -57,6 +57,11 @@ class MobileAppController extends AppController
        {
                parent::beforeFilter();
 
+               // PC用URLアクセスはエラー
+               if (!isset($this->params["prefix"])) {
+                       $this->cakeError("errorPcView");
+                       exit;
+               }
                // 入力データの文字コード変換
                @array_walk_recursive($this->data, "convertEncodeSjis2Utf8");
         }
diff --git a/app/error.php b/app/error.php
new file mode 100644 (file)
index 0000000..005b0dd
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+class AppError extends ErrorHandler {
+
+       function errorPcView($params) {
+               $this->controller->layout = "mobile_default";
+
+               $this->controller->set(array(
+                       'name' => __('PC View', true),
+                       'message' => "For PC browser View",
+                       'base' => $this->controller->base
+               ));
+
+               $this->_outputMessage('errorPcView');
+       }
+
+}
diff --git a/app/views/errors/error_pc_view.ctp b/app/views/errors/error_pc_view.ctp
new file mode 100644 (file)
index 0000000..b2b0e13
--- /dev/null
@@ -0,0 +1,5 @@
+<h2><?php echo $name; ?></h2>
+<p class="error">
+       <strong><?php __('Error'); ?>: </strong>
+       <?php echo sprintf(__("The requested address was %s .", true), "<strong>{$message}</strong>")?>
+</p>
\ No newline at end of file