This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Re-usable stuff. | |
* | |
* @FIXME multifield function seems not to work in included several times in the same page. | |
*/ | |
/** | |
* Implements hook_theme() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// limit scope fo our variable, and pass Jquery object as "$". | |
(function ($) { | |
Drupal.behaviors.rf_frequence = { | |
attach : function (context){ | |
popup_open(context); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
module_load_include('crud.inc', 'content', 'includes/content'); | |
$field = content_field_instance_read(array('field_name' => 'field_obsarticle_image')); | |
$field[0]['display_settings'][4]['exclude'] = 1; | |
content_field_instance_update($field[0]); | |
dpm($field); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Script to bootstrap Drupal 7 for PHPUnit tests. | |
* On multisite installation, set $http_host variable | |
* to the site you want to test. | |
*/ | |
/*===================== | |
SETTINGS | |
====================*/ | |
// set here drupal root path | |
$drupal_root = guessDrupalRootPath(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check if user has one of the roles passed as an array | |
* | |
* @param array $roles : array of roles as int (rid stored in database. | |
* @param int $user_id : optionnal, default to current user if not defined | |
* @return bool | |
*/ | |
function user_has_role($roles = array(), $user_id = null) { | |
if (is_null($user_id)) { | |
$user_id = $GLOBALS['user']->uid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const endpoint = 'https://public-api.wordpress.com/wp/v2/sites/yineo.fr' | |
const axios = require('axios') | |
async getPosts (perPage = 10) { | |
return {data} = await axios.get(endpoint + '/posts?_embed&per_page=' + perPage) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="homepage"> | |
<h1>Les dernières Articles</h1> | |
<div class="article" v-for="article in articles"> | |
<h2> {{ article.title }} </h2> | |
<p> {{ article.content }} </p> | |
</div> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Create automatically a Bulma css Grid from :items | |
USAGE : | |
<bulma-grid :items="yourItems" itemsByRow="3"> | |
<template scope="row"> | |
<recipe-card :node="row.item"></recipe-card> | |
</template> |
OlderNewer