diff options
author | Henry Sudhof <kellanved@phpbb.com> | 2007-06-11 12:39:51 +0000 |
---|---|---|
committer | Henry Sudhof <kellanved@phpbb.com> | 2007-06-11 12:39:51 +0000 |
commit | 0d074672fa8209c85af75ef7d7cdfbaf8e16cbab (patch) | |
tree | c8628246d3131dbf338fe9702edcb73712432dcc | |
parent | 13a02f6cc5bcdb0654642135b2981633ac3996b5 (diff) | |
download | forums-0d074672fa8209c85af75ef7d7cdfbaf8e16cbab.tar forums-0d074672fa8209c85af75ef7d7cdfbaf8e16cbab.tar.gz forums-0d074672fa8209c85af75ef7d7cdfbaf8e16cbab.tar.bz2 forums-0d074672fa8209c85af75ef7d7cdfbaf8e16cbab.tar.xz forums-0d074672fa8209c85af75ef7d7cdfbaf8e16cbab.zip |
Introducing the ability to manually set the dimensions of an image in the imageset editor.
A little spelling.
Introduces new language variable(s).
#11925
#11675
git-svn-id: file:///svn/phpbb/trunk@7750 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/adm/style/acp_styles.html | 43 | ||||
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 19 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/acp/common.php | 4 | ||||
-rw-r--r-- | phpBB/language/en/acp/styles.php | 1 |
6 files changed, 60 insertions, 10 deletions
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 26d0a6af4a..58d742ba62 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -58,6 +58,35 @@ } //--> </script> + <script type="text/javascript"> + <!-- + /** + * Handle displaying/hiding the dimension fields + */ + function display_options(value) + { + if (value == 0) + { + dE('img_dimensions', -1); + } + else + { + dE('img_dimensions', 1); + } + } + + /** + * Init the wanted display functionality if javascript is enabled. + * If javascript is not available, the user is still able to properly administrate. + */ + onload = function() + { + <!-- IF not IMAGE_SIZE --> + dE('img_dimensions', -1); + <!-- ENDIF --> + } + //--> + </script> <form method="post" action="{U_ACTION}"> @@ -100,9 +129,19 @@ </dl> <dl> <dt><label for="imgsize">{L_INCLUDE_DIMENSIONS}:</label><br /><span>{L_DIMENSIONS_EXPLAIN}</span></dt> - <dd><label><input type="radio" class="radio" name="imgsize" id="imgsize" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> - <label><input type="radio" class="radio" name="imgsize" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> + <dd><label><input type="radio" class="radio" name="imgsize" id="imgsize" onclick="display_options(1);" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> + <label><input type="radio" class="radio" name="imgsize" onclick="display_options(0);" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> + <div id="img_dimensions"> + <dl> + <dt><label for="imgwidth">{L_IMAGE_WIDTH}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt> + <dd><input type="text" name="imgwidth" value="{IMAGE_SIZE}" /></dd> + </dl> + <dl> + <dt><label for="imgheight">{L_IMAGE_HEIGHT}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt> + <dd><input type="text" name="imgheight" value="{IMAGE_HEIGHT}" /></dd> + </dl> + </div> </fieldset> <fieldset class="submit-buttons"> diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index e7570d1169..2f4bc5b848 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -269,6 +269,7 @@ p a { <li>[Fix] Wrongly applied setting for allowing links in private messages (used the signature setting instead of the post setting) (Bug #11945)</li> <li>[Fix] Unread flag for multipage topic wrongly set under some conditions (Bug #12127) - fix provided by asinshesq</li> <li>[Fix] Able to delete posts within user prune panel (Bug #11849)</li> + <li>[Feature] Allow to specify dimensions of images manually on imageset config (Bug #11675)</li> </ul> diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index cc3a54ad04..5f3aa024fc 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1209,7 +1209,8 @@ parse_css_file = {PARSE_CSS_FILE} $imgpath = request_var('imgpath', ''); $imgsize = request_var('imgsize', false); $imgwidth = request_var('imgwidth', 0); - + $imgheight = request_var('imgheight', 0); + $imgname = preg_replace('#[^a-z0-9\-+_]#i', '', $imgname); $imgpath = str_replace('..', '.', $imgpath); @@ -1269,7 +1270,8 @@ parse_css_file = {PARSE_CSS_FILE} { // If imgwidth and imgheight are non-zero grab the actual size // from the image itself ... we ignore width settings for the poll center image - $imgwidth = $imgheight = 0; + $imgwidth = request_var('imgwidth', 0); + $imgheight = request_var('imgheight', 0); $imglang = ''; if ($imgpath && !file_exists("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath")) @@ -1279,10 +1281,16 @@ parse_css_file = {PARSE_CSS_FILE} if ($imgsize && $imgpath) { - list($imgwidth, $imgheight) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"); + if (!$imgwidth || !$imgheight) + { + list($imgwidth_file, $imgheight_file) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"); + $imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file; + $imgheight = ($imgheight) ? $imgheight : $imgheight_file; + } $imgwidth = ($imgname != 'poll_center') ? (int) $imgwidth : 0; $imgheight = (int) $imgheight; - } + } + if (strpos($imgpath, '/') !== false) { @@ -1442,7 +1450,8 @@ parse_css_file = {PARSE_CSS_FILE} 'L_TITLE' => $user->lang[$this->page_title], 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'], 'IMAGE_OPTIONS' => $img_options, - 'IMAGE_SIZE' => $imgsize_bool, + 'IMAGE_SIZE' => $image_width, + 'IMAGE_HEIGHT' => $image_height, 'IMAGE_REQUEST' => $image_request, 'U_ACTION' => $this->u_action . "&action=edit&id=$imageset_id", 'U_BACK' => $this->u_action, diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 3e9c5655e8..ef41ede5c4 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -417,7 +417,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $post_id_list = array(); while ($row = $db->sql_fetchrow($result)) { - // If splitted from selected post (split_beyond), we split the unapproved items too. + // If split from selected post (split_beyond), we split the unapproved items too. if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id'])) { // continue; diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index aada3a4ee0..92e6d77dfb 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -466,8 +466,8 @@ $lang = array_merge($lang, array( 'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by</strong><br />» %2$s', 'LOG_REPORT_CLOSED' => '<strong>Closed report</strong><br />» %s', 'LOG_REPORT_DELETED' => '<strong>Deleted report</strong><br />» %s', - 'LOG_SPLIT_DESTINATION' => '<strong>Moved splitted posts</strong><br />» to %s', - 'LOG_SPLIT_SOURCE' => '<strong>Splitted posts</strong><br />» from %s', + 'LOG_SPLIT_DESTINATION' => '<strong>Moved split posts</strong><br />» to %s', + 'LOG_SPLIT_SOURCE' => '<strong>Split posts</strong><br />» from %s', 'LOG_TOPIC_DELETED' => '<strong>Deleted topic</strong><br />» %s', 'LOG_TOPIC_APPROVED' => '<strong>Approved topic</strong><br />» %s', diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index 8dc5d21775..4f7472e5ff 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -44,6 +44,7 @@ $lang = array_merge($lang, array( 'ADD_THEME' => 'Create theme', 'ADD_THEME_EXPLAIN' => 'Here you can add a new theme. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this theme on an existing one. You may also be able to upload or import (from the store directory) a theme archive. If you upload or import an archive the theme name can be optionally taken from the archive name (to do this leave the theme name blank).', 'ARCHIVE_FORMAT' => 'Archive file type', + 'AUTOMATIC_EXPLAIN' => 'Leave blank to attempt automatic detection.', 'BACKGROUND' => 'Background', 'BACKGROUND_COLOUR' => 'Background colour', |