diff --git a/.gitignore b/.gitignore index 81b46483f..762924975 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ lib/form/doctrine/op*Plugin -web/cache/* log/* plugins/op* +!plugins/opAuthMailAddressPlugin !plugins/opSkinBasicPlugin -!plugins/opSkinClassicPlugin plugins/.* lib/filter/doctrine/* cache/* diff --git a/NOTICE b/NOTICE index ca1d27b0e..ca058dad4 100644 --- a/NOTICE +++ b/NOTICE @@ -20,18 +20,26 @@ This product includes also softwares developed by : - Apache License 2.0 - Andy Smith (http://term.ie/) - MIT License + - Ryan Parman, Geoffrey Sneddon + - BSD 3-clause License (SimplePie) - Fabien Potencier (http://fabien.potencier.org/) - MIT License - Kousuke Ebihara (http://co3k.org/) - Apache License 2.0 + - Stig Bakken, Gregory Beaver, Helgi Þormar Þorbjörnsson, Tomas V.V.Cox, Martin Jansen + - BSD 2-clause License (PEAR) + - Greg Beaver + - BSD 2-clause License (PEAR_PackageFileManager2) - Vincent Oostindie, Alan Knowles, Peter Bowyer, Philippe Jausions - - PHP License 3.0 (PEAR::Image_Transform) + - PHP License 3.0 (Image_Transform) + - Harry Fuecks, Lorenzo Alberton + - BSD 3-clause License (Calendar) This product needs the third-party softwares listed blow to run. - PHP: Hypertext Preprocessor (5.2.4 +) This product includes dependent libraries listed blow: - - symfony 1.4.1 + - LExpress/symfony1 1.5.9 (fork of symfony 1.4) - Zend Framework 1.10.8 (partly) - Zend_Acl - Zend_Exception @@ -47,6 +55,10 @@ This product includes dependent libraries listed blow: - Zend_Version - Auth OpenID 2.1.2 - PHP OAuth library + - SimplePie 1.4.3 - sfFormExtraPlugin 1.0.12 - sfImageHandlerPlugin 1.0.0 - - PEAR::Image_Transform 0.9.3 + - PEAR 1.10.3 + - PEAR_PackageFileManager2 1.0.4 + - Image_Transform 0.9.5 + - Calendar 0.5.5 diff --git a/apps/api/config/factories.yml b/apps/api/config/factories.yml index 9a46337b2..aea47a0be 100644 --- a/apps/api/config/factories.yml +++ b/apps/api/config/factories.yml @@ -52,23 +52,10 @@ all: #all: # controller: # class: sfFrontWebController -# -# request: -# class: sfWebRequest -# param: -# logging: %SF_LOGGING_ENABLED% -# path_info_array: SERVER -# path_info_key: PATH_INFO -# relative_url_root: ~ -# formats: -# txt: text/plain -# js: [application/javascript, application/x-javascript, text/javascript] -# css: text/css -# json: [application/json, application/x-json] -# xml: [text/xml, application/xml, application/x-xml] -# rdf: application/rdf+xml -# atom: application/atom+xml -# + + request: + class: opWebRequest + # response: # class: sfWebResponse # param: @@ -83,12 +70,10 @@ all: # logging: %SF_LOGGING_ENABLED% # use_flash: true # default_culture: %SF_DEFAULT_CULTURE% -# -# storage: -# class: sfSessionStorage -# param: -# session_name: symfony -# + + storage: + class: sfNoStorage + # view_cache: # class: sfFileCache # param: diff --git a/apps/api/config/routing.yml b/apps/api/config/routing.yml index 366d4cb83..a53bdbca0 100644 --- a/apps/api/config/routing.yml +++ b/apps/api/config/routing.yml @@ -13,3 +13,118 @@ no_default: default: url: /:module/:action/* + +activity_search: + url: /activity/search.json + param: { module: activity, action: search, sf_format: json } + requirements: { sf_method: [get] } + +activity_list: + url: /activity/list.json + param: { module: activity, action: search, sf_format: json } + requirements: { sf_method: [get] } + +activity_member: + url: /activity/member.json + param: { module: activity, action: member, sf_format: json } + requirements: { sf_method: [get] } + +activity_friends: + url: /activity/friends.json + param: { module: activity, action: friends, sf_format: json } + requirements: { sf_method: [get] } + +activity_community: + url: /activity/community.json + param: { module: activity, action: community, sf_format: json } + requirements: { sf_method: [get] } + +activity_mentions: + url: /activity/mentions.json + param: { module: activity, action: mentions, sf_format: json } + requirements: { sf_method: [get] } + +activity_post: + url: /activity/post.json + param: { module: activity, action: post, sf_format: json } + requirements: { sf_method: [post, get] } + +activity_delete: + url: /activity/delete.json + param: { module: activity, action: delete, sf_format: json } + requirements: { sf_method: [get] } + +member_search: + url: /member/search.json + param: { module: member, action: search, sf_format: json } + requirements: { sf_method: [get] } + +member_list: + url: /member/list.json + param: { module: member, action: search, sf_format: json } + requirements: { sf_method: [get] } + +member_community: + url: /member/community.json + param: { module: member, action: community, sf_format: json } + requirements: { sf_method: [get] } + +member_friend_accept: + url: /member/friend_accept.json + param: { module: member, action: friendAccept, sf_format: json } + requirements: { sf_method: [get] } + +member_friend_reject: + url: /member/friend_reject.json + param: { module: member, action: friendAccept, sf_format: json, reject: 1 } + requirements: { sf_method: [get] } + +member_friend_request: + url: /member/friend_request.json + param: { module: member, action: friendRequest, sf_format: json, } + requirements: { sf_method: [get] } + +member_friend_unlink: + url: /member/friend_unlink.json + param: { module: member, action: friendRequest, sf_format: json, unlink: 1 } + requirements: { sf_method: [get] } + +community_search: + url: /community/search.json + param: { module: community, action: search, sf_format: json } + requirements: { sf_method: [get] } + +community_list: + url: /community/list.json + param: { module: community, action: search, sf_format: json } + requirements: { sf_method: [get] } + +community_member: + url: /community/member.json + param: { module: community, action: member, sf_format: json } + requirements: { sf_method: [get] } + +community_join: + url: /community/join.json + param: { module: community, action: join, sf_format: json } + requirements: { sf_method: [get] } + +push_search: + url: /push/search.json + param: { module: push, action: search, sf_format: json } + requirements: { sf_method: [get] } + +push_list: + url: /push/list.json + param: { module: push, action: search, sf_format: json } + requirements: { sf_method: [get] } + +push_count: + url: /push/count.json + param: { module: push, action: count, sf_format: json } + requirements: { sf_method: [get] } + +push_read: + url: /push/read.json + param: { module: push, action: read, sf_format: json } + requirements: { sf_method: [get] } diff --git a/apps/api/config/settings.yml b/apps/api/config/settings.yml index a5f6a520c..0d4848319 100644 --- a/apps/api/config/settings.yml +++ b/apps/api/config/settings.yml @@ -13,7 +13,7 @@ dev: test: .settings: - error_reporting: + error_reporting: cache: false web_debug: false no_script_name: false @@ -30,8 +30,17 @@ all: #all: # .actions: -# error_404_module: default # To be called when a 404 error is raised -# error_404_action: error404 # Or when the requested URL doesn't match any route + error_404_module: default # To be called when a 404 error is raised + error_404_action: error404 # Or when the requested URL doesn't match any route + + error_400_module: default + error_400_action: error400 + + error_401_module: default + error_401_action: error401 + + error_403_module: default + error_403_action: error403 # # login_module: default # To be called when a non-authenticated user # login_action: login # Tries to access a secure page @@ -42,7 +51,7 @@ all: # module_disabled_module: default # To be called when a user requests # module_disabled_action: disabled # A module disabled in the module.yml # - .settings: +# .settings: # # Optional features. Deactivating unused features boots performance a bit. # use_database: on # Enable database manager. Set to off if you don't use a database. i18n: on # Enable interface translation. Set to off if your application should not be translated. @@ -74,7 +83,7 @@ all: # calendar_web_dir: /sf/calendar # # # Helpers included in all templates by default -# standard_helpers: [Partial, Cache, Form] + standard_helpers: [Partial, Cache, sfImage, opUtil, opJsonApi] # # # Activated modules from plugins or from the symfony core # enabled_modules: [default] @@ -90,4 +99,4 @@ all: # logging_enabled: true # # # i18n - default_culture: ja # Default user culture + default_culture: ja_JP # Default user culture diff --git a/apps/api/lib/helper/opJsonApiHelper.php b/apps/api/lib/helper/opJsonApiHelper.php new file mode 100644 index 000000000..073cfb2de --- /dev/null +++ b/apps/api/lib/helper/opJsonApiHelper.php @@ -0,0 +1,206 @@ + + */ +function op_api_member($member) +{ + $viewMemberId = sfContext::getInstance()->getUser()->getMemberId(); + + $memberImageFileName = $member->getImageFileName(); + if (!$memberImageFileName) + { + $memberImage = op_image_path('no_image.gif', true); + } + else + { + $memberImage = sf_image_path($memberImageFileName, array('size' => '48x48'), true); + } + + $relation = null; + if ((string)$viewMemberId !== (string)$member->getId()) + { + $relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($viewMemberId, $member->getId()); + } + + $selfIntroduction = $member->getProfile('op_preset_self_introduction', true); + + return array( + 'id' => $member->getId(), + 'profile_image' => $memberImage, + 'screen_name' => $member->getConfig('op_screen_name', $member->getName()), + 'name' => $member->getName(), + 'profile_url' => op_api_member_profile_url($member->getId()), + 'friend' => $relation ? $relation->isFriend() : false, + 'blocking' => $relation ? $relation->isAccessBlocked() : false, + 'self' => $viewMemberId === $member->getId(), + 'friends_count' => $member->countFriends(), + 'self_introduction' => $selfIntroduction ? (string)$selfIntroduction : null, + ); +} + +function op_api_member_profile_url($memberId) +{ + return app_url_for('pc_frontend', array('sf_route' => 'obj_member_profile', 'id' => $memberId), true); +} + +function op_api_activity($activity) +{ + use_helper('opActivity'); + + $viewMemberId = sfContext::getInstance()->getUser()->getMemberId(); + $member = $activity->getMember(); + + $images = array(); + foreach ($activity->getImages() as $activityImage) + { + $images[] = array( + 'small_size' => op_activity_image_uri($activityImage, array('size' => '48x48'), true), + 'full_size' => op_activity_image_uri($activityImage, array(), true), + ); + } + + return array( + 'id' => $activity->getId(), + 'member' => op_api_member($member), + 'body' => $activity->getBody(), + 'body_html' => op_activity_linkification(nl2br(op_api_force_escape($activity->getBody()))), + 'uri' => $activity->getUri(), + 'source' => $activity->getSource(), + 'source_uri' => $activity->getSourceUri(), + 'image_uris' => $images, + 'created_at' => date('r', strtotime($activity->getCreatedAt())), + ); +} + +function op_activity_linkification($body, $options = array()) +{ + $body = op_auto_link_text($body); + + return preg_replace_callback('/(@+)([-._0-9A-Za-z]+)/', 'op_activity_linkification_callback', $body); +} + +function op_activity_linkification_callback($matches) +{ + $at = $matches[1]; + $screenName = $matches[2]; + $screenNameConfig = Doctrine::getTable('MemberConfig')->createQuery() + ->select('member_id') + ->addWhere('name = "op_screen_name"') + ->addWhere('value = ?', $screenName) + ->fetchOne(array(), Doctrine::HYDRATE_NONE); + + if ($screenNameConfig) + { + $memberId = $screenNameConfig[0]; + return link_to($at.$screenName, op_api_member_profile_url($memberId), array('target' => '_blank')); + } + + return $matches[0]; +} + +function op_api_force_escape($text) +{ + if (!sfConfig::get('sf_escaping_strategy')) + { + // escape body even if escaping method is disabled. + $text = sfOutputEscaper::escape(sfConfig::get('sf_escaping_method'), $text); + } + + return $text; +} + +function op_api_community($community) +{ + $viewMemberId = sfContext::getInstance()->getUser()->getMemberId(); + + $communityUrl = app_url_for('pc_frontend', array('sf_route' => 'community_home', 'id' => $community->getId()), true); + + $communityImageFileName = $community->getImageFileName(); + if (!$communityImageFileName) + { + $communityImage = op_image_path('no_image.gif', true); + } + else + { + $communityImage = sf_image_path($communityImageFileName, array('size' => '48x48'), true); + } + + $communityMember = Doctrine::getTable('CommunityMember') + ->retrieveByMemberIdAndCommunityId($viewMemberId, $community->getId()); + + return array( + 'id' => $community->getId(), + 'name' => $community->getName(), + 'category' => $community->getCommunityCategory() ? $community->getCommunityCategory()->getName() : null, + 'community_url' => $communityUrl, + 'community_image_url' => $communityImage, + 'joining' => $communityMember ? !$communityMember->getIsPre() : false, + 'admin' => $communityMember ? $communityMember->hasPosition('admin') : false, + 'sub_admin' => $communityMember ? $communityMember->hasPosition('sub_admin') : false, + 'created_at' => op_api_date($community->getCreatedAt()), + 'admin_member' => op_api_member($community->getAdminMember()), + 'member_count' => $community->countCommunityMembers(), + 'public_flag' => $community->getConfig('public_flag'), + 'register_policy' => $community->getConfig('register_policy'), + 'description' => $community->getConfig('description'), + ); +} + +function op_api_date($date) +{ + return gmdate('r', strtotime($date)); +} + +function op_api_notification($notification) +{ + if ($notification['icon_url']) + { + $iconUrl = $notification['icon_url']; + } + else + { + if ('link' === $notification['category']) + { + $fromMember = Doctrine::getTable('Member')->find($notification['member_id_from']); + $fromMemberImageFileName = $fromMember ? $fromMember->getImageFileName() : null; + + if ($fromMemberImageFileName) + { + $iconUrl = sf_image_path($fromMemberImageFileName, array('size' => '48x48'), true); + } + } + } + + if (!$iconUrl) + { + $iconUrl = op_image_path('no_image.gif', true); + } + elseif (false !== strpos('http://', $iconUrl)) + { + $iconUrl = sf_image_path($iconUrl, array('size' => '48x48'), true); + } + + return array( + 'id' => $notification['id'], + 'body' => sfContext::getInstance()->getI18N()->__($notification['body']), + 'category' => $notification['category'], + 'unread' => $notification['unread'], + 'created_at' => date('r', strtotime($notification['created_at'])), + 'icon_url' => $iconUrl, + 'url' => $notification['url'] ? url_for($notification['url'], array('abstract' => true)) : null, + 'member_id_from' => $notification['member_id_from'], + ); +} diff --git a/apps/api/lib/myUser.class.php b/apps/api/lib/myUser.class.php index 4c793028e..1b1af5c7a 100644 --- a/apps/api/lib/myUser.class.php +++ b/apps/api/lib/myUser.class.php @@ -1,5 +1,76 @@ + */ class myUser extends sfBasicSecurityUser { + protected + $member = null; + + public function getMemberByApiKey($apiKey) + { + if (!$apiKey) + { + return null; + } + + $config = Doctrine::getTable('MemberConfig')->createQuery('c') + ->leftJoin('c.Member') + ->where('c.name = \'api_key\'') + ->where('c.value = ?', $apiKey) + ->fetchOne(); + + if (!$config) + { + return null; + } + + return $config->getMember(); + } + + public function getMember() + { + if (!is_null($this->member)) + { + return $this->member; + } + + $request = sfContext::getInstance()->getRequest(); + + $apiKey = $request['apiKey']; + if (false === $apiKey) + { + $exception = new opErrorHttpException('apiKey parameter not specified.'); + throw $exception->setHttpStatusCode(401); + } + + $member = $this->getMemberByApiKey($apiKey); + if (is_null($member) || $member->isOnBlackList() || $member->getIsLoginRejected()) + { + $exception = new opErrorHttpException('Invalid API key.'); + throw $exception->setHttpStatusCode(401); + } + + $this->member = $member; + + return $member; + } + + public function getMemberId() + { + return $this->getMember()->getId(); + } } diff --git a/apps/api/modules/activity/actions/actions.class.php b/apps/api/modules/activity/actions/actions.class.php new file mode 100644 index 000000000..15f6804e9 --- /dev/null +++ b/apps/api/modules/activity/actions/actions.class.php @@ -0,0 +1,283 @@ + + */ +class activityActions extends opJsonApiActions +{ + public function executeSearch(sfWebRequest $request) + { + $builder = opActivityQueryBuilder::create() + ->setViewerId($this->getUser()->getMemberId()); + + if (isset($request['target'])) + { + if ('friend' === $request['target']) + { + $builder->includeFriends($request['target_id'] ? $request['target_id'] : null); + } + elseif ('community' === $request['target']) + { + $this->forward400Unless($request['target_id'], 'target_id parameter not specified.'); + $builder + ->includeSelf() + ->includeFriends() + ->includeSns() + ->setCommunityId($request['target_id']); + } + else + { + $this->forward400('target parameter is invalid.'); + } + } + else + { + if (isset($request['member_id'])) + { + $builder->includeMember($request['member_id']); + } + else + { + $builder + ->includeSns() + ->includeFriends() + ->includeSelf(); + } + } + + $query = $builder->buildQuery(); + + if (isset($request['keyword'])) + { + $query->andWhereLike('body', $request['keyword']); + } + + $globalAPILimit = sfConfig::get('op_json_api_limit', 20); + if (isset($request['count']) && (int)$request['count'] < $globalAPILimit) + { + $query->limit($request['count']); + } + else + { + $query->limit($globalAPILimit); + } + + if (isset($request['max_id'])) + { + $query->addWhere('id <= ?', $request['max_id']); + } + + if (isset($request['since_id'])) + { + $query->addWhere('id > ?', $request['since_id']); + } + + if (isset($request['activity_id'])) + { + $query->addWhere('id = ?', $request['activity_id']); + } + + $this->activityData = $query + ->andWhere('in_reply_to_activity_id IS NULL') + ->execute(); + + $this->setTemplate('array'); + } + + public function executeMember(sfWebRequest $request) + { + if ($request['id']) + { + $request['member_id'] = $request['id']; + } + + if (isset($request['target'])) + { + unset($request['target']); + } + + $this->forward('activity', 'search'); + } + + public function executeFriends(sfWebRequest $request) + { + $request['target'] = 'friend'; + + if (isset($request['member_id'])) + { + $request['target_id'] = $request['member_id']; + unset($request['member_id']); + } + elseif (isset($request['id'])) + { + $request['target_id'] = $request['id']; + unset($request['id']); + } + + $this->forward('activity', 'search'); + } + + public function executeCommunity(sfWebRequest $request) + { + $request['target'] = 'community'; + + if (isset($request['community_id'])) + { + $request['target_id'] = $request['community_id']; + unset($request['community_id']); + } + elseif (isset($request['id'])) + { + $request['target_id'] = $request['id']; + unset($request['id']); + } + else + { + $this->forward400('community_id parameter not specified.'); + } + + $this->forward('activity', 'search'); + } + + public function executePost(sfWebRequest $request) + { + if (!opConfig::get('is_allow_post_activity')) + { + return $this->renderJSON(array('status' => 'error', 'message' => "you are not allowed this action.")); + } + + $body = (string)$request['body']; + $this->forward400If('' === $body, 'body parameter not specified.'); + $this->forward400If(mb_strlen($body) > 140, 'The body text is too long.'); + + $memberId = $this->getUser()->getMemberId(); + $options = array(); + + if (isset($request['public_flag'])) + { + $options['public_flag'] = $request['public_flag']; + } + + if (isset($request['in_reply_to_activity_id'])) + { + $options['in_reply_to_activity_id'] = $request['in_reply_to_activity_id']; + } + + if (isset($request['uri'])) + { + $options['uri'] = $request['uri']; + } + elseif (isset($request['url'])) + { + $options['uri'] = $request['url']; + } + + if (isset($request['target']) && 'community' === $request['target']) + { + if (!isset($request['target_id'])) + { + $this->forward400('target_id parameter not specified.'); + } + + $this->checkCommunityMember($request['target_id']); + + $options['foreign_table'] = 'community'; + $options['foreign_id'] = $request['target_id']; + } + + $options['source'] = 'API'; + + $imageFiles = $request->getFiles('images'); + if (!empty($imageFiles)) + { + foreach ((array)$imageFiles as $imageFile) + { + $validator = new opValidatorImageFile(array('required' => false)); + try + { + $obj = $validator->clean($imageFile); + } + catch (sfValidatorError $e) + { + $this->forward400('This image file is invalid.'); + } + if (is_null($obj)) + { + continue; // empty value + } + $file = new File(); + $file->setFromValidatedFile($obj); + $file->setName('ac_'.$this->getUser()->getMemberId().'_'.$file->getName()); + $file->save(); + $options['images'][]['file_id'] = $file->getId(); + } + } + + $this->activity = Doctrine::getTable('ActivityData')->updateActivity($memberId, $body, $options); + + $this->setTemplate('object'); + } + + public function executeDelete(sfWebRequest $request) + { + if (isset($request['activity_id'])) + { + $activityId = $request['activity_id']; + } + elseif (isset($request['id'])) + { + $activityId = $request['id']; + } + else + { + $this->forward400('activity_id parameter not specified.'); + } + + $activity = Doctrine::getTable('ActivityData')->find($activityId); + + $this->forward404Unless($activity, 'Invalid activity id.'); + + $this->forward403Unless($activity->getMemberId() === $this->getUser()->getMemberId()); + + $activity->delete(); + + return $this->renderJSON(array('status' => 'success')); + } + + public function executeMentions(sfWebRequest $request) + { + $builder = opActivityQueryBuilder::create() + ->setViewerId($this->getUser()->getMemberId()) + ->includeMentions(); + + $query = $builder->buildQuery() + ->andWhere('in_reply_to_activity_id IS NULL') + ->andWhere('foreign_table IS NULL') + ->andWhere('foreign_id IS NULL') + ->limit(20); + + $this->activityData = $query->execute(); + + $this->setTemplate('array'); + } + + protected function checkCommunityMember($communityId) + { + $memberId = $this->getUser()->getMemberId(); + $isCommunityMember = Doctrine_Core::getTable('CommunityMember')->isMember($memberId, $communityId); + + $this->forward403Unless($isCommunityMember, 'You don\'t participate in this community.'); + } +} diff --git a/apps/api/modules/activity/templates/arraySuccess.php b/apps/api/modules/activity/templates/arraySuccess.php new file mode 100644 index 000000000..4eb150457 --- /dev/null +++ b/apps/api/modules/activity/templates/arraySuccess.php @@ -0,0 +1,26 @@ +getReplies(); + if (0 !== count($replies)) + { + $acEntity['replies'] = array(); + + foreach ($replies as $reply) + { + $acEntity['replies'][] = op_api_activity($reply); + } + } + + $ac[] = $acEntity; +} + +return array( + 'status' => 'success', + 'data' => $ac, +); diff --git a/apps/api/modules/activity/templates/objectSuccess.php b/apps/api/modules/activity/templates/objectSuccess.php new file mode 100644 index 000000000..c6fb31e48 --- /dev/null +++ b/apps/api/modules/activity/templates/objectSuccess.php @@ -0,0 +1,19 @@ +getReplies(); +if (0 !== count($replies)) +{ + $acEntity['replies'] = array(); + + foreach ($replies as $reply) + { + $acEntity['replies'][] = op_api_activity($reply); + } +} + +return array( + 'status' => 'success', + 'data' => $acEntity, +); diff --git a/apps/api/modules/community/actions/actions.class.php b/apps/api/modules/community/actions/actions.class.php new file mode 100644 index 000000000..a4cea8bfa --- /dev/null +++ b/apps/api/modules/community/actions/actions.class.php @@ -0,0 +1,115 @@ + + */ +class communityActions extends opJsonApiActions +{ + public function executeSearch(sfWebRequest $request) + { + $query = Doctrine::getTable('Community')->createQuery(); + + if (isset($request['keyword'])) + { + $query->andWhereLike('name', $request['keyword']); + } + + $this->communities = $query + ->limit(sfConfig::get('op_json_api_limit', 20)) + ->execute(); + + $this->setTemplate('array'); + } + + public function executeMember(sfWebRequest $request) + { + if (isset($request['community_id'])) + { + $communityId = $request['community_id']; + } + elseif (isset($request['id'])) + { + $communityId = $request['id']; + } + else + { + $this->forward400('community_id parameter not specified.'); + } + + $this->members = Doctrine::getTable('Member')->createQuery('m') + ->addWhere('EXISTS (FROM CommunityMember cm WHERE m.id = cm.member_id AND cm.is_pre = false AND cm.community_id = ?)', $communityId) + ->limit(sfConfig::get('op_json_api_limit', 20)) + ->execute(); + + $this->setTemplate('array', 'member'); + } + + public function executeJoin(sfWebRequest $request) + { + $memberId = $this->getUser()->getMemberId(); + + if (isset($request['community_id'])) + { + $communityId = $request['community_id']; + } + elseif (isset($request['id'])) + { + $communityId = $request['id']; + } + else + { + $this->forward400('community_id parameter not specified.'); + } + + $community = Doctrine::getTable('Community')->find($communityId); + if (!$community) + { + $this->forward404('This community does not exist.'); + } + + $communityJoinPolicy = $community->getConfig('register_policy'); + + $communityMember = Doctrine::getTable('CommunityMember') + ->retrieveByMemberIdAndCommunityId($memberId, $community->getId()); + + if ($request['leave']) + { + if (!$communityMember || $communityMember->hasPosition('admin')) + { + $this->forward400('You can\'t leave this community.'); + } + + Doctrine::getTable('CommunityMember')->quit($memberId, $communityId); + } + else + { + if ($communityMember) + { + if ($communityMember->getIsPre()) + { + $this->forward400('You are already sent request to join this community.'); + } + else + { + $this->forward400('You are already this community\'s member.'); + } + } + + Doctrine::getTable('CommunityMember')->join($memberId, $communityId, $communityJoinPolicy); + } + + return $this->renderJSON(array('status' => 'success')); + } +} diff --git a/apps/api/modules/community/templates/arraySuccess.php b/apps/api/modules/community/templates/arraySuccess.php new file mode 100644 index 000000000..2574ab914 --- /dev/null +++ b/apps/api/modules/community/templates/arraySuccess.php @@ -0,0 +1,13 @@ + 'success', + 'data' => $data, +); diff --git a/apps/api/modules/default/actions/actions.class.php b/apps/api/modules/default/actions/actions.class.php new file mode 100644 index 000000000..cd3ea6c68 --- /dev/null +++ b/apps/api/modules/default/actions/actions.class.php @@ -0,0 +1,62 @@ + + */ +class defaultActions extends sfActions +{ + public function executeError400(sfWebRequest $request) + { + $this->getResponse()->setStatusCode(400); + + return $this->renderError($request['error_message']); + } + + public function executeError401(sfWebRequest $request) + { + $this->getResponse()->setStatusCode(401); + + return $this->renderError($request['error_message']); + } + + public function executeError403(sfWebRequest $request) + { + $this->getResponse()->setStatusCode(403); + + return $this->renderError($request['error_message']); + } + + public function executeError404(sfWebRequest $request) + { + $this->getResponse()->setStatusCode(404); + + return $this->renderError($request['error_message']); + } + + protected function renderError($message = null) + { + $response = $this->getResponse(); + $response->setContentType('text/plain'); + + $errorText = $response->getStatusCode().' '.$response->getStatusText(); + + if ($message) + { + $errorText .= ': '.$message; + } + + return $this->renderText($errorText); + } +} diff --git a/apps/api/modules/member/actions/actions.class.php b/apps/api/modules/member/actions/actions.class.php new file mode 100644 index 000000000..8f8df37b4 --- /dev/null +++ b/apps/api/modules/member/actions/actions.class.php @@ -0,0 +1,187 @@ + + */ +class memberActions extends opJsonApiActions +{ + public function executeCommunity(sfWebRequest $request) + { + if (isset($request['member_id'])) + { + $memberId = $request['member_id']; + } + elseif (isset($request['id'])) + { + $memberId = $request['id']; + } + else + { + $memberId = $this->getUser()->getMemberId(); + } + + $query = Doctrine::getTable('Community')->createQuery('c') + ->innerJoin('c.CommunityMember cm WITH cm.is_pre = false AND cm.member_id = ?', $memberId) + ->limit(sfConfig::get('op_json_api_limit', 20)); + + if (isset($request['keyword'])) + { + $query->whereLike('c.name', $request['keyword']); + } + + $this->communities = $query->execute(); + + $this->setTemplate('array', 'community'); + } + + public function executeSearch(sfWebRequest $request) + { + $query = Doctrine::getTable('Member')->createQuery('m') + ->andWhere('m.is_active = true'); + + if (isset($request['target'])) + { + if (!isset($request['target_id'])) + { + $this->forward400('target_id parameter not specified.'); + } + $targetId = $request['target_id']; + + if ('friend' === $request['target']) + { + $query->andWhere('EXISTS (FROM MemberRelationship mr WHERE m.id = mr.member_id_to AND mr.member_id_from = ? AND mr.is_friend = true)', $targetId); + } + if ('community' === $request['target']) + { + $query->andWhere('EXISTS (FROM CommunityMember cm WHERE m.id = cm.member_id AND cm.community_id = ?)', $targetId); + } + } + + if (isset($request['keyword'])) + { + $query->andWhereLike('m.name', $request['keyword']); + } + + $this->members = $query + ->limit(sfConfig::get('op_json_api_limit', 20)) + ->execute(); + + $this->setTemplate('array'); + } + + public function executeFriendAccept(sfWebRequest $request) + { + if (isset($request['member_id'])) + { + $targetMemberId = $request['member_id']; + } + elseif (isset($request['id'])) + { + $targetMemberId = $request['id']; + } + else + { + $this->forward400('member_id parameter not specified.'); + } + + $memberId = $this->getUser()->getMemberId(); + + $preRequest = Doctrine::getTable('MemberRelationship')->createQuery() + ->addWhere('member_id_from = ?', $targetMemberId) + ->addWhere('member_id_to = ?', $memberId) + ->addWhere('is_friend_pre = true') + ->fetchOne(); + + if (!$preRequest) + { + $this->forward404('Invalid member_id.'); + } + + if (!isset($request['reject'])) + { + $preRequest->setFriend(); + } + else + { + $preRequest->removeFriendPre(); + } + + $preRequest->free(true); + + return $this->renderJSON(array('status' => 'success')); + } + + public function executeFriendRequest(sfWebRequest $request) + { + $memberId = $this->getUser()->getMemberId(); + + if (isset($request['member_id'])) + { + $targetMemberId = $request['member_id']; + } + elseif (isset($request['id'])) + { + $targetMemberId = $request['id']; + } + else + { + $this->forward400('member_id parameter not specified.'); + } + + if ($memberId === $targetMemberId) + { + $this->forward400('Friend request to myself is not allowed.'); + } + + $relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($memberId, $targetMemberId); + if (!$relation) + { + $relation = new MemberRelationship(); + $relation->setMemberIdFrom($memberId); + $relation->setMemberIdTo($targetMemberId); + } + + if (isset($request['unlink'])) + { + if (!$relation->isFriend()) + { + $this->forward400('This member is not your friend.'); + } + + $relation->removeFriend(); + } + else + { + if ($relation->isAccessBlocked()) + { + $this->forward403('Friend request is blocked.'); + } + if ($relation->isFriend()) + { + $this->forward400('This member already belongs to your friend.'); + } + if ($relation->isFriendPreFrom()) + { + $this->forward400('Friend request is already sent.'); + } + + $relation->setFriendPre(); + } + + $relation->free(true); + + return $this->renderJSON(array('status' => 'success')); + } +} diff --git a/apps/api/modules/member/templates/arraySuccess.php b/apps/api/modules/member/templates/arraySuccess.php new file mode 100644 index 000000000..acc241bfe --- /dev/null +++ b/apps/api/modules/member/templates/arraySuccess.php @@ -0,0 +1,13 @@ + 'success', + 'data' => $data, +); diff --git a/apps/api/modules/push/actions/actions.class.php b/apps/api/modules/push/actions/actions.class.php new file mode 100644 index 000000000..896eb5fb6 --- /dev/null +++ b/apps/api/modules/push/actions/actions.class.php @@ -0,0 +1,76 @@ + + */ +class pushActions extends opJsonApiActions +{ + public function executeSearch(sfWebRequest $request) + { + $member = $this->getUser()->getMember(); + $this->notifications = opNotificationCenter::getNotifications($member); + + $this->setTemplate('array'); + } + + public function executeCount(sfWebRequest $request) + { + $member = $this->getUser()->getMember(); + $notifications = opNotificationCenter::getNotifications($member); + + $this->count = array( + 'link' => 0, + 'message' => 0, + 'other' => 0, + ); + + foreach ($notifications as $notification) + { + if (array_key_exists($notification['category'], $this->count)) + { + $category = $notification['category']; + } + else + { + $category = 'other'; + } + + if ($notification['unread']) + { + $this->count[$category]++; + } + } + + $this->setTemplate('count'); + } + + public function executeRead(sfWebRequest $request) + { + $this->forward400Unless($request['id'], 'id parameter not specified.'); + + $member = $this->getUser()->getMember(); + + $ret = opNotificationCenter::setRead($member, $request['id']); + + if ($ret) + { + return $this->renderJSON(array('status' => 'success')); + } + else + { + $this->forward404('Request parameter id does not exist.'); + } + } +} diff --git a/apps/api/modules/push/templates/arraySuccess.php b/apps/api/modules/push/templates/arraySuccess.php new file mode 100644 index 000000000..afcf70c91 --- /dev/null +++ b/apps/api/modules/push/templates/arraySuccess.php @@ -0,0 +1,13 @@ + 'success', + 'data' => $data +); diff --git a/apps/api/modules/push/templates/countSuccess.php b/apps/api/modules/push/templates/countSuccess.php new file mode 100644 index 000000000..c9ad93471 --- /dev/null +++ b/apps/api/modules/push/templates/countSuccess.php @@ -0,0 +1,6 @@ + 'success', + 'data' => $count->getRawValue(), +); diff --git a/apps/mobile_frontend/config/factories.yml b/apps/mobile_frontend/config/factories.yml index bc25a5b4b..5742d6620 100644 --- a/apps/mobile_frontend/config/factories.yml +++ b/apps/mobile_frontend/config/factories.yml @@ -93,13 +93,7 @@ all: debug: false untranslated_prefix: "[T]" untranslated_suffix: "[/T]" - cache: - class: sfFileCache - param: - automatic_cleaning_factor: 0 - cache_dir: %SF_I18N_CACHE_DIR% - lifetime: 86400 - prefix: %SF_APP_DIR% + cache: ~ routing: class: sfPatternRouting diff --git a/apps/mobile_frontend/i18n/messages.ja.xml b/apps/mobile_frontend/i18n/messages.ja.xml index 363d0a99b..7f3d48ef7 100644 --- a/apps/mobile_frontend/i18n/messages.ja.xml +++ b/apps/mobile_frontend/i18n/messages.ja.xml @@ -106,26 +106,6 @@ Public Flag for Profile Page プロフィールページの公開範囲 - - All Users on the Web - Web全体に公開 - - - All Members - 全員に公開 - - - %my_friend% - %my_friend%まで公開 - - - Only Open to %my_friend% - %my_friend%まで公開 - - - Private - 公開しない - Register mobile 携帯電話を登録する @@ -162,14 +142,6 @@ %Community% Members %Community%メンバー - - Everyone can see - Web全体に公開 - - - Only SNS members can see - SNS参加者のみ公開 - Everyone can join 誰でも参加できる @@ -234,6 +206,10 @@ Please select the item from the menu. メニューから設定したい項目を選択してください。 + + There is no available settings. + 利用可能な設定はありません。 + Successful in invite. 送信が完了しました。 @@ -307,7 +283,7 @@ 携帯電話を登録します。 - Prease input your password, press "%1%" button. + Please input your password, and press "%1%" button. パスワードを入力して、「%1%」ボタンを押してください。 @@ -511,16 +487,20 @@ %community%作成 - Search Communities - コミュニティ検索 + Search %Community% + %Community%検索 + + + %Community% Top + %Community% トップ Categories カテゴリ - Your search queries did not match any communities. - 該当するコミュニティはありませんでした。 + Your search queries did not match any %community%. + 該当する%community%はありませんでした。 All categories @@ -629,7 +609,7 @@ The form submission cannot be processed. It probably means that you have uploaded a file that is too big. - 送信に失敗しました。 + フォームの送信に失敗しました。アップロードしたファイルが大きすぎる可能性があります。 "%value%" is not an integer. @@ -1235,6 +1215,18 @@ Block access from the selected member with input MemberID.<br /> MemberID is written at the end of member top page URL.<br /> ex. The MemberID is 1 when the URL "http://sns.example.com/member/1" メンバーIDを入力して特定のメンバーからのアクセスをブロックします。<br />メンバーIDは相手トップページのURL末尾に表示されています。<br />例:"http://sns.example.com/member/1" というURLである場合にはメンバーIDは1になります。 + + A mobile UID was already registered. + その携帯電話の個体識別番号はすでに登録されています。 + + + A mobile UID is required. Please check settings of your mobile phone and retry. + 携帯電話の個体識別番号は必須です。携帯電話の個体識別番号設定を確認してもう一度お試しください。 + + + A mobile UID is invalid. + その携帯電話の個体識別番号は無効です。 + diff --git a/apps/mobile_frontend/i18n/publicFlags.ja.xml b/apps/mobile_frontend/i18n/publicFlags.ja.xml new file mode 100644 index 000000000..0fc2f7aa9 --- /dev/null +++ b/apps/mobile_frontend/i18n/publicFlags.ja.xml @@ -0,0 +1,23 @@ + + + + + + All Users on the Web + Web全体に公開 + + + All Members + 全員に公開 + + + %my_friend% + %my_friend%まで公開 + + + Private + 公開しない + + + + diff --git a/apps/mobile_frontend/modules/community/actions/actions.class.php b/apps/mobile_frontend/modules/community/actions/actions.class.php index 23f0c8dcd..5fb35d0a0 100644 --- a/apps/mobile_frontend/modules/community/actions/actions.class.php +++ b/apps/mobile_frontend/modules/community/actions/actions.class.php @@ -21,9 +21,9 @@ class communityActions extends opCommunityAction /** * Executes home action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeHome(sfWebRequest $request) + public function executeHome(opWebRequest $request) { $this->membersSize = 5; @@ -33,9 +33,9 @@ public function executeHome(sfWebRequest $request) /** * Executes joinlist action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeJoinlist(sfWebRequest $request) + public function executeJoinlist(opWebRequest $request) { $this->size = 10; @@ -45,9 +45,9 @@ public function executeJoinlist(sfWebRequest $request) /** * Executes memberList action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeMemberList(sfWebRequest $request) + public function executeMemberList(opWebRequest $request) { $this->size = 10; @@ -57,9 +57,9 @@ public function executeMemberList(sfWebRequest $request) /** * Executes search action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeSearch(sfWebRequest $request) + public function executeSearch(opWebRequest $request) { sfConfig::set('sf_nav_type', 'default'); @@ -95,9 +95,9 @@ public function executeSearch(sfWebRequest $request) /** * Executes detail action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeDetail(sfWebRequest $request) + public function executeDetail(opWebRequest $request) { $this->community = Doctrine::getTable('Community')->find($this->id); $this->forward404Unless($this->community, 'Undefined community.'); @@ -111,9 +111,9 @@ public function executeDetail(sfWebRequest $request) /** * Executes configImage action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeConfigImage(sfWebRequest $request) + public function executeConfigImage(opWebRequest $request) { $this->forward404Unless($this->id && $this->isEditCommunity); $this->community = Doctrine::getTable('Community')->find($this->id); @@ -122,9 +122,9 @@ public function executeConfigImage(sfWebRequest $request) /** * Executes deleteImage action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeDeleteImage($request) + public function executeDeleteImage(opWebRequest $request) { $this->forward404Unless($this->id && $this->isEditCommunity); diff --git a/apps/mobile_frontend/modules/community/actions/components.class.php b/apps/mobile_frontend/modules/community/actions/components.class.php index 25ebf6f8a..cca235373 100644 --- a/apps/mobile_frontend/modules/community/actions/components.class.php +++ b/apps/mobile_frontend/modules/community/actions/components.class.php @@ -10,7 +10,7 @@ class communityComponents extends opCommunityComponents { - public function executeJoinListBox($request) + public function executeJoinListBox(opWebRequest $request) { $memberId = $this->getUser()->getMemberId(); if ($request->hasParameter('id')) diff --git a/apps/mobile_frontend/modules/community/config/security.yml b/apps/mobile_frontend/modules/community/config/security.yml index 4e641023f..d92f54d55 100644 --- a/apps/mobile_frontend/modules/community/config/security.yml +++ b/apps/mobile_frontend/modules/community/config/security.yml @@ -1,10 +1,3 @@ all: is_secure: true credentials: SNSMember - -home: - is_secure: false - -memberList: - is_secure: false - diff --git a/apps/mobile_frontend/modules/community/templates/detailSuccess.php b/apps/mobile_frontend/modules/community/templates/detailSuccess.php index 257d7f695..d5492a795 100644 --- a/apps/mobile_frontend/modules/community/templates/detailSuccess.php +++ b/apps/mobile_frontend/modules/community/templates/detailSuccess.php @@ -37,4 +37,4 @@
-getId()) ?> +getId()) ?> diff --git a/apps/mobile_frontend/modules/community/templates/editSuccess.php b/apps/mobile_frontend/modules/community/templates/editSuccess.php index f568b4cb4..0d61b6b13 100644 --- a/apps/mobile_frontend/modules/community/templates/editSuccess.php +++ b/apps/mobile_frontend/modules/community/templates/editSuccess.php @@ -21,7 +21,7 @@ 'align' => 'center', )) ?> -isNew()): ?> +isNew() && $isDeleteCommunity): ?> __('Delete this %community%'), @@ -32,5 +32,5 @@ )); ?>
-getId()) ?> +getId()) ?> diff --git a/apps/mobile_frontend/modules/community/templates/memberListError.php b/apps/mobile_frontend/modules/community/templates/memberListError.php index 4412cd7e6..abba9d293 100644 --- a/apps/mobile_frontend/modules/community/templates/memberListError.php +++ b/apps/mobile_frontend/modules/community/templates/memberListError.php @@ -3,4 +3,4 @@
-getId()) ?> +getId()) ?> diff --git a/apps/mobile_frontend/modules/community/templates/memberListSuccess.php b/apps/mobile_frontend/modules/community/templates/memberListSuccess.php index 8c132a430..f65ee5389 100644 --- a/apps/mobile_frontend/modules/community/templates/memberListSuccess.php +++ b/apps/mobile_frontend/modules/community/templates/memberListSuccess.php @@ -19,4 +19,4 @@
-getId()) ?> +getId()) ?> diff --git a/apps/mobile_frontend/modules/community/templates/quitError.php b/apps/mobile_frontend/modules/community/templates/quitError.php index a76185966..d71c4295c 100644 --- a/apps/mobile_frontend/modules/community/templates/quitError.php +++ b/apps/mobile_frontend/modules/community/templates/quitError.php @@ -1,6 +1,6 @@ - + - + diff --git a/apps/mobile_frontend/modules/community/templates/searchSuccess.php b/apps/mobile_frontend/modules/community/templates/searchSuccess.php index 89407a218..f68a9a2cc 100644 --- a/apps/mobile_frontend/modules/community/templates/searchSuccess.php +++ b/apps/mobile_frontend/modules/community/templates/searchSuccess.php @@ -1,4 +1,4 @@ - + $op_term['community']->pluralize()))) ?> getNbResults()): ?> @@ -18,7 +18,7 @@ ?> false, 'use_current_query_string' => true)) ?> - + $op_term['community']->pluralize())) ?> diff --git a/apps/mobile_frontend/modules/friend/actions/actions.class.php b/apps/mobile_frontend/modules/friend/actions/actions.class.php index f33732bbd..3dd65d61a 100644 --- a/apps/mobile_frontend/modules/friend/actions/actions.class.php +++ b/apps/mobile_frontend/modules/friend/actions/actions.class.php @@ -20,9 +20,9 @@ class friendActions extends opFriendAction /** * Executes list action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeList(sfWebRequest $request) + public function executeList(opWebRequest $request) { $this->size = 10; @@ -32,9 +32,9 @@ public function executeList(sfWebRequest $request) /** * Execute show activities action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeShowActivity(sfWebRequest $request) + public function executeShowActivity(opWebRequest $request) { $this->size = 10; diff --git a/apps/mobile_frontend/modules/friend/actions/components.class.php b/apps/mobile_frontend/modules/friend/actions/components.class.php index 35b9acb71..7d950e094 100644 --- a/apps/mobile_frontend/modules/friend/actions/components.class.php +++ b/apps/mobile_frontend/modules/friend/actions/components.class.php @@ -10,7 +10,7 @@ class friendComponents extends opFriendComponents { - public function executeFriendListBox($request) + public function executeFriendListBox(opWebRequest $request) { $memberId = $this->getUser()->getMemberId(); if ($request->hasParameter('id')) diff --git a/apps/mobile_frontend/modules/member/actions/actions.class.php b/apps/mobile_frontend/modules/member/actions/actions.class.php index afa97b606..aca6be110 100644 --- a/apps/mobile_frontend/modules/member/actions/actions.class.php +++ b/apps/mobile_frontend/modules/member/actions/actions.class.php @@ -17,7 +17,7 @@ */ class memberActions extends opMemberAction { - public function executeHome($request) + public function executeHome(opWebRequest $request) { $this->gadgetConfig = sfConfig::get('op_mobile_gadget_list'); @@ -33,7 +33,7 @@ public function executeHome($request) return parent::executeHome($request); } - public function executeLogin($request) + public function executeLogin(opWebRequest $request) { if (opConfig::get('external_mobile_login_url') && $request->isMethod(sfWebRequest::GET)) { @@ -46,14 +46,14 @@ public function executeLogin($request) return parent::executeLogin($request); } - public function executeSearch($request) + public function executeSearch(opWebRequest $request) { $this->size = 10; return parent::executeSearch($request); } - public function executeProfile($request) + public function executeProfile(opWebRequest $request) { $this->friendsSize = 5; $this->communitiesSize = 5; @@ -66,7 +66,7 @@ public function executeProfile($request) return parent::executeProfile($request); } - public function executeConfigUID($request) + public function executeConfigUID(opWebRequest $request) { $option = array('member' => $this->getUser()->getMember()); $this->passwordForm = new opPasswordForm(array(), $option); @@ -112,7 +112,7 @@ public function executeConfigUID($request) return sfView::SUCCESS; } - public function executeRegisterMobileToRegisterEnd(sfWebRequest $request) + public function executeRegisterMobileToRegisterEnd(opWebRequest $request) { $id = $request->getParameter('id'); @@ -149,7 +149,7 @@ public function executeRegisterMobileToRegisterEnd(sfWebRequest $request) return sfView::SUCCESS; } - public function executeDeleteImage($request) + public function executeDeleteImage(opWebRequest $request) { $this->image = Doctrine::getTable('MemberImage')->find($request->getParameter('member_image_id')); $this->forward404Unless($this->image); @@ -165,14 +165,14 @@ public function executeDeleteImage($request) } } - public function executeShowActivity($request) + public function executeShowActivity(opWebRequest $request) { $this->size = 10; parent::executeShowActivity($request); } - public function executeSetSid($request) + public function executeSetSid(opWebRequest $request) { $this->forward404Unless(isset($request['sid'])); $this->forward404Unless(isset($request['ts']) && abs(time() - $request['ts']) <= strtotime('30 minutes')); @@ -199,9 +199,9 @@ public function executeSetSid($request) /** * Execute show all member activities action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeShowAllMemberActivity(sfWebRequest $request) + public function executeShowAllMemberActivity(opWebRequest $request) { $this->size = 10; diff --git a/apps/mobile_frontend/modules/member/templates/configSuccess.php b/apps/mobile_frontend/modules/member/templates/configSuccess.php index f27a9ee2b..3a20ffaa9 100644 --- a/apps/mobile_frontend/modules/member/templates/configSuccess.php +++ b/apps/mobile_frontend/modules/member/templates/configSuccess.php @@ -4,12 +4,14 @@ - +count() > 1): // except CSRF token field ?> url_for('member/config?category='.$categoryName), 'align' => 'center', 'button' => __('Save') )) ?> +count()) : ?> + diff --git a/apps/mobile_frontend/modules/member/templates/configUIDSuccess.php b/apps/mobile_frontend/modules/member/templates/configUIDSuccess.php index 84e7e9b26..b40dc6252 100644 --- a/apps/mobile_frontend/modules/member/templates/configUIDSuccess.php +++ b/apps/mobile_frontend/modules/member/templates/configUIDSuccess.php @@ -3,7 +3,8 @@
"> - __('Save'))) ?> +
+ __('Save'))) ?>
diff --git a/apps/mobile_frontend/modules/member/templates/homeSuccess.php b/apps/mobile_frontend/modules/member/templates/homeSuccess.php index 74ebb4629..0265111c4 100644 --- a/apps/mobile_frontend/modules/member/templates/homeSuccess.php +++ b/apps/mobile_frontend/modules/member/templates/homeSuccess.php @@ -57,7 +57,7 @@ $op_term['community']->pluralize())), 'community/search'), ); op_include_list('search', $list, array('title' => __('Search'))) ?> diff --git a/apps/mobile_frontend/modules/member/templates/profileSuccess.php b/apps/mobile_frontend/modules/member/templates/profileSuccess.php index 5f0d9c66b..3c0d7527c 100644 --- a/apps/mobile_frontend/modules/member/templates/profileSuccess.php +++ b/apps/mobile_frontend/modules/member/templates/profileSuccess.php @@ -1,7 +1,7 @@ getName()) ?> getCulture()); ?> -getMember()) : ?> +isSelf()) : ?> ">
link_to('「'. __('Edit profile') .'」', '@member_editProfile'))) ?> @@ -33,6 +33,9 @@ getName(); + if ($member->getAge(true)) { $ageValue = __('%1% years old', array('%1%' => $member->getAge())); @@ -56,11 +59,7 @@ continue; } - if ('textarea' === $profile->getFormType()) - { - $value = op_auto_link_text_for_mobile((string)$profile); - } - elseif ($profile->getProfile()->isPreset()) + if ($profile->getProfile()->isPreset()) { $presetConfig = $profile->getProfile()->getPresetConfig(); $caption = __($presetConfig['Caption']); @@ -78,15 +77,23 @@ } } + if ('textarea' === $profile->getFormType()) + { + $value = nl2br(op_auto_link_text_for_mobile($value)); + } + if ($member->getId() == $sf_user->getMemberId()) { + $termMyFriend = Doctrine::getTable('SnsTerm')->get('my_friend'); + $terms = array('%my_friend%' => $termMyFriend->pluralize()->titleize()); + if ($profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_FRIEND) { - $value .= '('.__('Only Open to %my_friend%').')
'; + $value .= '('.__('%my_friend%', $terms, 'publicFlags').')
'; } elseif ($profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_WEB && $profile->Profile->is_public_web) { - $value .= '('.__('All Users on the Web').')
'; + $value .= '('.__('All Users on the Web', $terms, 'publicFlags').')
'; } } diff --git a/apps/mobile_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php b/apps/mobile_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php index 04439e372..8c9d7b69a 100644 --- a/apps/mobile_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php +++ b/apps/mobile_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php @@ -1,7 +1,7 @@
- __('Register'))) ?>
+ __('Register'))) ?>
diff --git a/apps/mobile_mail_frontend/i18n/messages.ja.xml b/apps/mobile_mail_frontend/i18n/messages.ja.xml index 01b95c189..7247dc899 100644 --- a/apps/mobile_mail_frontend/i18n/messages.ja.xml +++ b/apps/mobile_mail_frontend/i18n/messages.ja.xml @@ -72,7 +72,7 @@ The form submission cannot be processed. It probably means that you have uploaded a file that is too big. - 送信に失敗しました。 + フォームの送信に失敗しました。アップロードしたファイルが大きすぎる可能性があります。 "%value%" is not an integer. diff --git a/apps/pc_backend/config/factories.yml b/apps/pc_backend/config/factories.yml index 21cc1657b..0b9b2a4fd 100644 --- a/apps/pc_backend/config/factories.yml +++ b/apps/pc_backend/config/factories.yml @@ -92,13 +92,7 @@ all: debug: false untranslated_prefix: "[T]" untranslated_suffix: "[/T]" - cache: - class: sfFileCache - param: - automatic_cleaning_factor: 0 - cache_dir: %SF_I18N_CACHE_DIR% - lifetime: 86400 - prefix: %SF_APP_DIR% + cache: ~ routing: class: sfPatternRouting diff --git a/apps/pc_backend/i18n/form_community.ja.xml b/apps/pc_backend/i18n/form_community.ja.xml index 630285956..db4b94760 100644 --- a/apps/pc_backend/i18n/form_community.ja.xml +++ b/apps/pc_backend/i18n/form_community.ja.xml @@ -42,6 +42,10 @@ Required. 必須項目です。 + + "%value%" is too long (%max_length% characters max). + %max_length%文字以内で入力してください。 + diff --git a/apps/pc_backend/i18n/messages.ja.xml b/apps/pc_backend/i18n/messages.ja.xml index f36bb24df..ae78ab867 100644 --- a/apps/pc_backend/i18n/messages.ja.xml +++ b/apps/pc_backend/i18n/messages.ja.xml @@ -2,10 +2,6 @@ - - Nickname - ニックネーム - Password パスワード @@ -34,7 +30,7 @@ %Community%'s admin authorization needed - %Community%参加者の承認が必要 + %Community%管理者の承認が必要 Public Flag for Profile Page @@ -108,6 +104,10 @@ %community% Description %community%説明文 + + There are no %community% matches search condition. + 該当する%community%は存在しません。 + Text Mode @@ -185,7 +185,7 @@ The form submission cannot be processed. It probably means that you have uploaded a file that is too big. - 送信に失敗しました。 + フォームの送信に失敗しました。アップロードしたファイルが大きすぎる可能性があります。 "%value%" is not an integer. @@ -331,10 +331,6 @@ Remove Admin Token アクセス権限の剥奪 - - Image - 画像 - Application Name アプリケーション名 @@ -556,38 +552,6 @@ Okinawa 沖縄県 - - Sex - 性別 - - - Birthday - 誕生日 - - - Country - 国または地域 - - - Region - 都市(都道府県や州など) - - - Region in Japan - 都道府県 - - - Postal Code - 郵便番号 - - - Telephone Number - 電話番号 - - - Self Introduction - 自己紹介 - Term Configuration in this SNS SNS内名称設定 @@ -961,10 +925,6 @@ Create new entry プロフィール項目登録 - - Operation - 操作 - Entry name 項目名 @@ -1005,18 +965,10 @@ Change 変更 - - Edit - 変更 - Search 検索 - - Delete - 削除 - List 一覧 @@ -1178,7 +1130,7 @@ 本当に削除してもよろしいですか? - ※All the member's data in this entry will be lost. + NOTE: All the member's data in this entry will be lost. ※この項目に対するメンバーの入力値も失われます。 @@ -1197,6 +1149,10 @@ PC frontend ナビ設定 + + PC frontend (Smartphone) + スマートフォン版ナビ設定 + Mobile frontend 携帯版ナビ設定 @@ -1224,43 +1180,43 @@ No members matching 該当するメンバーは存在しません。 - + Unsubscribe 強制退会 - + Ban ログイン停止 - + Unban ログイン停止解除 - + Reissue password パスワード再発行 - + Add mobile UID to blacklist 携帯電話個体識別番号をブラックリストに登録 - + Invited by 招待者 - + Last login 最終ログイン - + PC email PCメールアドレス - + Mobile email 携帯メールアドレス - + Mobile UID 携帯電話個体識別番号(暗号化済) @@ -1268,31 +1224,31 @@ Ban Setting ログイン停止設定 - + [0]Do you want to ban this member?[1]Do you want to unban this member? [0]ログイン停止設定を有効にします。|[1]ログイン停止設定を解除します。 - + [0]Ban|[1]Unban [0]有効にする|[1]解除する - + Return to previous page 前のページに戻る - + Change %1%'s password %1%さんのパスワードを変更します。 - + - Change password + Change Password パスワード変更 - + Blacklist Management ブラックリスト管理 - + Add to blacklist ブラックリストに追加 @@ -1332,27 +1288,27 @@ Can't unsubscribe the member has ID = 1 IDが1のメンバーは退会することができません。 - + Do you want to delete this member anyway? 本当にこのメンバーを強制退会させてもよろしいですか? - + The data of this member will be lost forever. 強制退会させると、このメンバーに関する情報は削除され元に戻すことはできません。 - + Delete Blacklist ブラックリスト削除 - + Do you want to delete the following? 以下の内容を本当に削除しますか? - + Authentication plugin is not available. 招待可能な認証プラグインがありません。 - + Please try this again after changing "Authentication plugin" settings in "Plugins" menu. 「プラグイン設定」から認証プラグインの設定を変更してからやりなおしてください。 @@ -1372,7 +1328,7 @@ The member has been unsubscribed 退会が完了しました - + %Community% Name %Community%名 @@ -1417,14 +1373,6 @@ Input the %community% ID you want new members to join and click "Add" button. 参加させたい%community%のIDを入力して「追加」ボタンを押してください。 - - Authority to Read Topic - トピック閲覧権限 - - - Authority to Create Topic - トピック作成権限 - Register policy 参加方針 @@ -1449,6 +1397,74 @@ Not allowed 許可されていません。 + + Logged out. + ログアウトしました。 + + + This setting is applied only for Input type "Text" or "Paragraph text". + この設定はフォームタイプが「テキスト」または「テキスト(複数行)」の場合のみ適用されます。 + + + All of the inputted E-mail addresses are invalid. + 入力されたEメールアドレスはすべて無効です。 + + + Full Size + フルサイズ + + + Advanced Settings + 上級者向け設定 + + + Old password + 古いパスワード + + + New password + 新しいパスワード + + + Account Management + アカウント管理 + + + Set administrator account. + 管理用アカウントを設定します。 + + + Register new account + アカウント追加 + + + User name + ユーザ名 + + + Are you sure you want to delete this account? + このアカウントを本当に削除しますか? + + + Delete account + アカウント削除 + + + Change Language + 言語変更 + + + Languages + 言語 + + + Changed configuration for your culture. + 言語環境を変更しました。 + + + %Community% Sub Administrator + %Community%副管理者 + diff --git a/apps/pc_backend/modules/admin/lib/AdminUserEditPasswordForm.class.php b/apps/pc_backend/modules/admin/lib/AdminUserEditPasswordForm.class.php index 86c08ee23..cb0a1b09c 100644 --- a/apps/pc_backend/modules/admin/lib/AdminUserEditPasswordForm.class.php +++ b/apps/pc_backend/modules/admin/lib/AdminUserEditPasswordForm.class.php @@ -1,5 +1,13 @@ getUsername(); $values['password'] = $values['new_password']; + return $values; } diff --git a/apps/pc_backend/modules/admin/templates/addUserSuccess.php b/apps/pc_backend/modules/admin/templates/addUserSuccess.php index efb8fa59c..5e3395370 100644 --- a/apps/pc_backend/modules/admin/templates/addUserSuccess.php +++ b/apps/pc_backend/modules/admin/templates/addUserSuccess.php @@ -2,13 +2,13 @@ -

+

- +
diff --git a/apps/pc_backend/modules/admin/templates/deleteUserSuccess.php b/apps/pc_backend/modules/admin/templates/deleteUserSuccess.php index 02628074e..39e83e8f4 100644 --- a/apps/pc_backend/modules/admin/templates/deleteUserSuccess.php +++ b/apps/pc_backend/modules/admin/templates/deleteUserSuccess.php @@ -2,9 +2,9 @@ -

+

-

+

@@ -12,12 +12,12 @@ - +
getId() ?>
getUsername() ?>getUsername() ?>
- +
diff --git a/apps/pc_backend/modules/admin/templates/editPasswordSuccess.php b/apps/pc_backend/modules/admin/templates/editPasswordSuccess.php index e33187cff..e924ceb98 100644 --- a/apps/pc_backend/modules/admin/templates/editPasswordSuccess.php +++ b/apps/pc_backend/modules/admin/templates/editPasswordSuccess.php @@ -2,13 +2,13 @@ -

+

- +
diff --git a/apps/pc_backend/modules/admin/templates/manageUserSuccess.php b/apps/pc_backend/modules/admin/templates/manageUserSuccess.php index 6c158295c..f5729f508 100644 --- a/apps/pc_backend/modules/admin/templates/manageUserSuccess.php +++ b/apps/pc_backend/modules/admin/templates/manageUserSuccess.php @@ -2,23 +2,23 @@ -

+

-

-

+

+

- - + + - diff --git a/apps/pc_backend/modules/advanced/actions/actions.class.php b/apps/pc_backend/modules/advanced/actions/actions.class.php new file mode 100644 index 000000000..d18b3f96a --- /dev/null +++ b/apps/pc_backend/modules/advanced/actions/actions.class.php @@ -0,0 +1,86 @@ + + * @author Kimura Youichi + */ +class advancedActions extends sfActions +{ + /** + * Executes config action + * + * @param sfRequest $request A request object + */ + public function executeConfig(sfWebRequest $request) + { + $this->category = $request->getParameter('category', 'advanced'); + $this->categoryAttributes = sfConfig::get('openpne_sns_category_attribute'); + + $this->forward404If(!empty($this->categoryAttributes[$this->category]['Hidden'])); + + $formName = 'op'.sfInflector::camelize($this->category).'SnsConfigForm'; + if (class_exists($formName, true)) + { + $this->form = new $formName(); + } + else + { + $this->form = new SnsConfigForm(array(), array('category' => $this->category)); + } + + if ($request->isMethod('post')) + { + $this->form->bind($request->getParameter('sns_config')); + if ($this->form->isValid()) + { + $this->form->save(); + $this->getUser()->setFlash('notice', 'Saved.'); + $this->redirect('advanced/config?category='.$this->category); + } + + $this->getUser()->setFlash('error', 'Failed to save.', false); + } + } + + public function executeRichTextarea(sfWebRequest $request) + { + $this->sortForm = new BaseForm(); + $this->configForm = new opRichTextareaOpenPNEConfigForm(); + $this->buttonConfigForm = new opRichTextareaOpenPNEButtonConfigForm(); + $this->buttonConfig = opWidgetFormRichTextareaOpenPNE::getAllButtons(); + if ($request->isMethod(sfWebRequest::POST)) + { + $this->configForm->bind($request->getParameter('config')); + $this->buttonConfigForm->bind($request->getParameter('button')); + if ($this->configForm->isValid() && $this->buttonConfigForm->isValid()) + { + $this->configForm->save(); + $this->buttonConfigForm->save(); + } + } + } + + public function executeChangeRichTextareaButtonOrder(sfWebRequest $request) + { + if ($request->isXmlHttpRequest()) + { + $request->checkCSRFProtection(); + + $buttons = $request->getParameter('button'); + Doctrine::getTable('SnsConfig')->set('richtextarea_buttons_sort_order', serialize($buttons)); + } + return sfView::NONE; + } +} diff --git a/apps/pc_backend/modules/sns/lib/opRichTextareaOpenPNEButtonConfigForm.class.php b/apps/pc_backend/modules/advanced/lib/opRichTextareaOpenPNEButtonConfigForm.class.php similarity index 100% rename from apps/pc_backend/modules/sns/lib/opRichTextareaOpenPNEButtonConfigForm.class.php rename to apps/pc_backend/modules/advanced/lib/opRichTextareaOpenPNEButtonConfigForm.class.php diff --git a/apps/pc_backend/modules/sns/lib/opRichTextareaOpenPNEConfigForm.class.php b/apps/pc_backend/modules/advanced/lib/opRichTextareaOpenPNEConfigForm.class.php similarity index 95% rename from apps/pc_backend/modules/sns/lib/opRichTextareaOpenPNEConfigForm.class.php rename to apps/pc_backend/modules/advanced/lib/opRichTextareaOpenPNEConfigForm.class.php index 62ee842be..00f9f4335 100644 --- a/apps/pc_backend/modules/sns/lib/opRichTextareaOpenPNEConfigForm.class.php +++ b/apps/pc_backend/modules/advanced/lib/opRichTextareaOpenPNEConfigForm.class.php @@ -28,7 +28,7 @@ public function configure() array_map(array(sfContext::getInstance()->getI18n(), '__') , self::$defaultModeChoice), 'expanded' => true ))); - $this->setValidator('default_mode', new sfValidatorChoice(array('choices' => array_keys(self::$defaultModeChoice)))); + $this->setValidator('default_mode', new opValidatorChoice(array('choices' => array_keys(self::$defaultModeChoice)))); $this->setDefault('default_mode', Doctrine::getTable('SnsConfig')->get('richtextarea_default_mode', 'text')); $this->widgetSchema->setLabel('default_mode', 'Default edit mode'); $this->widgetSchema->setNameFormat('config[%s]'); diff --git a/apps/pc_backend/modules/advanced/templates/_submenu.php b/apps/pc_backend/modules/advanced/templates/_submenu.php new file mode 100644 index 000000000..181982e5a --- /dev/null +++ b/apps/pc_backend/modules/advanced/templates/_submenu.php @@ -0,0 +1,12 @@ + + $configs) :?> + +
  • + +
  • diff --git a/apps/pc_backend/modules/advanced/templates/configSuccess.php b/apps/pc_backend/modules/advanced/templates/configSuccess.php new file mode 100644 index 000000000..80af5d6a2 --- /dev/null +++ b/apps/pc_backend/modules/advanced/templates/configSuccess.php @@ -0,0 +1,25 @@ + + + + + + +

    ()

    + +

    + + +

    + + +
    +
    getId() ?> getUsername() ?>getId() != 1 && $user->getId() != $sf_user->getId()) : ?> -getId()) ?> +getId() && $user->getId() != $sf_user->getId()) : ?> +getId()) ?>
    + + + + +
    + diff --git a/apps/pc_backend/modules/advanced/templates/richTextareaSuccess.php b/apps/pc_backend/modules/advanced/templates/richTextareaSuccess.php new file mode 100644 index 000000000..c705055ea --- /dev/null +++ b/apps/pc_backend/modules/advanced/templates/richTextareaSuccess.php @@ -0,0 +1,51 @@ + + + + +

    +
    + + +
    +

    + + + + + + + + + + + $button): ?> +isHidden()): ?> + + + + + + + + + +
    ID
    +renderHiddenFields() ?> + +
    + + .sortable", + update: function (event, ui) { + var postData = $(this).sortable("serialize", { expression: /(button)_(.+)/ }); + postData += "&'.urlencode($sortForm->getCSRFFieldName()).'='.urlencode($sortForm->getCSRFToken()).'"; + + $.ajax({ + url: "'.url_for('sns/changeRichTextareaButtonOrder').'", + type: "POST", + data: postData + }); + } +}); +') ?> diff --git a/apps/pc_backend/modules/community/actions/actions.class.php b/apps/pc_backend/modules/community/actions/actions.class.php index 65ea8b76b..fb0ccd610 100644 --- a/apps/pc_backend/modules/community/actions/actions.class.php +++ b/apps/pc_backend/modules/community/actions/actions.class.php @@ -147,17 +147,7 @@ public function executeAddAllMember(sfWebRequest $request) if ($request->isMethod(sfWebRequest::POST)) { $request->checkCSRFProtection(); - $conn = Doctrine::getTable('Member')->getConnection(); - $insertIds = $conn->fetchColumn('SELECT id FROM '.Doctrine::getTable('Member')->getTableName()); - $ids = Doctrine::getTable('CommunityMember')->getMemberIdsByCommunityId($this->community->getId()); - if (count($ids)) - { - $insertIds = array_diff($insertIds, $ids); - } - foreach ($insertIds as $id) - { - Doctrine::getTable('CommunityMember')->join($id, $this->community->getId()); - } + $this->community->joinAllMembers(); $this->getUser()->setFlash('notice', 'All member joined.'); $this->redirect('community/list'); } @@ -213,7 +203,8 @@ public function executeCategoryEdit(sfWebRequest $request) } else { - $this->getUser()->setFlash('error', $form['name']->getError()->getMessage()); + $i18n = $this->getContext()->getI18N(); + $this->getUser()->setFlash('error', $form['name']->renderLabelName().':'.$i18n->__($form['name']->getError()->getMessageFormat(), $form['name']->getError()->getArguments())); } } $this->redirect('community/categoryList'); diff --git a/apps/pc_backend/modules/community/config/view.yml b/apps/pc_backend/modules/community/config/view.yml new file mode 100644 index 000000000..08f900204 --- /dev/null +++ b/apps/pc_backend/modules/community/config/view.yml @@ -0,0 +1,4 @@ +categoryListSuccess: + javascripts: + - jquery.min.js + - jquery-ui.min.js diff --git a/apps/pc_backend/modules/community/templates/_categoryListForm.php b/apps/pc_backend/modules/community/templates/_categoryListForm.php index 12fcc5463..348bf9ac1 100644 --- a/apps/pc_backend/modules/community/templates/_categoryListForm.php +++ b/apps/pc_backend/modules/community/templates/_categoryListForm.php @@ -8,9 +8,9 @@ + - - +
    getForm()->renderGlobalErrors() ?> getForm() as $key => $row) : ?> @@ -35,8 +35,8 @@
    - +
    @@ -62,9 +62,18 @@ - 'tbody', - 'only' => 'sortable', - 'url' => 'community/categorySort', - 'with' => 'Sortable.serialize("type_'.$type.'")+"&'.urlencode($form->getCSRFFieldName()).'='.urlencode($form->getCSRFToken()).'"', -)) ?> + .sortable", + update: function (event, ui) { + var postData = $(this).sortable("serialize", { expression: /(type_'.$type.')_(.+)/ }); + postData += "&'.urlencode($form->getCSRFFieldName()).'='.urlencode($form->getCSRFToken()).'"; + + $.ajax({ + url: "'.url_for('community/categorySort').'", + type: "POST", + data: postData + }); + } +}); +'); ?> diff --git a/apps/pc_backend/modules/community/templates/_communityInfo.php b/apps/pc_backend/modules/community/templates/_communityInfo.php index 1a76f671b..3042aab79 100644 --- a/apps/pc_backend/modules/community/templates/_communityInfo.php +++ b/apps/pc_backend/modules/community/templates/_communityInfo.php @@ -10,7 +10,7 @@ $subAdminCaption .= "
  • ".$m->getName()."
  • \n"; }?> -
    +
    countCommunityMembers() ?> getCreatedAt() ?> diff --git a/apps/pc_backend/modules/community/templates/_submenu.php b/apps/pc_backend/modules/community/templates/_submenu.php old mode 100755 new mode 100644 diff --git a/apps/pc_backend/modules/community/templates/deleteSuccess.php b/apps/pc_backend/modules/community/templates/deleteSuccess.php index 00a4f5cca..3f4ecfe35 100644 --- a/apps/pc_backend/modules/community/templates/deleteSuccess.php +++ b/apps/pc_backend/modules/community/templates/deleteSuccess.php @@ -14,7 +14,7 @@ $community, - 'moreInfo' => array($csrfToken.'') + 'moreInfo' => array($csrfToken.'') )); ?>
    diff --git a/apps/pc_backend/modules/community/templates/listSuccess.php b/apps/pc_backend/modules/community/templates/listSuccess.php index 87b258c25..0312ad610 100644 --- a/apps/pc_backend/modules/community/templates/listSuccess.php +++ b/apps/pc_backend/modules/community/templates/listSuccess.php @@ -15,7 +15,7 @@ getNbResults()): ?> -

    +

    true)) ?>

    diff --git a/apps/pc_backend/modules/default/config/view.yml b/apps/pc_backend/modules/default/config/view.yml index 8beb8a03b..b81991cfa 100644 --- a/apps/pc_backend/modules/default/config/view.yml +++ b/apps/pc_backend/modules/default/config/view.yml @@ -1,5 +1,5 @@ topSuccess: - javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype] + javascripts: [jquery.min.js] templateHelpSuccess: layout: plain diff --git a/apps/pc_backend/modules/default/templates/topSuccess.php b/apps/pc_backend/modules/default/templates/topSuccess.php index cbfcf2688..8424dcca5 100644 --- a/apps/pc_backend/modules/default/templates/topSuccess.php +++ b/apps/pc_backend/modules/default/templates/topSuccess.php @@ -4,8 +4,8 @@ function getVersion(obj) { if (obj) { - var info = document.getElementById("versionInformation"); - new Insertion.Top(info, "

    "+obj.message+"

    "); + var info = $("#versionInformation"); + info.before("

    "+obj.message+"

    "); info.show(); } } @@ -14,8 +14,8 @@ function getDashboard(str) { if (str) { - var dashboard = document.getElementById("dashboard"); - new Insertion.Top(dashboard, str); + var dashboard = $("#dashboard"); + dashboard.before(str); dashboard.show(); } } diff --git a/apps/pc_backend/modules/design/config/view.yml b/apps/pc_backend/modules/design/config/view.yml index a2a16e49f..dd955e1d9 100644 --- a/apps/pc_backend/modules/design/config/view.yml +++ b/apps/pc_backend/modules/design/config/view.yml @@ -1,20 +1,18 @@ gadgetSuccess: javascripts: - - %SF_PROTOTYPE_WEB_DIR%/js/prototype - - %SF_PROTOTYPE_WEB_DIR%/js/builder - - %SF_PROTOTYPE_WEB_DIR%/js/effects + - jquery.min.js gadgetPlotSuccess: layout: plain stylesheets: [-backend, gadgetPlot] - javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype] + javascripts: [jquery.min.js, jquery-ui.min.js] addGadgetSuccess: layout: plain stylesheets: [-backend] - javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype] + javascripts: [jquery.min.js] editGadgetSuccess: layout: plain stylesheets: [-backend] - javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype] + javascripts: [jquery.min.js] diff --git a/apps/pc_backend/modules/design/lib/PickHomeLayoutForm.class.php b/apps/pc_backend/modules/design/lib/PickHomeLayoutForm.class.php index b9feb6530..7a55de2f4 100644 --- a/apps/pc_backend/modules/design/lib/PickHomeLayoutForm.class.php +++ b/apps/pc_backend/modules/design/lib/PickHomeLayoutForm.class.php @@ -48,7 +48,7 @@ public function configure() 'image_prefix' => 'layout_selection_', ))); - $this->setValidator('layout', new sfValidatorChoice(array( + $this->setValidator('layout', new opValidatorChoice(array( 'choices' => array_keys($this->choices), ))); $this->widgetSchema->setNameFormat('pick_home_layout[%s]'); @@ -70,6 +70,8 @@ public function save() $value = $this->choices[$this->values['layout']]; $snsConfig->setValue($value); - return (bool)$snsConfig->save(); + $snsConfig->save(); + + return true; } } diff --git a/apps/pc_backend/modules/design/templates/_plotGadget.php b/apps/pc_backend/modules/design/templates/_plotGadget.php index e8883d598..8147b2903 100644 --- a/apps/pc_backend/modules/design/templates/_plotGadget.php +++ b/apps/pc_backend/modules/design/templates/_plotGadget.php @@ -12,8 +12,16 @@ - 'sortable', - 'tag' => 'div', - 'onUpdate' => 'function(s){insertHiddenTags(\''.$type.'\', Sortable.sequence(s, s.id))}', -)) ?> + div.sortable", + update: function(event,ui){ + var item_ids = ui.item.parent().sortable("toArray"); + item_ids = $.map(item_ids, function (val) { + return val.replace(/^.+_(\d+)$/, "$1"); + }); + + insertHiddenTags("'.$type.'", item_ids); + } +}); +') ?> diff --git a/apps/pc_backend/modules/design/templates/_plotHeader.php b/apps/pc_backend/modules/design/templates/_plotHeader.php index b2ac84a6e..03ccf5032 100644 --- a/apps/pc_backend/modules/design/templates/_plotHeader.php +++ b/apps/pc_backend/modules/design/templates/_plotHeader.php @@ -3,28 +3,25 @@ ".__('削除').")'; - new Insertion.Before(target, contents); + $(contents).insertBefore(target); - var form = parent.document.getElementById('gadgetForm'); + var form = $('#gadgetForm', parent.document); var hidden = parent.document.createElement('input'); hidden.setAttribute('class', type + 'New'); hidden.setAttribute('type', 'hidden'); hidden.setAttribute('name', 'new[' + type + '][]'); hidden.setAttribute('value', id); - new Insertion.Bottom(form, hidden); + $(hidden).appendTo(form); parentIframe.contentWindow.parent.adjustByIframeContens(parentIframe); } diff --git a/apps/pc_backend/modules/design/templates/editGadgetSuccess.php b/apps/pc_backend/modules/design/templates/editGadgetSuccess.php index d3138cdd7..9ed61b949 100644 --- a/apps/pc_backend/modules/design/templates/editGadgetSuccess.php +++ b/apps/pc_backend/modules/design/templates/editGadgetSuccess.php @@ -28,18 +28,16 @@ function deleteGadget(type, id) var parentIframe = parent.document.getElementsByTagName('iframe')[0]; var typeId = 'plot' + type.charAt(0).toUpperCase() + type.substr(1, type.length - 1); - Element.remove(parentIframe.contentWindow.document.getElementById(typeId + '_gadget_' + id)); + $('#' + typeId + '_gadget_' + id, parentIframe.contentWindow.document).remove(); var form = parent.document.getElementById('gadgetForm'); - var hiddens = Element.select(form, '.' + type + 'Gadget'); - for (var i = 0; i < hiddens.length; i++) - { - if (hiddens[i].value == id) + $('.' + type + 'Gadget', form).each(function(){ + if (this.value == id) { - Element.remove(hiddens[i]); - break; + $(this).remove(); + return false; } - } + }); parentIframe.contentWindow.parent.adjustByIframeContens(parentIframe); parent.document.getElementById('modal').onclick(); diff --git a/apps/pc_backend/modules/design/templates/gadgetSuccess.php b/apps/pc_backend/modules/design/templates/gadgetSuccess.php index 8b1f3ae2f..3b45d6422 100644 --- a/apps/pc_backend/modules/design/templates/gadgetSuccess.php +++ b/apps/pc_backend/modules/design/templates/gadgetSuccess.php @@ -33,7 +33,7 @@ redirect('@mail_config'); } - $this->getUser()->setFlash('error', (string)$this->form->getErrorSchema(), false); } } @@ -66,7 +65,6 @@ public function executeTemplate(sfWebRequest $request) $this->getUser()->setFlash('notice', 'Saved.'); $this->redirect('@mail_template_specified?name='.$this->name); } - $this->getUser()->setFlash('error', (string)$this->form->getErrorSchema(), false); } } diff --git a/apps/pc_backend/modules/mail/lib/opMailNotificationForm.class.php b/apps/pc_backend/modules/mail/lib/opMailNotificationForm.class.php index 08e6eac2d..7d1709b95 100644 --- a/apps/pc_backend/modules/mail/lib/opMailNotificationForm.class.php +++ b/apps/pc_backend/modules/mail/lib/opMailNotificationForm.class.php @@ -32,7 +32,7 @@ public function configure() } $this->setWidget($fieldName, new sfWidgetFormChoice(array('choices' => $choices, 'expanded' => true))); - $this->setValidator($fieldName, new sfValidatorChoice(array('choices' => array_keys($choices)))); + $this->setValidator($fieldName, new opValidatorChoice(array('choices' => array_keys($choices)))); $this->setDefault($fieldName, !in_array($fieldName, $disabledList)); $this->widgetSchema->setLabel($fieldName, $v['caption']); } diff --git a/apps/pc_backend/modules/mail/templates/configSuccess.php b/apps/pc_backend/modules/mail/templates/configSuccess.php index 87205b99b..a0b44ce26 100644 --- a/apps/pc_backend/modules/mail/templates/configSuccess.php +++ b/apps/pc_backend/modules/mail/templates/configSuccess.php @@ -5,6 +5,7 @@

    renderFormTag(url_for('@mail_config')); ?> +renderGlobalErrors() ?> renderHiddenFields(); ?> $mails): ?> diff --git a/apps/pc_backend/modules/mail/templates/templateSuccess.php b/apps/pc_backend/modules/mail/templates/templateSuccess.php index 4ee34dd68..3dec25c32 100644 --- a/apps/pc_backend/modules/mail/templates/templateSuccess.php +++ b/apps/pc_backend/modules/mail/templates/templateSuccess.php @@ -70,10 +70,14 @@

    renderFormTag(url_for('@mail_template_specified?name='.$name), array('method' => 'post')); ?> +renderGlobalErrors() ?> renderHiddenFields(); ?> -renderLabel() ?> render(array('class' => 'title')) ?> +renderLabel() ?> +renderError() ?> +render(array('class' => 'title')) ?> +renderError() ?> render(array('rows' => 30, 'cols' => 72)) ?> diff --git a/apps/pc_backend/modules/member/actions/actions.class.php b/apps/pc_backend/modules/member/actions/actions.class.php index aacd98209..805f24a58 100644 --- a/apps/pc_backend/modules/member/actions/actions.class.php +++ b/apps/pc_backend/modules/member/actions/actions.class.php @@ -36,8 +36,8 @@ public function executeList(sfWebRequest $request) { $params = $request->getParameter('member', array()); - $this->form = new opMemberProfileSearchForm(array(), array('use_id' => true, 'is_check_public_flag' => false)); - $this->form->getWidgetSchema()->setLabel('name', 'Nickname'); + $this->form = new opMemberProfileSearchForm(array(), array('is_use_id' => true, 'is_check_public_flag' => false)); + $this->form->getWidgetSchema()->setLabel('name', '%Nickname%'); $this->form->bind($params); $this->pager = new sfDoctrinePager('Member', 20); diff --git a/apps/pc_backend/modules/member/lib/AdminInviteForm.class.php b/apps/pc_backend/modules/member/lib/AdminInviteForm.class.php index 4eda478dd..d097d1b03 100644 --- a/apps/pc_backend/modules/member/lib/AdminInviteForm.class.php +++ b/apps/pc_backend/modules/member/lib/AdminInviteForm.class.php @@ -21,7 +21,7 @@ public function configure() { $choice = $this->getOption('authModes', array()); $this->setWidget('auth_mode', new sfWidgetFormChoice(array('choices' => $choice))); - $this->setValidator('auth_mode', new sfValidatorChoice(array('choices' => array_keys($choice)))); + $this->setValidator('auth_mode', new opValidatorChoice(array('choices' => array_keys($choice)))); $this->setWidget('mail_address', new sfWidgetFormTextarea()); $this->setValidator('mail_address', new sfValidatorPass()); @@ -71,26 +71,33 @@ public function save() $authMode = $authModes[$this->getValue('auth_mode')]; $this->setOption('authMode', $authMode); + $memberConfigTable = Doctrine::getTable('MemberConfig'); foreach ($this->getValue('pc') as $value) { - if (!$this->validateAddress('pc_address', $value)) + if ($this->validateAddress('pc_address', $value)) { - $this->member = Doctrine::getTable('Member')->createPre(); + if (!$memberConfigTable->retrieveByNameAndValue('pc_address_pre', $value)) + { + $this->member = Doctrine::getTable('Member')->createPre(); + } + $this->saveConfig('pc_address', $value); + $this->member->setConfig('register_auth_mode', $authMode); + $this->member->setConfig('is_admin_invited', true); } - $this->saveConfig('pc_address', $value); - $this->member->setConfig('register_auth_mode', $authMode); - $this->member->setConfig('is_admin_invited', true); } foreach ($this->getValue('mobile') as $value) { - if (!$this->validateAddress('mobile_address', $value)) + if ($this->validateAddress('mobile_address', $value)) { - $this->member = Doctrine::getTable('Member')->createPre(); + if (!$memberConfigTable->retrieveByNameAndValue('mobile_address_pre', $value)) + { + $this->member = Doctrine::getTable('Member')->createPre(); + } + $this->saveConfig('mobile_address', $value); + $this->member->setConfig('register_auth_mode', $authMode); + $this->member->setConfig('is_admin_invited', true); } - $this->saveConfig('mobile_address', $value); - $this->member->setConfig('register_auth_mode', $authMode); - $this->member->setConfig('is_admin_invited', true); } return true; diff --git a/apps/pc_backend/modules/member/templates/deleteSuccess.php b/apps/pc_backend/modules/member/templates/deleteSuccess.php index e62013793..e5844ec3b 100644 --- a/apps/pc_backend/modules/member/templates/deleteSuccess.php +++ b/apps/pc_backend/modules/member/templates/deleteSuccess.php @@ -13,12 +13,18 @@ getId() ?> -getName() ?> +getName() ?> getProfiles() as $profile): ?> +getProfile(); ?> +isPreset()): ?> +getPresetConfig(); ?> + + getCaption() ?> -getProfile($profile->getName()) ?> + +getProfile($profile->getName())) ?> diff --git a/apps/pc_backend/modules/member/templates/listSuccess.php b/apps/pc_backend/modules/member/templates/listSuccess.php index d310df1fd..67f48fabf 100644 --- a/apps/pc_backend/modules/member/templates/listSuccess.php +++ b/apps/pc_backend/modules/member/templates/listSuccess.php @@ -40,7 +40,7 @@ - + diff --git a/apps/pc_backend/modules/member/templates/rejectSuccess.php b/apps/pc_backend/modules/member/templates/rejectSuccess.php index d50ce617e..68254df8f 100644 --- a/apps/pc_backend/modules/member/templates/rejectSuccess.php +++ b/apps/pc_backend/modules/member/templates/rejectSuccess.php @@ -15,7 +15,7 @@ getId() ?> -getName() ?> +getName() ?> diff --git a/apps/pc_backend/modules/monitoring/templates/_imageInfo.php b/apps/pc_backend/modules/monitoring/templates/_imageInfo.php index 2e4af7740..37d1913ad 100644 --- a/apps/pc_backend/modules/monitoring/templates/_imageInfo.php +++ b/apps/pc_backend/modules/monitoring/templates/_imageInfo.php @@ -2,7 +2,7 @@
    getCreatedAt() ?>
    -
    getName(), $options = array('size' => '120x120')) ?>
    +
    '120x120')) ?>
    getName() ?>
    diff --git a/apps/pc_backend/modules/monitoring/templates/editImageSuccess.php b/apps/pc_backend/modules/monitoring/templates/editImageSuccess.php index 98298bbd8..b39613f10 100644 --- a/apps/pc_backend/modules/monitoring/templates/editImageSuccess.php +++ b/apps/pc_backend/modules/monitoring/templates/editImageSuccess.php @@ -13,7 +13,7 @@ - + diff --git a/apps/pc_backend/modules/navigation/config/view.yml b/apps/pc_backend/modules/navigation/config/view.yml new file mode 100644 index 000000000..b979df85c --- /dev/null +++ b/apps/pc_backend/modules/navigation/config/view.yml @@ -0,0 +1,4 @@ +listSuccess: + javascripts: + - jquery.min.js + - jquery-ui.min.js diff --git a/apps/pc_backend/modules/navigation/templates/_submenu.php b/apps/pc_backend/modules/navigation/templates/_submenu.php index 4df980c37..8ce00688f 100644 --- a/apps/pc_backend/modules/navigation/templates/_submenu.php +++ b/apps/pc_backend/modules/navigation/templates/_submenu.php @@ -1,3 +1,4 @@
  • +
  • diff --git a/apps/pc_backend/modules/navigation/templates/listSuccess.php b/apps/pc_backend/modules/navigation/templates/listSuccess.php index 780d186c9..4e6d40d8e 100644 --- a/apps/pc_backend/modules/navigation/templates/listSuccess.php +++ b/apps/pc_backend/modules/navigation/templates/listSuccess.php @@ -18,9 +18,9 @@ + -isNew()) : ?> class="sortable"> - +isNew()) : ?> class="sortable">
    renderHiddenFields() ?> @@ -47,15 +47,24 @@ - + - 'tbody', - 'only' => 'sortable', - 'url' => 'navigation/sort', - 'with' => 'Sortable.serialize("type_'.str_replace(' ', '_', $type).'")+"&'.urlencode($sortForm->getCSRFFieldName()).'='.urlencode($sortForm->getCSRFToken()).'"', -)) ?> + .sortable", + update: function (event, ui) { + var postData = $(this).sortable("serialize", { expression: /(type_'.str_replace(' ', '_', $type).')_(.+)/ }); + postData += "&'.urlencode($sortForm->getCSRFFieldName()).'='.urlencode($sortForm->getCSRFToken()).'"; + + $.ajax({ + url: "'.url_for('navigation/sort').'", + type: "POST", + data: postData + }); + } +}); +') ?> diff --git a/apps/pc_backend/modules/plugin/lib/PluginActivationForm.class.php b/apps/pc_backend/modules/plugin/lib/PluginActivationForm.class.php index c651c9347..b09035990 100644 --- a/apps/pc_backend/modules/plugin/lib/PluginActivationForm.class.php +++ b/apps/pc_backend/modules/plugin/lib/PluginActivationForm.class.php @@ -63,7 +63,7 @@ public function configure() } $this->setWidget($this->pluginFieldKey, new sfWidgetFormChoice($widgetOptions)); - $this->setValidator($this->pluginFieldKey, new sfValidatorChoice($validatorOptions, $validatorMessages)); + $this->setValidator($this->pluginFieldKey, new opValidatorChoice($validatorOptions, $validatorMessages)); $this->setDefault($this->pluginFieldKey, $pluginDefault); $this->widgetSchema->setNameFormat('plugin_activation[%s]'); diff --git a/apps/pc_backend/modules/plugin/templates/listSuccess.php b/apps/pc_backend/modules/plugin/templates/listSuccess.php index c5dd0ec63..729d63f5e 100644 --- a/apps/pc_backend/modules/plugin/templates/listSuccess.php +++ b/apps/pc_backend/modules/plugin/templates/listSuccess.php @@ -37,8 +37,21 @@
    -

    - -

    -

    -

    +
    +

    +

    +

    +
      +
    • +
    • +
    • +
    • +
    +

    +
    + +
    +

    +

    +

    +
    diff --git a/apps/pc_backend/modules/profile/config/view.yml b/apps/pc_backend/modules/profile/config/view.yml index 306c4135a..84afedbaa 100644 --- a/apps/pc_backend/modules/profile/config/view.yml +++ b/apps/pc_backend/modules/profile/config/view.yml @@ -1,2 +1,5 @@ editSuccess: javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype] + +listSuccess: + javascripts: [jquery.min.js, jquery-ui.min.js] diff --git a/apps/pc_backend/modules/profile/templates/deleteSuccess.php b/apps/pc_backend/modules/profile/templates/deleteSuccess.php index 529a26d2d..7e1a5d41c 100644 --- a/apps/pc_backend/modules/profile/templates/deleteSuccess.php +++ b/apps/pc_backend/modules/profile/templates/deleteSuccess.php @@ -1,6 +1,6 @@

    -

    +

    diff --git a/apps/pc_backend/modules/profile/templates/listSuccess.php b/apps/pc_backend/modules/profile/templates/listSuccess.php index b637f7f9a..880800069 100644 --- a/apps/pc_backend/modules/profile/templates/listSuccess.php +++ b/apps/pc_backend/modules/profile/templates/listSuccess.php @@ -19,9 +19,9 @@ + - - + getId()) ?> getId()) ?> getId() ?> @@ -48,14 +48,24 @@ getIsDispConfig() ? '○' :'×') ?> getIsDispSearch() ? '○' : '') ?> - + - 'tbody', - 'url' => 'profile/sortProfile', - 'with' => 'Sortable.serialize("profiles")+"&'.urlencode($tokenForm->getCSRFFieldName()).'='.urlencode($tokenForm->getCSRFToken()).'"' -)) ?> + .sortable", + update: function (event, ui) { + var postData = $(this).sortable("serialize", { key: "profiles[]", expression: /profile_(.+)/ }); + postData += "&'.urlencode($tokenForm->getCSRFFieldName()).'='.urlencode($tokenForm->getCSRFToken()).'"; + + $.ajax({ + url: "'.url_for('profile/sortProfile').'", + type: "POST", + data: postData + }); + } +}); +') ?>

    @@ -72,11 +82,12 @@ + getId()] as $form) : ?> getObject()->isNew()) : ?> - + - + @@ -109,15 +120,24 @@
    - + -getId(),array( - 'tag' => 'tbody', - 'only' => 'sortable', - 'url' => 'profile/sortProfileOption', - 'with' => 'Sortable.serialize("profile_options_'.$value->getId().'")+"&'.urlencode($tokenForm->getCSRFFieldName()).'='.urlencode($tokenForm->getCSRFToken()).'"' -)) ?> +getId().' tbody").sortable({ + items: "> .sortable", + update: function (event, ui) { + var postData = $(this).sortable("serialize", { expression: /(profile_options_'.$value->getId().')_(.+)/ }); + postData += "&'.urlencode($tokenForm->getCSRFFieldName()).'='.urlencode($tokenForm->getCSRFToken()).'"; + + $.ajax({ + url: "'.url_for('profile/sortProfileOption').'", + type: "POST", + data: postData + }); + } +}); +') ?> diff --git a/apps/pc_backend/modules/sns/actions/actions.class.php b/apps/pc_backend/modules/sns/actions/actions.class.php index 13562c774..e4c6bafde 100644 --- a/apps/pc_backend/modules/sns/actions/actions.class.php +++ b/apps/pc_backend/modules/sns/actions/actions.class.php @@ -112,34 +112,4 @@ public function executeCache(sfWebRequest $request) $this->redirect('sns/cache'); } } - - public function executeRichTextarea(sfWebRequest $request) - { - $this->sortForm = new BaseForm(); - $this->configForm = new opRichTextareaOpenPNEConfigForm(); - $this->buttonConfigForm = new opRichTextareaOpenPNEButtonConfigForm(); - $this->buttonConfig = opWidgetFormRichTextareaOpenPNE::getAllButtons(); - if ($request->isMethod(sfWebRequest::POST)) - { - $this->configForm->bind($request->getParameter('config')); - $this->buttonConfigForm->bind($request->getParameter('button')); - if ($this->configForm->isValid() && $this->buttonConfigForm->isValid()) - { - $this->configForm->save(); - $this->buttonConfigForm->save(); - } - } - } - - public function executeChangeRichTextareaButtonOrder(sfWebRequest $request) - { - if ($request->isXmlHttpRequest()) - { - $request->checkCSRFProtection(); - - $buttons = $request->getParameter('button'); - Doctrine::getTable('SnsConfig')->set('richtextarea_buttons_sort_order', serialize($buttons)); - } - return sfView::NONE; - } } diff --git a/apps/pc_backend/modules/sns/config/view.yml b/apps/pc_backend/modules/sns/config/view.yml new file mode 100644 index 000000000..f567e9d48 --- /dev/null +++ b/apps/pc_backend/modules/sns/config/view.yml @@ -0,0 +1,4 @@ +richTextareaSuccess: + javascripts: + - jquery.min.js + - jquery-ui.min.js diff --git a/apps/pc_backend/modules/sns/templates/_submenu.php b/apps/pc_backend/modules/sns/templates/_submenu.php index 42d9164f0..c3e2594c3 100644 --- a/apps/pc_backend/modules/sns/templates/_submenu.php +++ b/apps/pc_backend/modules/sns/templates/_submenu.php @@ -1,7 +1,7 @@ $configs) :?>
  • -
  • diff --git a/apps/pc_backend/modules/sns/templates/richTextareaSuccess.php b/apps/pc_backend/modules/sns/templates/richTextareaSuccess.php deleted file mode 100644 index fcd91d2aa..000000000 --- a/apps/pc_backend/modules/sns/templates/richTextareaSuccess.php +++ /dev/null @@ -1,43 +0,0 @@ - - - - -

    -
    - - -
    -

    - - - - - - - - - - $button): ?> -isHidden()): ?> - - - - - - - - - - -
    ID
    -renderHiddenFields() ?> - -
    - - 'tbody', - 'only' => 'sortable', - 'format' => '/^button_(.*)$/', - 'url' => 'sns/changeRichTextareaButtonOrder', - 'with' => 'Sortable.serialize("button")+"&'.urlencode($sortForm->getCSRFFieldName()).'='.urlencode($sortForm->getCSRFToken()).'"', -)) ?> diff --git a/apps/pc_frontend/config/factories.yml b/apps/pc_frontend/config/factories.yml index 3a2758cc5..9501123c3 100644 --- a/apps/pc_frontend/config/factories.yml +++ b/apps/pc_frontend/config/factories.yml @@ -15,7 +15,7 @@ cli: test: response: - class: sfWebResponse + class: opWebResponse param: send_http_headers: false diff --git a/apps/pc_frontend/config/filters.yml b/apps/pc_frontend/config/filters.yml index b202269a3..c44ddcea1 100644 --- a/apps/pc_frontend/config/filters.yml +++ b/apps/pc_frontend/config/filters.yml @@ -9,9 +9,6 @@ enable_app: xrds_header: class: opAppendXRDSHeaderFilter -remember_login: - class: opRememberLoginFilter - security: ~ emoji: diff --git a/apps/pc_frontend/config/routing.yml b/apps/pc_frontend/config/routing.yml index 88d0f07ad..f87514b83 100644 --- a/apps/pc_frontend/config/routing.yml +++ b/apps/pc_frontend/config/routing.yml @@ -58,6 +58,10 @@ member_config_image: url: /member/image/config param: { module: member, action: configImage } +member_config_jsonapi: + url: /member/config/jsonapi + param: { module: member, action: configJsonApi } + member_config: url: /member/config param: { module: member, action: config } diff --git a/apps/pc_frontend/config/view.yml b/apps/pc_frontend/config/view.yml index 2a98916c7..86198fc3b 100644 --- a/apps/pc_frontend/config/view.yml +++ b/apps/pc_frontend/config/view.yml @@ -11,7 +11,7 @@ default: stylesheets: [] - javascripts: [] + javascripts: ['util.js'] has_layout: true layout: layoutC diff --git a/apps/pc_frontend/i18n/api.ja.xml b/apps/pc_frontend/i18n/api.ja.xml index cc250bf45..baa491225 100644 --- a/apps/pc_frontend/i18n/api.ja.xml +++ b/apps/pc_frontend/i18n/api.ja.xml @@ -60,7 +60,7 @@ The form submission cannot be processed. It probably means that you have uploaded a file that is too big. - 送信に失敗しました。 + フォームの送信に失敗しました。アップロードしたファイルが大きすぎる可能性があります。 "%value%" is not an integer. diff --git a/apps/pc_frontend/i18n/form_member.ja.xml b/apps/pc_frontend/i18n/form_member.ja.xml index 5278e3c65..95cbf3c86 100644 --- a/apps/pc_frontend/i18n/form_member.ja.xml +++ b/apps/pc_frontend/i18n/form_member.ja.xml @@ -14,6 +14,10 @@ "%value%" is too long (%max_length% characters max). %max_length%文字以内で入力してください。 + + CSRF attack detected. + 前の画面を読み直して、操作をやり直してください。 + diff --git a/apps/pc_frontend/i18n/messages.ja.xml b/apps/pc_frontend/i18n/messages.ja.xml index 620fe6bf6..1661b638a 100644 --- a/apps/pc_frontend/i18n/messages.ja.xml +++ b/apps/pc_frontend/i18n/messages.ja.xml @@ -96,7 +96,7 @@ The administrator doesn't leave the %community%. - 管理者は退会できません。 + %community%管理者は退会できません。 You haven't joined this %community% yet. @@ -258,6 +258,10 @@ Please select the item that wants to be set from the menu. メニューから設定したい項目を選択してください。 + + There is no available settings. + 利用可能な設定はありません。 + Edit profile プロフィール変更 @@ -274,26 +278,6 @@ Public Flag for Profile Page プロフィールページの公開範囲 - - All Users on the Web - Web全体に公開 - - - All Members - 全員に公開 - - - %my_friend% - %my_friend%まで公開 - - - Only Open to %my_friend% - %my_friend%まで公開 - - - Private - 公開しない - Invite a friend to %1% 友人を%1%に招待する @@ -318,6 +302,10 @@ %friend% List %friend%リスト + + %1%'s %friend% List + %1%さんの%friend%リスト + Other members look your page like this. ※他のメンバーから見たあなたのページはこのようになります。 @@ -334,6 +322,10 @@ It is necessary to register the mobile-phone information to entry in %1%. %1%に参加するには、携帯電話の登録が必要です。 + + Please note that you cannot use smartphones. + スマートフォンからは登録することができませんのでご注意ください。 + Register the mobile-phone 携帯電話の登録 @@ -378,6 +370,10 @@ Delete 削除 + + More + もっと見る + You can upload 3 photos. 写真は最大3枚までアップロードできます。 @@ -590,14 +586,6 @@ Remove the current photo この写真を削除する - - Everyone can see - Web全体に公開 - - - Only SNS members can see - SNS参加者のみ公開 - Everyone can join 誰でも参加可能 @@ -717,7 +705,7 @@ The form submission cannot be processed. It probably means that you have uploaded a file that is too big. - 送信に失敗しました。 + フォームの送信に失敗しました。アップロードしたファイルが大きすぎる可能性があります。 "%value%" is not an integer. @@ -1335,6 +1323,74 @@ Unknown Day 日付非設定 + + JSON API Configuration + JSON API 設定 + + + API Key + APIキー + + + You can provide this API key to third party applications. + APIキーはサードパーティアプリに設定することができます。 + + + Reset API key + APIキーをリセットする + + + Back to %member% profile page + %member% さんのページに戻る + + + Back to %community% top page + %community% トップに戻る + + + View this page on smartphone style + スマートフォン表示に切り替え + + + View this page on regular style + PC表示に切り替え + + + Post + 投稿する + + + What are you doing now? + 今なにしてる? + + + %Friend% link request + %Friend%申請 + + + Do you accept %friend% link request? + %friend%申請を許可しますか? + + + Notification Center + 通知センター + + + There is no new notification. + 新しい通知はありません + + + Reset + リセット + + + %Community% does not exist. + %Community%がありません。 + + + Private<br />Member + 非公開<br />メンバー + diff --git a/apps/pc_frontend/i18n/publicFlags.ja.xml b/apps/pc_frontend/i18n/publicFlags.ja.xml new file mode 100644 index 000000000..0fc2f7aa9 --- /dev/null +++ b/apps/pc_frontend/i18n/publicFlags.ja.xml @@ -0,0 +1,23 @@ + + + + + + All Users on the Web + Web全体に公開 + + + All Members + 全員に公開 + + + %my_friend% + %my_friend%まで公開 + + + Private + 公開しない + + + + diff --git a/apps/pc_frontend/modules/community/actions/actions.class.php b/apps/pc_frontend/modules/community/actions/actions.class.php index 0d14672dc..47ef61222 100644 --- a/apps/pc_frontend/modules/community/actions/actions.class.php +++ b/apps/pc_frontend/modules/community/actions/actions.class.php @@ -17,14 +17,45 @@ */ class communityActions extends opCommunityAction { + /** + * Executes home action + * + * @param opWebRequest $request A request object + */ + public function executeHome(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'community', 'smtHome'); + + return parent::executeHome($request); + } + + /** + * Executes smtHome action + * + * @param opWebRequest $request A request object + */ + public function executeSmtHome(opWebRequest $request) + { + $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('smartphoneCommunity'); + $this->contentsGadgets = $gadgets['smartphoneCommunityContents']; + + $this->community = Doctrine::getTable('Community')->find($this->id); + $this->forward404Unless($this->community); + + opSmartphoneLayoutUtil::setLayoutParameters(array('community' => $this->community)); + + return sfView::SUCCESS; + } + /** * Executes edit action * - * @param sfRequest $request A request object + * @param opWebRequest $request A request object */ - public function executeEdit($request) + public function executeEdit(opWebRequest $request) { - $this->enableImage = true; + $this->forwardIf($request->isSmartphone(), 'community', 'smtEdit'); + $result = parent::executeEdit($request); if ($this->community->isNew()) { @@ -32,16 +63,65 @@ public function executeEdit($request) } + return $result; + } + + /** + * Executes smtEdit action + * + * @param opWebRequest $request A request object + */ + public function executeSmtEdit(opWebRequest $request) + { + $result = parent::executeEdit($request); + + if ($this->community->isNew()) + { + $this->setLayout('smtLayoutHome'); + } + else + { + opSmartphoneLayoutUtil::setLayoutParameters(array('community' => $this->community)); + } + + return $result; + } + + /** + * Executes memberList action + * + * @param opWebRequest $request A request object + */ + public function executeMemberList(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'community', 'smtMemberList'); + + return parent::executeMemberList($request); + } + + /** + * Executes smtMemberList action + * + * @param opWebRequest $request A request object + */ + public function executeSmtMemberList(opWebRequest $request) + { + $result = parent::executeMemberList($request); + + opSmartphoneLayoutUtil::setLayoutParameters(array('community' => $this->community)); + return $result; } /** * Executes joinlist action * - * @param sfRequest $request A request object + * @param opWebRequest $request A request object */ - public function executeJoinlist($request) + public function executeJoinlist(opWebRequest $request) { + $this->forwardIf($request->isSmartphone(), 'community', 'smtJoinlist'); + sfConfig::set('sf_nav_type', 'default'); if ($request->hasParameter('id') && $request->getParameter('id') != $this->getUser()->getMemberId()) @@ -51,4 +131,101 @@ public function executeJoinlist($request) return parent::executeJoinlist($request); } + + /** + * Executes smtJoinlist action + * + * @param opWebRequest $request A request object + */ + public function executeSmtJoinlist(opWebRequest $request) + { + $result = parent::executeJoinlist($request); + + if ($request['id'] && $request['id'] !== $this->getUser()->getMemberId()) + { + $this->targetMember = Doctrine::getTable('Member')->find((int)$request['id']); + } + else + { + $this->targetMember = $this->getUser()->getMember(); + } + + opSmartphoneLayoutUtil::setLayoutParameters(array('member' => $this->member)); + + return $result; + } + + /** + * Executes join action + * + * @param opWebRequest $request A request object + */ + public function executeJoin(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'community', 'smtJoin'); + + return parent::executeJoin($request); + } + + /** + * Executes smtJoin action + * + * @param opWebRequest $request A request object + */ + public function executeSmtJoin(opWebRequest $request) + { + $result = parent::executeJoin($request); + + opSmartphoneLayoutUtil::setLayoutParameters(array('community' => $this->community)); + + return $result; + } + + /** + * Executes quit action + * + * @param opWebRequest $request A request object + */ + public function executeQuit(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'community', 'smtQuit'); + + return parent::executeQuit($request); + } + + /** + * Executes smtJoin action + * + * @param opWebRequest $request A request object + */ + public function executeSmtQuit(opWebRequest $request) + { + $result = parent::executeQuit($request); + + opSmartphoneLayoutUtil::setLayoutParameters(array('community' => $this->community)); + + return $result; + } + + /** + * Executes search action + * + * @param opWebRequest $request A request object + */ + public function executeSearch(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'community', 'smtSearch'); + + return parent::executeSearch($request); + } + + /** + * Executes smtSearch action + * + * @param opWebRequest $request A request object + */ + public function executeSmtSearch(opWebRequest $request) + { + return sfView::SUCCESS; + } } diff --git a/apps/pc_frontend/modules/community/actions/components.class.php b/apps/pc_frontend/modules/community/actions/components.class.php index 0e798c864..65e138078 100644 --- a/apps/pc_frontend/modules/community/actions/components.class.php +++ b/apps/pc_frontend/modules/community/actions/components.class.php @@ -10,7 +10,7 @@ class communityComponents extends opCommunityComponents { - public function executeJoinListBox($request) + public function executeJoinListBox(opWebRequest $request) { if ($request->hasParameter('id') && $request->getParameter('module') == 'member' && $request->getParameter('action') == 'profile') { @@ -25,4 +25,41 @@ public function executeJoinListBox($request) $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($this->member->getId()); $this->communities = Doctrine::getTable('Community')->retrievesByMemberId($this->member->getId(), $this->row * $this->col, true); } + + public function executeSmtCommunityListBox(opWebRequest $request) + { + $this->id = $request->getParameter('id'); + + $memberId = $this->getUser()->getMemberId(); + $communityMember = Doctrine::getTable('CommunityMember')->retrieveByMemberIdAndCommunityId($memberId, $this->id); + + if ($communityMember) + { + $this->isCommunityMember = !$communityMember->getIsPre(); + $this->isCommunityPreMember = $communityMember->getIsPre(); + + $positions = Doctrine::getTable('CommunityMemberPosition')->getPositionsByMemberIdAndCommunityId($memberId, $this->id); + $this->isAdmin = in_array('admin', $positions); + $this->isSubAdmin = in_array('sub_admin', $positions); + $this->isEditCommunity = $this->isAdmin || $this->isSubAdmin; + } + else + { + $this->isCommunityMember = false; + $this->isCommunityPreMember = false; + $this->isAdmin = false; + $this->isSubAdmin = false; + $this->isEditCommunity = false; + } + + $this->community = Doctrine::getTable('Community')->find($this->id); + $this->communityAdmin = $this->community->getAdminMember(); + $this->communitySubAdmins = $this->community->getSubAdminMembers(); + } + + public function executeSmtCommunityMemberJoinListBox(opWebRequest $request) + { + $this->id = $request->getParameter('id'); + $this->community = Doctrine::getTable('Community')->find($this->id); + } } diff --git a/apps/pc_frontend/modules/community/config/security.yml b/apps/pc_frontend/modules/community/config/security.yml index 4e641023f..d92f54d55 100644 --- a/apps/pc_frontend/modules/community/config/security.yml +++ b/apps/pc_frontend/modules/community/config/security.yml @@ -1,10 +1,3 @@ all: is_secure: true credentials: SNSMember - -home: - is_secure: false - -memberList: - is_secure: false - diff --git a/apps/pc_frontend/modules/community/config/view.yml b/apps/pc_frontend/modules/community/config/view.yml index 309e7b7fd..796c929d4 100644 --- a/apps/pc_frontend/modules/community/config/view.yml +++ b/apps/pc_frontend/modules/community/config/view.yml @@ -1,2 +1,29 @@ homeSuccess: layout: layoutA + +smtHomeSuccess: + layout: smtLayoutGroup + +smtEditSuccess: + layout: smtLayoutGroup + +smtMemberListSuccess: + layout: smtLayoutGroup + +smtJoinlistSuccess: + layout: smtLayoutMember + +smtJoinInput: + layout: smtLayoutGroup + +smtJoinError: + layout: smtLayoutSns + +smtQuitSuccess: + layout: smtLayoutGroup + +smtQuitError: + layout: smtLayoutSns + +smtSearchSuccess: + layout: smtLayoutSns diff --git a/apps/pc_frontend/modules/community/templates/_smtCommunityListBox.php b/apps/pc_frontend/modules/community/templates/_smtCommunityListBox.php new file mode 100644 index 000000000..8569abae2 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/_smtCommunityListBox.php @@ -0,0 +1,119 @@ +
    +
    コミュニティ情報
    +
    +
    +
    +
    + getImageFileName(), array('size' => '320x320', 'format' => 'jpg')) ?> +
    +
    +
    +
    + + + + + + + + + + +getName(), '@member_profile?id='.$m->getId()); +} +?> + + + + + + +community_category_id): ?> + + + + + + + + + + + + + + + + + + + + + +
    getCreatedAt(), 'D') ?>
    getName(), '@member_profile?id='.$communityAdmin->getId()) ?>
    \n", $subAdminCaption) ?>
    $op_term['community']->titleize()), 'form_community') ?>:getCommunityCategory() ?>
    $op_term['community']->titleize()), 'form_community') ?>:getRaw('community')->getRegisterPolicy()) ?>
    countCommunityMembers(); ?>
    $op_term['community']->titleize()), 'form_community') ?>getConfig('description')) ?>
    + + + + + +

    +

    +

    + + + $op_term['community']->titleize())) ?> + + +

    +

    +

    + + + +
    +
    + diff --git a/apps/pc_frontend/modules/community/templates/_smtCommunityMemberJoinListBox.php b/apps/pc_frontend/modules/community/templates/_smtCommunityMemberJoinListBox.php new file mode 100644 index 000000000..a785392c3 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/_smtCommunityMemberJoinListBox.php @@ -0,0 +1,48 @@ + + + + +
    +
    +
    $op_term['community'])) ?>
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    diff --git a/apps/pc_frontend/modules/community/templates/smtEditSuccess.php b/apps/pc_frontend/modules/community/templates/smtEditSuccess.php new file mode 100644 index 000000000..34fb026d2 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtEditSuccess.php @@ -0,0 +1,96 @@ +isNew()): ?> + + +getId()), 'multipart=true') ?> + +
    +isNew()): ?> +
    + +
    + +
    + + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + + +
    +
    +x + +

    + +
    +
    + + +
    + +isHidden()): ?> +
    + +
    + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
    +
    + + +
    + +
    + +isHidden()): ?> +
    + +
    + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
    +
    + + +
    + +
    + +isHidden()): ?> +
    + +
    + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
    +
    + + +
    + +
    +
    + +renderHiddenFields(); ?> +renderHiddenFields(); ?> +renderHiddenFields(); ?> + +
    +
    + +
    diff --git a/apps/pc_frontend/modules/community/templates/smtHomeSuccess.php b/apps/pc_frontend/modules/community/templates/smtHomeSuccess.php new file mode 100644 index 000000000..bf4865b2d --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtHomeSuccess.php @@ -0,0 +1,7 @@ + + +isEnabled()): ?> +getComponentModule(), $gadget->getComponentAction(), array('gadget' => $gadget)); ?> + + + diff --git a/apps/pc_frontend/modules/community/templates/smtJoinError.php b/apps/pc_frontend/modules/community/templates/smtJoinError.php new file mode 100644 index 000000000..4d0d5b033 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtJoinError.php @@ -0,0 +1,17 @@ +
    +
    +
    + +
    + + + + + + + + + + +
    + diff --git a/apps/pc_frontend/modules/community/templates/smtJoinInput.php b/apps/pc_frontend/modules/community/templates/smtJoinInput.php new file mode 100644 index 000000000..f87f579fd --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtJoinInput.php @@ -0,0 +1,29 @@ +
    +
    $community->getName())) ?>
    +
    + +
    +
    getImageFileName(), array('size' => '48x48')), '@community_home?id='.$id) ?>
    +
    getName(), '@community_home?id='.$id) ?>
    +
    +
    + getCurrentUri()); ?> + + isHidden()): ?> +
    + +
    + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
    +
    + + +
    + renderHiddenFields(); ?> + +
    +
    diff --git a/apps/pc_frontend/modules/community/templates/smtJoinlistSuccess.php b/apps/pc_frontend/modules/community/templates/smtJoinlistSuccess.php new file mode 100644 index 000000000..553c21f3d --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtJoinlistSuccess.php @@ -0,0 +1,18 @@ +
    +
    $op_term['community']->titleize())); ?>
    +
    +
    +
    +getResults() as $member ): ?> +
    +
    + op_image_tag_sf_image($member->getImageFileName(), array('size' => '57x57')))) ?> +
    +
    getName(), '@member_profile?id='.$member->getId()); ?>
    +
    + +
    + +
    + $targetMember->getName())), '@member_profile?id='.$targetMember->getId()) ?> +
    diff --git a/apps/pc_frontend/modules/community/templates/smtMemberListSuccess.php b/apps/pc_frontend/modules/community/templates/smtMemberListSuccess.php new file mode 100644 index 000000000..e29ca2f80 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtMemberListSuccess.php @@ -0,0 +1,20 @@ +
    +
    $op_term['community']->titleize())); ?>
    +
    +
    +
    +getResults() as $member ): ?> +
    +
    + op_image_tag_sf_image($member->getImageFileName(), array('size' => '57x57')))) ?> +
    +
    + getName(), '@member_profile?id='.$member->getId()); ?> +
    +
    + +
    + +
    + $community->getName())), '@community_home?id='.$community->getId()) ?> +
    diff --git a/apps/pc_frontend/modules/community/templates/smtQuitError.php b/apps/pc_frontend/modules/community/templates/smtQuitError.php new file mode 100644 index 000000000..bcef67f12 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtQuitError.php @@ -0,0 +1,16 @@ +
    +
    +
    + +
    + + + + + + + + + + +
    diff --git a/apps/pc_frontend/modules/community/templates/smtQuitSuccess.php b/apps/pc_frontend/modules/community/templates/smtQuitSuccess.php new file mode 100644 index 000000000..84e669046 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtQuitSuccess.php @@ -0,0 +1,31 @@ +
    +
    $community->getName())) ?>
    +
    + +
    +
    getImageFileName(), array('size' => '48x48')), '@community_home?id='.$id) ?>
    +
    getName(), '@community_home?id='.$id) ?>
    +
    +
    +
    + getCurrentUri()); ?> + + isHidden()): ?> +
    + +
    + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
    +
    + + + + renderHiddenFields(); ?> + +
    +
    +
    diff --git a/apps/pc_frontend/modules/community/templates/smtSearchSuccess.php b/apps/pc_frontend/modules/community/templates/smtSearchSuccess.php new file mode 100644 index 000000000..7615c00b5 --- /dev/null +++ b/apps/pc_frontend/modules/community/templates/smtSearchSuccess.php @@ -0,0 +1,63 @@ + + + + +
    +
    +
    $op_term['community']->titleize()->pluralize())) ?>
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/apps/pc_frontend/modules/default/actions/components.class.php b/apps/pc_frontend/modules/default/actions/components.class.php index ad7904649..aedf735f5 100644 --- a/apps/pc_frontend/modules/default/actions/components.class.php +++ b/apps/pc_frontend/modules/default/actions/components.class.php @@ -39,6 +39,19 @@ public function executeLocalNav() } } + public function executeSmtMenu() + { + $type = opToolkit::isSecurePage() ? 'smartphone_default' : 'smartphone_insecure'; + + $this->navs = Doctrine::getTable('Navigation')->retrieveByType($type); + } + + public function executeSmartphoneFooterGadgets() + { + $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('smartphoneFooter'); + $this->gadgets = $gadgets['smartphoneFooterContents']; + } + public function executeSideBannerGadgets() { $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('sideBanner'); @@ -89,6 +102,11 @@ public function executeLoginFormBox() $this->forms = $this->getUser()->getAuthForms(); } + public function executeSmtLoginFormBox() + { + $this->forms = $this->getUser()->getAuthForms(); + } + public function executeSideBanner() { } diff --git a/apps/pc_frontend/modules/default/actions/csrfErrorAction.class.php b/apps/pc_frontend/modules/default/actions/csrfErrorAction.class.php index b4b1eaed2..ba767e1b6 100644 --- a/apps/pc_frontend/modules/default/actions/csrfErrorAction.class.php +++ b/apps/pc_frontend/modules/default/actions/csrfErrorAction.class.php @@ -19,5 +19,10 @@ class csrfErrorAction extends sfAction { public function execute($request) { + if ($request->isSmartphone()) + { + $this->setLayout('smtLayoutSns'); + $this->setTemplate('smtCsrf'); + } } } diff --git a/apps/pc_frontend/modules/default/actions/customizingCssAction.class.php b/apps/pc_frontend/modules/default/actions/customizingCssAction.class.php index 9d609612e..0ec33a81b 100644 --- a/apps/pc_frontend/modules/default/actions/customizingCssAction.class.php +++ b/apps/pc_frontend/modules/default/actions/customizingCssAction.class.php @@ -27,7 +27,10 @@ public function execute($request) $filesystem = new sfFilesystem(); $dir = sfConfig::get('sf_web_dir').DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'css'; @$filesystem->mkdirs($dir); - file_put_contents($dir.DIRECTORY_SEPARATOR.'customizing.css', $css); + $filesystem->chmod($dir, 0777); + $cssPath = $dir.DIRECTORY_SEPARATOR.'customizing.css'; + file_put_contents($cssPath, $css); + $filesystem->chmod($cssPath, 0666); return sfView::NONE; } diff --git a/apps/pc_frontend/modules/default/actions/errorAction.class.php b/apps/pc_frontend/modules/default/actions/errorAction.class.php index a2f57c05c..877b15ddd 100644 --- a/apps/pc_frontend/modules/default/actions/errorAction.class.php +++ b/apps/pc_frontend/modules/default/actions/errorAction.class.php @@ -21,9 +21,14 @@ class errorAction extends sfAction /** * Executes error action * - * @param sfRequest $request A request object + * @param opWebRequest $request A request object */ public function execute($request) { + if ($request->isSmartphone()) + { + $this->setLayout('smtLayoutSns'); + $this->setTemplate('smtError'); + } } } diff --git a/apps/pc_frontend/modules/default/actions/privacyPolicyAction.class.php b/apps/pc_frontend/modules/default/actions/privacyPolicyAction.class.php index 5ce714119..173be9ee8 100644 --- a/apps/pc_frontend/modules/default/actions/privacyPolicyAction.class.php +++ b/apps/pc_frontend/modules/default/actions/privacyPolicyAction.class.php @@ -24,5 +24,10 @@ class privacyPolicyAction extends sfAction */ public function execute($request) { + if ($request->isSmartphone()) + { + $this->setLayout('smtLayoutSns'); + $this->setTemplate('smtPrivacyPolicy'); + } } } diff --git a/apps/pc_frontend/modules/default/actions/userAgreementAction.class.php b/apps/pc_frontend/modules/default/actions/userAgreementAction.class.php index 67195a715..5c24b42fe 100644 --- a/apps/pc_frontend/modules/default/actions/userAgreementAction.class.php +++ b/apps/pc_frontend/modules/default/actions/userAgreementAction.class.php @@ -24,5 +24,10 @@ class userAgreementAction extends sfAction */ public function execute($request) { + if ($request->isSmartphone()) + { + $this->setLayout('smtLayoutSns'); + $this->setTemplate('smtUserAgreement'); + } } } diff --git a/apps/pc_frontend/modules/default/templates/_activityRecord.php b/apps/pc_frontend/modules/default/templates/_activityRecord.php index 3ed1a07f4..6974a487a 100644 --- a/apps/pc_frontend/modules/default/templates/_activityRecord.php +++ b/apps/pc_frontend/modules/default/templates/_activityRecord.php @@ -10,11 +10,7 @@ getImages()->count()): ?> getImages() ?> count() && $i < 3;$i++): ?> -getFileId()): ?> -getFile(), array('size' => '48x48')) ?> - -getUri(), array('width' => 48, 'height' => 48)) ?> - + '48x48')) ?>
    @@ -40,7 +36,7 @@ { $operationItems[] = array( 'class' => 'delete', - 'body' => link_to(__('Delete'), 'member/deleteActivity?id='.$activity->getId(), array('title' => __('Delete this activity of %time%', array('%time%' => $time)))), + 'body' => link_to(__('Delete'), 'member/deleteActivity?id='.$activity->getId(), array('title' => __('Delete this %activity% of %time%', array('%time%' => $time)))), ); } } diff --git a/apps/pc_frontend/modules/default/templates/_smartphoneFooterGadgets.php b/apps/pc_frontend/modules/default/templates/_smartphoneFooterGadgets.php new file mode 100644 index 000000000..91ebf6d65 --- /dev/null +++ b/apps/pc_frontend/modules/default/templates/_smartphoneFooterGadgets.php @@ -0,0 +1,7 @@ + + +isEnabled()): ?> +getComponentModule(), $gadget->getComponentAction(), array('gadget' => $gadget)); ?> + + + diff --git a/apps/pc_frontend/modules/default/templates/_smtLoginFormBox.php b/apps/pc_frontend/modules/default/templates/_smtLoginFormBox.php new file mode 100644 index 000000000..022848227 --- /dev/null +++ b/apps/pc_frontend/modules/default/templates/_smtLoginFormBox.php @@ -0,0 +1,70 @@ + + +getAuthMode()))) ?> + + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + + +
    +
    +x + +

    + +
    +
    + + +
    + +isHidden()): ?> +getWidget()->getOption('type')): ?> +
    +
    + renderLabel(); ?> +
    +
    + hasError()): ?> + renderError()); ?> + + render(); ?> + renderHelp(); ?> +
    + +
    +
    + +
    + renderLabel(); ?> +
    +
    + hasError()): ?> + renderError()) ?> + + getWidget()->getOption('type'), array('text', 'password'))): ?> + render(array('class' => 'span12')); ?> + + render(); ?> + + renderHelp(); ?> +
    + + + +
    + +
    +
    + +renderHiddenFields(); ?> + +getAuthAdapter()->getAuthConfig('invite_mode') == 2 + && opToolkit::isEnabledRegistration('pc') + && $form->getAuthAdapter()->getAuthConfig('self_invite_action')) : ?> +getAuthAdapter()->getAuthConfig('self_invite_action')) ?> + +
    + + diff --git a/apps/pc_frontend/modules/default/templates/_smtMenu.php b/apps/pc_frontend/modules/default/templates/_smtMenu.php new file mode 100644 index 000000000..8e205d974 --- /dev/null +++ b/apps/pc_frontend/modules/default/templates/_smtMenu.php @@ -0,0 +1,14 @@ + diff --git a/apps/pc_frontend/modules/default/templates/smtCsrfErrorSuccess.php b/apps/pc_frontend/modules/default/templates/smtCsrfErrorSuccess.php new file mode 100644 index 000000000..6ce90a73d --- /dev/null +++ b/apps/pc_frontend/modules/default/templates/smtCsrfErrorSuccess.php @@ -0,0 +1,9 @@ +
    +

    +
    + + + +
    + +
    diff --git a/apps/pc_frontend/modules/default/templates/smtErrorSuccess.php b/apps/pc_frontend/modules/default/templates/smtErrorSuccess.php new file mode 100644 index 000000000..8337de2f4 --- /dev/null +++ b/apps/pc_frontend/modules/default/templates/smtErrorSuccess.php @@ -0,0 +1,8 @@ +
    +

    +
    + + +
    + +
    diff --git a/apps/pc_frontend/modules/default/templates/smtPrivacyPolicySuccess.php b/apps/pc_frontend/modules/default/templates/smtPrivacyPolicySuccess.php new file mode 100644 index 000000000..405090fad --- /dev/null +++ b/apps/pc_frontend/modules/default/templates/smtPrivacyPolicySuccess.php @@ -0,0 +1,12 @@ +
    +

    +
    + +
    + +
    + + +
    +

    'btn')) ?>

    +
    diff --git a/apps/pc_frontend/modules/default/templates/smtUserAgreementSuccess.php b/apps/pc_frontend/modules/default/templates/smtUserAgreementSuccess.php new file mode 100644 index 000000000..e5050f6df --- /dev/null +++ b/apps/pc_frontend/modules/default/templates/smtUserAgreementSuccess.php @@ -0,0 +1,12 @@ +
    +

    +
    + +
    + +
    + + +
    +

    'btn')) ?>

    +
    diff --git a/apps/pc_frontend/modules/friend/actions/actions.class.php b/apps/pc_frontend/modules/friend/actions/actions.class.php index 5751c03d8..f21aa8acc 100644 --- a/apps/pc_frontend/modules/friend/actions/actions.class.php +++ b/apps/pc_frontend/modules/friend/actions/actions.class.php @@ -27,10 +27,36 @@ public function preExecute() } } - public function executeList(sfWebRequest $request) + public function executeList(opWebRequest $request) { + $this->forwardIf($request->isSmartphone(), 'friend', 'smtList'); + $this->size = 50; return parent::executeList($request); } + + public function executeSmtList(opWebRequest $request) + { + $this->member = Doctrine::getTable('Member')->find($this->id); + opSmartphoneLayoutUtil::setLayoutParameters(array('member' => $this->member)); + + return sfView::SUCCESS; + } + + public function executeLink(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'friend', 'smtLink'); + + return parent::executeLink($request); + } + + public function executeSmtLink(opWebRequest $request) + { + $result = parent::executeLink($request); + + opSmartphoneLayoutUtil::setLayoutParameters(array('member' => $this->member)); + + return $result; + } } diff --git a/apps/pc_frontend/modules/friend/actions/components.class.php b/apps/pc_frontend/modules/friend/actions/components.class.php index 4f172b0d8..aa3147484 100644 --- a/apps/pc_frontend/modules/friend/actions/components.class.php +++ b/apps/pc_frontend/modules/friend/actions/components.class.php @@ -10,7 +10,7 @@ class friendComponents extends opFriendComponents { - public function executeFriendListBox($request) + public function executeFriendListBox(opWebRequest $request) { if ($request->hasParameter('id') && $request->getParameter('module') == 'member' && $request->getParameter('action') == 'profile') { diff --git a/apps/pc_frontend/modules/friend/config/view.yml b/apps/pc_frontend/modules/friend/config/view.yml new file mode 100644 index 000000000..7dcbac29c --- /dev/null +++ b/apps/pc_frontend/modules/friend/config/view.yml @@ -0,0 +1,5 @@ +smtListSuccess: + layout: smtLayoutMember + +smtLinkInput: + layout: smtLayoutSns diff --git a/apps/pc_frontend/modules/friend/templates/_friendListBox.php b/apps/pc_frontend/modules/friend/templates/_friendListBox.php index b183eb31e..c0c7b497c 100644 --- a/apps/pc_frontend/modules/friend/templates/_friendListBox.php +++ b/apps/pc_frontend/modules/friend/templates/_friendListBox.php @@ -3,6 +3,7 @@ 'title' => __('%friend% List', array('%friend%' => $op_term['friend']->titleize())), 'list' => $friends, 'link_to' => '@obj_member_profile?id=', + 'use_op_link_to_member_private' => true, 'use_op_link_to_member' => true, 'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->countFriends()), 'friend/list?id='.$member->getId())), 'type' => $sf_data->getRaw('gadget')->getConfig('type'), diff --git a/apps/pc_frontend/modules/friend/templates/smtLinkInput.php b/apps/pc_frontend/modules/friend/templates/smtLinkInput.php new file mode 100644 index 000000000..0ac503a2a --- /dev/null +++ b/apps/pc_frontend/modules/friend/templates/smtLinkInput.php @@ -0,0 +1,28 @@ +
    +
    $op_term['my_friend']->pluralize())) ?>
    +
    + +
    +
    getImageFileName(), array('size' => '48x48')), '@member_profile?id='.$id) ?>
    +
    getName(), '@member_profile?id='.$id) ?>
    +
    + getCurrentUri()); ?> + + isHidden()): ?> +
    + +
    + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
    +
    + + + + renderHiddenFields(); ?> + +
    +
    diff --git a/apps/pc_frontend/modules/friend/templates/smtListSuccess.php b/apps/pc_frontend/modules/friend/templates/smtListSuccess.php new file mode 100644 index 000000000..da9fc2225 --- /dev/null +++ b/apps/pc_frontend/modules/friend/templates/smtListSuccess.php @@ -0,0 +1,21 @@ + + + +
    +
    $member->getName(), '%friend%' => $op_term['friend']->titleize())); ?>
    +
    +
    +
    + +
    diff --git a/apps/pc_frontend/modules/googlemaps/actions/actions.class.php b/apps/pc_frontend/modules/googlemaps/actions/actions.class.php index 86378c768..e7341efc1 100644 --- a/apps/pc_frontend/modules/googlemaps/actions/actions.class.php +++ b/apps/pc_frontend/modules/googlemaps/actions/actions.class.php @@ -17,15 +17,5 @@ class googlemapsActions extends sfActions */ public function executeIndex(sfWebRequest $request) { - $this->mapType = 'G_NORMAL_MAP'; - switch ($request->getParameter('t')) - { - case 'k': - $this->mapType = 'G_SATELLITE_MAP'; - break; - case 'h': - $this->mapType = 'G_HYBRID_MAP'; - break; - } } } diff --git a/apps/pc_frontend/modules/googlemaps/templates/indexSuccess.php b/apps/pc_frontend/modules/googlemaps/templates/indexSuccess.php index 558334bcb..d833dca61 100644 --- a/apps/pc_frontend/modules/googlemaps/templates/indexSuccess.php +++ b/apps/pc_frontend/modules/googlemaps/templates/indexSuccess.php @@ -4,13 +4,12 @@ -<?php echo ($op_config['sns_title']) ? $op_config['sns_title'] : $op_config['sns_name'] ?> -get('pc_html_head') ?> - - - - + + + - +
    diff --git a/apps/pc_frontend/modules/member/actions/actions.class.php b/apps/pc_frontend/modules/member/actions/actions.class.php index b8d44a485..3edb5101b 100644 --- a/apps/pc_frontend/modules/member/actions/actions.class.php +++ b/apps/pc_frontend/modules/member/actions/actions.class.php @@ -20,10 +20,12 @@ class memberActions extends opMemberAction /** * Executes home action * - * @param sfRequest $request A request object + * @param opWebRequest $request A request object */ - public function executeHome($request) + public function executeHome(opWebRequest $request) { + $this->forwardIf($request->isSmartphone(), 'member', 'smtHome'); + $this->topGadgets = null; $this->sideMenuGadgets = null; @@ -47,44 +49,73 @@ public function executeHome($request) return parent::executeHome($request); } + /** + * Execute smtHome action + * + * @param opWebRequest $request A request object + */ + public function executeSmtHome(opWebRequest $request) + { + $this->gadgetConfig = sfConfig::get('op_smartphone_gadget_list'); + + $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('smartphone'); + $this->contentsGadgets = $gadgets['smartphoneContents']; + + return sfView::SUCCESS; + } + /** * Executes login action * - * @param sfRequest $request A request object + * @param opWevRequest $request A request object */ - public function executeLogin($request) + public function executeLogin(opWebRequest $request) { if (opConfig::get('external_pc_login_url') && $request->isMethod(sfWebRequest::GET)) { $this->redirect(opConfig::get('external_pc_login_url')); } - $this->gadgetConfig = sfConfig::get('op_login_gadget_list'); - $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('login'); - $layout = Doctrine::getTable('SnsConfig')->get('login_layout', 'layoutA'); - $this->setLayout($layout); - - switch($layout) + if ($request->isSmartphone()) { - case 'layoutA' : - $this->topGadgets = $gadgets['loginTop']; - case 'layoutB' : - $this->sideMenuGadgets = $gadgets['loginSideMenu']; + $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('smartphoneLogin'); + $this->contentsGadgets = $gadgets['smartphoneLoginContents']; + + $this->setLayout('smtLayoutSns'); + $this->setTemplate('smtLogin'); } + else + { + $this->gadgetConfig = sfConfig::get('op_login_gadget_list'); + $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('login'); + $layout = Doctrine::getTable('SnsConfig')->get('login_layout', 'layoutA'); + $this->setLayout($layout); - $this->contentsGadgets = $gadgets['loginContents']; - $this->bottomGadgets = $gadgets['loginBottom']; + switch($layout) + { + case 'layoutA' : + $this->topGadgets = $gadgets['loginTop']; + case 'layoutB' : + $this->sideMenuGadgets = $gadgets['loginSideMenu']; + } + + $this->contentsGadgets = $gadgets['loginContents']; + $this->bottomGadgets = $gadgets['loginBottom']; + } return parent::executeLogin($request); } + /** * Executes profile action * - * @param sfRequest $request A request object + * @param opWebRequest $request A request object */ - public function executeProfile($request) + public function executeProfile(opWebRequest $request) { + $this->forwardIf($request->isSmartphone(), 'member', 'smtProfile'); + $id = $request->getParameter('id', $this->getUser()->getMemberId()); if ($id != $this->getUser()->getMemberId()) { @@ -110,13 +141,32 @@ public function executeProfile($request) return parent::executeProfile($request); } + /** + * Executes smtProfile action + * + * @param opWebRequest $request A request object + */ + public function executeSmtProfile(opWebRequest $request) + { + $gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName('smartphoneProfile'); + $this->contentsGadgets = $gadgets['smartphoneProfileContents']; + + $result = parent::executeProfile($request); + + opSmartphoneLayoutUtil::setLayoutParameters(array('member' => $this->member)); + + return $result; + } + /** * Executes configImage action * - * @param sfRequest $request A request object + * @param opWebRequest $request A request object */ - public function executeConfigImage($request) + public function executeConfigImage(opWebRequest $request) { + $this->forwardIf($request->isSmartphone(), 'member', 'smtConfigImage'); + $options = array('member' => $this->getUser()->getMember()); $this->form = new MemberImageForm(array(), $options); @@ -141,14 +191,74 @@ public function executeConfigImage($request) } $this->redirect('@member_config_image'); } + } + /** - * Executes registerMobileToRegisterEnd action + * Executes smtCofigImage action + * + * @param opWebRequest $request A request object + */ + + public function executeSmtConfigImage(opWebRequest $request) + { + $options = array('member' => $this->getUser()->getMember()); + $this->form = new MemberImageForm(array(), $options); + + if ($request->isMethod(sfWebRequest::POST)) + { + try + { + if (!$this->form->bindAndSave($request->getParameter('member_image'), $request->getFiles('member_image'))) + { + $errors = $this->form->getErrorSchema()->getErrors(); + if (isset($errors['file'])) + { + $error = $errors['file']; + $i18n = $this->getContext()->getI18N(); + $this->getUser()->setFlash('error', $i18n->__($error->getMessageFormat(), $error->getArguments())); + } + } + } + catch (opRuntimeException $e) + { + $this->getUser()->setFlash('error', $e->getMessage()); + } + $this->redirect('@member_config_image'); + } + + return parent::executeConfigImage($request); + } + + /** + * Executes configJsonApi action * * @param sfRequest $request A request object */ - public function executeRegisterMobileToRegisterEnd(sfWebRequest $request) + public function executeConfigJsonApi(opWebRequest $request) + { + $this->forward404Unless(opConfig::get('enable_jsonapi')); + + $member = $this->getUser()->getMember(); + + if (isset($request['reset_api_key']) && '1' === $request['reset_api_key']) + { + $request->checkCSRFProtection(); + $member->generateApiKey(); + } + + $this->apiKey = $member->getApiKey(); + + return sfView::SUCCESS; + } + + /** + * Executes registerMobileToRegisterEnd action + * + * @param opWebRequest $request A request object + */ + public function executeRegisterMobileToRegisterEnd(opWebRequest $request) { opActivateBehavior::disable(); $this->form = new registerMobileForm($this->getUser()->getMember()); @@ -166,16 +276,16 @@ public function executeRegisterMobileToRegisterEnd(sfWebRequest $request) return sfView::SUCCESS; } - public function executeRegisterMobileToRegisterEndFinish(sfWebRequest $request) + public function executeRegisterMobileToRegisterEndFinish(opWebRequest $request) { } /** * Executes changeLanguage action * - * @param sfWebRequest $request a request object + * @param opWebRequest $request a request object */ - public function executeChangeLanguage(sfWebRequest $request) + public function executeChangeLanguage(opWebRequest $request) { if ($request->isMethod(sfWebRequest::POST)) { @@ -187,4 +297,95 @@ public function executeChangeLanguage(sfWebRequest $request) } $this->redirect('@homepage'); } + + + /** + * Executes editConfig action + * + * @param opWebRequest $request a request object + */ + public function executeConfig(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'member', 'smtConfig'); + + return parent::executeConfig($request); + } + + /** + * Executes editSmtConfig action + * + * @param opWebRequest $request a request object + */ + public function executeSmtConfig(opWebRequest $request) + { + return parent::executeConfig($request); + } + + /** + * Executes search action + * + * @param opWebRequest $request a request object + */ + public function executeSearch(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'member', 'smtSearch'); + + return parent::executeSearch($request); + } + + /** + * Executes smtSearch action + * + * @param opWebRequest $request a request object + */ + public function executeSmtSearch(opWebRequest $request) + { + return sfView::SUCCESS; + } + + /** + * Executes invite action + * + * @param opWebRequest $request a request object + */ + public function executeInvite(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'member', 'smtInvite'); + + return parent::executeInvite($request); + } + + + /** + * Executes editSmtConfig action + * + * @param opWebRequest $request a request object + */ + public function executeSmtInvite(opWebRequest $request) + { + return parent::executeInvite($request); + } + + + /** + * Executes editProfile action + * + * @param opWebRequest $request a request object + */ + public function executeEditProfile(opWebRequest $request) + { + $this->forwardIf($request->isSmartphone(), 'member', 'smtEditProfile'); + + return parent::executeEditProfile($request); + } + + /** + * Executes smtEditProfile action + * + * @param opWebRequest $request a request object + */ + public function executeSmtEditProfile(opWebRequest $request) + { + return parent::executeEditProfile($request); + } } diff --git a/apps/pc_frontend/modules/member/actions/components.class.php b/apps/pc_frontend/modules/member/actions/components.class.php index efb28a78c..456d1d548 100644 --- a/apps/pc_frontend/modules/member/actions/components.class.php +++ b/apps/pc_frontend/modules/member/actions/components.class.php @@ -10,7 +10,7 @@ class memberComponents extends opMemberComponents { - public function executeProfileListBox($request) + public function executeProfileListBox(opWebRequest $request) { if ($request->hasParameter('id')) { @@ -21,4 +21,41 @@ public function executeProfileListBox($request) $this->member = $this->getUser()->getMember(); } } + + public function executeSmtProfileListBox(opWebRequest $request) + { + if ($request->hasParameter('id')) + { + $this->member = Doctrine::getTable('Member')->find($request->getParameter('id')); + } + else + { + $this->member = $this->getUser()->getMember(); + } + } + + public function executeSmtMemberFriendListBox(opWebRequest $request) + { + if ($request->hasParameter('id') && 'profile' !== sfContext::getInstance()->getActionName()) + { + $this->member = Doctrine::getTable('Member')->find($request->getParameter('id')); + } + else + { + $this->member = $this->getUser()->getMember(); + } + } + + public function executeSmtMemberJoinCommunityListBox(opWebRequest $request) + { + if ($request->hasParameter('id') && 'profile' !== sfContext::getInstance()->getActionName()) + { + $this->member = Doctrine::getTable('Member')->find($request->getParameter('id')); + } + else + { + $this->member = $this->getUser()->getMember(); + } + } + } diff --git a/apps/pc_frontend/modules/member/config/security.yml b/apps/pc_frontend/modules/member/config/security.yml index cef7fb037..519074fcb 100644 --- a/apps/pc_frontend/modules/member/config/security.yml +++ b/apps/pc_frontend/modules/member/config/security.yml @@ -22,3 +22,6 @@ registerMobileToRegisterEndFinish: profile: is_secure: both + +smtProfile: + is_secure: both diff --git a/apps/pc_frontend/modules/member/config/view.yml b/apps/pc_frontend/modules/member/config/view.yml index f62759b2b..4a1fe3872 100644 --- a/apps/pc_frontend/modules/member/config/view.yml +++ b/apps/pc_frontend/modules/member/config/view.yml @@ -1,5 +1,5 @@ homeSuccess: - javascripts: [%SF_PROTOTYPE_WEB_DIR%/js/prototype, util] + javascripts: [jquery.min.js, jquery-ui.min.js] layout: layoutA customize: cautionAboutFriendPre: @@ -23,7 +23,6 @@ homeSuccess: is_component: true profileSuccess: - javascripts: [util] layout: layoutA configSuccess: @@ -31,3 +30,30 @@ configSuccess: loginSuccess: layout: layoutA + +smtHomeSuccess: + layout: smtLayoutHome + +smtProfileSuccess: + layout: smtLayoutMember + +smtEditProfileSuccess: + layout: smtLayoutHome + +smtConfigSuccess: + layout: smtLayoutHome + +smtSearchSuccess: + layout: smtLayoutSns + +smtConfigImageSuccess: + layout: smtLayoutHome + +smtInviteInput: + layout: smtLayoutSns + +smtInviteSuccess: + layout: smtLayoutSns + +smtInviteError: + layout: smtLayoutSns diff --git a/apps/pc_frontend/modules/member/templates/_profileListBox.php b/apps/pc_frontend/modules/member/templates/_profileListBox.php index bf17aee76..d9a1b8216 100644 --- a/apps/pc_frontend/modules/member/templates/_profileListBox.php +++ b/apps/pc_frontend/modules/member/templates/_profileListBox.php @@ -3,14 +3,18 @@ $culture = sfCultureInfo::getInstance($sf_user->getCulture()); $list = array(); -if ($member->getAge(true)) + +$list[__('%Nickname%')] = $member->getName(); + +if ($member->getAge(true) !== false) { $ageValue = __('%1% years old', array('%1%' => $member->getAge())); if ($member->getConfig('age_public_flag') == ProfileTable::PUBLIC_FLAG_FRIEND) { - $ageValue .= ' ('.__('Only Open to %my_friend%', array( - '%my_friend%' => $op_term['my_friend']->titleize()->pluralize(), - )).')'; + $termMyFriend = Doctrine::getTable('SnsTerm')->get('my_friend'); + $terms = array('%my_friend%' => $termMyFriend->pluralize()->titleize()); + + $ageValue .= ' ('.__('%my_friend%', $terms, 'publicFlags').')'; } $list[__('Age')] = $ageValue; @@ -52,15 +56,16 @@ if ($member->getId() == $sf_user->getMemberId()) { + $termMyFriend = Doctrine::getTable('SnsTerm')->get('my_friend'); + $terms = array('%my_friend%' => $termMyFriend->pluralize()->titleize()); + if ($profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_FRIEND) { - $profileValue .= ' ('.__('Only Open to %my_friend%', array( - '%my_friend%' => $op_term['my_friend']->titleize()->pluralize(), - )).')'; + $profileValue .= ' ('.__('%my_friend%', $terms, 'publicFlags').')'; } elseif ($profile->getPublicFlag() == ProfileTable::PUBLIC_FLAG_WEB && $profile->Profile->is_public_web) { - $profileValue .= ' ('.__('All Users on the Web').')'; + $profileValue .= ' ('.__('All Users on the Web', $terms, 'publicFlags').')'; } } $list[$caption] = $profileValue; diff --git a/apps/pc_frontend/modules/member/templates/_smtMemberFriendListBox.php b/apps/pc_frontend/modules/member/templates/_smtMemberFriendListBox.php new file mode 100644 index 000000000..130e23b9b --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/_smtMemberFriendListBox.php @@ -0,0 +1,50 @@ + + + + +
    +
    +
    $op_term['friend'])) ?>
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    + diff --git a/apps/pc_frontend/modules/member/templates/_smtMemberJoinCommunityListBox.php b/apps/pc_frontend/modules/member/templates/_smtMemberJoinCommunityListBox.php new file mode 100644 index 000000000..386b1fea0 --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/_smtMemberJoinCommunityListBox.php @@ -0,0 +1,48 @@ + + + + +
    +
    +
    $op_term['community'])) ?>
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    diff --git a/apps/pc_frontend/modules/member/templates/_smtProfileListBox.php b/apps/pc_frontend/modules/member/templates/_smtProfileListBox.php new file mode 100644 index 000000000..89b99480c --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/_smtProfileListBox.php @@ -0,0 +1,56 @@ + +getCulture()); + +foreach ($member->getProfiles(true) as $profile) +{ + $caption = $profile->getProfile()->getCaption(); + if ($profile->getProfile()->isPreset()) + { + $presetConfig = $profile->getProfile()->getPresetConfig(); + $caption = __($presetConfig['Caption']); + } + + $profileValue = (string)$profile; + if ('' === $profileValue) + { + continue; + } + + if ('textarea' === $profile->getFormType()) + { + $profileValue = op_auto_link_text(nl2br($profileValue)); + } + + if ($profile->getProfile()->isPreset()) + { + if ('country_select' === $profile->getFormType()) + { + $profileValue = $culture->getCountry($profileValue); + } + elseif ('op_preset_birthday' === $profile->getName()) + { + $profileValue = op_format_date($profileValue, 'XShortDateJa'); + } + + $profileValue = __($profileValue); + } + + $list[$caption] = $profileValue; +} +?> +
    +
    +
    +
    + + + + $profileValue): ?> + + + +
    getName(); ?>
    +
    diff --git a/apps/pc_frontend/modules/member/templates/configJsonApiSuccess.php b/apps/pc_frontend/modules/member/templates/configJsonApiSuccess.php new file mode 100644 index 000000000..c48ba35c5 --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/configJsonApiSuccess.php @@ -0,0 +1,14 @@ + +
    +

    + +

    +
    +

    + 'post')) ?> +

    +
    + + __('API Key'), +)); ?> diff --git a/apps/pc_frontend/modules/member/templates/configSuccess.php b/apps/pc_frontend/modules/member/templates/configSuccess.php index 5f2c4a2ee..c5fd3e567 100644 --- a/apps/pc_frontend/modules/member/templates/configSuccess.php +++ b/apps/pc_frontend/modules/member/templates/configSuccess.php @@ -19,6 +19,11 @@ $list[] = link_to(__('Connecting with External Application'), '@connection_list'); } +if (opConfig::get('enable_jsonapi')) +{ + $list[] = link_to(__('JSON API Configuration'), '@member_config_jsonapi'); +} + if (opConfig::get('enable_openid')) { $list[] = link_to(__('OpenID Configuration'), '@openid_list'); @@ -36,8 +41,10 @@ ?> - +count() > 1): // except CSRF token field ?> __($categoryCaptions[$categoryName]), 'url' => url_for('@member_config?category='.$categoryName))) ?> +count()) : ?> + __($categoryCaptions[$categoryName]))); ?> __('Change Settings'))); ?> diff --git a/apps/pc_frontend/modules/member/templates/homeSuccess.php b/apps/pc_frontend/modules/member/templates/homeSuccess.php index 08b121635..5c6a29ca7 100644 --- a/apps/pc_frontend/modules/member/templates/homeSuccess.php +++ b/apps/pc_frontend/modules/member/templates/homeSuccess.php @@ -8,7 +8,7 @@ - 'div', 'handle' => 'partsHeading', 'onChange' => 'function(obj){storeSort(obj)}')) ?> + div", handle: "div.sortHandle, div.partsHeading", update: function(event,ui){storeSort(event, ui)} });') ?> @@ -19,7 +19,7 @@ - 'div', 'handle' => 'partsHeading', 'onChange' => 'function(obj){storeSort(obj)}')) ?> + div", handle: "div.sortHandle, div.partsHeading", update: function(event,ui){storeSort(event, ui)} });') ?> @@ -28,7 +28,7 @@ getComponentModule(), $gadget->getComponentAction(), array('gadget' => $gadget)); ?> - 'div', 'handle' => 'partsHeading', 'onChange' => 'function(obj){storeSort(obj)}')) ?> + div", handle: "div.sortHandle, div.partsHeading", update: function(event,ui){storeSort(event, ui)} });') ?> @@ -39,33 +39,34 @@ - 'div', 'handle' => 'partsHeading')) ?> + getRelativeUrlRoot() ? $sf_request->getRelativeUrlRoot() : '/').'"; var expires = new Date(); expires.setTime((new Date()).getTime() + (10 * 12 * 30 * 24 * 60 * 60 * 1000)); - var pos = obj.parentNode.id; + var pos = ui.item.parent().attr("id"); opCookie.set("HomeGadget_" + pos + "_sort", result, expires, path); } function foldObj(obj, display) { - Element.childElements(obj.parentNode).each(function(child, index){ - if (!child.hasClassName("partsHeading")) { + obj.parent().children().each(function(index){ + var child = $(this); + if (!child.hasClass("partsHeading")) { if (display == null) { child.toggle(); } else { @@ -76,24 +77,25 @@ function foldObj(obj, display) } } - var size = Element.childElements(obj.parentNode).length; + var size = obj.parent().children().length; if (size == index + 1) { // It is a last loop maybe var path = "'.($sf_request->getRelativeUrlRoot() ? $sf_request->getRelativeUrlRoot() : '/').'"; - var id = child.parentNode.parentNode.id; + var id = child.parent().parent().attr("id"); var expires = new Date(); expires.setTime((new Date()).getTime() + (10 * 12 * 30 * 24 * 60 * 60 * 1000)); - opCookie.set("HomeGadget_" + id + "_toggle", child.visible(), expires, path); + opCookie.set("HomeGadget_" + id + "_toggle", !child.is(":hidden"), expires, path); } } }); } -$$(".partsHeading").each(function(obj){ +$(".partsHeading").each(function(){ + var obj = $(this); // folding - Event.observe(obj, "dblclick", function(e){ + obj.dblclick(function(){ foldObj(obj); }); - var id = obj.parentNode.parentNode.id; + var id = obj.parent().parent().attr("id"); var display = opCookie.get("HomeGadget_"+id+"_toggle"); if (display != null) { foldObj(obj, display); @@ -101,15 +103,14 @@ function foldObj(obj, display) }); -["Top", "Left", "Center"].each(function(type){ - var sortInfo = opCookie.get("HomeGadget_" + type + "_sort"); +$.each(["Top", "Left", "Center"], function(){ + var sortInfo = opCookie.get("HomeGadget_" + this + "_sort"); if (sortInfo) { - var obj = document.getElementById(type); - sortInfo.split(",").each(function(value){ - var gadget = document.getElementById(value); - Element.remove(gadget); - obj.appendChild(gadget); + var obj = $("#"+this); + $.each(sortInfo.split(","), function(){ + var gadget = $("#"+this); + gadget.detach().appendTo(obj); }); } }); diff --git a/apps/pc_frontend/modules/member/templates/registerInputSuccess.php b/apps/pc_frontend/modules/member/templates/registerInputSuccess.php index 720fc706b..295b4c58d 100644 --- a/apps/pc_frontend/modules/member/templates/registerInputSuccess.php +++ b/apps/pc_frontend/modules/member/templates/registerInputSuccess.php @@ -6,3 +6,10 @@ ); op_include_form('RegisterForm', $form, $options); ?> + + diff --git a/apps/pc_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php b/apps/pc_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php index 1fd51c140..220d1b212 100644 --- a/apps/pc_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php +++ b/apps/pc_frontend/modules/member/templates/registerMobileToRegisterEndSuccess.php @@ -1,5 +1,6 @@ -

    $op_config['sns_name'])) ?>

    +

    $op_config['sns_name'])) ?>
    +

    • diff --git a/apps/pc_frontend/modules/member/templates/smtConfigImageSuccess.php b/apps/pc_frontend/modules/member/templates/smtConfigImageSuccess.php new file mode 100644 index 000000000..7b58cba35 --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtConfigImageSuccess.php @@ -0,0 +1,58 @@ +
      +
      +
      + + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + + +
      +
      +x + +

      + +
      +
      + + +
      +renderFormTag(url_for('member/configImage')) ?> + +renderHiddenFields(); ?> + + += $sf_user->getMember()->getMemberImage()->count()): ?> +
      + + +
      + +
      +getMember() ?> +getMemberImage() ?> + +getCSRFFieldName().'='.$form->getCSRFToken() ?> + +
      +
      + + +getFile(), array('size' => '120x120', 'width' => '80', 'height' => '80')) ?>
      +
      +[ +getId().$csrfToken) ?> | +getIsPrimary()) : ?> + + +getId().$csrfToken) ?> + +] + + '80x80', 'alt' => '')) ?> + +
      +
      + +
      diff --git a/apps/pc_frontend/modules/member/templates/smtConfigSuccess.php b/apps/pc_frontend/modules/member/templates/smtConfigSuccess.php new file mode 100644 index 000000000..1efb09edf --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtConfigSuccess.php @@ -0,0 +1,66 @@ + $value) +{ + if (count($value)) + { + $lists[$key] = link_to(__($categoryCaptions[$key]), '@member_config?category='.$key); + } +} +?> + +
      +
      +
      + +
      +
      +
      + + + + + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + + +
      +
      + +

      + +
      +
      + + +
      + +isHidden()): ?> +
      + +
      + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
      +
      + + + +renderHiddenFields(); ?> + +
      + + + + +
      + +
      diff --git a/apps/pc_frontend/modules/member/templates/smtEditProfileSuccess.php b/apps/pc_frontend/modules/member/templates/smtEditProfileSuccess.php new file mode 100644 index 000000000..7c9b97ca7 --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtEditProfileSuccess.php @@ -0,0 +1,76 @@ +
      +
      +
      +
      + + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + + + +
      +
      +x + +

      + +
      +
      + + +
      + + +isHidden()): ?> + + + + + + +isHidden()): ?> + + + + + +renderHiddenFields(); ?> +renderHiddenFields(); ?> +
      +
      + +
      + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
      +
      +
      +
      + +
      + hasError()): ?> + renderError()); ?> + + getWidget()->getOption('widget') instanceof sfWidgetFormDate): ?> + render(array('class' => 'span4')) ?> + + render(array('class' => 'span12')) ?> + + renderHelp(); ?> +
      +
      +
      +
      + + +
      + + +
      diff --git a/apps/pc_frontend/modules/member/templates/smtHomeSuccess.php b/apps/pc_frontend/modules/member/templates/smtHomeSuccess.php new file mode 100644 index 000000000..bf4865b2d --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtHomeSuccess.php @@ -0,0 +1,7 @@ + + +isEnabled()): ?> +getComponentModule(), $gadget->getComponentAction(), array('gadget' => $gadget)); ?> + + + diff --git a/apps/pc_frontend/modules/member/templates/smtInviteError.php b/apps/pc_frontend/modules/member/templates/smtInviteError.php new file mode 100644 index 000000000..940aa0eb1 --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtInviteError.php @@ -0,0 +1,9 @@ + __('Invite a friend to %1%', array('%1%' => $op_config['sns_name'])), +); +op_include_box('inviteForm', __('The invitation has not been permitted.'), $options); +?> + + + diff --git a/apps/pc_frontend/modules/member/templates/smtInviteInput.php b/apps/pc_frontend/modules/member/templates/smtInviteInput.php new file mode 100644 index 000000000..98adb9fdd --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtInviteInput.php @@ -0,0 +1,38 @@ +
      +
      +
      $op_config['sns_name'])); ?>
      +
      + +hasGlobalErrors()): ?> +renderGlobalErrors(); ?> + + +
      +
      +x + +

      + +
      +
      + +
      + + +isHidden()): ?> +
      +renderLabel(); ?> +
      +
      + hasError()): ?> + renderError()) ?>
      + + render(array('class' => 'span12')) ?> + renderHelp() ?> +
      + + +renderHiddenFields(); ?> + + +
      diff --git a/apps/pc_frontend/modules/member/templates/smtInviteSuccess.php b/apps/pc_frontend/modules/member/templates/smtInviteSuccess.php new file mode 100644 index 000000000..16e1b9fe6 --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtInviteSuccess.php @@ -0,0 +1,28 @@ +
      +
      $op_config['sns_name'])); ?>
      +
      +
      +
      +

      +
      +
      + +
      + +isHidden()): ?> +
      + +
      + hasError()): ?> + renderError()); ?> + + render(array('class' => 'span12')) ?> + renderHelp(); ?> +
      +
      + + +renderHiddenFields(); ?> + + +
      diff --git a/apps/pc_frontend/modules/member/templates/smtLoginError.php b/apps/pc_frontend/modules/member/templates/smtLoginError.php new file mode 100644 index 000000000..7c820e18d --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtLoginError.php @@ -0,0 +1,8 @@ +
      +
      +
      + + + + + diff --git a/apps/pc_frontend/modules/member/templates/smtLoginSuccess.php b/apps/pc_frontend/modules/member/templates/smtLoginSuccess.php new file mode 100644 index 000000000..bf4865b2d --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtLoginSuccess.php @@ -0,0 +1,7 @@ + + +isEnabled()): ?> +getComponentModule(), $gadget->getComponentAction(), array('gadget' => $gadget)); ?> + + + diff --git a/apps/pc_frontend/modules/member/templates/smtProfileSuccess.php b/apps/pc_frontend/modules/member/templates/smtProfileSuccess.php new file mode 100644 index 000000000..f81e84be1 --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtProfileSuccess.php @@ -0,0 +1,51 @@ +isSelf()): ?> + +
      +

      +

      +
      + + $content)) ?> + +isFriend() && opConfig::get('enable_friend_link') && $relation->isAllowed($sf_user->getRawValue()->getMember(), 'friend_link')): ?> + + +
      +

      $member->getName(), '%my_friend%' => $op_term['my_friend']->pluralize())) ?>

      + +

      +

      $op_term['friend'])) ?>

      +

      $op_term['friend'])) ?>

      +
      + + $content)) ?> + + + + + +isEnabled()): ?> +getComponentModule(), $gadget->getComponentAction(), array('gadget' => $gadget)); ?> + + + diff --git a/apps/pc_frontend/modules/member/templates/smtSearchSuccess.php b/apps/pc_frontend/modules/member/templates/smtSearchSuccess.php new file mode 100644 index 000000000..08c84be9a --- /dev/null +++ b/apps/pc_frontend/modules/member/templates/smtSearchSuccess.php @@ -0,0 +1,50 @@ + + + + +
      +
      +
      +
      +
      +
      +
      + + +
      +
      +
      +
      +
      + +
      + diff --git a/apps/pc_frontend/modules/oauth/actions/actions.class.php b/apps/pc_frontend/modules/oauth/actions/actions.class.php index 4a656e040..33ee1d819 100644 --- a/apps/pc_frontend/modules/oauth/actions/actions.class.php +++ b/apps/pc_frontend/modules/oauth/actions/actions.class.php @@ -17,6 +17,8 @@ */ class oauthActions extends opOAuthTokenAction { + protected $authorizedMemberId = null; + protected function getTokenModelName() { return 'OAuthMemberToken'; @@ -27,15 +29,21 @@ public function setRecordTemplate(Doctrine_Record $record = null) $class = $this->getTokenModelName(); $record = new $class(); - $record->setMemberId($this->getUser()->getMemberId()); + if ($this->authorizedMemberId !== null) + { + $record->setMemberId($this->authorizedMemberId); + } parent::setRecordTemplate($record); } public function setQueryTemplate(Doctrine_Query $q = null) { - $q = $this->getTokenTable()->createQuery() - ->andWhere('member_id = ?', $this->getUser()->getMemberId()); + if ($this->authorizedMemberId !== null) + { + $q = $this->getTokenTable()->createQuery() + ->andWhere('member_id = ?', $this->authorizedMemberId); + } parent::setQueryTemplate($q); } @@ -84,7 +92,8 @@ public function executeAccessToken(sfWebRequest $request) $this->forward404Unless($this->information->getIsActive()); $this->forward404Unless($this->information->getVerifier() === $authRequest->get_parameter('oauth_verifier')); - $this->getUser()->setMemberId($this->information->getMemberId()); + $this->authorizedMemberId = $this->information->getMemberId(); + $this->forward404Unless($this->authorizedMemberId !== null); // o_auth_member_token.member_id is nullable $token = $this->getServer()->fetch_access_token($authRequest); diff --git a/apps/pc_frontend/templates/_header.php b/apps/pc_frontend/templates/_header.php index f87be598d..a70c487a2 100644 --- a/apps/pc_frontend/templates/_header.php +++ b/apps/pc_frontend/templates/_header.php @@ -1,5 +1,59 @@

      + +
      + '32', 'class' => 'ncbutton')) ?> +
      +
      + +
      +
      + +
      +
      + +
      +
      +
      + + + + + +
    +isSmartphone(false)): ?> +
    + + +
    + +