/**
 * generate URI
 * @param   string|array  $param
 * @param   bool          $absolute
 * @return  string
 */
function jpmobile_url_for($param, $absolute = false)
{
    $url = url_for($param, $absolute);
    if (sfJpMobile::isDocomo()) {
        $url .= "?guid=ON";
    }
    return $url;
}
 /**
  * @see sfWebController
  */
 public function genUrl($parameters = array(), $absolute = false)
 {
     $url = parent::genUrl($parameters, $absolute);
     if (sfJpMobile::isDocomo()) {
         if (!preg_match('/(\\?|&)guid=/', $url)) {
             $url .= (strpos($url, '?') === false ? '?' : '&') . 'guid=ON';
         }
     }
     return $url;
 }
/**
 * 入力文字種類制御の属性を追加する(Formのattribute用)
 *
 * @param   integer   $style    DoCoMoのistyle属性の値
 * @param   array     $attr     合成元の属性
 * @return  array
 */
function add_istyle($style, $attr = array())
{
    $data = new stdClass();
    $carrier = sfJpMobile::getShortCarrierName();
    $config = sfConfig::get("jpmobile_istyle_{$carrier}");
    foreach ($config as $k => $v) {
        $data->{$k} = $v[$style - 1];
    }
    if (!sfJpMobile::isDocomo()) {
        $data->istyle = $style;
    }
    foreach ($data as $k => $v) {
        if (array_key_exists($k, $attr)) {
            $attr[$k] .= $v;
        } else {
            $attr[$k] = $v;
        }
    }
    return $attr;
}
 /**
  * 出力コンテンツの変換
  * @return null
  */
 private function _convertContent()
 {
     $content = $this->getContext()->getResponse()->getContent();
     // 絵文字変換
     if (!sfJpMobile::isDocomo()) {
         $content = sfJpMobile::getEmoji()->convert($content);
     }
     // 出力文字コードの変更
     if (!sfJpMobile::isMobile() || !sfJpMobile::isSoftbank() && !sfJpMobile::isWillcom()) {
         $content = mb_convert_encoding($content, 'SJIS-win', 'UTF-8');
     }
     $this->getContext()->getResponse()->setContent($content);
 }
Example #5
0
<?php

echo '<?xml version="1.0" encoding="Shift_JIS"?>';
if (sfJpMobile::isDocomo()) {
    ?>
<!DOCTYPE html PUBLIC "-//i-mode group (ja)//DTD XHTML i-XHTML(Locale/Ver.=ja/1.1) 1.0//EN" "i-xhtml_4ja_10.dtd">
<?php 
} elseif (sfJpMobile::isKddi()) {
    ?>
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML 1.0//EN" "http://www.openwave.com/DTD/xhtml-basic.dtd">
<?php 
} elseif (sfJpMobile::isSoftbank()) {
    ?>
<!DOCTYPE html PUBLIC "-//JPHONE//DTD XHTML Basic 1.0 Plus//EN" "xhtml-basic10-plus.dtd">
<?php 
} else {
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php 
}
?>

<?php 
/* $Id$ */
/* vim:set expandtab tabstop=2 softtabstop=2 shiftwidth=2: */