///////////////////////////// dojo01.js if (Drupal.jsEnabled) { $(document).ready(function() { $("#hideme").fadeOut(2000,function(){ alert("Animation Done."); }) }) } ///////////////////////////// dojo02.js if (Drupal.jsEnabled) { $(document).ready(function() { $("#clickme").click(function() { $("#search-theme-form").slideToggle(250); return false; }) }) } ///////////////////////////// dojo03.js if (Drupal.jsEnabled) { $(document).ready(function() { $("#clickme").click(function() { $("#search-theme-form").slideToggle(250); titlediv = $("#clickme").parent(); uri = titlediv.attr("title"); $.get(uri + '/dojo', '', function(data) { $("#fillme").empty(); $("#fillme").append(data); }); return false; }) }) } ///////////////////////////// dojo04.js if (Drupal.jsEnabled) { $(document).ready(function() { $("#clickme").click(function() { key = $("#edit-search-theme-form-keys").val(); titlediv = $("#clickme").parent(); uri = titlediv.attr("title"); if (key != '') { $.get(uri + '/' + key, '', function(data) { $("#fillme").empty(); $("#fillme").append(data); }); } return false; }); $("#search-theme-form").submit(function() { key = $("#edit-search-theme-form-keys").val(); titlediv = $("#clickme").parent(); uri = titlediv.attr("title"); if (key != '') { $.get(uri + '/' + key, '', function(data) { $("#fillme").empty(); $("#fillme").append(data); }); } return false; }) }) } ///////////////////////////// ///////////////////////////// end dojo0x.js ///////////////////////////// ///////////////////////////// ///////////////////////////// start dojo.module ///////////////////////////// 'admin/settings/dojo', 'title' => t('Dojo Settings'), 'description' => t('Staring a granular taxonomy requirement system'), 'callback' => 'drupal_get_form', 'callback arguments' => array('dojo_settings'), 'access' => user_access('administer site configuration'), 'type' => MENU_NORMAL_ITEM, // optional ); $items[] = array( 'path' => 'dojojs', 'title' => 'jQuery Dojo!', 'type' => MENU_CALLBACK, 'callback' => 'dojo_jquery_page', 'access' => user_access('access content'), ); $items[] = array( 'path' => 'dojojs/ajax', 'title' => 'jQuery AJAX callback', 'type' => MENU_CALLBACK, 'callback' => 'dojo_jquery_ajax', 'access' => user_access('access content'), ); return $items; } function dojo_settings() { $types = node_get_types(); // print_r($types); $vocabs = taxonomy_get_vocabularies(); // print_r($vocabs); $header = array(t('Vocabulary')); foreach($vocabs as $vid => $vocab) { // make a row $row = array(); $row[] = $vocab->name; foreach($types as $type => $data) { $row[] = '[x]'; $header[] = $type; } $rows[] = $row; } $form = array(); $form['table'] = array( '#type' => 'markup', '#value' => theme('table', $header, $rows), ); return $form; } function dojo_perm() { return array('post dojo without revision'); } /** * Implementation of hook_nodeapi * * For dojo lesson and great justice! */ function dojo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { switch ($op) { case 'submit': If($node->type == 'dojo') { drupal_set_message('DOJO NODE SUBMITTED!'); } break; case 'search result': if ($node->uid == 1) { // use the uid of your puppy-hater here $output = 'THIS USER HATES PUPPIES!'; return $output; } break; case 'validate': // what we want is for this to check the perms if the revision bit is not set. if ($node->revision != 1 && user_access('post dojo without revision') == FALSE) { form_set_error('revision', t('Hey man, you have to make a revision')); } break; case 'update index': If($node->type == 'dojo') { return 'dojotastic'; } break; case 'view': If($node->type == 'dojo') { $node->content['body']['#value'] .= '