Merge with 3.7

This commit is contained in:
Romain Neutron
2012-10-04 12:49:01 +02:00
48 changed files with 353 additions and 89 deletions

View File

@@ -81,7 +81,9 @@ return call_user_func(
throw new \Exception_Session_NotAuthenticated(); throw new \Exception_Session_NotAuthenticated();
} }
$all_access = false; $stamp = $watermark = $all_access = false;
if ($subdef != 'thumbnail') {
$subdefStruct = $databox->get_subdef_structure(); $subdefStruct = $databox->get_subdef_structure();
if ($subdefStruct->getSubdefGroup($record->get_type())) { if ($subdefStruct->getSubdefGroup($record->get_type())) {
@@ -101,7 +103,6 @@ return call_user_func(
throw new \Exception_UnauthorizedAction(); throw new \Exception_UnauthorizedAction();
} }
$stamp = false;
$watermark = !$user->ACL()->has_right_on_base($record->get_base_id(), 'nowatermark'); $watermark = !$user->ACL()->has_right_on_base($record->get_base_id(), 'nowatermark');
if ($watermark && !$all_access) { if ($watermark && !$all_access) {
@@ -134,6 +135,7 @@ return call_user_func(
$watermark = false; $watermark = false;
} }
} }
}
return $deliver_content($app['request'], $session, $record, $subdef, $watermark, $stamp, $app); return $deliver_content($app['request'], $session, $record, $subdef, $watermark, $stamp, $app);
})->assert('sbas_id', '\d+')->assert('record_id', '\d+'); })->assert('sbas_id', '\d+')->assert('record_id', '\d+');

View File

@@ -468,7 +468,7 @@ class PDF
$t = str_replace( $t = str_replace(
array("<", ">", "&") array("<", ">", "&")
, array("<", ">", "&") , array("<", ">", "&")
, $field->get_serialized_values() , strip_tags($field->get_serialized_values())
); );
$this->pdf->Write(5, $t); $this->pdf->Write(5, $t);

View File

@@ -361,7 +361,7 @@ class Session_Handler
* @param Session_Authentication_Interface $auth * @param Session_Authentication_Interface $auth
* @return Session_Handler * @return Session_Handler
*/ */
public function authenticate(Session_Authentication_Interface $auth) public function authenticate(Session_Authentication_Interface $auth, $persistent = false)
{ {
if ($this->appbox->get_registry()->get('GV_maintenance')) { if ($this->appbox->get_registry()->get('GV_maintenance')) {
throw new Exception_ServiceUnavailable(); throw new Exception_ServiceUnavailable();
@@ -404,7 +404,9 @@ class Session_Handler
$this->delete_postlog(); $this->delete_postlog();
$auth->postlog(); $auth->postlog();
if ($persistent) {
$this->add_persistent_cookie(); $this->add_persistent_cookie();
}
self::set_cookie('last_act', '', -400000, true); self::set_cookie('last_act', '', -400000, true);
return $this; return $this;

View File

@@ -900,4 +900,18 @@ abstract class task_abstract
return $this; return $this;
} }
/**
* Escape a shell command.
*
* As this function is buggy under windows, this method check the
* environment
*
* @param string $command
* @return string
*/
protected static function escapeShellCmd($command)
{
return defined('PHP_WINDOWS_VERSION_BUILD') ? escapeshellarg($command) : escapeshellcmd($command);
}
} }

View File

