Skip to content

Instantly share code, notes, and snippets.

View colemanw's full-sized avatar
🎯
Focusing

colemanw

🎯
Focusing
View GitHub Profile
@colemanw
colemanw / font-awesome-mime-type-icons.php
Last active March 11, 2024 04:21 — forked from guedressel/font-awesome-mime-type-icons.php
Font Awesome File Icons: Mapping MIME Types to correct icon classes
<?php
/**
* Get font awesome file icon class for specific MIME Type
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551
*
*/
function ($mime_type) {
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
$icon_classes = array(
@colemanw
colemanw / webform_civicrm.utils.diff
Last active February 21, 2019 17:19
Add tag fields for multiple entities
diff --git a/includes/utils.inc b/includes/utils.inc
index dc502c5..97757dc 100644
--- a/includes/utils.inc
+++ b/includes/utils.inc
@@ -806,16 +806,6 @@ function wf_crm_get_fields($var = 'fields') {
'table' => 'group',
'expose_list' => TRUE,
);
- $tagsets = array('' => t('Tag(s)')) + CRM_Core_BAO_Tag::getTagSet('civicrm_contact');
- foreach ($tagsets as $pid => $name) {
<?php
/**
* Trait mixed into BAOs who support bulk-save operations
*/
trait CRM_Core_BulkSaveTrait {
/**
* @param $params
* @return CRM_Core_DAO|NULL
@colemanw
colemanw / cowModule.js
Last active July 19, 2021 17:15
Traits for AngularJS controllers
angular.module('cowModule').factory('cowTrait', function() {
// Private function (not available to controller using this trait)
function getSound() {
return 'Moo';
}
// Public properties & methods for use as a trait
return {
cows: 0,
<?php
use Civi\Api4\Contribution;
<?php
namespace Civi\Mixin\EntityTypesXmlV1;
class Loader {
private \CRM_Extension_MixInfo $mixInfo;
public function __construct(\CRM_Extension_MixInfo $mixInfo) {
$this->mixInfo = $mixInfo;