[ticket/249] Fix codesniffer complaints in portal files

B3P-249
This commit is contained in:
Marc Alexander
2014-06-09 00:32:38 +02:00
parent 727980f7e0
commit eb256a647d
20 changed files with 52 additions and 57 deletions

View File

@@ -232,7 +232,7 @@ class portal_module
$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
if ($submit)
{
{
set_config($config_name, $config_value);
}
}
@@ -385,8 +385,8 @@ class portal_module
$portal_modules = obtain_portal_modules();
$installed_modules = array();
foreach($portal_modules as $cur_module)
{
foreach($portal_modules as $cur_module)
{
$installed_modules[] = $cur_module['module_classname'];
// Create an array with the columns the module is in
$this->module_column[$cur_module['module_classname']][] = column_num_string($cur_module['module_column']);
@@ -790,10 +790,10 @@ class portal_module
$portal_config = obtain_portal_config(); // we need to prevent duplicate entry errors
$this->c_class->install($module_id);
$this->cache->purge();
// We need to return to the module config
meta_refresh(3, $this->get_module_link('config', $module_id));
trigger_error($this->user->lang['MODULE_RESET_SUCCESS'] . adm_back_link($this->u_action . "&module_id=$module_id"));
}
else
@@ -942,14 +942,14 @@ class portal_module
public function move_module_left($module_id)
{
$module_data = $this->get_move_module_data($module_id);
if (!isset($this->modules[$module_data['module_classname']]))
{
trigger_error('CLASS_NOT_FOUND', E_USER_ERROR);
}
$this->c_class = $this->modules[$module_data['module_classname']];
if ($module_data !== false && $module_data['module_column'] > column_string_num('left'))
{
if($this->c_class->columns & column_string_const(column_num_string($module_data['module_column'] - 1)))
@@ -964,7 +964,7 @@ class portal_module
{
$this->handle_after_move(false);
}
/**
* moving only 1 column to the left means we will either end up in the left column
* or in the center column. this is not possible when moving 2 columns to the left.
@@ -998,13 +998,13 @@ class portal_module
SET module_column = module_column - ' . $move_action . '
WHERE module_id = ' . (int) $module_id;
$this->db->sql_query($sql);
$sql = 'UPDATE ' . PORTAL_MODULES_TABLE . '
SET module_order = module_order - 1
WHERE module_order >= ' . $module_data['module_order'] . '
AND module_column = ' . $module_data['module_column'];
$this->db->sql_query($sql);
// the module that needs to moved is in the last row
if(!$updated)
{
@@ -1014,7 +1014,7 @@ class portal_module
AND module_column = ' . (int) ($module_data['module_column'] - $move_action);
$this->db->sql_query($sql);
$new_order = $this->db->sql_fetchfield('new_order') + 1;
$sql = 'UPDATE ' . PORTAL_MODULES_TABLE . '
SET module_order = ' . $new_order . '
WHERE module_id = ' . (int) $module_id;
@@ -1025,7 +1025,7 @@ class portal_module
{
$this->handle_after_move(false);
}
$this->handle_after_move(true);
}
@@ -1037,14 +1037,14 @@ class portal_module
public function move_module_right($module_id)
{
$module_data = $this->get_move_module_data($module_id);
if (!isset($this->modules[$module_data['module_classname']]))
{
trigger_error('CLASS_NOT_FOUND', E_USER_ERROR);
}
$this->c_class = $this->modules[$module_data['module_classname']];
if ($module_data !== false && $module_data['module_column'] < column_string_num('right'))
{
if($this->c_class->columns & column_string_const(column_num_string($module_data['module_column'] + 1)))
@@ -1059,7 +1059,7 @@ class portal_module
{
$this->handle_after_move(false);
}
/**
* moving only 1 column to the right means we will either end up in the right column
* or in the center column. this is not possible when moving 2 columns to the right.
@@ -1081,7 +1081,7 @@ class portal_module
$move_action = 2;
}
}
$sql = 'UPDATE ' . PORTAL_MODULES_TABLE . '
SET module_order = module_order + 1
WHERE module_order >= ' . (int) $module_data['module_order'] . '
@@ -1093,13 +1093,13 @@ class portal_module
SET module_column = module_column + ' . $move_action . '
WHERE module_id = ' . (int) $module_id;
$this->db->sql_query($sql);
$sql = 'UPDATE ' . PORTAL_MODULES_TABLE . '
SET module_order = module_order - 1
WHERE module_order >= ' . (int) $module_data['module_order'] . '
AND module_column = ' . (int) $module_data['module_column'];
$this->db->sql_query($sql);
// the module that needs to moved is in the last row
if(!$updated)
{
@@ -1109,7 +1109,7 @@ class portal_module
AND module_column = ' . (int) ($module_data['module_column'] + $move_action);
$this->db->sql_query($sql);
$new_order = $this->db->sql_fetchfield('new_order') + 1;
$sql = 'UPDATE ' . PORTAL_MODULES_TABLE . '
SET module_order = ' . (int) $new_order . '
WHERE module_id = ' . (int) $module_id;
@@ -1140,7 +1140,7 @@ class portal_module
$result = $this->db->sql_query_limit($sql, 1);
$module_data = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
if ($module_data !== false)
{
$module_classname = $this->request->variable('module_classname', '');
@@ -1164,7 +1164,7 @@ class portal_module
WHERE module_column = ' . $module_data['module_column'] . '
AND module_order > ' . $module_data['module_order'];
$this->db->sql_query($sql);
$this->cache->purge(); // make sure we don't get errors after re-adding a module
if ($this->request->is_ajax())
@@ -1194,7 +1194,7 @@ class portal_module
)));
}
}
$this->cache->destroy('portal_modules');
}

View File

@@ -110,7 +110,7 @@ function phpbb_fetch_posts($module_id, $forum_from, $permissions, $number_of_pos
if ($permissions == true)
{
$disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
}
}
else
{
$disallow_access = array();
@@ -316,7 +316,7 @@ function phpbb_fetch_posts($module_id, $forum_from, $permissions, $number_of_pos
$message = get_sub_taged_string($message, $row['bbcode_uid'], $maxlen);
$posts[$i]['striped'] = true;
}
else
else
{
$message = str_replace("\n", '<br/> ', $row['post_text']);
}

View File

@@ -129,7 +129,7 @@ class portal_upload
if (!sizeof($file->error))
{
// Let's start moving our files where they belong
// Let's start moving our files where they belong
foreach ($actions['NEW_FILES'] as $source => $target)
{
/*
@@ -245,7 +245,7 @@ class portal_upload
}
foreach (scandir($dir) as $item)
{
{
if ($item == '.' || $item == '..')
{
continue;

View File

@@ -175,7 +175,6 @@ class phpbb_trim_message_bbcodes
$this->is_sensitive = true;
}
$this->open_bbcode($bbcode_tag, $this->cur_position);
$this->cur_position += utf8_strlen($exploded_parts[0]) + $bbcode_end_length;
$this->bbcode_action($bbcode_tag, 'open_end', $this->cur_position);
@@ -376,7 +375,7 @@ class phpbb_trim_message_bbcodes
{
break;
}
if (($smiley_code = utf8_substr($content, $last_html_opening + 7, ($last_html_closing - $last_html_opening - 11))) != '--')
{
if ($last_smiley == $smiley_code)

View File

@@ -70,5 +70,5 @@ $lang = array_merge($lang, array(
'PORTAL_ANNOUNCEMENTS_ARCHIVE' => 'Das Archivsystem für die Bekanntmachungen aktivieren',
'PORTAL_ANNOUNCEMENTS_ARCHIVE_EXP' => 'Wenn aktiviert, wird das Archivsystem und ggf. Seitenzahlen angezeigt.',
'PORTAL_SHOW_REPLIES_VIEWS' => '"Antworten" und "Zugriffe" in Extraspalten',
'PORTAL_SHOW_REPLIES_VIEWS_EXP' => 'Einstellung für den kompakter Bekanntmachungen-Block-Stil.<br />Wenn aktiviert, wird die Anzahl der Antworten und Zugriffe in gesonderten Spalten angezeigt. Wenn deaktiviert gibt es nur zwei Spalten und die Antworten und Zugriffe werden neben "Forum" angezeigt. Bei Darstellungsproblemen mit z.B. schmalen Styles bitte deaktivieren.',
'PORTAL_SHOW_REPLIES_VIEWS_EXP' => 'Einstellung für den kompakter Bekanntmachungen-Block-Stil.<br />Wenn aktiviert, wird die Anzahl der Antworten und Zugriffe in gesonderten Spalten angezeigt. Wenn deaktiviert gibt es nur zwei Spalten und die Antworten und Zugriffe werden neben "Forum" angezeigt. Bei Darstellungsproblemen mit z.B. schmalen Styles bitte deaktivieren.',
));

View File

@@ -50,5 +50,5 @@ $lang = array_merge($lang, array(
'PORTAL_ATTACHMENTS_FILETYPE' => 'Dateitypen',
'PORTAL_ATTACHMENTS_FILETYPE_EXP' => 'Falls "Dateitypen ausschließen" auf "Ja" steht, wähle die Dateitypen die du ausschließen willst.<br />Falls "Dateitypen ausschließen" auf "Nein" steht, wähle die Dateitypen die du sehen willst.<br />Wähle mehrere Foren aus/ab, indem du beim Klicken die <samp>Strg</samp>-Taste drückst.',
'PORTAL_ATTACHMENTS_EXCLUDE' => 'Dateitypen ausschließen',
'PORTAL_ATTACHMENTS_EXCLUDE_EXP' => 'Wähle "Ja" wenn du die ausgewählten Dateitypen vom Dateianhänge-Block ausschließen willst, und "Nein" wenn du nur die ausgewählten Dateitypen im Dateianhänge-Block sehen willst.',
'PORTAL_ATTACHMENTS_EXCLUDE_EXP' => 'Wähle "Ja" wenn du die ausgewählten Dateitypen vom Dateianhänge-Block ausschließen willst, und "Nein" wenn du nur die ausgewählten Dateitypen im Dateianhänge-Block sehen willst.',
));

View File

@@ -40,5 +40,5 @@ $lang = array_merge($lang, array(
'ACP_PORTAL_BIRTHDAYS_SETTINGS_EXP' => 'Hier kannst du die Einstellungen für den Geburtstage-Block ändern.',
'PORTAL_BIRTHDAYS' => 'Geburtstage',
'PORTAL_BIRTHDAYS_AHEAD' => 'Anstehende Geburtstage',
'PORTAL_BIRTHDAYS_AHEAD_EXP' => 'Zeitraum für die Geburtstagsvorschau (Tage).<br />"0" deaktiviert die Anzeige der bevorstehenden Geburtstage.',
'PORTAL_BIRTHDAYS_AHEAD_EXP' => 'Zeitraum für die Geburtstagsvorschau (Tage).<br />"0" deaktiviert die Anzeige der bevorstehenden Geburtstage.',
));

View File

@@ -33,7 +33,7 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
'PORTAL_LINKS' => 'Links',
'LINKS_NO_LINKS' => 'Keine Links vorhanden',
'LINKS_NO_LINKS' => 'Keine Links vorhanden',
// ACP
'ACP_PORTAL_LINKS' => 'Links-Einstellungen',

View File

@@ -66,5 +66,5 @@ $lang = array_merge($lang, array(
'PORTAL_NEWS_ARCHIVE' => 'Das Archivsystem für die aktuellen Beiträge aktivieren',
'PORTAL_NEWS_ARCHIVE_EXP' => 'Wenn aktiviert, wird das Archivsystem und ggf. Seitenzahlen angezeigt.',
'PORTAL_SHOW_REPLIES_VIEWS' => '"Antworten" und "Zugriffe" in Extraspalten',
'PORTAL_SHOW_REPLIES_VIEWS_EXP' => 'Einstellung für den kompakter Bekanntmachungen-Block-Stil.<br />Wenn aktiviert, wird die Anzahl der Antworten und Zugriffe in gesonderten Spalten angezeigt. Wenn deaktiviert gibt es nur zwei Spalten und die Antworten und Zugriffe werden neben "Forum" angezeigt. Bei Darstellungsproblemen mit z.B. schmalen Styles bitte deaktivieren.',
'PORTAL_SHOW_REPLIES_VIEWS_EXP' => 'Einstellung für den kompakter Bekanntmachungen-Block-Stil.<br />Wenn aktiviert, wird die Anzahl der Antworten und Zugriffe in gesonderten Spalten angezeigt. Wenn deaktiviert gibt es nur zwei Spalten und die Antworten und Zugriffe werden neben "Forum" angezeigt. Bei Darstellungsproblemen mit z.B. schmalen Styles bitte deaktivieren.',
));

View File

@@ -33,7 +33,7 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
'PORTAL_LINKS' => 'Links',
'LINKS_NO_LINKS' => 'No links',
'LINKS_NO_LINKS' => 'No links',
// ACP
'ACP_PORTAL_LINKS' => 'Link Settings',

View File

@@ -40,7 +40,7 @@ $lang = array_merge($lang, array(
'M_TERMS' => 'Terms of use',
'M_PRV' => 'Privacy policy',
'M_SEARCH' => 'Search',
'MENU_NO_LINKS' => 'No links',
'MENU_NO_LINKS' => 'No links',
// ACP
'ACP_PORTAL_MENU' => 'Menu settings',

View File

@@ -140,7 +140,7 @@ class announcements extends module_base
if($permissions == true)
{
$disallow_access = array_unique(array_keys($this->auth->acl_getf('!f_read', true)));
}
}
else
{
$disallow_access = array();
@@ -156,7 +156,7 @@ class announcements extends module_base
if(sizeof($forum_from))
{
$disallow_access = array_diff($forum_from, $disallow_access);
$disallow_access = array_diff($forum_from, $disallow_access);
if(!sizeof($disallow_access))
{
return array();
@@ -197,7 +197,7 @@ class announcements extends module_base
$topic_tracking_info = (get_portal_tracking_info($fetch_news));
if($announcement < 0)
// Show the announcements overview
// Show the announcements overview
{
$count = $fetch_news['topic_count'];
for ($i = 0; $i < $count; $i++)
@@ -310,7 +310,6 @@ class announcements extends module_base
$this->pagination->generate_template_pagination($view_topic_url, 'announcements_center_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true);
if(!empty($fetch_news[$i]['attachments']))
{
foreach ($fetch_news[$i]['attachments'] as $attachment)
@@ -332,7 +331,7 @@ class announcements extends module_base
}
else
// Show "read full" page
{
{
$i = $announcement;
/**
@@ -358,7 +357,7 @@ class announcements extends module_base
if ($this->config['board3_announcements_archive_' . $module_id])
{
$pagination = generate_portal_pagination(append_sid("{$this->phpbb_root_path}app.{$this->php_ext}/portal"), $total_announcements, $this->config['board3_number_of_announcements_' . $module_id], $start, 'announcements');
}
}
$this->template->assign_block_vars('announcements_center_row', array(
'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $this->config['allow_attachments']) ? $this->user->img('icon_topic_attach', $this->user->lang['TOTAL_ATTACHMENTS']) : '',

View File

@@ -629,7 +629,7 @@ class calendar extends module_base
return;
break;
break;
}
for ($i = 0; $i < sizeof($events); $i++)

View File

@@ -342,7 +342,7 @@ class custom extends module_base
display_custom_bbcodes();
$this->user->add_lang('posting');
break;
break;
}
}

View File

@@ -364,7 +364,7 @@ class links extends module_base
break;
}
/*
/*
* on move_down, switch position with next order_id...
* on move_up, switch position with previous order_id...
* move up means a lower ID, move down means a higher ID
@@ -465,9 +465,9 @@ class links extends module_base
*
* @return string Unserialized string
*/
private function utf_unserialize($serial_str)
private function utf_unserialize($serial_str)
{
$out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str );
return unserialize($out);
$out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str);
return unserialize($out);
}
}

