aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvdigital <vdigital@piwigo.org>2008-10-19 15:47:34 +0000
committervdigital <vdigital@piwigo.org>2008-10-19 15:47:34 +0000
commita6be0e500b91696013b1580915c21493ce6c39b1 (patch)
tree14d7a7b6d3bf5d15e2efa3033ce23e3b5b7d66df
parent3326f742fe2a1745dc1ebdd060d023263af299b9 (diff)
Merging revisions 2773-2776
- Default template and Piwigo domain ... - No metadata synchronization icon on a remote picture (Synchro failure) - Jump to category icon is removed on user forbidden categories (previously check_restrictions was leading administrators to the access denied page). git-svn-id: http://piwigo.org/svn/trunk@2777 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/cat_modify.php1
-rw-r--r--admin/include/functions.php23
-rw-r--r--admin/template/goto/cat_list.tpl2
-rw-r--r--admin/template/goto/cat_modify.tpl2
-rw-r--r--admin/template/goto/picture_modify.tpl2
-rw-r--r--include/constants.php4
6 files changed, 32 insertions, 2 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index 4a385217d..b0876ecb8 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -235,6 +235,7 @@ if (!empty($category['id_uppercat']))
$template->assign(
array(
'CATEGORIES_NAV' => $navigation,
+ 'CAT_ID' => $category['id'],
'CAT_NAME' => @htmlspecialchars($category['name']),
'CAT_COMMENT' => @htmlspecialchars($category['comment']),
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 4b0713226..658033e0c 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1899,4 +1899,27 @@ SELECT id
);
}
}
+
+/**
+ * Is the category accessible to the (Admin) user ?
+ *
+ * Note : if the user is not authorized to see this category, category jump
+ * will be replaced by admin cat_modify page
+ *
+ * @param int category id to verify
+ * @return bool
+ */
+function cat_admin_access($category_id)
+{
+ global $user;
+
+ // $filter['visible_categories'] and $filter['visible_images']
+ // are not used because it's not necessary (filter <> restriction)
+ if (in_array($category_id, explode(',', $user['forbidden_categories'])))
+ {
+ return false;
+ }
+ return true;
+}
+
?> \ No newline at end of file
diff --git a/admin/template/goto/cat_list.tpl b/admin/template/goto/cat_list.tpl
index 4bf158baf..9f26e1f9c 100644
--- a/admin/template/goto/cat_list.tpl
+++ b/admin/template/goto/cat_list.tpl
@@ -48,7 +48,9 @@
<li class="categoryLi{if $category.IS_VIRTUAL} virtual_cat{/if}" id="cat_{$category.ID}">
<!-- category {$category.ID} -->
<ul class="categoryActions">
+ {if cat_admin_access($category.ID)}
<li><a href="{$category.U_JUMPTO}" title="{'jump to category'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to category'|@translate}" /></a></li>
+ {/if}
<li><a href="{$category.U_EDIT}" title="{'edit category informations'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"/></a></li>
{if isset($category.U_MANAGE_ELEMENTS) }
<li><a href="{$category.U_MANAGE_ELEMENTS}" title="{'manage category elements'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'elements'|@translate}" /></a></li>
diff --git a/admin/template/goto/cat_modify.tpl b/admin/template/goto/cat_modify.tpl
index b9746ffe1..418f87539 100644
--- a/admin/template/goto/cat_modify.tpl
+++ b/admin/template/goto/cat_modify.tpl
@@ -10,7 +10,9 @@
<h3>{$CATEGORIES_NAV}</h3>
<ul class="categoryActions">
+ {if cat_admin_access($CAT_ID)}
<li><a href="{$U_JUMPTO}" title="{'jump to category'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to category'|@translate}" /></a></li>
+ {/if}
{if isset($U_MANAGE_ELEMENTS) }
<li><a href="{$U_MANAGE_ELEMENTS}" title="{'manage category elements'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'elements'|@translate}" /></a></li>
<li><a href="{$U_MANAGE_RANKS}" title="{'manage image ranks'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/ranks.png" class="button" alt="{'ranks'|@translate}" /></a></li>
diff --git a/admin/template/goto/picture_modify.tpl b/admin/template/goto/picture_modify.tpl
index 038fc5ab6..65bc8f407 100644
--- a/admin/template/goto/picture_modify.tpl
+++ b/admin/template/goto/picture_modify.tpl
@@ -18,7 +18,9 @@
{if isset($U_JUMPTO) }
<li><a href="{$U_JUMPTO}" title="{'jump to image'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to image'|@translate}" /></a></li>
{/if}
+ {if !url_is_remote($path)}
<li><a href="{$U_SYNC}" title="{'synchronize metadata'|@translate}" {$TAG_INPUT_ENABLED}><img src="{$themeconf.admin_icon_dir}/sync_metadata.png" class="button" alt="{'synchronize'|@translate}" /></a></li>
+ {/if}
</ul>
<form action="{$F_ACTION}" method="post" id="properties">
diff --git a/include/constants.php b/include/constants.php
index b6d8146a9..dbed84511 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -23,11 +23,11 @@
// Default settings
define('PHPWG_VERSION', 'Colibri');
-define('PHPWG_DOMAIN', 'phpwebgallery.net');
+define('PHPWG_DOMAIN', 'piwigo.org');
define('PHPWG_URL', 'http://www.'.PHPWG_DOMAIN);
define('PEM_URL', 'http://' . PHPWG_DOMAIN . '/ext_new'); /* need to be changed on final release */
define('PHPWG_DEFAULT_LANGUAGE', 'en_UK');
-define('PHPWG_DEFAULT_TEMPLATE', 'yoga/clear');
+define('PHPWG_DEFAULT_TEMPLATE', 'yoga/Sylvia');
// Required versions
define('REQUIRED_PHP_VERSION', '5.0.0');