diff options
author | Zoddo <zoddo.ino@gmail.com> | 2015-09-12 00:53:33 +0200 |
---|---|---|
committer | Zoddo <zoddo.ino@gmail.com> | 2015-10-10 15:29:31 +0200 |
commit | 3937f1f4ae77b29faf69292783cc3ae267785ee4 (patch) | |
tree | f1764ac1f6c81f6b464e27665e73cf403644a7be /phpBB/includes/acp/acp_icons.php | |
parent | 8f6b50922ffc7d6c55fdfecf09ccde293546db24 (diff) | |
download | forums-3937f1f4ae77b29faf69292783cc3ae267785ee4.tar forums-3937f1f4ae77b29faf69292783cc3ae267785ee4.tar.gz forums-3937f1f4ae77b29faf69292783cc3ae267785ee4.tar.bz2 forums-3937f1f4ae77b29faf69292783cc3ae267785ee4.tar.xz forums-3937f1f4ae77b29faf69292783cc3ae267785ee4.zip |
[ticket/14157] Allow to set the alt/title attribute on post icons
PHPBB3-14157
Diffstat (limited to 'phpBB/includes/acp/acp_icons.php')
-rw-r--r-- | phpBB/includes/acp/acp_icons.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 5d1756de45..57a36bb9f3 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -248,7 +248,7 @@ class acp_icons $data = $_images; } - $colspan = (($mode == 'smilies') ? 7 : 5); + $colspan = (($mode == 'smilies') ? 7 : 6); $colspan += ($icon_id) ? 1 : 0; $colspan += ($action == 'add') ? 2 : 0; @@ -292,6 +292,8 @@ class acp_icons 'ID' => (isset($img_row[$fields . '_id'])) ? $img_row[$fields . '_id'] : 0, 'WIDTH' => (!empty($img_row[$fields .'_width'])) ? $img_row[$fields .'_width'] : $img_row['width'], 'HEIGHT' => (!empty($img_row[$fields .'_height'])) ? $img_row[$fields .'_height'] : $img_row['height'], + 'TEXT_ALT' => ($mode == 'icons' && !empty($img_row['icons_alt'])) ? $img_row['icons_alt'] : $img, + 'ALT' => ($mode == 'icons' && !empty($img_row['icons_alt'])) ? $img_row['icons_alt'] : '', 'POSTING_CHECKED' => (!empty($img_row['display_on_posting']) || $action == 'add') ? ' checked="checked"' : '', )); } @@ -336,6 +338,7 @@ class acp_icons $image_add = (isset($_POST['add_img'])) ? $request->variable('add_img', array('' => 0)) : array(); $image_emotion = $request->variable('emotion', array('' => ''), true); $image_code = $request->variable('code', array('' => ''), true); + $image_alt = ($request->is_set_post('alt')) ? $request->variable('alt', array('' => ''), true) : array(); $image_display_on_posting = (isset($_POST['display_on_posting'])) ? $request->variable('display_on_posting', array('' => 0)) : array(); // Ok, add the relevant bits if we are adding new codes to existing emoticons... @@ -438,6 +441,13 @@ class acp_icons ); } + if ($mode == 'icons') + { + $img_sql = array_merge($img_sql, array( + 'icons_alt' => $image_alt[$image]) + ); + } + // Image_order holds the 'new' order value if (!empty($image_order[$image])) { @@ -921,7 +931,7 @@ class acp_icons while ($row = $db->sql_fetchrow($result)) { - $alt_text = ($mode == 'smilies') ? $row['code'] : ''; + $alt_text = ($mode == 'smilies') ? $row['code'] : (($mode == 'icons' && !empty($row['icons_alt'])) ? $row['icons_alt'] : $row['icons_url']); $template->assign_block_vars('items', array( 'S_SPACER' => (!$spacer && !$row['display_on_posting']) ? true : false, |