Skip to content
Open
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
11 changes: 9 additions & 2 deletions core/acp/config_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

class config_module
{
/** @var \phpbb\language\language */
public $language;
public $new_config;
public $tpl_name;
public $page_title;
public $u_action;

/**
* This function is called, when the main() function is called.
* You can use this function to add your language files, check for a valid mode, unset config options and more.
Expand All @@ -37,7 +44,7 @@ public function main($id, $mode)
$this->language = $phpbb_container->get('language');
$this->language->add_lang(array('gallery', 'gallery_acp'), 'phpbbgallery/core');

$submit = (isset($_POST['submit'])) ? true : false;
$submit = $request->is_set_post('submit');
$form_key = 'acp_time';
add_form_key($form_key);

Expand All @@ -52,7 +59,7 @@ public function main($id, $mode)
// Init gallery configs class
$phpbb_gallery_configs = new \phpbbgallery\core\config($config);
$this->new_config = $phpbb_gallery_configs->get_all();
$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc($request->variable('config', array('' => ''), true)) : $this->new_config;
$cfg_array = $request->is_set_post('config') ? utf8_normalize_nfc($request->variable('config', array('' => ''), true)) : $this->new_config;
$error = array();

// We validate the complete config if whished
Expand Down
4 changes: 4 additions & 0 deletions core/acp/gallery_logs_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
class gallery_logs_module
{
var $u_action;
/** @var \phpbb\language\language */
var $language;
var $tpl_name;
var $page_title;

function main($id, $mode)
{
Expand Down
11 changes: 10 additions & 1 deletion core/acp/main_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
class main_module
{
var $u_action;
/** @var \phpbb\language\language */
var $language;
var $tpl_name;
var $page_title;

function main($id, $mode)
{
Expand Down Expand Up @@ -562,6 +566,11 @@ function overview()
$dir_sizes = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

$gallery_version = $phpbb_container
->get('ext.manager')
->create_extension_metadata_manager('phpbbgallery/core')
->get_metadata('version');

$template->assign_vars(array(
'S_GALLERY_OVERVIEW' => true,
'ACP_GALLERY_TITLE' => $this->language->lang('ACP_GALLERY_OVERVIEW'),
Expand All @@ -574,7 +583,7 @@ function overview()
'GUPLOAD_DIR_SIZE' => get_formatted_filesize($dir_sizes['stat']),
'MEDIUM_DIR_SIZE' => get_formatted_filesize($dir_sizes['stat_medium']),
'CACHE_DIR_SIZE' => get_formatted_filesize($dir_sizes['stat_cache']),
'GALLERY_VERSION' => $config['phpbb_gallery_version'],
'GALLERY_VERSION' => $gallery_version,
'U_FIND_USERNAME' => $gallery_url->append_sid('phpbb', 'memberlist', 'mode=searchuser&form=action_create_pega_form&field=username&select_single=true'),
'S_SELECT_ALBUM' => $phpbb_ext_gallery_core_album->get_albumbox(false, 'reset_album_id', false, false, false, (int) \phpbbgallery\core\block::PUBLIC_ALBUM, (int) \phpbbgallery\core\block::TYPE_UPLOAD),

Expand Down
10 changes: 5 additions & 5 deletions core/acp/permissions_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function main($id, $mode)
$this->tpl_name = 'gallery_permissions';
$this->page_title = $this->language->lang('ALBUM_AUTH_TITLE');
add_form_key('acp_gallery');
$submit = (isset($_POST['submit_edit_options'])) ? true : ((isset($_POST['submit_add_options'])) ? true : false);
$submit = $request->is_set_post('submit_edit_options') || $request->is_set_post('submit_add_options');
$action = $request->variable('action', '');

/**
Expand Down Expand Up @@ -164,8 +164,8 @@ private function permissions_v_mask()

$this->language->add_lang('acp/permissions');

$submit = (isset($_POST['submit'])) ? true : false;
$delete = (isset($_POST['delete'])) ? true : false;
$submit = $request->is_set_post('submit');
$delete = $request->is_set_post('delete');
$album_id = $request->variable('album_id', array(0));
$group_id = $request->variable('group_id', array(0));
$user_id = $request->variable('user_id', array(0));
Expand Down Expand Up @@ -679,7 +679,7 @@ private function permissions_set()
$phpbb_ext_gallery_core_auth = $phpbb_container->get('phpbbgallery.core.auth');

// Send constants to the template
$submit = (isset($_POST['submit'])) ? true : false;
$submit = $request->is_set_post('submit');
$album_id = $request->variable('album_id', array(0));
$group_id = $request->variable('group_id', array(0));
$user_id = $request->variable('user_id', array(0));
Expand Down Expand Up @@ -1018,7 +1018,7 @@ private function copy_album_permissions()
$phpbb_ext_gallery_core_album = $phpbb_container->get('phpbbgallery.core.album');
$this->language = $phpbb_container->get('language');

$submit = isset($_POST['submit']) ? true : false;
$submit = $request->is_set_post('submit');

if ($submit)
{
Expand Down
9 changes: 5 additions & 4 deletions core/album/display.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ public function get_parents($album_data)

if ($album_data['parent_id'] > 0)
{
if ($album_data['album_parents'] == '')
$cached_parents = json_decode($album_data['album_parents'], true);
if (!is_array($cached_parents))
{
$sql = 'SELECT album_id, album_name, album_type
FROM ' . $this->table_albums . '
Expand All @@ -222,7 +223,7 @@ public function get_parents($album_data)
}
$this->db->sql_freeresult($result);

$album_data['album_parents'] = serialize($album_parents);
$album_data['album_parents'] = json_encode($album_parents, JSON_UNESCAPED_UNICODE);

$sql = 'UPDATE ' . $this->table_albums . "
SET album_parents = '" . $this->db->sql_escape($album_data['album_parents']) . "'
Expand All @@ -231,7 +232,7 @@ public function get_parents($album_data)
}
else
{
$album_parents = @unserialize($album_data['album_parents']);
$album_parents = $cached_parents;
}
}

Expand Down Expand Up @@ -390,7 +391,7 @@ public function display_albums($root_data = '', $display_moderators = true, $ret
),
),

'WHERE' => 'a.parent_id = 0 AND ' . $sql_where,
'WHERE' => implode(' AND ', array('a.parent_id = 0', $sql_where)),
);
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
Expand Down
2 changes: 1 addition & 1 deletion core/auth/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ protected function restrict_pegas($user_id)

$zebra = null;

$albums = array();//@todo $this->cache->obtain_album_list();
$albums = $this->cache->get_albums();
foreach ($albums as $album)
{
if (!$album['album_auth_access'] || ($album['album_user_id'] == self::PUBLIC_ALBUM))# || ($album['album_user_id'] == $user_id))
Expand Down
Loading
Loading