Skip to content

Commit

Permalink
(ux) updated personal messages to keep the layout consistent with rec…
Browse files Browse the repository at this point in the history
…ent post bit changes
  • Loading branch information
silvercircle committed Apr 8, 2012
1 parent 35d4049 commit 6d0b6bf
Show file tree
Hide file tree
Showing 15 changed files with 726 additions and 132 deletions.
43 changes: 0 additions & 43 deletions Sources/CommonAPI.php
Expand Up @@ -642,49 +642,6 @@ public function getRules()
return $this->detectionRules;
}

/**
*
* @method boolean isiPhone()
* @method boolean isBlackBerry()
* @method boolean isHTC()
* @method boolean isNexus()
* @method boolean isDellStreak()
* @method boolean isMotorola()
* @method boolean isSamsung()
* @method boolean isSony()
* @method boolean isAsus()
* @method boolean isPalm()
*
* @method boolean isBlackBerryTablet()
* @method boolean isiPad()
* @method boolean isKindle()
* @method boolean isSamsungTablet()
* @method boolean isMotorolaTablet()
* @method boolean isAsusTablet()
*
* @method boolean isAndroidOS()
* @method boolean isBlackBerryOS()
* @method boolean isPalmOS()
* @method boolean isSymbianOS()
* @method boolean isWindowsMobileOS()
* @method boolean isiOS()
*
* @method boolean isChrome()
* @method boolean isDolfin()
* @method boolean isOpera()
* @method boolean isSkyfire()
* @method boolean isIE()
* @method boolean isFirefox()
* @method boolean isBolt()
* @method boolean isTeaShark()
* @method boolean isBlazer()
* @method boolean isSafari()
* @method boolean isMidori()
*
* @param string $name
* @param array $arguments
* @return mixed
*/
public function __call($name, $arguments)
{

Expand Down
18 changes: 10 additions & 8 deletions Sources/Load.php
Expand Up @@ -1287,14 +1287,16 @@ function detectBrowser()
$disable_mobile = $_COOKIE['usemobile'] == 'no' ? true : false;
}

if(isset($_REQUEST['mobile']) && $_REQUEST['mobile'] == 1) {
setcookie('usemobile', 'yes', time() + 86400 * 365);
$force_mobile = true;
}
if(isset($_REQUEST['mobile']) && $_REQUEST['mobile'] == 0) {
setcookie('usemobile', 'no', time() + 86400 * 365);
$disable_mobile = true;
$force_mobile = false;
if(isset($_REQUEST['mobile'])) {
if($_REQUEST['mobile'] == 1) {
setcookie('usemobile', 'yes', time() + 86400 * 365);
$force_mobile = true;
}
if($_REQUEST['mobile'] == 0) {
setcookie('usemobile', 'no', time() + 86400 * 365);
$disable_mobile = true;
$force_mobile = false;
}
}

$mobile_detector = new Mobile_Detect();
Expand Down
14 changes: 8 additions & 6 deletions Themes/default/Display.template.php
Expand Up @@ -54,6 +54,13 @@ function template_main()
<a id="top"></a>
', $context['first_new_message'] ? '<a id="new"></a>' : '';


echo '
<div>
<h1 class="bigheader">
', $txt['topic'], ': ', $context['prefix'], $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')
</h1>
</div>';
// Is this topic also a poll?
if ($context['is_poll'])
{
Expand Down Expand Up @@ -194,12 +201,7 @@ function template_main()

// Show the topic information - icon, subject, etc.
echo '
<div id="forumposts">
<div>
<h1 class="bigheader">
', $txt['topic'], ': ', $context['prefix'], $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')
</h1>
</div>';
<div id="forumposts">';

