本文整理汇总了PHP中F::File_LocalUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP F::File_LocalUrl方法的具体用法?PHP F::File_LocalUrl怎么用?PHP F::File_LocalUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F
的用法示例。
在下文中一共展示了F::File_LocalUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUrlPath
public function getUrlPath()
{
$sResult = $this->getProp('_page_url_path');
if (!$sResult) {
$sResult = F::File_LocalUrl(R::GetPath('page') . '/' . $this->getUrlFull());
$this->setProp('_page_url_path', $sResult);
}
return $sResult;
}
示例2: CallbackCheckLinks
/**
* Учет ссылок в тексте
*
* @param string $sTag
* @param array $aParams
* @param string $sContent
* @param string $sText
*
* @return string
*/
public function CallbackCheckLinks($sTag, $aParams, $sContent, $sText = null)
{
if (isset($this->aCheckTagLinks[$sTag])) {
if (isset($aParams[$this->aCheckTagLinks[$sTag]['link']])) {
$sLinkAttr = $this->aCheckTagLinks[$sTag]['link'];
$sLink = E::ModuleMresource()->NormalizeUrl($aParams[$sLinkAttr]);
$nType = $this->aCheckTagLinks[$sTag]['type'];
$this->aLinks[] = array('type' => $nType, 'link' => $sLink);
$sText = '<' . $sTag . ' ';
if (F::File_LocalUrl($aParams[$sLinkAttr]) && isset($aParams['rel']) && $aParams['rel'] == 'nofollow') {
unset($aParams['rel']);
}
foreach ($aParams as $sKey => $sVal) {
if ($sKey == $sLinkAttr && $this->aCheckTagLinks[$sTag]['restoreFunc']) {
$sVal = call_user_func($this->aCheckTagLinks[$sTag]['restoreFunc'], $sLink);
}
$sText .= $sKey . '="' . $sVal . '" ';
}
if (is_null($sContent) || empty($this->aCheckTagLinks[$sTag]['pairedTag'])) {
$sText = trim($sText) . '>';
} else {
$sText = trim($sText) . '>' . $sContent . '</' . $sTag . '>';
}
}
}
return $sText;
}
示例3: CalcUrlHash
/**
* Calc hash of URL for seeking & comparation
*
* @param string $sUrl
*
* @return string
*/
public function CalcUrlHash($sUrl)
{
if (substr($sUrl, 0, 1) != '@') {
$sPathUrl = F::File_LocalUrl($sUrl);
if ($sPathUrl) {
$sUrl = '@' . trim($sPathUrl, '/');
}
}
return md5($sUrl);
}
示例4: SetUrl
/**
* Sets full url of resource
*
* @param $sUrl
*/
public function SetUrl($sUrl)
{
if (substr($sUrl, 0, 1) === '@') {
$sPathUrl = substr($sUrl, 1);
$sUrl = F::File_RootUrl() . $sPathUrl;
} else {
$sPathUrl = F::File_LocalUrl($sUrl);
}
if ($sPathUrl) {
// Сохраняем относительный путь
$this->SetPathUrl('@' . trim($sPathUrl, '/'));
if (!$this->getPathFile()) {
$this->SetFile(F::File_Url2Dir($sUrl));
}
} else {
// Сохраняем абсолютный путь
$this->SetPathUrl($sUrl);
}
if (is_null($this->GetPathFile())) {
if (is_null($this->GetLink())) {
$this->SetLink(true);
}
if (is_null($this->GetType())) {
$this->SetType(ModuleMresource::TYPE_HREF);
}
}
$this->RecalcHash();
}
示例5: RealUrl
/**
* Returns real URL (or path of URL) without rewrites
*
* @param bool $bPathOnly
*
* @return null|string
*/
public static function RealUrl($bPathOnly = false)
{
$sResult = static::$sCurrentFullUrl;
if ($bPathOnly) {
$sResult = F::File_LocalUrl($sResult);
}
return $sResult;
}
示例6: getLink
/**
* Возвращает ссылку фото определенного размера
*
* @param string|null $xSize Размер фото, например, '100' или '150crop' или '150x100' или 'x100'
*
* @return null|string
*/
public function getLink($xSize = null)
{
if ($sUrl = $this->getPath()) {
if ($xSize) {
$sResizedUrl = $this->getProp('_size-' . $xSize . '-url');
if ($sResizedUrl) {
return $sResizedUrl;
}
$aPathInfo = pathinfo($sUrl);
if (E::ActivePlugin('ls')) {
// Включена совместимость с LS
$sResizedUrl = $aPathInfo['dirname'] . '/' . $aPathInfo['filename'] . '_' . $xSize . '.' . $aPathInfo['extension'];
if (F::File_LocalUrl($sResizedUrl) && !F::File_Exists(F::File_Url2Dir($sResizedUrl))) {
$sResizedUrl = '';
}
}
if (!$sResizedUrl) {
$sModSuffix = F::File_ImgModSuffix($xSize, $aPathInfo['extension']);
if ($sModSuffix) {
$sResizedUrl = $sUrl . $sModSuffix;
if (Config::Get('module.image.autoresize')) {
$sFile = E::ModuleUploader()->Url2Dir($sResizedUrl);
$this->setProp('_size-' . $xSize . '-file', $sFile);
if (!F::File_Exists($sFile)) {
E::ModuleImg()->Duplicate($sFile);
}
}
}
}
if ($sResizedUrl) {
$sUrl = F::File_NormPath($sResizedUrl);
}
$this->setProp('_size-' . $xSize . '-url', $sUrl);
}
}
return $sUrl;
}
示例7: Url2Dir
/**
* @param string $sUrl
*
* @return string
*/
public function Url2Dir($sUrl)
{
if (F::File_LocalUrl($sUrl)) {
$sDir = F::File_Url2Dir($sUrl);
if (strpos($sDir, Config::Get('path.uploads.root')) === 0) {
$sDir = F::File_NormPath(Config::Get('path.static.dir') . $sDir);
} elseif (Config::Get('path.root.subdir') && strpos($sDir, Config::Get('path.root.subdir') . Config::Get('path.uploads.root')) === 0) {
$sRootPath = substr(Config::Get('path.static.dir'), 0, -strlen(Config::Get('path.root.subdir')));
$sDir = F::File_NormPath($sRootPath . $sDir);
}
return $sDir;
}
}