function linkit_dashboard_page in Linkit 7
Same name and namespace in other branches
- 6 linkit.module \linkit_dashboard_page()
- 7.3 linkit.module \linkit_dashboard_page()
Creates the dashboard.
1 string reference to 'linkit_dashboard_page'
- linkit_menu in ./
linkit.module - Implements hook_menu().
File
- ./
linkit.module, line 135 - Main file for linkit module.
Code
function linkit_dashboard_page($editor) {
module_invoke('admin_menu', 'suppress');
// Add CSS.
drupal_add_css(drupal_get_path('module', 'linkit') . '/css/linkit.css');
// Add JS
static $defualt_settings_added = FALSE;
// Add default settings
if (!$defualt_settings_added) {
$defualt_settings_added = TRUE;
$settings = array(
'linkit' => array(
'ajaxcall' => url('linkit/geteditresult'),
),
);
// Check if we have IMCE and access to it.
$imce = module_invoke('imce', 'access');
if ($imce) {
$settings['linkit']['IMCEurl'] = url('imce', array(
'query' => array(
'app' => 'Linkit|url@edit-link--2',
),
));
}
drupal_add_js($settings, 'setting');
}
drupal_add_js(drupal_get_path('module', 'linkit') . '/linkit.js');
switch ($editor) {
case 'wysiwyg_tinymce':
// Add JavaScript.
drupal_add_js(wysiwyg_get_path('tinymce') . '/jscripts/tiny_mce/tiny_mce_popup.js');
drupal_add_js(drupal_get_path('module', 'linkit') . '/editors/tinymce/linkit.js');
break;
case 'ckeditor':
case 'wysiwyg_ckeditor':
// Add JavaScript.
drupal_add_js(drupal_get_path('module', 'linkit') . '/editors/ckeditor/linkitDialog.js');
break;
case 'fckeditor':
case 'wysiwyg_fckeditor':
// Add JavaScript.
drupal_add_js(drupal_get_path('module', 'linkit') . '/editors/fckeditor/linkit/linkitDialog.js');
break;
}
$form = drupal_get_form('_linkit_form');
print theme('linkit_dashboard', array(
'form' => render($form),
));
}