Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fixed #4590, BP from #4585) スマートフォンプロフィール画面にプロフィール写真ガジェットを追加 #688

Merged
merged 2 commits into from Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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]