function fetchListCount($isValid, $onlyPublished)
 {
     $parameters = array('is_valid' => $isValid, 'only_published' => $onlyPublished);
     $listCount = eZURL::fetchListCount($parameters);
     if ($listCount === null) {
         $result = array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
     } else {
         $result = array('result' => $listCount);
     }
     return $result;
 }
Пример #2
0
}
if ($Module->isCurrentAction('SetValid')) {
    $urlSelection = $Module->actionParameter('URLSelection');
    eZURL::setIsValid($urlSelection, true);
} else {
    if ($Module->isCurrentAction('SetInvalid')) {
        $urlSelection = $Module->actionParameter('URLSelection');
        eZURL::setIsValid($urlSelection, false);
    }
}
if ($ViewMode == 'all') {
    $listParameters = array('is_valid' => null, 'offset' => $offset, 'limit' => $limit, 'only_published' => true);
    $countParameters = array('only_published' => true);
} elseif ($ViewMode == 'valid') {
    $listParameters = array('is_valid' => true, 'offset' => $offset, 'limit' => $limit, 'only_published' => true);
    $countParameters = array('is_valid' => true, 'only_published' => true);
} elseif ($ViewMode == 'invalid') {
    $listParameters = array('is_valid' => false, 'offset' => $offset, 'limit' => $limit, 'only_published' => true);
    $countParameters = array('is_valid' => false, 'only_published' => true);
}
$list = eZURL::fetchList($listParameters);
$listCount = eZURL::fetchListCount($countParameters);
$viewParameters = array('offset' => $offset, 'limit' => $limit);
$tpl = eZTemplate::factory();
$tpl->setVariable('view_parameters', $viewParameters);
$tpl->setVariable('url_list', $list);
$tpl->setVariable('url_list_count', $listCount);
$tpl->setVariable('view_mode', $ViewMode);
$Result = array();
$Result['content'] = $tpl->fetch("design:url/list.tpl");
$Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('kernel/url', 'URL')), array('url' => false, 'text' => ezpI18n::tr('kernel/url', 'List')));