Skip to content

Instantly share code, notes, and snippets.

View Quevin's full-sized avatar

Kevin Davison Quevin

View GitHub Profile
@Quevin
Quevin / 0_reuse_code.js
Created July 2, 2014 23:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://preview-pharmacy.ucsf.edu/news.xml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<channel>
<title>School of Pharmacy - News</title>
<link>https://preview-pharmacy.ucsf.edu/news.xml</link>
<description></description>
<language>en</language>
<item>
<title>Burchard commentary calls for more diversity in biomedical research </title>
<link>https://preview-pharmacy.ucsf.edu/news/5291/burchard-commentary-calls-more-diversity-biomedical-research</link>
<description>&lt;p&gt;Authoring the lead commentary in the cu
@Quevin
Quevin / is_draft.php
Created January 6, 2015 22:38
Is this a draft?
if (module_exists('workbench_moderation')) {
// Is this a draft?
// dpm($vars);
$vars['is_draft'] = FALSE;
$state = $node->workbench_moderation;
if (!empty($state['published']) && $state['published']->vid != $state['current']->vid) {
$vars['is_draft'] = TRUE;
}
}
@Quevin
Quevin / pharmacyoa_is_front_settings.php
Last active August 29, 2015 14:12
Pharmacyoa template.php snippet to show how we may get $is_front TRUE/FALSE w/ or w/o a "front page" in draft state on a Lab site or otherwise...
// set up $node
if ( isset($vars['node']) ) {
$node = $vars['node'];
}
// Is this the front page?
if (module_exists('workbench_moderation')) {
if (module_exists('domain')) {
global $_domain;
// Get the domain site_frontpage path for this domain
html.cke_panel_container
, body.webedit-content {
.columns-2
, .columns-3
, .columns-4 {
&:before {
display: block;
border-bottom: 1px dashed $ucsf-gray;
font-size: 12px;
color: $ucsf-gray;
rr
updb
fr ucsf_starterkit_images|ucsf_starterkit_images
fr ucsf_pharmacy_images|ucsf_pharmacy_images
fr ucsf_pharmacy_syndicated_events|ucsf_pharmacy_syndicated_events
pm-disable better_login|better_login
pm-uninstall better_login|better_login
cc all
<?php
/**
* @file
* UCSF workbench tweaks module using the workbench_moderation API.
*/
/**
* Allows modules to respond to state transitions.
*
@Quevin
Quevin / drupal_get_path.tpl.php
Last active August 29, 2015 14:18
way to include a file from another TPL/theme
include drupal_get_path('theme','pharmacyoa') . '/templates/footer.tpl.php';
@Quevin
Quevin / date_all_day_template.php
Created April 16, 2015 18:10
When using date_all_day module and you want to alter how it looks when returned everywhere
/**
* Theme the way an 'all day' label will look.
*/
function pharmacyoa_date_all_day_label() {
return '(' . t('all day', array(), array('context' => 'datetime')) .')';
}
@Quevin
Quevin / workbench_moderation-referenc-linkchecker.module
Last active August 29, 2015 14:19
Some helpful reference to workbench_moderation
<?php
/**
* Checks if this entity is the default revision (published).
*
* @param object $entity
* The entity object, e.g., $node.
*
* @return bool
* TRUE if the entity is the default revision, FALSE otherwise.