Skip to content

Commit

Permalink
Merge pull request #688 from nishizoe/t-4590
Browse files Browse the repository at this point in the history
(fixed #4590, BP from #4585) スマートフォンプロフィール画面にプロフィール写真ガジェットを追加
  • Loading branch information
nishizoe committed Jun 6, 2023
2 parents 2634b4a + 465f63f commit fbe2f2e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
4 changes: 4 additions & 0 deletions apps/pc_frontend/i18n/messages.ja.xml
Expand Up @@ -274,6 +274,10 @@
<source>Profile</source>
<target>プロフィール</target>
</trans-unit>
<trans-unit id="">
<source>Profile Photo</source>
<target>プロフィール写真</target>
</trans-unit>
<trans-unit id="">
<source>Public Flag for Profile Page</source>
<target>プロフィールページの公開範囲</target>
Expand Down
13 changes: 13 additions & 0 deletions apps/pc_frontend/modules/default/actions/components.class.php
Expand Up @@ -130,4 +130,17 @@ public function executeRssBox()
public function executeLinkListBox()
{
}

public function executeSmtMemberImageBox($request)
{
if ($request->hasParameter('id') && $request->getParameter('module') == 'member' && $request->getParameter('action') == 'profile')
{
$this->member = Doctrine::getTable('Member')->find($request->getParameter('id'));
}
else
{
$this->member = $this->getUser()->getMember();
}
$this->id = $this->getUser()->getMemberId();
}
}
16 changes: 16 additions & 0 deletions apps/pc_frontend/modules/default/templates/_smtMemberImageBox.php
@@ -0,0 +1,16 @@
<div class="row">
<div class="gadget_header span12"><?php echo __('Profile Photo') ?></div>
</div>
<div class="row">
<div class="span12 center">
<p class="photo" style="margin-top: 8px;">
<?php $imgParam = array('size' => '180x180', 'alt' => $member->getName()) ?>
<?php if ($member): ?>
<?php echo op_image_tag_sf_image($member->getImageFileName(), $imgParam) ?>
<?php else: ?>
<?php echo op_image_tag('no_image.gif', $imgParam) ?>
<?php endif; ?>
</p>
<p class="text"><?php echo $member->getNameAndCount() ?></p>
</div>
</div>
Expand Up @@ -35,8 +35,7 @@
<?php $form = new sfForm() ?>
<?php $csrfToken = '&'.$form->getCSRFFieldName().'='.$form->getCSRFToken() ?>
<?php for ($i = 0; $i < 3; $i++) : ?>
<div class="span4">
<div class="row center">
<div class="span4"><div class="row center">
<?php if (isset($images[$i])) : ?>
<?php $image = $images[$i]; ?>
<?php echo op_image_tag_sf_image($image->getFile(), array('size' => '120x120', 'width' => '80', 'height' => '80')) ?></div>
Expand Down
9 changes: 8 additions & 1 deletion lib/config/config/smartphone_profile_gadget.yml
Expand Up @@ -19,6 +19,14 @@ freeArea:
ValueType: "text"
IsRequired: false

memberImageBox:
caption:
ja_JP: "プロフィール写真"
description:
ja_JP: "メンバーの登録した写真をホームに表示します"
viewable_privilege: 4
component: [default, smtMemberImageBox]

profileListBox:
caption:
ja_JP: "プロフィール"
Expand All @@ -40,4 +48,3 @@ memberJoinCommunityListBox:
description:
ja_JP: "メンバーが参加しているコミュニティの一覧を表示します"
component: [member, smtMemberJoinCommunityListBox]

0 comments on commit fbe2f2e

Please sign in to comment.