Xataface CKeditor Module 0.3
CKeditor Widget for Xataface
Xataface CKeditor Module
Screen_shot_2011-08-12_at_9.44.22_AM.png?max_width=640

Synopsis

This module adds an html editor widget that uses CKeditor to the set of widgets that can be used in a Xataface application. CKeditor is the successor of the FCKeditor project, which is included standard as part of the Xataface installation. The future of Xataface development is planned as modules so FCKeditor will continue to be used as the default editor for the htmlarea widget type. The CKeditor widget can be specified for any field by setting widget:type=ckeditor .

See also:
http://ckeditor.com/

Table of Contents

  1. Requirements
  2. License
  3. Installation
  4. Basic Usage
  5. Configuration Options
  6. Plugin Development
  7. Schema Browser Plugin
  8. Support

Requirements

  1. Xataface 2.0 (or SVN development trunk rev 3126 or higher)

Changes History

0.3 (January 26, 2012)

0.3 (January 26, 2012)

Installation

Installing the CKeditor module involves 2 steps:

  1. Copying the ckeditor directory into your application's (or xataface's) modules directory. I.e. the path should be modules/ckeditor.
  2. Adding the following line to the [_modules] section of your conf.ini file:
    modules_ckeditor=modules/ckeditor/ckeditor.php
    

At this point you should be able to use the ckeditor widget in your application.

Basic Usage

Once the module has been installed, you can specify that a field use the CKeditor widget by setting its widget:type directive to "ckeditor" in the fields.ini file. E.g.

[myfield]
    widget:type=ckeditor

Now when you load up the edit form for that table, you should see a ckeditor widget for editing the myfield field.

See also:
http://docs.cksource.com/CKEditor_3.x/Users_Guide (The CKeditor Users Guide)
http://xataface.com/wiki/fields.ini_file

Configuration Options

CKeditor supports a many configuration options for setting such things as where the toolbar should appear and which buttons should be present on the toolbar. A full list of these options can be found at http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html

Many of these options can be specified in the fields.ini file by setting:

widget:ckeditor:<configOption>=<configValue>

e.g.

widget:ckeditor:uiColor="#AADC6E"

Per-Record Configuration

You can also customize the configuration of a CKEditor instance on a per-record basis by implementing the ckeditor_decorateConfig() method in the delegate class.

e.g.

The following example sets the baseHref property of the editor be based on the record that is being edited.

function ckeditor_decorateConfig($record, &$config){
        $site = df_get_record('settings', array('settings_id'=>$record->val('settings_id') ));
        
        if ( $site ){
                $path = $record->val('webpage_url');
                if ( $path{strlen($path)-1} != '/' ){
                        if ( strpos($path, '/') !== false ){
                                $parts = explode('/', $path);
                                array_pop($parts);
                                $path = implode('/', $parts);
                        } else {
                                $path = '';
                        }
                        $path .= '/';
                }
                
                $baseurl = $site->val('website_url').$path;
                $config['baseHref'] = $baseurl;
        }
}
Attention:
Note It is very important that the 2nd parameter of this method is passed by reference (i.e. don't forget to prepend "&" to the argument definition.

Support

See also:
http://xataface.com/forum
 All Data Structures Files Functions Variables