本文整理汇总了PHP中eZURL::fetchList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZURL::fetchList方法的具体用法?PHP eZURL::fetchList怎么用?PHP eZURL::fetchList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZURL
的用法示例。
在下文中一共展示了eZURL::fetchList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchList
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: array
}
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: trim
<?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"));