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

How to create Primary links!

Hi,

I have created a module and its menu links like this.......

  $items[] = array(
    'path' => 'user/newsite',
    'title' => t('Create Site'),
    'description' => t('Description of what is this'),
    'callback' => 'drupal_get_form',
    'callback arguments' => 'newsite_form',
    'access' => TRUE,
    'type' => MENU_NORMAL_ITEM,
   );

How can I make this link as primary link.
Great appreciation for any help.........

Thank
CRINCH

Textfield instances in table for batch submit

I'm trying to make a batch edit function for a specific field on the Survey module.
The idea is to get a table with all the questions added, a textfield at the end of each row and a submit function at the end of the table.

I'm really dumb with the Forms API, and cannot get this right...:

Resizing Images in Image_Field

I currently have a content type that uses the image field cck module. What I need to do is take the image that is uploaded and make a small copy of it in another directory. I've made a function to copy and resize the image but I can't seem to find a spot in image_field.module to place a call to it. Every function I've tried has arrays that give the new filepath of the image but if I use that it claims no file exists there. Any ideas?

Is there a db_rewrite_sql with OR instead of AND?

Subject says it all.

So I'm writing a module. And it EXTENDS the information retrieved by another, rather than restricts it.

Done in one command, the SQL would look like:

$sql = "SELECT x.* FROM x INNER JOIN y ON x.id=y.x_id".
           " WHERE (x.private IS NULL OR y.private IS NULL)".
           " AND y.group_id IN (".implode(",", $user->groups).");"

See, all items in table x can be public/private, but there is a further table y that can make certain certain items public for people who belong to a group. [As this list is displayed verbatim, I don't believe it is fit for node_access; afaik Drupal has no built-in system to not show things that are either not user_access or node_access allowed in SQL, which means I'd have to reinvent the wheel.]

The problem I see is that db_rewrite_sql merges the WHERE clauses together using AND's, but as you can see, the clause requires it to be merged as an OR.

I've got a big thing about leaving modules I didn't write untouched (and thus easily upgradable) but I'm becoming afraid I might have to modify a module.

Or could this problem be solved as a restriction? [I don't think so, the only restriction I see is to show ALL items, but have module Y determine what to hide, which isn't good coding, as now X depends on Y and Y on X.]

How can CCK be used from within a page without browsing away from the page. Easy example inside, hard to explain in title.

I am fairly new to drupal still but have studied CCK and lots of other stuff and one question seems to pop up all the time.

How can you use stuff like the CCK without having to let the user browse to the input form.

Let me give an example... imagine you were creating a site for recipes and user can input recipes themselves... but not only can they input the recipes they can also input ingredients with nutritional information to the database (so the nutritional values for an entire dish can be calculated).

Okay so that is an example setup and here comes the problem with that example:
If you have used CCK to create all the forms and everything you need to contain recipes (maybe you even made your own module for CCK ingredient list or something) and you also used CCK for the ingredients input.

Collapse Package Fieldsets in admin/build/modules

I am trying to set all the fieldsets on admin/build/modules to a collapsed state by default like the "Core - required" fieldset.

I have searched the forum and site repeatedly and could not find a detailed answer... I have seen that I should use the hook_form_alter() function but when I dissect the info being passed into I do not see any fieldsets to manipulate...

I am fairly new to Drupal and I am sure this is an easy solution, but I am just not seeing it... Thanks in advance for your help...

Pages

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