// social share bar
if($context['use_share'])
Expand Down
6 changes: 3 additions & 3 deletions Themes/default/GenericMenu.template.php
Expand Up @@ -30,16 +30,16 @@ function template_generic_menu_sidebar_above()
{
// Show the section header - and pump up the line spacing for readability.
echo '
<div class="orange_container minpadding" style="margin-bottom:15px;border-right:0;border-radius:3px 0 0 3px;">
<div class="cat_bar">
<div class="flat_container minpadding" style="margin-bottom:15px;border-right:0;border-radius:3px 0 0 3px;">
<div class="cat_bar2">
<h3>';

echo '
', $section['title'];
echo '
</h3>
</div>
<ul class="smalltext left_admmenu">';
<ul class="smalltext left_admmenu" style="padding:5px 0;">';

// For every area of this section show a link to that area (bold if it's currently selected.)
foreach ($section['areas'] as $i => $area)
Expand Down
4 changes: 2 additions & 2 deletions Themes/default/Login.template.php
Expand Up @@ -200,10 +200,10 @@ function template_admin_login()
<div class="tborder login" id="admin_login">
<div class="cat_bar rounded_top">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/login_sm.gif" alt="" class="icon" /> ', $txt['login'], '</span>
<span class="ie6_header floatleft">', $txt['login'], '</span>
</h3>
</div>
<div class="blue_container centertext">';
<div class="blue_container centertext cleantop">';

if (!empty($context['incorrect_password']))
echo '
Expand Down
67 changes: 40 additions & 27 deletions Themes/default/PersonalMessage.template.php
Expand Up @@ -51,6 +51,7 @@ function template_pm_below()
function template_folder()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
$imgsrc = $settings['images_url'].'/clipsrc.png';

// The every helpful javascript!
echo '
Expand Down Expand Up @@ -141,9 +142,15 @@ function loadLabelChoices()
template_subject_list();
echo '<div class="clear"><br /></div>';
}
else
echo '
<div class="floatright tinytext smallpadding">
<a href="', $scripturl, '?action=pm;view;f=', $context['folder'], ';start=', $context['start'], ';sort=', $context['sort_by'], ($context['sort_direction'] == 'up' ? '' : ';desc'), ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''), '">',$txt['pm_change_view'],'</a>
</div>
<div class="clear"></div>';

// Got some messages to display?
echo '<div class="posts_container framed_region">';
echo '<div class="posts_container">';
if ($context['get_pmessage']('message', true))
{
// Show a few buttons if we are in conversation mode and outputting the first message.
Expand Down Expand Up @@ -176,7 +183,7 @@ function loadLabelChoices()

// Show who the message was sent to.
echo '
<span class="smalltext">&#171; <strong> ', $txt['sent_to'], ':</strong> ';
<span class="tinytext">&nbsp;&nbsp;-&nbsp;&nbsp;', $txt['sent_to'], ': ';

// People it was sent directly to....
if (!empty($message['recipients']['to']))
Expand All @@ -185,8 +192,7 @@ function loadLabelChoices()
elseif ($context['folder'] != 'sent')
echo '(', $txt['pm_undisclosed_recipients'], ')';

echo '
<strong> ', $txt['on'], ':</strong> ', $message['time'], ' &#187;
echo ', ', $message['time'], '
</span>';

// If we're in the sent items, show who it was sent to besides the "To:" people.
Expand Down Expand Up @@ -303,16 +309,11 @@ function loadLabelChoices()
<div class="post_content std">';
if (!empty($message['is_replied_to']))
echo '
<div style="margin:3px;" class="orange_container smalltext">&#171; ', $txt['pm_is_replied_to'], ' &#187;</div>';
<div style="margin:3px;" class="orange_container tinytext">&#171; ', $txt['pm_is_replied_to'], ' &#187;</div>';

echo '
<div class="post">
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
<div class="smalltext reportlinks">
', (!empty($modSettings['enableReportPM']) && $context['folder'] != 'sent' ? '<div class="righttext"><a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '">' . $txt['pm_report_to_admin'] . '</a></div>' : '');

echo '
</div>';
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>';

// Are there any custom profile fields for above the signature?
if (!empty($message['member']['custom_fields']))
Expand Down Expand Up @@ -340,7 +341,7 @@ function loadLabelChoices()

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
echo '<br>
<div class="signature">', $message['member']['signature'], '</div>';

// Add an extra line at the bottom if we have labels enabled.
Expand Down Expand Up @@ -401,26 +402,32 @@ function loadLabelChoices()
// Is there than more than one recipient you can reply to?
if ($message['number_recipients'] > 1 && $context['display_mode'] != 2)
echo '
<li class="reply_all_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['reply_to_all'], '</a></li>';
<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['reply_to_all'], '</a></li>';

