当前位置: 首页>>代码示例>>PHP>>正文


PHP eZURL::url方法代码示例

本文整理汇总了PHP中eZURL::url方法的典型用法代码示例。如果您正苦于以下问题:PHP eZURL::url方法的具体用法?PHP eZURL::url怎么用?PHP eZURL::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZURL的用法示例。


在下文中一共展示了eZURL::url方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processData

 /**
  * Search through valid ezxmltext occurrences, and fix missing url object links if
  * specified.
  *
  * @return void
  */
 public function processData()
 {
     while ($this->processedCount < $this->xmlTextContentObjectAttributeCount()) {
         $limit = array('offset' => $this->offset, 'length' => $this->fetchLimit);
         $xmlAttributeChunk = eZContentObjectAttribute::fetchListByClassID($this->xmlClassAttributeIds(), false, $limit, true, false);
         foreach ($xmlAttributeChunk as $xmlAttr) {
             $result = true;
             // If the current entry has been logged, we don't increment the running number
             // so that the entries can be displayed together on output.
             $currentEntryLogged = false;
             $currentId = $xmlAttr->attribute('id');
             $objectId = $xmlAttr->attribute('contentobject_id');
             $version = $xmlAttr->attribute('version');
             $languageCode = $xmlAttr->attribute('language_code');
             $label = "Attribute [id:{$currentId}] - [Object-id:{$objectId}] - [Version:{$version}] - [Language:{$languageCode}]";
             $xmlText = eZXMLTextType::rawXMLText($xmlAttr);
             if (empty($xmlText)) {
                 if ($this->verboseLevel > 0) {
                     $this->outputString("Empty XML-data", $label, $currentEntryLogged);
                     $currentEntryLogged = true;
                 }
                 $result = false;
                 continue;
             }
             $dom = new DOMDocument('1.0', 'utf-8');
             $success = $dom->loadXML($xmlText);
             if (!$success) {
                 if ($this->verboseLevel > 0) {
                     $this->outputString("XML not loaded correctly for attribute", $label, $currentEntryLogged);
                     $currentEntryLogged = true;
                 }
                 $result = false;
                 continue;
             }
             $linkNodes = $dom->getElementsByTagName('link');
             $urlIdArray = array();
             foreach ($linkNodes as $link) {
                 // We are looking for external 'http://'-style links, not the internal
                 // object or node links.
                 if ($link->hasAttribute('url_id')) {
                     $urlIdArray[] = $link->getAttribute('url_id');
                 }
             }
             if (count($urlIdArray) > 0) {
                 if ($this->verboseLevel > 0) {
                     $this->outputString("Found http-link elements in xml-block", $label, $currentEntryLogged);
                     $currentEntryLogged = true;
                 }
                 $urlIdArray = array_unique($urlIdArray);
                 foreach ($urlIdArray as $url) {
                     $linkObjectLink = eZURLObjectLink::fetch($url, $currentId, $version);
                     if ($linkObjectLink === null) {
                         $result = false;
                         $this->outputString("Missing url object link: [id:{$currentId}] - [version:{$version}] - [url:{$url}]", $label, $currentEntryLogged);
                         $currentEntryLogged = true;
                     }
                     $storedUrl = eZURL::url($url);
                     if ($storedUrl === false) {
                         $result = false;
                         $this->outputString("Missing URL, the referenced url does not exist, [url_id:{$url}]", $label, $currentEntryLogged);
                         $currentEntryLogged = true;
                     }
                 }
                 if ($this->doFix and $linkObjectLink === null and $storedUrl !== false) {
                     $this->outputString("Reconstructing ezurl-object-link", $label, $currentEntryLogged);
                     $currentEntryLogged = true;
                     eZSimplifiedXMLInput::updateUrlObjectLinks($xmlAttr, $urlIdArray);
                 }
             }
             $this->script->iterate($this->cli, $result);
             $label = null;
         }
         $this->processedCount += count($xmlAttributeChunk);
         $this->offset += $this->fetchLimit;
         unset($xmlAttributeChunk);
     }
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:83,代码来源:fixezurlobjectlinks.php

示例2: foreach


//.........这里部分代码省略.........
                {
                    $objectName = 'Unknown';
                    $classIdentifier = false;
                    $tplSuffix = '_denied';
                    $className .= ' ezoeItemObjectDeleted';
                    if ( self::$showEmbedValidationErrors )
                    {
                        $className .= ' ezoeItemValidationError';
                    }
                }

                $embedContentType = self::embedTagContentType( $classIdentifier );
                if ( $embedContentType === 'images' )
                {
                    $ini = eZINI::instance();
                    $URL = self::getServerURL();
                    $objectAttributes = $object->contentObjectAttributes();
                    $imageDatatypeArray = $ini->variable('ImageDataTypeSettings', 'AvailableImageDataTypes');
                    $imageWidth = 32;
                    $imageHeight = 32;
                    foreach ( $objectAttributes as $objectAttribute )
                    {
                        $classAttribute = $objectAttribute->contentClassAttribute();
                        $dataTypeString = $classAttribute->attribute( 'data_type_string' );
                        if ( in_array ( $dataTypeString, $imageDatatypeArray ) && $objectAttribute->hasContent() )
                        {
                            $content = $objectAttribute->content();
                            if ( $content == null )
                                continue;

                            if ( $content->hasAttribute( $size ) )
                            {
                                $imageAlias  = $content->imageAlias( $size );
                                $srcString   = $URL . '/' . $imageAlias['url'];
                                $imageWidth  = $imageAlias['width'];
                                $imageHeight = $imageAlias['height'];
                                break;
                            }
                            else
                            {
                                eZDebug::writeError( "Image alias does not exist: $size, missing from image.ini?",
                                    __METHOD__ );
                            }
                        }
                    }

                    if ( !isset( $srcString ) )
                    {
                        $srcString = self::getDesignFile('images/tango/mail-attachment32.png');
                    }

                    if ( $alignment === 'center' )
                    {
                        $objectAttr .= ' align="middle"';
                        $className .= ' ezoeAlignmiddle'; // align="middle" is not taken into account by browsers on img
                    }
                    else if ( $alignment )
                        $objectAttr .= ' align="' . $alignment . '"';

                    if ( $className != '' )
                        $objectAttr .= ' class="' . $className . '"';

                    $output .= '<img id="' . $idString . '" title="' . $objectName . '" src="' .
                               $srcString . '" width="' . $imageWidth . '" height="' . $imageHeight .
                               '" ' . $objectAttr . $customAttributePart . $styleString . ' />';
                }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:67,代码来源:ezoexmlinput.php

示例3: outputObject

 function outputObject( $element, &$attributes, &$sectionLevel )
 {
     $ret = null;
     if ( isset( $attributes['image:ezurl_id'] ) )
     {
         $linkID = $attributes['image:ezurl_id'];
         if ( $linkID != null )
         {
             $href = eZURL::url( $linkID );
             $attributes['href'] = $href;
         }
     }
     return $ret;
 }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:14,代码来源:ezsimplifiedxmleditoutput.php

示例4: toString

 function toString($contentObjectAttribute)
 {
     if (!$contentObjectAttribute->attribute('data_int')) {
         $attrValue = false;
         return $attrValue;
     }
     $url = eZURL::url($contentObjectAttribute->attribute('data_int'));
     $text = $contentObjectAttribute->attribute('data_text');
     if ($text != '') {
         $exportData = $url . '|' . $text;
     } else {
         $exportData = $url;
     }
     return $exportData;
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:15,代码来源:ezurltype.php

示例5: array

<?php

/**
 * Vue gérant les redirections de liens référencés dans eZ Publish
 * Utile pour les liens sponsorisés, notamment pour éviter les problèmes de validation HTML
 * ou pour cacher les régies publicitaires
 * @copyright Copyright (C) 2011 - Metal France. All rights reserved
 * @author Jerome Vieilledent
 * @version 3.0
 * @package metalfrance
 * @subpackage mf
 */
$Module = $Params['Module'];
$Result = array();
$http = eZHTTPTool::instance();
$mfINI = eZINI::instance('metalfrance.ini');
$url = eZURL::url((int) $Params['LinkID']);
eZHTTPTool::redirect($url, array(), '302');
开发者ID:obenyoussef,项目名称:metalfrance,代码行数:18,代码来源:gateway.php


注:本文中的eZURL::url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。