Browse code

Add missing pagePicker function

Benjamin Roth authored on11/12/2019 22:32:16
Showing1 changed files
... ...
@@ -35,7 +35,7 @@ $GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_link'] = [
35 35
   'eval' => array('rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'fieldType'=>'radio', 'tl_class'=>'clr wizard'),
36 36
   'wizard' => array
37 37
   (
38
-    array('tl_content', 'pagePicker')
38
+    array('tl_content_cookieconsent', 'pagePicker')
39 39
   ),
40 40
   'sql'=> "varchar(255) NOT NULL default ''"
41 41
 ];
... ...
@@ -48,3 +48,18 @@ $GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_services'] = [
48 48
   'eval' => array('multiple'=>true, 'tl_class' => 'clr'),
49 49
   'sql' => "blob NULL",
50 50
 ];
51
+
52
+class tl_content_cookieconsent extends Backend
53
+{
54
+  /**
55
+   * Return the link picker wizard
56
+   *
57
+   * @param \DataContainer $dc
58
+   *
59
+   * @return string
60
+   */
61
+  public function pagePicker(\DataContainer $dc)
62
+  {
63
+    return ' <a href="' . (($dc->value == '' || strpos($dc->value, '{{link_url::') !== false) ? 'contao/page.php' : 'contao/file.php') . '?do=' . \Input::get('do') . '&amp;table=' . $dc->table . '&amp;field=' . $dc->field . '&amp;value=' . rawurlencode(str_replace(array('{{link_url::', '}}'), '', $dc->value)) . '&amp;switch=1' . '" title="' . specialchars($GLOBALS['TL_LANG']['MSC']['pagepicker']) . '" onclick="Backend.getScrollOffset();Backend.openModalSelector({\'width\':768,\'title\':\'' . specialchars(str_replace("'", "\\'", $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['label'][0])) . '\',\'url\':this.href,\'id\':\'' . $dc->field . '\',\'tag\':\'ctrl_'. $dc->field . ((\Input::get('act') == 'editAll') ? '_' . $dc->id : '') . '\',\'self\':this});return false">' . \Image::getHtml('pickpage.gif', $GLOBALS['TL_LANG']['MSC']['pagepicker'], 'style="vertical-align:top;cursor:pointer"') . '</a>';
64
+  }
65
+}