Support for imagecache presets and for inline tags in tinyMce editor

attiks - September 21, 2007 - 14:55
Project:Asset Manager
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

This is a work in progress, to try this add a CCK select box to the image contenttype named 'imagecachepreset' and use the following code for the select (php):

  $presets = array();
  $result = db_query('SELECT presetid, presetname FROM {imagecache_preset} ORDER BY presetname');
  while ($row = db_fetch_array($result)) {
    $presets[$row['presetname']] = $row['presetname'];
  }
  return $presets;

1/ while adding a new image you can select the imagecache preset
2/ while selecting an image you can select the imagecache preset

the preset only works in TinyMce (probably add some support later for plain textfields as well?)
In tinyMCE you'll see an inline tag: [AM|nid=32|title=test|imagecachepreset=am_preview], only nid is mandatory, if title isn't specified, the system uses the node title, if imagecachepreset isn't specified it uses am_preview by default.

Don't forget to activate the inline filter!

For changed code files see below

#1

attiks - September 21, 2007 - 14:57

adapted am.module

AttachmentSize
am.module.txt 22.42 KB

#2

attiks - September 21, 2007 - 14:58

adapted am_loader.js

AttachmentSize
am_loader.js_.txt 6.76 KB

#3

attiks - September 22, 2007 - 09:29

Note: the plugin for TinyMce doesn't display the image for the moment, just the inline tag.

 
 

Drupal is a registered trademark of Dries Buytaert.