Fixed not working module deletion;

Updated language files; 
Updated module files and fixed a few errors; 
Added HTML files for modules; 
Fixed not working odering of modules;
This commit is contained in:
Marc Alexander
2010-04-09 18:39:51 +00:00
parent f90784a68e
commit 971455668d
9 changed files with 210 additions and 80 deletions

View File

@@ -281,6 +281,8 @@ class acp_portal
$module_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$directory = $phpbb_root_path . 'portal/modules/';
if ($module_data !== false)
{
$module_classname = request_var('module_classname', '');
@@ -438,7 +440,7 @@ class acp_portal
'MODULE_NAME' => (isset($user->lang[$row['module_name']])) ? $user->lang[$row['module_name']] : $row['module_name'],
'MODULE_IMAGE' => ($row['module_image_src']) ? '<img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $row['module_image_src'] . '" alt="' . $row['module_name'] . '" />' : '',
'U_DELETE' => $this->u_action . '&amp;module_id=' . $row['module_id'] . '&amp;action=delete',
'U_DELETE' => $this->u_action . '&amp;module_id=' . $row['module_id'] . '&amp;module_classname=' . $row['module_classname'] . '&amp;action=delete',
'U_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=portal&amp;mode=config&amp;module_id=' . $row['module_id']),
'U_MOVE_UP' => $this->u_action . '&amp;module_id=' . $row['module_id'] . '&amp;action=move_up',
'U_MOVE_DOWN' => $this->u_action . '&amp;module_id=' . $row['module_id'] . '&amp;action=move_down',

View File