@@ -473,18 +473,18 @@ class task_period_cindexer extends task_abstract
$pipes = array(); $pipes = array();
$logcmd = $cmd; $logcmd = self::escapeShellCmd($cmd);
foreach ($args_nopwd as $arg) { foreach ($args_nopwd as $arg) {
$logcmd .= ' ' . escapeshellarg($arg); $logcmd .= ' ' . escapeshellarg($arg);
} }
$this->log(sprintf('cmd=\'%s\'', escapeshellcmd($logcmd))); $this->log(sprintf('cmd=\'%s\'', self::escapeShellCmd($logcmd)));
$execmd = $cmd; $execmd = self::escapeShellCmd($cmd);
foreach ($args as $arg) { foreach ($args as $arg) {
$execmd .= ' ' . escapeshellarg($arg); $execmd .= ' ' . escapeshellarg($arg);
} }
$process = proc_open(escapeshellcmd($execmd), $descriptors, $pipes, $this->binpath, null, array('bypass_shell' => true)); $process = proc_open($execmd, $descriptors, $pipes, $this->binpath, null, array('bypass_shell' => true));
$pid = NULL; $pid = NULL;
if (is_resource($process)) { if (is_resource($process)) {

View File

@@ -5297,6 +5297,13 @@
<field>site</field> <field>site</field>
</fields> </fields>
</index> </index>
<index>
<name>sit_session</name>
<type>INDEX</type>
<fields>
<field>sit_session</field>
</fields>
</index>
<index> <index>
<name>user</name> <name>user</name>
<type>INDEX</type> <type>INDEX</type>

View File

@@ -120,7 +120,7 @@
<div style="display:none;" class="undisposable"> <div style="display:none;" class="undisposable">
<div>{% trans 'Les documents ne peuvent pas etre exportes' %}</div> <div>{% trans 'Les documents ne peuvent pas etre exportes' %}</div>
{% for datas in values.refused%} {% for datas in values.refused%}
{{ thumbnail.format(datas, 80, 80,'', session, true) }} {{ thumbnail.format(datas, 80, 80,'', session, true, false) }}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
@@ -187,7 +187,7 @@
<div style="display:none;" class="undisposable"> <div style="display:none;" class="undisposable">
<div><i>{% trans 'La sous resolution n\'est pas disponible pour les documents suivants' %}</i></div> <div><i>{% trans 'La sous resolution n\'est pas disponible pour les documents suivants' %}</i></div>
{% for datas in values.refused%} {% for datas in values.refused%}
{{ thumbnail.format(datas, 80, 80,'', session, true) }} {{ thumbnail.format(datas, 80, 80,'', session, true, false) }}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
@@ -233,7 +233,7 @@
<div style="display:none;" class="undisposable"> <div style="display:none;" class="undisposable">
<div><i>{% trans 'La sous resolution n\'est pas disponible pour les documents suivants' %}</i></div> <div><i>{% trans 'La sous resolution n\'est pas disponible pour les documents suivants' %}</i></div>
{% for datas in values.refused%} {% for datas in values.refused%}
{{ thumbnail.format(datas, 80, 80,'', session, true) }} {{ thumbnail.format(datas, 80, 80,'', session, true, false) }}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
@@ -391,7 +391,7 @@
<div style="display:none;" class="undisposable"> <div style="display:none;" class="undisposable">
<div><i>{% trans 'La sous resolution n\'est pas disponible pour les documents suivants' %}</i></div> <div><i>{% trans 'La sous resolution n\'est pas disponible pour les documents suivants' %}</i></div>
{% for datas in values.refused%} {% for datas in values.refused%}
{{ thumbnail.format(datas, 80, 80,'', session, true) }} {{ thumbnail.format(datas, 80, 80,'', session, true, false) }}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
@@ -499,14 +499,19 @@
}); });
{% set max_download = registry.get('GV_download_max', 120) %} {% set max_download = registry.get('GV_download_max', 120) %}
{% set alert_too_big%} {% set alert_too_big_one %}
"{% trans %} You can not directly download more than {{max_download}} Mo ; time to package all documents is too long{% endtrans %}\n"+ {% trans %} You can not directly download more than {{max_download}} Mo ; time to package all documents is too long{% endtrans %}
"{% trans 'You can alternatively receive an email when the download is ready.' %}\n\n"+
"{% trans 'Would you like to receive an e-mail when your download is ready ?' %}"
{% endset %} {% endset %}
{% set alert_too_big_two %}
{% trans 'You can alternatively receive an email when the download is ready.' %}
{% endset %}
{% set alert_too_big_three %}
{% trans 'Would you like to receive an e-mail when your download is ready ?' %}
{% endset %}
if(count>1 && total/1024/1024 > {{max_download}}) if(count>1 && total/1024/1024 > {{max_download}})
{ {
if(confirm("{{alert_too_big|escape("js")}}")) if(confirm("{{alert_too_big_one|e('js') ~ "\\n" ~ alert_too_big_two ~ "\\n" ~ alert_too_big_three}}"))
{ {
$('input[name="obj[]"]:checked', $('#download')).each(function(i,n){ $('input[name="obj[]"]:checked', $('#download')).each(function(i,n){
$('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true); $('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true);

View File

@@ -6,7 +6,7 @@
Phraseanet Phraseanet
</span> </span>
</li> </li>
{% if session.is_authenticated %} {% if module != "lightbox" and session.is_authenticated %}
<li> <li>
{% if module == "prod" %} {% if module == "prod" %}
<a target="_self" href="/client/"> <a target="_self" href="/client/">
@@ -69,7 +69,7 @@
{# MODULE #} {# MODULE #}
<li> <li>
<a id="validation_link" target="_blank" href="/lightbox/"> <a id="validation_link" target="_blank" href="/lightbox/">
<span class="{% if module == "lightbox" %}selected{% endif %}"> <span>
{% trans 'admin::monitor: module validation' %} {% trans 'admin::monitor: module validation' %}
</span> </span>
</a> </a>

View File

@@ -18,4 +18,4 @@
{% set width = preview_obj.get_width() %} {% set width = preview_obj.get_width() %}
{% set height = preview_obj.get_height() %} {% set height = preview_obj.get_height() %}
{{ thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', session, wrap) }} {{ thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', session, wrap, false) }}

View File

@@ -1,4 +1,4 @@
{% macro format(thumbnail, b_w, b_h, extraclass, session, wrap)%} {% macro format(thumbnail, b_w, b_h, extraclass, session, wrap, lazyload)%}
{% set record_type = thumbnail.get_type() %} {% set record_type = thumbnail.get_type() %}
@@ -92,9 +92,9 @@
{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> {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 %} {% else %}
{% set url = url ~ '?tag=' ~ thumbnail.getEtag() %} {% set url = url ~ '?tag=' ~ thumbnail.getEtag() %}
<img class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);" <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;" style="width:{{d_width|round}}px;height:{{d_height|round}}px;top:{{top|round}}px;"
src="{{url}}" ondragstart="return false;"> src="{% if lazyload %}/skins/grey.gif{% else %}{{ url }}{% endif %}" data-original="{{ url }}" ondragstart="return false;">
<input type="hidden" name="width" value="{{thumbnail.get_width()}}"/> <input type="hidden" name="width" value="{{thumbnail.get_width()}}"/>
<input type="hidden" name="height" value="{{thumbnail.get_height()}}"/> <input type="hidden" name="height" value="{{thumbnail.get_height()}}"/>
{% endif %} {% endif %}

View File

@@ -42,7 +42,7 @@
<div class="container left"> <div class="container left">
{% if first_item %} {% if first_item %}
{% set preview = first_item.get_record().get_preview() %} {% set preview = first_item.get_record().get_preview() %}
{{thumbnail.format(preview, preview.get_width(), preview.get_height(),'',session, false)}} {{thumbnail.format(preview, preview.get_width(), preview.get_height(),'',session, false, false)}}
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@@ -6,7 +6,7 @@
<a href="/lightbox/ajax/LOAD_FEED_ITEM/{{feed_entry.get_id()}}/{{element.get_id()}}/"> <a href="/lightbox/ajax/LOAD_FEED_ITEM/{{feed_entry.get_id()}}/{{element.get_id()}}/">
<div id="scid_{{element.get_id()}}" class="basket_element ui-corner-all {% if first_item and first_item.get_id() == element.get_id() %}selected{% endif %}"> <div id="scid_{{element.get_id()}}" class="basket_element ui-corner-all {% if first_item and first_item.get_id() == element.get_id() %}selected{% endif %}">
<div class="display_id">{{element.get_ord()}}</div> <div class="display_id">{{element.get_ord()}}</div>
{{thumbnail.format(element.get_record().get_thumbnail() ,114,85, '', session, true)}} {{thumbnail.format(element.get_record().get_thumbnail() ,114,85, '', session, true, false)}}
<form name="download_form" class="download_form" style="display:none;"> <form name="download_form" class="download_form" style="display:none;">
<input type="hidden" name="basrec" value="{{element.get_record().get_serialize_key()}}"/> <input type="hidden" name="basrec" value="{{element.get_record().get_serialize_key()}}"/>
</form> </form>

View File

@@ -41,7 +41,7 @@
<tr> <tr>
<td style="width:170px;"> <td style="width:170px;">
{% if basket_length > 0%} {% if basket_length > 0%}
{{thumbnail.format(basket.getELements().first().getRecord().get_thumbnail, 170, 170, '', session, true)}} {{thumbnail.format(basket.getELements().first().getRecord().get_thumbnail, 170, 170, '', session, true, false)}}
{% endif %} {% endif %}
</td> </td>
<td style="width:20px;"> <td style="width:20px;">
@@ -106,7 +106,7 @@
<tr> <tr>
<td style="width:170px;"> <td style="width:170px;">
{% if basket_length > 0%} {% if basket_length > 0%}
{{thumbnail.format(basket.getElements().first().getRecord().get_thumbnail, 170, 170, '', session, true)}} {{thumbnail.format(basket.getElements().first().getRecord().get_thumbnail, 170, 170, '', session, true, false)}}
{% endif %} {% endif %}
</td> </td>
<td style="width:20px;"> <td style="width:20px;">

View File

@@ -14,7 +14,7 @@
class="disagree_button {%if element.getUserValidationDatas(user).getAgreement() == true or element.getUserValidationDatas(user).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" /> class="disagree_button {%if element.getUserValidationDatas(user).getAgreement() == true or element.getUserValidationDatas(user).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" />
</div> </div>
{% endif %} {% endif %}
{{thumbnail.format(element.getRecord().get_thumbnail,114,85, '', session, true)}} {{thumbnail.format(element.getRecord().get_thumbnail,114,85, '', session, true, false)}}
<form name="download_form" class="download_form" style="display:none;"> <form name="download_form" class="download_form" style="display:none;">
<input type="hidden" name="basrec" value="{{element.getRecord().get_serialize_key()}}"/> <input type="hidden" name="basrec" value="{{element.getRecord().get_serialize_key()}}"/>
</form> </form>

View File

@@ -50,7 +50,7 @@
{% set width = bask_prev.get_width() %} {% set width = bask_prev.get_width() %}
{% set height = bask_prev.get_height() %} {% set height = bask_prev.get_height() %}
{{ thumbnail.format(bask_prev, width,height, '', session, false) }} {{ thumbnail.format(bask_prev, width,height, '', session, false, false) }}
{% endif %} {% endif %}
{% include 'lightbox/selector_box.html.twig' %} {% include 'lightbox/selector_box.html.twig' %}

View File

@@ -14,7 +14,7 @@
<div class="display_id"> <div class="display_id">
{{basket_element.getOrd()}} {{basket_element.getOrd()}}
</div> </div>
{{thumbnail.format(record.get_thumbnail(),165, 125, '', session, true)}} {{thumbnail.format(record.get_thumbnail(),165, 125, '', session, true, false)}}
</div> </div>
</td> </td>
<td style="width:10px;"> <td style="width:10px;">

View File

@@ -46,7 +46,7 @@
<div class="container PNB"> <div class="container PNB">
{% if first_item %} {% if first_item %}
{% set bask_prev = first_item.get_record().get_preview() %} {% set bask_prev = first_item.get_record().get_preview() %}
{{thumbnail.format(bask_prev,bask_prev.get_width(),bask_prev.get_height(),'',session, false)}} {{thumbnail.format(bask_prev,bask_prev.get_width(),bask_prev.get_height(),'',session, false, false)}}
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@@ -6,7 +6,7 @@
<a href="/lightbox/ajax/LOAD_FEED_ITEM/{{feed_entry.get_id()}}/{{element.get_id()}}/"> <a href="/lightbox/ajax/LOAD_FEED_ITEM/{{feed_entry.get_id()}}/{{element.get_id()}}/">
<div id="scid_{{element.get_id()}}" class="basket_element ui-corner-all {% if first_item and first_item.get_id() == element.get_id() %}selected{% endif %}"> <div id="scid_{{element.get_id()}}" class="basket_element ui-corner-all {% if first_item and first_item.get_id() == element.get_id() %}selected{% endif %}">
<div class="display_id">{{element.get_ord()}}</div> <div class="display_id">{{element.get_ord()}}</div>
{{thumbnail.format(element.get_record().get_thumbnail() ,114,85, '', session, true)}} {{thumbnail.format(element.get_record().get_thumbnail() ,114,85, '', session, true, false)}}
<form name="download_form" class="download_form" style="display:none;"> <form name="download_form" class="download_form" style="display:none;">
<input type="hidden" name="basrec" value="{{element.get_record().get_serialize_key()}}"/> <input type="hidden" name="basrec" value="{{element.get_record().get_serialize_key()}}"/>
</form> </form>

View File

@@ -42,7 +42,7 @@
<tr> <tr>
<td style="width:170px;"> <td style="width:170px;">
{% if basket_length > 0%} {% if basket_length > 0%}
{{thumbnail.format(basket.getElements().first().getRecord().get_thumbnail, 170, 170, '', session, true)}} {{thumbnail.format(basket.getElements().first().getRecord().get_thumbnail, 170, 170, '', session, true, false)}}
{% endif %} {% endif %}
</td> </td>
<td style="width:20px;"> <td style="width:20px;">
@@ -107,7 +107,7 @@
<tr> <tr>
<td style="width:170px;"> <td style="width:170px;">
{% if basket_length > 0%} {% if basket_length > 0%}
{{thumbnail.format(basket.getElements().first().getRecord().get_thumbnail, 170, 170, '', session, true)}} {{thumbnail.format(basket.getElements().first().getRecord().get_thumbnail, 170, 170, '', session, true, false)}}
{% endif %} {% endif %}
</td> </td>
<td style="width:20px;"> <td style="width:20px;">

View File

@@ -15,7 +15,7 @@
class="disagree_button {%if element.getUserValidationDatas(user).getAgreement() == true or element.getUserValidationDatas(user).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" /> class="disagree_button {%if element.getUserValidationDatas(user).getAgreement() == true or element.getUserValidationDatas(user).getAgreement() is null %}not_decided{%endif%} disagree_{{element.getId()}}" />
</div> </div>
{% endif %} {% endif %}
{{thumbnail.format(element.getRecord().get_thumbnail,114,85, '', session, true)}} {{thumbnail.format(element.getRecord().get_thumbnail,114,85, '', session, true, false)}}
<form name="download_form" class="download_form" style="display:none;"> <form name="download_form" class="download_form" style="display:none;">
<input type="hidden" name="basrec" value="{{element.getRecord().get_serialize_key()}}"/> <input type="hidden" name="basrec" value="{{element.getRecord().get_serialize_key()}}"/>
</form> </form>

View File

@@ -58,7 +58,7 @@
{% set width = bask_prev.get_width() %} {% set width = bask_prev.get_width() %}
{% set height = bask_prev.get_height() %} {% set height = bask_prev.get_height() %}
{{ thumbnail.format(bask_prev, width,height, '', session, false) }} {{ thumbnail.format(bask_prev, width,height, '', session, false, false) }}
{% endif %} {% endif %}
{% include 'lightbox/selector_box.html.twig' %} {% include 'lightbox/selector_box.html.twig' %}

View File

@@ -83,7 +83,7 @@
{% import 'common/thumbnail.html.twig' as thumbnail %} {% import 'common/thumbnail.html.twig' as thumbnail %}
{% set subdef = record.get_subdef(subdef_name) %} {% set subdef = record.get_subdef(subdef_name) %}
{{ thumbnail.format(subdef, subdef.get_width(), subdef.get_height(), '', session, true) }} {{ thumbnail.format(subdef, subdef.get_width(), subdef.get_height(), '', session, true, false) }}
</div> </div>
<div class="caption"> <div class="caption">
{% include 'common/caption.html.twig' %} {% include 'common/caption.html.twig' %}

View File

@@ -21,7 +21,7 @@
<div id="ORDER_{{ element.getId() }}" class="CHIM diapo" style="height:130px;overflow:hidden;"> <div id="ORDER_{{ element.getId() }}" class="CHIM diapo" style="height:130px;overflow:hidden;">
<div class="title" title="{{ element.getRecord().get_title() }}" style="position:relative;z-index:1200;height:30px;overflow:visible;text-align:center;"> <div class="title" title="{{ element.getRecord().get_title() }}" style="position:relative;z-index:1200;height:30px;overflow:visible;text-align:center;">
<span>{{ element.getRecord().get_title() }}</span> <span>{{ element.getRecord().get_title() }}</span>
{{ thumbnail.format(element.getRecord().get_thumbnail(), 80, 80, '', session) }} {{ thumbnail.format(element.getRecord().get_thumbnail(), 80, 80, '', session, false, false) }}
<form style="display:none;"> <form style="display:none;">
<input type="hidden" name="id" value="{{ element.getId() }}"/> <input type="hidden" name="id" value="{{ element.getId() }}"/>
<input type="hidden" name="title" value="{{ element.getRecord().get_title() }}"/> <input type="hidden" name="title" value="{{ element.getRecord().get_title() }}"/>

View File

@@ -15,7 +15,7 @@
<div id="ORDER_{{ element.get_record_id() }}" class="CHIM diapo" style="height:130px;overflow:hidden;"> <div id="ORDER_{{ element.get_record_id() }}" class="CHIM diapo" style="height:130px;overflow:hidden;">
<div class="title" title="{{ element.get_title() }}" style="position:relative;z-index:1200;height:30px;overflow:visible;text-align:center;"> <div class="title" title="{{ element.get_title() }}" style="position:relative;z-index:1200;height:30px;overflow:visible;text-align:center;">
<span>{{ element.get_title() }}</span> <span>{{ element.get_title() }}</span>
{{ thumbnail.format(element.get_thumbnail(), 80, 80, '', session) }} {{ thumbnail.format(element.get_thumbnail(), 80, 80, '', session, false, false) }}
<form style="display:none;"> <form style="display:none;">
<input type="hidden" name="id" value="{{ element.get_record_id() }}"/> <input type="hidden" name="id" value="{{ element.get_record_id() }}"/>
<input type="hidden" name="title" value="{{ element.get_title() }}"/> <input type="hidden" name="title" value="{{ element.get_title() }}"/>

View File

@@ -23,7 +23,7 @@
{% for element in basket.getElements() %} {% for element in basket.getElements() %}
{% if loop.index <= 9 %} {% if loop.index <= 9 %}
<div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;"> <div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;">
{{ thumbnail.format(element.getRecord().get_thumbnail(), 80, 80 , '', session) }} {{ thumbnail.format(element.getRecord().get_thumbnail(), 80, 80 , '', session, false, false) }}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@@ -20,7 +20,7 @@
{% for element in Story.get_children().get_elements() %} {% for element in Story.get_children().get_elements() %}
{% if loop.index <= 9 %} {% if loop.index <= 9 %}
<div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;"> <div style="margin:5px;position:relative;float:left;width:80px;height:80px;overflow:hidden;">
{{ thumbnail.format(element.get_thumbnail(), 80, 80 , '', session) }} {{ thumbnail.format(element.get_thumbnail(), 80, 80 , '', session, false, false) }}
</div> </div>
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@@ -106,7 +106,7 @@
{{record.get_original_name()}} {{record.get_original_name()}}
</div> </div>
<div> <div>
{{thumbnail.format(record.get_thumbnail,140,140, '', session, true)}} {{thumbnail.format(record.get_thumbnail,140,140, '', session, true, false)}}
</div> </div>
<div style='position:absolute; bottom:0px; left:0px; height:20px'> <div style='position:absolute; bottom:0px; left:0px; height:20px'>
<div class="previewTips" tooltipsrc="/prod/tooltip/preview/{{record.get_sbas_id()}}/{{record.get_record_id()}}/"></div> <div class="previewTips" tooltipsrc="/prod/tooltip/preview/{{record.get_sbas_id()}}/{{record.get_record_id()}}/"></div>

View File

@@ -40,7 +40,7 @@
<td class="thumbnail"> <td class="thumbnail">
{% set BasketElement = Basket.getElements().first() %} {% set BasketElement = Basket.getElements().first() %}
{% if BasketElement %} {% if BasketElement %}
{{thumbnail.format(BasketElement.getRecord().get_thumbnail(), 80, 80, '', session, true)}} {{thumbnail.format(BasketElement.getRecord().get_thumbnail(), 80, 80, '', session, true, false)}}
{% endif %} {% endif %}
<div class="counter"> <div class="counter">
{{ Basket.getElements().count() }} {{ Basket.getElements().count() }}

View File

@@ -267,7 +267,7 @@
<div style="position:absolute;background-color:#959595;color:black;font-weight:bold;padding:3px;z-index:90;"> <div style="position:absolute;background-color:#959595;color:black;font-weight:bold;padding:3px;z-index:90;">
{{record.get_number()}} {{record.get_number()}}
</div> </div>
{{thumbnail.format(record.get_thumbnail,82,82, '', session, true)}} {{thumbnail.format(record.get_thumbnail,82,82, '', session, true, false)}}
<div class="bottom"> <div class="bottom">
<a <a
{% if wz_scope == 'groupings' %} {% if wz_scope == 'groupings' %}

View File

@@ -38,7 +38,7 @@
<table style="width:100%;"> <table style="width:100%;">
<tr> <tr>
<td rowspan="3" style="width:120px;text-align:center;"> <td rowspan="3" style="width:120px;text-align:center;">
{{thumb.format(record.get_thumbnail, 100, 100, "", session, true)}} {{thumb.format(record.get_thumbnail, 100, 100, "", session, true, false)}}
</td> </td>
<td style="width:100px;"> <td style="width:100px;">
{% set name = "title_" ~ record.get_serialize_key() %} {% set name = "title_" ~ record.get_serialize_key() %}

View File

@@ -7,7 +7,7 @@
{% for id, record in route.get_elements %} {% for id, record in route.get_elements %}
<div id='pub_record_{{record.get_serialize_key()}}' class="diapo"> <div id='pub_record_{{record.get_serialize_key()}}' class="diapo">
<div class="title">{{ record.get_title() }}</div> <div class="title">{{ record.get_title() }}</div>
{{thumb.format(record.get_thumbnail, 80, 80, "", session, true)}} {{thumb.format(record.get_thumbnail, 80, 80, "", session, true, false)}}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>

View File

@@ -60,7 +60,7 @@
<td> <td>
<input type="hidden" value="{{ element.get_id() }}"/> <input type="hidden" value="{{ element.get_id() }}"/>
<div class="diapo pending_records"> <div class="diapo pending_records">
{{thumb.format(element.get_record().get_thumbnail, 40, 40, "", session, true)}} {{thumb.format(element.get_record().get_thumbnail, 40, 40, "", session, true, false)}}
</div> </div>
</td> </td>
<td> <td>

View File

@@ -1,7 +1,7 @@
{% macro format_diapo(record, session) %} {% macro format_diapo(record, session) %}
{% import 'common/thumbnail.html.twig' as thumbnail %} {% import 'common/thumbnail.html.twig' as thumbnail %}
<div class="diapo"> <div class="diapo">
{{thumbnail.format(record.get_thumbnail(), 100, 100, '', session, true)}} {{thumbnail.format(record.get_thumbnail(), 100, 100, '', session, true, false)}}
</div> </div>
{% endmacro %} {% endmacro %}

View File

@@ -2,7 +2,7 @@
{% macro format_diapo(record, session) %} {% macro format_diapo(record, session) %}
{% import 'common/thumbnail.html.twig' as thumbnail %} {% import 'common/thumbnail.html.twig' as thumbnail %}
<div class="diapo"> <div class="diapo">
{{thumbnail.format(record.get_thumbnail(), 100, 100, '', session, true)}} {{thumbnail.format(record.get_thumbnail(), 100, 100, '', session, true, false)}}
</div> </div>
{% endmacro %} {% endmacro %}

View File

@@ -58,7 +58,7 @@
{% for order_element_id,element in order %} {% for order_element_id,element in order %}
<li> <li>
<div id="order_wrapper_{{order.get_order_id()}}_{{element.get_base_id()}}_{{element.get_record_id()}}" class="order_wrapper {% if element.get_order_master_id() == false %}selectable{% endif %}"> <div id="order_wrapper_{{order.get_order_id()}}_{{element.get_base_id()}}_{{element.get_record_id()}}" class="order_wrapper {% if element.get_order_master_id() == false %}selectable{% endif %}">
{{ thumbnail.format(element.get_thumbnail() ,80, 80, '', session, true) }} {{ thumbnail.format(element.get_thumbnail() ,80, 80, '', session, true, false) }}
{% if element.get_order_master_id() %} {% if element.get_order_master_id() %}
{% set name = element.get_order_master_name() %} {% set name = element.get_order_master_name() %}
{% if element.get_deny() == 1 %} {% if element.get_deny() == 1 %}

View File

@@ -59,9 +59,9 @@
{% if rollover_gif %} {% if rollover_gif %}
{% set extraclass = 'rollover-gif-out' %} {% set extraclass = 'rollover-gif-out' %}
{% endif %} {% endif %}
{{thumbnail.format(record.get_thumbnail(), th_size, th_size, extraclass, session, true)}} {{thumbnail.format(record.get_thumbnail(), th_size, th_size, extraclass, session, true, true)}}
{% if rollover_gif %} {% if rollover_gif %}
{{thumbnail.format(rollover_gif, th_size, th_size, 'rollover-gif-hover', session, true )}} {{thumbnail.format(rollover_gif, th_size, th_size, 'rollover-gif-hover', session, true, true )}}
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@@ -1285,10 +1285,12 @@ function startThesaurus(){
{ {
C_MenuOption(menuItem, menu, "ACCEPT", {'lng':'{{lng_code}}'}); C_MenuOption(menuItem, menu, "ACCEPT", {'lng':'{{lng_code}}'});
} }
}, }
,
{% endfor %} {% endfor %}
{ {
label:'{% trans 'prod::thesaurusTab:cmenu:Remplacer par...' %}', label:'{% trans 'prod::thesaurusTab:cmenu:Remplacer par...' %}',
disabled:true,
onclick:function(menuItem, menu) onclick:function(menuItem, menu)
{ {
C_MenuOption(menuItem, menu, 'REPLACE', null); C_MenuOption(menuItem, menu, 'REPLACE', null);
@@ -1296,6 +1298,7 @@ function startThesaurus(){
}, },
{ {
label:'{% trans 'boutton::supprimer' %}', label:'{% trans 'boutton::supprimer' %}',
disabled:true,
onclick:function(menuItem, menu) onclick:function(menuItem, menu)
{ {
C_MenuOption(menuItem, menu, 'DELETE', null); C_MenuOption(menuItem, menu, 'DELETE', null);

View File

@@ -308,7 +308,7 @@
<li class="records-subititution span3"> <li class="records-subititution span3">
<div class="thumbnail"> <div class="thumbnail">
<div class="record-thumb" style="text-align:center;"> <div class="record-thumb" style="text-align:center;">
{{ thumb.format(record.get_thumbnail(), 260, 180, "", session, false) }} {{ thumb.format(record.get_thumbnail(), 260, 180, "", session, false, false) }}
<input name="record_id" value="{{ record.get_record_id() }}" type="hidden"/> <input name="record_id" value="{{ record.get_record_id() }}" type="hidden"/>
</div> </div>
<div class="caption"> <div class="caption">

View File

@@ -0,0 +1,215 @@
/*
* Lazy Load - jQuery plugin for lazy loading images
*
* Copyright (c) 2007-2012 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* http://www.appelsiini.net/projects/lazyload
*
* Version: 1.8.1
*
*/
(function($, window) {
var $window = $(window);
$.fn.lazyload = function(options) {
var elements = this;
var $container;
var settings = {
threshold : 0,
failure_limit : 0,
event : "scroll",
effect : "show",
container : window,
data_attribute : "original",
skip_invisible : true,
appear : null,
load : null
};
function update() {
var counter = 0;
elements.each(function() {
var $this = $(this);
if (settings.skip_invisible && !$this.is(":visible")) {
return;
}
if ($.abovethetop(this, settings) ||
$.leftofbegin(this, settings)) {
/* Nothing. */
} else if (!$.belowthefold(this, settings) &&
!$.rightoffold(this, settings)) {
$this.trigger("appear");
/* if we found an image we'll load, reset the counter */
counter = 0;
} else {
if (++counter > settings.failure_limit) {
return false;
}
}
});
}
if(options) {
/* Maintain BC for a couple of versions. */
if (undefined !== options.failurelimit) {
options.failure_limit = options.failurelimit;
delete options.failurelimit;
}
if (undefined !== options.effectspeed) {
options.effect_speed = options.effectspeed;
delete options.effectspeed;
}
$.extend(settings, options);
}
/* Cache container as jQuery as object. */
$container = (settings.container === undefined ||
settings.container === window) ? $window : $(settings.container);
/* Fire one scroll event per scroll. Not one scroll event per image. */
if (0 === settings.event.indexOf("scroll")) {
$container.bind(settings.event, function(event) {
return update();
});
}
this.each(function() {
var self = this;
var $self = $(self);
self.loaded = false;
/* When appear is triggered load original image. */
$self.one("appear", function() {
if (!this.loaded) {
if (settings.appear) {
var elements_left = elements.length;
settings.appear.call(self, elements_left, settings);
}
$("<img />")
.bind("load", function() {
$self
.hide()
.attr("src", $self.data(settings.data_attribute))
[settings.effect](settings.effect_speed);
self.loaded = true;
/* Remove image from array so it is not looped next time. */
var temp = $.grep(elements, function(element) {
return !element.loaded;
});
elements = $(temp);
if (settings.load) {
var elements_left = elements.length;
settings.load.call(self, elements_left, settings);
}
})
.attr("src", $self.data(settings.data_attribute));
}
});
/* When wanted event is triggered load original image */
/* by triggering appear. */
if (0 !== settings.event.indexOf("scroll")) {
$self.bind(settings.event, function(event) {
if (!self.loaded) {
$self.trigger("appear");
}
});
}
});
/* Check if something appears when window is resized. */
$window.bind("resize", function(event) {
update();
});
/* Force initial check if images should appear. */
$(document).ready(function() {
update();
});
return this;
};
/* Convenience methods in jQuery namespace. */
/* Use as $.belowthefold(element, {threshold : 100, container : window}) */
$.belowthefold = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.height() + $window.scrollTop();
} else {
fold = $(settings.container).offset().top + $(settings.container).height();
}
return fold <= $(element).offset().top - settings.threshold;
};
$.rightoffold = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.width() + $window.scrollLeft();
} else {
fold = $(settings.container).offset().left + $(settings.container).width();
}
return fold <= $(element).offset().left - settings.threshold;
};
$.abovethetop = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.scrollTop();
} else {
fold = $(settings.container).offset().top;
}
return fold >= $(element).offset().top + settings.threshold + $(element).height();
};
$.leftofbegin = function(element, settings) {
var fold;
if (settings.container === undefined || settings.container === window) {
fold = $window.scrollLeft();
} else {
fold = $(settings.container).offset().left;
}
return fold >= $(element).offset().left + settings.threshold + $(element).width();
};
$.inviewport = function(element, settings) {
return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) &&
!$.belowthefold(element, settings) && !$.abovethetop(element, settings);
};
/* Custom selectors for your convenience. */
/* Use as $("img:below-the-fold").something() or */
/* $("img").filter(":below-the-fold").something() which is faster */
$.extend($.expr[':'], {
"below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); },
"above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
"right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); },
"left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); },
"in-viewport" : function(a) { return $.inviewport(a, {threshold : 0}); },
/* Maintain BC for couple of versions. */
"above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
"right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0}); },
"left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0}); }
});
})(jQuery, window);

View File

@@ -59,6 +59,7 @@ $groups = array(
, '//include/jslibs/json2.js' , '//include/jslibs/json2.js'
, '//include/jslibs/colorpicker/js/colorpicker.js' , '//include/jslibs/colorpicker/js/colorpicker.js'
, '//include/jslibs/jquery.mousewheel.js' , '//include/jslibs/jquery.mousewheel.js'
, '//include/jslibs/jquery.lazyload/jquery.lazyload.1.8.1.js'
, '//include/jslibs/jquery-ui-1.8.17/jquery-ui-i18n.js' , '//include/jslibs/jquery-ui-1.8.17/jquery-ui-i18n.js'
, '//include/jslibs/jquery.cookie.js' , '//include/jslibs/jquery.cookie.js'
, '//include/jquery.common.js' , '//include/jquery.common.js'

View File

@@ -57,8 +57,15 @@ function getHome(cas, page){
success: function(data){ success: function(data){
answAjaxrunning = false; answAjaxrunning = false;
var answers = $('#answers'); var answers = $('#answers');
$('.next_publi_link', answers).remove(); $('.next_publi_link', answers).remove();
answers.append(data); answers.append(data);
answers.find("img.lazyload").lazyload({
container: answers
});
afterSearch(); afterSearch();
if(page > 0) if(page > 0)
{ {
@@ -478,6 +485,10 @@ function initAnswerForm(){
$('#answers').empty().append(datas.results).removeClass('loading'); $('#answers').empty().append(datas.results).removeClass('loading');
$("#answers img.lazyload").lazyload({
container: $('#answers')
});
$('#tool_results').empty().append(datas.infos); $('#tool_results').empty().append(datas.infos);
$('#tool_navigate').empty().append(datas.navigation); $('#tool_navigate').empty().append(datas.navigation);
@@ -950,6 +961,10 @@ $(document).ready(function(){
$('.see_more.loading', $answers).remove(); $('.see_more.loading', $answers).remove();
$answers.append(data); $answers.append(data);
$answers.find("img.lazyload").lazyload({
container: $answers
});
if(!no_scroll) if(!no_scroll)
{ {
$answers.animate({ $answers.animate({

BIN
www/skins/grey.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 17 KiB