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


PHP eZTemplateDesignResource::designSetting方法代码示例

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


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

示例1: eZImage

 static function eZImage($tpl, $operatorValue, $operatorName, $skipSlash = false)
 {
     $sys = eZSys::instance();
     if ($skipSlash && strlen($sys->wwwDir()) != 0) {
         $skipSlash = false;
     }
     $bases = eZTemplateDesignResource::allDesignBases();
     $triedFiles = array();
     $fileInfo = eZTemplateDesignResource::fileMatch($bases, 'images', $operatorValue, $triedFiles);
     if (!$fileInfo) {
         $tpl->warning($operatorName, "Image '{$operatorValue}' does not exist in any design");
         $tpl->warning($operatorName, "Tried files: " . implode(', ', $triedFiles));
         $siteDesign = eZTemplateDesignResource::designSetting('site');
         $imgPath = "design/{$siteDesign}/images/{$operatorValue}";
     } else {
         $imgPath = $fileInfo['path'];
     }
     $operatorValue = $skipSlash ? $imgPath : $sys->wwwDir() . '/' . $imgPath;
     $operatorValue = htmlspecialchars($operatorValue);
     return $operatorValue;
 }
开发者ID:stevoland,项目名称:ez_patch,代码行数:21,代码来源:ezurloperator.php

