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
function views_field_view_views_data_alter(&$data) { | |
$data['views']['view'] = array( | |
'title' => t('View'), | |
'help' => t('Embed a view as field. This can cause slow performance, so enable some caching.'), | |
'field' => array( | |
'handler' => 'views_field_view_handler_field_view', | |
), | |
); | |
$data['views']['view_field'] = array( | |
'title' => t('View'), |
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
function xml_to_array(SimpleXMLIterator $xml) { | |
$out = array(); | |
foreach ($xml as $key => $value) { | |
if ($xml->hasChildren()) { | |
$out[$key] = xml_to_array($value); | |
} | |
else { | |
if ($attributes = (array) $value->attributes()) { | |
$out['#attributes'] = $attributes['@attributes']; |
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 | |
* Tests different parts of the ctools export system. | |
*/ | |
/** | |
* Tests export crud. | |
*/ |
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
/** | |
* @todo. | |
*/ | |
public function pack($exportable) { | |
$data = array(); | |
foreach ($this->schema['fields'] as $field => $info) { | |
if (isset($exportable->{$field})) { | |
$data[$field] = $exportable->{$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
public function getExporter() { | |
if (empty($this->exporter)) { | |
if (class_exists($this->info['exporter class'])) { | |
$reflection = new \ReflectionClass($this->info['exporter class']); | |
if ($reflection->implementsInterface('Drupal\ctools\ExporterInterface')) { | |
$this->exporter = $reflection->newInstance(); | |
} | |
else { | |
return FALSE; | |
} |
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
$array_view = (array) views_get_view('archive'); | |
foreach ($array_view['display'] as $key => $display) { | |
$array_view['display'][$key] = (array) $display; | |
} | |
dpm($array_view); |
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
'backlinks' => array( | |
'disabled' => false, | |
'vid' => '1', | |
'name' => 'backlinks', | |
'description' => 'Displays a list of nodes that link to the node, using the search backlinks table.', | |
'tag' => 'default', | |
'base_table' => 'node', | |
'human_name' => 'Backlinks', | |
'core' => '0', | |
'display' => |
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 | |
* Definition of Drupal\views\Tests\Ui\Wizard\Helper. | |
*/ | |
namespace Drupal\views\Tests\Ui\Wizard; | |
use ViewsSqlTest; |
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 | |
function get_token_value($token, $values, $view) { | |
$value = NULL; | |
$token_info = $this->get_token_argument($token); | |
$arg = $token_info['arg']; | |
$token_type = $token_info['type']; | |
// Collect all of the values that we intend to use as arguments of our single query. | |
if (isset($view->field[$arg])) { |
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
class views_handler_filter_entity_type extends views_handler_filter_in_operator { | |
function get_value_options() { | |
if (!isset($this->value_options)) { | |
$table_data = views_fetch_data($this->view->base_table); | |
$this->entity_type = $table_data['table']['entity type']; | |
$info = entity_get_info($this->entity_type); | |
$types = $info['bundles']; | |
$this->value_title = t('@entity types', array('@entity' => $info['label'])); | |
$options = array(); |
OlderNewer