OS : Linux
PHP Version : 7.4.33
Software : Apache/2.4.6 (CentOS) PHP/7.4.33
Information System : uniqid = uniqid();
$this->typeObj = $typeObj;
}
private function accordionItem($index, $value, $opened = false) {
ob_start();
if (empty($value['contentType'])) {
$value['contentType'] = 'content';
}
$arrowClass = '';
$showClass = '';
$typeObj = $this->typeObj;
$icons = $typeObj->getOptionValue('yrm-accordion-icons');
list ($openClass, $closeClass) = explode('_', $icons);
if ($opened) {
list ($closeClass, $openClass) = explode('_', $icons);
$arrowClass = '';
$showClass = 'yrm-show';
}
$contentType = $value['contentType'];
$content = do_shortcode($value['content']);
if ($contentType == 'post' && !yrm_is_free()) {
$content = ReadMoreAdminHelperPro::getPostContentById($value['post']);
}
else if($contentType == 'youtube') {
$height = 'auto';
if (!empty($value['iframeHeight'])) {
$height = $value['iframeHeight'];
}
$content .= "";
}
$iconPosition = $typeObj->getOptionValue('yrm-accordion-icons-position');
$style = "style='float: left;'";
if ($iconPosition === 'right') {
$style = "style='float: right'";
}
else if ($iconPosition === 'hide') {
$style = "display: none";
}
$icon = '';
$allowedTag = ReadMoreAdminHelper::getAllowedTags();
?>
typeObj;
$names = array(
'yrm-accordion-activate-event',
'yrm-accordion-keep-extended',
'yrm-accordion-toggle-sound',
'yrm-accordion-animate-easings',
'yrm-accordion-animate-duration',
'yrm-accordion-icons',
'yrm-accordion-scroll-to-active-item'
);
$options = array();
foreach ($names as $name) {
$options[$name] = $typeObj->getOptionValue($name);
}
$options['sound-url'] = $typeObj->getOptionValue('yrm-accordion-click-sound');
return $options;
}
private function enqueScripts() {
wp_register_style('yrmaccordion.css', YRM_CSS_URL.'accordion/accordion.css');
wp_enqueue_style('yrmaccordion.css');
$accordionOptions = $this->getRenderOptions();
wp_register_script('YrmAccordion.js', YRM_JAVASCRIPT.'accordion/YrmAccordion.js');
wp_localize_script('YrmAccordion.js', 'YRM_ACCORDION_OPTIONS', $accordionOptions);
wp_enqueue_script('YrmAccordion.js');
}
private function getStyles() {
$typeObj = $this->typeObj;
$id = $typeObj->getId();
$enableMaxHeight = $typeObj->getOptionValue('yrm-accordion-enable-max-height');
$maxHeight = $typeObj->getOptionValue('yrm-accordion-max-height');
$cursor = $typeObj->getOptionValue('yrm-accordion-cursor');
$content = '';
if (!empty($enableMaxHeight)) {
$content .= "";
}
if ($cursor) {
$content .= "";
}
return $content;
}
public function __toString() {
$typeObj = $this->typeObj;
$mode = $typeObj->getOptionValue('yrm-accordion-mode');
$id = $typeObj->getId();
$this->enqueScripts();
$accordionOptions = $this->getRenderOptions();
$allowedTag = ReadMoreAdminHelper::getAllowedTags();
ob_start();
?>
getOptionValue('yrm-accordion') as $index => $value): ?>
accordionItem($index, $value, $opened), $allowedTag); ?>
".$this->typeObj->getOptionValue('yrm-accordion-custom-css')."";
$content .= "";
$obj = $this->typeObj;
$content .= apply_filters("yrm_accordion_advanced_styles", "", $obj);
$content .= "";
$content .= $this->getStyles();
return $content;
}
}