- May 2011 (2)
- June 2011 (1)
- August 2011 (1)
- December 2011 (1)
Blog
ESCI Beta PreviewSubmitted by tenken on Fri, 12/02/2011 - 08:54Long time since a last post. I have been working non-stop for about 1 month and a bit on the UCSB ESCI Website. ESCI is UCSB's campus-wide course survey and evaluation tool which has been in production for the last 30 years here at UCSB. My parent department runs the ESCI Survey System which has historically been scantron based and processed, tabulated once at the end of every quarter. To be more Green, sustainable and adaptive in the future we are moving this service to a web based service for students and faculty alike here at UCSB. I have been working on a Drupal based replacement for the scantrons students previously were submitting. This service is now in a Beta test with approximately 500 students. The next big rollout approaching campus wide usage is planned for March. Given some free time in the near future I will try to discuss some of its current underlying implementation involving Drupal and a brief look at its integration and consumption of campus and departmental data and webservices it currently uses. |
Attending DrupalCampLA2011Submitted by tenken on Fri, 08/05/2011 - 08:06I will be attending DrupalCampLA2011 at the University of California Irvine this weekend. See you all there. |
Creating D7 OG groups programmaticallySubmitted by tenken on Thu, 06/16/2011 - 09:50This is a crosspost to a D.o issue I replied to since I recently had to create groups programmatically in Drupal 7. Drupal 6/7 have drupal_execute() for D6 and drupal_form_submit() for D7 to programmatically submit forms. If you install OG and create a content type for your groups -- you can then programmatically submit the form via a Drush script or a module update using core drupal functions. An example of inspecting, and how to understand a POST of node creation form and also using drupal_form_submit() can be found here, and some nifty Firebug usage: Programmatically create nodes tutorial As an example the php script I created and then ran via "drush php-script" was as follows to create about a dozen groups on-the-fly in D7:
/*
* Eg filename "make-groups.php"
* run via "drush -l {SITENAME_URI} php-script make-groups.php
*/
|
Adding SunlightJS Syntax Highlighter to Drupal 7Submitted by tenken on Mon, 05/02/2011 - 22:42Curiously looking for a decent, extensible syntax highlighting package to add to this blog I stumbled across sunlightjs which supports colorschemes, language definitions and gracefully degrades. Simply extracting the sunlightjs sourcecode archive to your Drupal /themes folder and applying the following additions to your theme.info file will essentially make this package work on your drupal site. stylesheets[all][] = sunlight-1.8.341/themes/sunlight.dark.css scripts[] = sunlight-1.8.341/sunlight-min.js scripts[] = sunlight-1.8.341/lang/sunlight.bash-min.js scripts[] = sunlight-1.8.341/lang/sunlight.javascript-min.js scripts[] = sunlight-1.8.341/lang/sunlight.mysql-min.js scripts[] = sunlight-1.8.341/lang/sunlight.nginx-min.js scripts[] = sunlight-1.8.341/lang/sunlight.php-min.js scripts[] = sunlight-1.8.341/lang/sunlight.ruby-min.js Lastly, you must activate sunlightjs for the content in question. For this site I essentially want syntax highlighting within the blog section of the site. So we'll write a simple module function for davidgurba.com that inserts the activation javascript from the sunlightjs documentation page for all blog pages.
/** implementation of hook_node_view() */
function dgcom_node_view($node, $view_mode, $langcode) {
if ($node->type === 'blog_entry') {
drupal_add_js('Sunlight.highlightAll();',
array('type' => 'inline', 'scope' => 'footer', 'weight' => 5)
);
}
}
This blog post is an example of "eating your own dog food", eg this post utilizes all the code discussed herein. |
More to Come ...Submitted by tenken on Mon, 05/02/2011 - 21:43I will try to post interesting coding tidbits I produce or come across here. Mainly at work I have been developing software solutions using the Drupal CMS. Hopefully I will be able to post various coding techniques or innovations I author on behalf of my work. I also want to show other interests I have in this spot such as reading and martial arts. Have a great day! |