OSDN Git Service

BugTrack2/62: Do remove the whole design, 'Showing TrackBack-ping list by html'.
[pukiwiki/pukiwiki.git] / skin / keitai.skin.php
index 149be46..5cb9091 100644 (file)
@@ -1,25 +1,34 @@
 <?php
-/////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
+// $Id: keitai.skin.php,v 1.9 2005/05/01 02:43:27 henoheno Exp $
+// Copyright (C) 2003-2005 PukiWiki Developers Team
+// License: GPL v2 or (at your option) any later version
 //
-// $Id: keitai.skin.php,v 1.3 2004/10/17 13:29:52 henoheno Exp $
-//
+// Skin for Embedded devices
 
+// ----
 // Prohibit direct access
-if (! defined('UI_LANG')) exit;
+if (! defined('UI_LANG')) die('UI_LANG is not set');
 
 global $max_size, $accesskey, $menubar;
 $link = $_LINK;
+$rw = ! PKWK_READONLY;
 
-// Force Shift JIS encode for Japanese embedded browsers and devices
-header('Content-Type: text/html; charset=Shift_JIS');
-$title = mb_convert_encoding($title, 'SJIS', SOURCE_ENCODING);
-$body  = mb_convert_encoding($body,  'SJIS', SOURCE_ENCODING);
+// Output HTTP headers
+pkwk_headers_sent();
+if(TRUE) {
+       // Force Shift JIS encode for Japanese embedded browsers and devices
+       header('Content-Type: text/html; charset=Shift_JIS');
+       $title = mb_convert_encoding($title, 'SJIS', SOURCE_ENCODING);
+       $body  = mb_convert_encoding($body,  'SJIS', SOURCE_ENCODING);
+} else {
+       header('Content-Type: text/html; charset=' . CONTENT_CHARSET);
+}
 
 // Make 1KByte spare (for header, etc)
 $max_size = --$max_size * 1024;
 
-// IMG ¥¿¥°(²èÁü)¤òʸ»úÎó¤ËÃÖ´¹
+// Replace IMG tags (= images) with character strings
 // With ALT option
 $body = preg_replace('#(<div[^>]+>)?(<a[^>]+>)?<img[^>]*alt="([^"]+)"[^>]*>(?(2)</a>)(?(1)</div>)#i', '[$3]', $body);
 // Without ALT option
@@ -33,28 +42,30 @@ $lastpage = $pagecount - 1;
 // Top navigation (text) bar
 $navi = array();
 $navi[] = '<a href="' . $link['top']  . '" ' . $accesskey . '="0">0.Top</a>';
-$navi[] = '<a href="' . $link['new']  . '" ' . $accesskey . '="1">1.New</a>';
-$navi[] = '<a href="' . $link['edit'] . '" ' . $accesskey . '="2">2.Edit</a>';
-if ($is_read and $function_freeze) {
-       if (! $is_freeze) {
-               $navi[] = '<a href="' . $link['freeze']   . '" ' . $accesskey . '="3">3.Freeze</a>';
-       } else {
-               $navi[] = '<a href="' . $link['unfreeze'] . '" ' . $accesskey . '="3">3.Unfreeze</a>';
+if ($rw) {
+       $navi[] = '<a href="' . $link['new']  . '" ' . $accesskey . '="1">1.New</a>';
+       $navi[] = '<a href="' . $link['edit'] . '" ' . $accesskey . '="2">2.Edit</a>';
+       if ($is_read and $function_freeze) {
+               if (! $is_freeze) {
+                       $navi[] = '<a href="' . $link['freeze']   . '" ' . $accesskey . '="3">3.Freeze</a>';
+               } else {
+                       $navi[] = '<a href="' . $link['unfreeze'] . '" ' . $accesskey . '="3">3.Unfreeze</a>';
+               }
        }
 }
 $navi[] = '<a href="' . $script . '?' . $menubar . '" ' . $accesskey . '="4">4.Menu</a>';
 $navi[] = '<a href="' . $link['recent'] . '" ' . $accesskey . '="5">5.Recent</a>';
 
-// Á°/¼¡¤Î¥Ö¥í¥Ã¥¯
+// Previous / Next block
 if ($pagecount > 1) {
        $prev = $pageno - 1;
        $next = $pageno + 1;
        if ($pageno > 0) {
-               $navi[] = "<a href=\"$script?cmd=read&amp;page=$r_page&amp;p=$prev\" $accesskey=\"7\">7.Prev</a>";
+               $navi[] = '<a href="' . $script . '?cmd=read&amp;page=' . $r_page . '&amp;p=' . $prev . '" ' . $accesskey . '="7">7.Prev</a>';
        }
-       $navi[] = "$next/$pagecount ";
+       $navi[] = $next . '/' . $pagecount . ' ';
        if ($pageno < $lastpage) {
-               $navi[] = "<a href=\"$script?cmd=read&amp;page=$r_page&amp;p=$next\" $accesskey=\"8\">8.Next</a>";
+               $navi[] = '<a href="' . $script . '?cmd=read&amp;page=' . $r_page . '&amp;p=' . $next . '" ' . $accesskey . '="8">8.Next</a>';
        }
 }