This file contains hidden or 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
/** | |
* Implements hook_theme_registry_alter(). | |
* | |
* @param $theme_registry | |
* Drupal theme registry that could be changed. | |
*/ | |
function azr_catalog_theme_registry_alter(&$theme_registry) { | |
if (($key = array_search('crumbs_preprocess_page', $theme_registry['page']['preprocess functions'])) !== NULL) { | |
unset($theme_registry['page']['preprocess functions'][$key]); | |
} |
This file contains hidden or 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
function ft_pm_articles_views_pre_view(&$view){ | |
$display_id = $view->current_display; | |
if ($display_id == 'related_articles') { | |
_set_views_options($view, $display_id, 'field_article_category'); | |
} | |
elseif ($display_id == 'related_news') { | |
_set_views_options($view, $display_id, 'field_tags'); | |
} | |
} |
This file contains hidden or 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
function getCSVheader() { | |
$index = 1; | |
$numempty = 0; | |
$rows = _data_import_read_file($this->importArguments['file'], $this->importArguments['csvOptions']['delimiter']); | |
$header = array_shift($rows); | |
foreach($header as $title) { | |
if (!$this->importArguments['csvOptions']['header_rows']) { | |
$columns["col_$index"] = t('Column #!column', array('!column' => $index)); |
This file contains hidden or 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 | |
/** | |
* Wildcard loader for '%master_class' | |
* Add additional check after node_load() func. | |
* @param $nid | |
* @return bool|mixed | |
*/ | |
function master_class_load($nid) { | |
$node = node_load($nid); | |
$condition = $node->type == 'master_class' && $node->status == 1; |
This file contains hidden or 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
function yourtheme_alpha_preprocess_html(&$vars) { | |
$classes = array(); | |
$contexts = context_active_contexts(); | |
// Add delta names as css classes for <body> | |
foreach ($contexts as $context) { | |
if (isset($context->reactions['delta']) && ($delta_name = $context->reactions['delta']['delta_template'])) { | |
$classes[] = drupal_html_class($delta_name); | |
} | |
} |
This file contains hidden or 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
function yourtheme_preprocess_page(&$vars) { | |
$contexts = context_active_contexts(); | |
// Add delta based tpl. | |
foreach ($contexts as $context) { | |
if (isset($context->reactions['delta']) && ($delta_name = $context->reactions['delta']['delta_template'])) { | |
$vars['theme_hook_suggestions'][] = 'page__'. $delta_name; | |
} | |
} | |
} |
This file contains hidden or 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
function entity_property_values_create_entity($entity_type, $values = array()) { | |
if (entity_type_supports($entity_type, 'create')) { | |
$info = entity_get_info($entity_type); | |
// Create the initial entity by passing the values for all 'entity keys' | |
// to entity_create(). | |
$entity_keys = array_filter($info['entity keys']); | |
$creation_values = array_intersect_key($values, array_flip($entity_keys)); | |
// In case the bundle key does not match the property that sets it, ensure | |
// the bundle key is initialized somehow, so entity_extract_ids() |
This file contains hidden or 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
end($array); | |
$referenceToLastElement = &$array[key($array)]; |
This file contains hidden or 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
var myApp = angular.module('myApp', []); | |
var baseService = function () { | |
this._state = {}; | |
}; | |
baseService.prototype.getState = function () { | |
return this._state; | |
}; | |
baseService.prototype.setState = function (state) { | |
this._state = state; |
This file contains hidden or 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
(function () { | |
function ParentService(arg1) { | |
this.arg1 = arg1; | |
} | |
function ChildService(arg1, arg2) { | |
ParentService.call(this, arg1); | |
this.arg2 = arg2; | |
} |
OlderNewer