drupal-6

Where to declare variables common to different include files in a module - Drupal

[亡魂溺海] 提交于 2020-01-01 12:00:33
问题 I have a Drupal Module 'example'. I have split the admin and client side functionality of the module into two include files example.admin.inc and example.pages.inc. I declared constants (define()) in the example.module file, which are accessible in both the pages.inc file and admin.inc file. But how can I declare normal $variables in a centralized location so that they can be accessible in both the admin.inc file and pages.inc file. I tried to declare $variable in example.module, but couldn't

Drupal - use l or url function for mailto links

六月ゝ 毕业季﹏ 提交于 2020-01-01 08:43:47
问题 Does anyone know how to use the l() or url() function to create mailto links? I am running drupal 6. 回答1: You need to use the absolute option: l('Mail me', 'mailto:jim@hotmail.com', array('absolute' => TRUE)); will generate <a href="mailto:jim@hotmail.com">Mail Me</a> 回答2: A good practice is to use the t() function with strings. Code should be then: l(t('Mail me'), 'mailto:jim@hotmail.com', array('absolute' => TRUE)); 回答3: Preferably none: l() is useful for the output of internal links: it

Preventing form_token from rendering in Drupal “GET” forms

久未见 提交于 2020-01-01 02:49:07
问题 Drupal inserts a form_token as a hidden field when it renders forms. The form_token is then checked on form submission to prevent cross-site request forgery attacks. The form data that is submitted is guaranteed to have come from the original form rendered by Drupal. However, forms using the "GET" method shouldn't need this token. All it does is lengthen and uglify the resulting URL. Is there any way of suppressing it? 回答1: Yes, there is a way, but use it consciously (see warning below): If

Modificate content profile form to show checkboxes in the matrix

橙三吉。 提交于 2019-12-31 07:20:24
问题 I need to show matrix like this http://eugen.gotdns.com/test/zeitplaner.png in content profile form. I can arrange checkboxes with CSS in this way, but i need also some labels on the top and on the left. Should i work with $form array to add some labels? Can this be done with css maybe? 回答1: I agree with Mike Crittenden that the way to do this is to use tables, I don't agree with the way he want to do it though. The best solution is to make a custom theme function for the form. Basicly what

theme_table drupal development

女生的网名这么多〃 提交于 2019-12-31 05:36:05
问题 update I have made this table: I have 2 array's UGentArray and InternshipsArray. How can I set these in my table? instead of "Row column 1 data" and "Row column 2 data". My question is: I want the values from UgentArray and InternshipArray as 2 columns under Each title UGentID and Internships enter code here// Make table and display on screen. $tbl_header = array(); $tbl_header[] = array("data" => "UGentID"); $tbl_header[] = array("data" => "Internships"); $tbl_row = array(); foreach(

Auto-updating width/length/area using jQuery and Drupal6

…衆ロ難τιáo~ 提交于 2019-12-30 11:48:23
问题 I'm using Drupal to create a measurement sheet (Measurement sheets in Drupal 6) and am at a point where I have all the fields in place, I just need to write some jQuery that auto-updates the appropriate field when the user enters data. Code below: jQuery(document).ready( function ($) { $('input').change( function() { $parent = $(this).parent("td").children("div").children("div"); length = $parent.children("div[id*='field-length-0-wrapper']").children("div.container-inline").children('div[id*=

How to redirect from HTTPS to HTTP?

ε祈祈猫儿з 提交于 2019-12-25 04:56:29
问题 I have a Website. Where I need to redirect all the pages from HTTP to HTTPS. But there are two page which should not served over HTTPS. Home Page - www.hellomysite.com Dealers Page -www.hellomysite.com/dealers Even if user has entered the url as https://www.hellomysite.com/dealers, it should be served over HTTP. http://www.hellomysite.com/dealers I googled & found number of links but none of them is redirected. .htaccess #Redirect all request to HTTPS RewriteCond %{HTTPS} off [OR] RewriteCond

drupal 6 form module not calling hook_theme

巧了我就是萌 提交于 2019-12-25 04:55:16
问题 I'm trying to build a table with form elements by theming the form. I have created a form with 9 elements #type textfield: a1,a2,a3,b1,b2,b3,c1,c2,c3. I would like to put them into a table using theme_table($header,$row). To do this I create a _theme(){} function and another function that creates the $header and $rows for the form and uses drupal_render to create the form. The form renders only when I have return $form in the form hook. But really i don't want to render the form there, but

How to work with hook_nodeapi after image thumbnail creation with ImageCache

此生再无相见时 提交于 2019-12-25 04:43:32
问题 A bit of a followup from a previous question. As I mentioned in that question, my overall goal is to call a Ruby script after ImageCache does its magic with generating thumbnails and whatnot. Sebi's suggestion from this question involved using hook_nodeapi. Sadly, my Drupal knowledge of creating modules and/or hacking into existing modules is pretty limited. So, for this question: Should I create my own module or attempt to modify the ImageCache module? How do I go about getting the generated

Drupal url alias and views and clear urls for taxonomy issues

不问归期 提交于 2019-12-25 04:42:52
问题 I am using views module. I have created blocks using views and a url using page display. This is for taxonomy. So my views url looks like this "news/science" So if someone click on the link he should be taken to www.example.com/news/science. However i am taken to a unstyled page with broken links. But when i try to use the url www.example.com?q=news/science i am taken to a proper page with correct data. The issue is only with taxonomy related terms. i.e all urls www.example.com/news