aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-01-22 05:33:09 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-01-22 05:33:09 +0000
commitc10f287751ad0b1926bca72b1a732d8f7785de7d (patch)
tree2d29e18803eb3aca3bda2894aa2ba6e2c05008de
parent7de53b46ec192c66192f3ebcd6123c2c3dbecb6f (diff)
downloadforums-c10f287751ad0b1926bca72b1a732d8f7785de7d.tar
forums-c10f287751ad0b1926bca72b1a732d8f7785de7d.tar.gz
forums-c10f287751ad0b1926bca72b1a732d8f7785de7d.tar.bz2
forums-c10f287751ad0b1926bca72b1a732d8f7785de7d.tar.xz
forums-c10f287751ad0b1926bca72b1a732d8f7785de7d.zip
- Imagesets can now be edited! Hooray! ( Might need to add something.. )
git-svn-id: file:///svn/phpbb/trunk@5483 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/adm/style/acp_styles.html45
-rw-r--r--phpBB/includes/acp/acp_styles.php104
-rw-r--r--phpBB/language/en/acp/common.php1
-rw-r--r--phpBB/language/en/acp/styles.php11
4 files changed, 159 insertions, 2 deletions
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html
index a9bd2932cd..0c7a6a21ed 100644
--- a/phpBB/adm/style/acp_styles.html
+++ b/phpBB/adm/style/acp_styles.html
@@ -30,6 +30,51 @@
</form>
+<!-- ELSEIF S_EDIT_IMAGESET -->
+
+ <a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
+
+ <h1>{L_TITLE}</h1>
+
+ <p>{L_EXPLAIN}</p>
+
+ <form id="acp_styles" method="post" action="{U_ACTION}">
+ <table cellspacing="1">
+ <thead>
+ <tr>
+ <th colspan="5">{L_IMAGE_CONFIGURATION}</th>
+ </tr>
+ <tr>
+ <td class="row3" colspan="5"><b>{L_IMAGESET_NAME}: {NAME}</b></td>
+ </tr>
+ <tr class="row3">
+ <td>{L_IMAGE_NAME}</td>
+ <td>{L_IMAGE}</td>
+ <td>{L_IMAGE_LOCATION}</td>
+ <td>{L_IMAGE_WIDTH}</td>
+ <td>{L_IMAGE_HEIGHT}</td>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- BEGIN element -->
+ <!-- IF element.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
+ <td style="text-align: center;">{element.NAME}</td>
+ <td style="text-align: center;"><img src="{element.IMG_SRC}" alt="" title="" /></td>
+ <td><input class="post" type="text" name="src[{element.NAME}]" value="{element.SRC}" size="20" /></td>
+ <td><input class="post" type="text" size="3" name="width[{element.NAME}]" value="{element.WIDTH}" /></td>
+ <td><input class="post" type="text" size="3" name="height[{element.NAME}]" value="{element.HEIGHT}" /></td>
+ </tr>
+ <!-- END element -->
+ </tbody>
+ </table>
+
+ <fieldset class="submit-buttons">
+ <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
+ <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
+ </fieldset>
+
+ </form>
+
<!-- ELSEIF S_EXPORT -->
<a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 57c9fbfeaf..759ad47dcd 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -258,8 +258,14 @@ pagination_sep = \'{PAGINATION_SEP}\'
break;
case 'imageset':
-
- $this->frontend('imageset', array('details', 'delete', 'export'));
+ switch ($action)
+ {
+ case 'edit':
+ $this->edit_imageset($style_id);
+ break;
+ default:
+ $this->frontend('imageset', array('details', 'delete', 'export'));
+ }
break;
}
}
@@ -411,6 +417,100 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
/**
+ * Edit imagesets
+ */
+ function edit_imageset($style_id)
+ {
+ global $db, $template, $user, $phpbb_root_path, $cache;
+
+ $update = (isset($_POST['submit'])) ? true : false;
+
+ $sql = 'SELECT imageset_name, ' . $this->imageset_keys . '
+ FROM ' . STYLES_IMAGE_TABLE . '
+ WHERE imageset_id = ' . $style_id;
+ $result = $db->sql_query($sql);
+ $style_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if (!$style_row)
+ {
+ trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action));
+ }
+
+ $name = $style_row['imageset_name'];
+ unset($style_row['imageset_name']);
+
+ if ($update)
+ {
+ $images = (isset($_POST['src'])) ? request_var('src', array('' => '')) : array();
+ $image_width = (isset($_POST['width'])) ? array_map('intval', $_POST['width']) : array();
+ $image_height = (isset($_POST['height'])) ? array_map('intval', $_POST['height']) : array();
+
+ $img_array = array();
+
+ foreach ($images as $image_name => $value)
+ {
+ if (!empty($value))
+ {
+ $width = ($image_width[$image_name] == 0) ? '' : $image_width[$image_name];
+ $img_array[$image_name] = $value . '*' . $image_height[$image_name] . '*' . $width;
+ }
+ else
+ {
+ $img_array[$image_name] = '';
+ }
+ }
+
+ $sql = 'UPDATE ' . STYLES_IMAGE_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $img_array) . "
+ WHERE imageset_id = $style_id";
+ $db->sql_query($sql);
+
+ $cache->destroy('sql', STYLES_IMAGE_TABLE);
+
+ add_log('admin', 'LOG_IMAGESET_EDIT', $name);
+ trigger_error($user->lang['EDITED_IMAGESET'] . adm_back_link($this->u_action));
+ }
+
+ $this->page_title = 'EDIT_IMAGESET';
+
+ foreach ($style_row as $key => $value)
+ {
+ $src = '';
+
+ $width = $height = $imgsrc = '';
+ if (!empty($value))
+ {
+ $values = explode('*',$value);
+ $imgsrc = $values[0];
+ $height = (!empty($values[1])) ? $values[1] : '';
+ $width = (!empty($values[2])) ? $values[2] : '';
+ }
+
+ $template->assign_block_vars('element', array(
+ 'NAME' => $key,
+ 'SRC' => $imgsrc,
+ 'HEIGHT' => $height,
+ 'WIDTH' => $width,
+ 'IMG_SRC' => $phpbb_root_path . 'styles/' . $user->theme['imageset_path'] . '/imageset/' . str_replace('{LANG}', $user->img_lang, $imgsrc)
+ )
+ );
+ }
+
+
+ $template->assign_vars(array(
+ 'S_EDIT_IMAGESET' => true,
+ 'L_TITLE' => $user->lang[$this->page_title],
+ 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
+
+ 'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$style_id",
+ 'U_BACK' => $this->u_action,
+ 'NAME' => $name,
+ )
+ );
+ }
+
+ /**
* Remove style/template/theme/imageset
*/
function remove($mode, $style_id)
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 89feb93e3c..b70b5c33ec 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -338,6 +338,7 @@ $lang = array_merge($lang, array(
'LOG_IMAGESET_ADD_FS' => '<b>Add new imageset on filesystem</b><br />&#187; %s',
'LOG_IMAGESET_DELETE' => '<b>Deleted imageset</b><br />&#187; %s',
'LOG_IMAGESET_EDIT_DETAILS' => '<b>Edited imageset details</b><br />&#187; %s',
+ 'LOG_IMAGESET_EDIT' => '<b>Edited imageset</b><br />&#187; %s',
'LOG_IMAGESET_EXPORT' => '<b>Exported imageset</b><br />&#187; %s',
'LOG_INDEX_ACTIVATE' => '<b>Activated inactive users</b><br />&#187; %s',
diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php
index a83ffcc6ce..cffb03bdab 100644
--- a/phpBB/language/en/acp/styles.php
+++ b/phpBB/language/en/acp/styles.php
@@ -62,6 +62,15 @@ $lang = array_merge($lang, array(
'DELETE_THEME_EXPLAIN' => 'Here you can remove the selected theme from the database. Additionally, if you have permission you can elect to remove the theme from the filesystem. Please note that there is no undo capability. When the theme is deleted it is gone for good. It is recommended that you first export your theme for possible future use.',
'DETAILS' => 'Details',
+ 'EDIT_IMAGESET' => 'Edit imageset',
+ 'EDIT_IMAGESET_EXPLAIN' => 'Here you can modify the images stored in the currently selected imageset.',
+ 'IMAGE_CONFIGURATION' => 'Image configuration',
+ 'IMAGE_WIDTH' => 'Image width',
+ 'IMAGE_HEIGHT' => 'Image height',
+ 'IMAGE' => 'Image',
+ 'IMAGE_NAME' => 'Image name',
+ 'IMAGE_LOCATION' => 'Image location',
+
'EDIT_DETAILS_IMAGESET' => 'Edit imageset details',
'EDIT_DETAILS_IMAGESET_EXPLAIN' => 'Here you can edit certain imageset details such as its name.',
'EDIT_DETAILS_STYLE' => 'Edit Style',
@@ -106,6 +115,8 @@ $lang = array_merge($lang, array(
'INSTALLED_TEMPLATE' => 'Installed templates',
'INSTALLED_THEME' => 'Installed themes',
+ 'EDITED_IMAGESET' => 'Edited imageset',
+
'NO_IMAGESET' => 'Cannot find imageset on filesystem',
'NO_STYLE' => 'Cannot find style on filesystem',
'NO_TEMPLATE' => 'Cannot find template on filesystem',