aboutsummaryrefslogtreecommitdiffstats
path: root/admin/extend_for_templates.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-12-06 02:28:54 +0000
committerpatdenice <patdenice@piwigo.org>2008-12-06 02:28:54 +0000
commit6873537fe612c8adfe655a87c1750be8e8427dc3 (patch)
treea1ef0f880f29addf6b084267259a95fa257491a9 /admin/extend_for_templates.php
parent0479bcde106ec3a016c28f2fce458c4b09b1a664 (diff)
- Add a "Bound Template" column for template extensions.
git-svn-id: http://piwigo.org/svn/trunk@2923 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/extend_for_templates.php')
-rw-r--r--admin/extend_for_templates.php27
1 files changed, 19 insertions, 8 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,)
);
}
}