How do I load Ajax pager? My code in custom module
function organization_news_page(){
if(menu_get_object()){
$node = menu_get_object();
$query = db_select('node', 'n')
->fields('n', array('nid', 'uid', 'type'))
->condition('n.status', NODE_PUBLISHED)
->condition('n.type', 'news', '=')
->extend('PagerDefault')
->limit(10)
->orderBy('n.created', 'DESC');
$result = $query->execute();
$output = '';
foreach($result as $value){
if($value->uid == $node->uid){
$node_news = node_load($value->nid);
$image = theme('image_style', array('style_name' => '165x103', 'path' => $node_news->field_image['und'][0]['uri']));
$body = render(field_view_field('node', $node_news, 'body', array('label' => 'hidden', 'type' => 'text_summary_or_trimmed', 'settings' => array('trim_length' => 200))));
$output .= '<div class="news-organization-page"><span class="image-news-page">'.$image.'</span>';
$output .= '<span class="date-created-news-page">'.format_date($node_news->created, 'custom', 'j.m.Y').'</span>';
$output .= '<span class="title-news-page">'.$node_news->title.'</span>';
$output .= $body;
$output .= l('подробнее...', 'node/'.$node_news->nid, array('attributes' => array('class' => array('read-more-link'))));
$output .= '</div>';
}
}
$output .= theme('pager', array('element' => 1, 'quantity' => 9));
return $output;
}
}