本文整理汇总了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;
}
示例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;
}
示例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) {
示例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();
示例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><No override></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> Number of times templates used: {$totalTemplatesCount}<br /> 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;
}
示例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;\"><No override></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}\"> </td>" . "<td class=\"{$tdClass}\"> </td>" . "<td class=\"{$tdClass}\"> </td>" . "<td class=\"{$tdClass}\"> </td>" . "<td class=\"{$tdClass}\"> </td>" . "<td class=\"{$tdClass}\"> </td></tr>";
$stats .= "<tr><td colspan=\"2\" style=\"text-align: left;\"><b> Number of times templates used: {$totalTemplatesCount}<br /> Number of unique templates used: {$totalUniqueTemplatesCopunt}</b></td></tr>";
$stats .= "<tr><td colspan=\"2\" style=\"text-align: left;\"><b> 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;
}
示例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;
}