aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2006-06-13 20:38:21 +0000
committerplegall <plg@piwigo.org>2006-06-13 20:38:21 +0000
commit728594c2fa748399571febcff27e7563b01d430f (patch)
tree7754d9dd118f589d94c768e933dc1327977f3c80
parentd2f1e0a64f7479469cbdb7496b07ca3e6ab82ecd (diff)
bug 402 fixed: invalid empty HTML list when no categories to list.
git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1347 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/cat_list.php8
-rw-r--r--template/yoga/admin/cat_list.tpl18
2 files changed, 15 insertions, 11 deletions
diff --git a/admin/cat_list.php b/admin/cat_list.php
index 4c266c01f..ddeddcaa7 100644
--- a/admin/cat_list.php
+++ b/admin/cat_list.php
@@ -249,6 +249,8 @@ SELECT id_uppercat, COUNT(*) AS nb_subcats
{
$categories[$row['id_uppercat']]['nb_subcats'] = $row['nb_subcats'];
}
+
+ $template->assign_block_vars('categories', array());
}
foreach ($categories as $category)
@@ -267,7 +269,7 @@ foreach ($categories as $category)
}
$template->assign_block_vars(
- 'category',
+ 'categories.category',
array(
'NAME' => $category['name'],
'ID' => $category['id'],
@@ -288,7 +290,7 @@ foreach ($categories as $category)
if (empty($category['dir']))
{
$template->assign_block_vars(
- 'category.delete',
+ 'categories.category.delete',
array(
'URL'=>$self_url.'&amp;delete='.$category['id']
)
@@ -298,7 +300,7 @@ foreach ($categories as $category)
if ($category['nb_images'] > 0)
{
$template->assign_block_vars(
- 'category.elements',
+ 'categories.category.elements',
array(
'URL'=>$base_url.'element_set&amp;cat='.$category['id']
)
diff --git a/template/yoga/admin/cat_list.tpl b/template/yoga/admin/cat_list.tpl
index 1f6f0198c..ec4b66d43 100644
--- a/template/yoga/admin/cat_list.tpl
+++ b/template/yoga/admin/cat_list.tpl
@@ -3,6 +3,7 @@
<h3>{CATEGORIES_NAV}</h3>
+<!-- BEGIN categories -->
<form id="categoryOrdering" action="{F_ACTION}" method="post">
<ul class="categoryUl">
@@ -11,26 +12,26 @@
<li class="categoryLi"> <!-- category {category.ID} -->
<ul class="categoryActions">
- <li><a href="{category.U_JUMPTO}" title="{lang:jump to category}"><img src="{themeconf:icon_dir}/category_jump-to.png" class="button" alt="{lang:jump to}" /></a></li>
- <li><a href="{category.U_EDIT}" title="{lang:edit category informations}"><img src="{themeconf:icon_dir}/category_edit.png" class="button" alt="{lang:edit}"/></a></li>
+ <li><a href="{categories.category.U_JUMPTO}" title="{lang:jump to category}"><img src="{themeconf:icon_dir}/category_jump-to.png" class="button" alt="{lang:jump to}" /></a></li>
+ <li><a href="{categories.category.U_EDIT}" title="{lang:edit category informations}"><img src="{themeconf:icon_dir}/category_edit.png" class="button" alt="{lang:edit}"/></a></li>
<!-- BEGIN elements -->
- <li><a href="{category.elements.URL}" title="{lang:manage category elements}"><img src="{themeconf:icon_dir}/category_elements.png" class="button" alt="{lang:elements}" /></a></li>
+ <li><a href="{categories.category.elements.URL}" title="{lang:manage category elements}"><img src="{themeconf:icon_dir}/category_elements.png" class="button" alt="{lang:elements}" /></a></li>
<!-- END elements -->
- <li><a href="{category.U_CHILDREN}" title="{lang:manage sub-categories}"><img src="{themeconf:icon_dir}/category_children.png" class="button" alt="{lang:sub-categories}" /></a></li>
+ <li><a href="{categories.category.U_CHILDREN}" title="{lang:manage sub-categories}"><img src="{themeconf:icon_dir}/category_children.png" class="button" alt="{lang:sub-categories}" /></a></li>
<!-- BEGIN permissions -->
- <li><a href="{category.permissions.URL}" title="{lang:edit category permissions}" ><img src="{themeconf:icon_dir}/category_permissions.png" class="button" alt="{lang:permissions}" /></a></li>
+ <li><a href="{categories.category.permissions.URL}" title="{lang:edit category permissions}" ><img src="{themeconf:icon_dir}/category_permissions.png" class="button" alt="{lang:permissions}" /></a></li>
<!-- END permissions -->
<!-- BEGIN delete -->
- <li><a href="{category.delete.URL}" title="{lang:delete category}" onclick="return confirm('{lang:Are you sure?}');"><img src="{themeconf:icon_dir}/category_delete.png" class="button" alt="{lang:delete}" /></a></li>
+ <li><a href="{categories.category.delete.URL}" title="{lang:delete category}" onclick="return confirm('{lang:Are you sure?}');"><img src="{themeconf:icon_dir}/category_delete.png" class="button" alt="{lang:delete}" /></a></li>
<!-- END delete -->
</ul>
- <p><strong><a href="{category.U_CHILDREN}" title="{lang:manage sub-categories}">{category.NAME}</a></strong></p>
+ <p><strong><a href="{categories.category.U_CHILDREN}" title="{lang:manage sub-categories}">{categories.category.NAME}</a></strong></p>
<p>
<label>
{lang:Position} :
- <input type="text" size="4" name="catOrd[{category.ID}]" maxlength="4" value="{category.RANK}" />
+ <input type="text" size="4" name="catOrd[{categories.category.ID}]" maxlength="4" value="{categories.category.RANK}" />
</label>
</p>
@@ -44,6 +45,7 @@
</p>
</form>
+<!-- END categories -->
<form id="addVirtual" action="{F_ACTION}" method="post">
<p>