⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

unset_texteditor for every field



yvkr
  • profile picture
  • Member

Posted 21 April 2012 - 16:17 PM

Hi,

my Table consists of many text-columns and editing created a texteditior on every field.
The columns are dynamically created on an import, so I don't necessarily know the names.

I found no simple solution to do an "unset_texteditor" for every field.

So I changed the following in grocery_crud.php:

case 'text':
if(!empty($this->unset_texteditor) && in_array($field_info->name,$this->unset_texteditor))
$field_info->extras = false;
else
$field_info->extras = 'text_editor';
break;


to the following:


case 'text':
if(!empty($this->unset_texteditor) && (in_array($field_info->name,$this->unset_texteditor) || ($this->unset_texteditor[0]=='*') ) )
$field_info->extras = false;
else
$field_info->extras = 'text_editor';
break;


I can do an unset_texteditor for every field with this:

$crud->unset_texteditor('*');


Perhaps this helps someone.
Would be great, if you could integrate such a solution into one of the next Version.


Greetings

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 21 April 2012 - 17:08 PM

Thank you [member='yvkr'] that you share this. I will have it in mind to have such a think to a newer version. I was just thinking a simpler idea:


$crud->unset_texteditor();


without any parameter to unset all the texteditors from the crud. We'll see if I have time to do it as I already have a plan for the next version.

I am also moving this topic to extra Coding/Plugins so other people also know.