]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Using the original file name for photo title if none is specified.
authorBrett Profitt <brett.profitt@gmail.com>
Fri, 13 Apr 2012 23:35:22 +0000 (16:35 -0700)
committerBrett Profitt <brett.profitt@gmail.com>
Fri, 13 Apr 2012 23:35:22 +0000 (16:35 -0700)
actions/photos/admin/create_thumbnails.php
actions/photos/album/sort.php
actions/photos/image/tag.php
classes/TidypicsImage.php
pages/photos/album/sort.php
pages/photos/batch/edit.php
pages/photos/image/view.php
start.php
views/default/object/image.php
views/default/river/object/image/tag.php

index f2e9b26e2bd0b3f510381aa655bbe17ae13e844c..dfb5d4ed117a0d4dad6c3f77adbdce11ea78fd85 100644 (file)
@@ -23,7 +23,7 @@ if (!$filename || !$container_guid) {
        forward(REFERER);
 }
 
-$title = $image->title;
+$title = $image->getTitle();
 $prefix = "image/$container_guid/";
 $filestorename = substr($filename, strlen($prefix));
 
index 613747784e756b87df22edee26d8c0b34a09b2cf..453f51ac5b111e50cb5658b80208d1d90b2db9b0 100644 (file)
@@ -14,5 +14,5 @@ $guids = explode(',', $guids);
 
 $album->setImageList($guids);
 
-system_message(elgg_echo('tidypics:album:sorted', array($album->title)));
+system_message(elgg_echo('tidypics:album:sorted', array($album->getTitle())));
 forward($album->getURL());
\ No newline at end of file
index 20f47694409b277029c6d310295515c3a3eaac02..e623bd546ef28cce63d981b301edf365978e29e2 100644 (file)
@@ -92,7 +92,7 @@ if ($annotation_id) {
                                                elgg_echo('tidypics:tag:subject'),
                                                sprintf(
                                                        elgg_echo('tidypics:tag:body'),
-                                                       $image->title,
+                                                       $image->getTitle(),
                                                        $tagger->name,
                                                        $image->getURL()
                                                )
index dd4324468168d892a6f7e95727a3be8f5f49c0a6..26a3483a9c00d689297e08c4d855b9de194480ba 100644 (file)
@@ -90,7 +90,11 @@ class TidypicsImage extends ElggFile {
         * @return string
         */
        public function getTitle() {
-               return $this->title;
+               if ($this->title) {
+                       return $this->title;
+               } else {
+                       return $this->originalfilename;
+               }
        }
 
        /**
index a1d890be1d2d12f9a55fd2a6df5c38ac72883081..8b6d1bfc773f786e23c5e667d6a085f498305c9a 100644 (file)
@@ -30,7 +30,7 @@ if (elgg_instanceof($owner, 'group')) {
 } else {
        elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
 }
-elgg_push_breadcrumb($album->title, $album->getURL());
+elgg_push_breadcrumb($album->getTitle(), $album->getURL());
 elgg_push_breadcrumb(elgg_echo('album:sort'));
 
 
index b96ddf40877f441b9361d4e3e736be73d2976063..ca9a55b18f552ab0f69c08fe22332a9ee0218509 100644 (file)
@@ -29,7 +29,7 @@ $title = elgg_echo('tidypics:editprops');
 
 elgg_push_breadcrumb(elgg_echo('photos'), "photos/all");
 elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
-elgg_push_breadcrumb($album->title, $album->getURL());
+elgg_push_breadcrumb($album->getTitle(), $album->getURL());
 elgg_push_breadcrumb($title);
 
 $content = elgg_view_form('photos/batch/edit', array(), array('batch' => $batch));
index 6db9ff529839e209b2f1d4ac54e10a80455e62ad..6bd0257e093ce82472b6fe3e8454fab7f8b7e520 100644 (file)
@@ -36,8 +36,8 @@ if (elgg_instanceof($owner, 'group')) {
 } else {
        elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
 }
-elgg_push_breadcrumb($album->title, $album->getURL());
-elgg_push_breadcrumb($photo->title);
+elgg_push_breadcrumb($album->getTitle(), $album->getURL());
+elgg_push_breadcrumb($photo->getTitle());
 
 if (elgg_get_plugin_setting('download_link', 'tidypics')) {
        // add download button to title menu
@@ -54,11 +54,11 @@ $content = elgg_view_entity($photo, array('full_view' => true));
 $body = elgg_view_layout('content', array(
        'filter' => false,
        'content' => $content,
-       'title' => $photo->title,
+       'title' => $photo->getTitle(),
        'sidebar' => elgg_view('tidypics/sidebar', array(
                'page' => 'view',
                'image' => $photo,
        )),
 ));
 
-echo elgg_view_page($photo->title, $body);
+echo elgg_view_page($photo->getTitle(), $body);
index 2ef7dcb4c0989ccb74b60d77348cb697e369af4e..c56382655d97de75ca4a13ad817d543fc139692a 100644 (file)
--- a/start.php
+++ b/start.php
@@ -423,14 +423,14 @@ function tidypics_notify_message($hook, $type, $result, $params) {
                
                if ($entity->first_upload) {
                        $descr = $entity->description;
-                       $title = $entity->title;
+                       $title = $entity->getTitle();
                        $owner = $entity->getOwnerEntity();
                        return elgg_echo('tidypics:newalbum', array($owner->name))
                                        . ': ' . $title . "\n\n" . $descr . "\n\n" . $entity->getURL();
                } else {
                        if ($entity->shouldNotify()) {
                                $descr = $entity->description;
-                               $title = $entity->title;
+                               $title = $entity->getTitle();
                                $owner = $entity->getOwnerEntity();
 
                                return elgg_echo('tidypics:updatealbum', array($owner->name, $title)) . ': ' . $entity->getURL();
index 12d58440d13c5fc00b1b373683c6d3a518d074a1..2aa76d48fba9bd58e4fc6669a9314a3fbdd26ade 100644 (file)
@@ -25,7 +25,7 @@ include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/lib/exif.php";
 $image = $vars['entity'];
 $image_guid = $image->getGUID();
 $tags = $image->tags;
-$title = $image->title;
+$title = $image->getTitle();
 $desc = $image->description;
 $owner = $image->getOwnerEntity();
 $friendlytime = friendly_time($image->time_created);
index a59066c670e83d17201cd38b5ff1cc386133254a..7e6f0313dda47d515e1629f80b4ab40288559f01 100644 (file)
@@ -11,7 +11,7 @@ if ($annotation) {
                return;
        }
 
-       $image_title = $image->title;
+       $image_title = $image->getTitle();
 }
 
 $tagger_link = "<a href=\"{$tagger->getURL()}\">$tagger->name</a>";