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_init(). | |
*/ | |
function message_example_init() { | |
$arguments = array( | |
'@view' => array( | |
'callback' => 'message_example_view', | |
'pass message' => TRUE, | |
) | |
); |
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
$query = $this->view->build_info['query']; | |
$output = ((string)$query); | |
foreach ($query->getArguments() as $key => $value) { | |
$output = str_replace($key, '"' . $value. '"', $output); | |
} | |
$output = str_replace(array('{', '}'), '', $output); | |
dpm($output); |
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
/** | |
* Profile task; Attach OG related fields. | |
*/ | |
function kaveret_og_setup() { | |
// Group type. | |
og_create_field(OG_GROUP_FIELD, 'node', 'project'); | |
og_create_field(OG_ACCESS_FIELD, 'node', 'project'); | |
// Group content type |
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
// Enable Entity-reference prepopulate. | |
$og_field['instance']['settings']['behaviors']['prepopulate'] = array( | |
'status' => TRUE, | |
'action' => 'hide', | |
'action_on_edit' => TRUE, | |
'fallback' => 'redirect', | |
'og_context' => TRUE, | |
); |
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_views_query_alter(). | |
*/ | |
function devel_views_query_alter(&$view, &$query) { | |
if (empty($query->where[1]['conditions'][1]['field'])) { | |
return; | |
} | |
$sub_query = $query->where[1]['conditions'][1]['field']; | |
if (!$conditions = &$sub_query->conditions()) { | |
return; |
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
drush si -y openscholar --account-pass=admin --db-url=mysql://root:root@localhost/os --uri=http://local:8888/os openscholar_flavor_form.os_profile_flavor=development openscholar_install_type.os_profile_type=vsite | |
drush vset purl_base_domain http://local:8888/os | |
drush en -y os_migrate_demo |
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
if (!module_exists('biblio') || !module_exists('libraries')) { | |
return; | |
} | |
biblio_create_field('biblio_year', 'biblio', 'book'); | |
biblio_create_field('biblio_abstract', 'biblio', 'book'); | |
biblio_create_field('biblio_image', 'biblio', 'book'); | |
biblio_create_field('biblio_pages', 'biblio', 'book'); | |
biblio_create_field('contributor_collection', 'biblio', 'book'); |
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
biblio_create_field('biblio_year', 'biblio', 'book'); | |
biblio_create_field('biblio_abstract', 'biblio', 'book'); | |
biblio_create_field('biblio_image', 'biblio', 'book'); | |
biblio_create_field('biblio_pages', 'biblio', 'book'); | |
biblio_create_field('contributor_collection', 'biblio', 'book'); | |
biblio_create_field('biblio_contributor', 'field_collection_item', 'contributor_field_collection'); | |
biblio_create_field('biblio_contributor_roles', 'field_collection_item', 'contributor_field_collection'); | |
$biblio = biblio_create('book'); |
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
if (!module_exists('biblio') || !module_exists('libraries')) { | |
return; | |
} | |
biblio_create_field('biblio_issued', 'biblio', 'book'); | |
biblio_create_field('biblio_abstract', 'biblio', 'book'); | |
biblio_create_field('biblio_image', 'biblio', 'book'); | |
biblio_create_field('biblio_pages', 'biblio', 'book'); | |
biblio_create_field('biblio_contributor', 'biblio', 'book'); |
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 | |
if (!module_exists('biblio') || !module_exists('libraries')) { | |
return; | |
} | |
biblio_create_field('biblio_issued', 'biblio', 'book'); | |
biblio_create_field('biblio_abstract', 'biblio', 'book'); | |
biblio_create_field('biblio_image', 'biblio', 'book'); | |
biblio_create_field('biblio_pages', 'biblio', 'book'); |