diff botcha_d6/botcha/1.patch botcha_d7/botcha/1.patch 2c2 < index 8acd10a..0a89127 100644 --- > index 47495df..53da50a 100644 Только в botcha_d6/botcha/: 2.patch diff botcha_d6/botcha/botcha.info botcha_d7/botcha/botcha.info 4c4,5 < core = 6.x --- > core = 7.x > configure = admin/config/people/botcha 6,10d6 < ; For lazy-load via files[] like in D7. < dependencies[] = autoload < ; For db_* functions like in D7. < dependencies[] = dbtng < ; To turn a module into an Application. 12d7 < 27,28c22 < ; Unfortunately we can't write update tests for D6 - can we? < ;files[] = tests/upgrade/update.botcha.test \ В конце файла нет новой строки --- > files[] = tests/upgrade/update.botcha.test \ В конце файла нет новой строки diff botcha_d6/botcha/botcha.install botcha_d7/botcha/botcha.install 11c11 < * Implementation of hook_schema(). --- > * Implements hook_schema(). 153c153 < * Implementation of hook_requirements(). --- > * Implements hook_requirements(). 192,194c192,193 < 'comment_form', < 'contact_mail_page', < 'contact_mail_user', --- > 'contact_personal_form', > 'contact_site_form', 200c199 < 'user_register', --- > 'user_register_form', 201a201,204 > // Add form_ids of comment forms for all currently known node types too. > foreach (node_type_get_names() as $type => $name) { > $form_ids[] = 'comment_node_' . $type . '_form'; > } 206c209 < * Implementation of hook_install(). --- > * Implements of hook_install(). 210d212 < drupal_install_schema('botcha'); 217d218 < /* @todo Find a way to force autoloading of Botcha class during Simpletest is installing Botcha. 221,227d221 < * < */ < // Explain to users that page caching may be disabled. < if (variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED) { < drupal_set_message($t('Note that BOTCHA module disables page caching of pages that include forms processed by BOTCHA. ', < array('%performance_admin' => url('admin/settings/performance'))), 'warning'); < } 234,235c228,229 < botcha_update_6200(); < botcha_update_6201(); --- > botcha_update_7200(); > botcha_update_7201(); 241c235 < * Implementation of hook_enable(). --- > * Implements hook_enable(). 244,245d237 < // This enables autoload magic. < autoload_flush_caches(); 252c244 < * Implementation of hook_uninstall(). --- > * Implements hook_uninstall(). 255d246 < drupal_uninstall_schema('botcha'); 268d258 < * Implementation of hook_update_N(). 271c261 < function botcha_update_6200() { --- > function botcha_update_7200() { 278d267 < $ret = array(); 280c269 < db_create_table($ret, 'botcha_form', $schema_definition['botcha_form']); --- > db_create_table('botcha_form', $schema_definition['botcha_form']); 283c272 < db_create_table($ret, 'botcha_recipe', $schema_definition['botcha_recipe']); --- > db_create_table('botcha_recipe', $schema_definition['botcha_recipe']); 286c275 < db_create_table($ret, 'botcha_recipebook', $schema_definition['botcha_recipebook']); --- > db_create_table('botcha_recipebook', $schema_definition['botcha_recipebook']); 289c278 < db_create_table($ret, 'botcha_recipebook_form', $schema_definition['botcha_recipebook_form']); --- > db_create_table('botcha_recipebook_form', $schema_definition['botcha_recipebook_form']); 292c281 < db_create_table($ret, 'botcha_recipebook_recipe', $schema_definition['botcha_recipebook_recipe']); --- > db_create_table('botcha_recipebook_recipe', $schema_definition['botcha_recipebook_recipe']); 313c302 < $ret[] = db_merge('botcha_recipebook') --- > db_merge('botcha_recipebook') 323c312 < $ret[] = db_merge('botcha_form') --- > db_merge('botcha_form') 330c319 < $ret[] = $query->fields(array('rbid' => 'forbidden_forms'))->execute(); --- > $query->fields(array('rbid' => 'forbidden_forms'))->execute(); 333c322 < $ret[] = $query->fields(array('rbid' => 'default'))->execute(); --- > $query->fields(array('rbid' => 'default'))->execute(); 371c360 < $ret[] = db_merge('botcha_recipe') --- > db_merge('botcha_recipe') 383c372 < $ret[] = db_insert('botcha_recipebook_recipe') --- > db_insert('botcha_recipebook_recipe') 396c385 < $ret[] = db_insert('botcha_recipebook_recipe') --- > db_insert('botcha_recipebook_recipe') 404c393 < db_drop_table($ret, 'botcha_points'); --- > db_drop_table('botcha_points'); 406d394 < return $ret; 412,413c400 < function botcha_update_6201() { < $ret = array(); --- > function botcha_update_7201() { 424d410 < return $ret; diff botcha_d6/botcha/botcha.module botcha_d7/botcha/botcha.module 277,278c277,278 < $query = drupal_query_string_encode($query); < //$query = drupal_http_build_query($query); --- > //$query = drupal_query_string_encode($query); > $query = drupal_http_build_query($query); 283,284c283,284 < $path = drupal_urlencode($prefix . $path); < //$path = drupal_encode_path($prefix . $path); --- > //$path = drupal_urlencode($prefix . $path); > $path = drupal_encode_path($prefix . $path); 332c332 < * Implementation of hook_boot(). --- > * Implements hook_boot(). 395c395 < * Implementation of hook_theme(). --- > * Implements hook_theme(). 401,402c401 < 'arguments' => array('form' => NULL), < 'file' => 'botcha.admin.inc', --- > 'render element' => 'form', 405,406c404 < 'arguments' => array('form' => NULL), < 'file' => 'botcha.admin.inc', --- > 'render element' => 'form', 415,418c413,414 < function theme_botcha_forms_form_botcha_forms($form) { < // @todo Abstract it. < // "Add BOTCHA protection to the form" link. < $output = l(t('Add BOTCHA protection to the form'), Botcha::ADMIN_PATH . '/form/add'); --- > function theme_botcha_forms_form_botcha_forms($variables) { > $form = $variables['form']; 430c426 < $output .= theme('table', $header, $rows); --- > $output = theme('table', array('header' => $header, 'rows' => $rows)); 437,442c433,434 < function theme_botcha_recipebooks_form($form) { < // @todo Abstract it. < // "Add recipebook" link. < $output = l(t('Add recipe book'), Botcha::ADMIN_PATH . '/recipebook/add'); < // Prepare header before pass to theme. < $header = $form['#header']; --- > function theme_botcha_recipebooks_form($variables) { > $form = $variables['form']; 445,450c437,458 < foreach (element_children($form['recipebooks']) as $id) { < $row = array(); < foreach (element_children($form['recipebooks'][$id]) as $col) { < $row[$col] = drupal_render($form['recipebooks'][$id][$col]); < } < $rows[$id] = $row; --- > //foreach (array('enabled', 'disabled') as $type) { > // if (isset($form[$type])) { > foreach (element_children($form['recipebooks']) as $id) { > $row = array(); > foreach (element_children($form['recipebooks'][$id]) as $col) { > $row[$col] = array( > 'data' => drupal_render($form['recipebooks'][$id][$col]), > ); > } > $rows[] = array( > 'data' => $row, > ); > } > // } > //} > $output = theme('table', array( > 'header' => $form['#header'], > 'rows' => $rows, > 'empty' => t('No recipebooks available.'), > )); > if (!empty($rows)) { > $output .= drupal_render_children($form); 452d459 < $output .= theme('table', $header, $rows); 454,477c461 < } < < /** < * Process form callback for BOTCHA form. < * Using hooking mechanism that is a hack - we want to come in before #process, < * but our _form_alter() is way too early (we want to let it use cache for all other < * modules & data). Ideal would be to have #process callback < * work on the form, but FAPI does not call it on forms, despite the < * documentation stating that it does. In fact, D6 code needs '#input'=TRUE on < * the element to get into calling #process callbacks. So we set '#input'=>TRUE < * on the form when inserting our callback into form['#process'], and it forces < * the FAPI to call that code path and we get our intercept. Works like a charm! < */ < function botcha_fprocess($element, $edit, &$form_state, $complete_form) { < // Prevent caching of the page with BOTCHA elements. < // This needs to be done even if the BOTCHA will be ommitted later: < // other untrusted users should not get a cached page. < global $conf; < $conf['cache'] = CACHE_DISABLED; < // This temporarily disables cache (for this page request) < unset($element['#cache']); < return $element; < } < // END --- > } \ В конце файла нет новой строки diff botcha_d6/botcha/botcha.rules.inc botcha_d7/botcha/botcha.rules.inc 9c9 < * Implementation of hook_rules_event_info(). --- > * Implements hook_rules_event_info(). 16,17c16,17 < 'arguments' => botcha_rules_events_hook_arguments(), < 'module' => 'BOTCHA', --- > 'group' => t('BOTCHA'), > 'variables' => botcha_rules_events_hook_variables(), 22,23c22,23 < 'arguments' => botcha_rules_events_hook_arguments(), < 'module' => 'BOTCHA', --- > 'group' => t('BOTCHA'), > 'variables' => botcha_rules_events_hook_variables(), 31c31 < function botcha_rules_events_hook_arguments() { --- > function botcha_rules_events_hook_variables() { 64c64 < ) + rules_events_global_user_argument(); --- > ); 68c68 < * Implementation of hook_rules_action_info(). --- > * Implements hook_rules_action_info(). diff botcha_d6/botcha/CHANGELOG.txt botcha_d7/botcha/CHANGELOG.txt 1c1 < botcha 6.x-1.x-dev --- > botcha 7.x-1.x-dev 8a9 > [#1800406] by drclaw: Fixed array merge error in _form_set_class() 12c13 < botcha 6.x-1.8, 2012-05-02 --- > botcha 7.x-1.0, 2012-05-02 13a15,35 > [#1045192] Port to D7 > [#1510082] Fixed form rebuild was not happening properly - D7 ignores global $conf['cache'] and needs $form_state['no_cache'] instead > [NOISSUE] Removed global $conf['cache'] = 0, all notes on performance and caching > [NOISSUE] Reworded "Form session reuse detected" message, added "Please try again..." > [NOISSUE] Copied some goodies from CAPTCHA, added update_7000 to rename form ids in BOTCHA points > [#1075722] Cleanup, looks like sessions are handled properly for D7 (different from D6) > [#1511034] Fixed "Undefined vaiable t in botcha_install line 117" > [#1511042] Added configure path to botcha.info > [#1534350] Fixed comments crash (due to remnant D6 hack) > [NOISSUE] Refactoring: Allow named recipe books other than 'default'; Use form_state to pass '#botcha' value > [NOISSUE] Fixed lost recipe selector for add new on BOTCHA admin page > [NOISSUE] Remove Captcha integration text from help if Captcha module is not present > [NOISSUE] Remove hole in user_login_block protection when accessed via /admin/ path > [NOISSUE] Reworked _form_alter and _form_validate workings to allow clean reset of default values > [NOISSUE] Added simple honeypot recipe suitable for simpletest (no JS) > [NOISSUE] Added simpletest test cases > [#1544124] Fixed drush crash in rules integration due to API changes in rules 7.x-2.x > > > botcha 6.x-1.x-dev > ------------------ 25,91d46 < [NOISSUE] Fixed warning in rules integration < < < botcha 6.x-1.7, 2011-09-22 < -------------------------- < [#1180272] Rules integration - botcha_form_approved, botcha_form_rejected, botcha_rules_action_regenerate_seed < [#1004218] Rearranging text order for screen readers again < [#1004218] Added CSS visibility:hidden for screen readers < [#1285092] Make Javascript message more user friendly < [NOISSUE] Filter sensitive form data from detailed BOTCHA logs < [#1075722] by kndr: Compatibility with pressflow < < < botcha 6.x-1.6, 2011-08-27 < -------------------------- < [Roadmap, #1044368] Added forms list to configuration page < [Roadmap] Added admin link option to add/edit BOTCHA to forms < [NOISSUE] Added 'skip BOTCHA' permission < [NOISSUE] Cleanup admin/user/botcha/botcha paths < [#1058110] Fixed validation priority on user_login* forms < [NOISSUE] Fixed missing call to drupal_install_schema in install. duh! < [#1004218] Addition for screen readers. Apparently, they don't hande CSS display:none. < [#1089522] Fixed warning: array_unshift() [function.array-unshift]: The first argument should be an array < < < botcha 6.x-1.5, 2011-02-01 < -------------------------- < [NOISSUE] Fixed url query string for non-clean URLs < [#1024106] Fixed problem with Drupal installations in subfolder < < < botcha 6.x-1.4, 2010-12-19 < -------------------------- < [NOISSUE] Secret key setting and random generator < [NOISSUE] Secret key generation upon install < [NOISSUE] Clarify loglevels < [NOISSUE] Some weird statistics glitch - counters not self-initialized (cache problem?) < [NOISSUE] Added "No Resubmit" recipe < [NOISSUE] Split Botcha worker code into new botcha.botcha.inc < [NOISSUE] Changed 'noresubmit' recipe error message to account for humans pressing "back" and resubmit < [NOISSUE] Fixed wrong URL and skipped user/register for multi-lingual sites < [NOISSUE] Fixed skipped user/register for non-clean URLs < < < botcha 6.x-1.3, 2010-12-07 < -------------------------- < [#991416] Fixed WSOD upon install < < < botcha 6.x-1.2, 2010-12-07 < -------------------------- < [NOISSUE] Unneeded code removed < [NOISSUE] Added format to % blocked statistics on status < [NOISSUE] README.txt updated < < < botcha 6.x-1.1, 2010-12-07 < -------------------------- < [NOISSUE] Updated README.txt; Split todo items from README.txt into TODO.txt < < < botcha 6.x-1.0, 2010-11-26 < -------------------------- < [NOISSUE] Initial commit, First Release < [NOISSUE] First working code, release v1.0 < [ROADMAP] Added statistic counters < [ROADMAP] Addded some configuration settings Общие подкаталоги: botcha_d6/botcha/controller и botcha_d7/botcha/controller Общие подкаталоги: botcha_d6/botcha/.git и botcha_d7/botcha/.git Общие подкаталоги: botcha_d6/botcha/model и botcha_d7/botcha/model diff botcha_d6/botcha/README.txt botcha_d7/botcha/README.txt 75c75 < Module starts working as soon as it is activated. There are reasonable default settings and no configuration is required, though it can be adjusted at any time on Administer > User management > BOTCHA page. --- > Module starts working as soon as it is activated. There are reasonable default settings and no configuration is required, though it can be adjusted at any time on Administration > Configuration > People > BOTCHA page. Только в botcha_d6/botcha/: README.txt~ Общие подкаталоги: botcha_d6/botcha/tests и botcha_d7/botcha/tests diff botcha_d6/botcha/TODO.txt botcha_d7/botcha/TODO.txt 24d23 <