actuality bug fix
Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
parent
7a3ee63d15
commit
f0f9635e8b
@ -543,6 +543,8 @@ MaterioSearchApiAjax = function(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
function addNextpage(json, container_class){
|
function addNextpage(json, container_class){
|
||||||
|
// trace('json',json);
|
||||||
|
if(json){
|
||||||
var $newcontent = $(json.return),
|
var $newcontent = $(json.return),
|
||||||
$newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
|
$newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
|
||||||
$newpager = $('ul.pager', $newcontent);
|
$newpager = $('ul.pager', $newcontent);
|
||||||
@ -562,6 +564,7 @@ MaterioSearchApiAjax = function(){
|
|||||||
type : 'resultscompleted',
|
type : 'resultscompleted',
|
||||||
container : $(container_class, _$content)
|
container : $(container_class, _$content)
|
||||||
});
|
});
|
||||||
|
}
|
||||||
_isloadingresults = false;
|
_isloadingresults = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -206,6 +206,8 @@ MaterioSearchApiAjax = function(){
|
|||||||
};
|
};
|
||||||
|
|
||||||
function addNextpage(json, container_class){
|
function addNextpage(json, container_class){
|
||||||
|
// trace('json',json);
|
||||||
|
if(json){
|
||||||
var $newcontent = $(json.return),
|
var $newcontent = $(json.return),
|
||||||
$newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
|
$newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
|
||||||
$newpager = $('ul.pager', $newcontent);
|
$newpager = $('ul.pager', $newcontent);
|
||||||
@ -225,6 +227,7 @@ MaterioSearchApiAjax = function(){
|
|||||||
type : 'resultscompleted',
|
type : 'resultscompleted',
|
||||||
container : $(container_class, _$content)
|
container : $(container_class, _$content)
|
||||||
});
|
});
|
||||||
|
}
|
||||||
_isloadingresults = false;
|
_isloadingresults = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ function materio_search_api_results_search(){
|
|||||||
function materio_search_api_actuality(){
|
function materio_search_api_actuality(){
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if(!user_access('use materio search api')){
|
if(isset($user->roles[1])){
|
||||||
$date_limit = strtotime('-6 month');
|
$date_limit = strtotime('-6 month');
|
||||||
// dsm(date('d m y', $date_limit));
|
// dsm(date('d m y', $date_limit));
|
||||||
}
|
}
|
||||||
@ -341,7 +341,7 @@ function materio_search_api_actuality(){
|
|||||||
->propertyOrderBy('created', 'DESC')
|
->propertyOrderBy('created', 'DESC')
|
||||||
->range($offset,$limit);
|
->range($offset,$limit);
|
||||||
|
|
||||||
if(!user_access('use materio search api')){
|
if(isset($user->roles[1])){
|
||||||
$query->propertyCondition('created', $date_limit, '>');
|
$query->propertyCondition('created', $date_limit, '>');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ function materio_search_api_actuality(){
|
|||||||
->propertyCondition('status', 1)
|
->propertyCondition('status', 1)
|
||||||
->entityCondition('bundle', array('breve'));
|
->entityCondition('bundle', array('breve'));
|
||||||
// dsm($count, 'count');
|
// dsm($count, 'count');
|
||||||
if(!user_access('use materio search api')){
|
if(isset($user->roles[1])){
|
||||||
$count_query->propertyCondition('created', $date_limit, '>');
|
$count_query->propertyCondition('created', $date_limit, '>');
|
||||||
}
|
}
|
||||||
$count = $count_query->count()->execute();
|
$count = $count_query->count()->execute();
|
||||||
|
@ -52,7 +52,7 @@ function materio_search_api_ajax_menu() {
|
|||||||
'access arguments' => array('use materio search api viewmode selection'),
|
'access arguments' => array('use materio search api viewmode selection'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$items['materio_search_api_ajax/actuality'] = array(
|
$items['materio_search_api_ajax/actuality'] = $base+array(
|
||||||
'page callback' => 'materio_search_api_ajax_actuality',
|
'page callback' => 'materio_search_api_ajax_actuality',
|
||||||
'access callback' => TRUE,
|
'access callback' => TRUE,
|
||||||
'page arguments' => array(2),
|
'page arguments' => array(2),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user