mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Merge branch '3.7'
This commit is contained in:
@@ -679,7 +679,7 @@ class PhraseaEngine implements SearchEngineInterface
|
||||
$this->singleParse('main', $query);
|
||||
|
||||
foreach ($this->queries as $sbas => $db_query) {
|
||||
$this->singleParse($sbas, $query);
|
||||
$this->singleParse($sbas, $this->queries[$sbas]);
|
||||
}
|
||||
|
||||
$base_ids = array_map(function(\collection $collection) {
|
||||
@@ -733,11 +733,7 @@ class PhraseaEngine implements SearchEngineInterface
|
||||
$this->qp[$sbas] = new PhraseaEngineQueryParser($this->app, $this->options->getLocale());
|
||||
$this->qp[$sbas]->debug = false;
|
||||
|
||||
if ($sbas == 'main') {
|
||||
$simple_treeq = $this->qp[$sbas]->parsequery($query);
|
||||
} else {
|
||||
$simple_treeq = $this->qp[$sbas]->parsequery($this->queries[$sbas]);
|
||||
}
|
||||
|
||||
$this->qp[$sbas]->priority_opk($simple_treeq);
|
||||
$this->qp[$sbas]->distrib_opk($simple_treeq);
|
||||
|
@@ -586,7 +586,6 @@ class PhraseaEngineQueryParser
|
||||
|
||||
$ambigus = 0;
|
||||
if ($tree["CLASS"] == "OPK" && $tree["NODETYPE"] == PHRASEA_OP_COLON) {
|
||||
// $ambigus = $this->setTids($tree, $tree["RB"], $bid, $domthe, $searchsynonyms);
|
||||
$ambigus = $this->setTids($tree, $bid, $domthe, $searchsynonyms);
|
||||
} elseif ($tree["CLASS"] == "OPS" || $tree["CLASS"] == "OPK") {
|
||||
$ambigus += $this->thesaurus2($tree["LB"], $bid, $name, $domthe, $searchsynonyms, $depth + 1);
|
||||
@@ -723,8 +722,6 @@ class PhraseaEngineQueryParser
|
||||
if ($this->debug)
|
||||
print("============================ setTids:\n\$tree=" . var_export($tree, true) . "\n");
|
||||
|
||||
// $this->proposals["BASES"]["b$bid"] = array("BID"=>$bid, "TERMS"=>array());
|
||||
|
||||
$ambigus = 0;
|
||||
if (is_array($w = $tree["RB"]["VALUE"]))
|
||||
$t = $w = implode(" ", $w);
|
||||
@@ -772,9 +769,6 @@ class PhraseaEngineQueryParser
|
||||
$prophtml = "";
|
||||
$this->propAsHTML($domthe->documentElement, $prophtml, $path);
|
||||
$this->proposals["BASES"]["b$bid"]["TERMS"][$path]["HTML"] = $prophtml;
|
||||
} else {
|
||||
// le mot n'est pas dans le thesaurus
|
||||
$tree = null;
|
||||
}
|
||||
|
||||
return($ambigus);
|
||||
|
@@ -146,14 +146,15 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
|
||||
*/
|
||||
public function get_url()
|
||||
{
|
||||
return sprintf('%spermalink/v1/%d/%d/%s/%s.%s?token=%s',
|
||||
$this->app['phraseanet.registry']->get('GV_ServerName'),
|
||||
return sprintf('%spermalink/v1/%d/%d/%s/%s.%s?token=%s&etag=%s',
|
||||
$this->app['phraseanet.registry'],
|
||||
$this->media_subdef->get_sbas_id(),
|
||||
$this->media_subdef->get_record_id(),
|
||||
$this->media_subdef->get_name(),
|
||||
$this->get_label(),
|
||||
pathinfo($this->media_subdef->get_record()->get_original_name(), PATHINFO_EXTENSION),
|
||||
$this->get_token()
|
||||
pathinfo($this->media_subdef->get_file(), PATHINFO_EXTENSION),
|
||||
$this->get_token(),
|
||||
$this->media_subdef->getEtag()
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -231,7 +231,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
, 'height' => $this->height
|
||||
, 'etag' => $this->etag
|
||||
, 'path' => $this->path
|
||||
, 'url' => $this->url
|
||||
, 'url' => $this->url . ($this->is_physically_present ? '?etag=' . $this->etag : '')
|
||||
, 'file' => $this->file
|
||||
, 'physically_present' => $this->is_physically_present
|
||||
, 'is_substituted' => $this->is_substituted
|
||||
|
@@ -63,6 +63,8 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
|
||||
public $sbasid;
|
||||
private $app;
|
||||
|
||||
public $nb_days;
|
||||
|
||||
/**
|
||||
* Construit un dashboard selon les droits du usrid, si sbas vaut null
|
||||
* c'est un report sur toutes les bases, sinon sur le sbasid
|
||||
|
@@ -532,15 +532,9 @@ class record_preview extends record_adapter
|
||||
$row['referrer'] = _('report:: visualiseur cooliris');
|
||||
|
||||
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'document/') !== false) {
|
||||
if (strpos($row['referrer'], '/view/') !== false)
|
||||
$row['referrer'] = _('report::presentation page preview');
|
||||
else
|
||||
$row['referrer'] = _('report::acces direct');
|
||||
}
|
||||
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'permalink/') !== false) {
|
||||
if (strpos($row['referrer'], '/view/') !== false)
|
||||
$row['referrer'] = _('report::presentation page preview');
|
||||
else
|
||||
$row['referrer'] = _('report::acces direct');
|
||||
}
|
||||
if ( ! isset($referrers[$row['referrer']]))
|
||||
|
@@ -60,7 +60,7 @@
|
||||
<script type="text/javascript">
|
||||
flowplayer("preview{{random}}",
|
||||
{src:"/include/jslibs/flowplayer/flowplayer-3.2.12.swf", wmode: "transparent"},
|
||||
{clip:{url:"{{url}}",autoPlay: true,autoBuffering:true,provider: "h264streaming",scaling:"fit"},
|
||||
{clip:{url:"{{url|urlencode}}",autoPlay: true,autoBuffering:true,provider: "h264streaming",scaling:"fit"},
|
||||
onError:function(code,message){getNewVideoToken({{thumbnail.get_sbas_id() ~'_'~thumbnail.get_record_id()}}, this);},
|
||||
plugins: {h264streaming: {url: "/include/jslibs/flowplayer/flowplayer.pseudostreaming-3.2.9.swf"}}
|
||||
});
|
||||
@@ -91,7 +91,6 @@
|
||||
"{{d_width}}", "{{d_height}}", "9.0.0", false, false,
|
||||
{menu: "false",flashvars: "playerID=2&autostart=yes&noinfo=yes&animation=no&remaining=yes&soundFile={{url}}", movie: "/include/jslibs/audio-player/player.swf", allowFullScreen :"true",wmode: "transparent"}, false);</script>
|
||||
{% else %}
|
||||
{% set url = url ~ '?tag=' ~ thumbnail.getEtag() %}
|
||||
<img class="{% if lazyload %}lazyload{% endif %} record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
|
||||
style="width:{{d_width|round}}px;height:{{d_height|round}}px;top:{{top|round}}px;"
|
||||
src="{% if lazyload %}/skins/grey.gif{% else %}{{ url }}{% endif %}" data-original="{{ url }}" ondragstart="return false;">
|
||||
|
@@ -7,6 +7,7 @@
|
||||
{% else %}
|
||||
{% set type = record.get_type() %}
|
||||
{% set url = preview.get_permalink().get_url() %}
|
||||
{% set pageurl = preview.get_permalink().get_page() %}
|
||||
|
||||
{% if url is not empty %}
|
||||
<div id="tabs">
|
||||
@@ -17,13 +18,13 @@
|
||||
</ul>
|
||||
<div id="share">
|
||||
<div id="tweet">
|
||||
<div style="margin-left:20px;padding:10px 0 5px;"><a href="http://www.twitter.com/home/?status={{ url|url_encode }}view/" target="_blank"><img src="/skins/icons/twitter.ico" title="share this on twitter" style="vertical-align:middle;padding:0 5px;"/> Send to Twitter</a></div>
|
||||
<div style="margin-left:20px;padding:5px 0 10px;"><a href="http://www.facebook.com/sharer.php?u={{ url|url_encode }}view/" target="_blank"><img src="/skins/icons/facebook.ico" title="share on facebook" style="vertical-align:middle;padding:0 5px;"/> Send to Facebook</a></div>
|
||||
<div style="margin-left:20px;padding:10px 0 5px;"><a href="http://www.twitter.com/home/?status={{ pageurl }}" target="_blank"><img src="/skins/icons/twitter.ico" title="share this on twitter" style="vertical-align:middle;padding:0 5px;"/> Send to Twitter</a></div>
|
||||
<div style="margin-left:20px;padding:5px 0 10px;"><a href="http://www.facebook.com/sharer.php?u={{ pageurl }}" target="_blank"><img src="/skins/icons/facebook.ico" title="share on facebook" style="vertical-align:middle;padding:0 5px;"/> Send to Facebook</a></div>
|
||||
</div>
|
||||
<div id="embed" style="text-align:center;padding:10px 0;">
|
||||
<div style="text-align:left;margin-left:20px;padding:10px 0;">URL : </div>
|
||||
|
||||
<input style="width:90%;" readonly="true" type="text" value="{{ url|url_encode }}view/" onfocus="this.focus();this.select();" onclick="this.focus();this.select();" />
|
||||
<input style="width:90%;" readonly="true" type="text" value="{{ pageurl }}" onfocus="this.focus();this.select();" onclick="this.focus();this.select();" />
|
||||
<div style="text-align:left;margin-left:20px;padding:10px 0;">Embed :</div>
|
||||
<textarea onfocus="this.focus();this.select();" onclick="this.focus();this.select();" style="width:90%;height:50px;" readonly="true" >
|
||||
{% if type == 'video' %}
|
||||
@@ -50,7 +51,7 @@
|
||||
<param value="false" name="menu"/>
|
||||
</object>
|
||||
{% else %}
|
||||
<a href="{{ url|url_encode }}view/"><img src="{{ url|url_encode }}" title="" /></a>
|
||||
<a href="{{ pageurl }}"><img src="{{ url|url_encode }}" title="" /></a>
|
||||
{% endif %}
|
||||
</textarea>
|
||||
</div>
|
||||
|
@@ -6,12 +6,14 @@ class media_Permalink_AdapterTest extends PhraseanetPHPUnitAbstract
|
||||
* @var media_Permalink_Adapter
|
||||
*/
|
||||
static $object;
|
||||
static $subdef;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$databox = self::$DI['record_1']->get_databox();
|
||||
static::$object = media_Permalink_Adapter::getPermalink(self::$DI['app'], $databox, self::$DI['record_1']->get_subdef('document'));
|
||||
static::$subdef = self::$DI['record_1']->get_subdef('document');
|
||||
static::$object = media_Permalink_Adapter::getPermalink($databox, static::$subdef);
|
||||
}
|
||||
|
||||
public function testGet_label()
|
||||
@@ -51,12 +53,31 @@ class media_Permalink_AdapterTest extends PhraseanetPHPUnitAbstract
|
||||
. self::$DI['record_1']->get_sbas_id() . '/'
|
||||
. self::$DI['record_1']->get_record_id()
|
||||
. '/document/' . static::$object->get_label()
|
||||
. '.' . pathinfo(self::$DI['record_1']->get_original_name(), PATHINFO_EXTENSION)
|
||||
. '?token=' . static::$object->get_token();
|
||||
. '.' . pathinfo(self::$DI['record_1']->get_subdef('document')->get_file(), PATHINFO_EXTENSION)
|
||||
. '?token=' . static::$object->get_token()
|
||||
. '&etag=' . static::$subdef->getEtag();
|
||||
|
||||
$this->assertEquals($url, static::$object->get_url(self::$DI['app']['phraseanet.registry']));
|
||||
}
|
||||
|
||||
public function testGet_Previewurl()
|
||||
{
|
||||
$databox = self::$DI['record_1']->get_databox();
|
||||
$subdef = self::$DI['record_1']->get_subdef('preview');
|
||||
$previewPermalink = media_Permalink_Adapter::getPermalink($databox, $subdef);
|
||||
|
||||
$registry = registry::get_instance();
|
||||
$url = $registry->get('GV_ServerName') . 'permalink/v1/'
|
||||
. self::$DI['record_1']->get_sbas_id() . '/'
|
||||
. self::$DI['record_1']->get_record_id()
|
||||
. '/preview/' . $previewPermalink->get_label()
|
||||
. '.' . pathinfo(self::$DI['record_1']->get_subdef('preview')->get_file(), PATHINFO_EXTENSION)
|
||||
. '?token=' . $previewPermalink->get_token()
|
||||
. '&etag=' . $subdef->getEtag();
|
||||
|
||||
$this->assertEquals($url, $previewPermalink->get_url($registry));
|
||||
}
|
||||
|
||||
public function testGet_page()
|
||||
{
|
||||
$url = self::$DI['app']['phraseanet.registry']->get('GV_ServerName') . 'permalink/v1/'
|
||||
|
Reference in New Issue
Block a user