You are here

function editor_profile_plugins in Editor 5

Same name and namespace in other branches
  1. 6 editor.module \editor_profile_plugins()

Get plugins based on a profile's placeholders.

Parameters

object $profile: Profile object

Return value

array Plugin objects

1 call to editor_profile_plugins()
editor_display_toolbars in ./editor.module
Generate toolbar markup.

File

./editor.module, line 297
Extendable WYSIWYG editor @author Tj Holowaychuk <tj@vision-media.ca> @link http://vision-media.ca @package Editor

Code

function editor_profile_plugins($profile) {
  $plugins = array();
  if (count($profile->profile_array)) {
    foreach ($profile->profile_array as $pid) {
      if ($pid != '|') {
        $plugin = editor_plugin_get($pid);
        if ($plugin->pid) {
          $plugins[] = $plugin;
        }
      }
      else {
        $plugins[] = '|';
      }
    }
  }
  return $plugins;
}