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

page without theme

Hi,

I want to generate a page with no theme elements in.

So:
1. No Blocks
2. No drupal header

I managed to fix the first one by putting some php code in the block visibility settings. But the second one seems to be harder ?

Anyone a suggestion on how to do this ?

Thx !

Passing Variables to a search function - Help needed

I have been designing a module that will allow you to create project categories, assign tasks into the projects with owner information, start and end dates, notes, etc. I wrote a small search function to let you go through the db by any of the fields.

I am having an issue passing some values from the page through to my search function.
Right now, I have a form page called search_page:

 function search_page() {

    //Builds the array of project names for the project select field  
    $query = "SELECT DISTINCT project_id, project_name FROM qatask_project ORDER BY project_name";
      $projectlist = db_query($query);
      $options = array();
      $options[0] = 'None';

        while ( $data = db_fetch_object($projectlist) ) {
          $options[$data->project_id] = t($data->project_name);
        }

    //Builds the array of user names for the owner select field. Users MUST be in the role of QATask user.
    $query2 = "SELECT u.uid, u.name FROM users u, users_roles, role WHERE u.uid = users_roles.uid 
and role.rid = users_roles.rid and role.name like 'QATask user'";
      $ownerlist = db_query($query2);
      $options2 = array();
      $options2[0] = 'None';

        while ( $data2 = db_fetch_object($ownerlist) ) {
          $options2[$data2->uid] = $data2->name;
        }

    $form['search_task'] = array( '#type' => 'fieldset', '#title' => t('Search Task Datebase'), '#tree' => TRUE,);

    $form['search_task']['project_name'] = array( '#type' => 'select', '#title' => t('Project Name'), 
    '#default_value' => $options[0],  '#options' => $options,); 

    $form['search_task']['owner_name'] = array('#type' => 'select', '#title' => t('Task Owner'), 
     '#default_value' => $options2[0], '#options' => $options2,); 

    $form['search_task']['task_name'] = array( '#type' => 'textfield', '#title' => t('Task Name'), 
     '#default_value' => t(''), '#size' => 60, '#maxlength' => 100,); 

    $form['search_task']['start_date'] = array( '#type' => 'date', '#title' => t('Start Date'),);

    $form['search_task']['end_date'] = array( '#type' => 'date', '#title' => t('End Date'),);

    $form['submit'] = array('#type' => 'submit', '#value' => t('Search'));


  return drupal_get_form('search_task', $form, $form_id);
}

SRS for a new module - SPEC module

Hi,
I'm not a programmer myself, but I would like a powerful module for creating Specs - meaning creating a master node that will link to nodes holding information.
The advantage of such a spec is that every node can be commented, so if for example creating a Spec for a chocolate pie recipe - every step of the process can be commented by users.
I've written a DOC (with pics). I would appreciate getting some comments on it, and maybe better - maybe someone would be interested on it.

Tutorial node module access permissions

I'm creating a new node - a tutorial. It's purpose is to record tutor-student tutorials/interviews. I've got most of it working, just have a problem the access. There are two roles -tutor and student. I want:

  • Any tutor to be able to create, read and edit any tutorial record
  • Only the authoring tutor can delete a tutorial
  • Of the students, only the tutorial's student can view the tutorial

Here's the code:

<?php
/**
* Implementation of hook_perm().
* Define the permissions this module uses
*/
function tutorial_perm() {
return array('view tutorials', 'create tutorials', 'manage tutorials');
}

/**
* Implementation of hook_access().
*/
function tutorial_access($op, $node) {
global $user;

// Either any tutor or the tutorial's student can view the tutorial
$tut = db_fetch_object(db_query('SELECT t.sid FROM {tutorial} t WHERE t.nid = %d', $node->nid));
if($op == 'access') {
return (in_array('tutor', $user->roles) || ($user->uid == $tut->sid));
}

if ($op == 'create') {
return user_access('create tutorials');
}

// Any tutor can update the tutorial.
if ($op == 'update') {
return user_access('manage tutorials');
}

// Only the authoring tutor can delete the tutorial.
if ($op == 'delete') {
return (user_access('manage tutorials') && ($user->uid == $node->uid));
}

Dynamic Fields

I am working on a module that uses a but of javascript to add dynamic fields to the form. When I hit submit and begin verifying the input via the drupal_get_form("contact_insert_form",$form) call back, I have noticed that my dynamic fields are not added as elements in the $edit variable array. Is there a step I am missing?

I am inserting the dynamic fields using HTML similar to what Drupal generates:

StaffBio Module 4.6 -> 4.7

Hi!

I'm quite new to this, so please forgive me my beginner's ignorance...

I'm currently trying to get the StaffBio module working for my Drupal 4.7.3 installation... I converted the form elements with the automated tool, and changed the return values. The settings-page seems to work fine, and the content type is displayed in the menu. But the menu entry doesn't do anything... I assume this is due to invalid form porting (everything else should work as fine in 4.7 as it did in 4.6, right?), so below are the two blocks I edited (original code commented out).

I would be really grateful if someone could tell me what I did wrong there...
Thanks in advance!

Pages

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