You are here

function bueditor_processed_buttons in BUEditor 6

Same name and namespace in other branches
  1. 6.2 bueditor.inc \bueditor_processed_buttons()
  2. 7 bueditor.inc \bueditor_processed_buttons()

Processed buttons. Evaluate php code for php buttons and translate titles prefixed with t:.

1 call to bueditor_processed_buttons()
bueditor_settle in ./bueditor.module
Include necessary js and css files for editor settlement.

File

./bueditor.module, line 98

Code

function bueditor_processed_buttons($eid) {
  $buttons = array();
  foreach (bueditor_buttons($eid) as $bid => $button) {
    if (substr($button->content, 0, 4) == 'php:') {
      if ($content = drupal_eval('<?php ' . substr($button->content, 4) . ' ?>')) {
        $button->content = $content;
      }
      else {

        //php returned false or nothing. dont include this button.
        continue;
      }
    }
    $button->title = substr($button->title, 0, 2) == 't:' ? t(trim(substr($button->title, 2))) : $button->title;
    $buttons[] = array(
      $button->title,
      $button->content,
      $button->icon,
      $button->accesskey,
    );
  }
  return $buttons;
}