diff --git a/root/adm/images/icon_left.gif b/root/adm/images/icon_left.gif new file mode 100644 index 00000000..a9f4dd7d Binary files /dev/null and b/root/adm/images/icon_left.gif differ diff --git a/root/adm/images/icon_left_disabled.gif b/root/adm/images/icon_left_disabled.gif new file mode 100644 index 00000000..6bec1451 Binary files /dev/null and b/root/adm/images/icon_left_disabled.gif differ diff --git a/root/adm/images/icon_right.gif b/root/adm/images/icon_right.gif new file mode 100644 index 00000000..19f0edd4 Binary files /dev/null and b/root/adm/images/icon_right.gif differ diff --git a/root/adm/images/icon_right_disabled.gif b/root/adm/images/icon_right_disabled.gif new file mode 100644 index 00000000..8a28f6b3 Binary files /dev/null and b/root/adm/images/icon_right_disabled.gif differ diff --git a/root/adm/style/portal/acp_portal_modules.html b/root/adm/style/portal/acp_portal_modules.html index 51258f8a..f779a445 100644 --- a/root/adm/style/portal/acp_portal_modules.html +++ b/root/adm/style/portal/acp_portal_modules.html @@ -68,8 +68,10 @@ {modules_left.MODULE_IMAGE} {modules_left.MODULE_NAME}

{ICON_MOVE_UP_DISABLED}{ICON_MOVE_UP}  - {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN}  - {ICON_EDIT} {ICON_DELETE} + {ICON_MOVE_RIGHT}  + {ICON_EDIT} {ICON_DELETE}
+ {ICON_MOVE_LEFT_DISABLED}  + {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN} @@ -93,8 +95,10 @@ {modules_center.MODULE_IMAGE} {modules_center.MODULE_NAME}

{ICON_MOVE_UP_DISABLED}{ICON_MOVE_UP}  - {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN}  - {ICON_EDIT} {ICON_DELETE} + {ICON_MOVE_RIGHT}  + {ICON_EDIT} {ICON_DELETE}
+ {ICON_MOVE_LEFT}  + {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN} @@ -118,8 +122,10 @@ {modules_right.MODULE_IMAGE} {modules_right.MODULE_NAME}

