function _outline_designer_outline in Outline Designer 5
Helper function for the rendering of the outline designer page
1 string reference to '_outline_designer_outline'
- outline_designer_menu in ./
outline_designer.module - Implementation of hook_menu
File
- ./
outline_designer.module, line 230
Code
function _outline_designer_outline() {
global $base_url;
$drag = user_access('drag-and-drop content');
if ($drag == '') {
$drag = 0;
}
$change_type = user_access('change content types');
if ($change_type == '') {
$change_type = 0;
}
$outline_posts = user_access('outline posts in books');
if ($outline_posts == '') {
$outline_posts = 0;
}
$duplicate = user_access('duplicate nodes');
if ($duplicate == '') {
$duplicate = 0;
}
//this will setup all the Drupal / PHP based permission and path variables that we'll want to access from the javascript side of things
//this could have been accomplished via ajax (in most cases) but this is much more efficent
$od_path = drupal_get_path('module', 'outline_designer');
$js = '//Setup Drupal specific path variables
var AJAX_URL = "' . $base_url . '/?q=outline_designer/ajax/"
var DRUPAL_OD_PATH = "' . $od_path . '";
var DRUPAL_PATH = "' . $base_url . '";
//Setup privs for rendering based on what users are allowed to do.
var DRAG_AND_DROP_CONTENT = ' . $drag . ';
var CHANGE_CONTENT_TYPES = ' . $change_type . ';
var OUTLINE_POSTS = ' . $outline_posts . ';
var ALLOW_DUPLICATE = ' . $duplicate . ';
var treeObj;
var factor = 1;';
drupal_add_js($js, 'inline');
//this is the production version
drupal_add_css($od_path . '/style.css');
//this is the debugging / developing version
//drupal_add_css($od_path . '/source files/od_style.css');
//this one is the production version
drupal_add_js($od_path . '/scripts.js');
//these ones are for debugging / developing
//drupal_add_js($od_path . '/source files/serialize.js');
//drupal_add_js($od_path . '/source files/unserialize.js');
//drupal_add_js($od_path . '/source files/drag-drop-folder-tree.js');
//drupal_add_js($od_path . '/source files/context-menu.js');
//drupal_add_js($od_path . '/source files/functions.js');
$output = 'To drag nodes: Click and drag the type icon or the title<br />
To perform actions: Click on the smaller edit icon (double-click in Opera and IE)' . theme('outline_designer_top');
if (user_access('create new books') == 1) {
$output .= theme('outline_designer_options');
}
$output .= theme('outline_designer_bottom');
return $output;
}