aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-12-06 02:31:02 +0000
committerpatdenice <patdenice@piwigo.org>2008-12-06 02:31:02 +0000
commit76181e5a495a21a2bfae205fcfa89062f0cc9eeb (patch)
tree1fa224b421633abb86e2de4e4d9a07c8c42de9e2 /admin
parentf4f4f9724a480a4336af547c3a0ff814924f0acc (diff)
merge -c2923 from trunk to branch 2.0.
- Add a "Bound Template" column for template extensions. git-svn-id: http://piwigo.org/svn/branches/2.0@2924 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/extend_for_templates.php27
-rw-r--r--admin/template/goto/default-layout.css2
-rw-r--r--admin/template/goto/extend_for_templates.tpl4
3 files changed, 24 insertions, 9 deletions
diff --git a/admin/extend_for_templates.php b/admin/extend_for_templates.php
index 30b21f277..01a24b478 100644
--- a/admin/extend_for_templates.php
+++ b/admin/extend_for_templates.php
@@ -102,7 +102,13 @@ $eligible_templates = array(
'slideshow.tpl' => 'slideshow',
'tags.tpl' => 'tags',
'upload.tpl' => 'upload',);
- $flip_templates = array_flip($eligible_templates);
+
+$flip_templates = array_flip($eligible_templates);
+
+$available_templates = array_merge(
+ array('N/A' => '----------'),
+ get_dirs(PHPWG_ROOT_PATH.'template'));
+
// +-----------------------------------------------------------------------+
// | selected templates |
// +-----------------------------------------------------------------------+
@@ -118,9 +124,11 @@ if (isset($_POST['submit']) and !is_adviser())
$handle = $eligible_templates[$original];
$url_keyword = $_POST['url'][$i];
if ($url_keyword == '----------') $url_keyword = 'N/A';
+ $bound_tpl = $_POST['bound'][$i];
+ if ($bound_tpl == '----------') $bound_tpl = 'N/A';
if ($handle != 'N/A')
{
- $replacements[$newtpl] = array($handle, $url_keyword);
+ $replacements[$newtpl] = array($handle, $url_keyword, $bound_tpl);
}
$i++;
}
@@ -150,7 +158,7 @@ foreach ($tpl_extension as $file => $conditions)
}
foreach ($new_extensions as $file)
{
- $tpl_extension[$file] = array('N/A', 'N/A');
+ $tpl_extension[$file] = array('N/A', 'N/A', 'N/A');
}
$template->set_filenames(array('extend_for_templates'
@@ -167,14 +175,17 @@ foreach ($tpl_extension as $file => $conditions)
{
$handle = $conditions[0];
$url_keyword = $conditions[1];
+ $bound_tpl = $conditions[2];
{
$template->append('extents',
array(
- 'replacer' => $file,
- 'url_parameter' => $relevant_parameters,
- 'original_tpl' => array_keys($eligible_templates),
- 'selected_tpl' => $flip_templates[$handle],
- 'selected_url' => $url_keyword,)
+ 'replacer' => $file,
+ 'url_parameter' => $relevant_parameters,
+ 'original_tpl' => array_keys($eligible_templates),
+ 'bound_tpl' => $available_templates,
+ 'selected_tpl' => $flip_templates[$handle],
+ 'selected_url' => $url_keyword,
+ 'selected_bound' => $bound_tpl,)
);
}
}
diff --git a/admin/template/goto/default-layout.css b/admin/template/goto/default-layout.css
index fc5cb3c2a..05ca38cf1 100644
--- a/admin/template/goto/default-layout.css
+++ b/admin/template/goto/default-layout.css
@@ -7,7 +7,7 @@ TABLE.table2 {
padding: 0;
}
-TABLE.table2 TD {
+TABLE.table2 TD, TABLE.table2 TH {
padding: 0 5px;
}
diff --git a/admin/template/goto/extend_for_templates.tpl b/admin/template/goto/extend_for_templates.tpl
index 2e9c4766b..dae6903a5 100644
--- a/admin/template/goto/extend_for_templates.tpl
+++ b/admin/template/goto/extend_for_templates.tpl
@@ -9,6 +9,7 @@
<th>{'Replacers'|@translate}</th>
<th>{'Original templates'|@translate}</th>
<th>{'Optional URL keyword'|@translate}</th>
+ <th>{'Bound template'|@translate}</th>
</tr>
{foreach from=$extents item=tpl name=extent_loop}
<tr class="{if $smarty.foreach.extent_loop.index is odd}row1{else}row2{/if}">
@@ -22,6 +23,9 @@
<td>
{html_options name=url[] output=$tpl.url_parameter values=$tpl.url_parameter selected=$tpl.selected_url}
</td>
+ <td>
+ {html_options name=bound[] output=$tpl.bound_tpl values=$tpl.bound_tpl selected=$tpl.selected_bound}
+ </td>
</tr>
{/foreach}
</table>