Newer
Older
function unl_node_prepare($node) {
Eric Rasmussen
committed
$node->menu['expanded'] = 1;
Eric Rasmussen
committed
/**
* Implementation of hook_wywiwyg_plugin() found in wysiwyg.api.php
*/
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function unl_wysiwyg_plugin($editor) {
switch ($editor) {
case 'tinymce':
return array(
'unl' => array(
// A URL to the plugin's homepage.
'url' => 'http://gforge.unl.edu/gf/project/wdn_tinymce/',
// The full path to the native editor plugin.
'path' => $editor['library path'] . '/plugins/unl',
// A list of editor extensions provided by this native plugin.
// Extensions are not displayed as buttons and touch the editor's
// internals, so you should know what you are doing.
'extensions' => array(
'unl' => 'UNL Extension'
),
// Boolean whether this plugin is a native plugin, i.e. shipped with
// the editor. Definition must be ommitted for plugins provided by
// other modules.
'internal' => TRUE,
// Boolean whether the editor needs to load this plugin. When TRUE,
// the editor will automatically load the plugin based on the 'path'
// variable provided. If FALSE, the plugin either does not need to
// be loaded or is already loaded by something else on the page.
// Most plugins should define TRUE here.
'load' => TRUE,
// A list of buttons provided by this native plugin. The key has to
// match the corresponding JavaScript implementation. The value is
// is displayed on the editor configuration form only.
'buttons' => array(
'unlZenBox' => 'UNL Zen Box',
'unlZenTable' => 'UNL Zen Table',
'unlLayout' => 'UNL Layout',
'unlTooltip' => 'UNL Tooltip',
),
// A list of global, native editor configuration settings to
// override. To be used rarely and only when required.
'options' => array(
'skin' => 'unl',
'table_styles' => 'ZenTable Bright (yellow)=zentable bright;ZenTable Cool (blue)=zentable cool;ZenTable Energetic (orange)=zentable energetic;ZenTable Soothing (green)=zentable soothing;ZenTable Primary (red)=zentable primary;ZenTable Neutral (gray)=zentable neutral;', 'doctype' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
),
)
// Wysiwyg wrapper plugin AJAX callback.
// 'callback' => url('myplugin/browse'),
// 'icon' => drupal_get_path('module', 'mymodule') . '/myplugin/myplugin.png',
// Might need to be set later on; after retrieving customized editor
// layout.
//'theme_advanced_buttons1' => array(t('Button title (optional)') => 'myplugin'),
);
}
Eric Rasmussen
committed
function unl_permission() {
return array(
'unl migration' => array(
'title' => t('Migration'),
'description' => t('Migrate UNL Template based sites to drupal'),
),
'unl site creation' => array(
'title' => t('Site Creation'),
'description' => t('Create new drupal sites using the UNL profile'),
)
);
Eric Rasmussen
committed
/**
* Adds UNL Migration Tool to the Content menu for admin
*/
function unl_menu() {
$access = array();
$items['admin/content/unl/migration'] = array(
'title' => 'UNL Migration Tool',
'description' => 'Migrate a static UNL template page into drupal',
'access arguments' => array('unl migration'),
'page callback' => 'drupal_get_form',
'page arguments' => array('unl_migration'),
'type' => MENU_LOCAL_TASK,
'file' => 'unl_migration.php',
);
Eric Rasmussen
committed
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
if (conf_path() == 'sites/default') {
$items['admin/sites/unl'] = array(
'title' => 'UNL Site Creation Tool',
'description' => 'Create a new UNL Drupal site',
'access arguments' => array('unl site creation'),
'page callback' => 'drupal_get_form',
'page arguments' => array('unl_site_creation'),
'type' => MENU_LOCAL_TASK,
'file' => 'unl_site_creation.php',
);
$items['admin/sites/unl/add'] = array(
'title' => 'Add',
'description' => 'Determine access to features by selecting permissions for roles.',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -8,
);
$items['admin/sites/unl/list'] = array(
'title' => 'List',
'description' => 'List UNL Drupal sites',
'access arguments' => array('unl site creation'),
'page callback' => 'drupal_get_form',
'page arguments' => array('unl_site_list'),
'type' => MENU_LOCAL_TASK,
'file' => 'unl_site_creation.php',
);
}
function unl_form_alter(&$form, $form_state, $form_id) {
// Make new menu items expanded by default.
if ($form_id == 'menu_edit_item' && $form['mlid']['#value'] == 0) {
$form['expanded']['#default_value'] = TRUE;
}
Tim Steiner
committed
function unl_theme() {
return array(
'unl_site_list_table' => array(
'render element' => 'form'
)
);