aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-10-22 19:33:06 -0200
committerSilvio <silvio@devlet.com.br>2010-10-22 19:33:06 -0200
commit74eff1aa95a5dae06c7ddc6a8ffb81fdd563b8cf (patch)
tree910deb12b3bbe19e84bb454a9ce767faa24fa92f
parentf4e139e0e1673352ff4fc397f64b575df9a65a56 (diff)
downloadjquery_gallery_view-74eff1aa95a5dae06c7ddc6a8ffb81fdd563b8cf.tar.gz
jquery_gallery_view-74eff1aa95a5dae06c7ddc6a8ffb81fdd563b8cf.tar.bz2
Accepting title parameter
-rw-r--r--jquery_gallery_view.module18
1 files changed, 12 insertions, 6 deletions
diff --git a/jquery_gallery_view.module b/jquery_gallery_view.module
index 4799101..04f46a8 100644
--- a/jquery_gallery_view.module
+++ b/jquery_gallery_view.module
@@ -10,20 +10,26 @@
* Setup photos for a view.
*
* @param $view
- * View data.
+ * View data.
+ *
+ * @param $field
+ * File field name.
+ *
+ * @param $title
+ * Title field name.
*/
-function jquery_gallery_view_setup_photos($view, $field) {
+function jquery_gallery_view_setup_photos($view, $field, $title = NULL) {
// Setup files folder.
$files = variable_get('file_directory_path', conf_path() .'/files');
foreach ($view->result as $result) {
- $fid = $result->{'node_data_field_'. $field .'_fid'};
+ $fid = $result->{$field};
if ($fid != NULL) {
- $file = field_file_load($fid);
- $data = unserialize($result->{'node_data_field_'. $field .'_data'});
+ $file = field_file_load($fid);
+ $text = $result->{$title};
$photos[] = array(
'filename' => $file['filename'],
- 'title' => $data['title'],
+ 'title' => $text,
);
}
}