コード例 #1
0
 function fetchList($isValid, $offset, $limit, $onlyPublished)
 {
     $parameters = array('is_valid' => $isValid, 'offset' => $offset, 'limit' => $limit, 'only_published' => $onlyPublished);
     $list = eZURL::fetchList($parameters);
     if ($list === null) {
         $result = array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
     } else {
         $result = array('result' => $list);
     }
     return $result;
 }
コード例 #2
0
ファイル: list.php プロジェクト: jordanmanning/ezpublish
}
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')));
コード例 #3
0
<?php

/**
 * File containing the linkcheck.php cronjob
 *
 * @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version  2012.8
 * @package kernel
 */
$cli->output("Checking link ...");
$cronjobIni = eZINI::instance('cronjob.ini');
$siteURLs = $cronjobIni->variable('linkCheckSettings', 'SiteURL');
$linkList = eZURL::fetchList(array('only_published' => true));
foreach ($linkList as $link) {
    $linkID = $link->attribute('id');
    $url = $link->attribute('url');
    $isValid = $link->attribute('is_valid');
    $cli->output("check-" . $cli->stylize('emphasize', $url) . " ", false);
    if (preg_match("/^(http:)/i", $url) or preg_match("/^(ftp:)/i", $url) or preg_match("/^(https:)/i", $url) or preg_match("/^(file:)/i", $url) or preg_match("/^(mailto:)/i", $url)) {
        if (preg_match("/^(mailto:)/i", $url)) {
            if (eZSys::osType() != 'win32') {
                $url = trim(preg_replace("/^mailto:(.+)/i", "\\1", $url));
                list($userName, $host) = explode('@', $url);
                list($host, $junk) = explode('?', $host);
                $dnsCheck = checkdnsrr($host, "MX");
                if (!$dnsCheck) {
                    if ($isValid) {
                        eZURL::setIsValid($linkID, false);
                    }
                    $cli->output($cli->stylize('warning', "invalid"));