@@ -46,6 +46,28 @@ $lang = array_merge($lang, array(
'JUMP_FIRST' => 'Zum ersten Beitrag springen',
'JUMP_TO_POST' => 'Rufe den Beitrag auf',
'BACK' => 'Zurück',
'ACP_PORTAL_ANNOUNCE_SETTINGS' => 'Einstellungen für Bekanntmachungen',
'ACP_PORTAL_ANNOUNCE_SETTINGS_EXPLAIN' => 'Hier kannst du die Einstellungen für die Bekanntmachungen ändern.',
'PORTAL_ANNOUNCEMENTS' => 'Bekanntmachungen anzeigen',
'PORTAL_ANNOUNCEMENTS_EXPLAIN' => 'Diesen Block auf dem Portal anzeigen.',
'PORTAL_ANNOUNCEMENTS_STYLE' => 'Kompakter Bekanntmachungen-Block-Stil',
'PORTAL_ANNOUNCEMENTS_STYLE_EXPLAIN' => 'Wenn "ja" ausgewählt ist, wird die kompakte Ansicht für die Bekanntmachungen angezeigt, bei "nein" die große Ansicht.',
'PORTAL_NUMBER_OF_ANNOUNCEMENTS' => 'Anzahl der Bekanntmachungen auf dem Portal',
'PORTAL_NUMBER_OF_ANNOUNCEMENTS_EXPLAIN' => '0 bedeutet unbegrenzt',
'PORTAL_ANNOUNCEMENTS_DAY' => 'Die Anzahl der Tage, während der die Bekanntmachung angezeigt werden soll',
'PORTAL_ANNOUNCEMENTS_DAY_EXPLAIN' => '0 bedeutet unbegrenzt',
'PORTAL_ANNOUNCEMENTS_LENGTH' => 'Maximale Länge der Bekanntmachungen',
'PORTAL_ANNOUNCEMENTS_LENGTH_EXPLAIN' => '0 bedeutet unbegrenzt',
'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' => 'Foren der Bekanntmachungen',
'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM_EXPLAIN' => 'Die ID des Forums, aus welchem die Bekanntmachungen angezeigt werden sollen. Frei lassen, um aus allen Foren anzeigen zu lassen. Falls "Foren aussschließen" auf "Ja" steht, wähle die Foren die du ausschließen willst.<br />Falls "Foren aussschließen" auf "Nein" steht, wähle die Foren die du sehen willst.<br />Wähle mehrere Foren aus/ab, indem du beim Klicken die <samp>Strg</samp>-Taste drückst.',
'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE' => 'Foren aussschließen',
'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE_EXPLAIN'=> 'Wähle "Ja" wenn du die ausgewählten Foren vom Bekanntmachungen-Block ausschließen willst, und "Nein" wenn du nur die Bekanntmachungen aus den ausgewählten Foren im Bekanntmachungen-Block sehen willst.',
'PORTAL_ANNOUNCEMENTS_PERMISSIONS' => 'Berechtigungen prüfen anschalten?',
'PORTAL_ANNOUNCEMENTS_PERMISSIONS_EXPLAIN' => 'Berücksichtigt Berechtigungen beim Anzeigen der Bekanntmachungen',
'PORTAL_ANNOUNCEMENTS_ARCHIVE' => 'Das Archivsystem für die Bekanntmachungen aktivieren',
'PORTAL_ANNOUNCEMENTS_ARCHIVE_EXPLAIN' => 'Wenn aktiviert, wird das Archivsystem und ggf. Seitenzahlen angezeigt.',
'PORTAL_SHOW_REPLIES_VIEWS' => '"Antworten" und "Zugriffe" in Extraspalten',
'PORTAL_SHOW_REPLIES_VIEWS_EXPLAIN' => '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

@@ -46,6 +46,28 @@ $lang = array_merge($lang, array(
'JUMP_FIRST' => 'Jump to first post',
'JUMP_TO_POST' => 'Jump to post',
'BACK' => 'Back',
'ACP_PORTAL_ANNOUNCE_SETTINGS' => 'Global announcements settings',
'ACP_PORTAL_ANNOUNCE_SETTINGS_EXPLAIN' => 'This is where you customize the global announcements block.',
'PORTAL_ANNOUNCEMENTS' => 'Display global announcements',
'PORTAL_ANNOUNCEMENTS_EXPLAIN' => 'Display this block on the portal.',
'PORTAL_ANNOUNCEMENTS_STYLE' => 'Compact global announcements block style',
'PORTAL_ANNOUNCEMENTS_STYLE_EXPLAIN' => '"Yes" means use the compact style for for global announcements. "No" means use the large style (text view).',
'PORTAL_NUMBER_OF_ANNOUNCEMENTS' => 'Number of announcements on the portal',
'PORTAL_NUMBER_OF_ANNOUNCEMENTS_EXPLAIN' => '0 means infinite',
'PORTAL_ANNOUNCEMENTS_DAY' => 'Number of days to display the announcement',
'PORTAL_ANNOUNCEMENTS_DAY_EXPLAIN' => '0 means infinite',
'PORTAL_ANNOUNCEMENTS_LENGTH' => 'Maximum size/length of global announcements',
'PORTAL_ANNOUNCEMENTS_LENGTH_EXPLAIN' => '0 means infinite',
'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' => 'Announcements forums',
'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM_EXPLAIN' => 'Forum(s) from which we retrieve the announcements. Leave this blank to retrieve announcements from all the forums. If "Exclude forums" is set to "Yes", select the forums you want to exclude.<br />If "Exclude forums" is set to "No" select the forums you want to see.<br />Select/Deselect multiple forums by holding <samp>CTRL</samp> and clicking.',
'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE' => 'Exclude forums',
'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE_EXPLAIN'=> 'Select "Yes" if you want to exlude the selected forums from the announcements block, and "No" if you want to see only the selected forums in the announcements block.',
'PORTAL_ANNOUNCEMENTS_PERMISSIONS' => 'Enable/disable permissions',
'PORTAL_ANNOUNCEMENTS_PERMISSIONS_EXPLAIN' => 'When displaying announcements, consider a user&apos;s forum-viewing permissions.',
'PORTAL_ANNOUNCEMENTS_ARCHIVE' => 'Enable the announcements archive system',
'PORTAL_ANNOUNCEMENTS_ARCHIVE_EXPLAIN' => 'If enabled the announcements archive system / page numbers will be displayed.',
'PORTAL_SHOW_REPLIES_VIEWS' => 'Display the number of replies and views',
'PORTAL_SHOW_REPLIES_VIEWS_EXPLAIN' => 'This setting pertains to the compact block.<br />When Yes, the number of replies and views are shown in 2 extra columns. When No, replies and views will be shown beside the forum name. Select No if you have problems with the display of the extra columns due to the extra width required.',
));
?>

View File

@@ -33,7 +33,8 @@ if (!$config['portal_enable'])
}
$sql = 'SELECT *
FROM ' . PORTAL_MODULES_TABLE;
FROM ' . PORTAL_MODULES_TABLE . '
ORDER BY module_order ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{

View File

@@ -435,7 +435,7 @@ class portal_announcements_module
$selected = array();
if(isset($config[$key]) && strlen($config[$key]) > 0)
{
$selected = explode(',', $[$key]);
$selected = explode(',', $config[$key]);
}
// Build forum options
$s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';

View File

@@ -59,7 +59,9 @@ class portal_leaders_module
function get_template_side($module_id)
{
global $config, $template, $user, $auth, $db;
global $config, $template, $user, $auth, $db, $phpEx;
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
// Display a listing of board admins, moderators
$user->add_lang('groups');

View File

@@ -59,8 +59,17 @@ class portal_user_menu_module
function get_template_side($module_id)
{
global $config, $template;
global $config, $template, $user, $auth, $db, $phpEx;
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
if (!function_exists('display_forums'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
if ($user->data['is_registered'])
{
//
// + new posts since last visit & you post number
//
@@ -115,7 +124,6 @@ class portal_user_menu_module
$rank_title = $rank_img = '';
get_user_rank($user->data['user_rank'], $user->data['user_posts'], $rank_title, $rank_img, $rank_img_src);
// Assign specific vars
$template->assign_vars(array(
'L_NEW_POSTS' => $user->lang['SEARCH_NEW'] . '&nbsp;(' . $new_posts_count . ')',
@@ -128,8 +136,6 @@ class portal_user_menu_module
'RANK_IMG_SRC' => $rank_img_src,
'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour),
'B3P_USERNAME' => get_username_string('username', $user_id, $username, $colour),
'B3P_USER_COLOR' => get_username_string('colour', $user_id, $username, $colour),
'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour),
'U_NEW_POSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'),
@@ -138,10 +144,24 @@ class portal_user_menu_module
'U_UM_BOOKMARKS' => ($config['allow_bookmarks']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&amp;mode=bookmarks') : '',
'U_UM_MAIN_SUBSCRIBED' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&amp;mode=subscribed'),
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=front', true, $user->session_id) : '',
'S_DISPLAY_SUBSCRIPTIONS' => ($config['allow_topic_notify'] || $config['allow_forum_notify']) ? true : false,
));
return 'user_menu_side.html';
}
else
{
// Assign specific vars
$template->assign_vars(array(
'U_PORTAL' => append_sid("{$phpbb_root_path}portal.$phpEx"),
'S_DISPLAY_FULL_LOGIN' => true,
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
));
return 'login_box_side.html';
}
}
function get_template_acp($module_id)
{

View File

@@ -0,0 +1,20 @@
<!--version $Id$ //-->
<form action="{S_LOGIN_ACTION}" method="post">
<div>
{$LR_BLOCK_H_L}<a href="{U_LOGIN_LOGOUT}"><!-- IF $S_BLOCK_ICON --><img src="{T_THEME_PATH}/images/portal/portal_login.png" width="16" height="16" alt="" />&nbsp;<!-- ENDIF -->{L_LOGIN_LOGOUT}</a>{$LR_BLOCK_H_R}
<span class="genmed">{L_USERNAME}:</span><br />
<input type="text" tabindex="1" name="username" id="username" size="25" value="" class="inputbox autowidth" /><br /><br />
<span class="genmed">{L_PASSWORD}:</span><br />
<input type="password" tabindex="2" id="password" name="password" size="25" class="inputbox autowidth" />
<!-- IF S_DISPLAY_FULL_LOGIN -->
<br /><br />
<!-- IF S_AUTOLOGIN_ENABLED -->
<input type="checkbox" class="radio" name="autologin" tabindex="3" /> <span class="gensmall">{L_UM_LOG_ME_IN}</span><br />
<!-- ENDIF -->
<!-- ENDIF -->
<br />
<input type="hidden" name="redirect" value="{U_PORTAL}" />
<input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" />
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
</div>
</form>

View File

@@ -0,0 +1,41 @@
<!--version $Id$ //-->
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" />&nbsp;<!-- ENDIF -->{L_USER_MENU}{$LR_BLOCK_H_R}
<div style="text-align: center;">
<a href="{U_VIEW_PROFILE}"><span>{USERNAME_FULL}</span></a><br />
<!-- IF B3P_AVATAR_IMG -->
<a href="{U_PROFILE}">{B3P_AVATAR_IMG}</a>
<!-- ELSEIF $NO_AVATAR_IMG -->
<a href="{U_PROFILE}"><img src="{T_THEME_PATH}{$NO_AVATAR_IMG}" alt="" /></a>
<!-- ENDIF -->
<!-- IF B3P_RANK_TITLE --><br /><span class="gensmall">{B3P_RANK_TITLE}</span><!-- ENDIF -->
<!-- IF B3P_RANK_IMG --><br />{B3P_RANK_IMG}<!-- ENDIF -->
</div>
<hr class="dashed" />
<div class="portal-navigation">
<div class="menutitle">{L_M_MENU}</div>
<ul>
<!-- IF S_DISPLAY_SEARCH -->
<li><a href="{U_NEW_POSTS}">{L_NEW_POSTS}</a></li>
<li><a href="{U_UNREAD_POSTS}">{L_UNREAD_POSTS}</a></li>
<li><a href="{U_SELF_POSTS}">{L_SELF_POSTS}</a></li>
<!-- ENDIF -->
<!-- IF U_UM_BOOKMARKS -->
<li><a href="{U_UM_BOOKMARKS}">{L_UM_BOOKMARKS}</a></li>
<!-- ENDIF -->
<!-- IF S_DISPLAY_SUBSCRIPTIONS -->
<li><a href="{U_UM_MAIN_SUBSCRIBED}">{L_UM_MAIN_SUBSCRIBED}</a></li>
<!-- ENDIF -->
<!-- IF S_DISPLAY_PM -->
<li><a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a></li>
<!-- ENDIF -->
<li><a href="{U_PROFILE}">{L_PROFILE}</a></li>
<!-- IF U_MCP -->
<li><a href="{U_MCP}">{L_MCP}</a></li>
<!-- ENDIF -->
<!-- IF U_ACP -->
<li><a href="{U_ACP}">{L_M_ACP}</a></li>
<!-- ENDIF -->
<li><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></li>
</ul>
</div>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}