Introducing some changes to acp_icons. This adds language variables.

The JS candy is mostly only for firefox, the actual fix is splitting the list.

#13917
#13911


git-svn-id: file:///svn/phpbb/trunk@7992 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2007-08-01 15:50:47 +00:00
parent 0d9a8d0159
commit fae688ba2a
4 changed files with 74 additions and 19 deletions

View file

@ -4,8 +4,8 @@
<!-- IF S_EDIT --> <!-- IF S_EDIT -->
<script type="text/javascript" defer="defer">
<!-- IF S_ADD_CODE --> <!-- IF S_ADD_CODE -->
<script type="text/javascript" defer="defer">
<!-- <!--
var smiley = Array(); var smiley = Array();
@ -38,8 +38,36 @@
} }
} }
//--> //-->
</script>
<!-- ENDIF --> <!-- ENDIF -->
var toggle_options;
function toggle_select(smilie, display, select)
{
var disp = document.getElementById('order_disp[' + smilie + ']');
var nodisp = document.getElementById('order_no_disp[' + smilie + ']');
disp.disabled = !display;
//document.getElementById('order_disp[' + smilie + ']').style = '';
nodisp.disabled = display;
//document.getElementById('order_no_disp[' + smilie + ']').style = 'display:none';
if (display)
{
document.getElementById(select).selectedIndex = 0;
nodisp.style.display = 'none';
disp.style.display = '';
}
else
{
document.getElementById(select).selectedIndex = {S_ORDER_LIST_DISPLAY_COUNT};
disp.style.display = 'none';
nodisp.style.display = '';
}
}
</script>
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
@ -89,13 +117,16 @@
<td><input class="text post" type="text" size="3" name="width[{items.IMG}]" value="{items.WIDTH}" /></td> <td><input class="text post" type="text" size="3" name="width[{items.IMG}]" value="{items.WIDTH}" /></td>
<td><input class="text post" type="text" size="3" name="height[{items.IMG}]" value="{items.HEIGHT}" /></td> <td><input class="text post" type="text" size="3" name="height[{items.IMG}]" value="{items.HEIGHT}" /></td>
<td> <td>
<input type="checkbox" class="radio" name="display_on_posting[{items.IMG}]"{items.POSTING_CHECKED} /> <input type="checkbox" class="radio" name="display_on_posting[{items.IMG}]"{items.POSTING_CHECKED} onclick="toggle_select('{items.IMG}', this.checked, 'order[{items.IMG}]');"/>
<!-- IF items.S_ID --> <!-- IF items.S_ID -->
<input type="hidden" name="id[{items.IMG}]" value="{items.ID}" /> <input type="hidden" name="id[{items.IMG}]" value="{items.ID}" />
<!-- ENDIF --> <!-- ENDIF -->
</td> </td>
<!-- IF ID or S_ADD --> <!-- IF ID or S_ADD -->
<td><select name="order[{items.IMG}]">{S_ORDER_LIST}</select></td> <td><select id="order[{items.IMG}]" name="order[{items.IMG}]">
<optgroup id="order_disp[{items.IMG}]" label="{L_DISPLAY_POSTING}" <!-- IF not items.POSTING_CHECKED -->disabled="disabled" style="display:none"<!-- ENDIF -->>{S_ORDER_LIST_DISPLAY}</optgroup>
<optgroup id="order_no_disp[{items.IMG}]" label="{L_DISPLAY_POSTING_NO}" <!-- IF items.POSTING_CHECKED -->disabled="disabled" style="display:none"<!-- ENDIF -->>{S_ORDER_LIST_UNDISPLAY}</optgroup>
</select></td>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_ADD --> <!-- IF S_ADD -->
<td><input type="checkbox" class="radio" name="add_img[{items.IMG}]" value="1" /></td> <td><input type="checkbox" class="radio" name="add_img[{items.IMG}]" value="1" /></td>
@ -113,8 +144,11 @@
<td><input class="text post" type="text" name="add_emotion" id="add_emotion" value="{EMOTION}" size="10" maxlength="50" /></td> <td><input class="text post" type="text" name="add_emotion" id="add_emotion" value="{EMOTION}" size="10" maxlength="50" /></td>
<td><input class="text post" type="text" size="3" name="add_width" id="add_width" value="{WIDTH}" /></td> <td><input class="text post" type="text" size="3" name="add_width" id="add_width" value="{WIDTH}" /></td>
<td><input class="text post" type="text" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td> <td><input class="text post" type="text" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td>
<td><input type="checkbox" class="radio" name="add_display_on_posting" checked="checked" /></td> <td><input type="checkbox" class="radio" name="add_display_on_posting" checked="checked" onclick="toggle_select('add', this.checked, 'add_order');"/></td>
<td><select name="add_order" id="add_order">{S_ADD_ORDER_LIST}</select></td> <td><select id="add_order" name="add_order">
<optgroup id="order_disp[add]" label="{L_DISPLAY_POSTING}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
<optgroup id="order_no_disp[add]" label="{L_DISPLAY_POSTING_NO}" disabled="disabled" style="display:none">{S_ADD_ORDER_LIST_UNDISPLAY}</optgroup>
</select></td>
<td><input type="checkbox" class="radio" name="add_additional_code" value="1" /></td> <td><input type="checkbox" class="radio" name="add_additional_code" value="1" /></td>
</tr> </tr>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -193,6 +193,10 @@ p a {
<li>[Fix] Allow MS SQL to properly connect when using the mssql driver and PHP is less than either 4.4.1 or 5.1 (Bug #13874)</li> <li>[Fix] Allow MS SQL to properly connect when using the mssql driver and PHP is less than either 4.4.1 or 5.1 (Bug #13874)</li>
<li>[Fix] Ignore files containging HTML special chars in the filenames as gallery avatars (Bug #13906)</li> <li>[Fix] Ignore files containging HTML special chars in the filenames as gallery avatars (Bug #13906)</li>
<li>[Fix] Multiple PM recipients not separated (Bug #13876)</li> <li>[Fix] Multiple PM recipients not separated (Bug #13876)</li>
<li>[Change] Split the select list for the smilie order to clarify which are feasible and which are not (Bug #13911)</li>
<li>[Fix] Convert empty homepage fields (Bug #13917)</li>
</ul> </ul>

View file

@ -144,13 +144,19 @@ class acp_icons
} }
} }
} }
$sql = "SELECT * $sql = "SELECT *
FROM $table FROM $table
ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$data = array(); $data = array();
$after = false;
$display = 0;
$order_lists = array('', '');
$add_order_lists = array('', '');
$display_count = 0;
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
if ($action == 'add') if ($action == 'add')
@ -158,9 +164,11 @@ class acp_icons
unset($_images[$row[$fields . '_url']]); unset($_images[$row[$fields . '_url']]);
} }
if ($row[$fields . '_id'] == $icon_id) if ($row[$fields . '_id'] == $icon_id)
{ {
$after = true; $after = true;
$display = $row['display_on_posting'];
$data[$row[$fields . '_url']] = $row; $data[$row[$fields . '_url']] = $row;
} }
else else
@ -176,35 +184,41 @@ class acp_icons
$selected = ' selected="selected"'; $selected = ' selected="selected"';
$after = false; $after = false;
} }
if ($row['display_on_posting'])
{
$display_count++;
}
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url']; $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
$order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . $after_txt) . '</option>' . $order_list; $order_lists[$row['display_on_posting']] = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . $after_txt) . '</option>' . $order_lists[$row['display_on_posting']];
if (!empty($default_row)) if (!empty($default_row))
{ {
$add_order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . (($row[$fields . '_id'] == $default_row['smiley_id']) ? ' selected="selected"' : '') . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . $after_txt) . '</option>' . $add_order_list; $add_order_lists[$row['display_on_posting']] = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . (($row[$fields . '_id'] == $default_row['smiley_id']) ? ' selected="selected"' : '') . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . $after_txt) . '</option>' . $add_order_lists[$row['display_on_posting']];
} }
} }
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>' . $order_list; $order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>';
$add_order_list = '<option value="1">' . $user->lang['FIRST'] . '</option>' . $add_order_list; $add_order_list = '<option value="1">' . $user->lang['FIRST'] . '</option>';
if ($action == 'add') if ($action == 'add')
{ {
$data = $_images; $data = $_images;
} }
$colspan = (($mode == 'smilies') ? '7' : '5'); $colspan = (($mode == 'smilies') ? '7' : '5');
$colspan += ($icon_id) ? 1 : 0; $colspan += ($icon_id) ? 1 : 0;
$colspan += ($action == 'add') ? 2 : 0; $colspan += ($action == 'add') ? 2 : 0;
$template->assign_vars(array( $template->assign_vars(array(
'S_EDIT' => true, 'S_EDIT' => true,
'S_SMILIES' => ($mode == 'smilies') ? true : false, 'S_SMILIES' => ($mode == 'smilies') ? true : false,
'S_ADD' => ($action == 'add') ? true : false, 'S_ADD' => ($action == 'add') ? true : false,
'S_ORDER_LIST' => $order_list,
'S_ORDER_LIST_DISPLAY' => $order_list . $order_lists[1],
'S_ORDER_LIST_UNDISPLAY' => $order_list . $order_lists[0],
'S_ORDER_LIST_DISPLAY_COUNT' => $display_count + 1,
'L_TITLE' => $user->lang['ACP_' . $lang], 'L_TITLE' => $user->lang['ACP_' . $lang],
'L_EXPLAIN' => $user->lang['ACP_' . $lang . '_EXPLAIN'], 'L_EXPLAIN' => $user->lang['ACP_' . $lang . '_EXPLAIN'],
@ -247,7 +261,10 @@ class acp_icons
'S_ADD_CODE' => true, 'S_ADD_CODE' => true,
'S_IMG_OPTIONS' => $smiley_options, 'S_IMG_OPTIONS' => $smiley_options,
'S_ADD_ORDER_LIST' => $add_order_list,
'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1],
'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0],
'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'], 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
'IMG_PATH' => $img_path, 'IMG_PATH' => $img_path,
'PHPBB_ROOT_PATH' => $phpbb_root_path, 'PHPBB_ROOT_PATH' => $phpbb_root_path,

View file

@ -228,7 +228,7 @@ function validate_website($url)
{ {
return ''; return '';
} }
else if (strpos(strtolower($url), 'http://') !== 0) else if (strpos(strtolower($url), 'http://') !== 0 && strlen($url) > 0)
{ {
return 'http://' . $url; return 'http://' . $url;
} }