Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/notification/events/phpbbgallery_image_approved.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function get_email_template_variables()
*/
public function get_url()
{
return $this->get_data('album_url');
return $this->get_data('album_id') ? append_sid($this->phpbb_root_path . 'gallery/album/' . $this->get_data('album_id')) : $this->get_data('album_url');
}

/**
Expand All @@ -166,6 +166,7 @@ public function create_insert_array($data, $pre_create_data = array())
{
$this->set_data('album_name', $data['album_name']);
$this->set_data('album_url', $data['album_url']);
$this->set_data('album_id', $data['album_id']);
parent::create_insert_array($data, $pre_create_data);
}
}
7 changes: 4 additions & 3 deletions core/notification/events/phpbbgallery_image_for_approval.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function is_available()
*/
public static function get_item_id($data)
{
return $data['last_image_id'];
return (int) $data['last_image_id'];
}

/**
Expand All @@ -78,7 +78,7 @@ public static function get_item_id($data)
public static function get_item_parent_id($data)
{
// No parent
return $data['album_id'];
return (int) $data['album_id'];
}

/**
Expand Down Expand Up @@ -155,7 +155,7 @@ public function get_email_template_variables()
*/
public function get_url()
{
return $this->get_data('album_url');
return $this->get_data('album_id') ? append_sid($this->phpbb_root_path . 'gallery/album/' . $this->get_data('album_id')) : $this->get_data('album_url');
}

/**
Expand All @@ -181,6 +181,7 @@ public function create_insert_array($data, $pre_create_data = array())
{
$this->set_data('album_name', $data['album_name']);
$this->set_data('album_url', $data['album_url']);
$this->set_data('album_id', $data['album_id']);
$this->set_data('uploader', $data['uploader']);
parent::create_insert_array($data, $pre_create_data);
}
Expand Down
3 changes: 2 additions & 1 deletion core/notification/events/phpbbgallery_image_not_approved.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function get_email_template_variables()
*/
public function get_url()
{
return $this->get_data('album_url');
return $this->get_data('album_id') ? append_sid($this->phpbb_root_path . 'gallery/album/' . $this->get_data('album_id')) : $this->get_data('album_url');
}

/**
Expand All @@ -166,6 +166,7 @@ public function create_insert_array($data, $pre_create_data = array())
{
$this->set_data('album_name', $data['album_name']);
$this->set_data('album_url', $data['album_url']);
$this->set_data('album_id', $data['album_id']);
parent::create_insert_array($data, $pre_create_data);
}
}
6 changes: 3 additions & 3 deletions core/notification/events/phpbbgallery_new_comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function is_available()
*/
public static function get_item_id($data)
{
return $data['comment_id'];
return (int) $data['comment_id'];
}

/**
Expand All @@ -78,7 +78,7 @@ public static function get_item_id($data)
public static function get_item_parent_id($data)
{
// No parent
return $data['image_id'];
return (int) $data['image_id'];
}

/**
Expand Down Expand Up @@ -155,7 +155,7 @@ public function get_email_template_variables()
*/
public function get_url()
{
return $this->get_data('url');
return $this->get_data('image_id') ? append_sid($this->phpbb_root_path . 'gallery/image/' . $this->get_data('image_id')) : $this->get_data('url');
}

/**
Expand Down
7 changes: 4 additions & 3 deletions core/notification/events/phpbbgallery_new_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function is_available()
*/
public static function get_item_id($data)
{
return $data['last_image_id'];
return (int) $data['last_image_id'];
}

/**
Expand All @@ -78,7 +78,7 @@ public static function get_item_id($data)
public static function get_item_parent_id($data)
{
// No parent
return $data['album_id'];
return (int) $data['album_id'];
}

/**
Expand Down Expand Up @@ -149,7 +149,7 @@ public function get_email_template_variables()
*/
public function get_url()
{
return $this->get_data('album_url');
return $this->get_data('album_id') ? append_sid($this->phpbb_root_path . 'gallery/album/' . $this->get_data('album_id')) : $this->get_data('album_url');
}

/**
Expand All @@ -175,6 +175,7 @@ public function create_insert_array($data, $pre_create_data = array())
{
$this->set_data('album_name', $data['album_name']);
$this->set_data('album_url', $data['album_url']);
$this->set_data('album_id', $data['album_id']);
parent::create_insert_array($data, $pre_create_data);
}
}
7 changes: 4 additions & 3 deletions core/notification/events/phpbbgallery_new_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function is_available()
*/
public static function get_item_id($data)
{
return $data['item_id'];
return (int) $data['item_id'];
}

/**
Expand Down Expand Up @@ -154,7 +154,7 @@ public function users_to_query()
*/
public function get_url()
{
return $this->get_data('url');
return $this->get_data('reported_image_id') ? append_sid($this->phpbb_root_path . 'gallery/moderate/image/' . $this->get_data('reported_image_id')) : $this->get_data('url');
}

/**
Expand All @@ -170,7 +170,8 @@ public function create_insert_array($data, $pre_create_data = array())
{
$this->set_data('item_id', $data['item_id']);
$this->set_data('reporter', $data['reporter']);
$this->set_data('reported_image_id', $data['reported_image_id']);
$this->set_data('url', $data['url']);
return parent::create_insert_array($data, $pre_create_data);
parent::create_insert_array($data, $pre_create_data);
}
}
1 change: 1 addition & 0 deletions core/notification/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public function notify($type, $target)
'user_ids' => array_diff($this->gallery_auth->acl_users_ids('m_report', $target['reported_album_id']), array($target['reporter_id'])),
'item_id' => $target['report_id'],
'reporter' => $target['reporter_id'],
'reported_image_id' => $target['reported_image_id'],
'url' => $this->url->get_uri($this->helper->route('phpbbgallery_core_moderate_image', array('image_id' => $target['reported_image_id']))),
);
$phpbb_notifications->add_notifications('phpbbgallery.core.notification.new_report', $notification_data);
Expand Down
Loading