Created
October 21, 2016 14:14
-
-
Save DuaelFr/550102abeb1d73e7f84f04e1b1348098 to your computer and use it in GitHub Desktop.
Bean creation on install
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_install(). | |
*/ | |
function my_module_install() { | |
$bean = bean_create(array('type' => 'simple')); | |
$bean->label = 'Mon bloc simple custom'; | |
$bean->title = ''; | |
$bean->delta = 'my-delta'; | |
$bean->field_content = array( | |
LANGUAGE_NONE => array( | |
0 => array( | |
'value' => '<p>Valeur de base qui pourra être administrée après</p>', | |
'format' => 'full_html', | |
'safe_value' => '<p>Valeur de base qui pourra être administrée après</p>', | |
) | |
), | |
); | |
$bean->save(); | |
} | |
/** | |
* Implements hook_uninstall(). | |
*/ | |
function my_module_uninstall() { | |
bean_load_delta('my-delta')->delete(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment