1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge remote-tracking branch 'PayBas/ticket/12608' into develop-ascraeus

* PayBas/ticket/12608:
  [ticket/12608] Change CSS classes to prevent styling conflicts
  [ticket/12608] Add subSilver
  [ticket/12608] Changed get_styling() to get_style_class()
  [ticket/12608] Remove somewhat redundant reported color style
  [ticket/12608] Improved LTR and various bugfixes
  [ticket/12608] Clean up whitespace
  [ticket/12608] Add styling (CSS class) options to notifications
  [ticket/12608] Updated tests
  [ticket/12608] Improve notifications drop-down menu styling in header
This commit is contained in:
Cesar G
2014-06-22 15:44:06 -07:00
22 changed files with 430 additions and 78 deletions

View File

@@ -308,16 +308,15 @@ abstract class base implements \phpbb\notification\type\type_interface
return array(
'NOTIFICATION_ID' => $this->notification_id,
'STYLING' => $this->get_style_class(),
'AVATAR' => $this->get_avatar(),
'FORMATTED_TITLE' => $this->get_title(),
'REFERENCE' => $this->get_reference(),
'FORUM' => $this->get_forum(),
'REASON' => $this->get_reason(),
'URL' => $this->get_url(),
'TIME' => $this->user->format_date($this->notification_time),
'UNREAD' => !$this->notification_read,
'U_MARK_READ' => (!$this->notification_read) ? $u_mark_read : '',
);
}
@@ -336,6 +335,16 @@ abstract class base implements \phpbb\notification\type\type_interface
return false;
}
/**
* Get the CSS style class of the notification (fall back)
*
* @return string
*/
public function get_style_class()
{
return '';
}
/**
* Get the user's avatar (fall back)
*
@@ -346,6 +355,36 @@ abstract class base implements \phpbb\notification\type\type_interface
return '';
}
/**
* Get the reference of the notifcation (fall back)
*
* @return string
*/
public function get_reference()
{
return '';
}
/**
* Get the forum of the notification reference (fall back)
*
* @return string
*/
public function get_forum()
{
return '';
}
/**
* Get the reason for the notifcation (fall back)
*
* @return string
*/
public function get_reason()
{
return '';
}
/**
* Get the special items to load (fall back)
*

View File

@@ -30,6 +30,16 @@ class disapprove_post extends \phpbb\notification\type\approve_post
return 'disapprove_post';
}
/**
* Get the CSS style class of the notification
*
* @return string
*/
public function get_style_class()
{
return 'notification-disapproved';
}
/**
* Language key used to output the text
*
@@ -62,10 +72,32 @@ class disapprove_post extends \phpbb\notification\type\approve_post
* @return string
*/
public function get_title()
{
return $this->user->lang($this->language_key);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
$this->language_key,
censor_text($this->get_data('topic_title')),
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('topic_title'))
);
}
/**
* Get the reason for the disapproval notification
*
* @return string
*/
public function get_reason()
{
return $this->user->lang(
'NOTIFICATION_REASON',
$this->get_data('disapprove_reason')
);
}

View File

@@ -30,6 +30,16 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
return 'disapprove_topic';
}
/**
* Get the CSS style class of the notification
*
* @return string
*/
public function get_style_class()
{
return 'notification-disapproved';
}
/**
* Language key used to output the text
*
@@ -62,10 +72,32 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
* @return string
*/
public function get_title()
{
return $this->user->lang($this->language_key);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
$this->language_key,
censor_text($this->get_data('topic_title')),
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('topic_title'))
);
}
/**
* Get the reason for the disapproval notification
*
* @return string
*/
public function get_reason()
{
return $this->user->lang(
'NOTIFICATION_REASON',
$this->get_data('disapprove_reason')
);
}

View File

