「スマートフォン対応プラグインの作り方」を編集中
提供: OpenPNE3まとめwiki
警告: ログインしていません。
編集すると、IPアドレスがこのページの編集履歴に記録されます。この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
行8: | 行8: | ||
■ スマートフォン対応の基本仕様 | ■ スマートフォン対応の基本仕様 | ||
− | * jsについては基本的にjQueryを使用 | + | * jsについては基本的にjQueryを使用 |
− | * テンプレートレンダリングは基本的にjQuery Templateを使用 | + | * テンプレートレンダリングは基本的にjQuery Templateを使用 |
− | * アクション側での処理は最小限に抑え、データ取得など時間のかかる処理についてはAPIに回す | + | * アクション側での処理は最小限に抑え、データ取得など時間のかかる処理についてはAPIに回す |
− | + | ||
− | + | ||
行48: | 行46: | ||
26 public function executeIndex(opWebRequest $request) | 26 public function executeIndex(opWebRequest $request) | ||
27 { | 27 { | ||
− | 28 if ($request-> | + | 28 if ($request->isSmartPhone()) |
29 { | 29 { | ||
30 return $this->executeSmtIndex($request); | 30 return $this->executeSmtIndex($request); | ||
行57: | 行55: | ||
35 { | 35 { | ||
36 $this->setLayout('smtLayoutHome'); | 36 $this->setLayout('smtLayoutHome'); | ||
− | 37 | + | 37 $this->baseUrl = sfConfig::get('op_base_url'); |
− | 38 return sfView::SUCCESS; | + | 38 $form = new sfForm(); |
− | + | 39 $this->token = $form->getCSRFToken(); | |
+ | 40 return sfView::SUCCESS; | ||
+ | 41 } | ||
行95: | 行95: | ||
現在はスマートフォンのみしか対応していませんが、PC版もいずれはINFORMATIONボックスから通知センターに移行する予定です。 | 現在はスマートフォンのみしか対応していませんが、PC版もいずれはINFORMATIONボックスから通知センターに移行する予定です。 | ||
通知系は一括で、opNotificationCenter::notify()を使用してください | 通知系は一括で、opNotificationCenter::notify()を使用してください | ||
− | + | 1. 通知を追加する | |
− | 1. 通知を追加する | + | |
− | + | ||
− | + | ||
− | + | ||
opNotificationCenter::notify(Member $from, Member $to, $body, array $options = null) | opNotificationCenter::notify(Member $from, Member $to, $body, array $options = null) | ||
+ | $option = array ('category' => $category, 'icon_url' => $icon_url); | ||
+ | $category = 'link', 'message, 'other' | ||
− | + | 2. 通知を消す(既読状態にする) | |
− | 2. 通知を消す(既読状態にする) | + | |
opNotificationCenter::setRead(Member $target, $notificationId) | opNotificationCenter::setRead(Member $target, $notificationId) | ||
− | + | ||
(APIエントリポイント系) | (APIエントリポイント系) |