Skip to content

Commit b5abfd1

Browse files
author
Leinad4Mind
committed
Simplify solution
1 parent 523dcee commit b5abfd1

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

core/config/services_controller.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ services:
193193
- '@phpbbgallery.core.image'
194194
- '@phpbbgallery.core.notification.helper'
195195
- '@phpbbgallery.core.url'
196-
- '@phpbbgallery.core.config'
197196
- '@phpbbgallery.core.log'
198197
- '@phpbbgallery.core.report'
199198
- '@user_loader'

core/controller/moderate.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ class moderate
6262
/** @var \phpbbgallery\core\url */
6363
protected $url;
6464

65-
/** @var \phpbbgallery\core\config */
66-
protected $gallery_config;
67-
6865
/** @var \phpbbgallery\core\log */
6966
protected $gallery_log;
7067

@@ -97,7 +94,6 @@ class moderate
9794
* @param \phpbbgallery\core\image\image $image
9895
* @param \phpbbgallery\core\notification\helper $notification_helper
9996
* @param \phpbbgallery\core\url $url
100-
* @param \phpbbgallery\core\config $gallery_config
10197
* @param \phpbbgallery\core\log $gallery_log
10298
* @param \phpbbgallery\core\report $report
10399
* @param \phpbb\user_loader $user_loader
@@ -110,7 +106,7 @@ public function __construct(\phpbb\config\config $config, \phpbb\request\request
110106
\phpbb\template\template $template, \phpbb\user $user, \phpbb\language\language $language,
111107
\phpbb\controller\helper $helper, \phpbbgallery\core\album\display $display, \phpbbgallery\core\moderate $moderate,
112108
\phpbbgallery\core\auth\auth $gallery_auth, \phpbbgallery\core\misc $misc, \phpbbgallery\core\album\album $album, \phpbbgallery\core\image\image $image,
113-
\phpbbgallery\core\notification\helper $notification_helper, \phpbbgallery\core\url $url, \phpbbgallery\core\config $gallery_config, \phpbbgallery\core\log $gallery_log,
109+
\phpbbgallery\core\notification\helper $notification_helper, \phpbbgallery\core\url $url, \phpbbgallery\core\log $gallery_log,
114110
\phpbbgallery\core\report $report, \phpbb\user_loader $user_loader,
115111
$root_path, $php_ext)
116112
{
@@ -128,7 +124,6 @@ public function __construct(\phpbb\config\config $config, \phpbb\request\request
128124
$this->image = $image;
129125
$this->notification_helper = $notification_helper;
130126
$this->url = $url;
131-
$this->gallery_config = $gallery_config;
132127
$this->gallery_log = $gallery_log;
133128
$this->report = $report;
134129
$this->user_loader = $user_loader;
@@ -329,8 +324,8 @@ public function action_log($page, $album_id)
329324
'U_GALLERY_MCP_LOGS' => $album_id > 0 ? $this->helper->route('phpbbgallery_core_moderate_action_log_album', array('album_id' => $album_id)) : $this->helper->route('phpbbgallery_core_moderate_action_log'),
330325
'U_ALBUM_NAME' => $album_id > 0 ? $album['album_name'] : false,
331326
));
332-
$limit = $this->gallery_config->get('items_per_page');
333-
$this->gallery_log->build_list('moderator', $limit, $page, $album_id);
327+
328+
$this->gallery_log->build_list('moderator', 0, $page, $album_id);
334329
return $this->helper->render('gallery/moderate_actions.html', $this->language->lang('GALLERY'));
335330
}
336331

core/log.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ public function build_list($type, $limit = 0, $page = 1, $album = 0, $image = 0,
132132
if ($limit == 0)
133133
{
134134
$limit = $this->gallery_config->get('items_per_page');
135-
$page = (int) ($page / $limit) + 1;
135+
// If its called from ACP album is -1, if from MCP then is not
136+
if ($album == -1)
137+
{
138+
$page = (int) ($page / $limit) + 1;
139+
}
136140
}
137141
$this->language->add_lang(['info_acp_gallery_logs'], 'phpbbgallery/core');
138142

tests/controller/gallery_moderate_test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public function get_controller($user_id, $group, $is_registered)
6363
$this->gallery_image,
6464
$this->gallery_notification_helper,
6565
$this->gallery_url,
66-
$this->gallery_config,
6766
$this->log,
6867
$this->gallery_report,
6968
$this->user_loader,

0 commit comments

Comments
 (0)