@@ -543,6 +543,8 @@ MaterioSearchApiAjax = function(){
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  function addNextpage(json, container_class){
 | 
			
		||||
    // trace('json',json);
 | 
			
		||||
    if(json){
 | 
			
		||||
      var $newcontent = $(json.return),
 | 
			
		||||
          $newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
 | 
			
		||||
          $newpager = $('ul.pager', $newcontent);
 | 
			
		||||
@@ -562,6 +564,7 @@ MaterioSearchApiAjax = function(){
 | 
			
		||||
        type : 'resultscompleted',
 | 
			
		||||
        container : $(container_class, _$content)
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    _isloadingresults = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -206,6 +206,8 @@ MaterioSearchApiAjax = function(){
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  function addNextpage(json, container_class){
 | 
			
		||||
    // trace('json',json);
 | 
			
		||||
    if(json){
 | 
			
		||||
      var $newcontent = $(json.return),
 | 
			
		||||
          $newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
 | 
			
		||||
          $newpager = $('ul.pager', $newcontent);
 | 
			
		||||
@@ -225,6 +227,7 @@ MaterioSearchApiAjax = function(){
 | 
			
		||||
        type : 'resultscompleted',
 | 
			
		||||
        container : $(container_class, _$content)
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    _isloadingresults = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -323,7 +323,7 @@ function materio_search_api_results_search(){
 | 
			
		||||
function materio_search_api_actuality(){
 | 
			
		||||
  global $user;
 | 
			
		||||
 | 
			
		||||
  if(!user_access('use materio search api')){
 | 
			
		||||
  if(isset($user->roles[1])){
 | 
			
		||||
    $date_limit = strtotime('-6 month');  
 | 
			
		||||
    // dsm(date('d m y', $date_limit));
 | 
			
		||||
  }
 | 
			
		||||
@@ -341,7 +341,7 @@ function materio_search_api_actuality(){
 | 
			
		||||
    ->propertyOrderBy('created', 'DESC')
 | 
			
		||||
    ->range($offset,$limit);
 | 
			
		||||
 | 
			
		||||
  if(!user_access('use materio search api')){
 | 
			
		||||
  if(isset($user->roles[1])){
 | 
			
		||||
    $query->propertyCondition('created', $date_limit, '>');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -354,7 +354,7 @@ function materio_search_api_actuality(){
 | 
			
		||||
    ->propertyCondition('status', 1)
 | 
			
		||||
    ->entityCondition('bundle', array('breve'));
 | 
			
		||||
  // dsm($count, 'count');
 | 
			
		||||
  if(!user_access('use materio search api')){
 | 
			
		||||
  if(isset($user->roles[1])){
 | 
			
		||||
    $count_query->propertyCondition('created', $date_limit, '>');
 | 
			
		||||
  }
 | 
			
		||||
  $count = $count_query->count()->execute();
 | 
			
		||||
 
 | 
			
		||||
@@ -52,7 +52,7 @@ function materio_search_api_ajax_menu() {
 | 
			
		||||
    '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',
 | 
			
		||||
    'access callback' => TRUE,
 | 
			
		||||
    'page arguments' => array(2),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user