source: branches/version-2_12-dev/data/smarty_extends/block.marquee.php @ 22567

Revision 22567, 685 bytes checked in by shutta, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/**
3 * marqueeタグで囲む。
4 *
5 * DoCoMoの携帯端末の場合はmarqueeを使用しない。
6 *
7 * @param string $value 入力
8 * @return string 出力
9 */
10function smarty_block_marquee($params, $content, &$smarty, &$repeat)
11{
12    // {/marquee}の場合のみ出力する。
13    if ($repeat || !isset($content)) {
14    return null;
15    }
16
17    // 末尾の改行などを取り除く。
18    $content = rtrim($content);
19
20    // marqueeタグを使用しない場合
21    if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE && SC_MobileUserAgent::getCarrier() == 'docomo') {
22    return "<div>\n$content\n</div>\n";
23    }
24
25    return "<marquee>\n$content\n</marquee>\n";
26}
Note: See TracBrowser for help on using the repository browser.