diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index bd039fbc82..881bf3e520 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -1179,7 +1179,9 @@ class record_adapter implements record_Interface, cache_cacheableInterface foreach ($mandatoryParams as $param) { if (!array_key_exists($param, $params)) - throw new Exception_InvalidArgument(); + { + throw new Exception_InvalidArgument(sprintf('Invalid metadata, missing key %s', $param)); + } } if (!is_array($params['value'])) diff --git a/lib/classes/record/preview.class.php b/lib/classes/record/preview.class.php index 6d95132d3f..a5179b4449 100644 --- a/lib/classes/record/preview.class.php +++ b/lib/classes/record/preview.class.php @@ -274,40 +274,39 @@ class record_preview extends record_adapter { if ($this->title) return $this->title; + $this->title = collection::getLogo($this->get_base_id()) . ' '; + switch ($this->env) { case "RESULT": $this->title .= sprintf( _('preview:: resultat numero %s '), '' . ($this->number + 1) - . '' + . ' : ' ); - $title = parent::get_title(); - if ($search_engine instanceof searchEngine_adapter) - { - $this->title .= array_pop($search_engine->build_excerpt($highlight, array($title), $this)); - } - else - { - $this->title .= $title; - } + $this->title .= parent::get_title($highlight, $search_engine); break; case "BASK": - $this->title .= $this->name . ' - ' . parent::get_title() + $this->title .= $this->name . ' - ' . parent::get_title($highlight, $search_engine) . ' (' . $this->get_number() . '/' . $this->total . ') '; break; case "REG": + $title = parent::get_title(); if ($this->get_number() == 0) - $this->title .= _('preview:: regroupement '); + { + $this->title .= $title; + } else + { $this->title .= sprintf( - _('preview:: Previsualisation numero %s '), $this->get_number() . '/' . $this->total + _('%s %d/%d '), $title, $this->get_number() . '/' . $this->total ); + } break; default: - $this->title .= parent::get_title(); + $this->title .= parent::get_title($highlight, $search_engine); break; } diff --git a/templates/web/prod/preview/caption.html b/templates/web/prod/preview/caption.html index 7a037b4f81..011271a70e 100644 --- a/templates/web/prod/preview/caption.html +++ b/templates/web/prod/preview/caption.html @@ -9,6 +9,10 @@