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:
Marc Alexander
2011-01-10 23:35:20 +00:00
parent 9ce0695824
commit 488deca772
9 changed files with 58 additions and 9 deletions

View File

@@ -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 . '<br />';
}
}
$db->sql_freeresult($result);
if(isset($error))
{
trigger_error($error . adm_back_link(append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=portal&amp;mode=config&amp;module_id=' . $module_id)));
}
}
}
?>