{ICON_MOVE_UP_DISABLED}{ICON_MOVE_UP}  - {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN}  - {ICON_EDIT} {ICON_DELETE} + {ICON_MOVE_RIGHT_DISABLED}  + {ICON_EDIT} {ICON_DELETE}
+ {ICON_MOVE_LEFT}  + {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN} diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index 7aeddd51..021ad486 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -156,10 +156,10 @@ class acp_portal // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) { - if ($submit && isset($null['submit'])) + if ($submit && ($null['type'] == 'custom' || $null['submit_type'] == 'custom')) { $func = array($c_class, $null['submit']); - $args = ($module_id != 0) ? array($config_name, $module_id) : $config_name; + $args = ($module_id != 0) ? array($cfg_array[$config_name], $config_name, $module_id) : $config_name; call_user_func_array($func, $args); } @@ -245,6 +245,7 @@ class acp_portal 'U_ACTION' => $this->u_action . (($module_id) ? '&module_id=' . $module_id : ''), )); + // Output relevant page foreach ($display_vars['vars'] as $config_key => $vars) @@ -549,9 +550,18 @@ class acp_portal 'U_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=portal&mode=config&module_id=' . $row['module_id']), 'U_MOVE_UP' => $this->u_action . '&module_id=' . $row['module_id'] . '&action=move_up', 'U_MOVE_DOWN' => $this->u_action . '&module_id=' . $row['module_id'] . '&action=move_down', + 'U_MOVE_RIGHT' => $this->u_action . '&module_id=' . $row['module_id'] . '&action=move_right', + 'U_MOVE_LEFT' => $this->u_action . '&module_id=' . $row['module_id'] . '&action=move_left', )); } $db->sql_freeresult($result); + + $template->assign_vars(array( + 'ICON_MOVE_LEFT' => '' . $user->lang['MOVE_LEFT'] . '', + 'ICON_MOVE_LEFT_DISABLED' => '' . $user->lang['MOVE_LEFT'] . '', + 'ICON_MOVE_RIGHT' => '' . $user->lang['MOVE_RIGHT'] . '', + 'ICON_MOVE_RIGHT_DISABLED' => '' . $user->lang['MOVE_RIGHT'] . '', + )); } $this->tpl_name = 'portal/acp_portal_modules'; diff --git a/root/language/de/mods/info_acp_portal.php b/root/language/de/mods/info_acp_portal.php index 7c37e933..6cae58b0 100644 --- a/root/language/de/mods/info_acp_portal.php +++ b/root/language/de/mods/info_acp_portal.php @@ -50,6 +50,9 @@ $lang = array_merge($lang, array( 'SUCCESS_ADD' => 'Das Modul wurde erfolgreich hinzugefügt.', 'SUCCESS_DELETE' => 'Das Modul wurde erfolgreich entfernt.', 'NO_MODULES' => 'Es wurden keine Module gefunden.', + 'MOVE_RIGHT' => 'Nach rechts', + 'MOVE_LEFT' => 'Nach links', + 'B3P_FILE_NOT_FOUND' => 'Die angegebene Datei konnte nicht gefunden werden', 'MODULE_OPTIONS' => 'Modul Optionen', 'MODULE_NAME' => 'Modul Name', diff --git a/root/language/en/mods/info_acp_portal.php b/root/language/en/mods/info_acp_portal.php index 7ca1bfe7..8bd80596 100644 --- a/root/language/en/mods/info_acp_portal.php +++ b/root/language/en/mods/info_acp_portal.php @@ -49,6 +49,9 @@ $lang = array_merge($lang, array( 'SUCCESS_ADD' => 'The module was added successfully.', 'SUCCESS_DELETE' => 'The module was removed successfully.', 'NO_MODULES' => 'No modules have been detected.', + 'MOVE_RIGHT' => 'Move right', + 'MOVE_LEFT' => 'Move left', + 'B3P_FILE_NOT_FOUND' => 'The requested file could not be found', 'MODULE_OPTIONS' => 'Module options', 'MODULE_NAME' => 'Module name', diff --git a/root/portal/modules/portal_clock.php b/root/portal/modules/portal_clock.php index 8e73fc2c..638ffaca 100644 --- a/root/portal/modules/portal_clock.php +++ b/root/portal/modules/portal_clock.php @@ -63,7 +63,7 @@ class portal_clock_module 'title' => 'ACP_PORTAL_CLOCK_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_CLOCK_SETTINGS', - 'board3_clock_src_' . $module_id => array('lang' => 'ACP_PORTAL_CLOCK_SRC', 'validate' => 'string', 'type' => 'text:50:200', 'explain' => false), + 'board3_clock_src_' . $module_id => array('lang' => 'ACP_PORTAL_CLOCK_SRC', 'validate' => 'string', 'type' => 'text:50:200', 'explain' => true, 'submit_type' => 'custom', 'submit' => 'check_clock_src'), ), ); } @@ -88,6 +88,33 @@ class portal_clock_module WHERE ' . $db->sql_in_set('config_name', $del_config); return $db->sql_query($sql); } + + + /* + * check if the entered clock src file actually exists + */ + function check_clock_src($value, $key, $module_id) + { + global $db, $phpbb_root_path, $phpEx, $user; + + $sql = 'SELECT style_name + FROM ' . STYLES_TABLE . ' + WHERE style_active = 1'; + $result = $db->sql_query($sql); + while($row = $db->sql_fetchrow($result)) + { + if(!file_exists($phpbb_root_path . 'styles/' . $row['style_name'] . '/theme/images/portal/' . $value)) + { + $error .= $user->lang['B3P_FILE_NOT_FOUND'] . ': styles/' . $row['style_name'] . '/theme/images/portal/' . $value . '
'; + } + } + $db->sql_freeresult($result); + + if(isset($error)) + { + trigger_error($error . adm_back_link(append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=portal&mode=config&module_id=' . $module_id))); + } + } } ?> \ No newline at end of file