View source
<?php
function ckeditor_htmlbuttons_schema() {
$schema['ckeditor_htmlbuttons'] = array(
'fields' => array(
'name' => array(
'description' => 'The machine name for the btton.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'title' => array(
'description' => 'The title of the button.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'fid' => array(
'description' => 'The {file_managed}.fid of the image.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'html' => array(
'description' => 'The Wysiwyg template HTML',
'type' => 'text',
),
),
'primary key' => array(
'name',
),
);
return $schema;
}
function ckeditor_htmlbuttons_requirements($phase) {
$requirements = array();
$t = get_t();
if ($phase == 'runtime' && !module_exists('ckeditor') && !module_exists('wysiwyg')) {
$requirements['ckeditor_htmlbuttons'] = array(
'title' => $t('CKEditor HTML Buttons'),
'value' => $t('CKEditor HTML Buttons requires either the <a href="@c_url">CKEditor</a> or <a href="@w_url">Wysiwyg</a> module to be enabled.', array(
'@c_url' => 'https://www.drupal.org/project/ckeditor',
'@w_url' => 'https://www.drupal.org/project/wysiwyg',
)),
'severity' => REQUIREMENT_WARNING,
);
}
return $requirements;
}