'anyedit/edit', 'title' => t('anyedit edit'), 'access' => user_access('access anyedit'), 'type' => MENU_CALLBACK, 'callback' => 'anyedit_edit'); // callback for node properties $items[] = array('path' => 'anyedit/node', 'title' => t('anyedit select node'), 'access' => user_access('access anyedit'), 'type' => MENU_CALLBACK, 'callback' => 'anyedit_select_node'); } return $items; } /** * Implementation of hook_settings(). */ function anyedit_settings() { $form['messages'] = array('#type' => 'fieldset', '#title' => t('Messages'), '#collapsible' => true); $form['messages']['anyedit_updated_msg'] = array( '#type' => 'textfield', '#title' => t('Updated Message'), '#default_value' => variable_get('anyedit_updated_msg', 'updated'), '#size' => 40, '#maxlength' => 200, '#required' => true, ); $form['messages']['anyedit_error_msg'] = array('#type' => 'textfield', '#title' => t('Error Message'), '#description' => t('%response is a placeholder for what the server will return back as a more specific error response'), '#default_value' => variable_get('anyedit_error_msg', 'error updating (%response)'), '#size' => 40, '#maxlength' => 200, '#required' => true, ); $form['node_types_options'] = array('#type' => 'fieldset', '#title' => t('Node Types'), '#collapsible' => true); $form['node_types_options']['anyedit_node_types'] = array('#type' => 'checkboxes', '#title' => NULL, '#default_value' => variable_get('anyedit_node_types', node_get_types()), '#options' => node_get_types(), //'#prefix' => '
'. print_r(node_get_types(), true) .'' ); if (module_exist('tinymce') && user_access('administer tinymce')) { $form['tinymce'] = array('#type' => 'fieldset', '#title' => t('TinyMCE'), '#collapsible' => true); $form['tinymce']['anyedit_tinymce'] = array('#type' => 'checkbox', '#title' => t('enable TinyMCE on textarea editing'), '#default_value' => variable_get('anyedit_tinymce', true) ); } return $form; } /** * Implementation of hook_nodeapi(). */ function anyedit_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) { static $anyedit_include; if ($node && $op == 'view' && user_access('access anyedit')) { if (!$anyedit_include) { $available_nodes = variable_get('anyedit_node_types', node_get_types()); foreach ($available_nodes as $available_node => $node_type) { if ($node_type == $node->type) { _anyedit_jquery(); _anyedit(); _anyedit_js('anyedit.nodes.js'); $anyedit_include = true; break; } } } // oh so sneaky if ($page) { $node->body .= '