https://fonts.google.com/?selection.family=Open+Sans
cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip
# see https://github.com/cmaessen/docker-php-sendmail for more information | |
FROM php:5-fpm | |
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/* | |
RUN docker-php-ext-install mysql mysqli sysvsem | |
RUN pecl install xdebug-2.5.5 \ | |
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ |
# Concevoir un projet Drupal | |
## Prérequis | |
* L’utilitaire CLI Drush permettant de manipuler Drupal plus facilement | |
* Un serveur Web opérationnel (Apache / PHP / MySQL de préférence) | |
## Initialisation | |
* Choix de la distribution (classique, commerce, …) | |
* Etendre le profil d’installation de la distribution et configurer au besoin | |
* Ce profil d’installation est considéré comme un module à part entière, il peut |
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:bold); | |
/* Wrapper ------------------------------------------------------ */ | |
#wrapper { | |
text-align: center; | |
font-weight: bold; | |
font: 62.5%/1 "Yanone Kaffeesatz", "Lucida Grande", Lucida, Verdana, sans-serif; | |
margin: 0 auto; |
<?php | |
$keys = array_keys($css); | |
$data = ''; | |
foreach($keys as $key){ | |
$data .= 'unset($css[' . "'$key'])\n"; | |
} | |
dpm($data); |
<?php | |
function mymodule_theme() { | |
return array( | |
'page--mymodule' => array( | |
'render element' => 'node', | |
'template' => 'page--mymodule', | |
'path' => drupal_get_path('module', 'mymodule') . '/templates', | |
), | |
); |
<?php | |
/** | |
* @file | |
* class for MoshioshiUser | |
*/ | |
class MoshiMoshiUser { | |
const WEB_DIRECTORY = 'public_html'; | |
const USER_PREFIX = 'moshimoshiuser'; |
<?php | |
function theme_preprocess_page(&$vars){ | |
$arg1 = arg(1); | |
$arg2 = arg(2); | |
$arg3 = arg(3); | |
if(isset($vars['node'])){ | |
if(!in_array($arg2, array('edit')) && is_numeric($arg1)){ | |
$vars['theme_hook_suggestions'][] = 'page__node__' . $vars['node']->type; |
<?php | |
/** | |
* Implements hook_rules_action_info(). | |
*/ | |
function commerce_extra_rules_action_info() { | |
return array( | |
'ascomedia_commerce_extra_line_item_tax_component_delete' => array( | |
'label' => t('Restore default price'), | |
'parameter' => array( |
<?php | |
/** | |
* Implements hook_commerce_product_calculate_sell_price_line_item_alter(); | |
*/ | |
function custom_commerce_product_calculate_sell_price_line_item_alter(&$line_item){ | |
$name = ''; | |
$products = field_get_items('commerce_line_item', $line_item, 'commerce_product'); | |
foreach($products as $delta => $product){ | |
$product_id = $product['product_id']; |