classname
stringlengths
2
79
method_name
stringlengths
3
5.05k
description
stringlengths
6
3.95k
method_code
stringlengths
7
8.51k
explanation
stringclasses
1 value
MTPkgCmsNavigationEndPoint
_AllowCache
* @return string[]
return true;
-
MTPkgCmsNavigationEndPoint
_GetCacheParameters
* @return TdbDataExtranetUser
$parameter = parent::_GetCacheParameters(); $parameter['activepageid'] = $this->getActivePageService()->getActivePage()->id; $parameter['extranetUserGroups'] = $this->getActiveUserExtranetGroups(); $parameter['isLoggedIn'] = $this->activeUserIsLoggedIn(); return $parameter;
-
MTPkgCmsSubNavigationEndPoint
Accept
* {@inheritDoc}
$oRootTreeNode = $this->getRootNode(); $oRootNode = new TPkgCmsNavigationNode(); $oRootNode->loadFromNode($oRootTreeNode); $aTree = array($oRootNode); $oVisitor->SetMappedValue('aTree', $aTree); if ($bCachingEnabled) { $oCacheTriggerManager->addTrigger('cms_tree_node'); $oCacheTriggerManager->addTrigger('cms_tree'); $oCacheTriggerManager->addTrigger('cms_tpl_page');
-
MTPkgCmsSubNavigationEndPoint
_AllowCache
* @return string[]
return true;
-
MTPkgCmsSubNavigationEndPoint
_GetCacheParameters
* @return TdbDataExtranetUser
$parameter = parent::_GetCacheParameters(); $parameter['rootNodeId'] = $this->getRootNodeId(); $parameter['activepageid'] = $this->getActivePageService()->getActivePage()->id; $parameter['extranetUserGroups'] = $this->getActiveUserExtranetGroups(); $parameter['isLoggedIn'] = $this->activeUserIsLoggedIn(); return $parameter;
-
ChameleonSystemCmsResultCacheExtension
load
* {@inheritDoc} * * @return void
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('services.xml');
-
TPkgCmsResultCacheManager
get
* Can be used to cache results. * Independent of cache manager in db. * Can bes used for caching templates from other sites, credit or address checks. * /*
$sCachedValue = false; $oResultCache = TdbPkgCmsResultCache::GetNewInstance(); if ($oResultCache->LoadFromFields(array('owner_hash' => sha1($sOwner), 'hash' => sha1($sKey)))) { $sCachedValue = unserialize(base64_decode($oResultCache->fieldData)); // load worked if (false === $bIgnoreExpireTime) { $iExpireTimeStamp = strtotime($oResultCache->fieldDateExpireAfter); if (time() > $iExpireTimeStamp) { $sCachedValue = false;
-
TPkgCmsResultCacheManager
exists
* Get cache entry value for owner and key. Note: the object will be returned even if expired * Returns false if no entry was found. * * @param string $sOwner * @param string $sKey * @param bool $bIgnoreExpireTime * * @return bool|string
$oResultCache = TdbPkgCmsResultCache::GetNewInstance(); if (false === $oResultCache->LoadFromFields(array('owner_hash' => sha1($sOwner), 'hash' => sha1($sKey)))) { return false;
-
TPkgCmsResultCacheManager
set
* returns true if the cache entry exists AND is valid. * * @param string $sOwner * @param string $sKey * * @return bool
$aCacheEntryData = array(); $aCacheEntryData['owner_hash'] = sha1($sOwner); $aCacheEntryData['hash'] = sha1($sKey); $aCacheEntryData['data'] = base64_encode(serialize($sValue)); if (false !== $expireTimestamp) { $aCacheEntryData['date_expire_after'] = date('Y-m-d H:i:s', $expireTimestamp);
-
TPkgCmsResultCacheManager
garbageCollector
* Set value to cache. * * @param string $sOwner * @param string $sKey * @param string $sValue * @param string|bool $expireTimestamp * @param bool $bAllowGarbageCollection true = garbage collector delete entry if expired * * @return void
$sQuery = "DELETE FROM `pkg_cms_result_cache` WHERE `pkg_cms_result_cache`.`garbage_collect_when_expired` = '1' AND `pkg_cms_result_cache`.`date_expire_after` < NOW()"; MySqlLegacySupport::getInstance()->query($sQuery);
-
RoutingConfigChangedEvent
__construct
* @var \TdbPkgCmsRouting
$this->routing = $routing;
-
AbstractRouteController
__construct
@var PortalDomainServiceInterface $portalDomainService
$this->portalDomainService = $portalDomainService; $this->languageService = $languageService; $this->urlPrefixGenerator = $urlPrefixGenerator; $this->urlUtil = $urlUtil; $this->routingUtil = $routingUtil;
-
CmsRouteLoader
__construct( ContainerInterface $container, UrlPrefixGeneratorInterface $urlPrefixGenerator, RoutingUtilInterface $routingUtil, UrlUtil $urlUtil )
* @var ContainerInterface
$this->container = $container; $this->urlPrefixGenerator = $urlPrefixGenerator; $this->routingUtil = $routingUtil; $this->urlUtil = $urlUtil;
-
CmsRouteLoader
load
* @var UrlPrefixGeneratorInterface
$collection = new RouteCollection(); if (!is_array($resource)) { return $collection;
-
CmsRouteLoader
supports: bool
* @var RoutingUtilInterface
return 'chameleon' === $type;
-
RedirectRequiredException
__construct
* @var string
$this->url = $url; $this->permanent = $permanent; parent::__construct('redirect required');
-
RedirectRequiredException
getUrl
* @var bool
return $this->url;
-
RedirectRequiredException
isPermanent
* @param string $url * @param bool $permanent
return $this->permanent;
-
ChameleonSystemCmsStringUtilitiesExtension
load
* @return void
$loader = new XMLFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('services.xml');
-
TPkgCmsStringUtilities_CleanPHPCode
stripComments
* @param string $code * @return string
$newStr = ''; $commentTokens = array(T_COMMENT); if (defined('T_DOC_COMMENT')) { $commentTokens[] = T_DOC_COMMENT; // PHP 5
-
TPkgCmsStringUtilities_HTML
convertEntitiesWithBlacklist
* this is a simple implementation of htmlentities, but with one additional option: you can provide a blacklist of characters, that won't be converted. * This is sometimes useful, for example when you want to exclude umlauts from the convertion. * * @param string $string * @param array $blacklist * * @return string
/* * The number of arguments for get_html_translation_table is correct, PHPStorm stub is not (third argument was * added in PHP 5.3.4). * If you read this comment and PHPStorm does not complain about the method call, remove the comment. */ $list = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT, 'UTF-8'); foreach ($blacklist as $item) { unset($list[$item]);
-
TPkgCmsStringUtilities_iOSMailURLEncoder
encode
* @param string $source * * @return string
return preg_replace_callback( '/(<img [^>]*?src=["\'])(.*?)(["\'])/', function ($matches) { return $matches[1].str_replace('=', '&#61;', $matches[2]).$matches[3];
-
TPkgCmsStringUtilities_ReadConfig
__construct
* @var string
$this->sConfig = $sString; $this->aConfig = $this->convertToArray($sString);
-
TPkgCmsStringUtilities_ReadConfig
getConfigValue
* @var array|null
if (true === isset($this->aConfig[$sKey])) { return $this->aConfig[$sKey];
-
TPkgCmsStringUtilities_ReadConfig
getConfigArray
* config params are separated by \n. Key from value by "=". * * @param string $sString
return $this->aConfig;
-
TPkgCmsStringUtilities_VariableInjection
replace
* used for some methods to pass internal data in callback methods. * * @var array
if ('' === $sString) { return $sString;
-
TPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloads
replace
* replaces custom var or cms text blocks in the text * These variables in the text must have the following format: [{name:format}] * "format" ist either string, date, or number. It is possible to specify the number of decimals * used when formating a number: [{variable:number:decimalplaces}] * example [{costs:number:2}]. * * {@inheritDoc}
if (!empty($sString)) { $aMatches = $this->getMatches($sString); foreach ($aMatches as $sMatch) { $sDownloadLink = $this->getDownloadLinkForVariable($sMatch); $sString = str_replace($sMatch, $sDownloadLink, $sString);
-
TPkgCmsStringUtilities_HTMLTest
testUnchanged
@var TPkgCmsStringUtilities_HTML
$input = 'abcABC'; $this->assertEquals('abcABC', $this->util->convertEntitiesWithBlacklist($input));
-
TPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloadsTest
setUp: void
* @var TPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloads
$this->oPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloads = new TPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloads(); $this->getMatches = new ReflectionMethod('TPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloads', 'getMatches'); $this->getMatches->setAccessible(true);
-
TPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloadsTest
TearDown: void
@var ReflectionMethod
$this->oPkgCmsStringUtilities_VariableInjection_WYSIWYGDownloads = null;
-
ArrayUtilityService
equal
* return true if two arrays are equal. * * @param array $array1 * @param array $array2 * * @return bool
if (count($array1) !== count($array2)) { return false;
-
UrlUtilityService
addParameterToUrl
* {@inheritDoc}
$urlParts = parse_url($url); $queryParameterString = isset($urlParts['query']) ? $urlParts['query'] : ''; $queryParameter = array(); parse_str($queryParameterString, $queryParameter); $queryParameter = array_merge_recursive($queryParameter, $parameter); $urlParts['query'] = http_build_query($queryParameter); return $this->httpBuildUr($urlParts);
-
ArrayUtilityServiceTest
it_should_be_able_to_determine_if_two_arrays_are_equal
* @var ArrayUtilityService
$this->given_two_arrays($array1, $array2); $this->given_an_instance_of_the_array_service(); $this->when_we_call_equal(); $this->then_we_expect_to_get($expectedResult, $compareName);
-
ArrayUtilityServiceTest
dataProviderArrayEqual
* @test * @dataProvider dataProviderArrayEqual * * @param $compareName * @param $array1 * @param $array2 * @param $expectedResult * * @internal param $expectedDiff
return array( array( 'empty with empty', array(), array(), true, ), array( 'empty with array', array(), array('foo' => 'bar'), false, ), array( 'empty with complex array', array(), array('foo' => 'bar', 'test', 'subarray' => array('foo', 'bar' => 'foobar')), false, ), array( 'two arrays with mixed keys', array('foo', 'bar' => 'foobar', 'inboth', 'inbotharray' => array('foo')), array('foo2', 'bar' => 'foobar2', 'inboth', 'inbotharray' => array('foo')), false, ), array( 'two equal complex arrays with mixed keys', array('foo', 'bar' => 'foobar', 'inboth', 'inbotharray' => array('foo', 'subsub' => 'somevalue', 'subsubarray' => array('foo' => 'bar'))), array('bar' => 'foobar', 'foo', 'inbotharray' => array('subsub' => 'somevalue', 'foo', 'subsubarray' => array('foo' => 'bar')), 'inboth'), true, ), );
-
TPkgCmsStringUtilities_iOSMailURLEncoderTest
it_leaves_normal_urls_alone
* @var \TPkgCmsStringUtilities_iOSMailURLEncoder
$source = 'foo http://bar.bz?foo=bar baz'; $this->assertEquals($source, $this->util->encode($source));
-
TPkgCmsStringUtilities_iOSMailURLEncoderTest
it_fixes_image_urls
* @test
$source = 'foo <img src="http://bar.bz?foo=bar" /> bar'; $expected = 'foo <img src="http://bar.bz?foo&#61;bar" /> bar'; $this->assertEquals($expected, $this->util->encode($source));
-
TPkgCmsStringUtilities_iOSMailURLEncoderTest
it_fixes_image_urls_with_single_quotes
* @test
$source = "foo <img src='http://bar.bz?foo=bar' /> bar"; $expected = "foo <img src='http://bar.bz?foo&#61;bar' /> bar"; $this->assertEquals($expected, $this->util->encode($source));
-
TPkgCmsStringUtilities_iOSMailURLEncoderTest
it_fixes_multiple_parameters
* @test
$source = 'foo <img src="http://bar.bz?foo=bar&bar=baz" /> bar'; $expected = 'foo <img src="http://bar.bz?foo&#61;bar&bar&#61;baz" /> bar'; $this->assertEquals($expected, $this->util->encode($source));
-
TPkgCmsStringUtilities_iOSMailURLEncoderTest
it_fixes_multiple_tags
* @test
$source = 'foo <img src="http://bar.bz?foo=bar" /> bar <img src="http://bar.bz?foo=baz" />'; $expected = 'foo <img src="http://bar.bz?foo&#61;bar" /> bar <img src="http://bar.bz?foo&#61;baz" />'; $this->assertEquals($expected, $this->util->encode($source));
-
TPkgCmsStringUtilities_iOSMailURLEncoderTest
it_leaves_anchors_alone
* @test
$source = 'foo <img src="http://bar.bz?foo=bar" /> bar <a href="http://bar.bz?foo=baz" />'; $expected = 'foo <img src="http://bar.bz?foo&#61;bar" /> bar <a href="http://bar.bz?foo=baz" />'; $this->assertEquals($expected, $this->util->encode($source));
-
UrlUtilityServiceTest
it_should_add_parameters_to_a_url
* @var UrlUtilityService
$this->given_the_url($url); $this->given_the_parameters($parameter); $this->given_an_instance_of_the_service(); $this->when_we_call_addParameterToUrl(); $this->then_we_expect_an_url_matching($expectedUrl);
-
UrlUtilityServiceTest
dataProviderAddParameterToUrl
* @test * @dataProvider dataProviderAddParameterToUrl * * @param $url * @param $parameter * @param $expectedUrl
return array( array( 'http://suer:password@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar#anchor', array('param2' => array('newparam' => 'value')), 'http://suer:password@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar&'.urlencode('param2[newparam]').'=value#anchor', ), array( '//suer:password@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar#anchor', array('param2' => array('newparam' => 'value')), '//suer:password@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar&'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://:password@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar#anchor', array('param2' => array('newparam' => 'value')), 'http://:password@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar&'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://suer@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar#anchor', array('param2' => array('newparam' => 'value')), 'http://suer@www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar&'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar#anchor', array('param2' => array('newparam' => 'value')), 'http://www.foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar&'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar#anchor', array('param2' => array('newparam' => 'value')), 'http://foo.bar/my/path?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar&'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://foo.bar/?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar#anchor', array('param2' => array('newparam' => 'value')), 'http://foo.bar/?parameter1=foo&'.urlencode('param2[one]').'=foo&'.urlencode('param2[two]').'=bar&'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://suer:password@www.foo.bar/my/path#anchor', array('param2' => array('newparam' => 'value')), 'http://suer:password@www.foo.bar/my/path?'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://suer:password@www.foo.bar/my/path?#anchor', array('param2' => array('newparam' => 'value')), 'http://suer:password@www.foo.bar/my/path?'.urlencode('param2[newparam]').'=value#anchor', ), array( 'http://suer:password@www.foo.bar/my/path', array('param2' => array('newparam' => 'value')), 'http://suer:password@www.foo.bar/my/path?'.urlencode('param2[newparam]').'=value', ), array( '/my/path', array('param2' => array('newparam' => 'value')), '/my/path?'.urlencode('param2[newparam]').'=value', ), );
-
ChameleonSystemCmsTextBlockExtension
load
* @return void
$loader = new XMLFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('services.xml');
-
TPkgCmsTextBlockMapper_GetText
GetRequirements
* {@inheritdoc}
$oRequirements->NeedsSourceObject('name', 'string'); // the system name of the text-object to load $oRequirements->NeedsSourceObject('maxwidth', 'int', 600); // the system name of the text-object to load
-
TPkgCmsTextBlockMapper_GetText
Accept
* {@inheritdoc}
$sSystemName = $oVisitor->GetSourceObject('name'); $oBlock = TdbPkgCmsTextBlock::GetInstanceFromSystemName($sSystemName); if ($oBlock) { if ($bCachingEnabled) { $oCacheTriggerManager->addTrigger($oBlock->table, $oBlock->id);
-
TPkgCmsTextBlock
Render
* Renders a text block. * You can set width of text block by adding "iWidth" to $aCallTimeVars.(default width 600). * * @return string * * @param string $sViewName * @param string $sSubtype * @param int[] $aCallTimeVars
$oView = new TViewParser(); $iWidth = 600; if (array_key_exists('iWidth', $aCallTimeVars)) { $iWidth = $aCallTimeVars['iWidth'];
-
TPkgCmsTextBlockCmsPortal
GetPortalCmsTextBlockArray
* Get array with rendered text blocks from portal. * * @param int $iWidth * * @return array
$key = array('class' => __CLASS__, 'method' => 'GetPortalCmsTextBlockArray', 'id' => $this->id, 'width' => $iWidth); $cache = \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.cache'); $cacheKey = $cache->getKey($key); $aTextBlockArray = $cache->get($cacheKey); if (null === $aTextBlockArray) { $oTextBlockList = $this->GetPortalCmsTextBlockList(); $aTextBlockArray = $oTextBlockList->GetRenderedTextBlockArray($iWidth); $trigger = array(array('table' => 'pkg_cms_text_block', 'id' => null)); $cache->set($cacheKey, $aTextBlockArray, $trigger);
-
TPkgCmsTextBlockCmsPortal
GetPortalCmsTextBlockText
*Get all text blocks belong to portal. * * @return TdbPkgCmsTextBlockList
$sTextBlockText = $this->GetFromInternalCache(sha1($this->id.'_PortalTextBlockText'.$iWidth.$sSystemName)); if (is_null($sTextBlockText)) { // try to load from cache $oTextBlock = TdbPkgCmsTextBlock::GetInstanceFromSystemName($sSystemName, $this->id); if ($oTextBlock) { $sTextBlockText = $oTextBlock->Render('standard', 'Customer', array('iWidth' => $iWidth));
-
TPkgCmsTextBlockList
GetRenderedTextBlockArray
* Get list of all text block object that belong to the given portal. * * @static * * @param string $sPortalId * * @return TdbPkgCmsTextBlockList
$aPortalTextBlockArray = $this->RenderBlockListArrayItems($iWidth); return $aPortalTextBlockArray;
-
MTPkgCmsTextBlockCore
Execute
* loads and renders a wysiwyg text block from pkg_cms_text_block based * usable for static text blocks like footer bars that is placed on every page. /*
parent::Execute(); $this->data['oPkgCmsTextBlock'] = $this->LoadTextBlock(); return $this->data;
-
MTPkgCmsTextBlockCore
_AllowCache
* defines the identifier key of the text block that will be rendered * you need to set this in your extension or in the module config as parameter "sTextBlockkey". * * @var string
return true;
-
MTPkgCmsTextBlockCore
_GetCacheTableInfos
* holds the loaded text block db object. * * @var TdbPkgCmsTextBlock
$aTrigger = parent::_GetCacheTableInfos(); if (!is_array($aTrigger)) { $aTrigger = array();
-
TextBlockLookup
getText
* {@inheritdoc}
return $this->getRenderedText($systemName, $textContainerWidth);
-
TextBlockLookup
getRenderedText: string
* @param string $systemName * * @return string
$textBlock = $this->getTextBlock($systemName); if (null === $textBlock) { return '';
-
TextBlockLookup
getHeadline
* @param string $systemName * * @return null|TdbPkgCmsTextBlock
$textBlock = $this->getTextBlock($systemName); return $this->getHeadlineFromTextBlock($textBlock);
-
TextBlockLookup
getTextBlock
* @deprecated since version 7.0.13 use getRenderedTextFromTextBlock instead * * @param TdbPkgCmsTextBlock $textBlock * @param int $textContainerWidth * * @return string
return TdbPkgCmsTextBlock::GetInstanceFromSystemName($systemName);
-
TextBlockLookup
getTextFromTextBlock
* @deprecated since version 7.0.13 use getHeadlineFromTextBlock instead * * @param TdbPkgCmsTextBlock $textBlock * * @return string
return $this->getRenderedTextFromTextBlock($textBlock, $textContainerWidth);
-
TPkgCmsTextfieldImage
GetRequirements
* {@inheritdoc}
$oRequirements->NeedsSourceObject('aTagProperties', 'array', array()); $oRequirements->NeedsSourceObject('oImage', 'TCMSImage', null); $oRequirements->NeedsSourceObject('sFullImageURL', 'string', null, true); $oRequirements->NeedsSourceObject('sImageGroupName', 'string', null, true); $oRequirements->NeedsSourceObject('iThumbnailSizeThreshold', 'integer', 5, true); $oRequirements->NeedsSourceObject('aEffects', 'array', array(), true); $oRequirements->NeedsSourceObject('isForceThumbnailGenerationOnFullSizeImagesEnabled', 'bool', false, false);
-
TPkgCmsTextfieldImage
Accept
* {@inheritdoc}
/** * @var $oImage TCMSImage */ $oImage = $oVisitor->GetSourceObject('oImage'); $aTagProperties = $oVisitor->GetSourceObject('aTagProperties'); $oVisitor->SetMappedValue('aTagProperties', $aTagProperties); $sFullImageURL = $oVisitor->GetSourceObject('sFullImageURL'); $oVisitor->SetMappedValue('sFullImageURL', $sFullImageURL); $sImageGroupName = $oVisitor->GetSourceObject('sImageGroupName'); $oVisitor->SetMappedValue('sImageGroupName', $sImageGroupName); /** * if the size difference between the thumbnail and the original image is smaller than x pixel (5 by default) * the extra link for the original image should not be rendered. */ $iThumbnailSizeThreshold = $oVisitor->GetSourceObject('iThumbnailSizeThreshold'); // check if full size image link (lightbox) is needed. // if the thumbnail has the full size we don`t need a big image $bFullsizeImageBiggerThanThumbnail = true; $iWidth = 0; $iHeight = 0; if (isset($oImage->aData) && isset($oImage->aData['height'])) { $iHeight = $oImage->aData['height'];
-
TCMSTextFieldEndPoint
__construct
* manages a wysiwyxg textfield. /*
$this->content = $content;
-
TCMSTextFieldEndPoint
GetEnclosedMediaIDs
* if the size difference between the thumbnail and the original image is smaller than 5 pixel * the extra link for the original image will not be rendered. * * @var int
if (0 == count($this->aEnclosedMediaIDs)) { $this->_ReplaceImages($this->content);
-
TCMSTextFieldEndPoint
SetMaxImageZoomDimensions
* the wysiwyg text content. * * @var string - default = null
$this->iMaxZoomImageWidth = $width; $this->iMaxZoomImageHeight = $height;
-
TCMSTextFieldEndPoint
GetText
* max width of a thumbnail inside the wysiwyg text content block * forces thumbnail creation to this value if image is to big. * * @var int
$this->sImageGroupName = $sImageGroupName; $this->iMaxThumbWidth = $thumbnailWidth; $this->aEffects = $aEffects; $content = $this->content; $content = $this->replaceFrontController($content); $content = $this->_AddCMSClassToLinkedImages($content); $content = $this->_ReplaceImages($content); $content = $this->_AddCMSClassToExternalLinks($content); $content = $this->_ReplaceLinks($content); $content = $this->_ReplaceEMailLinks($content); $content = $this->_ReplaceDownloadLinks($content); $content = $this->_ReplaceInvalidDivs($content); $content = $this->_ReplaceEmptyAligns($content); $content = $this->_RemoveEmptyTags($content); $content = $this->_AddCMSClassToAnchors($content); $content = $this->_ReplaceCmsTextBlockInString($content, $thumbnailWidth); if (false === $this->isScriptTagAllowed()) { $content = $this->_RemoveScriptTags($content);
-
TCMSTextFieldEndPoint
GetTextForExternalUsage
* CSS rel tag name for lightbox/thickbox groups. * * @var string
$bOldState = $this->bForceFullURLs; $this->bForceFullURLs = true; $this->iMaxThumbWidth = $thumbnailWidth; $content = $this->replaceFrontController($this->content); $content = $this->_ReplaceImages($content, $bClearThickBox); $content = $this->_ReplaceLinks($content); $content = $this->_ReplaceDownloadLinks($content); $content = $this->_ReplaceInvalidDivs($content); $content = $this->_ReplaceEmptyAligns($content); $content = $this->_RemoveEmptyTags($content); $content = $this->_ReplaceCmsTextBlockInString($content, $thumbnailWidth); if (true === $bClearScriptTags || false === $this->isScriptTagAllowed()) { $content = $this->_RemoveScriptTags($content);
-
TCMSTextFieldEndPoint
IsEmpty
* array of image effects * See method TCMSImage::GetThumbnailPointer for available effects. * * @var array
return empty($this->content) || '<div>&nbsp;</div>' === $this->content || '<p>&nbsp;</p>' === $this->content;
-
TCMSTextFieldEndPoint
GetPlainTextWordSave
* max width of zoom images (thickbox/lightbox) * if full image is bigger a 2nd thumbnail will be generated. * * @var int
$content = html_entity_decode(strip_tags(trim($this->_ReplaceCmsTextBlockInString($this->content))), null, 'UTF-8'); //$content = preg_replace('/\s+/', ' ', $content); // remove double whitespaces // but don't remove all CR's! while (strpos($content, ' ')) { $content = str_replace(' ', ' ', $content);
-
TCMSTextFieldEndPoint
_callback_cmstextfield_downloadparser
* max height of zoom images (thickbox/lightbox) * if full image is bigger a 2nd thumbnail will be generated. * * @var int
$sResult = ''; if ('wysiwyg_cmsdownloaditem' == $aMatch[1]) { $sResult = $this->DownloadParserVersion2($aMatch);
-
TCMSTextFieldEndPoint
_callback_cmstextfield_emailparser
* array of cms_media object ids that are enclosed in the text. * * @var array
// extranet title... $aLinkAttributes = $this->getLinkAttributes($aMatch[0]); $sEmail = $aMatch[2]; $sEmailName = $aMatch[4]; $sEmailNameTmp = trim($sEmailName); if (0 == strcasecmp($sEmail, $sEmailNameTmp)) { return TTools::EncodeEMail($sEmail, null, $aLinkAttributes);
-
TCMSTextFieldEndPointTest
setUp: void
* @var TCMSTextFieldEndPoint
$this->oCmsTextFieldEndPoint = new TCMSTextFieldEndPoint(); $this->_GetDownloadSpans = new ReflectionMethod('TCMSTextFieldEndPoint', '_GetDownloadSpans'); $this->_GetDownloadSpans->setAccessible(true);
-
TCMSTextFieldEndPointTest
TearDown: void
@var ReflectionMethod
$this->oCmsTextFieldEndPoint = null;
-
MTPkgComment
GetHtmlHeadIncludes
* used to show and write article reviews. /*
$aIncludes = parent::GetHtmlHeadIncludes(); $aIncludes[] = " <script type=\"text/javascript\"> $(document).ready(function(){ $('#comment_preview_button').toggle(function(){ $('#comment_preview').show(); $('#comment_form').hide(); $('#comment_preview .text').html($('#comment_form .commenttextarea').val()); $('#comment_preview .title').html($('#comment_form .title').val()); $(this).html('".TGlobal::OutHtml(TGlobal::Translate('chameleon_system_comment.action.edit'))."');
-
TPkgComment
IsActiveComment
* @var string[]
$bIsActiveComment = false; $oGlobal = TGlobal::instance(); $iActiveCommentId = $oGlobal->GetUserData(TdbPkgComment::URL_NAME_ID); if ($iActiveCommentId == $this->id) { $bIsActiveComment = true;
-
TPkgComment
GetActionModeForActiveComment
* Returns the active comment. * * @static TdbPkgComment * * @return TdbPkgComment|null
$oGlobal = TGlobal::instance(); $sActionMode = false; if ($this->IsActiveComment()) { $sAction = $oGlobal->GetUserData(self::URL_ACTION_PARAMETER); if (!empty($sAction) && in_array($sAction, $this->aActionModes)) { $sActionMode = $sAction;
-
TPkgComment
GetURLToReComment
* return TdbPkgComment - or a child of that class (if the fields class, class_subtype and class_type have been set). * * @param string $sId * @param bool $bReload * * @return TdbPkgComment|null
$url = false; if ($this->ReCommentIsAllowed()) { $aUrlData = $this->GetCommentURLData($iCommentPage); $aUrlData[self::URL_ACTION_PARAMETER] = $this->aActionModes[1]; $activePageService = $this->getActivePageService(); if (true === $bUseFullURL) { $url = $activePageService->getLinkToActivePageAbsolute($aUrlData, array('module_fnc'));
-
TPkgComment
GetURLToEditComment
* Checks if the comment is active comment. * * @return bool
$url = false; if ($this->ChangingCommentIsAllowed()) { $aUrlData = $this->GetCommentURLData($iCommentPage); $aUrlData[self::URL_ACTION_PARAMETER] = $this->aActionModes[0]; $activePageService = $this->getActivePageService(); if (true === $bUseFullURL) { $url = $activePageService->getLinkToActivePageAbsolute($aUrlData, array('module_fnc'));
-
TPkgComment
GetURLToDeleteComment
* Function returns the action for the active comment. * If no action was defined function returns re comment. This is needed for compatibility to older version * which not know the url parameter. * * @return string|bool
$sUrl = false; if ($this->ChangingCommentIsAllowed()) { $aUrlData = $this->GetCommentURLData($iCommentPage); $sUrl = TTools::GetExecuteMethodOnCurrentModuleURL('DeleteComment', $aUrlData, $bUseFullURL);
-
TPkgComment
GetURLToReportComment
* Returns link to re comment a comment. * Returns a valid url only if user is logged in or guest can write comments was set to true in module config and * comment was not marked as deleted. * * note: You can use this function only if the view was rendered from module MTPkgCommentCore * * @param bool|int $iCommentPage * @param bool $bUseFullURL * * @return bool|string
$aUrlData = array(); $aUrlData['commentid'] = $this->id; if (is_numeric($iCommentPage)) { $aUrlData[TGlobal::Translate(self::URL_NAME_ID_PAGE)] = $iCommentPage;
-
TPkgComment
ChangingCommentIsAllowed
* Returns url to edit the comment. Returns a valid url only if user is logged in * and comment was written from logged in user else returns false. * * @param bool|int $iCommentPage * @param bool $bUseFullURL * * @return bool|string
$bEditCommentIsAllowed = true; $oUser = TdbDataExtranetUser::GetInstance(); if ($oUser->IsLoggedIn()) { if (strval($oUser->id) != strval($this->fieldDataExtranetUserId)) { $bEditCommentIsAllowed = false;
-
TPkgComment
GetChildComments
* Returns the url to delete the comment. Returns a valid url only if user is logged in * and comment was written from logged in user else returns false. * * note: You can use this function only if the view was rendered from module MTPkgCommentCore. * * @param bool $iCommentPage * @param bool $bUseFullURL * * @return bool|string
$oList = $this->GetFromInternalCache('CommentChildList'); if (null === $oList) { $sQuery = "SELECT * FROM `pkg_comment` WHERE `pkg_comment`.`item_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->fieldItemId)."' AND `pkg_comment_id`='".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."' AND `pkg_comment_type_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->fieldPkgCommentTypeId)."' ORDER BY `pkg_comment`.`created_timestamp` DESC"; if (null === $iLanguageId) { $iLanguageId = self::getLanguageService()->getActiveLanguageId();
-
TPkgComment
Render
* Returns the url to report the comment. * * @param bool $iCommentPage * @param bool $bUseFullURL * * @return string
$oView = new TViewParser(); $oView = $this->GetAdditionalViewVariables($oView, $sViewName, $aCallTimeVars); $oView->AddVar('aCallTimeVars', $aCallTimeVars); return $oView->RenderObjectPackageView($sViewName, self::VIEW_PATH, 'Customer');
-
TPkgComment
GetCommentedObject
* Check if its allowed to re comment the comment. * Its allowed if user is logged in or guest can write comments was set to true in module config * and comment was not marked as deleted. * * @return bool
$oCommentedObject = $this->GetFromInternalCache('oCommentedObject'); if (is_null($oCommentedObject)) { $query = "SELECT `cms_tbl_conf`.`name` FROM `cms_tbl_conf` INNER JOIN `pkg_comment_type` ON `cms_tbl_conf`.`id` = `pkg_comment_type`.`cms_tbl_conf_id` WHERE `pkg_comment_type`.`id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->fieldPkgCommentTypeId)."' "; if ($aTable = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) { $sTableName = $aTable['name']; $sObjectName = TCMSTableToClass::GetClassName(TCMSTableToClass::PREFIX_CLASS, $sTableName); $oCommentedObject = call_user_func(array($sObjectName, 'GetNewInstance')); if (false == $oCommentedObject->Load($this->fieldItemId)) { $oCommentedObject = false;
-
TPkgCommentList
GetNrOfComments
* ;. /*
return $this->Length();
-
TPkgCommentModuleConfig
AllowGuestComments
* @var int|string * @psalm-var positive-int|0
return $this->fieldGuestCommentAllowed;
-
TPkgCommentModuleConfig
SetActiveItem
* @var int * @psalm-var positive-int
$this->oActiveItem = $oActiveItem;
-
TPkgCommentModuleConfig
GetFieldPkgCommentType
* @var float|int * @psalm-var positive-int|0
$oItem = $this->GetFromInternalCache('oLookuppkg_comment_type_id'); if (is_null($oItem)) { $oItem = TdbPkgCommentType::GetNewInstance(); /** @var $oItem TdbPkgCommentType */ $oItem->SetLanguage($this->iLanguageId); $oItem = $oItem->GetInstance($this->fieldPkgCommentTypeId); if (!array_key_exists('id', $oItem->sqlData) && !empty($oItem->sqlData['id'])) { $oItem = null;
-
TPkgCommentModuleConfig
GetComments
* @var int * @psalm-var positive-int|0
$oPkgCommentType = $this->GetFieldPkgCommentType(); $oActiveCommentType = $this->GetActiveItem(); $sKey = $this->getCommentInternalCacheKey($oActiveCommentType, $oPkgCommentType); $oCommentList = $this->GetFromInternalCache($sKey); if (is_null($oCommentList)) { if (!is_null($oActiveCommentType) && $this->AllowShowComments()) { $oCommentList = $this->GetListForItemTable($oActiveCommentType->id, $oPkgCommentType->id); $this->iCommentNr = $oCommentList->GetNrOfComments(); if ($this->iPageSize > 0) { /** @psalm-suppress InvalidPropertyAssignmentValue */ $this->iMaxPage = ceil($oCommentList->Length() / $this->iPageSize);
-
TPkgCommentModuleConfig
GetListForItemTable
* @var null|mixed
$sQuery = "SELECT * FROM `pkg_comment` WHERE `pkg_comment`.`item_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($sItemId)."' AND `pkg_comment`.`pkg_comment_type_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($sTypeId)."' AND `pkg_comment_id`='' "; if (!$this->fieldShowReportedComments) { $sQuery .= "AND `pkg_comment`.`mark_as_reported` = '0'";
-
TPkgCommentModuleConfig
AllowShowComments
* allow users that are not signed in to comment. * * @return bool
$bAllowShowComments = false; $oUser = TdbDataExtranetUser::GetInstance(); if ($this->fieldGuestCanSeeComments) { $bAllowShowComments = true;
-
TPkgCommentModuleConfig
GetActiveItem
* @param mixed $oActiveItem * @return void
if (is_null($this->oActiveItem)) { $oPkgCommentType = $this->GetFieldPkgCommentType(); $this->oActiveItem = $oPkgCommentType->GetActiveItem();
-
TPkgCommentModuleConfig
Render
* Returns the comment type configured in the module config. * * @return TdbPkgCommentType|null
$oView = new TViewParser(); $this->SetPage(); if (array_key_exists('oActiveCommentItem', $aCallTimeVars)) { $this->oActiveItem = $aCallTimeVars['oActiveCommentItem'];
-
TPkgCommentModuleConfig
GetCacheTrigger
@var $oItem TdbPkgCommentType
$aClearCacheParameter = array(); $oCommentList = $this->GetComments(); while ($oComment = $oCommentList->Next()) { $aClearCacheParameter[] = array('table' => 'pkg_comment', 'id' => $oComment->id); $oChildCommentList = $oComment->GetChildComments(); while ($oChildComment = $oChildCommentList->Next()) { $aClearCacheParameter[] = array('table' => 'pkg_comment', 'id' => $oChildComment->id);
-
TCMSSmartURLHandler_PkgCommentReport
GetPageDef
@var $oPortal TdbCmsPortal
$iPageId = false; $oURLData = TCMSSmartURLData::GetActive(); $sPath = $oURLData->sRelativeURL; if ('/' == substr($sPath, 0, 1)) { $sPath = substr($sPath, 1);
-
TPkgCommentType
GetInstance
* ;. /*
$oPkgCommentType = TdbPkgCommentType::GetNewInstance(); $oInstance = false; if ($oPkgCommentType->Load($sPkgCommentTypeId)) { $sClassName = $oPkgCommentType->fieldClassName; $oInstance = new $sClassName(); $oInstance->LoadFromRow($oPkgCommentType->sqlData);
-
TPkgCommentType
GetActiveItem
* Get instance for type. * * @param string|int $sPkgCommentTypeId * * @return TdbPkgCommentType|bool
return null;
-
TCMSTableEditor_PkgComment
GetObjectShortInfo
* ;. /*
$oRecordData = parent::GetObjectShortInfo($postData); if (array_key_exists('item_id', $postData)) { $oRecordData->fieldItemId = $postData['item_id'];
-
MTPkgCommentCore
Init
* @var TdbPkgCommentModuleConfig
parent::Init(); $this->GetConfig(); $this->GetActiveComment();
-
MTPkgCommentCore
SetModuleConfig
* @var TCMSRecord
$this->oModConf = $oModuleConfiguration;
-
MTPkgCommentCore
SetActiveCommentTypeItem
* @var TdbPkgComment|null
$this->oActiveCommentTypeItem = $oActiveCommentTypeItem;
-
MTPkgCommentCore
SetSuppressRedirectAfterAction
* @var bool
$this->bSuppressRedirectAfterAction = $bSuppressRedirectAfterAction;
-
MTPkgCommentCore
Execute
* Initialize the module * Get module config and active comment.
parent::Execute(); $sWhatToShow = $this->aModuleConfig['view']; $this->data['oModconf'] = $this->GetConfig(); $this->data['bAllowGuestComments'] = $this->data['oModconf']->AllowGuestComments(); if ('report' == $sWhatToShow) { $this->ExecuteReportView();
-