-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathding_content.module
More file actions
91 lines (77 loc) · 2.34 KB
/
ding_content.module
File metadata and controls
91 lines (77 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
include_once('ding_content.features.inc');
/**
* @file
* Various integration with panels to create panel panes and more.
*/
/**
* Implements hook_menu().
*/
function ding_content_menu() {
$items = array();
$items['ding_content/media'] = array(
'title' => 'Media browser list',
'description' => 'Ajax Callback for getting media',
'page callback' => 'ding_content_media_browser_list',
'access callback' => 'media_access',
'access arguments' => array('view'),
'type' => MENU_CALLBACK,
'file' => 'ding_content.admin.inc',
);
return $items;
}
/**
* Implements hook_media_browser_plugin_info().
*/
function ding_content_media_browser_plugin_info() {
$plugins = array();
$plugins['ding_content'] = array(
'#weight' => 0,
);
return $plugins;
}
/**
* Implements hook_media_browser_plugin_view().
*/
function ding_content_media_browser_plugin_view($plugin_name, $params) {
$media_path = drupal_get_path('module', 'media');
$path = drupal_get_path('module', 'ding_content');
$params += array(
'types' => array(),
'multiselect' => FALSE,
);
switch ($plugin_name) {
case 'ding_content':
return array(
'#title' => t('Personal library'),
'#attached' => array(
'js' => array(
$media_path . '/js/plugins/media.library.js',
$path . '/js/ding_content.media.js',
),
'css' => array(
// @todo: should move this.
$media_path . '/js/plugins/media.library.css',
$path . '/css/ding_content.media.css',
),
),
'#settings' => array(
'viewMode' => 'thumbnails',
'getMediaUrl' => url('ding_content/media'),
// We should probably change this to load dynamically when requested
// via the JS file.
) + $params,
'#markup' => '<div id="container"><div id="scrollbox"><ul id="media-browser-library-list" class="media-list-thumbnails"></ul><div id="status"></div></div></div>',
);
}
return array();
}
/**
* Implements hook_wysiwyg_editor_settings_alter().
*/
function ding_content_wysiwyg_editor_settings_alter(&$settings, $context) {
if ($context['profile']->editor == 'ckeditor') {
$path = drupal_get_path('module', 'ding_content');
$settings['customConfig'] = '/' . $path . '/js/ding_content.editor_config.js';
}
}