Added check for existence of clock file;
Added basic set of files for moving blocks right & left (still missing the functions in includes/acp/acp_portal.php)
This commit is contained in:
BIN
root/adm/images/icon_left.gif
Normal file
BIN
root/adm/images/icon_left.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 240 B |
BIN
root/adm/images/icon_left_disabled.gif
Normal file
BIN
root/adm/images/icon_left_disabled.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 166 B |
BIN
root/adm/images/icon_right.gif
Normal file
BIN
root/adm/images/icon_right.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 241 B |
BIN
root/adm/images/icon_right_disabled.gif
Normal file
BIN
root/adm/images/icon_right_disabled.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 166 B |
@@ -68,8 +68,10 @@
|
|||||||
{modules_left.MODULE_IMAGE} {modules_left.MODULE_NAME}<br />
|
{modules_left.MODULE_IMAGE} {modules_left.MODULE_NAME}<br />
|
||||||
<br />
|
<br />
|
||||||
<!-- IF modules_left.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{modules_left.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
<!-- IF modules_left.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{modules_left.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
||||||
<!-- IF modules_left.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{modules_left.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
<a href="{modules_left.U_MOVE_RIGHT}">{ICON_MOVE_RIGHT}</a>
|
||||||
<a href="{modules_left.U_EDIT}">{ICON_EDIT}</a> <a href="{modules_left.U_DELETE}">{ICON_DELETE}</a>
|
<a href="{modules_left.U_EDIT}">{ICON_EDIT}</a> <a href="{modules_left.U_DELETE}">{ICON_DELETE}</a><br/>
|
||||||
|
{ICON_MOVE_LEFT_DISABLED}
|
||||||
|
<!-- IF modules_left.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{modules_left.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGINELSE -->
|
<!-- BEGINELSE -->
|
||||||
@@ -93,8 +95,10 @@
|
|||||||
{modules_center.MODULE_IMAGE} {modules_center.MODULE_NAME}<br />
|
{modules_center.MODULE_IMAGE} {modules_center.MODULE_NAME}<br />
|
||||||
<br />
|
<br />
|
||||||
<!-- IF modules_center.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{modules_center.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
<!-- IF modules_center.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{modules_center.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
||||||
<!-- IF modules_center.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{modules_center.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
<a href="{modules_left.U_MOVE_RIGHT}">{ICON_MOVE_RIGHT}</a>
|
||||||
<a href="{modules_center.U_EDIT}">{ICON_EDIT}</a> <a href="{modules_center.U_DELETE}">{ICON_DELETE}</a>
|
<a href="{modules_center.U_EDIT}">{ICON_EDIT}</a> <a href="{modules_center.U_DELETE}">{ICON_DELETE}</a><br />
|
||||||
|
<a href="{modules_left.U_MOVE_LEFT}">{ICON_MOVE_LEFT}</a>
|
||||||
|
<!-- IF modules_center.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{modules_center.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGINELSE -->
|
<!-- BEGINELSE -->
|
||||||
@@ -118,8 +122,10 @@
|
|||||||
{modules_right.MODULE_IMAGE} {modules_right.MODULE_NAME}<br />
|
{modules_right.MODULE_IMAGE} {modules_right.MODULE_NAME}<br />
|
||||||
<br />
|
<br />
|
||||||
<!-- IF modules_right.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{modules_right.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
<!-- IF modules_right.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{modules_right.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->
|
||||||
<!-- IF modules_right.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{modules_right.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
{ICON_MOVE_RIGHT_DISABLED}
|
||||||
<a href="{modules_right.U_EDIT}">{ICON_EDIT}</a> <a href="{modules_right.U_DELETE}">{ICON_DELETE}</a>
|
<a href="{modules_right.U_EDIT}">{ICON_EDIT}</a> <a href="{modules_right.U_DELETE}">{ICON_DELETE}</a><br />
|
||||||
|
<a href="{modules_left.U_MOVE_LEFT}">{ICON_MOVE_LEFT}</a>
|
||||||
|
<!-- IF modules_right.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{modules_right.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGINELSE -->
|
<!-- BEGINELSE -->
|
||||||
|
|||||||
@@ -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...
|
// 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)
|
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']);
|
$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);
|
call_user_func_array($func, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,6 +245,7 @@ class acp_portal
|
|||||||
|
|
||||||
'U_ACTION' => $this->u_action . (($module_id) ? '&module_id=' . $module_id : ''),
|
'U_ACTION' => $this->u_action . (($module_id) ? '&module_id=' . $module_id : ''),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
// Output relevant page
|
// Output relevant page
|
||||||
foreach ($display_vars['vars'] as $config_key => $vars)
|
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_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_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_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);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'ICON_MOVE_LEFT' => '<img src="' . $phpbb_admin_path . 'images/icon_left.gif" alt="' . $user->lang['MOVE_LEFT'] . '" title="' . $user->lang['MOVE_LEFT'] . '" />',
|
||||||
|
'ICON_MOVE_LEFT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_left_disabled.gif" alt="' . $user->lang['MOVE_LEFT'] . '" title="' . $user->lang['MOVE_LEFT'] . '" />',
|
||||||
|
'ICON_MOVE_RIGHT' => '<img src="' . $phpbb_admin_path . 'images/icon_right.gif" alt="' . $user->lang['MOVE_RIGHT'] . '" title="' . $user->lang['MOVE_RIGHT'] . '" />',
|
||||||
|
'ICON_MOVE_RIGHT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_right_disabled.gif" alt="' . $user->lang['MOVE_RIGHT'] . '" title="' . $user->lang['MOVE_RIGHT'] . '" />',
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tpl_name = 'portal/acp_portal_modules';
|
$this->tpl_name = 'portal/acp_portal_modules';
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ $lang = array_merge($lang, array(
|
|||||||
'SUCCESS_ADD' => 'Das Modul wurde erfolgreich hinzugefügt.',
|
'SUCCESS_ADD' => 'Das Modul wurde erfolgreich hinzugefügt.',
|
||||||
'SUCCESS_DELETE' => 'Das Modul wurde erfolgreich entfernt.',
|
'SUCCESS_DELETE' => 'Das Modul wurde erfolgreich entfernt.',
|
||||||
'NO_MODULES' => 'Es wurden keine Module gefunden.',
|
'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_OPTIONS' => 'Modul Optionen',
|
||||||
'MODULE_NAME' => 'Modul Name',
|
'MODULE_NAME' => 'Modul Name',
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ $lang = array_merge($lang, array(
|
|||||||
'SUCCESS_ADD' => 'The module was added successfully.',
|
'SUCCESS_ADD' => 'The module was added successfully.',
|
||||||
'SUCCESS_DELETE' => 'The module was removed successfully.',
|
'SUCCESS_DELETE' => 'The module was removed successfully.',
|
||||||
'NO_MODULES' => 'No modules have been detected.',
|
'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_OPTIONS' => 'Module options',
|
||||||
'MODULE_NAME' => 'Module name',
|
'MODULE_NAME' => 'Module name',
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class portal_clock_module
|
|||||||
'title' => 'ACP_PORTAL_CLOCK_SETTINGS',
|
'title' => 'ACP_PORTAL_CLOCK_SETTINGS',
|
||||||
'vars' => array(
|
'vars' => array(
|
||||||
'legend1' => 'ACP_PORTAL_CLOCK_SETTINGS',
|
'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);
|
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||||
return $db->sql_query($sql);
|
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 . '<br />';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$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)));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user