| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup UnaBaseView UNA Base Representation Classes
- * @{
- */
- /**
- * Iframely integration.
- * @see BxDolEmbed
- */
- class BxBaseEmbedIframely extends BxDolEmbed
- {
- public function __construct ($aObject, $oTemplate)
- {
- parent::__construct ($aObject);
- if ($oTemplate)
- $this->_oTemplate = $oTemplate;
- else
- $this->_oTemplate = BxDolTemplate::getInstance();
- }
- public function getLinkHTML ($sLink, $sTitle = '', $sMaxWidth = '')
- {
- $aAttrs = array(
- 'title' => bx_html_attribute($sTitle),
- );
- // check for external link
- if (strncmp(BX_DOL_URL_ROOT, $sLink, strlen(BX_DOL_URL_ROOT)) !== 0) {
- $aAttrs['target'] = '_blank';
- if (getParam('sys_add_nofollow') == 'on')
- $aAttrs['rel'] = 'nofollow';
- }
- return $this->_oTemplate->parseHtmlByName('embed_iframely_link.html', array(
- 'link' => $sLink,
- 'title' => $sTitle,
- 'attrs' => bx_convert_array2attrs($aAttrs),
- 'width' => $sMaxWidth,
- ));
- }
- public function addJsCss ()
- {
- $sKey = getParam('sys_iframely_api_key');
- return $this->_oTemplate->parseHtmlByName('embed_iframely_integration.html', array(
- 'key' => $sKey,
- ));
- }
- }
- /** @} */
|