This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

What are the different ways of submitting a form and finding the values entered?

Here is what I want to do: display a form, allow the user to enter values, then re-display the form with underneath it the results retrieved as a result of the submit (if you look at how search works on drupal.org you'll have a good idea of the kind of thing I want to do).

hook_alter_form by node type?

Hi you all.

I've been searching and searching on the forums trying to find how to determine that the hook_alter_form acts according the node type. One example would be limiting that the menu or path or nodewords alter the editing form with their parameters on each and every node type. I thought it would be easy adding at the very beginning of the function something like:

New WebCalendar module

I've been working on a new module that integrates WebCalendar into Drupal. Its pretty much finished except for help pages etc.

WebCalendar is a great PHP calendar, you can read about all its features here http://webcalendar.sourceforge.net/

Insert node to body of another node (filter)

I post text of my quick hack-filter. Syntax:

[node:123] - insert full text (themed by theme('node'))
[node:123 body] - insert node's body
[node:123 teaser] - insert node's teaser
[node:123 link] - insert link to node
[node:123 collapsed] - insert collapsed node's body

Code (put it to file node_filter.module):

<?php

function node_filter_help($section) {
switch($section) {
case 'admin/modules#description':
return t('Filter for including node to body of another node by its ID.');
}
}

function _node_filter_replacer($matches) {
$node = node_load(array('nid'=>$matches[1]));
switch ($matches[2]) {
case 'body':
return $node->body;
case 'teaser':
return $node->teaser;
case 'link':
return l($node->title, "node/$node->nid");
case 'collapsed':
return theme('fieldset', array('#collapsible'=>true, '#collapsed'=>true, '#title'=>$node->title, '#value'=>$node->body));
default:
return theme('node', $node);
}
}

function node_filter_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(0 => t('Include/link node by ID'));
case 'description':
return '';
case 'prepare':
return $text;
case "process":
$text = preg_replace_callback('/\[node:([0-9]+)(?:\s+(body|link|collapsed|teaser))?\]/', '_node_filter_replacer', $text);
return $text;
default:
return $text;
}

Customised Advanced Search Form

Hey guys,

I'm trying to create an advanced search form with fields for selecting terms of particular taxonomy categories.

Yes, these are already available in the Advanced Search form, but they are all combined into one select field - and we need them in separate fields.. as some of the categories have dozens of terms to choose from.

Authentication against drupal database

Hi,

I'm working on a integration plugin for a php calendar script called WebCalendar. http://www.k5n.us/webcalendar.php

The idea is that the WebCalendar script will authenticate against the Drupal database and check whether they have permissions such as "administer webcalendar" provided by a Drupal module.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions