Merge pull request #348 from marc1706/ticket/346
[ticket/346] Remove usage of legacy phpBB functions and methods
This commit is contained in:
@@ -15,13 +15,13 @@ class portal_module
|
||||
public $new_config = array();
|
||||
protected $c_class;
|
||||
protected $db, $user, $cache, $template, $display_vars, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
|
||||
protected $root_path, $version_check, $request, $php_ext, $portal_helper, $modules_helper;
|
||||
protected $root_path, $version_check, $request, $php_ext, $portal_helper, $modules_helper, $log;
|
||||
public $module_column = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $db, $user, $cache, $request, $template, $table_prefix;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpbb_container, $phpEx;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpbb_container, $phpEx, $phpbb_log;
|
||||
|
||||
$user->add_lang_ext('board3/portal', array('portal', 'portal_acp'));
|
||||
|
||||
@@ -42,6 +42,7 @@ class portal_module
|
||||
$this->version_check = $this->phpbb_container->get('board3.version.check');
|
||||
$this->portal_helper = $this->phpbb_container->get('board3.portal.helper');
|
||||
$this->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper');
|
||||
$this->log = $phpbb_log;
|
||||
define('PORTAL_MODULES_TABLE', $this->phpbb_container->getParameter('board3.modules.table'));
|
||||
define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.config.table'));
|
||||
|
||||
@@ -218,7 +219,7 @@ class portal_module
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
set_config($config_name, $config_value);
|
||||
$this->config->set($config_name, $config_value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,12 +270,12 @@ class portal_module
|
||||
{
|
||||
if (isset($module_data) && $module_data['module_classname'] !== '\board3\portal\modules\custom')
|
||||
{
|
||||
add_log('admin', 'LOG_PORTAL_CONFIG', $module_name);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_CONFIG', false, array($module_name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
add_log('admin', 'LOG_PORTAL_CONFIG', $this->user->lang['ACP_PORTAL_' . strtoupper($mode) . '_INFO']);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_CONFIG', false, array($this->user->lang['ACP_PORTAL_' . strtoupper($mode) . '_INFO']));
|
||||
}
|
||||
trigger_error($this->user->lang['CONFIG_UPDATED'] . ((!empty($img_error) ? '<br /><br />' . $this->user->lang['MODULE_IMAGE_ERROR'] . '<br />' . $img_error : '')) . adm_back_link(($module_id) ? append_sid("{$this->phpbb_root_path}adm/index.{$this->php_ext}", 'i=\board3\portal\acp\portal_module&mode=modules') : $this->u_action));
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ services:
|
||||
- %core.php_ext%
|
||||
- @user
|
||||
- @path_helper
|
||||
- @log
|
||||
tags:
|
||||
- { name: board3.module }
|
||||
|
||||
@@ -71,6 +72,7 @@ services:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- @user
|
||||
- @log
|
||||
tags:
|
||||
- { name: board3.module }
|
||||
|
||||
@@ -158,6 +160,7 @@ services:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- @user
|
||||
- @log
|
||||
tags:
|
||||
- { name: board3.module }
|
||||
|
||||
@@ -171,6 +174,7 @@ services:
|
||||
- %core.root_path%
|
||||
- %core.php_ext%
|
||||
- @user
|
||||
- @log
|
||||
tags:
|
||||
- { name: board3.module }
|
||||
|
||||
|
||||
@@ -471,15 +471,15 @@ class announcements extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_announcements_style_' . $module_id, 0);
|
||||
set_config('board3_number_of_announcements_' . $module_id, 1);
|
||||
set_config('board3_announcements_day_' . $module_id, 0);
|
||||
set_config('board3_announcements_length_' . $module_id, 200);
|
||||
set_config('board3_global_announcements_forum_' . $module_id, '');
|
||||
set_config('board3_announcements_forum_exclude_' . $module_id, 0);
|
||||
set_config('board3_announcements_archive_' . $module_id, 1);
|
||||
set_config('board3_announcements_permissions_' . $module_id, 1);
|
||||
set_config('board3_show_announcements_replies_views_' . $module_id, 1);
|
||||
$this->config->set('board3_announcements_style_' . $module_id, 0);
|
||||
$this->config->set('board3_number_of_announcements_' . $module_id, 1);
|
||||
$this->config->set('board3_announcements_day_' . $module_id, 0);
|
||||
$this->config->set('board3_announcements_length_' . $module_id, 200);
|
||||
$this->config->set('board3_global_announcements_forum_' . $module_id, '');
|
||||
$this->config->set('board3_announcements_forum_exclude_' . $module_id, 0);
|
||||
$this->config->set('board3_announcements_archive_' . $module_id, 1);
|
||||
$this->config->set('board3_announcements_permissions_' . $module_id, 1);
|
||||
$this->config->set('board3_show_announcements_replies_views_' . $module_id, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -134,12 +134,12 @@ class attachments extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_attachments_number_' . $module_id, 8);
|
||||
set_config('board3_attach_max_length_' . $module_id, 15);
|
||||
set_config('board3_attachments_forum_ids_' . $module_id, '');
|
||||
set_config('board3_attachments_forum_exclude_' . $module_id, 0);
|
||||
set_config('board3_attachments_filetype_' . $module_id, '');
|
||||
set_config('board3_attachments_exclude_' . $module_id, 0);
|
||||
$this->config->set('board3_attachments_number_' . $module_id, 8);
|
||||
$this->config->set('board3_attach_max_length_' . $module_id, 15);
|
||||
$this->config->set('board3_attachments_forum_ids_' . $module_id, '');
|
||||
$this->config->set('board3_attachments_forum_exclude_' . $module_id, 0);
|
||||
$this->config->set('board3_attachments_filetype_' . $module_id, '');
|
||||
$this->config->set('board3_attachments_exclude_' . $module_id, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ class attachments extends module_base
|
||||
|
||||
$filetypes = implode(',', $values);
|
||||
|
||||
set_config('board3_attachments_filetype_' . $module_id, $filetypes);
|
||||
$this->config->set('board3_attachments_filetype_' . $module_id, $filetypes);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ class birthday_list extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_birthdays_ahead_' . $module_id, 30);
|
||||
$this->config->set('board3_birthdays_ahead_' . $module_id, 30);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +112,9 @@ class calendar extends module_base
|
||||
/** @var string Portal root path */
|
||||
protected $portal_root_path;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log */
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a calendar object
|
||||
*
|
||||
@@ -123,8 +126,9 @@ class calendar extends module_base
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\path_helper $path_helper phpBB path helper
|
||||
* @param \phpbb\log\log $log phpBB log object
|
||||
*/
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user, $path_helper)
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user, $path_helper, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->template = $template;
|
||||
@@ -134,6 +138,7 @@ class calendar extends module_base
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->user = $user;
|
||||
$this->path_helper = $path_helper;
|
||||
$this->log = $log;
|
||||
$this->portal_root_path = $this->path_helper->get_web_root_path() . $this->phpbb_root_path . 'ext/board3/portal/';
|
||||
}
|
||||
|
||||
@@ -356,13 +361,13 @@ class calendar extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_sunday_first_' . $module_id, 1);
|
||||
set_config('board3_calendar_today_color_' . $module_id, '#000000');
|
||||
set_config('board3_calendar_sunday_color_' . $module_id, '#FF0000');
|
||||
set_config('board3_long_month_' . $module_id, 0);
|
||||
set_config('board3_display_events_' . $module_id, 0);
|
||||
set_config('board3_events_' . $module_id, '');
|
||||
set_config('board3_events_url_new_window_' . $module_id, 0);
|
||||
$this->config->set('board3_sunday_first_' . $module_id, 1);
|
||||
$this->config->set('board3_calendar_today_color_' . $module_id, '#000000');
|
||||
$this->config->set('board3_calendar_sunday_color_' . $module_id, '#FF0000');
|
||||
$this->config->set('board3_long_month_' . $module_id, 0);
|
||||
$this->config->set('board3_display_events_' . $module_id, 0);
|
||||
$this->config->set('board3_events_' . $module_id, '');
|
||||
$this->config->set('board3_events_url_new_window_' . $module_id, 0);
|
||||
|
||||
set_portal_config('board3_calendar_events_' . $module_id, '');
|
||||
return true;
|
||||
@@ -497,7 +502,7 @@ class calendar extends module_base
|
||||
'url' => htmlspecialchars_decode($event_url),
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_EVENT_UPDATED', $event_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_UPDATED', false, array($event_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -512,7 +517,7 @@ class calendar extends module_base
|
||||
'permission' => $event_permission,
|
||||
'url' => $event_url, // optional
|
||||
);
|
||||
add_log('admin', 'LOG_PORTAL_EVENT_ADDED', $event_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_ADDED', false, array($event_title));
|
||||
}
|
||||
|
||||
// we sort the $events array by the start time
|
||||
@@ -546,7 +551,7 @@ class calendar extends module_base
|
||||
$board3_events_array = serialize($events);
|
||||
set_portal_config('board3_calendar_events_' . $module_id, $board3_events_array);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_EVENT_REMOVED', $cur_event_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_REMOVED', false, array($cur_event_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -68,6 +68,9 @@ class custom extends module_base
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log*/
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a custom module object
|
||||
*
|
||||
@@ -78,8 +81,9 @@ class custom extends module_base
|
||||
* @param string $phpEx php file extension
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\log\log $log phpBB log
|
||||
*/
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user)
|
||||
public function __construct($config, $template, $db, $request, $phpbb_root_path, $phpEx, $user, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->template = $template;
|
||||
@@ -88,6 +92,7 @@ class custom extends module_base
|
||||
$this->php_ext = $phpEx;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->user = $user;
|
||||
$this->log = $log;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,13 +131,13 @@ class custom extends module_base
|
||||
public function install($module_id)
|
||||
{
|
||||
set_portal_config('board3_custom_' . $module_id . '_code', '');
|
||||
set_config('board3_custom_' . $module_id . '_code', '');
|
||||
set_config('board3_custom_' . $module_id . '_bbcode', 1);
|
||||
set_config('board3_custom_' . $module_id . '_title', '');
|
||||
set_config('board3_custom_' . $module_id . '_image_src', '');
|
||||
set_config('board3_custom_' . $module_id . '_uid', '');
|
||||
set_config('board3_custom_' . $module_id . '_bitfield', '');
|
||||
set_config('board3_custom_' . $module_id . '_permission', '');
|
||||
$this->config->set('board3_custom_' . $module_id . '_code', '');
|
||||
$this->config->set('board3_custom_' . $module_id . '_bbcode', 1);
|
||||
$this->config->set('board3_custom_' . $module_id . '_title', '');
|
||||
$this->config->set('board3_custom_' . $module_id . '_image_src', '');
|
||||
$this->config->set('board3_custom_' . $module_id . '_uid', '');
|
||||
$this->config->set('board3_custom_' . $module_id . '_bitfield', '');
|
||||
$this->config->set('board3_custom_' . $module_id . '_permission', '');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -232,16 +237,16 @@ class custom extends module_base
|
||||
$log_title = $custom_title;
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_CONFIG', $this->user->lang['PORTAL_CUSTOM'] . ': ' . $log_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_CONFIG', false, array($this->user->lang['PORTAL_CUSTOM'] . ': ' . $log_title));
|
||||
|
||||
// set_portal_config will take care of escaping the welcome message
|
||||
set_portal_config('board3_custom_' . $module_id . '_code', $custom_code);
|
||||
set_config('board3_custom_' . $module_id . '_bbcode', $custom_bbcode);
|
||||
set_config('board3_custom_' . $module_id . '_title', $custom_title);
|
||||
set_config('board3_custom_' . $module_id . '_image_src', $custom_image_src);
|
||||
set_config('board3_custom_' . $module_id . '_uid', $uid);
|
||||
set_config('board3_custom_' . $module_id . '_bitfield', $bitfield);
|
||||
set_config('board3_custom_' . $module_id . '_permission', $custom_permission);
|
||||
$this->config->set('board3_custom_' . $module_id . '_bbcode', $custom_bbcode);
|
||||
$this->config->set('board3_custom_' . $module_id . '_title', $custom_title);
|
||||
$this->config->set('board3_custom_' . $module_id . '_image_src', $custom_image_src);
|
||||
$this->config->set('board3_custom_' . $module_id . '_uid', $uid);
|
||||
$this->config->set('board3_custom_' . $module_id . '_bitfield', $bitfield);
|
||||
$this->config->set('board3_custom_' . $module_id . '_permission', $custom_permission);
|
||||
|
||||
//trigger_error($this->user->lang['CONFIG_UPDATED'] . adm_back_link(($module_id) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=portal&mode=modules') : $u_action));
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@ class modulename extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_configname_' . $module_id, 'Hello World!');
|
||||
set_config('board3_configname2_' . $module_id, 1337);
|
||||
$this->config->set('board3_configname_' . $module_id, 'Hello World!');
|
||||
$this->config->set('board3_configname2_' . $module_id, 1337);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,8 +110,8 @@ class donation extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_pay_acc_' . $module_id, 'your@paypal.com');
|
||||
set_config('board3_pay_custom_' . $module_id, true);
|
||||
$this->config->set('board3_pay_acc_' . $module_id, 'your@paypal.com');
|
||||
$this->config->set('board3_pay_custom_' . $module_id, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ class friends extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_max_online_friends_' . $module_id, 8);
|
||||
$this->config->set('board3_max_online_friends_' . $module_id, 8);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class latest_bots extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_last_visited_bots_number_' . $module_id, 1);
|
||||
$this->config->set('board3_last_visited_bots_number_' . $module_id, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class latest_members extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_max_last_member_' . $module_id, 8);
|
||||
$this->config->set('board3_max_last_member_' . $module_id, 8);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ class leaders extends module_base
|
||||
public function install($module_id)
|
||||
{
|
||||
// Show normal team block by default
|
||||
set_config('board3_leaders_ext_' . $module_id, 0);
|
||||
$this->config->set('board3_leaders_ext_' . $module_id, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,9 @@ class links extends module_base
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log */
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a links object
|
||||
*
|
||||
@@ -84,8 +87,9 @@ class links extends module_base
|
||||
* @param string $phpEx php file extension
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\log\log phpBB log
|
||||
*/
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user)
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->db = $db;
|
||||
@@ -94,6 +98,7 @@ class links extends module_base
|
||||
$this->php_ext = $phpEx;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->user = $user;
|
||||
$this->log = $log;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,8 +198,8 @@ class links extends module_base
|
||||
|
||||
$board3_menu_array = serialize($links);
|
||||
set_portal_config('board3_links_array_' . $module_id, $board3_menu_array);
|
||||
set_config('board3_links_' . $module_id, '');
|
||||
set_config('board3_links_url_new_window_' . $module_id, 0);
|
||||
$this->config->set('board3_links_' . $module_id, '');
|
||||
$this->config->set('board3_links_url_new_window_' . $module_id, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -297,7 +302,7 @@ class links extends module_base
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_UPDATED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_UPDATED', false, array($link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -309,7 +314,7 @@ class links extends module_base
|
||||
'type' => $link_type,
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
add_log('admin', 'LOG_PORTAL_LINK_ADDED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'],'LOG_PORTAL_LINK_ADDED', false, array($link_title));
|
||||
}
|
||||
|
||||
$board3_links_array = serialize($links);
|
||||
@@ -337,7 +342,7 @@ class links extends module_base
|
||||
$board3_links_array = serialize($links);
|
||||
set_portal_config('board3_links_array_' . $module_id, $board3_links_array);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_REMOVED', $cur_link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_REMOVED', false, array($cur_link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -75,6 +75,9 @@ class main_menu extends module_base
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\log\log phpBB log */
|
||||
protected $log;
|
||||
|
||||
/**
|
||||
* Construct a main menu object
|
||||
*
|
||||
@@ -85,8 +88,9 @@ class main_menu extends module_base
|
||||
* @param string $phpbb_root_path phpBB root path
|
||||
* @param string $phpEx php file extension
|
||||
* @param \phpbb\user $user phpBB user object
|
||||
* @param \phpbb\log\log $log phpBB log
|
||||
*/
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user)
|
||||
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user, $log)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->db = $db;
|
||||
@@ -95,6 +99,7 @@ class main_menu extends module_base
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $phpEx;
|
||||
$this->user = $user;
|
||||
$this->log = $log;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,8 +253,8 @@ class main_menu extends module_base
|
||||
|
||||
$board3_menu_array = serialize($links);
|
||||
set_portal_config('board3_menu_array_' . $module_id, $board3_menu_array);
|
||||
set_config('board3_menu_' . $module_id, '');
|
||||
set_config('board3_menu_url_new_window_' . $module_id, 0);
|
||||
$this->config->set('board3_menu_' . $module_id, '');
|
||||
$this->config->set('board3_menu_url_new_window_' . $module_id, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -353,7 +358,7 @@ class main_menu extends module_base
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_UPDATED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_UPDATED', false, array($link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -369,7 +374,7 @@ class main_menu extends module_base
|
||||
'type' => $link_type,
|
||||
'permission' => $link_permissions,
|
||||
);
|
||||
add_log('admin', 'LOG_PORTAL_LINK_ADDED', $link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_ADDED', false, array($link_title));
|
||||
}
|
||||
|
||||
$board3_menu_array = serialize($links);
|
||||
@@ -397,7 +402,7 @@ class main_menu extends module_base
|
||||
$board3_menu_array = serialize($links);
|
||||
set_portal_config('board3_menu_array_' . $module_id, $board3_menu_array);
|
||||
|
||||
add_log('admin', 'LOG_PORTAL_LINK_REMOVED', $cur_link_title);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_LINK_REMOVED', false, array($cur_link_title));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -451,16 +451,16 @@ class news extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_news_length_' . $module_id, 250);
|
||||
set_config('board3_news_forum_' . $module_id, '');
|
||||
set_config('board3_news_permissions_' . $module_id, 1);
|
||||
set_config('board3_number_of_news_' . $module_id, 5);
|
||||
set_config('board3_show_all_news_' . $module_id, 1);
|
||||
set_config('board3_news_exclude_' . $module_id, 0);
|
||||
set_config('board3_news_archive_' . $module_id, 1);
|
||||
set_config('board3_news_show_last_' . $module_id, 0);
|
||||
set_config('board3_show_news_replies_views_' . $module_id, 1);
|
||||
set_config('board3_news_style_' . $module_id, 1);
|
||||
$this->config->set('board3_news_length_' . $module_id, 250);
|
||||
$this->config->set('board3_news_forum_' . $module_id, '');
|
||||
$this->config->set('board3_news_permissions_' . $module_id, 1);
|
||||
$this->config->set('board3_number_of_news_' . $module_id, 5);
|
||||
$this->config->set('board3_show_all_news_' . $module_id, 1);
|
||||
$this->config->set('board3_news_exclude_' . $module_id, 0);
|
||||
$this->config->set('board3_news_archive_' . $module_id, 1);
|
||||
$this->config->set('board3_news_show_last_' . $module_id, 0);
|
||||
$this->config->set('board3_show_news_replies_views_' . $module_id, 1);
|
||||
$this->config->set('board3_news_style_' . $module_id, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,11 +134,11 @@ class poll extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_poll_allow_vote_' . $module_id, 1);
|
||||
set_config('board3_poll_topic_id_' . $module_id, '');
|
||||
set_config('board3_poll_exclude_id_' . $module_id, 0);
|
||||
set_config('board3_poll_hide_' . $module_id, 0);
|
||||
set_config('board3_poll_limit_' . $module_id, 3);
|
||||
$this->config->set('board3_poll_allow_vote_' . $module_id, 1);
|
||||
$this->config->set('board3_poll_topic_id_' . $module_id, '');
|
||||
$this->config->set('board3_poll_exclude_id_' . $module_id, 0);
|
||||
$this->config->set('board3_poll_hide_' . $module_id, 0);
|
||||
$this->config->set('board3_poll_limit_' . $module_id, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class random_member extends module_base
|
||||
$result = $this->db->sql_query_limit($sql, 1);
|
||||
$row = $this->db->sql_fetchrow($result);
|
||||
|
||||
$avatar_img = get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $row['user_avatar_width'], $row['user_avatar_height']);
|
||||
$avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($row, 'user'), 'USER_AVATAR');
|
||||
|
||||
$rank_title = $rank_img = '';
|
||||
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||
@@ -128,9 +128,9 @@ class random_member extends module_base
|
||||
'USER_POSTS' => (int) $row['user_posts'],
|
||||
'AVATAR_IMG' => $avatar_img,
|
||||
'JOINED' => $this->user->format_date($row['user_regdate'], 'd.M.Y'),
|
||||
'USER_OCC' => censor_text($row['user_occ']),
|
||||
'USER_FROM' => censor_text($row['user_from']),
|
||||
'U_WWW' => censor_text($row['user_website']),
|
||||
// 'USER_OCC' => censor_text($row['user_occ']),
|
||||
// 'USER_FROM' => censor_text($row['user_from']),
|
||||
// 'U_WWW' => censor_text($row['user_website']),
|
||||
));
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
|
||||
@@ -230,10 +230,10 @@ class recent extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_max_topics_' . $module_id, 10);
|
||||
set_config('board3_recent_title_limit_' . $module_id, 100);
|
||||
set_config('board3_recent_forum_' . $module_id, '');
|
||||
set_config('board3_recent_exclude_forums_' . $module_id, 1);
|
||||
$this->config->set('board3_max_topics_' . $module_id, 10);
|
||||
$this->config->set('board3_recent_title_limit_' . $module_id, 100);
|
||||
$this->config->set('board3_recent_forum_' . $module_id, '');
|
||||
$this->config->set('board3_recent_exclude_forums_' . $module_id, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ class topposters extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_topposters_' . $module_id, 5);
|
||||
$this->config->set('board3_topposters_' . $module_id, 5);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ class user_menu extends module_base
|
||||
$user_id = $this->user->data['user_id'];
|
||||
$username = $this->user->data['username'];
|
||||
$colour = $this->user->data['user_colour'];
|
||||
$avatar_img = get_user_avatar($this->user->data['user_avatar'], $this->user->data['user_avatar_type'], $this->user->data['user_avatar_width'], $this->user->data['user_avatar_height']);
|
||||
$avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($this->user->data, 'user'), 'USER_AVATAR');
|
||||
$rank_title = $rank_img = '';
|
||||
\get_user_rank($this->user->data['user_rank'], $this->user->data['user_posts'], $rank_title, $rank_img, $rank_img_src);
|
||||
|
||||
@@ -216,7 +216,7 @@ class user_menu extends module_base
|
||||
*/
|
||||
public function install($module_id)
|
||||
{
|
||||
set_config('board3_user_menu_register_' . $module_id, 1);
|
||||
$this->config->set('board3_user_menu_register_' . $module_id, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,9 @@ class welcome extends module_base
|
||||
public function install($module_id)
|
||||
{
|
||||
set_portal_config('board3_welcome_message_' . $module_id, 'Welcome to my Community!');
|
||||
set_config('board3_welcome_message_' . $module_id, '');
|
||||
set_config('board3_welcome_message_uid_' . $module_id, '');
|
||||
set_config('board3_welcome_message_bitfield_' . $module_id, '');
|
||||
$this->config->set('board3_welcome_message_' . $module_id, '');
|
||||
$this->config->set('board3_welcome_message_uid_' . $module_id, '');
|
||||
$this->config->set('board3_welcome_message_bitfield_' . $module_id, '');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -195,8 +195,8 @@ class welcome extends module_base
|
||||
|
||||
// set_portal_config will take care of escaping the welcome message
|
||||
set_portal_config('board3_welcome_message_' . $module_id, $welcome_message);
|
||||
set_config('board3_welcome_message_uid_' . $module_id, $uid);
|
||||
set_config('board3_welcome_message_bitfield_' . $module_id, $bitfield);
|
||||
$this->config->set('board3_welcome_message_uid_' . $module_id, $uid);
|
||||
$this->config->set('board3_welcome_message_bitfield_' . $module_id, $bitfield);
|
||||
break;
|
||||
|
||||
case 'preview':
|
||||
|
||||
@@ -40,7 +40,7 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor
|
||||
'php'
|
||||
);
|
||||
self::$config = new \phpbb\config\config(array());
|
||||
$this->calendar = new \board3\portal\modules\calendar(array(), null, null, null, dirname(__FILE__) . '/../../../', 'php', null, $this->path_helper);
|
||||
$this->calendar = new \board3\portal\modules\calendar(self::$config, null, null, null, dirname(__FILE__) . '/../../../', 'php', null, $this->path_helper, null);
|
||||
define('PORTAL_MODULES_TABLE', 'phpbb_portal_modules');
|
||||
define('PORTAL_CONFIG_TABLE', 'phpbb_portal_config');
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put'));
|
||||
|
||||
Reference in New Issue
Block a user