Skip to content

Commit

Permalink
Updated url fields to use the DCA picker
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Sep 7, 2020
1 parent 8925992 commit 79cd56b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 40 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"require":{
"php":">=5.5",
"contao/core-bundle":"^4.4"
"contao/core-bundle":"^4.4.2"
},
"require-dev": {
"contao/manager-plugin": "^2.0"
Expand Down
7 changes: 3 additions & 4 deletions src/Resources/contao/dca/tl_rocksolid_slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,9 @@
'rgxp' => 'url',
'decodeEntities' => true,
'maxlength' => 255,
'tl_class' => 'clr w50 wizard',
),
'wizard' => array(
array('MadeYourDay\\RockSolidSlider\\Slider', 'pagePickerWizard'),
'tl_class' => 'clr w50',
'dcaPicker' => true,
'addWizardClass' => false,
),
'sql' => "varchar(255) NOT NULL default ''",
),
Expand Down
35 changes: 0 additions & 35 deletions src/Slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,41 +145,6 @@ public function listSlides($arrRow)
return '<div class="tl_content_left">' . $arrRow['title'] . ' <span style="color:#999;padding-left:3px">' . $GLOBALS['TL_LANG']['tl_rocksolid_slide']['types'][$arrRow['type']] . '</span></div>';
}

/**
* Page picker wizard for url fields
*
* @param \DataContainer $dc Data container
* @return string Page picker button html code
*/
public function pagePickerWizard($dc) {
return ' <a'
. ' href="contao/page.php'
. '?do=' . \Input::get('do')
. '&amp;table=' . $dc->table
. '&amp;field=' . $dc->field
. '&amp;value=' . str_replace(array('{{link_url::', '}}'), '', $dc->value)
. '"'
. ' title="' . \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['pagepicker']) . '"'
. ' onclick="'
. 'Backend.getScrollOffset();'
. 'Backend.openModalSelector({'
. '\'width\':765,'
. '\'title\':' . \StringUtil::specialchars(json_encode($GLOBALS['TL_LANG']['MOD']['page'][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>';
}

/**
* Get all sliders and return them as array
*
Expand Down

0 comments on commit 79cd56b

Please sign in to comment.