View File

@@ -424,7 +424,7 @@ class main_menu extends module_base
break;
}
/*
/*
* on move_down, switch position with next order_id...
* on move_up, switch position with previous order_id...
* move up means a lower ID, move down means a higher ID
@@ -528,9 +528,9 @@ class main_menu extends module_base
*
* @return string Unserialized string
*/
private function utf_unserialize($serial_str)
private function utf_unserialize($serial_str)
{
$out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str );
return unserialize($out);
$out = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $serial_str);
return unserialize($out);
}
}

View File

@@ -114,7 +114,6 @@ class news extends module_base
$portal_news_length = ($news < 0) ? $this->config['board3_news_length_' . $module_id] : 0;
$fetch_news = phpbb_fetch_posts($module_id, $this->config['board3_news_forum_' . $module_id], $this->config['board3_news_permissions_' . $module_id], $this->config['board3_number_of_news_' . $module_id], $portal_news_length, 0, ($this->config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news', $start, $this->config['board3_news_exclude_' . $module_id]);
// Any news present? If not terminate it here.
if (sizeof($fetch_news) == 0)
{
@@ -268,7 +267,7 @@ class news extends module_base
'TITLE' => $fetch_news[$i]['topic_title'],
'POSTER' => $fetch_news[$i]['username'],
'POSTER_FULL' => $fetch_news[$i]['username_full'],
'USERNAME_FULL_LAST' => $fetch_news[$i]['username_full_last'],
'USERNAME_FULL_LAST' => $fetch_news[$i]['username_full_last'],
'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile&amp;u=' . $fetch_news[$i]['user_id']) : '',
'TIME' => $fetch_news[$i]['topic_time'],
'LAST_POST_TIME' => $this->user->format_date($fetch_news[$i]['topic_last_post_time']),
@@ -355,7 +354,7 @@ class news extends module_base
'S_POLL' => $fetch_news[$i]['poll'],
'S_UNREAD_INFO' => $unread_topic,
'U_READ_FULL' => $read_full_url,
'L_READ_FULL' => $read_full,
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket,
'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false,

View File

@@ -116,7 +116,6 @@ class stylechanger extends module_base
$this->template->assign_var('STYLE_SELECT', $style_select);
}
// Assign specific vars
$this->template->assign_vars(array(
'S_STYLE_OPTIONS' => ($this->config['override_user_style'] || $style_count < 2) ? '' : style_select($this->user->data['user_style']),

View File

@@ -145,7 +145,6 @@ class user_menu extends module_base
$unread_list = get_unread_topics($this->user->data['user_id'], $sql_where, 'ORDER BY t.topic_id DESC');
$unread_posts_count = sizeof($unread_list);
// Get user avatar and rank
$user_id = $this->user->data['user_id'];
$username = $this->user->data['username'];

View File

@@ -247,7 +247,7 @@ class welcome extends module_base
display_custom_bbcodes();
$this->user->add_lang('posting');
break;
break;
}
}