@@ -111,7 +111,20 @@ class pm extends \phpbb\notification\type\base
{
$username = $this->user_loader->get_username($this->get_data('from_user_id'), 'no_profile');
return $this->user->lang('NOTIFICATION_PM', $username, $this->get_data('message_subject'));
return $this->user->lang('NOTIFICATION_PM', $username);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
'NOTIFICATION_REFERENCE',
$this->get_data('message_subject')
);
}
/**

View File

@@ -225,11 +225,23 @@ class post extends \phpbb\notification\type\base
return $this->user->lang(
$this->language_key,
phpbb_generate_string_list($usernames, $this->user),
censor_text($this->get_data('topic_title')),
$responders_cnt
);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('topic_title'))
);
}
/**
* Get email template
*

View File

@@ -30,6 +30,16 @@ class report_pm extends \phpbb\notification\type\pm
return 'report_pm';
}
/**
* Get the CSS style class of the notification
*
* @return string
*/
public function get_style_class()
{
return 'notification-reported';
}
/**
* Language key used to output the text
*
@@ -159,12 +169,36 @@ class report_pm extends \phpbb\notification\type\pm
$username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
return $this->user->lang(
$this->language_key,
$username
);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('message_subject'))
);
}
/**
* Get the reason for the notification
*
* @return string
*/
public function get_reason()
{
if ($this->get_data('report_text'))
{
return $this->user->lang(
$this->language_key,
$username,
censor_text($this->get_data('message_subject')),
'NOTIFICATION_REASON',
$this->get_data('report_text')
);
}
@@ -172,17 +206,13 @@ class report_pm extends \phpbb\notification\type\pm
if (isset($this->user->lang[$this->get_data('reason_title')]))
{
return $this->user->lang(
$this->language_key,
$username,
censor_text($this->get_data('message_subject')),
'NOTIFICATION_REASON',
$this->user->lang[$this->get_data('reason_title')]
);
}
return $this->user->lang(
$this->language_key,
$username,
censor_text($this->get_data('message_subject')),
'NOTIFICATION_REASON',
$this->get_data('reason_description')
);
}

View File

@@ -107,7 +107,19 @@ class report_pm_closed extends \phpbb\notification\type\pm
return $this->user->lang(
$this->language_key,
$username,
$username
);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('message_subject'))
);
}

View File

@@ -29,6 +29,16 @@ class report_post extends \phpbb\notification\type\post_in_queue
return 'report_post';
}
/**
* Get the CSS style class of the notification
*
* @return string
*/
public function get_style_class()
{
return 'notification-reported';
}
/**
* Language key used to output the text
*
@@ -132,12 +142,36 @@ class report_post extends \phpbb\notification\type\post_in_queue
$username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
return $this->user->lang(
$this->language_key,
$username
);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('post_subject'))
);
}
/**
* Get the reason for the notification
*
* @return string
*/
public function get_reason()
{
if ($this->get_data('report_text'))
{
return $this->user->lang(
$this->language_key,
$username,
censor_text($this->get_data('post_subject')),
'NOTIFICATION_REASON',
$this->get_data('report_text')
);
}
@@ -145,17 +179,13 @@ class report_post extends \phpbb\notification\type\post_in_queue
if (isset($this->user->lang[$this->get_data('reason_title')]))
{
return $this->user->lang(
$this->language_key,
$username,
censor_text($this->get_data('post_subject')),
'NOTIFICATION_REASON',
$this->user->lang[$this->get_data('reason_title')]
);
}
return $this->user->lang(
$this->language_key,
$username,
censor_text($this->get_data('post_subject')),
'NOTIFICATION_REASON',
$this->get_data('reason_description')
);
}

View File

@@ -114,7 +114,19 @@ class report_post_closed extends \phpbb\notification\type\post
return $this->user->lang(
$this->language_key,
$username,
$username
);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('post_subject'))
);
}

View File

@@ -151,8 +151,32 @@ class topic extends \phpbb\notification\type\base
return $this->user->lang(
$this->language_key,
$username,
censor_text($this->get_data('topic_title')),
$username
);
}
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference()
{
return $this->user->lang(
'NOTIFICATION_REFERENCE',
censor_text($this->get_data('topic_title'))
);
}
/**
* Get the forum of the notification reference
*
* @return string
*/
public function get_forum()
{
return $this->user->lang(
'NOTIFICATION_FORUM',
$this->get_data('forum_name')
);
}

View File

@@ -87,6 +87,13 @@ interface type_interface
*/
public function load_special($data, $notifications);
/**
* Get the CSS style class of the notification
*
* @return string
*/
public function get_style_class();
/**
* Get the HTML formatted title of this notification
*
@@ -94,6 +101,20 @@ interface type_interface
*/
public function get_title();
/**
* Get the HTML formatted reference of the notification
*
* @return string
*/
public function get_reference();
/**
* Get the forum of the notification reference
*
* @return string
*/
public function get_forum();
/**
* Get the url to this item
*