Merge pull request #383 from marc1706/ticket/382

[ticket/382] Fix inheritdoc and functions_upload docblock
This commit is contained in:
Marc Alexander
2014-10-31 08:07:46 +01:00
30 changed files with 169 additions and 171 deletions

View File

@@ -266,7 +266,7 @@ class portal_upload
* @param $from string Can be a file or a directory. Will move either the file or all files within the directory
* @param $to string Where to move the file(s) to. If not specified then will get moved to the root folder
* @param $strip Used for FTP only
* @return mixed: Bool true on success, error string on failure, NULL if no action was taken
* @return mixed Bool true on success, error string on failure, NULL if no action was taken
*
* NOTE: function should preferably not return in case of failure on only one file.
* The current method makes error handling difficult

View File

@@ -110,7 +110,7 @@ class announcements extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -231,7 +231,7 @@ class announcements extends module_base
// unread?
$forum_id = $fetch_news[$i]['forum_id'];
$topic_id = $fetch_news[$i]['topic_id'];
//$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$real_forum_id = ($forum_id == 0) ? $fetch_news['global_id']: $forum_id;
$read_full_url = ($this->request->is_set('ap')) ? 'ap='. $start . '&announcement=' . $i . '#a' . $i : 'announcement=' . $i . '#a' . $i;
@@ -243,7 +243,7 @@ class announcements extends module_base
}
$replies = ($this->auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
$folder_img = $folder_alt = $topic_type = $folder = $folder_new = '';
switch ($fetch_news[$i]['topic_type'])
{
case POST_GLOBAL:
@@ -270,10 +270,7 @@ class announcements extends module_base
$folder .= '_locked';
$folder_new .= '_locked';
}
if ($fetch_news[$i]['topic_type'] == POST_GLOBAL)
{
$global_announce_list[$fetch_news[$i]['topic_id']] = true;
}
if ($fetch_news[$i]['topic_posted'])
{
$folder .= '_mine';
@@ -336,7 +333,7 @@ class announcements extends module_base
if ($this->config['board3_number_of_announcements_' . $module_id] != 0 && $this->config['board3_announcements_archive_' . $module_id])
{
$this->template->assign_vars(array(
'AP_PAGINATION' => $pagination,
'AP_PAGINATION' => (isset($pagination)) ? $pagination : '',
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $this->user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($this->user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
'AP_PAGE_NUMBER' => $this->pagination->on_page($total_announcements, $this->config['board3_number_of_announcements_' . $module_id], $start))
);
@@ -359,7 +356,7 @@ class announcements extends module_base
$forum_id = $fetch_news[$i]['forum_id'];
$topic_id = $fetch_news[$i]['topic_id'];
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id);
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
$open_bracket = '[ ';
$close_bracket = ' ]';
@@ -412,7 +409,7 @@ class announcements extends module_base
if ($this->config['board3_number_of_announcements_' . $module_id] <> 0 && $this->config['board3_announcements_archive_' . $module_id])
{
$this->template->assign_vars(array(
'AP_PAGINATION' => $pagination,
'AP_PAGINATION' => (!empty($pagination)) ? $pagination : '',
'TOTAL_ANNOUNCEMENTS' => ($total_announcements == 1) ? $this->user->lang['VIEW_LATEST_ANNOUNCEMENT'] : sprintf($this->user->lang['VIEW_LATEST_ANNOUNCEMENTS'], $total_announcements),
'AP_PAGE_NUMBER' => $this->pagination->on_page($total_announcements, $this->config['board3_number_of_announcements_' . $module_id], $start))
);
@@ -445,7 +442,7 @@ class announcements extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -467,7 +464,7 @@ class announcements extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -485,7 +482,7 @@ class announcements extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -95,7 +95,7 @@ class attachments extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -103,7 +103,7 @@ class attachments extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -111,7 +111,7 @@ class attachments extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -130,7 +130,7 @@ class attachments extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -144,7 +144,7 @@ class attachments extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -70,7 +70,7 @@ class birthday_list extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -158,7 +158,7 @@ class birthday_list extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -172,7 +172,7 @@ class birthday_list extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -181,7 +181,7 @@ class birthday_list extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -51,6 +51,7 @@ class calendar extends module_base
* additional variables
*/
protected $mini_cal_fdow;
protected $mini_cal_month;
/**
* User datetime object
@@ -143,7 +144,7 @@ class calendar extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -177,7 +178,6 @@ class calendar extends module_base
$mini_cal_count = $this->mini_cal_fdow;
$mini_cal_this_year = $this->dateYYYY;
$mini_cal_this_month = $this->dateMM;
$mini_cal_this_day = $this->dateDD;
$mini_cal_month_days = $this->daysMonth;
// output our general calendar bits
@@ -264,6 +264,7 @@ class calendar extends module_base
if (!empty($events) && $this->config['board3_display_events_' . $module_id])
{
$time_ary = array();
// we sort the $events array by the start time
foreach ($events as $key => $cur_event)
{
@@ -337,7 +338,7 @@ class calendar extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -357,7 +358,7 @@ class calendar extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -374,7 +375,7 @@ class calendar extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{
@@ -520,6 +521,7 @@ class calendar extends module_base
$this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_ADDED', false, array($event_title));
}
$time_ary = array();
// we sort the $events array by the start time
foreach ($events as $key => $cur_event)
{
@@ -601,8 +603,6 @@ class calendar extends module_base
$this->db->sql_freeresult($result);
return;
break;
}
for ($i = 0; $i < sizeof($events); $i++)
@@ -618,7 +618,7 @@ class calendar extends module_base
'EVENT_TITLE' => ($action != 'add') ? ((isset($this->user->lang[$events[$i]['title']])) ? $this->user->lang[$events[$i]['title']] : $events[$i]['title']) : '',
'EVENT_DESC' => ($action != 'add') ? $events[$i]['desc'] : '',
'EVENT_START' => ($action != 'add') ? $this->user->format_date($events[$i]['start_time'], $start_time_format) : '',
'EVENT_END' => ($action != 'add' && !$event_all_day) ? $this->user->format_date($events[$i]['end_time'], $end_time_format) : '',
'EVENT_END' => ($action != 'add' && !$event_all_day && !empty($end_time_format)) ? $this->user->format_date($events[$i]['end_time'], $end_time_format) : '',
'EVENT_URL' => ($action != 'add' && isset($events[$i]['url']) && !empty($events[$i]['url'])) ? $this->validate_url($events[$i]['url']) : '',
'EVENT_URL_RAW' => ($action != 'add' && isset($events[$i]['url']) && !empty($events[$i]['url'])) ? $events[$i]['url'] : '',
'U_EDIT' => $u_action . '&amp;action=edit&amp;id=' . $i,

View File

@@ -42,7 +42,7 @@ class clock extends module_base
public $language = 'portal_clock_module';
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -50,7 +50,7 @@ class clock extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{

View File

@@ -96,7 +96,7 @@ class custom extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -104,7 +104,7 @@ class custom extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -112,7 +112,7 @@ class custom extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -126,7 +126,7 @@ class custom extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -142,7 +142,7 @@ class custom extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{
@@ -186,7 +186,7 @@ class custom extends module_base
$u_action = append_sid('index.' . $this->php_ext, 'i=\board3\portal\acp\portal_module&amp;mode=config&amp;module_id=' . $module_id);
switch($action)
switch ($action)
{
// Save changes
case 'save':
@@ -202,14 +202,14 @@ class custom extends module_base
$custom_image_src = $this->request->variable('module_image', '', true);
$groups_ary = array();
$uid = $bitfield = $flags = '';
$options = 7;
if($custom_bbcode)
if ($custom_bbcode)
{
generate_text_for_storage($custom_code, $uid, $bitfield, $flags, true, true, true);
}
// first check for obvious errors, we don't want to waste server resources
if(empty($custom_code))
if (empty($custom_code))
{
trigger_error($this->user->lang['ACP_PORTAL_CUSTOM_CODE_SHORT']. adm_back_link($u_action), E_USER_WARNING);
}
@@ -219,7 +219,7 @@ class custom extends module_base
FROM ' . GROUPS_TABLE . '
ORDER BY group_id ASC';
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$groups_ary[] = $row['group_id'];
}
@@ -261,12 +261,12 @@ class custom extends module_base
$groups_ary = array();
// first check for obvious errors, we don't want to waste server resources
if(empty($custom_code))
if (empty($custom_code))
{
trigger_error($this->user->lang['ACP_PORTAL_CUSTOM_CODE_SHORT']. adm_back_link($u_action), E_USER_WARNING);
}
if($custom_bbcode)
if ($custom_bbcode)
{
$bbcode_options = OPTION_FLAG_BBCODE + OPTION_FLAG_SMILIES + OPTION_FLAG_LINKS;
$uid = (isset($this->config['board3_custom_' . $module_id . '_uid'])) ? $this->config['board3_custom_' . $module_id . '_uid'] : '';
@@ -291,7 +291,7 @@ class custom extends module_base
FROM ' . GROUPS_TABLE . '
ORDER BY group_id ASC';
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$groups_ary[] = $row['group_id'];
}
@@ -302,7 +302,7 @@ class custom extends module_base
// Edit or add menu item
case 'reset':
default:
if(!isset($custom_code))
if (!isset($custom_code))
{
$custom_code = generate_text_for_edit($portal_config['board3_custom_' . $module_id . '_code'], $this->config['board3_custom_' . $module_id . '_uid'], '');
}
@@ -328,7 +328,7 @@ class custom extends module_base
FROM ' . GROUPS_TABLE . '
ORDER BY group_id ASC';
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$this->template->assign_block_vars('permission_setting', array(
'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false,
@@ -338,7 +338,7 @@ class custom extends module_base
}
$this->db->sql_freeresult($result);
if(!function_exists('display_forums'))
if (!function_exists('display_forums'))
{
include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
}
@@ -396,7 +396,7 @@ class custom extends module_base
$title = (!empty($this->config['board3_custom_' . $module_id . '_title'])) ? ((isset($this->user->lang[$this->config['board3_custom_' . $module_id . '_title']])) ? $this->user->lang[$this->config['board3_custom_' . $module_id . '_title']] : $this->config['board3_custom_' . $module_id . '_title']) : $this->user->lang[$this->name];
if(!empty($assign_code))
if (!empty($assign_code))
{
return array(
'template' => 'custom_' . $type . '.html',

View File

@@ -71,7 +71,7 @@ class modulename extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -83,7 +83,7 @@ class modulename extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -95,7 +95,7 @@ class modulename extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -110,7 +110,7 @@ class modulename extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -120,7 +120,7 @@ class modulename extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -65,7 +65,7 @@ class donation extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -78,7 +78,7 @@ class donation extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -91,7 +91,7 @@ class donation extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -106,7 +106,7 @@ class donation extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -116,7 +116,7 @@ class donation extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -86,7 +86,7 @@ class forumlist extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -109,7 +109,7 @@ class forumlist extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{

View File

@@ -75,7 +75,7 @@ class friends extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -131,7 +131,7 @@ class friends extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -145,7 +145,7 @@ class friends extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -154,7 +154,7 @@ class friends extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -75,7 +75,7 @@ class latest_bots extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -106,7 +106,7 @@ class latest_bots extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -120,7 +120,7 @@ class latest_bots extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -129,7 +129,7 @@ class latest_bots extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -70,7 +70,7 @@ class latest_members extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -94,7 +94,7 @@ class latest_members extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -108,7 +108,7 @@ class latest_members extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -117,7 +117,7 @@ class latest_members extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -85,7 +85,7 @@ class leaders extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -213,6 +213,10 @@ class leaders extends module_base
{
$which_row = 'b3p_moderators';
}
else
{
continue;
}
if ($row['group_type'] == GROUP_HIDDEN && !$this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $this->user->data['user_id'])
{
@@ -244,7 +248,7 @@ class leaders extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -258,7 +262,7 @@ class leaders extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -268,7 +272,7 @@ class leaders extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -65,7 +65,7 @@ class link_us extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -82,7 +82,7 @@ class link_us extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{

View File

@@ -102,11 +102,10 @@ class links extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
$links = array();
$portal_config = obtain_portal_config();
$links = $this->utf_unserialize($portal_config['board3_links_array_' . $module_id]);
@@ -116,7 +115,7 @@ class links extends module_base
for ($i = 0; $i < sizeof($links); $i++)
{
if($links[$i]['type'] == self::LINK_INT)
if ($links[$i]['type'] == self::LINK_INT)
{
$links[$i]['url'] = str_replace('&', '&amp;', $links[$i]['url']); // we need to do this in order to prevent XHTML validation errors
$cur_url = append_sid($this->phpbb_root_path . $links[$i]['url']); // the user should know what kind of file it is
@@ -129,7 +128,7 @@ class links extends module_base
$cur_permissions = explode(',', $links[$i]['permission']);
$permission_check = array_intersect($groups_ary, $cur_permissions);
if(!empty($permission_check) || $links[$i]['permission'] == '')
if (!empty($permission_check) || $links[$i]['permission'] == '')
{
$this->template->assign_block_vars('portallinks', array(
'LINK_TITLE' => (isset($this->user->lang[$links[$i]['title']])) ? $this->user->lang[$links[$i]['title']] : $links[$i]['title'],
@@ -144,7 +143,7 @@ class links extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -160,7 +159,7 @@ class links extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -186,7 +185,7 @@ class links extends module_base
'',
);
foreach($links_urls as $i => $url)
foreach ($links_urls as $i => $url)
{
$links[] = array(
'title' => $links_titles[$i],
@@ -205,7 +204,7 @@ class links extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{
@@ -243,8 +242,6 @@ class links extends module_base
$link_id = $this->request->variable('id', 99999999); // 0 will trigger unwanted behavior, therefore we set a number we should never reach
$portal_config = obtain_portal_config();
$links = array();
$links = $this->utf_unserialize($portal_config['board3_links_array_' . $module_id]);
$u_action = append_sid('index.' . $this->php_ext, 'i=\board3\portal\acp\portal_module&amp;mode=config&amp;module_id=' . $module_id);
@@ -270,7 +267,7 @@ class links extends module_base
FROM ' . GROUPS_TABLE . '
ORDER BY group_id ASC';
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$groups_ary[] = $row['group_id'];
}
@@ -419,7 +416,7 @@ class links extends module_base
FROM ' . GROUPS_TABLE . '
ORDER BY group_id ASC';
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$this->template->assign_block_vars('permission_setting_link', array(
'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false,
@@ -430,8 +427,6 @@ class links extends module_base
$this->db->sql_freeresult($result);
return;
break;
}
for ($i = 0; $i < sizeof($links); $i++)

View File

@@ -103,11 +103,10 @@ class main_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
$links = array();
$portal_config = obtain_portal_config();
$links = $this->utf_unserialize($portal_config['board3_menu_array_' . $module_id]);
@@ -117,7 +116,7 @@ class main_menu extends module_base
for ($i = 0; $i < sizeof($links); $i++)
{
if($links[$i]['type'] == self::LINK_CAT)
if ($links[$i]['type'] == self::LINK_CAT)
{
$this->template->assign_block_vars('portalmenu', array(
'CAT_TITLE' => (isset($this->user->lang[$links[$i]['title']])) ? $this->user->lang[$links[$i]['title']] : $links[$i]['title'],
@@ -126,7 +125,7 @@ class main_menu extends module_base
}
else
{
if($links[$i]['type'] == self::LINK_INT)
if ($links[$i]['type'] == self::LINK_INT)
{
$links[$i]['url'] = str_replace('&', '&amp;', $links[$i]['url']); // we need to do this in order to prevent XHTML validation errors
$cur_url = append_sid($this->phpbb_root_path . $links[$i]['url']); // the user should know what kind of file it is
@@ -139,7 +138,7 @@ class main_menu extends module_base
$cur_permissions = explode(',', $links[$i]['permission']);
$permission_check = array_intersect($groups_ary, $cur_permissions);
if(!empty($permission_check) || $links[$i]['permission'] == '')
if (!empty($permission_check) || $links[$i]['permission'] == '')
{
$this->template->assign_block_vars('portalmenu.links', array(
'LINK_TITLE' => (isset($this->user->lang[$links[$i]['title']])) ? $this->user->lang[$links[$i]['title']] : $links[$i]['title'],
@@ -154,7 +153,7 @@ class main_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -169,16 +168,17 @@ class main_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
// get the correct group IDs from the database
$in_ary = array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA');
$groups_ary = array();
$sql = 'SELECT group_id, group_name FROM ' . GROUPS_TABLE . ' WHERE ' . $this->db->sql_in_set('group_name', $in_ary);
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$groups_ary[$row['group_name']] = $row['group_id'];
}
@@ -241,7 +241,7 @@ class main_menu extends module_base
'',
);
foreach($links_urls as $i => $url)
foreach ($links_urls as $i => $url)
{
$links[] = array(
'title' => $links_titles[$i],
@@ -260,7 +260,7 @@ class main_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{
@@ -298,8 +298,6 @@ class main_menu extends module_base
$link_id = $this->request->variable('id', 99999999); // 0 will trigger unwanted behavior, therefore we set a number we should never reach
$portal_config = obtain_portal_config();
$links = array();
$links = $this->utf_unserialize($portal_config['board3_menu_array_' . $module_id]);
$u_action = append_sid('index.' . $this->php_ext, 'i=%5Cboard3%5Cportal%5Cacp%5Cportal_module&amp;mode=config&amp;module_id=' . $module_id);
@@ -326,7 +324,7 @@ class main_menu extends module_base
FROM ' . GROUPS_TABLE . '
ORDER BY group_id ASC';
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$groups_ary[] = $row['group_id'];
}
@@ -481,7 +479,7 @@ class main_menu extends module_base
FROM ' . GROUPS_TABLE . '
ORDER BY group_id ASC';
$result = $this->db->sql_query($sql);
while($row = $this->db->sql_fetchrow($result))
while ($row = $this->db->sql_fetchrow($result))
{
$this->template->assign_block_vars('permission_setting_menu', array(
'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false,
@@ -492,8 +490,6 @@ class main_menu extends module_base
$this->db->sql_freeresult($result);
return;
break;
}
for ($i = 0; $i < sizeof($links); $i++)

View File

@@ -14,8 +14,20 @@ namespace board3\portal\modules;
*/
class module_base implements module_interface
{
/** @var int Module's allowed columns */
protected $columns;
/** @var string Module name */
protected $name;
/** @var string Module image source */
protected $image_src;
/** @var string Module language file */
protected $language;
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_allowed_columns()
{
@@ -23,7 +35,7 @@ class module_base implements module_interface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_name()
{
@@ -31,7 +43,7 @@ class module_base implements module_interface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_image()
{
@@ -39,7 +51,7 @@ class module_base implements module_interface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_language()
{
@@ -47,7 +59,7 @@ class module_base implements module_interface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -55,7 +67,7 @@ class module_base implements module_interface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -63,15 +75,15 @@ class module_base implements module_interface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
return false;
return array();
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -79,7 +91,7 @@ class module_base implements module_interface
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -56,7 +56,7 @@ interface module_interface
*
* @param int $module_id Module's ID
*
* @return string Module template file
* @return string|array Module template file
*/
public function get_template_side($module_id);
@@ -65,7 +65,7 @@ interface module_interface
*
* @param int $module_id Module's ID
*
* @return string Module template file
* @return string|array Module template file
*/
public function get_template_center($module_id);

View File

@@ -110,7 +110,7 @@ class news extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -119,6 +119,7 @@ class news extends module_base
$this->user->add_lang('viewforum');
$start = $this->request->variable('np', 0);
$start = ($start < 0) ? 0 : $start;
$total_news = 1;
// Fetch news from portal functions.php with check if "read full" is requested.
$portal_news_length = ($news < 0) ? $this->config['board3_news_length_' . $module_id] : 0;
@@ -234,7 +235,7 @@ class news extends module_base
}
$replies = ($this->auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
$folder_img = $folder_alt = $topic_type = $folder = $folder_new = '';
switch ($fetch_news[$i]['topic_type'])
{
case POST_STICKY:
@@ -325,7 +326,7 @@ class news extends module_base
if ($this->config['board3_number_of_news_' . $module_id] <> 0 && $this->config['board3_news_archive_' . $module_id])
{
$this->template->assign_vars(array(
'NP_PAGINATION' => $pagination,
'NP_PAGINATION' => (!empty($pagination)) ? $pagination : '',
'TOTAL_NEWS' => ($total_news == 1) ? sprintf($this->user->lang['VIEW_FORUM_TOPICS'][1], $total_news) : sprintf($this->user->lang['VIEW_FORUM_TOPICS'][2], $total_news),
'NP_PAGE_NUMBER' => $this->pagination->on_page($total_news, $this->config['board3_number_of_news_' . $module_id], $start))
);
@@ -389,7 +390,7 @@ class news extends module_base
if ($this->config['board3_number_of_news_' . $module_id] <> 0 && $this->config['board3_news_archive_' . $module_id])
{
$this->template->assign_vars(array(
'NP_PAGINATION' => $pagination,
'NP_PAGINATION' => (!empty($pagination)) ? $pagination : '',
'TOTAL_NEWS' => ($total_news == 1) ? $this->user->lang['VIEW_FORUM_TOPIC'] : $this->user->lang('VIEW_FORUM_TOPICS', $total_news),
'NP_PAGE_NUMBER' => $this->pagination->on_page($total_news, $this->config['board3_number_of_news_' . $module_id], $start))
);
@@ -424,7 +425,7 @@ class news extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -447,7 +448,7 @@ class news extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -465,7 +466,7 @@ class news extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -96,7 +96,7 @@ class poll extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -104,7 +104,7 @@ class poll extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -112,7 +112,7 @@ class poll extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -130,7 +130,7 @@ class poll extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -143,7 +143,7 @@ class poll extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{
@@ -209,7 +209,7 @@ class poll extends module_base
// Cookie based guest tracking ... I don't like this but hum ho
// it's oft requested. This relies on "nice" users who don't feel
// the need to delete cookies to mess with results.
if ($request->is_set($this->config['cookie_name'] . '_poll_' . $up_topic_id, \phpbb\request\request_interface::COOKIE))
if ($this->request->is_set($this->config['cookie_name'] . '_poll_' . $up_topic_id, \phpbb\request\request_interface::COOKIE))
{
$cur_voted_id = explode(',', $this->request->variable($this->config['cookie_name'] . '_poll_' . $up_topic_id, '', true, \phpbb\request\request_interface::COOKIE));
$cur_voted_id = array_map('intval', $cur_voted_id);
@@ -317,12 +317,9 @@ class poll extends module_base
}
}
$where = '';
$poll_forums = false;
// Get readable forums
$forum_list = array();
$forum_list = array_unique(array_keys($this->auth->acl_getf('f_read', true)));
if($this->config['board3_poll_topic_id_' . $module_id] !== '')

View File

@@ -71,7 +71,7 @@ class random_member extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -108,7 +108,7 @@ class random_member extends module_base
$avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($row, 'user'), 'USER_AVATAR');
$rank_title = $rank_img = '';
$rank_title = $rank_img = $rank_img_src = '';
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
$username = $row['username'];
@@ -138,7 +138,7 @@ class random_member extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{

View File

@@ -91,7 +91,7 @@ class recent extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -209,7 +209,7 @@ class recent extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -226,7 +226,7 @@ class recent extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -238,7 +238,7 @@ class recent extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -71,7 +71,7 @@ class search extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -81,7 +81,7 @@ class search extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{

View File

@@ -81,7 +81,7 @@ class statistics extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -166,7 +166,7 @@ class statistics extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{

View File

@@ -85,7 +85,7 @@ class stylechanger extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -125,7 +125,7 @@ class stylechanger extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{

View File

@@ -75,7 +75,7 @@ class topposters extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -101,7 +101,7 @@ class topposters extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -115,7 +115,7 @@ class topposters extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -124,7 +124,7 @@ class topposters extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -95,7 +95,7 @@ class user_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -113,7 +113,6 @@ class user_menu extends module_base
if ($this->auth->acl_get('m_approve'))
{
$m_approve_fid_ary = array(-1);
$m_approve_fid_sql = '';
}
else if ($this->auth->acl_getf_global('m_approve'))
@@ -123,7 +122,6 @@ class user_menu extends module_base
}
else
{
$m_approve_fid_ary = array();
$m_approve_fid_sql = ' AND p.post_visibility = 1';
}
@@ -141,7 +139,6 @@ class user_menu extends module_base
$sql_where = 'AND t.topic_moved_id = 0
' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $this->db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
$unread_list = array();
$unread_list = get_unread_topics($this->user->data['user_id'], $sql_where, 'ORDER BY t.topic_id DESC');
$unread_posts_count = sizeof($unread_list);
@@ -150,7 +147,7 @@ class user_menu extends module_base
$username = $this->user->data['username'];
$colour = $this->user->data['user_colour'];
$avatar_img = phpbb_get_avatar(\phpbb\avatar\manager::clean_row($this->user->data, 'user'), 'USER_AVATAR');
$rank_title = $rank_img = '';
$rank_title = $rank_img = $rank_img_src = '';
\get_user_rank($this->user->data['user_rank'], $this->user->data['user_posts'], $rank_title, $rank_img, $rank_img_src);
// Assign specific vars
@@ -198,7 +195,7 @@ class user_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -212,7 +209,7 @@ class user_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -222,7 +219,7 @@ class user_menu extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{

View File

@@ -86,7 +86,7 @@ class welcome extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -106,7 +106,7 @@ class welcome extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{
@@ -120,7 +120,7 @@ class welcome extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function install($module_id)
{
@@ -132,7 +132,7 @@ class welcome extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function uninstall($module_id, $db)
{
@@ -184,7 +184,6 @@ class welcome extends module_base
$welcome_message = $this->request->variable('welcome_message', '', true);
$uid = $bitfield = $flags = '';
$options = 7;
generate_text_for_storage($welcome_message, $uid, $bitfield, $flags, true, true, true);
// first check for obvious errors, we don't want to waste server resources

View File

@@ -86,7 +86,7 @@ class whois_online extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_center($module_id)
{
@@ -139,7 +139,7 @@ class whois_online extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_side($module_id)
{
@@ -147,7 +147,7 @@ class whois_online extends module_base
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function get_template_acp($module_id)
{