-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMailsHtmlHelper.php
More file actions
51 lines (44 loc) · 1.52 KB
/
MailsHtmlHelper.php
File metadata and controls
51 lines (44 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* MailsHtmlHelper
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
App::uses('AppHelper', 'View/Helper');
/**
* MailsHtmlHelper
*
* @package NetCommons\Mails\View\Helper
*/
class MailsHtmlHelper extends AppHelper {
/**
* ヘルプの表示
*
* #### Sample code
* ##### template file(ctp file) - 通常パターン
* ```
* <?php echo $this->MailsHtml->help($editForm['mailBodyPopoverMessage']); ?>
* ```
*
* @param string $content メッセージ内容(オリジナルタグの内容)
* @param string $placement ポジション
* @return string ヘルプHTML出力
*/
public function help($content = '', $placement = 'bottom') {
$html = '';
$content = __d('mails', 'Each of the embedded keywords, will be sent is converted ' .
'to the corresponding content. <br />') . $content;
$html .= __d('mails', 'Can use an embedded keyword in the subject line and body') . ' ';
$html .= '<a href="" data-toggle="popover" data-placement="' . $placement . '"' .
' title="' . __d('mails', 'Embedded keyword?') . '"' . ' data-content="' . $content . '">';
$html .= '<span class="glyphicon glyphicon-info-sign"></span>';
$html .= '</a>';
$html .= '<script type="text/javascript">' .
'$(function () { $(\'[data-toggle="popover"]\').popover({html: true}) });</script>';
return $html;
}
}