echo '
<li class="reply_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $txt['reply'], '</a></li>
<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>';
<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><div class="csrcwrapper16px"><img class="clipsrc reply" src="',$imgsrc,'" alt="',$txt['reply'],'" title="',$txt['reply'],'" /></div></a></li>
<li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><div class="csrcwrapper16px"><img class="clipsrc mquote_add" src="',$imgsrc,'" alt="',$txt['quote'],'" title="',$txt['quote'],'" /></div></a></li>';
}
// This is for "forwarding" - even if the member is gone.
else
echo '
<li class="forward_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $txt['reply_quote'], '</a></li>';
}
echo '
<li class="remove_button"><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions[', $message['id'], ']=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" onclick="return Eos_Confirm(\'\', \'', addslashes($txt['remove_message']), '?\');">', $txt['delete'], '</a></li>';
<li class="remove_button"><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions[', $message['id'], ']=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" onclick="return Eos_Confirm(\'\', \'', addslashes($txt['remove_message']), '?\');"><div class="csrcwrapper16px"><img class="clipsrc remove" src="',$imgsrc,'" alt="',$txt['remove'],'" title="',$txt['remove'],'" /></div></a></li>';

if (empty($context['display_mode']))
echo '
<li class="inline_mod_check"><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;" class="input_check" /></li>';

echo '
</ul><div class="clear"></div>
</ul>';
if(!empty($modSettings['enableReportPM']) && $context['folder'] != 'sent')
echo '
<a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '"><div class="csrcwrapper16px floatleft padded"><img class="clipsrc reporttm" src="',$imgsrc,'" alt="',$txt['pm_report_to_admin'],'" title="',$txt['pm_report_to_admin'],'" /></div></a>';

echo '
<div class="clear"></div>
</div>
</div>';
}
Expand Down Expand Up @@ -470,22 +477,27 @@ function template_subject_list()
global $context, $options, $settings, $modSettings, $txt, $scripturl;

echo '
<table width="100%" id="messageindex" class="table_grid mediumpadding ">
<div class="floatright tinytext smallpadding">
<a href="', $scripturl, '?action=pm;view;f=', $context['folder'], ';start=', $context['start'], ';sort=', $context['sort_by'], ($context['sort_direction'] == 'up' ? '' : ';desc'), ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''), '">',$txt['pm_change_view'],'</a>
</div>
<div class="clear"></div>
<div class="framed_region">
<table width="100%" class="topic_table">
<thead>
<tr>
<th width="4%" class="centertext glass first_th">
<a href="', $scripturl, '?action=pm;view;f=', $context['folder'], ';start=', $context['start'], ';sort=', $context['sort_by'], ($context['sort_direction'] == 'up' ? '' : ';desc'), ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''), '"><img src="', $settings['images_url'], '/im_switch.gif" alt="', $txt['pm_change_view'], '" title="', $txt['pm_change_view'], '" width="16" height="16" /></a>
<th class="centertext glass cleantop first_th" style="width:4%;">
<a href="', $scripturl, '?action=pm;view;f=', $context['folder'], ';start=', $context['start'], ';sort=', $context['sort_by'], ($context['sort_direction'] == 'up' ? '' : ';desc'), ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''), '"></a>
</th>
<th class="glass lefttext" style="width:22%;">
<th class="glass cleantop lefttext" style="width:22%;">
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=date', $context['sort_by'] == 'date' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', $txt['date'], $context['sort_by'] == 'date' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>
<th class="glass lefttext" width="46%">
<th class="glass cleantop lefttext" style="width:46%;">
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>
<th class="glass lefttext">
<th class="glass cleantop lefttext">
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', ($context['from_or_to'] == 'from' ? $txt['from'] : $txt['to']), $context['sort_by'] == 'name' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>
<th width="4%" class="centertext glass last_th">
<th class="centertext glass cleantop last_th" style="width:4%;">
<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />
</th>
</tr>
Expand Down Expand Up @@ -532,6 +544,7 @@ function template_subject_list()
echo '
</tbody>
</table>
</div>
<div class="pagesection">
<div class="floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>
<div class="floatright">&nbsp;';
Expand Down Expand Up @@ -1177,11 +1190,11 @@ function template_report_message()
<div class="cat_bar">
<h3 class="catbg">', $txt['pm_report_title'], '</h3>
</div>
<div class="description">
<div class="orange_container cleantop">
', $txt['pm_report_desc'], '
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<br>
<div class="blue_container">
<div class="content">
<dl class="settings">';

Expand Down
4 changes: 2 additions & 2 deletions Themes/default/Postbit.template.php
Expand Up @@ -46,7 +46,7 @@ function template_postbit_normal(&$message)
echo '
<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Person" class="poster std">
<h4>', $message['member']['link'], '</h4>
<ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
<ul class="reset tinytext" id="msg_', $message['id'], '_extra_info">';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
Expand Down Expand Up @@ -826,7 +826,7 @@ function template_postbit_quickbuttons(&$message)
$imgsrc = $settings['images_url'].'/clipsrc.png';

echo '
<ul class="floatright plainbuttonlist orange">';
<ul class="floatright plainbuttonlist">';

if ($message['can_approve'])
echo '
Expand Down
2 changes: 1 addition & 1 deletion Themes/default/Profile.template.php
Expand Up @@ -415,7 +415,7 @@ function template_showPosts()
}
else {
echo '
<div class="posts_container framed_region">';
<div class="posts_container">';
foreach ($context['posts'] as &$post)
$context['postbit_callback']($post);
echo '
Expand Down

0 comments on commit 6d0b6bf

Please sign in to comment.