$t->assign('prev_page_link', constructUrl('/', $currentParams, array('start' => $prevStart)));
$nextStart = $start + $pageSize;
$t->assign('next_page_link', constructUrl('/', $currentParams, array('start' => $nextStart)));
$t->assign('full_text_link', constructUrl('/', $currentParams));
$t->assign('snippets_link', constructUrl('/', $currentParams));
$t->assign('all_declarations_link', constructUrl('/', $currentParams, array('decl_type' => 'all', 'start' => 0)));
$t->assign('important_declarations_link', constructUrl('/', $currentParams, array('decl_type' => 'important', 'start' => 0)));
$t->assign('my_declarations_link', constructUrl('/', $currentParams, array('decl_type' => 'mine', 'start' => 0)));
$ranges = getHighlights($declarations);
$myRanges = array();
if (is_user_logged_in()) {
    $ranges = getHighlights($declarations, 0, $uid);
    $uid = is_user_logged_in() ? $current_user->ID : 0;
    $myRanges = getHighlights($declarations, $uid, 0);
}
$newDeclarations = array();
foreach ($declarations as $declaration) {
    if ($decl_type == 'important' || $decl_type == 'mine') {
        $declaration['class'] = 'light_gray';
    } else {
        if ($highlightsPerDeclaration['declaration-' . $declaration['id']]) {
            $declaration['class'] = 'dark_gray';
        }
    }
    $declaration['link_to'] = constructUrl('/', array(), array('name' => str_replace(' ', '+', $person->name), 'exp' => 'person_declarations', 'decl_id' => $declaration['id']));
    array_push($newDeclarations, $declaration);
}
$t->assign('declarations', $newDeclarations);
$t->assign('highlights_global_ranges', $ranges);
$t->assign('highlights_my_ranges', $myRanges);
$t->display('mod_person_declarations_expanded.tpl');
Пример #2
0
 /**
  * Returns url for a specific declaration. 
  * @param $declarationId the id of the declaration that the URL points to.
  * 
  */
 public function getDeclarationUrl($declarationId)
 {
     $declarationUrl = constructUrl(getSiteUrl(), array(), array('name' => $this->getNameForUrl(), 'exp' => 'person_declarations', 'decl_id' => $declarationId));
     return $declarationUrl;
 }
$nextStart = $start + $pageSize;
$t->assign('next_page_link', constructUrl('/', $currentParams, array('start' => $nextStart)));
$t->assign('full_text_link', constructUrl('/', $currentParams));
$t->assign('snippets_link', constructUrl('/', $currentParams));
$t->assign('all_declarations_link', constructUrl('/', $currentParams, array('decl_type' => 'all', 'start' => 0)));
$t->assign('important_declarations_link', constructUrl('/', $currentParams, array('decl_type' => 'important', 'start' => 0)));
$t->assign('my_declarations_link', constructUrl('/', $currentParams, array('decl_type' => 'mine', 'start' => 0)));
$ranges = getHighlights($declarations);
$myRanges = array();
if (is_user_logged_in()) {
    $ranges = getHighlights($declarations, 0, $uid);
    $uid = is_user_logged_in() ? $current_user->ID : 0;
    $myRanges = getHighlights($declarations, $uid, 0);
}
$newDeclarations = array();
foreach ($declarations as $declaration) {
    if ($decl_type == 'important' || $decl_type == 'mine') {
        $declaration['class'] = 'light_gray';
    } else {
        if ($highlightsPerDeclaration['declaration-' . $declaration['id']]) {
            $declaration['class'] = 'dark_gray';
        }
    }
    $declaration['link_to'] = constructUrl('/', array(), array('name' => $person->getNameForUrl(), 'exp' => 'person_declarations', 'decl_id' => $declaration['id']));
    array_push($newDeclarations, $declaration);
}
$t->assign('declarations', $newDeclarations);
$t->assign('person', $person);
$t->assign('highlights_global_ranges', $ranges);
$t->assign('highlights_my_ranges', $myRanges);
$t->display('mod_person_declarations_expanded.tpl');