drupal-modules

Track user's action

喜欢而已 提交于 2019-12-25 03:22:44
问题 In our company I have to extend the functionality of existing Drupal 7 website. Here are the requirements: The business needs to inform all staff members, on different topics using uploaded to the Drupal site documents. (I already implemented this requirement.) The business needs to know, which staff members have read a document and which still have not. They need a report like this: Document 1 25/50 (25 from 50 staff members still didn't read the file) Document 2 50/50 (all staff members did

Theming Module Output

我们两清 提交于 2019-12-25 02:15:43
问题 What I am trying to do is generate some raw output within a module. I would like to pass an array of data through to a template file, and then use that data to populate the code from the template. The template is represented by a file in my theme folder. I have a hook set up for a certain URL (/itunes): $items['itunes'] = array( 'page callback' => 'itunespromo_buildpage', 'type' => MENU_SUGGESTED_ITEM, 'access arguments' => array('access content'), ); ..inside itunespromo_buildpage...

Why does each field appear in a new row?

筅森魡賤 提交于 2019-12-25 01:26:09
问题 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. How would one modify the following code so that each field appeared in a new table row (instead of fields in adjacent cells within the same row)? // Make table and display on screen. $tbl_header = array();

How to create a custom token for the Message module?

♀尐吖头ヾ 提交于 2019-12-25 00:43:07
问题 I have a site with Drupal, as well as the modules "Message" and "Token". I created a custom module based on the module "Message example". I created for entities, a display mode called message_activity_stream . I created a token to display the rendered entity of the nodes and it works. Now I want to create a custom token to display the rendered entity of the author of the message. How to create a custom token in my module, to display the rendered entity message_activity_stream of the user

hook_permission and control access [how to redirect to the login page if user not logged in]

感情迁移 提交于 2019-12-25 00:36:16
问题 How does one limit "what" can access a page. I have little understanding on how to use hook_permission() to set user permission based on a role to control access to hook_menu() items. However, what if I have a hook_menu() item that is to be used solely by the system itself? For example, say I have a registration page in a custom module: module/register - Anyone can access that page. Then, say I have an another page which is only for admin. So, I register another item in hook_menu(), call it

How do I add 'javascript' url scheme in HTML purifier module in Drupal?

青春壹個敷衍的年華 提交于 2019-12-24 21:42:20
问题 How can I can add the "javascript:xyz" url format for the URI.AllowedSchemes in HTML purifier module in drupal ? I suppose this is the file I should modify URI.AllowedSchemes or is there any other config change I need to make. This is for the site moderator to publish bookmarklets and will not be exposed to outside world. 回答1: http://htmlpurifier.org/docs/enduser-uri-filter.html 来源: https://stackoverflow.com/questions/5138282/how-do-i-add-javascript-url-scheme-in-html-purifier-module-in

how do i make diffrent registration form in drupal?

好久不见. 提交于 2019-12-24 06:57:52
问题 Is there a module that can make different registration forms for different roles during sign up? (ex. each Editor,Main User,Sub User role have different form) 回答1: There is :) http://drupal.org/project/autoassignrole to assign by path you will also need Content Profile: http://drupal.org/project/content_profile check out this tutorial on how to pull it off: http://www.web-a-team.com/blog-post/user-registration-more-one-role 回答2: Here's what you should do start with install profile2-7.x-1.2

Drupal 7 Forms API - AJAX Forms error: An illegal choice has been detected. Please contact the site administrator

旧城冷巷雨未停 提交于 2019-12-24 04:49:05
问题 I have a form set up where a users selects an item from a drop down. Once that item is selected another drop down is populated. Then depending on the value that is selected from the second drop down a fieldset may or may not be shown. If the field set is shown there is a field and a button. By clicking the button you add another copy of the same field. Once there is more than one a remove one button shows up as well. I got the basis for the code from here: http://api.drupal.org/api/examples

Theming Drupal 7's Ubercart “/cart” page

前提是你 提交于 2019-12-23 11:55:15
问题 I'm trying to theme Drupal 7's Ubercart 3 /cart page, but I'm struggling to find the theming function to do so. I believe the right code may be located in template.tpl.php , but I am not sure. Where in Drupal is the code to theme this page? 回答1: Create a new template file and name it page--cart.tpl.php For more information about Drupal theming suggestions: http://drupal.org/node/1089656 (Don't forget to clear the cache after adding the new template file) Another way to use Devel module with

How add trigger to mysql Through Schema API

我们两清 提交于 2019-12-23 05:36:11
问题 Through Schema API (file mymodule.install in Folder sites\all\modules\mymodule). trigger in mysql: delimiter | CREATE TRIGGER testref AFTER INSERT ON users FOR EACH ROW BEGIN INSERT INTO beep SET uid = NEW.uid; END; | delimiter ; 回答1: There is no specific API for that. Try http://api.drupal.org/api/drupal/includes--database.pgsql.inc/function/db_query/6 Also remember that triggers are not standardised across different databases. It would be a better idea (or maybe as a fallback) to do that