@@ 69-86 (lines=18) @@ | ||
66 | $form->loadDataFrom($fields); |
|
67 | ||
68 | // Copied from {@link UserDefinedFormController} |
|
69 | if ($this->Content && $form && !$this->config()->disable_form_content_shortcode) { |
|
70 | $hasLocation = stristr($this->Content, '$UserDefinedForm'); |
|
71 | if ($hasLocation) { |
|
72 | /** @see Requirements_Backend::escapeReplacement */ |
|
73 | $formEscapedForRegex = addcslashes($form->forTemplate(), '\\$'); |
|
74 | $content = preg_replace( |
|
75 | '/(<p[^>]*>)?\\$UserDefinedForm(<\\/p>)?/i', |
|
76 | $formEscapedForRegex, |
|
77 | $this->Content |
|
78 | ); |
|
79 | ||
80 | return $this->customise([ |
|
81 | 'Content' => DBField::create_field('HTMLText', $content), |
|
82 | 'Form' => '', |
|
83 | 'PartialLink' => $partial->getPartialLink() |
|
84 | ])->renderWith([static::class, Page::class]); |
|
85 | } |
|
86 | } |
|
87 | ||
88 | return $this->customise([ |
|
89 | 'Content' => DBField::create_field('HTMLText', $this->Content), |
|
@@ 143-160 (lines=18) @@ | ||
140 | $form->loadDataFrom($fields); |
|
141 | ||
142 | // Copied from {@link UserDefinedFormController} |
|
143 | if ($this->Content && $form && !$this->config()->disable_form_content_shortcode) { |
|
144 | $hasLocation = stristr($this->Content, '$UserDefinedForm'); |
|
145 | if ($hasLocation) { |
|
146 | /** @see Requirements_Backend::escapeReplacement */ |
|
147 | $formEscapedForRegex = addcslashes($form->forTemplate(), '\\$'); |
|
148 | $content = preg_replace( |
|
149 | '/(<p[^>]*>)?\\$UserDefinedForm(<\\/p>)?/i', |
|
150 | $formEscapedForRegex, |
|
151 | $this->Content |
|
152 | ); |
|
153 | ||
154 | return $this->customise([ |
|
155 | 'Content' => DBField::create_field('HTMLText', $content), |
|
156 | 'Form' => '', |
|
157 | 'PartialLink' => $partial->getPartialLink() |
|
158 | ])->renderWith([static::class, Page::class]); |
|
159 | } |
|
160 | } |
|
161 | ||
162 | return $this->customise([ |
|
163 | 'Content' => DBField::create_field('HTMLText', $this->Content), |