Jump to content

AtkFckAttribute: Difference between revisions

From NusaATK
No edit summary
Line 21: Line 21:
(in a [[node]] constructor):
(in a [[node]] constructor):


  $attr = &$this->add(new atkFckAttribute("forum_reply_text"));
  $this->add(new atkFckAttribute("forum_reply_text"));


Adds a WYSIWYG field 'forum_reply_text' to the node.  
Adds a WYSIWYG field 'forum_reply_text' to the node.  
Or a multilanguage example:
$this->add(new atkMlWrapper(new atkFckAttribute('text',array('rows'=>50,'cols'=>50),AF_SEARCHABLE,array('ToolbarSet'=>'Basic','Width'=>'600px','Height'=>'600px'))));


==== Toolbar ====
==== Toolbar ====

Revision as of 11:56, 1 April 2008

Attribute: atkFckAttribute

API docs | Flags

List of other attributes

File:AtkFckAttribute.png
atkFckAttribute screenshot

Description

The atkFckAttribute is a 'wysiwyg' text editor. It is a wrapper for the FckEditor from http://www.fckeditor.net. It is feature-rich and works in most popular browsers.

Params

The constructor of the atkFckAttribute has the following params:

atkFckAttribute($name, $size='', $flags=0,$opt=array())

  • name String
Name of the attribute (the same as the fieldname used in the database)
  • size int
Can be an array with cols and rows key for size and an autoadjust value or just the rows size
  • flags (optional) int
Flags for the attribute. For more information about flags, please checkout the flags section.
  • opt array
Extra fckeditor configuration options.

Examples

(in a node constructor):

$this->add(new atkFckAttribute("forum_reply_text"));

Adds a WYSIWYG field 'forum_reply_text' to the node.

Or a multilanguage example:

$this->add(new atkMlWrapper(new atkFckAttribute('text',array('rows'=>50,'cols'=>50),AF_SEARCHABLE,array('ToolbarSet'=>'Basic','Width'=>'600px','Height'=>'600px'))));

Toolbar

$attr->setToolbarSet('Basic');

With setToolbarSet it is possible to select the icons displayed on the toolbar. The 'Basic' set includes buttons for 'Bold','Italic','OrderedList','UnorderedList','Link','Unlink','About'.

A custom set can be specified in atk\attributes\fck\fckconfig.js.

Custom buttons

It is also possible to add custom buttons to the toolbar.