ChildNode = $childNode; } public function ParseContent() { $this->Marks = $this->Data->marks; $this->ChildNode->Parent = $this; return $this; } public function GetLinkData() { foreach($this->Marks as $currentMark) { if($currentMark->type == 'link') { if (!isset($currentMark->attrs->type) || $currentMark->attrs->type == '') { $href = Sanitizer::GetValueFromPath($currentMark, ['attrs', 'href']); if(is_object($href)) { $singleLineGenerator = new SingleLineGenerator($this->FormBuilder); $href = $singleLineGenerator->GetText($href); } return [ 'href' => $href, 'target' => $currentMark->attrs->target ]; } if($currentMark->attrs->type == 'EntryURL') return [ 'href' => (AllInOneForms()->GetLoader()->IsPR() ? IntegrationURL::PageURL('rednao_calculation_form_entries') : IntegrationURL::PageURL('rednao_entries_form')) . '&entryid=' . $this->FormBuilder->Entry->EntryId, 'target' => $currentMark->attrs->target ]; } } return null; } public function GetStyles() { $styles = ''; foreach ($this->Marks as $currentMark) { switch ($currentMark->type) { case 'strong': $styles .= 'font-weight:bold;'; break; case 'em': $styles .= 'font-style:italic;'; break; case 'color': $styles .= 'color:' . $currentMark->attrs->color . ';'; break; case 'fontsize': $styles .= 'font-size:' . $currentMark->attrs->size . ';'; break; case 'link': break; default: $styles = $styles . ''; } } return $styles; } protected function GetTemplateName() { return 'core/Managers/HTMLGenerator/HTMLParsers/Core/ParserWithMarks.twig'; } }