Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

[solved] Removing Tab from SSMedia PopUp


Reply


2 Posts   419 Views

Avatar
Silverfish

Community Member, 59 Posts

26 December 2013 at 11:39pm

Hi there,

if you enter a media into the Html Editor, you can choose where you want to get the media file from ('From your computer', 'From the web', 'From the CMS'), how could I remove one or two of these tabs? (see attached screenshot for further explanation).

Would be very grateful for any hint!

Whish you all happy holidays and an awesome new year!

regards
SF

Attached Files
Avatar
Silverfish

Community Member, 59 Posts

27 December 2013 at 5:06am

Edited: 27/12/2013 5:07am

Hi,

after spending hours of research, the answer is embarrassingly simple.
Best hint was [url]http://www.silverstripe.org/customising-the-cms/show/23497[/url], thanx for that!

I created an extension for the HtmlEditorField_Toolbar like:

<?php

class HtmlEditorField_ToolbarExtension extends DataExtension {

   public function updateMediaForm(Form $form) {
      $form->Fields()->removeByName('FromComputer');
      $form->Fields()->removeByName('FromCms');
   }

}

and included it in _config.php:

Object::add_extension('HtmlEditorField_Toolbar', 'HtmlEditorField_ToolbarExtension');

Regards
SF