SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal: Configuration and Customization Week 4: Installation, Module Development January 25,

Slides:



Advertisements
Similar presentations
CiviCRM Developer Training Extend and customize CiviCRM.
Advertisements

Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
OCLC Online Computer Library Center CONTENTdm Developers Meeting ALA Midwinter Meeting Seattle, WA January 19 th, 2007 Claire Cocco, Product Manager Joe.
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
Drupal Online Tutorial A Product of an ENGL 421 class at Purdue University Page 1.
Our aims ease the pain – for all our users get with the times better communication with our supporters recruit and engage people to our campaigns raise.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Drupal Create a website/web app quickly with this Content Management System Jiaying Xu Spring 2011 COMS E6125 Web-enHanced Information.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2006 Microsoft Corporation.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
State of Connecticut Core-CT Project Query 4 hrs Updated 1/21/2011.
The Dr ü G Book: An Intro to Drupal The Dr ü G Book: An Intro to Drupal (Dr ü G: Drupal User ’ s Group - users, not developers) This is an introduction.
Deployment Management The following screens demonstrate how to: 1. Access and view deployments 2. Create a new local deployment 3. Create and modify a.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Drupal and the CMS Project. Lesson Learned #1 Keep your modules updated, especially when there are security concerns in the update notes 2010 | The Sky’s.
The New Books List Michael Doran, Systems Librarian Ex Libris Southwest Users Group February 6, 2008 – Santa Ana College.
Hook, Drush, and Alters Oh Mai! Bryan Ollendyke.
Business Optix Library Service – Workflow
TOP 20 MISTAKES YOU WILL MAKE IN YOUR 1ST DRUPAL PROJECT IZTOK SMOLIČ, ZAGREB.
Introduction: Drupal is a free and open-source content management system (CMS). A content management system(CMS) is a computer program that allows publishing,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
1/30/11 Hacking your way through the Drupal API, a themers intro Baris Wanschers (BarisW)
OCLC Online Computer Library Center CONTENTdm Migration Training Craig Yamashita Vice President, Technology and Product Development DiMeMa, Inc. July 2005.
Drupal Training Syllabus Chaitanya Lakshmi
How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work.
Administration Tab CiviCRM. Data Organization in CiviCRM: "Building Blocks" Contacts Reports Mail Tags Activities Contribe Member Events and Event Attendences.
Let’s Make An Form! Bonney Armstrong GD 444 Westwood College February 9, 2005.
OCLC Online Computer Library Center CONTENTdm ® Digital Collection Management Software Ron Gardner, OCLC Digital Services Consultant ICOLC Meeting April.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Using Visual Basic 6.0 to Create Web-Based Database Applications
BZUPAGES.COM Presentation on Content Management System (CMS) Presented to. Sir Ahmad Kareem.
Nonprofit? There's an App for That! Drupal Modules for Activism, Donations and other Nonprofit #NYCCamp Benjamin J. Kallos iMediaEDGE
What is Drupal? Open Source software written in php. A CMS or content-management system. A sophisticated web application building tool.
Drupal Jumpstart Information Systems 337 Prof. Harry Plantinga.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
Revolutionizing enterprise web development Searching with Solr.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
0 eCPIC User Training: Resource Library These training materials are owned by the Federal Government. They can be used or modified only by FESCOM member.
AEgir Maintain your Drupal sites. The name: AEgir “In Norse mythology, AEgir was the god of the oceans and if Drupal is a drop of water, AEgir is the.
Drupal Overview Prepared by : Agustin D. Gumogda Jr. Instructor.
Forensic Drupal Debugging Dan Harris daneesia on drupal.org.
Meridium EPiServer Premium Partner EPiMore Partner EPiServer is a major focus area Founded in employees 2.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
Drupal for NGOs 1 Amnesty.org redesign 22 July 2008.
Information Systems | SEPTEMBER 10, 2008 Service Portal Maintenance Understanding the Fundamentals of Drupal.
How does Drupal Work? Information Systems 337 Prof. Harry Plantinga.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
Drupal for client Maria Sherskova skype: sherskova.
Hubnet Training One Health Network South East Asia Network Overview | Public and Members-only Pages; Communicating and Publishing using Blogs and News.
: Information Retrieval อาจารย์ ธีภากรณ์ นฤมาณนลิณี
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Module of the week Webform 7.x-4.0-alpha9 – admin/config/content/webform Add content types, choose allowed fields, default values and advanced options.
INFM 700 Project 3 (Aqua) - Akashdeep Ray - Arnaud Lawson - Neha AR - Vidisha Vedvyas.
Drupal: Content Management and Community for your Library a panel presentation Ilana Kingsley, Univ. of Alaska Fairbanks Rasmuson Library
How to use Drupal Awdhesh Kumar (Team Leader) Presentation Topic.
Khalid Baheyeldin, Toronto, Mar 13, 2007 Building Drupal sites using CCK, Views and Panels Khalid Baheyeldin Drupal Users Group, Toronto.
PHP using MySQL Database for Web Development (part II)
Unit 7 Learning Objectives
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
The Way Eryk Budi Pratama
RMS with Microsoft SharePoint
SiteBuilder 2 Introduction.
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Presentation transcript:

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal: Configuration and Customization Week 4: Installation, Module Development January 25, 2007 Professor Paul Resnick (with help from Michael Hess, as usual)

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Today’s Learning Objectives n At the end of this week, students should be able to: –Debug minor installation and upgrade problems –Explain the major differences between Drupal 4.7 and 5.0 –Explore the code behind a contributed module –Create small custom modules

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal 4.7 Installation n If you don’t have an auto-installer (e.g., fantastico)… n Download and extract the tar.gz file –Place in a web-accessible folder on your server E.g., htdocs n Edit sites/default/settings.php file –Directions in the comments in this file –location of your database –$base_url path n Import the database –Get directions from your ISP –E.g., mysql dbname –u dbuser –ppassword < drupaldb_file

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal 5.0 Installation n If you don’t have an auto-installer (e.g., fantastico)… n Download and extract the tar.gz file –Place in a web-accessible folder on your server E.g., htdocs n Change perms on /sites/default/settings.php to 666 –Owner, group, and other all read/write privileges n Access your Drupal install via web and follow the directions

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Upgrading 4.7 to 5 n See Lullabot screencastscreencast n Note: you can’t do this on cms.si.umich –We have a multi-site installation

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal Security n If you’re the site maintainer… –Join the security mailing list Login to drupal.org My account >> my newsletters –When you get a security alert for a module you’re using Upgrade as soon as you can –When you get a security alert for Drupal core Follow the suggested action ASAP n Do NOT install modules not found on Drupal.org –No security alerting system

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal 5.0 Preview n Key changes –Installation is easier –Administration interface changes –Themes New: Garland Some color changes without changing code –CCK is part of core –Installation Profiles n See Lullabot screencastscreencast

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Some PHP Basics n Semi-colon at end of statements n { } enclose collection of statements n Variables n If-statements n Functions n Arrays n For loops

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu PHP Variables n Variables begin with $ n Set using = $x = 23; n Local unless you specify global global $user;

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu PHP If/Else and Switch/Case if ($op == "list") { stm1; stm2; … } else { } switch ($section) { case “a”: stmt; break; case “b”: stmt; }

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu PHP Function Definition function onthisdate_help($section='') { $output = ''; switch ($section) { case "admin/modules#description": $output = t("Displays links to nodes created on this date"); break; } return $output; } // function onthisdate_help

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu PHP Arrays n Example: an array whose first/only item is an array $items = array(); $items[] = array('path' => 'onthisdate', 'title' => t('on this date'), 'callback' => 'onthisdate_all', 'access' => user_access('access content'), 'type' => MENU_CALLBACK);

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu PHP Foreach Loops

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Extensibility Concepts: Defining Add- ons n Adding new names –Only problem is name collisions Variables in programs– local and global XML markup tags– XML Namespaces n Defining meaning of named items –Set variable values –Define functions

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Extensibility Concepts: Integrating Add-ons n Hooks/callbacks –Base calls the add-on n Function libraries –Add-on calls the base

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu What Programmers Need to Know About Callbacks n How to register the callback so it will be invoked n When the callback will be invoked n Parameters passed and returned

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal Callbacks (Hooks) n Registering a hook –Define a function with the right name _hookname –No separate registration process; will automatically be invoked n When hook will be invoked –Check documentation; look at source code n Parameters passed and returned –api.drupal.org

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal Naming Conventions n One big namespace n Don’t define a module that has same name as any other module n All functions in module begin with prefix – _ For functions that may be invoked from other files –_ _ For private functions

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu What Programmers Need to Know About Library Functions n Parameters passed and returned –See api.drupal.org n Any side effects of the function –E.g., saving a node in the database

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Some Useful Hooks n Documentation Documentation n hook_access n hook_block n hook_cron n hook_menu n hook_settings (4.7; use hook_menu in 5.0) n hook_nodeapi

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Cron.php n When cron.php is executed –Executes the cron hooks for all contributed modules n Set up a UNIX cron job to cause cron.php to be executed periodically –Done for you on cms.si Once per hour n Poormanscron module if you can’t run a cron job on your installation –Checks on each user access whether it’s time to run cron.php

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Some Useful Drupal library functions n Documentation at n Theme related –l(), t() n Node functions Node functions –node_load(), node_save() n Database functions Database functions –Db_query() et al n Forms API Forms API n Access control –User_access()

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Drupal Licensing n Drupal Core is Distributed under GPL –You can modify and redistribute it –You can’t prevent others from doing so –You don’t have to distribute your modifications n If you distribute modifications, must be under GPL –Wiggle room about whether a consultant who gives the module only to a client who paid for its production is distributing it Consult an attorney

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Module Development n Tutorial OnThisDate – n A Sign-me-up custom feature for AARecon

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Devel Module n Menu block –Clear the cache –View variable values n PHP block to execute some code n Display SQL queries used in building a page n Object structure display for current node

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu OnThisDate Tutorial n n Final version of 4.7 code (rename it to OnThisDate.module) Final version of 4.7 code

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Making module information visible n hook_help

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Permission Actions n hook_perm

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Create Block(s) in a Module n hook_block –List op –View op

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Create Module Settings n hook_settings –Add a new variable that can be set through administer >> settings >> this_module

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Create a Page n Define a function that outputs a page n Give it a URL path and/or add it to a menu

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu SignMeUp Custom Module n Adds a link to sign up as the closer n For production we’ll do better –A custom field type using CCK’s API Copy and edit userreference –Button in each of the fields where user can sign up Access controls; don’t allow double sign-up, etc. –Display sign-ups with photos

SCHOOL OF INFORMATION UNIVERSITY OF MICHIGAN si.umich.edu Exercises n Which hook would you use? n Write or modify a module