示例2: findDesignBase

 /**
  * Find the location on design bases on the disk
  *
  * @param $ini an eZINI object
  * @param $siteAccess Wether to use siteaccesses or not
  * @return array The list of design bases
  */
 private static function findDesignBase(eZINI $ini, $siteAccess = false)
 {
     if ($siteAccess) {
         $ini = eZSiteAccess::getIni($siteAccess, 'site.ini');
         $standardDesign = $ini->variable('DesignSettings', 'StandardDesign');
         $siteDesign = $ini->variable('DesignSettings', 'SiteDesign');
     } else {
         $ini = eZINI::instance();
         $standardDesign = eZTemplateDesignResource::designSetting('standard');
         $siteDesign = eZTemplateDesignResource::designSetting('site');
     }
     $siteDesignList = $ini->variable('DesignSettings', 'AdditionalSiteDesignList');
     array_unshift($siteDesignList, $siteDesign);
     $siteDesignList[] = $standardDesign;
     $siteDesignList = array_unique($siteDesignList);
     $designBaseList = array();
     $extensionDirectory = eZExtension::baseDirectory();
     $designStartPath = eZTemplateDesignResource::designStartPath();
     $extensions = eZTemplateDesignResource::designExtensions();
     foreach ($siteDesignList as $design) {
         foreach ($extensions as $extension) {
             $path = "{$extensionDirectory}/{$extension}/{$designStartPath}/{$design}";
             if (file_exists($path)) {
                 $designBaseList[] = $path;
             }
         }
         $path = "{$designStartPath}/{$design}";
         if (file_exists($path)) {
             $designBaseList[] = $path;
         }
     }
     return $designBaseList;
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:40,代码来源:eztemplatedesignresource.php

示例3: array

$user = eZUser::currentUser();
eZDebugSetting::addTimingPoint('kernel-content-pdf', 'Operation start');
$operationResult = eZOperationHandler::execute('content', 'read', array('node_id' => $NodeID, 'user_id' => $user->id(), 'language_code' => $LanguageCode), null, $useTriggers);
eZDebugSetting::writeDebug('kernel-content-pdf', $operationResult, 'operationResult');
eZDebugSetting::addTimingPoint('kernel-content-pdf', 'Operation end');
eZDebugSetting::writeDebug('kernel-content-pdf', $NodeID, 'Fetching node');
switch ($operationResult['status']) {
    case eZModuleOperationInfo::STATUS_CONTINUE:
        if ($operationResult != null && !isset($operationResult['result']) && (!isset($operationResult['redirect_url']) || $operationResult['redirect_url'] == null)) {
            if ($viewCacheEnabled) {
                // Note: this code is duplicate, see about 100 lines up
                $cacheInfo = eZContentObject::cacheInfo($Params);
                $language = $cacheInfo['language'];
                $roleList = $cacheInfo['role_list'];
                $discountList = $cacheInfo['discount_list'];
                $designSetting = eZTemplateDesignResource::designSetting('site');
                if (eZContentCache::exists($designSetting, $NodeID, 'pdf', $language, $Offset, $roleList, $discountList, $layout, array('view_parameters' => $viewParameters))) {
                    $cachePathInfo = eZContentCache::cachePathInfo($designSetting, $NodeID, 'pdf', $language, $Offset, $roleList, $discountList, $layout, false, array('view_parameters' => $viewParameters));
                    contentPDFPassthrough($cachePathInfo['path']);
                }
            }
            if (isset($operationResult['object'])) {
                $object = $operationResult['object'];
            } else {
                return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
            }
            if (!$object instanceof eZContentObject) {
                return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
            }
            $node = $operationResult['node'];
            if ($node === null) {
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:31,代码来源:pdf.php

示例4: htmlspecialchars

$node->setAttribute('sort_order', $class->attribute('sort_order'));
$node->setAttribute('remote_id', eZRemoteIdUtility::generate('node'));
$node->setName($objectName);
$node->setContentObject($contentObject);
if ($Params['SiteAccess']) {
    $siteAccess = htmlspecialchars($Params['SiteAccess']);
} else {
    include 'kernel/content/versionviewframe.php';
    return;
}
if (!$siteAccess) {
    $contentINI = eZINI::instance('content.ini');
    if ($contentINI->hasVariable('VersionView', 'DefaultPreviewDesign')) {
        $siteAccess = $contentINI->variable('VersionView', 'DefaultPreviewDesign');
    } else {
        $siteAccess = eZTemplateDesignResource::designSetting('site');
    }
}
$access = $GLOBALS['eZCurrentAccess'];
$access['name'] = $siteAccess;
if ($access['type'] === eZSiteAccess::TYPE_URI) {
    $access['uri_part'] = array($siteAccess);
}
eZSiteAccess::load($access);
eZDebug::checkDebugByUser();
// Change content object default language
$GLOBALS['eZContentObjectDefaultLanguage'] = $LanguageCode;
eZTranslatorManager::resetTranslations();
ezpI18n::reset();
eZContentObject::clearCache();
eZContentLanguage::expireCache();
开发者ID:schwabokaner,项目名称:ezpublish-legacy,代码行数:31,代码来源:versionview.php

示例5: generateStatistics

 static function generateStatistics($as_html = true)
 {
     $stats = '';
     if (!eZTemplate::isTemplatesUsageStatisticsEnabled()) {
         return $stats;
     }
     if ($as_html) {
         $stats .= "<h3>Templates used to render the page:</h3>";
         $stats .= "<table id='templateusage' class='debug_resource_usage' title='List of used templates'>" . "<tr><th title='Usage count of this particular template'>Usage</th>" . "<th>Requested template</th>" . "<th>Template</th>" . "<th>Template loaded</th>" . "<th>Edit</th>" . "<th>Override</th></tr>";
     } else {
         $formatString = "%-40s%-40s%-40s\n";
         $stats .= "Templates usage statistics\n";
         $stats .= sprintf($formatString, 'Templates', 'Requested template', 'Template loaded');
     }
     if ($as_html) {
         $iconSizeX = 16;
         $iconSizeY = 16;
         $templateViewFunction = 'visual/templateview';
         eZURI::transformURI($templateViewFunction);
         $templateEditFunction = 'visual/templateedit';
         eZURI::transformURI($templateEditFunction);
         $templateOverrideFunction = 'visual/templatecreate';
         eZURI::transformURI($templateOverrideFunction);
         $std_base = eZTemplateDesignResource::designSetting('standard');
         $wwwDir = htmlspecialchars(eZSys::wwwDir(), ENT_COMPAT, 'UTF-8');
         $editIconFile = "{$wwwDir}/design/{$std_base}/images/edit.gif";
         $overrideIconFile = "{$wwwDir}/design/{$std_base}/images/override-template.gif";
         $tdClass = 'used_templates_stats1';
         $j = 0;
         $currentSiteAccess = $GLOBALS['eZCurrentAccess']['name'];
     }
     $templatesUsageStatistics = eZTemplate::templatesUsageStatistics();
     $alreadyListedTemplate = $templateCounts = array();
     //Generate usage count for each unique template first.
     foreach ($templatesUsageStatistics as $templateInfo) {
         $actualTemplateName = $templateInfo['actual-template-name'];
         if (!array_key_exists($actualTemplateName, $templateCounts)) {
             $templateCounts[$actualTemplateName] = 1;
         } else {
             ++$templateCounts[$actualTemplateName];
         }
     }
     //Then create the actual listing
     foreach ($templatesUsageStatistics as $templateInfo) {
         $actualTemplateName = $templateInfo['actual-template-name'];
         $requestedTemplateName = $templateInfo['requested-template-name'];
         $templateFileName = $templateInfo['template-filename'];
         if (!in_array($actualTemplateName, $alreadyListedTemplate)) {
             $alreadyListedTemplate[] = $actualTemplateName;
             if ($as_html) {
                 $requestedTemplateViewURI = $templateViewFunction . '/' . $requestedTemplateName;
                 $actualTemplateViewURI = $templateViewFunction . '/' . $actualTemplateName;
                 $templateEditURI = $templateEditFunction . '/' . $templateFileName;
                 $templateOverrideURI = $templateOverrideFunction . '/' . $actualTemplateName;
                 $actualTemplateNameOutput = $actualTemplateName == $requestedTemplateName ? "<em>&lt;No override&gt;</em>" : $actualTemplateName;
                 $stats .= "<tr class='data'><td>{$templateCounts[$actualTemplateName]}</td>" . "<td><a href=\"{$requestedTemplateViewURI}\">{$requestedTemplateName}</a></td>" . "<td>{$actualTemplateNameOutput}</td>" . "<td>{$templateFileName}</td>" . "<td><a href=\"{$templateEditURI}/(siteAccess)/{$currentSiteAccess}\"><img src=\"{$editIconFile}\" width=\"{$iconSizeX}\" height=\"{$iconSizeY}\" alt=\"Edit template\" title=\"Edit template\" /></a></td>" . "<td><a href=\"{$templateOverrideURI}/(siteAccess)/{$currentSiteAccess}\"><img src=\"{$overrideIconFile}\" width=\"{$iconSizeX}\" height=\"{$iconSizeY}\" alt=\"Override template\" title=\"Override template\" /></a></td></tr>";
                 $j++;
             } else {
                 $stats .= sprintf($formatString, $requestedTemplateName, $actualTemplateName, $templateFileName);
             }
         }
     }
     $totalTemplatesCount = count($templatesUsageStatistics);
     $totalUniqueTemplatesCopunt = count(array_keys($alreadyListedTemplate));
     if ($as_html) {
         $stats .= "<tr><td colspan=\"6\"><b>&nbsp;Number of times templates used: {$totalTemplatesCount}<br />&nbsp;Number of unique templates used: {$totalUniqueTemplatesCopunt}</b></td></tr>";
         $stats .= "</table>";
     } else {
         $stats .= "\nTotal templates count: " . $totalTemplatesCount . "\n" . "Total unique templates count: " . $totalUniqueTemplatesCopunt . "\n";
     }
     return $stats;
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:72,代码来源:eztemplatesstatisticsreporter.php

示例6: generateStatistics

 static function generateStatistics($as_html = true)
 {
     $statStartTime = microtime(true);
     $stats = '';
     if (!eZTemplate::isTemplatesUsageStatisticsEnabled()) {
         return $stats;
     }
     if ($as_html) {
         $stats .= "<h2>Templates used to render the page:</h2>";
         $stats .= "<table id='templateusage' summary='List of used templates' style='border: 1px dashed black;' cellspacing='0'>" . "<tr><th>Usage count</th>" . "<th>Requested template</th>" . "<th>Template</th>" . "<th>Template loaded</th>" . "<th>Edit</th>" . "<th>Override</th></tr>";
     } else {
         $formatString = "%-40s%-40s%-40s\n";
         $stats .= "Templates usage statistics\n";
         $stats .= sprintf($formatString, 'Templates', 'Requested template', 'Template loaded');
     }
     if ($as_html) {
         $iconSizeX = 16;
         $iconSizeY = 16;
         $templateViewFunction = 'visual/templateview';
         eZURI::transformURI($templateViewFunction);
         $templateEditFunction = 'visual/templateedit';
         eZURI::transformURI($templateEditFunction);
         $templateOverrideFunction = 'visual/templatecreate';
         eZURI::transformURI($templateOverrideFunction);
         $std_base = eZTemplateDesignResource::designSetting('standard');
         $wwwDir = eZSys::wwwDir();
         $editIconFile = "{$wwwDir}/design/{$std_base}/images/edit.gif";
         $overrideIconFile = "{$wwwDir}/design/{$std_base}/images/override-template.gif";
         $tdClass = 'used_templates_stats1';
         $j = 0;
         $currentSiteAccess = $GLOBALS['eZCurrentAccess']['name'];
     }
     $templatesUsageStatistics = eZTemplate::templatesUsageStatistics();
     $alreadyListedTemplate = $templateCounts = array();
     //Generate usage count for each unique template first.
     foreach ($templatesUsageStatistics as $templateInfo) {
         $actualTemplateName = $templateInfo['actual-template-name'];
         if (!array_key_exists($actualTemplateName, $templateCounts)) {
             $templateCounts[$actualTemplateName] = 1;
         } else {
             ++$templateCounts[$actualTemplateName];
         }
     }
     //Then create the actual listing
     foreach ($templatesUsageStatistics as $templateInfo) {
         $actualTemplateName = $templateInfo['actual-template-name'];
         $requestedTemplateName = $templateInfo['requested-template-name'];
         $templateFileName = $templateInfo['template-filename'];
         if (!in_array($actualTemplateName, $alreadyListedTemplate)) {
             $alreadyListedTemplate[] = $actualTemplateName;
             if ($as_html) {
                 $tdClass = $j % 2 == 0 ? 'used_templates_stats1' : 'used_templates_stats2';
                 $requestedTemplateViewURI = $templateViewFunction . '/' . $requestedTemplateName;
                 $actualTemplateViewURI = $templateViewFunction . '/' . $actualTemplateName;
                 $templateEditURI = $templateEditFunction . '/' . $templateFileName;
                 $templateOverrideURI = $templateOverrideFunction . '/' . $actualTemplateName;
                 $actualTemplateNameOutput = $actualTemplateName == $requestedTemplateName ? "<span style=\"font-style: italic;\">&lt;No override&gt;</span>" : $actualTemplateName;
                 $stats .= "<tr><td class=\"{$tdClass}\" style=\"text-align: center;\">{$templateCounts[$actualTemplateName]}</td>" . "<td class=\"{$tdClass}\"><a href=\"{$requestedTemplateViewURI}\">{$requestedTemplateName}</a></td>" . "<td class=\"{$tdClass}\">{$actualTemplateNameOutput}</td>" . "<td class=\"{$tdClass}\">{$templateFileName}</td>" . "<td class=\"{$tdClass}\" align=\"center\"><a href=\"{$templateEditURI}/(siteAccess)/{$currentSiteAccess}\"><img src=\"{$editIconFile}\" width=\"{$iconSizeX}\" height=\"{$iconSizeY}\" alt=\"Edit template\" title=\"Edit template\" /></a></td>" . "<td class=\"{$tdClass}\" align=\"center\"><a href=\"{$templateOverrideURI}/(siteAccess)/{$currentSiteAccess}\"><img src=\"{$overrideIconFile}\" width=\"{$iconSizeX}\" height=\"{$iconSizeY}\" alt=\"Override template\" title=\"Override template\" /></a></td></tr>";
                 $j++;
             } else {
                 $stats .= sprintf($formatString, $requestedTemplateName, $actualTemplateName, $templateFileName);
             }
         }
     }
     $totalTemplatesCount = count($templatesUsageStatistics);
     $totalUniqueTemplatesCopunt = count(array_keys($alreadyListedTemplate));
     $statEndTime = microtime(true);
     $timeUsage = number_format($statEndTime - $statStartTime, 4);
     if ($as_html) {
         $stats .= "<tr><td class=\"{$tdClass}\">&nbsp;</td>" . "<td class=\"{$tdClass}\">&nbsp;</td>" . "<td class=\"{$tdClass}\">&nbsp;</td>" . "<td class=\"{$tdClass}\">&nbsp;</td>" . "<td class=\"{$tdClass}\">&nbsp;</td>" . "<td class=\"{$tdClass}\">&nbsp;</td></tr>";
         $stats .= "<tr><td colspan=\"2\" style=\"text-align: left;\"><b>&nbsp;Number of times templates used: {$totalTemplatesCount}<br />&nbsp;Number of unique templates used: {$totalUniqueTemplatesCopunt}</b></td></tr>";
         $stats .= "<tr><td colspan=\"2\" style=\"text-align: left;\"><b>&nbsp;Time used to render template usage: {$timeUsage} secs</b></td></tr>";
         $stats .= "</table>";
     } else {
         $stats .= "\nTotal templates count: " . $totalTemplatesCount . "\n" . "Total unique templates count: " . $totalUniqueTemplatesCopunt . "\n";
     }
     return $stats;
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:78,代码来源:eztemplatesstatisticsreporter.php

示例7: eZImage

    static function eZImage( $tpl, $operatorValue, $operatorName, $skipSlash = false )
    {
        $sys = eZSys::instance();
        if ( $skipSlash && strlen( $sys->wwwDir() ) != 0 )
        {
            $skipSlash = false;
        }

        $bases = eZTemplateDesignResource::allDesignBases();
        $triedFiles = array();
        $fileInfo = eZTemplateDesignResource::fileMatch( $bases, 'images', $operatorValue, $triedFiles );

        if ( !$fileInfo )
        {
            $tpl->warning( $operatorName, "Image '$operatorValue' does not exist in any design" );
            $tpl->warning( $operatorName, "Tried files: " . implode( ', ', $triedFiles ) );
            $siteDesign = eZTemplateDesignResource::designSetting( 'site' );
            $imgPath = "design/$siteDesign/images/$operatorValue";
        }
        else
        {
            $imgPath = $fileInfo['path'];
        }

        $ini = eZINI::instance();
        if ( $ini->variable( 'DesignSettings', 'DynamicImageSuffix' ) == 'enabled' )
        {
            $imgHash = sha1_file( $imgPath );
            $imgDecHash = hexdec( substr( $imgHash, 0, 7 ) );
            $imgPath =  preg_replace( '/^(.*)\.([^.]+)$/i', '$1.'.$imgDecHash.'.$2', $imgPath );
        }

        $operatorValue = $skipSlash ? $imgPath : $sys->wwwDir() . '/' . $imgPath;
        $operatorValue = htmlspecialchars( $operatorValue );
        if ( ! $skipSlash )
        {
            $serverURL = eZURI::serverShardingURL( $operatorValue );
            $operatorValue = $serverURL.$operatorValue;
        }

        return $operatorValue;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:42,代码来源:ezurloperator.php


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