1
Shiva
Editors for blocks?
  • 2009/4/4 13:23

  • Shiva

  • Quite a regular

  • Posts: 280

  • Since: 2006/7/9 1


Is there hack to use different editors such as fck to update custom blocks with?

2
kerkyra
Re: Editors for blocks?
  • 2009/4/4 18:32

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


you will have to edit the file blockform.php in /modules/system/admin/blocksadmin/

find this code in line 49
Quote:

$textarea = new XoopsFormDhtmlTextArea(_AM_CONTENT, 'bcontent', $block['content'], 15, 70);
$textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'._AM_USEFULTAGS.'</span><br /><span style="font-size:x-small;font-weight:normal;">'.sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>');
$textarea->doHtml = true;
$form->addElement($textarea, true);


and replace it with

Quote:

include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';

$editor_configs = array();
$editor_configs['name'] = 'bcontent';
$editor_configs['value'] = $block['content'];
$editor_configs['rows'] = $rows ? $rows : 35;
$editor_configs['cols'] = $cols ? $cols : 60;
$editor_configs['width'] = "100%";
$editor_configs['height'] = "400px";

$textarea = new XoopsFormEditor(_AM_CONTENT, "fckeditor", $editor_configs);
$textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'._AM_USEFULTAGS.'</span><br /><span style="font-size:x-small;font-weight:normal;">'.sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>');

$form->addElement($textarea, true);


this should do the trick ;)
www.guidemap.gr - Beta is out...

3
Shiva
Re: Editors for blocks?
  • 2009/4/4 21:37

  • Shiva

  • Quite a regular

  • Posts: 280

  • Since: 2006/7/9 1


Great! thanks.

4
claydoh
Re: Editors for blocks?
  • 2009/4/5 22:11

  • claydoh

  • Friend of XOOPS

  • Posts: 58

  • Since: 2003/6/6 0


This does work for me on my new 2.3.3 install. Am I missing something under my nose ;)

5
kerkyra
Re: Editors for blocks?
  • 2009/4/5 23:37

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


any errors???
www.guidemap.gr - Beta is out...

6
claydoh
Re: Editors for blocks?
  • 2009/4/7 19:29

  • claydoh

  • Friend of XOOPS

  • Posts: 58

  • Since: 2003/6/6 0


NoticeUndefined variablerows in file /modules/system/admin/blocksadmin/blockform.php line 55
Notice
Undefined variablecols in file /modules/system/admin/blocksadmin/blockform.php line 56


the relevant lines:
$editor_configs['rows'] = $rows $rows 35;
$editor_configs['cols'] = $cols $cols 60;

7
trabis
Re: Editors for blocks?
  • 2009/4/7 19:48

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


$editor_configs['rows'] = isset($rows) ? $rows 35;
$editor_configs['cols'] = isset($cols) ? $cols 60;


But this should not affect behavior, I think.

8
kerkyra
Re: Editors for blocks?
  • 2009/4/8 0:27

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


it should just assign to array['rows'] and array['cols'] the values 35 and 60 respectively! Thats the code i'm using right now on a couple of 2.3.2b sites with no problems at all. :/ Dont you get any other errors? Ignore the notices for now...
www.guidemap.gr - Beta is out...

9
claydoh
Re: Editors for blocks?
  • 2009/4/12 14:18

  • claydoh

  • Friend of XOOPS

  • Posts: 58

  • Since: 2003/6/6 0


Sorry for the delay, and thanks for the assistance :)

I don't get any other errors. Using Trabis' code removes the error message, but I still just get a plain text input area with no controls.

10
cerbero
Re: Editors for blocks?
  • 2010/7/7 10:52

  • cerbero

  • Not too shy to talk

  • Posts: 191

  • Since: 2003/9/11


Works fine also in 2.4.4
...

Login

Who's Online

239 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits