aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-02-24 13:48:31 +0000
committerplegall <plg@piwigo.org>2011-02-24 13:48:31 +0000
commitbf4d7dca1411d0127f6b47dbc18cc2b1cb007f88 (patch)
treef14bc45910aa4d3a766beebc782ace458aebd9f7
parentbe797aa3da9b4a16010efeab33f40862864222d2 (diff)
new function to get image name depending on name and filename
git-svn-id: http://piwigo.org/svn/trunk@9366 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/functions_picture.inc.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/functions_picture.inc.php b/include/functions_picture.inc.php
index 8c9f4bafd..3eb90af0b 100644
--- a/include/functions_picture.inc.php
+++ b/include/functions_picture.inc.php
@@ -65,6 +65,25 @@ function get_element_location($element_info)
}
+/*
+ * Returns the name of a photo according to its name and its filename.
+ * @param name string
+ * @param filename string
+ * @return string
+ */
+function get_image_name($name, $filename)
+{
+ if (!empty($name))
+ {
+ return $name;
+ }
+ else
+ {
+ return get_name_from_file($filename);
+ }
+}
+
+
/**
* Returns the PATH to the image to be displayed in the picture page. If the
* element is not a picture, then the representative image or the default