update 2.2 + precedent custom commits
Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
@@ -6,9 +6,9 @@ hidden = TRUE
|
||||
dependencies[] = wysiwyg
|
||||
files[] = wysiwyg_test.module
|
||||
|
||||
; Information added by drupal.org packaging script on 2011-06-19
|
||||
version = "7.x-2.1"
|
||||
; Information added by drupal.org packaging script on 2012-10-02
|
||||
version = "7.x-2.2"
|
||||
core = "7.x"
|
||||
project = "wysiwyg"
|
||||
datestamp = "1308450722"
|
||||
datestamp = "1349213776"
|
||||
|
||||
|
||||
@@ -5,3 +5,46 @@
|
||||
* Testing functionality for Wysiwyg module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_menu().
|
||||
*/
|
||||
function wysiwyg_test_menu() {
|
||||
$items['wysiwyg-test/ajax'] = array(
|
||||
'title' => 'Ajaxified form',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('wysiwyg_test_ajax_form'),
|
||||
'access callback' => TRUE,
|
||||
);
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Form constructor for an ajaxified form lazy-loading a textarea.
|
||||
*/
|
||||
function wysiwyg_test_ajax_form($form, &$form_state) {
|
||||
$form['enable'] = array(
|
||||
'#type' => 'checkbox',
|
||||
'#title' => 'Load textarea',
|
||||
'#ajax' => array(
|
||||
'callback' => 'wysiwyg_test_ajax_form_callback',
|
||||
'wrapper' => 'ajax-wrapper',
|
||||
),
|
||||
);
|
||||
$form['wrapper'] = array(
|
||||
'#type' => 'container',
|
||||
'#id' => 'ajax-wrapper',
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* #ajax callback for wysiwyg_test_ajax_form().
|
||||
*/
|
||||
function wysiwyg_test_ajax_form_callback($form, &$form_state) {
|
||||
$form['body'] = array(
|
||||
'#type' => 'text_format',
|
||||
'#default_value' => '',
|
||||
);
|
||||
form_builder($form['form_id']['#value'], $form, $form_state);
|
||||
return $form['body'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user