From 636cbb7edfd4593723d4e2f23827e4b510347552 Mon Sep 17 00:00:00 2001 From: Tim Steiner <tsteiner2@unl.edu> Date: Fri, 17 Jun 2011 16:14:42 +0000 Subject: [PATCH] [gh-140] Merging from testing into staging git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@751 20a16fea-79d4-4915-8869-1ea9d5ebf173 --- .htaccess.sample | 5 - CHANGELOG.txt | 262 +++++++- COPYRIGHT.txt | 4 +- INSTALL.mysql.txt | 9 +- INSTALL.pgsql.txt | 48 +- INSTALL.sqlite.txt | 15 +- INSTALL.txt | 50 +- LICENSE.txt | 602 ++++++++---------- MAINTAINERS.txt | 5 +- README.txt | 21 +- UPGRADE.txt | 3 +- authorize.php | 1 - cron.php | 1 - includes/actions.inc | 1 - includes/ajax.inc | 238 ++++--- includes/archiver.inc | 1 - includes/authorize.inc | 3 +- includes/batch.inc | 1 - includes/batch.queue.inc | 1 - includes/bootstrap.inc | 263 +++----- includes/cache-install.inc | 3 +- includes/cache.inc | 14 +- includes/common.inc | 272 +++++--- includes/database/database.inc | 60 +- includes/database/log.inc | 1 - includes/database/mysql/database.inc | 1 - includes/database/mysql/install.inc | 1 - includes/database/mysql/query.inc | 9 +- includes/database/mysql/schema.inc | 1 - includes/database/pgsql/database.inc | 10 +- includes/database/pgsql/install.inc | 1 - includes/database/pgsql/query.inc | 5 +- includes/database/pgsql/schema.inc | 9 +- includes/database/pgsql/select.inc | 1 - includes/database/prefetch.inc | 1 - includes/database/query.inc | 23 +- includes/database/schema.inc | 1 - includes/database/select.inc | 6 +- includes/database/sqlite/database.inc | 1 - includes/database/sqlite/install.inc | 1 - includes/database/sqlite/query.inc | 11 +- includes/database/sqlite/schema.inc | 1 - includes/database/sqlite/select.inc | 1 - includes/date.inc | 1 - includes/entity.inc | 3 +- includes/errors.inc | 1 - includes/file.inc | 8 +- includes/file.mimetypes.inc | 1 - includes/filetransfer/filetransfer.inc | 1 - includes/filetransfer/ftp.inc | 1 - includes/filetransfer/local.inc | 1 - includes/filetransfer/ssh.inc | 1 - includes/form.inc | 61 +- includes/graph.inc | 9 +- includes/image.inc | 1 - includes/install.core.inc | 1 - includes/install.inc | 46 +- includes/iso.inc | 1 - includes/language.inc | 66 +- includes/locale.inc | 194 ++++-- includes/lock.inc | 29 +- includes/mail.inc | 5 +- includes/menu.inc | 53 +- includes/module.inc | 14 +- includes/pager.inc | 3 +- includes/password.inc | 1 - includes/path.inc | 1 - includes/registry.inc | 4 +- includes/session.inc | 1 - includes/stream_wrappers.inc | 3 +- includes/tablesort.inc | 82 +-- includes/theme.inc | 82 +-- includes/theme.maintenance.inc | 1 - includes/token.inc | 82 ++- includes/unicode.entities.inc | 1 - includes/unicode.inc | 5 +- includes/update.inc | 1 - includes/updater.inc | 1 - includes/utility.inc | 1 - includes/xmlrpc.inc | 1 - includes/xmlrpcs.inc | 9 +- index.php | 1 - install.php | 1 - misc/ajax.js | 79 ++- misc/authorize.js | 1 - misc/autocomplete.js | 1 - misc/batch.js | 1 - misc/collapse.js | 1 - misc/drupal.js | 11 +- misc/farbtastic/farbtastic.css | 1 - misc/farbtastic/farbtastic.js | 1 - misc/form.js | 1 - misc/jquery.ba-bbq.js | 1 - misc/jquery.cookie.js | 1 - misc/jquery.form.js | 1 - misc/jquery.js | 1 - misc/jquery.once.js | 1 - misc/machine-name.js | 1 - misc/print-rtl.css | 1 - misc/print.css | 1 - misc/progress.js | 1 - misc/states.js | 8 +- misc/tabledrag.js | 3 +- misc/tableheader.js | 1 - misc/tableselect.js | 3 +- misc/textarea.js | 1 - misc/timezone.js | 1 - misc/ui/jquery.effects.blind.min.js | 1 - misc/ui/jquery.effects.bounce.min.js | 1 - misc/ui/jquery.effects.clip.min.js | 1 - misc/ui/jquery.effects.core.min.js | 1 - misc/ui/jquery.effects.drop.min.js | 1 - misc/ui/jquery.effects.explode.min.js | 1 - misc/ui/jquery.effects.fade.min.js | 1 - misc/ui/jquery.effects.fold.min.js | 1 - misc/ui/jquery.effects.highlight.min.js | 1 - misc/ui/jquery.effects.pulsate.min.js | 1 - misc/ui/jquery.effects.scale.min.js | 1 - misc/ui/jquery.effects.shake.min.js | 1 - misc/ui/jquery.effects.slide.min.js | 1 - misc/ui/jquery.effects.transfer.min.js | 1 - misc/ui/jquery.ui.accordion.css | 1 - misc/ui/jquery.ui.accordion.min.js | 1 - misc/ui/jquery.ui.autocomplete.css | 1 - misc/ui/jquery.ui.autocomplete.min.js | 1 - misc/ui/jquery.ui.button.css | 1 - misc/ui/jquery.ui.button.min.js | 1 - misc/ui/jquery.ui.core.css | 1 - misc/ui/jquery.ui.core.min.js | 1 - misc/ui/jquery.ui.datepicker.css | 1 - misc/ui/jquery.ui.datepicker.min.js | 1 - misc/ui/jquery.ui.dialog.css | 1 - misc/ui/jquery.ui.dialog.min.js | 1 - misc/ui/jquery.ui.draggable.min.js | 1 - misc/ui/jquery.ui.droppable.min.js | 1 - misc/ui/jquery.ui.mouse.min.js | 1 - misc/ui/jquery.ui.position.min.js | 1 - misc/ui/jquery.ui.progressbar.css | 1 - misc/ui/jquery.ui.progressbar.min.js | 1 - misc/ui/jquery.ui.resizable.css | 1 - misc/ui/jquery.ui.resizable.min.js | 1 - misc/ui/jquery.ui.selectable.css | 1 - misc/ui/jquery.ui.selectable.min.js | 1 - misc/ui/jquery.ui.slider.css | 1 - misc/ui/jquery.ui.slider.min.js | 1 - misc/ui/jquery.ui.sortable.min.js | 1 - misc/ui/jquery.ui.tabs.css | 1 - misc/ui/jquery.ui.tabs.min.js | 1 - misc/ui/jquery.ui.theme.css | 1 - misc/ui/jquery.ui.widget.min.js | 1 - misc/vertical-tabs-rtl.css | 1 - misc/vertical-tabs.css | 1 - misc/vertical-tabs.js | 1 - misc/watchdog-error.png | Bin 775 -> 780 bytes misc/watchdog-ok.png | Bin 409 -> 375 bytes misc/watchdog-warning.png | Bin 319 -> 318 bytes modules/README.txt | 1 - .../aggregator/aggregator-feed-source.tpl.php | 1 - modules/aggregator/aggregator-item.tpl.php | 1 - modules/aggregator/aggregator-rtl.css | 1 - .../aggregator-summary-item.tpl.php | 1 - .../aggregator-summary-items.tpl.php | 1 - modules/aggregator/aggregator-wrapper.tpl.php | 1 - modules/aggregator/aggregator.admin.inc | 14 +- modules/aggregator/aggregator.api.php | 1 - modules/aggregator/aggregator.css | 1 - modules/aggregator/aggregator.fetcher.inc | 1 - modules/aggregator/aggregator.info | 7 +- modules/aggregator/aggregator.install | 1 - modules/aggregator/aggregator.module | 26 +- modules/aggregator/aggregator.pages.inc | 1 - modules/aggregator/aggregator.parser.inc | 7 +- modules/aggregator/aggregator.processor.inc | 5 +- modules/aggregator/aggregator.test | 4 +- modules/aggregator/tests/aggregator_test.info | 7 +- .../aggregator/tests/aggregator_test.module | 1 - .../block/block-admin-display-form.tpl.php | 1 - modules/block/block.admin.inc | 3 +- modules/block/block.api.php | 31 +- modules/block/block.css | 1 - modules/block/block.info | 7 +- modules/block/block.install | 10 +- modules/block/block.js | 1 - modules/block/block.module | 15 +- modules/block/block.test | 47 +- modules/block/block.tpl.php | 1 - modules/block/tests/block_test.info | 7 +- modules/block/tests/block_test.module | 1 - modules/blog/blog.info | 7 +- modules/blog/blog.install | 8 +- modules/blog/blog.module | 1 - modules/blog/blog.pages.inc | 1 - modules/blog/blog.test | 6 +- modules/book/book-all-books-block.tpl.php | 1 - modules/book/book-export-html.tpl.php | 1 - modules/book/book-navigation.tpl.php | 1 - modules/book/book-node-export-html.tpl.php | 1 - modules/book/book-rtl.css | 1 - modules/book/book.admin.inc | 1 - modules/book/book.css | 1 - modules/book/book.info | 7 +- modules/book/book.install | 1 - modules/book/book.js | 1 - modules/book/book.module | 17 +- modules/book/book.pages.inc | 7 +- modules/book/book.test | 10 +- modules/color/color-rtl.css | 1 - modules/color/color.css | 1 - modules/color/color.info | 7 +- modules/color/color.install | 16 +- modules/color/color.js | 1 - modules/color/color.module | 14 +- modules/color/color.test | 1 - modules/color/preview.js | 1 - modules/comment/comment-node-form.js | 1 - modules/comment/comment-rtl.css | 1 - modules/comment/comment-wrapper.tpl.php | 1 - modules/comment/comment.admin.inc | 1 - modules/comment/comment.api.php | 1 - modules/comment/comment.css | 1 - modules/comment/comment.info | 7 +- modules/comment/comment.install | 29 +- modules/comment/comment.module | 94 ++- modules/comment/comment.pages.inc | 1 - modules/comment/comment.test | 32 +- modules/comment/comment.tokens.inc | 1 - modules/comment/comment.tpl.php | 1 - modules/contact/contact.admin.inc | 1 - modules/contact/contact.info | 7 +- modules/contact/contact.install | 1 - modules/contact/contact.module | 1 - modules/contact/contact.pages.inc | 1 - modules/contact/contact.test | 5 +- modules/contextual/contextual-rtl.css | 1 - modules/contextual/contextual.api.php | 1 - modules/contextual/contextual.css | 1 - modules/contextual/contextual.info | 7 +- modules/contextual/contextual.js | 1 - modules/contextual/contextual.module | 1 - modules/dashboard/dashboard-rtl.css | 27 + modules/dashboard/dashboard.api.php | 1 - modules/dashboard/dashboard.css | 11 +- modules/dashboard/dashboard.info | 7 +- modules/dashboard/dashboard.install | 1 - modules/dashboard/dashboard.js | 1 - modules/dashboard/dashboard.module | 8 +- modules/dashboard/dashboard.test | 3 +- modules/dblog/dblog-rtl.css | 1 - modules/dblog/dblog.admin.inc | 3 +- modules/dblog/dblog.css | 1 - modules/dblog/dblog.info | 7 +- modules/dblog/dblog.install | 8 +- modules/dblog/dblog.module | 6 +- modules/dblog/dblog.test | 6 +- modules/field/field.api.php | 15 +- modules/field/field.attach.inc | 38 +- modules/field/field.crud.inc | 11 +- modules/field/field.default.inc | 19 +- modules/field/field.form.inc | 9 +- modules/field/field.info | 7 +- modules/field/field.info.inc | 7 +- modules/field/field.install | 26 +- modules/field/field.module | 3 +- modules/field/field.multilingual.inc | 1 - .../field_sql_storage/field_sql_storage.info | 7 +- .../field_sql_storage.install | 1 - .../field_sql_storage.module | 1 - .../field_sql_storage/field_sql_storage.test | 3 +- modules/field/modules/list/list.info | 7 +- modules/field/modules/list/list.install | 17 +- modules/field/modules/list/list.module | 3 +- modules/field/modules/list/tests/list.test | 7 +- .../field/modules/list/tests/list_test.info | 7 +- .../field/modules/list/tests/list_test.module | 1 - modules/field/modules/number/number.info | 7 +- modules/field/modules/number/number.install | 1 - modules/field/modules/number/number.module | 9 +- modules/field/modules/number/number.test | 3 +- modules/field/modules/options/options.api.php | 1 - modules/field/modules/options/options.info | 7 +- modules/field/modules/options/options.module | 1 - modules/field/modules/options/options.test | 6 +- modules/field/modules/text/text.info | 7 +- modules/field/modules/text/text.install | 3 +- modules/field/modules/text/text.js | 1 - modules/field/modules/text/text.module | 1 - modules/field/modules/text/text.test | 6 +- modules/field/tests/field.test | 318 +++++---- modules/field/tests/field_test.entity.inc | 1 - modules/field/tests/field_test.field.inc | 1 - modules/field/tests/field_test.info | 7 +- modules/field/tests/field_test.install | 1 - modules/field/tests/field_test.module | 5 +- modules/field/tests/field_test.storage.inc | 3 +- modules/field/theme/field-rtl.css | 1 - modules/field/theme/field.css | 1 - modules/field/theme/field.tpl.php | 1 - modules/field_ui/field_ui-rtl.css | 1 - modules/field_ui/field_ui.admin.inc | 9 +- modules/field_ui/field_ui.api.php | 1 - modules/field_ui/field_ui.css | 1 - modules/field_ui/field_ui.info | 7 +- modules/field_ui/field_ui.js | 11 +- modules/field_ui/field_ui.module | 6 +- modules/field_ui/field_ui.test | 5 +- modules/file/file.api.php | 3 +- modules/file/file.css | 1 - modules/file/file.field.inc | 22 +- modules/file/file.info | 7 +- modules/file/file.install | 1 - modules/file/file.js | 7 +- modules/file/file.module | 12 +- modules/file/tests/file.test | 21 +- modules/file/tests/file_module_test.info | 7 +- modules/file/tests/file_module_test.module | 1 - modules/filter/filter.admin.inc | 1 - modules/filter/filter.admin.js | 1 - modules/filter/filter.api.php | 1 - modules/filter/filter.css | 1 - modules/filter/filter.info | 7 +- modules/filter/filter.install | 1 - modules/filter/filter.js | 1 - modules/filter/filter.module | 23 +- modules/filter/filter.pages.inc | 3 +- modules/filter/filter.test | 31 +- modules/forum/forum-icon.tpl.php | 3 +- modules/forum/forum-list.tpl.php | 1 - modules/forum/forum-rtl.css | 1 - modules/forum/forum-submitted.tpl.php | 1 - modules/forum/forum-topic-list.tpl.php | 1 - modules/forum/forum.admin.inc | 1 - modules/forum/forum.css | 1 - modules/forum/forum.info | 7 +- modules/forum/forum.install | 103 ++- modules/forum/forum.module | 41 +- modules/forum/forum.pages.inc | 1 - modules/forum/forum.test | 6 +- modules/forum/forums.tpl.php | 1 - modules/help/help-rtl.css | 1 - modules/help/help.admin.inc | 1 - modules/help/help.api.php | 1 - modules/help/help.css | 1 - modules/help/help.info | 7 +- modules/help/help.module | 1 - modules/help/help.test | 6 +- modules/image/image-rtl.css | 1 - modules/image/image.admin.css | 1 - modules/image/image.admin.inc | 3 +- modules/image/image.api.php | 1 - modules/image/image.css | 1 - modules/image/image.effects.inc | 13 +- modules/image/image.field.inc | 1 - modules/image/image.info | 7 +- modules/image/image.install | 15 +- modules/image/image.module | 49 +- modules/image/image.test | 26 +- modules/image/tests/image_module_test.info | 7 +- modules/image/tests/image_module_test.module | 1 - modules/locale/locale.admin.inc | 36 +- modules/locale/locale.api.php | 1 - modules/locale/locale.css | 7 +- modules/locale/locale.datepicker.js | 35 +- modules/locale/locale.info | 7 +- modules/locale/locale.install | 9 +- modules/locale/locale.module | 46 +- modules/locale/locale.test | 193 +++++- modules/locale/tests/locale_test.info | 7 +- modules/locale/tests/locale_test.module | 82 ++- modules/menu/menu.admin.inc | 1 - modules/menu/menu.admin.js | 1 - modules/menu/menu.api.php | 1 - modules/menu/menu.css | 1 - modules/menu/menu.info | 7 +- modules/menu/menu.install | 1 - modules/menu/menu.js | 1 - modules/menu/menu.module | 34 +- modules/menu/menu.test | 21 +- modules/node/content_types.inc | 3 +- modules/node/content_types.js | 1 - modules/node/node-rtl.css | 1 - modules/node/node.admin.inc | 7 +- modules/node/node.api.php | 26 +- modules/node/node.css | 1 - modules/node/node.info | 7 +- modules/node/node.install | 86 ++- modules/node/node.js | 1 - modules/node/node.module | 39 +- modules/node/node.pages.inc | 1 - modules/node/node.test | 10 +- modules/node/node.tokens.inc | 1 - modules/node/node.tpl.php | 1 - modules/node/tests/node_access_test.info | 7 +- modules/node/tests/node_access_test.module | 1 - modules/node/tests/node_test.info | 7 +- modules/node/tests/node_test.module | 1 - modules/node/tests/node_test_exception.info | 7 +- modules/node/tests/node_test_exception.module | 1 - modules/openid/openid-rtl.css | 1 - modules/openid/openid.api.php | 1 - modules/openid/openid.css | 1 - modules/openid/openid.inc | 160 ++++- modules/openid/openid.info | 7 +- modules/openid/openid.install | 18 +- modules/openid/openid.js | 1 - modules/openid/openid.module | 11 +- modules/openid/openid.pages.inc | 1 - modules/openid/openid.test | 6 +- modules/openid/tests/openid_test.info | 7 +- modules/openid/tests/openid_test.install | 1 - modules/openid/tests/openid_test.module | 13 +- modules/overlay/overlay-child.css | 1 - modules/overlay/overlay-child.js | 1 - modules/overlay/overlay-parent.css | 1 - modules/overlay/overlay-parent.js | 10 +- modules/overlay/overlay.api.php | 1 - modules/overlay/overlay.info | 7 +- modules/overlay/overlay.install | 1 - modules/overlay/overlay.module | 7 +- modules/overlay/overlay.tpl.php | 1 - modules/path/path.admin.inc | 1 - modules/path/path.api.php | 1 - modules/path/path.info | 7 +- modules/path/path.js | 1 - modules/path/path.module | 3 +- modules/path/path.test | 3 +- modules/php/php.info | 7 +- modules/php/php.install | 1 - modules/php/php.module | 1 - modules/php/php.test | 6 +- modules/poll/poll-bar--block.tpl.php | 1 - modules/poll/poll-bar.tpl.php | 1 - modules/poll/poll-results--block.tpl.php | 1 - modules/poll/poll-results.tpl.php | 1 - modules/poll/poll-rtl.css | 1 - modules/poll/poll-vote.tpl.php | 1 - modules/poll/poll.css | 1 - modules/poll/poll.info | 7 +- modules/poll/poll.install | 9 +- modules/poll/poll.module | 7 +- modules/poll/poll.pages.inc | 1 - modules/poll/poll.test | 9 +- modules/poll/poll.tokens.inc | 1 - modules/profile/profile-block.tpl.php | 1 - modules/profile/profile-listing.tpl.php | 1 - modules/profile/profile-wrapper.tpl.php | 1 - modules/profile/profile.admin.inc | 1 - modules/profile/profile.css | 1 - modules/profile/profile.info | 7 +- modules/profile/profile.install | 1 - modules/profile/profile.js | 1 - modules/profile/profile.module | 1 - modules/profile/profile.pages.inc | 1 - modules/profile/profile.test | 6 +- modules/rdf/rdf.api.php | 1 - modules/rdf/rdf.info | 7 +- modules/rdf/rdf.install | 1 - modules/rdf/rdf.module | 1 - modules/rdf/rdf.test | 3 +- modules/rdf/tests/rdf_test.info | 7 +- modules/rdf/tests/rdf_test.install | 1 - modules/rdf/tests/rdf_test.module | 1 - modules/search/search-block-form.tpl.php | 1 - modules/search/search-result.tpl.php | 1 - modules/search/search-results.tpl.php | 1 - modules/search/search-rtl.css | 1 - modules/search/search.admin.inc | 20 +- modules/search/search.api.php | 1 - modules/search/search.css | 1 - modules/search/search.extender.inc | 1 - modules/search/search.info | 7 +- modules/search/search.install | 1 - modules/search/search.module | 2 - modules/search/search.pages.inc | 1 - modules/search/search.test | 6 +- .../search/tests/search_embedded_form.info | 7 +- .../search/tests/search_embedded_form.module | 1 - modules/search/tests/search_extra_type.info | 7 +- modules/search/tests/search_extra_type.module | 1 - modules/shortcut/shortcut-rtl.css | 47 ++ modules/shortcut/shortcut.admin.css | 1 - modules/shortcut/shortcut.admin.inc | 1 - modules/shortcut/shortcut.admin.js | 1 - modules/shortcut/shortcut.api.php | 1 - modules/shortcut/shortcut.css | 25 +- modules/shortcut/shortcut.info | 7 +- modules/shortcut/shortcut.install | 1 - modules/shortcut/shortcut.module | 1 - modules/shortcut/shortcut.png | Bin 432 -> 558 bytes modules/shortcut/shortcut.test | 3 +- modules/simpletest/drupal_web_test_case.php | 52 +- modules/simpletest/files/README.txt | 1 - .../css_input_without_import.css | 1 - ...s_input_without_import.css.unoptimized.css | 1 - modules/simpletest/simpletest.api.php | 1 - modules/simpletest/simpletest.css | 1 - modules/simpletest/simpletest.info | 9 +- modules/simpletest/simpletest.install | 7 +- modules/simpletest/simpletest.js | 1 - modules/simpletest/simpletest.module | 1 - modules/simpletest/simpletest.pages.inc | 13 +- modules/simpletest/simpletest.test | 6 +- modules/simpletest/tests/actions.test | 1 - .../simpletest/tests/actions_loop_test.info | 7 +- .../tests/actions_loop_test.install | 1 - .../simpletest/tests/actions_loop_test.module | 1 - modules/simpletest/tests/ajax.test | 29 +- modules/simpletest/tests/ajax_forms_test.info | 7 +- .../simpletest/tests/ajax_forms_test.module | 65 +- modules/simpletest/tests/ajax_test.info | 7 +- modules/simpletest/tests/ajax_test.module | 5 +- modules/simpletest/tests/batch.test | 1 - .../simpletest/tests/batch_test.callbacks.inc | 1 - modules/simpletest/tests/batch_test.info | 7 +- modules/simpletest/tests/batch_test.module | 1 - modules/simpletest/tests/bootstrap.test | 1 - modules/simpletest/tests/cache.test | 1 - modules/simpletest/tests/common.test | 58 +- modules/simpletest/tests/common_test.css | 1 - modules/simpletest/tests/common_test.info | 7 +- modules/simpletest/tests/common_test.module | 1 - .../simpletest/tests/common_test.print.css | 1 - modules/simpletest/tests/common_test_info.txt | 1 - modules/simpletest/tests/database_test.info | 7 +- .../simpletest/tests/database_test.install | 1 - modules/simpletest/tests/database_test.module | 1 - modules/simpletest/tests/database_test.test | 54 +- ...drupal_system_listing_compatible_test.info | 7 +- ...upal_system_listing_compatible_test.module | 1 - ...upal_system_listing_incompatible_test.info | 7 +- ...al_system_listing_incompatible_test.module | 1 - .../simpletest/tests/entity_cache_test.info | 7 +- .../simpletest/tests/entity_cache_test.module | 1 - .../tests/entity_cache_test_dependency.info | 7 +- .../tests/entity_cache_test_dependency.module | 1 - .../tests/entity_crud_hook_test.info | 7 +- .../tests/entity_crud_hook_test.module | 1 - .../tests/entity_crud_hook_test.test | 1 - modules/simpletest/tests/entity_query.test | 1 - modules/simpletest/tests/error.test | 14 +- modules/simpletest/tests/error_test.info | 7 +- modules/simpletest/tests/error_test.module | 1 - modules/simpletest/tests/file.test | 1 - modules/simpletest/tests/file_test.info | 7 +- modules/simpletest/tests/file_test.module | 1 - modules/simpletest/tests/filetransfer.test | 1 - modules/simpletest/tests/filter_test.info | 7 +- modules/simpletest/tests/filter_test.module | 1 - modules/simpletest/tests/form.test | 13 +- modules/simpletest/tests/form_test.file.inc | 5 +- modules/simpletest/tests/form_test.info | 7 +- modules/simpletest/tests/form_test.module | 1 - modules/simpletest/tests/graph.test | 1 - modules/simpletest/tests/http.php | 1 - modules/simpletest/tests/https.php | 1 - modules/simpletest/tests/image.test | 1 - modules/simpletest/tests/image_test.info | 7 +- modules/simpletest/tests/image_test.module | 1 - modules/simpletest/tests/lock.test | 1 - modules/simpletest/tests/mail.test | 1 - modules/simpletest/tests/menu.test | 71 ++- modules/simpletest/tests/menu_test.info | 7 +- modules/simpletest/tests/menu_test.module | 8 +- modules/simpletest/tests/module.test | 22 +- modules/simpletest/tests/module_test.file.inc | 1 - modules/simpletest/tests/module_test.info | 7 +- modules/simpletest/tests/module_test.install | 1 - modules/simpletest/tests/module_test.module | 15 +- modules/simpletest/tests/password.test | 1 - modules/simpletest/tests/path.test | 1 - modules/simpletest/tests/registry.test | 1 - .../simpletest/tests/requirements1_test.info | 7 +- .../tests/requirements1_test.install | 1 - .../tests/requirements1_test.module | 1 - .../simpletest/tests/requirements2_test.info | 7 +- .../tests/requirements2_test.module | 1 - modules/simpletest/tests/schema.test | 1 - modules/simpletest/tests/session.test | 1 - modules/simpletest/tests/session_test.info | 7 +- modules/simpletest/tests/session_test.module | 1 - modules/simpletest/tests/system.base.css | 1 - .../tests/system_dependencies_test.info | 7 +- .../tests/system_dependencies_test.module | 1 - modules/simpletest/tests/system_test.info | 7 +- modules/simpletest/tests/system_test.module | 1 - modules/simpletest/tests/tablesort.test | 166 +++++ modules/simpletest/tests/taxonomy_test.info | 7 +- .../simpletest/tests/taxonomy_test.install | 1 - modules/simpletest/tests/taxonomy_test.module | 1 - modules/simpletest/tests/theme.test | 1 - modules/simpletest/tests/theme_test.info | 7 +- modules/simpletest/tests/theme_test.module | 1 - modules/simpletest/tests/unicode.test | 1 - modules/simpletest/tests/update.test | 1 - modules/simpletest/tests/update_test_1.info | 7 +- .../simpletest/tests/update_test_1.install | 1 - modules/simpletest/tests/update_test_1.module | 1 - modules/simpletest/tests/update_test_2.info | 7 +- .../simpletest/tests/update_test_2.install | 1 - modules/simpletest/tests/update_test_2.module | 1 - modules/simpletest/tests/update_test_3.info | 7 +- .../simpletest/tests/update_test_3.install | 1 - modules/simpletest/tests/update_test_3.module | 1 - .../tests/upgrade/drupal-6.bare.database.php | 5 +- .../upgrade/drupal-6.filled.database.php | 1 - .../tests/upgrade/drupal-6.forum.database.php | 261 ++++++++ .../upgrade/drupal-6.locale.database.php | 1 - .../upgrade/drupal-6.upload.database.php | 1 - .../tests/upgrade/upgrade.comment.test | 1 - .../tests/upgrade/upgrade.filter.test | 1 - .../tests/upgrade/upgrade.forum.test | 61 ++ .../tests/upgrade/upgrade.locale.test | 1 - .../tests/upgrade/upgrade.node.test | 1 - .../tests/upgrade/upgrade.poll.test | 1 - .../tests/upgrade/upgrade.taxonomy.test | 1 - modules/simpletest/tests/upgrade/upgrade.test | 1 - .../tests/upgrade/upgrade.upload.test | 1 - modules/simpletest/tests/url_alter_test.info | 7 +- .../simpletest/tests/url_alter_test.install | 1 - .../simpletest/tests/url_alter_test.module | 1 - modules/simpletest/tests/xmlrpc.test | 11 +- modules/simpletest/tests/xmlrpc_test.info | 7 +- modules/simpletest/tests/xmlrpc_test.module | 1 - modules/statistics/statistics.admin.inc | 1 - modules/statistics/statistics.info | 7 +- modules/statistics/statistics.install | 1 - modules/statistics/statistics.module | 1 - modules/statistics/statistics.pages.inc | 1 - modules/statistics/statistics.test | 8 +- modules/statistics/statistics.tokens.inc | 1 - modules/syslog/syslog.info | 7 +- modules/syslog/syslog.install | 1 - modules/syslog/syslog.module | 1 - modules/syslog/syslog.test | 6 +- modules/system/html.tpl.php | 1 - modules/system/image.gd.inc | 1 - modules/system/maintenance-page.tpl.php | 1 - modules/system/page.tpl.php | 1 - modules/system/region.tpl.php | 1 - modules/system/system.admin-rtl.css | 1 - modules/system/system.admin.css | 1 - modules/system/system.admin.inc | 18 +- modules/system/system.api.php | 111 ++-- modules/system/system.archiver.inc | 1 - modules/system/system.base-rtl.css | 1 - modules/system/system.base.css | 1 - modules/system/system.cron.js | 1 - modules/system/system.info | 7 +- modules/system/system.install | 53 +- modules/system/system.js | 14 - modules/system/system.mail.inc | 1 - modules/system/system.maintenance.css | 1 - modules/system/system.menus-rtl.css | 1 - modules/system/system.menus.css | 1 - modules/system/system.messages-rtl.css | 13 + modules/system/system.messages.css | 1 - modules/system/system.module | 18 +- modules/system/system.queue.inc | 1 - modules/system/system.test | 105 ++- modules/system/system.theme-rtl.css | 1 - modules/system/system.theme.css | 1 - modules/system/system.tokens.inc | 1 - modules/system/system.updater.inc | 1 - modules/system/theme.api.php | 9 +- modules/taxonomy/taxonomy-term.tpl.php | 1 - modules/taxonomy/taxonomy.admin.inc | 35 +- modules/taxonomy/taxonomy.api.php | 1 - modules/taxonomy/taxonomy.css | 1 - modules/taxonomy/taxonomy.info | 7 +- modules/taxonomy/taxonomy.install | 9 +- modules/taxonomy/taxonomy.js | 1 - modules/taxonomy/taxonomy.module | 28 +- modules/taxonomy/taxonomy.pages.inc | 15 +- modules/taxonomy/taxonomy.test | 17 +- modules/taxonomy/taxonomy.tokens.inc | 1 - modules/toolbar/toolbar-rtl.css | 41 ++ modules/toolbar/toolbar.css | 73 +-- modules/toolbar/toolbar.info | 7 +- modules/toolbar/toolbar.js | 1 - modules/toolbar/toolbar.module | 3 +- modules/toolbar/toolbar.tpl.php | 1 - modules/tracker/tracker.css | 1 - modules/tracker/tracker.info | 7 +- modules/tracker/tracker.install | 1 - modules/tracker/tracker.module | 1 - modules/tracker/tracker.pages.inc | 1 - modules/tracker/tracker.test | 6 +- .../translation/tests/translation_test.info | 7 +- .../translation/tests/translation_test.module | 1 - modules/translation/translation.info | 7 +- modules/translation/translation.module | 31 +- modules/translation/translation.pages.inc | 7 +- modules/translation/translation.test | 61 +- modules/trigger/tests/trigger_test.info | 7 +- modules/trigger/tests/trigger_test.module | 1 - modules/trigger/trigger.admin.inc | 1 - modules/trigger/trigger.api.php | 1 - modules/trigger/trigger.info | 7 +- modules/trigger/trigger.install | 1 - modules/trigger/trigger.module | 1 - modules/trigger/trigger.test | 6 +- modules/update/tests/aaa_update_test.info | 7 +- modules/update/tests/aaa_update_test.module | 1 - modules/update/tests/bbb_update_test.info | 7 +- modules/update/tests/bbb_update_test.module | 1 - modules/update/tests/ccc_update_test.info | 7 +- modules/update/tests/ccc_update_test.module | 1 - modules/update/tests/update_test.info | 7 +- modules/update/tests/update_test.module | 1 - modules/update/update-rtl.css | 1 - modules/update/update.api.php | 1 - modules/update/update.authorize.inc | 3 +- modules/update/update.compare.inc | 1 - modules/update/update.css | 1 - modules/update/update.fetch.inc | 1 - modules/update/update.info | 7 +- modules/update/update.install | 1 - modules/update/update.manager.inc | 44 +- modules/update/update.module | 64 +- modules/update/update.report.inc | 9 +- modules/update/update.settings.inc | 1 - modules/update/update.test | 3 +- modules/user/tests/user_form_test.info | 7 +- modules/user/tests/user_form_test.module | 1 - modules/user/user-picture.tpl.php | 5 +- modules/user/user-profile-category.tpl.php | 1 - modules/user/user-profile-item.tpl.php | 1 - modules/user/user-profile.tpl.php | 1 - modules/user/user-rtl.css | 18 +- modules/user/user.admin.inc | 1 - modules/user/user.api.php | 39 +- modules/user/user.css | 21 +- modules/user/user.info | 7 +- modules/user/user.install | 14 +- modules/user/user.js | 3 +- modules/user/user.module | 144 +++-- modules/user/user.pages.inc | 1 - modules/user/user.permissions.js | 1 - modules/user/user.test | 36 +- modules/user/user.tokens.inc | 1 - profiles/minimal/minimal.info | 7 +- profiles/minimal/minimal.install | 1 - profiles/minimal/minimal.profile | 1 - profiles/minimal/translations/README.txt | 1 - profiles/standard/standard.info | 7 +- profiles/standard/standard.install | 5 +- profiles/standard/standard.profile | 1 - profiles/standard/translations/README.txt | 1 - ...drupal_system_listing_compatible_test.info | 7 +- ...upal_system_listing_compatible_test.module | 1 - ...upal_system_listing_incompatible_test.info | 7 +- ...al_system_listing_incompatible_test.module | 1 - profiles/testing/testing.info | 7 +- profiles/testing/testing.install | 1 - profiles/testing/testing.profile | 1 - robots.txt | 1 - scripts/code-clean.sh | 1 - scripts/cron-curl.sh | 1 - scripts/cron-lynx.sh | 1 - scripts/drupal.sh | 1 - scripts/dump-database-d6.sh | 2 - scripts/generate-d6-content.sh | 1 - scripts/password-hash.sh | 1 - scripts/run-tests.sh | 1 - sites/all/README.txt | 1 - sites/all/modules/README.txt | 1 - sites/all/modules/ctools/API.txt | 17 +- sites/all/modules/ctools/CHANGELOG.txt | 7 + .../ctools/bulk_export/bulk_export.css | 12 +- .../ctools/bulk_export/bulk_export.info | 7 +- .../ctools/bulk_export/bulk_export.module | 50 +- sites/all/modules/ctools/css/button.css | 32 + .../modules/ctools/css/collapsible-div.css | 1 - sites/all/modules/ctools/css/context.css | 1 - sites/all/modules/ctools/css/ctools.css | 1 - sites/all/modules/ctools/css/dropbutton.css | 67 ++ sites/all/modules/ctools/css/dropdown.css | 1 - .../all/modules/ctools/css/export-ui-list.css | 14 +- sites/all/modules/ctools/css/modal.css | 2 - sites/all/modules/ctools/css/stylizer.css | 1 - sites/all/modules/ctools/css/wizard.css | 1 - sites/all/modules/ctools/ctools.api.php | 39 +- sites/all/modules/ctools/ctools.info | 7 +- sites/all/modules/ctools/ctools.install | 1 - sites/all/modules/ctools/ctools.module | 143 ++++- .../ctools_access_ruleset.info | 7 +- .../ctools_access_ruleset.install | 1 - .../ctools_access_ruleset.module | 1 - .../plugins/access/ruleset.inc | 18 +- .../export_ui/ctools_access_ruleset.inc | 1 - .../ctools_access_ruleset_ui.class.php | 1 - .../ctools_ajax_sample.info | 7 +- .../ctools_ajax_sample.install | 1 - .../ctools_ajax_sample.module | 20 +- .../ctools_ajax_sample/images/ajax-loader.gif | Bin 0 -> 10819 bytes .../images/loading-large.gif | Bin 0 -> 2545 bytes .../ctools_ajax_sample/images/loading.gif | Bin 0 -> 1849 bytes .../images/popups-border.png | Bin 0 -> 380 bytes .../ctools_custom_content.info | 7 +- .../ctools_custom_content.install | 1 - .../ctools_custom_content.module | 1 - .../export_ui/ctools_custom_content.inc | 1 - .../ctools_custom_content_ui.class.php | 5 +- .../ctools/ctools_plugin_example/README.txt | 1 - .../ctools_plugin_example.info | 7 +- .../ctools_plugin_example.module | 1 - .../ctools_plugin_example.pages_default.inc | 1 - .../plugins/access/arg_length.inc | 1 - .../plugins/access/example_role.inc | 1 - .../plugins/arguments/simplecontext_arg.inc | 1 - .../content_types/no_context_content_type.inc | 5 +- .../content_types/relcontext_content_type.inc | 1 - .../simplecontext_content_type.inc | 1 - .../plugins/contexts/relcontext.inc | 1 - .../plugins/contexts/simplecontext.inc | 1 - .../plugins/panels.pages.inc | 1 - .../relcontext_from_simplecontext.inc | 1 - sites/all/modules/ctools/help/about.html | 1 - sites/all/modules/ctools/help/ajax.html | 1 - .../modules/ctools/help/context-access.html | 1 - .../ctools/help/context-arguments.html | 1 - .../modules/ctools/help/context-content.html | 1 - .../modules/ctools/help/context-context.html | 1 - .../ctools/help/context-relationships.html | 1 - sites/all/modules/ctools/help/context.html | 1 - sites/all/modules/ctools/help/ctools.help.ini | 5 +- sites/all/modules/ctools/help/export-ui.html | 1 - sites/all/modules/ctools/help/export.html | 19 +- sites/all/modules/ctools/help/modal.html | 7 +- .../all/modules/ctools/help/object-cache.html | 1 - .../all/modules/ctools/help/plugins-api.html | 1 - .../modules/ctools/help/plugins-creating.html | 1 - .../ctools/help/plugins-implementing.html | 1 - sites/all/modules/ctools/help/plugins.html | 1 - sites/all/modules/ctools/help/wizard.html | 9 +- sites/all/modules/ctools/includes/ajax.inc | 1 - sites/all/modules/ctools/includes/cache.inc | 1 - .../ctools/includes/cache.plugin-type.inc | 1 - .../modules/ctools/includes/cleanstring.inc | 60 +- .../ctools/includes/collapsible.theme.inc | 1 - sites/all/modules/ctools/includes/content.inc | 16 +- .../modules/ctools/includes/content.menu.inc | 4 +- .../ctools/includes/content.plugin-type.inc | 1 - .../modules/ctools/includes/content.theme.inc | 1 - .../ctools/includes/context-access-admin.inc | 1 - .../modules/ctools/includes/context-admin.inc | 36 +- .../ctools/includes/context-task-handler.inc | 5 +- sites/all/modules/ctools/includes/context.inc | 38 +- .../modules/ctools/includes/context.menu.inc | 2 +- .../ctools/includes/context.plugin-type.inc | 1 - .../modules/ctools/includes/context.theme.inc | 1 - sites/all/modules/ctools/includes/css.inc | 9 +- .../all/modules/ctools/includes/dependent.inc | 76 ++- .../ctools/includes/dropbutton.theme.inc | 142 +++++ .../ctools/includes/dropdown.theme.inc | 1 - .../all/modules/ctools/includes/export-ui.inc | 4 +- .../ctools/includes/export-ui.menu.inc | 1 - .../ctools/includes/export-ui.plugin-type.inc | 1 - sites/all/modules/ctools/includes/export.inc | 244 ++++++- sites/all/modules/ctools/includes/fields.inc | 40 +- .../all/modules/ctools/includes/jump-menu.inc | 18 +- sites/all/modules/ctools/includes/menu.inc | 3 +- sites/all/modules/ctools/includes/modal.inc | 3 +- .../ctools/includes/object-cache.cron.inc | 1 - .../modules/ctools/includes/object-cache.inc | 1 - .../modules/ctools/includes/page-wizard.inc | 1 - .../ctools/includes/page-wizard.menu.inc | 1 - .../modules/ctools/includes/plugins-admin.inc | 37 +- sites/all/modules/ctools/includes/plugins.inc | 87 ++- .../all/modules/ctools/includes/stylizer.inc | 5 +- .../ctools/includes/stylizer.theme.inc | 1 - sites/all/modules/ctools/includes/utility.inc | 7 +- sites/all/modules/ctools/includes/views.inc | 26 + sites/all/modules/ctools/includes/wizard.inc | 7 +- .../modules/ctools/includes/wizard.theme.inc | 1 - sites/all/modules/ctools/js/ajax-responder.js | 44 +- sites/all/modules/ctools/js/auto-submit.js | 7 +- .../all/modules/ctools/js/collapsible-div.js | 1 - sites/all/modules/ctools/js/dependent.js | 6 +- sites/all/modules/ctools/js/dropbutton.js | 96 +++ sites/all/modules/ctools/js/dropdown.js | 1 - sites/all/modules/ctools/js/jump-menu.js | 1 - sites/all/modules/ctools/js/modal.js | 19 +- sites/all/modules/ctools/js/stylizer.js | 1 - .../ctools/page_manager/css/page-manager.css | 33 +- .../ctools/page_manager/help/about.html | 1 - .../page_manager/help/api-task-handler.html | 1 - .../page_manager/help/api-task-type.html | 1 - .../ctools/page_manager/help/api-task.html | 1 - .../help/custom-pages-access.html | 1 - .../help/custom-pages-arguments.html | 1 - .../page_manager/help/custom-pages-menu.html | 1 - .../page_manager/help/custom-pages.html | 1 - .../help/getting-started-create.html | 1 - .../help/getting-started-custom-nodes.html | 1 - .../getting-started-custom-vocabulary.html | 1 - .../help/getting-started-members.html | 1 - .../help/getting-started-page-list.html | 1 - .../page_manager/help/getting-started.html | 1 - .../page_manager/help/page_manager.help.ini | 1 - .../ctools/page_manager/help/variants.html | 1 - .../ctools/page_manager/js/page-list.js | 1 - .../page_manager/page_manager.admin.inc | 31 +- .../ctools/page_manager/page_manager.info | 7 +- .../ctools/page_manager/page_manager.install | 1 - .../ctools/page_manager/page_manager.module | 35 +- .../plugins/cache/page_manager_context.inc | 1 - .../plugins/task_handlers/http_response.inc | 8 +- .../page_manager/plugins/tasks/blog.inc | 1 - .../page_manager/plugins/tasks/blog_user.inc | 1 - .../plugins/tasks/contact_site.inc | 15 +- .../plugins/tasks/contact_user.inc | 15 +- .../page_manager/plugins/tasks/node_edit.inc | 7 +- .../page_manager/plugins/tasks/node_view.inc | 3 +- .../page_manager/plugins/tasks/page.admin.inc | 34 +- .../page_manager/plugins/tasks/page.inc | 1 - .../page_manager/plugins/tasks/poll.inc | 1 - .../page_manager/plugins/tasks/search.inc | 135 +--- .../page_manager/plugins/tasks/term_view.inc | 101 +-- .../page_manager/plugins/tasks/user_view.inc | 31 +- .../theme/page-manager-edit-page.tpl.php | 1 - .../page_manager/theme/page_manager.theme.inc | 1 - .../ctools/plugins/access/compare_users.inc | 3 +- .../ctools/plugins/access/context_exists.inc | 1 - .../ctools/plugins/access/entity_bundle.inc | 126 ++++ .../ctools/plugins/access/node_access.inc | 1 - .../ctools/plugins/access/node_language.inc | 1 - .../ctools/plugins/access/node_type.inc | 22 +- .../ctools/plugins/access/path_visibility.inc | 1 - .../modules/ctools/plugins/access/perm.inc | 1 - .../all/modules/ctools/plugins/access/php.inc | 1 - .../modules/ctools/plugins/access/role.inc | 1 - .../ctools/plugins/access/site_language.inc | 1 - .../ctools/plugins/access/string_equal.inc | 1 - .../ctools/plugins/access/string_length.inc | 3 +- .../modules/ctools/plugins/access/term.inc | 58 +- .../ctools/plugins/access/term_has_parent.inc | 161 +++++ .../ctools/plugins/access/term_parent.inc | 3 +- .../ctools/plugins/access/term_vocabulary.inc | 1 - .../modules/ctools/plugins/access/theme.inc | 1 - .../ctools/plugins/arguments/entity_id.inc | 13 +- .../modules/ctools/plugins/arguments/nid.inc | 2 +- .../ctools/plugins/arguments/node_add.inc | 1 - .../ctools/plugins/arguments/node_edit.inc | 1 - .../modules/ctools/plugins/arguments/rid.inc | 3 +- .../ctools/plugins/arguments/string.inc | 5 +- .../modules/ctools/plugins/arguments/term.inc | 66 +- .../ctools/plugins/arguments/terms.inc | 5 +- .../modules/ctools/plugins/arguments/uid.inc | 2 +- .../ctools/plugins/arguments/user_name.inc | 3 +- .../modules/ctools/plugins/arguments/vid.inc | 2 +- .../ctools/plugins/cache/export_ui.inc | 1 - .../modules/ctools/plugins/cache/simple.inc | 1 - .../plugins/content_types/block/block.inc | 1 - .../plugins/content_types/contact/contact.inc | 3 +- .../content_types/contact/user_contact.inc | 6 +- .../plugins/content_types/custom/custom.inc | 18 +- .../entity_context/entity_field.inc | 71 ++- .../content_types/form/entity_form_field.inc | 114 ++++ .../plugins/content_types/form/form.inc | 14 +- .../plugins/content_types/node/node.inc | 27 +- .../node_context/node_attachments.inc | 1 - .../node_context/node_author.inc | 3 +- .../content_types/node_context/node_body.inc | 31 +- .../node_context/node_book_children.inc | 2 +- .../node_context/node_book_nav.inc | 3 +- .../node_context/node_comment_form.inc | 5 +- .../node_context/node_comments.inc | 3 +- .../node_context/node_content.inc | 10 +- .../node_context/node_created.inc | 1 - .../content_types/node_context/node_links.inc | 3 +- .../content_types/node_context/node_terms.inc | 85 +-- .../content_types/node_context/node_title.inc | 3 +- .../node_context/node_type_desc.inc | 1 - .../node_context/node_updated.inc | 1 - .../node_form/node_form_attachments.inc | 15 +- .../node_form/node_form_author.inc | 20 +- .../node_form/node_form_book.inc | 22 +- .../node_form/node_form_buttons.inc | 10 +- .../node_form/node_form_comment.inc | 14 +- .../content_types/node_form/node_form_log.inc | 18 +- .../node_form/node_form_menu.inc | 15 +- .../node_form/node_form_path.inc | 16 +- .../node_form/node_form_publishing.inc | 14 +- .../node_form/node_form_title.inc | 41 ++ .../content_types/page/page_breadcrumb.inc | 1 - .../content_types/page/page_feed_icons.inc | 1 - .../plugins/content_types/page/page_help.inc | 1 - .../plugins/content_types/page/page_logo.inc | 4 +- .../content_types/page/page_messages.inc | 1 - .../content_types/page/page_primary_links.inc | 1 - .../page/page_secondary_links.inc | 1 - .../content_types/page/page_site_name.inc | 1 - .../content_types/page/page_slogan.inc | 1 - .../plugins/content_types/page/page_tabs.inc | 17 +- .../plugins/content_types/page/page_title.inc | 1 - .../content_types/search/search_form.inc | 29 +- .../content_types/search/search_result.inc | 111 ++-- .../term_context/term_description.inc | 3 +- .../content_types/term_context/term_list.inc | 63 +- .../content_types/token/icon_token.png | Bin 0 -> 460 bytes .../plugins/content_types/token/token.inc | 115 ++++ .../user_context/profile_fields.inc | 1 - .../user_context/profile_fields_pane.tpl.php | 1 - .../user_context/user_picture.inc | 5 +- .../user_context/user_profile.inc | 1 - .../user_context/user_signature.inc | 3 +- .../vocabulary_context/vocabulary_terms.inc | 3 +- .../ctools/plugins/contexts/entity.inc | 46 +- .../modules/ctools/plugins/contexts/node.inc | 13 +- .../ctools/plugins/contexts/node_add_form.inc | 13 +- .../plugins/contexts/node_edit_form.inc | 27 +- .../ctools/plugins/contexts/string.inc | 1 - .../modules/ctools/plugins/contexts/term.inc | 5 +- .../modules/ctools/plugins/contexts/terms.inc | 3 +- .../modules/ctools/plugins/contexts/token.inc | 1 - .../modules/ctools/plugins/contexts/user.inc | 15 +- .../ctools/plugins/contexts/vocabulary.inc | 4 +- .../export_ui/ctools_export_ui.class.php | 51 +- .../plugins/export_ui/ctools_export_ui.inc | 1 - .../plugins/relationships/book_parent.inc | 1 - .../relationships/entity_from_field.inc | 138 +++- .../relationships/entity_from_schema.inc | 82 ++- .../node_edit_form_from_node.inc | 1 - .../plugins/relationships/term_from_node.inc | 5 +- .../plugins/relationships/term_parent.inc | 7 +- .../plugins/relationships/terms_from_node.inc | 1 - .../plugins/relationships/user_from_node.inc | 2 +- .../stylizer/plugins/export_ui/stylizer.inc | 1 - .../plugins/export_ui/stylizer_ui.class.php | 5 +- .../all/modules/ctools/stylizer/stylizer.info | 7 +- .../modules/ctools/stylizer/stylizer.install | 1 - .../modules/ctools/stylizer/stylizer.module | 1 - sites/all/modules/ctools/tests/css.test | 1 - .../modules/ctools/tests/ctools.plugins.test | 1 - .../ctools/tests/ctools_plugin_test.info | 7 +- .../ctools/tests/ctools_plugin_test.module | 1 - .../modules/ctools/tests/object_cache.test | 1 - .../cached/ctoolsCachedPluginArray.class.php | 1 - .../cached/ctoolsCachedPluginArray2.class.php | 1 - .../tests/plugins/cached/plugin_array.inc | 1 - .../tests/plugins/cached/plugin_array2.inc | 1 - .../tests/plugins/cached/plugin_array_dne.inc | 1 - .../ctoolsNotCachedPluginArray.class.php | 1 - .../ctoolsNotCachedPluginArray2.class.php | 1 - .../tests/plugins/not_cached/plugin_array.inc | 1 - .../plugins/not_cached/plugin_array2.inc | 1 - .../plugins/not_cached/plugin_array_dne.inc | 1 - .../plugins/content_types/views.inc | 19 +- .../content_types/views_attachments.inc | 1 - .../plugins/content_types/views_empty.inc | 10 +- .../plugins/content_types/views_exposed.inc | 6 +- .../plugins/content_types/views_feed.inc | 8 +- .../plugins/content_types/views_footer.inc | 6 +- .../plugins/content_types/views_header.inc | 6 +- .../plugins/content_types/views_pager.inc | 7 +- .../plugins/content_types/views_panes.inc | 115 ++-- .../plugins/content_types/views_row.inc | 43 +- .../plugins/content_types/views_view.inc | 52 ++ .../views_content/plugins/contexts/view.inc | 83 ++- .../plugins/relationships/node_from_view.inc | 1 - .../plugins/relationships/term_from_view.inc | 1 - .../plugins/relationships/user_from_view.inc | 1 - .../relationships/view_from_argument.inc | 101 +++ .../plugins/views/views_content.views.inc | 3 +- ..._content_plugin_display_ctools_context.inc | 123 +++- ...iews_content_plugin_display_panel_pane.inc | 16 +- ...ws_content_plugin_style_ctools_context.inc | 1 - .../ctools/views_content/views_content.info | 7 +- .../ctools/views_content/views_content.module | 100 ++- sites/all/modules/google_analytics/README.txt | 4 +- .../googleanalytics.admin.inc | 33 +- .../google_analytics/googleanalytics.admin.js | 15 +- .../google_analytics/googleanalytics.info | 7 +- .../google_analytics/googleanalytics.install | 48 +- .../google_analytics/googleanalytics.js | 19 +- .../google_analytics/googleanalytics.module | 98 ++- .../google_analytics/googleanalytics.test | 9 +- .../googleanalytics.tokens.inc | 1 - sites/all/modules/imce/README.txt | 1 - sites/all/modules/imce/css/imce-content.css | 6 +- sites/all/modules/imce/imce.info | 7 +- sites/all/modules/imce/imce.install | 9 +- sites/all/modules/imce/imce.module | 1 - sites/all/modules/imce/inc/imce.admin.inc | 23 +- .../modules/imce/inc/imce.core.profiles.inc | 1 - sites/all/modules/imce/inc/imce.js.inc | 1 - sites/all/modules/imce/inc/imce.page.inc | 14 +- sites/all/modules/imce/js/imce.js | 7 +- sites/all/modules/imce/js/imce_extras.js | 1 - sites/all/modules/imce/js/imce_set_app.js | 1 - sites/all/modules/imce/js/imce_set_inline.js | 11 +- sites/all/modules/imce/js/jquery.form.js | 5 +- .../all/modules/imce/tpl/imce-content.tpl.php | 1 - .../modules/imce/tpl/imce-file-list.tpl.php | 1 - sites/all/modules/imce/tpl/imce-page.tpl.php | 4 +- sites/all/modules/imce_wysiwyg/CHANGELOG.txt | 1 - sites/all/modules/imce_wysiwyg/README.txt | 1 - .../modules/imce_wysiwyg/imce_wysiwyg.info | 5 +- .../modules/imce_wysiwyg/imce_wysiwyg.module | 1 - .../modules/imce_wysiwyg/js/imce_wysiwyg.js | 1 - .../modules/imce_wysiwyg/translations/de.po | 39 -- .../translations/imce_wysiwyg.pot | 37 -- sites/all/modules/token/README.txt | 1 - sites/all/modules/token/jquery.treeTable.css | 1 - sites/all/modules/token/jquery.treeTable.js | 1 - sites/all/modules/token/tests/token_test.info | 6 +- sites/all/modules/token/token.css | 9 +- sites/all/modules/token/token.info | 7 +- sites/all/modules/token/token.install | 1 - sites/all/modules/token/token.js | 1 - sites/all/modules/token/token.module | 62 +- sites/all/modules/token/token.pages.inc | 1 - sites/all/modules/token/token.test | 81 ++- sites/all/modules/token/token.tokens.inc | 117 +++- sites/all/themes/README.txt | 1 - sites/default/default.settings.php | 14 +- sites/example.sites.php | 1 - themes/README.txt | 1 - themes/bartik/bartik.info | 7 +- themes/bartik/color/color.inc | 1 - themes/bartik/color/preview.css | 1 - themes/bartik/color/preview.js | 1 - themes/bartik/css/colors.css | 9 +- themes/bartik/css/ie-rtl.css | 1 - themes/bartik/css/ie.css | 1 - themes/bartik/css/ie6.css | 1 - themes/bartik/css/layout-rtl.css | 1 - themes/bartik/css/layout.css | 1 - themes/bartik/css/maintenance-page.css | 8 +- themes/bartik/css/print.css | 1 - themes/bartik/css/style-rtl.css | 1 - themes/bartik/css/style.css | 37 +- themes/bartik/template.php | 2 - .../bartik/templates/comment-wrapper.tpl.php | 1 - themes/bartik/templates/comment.tpl.php | 1 - .../bartik/templates/maintenance-page.tpl.php | 1 - themes/bartik/templates/node.tpl.php | 1 - themes/bartik/templates/page.tpl.php | 1 - themes/engines/phptemplate/phptemplate.engine | 1 - themes/garland/color/color.inc | 1 - themes/garland/color/preview.css | 1 - themes/garland/comment.tpl.php | 1 - themes/garland/fix-ie-rtl.css | 1 - themes/garland/fix-ie.css | 1 - themes/garland/garland.info | 7 +- themes/garland/maintenance-page.tpl.php | 1 - themes/garland/node.tpl.php | 1 - themes/garland/page.tpl.php | 1 - themes/garland/print.css | 1 - themes/garland/style-rtl.css | 1 - themes/garland/style.css | 1 - themes/garland/template.php | 1 - themes/garland/theme-settings.php | 1 - themes/seven/ie.css | 1 - themes/seven/ie6.css | 1 - themes/seven/images/fc-rtl.png | Bin 0 -> 76 bytes themes/seven/maintenance-page.tpl.php | 1 - themes/seven/page.tpl.php | 1 - themes/seven/reset.css | 1 - themes/seven/seven.info | 7 +- themes/seven/style-rtl.css | 1 - themes/seven/style.css | 3 +- themes/seven/template.php | 8 +- themes/seven/vertical-tabs-rtl.css | 21 + themes/seven/vertical-tabs.css | 29 +- themes/stark/README.txt | 1 - themes/stark/layout.css | 1 - themes/stark/stark.info | 7 +- themes/tests/README.txt | 1 - themes/tests/test_theme/template.php | 1 - themes/tests/test_theme/test_theme.info | 7 +- .../update_test_basetheme.info | 7 +- .../update_test_subtheme.info | 7 +- update.php | 21 +- xmlrpc.php | 1 - 1175 files changed, 9125 insertions(+), 4941 deletions(-) create mode 100644 modules/dashboard/dashboard-rtl.css create mode 100644 modules/shortcut/shortcut-rtl.css create mode 100644 modules/simpletest/tests/tablesort.test create mode 100644 modules/simpletest/tests/upgrade/drupal-6.forum.database.php create mode 100644 modules/simpletest/tests/upgrade/upgrade.forum.test create mode 100644 modules/system/system.messages-rtl.css create mode 100644 modules/toolbar/toolbar-rtl.css create mode 100644 sites/all/modules/ctools/css/button.css create mode 100644 sites/all/modules/ctools/css/dropbutton.css create mode 100644 sites/all/modules/ctools/ctools_ajax_sample/images/ajax-loader.gif create mode 100644 sites/all/modules/ctools/ctools_ajax_sample/images/loading-large.gif create mode 100644 sites/all/modules/ctools/ctools_ajax_sample/images/loading.gif create mode 100644 sites/all/modules/ctools/ctools_ajax_sample/images/popups-border.png create mode 100644 sites/all/modules/ctools/includes/dropbutton.theme.inc create mode 100644 sites/all/modules/ctools/includes/views.inc create mode 100644 sites/all/modules/ctools/js/dropbutton.js create mode 100644 sites/all/modules/ctools/plugins/access/entity_bundle.inc create mode 100644 sites/all/modules/ctools/plugins/access/term_has_parent.inc create mode 100644 sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc create mode 100644 sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc create mode 100644 sites/all/modules/ctools/plugins/content_types/token/icon_token.png create mode 100644 sites/all/modules/ctools/plugins/content_types/token/token.inc create mode 100644 sites/all/modules/ctools/views_content/plugins/content_types/views_view.inc create mode 100644 sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc delete mode 100644 sites/all/modules/imce_wysiwyg/translations/de.po delete mode 100644 sites/all/modules/imce_wysiwyg/translations/imce_wysiwyg.pot create mode 100644 themes/seven/images/fc-rtl.png create mode 100644 themes/seven/vertical-tabs-rtl.css diff --git a/.htaccess.sample b/.htaccess.sample index 9cd0e98f..d6ad2fdf 100644 --- a/.htaccess.sample +++ b/.htaccess.sample @@ -13,9 +13,6 @@ Options -Indexes # Follow symbolic links in this directory. Options +FollowSymLinks -# Multiviews creates problems with aliased URLs and is not needed for Drupal. -Options -Multiviews - # Make Drupal handle any 404 errors. ErrorDocument 404 /index.php @@ -148,5 +145,3 @@ DirectoryIndex index.php index.html index.htm </FilesMatch> </IfModule> </IfModule> - -# $Id: .htaccess,v 1.111 2010/11/23 02:59:05 dries Exp $ diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9807f2eb..131e1724 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,23 @@ -// $Id: CHANGELOG.txt,v 1.396 2011/01/05 06:17:58 webchick Exp $ -Drupal 7.0, 2011-01-05 +Drupal 7.2, 2011-05-25 +---------------------- +- Added a default .gitignore file. +- Improved PostgreSQL and SQLite support. +- Numerous critical performance improvements. +- Numerous critical fixes to the upgrade path. +- Numerous fixes to language and translation systems. +- Numerous fixes to AJAX and #states systems. +- Improvements to the locking system. +- Numerous documentation fixes. +- Numerous styling and theme system fixes. +- Numerous fixes for schema mis-matches between Drupal 6 and 7. +- Minor internal API clean-ups. + +Drupal 7.1, 2011-05-25 +---------------------- +- Fixed security issues (Cross site scripting, File access bypass), see SA-CORE-2011-001. + +Drupal 7.0, 2011-01-05 ---------------------- - Database: * Fully rewritten database layer utilizing PHP 5's PDO abstraction layer. @@ -103,7 +120,7 @@ Drupal 7.0, 2011-01-05 are available. - OpenID: * Added support for Gmail and Google Apps for Domain identifiers. Users can - now login with their user@domain.com identifier when domain.com is powered + now login with their user@example.com identifier when example.com is powered by Google. * Made the OpenID module more pluggable. - Added code registry: @@ -219,6 +236,156 @@ Drupal 7.0, 2011-01-05 * Added a locking framework to coordinate long-running operations across requests. +Drupal 6.22, 2011-05-25 +----------------------- +- Made Drupal 6 work better with IIS and Internet Explorer. +- Fixed .po file imports to work better with custom textgroups. +- Improved code documentation at various places. +- Fixed a variety of other bugs. + +Drupal 6.21, 2011-05-25 +---------------------- +- Fixed security issues (Cross site scripting), see SA-CORE-2011-001. + +Drupal 6.20, 2010-12-15 +---------------------- +- Fixed a variety of small bugs, improved code documentation. + +Drupal 6.19, 2010-08-11 +---------------------- +- Fixed a variety of small bugs, improved code documentation. + +Drupal 6.18, 2010-08-11 +---------------------- +- Fixed security issues (OpenID authentication bypass, File download access + bypass, Comment unpublishing bypass, Actions cross site scripting), + see SA-CORE-2010-002. + +Drupal 6.17, 2010-06-02 +---------------------- +- Improved PostgreSQL compatibility +- Better PHP 5.3 and PHP 4 compatibility +- Better browser compatibility of CSS and JS aggregation +- Improved logging for login failures +- Fixed an incompatibility with some contributed modules and the locking system +- Fixed a variety of other bugs. + +Drupal 6.16, 2010-03-03 +---------------------- +- Fixed security issues (Installation cross site scripting, Open redirection, + Locale module cross site scripting, Blocked user session regeneration), + see SA-CORE-2010-001. +- Better support for updated jQuery versions. +- Reduced resource usage of update.module. +- Fixed several issues relating to support of install profiles and + distributions. +- Added a locking framework to avoid data corruption on long operations. +- Fixed a variety of other bugs. + +Drupal 6.15, 2009-12-16 +---------------------- +- Fixed security issues (Cross site scripting), see SA-CORE-2009-009. +- Fixed a variety of other bugs. + +Drupal 6.14, 2009-09-16 +---------------------- +- Fixed security issues (OpenID association cross site request forgeries, + OpenID impersonation and File upload), see SA-CORE-2009-008. +- Changed the system modules page to not run all cache rebuilds; use the + button on the performance settings page to achieve the same effect. +- Added support for PHP 5.3.0 out of the box. +- Fixed a variety of small bugs. + +Drupal 6.13, 2009-07-01 +---------------------- +- Fixed security issues (Cross site scripting, Input format access bypass and + Password leakage in URL), see SA-CORE-2009-007. +- Fixed a variety of small bugs. + +Drupal 6.12, 2009-05-13 +---------------------- +- Fixed security issues (Cross site scripting), see SA-CORE-2009-006. +- Fixed a variety of small bugs. + +Drupal 6.11, 2009-04-29 +---------------------- +- Fixed security issues (Cross site scripting and limited information + disclosure), see SA-CORE-2009-005 +- Fixed performance issues with the menu router cache, the update + status cache and improved cache invalidation +- Fixed a variety of small bugs. + +Drupal 6.10, 2009-02-25 +---------------------- +- Fixed a security issue, (Local file inclusion on Windows), + see SA-CORE-2009-003 +- Fixed node_feed() so custom fields can show up in RSS feeds. +- Improved PostgreSQL compatibility. +- Fixed a variety of small bugs. + +Drupal 6.9, 2009-01-14 +---------------------- +- Fixed security issues, (Access Bypass, Validation Bypass and Hardening + against SQL injection), see SA-CORE-2009-001 +- Made HTTP request checking more robust and informative. +- Fixed HTTP_HOST checking to work again with HTTP 1.0 clients and + basic shell scripts. +- Removed t() calls from all schema documentation. Suggested best practice + changed for contributed modules, see http://drupal.org/node/322731. +- Fixed a variety of small bugs. + +Drupal 6.8, 2008-12-11 +---------------------- +- Removed a previous change incompatible with PHP 5.1.x and lower. + +Drupal 6.7, 2008-12-10 +---------------------- +- Fixed security issues, (Cross site request forgery and Cross site scripting), see SA-2008-073 +- Updated robots.txt and .htaccess to match current file use. +- Fixed a variety of small bugs. + +Drupal 6.6, 2008-10-22 +---------------------- +- Fixed security issues, (File inclusion, Cross site scripting), see SA-2008-067 +- Fixed a variety of small bugs. + +Drupal 6.5, 2008-10-08 +---------------------- +- Fixed security issues, (File upload access bypass, Access rules bypass, + BlogAPI access bypass), see SA-2008-060. +- Fixed a variety of small bugs. + +Drupal 6.4, 2008-08-13 +---------------------- +- Fixed a security issue (Cross site scripting, Arbitrary file uploads via + BlogAPI, Cross site request forgeries and Various Upload module + vulnerabilities), see SA-2008-047. +- Improved error messages during installation. +- Fixed a bug that prevented AHAH handlers to be attached to radios widgets. +- Fixed a variety of small bugs. + +Drupal 6.3, 2008-07-09 +---------------------- +- Fixed security issues, (Cross site scripting, cross site request forgery, + session fixation and SQL injection), see SA-2008-044. +- Slightly modified installation process to prevent file ownership issues on + shared hosts. +- Improved PostgreSQL compatibility (rewritten queries; custom blocks). +- Upgraded to jQuery 1.2.6. +- Performance improvements to search, menu handling and form API caches. +- Fixed Views compatibility issues (Views for Drupal 6 requires Drupal 6.3+). +- Fixed a variety of small bugs. + +Drupal 6.2, 2008-04-09 +---------------------- +- Fixed a variety of small bugs. +- Fixed a security issue (Access bypasses), see SA-2008-026. + +Drupal 6.1, 2008-02-27 +---------------------- +- Fixed a variety of small bugs. +- Fixed a security issue (Cross site scripting), see SA-2008-018. + Drupal 6.0, 2008-02-13 ---------------------- - New, faster and better menu system. @@ -321,6 +488,95 @@ Drupal 6.0, 2008-02-13 - Removed old system updates. Updates from Drupal versions prior to 5.x will require upgrading to 5.x before upgrading to 6.x. +Drupal 5.23, 2010-08-11 +----------------------- +- Fixed security issues (File download access bypass, Comment unpublishing + bypass), see SA-CORE-2010-002. + +Drupal 5.22, 2010-03-03 +----------------------- +- Fixed security issues (Open redirection, Locale module cross site scripting, + Blocked user session regeneration), see SA-CORE-2010-001. + +Drupal 5.21, 2009-12-16 +----------------------- +- Fixed a security issue (Cross site scripting), see SA-CORE-2009-009. +- Fixed a variety of small bugs. + +Drupal 5.20, 2009-09-16 +----------------------- +- Avoid security problems resulting from writing Drupal 6-style menu + declarations. +- Fixed security issues (session fixation), see SA-CORE-2009-008. +- Fixed a variety of small bugs. + +Drupal 5.19, 2009-07-01 +----------------------- +- Fixed security issues (Cross site scripting and Password leakage in URL), see + SA-CORE-2009-007. +- Fixed a variety of small bugs. + +Drupal 5.18, 2009-05-13 +----------------------- +- Fixed security issues (Cross site scripting), see SA-CORE-2009-006. +- Fixed a variety of small bugs. + +Drupal 5.17, 2009-04-29 +----------------------- +- Fixed security issues (Cross site scripting and limited information + disclosure) see SA-CORE-2009-005. +- Fixed a variety of small bugs. + +Drupal 5.16, 2009-02-25 +----------------------- +- Fixed a security issue, (Local file inclusion on Windows), see SA-CORE-2009-004. +- Fixed a variety of small bugs. + +Drupal 5.15, 2009-01-14 +----------------------- +- Fixed security issues, (Hardening against SQL injection), see + SA-CORE-2009-001 +- Fixed HTTP_HOST checking to work again with HTTP 1.0 clients and basic shell + scripts. +- Fixed a variety of small bugs. + +Drupal 5.14, 2008-12-11 +----------------------- +- removed a previous change incompatible with PHP 5.1.x and lower. + +Drupal 5.13, 2008-12-10 +----------------------- +- fixed a variety of small bugs. +- fixed security issues, (Cross site request forgery and Cross site scripting), see SA-2008-073 +- updated robots.txt and .htaccess to match current file use. + +Drupal 5.12, 2008-10-22 +----------------------- +- fixed security issues, (File inclusion), see SA-2008-067 + +Drupal 5.11, 2008-10-08 +----------------------- +- fixed a variety of small bugs. +- fixed security issues, (File upload access bypass, Access rules bypass, + BlogAPI access bypass, Node validation bypass), see SA-2008-060 + +Drupal 5.10, 2008-08-13 +----------------------- +- fixed a variety of small bugs. +- fixed security issues, (Cross site scripting, Arbitrary file uploads via + BlogAPI and Cross site request forgery), see SA-2008-047 + +Drupal 5.9, 2008-07-23 +---------------------- +- fixed a variety of small bugs. +- fixed security issues, (Session fixation), see SA-2008-046 + +Drupal 5.8, 2008-07-09 +---------------------- +- fixed a variety of small bugs. +- fixed security issues, (Cross site scripting, cross site request forgery, and + session fixation), see SA-2008-044 + Drupal 5.7, 2008-01-28 ---------------------- - fixed the input format configuration page. diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 3faeeb84..e9834744 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -1,10 +1,10 @@ -// $Id: COPYRIGHT.txt,v 1.6 2010/01/02 10:20:21 dries Exp $ All Drupal code is Copyright 2001 - 2010 by the original authors. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation. +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY diff --git a/INSTALL.mysql.txt b/INSTALL.mysql.txt index 2bd3a4bc..a7c292e3 100644 --- a/INSTALL.mysql.txt +++ b/INSTALL.mysql.txt @@ -1,12 +1,11 @@ -// $Id: INSTALL.mysql.txt,v 1.12 2010/01/11 16:25:15 webchick Exp $ CREATE THE MySQL DATABASE -------------------------- -This step is only necessary if you don't already have a database set-up (e.g. by -your host). In the following examples, 'username' is an example MySQL user which -has the CREATE and GRANT privileges. Use the appropriate user name for your -system. +This step is only necessary if you don't already have a database set up (e.g., +by your host). In the following examples, 'username' is an example MySQL user +which has the CREATE and GRANT privileges. Use the appropriate user name for +your system. First, you must create a new database for your Drupal site (here, 'databasename' is the name of the new database): diff --git a/INSTALL.pgsql.txt b/INSTALL.pgsql.txt index c6ee6e75..8fe80433 100644 --- a/INSTALL.pgsql.txt +++ b/INSTALL.pgsql.txt @@ -1,4 +1,3 @@ -// $Id: INSTALL.pgsql.txt,v 1.9 2010/04/07 15:07:58 dries Exp $ CREATE THE PostgreSQL DATABASE ------------------------------ @@ -7,38 +6,39 @@ Note that the database must be created with UTF-8 (Unicode) encoding. 1. CREATE DATABASE USER - This step is only necessary if you don't already have a user set up (e.g. - by your host) or you want to create new user for use with Drupal only. The - following command creates a new user named "username" and asks for a - password for that user: + This step is only necessary if you don't already have a user set up (e.g., by + your host), or want to create a new user for use with Drupal only. The + following command creates a new user named 'username' and asks for a password + for that user: createuser --pwprompt --encrypted --no-createrole --no-createdb username - If there are no errors then the command was successful + If there are no errors, then the command was successful. -2. CREATE THE DRUPAL DATABASE +2. CREATE DRUPAL DATABASE - This step is only necessary if you don't already have a database set up (e.g. - by your host) or you want to create new database for use with Drupal only. - The following command creates a new database named "databasename", which is - owned by previously created "username": + This step is only necessary if you don't already have a database set up + (e.g., by your host) or want to create a new database for use with Drupal + only. The following command creates a new database named 'databasename', + which is owned by the previously created 'username': createdb --encoding=UTF8 --owner=username databasename - If there are no errors then the command was successful + If there are no errors, then the command was successful. -3. CREATE A SCHEMA OR SCHEMAS (Optional advanced) +3. CREATE SCHEMA OR SCHEMAS (Optional advanced step) - Drupal will run across different schemas within your database if you so wish. - By default, Drupal runs inside the 'public' schema but you can use $db_prefix - inside settings.php to define a schema for Drupal to inside of or specify tables - that are shared inside of a separate schema. Drupal will not create schemas for - you, infact the user that Drupal runs as should not be allowed to. You'll need - execute the SQL below as a superuser (such as a postgres user) and replace - 'drupaluser' with the username that Drupal uses to connect to PostgreSQL with - and replace schema_name with a schema name you wish to use such as 'shared': + Drupal will run across different schemas within your database if you so wish. + By default, Drupal runs inside the 'public' schema but you can use $db_prefix + inside settings.php to define a schema for Drupal to run inside of, or + specify tables that are shared inside of a separate schema. Drupal will not + create schemas for you. In fact, the user that Drupal runs as should not be + allowed to do this. You'll need to execute the SQL below as a superuser, + replace 'username' with the username that Drupal uses to connect to + PostgreSQL, and replace 'schema_name' with a schema name you wish to use, + such as 'shared': - CREATE SCHEMA schema_name AUTHORIZATION drupaluser; + CREATE SCHEMA schema_name AUTHORIZATION username; - Do this for as many schemas as you need. See default.settings.php for how to - set which tables use which schemas. + Do this for as many schemas as you need. See default.settings.php for + instructions on how to set which tables use which schemas. diff --git a/INSTALL.sqlite.txt b/INSTALL.sqlite.txt index 9c4f754a..8e57d60c 100644 --- a/INSTALL.sqlite.txt +++ b/INSTALL.sqlite.txt @@ -1,20 +1,19 @@ -// $Id: INSTALL.sqlite.txt,v 1.4 2010/11/29 02:55:57 webchick Exp $ SQLITE REQUIREMENTS ------------------- -To use SQLite with your Drupal installation, the following requirements must -be met: server has PHP 5.2 or later with PDO, and the PDO SQLite driver must -be enabled. +To use SQLite with your Drupal installation, the following requirements must be +met: Server has PHP 5.2 or later with PDO, and the PDO SQLite driver must be +enabled. SQLITE DATABASE CREATION ------------------------ The Drupal installer will create the SQLite database for you. The only -requirement is the installer must have write permissions the directory where -the database file resides. This directory (not just the database file) also has -to remain writeable by the web server going forward for SQLite to continue to be -able to operate. +requirement is that the installer must have write permissions to the directory +where the database file resides. This directory (not just the database file) also +has to remain writeable by the web server going forward for SQLite to continue to +be able to operate. On the "Database configuration" form in the "Database file" field, you must supply the exact path to where you wish your database file to reside. It is diff --git a/INSTALL.txt b/INSTALL.txt index 95fa4156..7b526e33 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,4 +1,3 @@ -// $Id: INSTALL.txt,v 1.87 2011/01/01 22:41:24 webchick Exp $ CONTENTS OF THIS FILE --------------------- @@ -10,7 +9,6 @@ CONTENTS OF THIS FILE * Multisite configuration * More information - REQUIREMENTS AND NOTES ---------------------- @@ -27,24 +25,23 @@ Drupal requires: For more detailed information about Drupal requirements, including a list of PHP extensions and configurations that are required, see "System requirements" -(http://drupal.org/requirements) in the Drupal handbook. +(http://drupal.org/requirements) in the Drupal.org online documentation. For detailed information on how to configure a test server environment using a variety of operating systems and web servers, see "Local server setup" -(http://drupal.org/node/157602) in the Drupal handbook. +(http://drupal.org/node/157602) in the Drupal.org online documentation. Note that all directories mentioned in this document are always relative to the directory of your Drupal installation, and commands are meant to be run from this directory (except for the initial commands that create that directory). - OPTIONAL SERVER REQUIREMENTS ---------------------------- - If you want to use Drupal's "Clean URLs" feature on an Apache web server, you will need the mod_rewrite module and the ability to use local .htaccess - files. For Clean URLs support on IIS, see "Using Clean URLs with IIS" - (http://drupal.org/node/3854) in the Drupal handbook. + files. For Clean URLs support on IIS, see "Clean URLs with IIS" + (http://drupal.org/node/3854) in the Drupal.org online documentation. - If you plan to use XML-based services such as RSS aggregation, you will need PHP's XML extension. This extension is enabled by default on most PHP @@ -60,17 +57,18 @@ OPTIONAL SERVER REQUIREMENTS configuration allows the web server to initiate outbound connections. Most web hosting setups allow this. - INSTALLATION ------------ 1. Download and extract Drupal. You can obtain the latest Drupal release from http://drupal.org -- the files - are in .tar.gz format and can be extracted using most compression tools. + are available in .tar.gz and .zip formats and can be extracted using most + compression tools. To download and extract the files, on a typical Unix/Linux command line, use - the following commands (assuming you want version x.y of Drupal): + the following commands (assuming you want version x.y of Drupal in .tar.gz + format): wget http://drupal.org/files/projects/drupal-x.y.tar.gz tar -zxvf drupal-x.y.tar.gz @@ -89,7 +87,7 @@ INSTALLATION initially: - Download a translation file for the correct Drupal version and language - from the translation server: http://localize.drupal.org/download + from the translation server: http://localize.drupal.org/translate/downloads - Place the file into your installation profile's translations directory. For instance, if you are using the Standard install profile, @@ -257,7 +255,7 @@ INSTALLATION For more information on setting file permissions, see "Modifying Linux, Unix, and Mac file permissions" (http://drupal.org/node/202483) or "Modifying Windows file permissions" (http://drupal.org/node/202491) in the - online handbook. + Drupal.org online documentation. 8. Set up independent "cron" maintenance jobs. @@ -299,7 +297,6 @@ INSTALLATION scripts/ directory. (Note that these scripts must be customized like the above example, to add your site-specific cron key and domain name.) - BUILDING AND CUSTOMIZING YOUR SITE ---------------------------------- @@ -317,12 +314,11 @@ multisite installation, you can also place modules and themes in the site-specific directories -- see the Multisite Configuration section, below. Never edit Drupal's core modules and themes; instead, use the hooks available in -the Drupal API. To modify the behavior of Drupal, develope a module as described +the Drupal API. To modify the behavior of Drupal, develop a module as described at http://drupal.org/developing/modules. To modify the look of Drupal, create a subtheme as described at http://drupal.org/node/225125, or a completely new theme as described at http://drupal.org/documentation/theme - MULTISITE CONFIGURATION ----------------------- @@ -332,16 +328,15 @@ its own individual configuration. Additional site configurations are created in subdirectories within the 'sites' directory. Each subdirectory must have a 'settings.php' file, which specifies the configuration settings. The easiest way to create additional sites is to -copy the 'default' directory and modify the 'settings.php' file as -appropriate. The new directory name is constructed from the site's URL. The -configuration for www.example.com could be in 'sites/example.com/settings.php' -(note that 'www.' should be omitted if users can access your site at -http://example.com/). +copy the 'default' directory and modify the 'settings.php' file as appropriate. +The new directory name is constructed from the site's URL. The configuration for +www.example.com could be in 'sites/example.com/settings.php' (note that 'www.' +should be omitted if users can access your site at http://example.com/). Sites do not have to have a different domain. You can also use subdomains and -subdirectories for Drupal sites. For example, example.com, sub.example.com, -and sub.example.com/site3 can all be defined as independent Drupal sites. The -setup for a configuration such as this would look like the following: +subdirectories for Drupal sites. For example, example.com, sub.example.com, and +sub.example.com/site3 can all be defined as independent Drupal sites. The setup +for a configuration such as this would look like the following: sites/default/settings.php sites/example.com/settings.php @@ -384,15 +379,14 @@ settings, consult http://drupal.org/getting-started/6/install/multi-site For more information on configuring Drupal's file system path in a multisite configuration, see step 6 above. - MORE INFORMATION ---------------- -- For additional documentation, see the online Drupal handbook: - http://drupal.org/handbook +- See the Drupal.org online documentation: + http://drupal.org/documentation -- For a list of security announcements, see the "Security announcements" page - at http://drupal.org/security (available as an RSS feed). This page also +- For a list of security announcements, see the "Security advisories" page at + http://drupal.org/security (available as an RSS feed). This page also describes how to subscribe to these announcements via e-mail. - For information about the Drupal security process, or to find out how to diff --git a/LICENSE.txt b/LICENSE.txt index 21725202..2c095c8d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,340 +1,274 @@ -// $Id: LICENSE.txt,v 1.7 2009/01/26 14:08:40 dries Exp $ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. +GNU GENERAL PUBLIC LICENSE + + Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, +Cambridge, MA 02139, USA. Everyone is permitted to copy and distribute +verbatim copies of this license document, but changing it is not allowed. + + Preamble + +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public License +applies to most of the Free Software Foundation's software and to any other +program whose authors commit to using it. (Some other Free Software +Foundation software is covered by the GNU Library General Public License +instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the +freedom to distribute copies of free software (and charge for this service if +you wish), that you receive source code or can get it if you want it, that you +can change the software or use pieces of it in new free programs; and that +you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to +deny you these rights or to ask you to surrender the rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for +a fee, you must give the recipients all the rights that you have. You must make +sure that they, too, receive or can get the source code. And you must show +them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) +offer you this license which gives you legal permission to copy, distribute +and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that +everyone understands that there is no warranty for this free software. If the +software is modified by someone else and passed on, we want its recipients +to know that what they have is not the original, so that any problems +introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We +wish to avoid the danger that redistributors of a free program will individually +obtain patent licenses, in effect making the program proprietary. To prevent +this, we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification +follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND + MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms +of this General Public License. The "Program", below, refers to any such +program or work, and a "work based on the Program" means either the +Program or any derivative work under copyright law: that is to say, a work +containing the Program or a portion of it, either verbatim or with +modifications and/or translated into another language. (Hereinafter, translation +is included without limitation in the term "modification".) Each licensee is +addressed as "you". + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running the Program is +not restricted, and the output from the Program is covered only if its contents +constitute a work based on the Program (independent of having been made +by running the Program). Whether that is true depends on what the Program +does. + +1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this License +and to the absence of any warranty; and give any other recipients of the +Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, +thus forming a work based on the Program, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that you +also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that +you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or in +part contains or is derived from the Program or any part thereof, to be +licensed as a whole at no charge to all third parties under the terms of this +License. + +c) If the modified program normally reads commands interactively when run, +you must cause it, when started running for such interactive use in the most +ordinary way, to print or display an announcement including an appropriate +copyright notice and a notice that there is no warranty (or else, saying that +you provide a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this License. +(Exception: if the Program itself is interactive but does not normally print such +an announcement, your work based on the Program is not required to print +an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be +reasonably considered independent and separate works in themselves, then +this License, and its terms, do not apply to those sections when you distribute +them as separate works. But when you distribute the same sections as part +of a whole which is a work based on the Program, the distribution of the +whole must be on the terms of this License, whose permissions for other +licensees extend to the entire whole, and thus to each and every part +regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to +work written entirely by you; rather, the intent is to exercise the right to +control the distribution of derivative or collective works based on the +Program. In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) +with the Program (or with a work based on the Program) on a volume of a +storage or distribution medium does not bring the other work under the scope +of this License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 +and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source +code, which must be distributed under the terms of Sections 1 and 2 above +on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to give +any third party, for a charge no more than your cost of physically performing +source distribution, a complete machine-readable copy of the corresponding +source code, to be distributed under the terms of Sections 1 and 2 above on +a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to distribute +corresponding source code. (This alternative is allowed only for +noncommercial distribution and only if you received the program in object +code or executable form with such an offer, in accord with Subsection b +above.) The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to +making modifications to it. For an executable work, complete source code +means all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation and +installation of the executable. However, as a special exception, the source +code distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, +and so on) of the operating system on which the executable runs, unless that +component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to +copy from a designated place, then offering equivalent access to copy the +source code from the same place counts as distribution of the source code, +even though third parties are not compelled to copy the source along with the +object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, +modify, sublicense or distribute the Program is void, and will automatically +terminate your rights under this License. However, parties who have received +copies, or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the +Program or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or distributing the +Program (or any work based on the Program), you indicate your acceptance +of this License to do so, and all its terms and conditions for copying, +distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), conditions +are imposed on you (whether by court order, agreement or otherwise) that +contradict the conditions of this License, they do not excuse you from the +conditions of this License. If you cannot distribute so as to satisfy +simultaneously your obligations under this License and any other pertinent +obligations, then as a consequence you may not distribute the Program at all. +For example, if a patent license would not permit royalty-free redistribution +of the Program by all those who receive copies directly or indirectly through +you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system, which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose +that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Program under this License may add an explicit +geographical distribution limitation excluding those countries, so that +distribution is permitted only in or among countries not thus excluded. In such +case, this License incorporates the limitation as if written in the body of this +License. + +9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies +a version number of this License which applies to it and "any later version", +you have the option of following the terms and conditions either of that +version or of any later version published by the Free Software Foundation. If +the Program does not specify a version number of this License, you may +choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make +exceptions for this. Our decision will be guided by the two goals of +preserving the free status of all derivatives of our free software and of +promoting the sharing and reuse of software generally. + + NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT +PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR +AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR +ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE +LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE +PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA +OR DATA BEING RENDERED INACCURATE OR LOSSES +SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE +PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN +IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt index d01cc4cb..0af271d4 100644 --- a/MAINTAINERS.txt +++ b/MAINTAINERS.txt @@ -1,4 +1,3 @@ -// $Id: MAINTAINERS.txt,v 1.53 2011/01/04 01:03:23 webchick Exp $ Drupal core is maintained by the community. To participate, go to @@ -19,7 +18,7 @@ Drupal 7 Component maintainers --------------------- -AJAX system +Ajax system - Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040> - Randy Fay 'rfay' <http://drupal.org/user/30906> - Earl Miles 'merlinofchaos' <http://drupal.org/user/26979> @@ -44,7 +43,7 @@ Database system - MySQL driver - Larry Garfield 'Crell' <http://drupal.org/user/26398> - - David Strauss 'David Strauss' <hhttp://drupal.org/user/93254> + - David Strauss 'David Strauss' <http://drupal.org/user/93254> - PostgreSQL driver - Damien Tournoud 'DamZ' <http://drupal.org/user/22211> diff --git a/README.txt b/README.txt index 4cc75b3a..921f99c6 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.1 2010/12/02 00:20:18 webchick Exp $ CONTENTS OF THIS FILE --------------------- @@ -25,14 +24,14 @@ Legal information about Drupal: CONFIGURATION AND FEATURES -------------------------- -Drupal core (what you get when you download and unzip a drupal-x.y.tar.gz file -from http://drupal.org/project/drupal) has what you need to get started with -your website. It includes several modules (extensions that add functionality) -for common website features, such as managing content, user accounts, image -uploading, and search. Core comes with many options that allow site-specific -configuration. In addition to the core modules, there are thousands of -contributed modules (for functionality not included with Drupal core) -available for download. +Drupal core (what you get when you download and extract a drupal-x.y.tar.gz or +drupal-x.y.zip file from http://drupal.org/project/drupal) has what you need to +get started with your website. It includes several modules (extensions that add +functionality) for common website features, such as managing content, user +accounts, image uploading, and search. Core comes with many options that allow +site-specific configuration. In addition to the core modules, there are +thousands of contributed modules (for functionality not included with Drupal +core) available for download. More about configuration: * Install, upgrade, and maintain Drupal: @@ -49,8 +48,8 @@ APPEARANCE In Drupal, the appearance of your site is set by the theme (themes are extensions that set fonts, colors, and layout). Drupal core comes with several -themes. More themes are available for download, and you can also create your -own custom theme. +themes. More themes are available for download, and you can also create your own +custom theme. More about themes: * Download contributed themes to sites/all/themes to modify Drupal's diff --git a/UPGRADE.txt b/UPGRADE.txt index b84844c0..d4909d8e 100644 --- a/UPGRADE.txt +++ b/UPGRADE.txt @@ -1,4 +1,3 @@ -// $Id: UPGRADE.txt,v 1.27 2010/10/27 18:32:54 dries Exp $ INTRODUCTION ------------ @@ -13,7 +12,7 @@ First steps and definitions: * If you are upgrading to Drupal version x.y, then x is known as the major version number, and y is known as the minor version number. The download - file will be named drupal-x.y.tar.gz. + file will be named drupal-x.y.tar.gz (or drupal-x.y.zip). * All directories mentioned in this document are relative to the directory of your Drupal installation. diff --git a/authorize.php b/authorize.php index 8eeccdd7..cd3df50e 100644 --- a/authorize.php +++ b/authorize.php @@ -1,5 +1,4 @@ <?php -// $Id: authorize.php,v 1.12 2010/12/29 04:07:52 webchick Exp $ /** * @file diff --git a/cron.php b/cron.php index 41b9d11d..0dc119ee 100644 --- a/cron.php +++ b/cron.php @@ -1,5 +1,4 @@ <?php -// $Id: cron.php,v 1.43 2009/11/02 03:30:49 webchick Exp $ /** * @file diff --git a/includes/actions.inc b/includes/actions.inc index 9331422b..c2fd4d96 100644 --- a/includes/actions.inc +++ b/includes/actions.inc @@ -1,5 +1,4 @@ <?php -// $Id: actions.inc,v 1.41 2010/12/11 02:09:00 dries Exp $ /** * @file diff --git a/includes/ajax.inc b/includes/ajax.inc index cfb71feb..41c69832 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -1,17 +1,16 @@ <?php -// $Id: ajax.inc,v 1.42 2011/01/02 17:26:39 webchick Exp $ /** * @file - * Functions for use with Drupal's AJAX framework. + * Functions for use with Drupal's Ajax framework. */ /** - * @defgroup ajax AJAX framework + * @defgroup ajax Ajax framework * @{ - * Functions for Drupal's AJAX framework. + * Functions for Drupal's Ajax framework. * - * Drupal's AJAX framework is used to dynamically update parts of a page's HTML + * Drupal's Ajax framework is used to dynamically update parts of a page's HTML * based on data from the server. Upon a specified event, such as a button * click, a callback function is triggered which performs server-side logic and * may return updated markup, which is then replaced on-the-fly with no page @@ -20,33 +19,33 @@ * This framework creates a PHP macro language that allows the server to * instruct JavaScript to perform actions on the client browser. When using * forms, it can be used with the #ajax property. - * The #ajax property can be used to bind events to the AJAX framework. By + * The #ajax property can be used to bind events to the Ajax framework. By * default, #ajax uses 'system/ajax' as its path for submission and thus calls * ajax_form_callback() and a defined #ajax['callback'] function. * However, you may optionally specify a different path to request or a * different callback function to invoke, which can return updated HTML or can - * also return a richer set of @link ajax_commands AJAX framework commands @endlink. + * also return a richer set of @link ajax_commands Ajax framework commands @endlink. * * Standard form handling is as follows: * - A form element has a #ajax property that includes #ajax['callback'] and * omits #ajax['path']. See below about using #ajax['path'] to implement * advanced use-cases that require something other than standard form * handling. - * - On the specified element, AJAX processing is triggered by a change to + * - On the specified element, Ajax processing is triggered by a change to * that element. * - The browser submits an HTTP POST request to the 'system/ajax' Drupal * path. * - The menu page callback for 'system/ajax', ajax_form_callback(), calls * drupal_process_form() to process the form submission and rebuild the * form if necessary. The form is processed in much the same way as if it - * were submitted without AJAX, with the same #process functions and + * were submitted without Ajax, with the same #process functions and * validation and submission handlers called in either case, making it easy - * to create AJAX-enabled forms that degrade gracefully when JavaScript is + * to create Ajax-enabled forms that degrade gracefully when JavaScript is * disabled. * - After form processing is complete, ajax_form_callback() calls the * function named by #ajax['callback'], which returns the form element that * has been updated and needs to be returned to the browser, or - * alternatively, an array of custom AJAX commands. + * alternatively, an array of custom Ajax commands. * - The page delivery callback for 'system/ajax', ajax_deliver(), renders the * element returned by #ajax['callback'], and returns the JSON string * created by ajax_render() to the browser. @@ -57,7 +56,7 @@ * #ajax['callback'], using a JavaScript animation effect specified by * #ajax['effect']. * - * A simple example of basic AJAX use from the + * A simple example of basic Ajax use from the * @link http://drupal.org/project/examples Examples module @endlink follows: * @code * function main_page() { @@ -99,28 +98,28 @@ * } * @endcode * - * In the above example, the 'changethis' element is AJAX-enabled. The default + * In the above example, the 'changethis' element is Ajax-enabled. The default * #ajax['event'] is 'change', so when the 'changethis' element changes, - * an AJAX call is made. The form is submitted and reprocessed, and then the + * an Ajax call is made. The form is submitted and reprocessed, and then the * callback is called. In this case, the form has been automatically * built changing $form['replace_textfield']['#description'], so the callback * just returns that part of the form. * - * To implement AJAX handling in a form, add '#ajax' to the form - * definition of a field. That field will trigger an AJAX event when it is + * To implement Ajax handling in a form, add '#ajax' to the form + * definition of a field. That field will trigger an Ajax event when it is * clicked (or changed, depending on the kind of field). #ajax supports * the following parameters (either 'path' or 'callback' is required at least): * - #ajax['callback']: The callback to invoke to handle the server side of the - * AJAX event, which will receive a $form and $form_state as arguments, and + * Ajax event, which will receive a $form and $form_state as arguments, and * returns a renderable array (most often a form or form fragment), an HTML - * string, or an array of AJAX commands. If returning a renderable array or + * string, or an array of Ajax commands. If returning a renderable array or * a string, the value will replace the original element named in * #ajax['wrapper'], and * theme_status_messages() * will be prepended to that * element. (If the status messages are not wanted, return an array - * of AJAX commands instead.) - * #ajax['wrapper']. If an array of AJAX commands is returned, it will be + * of Ajax commands instead.) + * #ajax['wrapper']. If an array of Ajax commands is returned, it will be * executed by the calling code. * - #ajax['path']: The menu path to use for the request. This is often omitted * and the default is used. This path should map @@ -155,21 +154,21 @@ * More information is available in the * @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7 Form API Reference @endlink * - * In addition to using Form API for doing in-form modification, AJAX may be + * In addition to using Form API for doing in-form modification, Ajax may be * enabled by adding classes to buttons and links. By adding the 'use-ajax' - * class to a link, the link will be loaded via an AJAX call. When using this + * class to a link, the link will be loaded via an Ajax call. When using this * method, the href of the link can contain '/nojs/' as part of the path. When - * the AJAX framework makes the request, it will convert this to '/ajax/'. + * the Ajax framework makes the request, it will convert this to '/ajax/'. * The server is then able to easily tell if this request was made through an - * actual AJAX request or in a degraded state, and respond appropriately. + * actual Ajax request or in a degraded state, and respond appropriately. * * Similarly, submit buttons can be given the class 'use-ajax-submit'. The - * form will then be submitted via AJAX to the path specified in the #action. + * form will then be submitted via Ajax to the path specified in the #action. * Like the ajax-submit class above, this path will have '/nojs/' replaced with * '/ajax/' so that the submit handler can tell if the form was submitted * in a degraded state or not. * - * When responding to AJAX requests, the server should do what it needs to do + * When responding to Ajax requests, the server should do what it needs to do * for that request, then create a commands array. This commands array will * be converted to a JSON object and returned to the client, which will then * iterate over the array and process it like a macro language. @@ -189,14 +188,14 @@ * // Add a visual "changed" marker to the '#object-1' element. * $commands[] = ajax_command_changed('#object-1'); * // Menu 'page callback' and #ajax['callback'] functions are supposed to - * // return render arrays. If returning an AJAX commands array, it must be + * // return render arrays. If returning an Ajax commands array, it must be * // encapsulated in a render array structure. * return array('#type' => 'ajax', '#commands' => $commands); * @endcode * - * When returning an AJAX command array, it is often useful to have + * When returning an Ajax command array, it is often useful to have * status messages rendered along with other tasks in the command array. - * In that case the the AJAX commands array may be constructed like this: + * In that case the the Ajax commands array may be constructed like this: * @code * $commands = array(); * $commands[] = ajax_command_replace(NULL, $output); @@ -204,7 +203,7 @@ * return array('#type' => 'ajax', '#commands' => $commands); * @endcode * - * See @link ajax_commands AJAX framework commands @endlink + * See @link ajax_commands Ajax framework commands @endlink */ /** @@ -215,7 +214,7 @@ * functions. */ function ajax_render($commands = array()) { - // AJAX responses aren't rendered with html.tpl.php, so we have to call + // Ajax responses aren't rendered with html.tpl.php, so we have to call // drupal_get_css() and drupal_get_js() here, in order to have new files added // during this request to be loaded by the page. We only want to send back // files that the page hasn't already loaded, so we implement simple diffing @@ -235,7 +234,7 @@ function ajax_render($commands = array()) { // @todo Inline CSS and JS items are indexed numerically. These can't be // reliably diffed with array_diff_key(), since the number can change // due to factors unrelated to the inline content, so for now, we strip - // the inline items from AJAX responses, and can add support for them + // the inline items from Ajax responses, and can add support for them // when drupal_add_css() and drupal_add_js() are changed to using md5() // or some other hash of the inline content. foreach ($items[$type] as $key => $item) { @@ -251,14 +250,14 @@ function ajax_render($commands = array()) { // Settings are handled separately, later in this function, so that changes to // the ajaxPageState setting that occur during drupal_get_css() and // drupal_get_js() get included, and because the jQuery.extend() code produced - // by drupal_get_js() for adding settings isn't appropriate during an AJAX + // by drupal_get_js() for adding settings isn't appropriate during an Ajax // response, because it does not pass TRUE for the "deep" parameter, and // therefore, can clobber existing settings on the page. if (isset($items['js']['settings'])) { unset($items['js']['settings']); } - // Render the HTML to load these files, and add AJAX commands to insert this + // Render the HTML to load these files, and add Ajax commands to insert this // HTML in the page. We pass TRUE as the $skip_alter argument to prevent the // data from being altered again, as we already altered it above. $styles = drupal_get_css($items['css'], TRUE); @@ -287,16 +286,16 @@ function ajax_render($commands = array()) { array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $settings['data']), TRUE)); } - // Allow modules to alter any AJAX response. + // Allow modules to alter any Ajax response. drupal_alter('ajax_render', $commands); return drupal_json_encode($commands); } /** - * Get a form submitted via #ajax during an AJAX callback. + * Get a form submitted via #ajax during an Ajax callback. * - * This will load a form from the form cache used during AJAX operations. It + * This will load a form from the form cache used during Ajax operations. It * pulls the form info from $_POST. * * @return @@ -326,7 +325,7 @@ function ajax_get_form() { // Since some of the submit handlers are run, redirects need to be disabled. $form_state['no_redirect'] = TRUE; - // When a form is rebuilt after AJAX processing, its #build_id and #action + // When a form is rebuilt after Ajax processing, its #build_id and #action // should not change. // @see drupal_rebuild_form() $form_state['rebuild_info']['copy']['#build_id'] = TRUE; @@ -341,10 +340,10 @@ function ajax_get_form() { } /** - * Menu callback; handles AJAX requests for the #ajax Form API property. + * Menu callback; handles Ajax requests for the #ajax Form API property. * * This rebuilds the form from cache and invokes the defined #ajax['callback'] - * to return an AJAX command structure for JavaScript. In case no 'callback' has + * to return an Ajax command structure for JavaScript. In case no 'callback' has * been defined, nothing will happen. * * The Form API #ajax property can be set both for buttons and other input @@ -361,9 +360,9 @@ function ajax_form_callback() { // We need to return the part of the form (or some other content) that needs // to be re-rendered so the browser can update the page with changed content. - // Since this is the generic menu callback used by many AJAX elements, it is + // Since this is the generic menu callback used by many Ajax elements, it is // up to the #ajax['callback'] function of the element (may or may not be a - // button) that triggered the AJAX request to determine what needs to be + // button) that triggered the Ajax request to determine what needs to be // rendered. if (!empty($form_state['triggering_element'])) { $callback = $form_state['triggering_element']['#ajax']['callback']; @@ -374,21 +373,21 @@ function ajax_form_callback() { } /** - * Theme callback for AJAX requests. + * Theme callback for Ajax requests. * - * Many different pages can invoke an AJAX request to system/ajax or another - * generic AJAX path. It is almost always desired for an AJAX response to be + * Many different pages can invoke an Ajax request to system/ajax or another + * generic Ajax path. It is almost always desired for an Ajax response to be * rendered using the same theme as the base page, because most themes are built * with the assumption that they control the entire page, so if the CSS for two * themes are both loaded for a given page, they may conflict with each other. * For example, Bartik is Drupal's default theme, and Seven is Drupal's default * administration theme. Depending on whether the "Use the administration theme * when editing or creating content" checkbox is checked, the node edit form may - * be displayed in either theme, but the AJAX response to the Field module's + * be displayed in either theme, but the Ajax response to the Field module's * "Add another item" button should be rendered using the same theme as the rest * of the page. Therefore, system_menu() sets the 'theme callback' for * 'system/ajax' to this function, and it is recommended that modules - * implementing other generic AJAX paths do the same. + * implementing other generic Ajax paths do the same. */ function ajax_base_page_theme() { if (!empty($_POST['ajax_page_state']['theme']) && !empty($_POST['ajax_page_state']['theme_token'])) { @@ -407,9 +406,9 @@ function ajax_base_page_theme() { } /** - * Package and send the result of a page callback to the browser as an AJAX response. + * Package and send the result of a page callback to the browser as an Ajax response. * - * This function is the equivalent of drupal_deliver_html_page(), but for AJAX + * This function is the equivalent of drupal_deliver_html_page(), but for Ajax * requests. Like that function, it: * - Adds needed HTTP headers. * - Prints rendered output. @@ -425,36 +424,71 @@ function ajax_base_page_theme() { * @see drupal_deliver_html_page() */ function ajax_deliver($page_callback_result) { + // Browsers do not allow JavaScript to read the contents of a user's local + // files. To work around that, the jQuery Form plugin submits forms containing + // a file input element to an IFRAME, instead of using XHR. Browsers do not + // normally expect JSON strings as content within an IFRAME, so the response + // must be customized accordingly. + // @see http://malsup.com/jquery/form/#file-upload + // @see Drupal.ajax.prototype.beforeSend() + $iframe_upload = !empty($_POST['ajax_iframe_upload']); + // Emit a Content-Type HTTP header if none has been added by the page callback // or by a wrapping delivery callback. if (is_null(drupal_get_http_header('Content-Type'))) { - // The standard header for JSON is application/json. - // @see http://www.ietf.org/rfc/rfc4627.txt?number=4627 - // However, browsers do not allow JavaScript to read the contents of a - // user's local files. To work around that, jQuery submits forms containing - // a file input element to an IFRAME, instead of using XHR. - // @see http://malsup.com/jquery/form/#file-upload - // When Internet Explorer receives application/json content in an IFRAME, it - // treats it as a file download and prompts the user to save it. To prevent - // that, we return the content as text/plain. But only for POST requests, - // since jQuery should always use XHR for GET requests and the incorrect - // mime type should not end up in page or proxy server caches. - // @see http://drupal.org/node/995854 - $iframe_upload = !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest'; - if ($iframe_upload && $_SERVER['REQUEST_METHOD'] == 'POST') { - drupal_add_http_header('Content-Type', 'text/plain; charset=utf-8'); + if (!$iframe_upload) { + // Standard JSON can be returned to a browser's XHR object, and to + // non-browser user agents. + // @see http://www.ietf.org/rfc/rfc4627.txt?number=4627 + drupal_add_http_header('Content-Type', 'application/json; charset=utf-8'); } else { - drupal_add_http_header('Content-Type', 'application/json; charset=utf-8'); + // Browser IFRAMEs expect HTML. With most other content types, Internet + // Explorer presents the user with a download prompt. + drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); } } - // Normalize whatever was returned by the page callback to an AJAX commands - // array. + // Print the response. + $commands = ajax_prepare_response($page_callback_result); + $json = ajax_render($commands); + if (!$iframe_upload) { + // Standard JSON can be returned to a browser's XHR object, and to + // non-browser user agents. + print $json; + } + else { + // Browser IFRAMEs expect HTML. Browser extensions, such as Linkification + // and Skype's Browser Highlighter, convert URLs, phone numbers, etc. into + // links. This corrupts the JSON response. Protect the integrity of the + // JSON data by making it the value of a textarea. + // @see http://malsup.com/jquery/form/#file-upload + // @see http://drupal.org/node/1009382 + print '<textarea>' . $json . '</textarea>'; + } + + // Perform end-of-request tasks. + ajax_footer(); +} + +/** + * Converts the return value of a page callback into an Ajax commands array. + * + * @param $page_callback_result + * The result of a page callback. Can be one of: + * - NULL: to indicate no content. + * - An integer menu status constant: to indicate an error condition. + * - A string of HTML content. + * - A renderable array of content. + * + * @return + * An Ajax commands array that can be passed to ajax_render(). + */ +function ajax_prepare_response($page_callback_result) { $commands = array(); if (!isset($page_callback_result)) { // Simply delivering an empty commands array is sufficient. This results - // in the AJAX request being completed, but nothing being done to the page. + // in the Ajax request being completed, but nothing being done to the page. } elseif (is_int($page_callback_result)) { switch ($page_callback_result) { @@ -473,7 +507,7 @@ function ajax_deliver($page_callback_result) { } } elseif (is_array($page_callback_result) && isset($page_callback_result['#type']) && ($page_callback_result['#type'] == 'ajax')) { - // Complex AJAX callbacks can return a result that contains an error message + // Complex Ajax callbacks can return a result that contains an error message // or a specific set of commands to send to the browser. $page_callback_result += element_info('ajax'); $error = $page_callback_result['#error']; @@ -488,7 +522,7 @@ function ajax_deliver($page_callback_result) { } } else { - // Like normal page callbacks, simple AJAX callbacks can return HTML + // Like normal page callbacks, simple Ajax callbacks can return HTML // content, as a string or render array. This HTML is inserted in some // relationship to #ajax['wrapper'], as determined by which jQuery DOM // manipulation method is used. The method used is specified by @@ -497,28 +531,24 @@ function ajax_deliver($page_callback_result) { $html = is_string($page_callback_result) ? $page_callback_result : drupal_render($page_callback_result); $commands[] = ajax_command_insert(NULL, $html); // Add the status messages inside the new content's wrapper element, so that - // on subsequent AJAX requests, it is treated as old content. + // on subsequent Ajax requests, it is treated as old content. $commands[] = ajax_command_prepend(NULL, theme('status_messages')); } - // Unlike the recommendation in http://malsup.com/jquery/form/#file-upload, - // we do not have to wrap the JSON string in a TEXTAREA, because - // drupal_json_encode() returns an HTML-safe JSON string. - print ajax_render($commands); - ajax_footer(); + return $commands; } /** - * Perform end-of-AJAX-request tasks. + * Perform end-of-Ajax-request tasks. * - * This function is the equivalent of drupal_page_footer(), but for AJAX + * This function is the equivalent of drupal_page_footer(), but for Ajax * requests. * * @see drupal_page_footer() */ function ajax_footer() { - // Even for AJAX requests, invoke hook_exit() implementations. There may be - // modules that need very fast AJAX responses, and therefore, run AJAX + // Even for Ajax requests, invoke hook_exit() implementations. There may be + // modules that need very fast Ajax responses, and therefore, run Ajax // requests with an early bootstrap. if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update')) { module_invoke_all('exit'); @@ -551,10 +581,10 @@ function ajax_process_form($element, &$form_state) { } /** - * Add AJAX information about an element to the page to communicate with JavaScript. + * Add Ajax information about an element to the page to communicate with JavaScript. * * If #ajax['path'] is set on an element, this additional JavaScript is added - * to the page header to attach the AJAX behaviors. See ajax.js for more + * to the page header to attach the Ajax behaviors. See ajax.js for more * information. * * @param $element @@ -591,9 +621,9 @@ function ajax_pre_render_element($element) { case 'image_button': // Use the mousedown instead of the click event because form // submission via pressing the enter key triggers a click event on - // submit inputs, inappropriately triggering AJAX behaviors. + // submit inputs, inappropriately triggering Ajax behaviors. $element['#ajax']['event'] = 'mousedown'; - // Attach an additional event handler so that AJAX behaviors + // Attach an additional event handler so that Ajax behaviors // can be triggered still via keyboard input. $element['#ajax']['keypress'] = TRUE; break; @@ -642,7 +672,7 @@ function ajax_pre_render_element($element) { unset($settings['path'], $settings['options']); // Add special data to $settings['submit'] so that when this element - // triggers an AJAX submission, Drupal's form processing can determine which + // triggers an Ajax submission, Drupal's form processing can determine which // element triggered it. // @see _form_element_triggered_scripted_submission() if (isset($settings['trigger_as'])) { @@ -685,7 +715,7 @@ function ajax_pre_render_element($element) { 'data' => array('ajax' => array($element['#id'] => $settings)), ); - // Indicate that AJAX processing was successful. + // Indicate that Ajax processing was successful. $element['#ajax_processed'] = TRUE; } return $element; @@ -696,16 +726,16 @@ function ajax_pre_render_element($element) { */ /** - * @defgroup ajax_commands AJAX framework commands + * @defgroup ajax_commands Ajax framework commands * @{ - * Functions to create various AJAX commands. + * Functions to create various Ajax commands. * * These functions can be used to create arrays for use with the * ajax_render() function. */ /** - * Creates a Drupal AJAX 'alert' command. + * Creates a Drupal Ajax 'alert' command. * * The 'alert' command instructs the client to display a JavaScript alert * dialog box. @@ -727,7 +757,7 @@ function ajax_command_alert($text) { } /** - * Creates a Drupal AJAX 'insert' command using the method in #ajax['method']. + * Creates a Drupal Ajax 'insert' command using the method in #ajax['method']. * * This command instructs the client to insert the given HTML using whichever * jQuery DOM manipulation method has been specified in the #ajax['method'] @@ -758,7 +788,7 @@ function ajax_command_insert($selector, $html, $settings = NULL) { } /** - * Creates a Drupal AJAX 'insert/replaceWith' command. + * Creates a Drupal Ajax 'insert/replaceWith' command. * * The 'insert/replaceWith' command instructs the client to use jQuery's * replaceWith() method to replace each element matched matched by the given @@ -791,7 +821,7 @@ function ajax_command_replace($selector, $html, $settings = NULL) { } /** - * Creates a Drupal AJAX 'insert/html' command. + * Creates a Drupal Ajax 'insert/html' command. * * The 'insert/html' command instructs the client to use jQuery's html() * method to set the HTML content of each element matched by the given @@ -824,7 +854,7 @@ function ajax_command_html($selector, $html, $settings = NULL) { } /** - * Creates a Drupal AJAX 'insert/prepend' command. + * Creates a Drupal Ajax 'insert/prepend' command. * * The 'insert/prepend' command instructs the client to use jQuery's prepend() * method to prepend the given HTML content to the inside each element matched @@ -857,10 +887,10 @@ function ajax_command_prepend($selector, $html, $settings = NULL) { } /** - * Creates a Drupal AJAX 'insert/append' command. + * Creates a Drupal Ajax 'insert/append' command. * * The 'insert/append' command instructs the client to use jQuery's append() - * method to append the given HTML content to the inside each element matched + * method to append the given HTML content to the inside of each element matched * by the given selector. * * This command is implemented by Drupal.ajax.prototype.commands.insert() @@ -890,7 +920,7 @@ function ajax_command_append($selector, $html, $settings = NULL) { } /** - * Creates a Drupal AJAX 'insert/after' command. + * Creates a Drupal Ajax 'insert/after' command. * * The 'insert/after' command instructs the client to use jQuery's after() * method to insert the given HTML content after each element matched by @@ -923,7 +953,7 @@ function ajax_command_after($selector, $html, $settings = NULL) { } /** - * Creates a Drupal AJAX 'insert/before' command. + * Creates a Drupal Ajax 'insert/before' command. * * The 'insert/before' command instructs the client to use jQuery's before() * method to insert the given HTML content before each of elements matched by @@ -956,7 +986,7 @@ function ajax_command_before($selector, $html, $settings = NULL) { } /** - * Creates a Drupal AJAX 'remove' command. + * Creates a Drupal Ajax 'remove' command. * * The 'remove' command instructs the client to use jQuery's remove() method * to remove each of elements matched by the given selector, and everything @@ -982,7 +1012,7 @@ function ajax_command_remove($selector) { } /** - * Creates a Drupal AJAX 'changed' command. + * Creates a Drupal Ajax 'changed' command. * * This command instructs the client to mark each of the elements matched by the * given selector as 'ajax-changed'. @@ -1009,7 +1039,7 @@ function ajax_command_changed($selector, $asterisk = '') { } /** - * Creates a Drupal AJAX 'css' command. + * Creates a Drupal Ajax 'css' command. * * The 'css' command will instruct the client to use the jQuery css() method * to apply the CSS arguments to elements matched by the given selector. @@ -1037,7 +1067,7 @@ function ajax_command_css($selector, $argument) { } /** - * Creates a Drupal AJAX 'settings' command. + * Creates a Drupal Ajax 'settings' command. * * The 'settings' command instructs the client either to use the given array as * the settings for ajax-loaded content or to extend Drupal.settings with the @@ -1068,7 +1098,7 @@ function ajax_command_settings($argument, $merge = FALSE) { } /** - * Creates a Drupal AJAX 'data' command. + * Creates a Drupal Ajax 'data' command. * * The 'data' command instructs the client to attach the name=value pair of * data to the selector via jQuery's data cache. @@ -1100,7 +1130,7 @@ function ajax_command_data($selector, $name, $value) { } /** - * Creates a Drupal AJAX 'invoke' command. + * Creates a Drupal Ajax 'invoke' command. * * The 'invoke' command will instruct the client to invoke the given jQuery * method with the supplied arguments on the elements matched by the given @@ -1131,7 +1161,7 @@ function ajax_command_invoke($selector, $method, array $arguments = array()) { } /** - * Creates a Drupal AJAX 'restripe' command. + * Creates a Drupal Ajax 'restripe' command. * * The 'restripe' command instructs the client to restripe a table. This is * usually used after a table has been modified by a replace or append command. diff --git a/includes/archiver.inc b/includes/archiver.inc index 05263373..fec053be 100644 --- a/includes/archiver.inc +++ b/includes/archiver.inc @@ -1,5 +1,4 @@ <?php -// $Id: archiver.inc,v 1.5 2010/02/01 07:17:59 webchick Exp $ /** * @file diff --git a/includes/authorize.inc b/includes/authorize.inc index b8f2cce5..3617d7d0 100644 --- a/includes/authorize.inc +++ b/includes/authorize.inc @@ -1,5 +1,4 @@ <?php -// $Id: authorize.inc,v 1.15 2011/01/04 04:37:27 webchick Exp $ /** * @file @@ -160,7 +159,7 @@ function _authorize_filetransfer_connection_settings($backend) { * Therefore, to properly add defaults, we need to walk through all the * children form elements and process those defaults recursively. * - * @param &$element + * @param $element * Reference to the Form API form element we're operating on. * @param $key * The key for our current form element, if any. diff --git a/includes/batch.inc b/includes/batch.inc index c84df765..7011abfb 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -1,5 +1,4 @@ <?php -// $Id: batch.inc,v 1.54 2010/11/30 17:16:37 dries Exp $ /** diff --git a/includes/batch.queue.inc b/includes/batch.queue.inc index ee2665dc..84648369 100644 --- a/includes/batch.queue.inc +++ b/includes/batch.queue.inc @@ -1,5 +1,4 @@ <?php -// $Id: batch.queue.inc,v 1.2 2010/12/01 00:21:02 webchick Exp $ /** diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 7791a7e8..b0e5be83 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1,5 +1,4 @@ <?php -// $Id: bootstrap.inc,v 1.462 2011/01/05 06:17:58 webchick Exp $ /** * @file @@ -9,7 +8,7 @@ /** * The current system version. */ -define('VERSION', '7.0'); +define('VERSION', '7.2'); /** * Core API compatibility. @@ -1228,185 +1227,64 @@ function drupal_unpack($obj, $field = 'data') { /** * Translates a string to the current language or to a given language. * - * All human-readable text that will be displayed on the site or sent to a user - * should be passed through the t() function. This ensures that sites can be - * fully translated into other languages. - * - * Here are some examples of translating static text using t(): - * @code - * if (!$info || !$info['extension']) { - * form_set_error('picture_upload', t('The uploaded file was not an image.')); - * } - * - * $form['submit'] = array( - * '#type' => 'submit', - * '#value' => t('Log in'), - * ); - * @endcode - * - * In addition to translating static text, t() can handle text that should not - * be translated or that might change from time to time (such as link paths) - * and dynamic text from variables, using special "placeholders". There are - * three styles of placeholders: - * - !variable: Indicates that the text should be inserted as-is. This is - * useful for inserting variables into things like e-mail. Example: - * @code - * $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE)))); - * @endcode - * - @variable: Indicates that the text should be run through check_plain(), to - * escape HTML characters. Use this for any output that is displayed within a - * Drupal page. Example: - * @code - * drupal_set_title($title = t("@name's blog", array('@name' => format_username($account))), PASS_THROUGH); - * @endcode - * - %variable: Indicates that the string should be HTML-escaped and highlighted - * with drupal_placeholder(), which shows up as <em>emphasized</em>. - * @code - * $message = t('%name-from sent %name-to an e-mail.', array('%name-from' => format_username($user), '%name-to' => format_username($account))); - * @endcode - * - * When using t(), try to put entire paragraphs in one t() call. This makes it - * easier for translators, as it provides context as to what each word refers - * to (and also allows translators to adjust word order, which may not be the - * same in all languages). HTML markup within translation strings is allowed, - * but should be avoided if possible. The exception is embedded links: link - * titles add context for translators and need to be translated, so they should - * be kept in the main string, while link URLs should be generated using - * placeholders. - * - Incorrect HTML in t(): - * @code - * $output .= t('<p>Go to the @contact-page.</p>', array('@contact-page' => l(t('contact page'), 'contact'))); - * @endcode - * - Correct HTML in t(): - * @code - * $output .= '<p>' . t('Go to the <a href="@contact-page">contact page</a>.', array('@contact-page' => url('contact'))) . '</p>'; - * @endcode - * - * Another thing that is helpful is to avoid escaping quotation marks wherever - * possible, because it can be confusing to translation teams. - * - Less desirable quotation mark escaping: - * @code - * $output .= t('Don\'t click me.'); - * @endcode - * - Better way to use quotation marks: - * @code - * $output .= t("Don't click me."); - * @endcode - * - * It is important that all translation uses the t() mechanism, because in - * addition to actually translating the text at run-time, the t() function is - * also used by text-extraction routines to find text that needs to be - * translated, and build databases of text to be translated for translation - * teams. For that reason, you must put the actual string into the t() function, - * in most cases, and not a variable. - * - Incorrect use of a variable in t(): - * @code - * $message = 'An error occurred.'; - * drupal_set_message(t($message), 'error'); - * $output .= t($message); - * @endcode - * - Correct translation of a variable with t(): - * @code - * $message = t('An error occurred.'); - * drupal_set_message($message, 'error'); - * $output .= $message; - * @endcode - * - * The only case in which variables can be passed safely through t() is when - * code-based versions of the same strings will be passed through t() (or - * otherwise extracted) elsewhere. - * - * Also, you cannot use t() early in the bootstrap process, prior to the - * DRUPAL_BOOTSTRAP_LANGUAGE phase. The language variables will not be - * initialized yet, so the string will not be translated into the correct - * language. Examples of places where t() cannot be used include: - * - In a PHP define() statement. - * - In a hook_boot() implementation. - * - * In some cases, modules may include strings in code that can't use t() - * calls. For example, a module may use an external PHP application that - * produces strings that are loaded into variables in Drupal for output. - * In these cases, module authors may include a dummy file that passes the - * relevant strings through t(). This approach will allow the strings to be - * extracted. - * - * Sample external (non-Drupal) code: - * @code - * class Time { - * public $yesterday = 'Yesterday'; - * public $today = 'Today'; - * public $tomorrow = 'Tomorrow'; - * } - * @endcode - * - * Sample dummy file: - * @code - * // Dummy function included in example.potx.inc. - * function example_potx() { - * $strings = array( - * t('Yesterday'), - * t('Today'), - * t('Tomorrow'), - * ); - * // No return value needed, since this is a dummy function. - * } - * @endcode - * - * Having passed strings through t() in a dummy function, it is then - * possible to pass variables through t(): - * @code - * $time = new Time(); - * $output .= t($time->today); - * @endcode - * - * However tempting it is, custom data from user input or other non-code - * sources should not be passed through t(). Doing so leads to the following - * problems and errors: - * - The t() system doesn't support updates to existing strings. When user - * data is updated, the next time it's passed through t(), a new record is - * created instead of an update. The database bloats over time and any - * existing translations are orphaned with each update. - * - The t() system assumes any data it receives is in English. User data may - * be in another language, producing translation errors. - * - The "Built-in interface" text group in the locale system is used to - * produce translations for storage in .po files. When non-code strings are - * passed through t(), they are added to this text group, which is rendered - * inaccurate since it is a mix of actual interface strings and various user - * input strings of uncertain origin. - * Instead, translation of these data can be done through the locale system, - * either directly through hook_local() or through helper functions provided by - * contributed modules. - * - * Incorrect: + * The t() function serves two purposes. First, at run-time it translates + * user-visible text into the appropriate language. Second, various mechanisms + * that figure out what text needs to be translated work off t() -- the text + * inside t() calls is added to the database of strings to be translated. So, + * to enable a fully-translatable site, it is important that all human-readable + * text that will be displayed on the site or sent to a user is passed through + * the t() function, or a related function. See the + * @link http://drupal.org/node/322729 Localization API @endlink pages for + * more information, including recommendations on how to break up or not + * break up strings for translation. + * + * You should never use t() to translate variables, such as calling + * @code t($text); @endcode, unless the text that the variable holds has been + * passed through t() elsewhere (e.g., $text is one of several translated + * literal strings in an array). It is especially important never to call + * @code t($user_text); @endcode, where $user_text is some text that a user + * entered - doing that can lead to cross-site scripting and other security + * problems. However, you can use variable substitution in your string, to put + * variable text such as user names or link URLs into translated text. Variable + * substitution looks like this: * @code - * $item = item_load(); - * $output .= check_plain(t($item['title'])); + * $text = t("@name's blog", array('@name' => format_username($account))); * @endcode + * Basically, you can put variables like @name into your string, and t() will + * substitute their sanitized values at translation time (see $args below or + * the Localization API pages referenced above for details). Translators can + * then rearrange the string as necessary for the language (e.g., in Spanish, + * it might be "blog de @name"). * - * During installation, st() is used in place of t(). Code that may be called - * during installation or during normal operation should use the get_t() - * helper function. + * During the Drupal installation phase, some resources used by t() wil not be + * available to code that needs localization. See st() and get_t() for + * alternatives. * * @param $string * A string containing the English string to translate. * @param $args - * An associative array of replacements to make after translation. Incidences - * of any key in this array are replaced with the corresponding value. Based - * on the first character of the key, the value is escaped and/or themed: - * - !variable: inserted as is - * - @variable: escape plain text to HTML (using check_plain()) - * - %variable: escape text and theme as a placeholder for user-submitted - * content (using check_plain() + drupal_placeholder()) + * An associative array of replacements to make after translation. + * Occurrences in $string of any key in $args are replaced with the + * corresponding value, after sanitization. The sanitization function depends + * on the first character of the key: + * - !variable: Inserted as is. Use this for text that has already been + * sanitized. + * - @variable: Escaped to HTML using check_plain(). Use this for anything + * displayed on a page on the site. + * - %variable: Escaped as a placeholder for user-submitted content using + * drupal_placeholder(), which shows up as <em>emphasized</em> text. * @param $options - * An associative array of additional options, with the following keys: - * - 'langcode' (defaults to the current language) The language code to - * translate to a language other than what is used to display the page. - * - 'context' (defaults to the empty context) The context the source string - * belongs to. + * An associative array of additional options, with the following elements: + * - 'langcode' (defaults to the current language): The language code to + * translate to a language other than what is used to display the page. + * - 'context' (defaults to the empty context): The context the source string + * belongs to. * * @return * The translated string. * + * @see st() + * @see get_t() * @ingroup sanitization */ function t($string, array $args = array(), array $options = array()) { @@ -1553,7 +1431,7 @@ function request_uri() { * The exception that is going to be logged. * @param $message * The message to store in the log. If empty, a text that contains all useful - * information about the passed in exception is used. + * information about the passed-in exception is used. * @param $variables * Array of variables to replace in the message on display. Defaults to the * return value of drupal_decode_exception(). @@ -1649,8 +1527,8 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO * messages without clearing them. * * @param $message - * The message should begin with a capital letter and always ends with a - * period '.'. + * The message to be displayed to the user. For consistency with other + * messages, it should begin with a capital letter and end with a period. * @param $type * The type of the message. One of the following values are possible: * - 'status' @@ -2369,8 +2247,30 @@ function drupal_installation_attempted() { } /** - * Return the name of the localization function. Use in code that needs to - * run both during installation and normal operation. + * Returns the name of the proper localization function. + * + * get_t() exists to support localization for code that might run during + * the installation phase, when some elements of the system might not have + * loaded. + * + * This would include implementations of hook_install(), which could run + * during the Drupal installation phase, and might also be run during + * non-installation time, such as while installing the module from the the + * module administration page. + * + * Example useage: + * @code + * $t = get_t(); + * $translated = $t('translate this'); + * @endcode + * + * Use t() if your code will never run during the Drupal installation phase. + * Use st() if your code will only run during installation and never any other + * time. Use get_t() if your code could run in either circumstance. + * + * @see t() + * @see st() + * @ingroup sanitization */ function get_t() { static $t; @@ -2426,6 +2326,9 @@ function drupal_language_types() { * Return true if there is more than one language enabled. */ function drupal_multilingual() { + // The "language_count" variable stores the number of enabled languages to + // avoid unnecessarily querying the database when building the list of + // enabled languages on monolingual sites. return variable_get('language_count', 1) > 1; } @@ -2497,6 +2400,8 @@ function language_default($property = NULL) { * base_path() returns "/drupalfolder/". * - http://example.com/path/alias (which is a path alias for node/306) returns * "path/alias" as opposed to the internal path. + * - http://example.com/index.php returns an empty string (meaning: front page). + * - http://example.com/index.php?page=1 returns an empty string. * * @return * The requested Drupal URL path. @@ -2518,11 +2423,19 @@ function request_path() { $path = $_GET['q']; } elseif (isset($_SERVER['REQUEST_URI'])) { - // This is a request using a clean URL. Extract the path from REQUEST_URI. + // This request is either a clean URL, or 'index.php', or nonsense. + // Extract the path from REQUEST_URI. $request_path = strtok($_SERVER['REQUEST_URI'], '?'); $base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/')); // Unescape and strip $base_path prefix, leaving q without a leading slash. $path = substr(urldecode($request_path), $base_path_len + 1); + // If the path equals the script filename, either because 'index.php' was + // explicitly provided in the URL, or because the server added it to + // $_SERVER['REQUEST_URI'] even when it wasn't provided in the URL (some + // versions of Microsoft IIS do this), the front page should be served. + if ($path == basename($_SERVER['PHP_SELF'])) { + $path = ''; + } } else { // This is the front page. diff --git a/includes/cache-install.inc b/includes/cache-install.inc index c4cf081a..d9bb0f92 100644 --- a/includes/cache-install.inc +++ b/includes/cache-install.inc @@ -1,5 +1,4 @@ <?php -// $Id: cache-install.inc,v 1.9 2010/05/18 18:26:30 dries Exp $ /** * @file @@ -31,7 +30,7 @@ class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterfac // If there is a database cache, attempt to clear it whenever possible. The // reason for doing this is that the database cache can accumulate data // during installation due to any full bootstraps that may occur at the - // same time (for example, AJAX requests triggered by the installer). If we + // same time (for example, Ajax requests triggered by the installer). If we // didn't try to clear it whenever this function is called, the data in the // cache would become stale; for example, the installer sometimes calls // variable_set(), which updates the {variable} table and then clears the diff --git a/includes/cache.inc b/includes/cache.inc index e5d0c497..8666874a 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -1,5 +1,4 @@ <?php -// $Id: cache.inc,v 1.51 2010/12/01 00:26:03 webchick Exp $ /** * Get the cache object for a cache bin. @@ -325,10 +324,15 @@ class DrupalDatabaseCache implements DrupalCacheInterface { try { // Garbage collection necessary when enforcing a minimum cache lifetime. $this->garbageCollection($this->bin); - $query = db_select($this->bin); - $query->fields($this->bin, array('cid', 'data', 'created', 'expire', 'serialized')); - $query->condition($this->bin . '.cid', $cids, 'IN'); - $result = $query->execute(); + + // When serving cached pages, the overhead of using db_select() was found + // to add around 30% overhead to the request. Since $this->bin is a + // variable, this means the call to db_query() here uses a concatenated + // string. This is highly discouraged under any other circumstances, and + // is used here only due to the performance overhead we would incur + // otherwise. When serving an uncached page, the overhead of using + // db_select() is a much smaller proportion of the request. + $result = db_query('SELECT cid, data, created, expire, serialized FROM {' . db_escape_table($this->bin) . '} WHERE cid IN (:cids)', array(':cids' => $cids)); $cache = array(); foreach ($result as $item) { $item = $this->prepareItem($item); diff --git a/includes/common.inc b/includes/common.inc index 216f1be4..5158c5a9 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1,5 +1,4 @@ <?php -// $Id: common.inc,v 1.1283 2011/01/03 06:51:00 webchick Exp $ /** * @file @@ -915,7 +914,9 @@ function drupal_http_request($url, array $options = array()) { return $result; } // Parse response headers from the response body. - list($response, $result->data) = explode("\r\n\r\n", $response, 2); + // Be tolerant of malformed HTTP responses that separate header and body with + // \n\n or \r\r instead of \r\n\r\n. + list($response, $result->data) = preg_split("/\r\n\r\n|\n\n|\r\r/", $response, 2); $response = preg_split("/\r\n|\n|\r/", $response); // Parse the response status line. @@ -1050,15 +1051,15 @@ function _fix_gpc_magic_files(&$item, $key) { * Fix double-escaping problems caused by "magic quotes" in some PHP installations. */ function fix_gpc_magic() { - $fixed = &drupal_static(__FUNCTION__, FALSE); + static $fixed = FALSE; if (!$fixed && ini_get('magic_quotes_gpc')) { array_walk($_GET, '_fix_gpc_magic'); array_walk($_POST, '_fix_gpc_magic'); array_walk($_COOKIE, '_fix_gpc_magic'); array_walk($_REQUEST, '_fix_gpc_magic'); array_walk($_FILES, '_fix_gpc_magic_files'); - $fixed = TRUE; } + $fixed = TRUE; } /** @@ -1974,7 +1975,7 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) { /** * Format a username. * - * By default, the passed in object's 'name' property is used if it exists, or + * By default, the passed-in object's 'name' property is used if it exists, or * else, the site-defined value for the 'anonymous' variable. However, a module * may override this by implementing hook_username_alter(&$name, $account). * @@ -2241,7 +2242,7 @@ function drupal_http_header_attributes(array $attributes = array()) { * drupal_attributes(array('title' => t('<script>steal_cookie();</script>'))); * * // The statement below demonstrates dangerous use of drupal_attributes, and - * // will return an onmouseout attribute with javascript code that, when used + * // will return an onmouseout attribute with JavaScript code that, when used * // as attribute in a tag, will cause users to be redirected to another site. * // * // In this case, the 'onmouseout' attribute should not be whitelisted -- @@ -2386,9 +2387,9 @@ function l($text, $path, array $options = array()) { * basis in hook_page_delivery_callback_alter(). * * For example, the same page callback function can be used for an HTML - * version of the page and an AJAX version of the page. The page callback + * version of the page and an Ajax version of the page. The page callback * function just needs to decide what content is to be returned and the - * delivery callback function will send it as an HTML page or an AJAX + * delivery callback function will send it as an HTML page or an Ajax * response, as appropriate. * * In order for page callbacks to be reusable in different delivery formats, @@ -2605,7 +2606,8 @@ function drupal_exit($destination = NULL) { * A linear array. * @param $function * A name of a function to apply to all values before output. - * @result + * + * @return * An associative array. */ function drupal_map_assoc($array, $function = NULL) { @@ -3546,7 +3548,7 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) { // There are different conditions for removing leading and trailing // whitespace. // @see http://php.net/manual/en/regexp.reference.subpatterns.php - $contents = preg_replace_callback('< + $contents = preg_replace('< # Strip leading and trailing whitespace. \s*([@{};,])\s* # Strip only leading whitespace from: @@ -3557,7 +3559,10 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) { # - Colon: Retain :pseudo-selectors. | ([\(:])\s+ >xS', - '_drupal_load_stylesheet_content', + // Only one of the three capturing groups will match, so its reference + // will contain the wanted value and the references for the + // two non-matching groups will be replaced with empty strings. + '$1$2$3', $contents ); // End the file with a new line. @@ -3571,16 +3576,6 @@ function drupal_load_stylesheet_content($contents, $optimize = FALSE) { return $contents; } -/** - * Helper for drupal_load_stylesheet_content(). - */ -function _drupal_load_stylesheet_content($matches) { - // Discard the full match. - unset($matches[0]); - // Use the non-empty match. - return current(array_filter($matches)); -} - /** * Loads stylesheets recursively and returns contents with corrected paths. * @@ -3675,17 +3670,17 @@ function drupal_html_class($class) { * blocks, and other content to be output multiple times on the same page, * without breaking (X)HTML validation. * - * For already existing ids, a counter is appended to the id string. Therefore, + * For already existing IDs, a counter is appended to the ID string. Therefore, * JavaScript and CSS code should not rely on any value that was generated by * this function and instead should rely on manually added CSS classes or * similarly reliable constructs. * - * Two consecutive hyphens separate the counter from the original id. To manage - * uniqueness across multiple AJAX requests on the same page, AJAX requests + * Two consecutive hyphens separate the counter from the original ID. To manage + * uniqueness across multiple Ajax requests on the same page, Ajax requests * POST an array of all IDs currently present on the page, which are used to * prime this function's cache upon first invocation. * - * To allow reverse-parsing of ids submitted via AJAX, any multiple consecutive + * To allow reverse-parsing of IDs submitted via Ajax, any multiple consecutive * hyphens in the originally passed $id are replaced with a single hyphen. * * @param $id @@ -3695,10 +3690,10 @@ function drupal_html_class($class) { * The cleaned ID. */ function drupal_html_id($id) { - // If this is an AJAX request, then content returned by this page request will - // be merged with content already on the base page. The HTML ids must be + // If this is an Ajax request, then content returned by this page request will + // be merged with content already on the base page. The HTML IDs must be // unique for the fully merged content. Therefore, initialize $seen_ids to - // take into account ids that are already in use on the base page. + // take into account IDs that are already in use on the base page. $seen_ids_init = &drupal_static(__FUNCTION__ . ':init'); if (!isset($seen_ids_init)) { // Ideally, Drupal would provide an API to persist state information about @@ -3706,7 +3701,7 @@ function drupal_html_id($id) { // function's $seen_ids static variable to that state information in order // to have it properly initialized for this page request. However, no such // page state API exists, so instead, ajax.js adds all of the in-use HTML - // ids to the POST data of AJAX submissions. Direct use of $_POST is + // IDs to the POST data of Ajax submissions. Direct use of $_POST is // normally not recommended as it could open up security risks, but because // the raw POST data is cast to a number before being returned by this // function, this usage is safe. @@ -3753,7 +3748,7 @@ function drupal_html_id($id) { // The counter needs to be appended with a delimiter that does not exist in // the base ID. Requiring a unique delimiter helps ensure that we really do // return unique IDs and also helps us re-create the $seen_ids array during - // AJAX requests. + // Ajax requests. if (isset($seen_ids[$id])) { $id = $id . '--' . ++$seen_ids[$id]; } @@ -3771,7 +3766,7 @@ function drupal_html_id($id) { * page region that is output by the theme (Drupal core already handles this in * the standard template preprocess implementation). Standardizing the class * names in this way allows modules to implement certain features, such as - * drag-and-drop or dynamic AJAX loading, in a theme-independent way. + * drag-and-drop or dynamic Ajax loading, in a theme-independent way. * * @param $region * The name of the page region (for example, 'page_top' or 'content'). @@ -3956,12 +3951,17 @@ function drupal_add_js($data = NULL, $options = NULL) { if (isset($data)) { // Add jquery.js and drupal.js, as well as the basePath setting, the - // first time a Javascript file is added. + // first time a JavaScript file is added. if (empty($javascript)) { + // url() generates the prefix using hook_url_outbound_alter(). Instead of + // running the hook_url_outbound_alter() again here, extract the prefix + // from url(). + url('', array('prefix' => &$prefix)); $javascript = array( 'settings' => array( 'data' => array( array('basePath' => base_path()), + array('pathPrefix' => empty($prefix) ? '' : $prefix), ), 'type' => 'setting', 'scope' => 'header', @@ -3999,7 +3999,7 @@ function drupal_add_js($data = NULL, $options = NULL) { default: // 'file' and 'external' // Local and external files must keep their name as the associative key - // so the same JavaScript file is not be added twice. + // so the same JavaScript file is not added twice. $javascript[$options['data']] = $options; } } @@ -4097,13 +4097,13 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS // page request. $default_query_string = variable_get('css_js_query_string', '0'); - // For inline Javascript to validate as XHTML, all Javascript containing + // For inline JavaScript to validate as XHTML, all JavaScript containing // XHTML needs to be wrapped in CDATA. To make that backwards compatible // with HTML 4, we need to comment out the CDATA-tag. $embed_prefix = "\n<!--//--><![CDATA[//><!--\n"; $embed_suffix = "\n//--><!]]>\n"; - // Since Javascript may look for arguments in the url and act on them, some + // Since JavaScript may look for arguments in the URL and act on them, some // third-party code might require the use of a different query string. $js_version_string = variable_get('drupal_js_version_query_string', 'v='); @@ -4321,7 +4321,7 @@ function drupal_process_attached($elements, $group = JS_DEFAULT, $dependency_che } // Add additional types of attachments specified in the render() structure. - // Libraries, Javascript and CSS have been added already, as they require + // Libraries, JavaScript and CSS have been added already, as they require // special handling. foreach ($elements['#attached'] as $callback => $options) { if (function_exists($callback)) { @@ -4788,7 +4788,7 @@ function drupal_clear_js_cache() { } /** - * Converts a PHP variable into its Javascript equivalent. + * Converts a PHP variable into its JavaScript equivalent. * * We use HTML-safe strings, i.e. with <, > and & escaped. * @@ -4884,12 +4884,12 @@ function drupal_valid_token($token, $value = '', $skip_anonymous = FALSE) { } function _drupal_bootstrap_full() { - $called = &drupal_static(__FUNCTION__); + static $called = FALSE; if ($called) { return; } - $called = 1; + $called = TRUE; require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc'); require_once DRUPAL_ROOT . '/includes/theme.inc'; require_once DRUPAL_ROOT . '/includes/pager.inc'; @@ -5238,7 +5238,7 @@ function drupal_set_page_content($content = NULL) { * browsers, '#browsers' can be set to array('IE' => 'gte IE 8'). * * @return - * The passed in element with markup for conditional comments potentially + * The passed-in element with markup for conditional comments potentially * added to '#prefix' and '#suffix'. */ function drupal_pre_render_conditional_comments($elements) { @@ -5300,7 +5300,7 @@ function drupal_pre_render_conditional_comments($elements) { * - #options: (optional) An array of options to pass to l(). * * @return - * The passed in elements containing a rendered link in '#markup'. + * The passed-in elements containing a rendered link in '#markup'. */ function drupal_pre_render_link($element) { // By default, link options to pass to l() are normally set in #options. @@ -5330,7 +5330,7 @@ function drupal_pre_render_link($element) { if (!isset($element['#id'])) { $element['#id'] = $element['#options']['attributes']['id'] = drupal_html_id('ajax-link'); } - // If #ajax['path] was not specified, use the href as AJAX request URL. + // If #ajax['path] was not specified, use the href as Ajax request URL. if (!isset($element['#ajax']['path'])) { $element['#ajax']['path'] = $element['#href']; $element['#ajax']['options'] = $element['#options']; @@ -5447,7 +5447,7 @@ function drupal_pre_render_links($element) { * A structured array using the #markup key. * * @return - * The passed in elements, but #markup appended to #children. + * The passed-in elements, but #markup appended to #children. */ function drupal_pre_render_markup($elements) { $elements['#children'] = $elements['#markup']; @@ -5578,9 +5578,9 @@ function drupal_render(&$elements) { return $cached_output; } - // If #markup is not empty, set #type. This allows to specify just #markup on - // an element without setting #type. - if (!empty($elements['#markup']) && !isset($elements['#type'])) { + // If #markup is set, ensure #type is set. This allows to specify just #markup + // on an element without setting #type. + if (isset($elements['#markup']) && !isset($elements['#type'])) { $elements['#type'] = 'markup'; } @@ -5697,13 +5697,17 @@ function drupal_render_children(&$element, $children_keys = NULL) { } /** - * Render and print an element. + * Render an element. * * This function renders an element using drupal_render(). The top level - * element is always rendered even if hide() had been previously used on it. + * element is shown with show() before rendering, so it will always be rendered + * even if hide() had been previously used on it. * - * Any nested elements are only rendered if they haven't been rendered before - * or if they have been re-enabled with show(). + * @param $element + * The element to be rendered. + * + * @return + * The rendered element. * * @see drupal_render() * @see show() @@ -5724,6 +5728,21 @@ function render(&$element) { /** * Hide an element from later rendering. * + * The first time render() or drupal_render() is called on an element tree, + * as each element in the tree is rendered, it is marked with a #printed flag + * and the rendered children of the element are cached. Subsequent calls to + * render() or drupal_render() will not traverse the child tree of this element + * again: they will just use the cached children. So if you want to hide an + * element, be sure to call hide() on the element before its parent tree is + * rendered for the first time, as it will have no effect on subsequent + * renderings of the parent tree. + * + * @param $element + * The element to be hidden. + * + * @return + * The element. + * * @see render() * @see show() */ @@ -5733,10 +5752,25 @@ function hide(&$element) { } /** - * Show a hidden or already printed element from later rendering. + * Show a hidden element for later rendering. + * + * You can also use render($element), which shows the element while rendering + * it. + * + * The first time render() or drupal_render() is called on an element tree, + * as each element in the tree is rendered, it is marked with a #printed flag + * and the rendered children of the element are cached. Subsequent calls to + * render() or drupal_render() will not traverse the child tree of this element + * again: they will just use the cached children. So if you want to show an + * element, be sure to call show() on the element before its parent tree is + * rendered for the first time, as it will have no effect on subsequent + * renderings of the parent tree. + * + * @param $element + * The element to be shown. * - * Alternatively, render($element) could be used which automatically shows the - * element while rendering it. + * @return + * The element. * * @see render() * @see hide() @@ -5803,14 +5837,58 @@ function drupal_render_cache_set(&$markup, $elements) { // be retrieved and used. $data['#markup'] = &$markup; // Persist attached data associated with this element. - if (isset($elements['#attached'])) { - $data['#attached'] = $elements['#attached']; + $attached = drupal_render_collect_attached($elements, TRUE); + if ($attached) { + $data['#attached'] = $attached; } $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache'; $expire = isset($elements['#cache']['expire']) ? $elements['#cache']['expire'] : CACHE_PERMANENT; cache_set($cid, $data, $bin, $expire); } +/** + * Collect #attached for an element and all child elements into a single array. + * + * When caching elements, it is necessary to collect all libraries, JavaScript + * and CSS into a single array, from both the element itself and all child + * elements. This allows drupal_render() to add these back to the page when the + * element is returned from cache. + * + * @param $elements + * The element to collect #attached from. + * @param $return + * Whether to return the attached elements and reset the internal static. + * + * @return + * The #attached array for this element and its descendants. + */ +function drupal_render_collect_attached($elements, $return = FALSE) { + $attached = &drupal_static(__FUNCTION__, array()); + + // Collect all #attached for this element. + if (isset($elements['#attached'])) { + foreach ($elements['#attached'] as $key => $value) { + if (!isset($attached[$key])) { + $attached[$key] = array(); + } + $attached[$key] = array_merge($attached[$key], $value); + } + } + if ($children = element_children($elements)) { + foreach ($children as $child) { + drupal_render_collect_attached($elements[$child]); + } + } + + // If this was the first call to the function, return all attached elements + // and reset the static cache. + if ($return) { + $return = $attached; + $attached = array(); + return $return; + } +} + /** * Prepare an element for caching based on a query. This smart caching strategy * saves Drupal from querying and rendering to HTML when the underlying query is @@ -5833,7 +5911,7 @@ function drupal_render_cache_set(&$markup, $elements) { * * @return * A renderable array with the following keys and values: - * - #query: The passed in $query. + * - #query: The passed-in $query. * - #pre_render: $function with a _pre_render suffix. * - #cache: An associative array prepared for drupal_render_cache_set(). */ @@ -6240,7 +6318,7 @@ function drupal_array_set_nested_value(array &$array, array $parents, $value, $f * The array from which to get the value. * @param $parents * An array of parent keys of the value, starting with the outermost key. - * @param &$key_exists + * @param $key_exists * (optional) If given, an already defined variable that is altered by * reference. * @@ -6654,30 +6732,27 @@ function drupal_schema_fields_sql($table, $prefix = NULL) { } /** - * Saves a record to the database based upon the schema. - * - * Default values are filled in for missing items, and 'serial' (auto increment) - * types are filled in with IDs. + * Saves (inserts or updates) a record to the database based upon the schema. * * @param $table * The name of the table; this must be defined by a hook_schema() * implementation. * @param $record * An object or array representing the record to write, passed in by - * reference. The function will fill in defaults from the schema and add an - * ID value to serial fields. + * reference. If inserting a new record, values not provided in $record will + * be populated in $record and in the database with the default values from + * the schema, as well as a single serial (auto-increment) field (if present). + * If updating an existing record, only provided values are updated in the + * database, and $record is not modified. * @param $primary_keys - * If this is an update, specify the primary keys' field names. If this is a - * new record, you must not provide this value. If there is only 1 field in - * the key, you may pass in a string; if there are multiple fields in the key, - * pass in an array. + * To indicate that this is a new record to be inserted, omit this argument. + * If this is an update, this argument specifies the primary keys' field + * names. If there is only 1 field in the key, you may pass in a string; if + * there are multiple fields in the key, pass in an array. * * @return - * Failure to write a record will return FALSE. Otherwise SAVED_NEW or - * SAVED_UPDATED is returned depending on the operation performed. The $object - * parameter will contain values for any serial fields defined by the $table. - * For example, $record->nid or $record['nid'] will be populated after - * inserting a new a new node. + * If the record insert or update failed, returns FALSE. If it succeeded, + * returns SAVED_NEW or SAVED_UPDATED, depending on the operation performed. */ function drupal_write_record($table, &$record, $primary_keys = array()) { // Standardize $primary_keys to an array. @@ -6818,7 +6893,7 @@ function drupal_write_record($table, &$record, $primary_keys = array()) { */ /** - * Parse Drupal module and theme info file format. + * Parses Drupal module and theme .info files. * * Info files are NOT for placing arbitrary theme and module-specific settings. * Use variable_get() and variable_set() for that. @@ -6829,35 +6904,42 @@ function drupal_write_record($table, &$record, $primary_keys = array()) { * - dependencies: An array of shortnames of other modules this module requires. * - package: The name of the package of modules this module belongs to. * - * @see forum.info + * See forum.info for an example of a module .info file. * * Information stored in a theme .info file: - * - name: The real name of the theme for display purposes - * - description: Brief description + * - name: The real name of the theme for display purposes. + * - description: Brief description. * - screenshot: Path to screenshot relative to the theme's .info file. * - engine: Theme engine; typically phptemplate. - * - base: Name of a base theme, if applicable, eg: base = zen - * - regions: Listed regions eg: region[left] = Left sidebar - * - features: Features available eg: features[] = logo - * - stylesheets: Theme stylesheets eg: stylesheets[all][] = my-style.css - * - scripts: Theme scripts eg: scripts[] = my-script.css + * - base: Name of a base theme, if applicable; e.g., base = zen. + * - regions: Listed regions; e.g., region[left] = Left sidebar. + * - features: Features available; e.g., features[] = logo. + * - stylesheets: Theme stylesheets; e.g., stylesheets[all][] = my-style.css. + * - scripts: Theme scripts; e.g., scripts[] = my-script.js. * - * @see bartik.info + * See bartik.info for an example of a theme .info file. * * @param $filename * The file we are parsing. Accepts file with relative or absolute path. + * * @return * The info array. * * @see drupal_parse_info_format() */ function drupal_parse_info_file($filename) { - if (!file_exists($filename)) { - return array(); - } + $info = &drupal_static(__FUNCTION__, array()); - $data = file_get_contents($filename); - return drupal_parse_info_format($data); + if (!isset($info[$filename])) { + if (!file_exists($filename)) { + $info[$filename] = array(); + } + else { + $data = file_get_contents($filename); + $info[$filename] = drupal_parse_info_format($data); + } + } + return $info[$filename]; } /** @@ -7322,8 +7404,7 @@ function entity_create_stub_entity($entity_type, $ids) { /** * Load entities from the database. * - * This function should be used whenever you need to load more than one entity - * from the database. The entities are loaded into memory and will not require + * The entities are stored in a static memory cache, and will not require * database access if loaded again during the same page request. * * The actual loading is done through a class that has to implement the @@ -7418,8 +7499,15 @@ function entity_get_controller($entity_type) { * The type of entity, i.e. 'node', 'user'. * @param $entities * The entity objects which are being prepared for view, keyed by object ID. + * @param $langcode + * (optional) A language code to be used for rendering. Defaults to the global + * content language of the current request. */ -function entity_prepare_view($entity_type, $entities) { +function entity_prepare_view($entity_type, $entities, $langcode = NULL) { + if (!isset($langcode)) { + $langcode = $GLOBALS['language_content']->language; + } + // To ensure hooks are only run once per entity, check for an // entity_view_prepared flag and only process items without it. // @todo: resolve this more generally for both entity and field level hooks. @@ -7435,7 +7523,7 @@ function entity_prepare_view($entity_type, $entities) { } if (!empty($prepare)) { - module_invoke_all('entity_prepare_view', $prepare, $entity_type); + module_invoke_all('entity_prepare_view', $prepare, $entity_type, $langcode); } } @@ -7510,7 +7598,7 @@ function entity_label($entity_type, $entity) { $label = FALSE; $info = entity_get_info($entity_type); if (isset($info['label callback']) && function_exists($info['label callback'])) { - $label = $info['label callback']($entity); + $label = $info['label callback']($entity, $entity_type); } elseif (!empty($info['entity keys']['label']) && isset($entity->{$info['entity keys']['label']})) { $label = $entity->{$info['entity keys']['label']}; diff --git a/includes/database/database.inc b/includes/database/database.inc index e6cf0d5c..4cc1a33d 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -1,5 +1,4 @@ <?php -// $Id: database.inc,v 1.147 2010/12/22 07:48:56 webchick Exp $ /** * @file @@ -321,7 +320,7 @@ abstract class DatabaseConnection extends PDO { * PDO::FETCH_OBJ, PDO::FETCH_NUM, or a string representing the name of a * class. If a string is specified, each record will be fetched into a new * object of that class. The behavior of all other values is defined by PDO. - * See http://www.php.net/PDOStatement-fetch + * See http://php.net/manual/pdostatement.fetch.php * - return: Depending on the type of query, different return values may be * meaningful. This directive instructs the system which type of return * value is desired. The system will generally set the correct value @@ -541,6 +540,63 @@ abstract class DatabaseConnection extends PDO { return $this->prefixTables('{' . $table . '}_' . $field . '_seq'); } + /** + * Flatten an array of query comments into a single comment string. + * + * The comment string will be sanitized to avoid SQL injection attacks. + * + * @param $comments + * An array of query comment strings. + * + * @return + * A sanitized comment string. + */ + public function makeComment($comments) { + if (empty($comments)) + return ''; + + // Flatten the array of comments. + $comment = implode('; ', $comments); + + // Sanitize the comment string so as to avoid SQL injection attacks. + return '/* ' . $this->filterComment($comment) . ' */ '; + } + + /** + * Sanitize a query comment string. + * + * Ensure a query comment does not include strings such as "* /" that might + * terminate the comment early. This avoids SQL injection attacks via the + * query comment. The comment strings in this example are separated by a + * space to avoid PHP parse errors. + * + * For example, the comment: + * @code + * db_update('example') + * ->condition('id', $id) + * ->fields(array('field2' => 10)) + * ->comment('Exploit * / DROP TABLE node; --') + * ->execute() + * @endcode + * + * Would result in the following SQL statement being generated: + * @code + * "/ * Exploit * / DROP TABLE node; -- * / UPDATE example SET field2=..." + * @endcode + * + * Unless the comment is sanitised first, the SQL server would drop the + * node table and ignore the rest of the SQL statement. + * + * @param $comment + * A query comment string. + * + * @return + * A sanitized version of the query comment string. + */ + protected function filterComment($comment = '') { + return preg_replace('/(\/\*\s*)|(\s*\*\/)/', '', $comment); + } + /** * Executes a query string against the database. * diff --git a/includes/database/log.inc b/includes/database/log.inc index e579bbcc..ec27ef8e 100644 --- a/includes/database/log.inc +++ b/includes/database/log.inc @@ -1,5 +1,4 @@ <?php -// $Id: log.inc,v 1.8 2010/03/31 15:09:21 dries Exp $ /** * @file diff --git a/includes/database/mysql/database.inc b/includes/database/mysql/database.inc index 127c8daf..262cc605 100644 --- a/includes/database/mysql/database.inc +++ b/includes/database/mysql/database.inc @@ -1,5 +1,4 @@ <?php -// $Id: database.inc,v 1.34 2010/10/03 01:29:41 dries Exp $ /** * @file diff --git a/includes/database/mysql/install.inc b/includes/database/mysql/install.inc index e6075b63..75f2ae39 100644 --- a/includes/database/mysql/install.inc +++ b/includes/database/mysql/install.inc @@ -1,5 +1,4 @@ <?php -// $Id: install.inc,v 1.7 2010/11/26 21:36:43 webchick Exp $ /** * @file diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc index b1f248a5..888b6a5a 100644 --- a/includes/database/mysql/query.inc +++ b/includes/database/mysql/query.inc @@ -1,5 +1,4 @@ <?php -// $Id: query.inc,v 1.18 2010/06/26 01:40:05 dries Exp $ /** * @ingroup database @@ -43,8 +42,8 @@ class InsertQuery_mysql extends InsertQuery { } public function __toString() { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); // Default fields are always placed first for consistency. $insert_fields = array_merge($this->defaultFields, $this->insertFields); @@ -93,8 +92,8 @@ class TruncateQuery_mysql extends TruncateQuery { // not transactional, and result in an implicit COMMIT. When we are in a // transaction, fallback to the slower, but transactional, DELETE. if ($this->connection->inTransaction()) { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}'; } else { diff --git a/includes/database/mysql/schema.inc b/includes/database/mysql/schema.inc index 94fcb821..4e88fa16 100644 --- a/includes/database/mysql/schema.inc +++ b/includes/database/mysql/schema.inc @@ -1,5 +1,4 @@ <?php -// $Id: schema.inc,v 1.44 2010/12/08 06:38:59 webchick Exp $ /** * @file diff --git a/includes/database/pgsql/database.inc b/includes/database/pgsql/database.inc index 57e77507..98b954ff 100644 --- a/includes/database/pgsql/database.inc +++ b/includes/database/pgsql/database.inc @@ -1,5 +1,4 @@ <?php -// $Id: database.inc,v 1.43 2010/10/03 01:29:41 dries Exp $ /** * @file @@ -35,6 +34,15 @@ class DatabaseConnection_pgsql extends DatabaseConnection { if (empty($connection_options['password'])) { $connection_options['password'] = NULL; } + // If the password contains a backslash it is treated as an escape character + // http://bugs.php.net/bug.php?id=53217 + // so backslashes in the password need to be doubled up. + // The bug was reported against pdo_pgsql 1.0.2, backslashes in passwords + // will break on this doubling up when the bug is fixed, so check the version + //elseif (phpversion('pdo_pgsql') < 'version_this_was_fixed_in') { + else { + $connection_options['password'] = str_replace('\\', '\\\\', $connection_options['password']); + } $this->connectionOptions = $connection_options; diff --git a/includes/database/pgsql/install.inc b/includes/database/pgsql/install.inc index beb7f53e..c77f4ea7 100644 --- a/includes/database/pgsql/install.inc +++ b/includes/database/pgsql/install.inc @@ -1,5 +1,4 @@ <?php -// $Id: install.inc,v 1.14 2010/12/21 21:20:04 webchick Exp $ /** * @file diff --git a/includes/database/pgsql/query.inc b/includes/database/pgsql/query.inc index b18b5700..f3783a9c 100644 --- a/includes/database/pgsql/query.inc +++ b/includes/database/pgsql/query.inc @@ -1,5 +1,4 @@ <?php -// $Id: query.inc,v 1.24 2010/11/29 04:45:10 webchick Exp $ /** * @ingroup database @@ -104,8 +103,8 @@ class InsertQuery_pgsql extends InsertQuery { } public function __toString() { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); // Default fields are always placed first for consistency. $insert_fields = array_merge($this->defaultFields, $this->insertFields); diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc index 4ceddcb0..9ed8a262 100644 --- a/includes/database/pgsql/schema.inc +++ b/includes/database/pgsql/schema.inc @@ -1,5 +1,4 @@ <?php -// $Id: schema.inc,v 1.43 2010/12/29 04:03:42 webchick Exp $ /** * @file @@ -528,6 +527,9 @@ class DatabaseSchema_pgsql extends DatabaseSchema { $this->connection->query('ALTER TABLE {' . $table . '} DROP CONSTRAINT "' . $check . '"'); } + // Remove old default. + $this->fieldSetNoDefault($table, $field); + $this->connection->query('ALTER TABLE {' . $table . '} ALTER "' . $field . '" TYPE ' . $typecast . ' USING "' . $field . '"::' . $typecast); if (isset($spec['not null'])) { @@ -562,6 +564,11 @@ class DatabaseSchema_pgsql extends DatabaseSchema { $this->connection->query('ALTER TABLE {' . $table . '} ADD CHECK ("' . $field_new . '" >= 0)'); } + // Add default if necessary. + if (isset($spec['default'])) { + $this->fieldSetDefault($table, $field_new, $spec['default']); + } + // Change description if necessary. if (!empty($spec['description'])) { $this->connection->query('COMMENT ON COLUMN {' . $table . '}."' . $field_new . '" IS ' . $this->prepareComment($spec['description'])); diff --git a/includes/database/pgsql/select.inc b/includes/database/pgsql/select.inc index f61ccad0..d1d83828 100644 --- a/includes/database/pgsql/select.inc +++ b/includes/database/pgsql/select.inc @@ -1,5 +1,4 @@ <?php -// $Id: select.inc,v 1.1 2010/11/29 19:57:57 webchick Exp $ /** * @file diff --git a/includes/database/prefetch.inc b/includes/database/prefetch.inc index a314eacf..f378d355 100644 --- a/includes/database/prefetch.inc +++ b/includes/database/prefetch.inc @@ -1,5 +1,4 @@ <?php -// $Id: prefetch.inc,v 1.10 2010/04/30 13:47:46 dries Exp $ /** * @file diff --git a/includes/database/query.inc b/includes/database/query.inc index f2cfc6c3..23b652f9 100644 --- a/includes/database/query.inc +++ b/includes/database/query.inc @@ -1,5 +1,4 @@ <?php -// $Id: query.inc,v 1.60 2010/12/31 20:43:43 webchick Exp $ /** * @ingroup database @@ -362,6 +361,9 @@ abstract class Query implements QueryPlaceholderInterface { * for easier debugging and allows you to more easily find where a query * with a performance problem is being generated. * + * The comment string will be sanitized to remove * / and other characters + * that may terminate the string early so as to avoid SQL injection attacks. + * * @param $comment * The comment string to be inserted into the query. * @@ -624,9 +626,8 @@ class InsertQuery extends Query { * The prepared statement. */ public function __toString() { - - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); // Default fields are always placed first for consistency. $insert_fields = array_merge($this->defaultFields, $this->insertFields); @@ -816,9 +817,8 @@ class DeleteQuery extends Query implements QueryConditionInterface { * The prepared statement. */ public function __toString() { - - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); $query = $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} '; @@ -885,8 +885,8 @@ class TruncateQuery extends Query { * The prepared statement. */ public function __toString() { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); return $comments . 'TRUNCATE {' . $this->connection->escapeTable($this->table) . '} '; } @@ -1112,9 +1112,8 @@ class UpdateQuery extends Query implements QueryConditionInterface { * The prepared statement. */ public function __toString() { - - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); // Expressions take priority over literal fields, so we process those first // and remove any literal fields that conflict. diff --git a/includes/database/schema.inc b/includes/database/schema.inc index 1423f655..de1b2f5b 100644 --- a/includes/database/schema.inc +++ b/includes/database/schema.inc @@ -1,5 +1,4 @@ <?php -// $Id: schema.inc,v 1.44 2011/01/03 18:03:54 webchick Exp $ /** * @file diff --git a/includes/database/select.inc b/includes/database/select.inc index 19e0464c..716c2fc3 100644 --- a/includes/database/select.inc +++ b/includes/database/select.inc @@ -1,5 +1,4 @@ <?php -// $Id: select.inc,v 1.59 2010/12/31 20:43:43 webchick Exp $ /** * @ingroup database @@ -1440,9 +1439,8 @@ class SelectQuery extends Query implements SelectQueryInterface { } public function __toString() { - - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); // SELECT $query = $comments . 'SELECT '; diff --git a/includes/database/sqlite/database.inc b/includes/database/sqlite/database.inc index 6163f2e4..cf3b9551 100644 --- a/includes/database/sqlite/database.inc +++ b/includes/database/sqlite/database.inc @@ -1,5 +1,4 @@ <?php -// $Id: database.inc,v 1.41 2010/12/23 05:29:27 webchick Exp $ /** * @file diff --git a/includes/database/sqlite/install.inc b/includes/database/sqlite/install.inc index a5b0efac..62cbac38 100644 --- a/includes/database/sqlite/install.inc +++ b/includes/database/sqlite/install.inc @@ -1,5 +1,4 @@ <?php -// $Id: install.inc,v 1.6 2010/11/29 02:55:57 webchick Exp $ /** * @file diff --git a/includes/database/sqlite/query.inc b/includes/database/sqlite/query.inc index b0a62e07..6b8a72f2 100644 --- a/includes/database/sqlite/query.inc +++ b/includes/database/sqlite/query.inc @@ -1,5 +1,4 @@ <?php -// $Id: query.inc,v 1.15 2010/12/22 01:16:43 webchick Exp $ /** * @file @@ -33,8 +32,8 @@ class InsertQuery_sqlite extends InsertQuery { } public function __toString() { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); // Produce as many generic placeholders as necessary. $placeholders = array_fill(0, count($this->insertFields), '?'); @@ -102,7 +101,7 @@ class UpdateQuery_sqlite extends UpdateQuery { } elseif (!isset($data)) { // The field will be set to NULL. - $condition->isNull($field); + $condition->isNotNull($field); } else { $condition->condition($field, $data, '<>'); @@ -149,8 +148,8 @@ class DeleteQuery_sqlite extends DeleteQuery { */ class TruncateQuery_sqlite extends TruncateQuery { public function __toString() { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} '; } diff --git a/includes/database/sqlite/schema.inc b/includes/database/sqlite/schema.inc index 928e34b8..840ba6b5 100644 --- a/includes/database/sqlite/schema.inc +++ b/includes/database/sqlite/schema.inc @@ -1,5 +1,4 @@ <?php -// $Id: schema.inc,v 1.23 2010/12/23 01:43:38 webchick Exp $ /** * @file diff --git a/includes/database/sqlite/select.inc b/includes/database/sqlite/select.inc index 3d89af4d..fb926ef0 100644 --- a/includes/database/sqlite/select.inc +++ b/includes/database/sqlite/select.inc @@ -1,5 +1,4 @@ <?php -// $Id: select.inc,v 1.1 2010/11/29 19:57:57 webchick Exp $ /** * @file diff --git a/includes/date.inc b/includes/date.inc index 6eaddd80..27634f9e 100644 --- a/includes/date.inc +++ b/includes/date.inc @@ -1,5 +1,4 @@ <?php -// $Id: date.inc,v 1.2 2010/12/09 01:51:15 dries Exp $ /** * @file diff --git a/includes/entity.inc b/includes/entity.inc index fbc4f029..a3cdf741 100644 --- a/includes/entity.inc +++ b/includes/entity.inc @@ -1,5 +1,4 @@ <?php -// $Id: entity.inc,v 1.19 2010/11/30 19:31:46 dries Exp $ /** * Interface for entity controller classes. @@ -409,7 +408,7 @@ class EntityFieldQueryException extends Exception {} * direct access to the collected properties in order to handle alternate * execution routines. We therefore use public properties for simplicity. Note * that code that is simply creating and running a field query should still use - * the appropriate methods add conditions on the query. + * the appropriate methods to add conditions on the query. * * Storage engines are not required to support every type of query. By default, * an EntityFieldQueryException will be raised if an unsupported condition is diff --git a/includes/errors.inc b/includes/errors.inc index 2022fc4f..3a97b6da 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -1,5 +1,4 @@ <?php -// $Id: errors.inc,v 1.9 2010/10/16 00:00:16 webchick Exp $ /** * @file diff --git a/includes/file.inc b/includes/file.inc index 4e9f3a9a..6dc7f88b 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -1,5 +1,4 @@ <?php -// $Id: file.inc,v 1.243 2010/12/15 03:39:41 webchick Exp $ /** * @file @@ -202,9 +201,8 @@ function file_stream_wrapper_get_class($scheme) { * @see file_uri_target() */ function file_uri_scheme($uri) { - $data = explode('://', $uri, 2); - - return count($data) == 2 ? $data[0] : FALSE; + $position = strpos($uri, '://'); + return $position ? substr($uri, 0, $position) : FALSE; } /** @@ -424,7 +422,7 @@ function file_create_url($uri) { * Directories need to have execute permissions to be considered a directory by * FTP servers, etc. * - * @param &$directory + * @param $directory * A string reference containing the name of a directory path or URI. A * trailing slash will be trimmed from a path. * @param $options diff --git a/includes/file.mimetypes.inc b/includes/file.mimetypes.inc index 9f238380..cda03fb9 100644 --- a/includes/file.mimetypes.inc +++ b/includes/file.mimetypes.inc @@ -1,5 +1,4 @@ <?php -// $Id: file.mimetypes.inc,v 1.5 2010/07/16 02:40:48 dries Exp $ /** * @file diff --git a/includes/filetransfer/filetransfer.inc b/includes/filetransfer/filetransfer.inc index d7f47e09..2083da9d 100644 --- a/includes/filetransfer/filetransfer.inc +++ b/includes/filetransfer/filetransfer.inc @@ -1,5 +1,4 @@ <?php -// $Id: filetransfer.inc,v 1.14 2011/01/03 02:20:45 webchick Exp $ /* * Base FileTransfer class. diff --git a/includes/filetransfer/ftp.inc b/includes/filetransfer/ftp.inc index 97a6f9b1..838dc7c1 100644 --- a/includes/filetransfer/ftp.inc +++ b/includes/filetransfer/ftp.inc @@ -1,5 +1,4 @@ <?php -// $Id: ftp.inc,v 1.16 2011/01/03 02:20:45 webchick Exp $ /** * Base class for FTP implementations. diff --git a/includes/filetransfer/local.inc b/includes/filetransfer/local.inc index 225a3408..b1259897 100644 --- a/includes/filetransfer/local.inc +++ b/includes/filetransfer/local.inc @@ -1,5 +1,4 @@ <?php -// $Id: local.inc,v 1.7 2010/12/01 00:13:47 webchick Exp $ /** * The local connection class for copying files as the httpd user. diff --git a/includes/filetransfer/ssh.inc b/includes/filetransfer/ssh.inc index a47e9676..43ec3249 100644 --- a/includes/filetransfer/ssh.inc +++ b/includes/filetransfer/ssh.inc @@ -1,5 +1,4 @@ <?php -// $Id: ssh.inc,v 1.8 2011/01/03 02:32:27 webchick Exp $ /** * The SSH connection class for the update module. diff --git a/includes/form.inc b/includes/form.inc index 72a0acbf..a337b03d 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1,5 +1,4 @@ <?php -// $Id: form.inc,v 1.520 2011/01/04 16:46:24 webchick Exp $ /** * @defgroup forms Form builder functions @@ -128,9 +127,9 @@ * - 'triggering_element': (read-only) The form element that triggered * submission. This is the same as the deprecated * $form_state['clicked_button']. It is the element that caused submission, - * which may or may not be a button (in the case of AJAX forms.) This is + * which may or may not be a button (in the case of Ajax forms.) This is * often used to distinguish between various buttons in a submit handler, - * and is also used in AJAX handlers. + * and is also used in Ajax handlers. * - 'cache': The typical form workflow involves two page requests. During the * first page request, a form is built and returned for the user to fill in. * Then the user fills the form in and submits it, triggering a second page @@ -139,9 +138,9 @@ * In some special use-cases, it is necessary or desired to persist the $form * and $form_state variables from the initial page request to the one that * processes the submission. A form builder function can set 'cache' to TRUE - * to do this. One example where this is needed is to handle AJAX submissions, + * to do this. One example where this is needed is to handle Ajax submissions, * so ajax_process_form() sets this for all forms that include an element with - * a #ajax property. (In AJAX, the handler has no way to build the form + * a #ajax property. (In Ajax, the handler has no way to build the form * itself, so must rely on the cached version created on each page load, so * it's a classic example of this use case.) Note that the persistence of * $form and $form_state across successive submissions of a multi-step form @@ -202,7 +201,7 @@ function drupal_get_form($form_id) { * can implement hook_forms(), which maps different $form_id values to the * proper form constructor function. Examples may be found in node_forms(), * search_forms(), and user_forms(). - * @param &$form_state + * @param $form_state * An array which stores information about the form. This is passed as a * reference so that the caller can use it to examine what in the form changed * when the form submission process is complete. Furthermore, it may be used @@ -254,7 +253,7 @@ function drupal_get_form($form_id) { * - must_validate: Ordinarily, a form is only validated once but there are * times when a form is resubmitted internally and should be validated * again. Setting this to TRUE will force that to happen. This is most - * likely to occur during AHAH or AJAX operations. + * likely to occur during AHAH or Ajax operations. * - temporary: An array holding temporary data accessible during the current * page request only. It may be used to temporary save any data that doesn't * need to or shouldn't be cached during the whole form workflow, e.g. data @@ -396,9 +395,9 @@ function form_state_defaults() { * function is called to generate a new $form, the next step in the form * workflow, to be returned for rendering. * - * AJAX form submissions are almost always multi-step workflows, so that is one + * Ajax form submissions are almost always multi-step workflows, so that is one * common use-case during which form rebuilding occurs. See ajax_form_callback() - * for more information about creating AJAX-enabled forms. + * for more information about creating Ajax-enabled forms. * * @param $form_id * The unique string identifying the desired form. If a function @@ -411,7 +410,7 @@ function form_state_defaults() { * A keyed array containing the current state of the form. * @param $old_form * (optional) A previously built $form. Used to retain the #build_id and - * #action properties in AJAX callbacks and similar partial form rebuilds. The + * #action properties in Ajax callbacks and similar partial form rebuilds. The * only properties copied from $old_form are the ones which both exist in * $old_form and for which $form_state['rebuild_info']['copy'][PROPERTY] is * TRUE. If $old_form is not passed, the entire $form is rebuilt freshly. @@ -427,7 +426,7 @@ function form_state_defaults() { function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) { $form = drupal_retrieve_form($form_id, $form_state); - // If only parts of the form will be returned to the browser (e.g. AJAX or + // If only parts of the form will be returned to the browser (e.g., Ajax or // RIA clients), re-use the old #build_id to not require client-side code to // manually update the hidden 'build_id' input element. // Otherwise, a new #build_id is generated, to not clobber the previous @@ -441,7 +440,7 @@ function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) { $form['#build_id'] = 'form-' . drupal_hash_base64(uniqid(mt_rand(), TRUE) . mt_rand()); } - // #action defaults to request_uri(), but in case of AJAX and other partial + // #action defaults to request_uri(), but in case of Ajax and other partial // rebuilds, the form is submitted to an alternate URL, and the original // #action needs to be retained. if (isset($old_form['#action']) && !empty($form_state['rebuild_info']['copy']['#action'])) { @@ -882,13 +881,13 @@ function drupal_process_form($form_id, &$form, &$form_state) { // yet complete. A new $form needs to be constructed based on the changes // made to $form_state during this request. Normally, a submit handler sets // $form_state['rebuild'] if a fully executed form requires another step. - // However, for forms that have not been fully executed (e.g., AJAX + // However, for forms that have not been fully executed (e.g., Ajax // submissions triggered by non-buttons), there is no submit handler to set // $form_state['rebuild']. It would not make sense to redisplay the // identical form without an error for the user to correct, so we also // rebuild error-free non-executed forms, regardless of // $form_state['rebuild']. - // @todo D8: Simplify this logic; considering AJAX and non-HTML front-ends, + // @todo D8: Simplify this logic; considering Ajax and non-HTML front-ends, // along with element-level #submit properties, it makes no sense to have // divergent form execution based on whether the triggering element has // #executes_submit_callback set to TRUE. @@ -1146,7 +1145,7 @@ function drupal_validate_form($form_id, &$form, &$form_state) { * - If $form_state['no_redirect'] is TRUE, then the callback that originally * built the form explicitly disallows any redirection, regardless of the * redirection value in $form_state['redirect']. For example, ajax_get_form() - * defines $form_state['no_redirect'] when building a form in an AJAX + * defines $form_state['no_redirect'] when building a form in an Ajax * callback to prevent any redirection. $form_state['no_redirect'] should NOT * be altered by form builder functions or form validation/submit handlers. * - If $form_state['programmed'] is TRUE, the form submission was usually @@ -1286,7 +1285,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) { // If submit handlers won't run (due to the submission having been triggered // by an element whose #executes_submit_callback property isn't TRUE), then // it's safe to suppress all validation errors, and we do so by default, - // which is particularly useful during an AJAX submission triggered by a + // which is particularly useful during an Ajax submission triggered by a // non-button. An element can override this default by setting the // #limit_validation_errors property. For button element types, // #limit_validation_errors defaults to FALSE (via system_element_info()), @@ -1962,12 +1961,12 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) { // form_state_values_clean(). Enforce the same input processing restrictions // as above. if ($process_input) { - // Detect if the element triggered the submission via AJAX. + // Detect if the element triggered the submission via Ajax. if (_form_element_triggered_scripted_submission($element, $form_state)) { $form_state['triggering_element'] = $element; } - // If the form was submitted by the browser rather than via AJAX, then it + // If the form was submitted by the browser rather than via Ajax, then it // can only have been triggered by a button, and we need to determine which // button within the constraints of how browsers provide this information. if (isset($element['#button_type'])) { @@ -1992,7 +1991,7 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) { * Helper function to handle the convoluted logic of button click detection. * * This detects button or non-button controls that trigger a form submission via - * AJAX or some other scriptable environment. These environments can set the + * Ajax or some other scriptable environment. These environments can set the * special input key '_triggering_element_name' to identify the triggering * element. If the name alone doesn't identify the element uniquely, the input * key '_triggering_element_value' may also be set to require a match on element @@ -2017,7 +2016,7 @@ function _form_element_triggered_scripted_submission($element, &$form_state) { * of the POST data, but with extra code to deal with the convoluted way in * which browsers submit data for image button clicks. * - * This does not detect button clicks processed by AJAX (that is done in + * This does not detect button clicks processed by Ajax (that is done in * _form_element_triggered_scripted_submission()) and it does not detect form * submissions from Internet Explorer in response to an ENTER key pressed in a * textfield (form_builder() has extra code for that). @@ -2062,7 +2061,7 @@ function _form_button_was_clicked($element, &$form_state) { * - form_build_id * - op * - * @param &$form_state + * @param $form_state * A keyed array containing the current state of the form, including * submitted form values; altered by reference. */ @@ -2492,7 +2491,7 @@ function form_process_select($element) { if (($required && !isset($element['#default_value'])) || isset($element['#empty_value']) || isset($element['#empty_option'])) { $element += array( '#empty_value' => '', - '#empty_option' => $required ? t('- Select - ') : t('- None -'), + '#empty_option' => $required ? t('- Select -') : t('- None -'), ); // The empty option is prepended to #options and purposively not merged // to prevent another option in #options mistakenly using the same value @@ -3378,7 +3377,7 @@ function form_validate_machine_name(&$element, &$form_state) { * Adds fieldsets to the specified group or adds group members to this * fieldset. * - * @param &$element + * @param $element * An associative array containing the properties and children of the * fieldset. Note that $element must be taken by reference here, so processed * child elements are taken over into $form_state. @@ -3724,7 +3723,7 @@ function theme_textarea($variables) { function theme_password($variables) { $element = $variables['element']; $element['#attributes']['type'] = 'password'; - element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength')); + element_set_attributes($element, array('id', 'name', 'size', 'maxlength')); _form_set_class($element, array('form-text')); return '<input' . drupal_attributes($element['#attributes']) . ' />'; @@ -3956,7 +3955,7 @@ function theme_form_element_label($variables) { * * Adds 'required' and 'error' classes as needed. * - * @param &$element + * @param $element * The form element. * @param $name * Array of new class names to be added. @@ -4016,7 +4015,9 @@ function _form_set_class(&$element, $class = array()) { * Note: if the batch 'title', 'init_message', 'progress_message', or * 'error_message' could contain any user input, it is the responsibility of * the code calling batch_set() to sanitize them first with a function like - * check_plain() or filter_xss(). + * check_plain() or filter_xss(). Furthermore, if the batch operation + * returns any user input in the 'results' or 'message' keys of $context, + * it must also sanitize them first. * * Sample batch operations: * @code @@ -4039,8 +4040,8 @@ function _form_set_class(&$element, $class = array()) { * // and the batch processing can continue to the next operation. * * $node = node_load(array('uid' => $uid, 'type' => $type)); - * $context['results'][] = $node->nid . ' : ' . $node->title; - * $context['message'] = $node->title; + * $context['results'][] = $node->nid . ' : ' . check_plain($node->title); + * $context['message'] = check_plain($node->title); * } * * // More advanced example: multi-step operation - load all nodes, five by five @@ -4059,10 +4060,10 @@ function _form_set_class(&$element, $class = array()) { * ->execute(); * foreach ($result as $row) { * $node = node_load($row->nid, NULL, TRUE); - * $context['results'][] = $node->nid . ' : ' . $node->title; + * $context['results'][] = $node->nid . ' : ' . check_plain($node->title); * $context['sandbox']['progress']++; * $context['sandbox']['current_node'] = $node->nid; - * $context['message'] = $node->title; + * $context['message'] = check_plain($node->title); * } * if ($context['sandbox']['progress'] != $context['sandbox']['max']) { * $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max']; diff --git a/includes/graph.inc b/includes/graph.inc index 01a27339..416fad6d 100644 --- a/includes/graph.inc +++ b/includes/graph.inc @@ -1,5 +1,4 @@ <?php -// $Id: graph.inc,v 1.4 2010/04/22 19:21:12 dries Exp $ /** * @file @@ -33,7 +32,7 @@ * @endcode * * @return - * The passed in $graph with more secondary keys filled in: + * The passed-in $graph with more secondary keys filled in: * - 'paths': Contains a list of vertices than can be reached on a path from * this vertex. * - 'reverse_paths': Contains a list of vertices that has a path from them @@ -75,15 +74,15 @@ function drupal_depth_first_search(&$graph) { /** * Helper function to perform a depth first sort. * - * @param &$graph + * @param $graph * A three dimensional associated graph array. - * @param &$state + * @param $state * An associative array. The key 'last_visit_order' stores a list of the * vertices visited. The key components stores list of vertices belonging * to the same the component. * @param $start * An arbitrary vertex where we started traversing the graph. - * @param &$component + * @param $component * The component of the last vertex. * * @see drupal_depth_first_search() diff --git a/includes/image.inc b/includes/image.inc index ce6a5275..b04943b5 100644 --- a/includes/image.inc +++ b/includes/image.inc @@ -1,5 +1,4 @@ <?php -// $Id: image.inc,v 1.42 2011/01/02 17:26:39 webchick Exp $ /** * @file diff --git a/includes/install.core.inc b/includes/install.core.inc index 52ef5935..a74dfdf0 100644 --- a/includes/install.core.inc +++ b/includes/install.core.inc @@ -1,5 +1,4 @@ <?php -// $Id: install.core.inc,v 1.49 2011/01/03 15:48:11 webchick Exp $ /** * @file diff --git a/includes/install.inc b/includes/install.inc index 3956ff9f..d22f4f9c 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -1,5 +1,4 @@ <?php -// $Id: install.inc,v 1.152 2011/01/02 17:23:20 webchick Exp $ /** * Indicates that a module has not been installed yet. @@ -199,7 +198,7 @@ function drupal_install_profile_distribution_name() { // At all other times, we load the profile via standard methods. else { $profile = drupal_get_profile(); - $info = install_profile_info($profile); + $info = system_get_info('module', $profile); return $info['distribution_name']; } } @@ -548,7 +547,7 @@ abstract class DatabaseTasks { * * @param $database * An array of driver specific configuration options. - * + * * @return * An array of driver configuration errors, keyed by form element name. */ @@ -783,44 +782,12 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents } foreach ($module_list as $module) { - // First, retrieve all the module's menu paths from db. - drupal_load('module', $module); - $paths = module_invoke($module, 'menu'); - // Uninstall the module. module_load_install($module); module_invoke($module, 'uninstall'); drupal_uninstall_schema($module); watchdog('system', '%module module uninstalled.', array('%module' => $module), WATCHDOG_INFO); - - // Now remove the menu links for all paths declared by this module. - if (!empty($paths)) { - $paths = array_keys($paths); - // Clean out the names of load functions. - foreach ($paths as $index => $path) { - $parts = explode('/', $path, MENU_MAX_PARTS); - foreach ($parts as $k => $part) { - if (preg_match('/^%[a-z_]*$/', $part)) { - $parts[$k] = '%'; - } - } - $paths[$index] = implode('/', $parts); - } - - $result = db_select('menu_links') - ->fields('menu_links') - ->condition('router_path', $paths, 'IN') - ->condition('external', 0) - ->orderBy('depth') - ->execute(); - // Remove all such items. Starting from those with the greatest depth will - // minimize the amount of re-parenting done by menu_link_delete(). - foreach ($result as $item) { - _menu_delete_item($item, TRUE); - } - } - drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED); } @@ -1055,7 +1022,12 @@ function install_goto($path) { * Used during the install process, when database, theme, and localization * system is possibly not yet available. * + * Use t() if your code will never run during the Drupal installation phase. + * Use st() if your code will only run during installation and never any other + * time. Use get_t() if your code could run in either circumstance. + * * @see t() + * @see get_t() * @ingroup sanitization */ function st($string, array $args = array(), array $options = array()) { @@ -1199,6 +1171,10 @@ function drupal_check_module($module) { * installed, to be shown throughout the installation process. Defaults to * 'Drupal'. * + * Note that this function does an expensive file system scan to get info file + * information for dependencies. If you only need information from the info + * file itself, use system_get_info(). + * * Example of .info file: * @code * name = Minimal diff --git a/includes/iso.inc b/includes/iso.inc index 5d8a09c0..dabbefdd 100644 --- a/includes/iso.inc +++ b/includes/iso.inc @@ -1,5 +1,4 @@ <?php -// $Id: iso.inc,v 1.13 2011/01/04 16:07:48 webchick Exp $ /** * @file diff --git a/includes/language.inc b/includes/language.inc index 61bbbd76..b7057f2a 100644 --- a/includes/language.inc +++ b/includes/language.inc @@ -1,5 +1,4 @@ <?php -// $Id: language.inc,v 1.30 2010/05/12 08:26:14 dries Exp $ /** * @file @@ -84,6 +83,44 @@ function language_types_disable($types) { variable_set('language_types', $enabled_types); } +/** + * Updates the language type configuration. + */ +function language_types_set() { + // Ensure that we are getting the defined language negotiation information. An + // invocation of module_enable() or module_disable() could outdate the cached + // information. + drupal_static_reset('language_types_info'); + drupal_static_reset('language_negotiation_info'); + + // Determine which language types are configurable and which not by checking + // whether the 'fixed' key is defined. Non-configurable (fixed) language types + // have their language negotiation settings stored there. + $defined_providers = language_negotiation_info(); + foreach (language_types_info() as $type => $info) { + if (isset($info['fixed'])) { + $language_types[$type] = FALSE; + $negotiation = array(); + foreach ($info['fixed'] as $weight => $id) { + if (isset($defined_providers[$id])) { + $negotiation[$id] = $weight; + } + } + language_negotiation_set($type, $negotiation); + } + else { + $language_types[$type] = TRUE; + } + } + + // Save language types. + variable_set('language_types', $language_types); + + // Ensure that subsequent calls of language_types_configurable() return the + // updated language type information. + drupal_static_reset('language_types_configurable'); +} + /** * Check if a language provider is enabled. * @@ -174,6 +211,28 @@ function language_negotiation_get_switch_links($type, $path) { return $links; } +/** + * Updates language configuration to remove any language provider that is no longer defined. + */ +function language_negotiation_purge() { + // Ensure that we are getting the defined language negotiation information. An + // invocation of module_enable() or module_disable() could outdate the cached + // information. + drupal_static_reset('language_negotiation_info'); + drupal_static_reset('language_types_info'); + + $defined_providers = language_negotiation_info(); + foreach (language_types_info() as $type => $type_info) { + $weight = 0; + $negotiation = array(); + foreach (variable_get("language_negotiation_$type", array()) as $id => $provider) { + if (isset($defined_providers[$id])) { + $negotiation[$id] = $weight++; + } + } + language_negotiation_set($type, $negotiation); + } +} /** * Save a list of language providers. @@ -181,7 +240,8 @@ function language_negotiation_get_switch_links($type, $path) { * @param $type * The language negotiation type. * @param $language_providers - * An array of language provider ids. + * An array of language provider weights keyed by id. + * @see language_provider_weight() */ function language_negotiation_set($type, $language_providers) { // Save only the necessary fields. @@ -190,7 +250,7 @@ function language_negotiation_set($type, $language_providers) { $negotiation = array(); $providers_weight = array(); $defined_providers = language_negotiation_info(); - $default_types = language_types_configurable(); + $default_types = language_types_configurable(FALSE); // Initialize the providers weight list. foreach ($language_providers as $id => $provider) { diff --git a/includes/locale.inc b/includes/locale.inc index e59e28e2..578b1b3c 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -1,5 +1,4 @@ <?php -// $Id: locale.inc,v 1.266 2011/01/03 18:03:54 webchick Exp $ /** * @file @@ -586,159 +585,250 @@ function _locale_import_po($file, $langcode, $mode, $group = NULL) { */ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = 'default') { - $fd = fopen($file->uri, "rb"); // File will get closed by PHP on return + // The file will get closed by PHP on returning from this function. + $fd = fopen($file->uri, 'rb'); if (!$fd) { _locale_import_message('The translation import failed, because the file %filename could not be read.', $file); return FALSE; } - $context = "COMMENT"; // Parser context: COMMENT, MSGID, MSGID_PLURAL, MSGSTR and MSGSTR_ARR - $current = array(); // Current entry being read - $plural = 0; // Current plural form - $lineno = 0; // Current line + /* + * The parser context. Can be: + * - 'COMMENT' (#) + * - 'MSGID' (msgid) + * - 'MSGID_PLURAL' (msgid_plural) + * - 'MSGCTXT' (msgctxt) + * - 'MSGSTR' (msgstr or msgstr[]) + * - 'MSGSTR_ARR' (msgstr_arg) + */ + $context = 'COMMENT'; + + // Current entry being read. + $current = array(); + + // Current plurality for 'msgstr[]'. + $plural = 0; + + // Current line. + $lineno = 0; while (!feof($fd)) { - $line = fgets($fd, 10*1024); // A line should not be this long + // A line should not be longer than 10 * 1024. + $line = fgets($fd, 10 * 1024); + if ($lineno == 0) { // The first line might come with a UTF-8 BOM, which should be removed. $line = str_replace("\xEF\xBB\xBF", '', $line); } + $lineno++; + + // Trim away the linefeed. $line = trim(strtr($line, array("\\\n" => ""))); - if (!strncmp("#", $line, 1)) { // A comment - if ($context == "COMMENT") { // Already in comment context: add - $current["#"][] = substr($line, 1); + if (!strncmp('#', $line, 1)) { + // Lines starting with '#' are comments. + + if ($context == 'COMMENT') { + // Already in comment token, insert the comment. + $current['#'][] = substr($line, 1); } - elseif (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one + elseif (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) { + // We are currently in string token, close it out. _locale_import_one_string($op, $current, $mode, $lang, $file, $group); - $current = array(); - $current["#"][] = substr($line, 1); - $context = "COMMENT"; + + // Start a new entry for the comment. + $current = array(); + $current['#'][] = substr($line, 1); + + $context = 'COMMENT'; } - else { // Parse error + else { + // A comment following any other token is a syntax error. _locale_import_message('The translation file %filename contains an error: "msgstr" was expected but not found on line %line.', $file, $lineno); return FALSE; } } - elseif (!strncmp("msgid_plural", $line, 12)) { - if ($context != "MSGID") { // Must be plural form for current entry + elseif (!strncmp('msgid_plural', $line, 12)) { + // A plural form for the current message. + + if ($context != 'MSGID') { + // A plural form cannot be added to anything else but the id directly. _locale_import_message('The translation file %filename contains an error: "msgid_plural" was expected but not found on line %line.', $file, $lineno); return FALSE; } + + // Remove 'msgid_plural' and trim away whitespace. $line = trim(substr($line, 12)); + // At this point, $line should now contain only the plural form. + $quoted = _locale_import_parse_quoted($line); if ($quoted === FALSE) { + // The plural form must be wrapped in quotes. _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - $current["msgid"] = $current["msgid"] . "\0" . $quoted; - $context = "MSGID_PLURAL"; + + // Append the plural form to the current entry. + $current['msgid'] .= "\0" . $quoted; + + $context = 'MSGID_PLURAL'; } - elseif (!strncmp("msgid", $line, 5)) { - if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one + elseif (!strncmp('msgid', $line, 5)) { + // Starting a new message. + + if (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) { + // We are currently in a message string, close it out. _locale_import_one_string($op, $current, $mode, $lang, $file, $group); + + // Start a new context for the id. $current = array(); } - elseif ($context == "MSGID") { // Already in this context? Parse error + elseif ($context == 'MSGID') { + // We are currently already in the context, meaning we passed an id with no data. _locale_import_message('The translation file %filename contains an error: "msgid" is unexpected on line %line.', $file, $lineno); return FALSE; } + + // Remove 'msgid' and trim away whitespace. $line = trim(substr($line, 5)); + // At this point, $line should now contain only the message id. + $quoted = _locale_import_parse_quoted($line); if ($quoted === FALSE) { + // The message id must be wrapped in quotes. _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - $current["msgid"] = $quoted; - $context = "MSGID"; + + $current['msgid'] = $quoted; + $context = 'MSGID'; } - elseif (!strncmp("msgctxt", $line, 7)) { - if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one + elseif (!strncmp('msgctxt', $line, 7)) { + // Starting a new context. + + if (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) { + // We are currently in a message, start a new one. _locale_import_one_string($op, $current, $mode, $lang, $file, $group); $current = array(); } - elseif (!empty($current["msgctxt"])) { // Already in this context? Parse error + elseif (!empty($current['msgctxt'])) { + // A context cannot apply to another context. _locale_import_message('The translation file %filename contains an error: "msgctxt" is unexpected on line %line.', $file, $lineno); return FALSE; } + + // Remove 'msgctxt' and trim away whitespaces. $line = trim(substr($line, 7)); + // At this point, $line should now contain the context. + $quoted = _locale_import_parse_quoted($line); if ($quoted === FALSE) { + // The context string must be quoted. _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - $current["msgctxt"] = $quoted; - $context = "MSGCTXT"; + + $current['msgctxt'] = $quoted; + + $context = 'MSGCTXT'; } - elseif (!strncmp("msgstr[", $line, 7)) { - if (($context != "MSGID") && ($context != "MSGCTXT") && ($context != "MSGID_PLURAL") && ($context != "MSGSTR_ARR")) { // Must come after msgid, msgxtxt, msgid_plural, or msgstr[] + elseif (!strncmp('msgstr[', $line, 7)) { + // A message string for a specific plurality. + + if (($context != 'MSGID') && ($context != 'MSGCTXT') && ($context != 'MSGID_PLURAL') && ($context != 'MSGSTR_ARR')) { + // Message strings must come after msgid, msgxtxt, msgid_plural, or other msgstr[] entries. _locale_import_message('The translation file %filename contains an error: "msgstr[]" is unexpected on line %line.', $file, $lineno); return FALSE; } - if (strpos($line, "]") === FALSE) { + + // Ensure the plurality is terminated. + if (strpos($line, ']') === FALSE) { _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - $frombracket = strstr($line, "["); - $plural = substr($frombracket, 1, strpos($frombracket, "]") - 1); + + // Extract the plurality. + $frombracket = strstr($line, '['); + $plural = substr($frombracket, 1, strpos($frombracket, ']') - 1); + + // Skip to the next whitespace and trim away any further whitespace, bringing $line to the message data. $line = trim(strstr($line, " ")); + $quoted = _locale_import_parse_quoted($line); if ($quoted === FALSE) { + // The string must be quoted. _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - $current["msgstr"][$plural] = $quoted; - $context = "MSGSTR_ARR"; + + $current['msgstr'][$plural] = $quoted; + + $context = 'MSGSTR_ARR'; } elseif (!strncmp("msgstr", $line, 6)) { - if (($context != "MSGID") && ($context != "MSGCTXT")) { // Should come just after a msgid or msgctxt block + // A string for the an id or context. + + if (($context != 'MSGID') && ($context != 'MSGCTXT')) { + // Strings are only valid within an id or context scope. _locale_import_message('The translation file %filename contains an error: "msgstr" is unexpected on line %line.', $file, $lineno); return FALSE; } + + // Remove 'msgstr' and trim away away whitespaces. $line = trim(substr($line, 6)); + // At this point, $line should now contain the message. + $quoted = _locale_import_parse_quoted($line); if ($quoted === FALSE) { + // The string must be quoted. _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - $current["msgstr"] = $quoted; - $context = "MSGSTR"; + + $current['msgstr'] = $quoted; + + $context = 'MSGSTR'; } - elseif ($line != "") { + elseif ($line != '') { + // Anything that is not a token may be a continuation of a previous token. + $quoted = _locale_import_parse_quoted($line); if ($quoted === FALSE) { + // The string must be quoted. _locale_import_message('The translation file %filename contains a syntax error on line %line.', $file, $lineno); return FALSE; } - if (($context == "MSGID") || ($context == "MSGID_PLURAL")) { - $current["msgid"] .= $quoted; + + // Append the string to the current context. + if (($context == 'MSGID') || ($context == 'MSGID_PLURAL')) { + $current['msgid'] .= $quoted; } - elseif ($context == "MSGCTXT") { - $current["msgctxt"] .= $quoted; + elseif ($context == 'MSGCTXT') { + $current['msgctxt'] .= $quoted; } - elseif ($context == "MSGSTR") { - $current["msgstr"] .= $quoted; + elseif ($context == 'MSGSTR') { + $current['msgstr'] .= $quoted; } - elseif ($context == "MSGSTR_ARR") { - $current["msgstr"][$plural] .= $quoted; + elseif ($context == 'MSGSTR_ARR') { + $current['msgstr'][$plural] .= $quoted; } else { + // No valid context to append to. _locale_import_message('The translation file %filename contains an error: there is an unexpected string on line %line.', $file, $lineno); return FALSE; } } } - // End of PO file, flush last entry. - if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { + // End of PO file, closed out the last entry. + if (($context == 'MSGSTR') || ($context == 'MSGSTR_ARR')) { _locale_import_one_string($op, $current, $mode, $lang, $file, $group); } - elseif ($context != "COMMENT") { + elseif ($context != 'COMMENT') { _locale_import_message('The translation file %filename ended unexpectedly at line %line.', $file, $lineno); return FALSE; } - } /** diff --git a/includes/lock.inc b/includes/lock.inc index ddf4e754..42f1906f 100644 --- a/includes/lock.inc +++ b/includes/lock.inc @@ -1,5 +1,4 @@ <?php -// $Id: lock.inc,v 1.6 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -188,7 +187,7 @@ function lock_may_be_available($name) { * lock. This will block further execution until the lock is available or the * specified delay in seconds is reached. This should not be used with locks * that are acquired very frequently, since the lock is likely to be acquired - * again by a different request during the sleep(). + * again by a different request while waiting. * * @param $name * The name of the lock. @@ -199,12 +198,32 @@ function lock_may_be_available($name) { * TRUE if the lock holds, FALSE if it is available. */ function lock_wait($name, $delay = 30) { - $delay = (int) $delay; - while ($delay--) { + // Pause the process for short periods between calling + // lock_may_be_available(). This prevents hitting the database with constant + // database queries while waiting, which could lead to performance issues. + // However, if the wait period is too long, there is the potential for a + // large number of processes to be blocked waiting for a lock, especially + // if the item being rebuilt is commonly requested. To address both of these + // concerns, begin waiting for 25ms, then add 25ms to the wait period each + // time until it reaches 500ms. After this point polling will continue every + // 500ms until $delay is reached. + + // $delay is passed in seconds, but we will be using usleep(), which takes + // microseconds as a parameter. Multiply it by 1 million so that all + // further numbers are equivalent. + $delay = (int) $delay * 1000000; + + // Begin sleeping at 25ms. + $sleep = 25000; + while ($delay > 0) { // This function should only be called by a request that failed to get a // lock, so we sleep first to give the parallel request a chance to finish // and release the lock. - sleep(1); + usleep($sleep); + // After each sleep, increase the value of $sleep until it reaches + // 500ms, to reduce the potential for a lock stampede. + $delay = $delay - $sleep; + $sleep = min(500000, $sleep + 25000, $delay); if (lock_may_be_available($name)) { // No longer need to wait. return FALSE; diff --git a/includes/mail.inc b/includes/mail.inc index 6481bac9..d2febed3 100644 --- a/includes/mail.inc +++ b/includes/mail.inc @@ -1,5 +1,4 @@ <?php -// $Id: mail.inc,v 1.34 2010/07/28 02:19:56 dries Exp $ /** * @file @@ -123,8 +122,8 @@ function drupal_mail($module, $key, $to, $language, $params = array(), $from = N if ($default_from) { // To prevent e-mail from looking like spam, the addresses in the Sender and // Return-Path headers should have a domain authorized to use the originating - // SMTP server. Errors-To is redundant, but shouldn't hurt. - $headers['From'] = $headers['Sender'] = $headers['Return-Path'] = $headers['Errors-To'] = $default_from; + // SMTP server. + $headers['From'] = $headers['Sender'] = $headers['Return-Path'] = $default_from; } if ($from) { $headers['From'] = $from; diff --git a/includes/menu.inc b/includes/menu.inc index fb61fd37..cfd35c79 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: menu.inc,v 1.431 2011/01/04 06:20:30 dries Exp $ /** * @file @@ -14,7 +13,10 @@ * The Drupal menu system drives both the navigation system from a user * perspective and the callback system that Drupal uses to respond to URLs * passed from the browser. For this reason, a good understanding of the - * menu system is fundamental to the creation of complex modules. + * menu system is fundamental to the creation of complex modules. As a note, + * this is related to, but separate from menu.module, which allows menus + * (which in this context are hierarchical lists of links) to be customized from + * the Drupal administrative interface. * * Drupal's menu system follows a simple hierarchy defined by paths. * Implementations of hook_menu() define menu items and assign them to @@ -125,7 +127,7 @@ define('MENU_IS_LOCAL_ACTION', 0x0100); /** * @defgroup menu_item_types Menu item types * @{ - * Definitions for various menu types. + * Definitions for various menu item types. * * Menu item definitions provide one of these constants, which are shortcuts for * combinations of @link menu_flags Menu flags @endlink. @@ -1042,7 +1044,7 @@ function menu_tree_output($tree) { } // Allow menu-specific theme overrides. - $element['#theme'] = 'menu_link__' . $data['link']['menu_name']; + $element['#theme'] = 'menu_link__' . strtr($data['link']['menu_name'], '-', '_'); $element['#attributes']['class'] = $class; $element['#title'] = $data['link']['title']; $element['#href'] = $data['link']['href']; @@ -2064,7 +2066,7 @@ function menu_local_tasks($level = 0) { * node or array('system', 'navigation') for a certain block. * * @return - * A list of menu router items that are local tasks for the passed in path. + * A list of menu router items that are local tasks for the passed-in path. * * @see contextual_links_preprocess() */ @@ -2319,11 +2321,11 @@ function menu_set_active_trail($new_trail = NULL) { } list($key, $curr) = each($tree); } - // Make sure the current page is in the trail (needed for the page title), - // if the link's type allows it to be shown in the breadcrumb. Also exclude - // it if we are on the front page. + // Make sure the current page is in the trail to build the page title, by + // appending either the preferred link or the menu router item for the + // current page. Exclude it if we are on the front page. $last = end($trail); - if ($last['href'] != $preferred_link['href'] && ($preferred_link['type'] & MENU_VISIBLE_IN_BREADCRUMB) == MENU_VISIBLE_IN_BREADCRUMB && !drupal_is_front_page()) { + if ($last['href'] != $preferred_link['href'] && !drupal_is_front_page()) { $trail[] = $preferred_link; } } @@ -2891,11 +2893,12 @@ function _menu_delete_item($item, $force = FALSE) { menu_link_save($child); } } - db_delete('menu_links')->condition('mlid', $item['mlid'])->execute(); - // Notify modules we have deleted the item. + // Notify modules we are deleting the item. module_invoke_all('menu_link_delete', $item); + db_delete('menu_links')->condition('mlid', $item['mlid'])->execute(); + // Update the has_children status of the parent. _menu_update_parental_status($item); menu_cache_clear($item['menu_name']); @@ -2904,18 +2907,26 @@ function _menu_delete_item($item, $force = FALSE) { } /** - * Save a menu link. + * Saves a menu link. + * + * After calling this function, rebuild the menu cache using + * menu_cache_clear_all(). * * @param $item - * An array representing a menu link item. The only mandatory keys are - * link_path and link_title. Possible keys are: - * - menu_name: Default is navigation - * - weight: Default is 0 - * - expanded: Whether the item is expanded. - * - options: An array of options, see l() for more. - * - mlid: Set to an existing value, or 0 or NULL to insert a new link. - * - plid: The mlid of the parent. - * - router_path: The path of the relevant router item. + * An associative array representing a menu link item, with elements: + * - link_path: (required) The path of the menu item, which should be + * normalized first by calling drupal_get_normal_path() on it. + * - link_title: (required) Title to appear in menu for the link. + * - menu_name: (optional) The machine name of the menu for the link. + * Defaults to 'navigation'. + * - weight: (optional) Integer to determine position in menu. Default is 0. + * - expanded: (optional) Boolean that determines if the item is expanded. + * - options: (optional) An array of options, see l() for more. + * - mlid: (optional) Menu link identifier, the primary integer key for each + * menu link. Can be set to an existing value, or to 0 or NULL + * to insert a new link. + * - plid: (optional) The mlid of the parent. + * - router_path: (optional) The path of the relevant router item. * * @return * The mlid of the saved menu link, or FALSE if the menu link could not be diff --git a/includes/module.inc b/includes/module.inc index 1ae5583d..779b6682 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -1,5 +1,4 @@ <?php -// $Id: module.inc,v 1.209 2010/11/27 20:41:38 dries Exp $ /** * @file @@ -127,6 +126,9 @@ function system_list($type) { // if not fetch only the required information to fire bootstrap hooks // in case we are going to serve the page from cache. if ($type == 'bootstrap') { + if (isset($lists['bootstrap'])) { + return $lists['bootstrap']; + } if ($cached = cache_get('bootstrap_modules', 'cache_bootstrap')) { $bootstrap_list = $cached->data; } @@ -372,7 +374,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) { // Add dependencies to the list, with a placeholder weight. // The new modules will be processed as the while loop continues. - foreach ($module_data[$module]->info['dependencies'] as $dependency) { + foreach (array_keys($module_data[$module]->requires) as $dependency) { if (!isset($module_list[$dependency])) { $module_list[$dependency] = 0; } @@ -854,7 +856,7 @@ function drupal_required_modules() { /** * Hands off alterable variables to type-specific *_alter implementations. * - * This dispatch function hands off the passed in variables to type-specific + * This dispatch function hands off the passed-in variables to type-specific * hook_TYPE_alter() implementations in modules. It ensures a consistent * interface for all altering operations. * @@ -888,14 +890,14 @@ function drupal_required_modules() { * values in $type. For example, when Form API is using drupal_alter() to * execute both hook_form_alter() and hook_form_FORM_ID_alter() * implementations, it passes array('form', 'form_' . $form_id) for $type. - * @param &$data + * @param $data * The variable that will be passed to hook_TYPE_alter() implementations to be * altered. The type of this variable depends on the value of the $type * argument. For example, when altering a 'form', $data will be a structured * array. When altering a 'profile', $data will be an object. - * @param &$context1 + * @param $context1 * (optional) An additional variable that is passed by reference. - * @param &$context2 + * @param $context2 * (optional) An additional variable that is passed by reference. If more * context needs to be provided to implementations, then this should be an * associative array as described above. diff --git a/includes/pager.inc b/includes/pager.inc index 12692986..146033f1 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -1,5 +1,4 @@ <?php -// $Id: pager.inc,v 1.87 2011/01/03 18:03:54 webchick Exp $ /** * @file @@ -431,7 +430,7 @@ function theme_pager($variables) { /** * @defgroup pagerpieces Pager pieces * @{ - * Use these pieces to construct your own custom pagers in your theme. + * Theme functions for customizing pager elements. * * Note that you should NOT modify this file to customize your pager. */ diff --git a/includes/password.inc b/includes/password.inc index 131ca63f..93d34f81 100644 --- a/includes/password.inc +++ b/includes/password.inc @@ -1,5 +1,4 @@ <?php -// $Id: password.inc,v 1.9 2010/12/18 00:56:18 dries Exp $ /** * @file diff --git a/includes/path.inc b/includes/path.inc index 1825c1ab..db605370 100644 --- a/includes/path.inc +++ b/includes/path.inc @@ -1,5 +1,4 @@ <?php -// $Id: path.inc,v 1.72 2010/11/30 01:05:24 dries Exp $ /** * @file diff --git a/includes/registry.inc b/includes/registry.inc index b0faf259..3fb14fb3 100644 --- a/includes/registry.inc +++ b/includes/registry.inc @@ -1,5 +1,4 @@ <?php -// $Id: registry.inc,v 1.34 2010/09/17 14:45:46 dries Exp $ /** * @file @@ -98,7 +97,8 @@ function _registry_update() { _registry_check_code(REGISTRY_RESET_LOOKUP_CACHE); } catch (Exception $e) { - $transaction->rollback('registry', $e->getMessage(), array(), WATCHDOG_ERROR); + $transaction->rollback(); + watchdog_exception('registry', $e); throw $e; } diff --git a/includes/session.inc b/includes/session.inc index 0ff7c210..9061f461 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -1,5 +1,4 @@ <?php -// $Id: session.inc,v 1.92 2010/11/13 17:40:09 webchick Exp $ /** * @file diff --git a/includes/stream_wrappers.inc b/includes/stream_wrappers.inc index 081941b0..7df1f9dc 100644 --- a/includes/stream_wrappers.inc +++ b/includes/stream_wrappers.inc @@ -1,5 +1,4 @@ <?php -// $Id: stream_wrappers.inc,v 1.22 2010/12/30 22:33:03 webchick Exp $ /** * @file @@ -384,7 +383,7 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface * The file mode ("r", "wb" etc.). * @param $options * A bit mask of STREAM_USE_PATH and STREAM_REPORT_ERRORS. - * @param &$opened_path + * @param $opened_path * A string containing the path actually opened. * * @return diff --git a/includes/tablesort.inc b/includes/tablesort.inc index 327738b5..121a1b90 100644 --- a/includes/tablesort.inc +++ b/includes/tablesort.inc @@ -1,5 +1,4 @@ <?php -// $Id: tablesort.inc,v 1.61 2010/12/17 19:28:13 webchick Exp $ /** * @file @@ -74,18 +73,7 @@ class TableSort extends SelectQueryExtender { * The current sort direction ("asc" or "desc"). */ protected function getSort() { - if (isset($_GET['sort'])) { - return ($_GET['sort'] == 'desc') ? 'desc' : 'asc'; - } - // User has not specified a sort. Use default if specified; otherwise use "asc". - else { - foreach ($this->header as $header) { - if (is_array($header) && isset($header['sort'])) { - return $header['sort']; - } - } - } - return 'asc'; + return tablesort_get_sort($this->header); } /** @@ -112,32 +100,7 @@ class TableSort extends SelectQueryExtender { * - "sql": The name of the database field to sort on. */ protected function order() { - $order = isset($_GET['order']) ? $_GET['order'] : ''; - foreach ($this->header as $header) { - if (isset($header['data']) && $order == $header['data']) { - return array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : ''); - } - - if (isset($header['sort']) && ($header['sort'] == 'asc' || $header['sort'] == 'desc')) { - $default = array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : ''); - } - } - - if (isset($default)) { - return $default; - } - else { - // The first column specified is initial 'order by' field unless otherwise specified - $headers = array_values($this->header); - $header = $headers[0]; - if (is_array($header)) { - $header += array('data' => NULL, 'field' => NULL); - return array('name' => $header['data'], 'sql' => $header['field']); - } - else { - return array('name' => $header); - } - } + return tablesort_get_order($this->header); } } @@ -239,29 +202,27 @@ function tablesort_get_query_parameters() { function tablesort_get_order($headers) { $order = isset($_GET['order']) ? $_GET['order'] : ''; foreach ($headers as $header) { - if (isset($header['data']) && $order == $header['data']) { - return array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : ''); - } + if (is_array($header)) { + if (isset($header['data']) && $order == $header['data']) { + $default = $header; + break; + } - if (isset($header['sort']) && ($header['sort'] == 'asc' || $header['sort'] == 'desc')) { - $default = array('name' => $header['data'], 'sql' => isset($header['field']) ? $header['field'] : ''); + if (empty($default) && isset($header['sort']) && ($header['sort'] == 'asc' || $header['sort'] == 'desc')) { + $default = $header; + } } } - if (isset($default)) { - return $default; - } - else { - // The first column specified is the initial 'order by' field unless otherwise specified. - $first = current($headers); - if (is_array($first)) { - $first += array('data' => NULL, 'field' => NULL); - return array('name' => $first['data'], 'sql' => $first['field']); - } - else { - return array('name' => $first, 'sql' => ''); + if (!isset($default)) { + $default = reset($headers); + if (!is_array($default)) { + $default = array('data' => $default); } } + + $default += array('data' => NULL, 'field' => NULL); + return array('name' => $default['data'], 'sql' => $default['field']); } /** @@ -274,12 +235,15 @@ function tablesort_get_order($headers) { */ function tablesort_get_sort($headers) { if (isset($_GET['sort'])) { - return ($_GET['sort'] == 'desc') ? 'desc' : 'asc'; + return (strtolower($_GET['sort']) == 'desc') ? 'desc' : 'asc'; } - // User has not specified a sort. Use default if specified; otherwise use "asc". + // The user has not specified a sort. Use the default for the currently sorted + // header if specified; otherwise use "asc". else { + // Find out which header is currently being sorted. + $ts = tablesort_get_order($headers); foreach ($headers as $header) { - if (isset($header['sort'])) { + if (is_array($header) && isset($header['data']) && $header['data'] == $ts['name'] && isset($header['sort'])) { return $header['sort']; } } diff --git a/includes/theme.inc b/includes/theme.inc index 0a82a8ad..3ae50006 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: theme.inc,v 1.627 2011/01/03 08:02:11 webchick Exp $ /** * @file @@ -104,7 +103,7 @@ function drupal_theme_initialize() { drupal_static_reset('drupal_alter'); // Provide the page with information about the theme that's used, so that a - // later AJAX request can be rendered using the same theme. + // later Ajax request can be rendered using the same theme. // @see ajax_base_page_theme() $setting['ajaxPageState'] = array( 'theme' => $theme_key, @@ -320,8 +319,8 @@ function drupal_theme_rebuild() { * The theme registry that will eventually be cached; It is an associative * array keyed by theme hooks, whose values are associative arrays describing * the hook: - * - 'type': The passed in $type. - * - 'theme path': The passed in $path. + * - 'type': The passed-in $type. + * - 'theme path': The passed-in $path. * - 'function': The name of the function generating output for this theme * hook. Either defined explicitly in hook_theme() or, if neither 'function' * nor 'template' is defined, then the default theme function name is used. @@ -363,7 +362,6 @@ function drupal_theme_rebuild() { */ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { $result = array(); - $function = $name . '_theme'; // Processor functions work in two distinct phases with the process // functions always being executed after the preprocess functions. @@ -372,24 +370,43 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { 'process functions' => 'process', ); + $hook_defaults = array( + 'variables' => TRUE, + 'render element' => TRUE, + 'pattern' => TRUE, + 'base hook' => TRUE, + ); + + // Invoke the hook_theme() implementation, process what is returned, and + // merge it into $cache. + $function = $name . '_theme'; if (function_exists($function)) { $result = $function($cache, $type, $theme, $path); foreach ($result as $hook => $info) { + // When a theme or engine overrides a module's theme function + // $result[$hook] will only contain key/value pairs for information being + // overridden. Pull the rest of the information from what was defined by + // an earlier hook. + + // Fill in the type and path of the module, theme, or engine that + // implements this theme function. $result[$hook]['type'] = $type; $result[$hook]['theme path'] = $path; - // if function and file are left out, default to standard naming + + // If function and file are omitted, default to standard naming // conventions. if (!isset($info['template']) && !isset($info['function'])) { $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name . '_') . $hook; } - // If a path is set in the info, use what was set. Otherwise use the - // default path. This is mostly so system.module can declare theme - // functions on behalf of core .include files. - // All files are included to be safe. Conditionally included - // files can prevent them from getting registered. + if (isset($cache[$hook]['includes'])) { $result[$hook]['includes'] = $cache[$hook]['includes']; } + + // If the theme implementation defines a file, then also use the path + // that it defined. Otherwise use the default path. This allows + // system.module to declare theme functions on behalf of core .include + // files. if (isset($info['file'])) { $include_file = isset($info['path']) ? $info['path'] : $path; $include_file .= '/' . $info['file']; @@ -397,14 +414,10 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { $result[$hook]['includes'][] = $include_file; } - // If these keys are left unspecified within overridden entries returned - // by hook_theme(), carry them forward from the prior entry. This is so - // that themes don't need to specify this information, since the module - // that registered the theme hook already has. - foreach (array('variables', 'render element', 'pattern', 'base hook') as $key) { - if (!isset($info[$key]) && isset($cache[$hook][$key])) { - $result[$hook][$key] = $cache[$hook][$key]; - } + // If the default keys are not set, use the default values registered + // by the module. + if (isset($cache[$hook])) { + $result[$hook] += array_intersect_key($cache[$hook], $hook_defaults); } // The following apply only to theming hooks implemented as templates. @@ -469,7 +482,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { } // Merge the newly created theme hooks into the existing cache. - $cache = array_merge($cache, $result); + $cache = $result + $cache; } // Let themes have variable processors even if they didn't register a template. @@ -972,7 +985,7 @@ function drupal_find_theme_functions($cache, $prefixes) { // start with. The default is the name of the hook followed by '__'. An // 'base hook' key is added to each entry made for a found suggestion, // so that common functionality can be implemented for all suggestions of - // the same base hook. To keep things simple, deep heirarchy of + // the same base hook. To keep things simple, deep hierarchy of // suggestions is not supported: each suggestion's 'base hook' key // refers to a base hook, not to another suggestion, and all suggestions // are found using the base hook's pattern, not a pattern from an @@ -982,7 +995,7 @@ function drupal_find_theme_functions($cache, $prefixes) { $matches = preg_grep('/^' . $prefix . '_' . $pattern . '/', $functions['user']); if ($matches) { foreach ($matches as $match) { - $new_hook = str_replace($prefix . '_', '', $match); + $new_hook = substr($match, strlen($prefix) + 1); $arg_name = isset($info['variables']) ? 'variables' : 'render element'; $implementations[$new_hook] = array( 'function' => $match, @@ -1256,15 +1269,8 @@ function theme_enable($theme_list) { menu_rebuild(); drupal_theme_rebuild(); - // Notify locale module about new themes being enabled, so translations can - // be imported. This might start a batch, and only return to the redirect - // path after that. - module_invoke('locale', 'system_update', $theme_list); - - // Invoke hook_themes_enabled after the themes have been enabled. + // Invoke hook_themes_enabled() after the themes have been enabled. module_invoke_all('themes_enabled', $theme_list); - - return; } /** @@ -1296,10 +1302,8 @@ function theme_disable($theme_list) { menu_rebuild(); drupal_theme_rebuild(); - // Invoke hook_themes_enabled after the themes have been enabled. + // Invoke hook_themes_disabled after the themes have been disabled. module_invoke_all('themes_disabled', $theme_list); - - return; } /** @@ -1756,10 +1760,10 @@ function theme_table($variables) { */ function theme_tablesort_indicator($variables) { if ($variables['style'] == "asc") { - return theme('image', array('path' => 'misc/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending'))); + return theme('image', array('path' => 'misc/arrow-asc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort ascending'), 'title' => t('sort ascending'))); } else { - return theme('image', array('path' => 'misc/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending'))); + return theme('image', array('path' => 'misc/arrow-desc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort descending'), 'title' => t('sort descending'))); } } @@ -1872,7 +1876,7 @@ function theme_more_help_link($variables) { */ function theme_feed_icon($variables) { $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title'])); - if ($image = theme('image', array('path' => 'misc/feed.png', 'alt' => $text))) { + if ($image = theme('image', array('path' => 'misc/feed.png', 'width' => 16, 'height' => 16, 'alt' => $text))) { return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text))); } } @@ -2042,6 +2046,9 @@ function _theme_table_cell($cell, $header = FALSE) { * Adds a default set of helper variables for variable processors and templates. * This comes in before any other preprocess function which makes it possible to * be used in default theme implementations (non-overridden theme functions). + * + * For more detailed information, see theme(). + * */ function template_preprocess(&$variables, $hook) { global $user; @@ -2119,6 +2126,9 @@ function _template_preprocess_default_variables() { /** * A default process function used to alter variables as late as possible. + * + * For more detailed information, see theme(). + * */ function template_process(&$variables, $hook) { // Flatten out classes. diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc index f165f993..218a8ada 100644 --- a/includes/theme.maintenance.inc +++ b/includes/theme.maintenance.inc @@ -1,5 +1,4 @@ <?php -// $Id: theme.maintenance.inc,v 1.71 2010/11/29 04:45:10 webchick Exp $ /** * @file diff --git a/includes/token.inc b/includes/token.inc index 8bd61e9a..edc8a962 100644 --- a/includes/token.inc +++ b/includes/token.inc @@ -1,24 +1,23 @@ <?php -// $Id: token.inc,v 1.10 2010/10/18 01:13:07 dries Exp $ /** * @file * Drupal placeholder/token replacement system. * - * Provides a set of extensible API functions for replacing placeholders in text - * with meaningful values. + * API functions for replacing placeholders in text with meaningful values. * - * For example: When configuring automated emails, an administrator enters standard - * text for the email. Variables like the title of a node and the date the email - * was sent can be entered as placeholders like [node:title] and [date:short]. - * When a Drupal module prepares to send the email, it can call the token_replace() - * function, passing in the text. The token system will scan the text for placeholder - * tokens, give other modules an opportunity to replace them with meaningful text, - * then return the final product to the original module. + * For example: When configuring automated emails, an administrator enters + * standard text for the email. Variables like the title of a node and the date + * the email was sent can be entered as placeholders like [node:title] and + * [date:short]. When a Drupal module prepares to send the email, it can call + * the token_replace() function, passing in the text. The token system will + * scan the text for placeholder tokens, give other modules an opportunity to + * replace them with meaningful text, then return the final product to the + * original module. * * Tokens follow the form: [$type:$name], where $type is a general class of * tokens like 'node', 'user', or 'comment' and $name is the name of a given - * placeholder. For example, [node:title]. + * placeholder. For example, [node:title] or [node:created:since]. * * In addition to raw text containing placeholders, modules may pass in an array * of objects to be used when performing the replacement. The objects should be @@ -38,8 +37,8 @@ * Some tokens may be chained in the form of [$type:$pointer:$name], where $type * is a normal token type, $pointer is a reference to another token type, and * $name is the name of a given placeholder. For example, [node:author:mail]. In - * that example, 'author' is a pointer to the 'user' account that created the node, - * and 'mail' is a placeholder available for any 'user'. + * that example, 'author' is a pointer to the 'user' account that created the + * node, and 'mail' is a placeholder available for any 'user'. * * @see token_replace() * @see hook_tokens() @@ -47,7 +46,7 @@ */ /** - * Replace all tokens in a given string with appropriate values. + * Replaces all tokens in a given string with appropriate values. * * @param $text * A string potentially containing replaceable tokens. @@ -55,22 +54,25 @@ * (optional) An array of keyed objects. For simple replacement scenarios * 'node', 'user', and others are common keys, with an accompanying node or * user object being the value. Some token types, like 'site', do not require - * any explicit information from $data and can be replaced even if it is empty. + * any explicit information from $data and can be replaced even if it is + * empty. * @param $options * (optional) A keyed array of settings and flags to control the token * replacement process. Supported options are: * - language: A language object to be used when generating locale-sensitive * tokens. * - callback: A callback function that will be used to post-process the array - * of token replacements after they are generated. For example, a module using - * tokens in a text-only email might provide a callback to strip HTML + * of token replacements after they are generated. For example, a module + * using tokens in a text-only email might provide a callback to strip HTML * entities from token values before they are inserted into the final text. * - clear: A boolean flag indicating that tokens should be removed from the * final text if no replacement value can be generated. * - sanitize: A boolean flag indicating that tokens should be sanitized for - * display to a web browser. Defaults to TRUE. Developers who set this option - * to FALSE assume responsibility for running filter_xss(), check_plain() or - * other appropriate scrubbing functions before displaying data to users. + * display to a web browser. Defaults to TRUE. Developers who set this + * option to FALSE assume responsibility for running filter_xss(), + * check_plain() or other appropriate scrubbing functions before displaying + * data to users. + * * @return * Text with tokens replaced. */ @@ -96,17 +98,25 @@ function token_replace($text, array $data = array(), array $options = array()) { } /** - * Build a list of all token-like patterns that appear in the text. + * Builds a list of all token-like patterns that appear in the text. * * @param $text * The text to be scanned for possible tokens. + * * @return * An associative array of discovered tokens, grouped by type. */ function token_scan($text) { - // Matches tokens with the following pattern: [$type:$token] - // $type and $token may not contain white spaces. - preg_match_all('/\[([^\s\]:]*):([^\s\]]*)\]/', $text, $matches); + // Matches tokens with the following pattern: [$type:$name] + // $type and $name may not contain [ ] or whitespace characters. + // $type may not contain : characters, but $name may. + preg_match_all('/ + \[ # [ - pattern start + ([^\s\[\]:]*) # match $type not containing whitespace : [ or ] + : # : - separator + ([^\s\[\]]*) # match $name not containing whitespace [ or ] + \] # ] - pattern end + /x', $text, $matches); $types = $matches[1]; $tokens = $matches[2]; @@ -123,7 +133,7 @@ function token_scan($text) { } /** - * Generate replacement values for a list of tokens. + * Generates replacement values for a list of tokens. * * @param $type * The type of token being replaced. 'node', 'user', and 'date' are common. @@ -134,20 +144,22 @@ function token_scan($text) { * (optional) An array of keyed objects. For simple replacement scenarios * 'node', 'user', and others are common keys, with an accompanying node or * user object being the value. Some token types, like 'site', do not require - * any explicit information from $data and can be replaced even if it is empty. + * any explicit information from $data and can be replaced even if it is + * empty. * @param $options * (optional) A keyed array of settings and flags to control the token * replacement process. Supported options are: - * - 'language' A language object to be used when generating locale-sensitive + * - language: A language object to be used when generating locale-sensitive * tokens. - * - 'callback' A callback function that will be used to post-process the array - * of token replacements after they are generated. Can be used when modules - * require special formatting of token text, for example URL encoding or - * truncation to a specific length. - * - 'sanitize' A boolean flag indicating that tokens should be sanitized for + * - callback: A callback function that will be used to post-process the + * array of token replacements after they are generated. Can be used when + * modules require special formatting of token text, for example URL + * encoding or truncation to a specific length. + * - sanitize: A boolean flag indicating that tokens should be sanitized for * display to a web browser. Developers who set this option to FALSE assume * responsibility for running filter_xss(), check_plain() or other * appropriate scrubbing functions before displaying data to users. + * * @return * An associative array of replacement values, keyed by the original 'raw' * tokens that were found in the source text. For example: @@ -173,7 +185,7 @@ function token_generate($type, array $tokens, array $data = array(), array $opti } /** - * Given a list of tokens, return those that begin with a specific prefix. + * Given a list of tokens, returns those that begin with a specific prefix. * * Used to extract a group of 'chained' tokens (such as [node:author:name]) from * the full list of tokens found in text. For example: @@ -181,7 +193,7 @@ function token_generate($type, array $tokens, array $data = array(), array $opti * $data = array( * 'author:name' => '[node:author:name]', * 'title' => '[node:title]', - * 'created' => '[node:author:name]', + * 'created' => '[node:created]', * ); * $results = token_find_with_prefix($data, 'author'); * $results == array('name' => '[node:author:name]'); @@ -194,6 +206,7 @@ function token_generate($type, array $tokens, array $data = array(), array $opti * @param $delimiter * An optional string containing the character that separates the prefix from * the rest of the token. Defaults to ':'. + * * @return * An associative array of discovered tokens, with the prefix and delimiter * stripped from the key. @@ -230,6 +243,7 @@ function token_find_with_prefix(array $tokens, $prefix, $delimiter = ':') { * 'type' => 'user', * ); * @endcode + * * @return * An associative array of token information, grouped by token type. */ diff --git a/includes/unicode.entities.inc b/includes/unicode.entities.inc index 7b0a4909..3b1fbb69 100644 --- a/includes/unicode.entities.inc +++ b/includes/unicode.entities.inc @@ -1,5 +1,4 @@ <?php -// $Id: unicode.entities.inc,v 1.2 2009/04/26 15:14:55 dries Exp $ /** * @file diff --git a/includes/unicode.inc b/includes/unicode.inc index 12b80108..9dde2ca7 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -1,5 +1,4 @@ <?php -// $Id: unicode.inc,v 1.48 2010/12/28 18:21:58 webchick Exp $ /** * Indicates an error during check for PHP unicode support. @@ -170,7 +169,7 @@ function unicode_requirements() { * This is also where unsupported encodings will be converted. Callers should * take this into account: $data might have been changed after the call. * - * @param &$data + * @param $data * The XML data which will be parsed later. * * @return @@ -221,7 +220,7 @@ function drupal_xml_parser_create(&$data) { * @param $data * The data to be converted. * @param $encoding - * The encoding that the data is in + * The encoding that the data is in. * * @return * Converted data or FALSE. diff --git a/includes/update.inc b/includes/update.inc index 3932bb88..192aa1aa 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -1,5 +1,4 @@ <?php -// $Id: update.inc,v 1.87 2011/01/03 18:03:54 webchick Exp $ /** * @file diff --git a/includes/updater.inc b/includes/updater.inc index ebdd2bc3..363c6ebf 100644 --- a/includes/updater.inc +++ b/includes/updater.inc @@ -1,5 +1,4 @@ <?php -// $Id: updater.inc,v 1.8 2011/01/02 23:28:16 webchick Exp $ /** * @file diff --git a/includes/utility.inc b/includes/utility.inc index 38e7e40c..254313f7 100644 --- a/includes/utility.inc +++ b/includes/utility.inc @@ -1,5 +1,4 @@ <?php -// $Id: utility.inc,v 1.2 2010/07/24 17:28:25 dries Exp $ /** * @file diff --git a/includes/xmlrpc.inc b/includes/xmlrpc.inc index fccc105d..92e5d14f 100644 --- a/includes/xmlrpc.inc +++ b/includes/xmlrpc.inc @@ -1,5 +1,4 @@ <?php -// $Id: xmlrpc.inc,v 1.69 2010/08/14 03:15:01 dries Exp $ /** * @file diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc index b1b2f9f2..70c7cdac 100644 --- a/includes/xmlrpcs.inc +++ b/includes/xmlrpcs.inc @@ -1,5 +1,4 @@ <?php -// $Id: xmlrpcs.inc,v 1.42 2010/10/02 01:22:41 dries Exp $ /** * @file @@ -337,7 +336,7 @@ function xmlrpc_server_get_capabilities() { } /** - * Returns the method signature of a function. + * Returns one method signature for a function. * * This is the function mapped to the XML-RPC method system.methodSignature. * @@ -349,8 +348,8 @@ function xmlrpc_server_get_capabilities() { * Name of method to return a method signature for. * * @return array - * An array of types representing the method signature of the function that - * $methodname maps to. + * An array of arrays of types, each of the arrays representing one method + * signature of the function that $methodname maps to. */ function xmlrpc_server_method_signature($methodname) { $xmlrpc_server = xmlrpc_server_get(); @@ -365,7 +364,7 @@ function xmlrpc_server_method_signature($methodname) { foreach ($xmlrpc_server->signatures[$methodname] as $type) { $return[] = $type; } - return $return; + return array($return); } /** diff --git a/index.php b/index.php index ea72099b..ca337382 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,4 @@ <?php -// $Id: index.php,v 1.99 2009/10/15 14:07:25 dries Exp $ /** * @file diff --git a/install.php b/install.php index 4b6c677c..881ca5a8 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,4 @@ <?php -// $Id: install.php,v 1.238 2010/10/22 02:53:19 webchick Exp $ /** * @file diff --git a/misc/ajax.js b/misc/ajax.js index f20d563a..fb03e2b3 100644 --- a/misc/ajax.js +++ b/misc/ajax.js @@ -1,26 +1,25 @@ -// $Id: ajax.js,v 1.35 2010/12/23 04:26:31 webchick Exp $ (function ($) { /** - * Provides AJAX page updating via jQuery $.ajax (Asynchronous JavaScript and XML). + * Provides Ajax page updating via jQuery $.ajax (Asynchronous JavaScript and XML). * - * AJAX is a method of making a request via Javascript while viewing an HTML + * Ajax is a method of making a request via JavaScript while viewing an HTML * page. The request returns an array of commands encoded in JSON, which is * then executed to make any changes that are necessary to the page. * * Drupal uses this file to enhance form elements with #ajax['path'] and * #ajax['wrapper'] properties. If set, this file will automatically be included - * to provide AJAX capabilities. + * to provide Ajax capabilities. */ Drupal.ajax = Drupal.ajax || {}; /** - * Attaches the AJAX behavior to each AJAX form element. + * Attaches the Ajax behavior to each Ajax form element. */ Drupal.behaviors.AJAX = { attach: function (context, settings) { - // Load all AJAX behaviors specified in the settings. + // Load all Ajax behaviors specified in the settings. for (var base in settings.ajax) { if (!$('#' + base + '.ajax-processed').length) { var element_settings = settings.ajax[base]; @@ -37,7 +36,7 @@ Drupal.behaviors.AJAX = { } } - // Bind AJAX behaviors to all items showing the class. + // Bind Ajax behaviors to all items showing the class. $('.use-ajax:not(.ajax-processed)').addClass('ajax-processed').each(function () { var element_settings = {}; // Clicked links look better with the throbber than the progress bar. @@ -53,11 +52,11 @@ Drupal.behaviors.AJAX = { Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); }); - // This class means to submit the form to the action using AJAX. + // This class means to submit the form to the action using Ajax. $('.use-ajax-submit:not(.ajax-processed)').addClass('ajax-processed').each(function () { var element_settings = {}; - // AJAX submits specified in this manner automatically submit to the + // Ajax submits specified in this manner automatically submit to the // normal form action. element_settings.url = $(this.form).attr('action'); // Form submit button clicks need to tell the form what was clicked so @@ -75,13 +74,13 @@ Drupal.behaviors.AJAX = { }; /** - * AJAX object. + * Ajax object. * - * All AJAX objects on a page are accessible through the global Drupal.ajax + * All Ajax objects on a page are accessible through the global Drupal.ajax * object and are keyed by the submit button's ID. You can access them from * your module's JavaScript file to override properties or functions. * - * For example, if your AJAX enabled button has the ID 'edit-submit', you can + * For example, if your Ajax enabled button has the ID 'edit-submit', you can * redefine the function that is called to insert the new content like this * (inside a Drupal.behaviors attach block): * @code @@ -134,7 +133,7 @@ Drupal.ajax = function (base, element, element_settings) { this.wrapper = '#' + element_settings.wrapper; // If there isn't a form, jQuery.ajax() will be used instead, allowing us to - // bind AJAX to links as well. + // bind Ajax to links as well. if (this.element.form) { this.form = $(this.element.form); } @@ -179,7 +178,7 @@ Drupal.ajax = function (base, element, element_settings) { return ajax.eventResponse(this, event); }); - // If necessary, enable keyboard submission so that AJAX behaviors + // If necessary, enable keyboard submission so that Ajax behaviors // can be triggered through keyboard input as well as e.g. a mousedown // action. if (element_settings.keypress) { @@ -192,7 +191,7 @@ Drupal.ajax = function (base, element, element_settings) { /** * Handle a key press. * - * The AJAX object will, if instructed, bind to a key press response. This + * The Ajax object will, if instructed, bind to a key press response. This * will test to see if the key press is valid to trigger this event and * if it is, trigger it for us and prevent other keypresses from triggering. * In this case we're handling RETURN and SPACEBAR keypresses (event codes 13 @@ -214,10 +213,10 @@ Drupal.ajax.prototype.keypressResponse = function (element, event) { }; /** - * Handle an event that triggers an AJAX response. + * Handle an event that triggers an Ajax response. * - * When an event that triggers an AJAX response happens, this method will - * perform the actual AJAX call. It is bound to the event using + * When an event that triggers an Ajax response happens, this method will + * perform the actual Ajax call. It is bound to the event using * bind() in the constructor, and it uses the options specified on the * ajax object. */ @@ -315,23 +314,41 @@ Drupal.ajax.prototype.beforeSubmit = function (form_values, element, options) { } /** - * Prepare the AJAX request before it is sent. + * Prepare the Ajax request before it is sent. */ Drupal.ajax.prototype.beforeSend = function (xmlhttprequest, options) { + // For forms without file inputs, the jQuery Form plugin serializes the form + // values, and then calls jQuery's $.ajax() function, which invokes this + // handler. In this circumstance, options.extraData is never used. For forms + // with file inputs, the jQuery Form plugin uses the browser's normal form + // submission mechanism, but captures the response in a hidden IFRAME. In this + // circumstance, it calls this handler first, and then appends hidden fields + // to the form to submit the values in options.extraData. There is no simple + // way to know which submission mechanism will be used, so we add to extraData + // regardless, and allow it to be ignored in the former case. + if (this.form) { + options.extraData = options.extraData || {}; + + // Let the server know when the IFRAME submission mechanism is used. The + // server can use this information to wrap the JSON response in a TEXTAREA, + // as per http://jquery.malsup.com/form/#file-upload. + options.extraData.ajax_iframe_upload = '1'; + + // The triggering element is about to be disabled (see below), but if it + // contains a value (e.g., a checkbox, textfield, select, etc.), ensure that + // value is included in the submission. As per above, submissions that use + // $.ajax() are already serialized prior to the element being disabled, so + // this is only needed for IFRAME submissions. + var v = $.fieldValue(this.element); + if (v !== null) { + options.extraData[this.element.name] = v; + } + } + // Disable the element that received the change to prevent user interface - // interaction while the AJAX request is in progress. ajax.ajaxing prevents + // interaction while the Ajax request is in progress. ajax.ajaxing prevents // the element from triggering a new request, but does not prevent the user // from changing its value. - // Forms without file inputs are already serialized before this function is - // called. Forms with file inputs use an IFRAME to perform a POST request - // similar to a browser, so disabled elements are not contained in the - // submitted values. Therefore, we manually add the element's value to - // options.extraData. - var v = $.fieldValue(this.element); - if (v !== null) { - options.extraData = options.extraData || {}; - options.extraData[this.element.name] = v; - } $(this.element).addClass('progress-disabled').attr('disabled', true); // Insert progressbar or throbber. @@ -470,7 +487,7 @@ Drupal.ajax.prototype.commands = { // sufficiently tested whether attachBehaviors() can be successfully called // with a context object that includes top-level text nodes. However, to // give developers full control of the HTML appearing in the page, and to - // enable AJAX content to be inserted in places where DIV elements are not + // enable Ajax content to be inserted in places where DIV elements are not // allowed (e.g., within TABLE, TR, and SPAN parents), we check if the new // content satisfies the requirement of a single top-level element, and // only use the container DIV created above when it doesn't. For more diff --git a/misc/authorize.js b/misc/authorize.js index 904a6e19..66b78979 100644 --- a/misc/authorize.js +++ b/misc/authorize.js @@ -1,4 +1,3 @@ -// $Id: authorize.js,v 1.3 2010/01/04 16:08:52 webchick Exp $ /** * @file diff --git a/misc/autocomplete.js b/misc/autocomplete.js index 57f3be67..5e85be44 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -1,4 +1,3 @@ -// $Id: autocomplete.js,v 1.39 2010/11/20 07:49:56 webchick Exp $ (function ($) { /** diff --git a/misc/batch.js b/misc/batch.js index 2a4507d4..fee71a52 100644 --- a/misc/batch.js +++ b/misc/batch.js @@ -1,4 +1,3 @@ -// $Id: batch.js,v 1.10 2009/08/31 05:51:07 dries Exp $ (function ($) { /** diff --git a/misc/collapse.js b/misc/collapse.js index c9cde7fd..1a98dc0e 100644 --- a/misc/collapse.js +++ b/misc/collapse.js @@ -1,4 +1,3 @@ -// $Id: collapse.js,v 1.32 2010/05/14 16:45:56 dries Exp $ (function ($) { /** diff --git a/misc/drupal.js b/misc/drupal.js index 9695f5da..3cebbd28 100644 --- a/misc/drupal.js +++ b/misc/drupal.js @@ -1,4 +1,3 @@ -// $Id: drupal.js,v 1.72 2011/01/01 04:11:39 webchick Exp $ var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} }; @@ -11,7 +10,7 @@ jQuery.noConflict(); * Attach all registered behaviors to a page element. * * Behaviors are event-triggered actions that attach to page elements, enhancing - * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors + * default non-JavaScript UIs. Behaviors are registered in the Drupal.behaviors * object using the method 'attach' and optionally also 'detach' as follows: * @code * Drupal.behaviors.behaviorName = { @@ -25,7 +24,7 @@ jQuery.noConflict(); * @endcode * * Drupal.attachBehaviors is added below to the jQuery ready event and so - * runs on initial page load. Developers implementing AHAH/AJAX in their + * runs on initial page load. Developers implementing AHAH/Ajax in their * solutions should also call this function after new page content has been * loaded, feeding in an element to be processed, in order to attach all * behaviors to the new content. @@ -61,7 +60,7 @@ Drupal.attachBehaviors = function (context, settings) { /** * Detach registered behaviors from a page element. * - * Developers implementing AHAH/AJAX in their solutions should call this + * Developers implementing AHAH/Ajax in their solutions should call this * function before page content is about to be removed, feeding in an element * to be processed, in order to allow special behaviors to detach from the * content. @@ -89,7 +88,7 @@ Drupal.attachBehaviors = function (context, settings) { * IFRAME elements reload their "src" when being moved within the DOM, * behaviors bound to IFRAME elements (like WYSIWYG editors) may need to * take some action. - * - serialize: When an AJAX form is submitted, this is called with the + * - serialize: When an Ajax form is submitted, this is called with the * form as the context. This provides every behavior within the form an * opportunity to ensure that the field elements have correct content * in them before the form is serialized. The canonical use-case is so @@ -302,7 +301,7 @@ Drupal.getSelection = function (element) { }; /** - * Build an error message from an AJAX response. + * Build an error message from an Ajax response. */ Drupal.ajaxError = function (xmlhttp, uri) { var statusCode, statusText, pathText, responseText, readyStateText, message; diff --git a/misc/farbtastic/farbtastic.css b/misc/farbtastic/farbtastic.css index 675a5c07..25a68ebf 100644 --- a/misc/farbtastic/farbtastic.css +++ b/misc/farbtastic/farbtastic.css @@ -1,4 +1,3 @@ -/* $Id: farbtastic.css,v 1.4 2010/04/28 20:08:38 dries Exp $ */ .farbtastic { position: relative; diff --git a/misc/farbtastic/farbtastic.js b/misc/farbtastic/farbtastic.js index 520f77fb..10c9e763 100644 --- a/misc/farbtastic/farbtastic.js +++ b/misc/farbtastic/farbtastic.js @@ -1,4 +1,3 @@ -// $Id: farbtastic.js,v 1.8 2010/01/25 17:02:47 dries Exp $ (function(e){e.fn.farbtastic=function(f){e.farbtastic(this,f);return this};e.farbtastic=function(f,l){f=e(f).get(0);return f.farbtastic||(f.farbtastic=new e._farbtastic(f,l))};e._farbtastic=function(f,l){var a=this;e(f).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');var k=e(".farbtastic",f);a.wheel=e(".wheel",f).get(0);a.radius=84;a.square=100;a.width=194;navigator.appVersion.match(/MSIE [0-6]\./)&& e("*",k).each(function(){if(this.currentStyle.backgroundImage!="none"){var b=this.currentStyle.backgroundImage;b=this.currentStyle.backgroundImage.substring(5,b.length-2);e(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+b+"')"})}});a.linkTo=function(b){typeof a.callback=="object"&&e(a.callback).unbind("keyup",a.updateValue);a.color=null;if(typeof b=="function")a.callback=b;else if(typeof b=="object"||typeof b=="string"){a.callback= e(b);a.callback.bind("keyup",a.updateValue);a.callback.get(0).value&&a.setColor(a.callback.get(0).value)}return this};a.updateValue=function(){this.value&&this.value!=a.color&&a.setColor(this.value)};a.setColor=function(b){var c=a.unpack(b);if(a.color!=b&&c){a.color=b;a.rgb=c;a.hsl=a.RGBToHSL(a.rgb);a.updateDisplay()}return this};a.setHSL=function(b){a.hsl=b;a.rgb=a.HSLToRGB(b);a.color=a.pack(a.rgb);a.updateDisplay();return this};a.widgetCoords=function(b){var c=e(a.wheel).offset();return{x:b.pageX- diff --git a/misc/form.js b/misc/form.js index e5961f2e..259b84eb 100644 --- a/misc/form.js +++ b/misc/form.js @@ -1,4 +1,3 @@ -// $Id: form.js,v 1.15 2010/04/09 12:24:53 dries Exp $ (function ($) { /** diff --git a/misc/jquery.ba-bbq.js b/misc/jquery.ba-bbq.js index 10b0b029..deb9a2fa 100644 --- a/misc/jquery.ba-bbq.js +++ b/misc/jquery.ba-bbq.js @@ -1,4 +1,3 @@ -// $Id: jquery.ba-bbq.js,v 1.3 2010/05/26 11:55:15 dries Exp $ /* * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 diff --git a/misc/jquery.cookie.js b/misc/jquery.cookie.js index 9072d9f4..79f514c2 100644 --- a/misc/jquery.cookie.js +++ b/misc/jquery.cookie.js @@ -1,4 +1,3 @@ -// $Id: jquery.cookie.js,v 1.1 2009/07/01 12:16:48 dries Exp $ /** * Cookie plugin 1.0 diff --git a/misc/jquery.form.js b/misc/jquery.form.js index 8457185f..7a6f1b29 100644 --- a/misc/jquery.form.js +++ b/misc/jquery.form.js @@ -1,4 +1,3 @@ -// $Id: jquery.form.js,v 1.7 2011/01/03 02:11:27 webchick Exp $ /*! * jQuery Form Plugin diff --git a/misc/jquery.js b/misc/jquery.js index 94031629..e900c19a 100644 --- a/misc/jquery.js +++ b/misc/jquery.js @@ -1,4 +1,3 @@ -// $Id: jquery.js,v 1.20 2010/11/12 01:36:08 webchick Exp $ /*! * jQuery JavaScript Library v1.4.4 diff --git a/misc/jquery.once.js b/misc/jquery.once.js index fe2bca7a..506fb486 100644 --- a/misc/jquery.once.js +++ b/misc/jquery.once.js @@ -1,4 +1,3 @@ -// $Id: jquery.once.js,v 1.1 2009/08/31 15:52:26 webchick Exp $ /** * jQuery Once Plugin v1.2 diff --git a/misc/machine-name.js b/misc/machine-name.js index 7d0c0bc5..00a648a1 100644 --- a/misc/machine-name.js +++ b/misc/machine-name.js @@ -1,4 +1,3 @@ -// $Id: machine-name.js,v 1.2 2010/11/22 00:05:58 dries Exp $ (function ($) { /** diff --git a/misc/print-rtl.css b/misc/print-rtl.css index ceae5961..f99287a5 100644 --- a/misc/print-rtl.css +++ b/misc/print-rtl.css @@ -1,4 +1,3 @@ -/* $Id: print-rtl.css,v 1.1 2007/06/10 08:55:55 goba Exp $ */ body { direction: rtl; diff --git a/misc/print.css b/misc/print.css index c2c22cdc..0a56ef13 100644 --- a/misc/print.css +++ b/misc/print.css @@ -1,4 +1,3 @@ -/* $Id: print.css,v 1.6 2007/06/10 08:55:55 goba Exp $ */ body { margin: 1em; diff --git a/misc/progress.js b/misc/progress.js index adaa2ff6..822666af 100644 --- a/misc/progress.js +++ b/misc/progress.js @@ -1,4 +1,3 @@ -// $Id: progress.js,v 1.27 2010/09/09 21:05:11 dries Exp $ (function ($) { /** diff --git a/misc/states.js b/misc/states.js index 1f99a8c6..ec070c9a 100644 --- a/misc/states.js +++ b/misc/states.js @@ -1,4 +1,3 @@ -// $Id: states.js,v 1.5 2010/12/06 16:10:29 webchick Exp $ (function ($) { /** @@ -363,7 +362,12 @@ states.State.prototype = { $(document).bind('state:required', function(e) { if (e.trigger) { - $(e.target).closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-required'); + if (e.value) { + $(e.target).closest('.form-item, .form-wrapper').find('label').append('<span class="form-required">*</span>'); + } + else { + $(e.target).closest('.form-item, .form-wrapper').find('label .form-required').remove(); + } } }); diff --git a/misc/tabledrag.js b/misc/tabledrag.js index ccb9f349..b566168c 100644 --- a/misc/tabledrag.js +++ b/misc/tabledrag.js @@ -1,4 +1,3 @@ -// $Id: tabledrag.js,v 1.42 2010/09/11 00:03:41 webchick Exp $ (function ($) { /** @@ -1080,7 +1079,7 @@ Drupal.tableDrag.prototype.row.prototype.indent = function (indentDiff) { /** * Find all siblings for a row, either according to its subgroup or indentation. - * Note that the passed in row is included in the list of siblings. + * Note that the passed-in row is included in the list of siblings. * * @param settings * The field settings we're using to identify what constitutes a sibling. diff --git a/misc/tableheader.js b/misc/tableheader.js index a377bd9c..949ef521 100644 --- a/misc/tableheader.js +++ b/misc/tableheader.js @@ -1,4 +1,3 @@ -// $Id: tableheader.js,v 1.32 2010/07/28 01:38:28 dries Exp $ (function ($) { /** diff --git a/misc/tableselect.js b/misc/tableselect.js index 472e1f85..a50110e9 100644 --- a/misc/tableselect.js +++ b/misc/tableselect.js @@ -1,9 +1,8 @@ -// $Id: tableselect.js,v 1.13 2009/08/31 05:51:08 dries Exp $ (function ($) { Drupal.behaviors.tableSelect = { attach: function (context, settings) { - $('form table:has(th.select-all)', context).once('table-select', Drupal.tableSelect); + $('table:has(th.select-all)', context).once('table-select', Drupal.tableSelect); } }; diff --git a/misc/textarea.js b/misc/textarea.js index 3582f4e7..0ab5e712 100644 --- a/misc/textarea.js +++ b/misc/textarea.js @@ -1,4 +1,3 @@ -// $Id: textarea.js,v 1.31 2010/03/09 11:45:37 dries Exp $ (function ($) { Drupal.behaviors.textarea = { diff --git a/misc/timezone.js b/misc/timezone.js index 7c2db906..54497304 100644 --- a/misc/timezone.js +++ b/misc/timezone.js @@ -1,4 +1,3 @@ -// $Id: timezone.js,v 1.7 2009/08/31 05:51:08 dries Exp $ (function ($) { /** diff --git a/misc/ui/jquery.effects.blind.min.js b/misc/ui/jquery.effects.blind.min.js index f76085c1..ed7c74f1 100644 --- a/misc/ui/jquery.effects.blind.min.js +++ b/misc/ui/jquery.effects.blind.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.blind.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Blind 1.8.7 diff --git a/misc/ui/jquery.effects.bounce.min.js b/misc/ui/jquery.effects.bounce.min.js index a90de0d3..ca63813f 100644 --- a/misc/ui/jquery.effects.bounce.min.js +++ b/misc/ui/jquery.effects.bounce.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.bounce.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Bounce 1.8.7 diff --git a/misc/ui/jquery.effects.clip.min.js b/misc/ui/jquery.effects.clip.min.js index 4824d1b3..75966ec4 100644 --- a/misc/ui/jquery.effects.clip.min.js +++ b/misc/ui/jquery.effects.clip.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.clip.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Clip 1.8.7 diff --git a/misc/ui/jquery.effects.core.min.js b/misc/ui/jquery.effects.core.min.js index bd571202..40c15504 100644 --- a/misc/ui/jquery.effects.core.min.js +++ b/misc/ui/jquery.effects.core.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.core.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects 1.8.7 diff --git a/misc/ui/jquery.effects.drop.min.js b/misc/ui/jquery.effects.drop.min.js index 2b258de7..37a034d3 100644 --- a/misc/ui/jquery.effects.drop.min.js +++ b/misc/ui/jquery.effects.drop.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.drop.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Drop 1.8.7 diff --git a/misc/ui/jquery.effects.explode.min.js b/misc/ui/jquery.effects.explode.min.js index cb55bc52..726f3d5b 100644 --- a/misc/ui/jquery.effects.explode.min.js +++ b/misc/ui/jquery.effects.explode.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.explode.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Explode 1.8.7 diff --git a/misc/ui/jquery.effects.fade.min.js b/misc/ui/jquery.effects.fade.min.js index 1fde384a..71127f9a 100644 --- a/misc/ui/jquery.effects.fade.min.js +++ b/misc/ui/jquery.effects.fade.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.fade.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Fade 1.8.7 diff --git a/misc/ui/jquery.effects.fold.min.js b/misc/ui/jquery.effects.fold.min.js index e3b95d09..ccc6b294 100644 --- a/misc/ui/jquery.effects.fold.min.js +++ b/misc/ui/jquery.effects.fold.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.fold.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Fold 1.8.7 diff --git a/misc/ui/jquery.effects.highlight.min.js b/misc/ui/jquery.effects.highlight.min.js index 780d15a3..0ed3d898 100644 --- a/misc/ui/jquery.effects.highlight.min.js +++ b/misc/ui/jquery.effects.highlight.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.highlight.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Highlight 1.8.7 diff --git a/misc/ui/jquery.effects.pulsate.min.js b/misc/ui/jquery.effects.pulsate.min.js index 1757640f..658d8d03 100644 --- a/misc/ui/jquery.effects.pulsate.min.js +++ b/misc/ui/jquery.effects.pulsate.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.pulsate.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Pulsate 1.8.7 diff --git a/misc/ui/jquery.effects.scale.min.js b/misc/ui/jquery.effects.scale.min.js index 16acd628..206ef12f 100644 --- a/misc/ui/jquery.effects.scale.min.js +++ b/misc/ui/jquery.effects.scale.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.scale.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Scale 1.8.7 diff --git a/misc/ui/jquery.effects.shake.min.js b/misc/ui/jquery.effects.shake.min.js index 50d62b3c..44542f32 100644 --- a/misc/ui/jquery.effects.shake.min.js +++ b/misc/ui/jquery.effects.shake.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.shake.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Shake 1.8.7 diff --git a/misc/ui/jquery.effects.slide.min.js b/misc/ui/jquery.effects.slide.min.js index 9949129e..94f5906f 100644 --- a/misc/ui/jquery.effects.slide.min.js +++ b/misc/ui/jquery.effects.slide.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.slide.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Slide 1.8.7 diff --git a/misc/ui/jquery.effects.transfer.min.js b/misc/ui/jquery.effects.transfer.min.js index 94bc8dca..0addaa8b 100644 --- a/misc/ui/jquery.effects.transfer.min.js +++ b/misc/ui/jquery.effects.transfer.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.effects.transfer.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Effects Transfer 1.8.7 diff --git a/misc/ui/jquery.ui.accordion.css b/misc/ui/jquery.ui.accordion.css index 3d470e09..fcd7c55d 100644 --- a/misc/ui/jquery.ui.accordion.css +++ b/misc/ui/jquery.ui.accordion.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.accordion.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */ /* * jQuery UI Accordion 1.8.7 diff --git a/misc/ui/jquery.ui.accordion.min.js b/misc/ui/jquery.ui.accordion.min.js index 402f6a28..0e0ee39a 100644 --- a/misc/ui/jquery.ui.accordion.min.js +++ b/misc/ui/jquery.ui.accordion.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.accordion.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Accordion 1.8.7 diff --git a/misc/ui/jquery.ui.autocomplete.css b/misc/ui/jquery.ui.autocomplete.css index b0c8b96b..80a5789e 100644 --- a/misc/ui/jquery.ui.autocomplete.css +++ b/misc/ui/jquery.ui.autocomplete.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.autocomplete.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */ /* * jQuery UI Autocomplete 1.8.7 diff --git a/misc/ui/jquery.ui.autocomplete.min.js b/misc/ui/jquery.ui.autocomplete.min.js index f243dada..9983ec77 100644 --- a/misc/ui/jquery.ui.autocomplete.min.js +++ b/misc/ui/jquery.ui.autocomplete.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.autocomplete.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Autocomplete 1.8.7 diff --git a/misc/ui/jquery.ui.button.css b/misc/ui/jquery.ui.button.css index ca824789..973c3145 100644 --- a/misc/ui/jquery.ui.button.css +++ b/misc/ui/jquery.ui.button.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.button.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */ /* * jQuery UI Button 1.8.7 diff --git a/misc/ui/jquery.ui.button.min.js b/misc/ui/jquery.ui.button.min.js index ee04bcb4..26366aa4 100644 --- a/misc/ui/jquery.ui.button.min.js +++ b/misc/ui/jquery.ui.button.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.button.min.js,v 1.3 2011/01/03 00:03:34 webchick Exp $ /* * jQuery UI Button 1.8.7 diff --git a/misc/ui/jquery.ui.core.css b/misc/ui/jquery.ui.core.css index f5acbf0c..d436225e 100644 --- a/misc/ui/jquery.ui.core.css +++ b/misc/ui/jquery.ui.core.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.core.css,v 1.3 2011/01/03 00:03:34 webchick Exp $ */ /* * jQuery UI CSS Framework 1.8.7 diff --git a/misc/ui/jquery.ui.core.min.js b/misc/ui/jquery.ui.core.min.js index 87769b48..976e056f 100644 --- a/misc/ui/jquery.ui.core.min.js +++ b/misc/ui/jquery.ui.core.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.core.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /*! * jQuery UI 1.8.7 diff --git a/misc/ui/jquery.ui.datepicker.css b/misc/ui/jquery.ui.datepicker.css index b7fbb522..a9048840 100644 --- a/misc/ui/jquery.ui.datepicker.css +++ b/misc/ui/jquery.ui.datepicker.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.datepicker.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI Datepicker 1.8.7 diff --git a/misc/ui/jquery.ui.datepicker.min.js b/misc/ui/jquery.ui.datepicker.min.js index 03de55ee..11af4811 100644 --- a/misc/ui/jquery.ui.datepicker.min.js +++ b/misc/ui/jquery.ui.datepicker.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.datepicker.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Datepicker 1.8.7 diff --git a/misc/ui/jquery.ui.dialog.css b/misc/ui/jquery.ui.dialog.css index e167b663..156e03ac 100644 --- a/misc/ui/jquery.ui.dialog.css +++ b/misc/ui/jquery.ui.dialog.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.dialog.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI Dialog 1.8.7 diff --git a/misc/ui/jquery.ui.dialog.min.js b/misc/ui/jquery.ui.dialog.min.js index dcbe845c..d60151c2 100644 --- a/misc/ui/jquery.ui.dialog.min.js +++ b/misc/ui/jquery.ui.dialog.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.dialog.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Dialog 1.8.7 diff --git a/misc/ui/jquery.ui.draggable.min.js b/misc/ui/jquery.ui.draggable.min.js index 28e072c2..59a74182 100644 --- a/misc/ui/jquery.ui.draggable.min.js +++ b/misc/ui/jquery.ui.draggable.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.draggable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Draggable 1.8.7 diff --git a/misc/ui/jquery.ui.droppable.min.js b/misc/ui/jquery.ui.droppable.min.js index a5e739b8..12efd10b 100644 --- a/misc/ui/jquery.ui.droppable.min.js +++ b/misc/ui/jquery.ui.droppable.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.droppable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Droppable 1.8.7 diff --git a/misc/ui/jquery.ui.mouse.min.js b/misc/ui/jquery.ui.mouse.min.js index dfa32c92..18057ebd 100644 --- a/misc/ui/jquery.ui.mouse.min.js +++ b/misc/ui/jquery.ui.mouse.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.mouse.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /*! * jQuery UI Mouse 1.8.7 diff --git a/misc/ui/jquery.ui.position.min.js b/misc/ui/jquery.ui.position.min.js index 5d47efbd..2e1451ef 100644 --- a/misc/ui/jquery.ui.position.min.js +++ b/misc/ui/jquery.ui.position.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.position.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Position 1.8.7 diff --git a/misc/ui/jquery.ui.progressbar.css b/misc/ui/jquery.ui.progressbar.css index 57a7a0bb..75610308 100644 --- a/misc/ui/jquery.ui.progressbar.css +++ b/misc/ui/jquery.ui.progressbar.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.progressbar.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI Progressbar 1.8.7 diff --git a/misc/ui/jquery.ui.progressbar.min.js b/misc/ui/jquery.ui.progressbar.min.js index 4ac85b62..7a8f0b79 100644 --- a/misc/ui/jquery.ui.progressbar.min.js +++ b/misc/ui/jquery.ui.progressbar.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.progressbar.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Progressbar 1.8.7 diff --git a/misc/ui/jquery.ui.resizable.css b/misc/ui/jquery.ui.resizable.css index f9585811..e0f15cc6 100644 --- a/misc/ui/jquery.ui.resizable.css +++ b/misc/ui/jquery.ui.resizable.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.resizable.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI Resizable 1.8.7 diff --git a/misc/ui/jquery.ui.resizable.min.js b/misc/ui/jquery.ui.resizable.min.js index 4cb39c61..4df6eb77 100644 --- a/misc/ui/jquery.ui.resizable.min.js +++ b/misc/ui/jquery.ui.resizable.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.resizable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Resizable 1.8.7 diff --git a/misc/ui/jquery.ui.selectable.css b/misc/ui/jquery.ui.selectable.css index 688d8ae9..1489dcf3 100644 --- a/misc/ui/jquery.ui.selectable.css +++ b/misc/ui/jquery.ui.selectable.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.selectable.css,v 1.2 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI Selectable 1.8.7 diff --git a/misc/ui/jquery.ui.selectable.min.js b/misc/ui/jquery.ui.selectable.min.js index d5402bdb..e2ec516e 100644 --- a/misc/ui/jquery.ui.selectable.min.js +++ b/misc/ui/jquery.ui.selectable.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.selectable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Selectable 1.8.7 diff --git a/misc/ui/jquery.ui.slider.css b/misc/ui/jquery.ui.slider.css index 319603d0..a56a5138 100644 --- a/misc/ui/jquery.ui.slider.css +++ b/misc/ui/jquery.ui.slider.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.slider.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI Slider 1.8.7 diff --git a/misc/ui/jquery.ui.slider.min.js b/misc/ui/jquery.ui.slider.min.js index 1867be18..dc36f15f 100644 --- a/misc/ui/jquery.ui.slider.min.js +++ b/misc/ui/jquery.ui.slider.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.slider.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Slider 1.8.7 diff --git a/misc/ui/jquery.ui.sortable.min.js b/misc/ui/jquery.ui.sortable.min.js index b394ed11..2cb1eaa5 100644 --- a/misc/ui/jquery.ui.sortable.min.js +++ b/misc/ui/jquery.ui.sortable.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.sortable.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Sortable 1.8.7 diff --git a/misc/ui/jquery.ui.tabs.css b/misc/ui/jquery.ui.tabs.css index c801d735..94420e18 100644 --- a/misc/ui/jquery.ui.tabs.css +++ b/misc/ui/jquery.ui.tabs.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.tabs.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI Tabs 1.8.7 diff --git a/misc/ui/jquery.ui.tabs.min.js b/misc/ui/jquery.ui.tabs.min.js index 6fe9fad1..aeb42bb4 100644 --- a/misc/ui/jquery.ui.tabs.min.js +++ b/misc/ui/jquery.ui.tabs.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.tabs.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /* * jQuery UI Tabs 1.8.7 diff --git a/misc/ui/jquery.ui.theme.css b/misc/ui/jquery.ui.theme.css index 32a1a2a7..1e622b46 100644 --- a/misc/ui/jquery.ui.theme.css +++ b/misc/ui/jquery.ui.theme.css @@ -1,4 +1,3 @@ -/* $Id: jquery.ui.theme.css,v 1.3 2011/01/03 00:03:35 webchick Exp $ */ /* * jQuery UI CSS Framework 1.8.7 diff --git a/misc/ui/jquery.ui.widget.min.js b/misc/ui/jquery.ui.widget.min.js index d4691991..165a272b 100644 --- a/misc/ui/jquery.ui.widget.min.js +++ b/misc/ui/jquery.ui.widget.min.js @@ -1,4 +1,3 @@ -// $Id: jquery.ui.widget.min.js,v 1.3 2011/01/03 00:03:35 webchick Exp $ /*! * jQuery UI Widget 1.8.7 diff --git a/misc/vertical-tabs-rtl.css b/misc/vertical-tabs-rtl.css index 5dc8c989..7fb0347d 100644 --- a/misc/vertical-tabs-rtl.css +++ b/misc/vertical-tabs-rtl.css @@ -1,4 +1,3 @@ -/* $Id: vertical-tabs-rtl.css,v 1.3 2010/10/07 15:54:13 webchick Exp $ */ div.vertical-tabs { margin-left: 0; diff --git a/misc/vertical-tabs.css b/misc/vertical-tabs.css index d350c8e6..10e81539 100644 --- a/misc/vertical-tabs.css +++ b/misc/vertical-tabs.css @@ -1,4 +1,3 @@ -/* $Id: vertical-tabs.css,v 1.8 2010/10/07 15:54:13 webchick Exp $ */ div.vertical-tabs { margin: 1em 0 1em 15em; /* LTR */ diff --git a/misc/vertical-tabs.js b/misc/vertical-tabs.js index 73599531..82dcd2c6 100644 --- a/misc/vertical-tabs.js +++ b/misc/vertical-tabs.js @@ -1,4 +1,3 @@ -// $Id: vertical-tabs.js,v 1.14 2010/07/24 16:56:31 dries Exp $ (function ($) { diff --git a/misc/watchdog-error.png b/misc/watchdog-error.png index f7e60e5238ee0f613c73d556f69f7ff52be7a8bb..db05365aa51c5d77ebdf732aa642d94da8613f25 100644 GIT binary patch delta 756 zcmV<Q0t@|z28;%fB!AOML_t(I%axPaOB+!b#pl^4(YS9U3MvM~s9@a2Jt}T-c~K!E zxS=RQM8Tnvnt+OmphbgOG^LP#LD~nOT9B&rp->+Rni#dx)-4)+I{jua(~PF2J#ZQB z%-rAo?)lDTm>{xPEbQ9anqhf)8H<aHn4O)4$z(E2O--@Pzkg_BV}rHXY%rV6ct1Ld zubrLnYBc!L+KR2NE^r)&iHQm5^?LSikYT&s4p&bP?wgu$S67GI>T29nRN%U#1eb+{ zxX8=HKFvo)MtIn8&`M~)-P?<Mtrouedfe93z*|{~>(WwO6&2w^t;WyXTzt>U!bh6- z_4PfkY;$uHZh!jl(A*5ae0n`@%F1w6T#U>7d|dbUi{H-E)A1oE2RfY&BE;cvuvV)T z4=pY5H8vtpM*{=6EGUpbcuhw{;8dYNM@I*gN+l<N$QQ%T__*kcZ){Am=xlCIGI!8_ zFJ&^EBqhN{$7Na8Nf;TkzP^sb?rw=MuE9YB6Azgt$bVi!0zC2Y*iKDFBb|akY0T>C zDtrwMxT~#&x2j6?<!pXl0@<3J6ppl)m<SJn+%Yk5(Y%gMK_D%&va%xP<)*wGS1b$f zA1d0VJb4Io92*N)WF+3n<*25J2%x2<CBrtE>d%XJXh>QKg)mSD6c2Y)6pq5f@k*&g zc6PQ?0DmnkEU+^(Gh$u>^_t>fq(!@JZIbspVPQB74Mi1MA(zWJ!6RNqqY<CUrwhu< zQ^-D*e?sGc;^EhekPvLe#i5M+6sqC7#*0rVe~&)V4nI^Xn8*WTbTsxUD|}x3zU)xP z3<MdVYRbt^g+jqSf_{s?J2bFMW}jzd;2X8}G;KLq$jdS9?)T*_b*zH?%*@QRJc9(l z*g@(Te~;eKjvn%i&kO%F(;cg&h*VO}f>shtDwT@UXf)3D_I9+9(M=RYwOZ{=NlEbo mw9J1<_Sg+=z(^B~eWG7>{A$IwwQ6nv0000<MNUMnLSTZ9pLEXv delta 751 zcmV<L0ucR-28RZaB!A9HL_t(|+KrRhOB+!X#`ElxXxujv1r-BgqF~}O?on}z%S#j# z!6iftLPWu#k(z*til9Y<F=|R7|AMp+KD8iK=|e#u3Yr+T($*!>=+oCTLo-a!wtjF3 zcP8_@=YHqAlIP@bIGEMdRm;-S5*8K~Ff%g)o6TmKoSbANFMrYI<|gBGI$^il@o{7X z-@3XG&}wnm-j3~_9<VHn@$qq(&1U9bkl~Gu4S4$c@X*qN`-TSG)z-paRfXHKGF%rI z<EpR_2edYsOdM?Z*-oh7?eE8fPKRJ)Bkt<z5U8%kZFxCvN=k60R^wMe0e<A=;WMoV z1_qvXwzahdFMqvwY;8qIL9-eDiVED6mf~8Y!R_E6Lb}Y(#;5#zba!_{fVf;PW_^7f zk8N!THaA186N3TQMMXSBtf`n7oXh3t?CgX>p<sCs`C{1}8xwp9j*ddCi`iL-<)Z(+ zmP&D!mIfysmthz;VWg6^wKW{~_J;Z5F&ZJ37&1kW{eP4c_>z;clbMNTIt78UBr7W` z2sSn0zP=uTni|2Ei@7<7wLLMxA89`|6+Qxa6B6K|bpxG(Ksw3t^0JT@e`O_Z7zTmA zbhJl#@)77XF%h2FSbUJlP)iZvL5quvmK}pZ$V*^oD7+I2p;$*04{ux?PNJjnMxlU8 zrE>G2`G5I&W_o&B$ctESDGpZpXs@FKV(msn;W#o9HDrZMCS!SzI9aV$d?lZ*G@2)n z18V<_>WJbI(yNFFY$qk5g8byV;itxlODK1bzR(Uol}gyi18aOd4k#;>7r~cZnwW(k z2I{7g{FKY(EDsWkyE|0aBeO4aa`2r-d!C-o=V;}Wb`SaTo+egBe&*)pI>I60Fve&! z^7rT+?dT)VC@=i4o$gpYMWmW?CUo*YDV0iAtJS*odObSG=oSj1TCH|xWMqT@R4<qG h&op$R%Hp3tqu+M?YQ;)-$Tt80002ovPDHLkV1lr2YybcN diff --git a/misc/watchdog-ok.png b/misc/watchdog-ok.png index 6ebea3e53d5fd889eb4ada215506c6e0e48b48bf..1d7baa06e2d09c704e47d4955a763066398e932c 100644 GIT binary patch literal 375 zcmV--0f_#IP)<h;3K|Lk000e1NJLTq000sI000sQ1^@s6R?d!B0003#Nkl<ZILl*T z7!+WIOg|9crqqz>K>VL!vGfTbPm^3j+QEh_mA=Q|!Q%xKQ6<NaY_K8AWxg<^3noBa z!$zth#b85L$oyo;7tR2R=m9Y|sfL6=4f)SdCt3{@(FbB)QVp>L;?H11y2K{{MGSyg zkW@oNfcOH~kg1X@poWOyQp^g(ia^YUMQ$G0kcHCc8HAZlfg&>aY@GyFyi8^V(Elt* z;*ro8`p%Fn5Ce^7MtlZcfd}Li$qumM6*AmFd=V@*Nn$ZHhPViYgFoD$r7~|BT)0(% z>>{Wu-!QoIcmh>P6BnrSq}t$y&63&%r0;{--QtsgvO2^kx)n0QK--_g4THGmErTPs z8&Fo9w5VPxU5H{(zr-x4YgkE5GpxYeyd4-zKN;prorStalH39U6upYjSW+d{H2?sW Vcv8)9RPO))002ovPDHLkV1jaCo!<Ze literal 409 zcmV;K0cQS*P)<h;3K|Lk000e1NJLTq000pH000pP1^@s6J8eh$0004CNkl<Zc-ozk zKTE@45Qk5+8B7IB)HHdsbjToxx;Qur;=jekMQ{)t6dXhy1xFPfDnTi9s7Q$B6X;iP z5f$779bI%%kWR0^94{dfHED+@IdXT;d&z~Qlx;zwQw2{Pw<)LrNxrxtqQQ0q`z#2= zGtCs|AaPq2th3<K`J~m-ax?|dS`lmm37WKFtf6@r=$y+bSOAjQ?cYK32<VCPIRxY2 zg9V4?F`7p~DOr;x=mYmGIJH707)aHjpa3dB`$f`V!MV62qjL<^j>@GZ9v5CXA>Owu zAy`zK_@b5GrD&C)<1fi0kj#m75EUZU!2>_@%D&n}cS?|u%*T?zd8bL;MZBe^d!y;% zEULu6-;OU0doLE%?JL}0I6g8x2!?=`DM5pQQ(t2dPl2f>^eG6;%-<jm0<rl+QZ3ij z6ouRpUbQc-v5h93*|%y6i}N`pOtcwLQQL4cr%-$Yp|OBwC+{L*00000NkvXXu0mjf Deb%b2 diff --git a/misc/watchdog-warning.png b/misc/watchdog-warning.png index 5d33a512ee78ecd82a36763d4588ffa9ba45b767..d8dced8890f22165848acc20297fdb93fc2a77ff 100644 GIT binary patch literal 318 zcmV-E0m1%>P)<h;3K|Lk000e1NJLTq000sI000sQ1^@s6R?d!B00036Nkl<ZILl*T zpcj}vefob8rr3~E$GrcqS)uzsIy(A4MF#!($Oy(zgM7$y%^{!vf8R2K@tP%i<hcrD z(BBt~|LaR27{n&oRbbcb1G?r3(|-p`Mlc4k*DN5>RbbaVU;<+Y3q~-8@ria7*fqO= zuDQbm#t!C;U<~80nM0(jKnDH0!3@U^W{hBrEJn~(AVW@X^Zozt3Nsu#m@<Mfve?=g z`uJT1cFhH56kMOd1jgv%I9&yH%_g90&ae=L*G|FVDzIygvtVEcBStXBCWqlFuxr-( z{{MfN1p_-6GJ-KSxwZXht^ymh+VB7W{j4P6wY>&d!|Feo*ausn`;dtl0NW0KXl_Kc QhX4Qo07*qoM6N<$f(x6B%m4rY literal 319 zcmV-F0l@x=P)<h;3K|Lk000e1NJLTq000pH000pP1^@s6J8eh$00037Nkl<Zc-o!N zy=uZx6u|MEBtDMX7Fu<?yGdUlFW>`o&l8j`g>-Om=ul|x;^5$5L7|1};Nalk;NZ}u zL-*=w&J_;{N75u0esDkF@aI~2D~ci{R)xg_KHs|-ztk}Z0<1jb_Xo&nh*!R1>f!zy zjQF|1HKm5^zW~EKgZ5lgyke46>}*sWAZ8yAxTavm);3fd2%ov;-->Zkv9S%+0>bCG z&o%i&4r_<08zAXBQ6mP-M?M}_4pY}aGI#o^nW>Q#OD7}j*+krPji?wV6$`fz{dlaA z6(6pku7I3<;~K8eKH|(3)FqI!Z~7rsV}`umBEHp1(f1ePZ?GcING-1->kr*=e`ss| RHogD=002ovPDHLkV1j|ik2U}R diff --git a/modules/README.txt b/modules/README.txt index d0e7c9d9..8928d802 100644 --- a/modules/README.txt +++ b/modules/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.3 2009/10/08 01:44:22 dries Exp $ This directory is reserved for core module files. Custom or contributed modules should be placed in their own subdirectory of the sites/all/modules directory. diff --git a/modules/aggregator/aggregator-feed-source.tpl.php b/modules/aggregator/aggregator-feed-source.tpl.php index 267265e0..6a684bdb 100644 --- a/modules/aggregator/aggregator-feed-source.tpl.php +++ b/modules/aggregator/aggregator-feed-source.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: aggregator-feed-source.tpl.php,v 1.2 2008/05/15 21:27:32 dries Exp $ /** * @file diff --git a/modules/aggregator/aggregator-item.tpl.php b/modules/aggregator/aggregator-item.tpl.php index 5d6912fa..c5dd70c6 100644 --- a/modules/aggregator/aggregator-item.tpl.php +++ b/modules/aggregator/aggregator-item.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: aggregator-item.tpl.php,v 1.2 2008/05/15 21:27:32 dries Exp $ /** * @file diff --git a/modules/aggregator/aggregator-rtl.css b/modules/aggregator/aggregator-rtl.css index 7de7e651..ea59ca3a 100644 --- a/modules/aggregator/aggregator-rtl.css +++ b/modules/aggregator/aggregator-rtl.css @@ -1,4 +1,3 @@ -/* $Id: aggregator-rtl.css,v 1.1 2007/05/27 17:57:47 goba Exp $ */ #aggregator .feed-source .feed-icon { float: left; diff --git a/modules/aggregator/aggregator-summary-item.tpl.php b/modules/aggregator/aggregator-summary-item.tpl.php index 281aa2f8..1c829993 100644 --- a/modules/aggregator/aggregator-summary-item.tpl.php +++ b/modules/aggregator/aggregator-summary-item.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: aggregator-summary-item.tpl.php,v 1.2 2008/05/15 21:27:32 dries Exp $ /** * @file diff --git a/modules/aggregator/aggregator-summary-items.tpl.php b/modules/aggregator/aggregator-summary-items.tpl.php index eeb25982..0e2133a1 100644 --- a/modules/aggregator/aggregator-summary-items.tpl.php +++ b/modules/aggregator/aggregator-summary-items.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: aggregator-summary-items.tpl.php,v 1.4 2010/10/15 23:37:55 webchick Exp $ /** * @file diff --git a/modules/aggregator/aggregator-wrapper.tpl.php b/modules/aggregator/aggregator-wrapper.tpl.php index f49dce3d..80b90327 100644 --- a/modules/aggregator/aggregator-wrapper.tpl.php +++ b/modules/aggregator/aggregator-wrapper.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: aggregator-wrapper.tpl.php,v 1.3 2009/07/23 22:14:26 webchick Exp $ /** * @file diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc index 7534a9c2..08087afb 100644 --- a/modules/aggregator/aggregator.admin.inc +++ b/modules/aggregator/aggregator.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.admin.inc,v 1.54 2010/06/26 19:55:47 dries Exp $ /** * @file @@ -350,16 +349,17 @@ function aggregator_form_opml_submit($form, &$form_state) { /** * Parse an OPML file. * - * Feeds are recognized as <outline> elements with the attributes - * <em>text</em> and <em>xmlurl</em> set. + * Feeds are recognized as <outline> elements with the attributes "text" and + * "xmlurl" set. * * @param $opml * The complete contents of an OPML document. + * * @return - * An array of feeds, each an associative array with a <em>title</em> and - * a <em>url</em> element, or NULL if the OPML document failed to be parsed. - * An empty array will be returned if the document is valid but contains - * no feeds, as some OPML documents do. + * An array of feeds, each an associative array with a "title" and a "url" + * element, or NULL if the OPML document failed to be parsed. An empty + * array will be returned if the document is valid but contains no feeds, as + * some OPML documents do. */ function _aggregator_parse_opml($opml) { $feeds = array(); diff --git a/modules/aggregator/aggregator.api.php b/modules/aggregator/aggregator.api.php index 91f44c34..f31413c4 100644 --- a/modules/aggregator/aggregator.api.php +++ b/modules/aggregator/aggregator.api.php @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.api.php,v 1.7 2010/01/08 11:03:54 dries Exp $ /** * @file diff --git a/modules/aggregator/aggregator.css b/modules/aggregator/aggregator.css index b50fc8d4..13c58ffe 100644 --- a/modules/aggregator/aggregator.css +++ b/modules/aggregator/aggregator.css @@ -1,4 +1,3 @@ -/* $Id: aggregator.css,v 1.3 2010/04/28 20:08:38 dries Exp $ */ #aggregator .feed-source .feed-title { margin-top: 0; diff --git a/modules/aggregator/aggregator.fetcher.inc b/modules/aggregator/aggregator.fetcher.inc index 4695d994..0f728779 100644 --- a/modules/aggregator/aggregator.fetcher.inc +++ b/modules/aggregator/aggregator.fetcher.inc @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.fetcher.inc,v 1.12 2010/01/08 11:03:54 dries Exp $ /** * @file diff --git a/modules/aggregator/aggregator.info b/modules/aggregator/aggregator.info index b31da62c..667e77ce 100644 --- a/modules/aggregator/aggregator.info +++ b/modules/aggregator/aggregator.info @@ -1,4 +1,3 @@ -; $Id: aggregator.info,v 1.15 2010/12/20 19:59:40 webchick Exp $ name = Aggregator description = "Aggregates syndicated content (RSS, RDF, and Atom feeds)." package = Core @@ -8,8 +7,8 @@ files[] = aggregator.test configure = admin/config/services/aggregator/settings stylesheets[all][] = aggregator.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install index 8cc421b9..f19d7de9 100644 --- a/modules/aggregator/aggregator.install +++ b/modules/aggregator/aggregator.install @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.install,v 1.31 2010/08/22 13:55:53 dries Exp $ /** * @file diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 21b21f87..1e1686af 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.module,v 1.444 2010/09/24 00:37:41 dries Exp $ /** * @file @@ -27,9 +26,9 @@ function aggregator_help($path, $arg) { $output .= '<dt>' . t('Adding, editing, and deleting feeds') . '</dt>'; $output .= '<dd>' . t('Administrators can add, edit, and delete feeds, and choose how often to check each feed for newly updated items on the <a href="@feededit">Feed aggregator administration page</a>.', array('@feededit' => url('admin/config/services/aggregator'))) . '</dd>'; $output .= '<dt>' . t('OPML integration') . '</dt>'; - $output .= '<dd>' . t('A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. OPML is an XML-based file format used to share outline-structured information such as a list of RSS feeds. Feeds can also be <a href="@import-opml">imported via an OPML file</a>.', array('@aggregator-opml' => url('aggregator/opml'), '@import-opml' => url('admin/config/services/aggregator'))) . '</dd>'; + $output .= '<dd>' . t('A <a href="@aggregator-opml">machine-readable OPML file</a> of all feeds is available. OPML is an XML-based file format used to share outline-structured information such as a list of RSS feeds. Feeds can also be <a href="@import-opml">imported via an OPML file</a>.', array('@aggregator-opml' => url('aggregator/opml'), '@import-opml' => url('admin/config/services/aggregator'))) . '</dd>'; $output .= '<dt>' . t('Configuring cron') . '</dt>'; - $output .= '<dd>' . t('A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@cron' => 'http://drupal.org/cron')) . '</dd>'; + $output .= '<dd>' . t('A correctly configured <a href="@cron">cron maintenance task</a> is required to update feeds automatically.', array('@cron' => 'http://drupal.org/cron')) . '</dd>'; $output .= '</dl>'; return $output; case 'admin/config/services/aggregator': @@ -195,7 +194,6 @@ function aggregator_menu() { 'title arguments' => array(2), 'page callback' => 'aggregator_page_category', 'page arguments' => array(2), - 'access callback' => 'user_access', 'access arguments' => array('access news feeds'), 'file' => 'aggregator.pages.inc', ); @@ -268,7 +266,7 @@ function aggregator_menu() { } /** - * Menu callback. + * Title callback for aggregatory category pages. * * @return * An aggregator category title. @@ -281,7 +279,8 @@ function _aggregator_category_title($category) { * Find out whether there are any aggregator categories. * * @return - * TRUE if there is at least one category and the user has access to them, FALSE otherwise. + * TRUE if there is at least one category and the user has access to them, FALSE + * otherwise. */ function _aggregator_has_categories() { return user_access('access news feeds') && db_query('SELECT COUNT(*) FROM {aggregator_category}')->fetchField(); @@ -307,7 +306,7 @@ function aggregator_permission() { * Queues news feeds for updates once their refresh interval has elapsed. */ function aggregator_cron() { - $result = db_query('SELECT * FROM {aggregator_feed} WHERE queued = 0 AND checked + refresh < :time AND refresh != :never', array( + $result = db_query('SELECT * FROM {aggregator_feed} WHERE queued = 0 AND checked + refresh < :time AND refresh <> :never', array( ':time' => REQUEST_TIME, ':never' => AGGREGATOR_CLEAR_NEVER )); @@ -344,16 +343,16 @@ function aggregator_cron_queue_info() { * Implements hook_block_info(). */ function aggregator_block_info() { - $block = array(); + $blocks = array(); $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title'); foreach ($result as $category) { - $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title)); + $blocks['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title)); } $result = db_query('SELECT fid, title FROM {aggregator_feed} WHERE block <> 0 ORDER BY fid'); foreach ($result as $feed) { - $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title)); + $blocks['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title)); } - return $block; + return $blocks; } /** @@ -367,7 +366,7 @@ function aggregator_block_configure($delta = '') { '#type' => 'select', '#title' => t('Number of news items in block'), '#default_value' => $value, - '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)) + '#options' => drupal_map_assoc(range(2, 20)), ); return $form; } @@ -720,7 +719,8 @@ function aggregator_filter_xss($value) { /** * Check and sanitize aggregator configuration. * - * Goes through all fetchers, parsers and processors and checks whether they are available. + * Goes through all fetchers, parsers and processors and checks whether they are + * available. * If one is missing resets to standard configuration. * * @return diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc index 08c2de7c..53ecb368 100644 --- a/modules/aggregator/aggregator.pages.inc +++ b/modules/aggregator/aggregator.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.pages.inc,v 1.45 2010/10/15 23:37:55 webchick Exp $ /** * @file diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc index 2105aed7..cffd1c3a 100644 --- a/modules/aggregator/aggregator.parser.inc +++ b/modules/aggregator/aggregator.parser.inc @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.parser.inc,v 1.10 2010/07/24 17:42:22 dries Exp $ /** * @file @@ -125,7 +124,11 @@ function aggregator_parse_feed(&$data, $feed) { else { $item['link'] = $feed->link; } - $item['guid'] = isset($item['guid']) ? $item['guid'] : ''; + + // Atom feeds have an ID tag instead of a GUID tag. + if (!isset($item['guid'])) { + $item['guid'] = isset($item['id']) ? $item['id'] : ''; + } // Atom feeds have a content and/or summary tag instead of a description tag. if (!empty($item['content:encoded'])) { diff --git a/modules/aggregator/aggregator.processor.inc b/modules/aggregator/aggregator.processor.inc index fec66e24..6eb2c662 100644 --- a/modules/aggregator/aggregator.processor.inc +++ b/modules/aggregator/aggregator.processor.inc @@ -1,5 +1,4 @@ <?php -// $Id: aggregator.processor.inc,v 1.14 2010/10/04 18:00:45 dries Exp $ /** * @file @@ -163,8 +162,8 @@ function aggregator_save_item($edit) { $result = db_query('SELECT cid FROM {aggregator_category_feed} WHERE fid = :fid', array(':fid' => $edit['fid'])); foreach ($result as $category) { db_merge('aggregator_category_item') - ->key(array('iid' => $edit['iid'])) - ->fields(array( + ->key(array( + 'iid' => $edit['iid'], 'cid' => $category->cid, )) ->execute(); diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test index 2e526079..1ab12dc2 100644 --- a/modules/aggregator/aggregator.test +++ b/modules/aggregator/aggregator.test @@ -1,9 +1,8 @@ <?php -// $Id: aggregator.test,v 1.47 2010/10/25 15:51:21 webchick Exp $ /** * @file - * Creates tests for aggregator module. + * Tests for aggregator.module. */ class AggregatorTestCase extends DrupalWebTestCase { @@ -854,6 +853,7 @@ class FeedParserTestCase extends AggregatorTestCase { $this->assertText('Atom-Powered Robots Run Amok'); $this->assertLinkByHref('http://example.org/2003/12/13/atom03'); $this->assertText('Some text.'); + $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', array(':link' => 'http://example.org/2003/12/13/atom03'))->fetchField(), 'Atom entry id element is parsed correctly.'); } } diff --git a/modules/aggregator/tests/aggregator_test.info b/modules/aggregator/tests/aggregator_test.info index 7d79a08b..31fcf1d5 100644 --- a/modules/aggregator/tests/aggregator_test.info +++ b/modules/aggregator/tests/aggregator_test.info @@ -1,4 +1,3 @@ -; $Id: aggregator_test.info,v 1.2 2010/12/20 19:59:40 webchick Exp $ name = "Aggregator module tests" description = "Support module for aggregator related testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/aggregator/tests/aggregator_test.module b/modules/aggregator/tests/aggregator_test.module index f77e38af..2d26a5d9 100644 --- a/modules/aggregator/tests/aggregator_test.module +++ b/modules/aggregator/tests/aggregator_test.module @@ -1,5 +1,4 @@ <?php -// $Id: aggregator_test.module,v 1.8 2010/05/01 08:12:22 dries Exp $ /** * Implements hook_menu(). diff --git a/modules/block/block-admin-display-form.tpl.php b/modules/block/block-admin-display-form.tpl.php index 5ec8be03..94b61041 100644 --- a/modules/block/block-admin-display-form.tpl.php +++ b/modules/block/block-admin-display-form.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: block-admin-display-form.tpl.php,v 1.7 2009/10/05 02:43:01 webchick Exp $ /** * @file diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 72dec8f9..7cf299c0 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: block.admin.inc,v 1.91 2010/11/06 23:24:33 webchick Exp $ /** * @file @@ -17,7 +16,7 @@ function block_admin_demo($theme = NULL) { /** * Menu callback for admin/structure/block. * - * @param $theme + * @param $theme * The theme to display the administration page for. If not provided, defaults * to the currently used theme. */ diff --git a/modules/block/block.api.php b/modules/block/block.api.php index 2df97df8..d33f5942 100644 --- a/modules/block/block.api.php +++ b/modules/block/block.api.php @@ -1,5 +1,4 @@ <?php -// $Id: block.api.php,v 1.15 2010/11/23 16:12:15 webchick Exp $ /** * @file @@ -34,7 +33,7 @@ * it is preferable to use descriptive strings whenever possible, and only use a * numeric identifier if you have to (for instance if your module allows users * to create several similar blocks that you identify within your module code - * with numeric IDs). + * with numeric IDs). The maximum length for delta values is 32 bytes. * * @return * An associative array whose keys define the delta for each block and whose @@ -77,12 +76,12 @@ * enabled theme, the block will be disabled. * - 'visibility': (optional) Initial value for the visibility flag, which * tells how to interpret the 'pages' value. Possible values are: - * - 0: Show on all pages except listed pages. 'pages' lists the paths where - * the block should not be shown. - * - 1: Show only on listed pages. 'pages' lists the paths where the block - * should be shown. - * - 2: Use custom PHP code to determine visibility. 'pages' gives the PHP - * code to use. + * - BLOCK_VISIBILITY_NOTLISTED: Show on all pages except listed pages. + * 'pages' lists the paths where the block should not be shown. + * - BLOCK_VISIBILITY_LISTED: Show only on listed pages. 'pages' lists the + * paths where the block should be shown. + * - BLOCK_VISIBILITY_PHP: Use custom PHP code to determine visibility. + * 'pages' gives the PHP code to use. * Most modules do not provide an initial value for 'visibility' or 'pages', * and any value provided can be modified by a user on the block * configuration screen. @@ -206,23 +205,27 @@ function hook_block_save($delta = '', $edit = array()) { * @see hook_block_view_MODULE_DELTA_alter() */ function hook_block_view($delta = '') { - // This example comes from node.module. Note that you can also return a - // renderable array rather than rendered HTML for 'content'. + // This example is adapted from node.module. $block = array(); switch ($delta) { case 'syndicate': $block['subject'] = t('Syndicate'); - $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate'))); + $block['content'] = array( + '#theme' => 'feed_icon', + '#url' => 'rss.xml', + '#title' => t('Syndicate'), + ); break; case 'recent': if (user_access('access content')) { $block['subject'] = t('Recent content'); if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) { - $block['content'] = theme('node_recent_block', array( - 'nodes' => $nodes, - )); + $block['content'] = array( + '#theme' => 'node_recent_block', + '#nodes' => $nodes, + ); } else { $block['content'] = t('No content available.'); } diff --git a/modules/block/block.css b/modules/block/block.css index a146be04..214c8a25 100644 --- a/modules/block/block.css +++ b/modules/block/block.css @@ -1,4 +1,3 @@ -/* $Id: block.css,v 1.9 2011/01/03 07:04:48 webchick Exp $ */ #blocks tr.region-title td { font-weight: bold; diff --git a/modules/block/block.info b/modules/block/block.info index 7e51b488..b891bf74 100644 --- a/modules/block/block.info +++ b/modules/block/block.info @@ -1,4 +1,3 @@ -; $Id: block.info,v 1.16 2010/12/20 19:59:40 webchick Exp $ name = Block description = Controls the visual building blocks a page is constructed with. Blocks are boxes of content rendered into an area, or region, of a web page. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = block.test configure = admin/structure/block -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/block/block.install b/modules/block/block.install index dafcfb3c..c45b076b 100644 --- a/modules/block/block.install +++ b/modules/block/block.install @@ -1,5 +1,4 @@ <?php -// $Id: block.install,v 1.48 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -229,6 +228,7 @@ function block_update_7000() { * {boxes} to {block_custom}. */ function block_update_7002() { + db_drop_index('blocks', 'list'); db_rename_table('blocks', 'block'); db_rename_table('blocks_roles', 'block_role'); db_rename_table('boxes', 'block_custom'); @@ -238,7 +238,6 @@ function block_update_7002() { * Change the weight column to normal int. */ function block_update_7003() { - db_drop_index('block', 'list'); db_change_field('block', 'weight', 'weight', array( 'type' => 'int', 'not null' => TRUE, @@ -461,6 +460,13 @@ function block_update_7007() { )); } +/** + * Update database to match Drupal 7 schema. + */ +function block_update_7008() { + db_drop_field('block', 'throttle'); +} + /** * @} End of "addtogroup updates-6.x-to-7.x" */ diff --git a/modules/block/block.js b/modules/block/block.js index 29010691..ce4995dc 100644 --- a/modules/block/block.js +++ b/modules/block/block.js @@ -1,4 +1,3 @@ -// $Id: block.js,v 1.16 2010/05/09 13:57:59 dries Exp $ (function ($) { /** diff --git a/modules/block/block.module b/modules/block/block.module index ae4889ee..73eba331 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -1,5 +1,4 @@ <?php -// $Id: block.module,v 1.435 2010/11/23 16:12:15 webchick Exp $ /** * @file @@ -258,7 +257,7 @@ function block_page_build(&$page) { // The theme system might not yet be initialized. We need $theme. drupal_theme_initialize(); - // Populate all block regions + // Fetch a list of regions for the current theme. $all_regions = system_region_list($theme); $item = menu_get_item(); @@ -356,7 +355,7 @@ function _block_get_renderable_array($list = array()) { /** * Update the 'block' DB table with the blocks currently exported by modules. * - * @param $theme + * @param $theme * The theme to rehash blocks for. If not provided, defaults to the currently * used theme. * @@ -944,7 +943,15 @@ function template_preprocess_block(&$variables) { $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->region; $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module; - $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module . '__' . $variables['block']->delta; + // Hyphens (-) and underscores (_) play a special role in theme suggestions. + // Theme suggestions should only contain underscores, because within + // drupal_find_theme_templates(), underscores are converted to hyphens to + // match template file names, and then converted back to underscores to match + // pre-processing and other function names. So if your theme suggestion + // contains a hyphen, it will end up as an underscore after this conversion, + // and your function names won't be recognized. So, we need to convert + // hyphens to underscores in block deltas for the theme suggestions. + $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module . '__' . strtr($variables['block']->delta, '-', '_'); // Create a valid HTML ID and make sure it is unique. $variables['block_html_id'] = drupal_html_id('block-' . $variables['block']->module . '-' . $variables['block']->delta); diff --git a/modules/block/block.test b/modules/block/block.test index ce0ff807..022bf383 100644 --- a/modules/block/block.test +++ b/modules/block/block.test @@ -1,9 +1,8 @@ <?php -// $Id: block.test,v 1.64 2010/11/29 06:38:51 webchick Exp $ /** * @file - * Tests for the block module + * Tests for block.module. */ class BlockTestCase extends DrupalWebTestCase { @@ -415,7 +414,7 @@ class BlockAdminThemeTestCase extends DrupalWebTestCase { public static function getInfo() { return array( 'name' => 'Admin theme block admin accessibility', - 'description' => "Check whether the block administer page for a disabled theme acccessible if and only if it's the admin theme.", + 'description' => "Check whether the block administer page for a disabled theme accessible if and only if it's the admin theme.", 'group' => 'Block', ); } @@ -667,3 +666,45 @@ class BlockHTMLIdTestCase extends DrupalWebTestCase { $this->assertRaw('block-block-test-test-html-id', t('HTML id for test block is valid.')); } } + + +/** + * Unit tests for template_preprocess_block(). + */ +class BlockTemplateSuggestionsUnitTest extends DrupalUnitTestCase { + public static function getInfo() { + return array( + 'name' => 'Block template suggestions', + 'description' => 'Test the template_preprocess_block() function.', + 'group' => 'Block', + ); + } + + /** + * Test if template_preprocess_block() handles the suggestions right. + */ + function testBlockThemeHookSuggestions() { + // Define block delta with underscore to be preprocessed + $block1 = new stdClass(); + $block1->module = 'block'; + $block1->delta = 'underscore_test'; + $block1->region = 'footer'; + $variables1 = array(); + $variables1['elements']['#block'] = $block1; + $variables1['elements']['#children'] = ''; + template_preprocess_block($variables1); + $this->assertEqual($variables1['theme_hook_suggestions'], array('block__footer', 'block__block', 'block__block__underscore_test'), t('Found expected block suggestions for delta with underscore')); + + // Define block delta with hyphens to be preprocessed. Hyphens should be + // replaced with underscores. + $block2 = new stdClass(); + $block2->module = 'block'; + $block2->delta = 'hyphen-test'; + $block2->region = 'footer'; + $variables2 = array(); + $variables2['elements']['#block'] = $block2; + $variables2['elements']['#children'] = ''; + template_preprocess_block($variables2); + $this->assertEqual($variables2['theme_hook_suggestions'], array('block__footer', 'block__block', 'block__block__hyphen_test'), t('Hyphens (-) in block delta were replaced by underscore (_)')); + } +} diff --git a/modules/block/block.tpl.php b/modules/block/block.tpl.php index 270479d4..b1946374 100644 --- a/modules/block/block.tpl.php +++ b/modules/block/block.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: block.tpl.php,v 1.10 2010/04/26 14:10:40 dries Exp $ /** * @file diff --git a/modules/block/tests/block_test.info b/modules/block/tests/block_test.info index 5c6978c7..6da4918f 100644 --- a/modules/block/tests/block_test.info +++ b/modules/block/tests/block_test.info @@ -1,4 +1,3 @@ -; $Id: block_test.info,v 1.2 2010/12/20 19:59:40 webchick Exp $ name = Block test description = Provides test blocks. package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/block/tests/block_test.module b/modules/block/tests/block_test.module index 1957f24a..2abc433c 100644 --- a/modules/block/tests/block_test.module +++ b/modules/block/tests/block_test.module @@ -1,5 +1,4 @@ <?php -// $Id: block_test.module,v 1.3 2010/06/15 16:19:28 dries Exp $ /** * @file diff --git a/modules/blog/blog.info b/modules/blog/blog.info index a69e8524..3b93b82e 100644 --- a/modules/blog/blog.info +++ b/modules/blog/blog.info @@ -1,4 +1,3 @@ -; $Id: blog.info,v 1.12 2010/12/20 19:59:40 webchick Exp $ name = Blog description = Enables multi-user blogs. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x files[] = blog.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/blog/blog.install b/modules/blog/blog.install index 322c21b9..fffb14b8 100644 --- a/modules/blog/blog.install +++ b/modules/blog/blog.install @@ -1,5 +1,4 @@ <?php -// $Id: blog.install,v 1.1 2010/05/05 15:11:51 webchick Exp $ /** * @file @@ -15,3 +14,10 @@ function blog_install() { $types = node_type_get_types(); node_add_body_field($types['blog']); } + +/** + * Implements hook_uninstall(). + */ +function blog_uninstall() { + variable_del('blog_block_count'); +} diff --git a/modules/blog/blog.module b/modules/blog/blog.module index c9bee7b9..98ebe515 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -1,5 +1,4 @@ <?php -// $Id: blog.module,v 1.362 2010/11/14 21:04:45 webchick Exp $ /** * @file diff --git a/modules/blog/blog.pages.inc b/modules/blog/blog.pages.inc index 9270a12a..3684028d 100644 --- a/modules/blog/blog.pages.inc +++ b/modules/blog/blog.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: blog.pages.inc,v 1.28 2010/08/03 02:02:02 dries Exp $ /** * @file diff --git a/modules/blog/blog.test b/modules/blog/blog.test index 574e3794..6ff66a2a 100644 --- a/modules/blog/blog.test +++ b/modules/blog/blog.test @@ -1,5 +1,9 @@ <?php -// $Id: blog.test,v 1.30 2010/08/30 00:22:03 webchick Exp $ + +/** + * @file + * Tests for blog.module. + */ class BlogTestCase extends DrupalWebTestCase { protected $big_user; diff --git a/modules/book/book-all-books-block.tpl.php b/modules/book/book-all-books-block.tpl.php index 1282ce0b..d22ff2cc 100644 --- a/modules/book/book-all-books-block.tpl.php +++ b/modules/book/book-all-books-block.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: book-all-books-block.tpl.php,v 1.5 2010/01/30 07:59:24 dries Exp $ /** * @file diff --git a/modules/book/book-export-html.tpl.php b/modules/book/book-export-html.tpl.php index dffd446b..180f3ae7 100644 --- a/modules/book/book-export-html.tpl.php +++ b/modules/book/book-export-html.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: book-export-html.tpl.php,v 1.3 2010/10/23 15:35:35 webchick Exp $ /** * @file diff --git a/modules/book/book-navigation.tpl.php b/modules/book/book-navigation.tpl.php index 1d9dd080..e5883dc5 100644 --- a/modules/book/book-navigation.tpl.php +++ b/modules/book/book-navigation.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: book-navigation.tpl.php,v 1.3 2009/02/18 14:28:21 webchick Exp $ /** * @file diff --git a/modules/book/book-node-export-html.tpl.php b/modules/book/book-node-export-html.tpl.php index 6a00c676..ef6c3224 100644 --- a/modules/book/book-node-export-html.tpl.php +++ b/modules/book/book-node-export-html.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: book-node-export-html.tpl.php,v 1.2 2008/05/15 21:19:24 dries Exp $ /** * @file diff --git a/modules/book/book-rtl.css b/modules/book/book-rtl.css index a06c4a9d..f3a84c20 100644 --- a/modules/book/book-rtl.css +++ b/modules/book/book-rtl.css @@ -1,4 +1,3 @@ -/* $Id: book-rtl.css,v 1.2 2008/12/19 15:42:26 dries Exp $ */ .book-navigation .menu { padding: 1em 3em 0 0; diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index 386dfccf..7b9dea39 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: book.admin.inc,v 1.39 2011/01/03 07:34:46 webchick Exp $ /** * @file diff --git a/modules/book/book.css b/modules/book/book.css index 42fa885d..a8d2136d 100644 --- a/modules/book/book.css +++ b/modules/book/book.css @@ -1,4 +1,3 @@ -/* $Id: book.css,v 1.12 2009/08/24 03:11:34 webchick Exp $ */ .book-navigation .menu { border-top: 1px solid #888; diff --git a/modules/book/book.info b/modules/book/book.info index 1e05f525..6a7c8d5e 100644 --- a/modules/book/book.info +++ b/modules/book/book.info @@ -1,4 +1,3 @@ -; $Id: book.info,v 1.15 2010/12/20 19:59:41 webchick Exp $ name = Book description = Allows users to create and organize related content in an outline. package = Core @@ -8,8 +7,8 @@ files[] = book.test configure = admin/content/book/settings stylesheets[all][] = book.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/book/book.install b/modules/book/book.install index f8782cf1..1bd094c2 100644 --- a/modules/book/book.install +++ b/modules/book/book.install @@ -1,5 +1,4 @@ <?php -// $Id: book.install,v 1.36 2010/06/23 19:05:15 dries Exp $ /** * @file diff --git a/modules/book/book.js b/modules/book/book.js index a7d1b873..5b953f16 100644 --- a/modules/book/book.js +++ b/modules/book/book.js @@ -1,4 +1,3 @@ -// $Id: book.js,v 1.8 2010/11/05 19:47:20 dries Exp $ (function ($) { diff --git a/modules/book/book.module b/modules/book/book.module index 4252f3e9..de9561fe 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -1,5 +1,4 @@ <?php -// $Id: book.module,v 1.558 2011/01/03 07:34:46 webchick Exp $ /** * @file @@ -280,10 +279,10 @@ function book_block_view($delta = '') { } elseif ($current_bid) { // Only display this block when the user is browsing a book. - $select = db_select('node'); - $select->addField('node', 'title'); - $select->condition('nid', $node->book['bid']); - $select->addTag('node_access'); + $select = db_select('node', 'n') + ->fields('n', array('title')) + ->condition('nid', $node->book['bid']) + ->addTag('node_access'); $title = $select->execute()->fetchField(); // Only show the block if the user has view access for the top-level node. if ($title) { @@ -419,7 +418,7 @@ function book_form_node_form_alter(&$form, &$form_state, $form_id) { * rebuild so that the "Parent item" options are changed to reflect the newly * selected book. When JavaScript is enabled, the submit button that triggers * this handler is hidden, and the "Book" dropdown directly triggers the - * book_form_update() AJAX callback instead. + * book_form_update() Ajax callback instead. * * @see book_form_update() */ @@ -432,7 +431,7 @@ function book_pick_book_nojs_submit($form, &$form_state) { * Build the parent selection form element for the node form or outline tab. * * This function is also called when generating a new set of options during the - * AJAX callback, so an array is returned that can be used to replace an existing + * Ajax callback, so an array is returned that can be used to replace an existing * form element. */ function _book_parent_select($book_link) { @@ -479,7 +478,7 @@ function _book_parent_select($book_link) { * Build the common elements of the book form for the node and outline forms. */ function _book_add_form_elements(&$form, &$form_state, $node) { - // If the form is being processed during the AJAX callback of our book bid + // If the form is being processed during the Ajax callback of our book bid // dropdown, then $form_state will hold the value that was selected. if (isset($form_state['values']['book'])) { $node->book = $form_state['values']['book']; @@ -563,7 +562,7 @@ function _book_add_form_elements(&$form, &$form_state, $node) { /** * Renders a new parent page select element when the book selection changes. * - * This function is called via AJAX when the selected book is changed on a node + * This function is called via Ajax when the selected book is changed on a node * or book outline form. * * @return diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc index 14c8342d..1617f008 100644 --- a/modules/book/book.pages.inc +++ b/modules/book/book.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: book.pages.inc,v 1.27 2010/07/07 01:07:33 dries Exp $ /** * @file @@ -77,9 +76,11 @@ function book_export_html($nid) { if (isset($node->book)) { $tree = book_menu_subtree_data($node->book); $contents = book_export_traverse($tree, 'book_node_export'); + return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth'])); + } + else { + drupal_not_found(); } - - return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth'])); } else { drupal_access_denied(); diff --git a/modules/book/book.test b/modules/book/book.test index 7f8c8160..cc61778b 100644 --- a/modules/book/book.test +++ b/modules/book/book.test @@ -1,5 +1,9 @@ <?php -// $Id: book.test,v 1.28 2010/10/18 05:53:34 webchick Exp $ + +/** + * @file + * Tests for book.module. + */ class BookTestCase extends DrupalWebTestCase { protected $book; @@ -237,6 +241,10 @@ class BookTestCase extends DrupalWebTestCase { $this->drupalGet('book/export/foobar/' . $this->book->nid); $this->assertResponse('404', t('Unsupported export format returned "not found".')); + // Make sure we get a 404 on a not existing book node. + $this->drupalGet('book/export/html/123'); + $this->assertResponse('404', t('Not existing book node returned "not found".')); + // Make sure an anonymous user cannot view printer-friendly version. $this->drupalLogout(); diff --git a/modules/color/color-rtl.css b/modules/color/color-rtl.css index beb1b2cc..bfbcd499 100644 --- a/modules/color/color-rtl.css +++ b/modules/color/color-rtl.css @@ -1,4 +1,3 @@ -/* $Id: color-rtl.css,v 1.4 2010/04/28 20:08:38 dries Exp $ */ #placeholder { left: 0; diff --git a/modules/color/color.css b/modules/color/color.css index c388d9f3..e513dadf 100644 --- a/modules/color/color.css +++ b/modules/color/color.css @@ -1,4 +1,3 @@ -/* $Id: color.css,v 1.5 2010/04/28 20:08:38 dries Exp $ */ /* Farbtastic placement */ .color-form { diff --git a/modules/color/color.info b/modules/color/color.info index 96a07d6c..1ac87285 100644 --- a/modules/color/color.info +++ b/modules/color/color.info @@ -1,4 +1,3 @@ -; $Id: color.info,v 1.11 2010/12/20 19:59:41 webchick Exp $ name = Color description = Allows administrators to change the color scheme of compatible themes. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x files[] = color.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/color/color.install b/modules/color/color.install index 83a0780b..b0eb95ef 100644 --- a/modules/color/color.install +++ b/modules/color/color.install @@ -1,5 +1,4 @@ <?php -// $Id: color.install,v 1.9 2010/11/19 20:37:17 dries Exp $ /** * @file @@ -41,3 +40,18 @@ function color_requirements($phase) { return $requirements; } + +/** + * Warn site administrator if unsafe CSS color codes are found in the database. + */ +function color_update_7001() { + $theme_palettes = db_query("SELECT name FROM {variable} WHERE name LIKE 'color_%_palette'")->fetchCol(); + foreach ($theme_palettes as $name) { + $palette = variable_get($name, array()); + foreach ($palette as $key => $color) { + if (!preg_match('/^#([a-f0-9]{3}){1,2}$/iD', $color)) { + drupal_set_message('Some of the custom CSS color codes specified via the color module are invalid. Please examine the themes which are making use of the color module at the <a href="'. url('admin/appearance/settings') .'">Appearance settings</a> page to verify their CSS color values.', 'warning'); + } + } + } +} diff --git a/modules/color/color.js b/modules/color/color.js index 16515efe..43099adc 100644 --- a/modules/color/color.js +++ b/modules/color/color.js @@ -1,4 +1,3 @@ -// $Id: color.js,v 1.18 2010/04/22 05:18:21 webchick Exp $ (function ($) { Drupal.behaviors.color = { diff --git a/modules/color/color.module b/modules/color/color.module index aa1007c1..f3fafe7b 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -1,5 +1,4 @@ <?php -// $Id: color.module,v 1.92 2010/10/05 19:59:10 dries Exp $ /** * Implements hook_help(). @@ -43,6 +42,7 @@ function color_form_system_theme_settings_alter(&$form, &$form_state) { '#theme' => 'color_scheme_form', ); $form['color'] += color_scheme_form($form, $form_state, $theme); + $form['#validate'][] = 'color_scheme_form_validate'; $form['#submit'][] = 'color_scheme_form_submit'; } } @@ -271,6 +271,18 @@ function theme_color_scheme_form($variables) { return $output; } +/** + * Validation handler for color change form. + */ +function color_scheme_form_validate($form, &$form_state) { + // Only accept hexadecimal CSS color strings to avoid XSS upon use. + foreach ($form_state['values']['palette'] as $key => $color) { + if (!preg_match('/^#([a-f0-9]{3}){1,2}$/iD', $color)) { + form_set_error('palette][' . $key, t('%name must be a valid hexadecimal CSS color value.', array('%name' => $form['color']['palette'][$key]['#title']))); + } + } +} + /** * Submit handler for color change form. */ diff --git a/modules/color/color.test b/modules/color/color.test index 8f89b4bf..1ddfc064 100644 --- a/modules/color/color.test +++ b/modules/color/color.test @@ -1,5 +1,4 @@ <?php -// $Id: color.test,v 1.8 2010/11/13 14:06:43 dries Exp $ /** * @file diff --git a/modules/color/preview.js b/modules/color/preview.js index c5e47a08..88ae95fb 100644 --- a/modules/color/preview.js +++ b/modules/color/preview.js @@ -1,4 +1,3 @@ -// $Id: preview.js,v 1.2 2010/04/28 20:25:21 dries Exp $ (function ($) { Drupal.color = { diff --git a/modules/comment/comment-node-form.js b/modules/comment/comment-node-form.js index e8f07b24..76db2404 100644 --- a/modules/comment/comment-node-form.js +++ b/modules/comment/comment-node-form.js @@ -1,4 +1,3 @@ -// $Id: comment-node-form.js,v 1.6 2010/11/05 19:47:20 dries Exp $ (function ($) { diff --git a/modules/comment/comment-rtl.css b/modules/comment/comment-rtl.css index c40a859b..39c39296 100644 --- a/modules/comment/comment-rtl.css +++ b/modules/comment/comment-rtl.css @@ -1,4 +1,3 @@ -/* $Id: comment-rtl.css,v 1.2 2007/11/27 12:09:25 goba Exp $ */ .indented { margin-left: 0; diff --git a/modules/comment/comment-wrapper.tpl.php b/modules/comment/comment-wrapper.tpl.php index d17205ca..3293e88a 100644 --- a/modules/comment/comment-wrapper.tpl.php +++ b/modules/comment/comment-wrapper.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: comment-wrapper.tpl.php,v 1.10 2010/05/05 06:41:22 webchick Exp $ /** * @file diff --git a/modules/comment/comment.admin.inc b/modules/comment/comment.admin.inc index 91ce977b..4f3d3507 100644 --- a/modules/comment/comment.admin.inc +++ b/modules/comment/comment.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: comment.admin.inc,v 1.53 2011/01/03 05:18:42 webchick Exp $ /** * @file diff --git a/modules/comment/comment.api.php b/modules/comment/comment.api.php index 648088dd..05912655 100644 --- a/modules/comment/comment.api.php +++ b/modules/comment/comment.api.php @@ -1,5 +1,4 @@ <?php -// $Id: comment.api.php,v 1.18 2010/10/23 15:30:34 webchick Exp $ /** * @file diff --git a/modules/comment/comment.css b/modules/comment/comment.css index d316cba8..4a2675af 100644 --- a/modules/comment/comment.css +++ b/modules/comment/comment.css @@ -1,4 +1,3 @@ -/* $Id: comment.css,v 1.5 2008/12/31 12:02:21 dries Exp $ */ #comments { margin-top: 15px; diff --git a/modules/comment/comment.info b/modules/comment/comment.info index aceac3b1..85847e6f 100644 --- a/modules/comment/comment.info +++ b/modules/comment/comment.info @@ -1,4 +1,3 @@ -; $Id: comment.info,v 1.15 2010/12/20 19:59:41 webchick Exp $ name = Comment description = Allows users to comment on and discuss published content. package = Core @@ -10,8 +9,8 @@ files[] = comment.test configure = admin/content/comment stylesheets[all][] = comment.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 7959e79d..d64b3acd 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -1,5 +1,4 @@ <?php -// $Id: comment.install,v 1.76 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -337,6 +336,33 @@ function comment_update_7006(&$sandbox) { } } +/** + * Add an index to the created column. + */ +function comment_update_7007() { + db_add_index('comment', 'comment_created', array('created')); +} + +/** + * Update database to match Drupal 7 schema. + */ +function comment_update_7008() { + // Update default status to 1. + db_change_field('comment', 'status', 'status', array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 1, + 'size' => 'tiny', + )); + + // Realign indexes. + db_drop_index('comment', 'comment_status_pid'); + db_add_index('comment', 'comment_status_pid', array('pid', 'status')); + db_drop_index('comment', 'comment_pid_status'); + db_drop_index('comment', 'nid'); +} + /** * @} End of "addtogroup updates-6.x-to-7.x" */ @@ -442,6 +468,7 @@ function comment_schema() { 'comment_num_new' => array('nid', 'status', 'created', 'cid', 'thread'), 'comment_uid' => array('uid'), 'comment_nid_language' => array('nid', 'language'), + 'comment_created' => array('created'), ), 'primary key' => array('cid'), 'foreign keys' => array( diff --git a/modules/comment/comment.module b/modules/comment/comment.module index c295179a..4a737557 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1,5 +1,4 @@ <?php -// $Id: comment.module,v 1.931 2011/01/02 23:54:05 webchick Exp $ /** * @file @@ -495,6 +494,7 @@ function comment_permalink($cid) { * * @param integer $number * (optional) The maximum number of comments to find. Defaults to 10. + * * @return * An array of comment objects or an empty array if there are no recent * comments visible to the current user. @@ -502,15 +502,12 @@ function comment_permalink($cid) { function comment_get_recent($number = 10) { $query = db_select('comment', 'c'); $query->innerJoin('node', 'n', 'n.nid = c.nid'); - $query->innerJoin('node_comment_statistics', 'ncs', 'ncs.nid = c.nid'); $query->addTag('node_access'); $comments = $query ->fields('c') - ->condition('ncs.comment_count', 0, '>') ->condition('c.status', COMMENT_PUBLISHED) ->condition('n.status', NODE_PUBLISHED) - ->orderBy('ncs.last_comment_timestamp', 'DESC') - ->orderBy('c.cid', 'DESC') + ->orderBy('c.created', 'DESC') ->range(0, $number) ->execute() ->fetchAll(); @@ -989,8 +986,8 @@ function comment_build_content($comment, $node, $view_mode = 'full', $langcode = $comment->content = array(); // Build fields content. - field_attach_prepare_view('comment', array($comment->cid => $comment), $view_mode); - entity_prepare_view('comment', array($comment->cid => $comment)); + field_attach_prepare_view('comment', array($comment->cid => $comment), $view_mode, $langcode); + entity_prepare_view('comment', array($comment->cid => $comment), $langcode); $comment->content += field_attach_view('comment', $comment, $view_mode, $langcode); $comment->content['links'] = array( @@ -1092,8 +1089,8 @@ function comment_links($comment, $node) { * An array in the format expected by drupal_render(). */ function comment_view_multiple($comments, $node, $view_mode = 'full', $weight = 0, $langcode = NULL) { - field_attach_prepare_view('comment', $comments, $view_mode); - entity_prepare_view('comment', $comments); + field_attach_prepare_view('comment', $comments, $view_mode, $langcode); + entity_prepare_view('comment', $comments, $langcode); $build = array( '#sorted' => TRUE, @@ -1406,15 +1403,15 @@ function comment_user_delete($account) { } /** - * This is *not* a hook_access() implementation. This function is called - * to determine whether the current user has access to a particular comment. + * Determines whether the current user has access to a particular comment. * * Authenticated users can edit their comments as long they have not been - * replied to. This prevents people from changing or revising their - * statements based on the replies to their posts. + * replied to. This prevents people from changing or revising their statements + * based on the replies to their posts. * * @param $op - * The operation that is to be performed on the comment. Only 'edit' is recognized now. + * The operation that is to be performed on the comment. Only 'edit' is + * recognized now. * @param $comment * The comment object. * @return @@ -1468,28 +1465,15 @@ function comment_save($comment) { module_invoke_all('entity_presave', $comment, 'comment'); if ($comment->cid) { - // Update the comment in the database. - db_update('comment') - ->fields(array( - 'status' => $comment->status, - 'created' => $comment->created, - 'changed' => $comment->changed, - 'subject' => $comment->subject, - 'uid' => $comment->uid, - 'name' => $comment->name, - 'mail' => $comment->mail, - 'homepage' => $comment->homepage, - 'language' => $comment->language, - )) - ->condition('cid', $comment->cid) - ->execute(); + + drupal_write_record('comment', $comment, 'cid'); // Ignore slave server temporarily to give time for the // saved comment to be propagated to the slave. db_ignore_slave(); // Update the {node_comment_statistics} table prior to executing hooks. - _comment_update_node_statistics($comment->nid); + _comment_update_node_statistics($comment->nid); field_attach_update('comment', $comment); // Allow modules to respond to the updating of a comment. @@ -1554,23 +1538,16 @@ function comment_save($comment) { $comment->name = $user->name; } - $comment->cid = db_insert('comment') - ->fields(array( - 'nid' => $comment->nid, - 'pid' => empty($comment->pid) ? 0 : $comment->pid, - 'uid' => $comment->uid, - 'subject' => $comment->subject, - 'hostname' => ip_address(), - 'created' => $comment->created, - 'changed' => $comment->changed, - 'status' => $comment->status, - 'thread' => $thread, - 'name' => $comment->name, - 'mail' => $comment->mail, - 'homepage' => $comment->homepage, - 'language' => $comment->language, - )) - ->execute(); + // Ensure the parent id (pid) has a value set. + if (empty($comment->pid)) { + $comment->pid = 0; + } + + // Add the values which aren't passed into the function. + $comment->thread = $thread; + $comment->hostname = ip_address(); + + drupal_write_record('comment', $comment); // Ignore slave server temporarily to give time for the // created comment to be propagated to the slave. @@ -1929,11 +1906,9 @@ function comment_form($form, &$form_state, $comment) { '#default_value' => $author, '#maxlength' => 60, '#size' => 30, + '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))), + '#autocomplete_path' => 'user/autocomplete', ); - // If the comment is by a registered user, allow to autocomplete username. - if ($comment->registered_name != '') { - $form['author']['name']['#autocomplete_path'] = 'user/autocomplete'; - } } elseif ($user->uid) { $form['author']['_author'] = array( @@ -2114,18 +2089,21 @@ function comment_form_validate($form, &$form_state) { entity_form_field_validate('comment', $form, $form_state); if (!empty($form_state['values']['cid'])) { + // Verify the name in case it is being changed from being anonymous. + $account = user_load_by_name($form_state['values']['name']); + $form_state['values']['uid'] = $account ? $account->uid : 0; + if ($form_state['values']['date'] && strtotime($form_state['values']['date']) === FALSE) { form_set_error('date', t('You have to specify a valid date.')); } - if ($form_state['values']['name'] && !$form_state['values']['is_anonymous'] && !$account = user_load_by_name($form_state['values']['name'])) { + if ($form_state['values']['name'] && !$form_state['values']['is_anonymous'] && !$account) { form_set_error('name', t('You have to specify a valid author.')); } } - - // Validate anonymous comment author fields (if given). - if ($form_state['values']['is_anonymous']) { - // If the (original) author of this comment was an anonymous user, verify - // that no registered user with this name exists. + elseif ($form_state['values']['is_anonymous']) { + // Validate anonymous comment author fields (if given). If the (original) + // author of this comment was an anonymous user, verify that no registered + // user with this name exists. if ($form_state['values']['name']) { $query = db_select('users', 'u'); $query->addField('u', 'uid', 'uid'); @@ -2216,7 +2194,7 @@ function comment_form_submit($form, &$form_state) { $comment = comment_form_submit_build_comment($form, $form_state); if (user_access('post comments') && (user_access('administer comments') || $node->comment == COMMENT_NODE_OPEN)) { // Save the anonymous user information to a cookie for reuse. - if (!$comment->uid) { + if (user_is_anonymous()) { user_cookie_save(array_intersect_key($form_state['values'], array_flip(array('name', 'mail', 'homepage')))); } diff --git a/modules/comment/comment.pages.inc b/modules/comment/comment.pages.inc index 791974e5..7e88bffc 100644 --- a/modules/comment/comment.pages.inc +++ b/modules/comment/comment.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: comment.pages.inc,v 1.41 2011/01/02 23:54:05 webchick Exp $ /** * @file diff --git a/modules/comment/comment.test b/modules/comment/comment.test index 8e3a92ff..770e01d4 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -1,5 +1,9 @@ <?php -// $Id: comment.test,v 1.98 2011/01/02 23:54:05 webchick Exp $ + +/** + * @file + * Tests for comment.module. + */ class CommentHelperCase extends DrupalWebTestCase { protected $admin_user; @@ -303,6 +307,26 @@ class CommentInterfaceTest extends CommentHelperCase { $this->drupalLogin($this->admin_user); $this->setCommentSubject(TRUE); $this->setCommentPreview(DRUPAL_OPTIONAL); + + // Test changing the comment author to "Anonymous". + $this->drupalGet('comment/' . $comment->id . '/edit'); + $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => '')); + $comment_loaded = comment_load($comment->id); + $this->assertTrue(empty($comment_loaded->name) && $comment_loaded->uid == 0, t('Comment author successfully changed to anonymous.')); + + // Test changing the comment author to an unverified user. + $random_name = $this->randomName(); + $this->drupalGet('comment/' . $comment->id . '/edit'); + $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $random_name)); + $this->drupalGet('node/' . $this->node->nid); + $this->assertText($random_name . ' (' . t('not verified') . ')', t('Comment author successfully changed to an unverified user.')); + + // Test changing the comment author to a verified user. + $this->drupalGet('comment/' . $comment->id . '/edit'); + $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $this->web_user->name)); + $comment_loaded = comment_load($comment->id); + $this->assertTrue($comment_loaded->name == $this->web_user->name && $comment_loaded->uid == $this->web_user->uid, t('Comment author successfully changed to a registered user.')); + $this->drupalLogout(); // Reply to comment #2 creating comment #3 with optional preview and no @@ -1694,7 +1718,7 @@ class CommentTokenReplaceTestCase extends CommentHelperCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('comment' => $comment), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized comment token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized comment token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1710,7 +1734,7 @@ class CommentTokenReplaceTestCase extends CommentHelperCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('comment' => $comment), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized comment token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized comment token %token replaced.', array('%token' => $input))); } // Load node so comment_count gets computed. @@ -1723,7 +1747,7 @@ class CommentTokenReplaceTestCase extends CommentHelperCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('node' => $node), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Node comment token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Node comment token %token replaced.', array('%token' => $input))); } } } diff --git a/modules/comment/comment.tokens.inc b/modules/comment/comment.tokens.inc index 02e8b963..d62b7e2f 100644 --- a/modules/comment/comment.tokens.inc +++ b/modules/comment/comment.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: comment.tokens.inc,v 1.13 2010/07/07 17:00:42 webchick Exp $ /** * @file diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php index 3ef38582..a483813d 100644 --- a/modules/comment/comment.tpl.php +++ b/modules/comment/comment.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: comment.tpl.php,v 1.19 2010/12/01 00:18:15 webchick Exp $ /** * @file diff --git a/modules/contact/contact.admin.inc b/modules/contact/contact.admin.inc index 477a20ce..9fde037d 100644 --- a/modules/contact/contact.admin.inc +++ b/modules/contact/contact.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: contact.admin.inc,v 1.24 2010/04/24 14:49:13 dries Exp $ /** * @file diff --git a/modules/contact/contact.info b/modules/contact/contact.info index f44e025e..25cee494 100644 --- a/modules/contact/contact.info +++ b/modules/contact/contact.info @@ -1,4 +1,3 @@ -; $Id: contact.info,v 1.11 2010/12/20 19:59:41 webchick Exp $ name = Contact description = Enables the use of both personal and site-wide contact forms. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = contact.test configure = admin/structure/contact -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/contact/contact.install b/modules/contact/contact.install index c0e570c3..6e8ec705 100644 --- a/modules/contact/contact.install +++ b/modules/contact/contact.install @@ -1,5 +1,4 @@ <?php -// $Id: contact.install,v 1.26 2011/01/02 17:26:39 webchick Exp $ /** * @file diff --git a/modules/contact/contact.module b/modules/contact/contact.module index 7ecaa671..eaae9c62 100644 --- a/modules/contact/contact.module +++ b/modules/contact/contact.module @@ -1,5 +1,4 @@ <?php -// $Id: contact.module,v 1.150 2010/12/20 19:59:41 webchick Exp $ /** * @file diff --git a/modules/contact/contact.pages.inc b/modules/contact/contact.pages.inc index 21076e90..30b28250 100644 --- a/modules/contact/contact.pages.inc +++ b/modules/contact/contact.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: contact.pages.inc,v 1.45 2010/11/30 17:16:37 dries Exp $ /** * @file diff --git a/modules/contact/contact.test b/modules/contact/contact.test index b758a083..bc44f5a0 100644 --- a/modules/contact/contact.test +++ b/modules/contact/contact.test @@ -1,9 +1,10 @@ <?php -// $Id: contact.test,v 1.45 2010/08/05 23:53:37 webchick Exp $ /** - * Test the sitewide contact form. + * @file + * Tests for contact.module. */ + class ContactSitewideTestCase extends DrupalWebTestCase { public static function getInfo() { return array( diff --git a/modules/contextual/contextual-rtl.css b/modules/contextual/contextual-rtl.css index bf044a34..96ffef5c 100644 --- a/modules/contextual/contextual-rtl.css +++ b/modules/contextual/contextual-rtl.css @@ -1,4 +1,3 @@ -/* $Id: contextual-rtl.css,v 1.1 2010/06/04 20:38:55 dries Exp $ */ div.contextual-links-wrapper { left: 5px; diff --git a/modules/contextual/contextual.api.php b/modules/contextual/contextual.api.php index 6670322a..e8f33ee0 100644 --- a/modules/contextual/contextual.api.php +++ b/modules/contextual/contextual.api.php @@ -1,5 +1,4 @@ <?php -// $Id: contextual.api.php,v 1.1 2010/09/11 14:35:13 dries Exp $ /** * @file diff --git a/modules/contextual/contextual.css b/modules/contextual/contextual.css index 875fb5d6..e49eb375 100644 --- a/modules/contextual/contextual.css +++ b/modules/contextual/contextual.css @@ -1,4 +1,3 @@ -/* $Id: contextual.css,v 1.9 2011/01/03 07:04:48 webchick Exp $ */ /** * Contextual links regions. diff --git a/modules/contextual/contextual.info b/modules/contextual/contextual.info index a4678d97..e279fd29 100644 --- a/modules/contextual/contextual.info +++ b/modules/contextual/contextual.info @@ -1,12 +1,11 @@ -; $Id: contextual.info,v 1.2 2010/12/20 19:59:41 webchick Exp $ name = Contextual links description = Provides contextual links to perform actions related to elements on a page. package = Core version = VERSION core = 7.x -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/contextual/contextual.js b/modules/contextual/contextual.js index 59d5b0b8..ee5b7a05 100644 --- a/modules/contextual/contextual.js +++ b/modules/contextual/contextual.js @@ -1,4 +1,3 @@ -// $Id: contextual.js,v 1.6 2010/11/16 18:43:06 dries Exp $ (function ($) { Drupal.contextualLinks = Drupal.contextualLinks || {}; diff --git a/modules/contextual/contextual.module b/modules/contextual/contextual.module index 8ed4d93a..0d6b625e 100644 --- a/modules/contextual/contextual.module +++ b/modules/contextual/contextual.module @@ -1,5 +1,4 @@ <?php -// $Id: contextual.module,v 1.9 2010/10/31 03:56:46 dries Exp $ /** * @file diff --git a/modules/dashboard/dashboard-rtl.css b/modules/dashboard/dashboard-rtl.css new file mode 100644 index 00000000..2ab53818 --- /dev/null +++ b/modules/dashboard/dashboard-rtl.css @@ -0,0 +1,27 @@ +/* $Id */ + +#dashboard div.dashboard-region { + float: right; +} +#dashboard #disabled-blocks .block, #dashboard .block-placeholder { + float: right; + margin: 3px 0 3px 3px; + padding: 6px 8px 6px 4px; +} +#dashboard .canvas-content a.button { + margin: 0 10px 0 0; +} +#dashboard .ui-sortable .block h2 { + background-position: right -39px; + padding: 0 19px; +} +#dashboard.customize-inactive #disabled-blocks .block:hover h2 { + background-position: right -39px; +} +#dashboard.customize-inactive .dashboard-region .ui-sortable .block:hover h2 { + background-position: right -36px; +} +#dashboard div#dashboard_main { + margin-left: 1%; + margin-right: 0; +} diff --git a/modules/dashboard/dashboard.api.php b/modules/dashboard/dashboard.api.php index 9663b661..00bfde5a 100644 --- a/modules/dashboard/dashboard.api.php +++ b/modules/dashboard/dashboard.api.php @@ -1,5 +1,4 @@ <?php -// $Id: dashboard.api.php,v 1.1 2009/10/18 11:20:26 dries Exp $ /** * @file diff --git a/modules/dashboard/dashboard.css b/modules/dashboard/dashboard.css index f1c0fcfc..db9243c6 100644 --- a/modules/dashboard/dashboard.css +++ b/modules/dashboard/dashboard.css @@ -1,4 +1,3 @@ -/* $Id: dashboard.css,v 1.16 2011/01/03 07:04:48 webchick Exp $ */ #dashboard div.dashboard-region { float: left; @@ -7,7 +6,7 @@ #dashboard div#dashboard_main { width: 65%; - margin-right: 1%; + margin-right: 1%; /* LTR */ } #dashboard div#dashboard_sidebar { @@ -29,9 +28,9 @@ #dashboard #disabled-blocks .block, #dashboard .block-placeholder { background: #e2e1dc; - padding: 6px 4px 6px 8px; - margin: 3px 3px 3px 0; - float: left; + padding: 6px 4px 6px 8px; /* LTR */ + margin: 3px 3px 3px 0; /* LTR */ + float: left; /* LTR */ -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; @@ -57,7 +56,7 @@ } #dashboard .canvas-content a.button { - margin: 0 0 0 10px; + margin: 0 0 0 10px; /* LTR */ color: #5a5a5a; text-decoration: none; } diff --git a/modules/dashboard/dashboard.info b/modules/dashboard/dashboard.info index ac7c9509..3b12f527 100644 --- a/modules/dashboard/dashboard.info +++ b/modules/dashboard/dashboard.info @@ -1,4 +1,3 @@ -; $Id: dashboard.info,v 1.5 2010/12/20 19:59:41 webchick Exp $ name = Dashboard description = Provides a dashboard page in the administrative interface for organizing administrative tasks and tracking information within your site. core = 7.x @@ -8,8 +7,8 @@ files[] = dashboard.test dependencies[] = block configure = admin/dashboard/customize -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/dashboard/dashboard.install b/modules/dashboard/dashboard.install index ab0e6dcb..50218262 100644 --- a/modules/dashboard/dashboard.install +++ b/modules/dashboard/dashboard.install @@ -1,5 +1,4 @@ <?php -// $Id: dashboard.install,v 1.1 2010/11/01 00:44:31 webchick Exp $ /** * @file diff --git a/modules/dashboard/dashboard.js b/modules/dashboard/dashboard.js index 7a309c2c..ebecbf65 100644 --- a/modules/dashboard/dashboard.js +++ b/modules/dashboard/dashboard.js @@ -1,4 +1,3 @@ -// $Id: dashboard.js,v 1.13 2010/06/08 05:16:29 webchick Exp $ (function ($) { /** diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module index d1e3582e..08a4cd2b 100644 --- a/modules/dashboard/dashboard.module +++ b/modules/dashboard/dashboard.module @@ -1,5 +1,4 @@ <?php -// $Id: dashboard.module,v 1.41 2010/11/06 23:24:33 webchick Exp $ /** * Implements hook_help(). @@ -82,6 +81,9 @@ function dashboard_permission() { return array( 'access dashboard' => array( 'title' => t('View the administrative dashboard'), + // Note: We translate the 'Administer blocks' permission string here with + // a separate t() call, to make sure it gets the same translation as when + // it's in block_permission(). 'description' => t('Customizing the dashboard requires the !permission-name permission.', array( '!permission-name' => l(t('Administer blocks'), 'admin/people/permissions', array('fragment' => 'module-block')), )), @@ -483,7 +485,7 @@ function dashboard_dashboard_regions() { } /** - * AJAX callback to show disabled blocks in the dashboard customization mode. + * Ajax callback to show disabled blocks in the dashboard customization mode. */ function dashboard_show_disabled() { global $theme_key; @@ -504,7 +506,7 @@ function dashboard_show_disabled() { } /** - * AJAX callback to display the rendered contents of a specific block. + * Ajax callback to display the rendered contents of a specific block. * * @param $module * The block's module name. diff --git a/modules/dashboard/dashboard.test b/modules/dashboard/dashboard.test index e9b12832..7cb93f9f 100644 --- a/modules/dashboard/dashboard.test +++ b/modules/dashboard/dashboard.test @@ -1,9 +1,8 @@ <?php -// $Id: dashboard.test,v 1.8 2010/11/06 23:24:33 webchick Exp $ /** * @file - * Tests for the dashboard module. + * Tests for dashboard.module. */ class DashboardBlocksTestCase extends DrupalWebTestCase { diff --git a/modules/dblog/dblog-rtl.css b/modules/dblog/dblog-rtl.css index 40415c7c..282fe971 100644 --- a/modules/dblog/dblog-rtl.css +++ b/modules/dblog/dblog-rtl.css @@ -1,4 +1,3 @@ -/* $Id: dblog-rtl.css,v 1.6 2010/04/28 20:08:38 dries Exp $ */ .form-item-type, .form-item-severity { diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc index 048a7df1..947100da 100644 --- a/modules/dblog/dblog.admin.inc +++ b/modules/dblog/dblog.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: dblog.admin.inc,v 1.42 2010/12/04 01:52:15 webchick Exp $ /** * @file @@ -286,7 +285,7 @@ function dblog_filter_form($form) { '#type' => 'fieldset', '#title' => t('Filter log messages'), '#collapsible' => TRUE, - '#collapsed' => empty($session), + '#collapsed' => empty($_SESSION['dblog_overview_filter']), ); foreach ($filters as $key => $filter) { $form['filters']['status'][$key] = array( diff --git a/modules/dblog/dblog.css b/modules/dblog/dblog.css index e28e4956..ff310e3b 100644 --- a/modules/dblog/dblog.css +++ b/modules/dblog/dblog.css @@ -1,4 +1,3 @@ -/* $Id: dblog.css,v 1.10 2010/09/09 15:47:03 webchick Exp $ */ .form-item-type, .form-item-severity { diff --git a/modules/dblog/dblog.info b/modules/dblog/dblog.info index bcdad918..85c90aee 100644 --- a/modules/dblog/dblog.info +++ b/modules/dblog/dblog.info @@ -1,4 +1,3 @@ -; $Id: dblog.info,v 1.8 2010/12/20 19:59:41 webchick Exp $ name = Database logging description = Logs and records system events to the database. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x files[] = dblog.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/dblog/dblog.install b/modules/dblog/dblog.install index 279993e7..759c7bc1 100644 --- a/modules/dblog/dblog.install +++ b/modules/dblog/dblog.install @@ -1,5 +1,4 @@ <?php -// $Id: dblog.install,v 1.24 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -92,6 +91,13 @@ function dblog_schema() { return $schema; } +/** + * Implements hook_uninstall(). + */ +function dblog_uninstall() { + variable_del('dblog_row_limit'); +} + /** * @addtogroup updates-6.x-to-7.x * @{ diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index d0e0c40b..496a043a 100644 --- a/modules/dblog/dblog.module +++ b/modules/dblog/dblog.module @@ -1,5 +1,4 @@ <?php -// $Id: dblog.module,v 1.57 2010/10/03 02:14:23 dries Exp $ /** * @file @@ -139,9 +138,12 @@ function _dblog_get_message_types() { * Note some values may be truncated for database column size restrictions. */ function dblog_watchdog(array $log_entry) { + // The user object may not exist in all conditions, so 0 is substituted if needed. + $user_uid = isset($log_entry['user']->uid) ? $log_entry['user']->uid : 0; + Database::getConnection('default', 'default')->insert('watchdog') ->fields(array( - 'uid' => $log_entry['user']->uid, + 'uid' => $user_uid, 'type' => substr($log_entry['type'], 0, 64), 'message' => $log_entry['message'], 'variables' => serialize($log_entry['variables']), diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test index 019f0194..5717455e 100644 --- a/modules/dblog/dblog.test +++ b/modules/dblog/dblog.test @@ -1,5 +1,9 @@ <?php -// $Id: dblog.test,v 1.40 2010/12/04 01:52:15 webchick Exp $ + +/** + * @file + * Tests for dblog.module. + */ class DBLogTestCase extends DrupalWebTestCase { protected $big_user; diff --git a/modules/field/field.api.php b/modules/field/field.api.php index 103be8b4..9c52d24e 100644 --- a/modules/field/field.api.php +++ b/modules/field/field.api.php @@ -1,5 +1,4 @@ <?php -// $Id: field.api.php,v 1.101 2010/12/14 19:50:05 dries Exp $ /** * @ingroup field_fieldable_type @@ -16,7 +15,7 @@ * * Fieldable entities or modules that want to have their components supported * should expose them using this hook. The user-defined settings (weight, - * visibility) are automatically applied on rendered forms and displayed + * visible) are automatically applied on rendered forms and displayed * entities in a #pre_render callback added by field_attach_form() and * field_attach_view(). * @@ -758,7 +757,7 @@ function hook_field_widget_info_alter(&$info) { /** * Return the form for a single field widget. * - * Field widget form elements should be based on the passed in $element, which + * Field widget form elements should be based on the passed-in $element, which * contains the base form element properties derived from the field * configuration. * @@ -1271,7 +1270,7 @@ function hook_field_attach_delete_revision($entity_type, $entity) { */ function hook_field_attach_purge($entity_type, $entity, $field, $instance) { // find the corresponding data in mymodule and purge it - if($entity_type == 'node' && $field->field_name == 'my_field_name') { + if ($entity_type == 'node' && $field->field_name == 'my_field_name') { mymodule_remove_mydata($entity->nid); } } @@ -1319,7 +1318,7 @@ function hook_field_attach_view_alter(&$output, $context) { * * This hook is invoked after the field module has performed the operation. * - * @param &$entity + * @param $entity * The entity being prepared for translation. * @param $context * An associative array containing: @@ -1362,7 +1361,7 @@ function hook_field_language_alter(&$display_language, $context) { * This hook is invoked from field_available_languages() to allow modules to * alter the array of available languages for the given field. * - * @param &$languages + * @param $languages * A reference to an array of language codes to be made available. * @param $context * An associative array containing: @@ -2205,7 +2204,7 @@ function hook_field_display_ENTITY_TYPE_alter(&$display, $context) { */ function hook_field_extra_fields_display_alter(&$displays, $context) { if ($context['entity_type'] == 'taxonomy_term' && $context['view_mode'] == 'full') { - $displays['description']['visibility'] = FALSE; + $displays['description']['visible'] = FALSE; } } @@ -2416,7 +2415,7 @@ function hook_field_delete_instance($instance) { * @param $field * The field record just read from the database. */ -function hook_field_read_field(&$field) { +function hook_field_read_field($field) { // @todo Needs function body. } diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc index e2224381..4ca15f54 100644 --- a/modules/field/field.attach.inc +++ b/modules/field/field.attach.inc @@ -1,5 +1,4 @@ <?php -// $Id: field.attach.inc,v 1.98 2010/12/07 05:09:58 webchick Exp $ /** * @file @@ -258,9 +257,9 @@ function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $opti * - 'deleted': If TRUE, the function will operate on deleted fields * as well as non-deleted fields. If unset or FALSE, only * non-deleted fields are operated on. - * - 'language': A language code or an array of language codes keyed by field - * name. It will be used to narrow down to a single value the available - * languages to act on. + * - 'language': A language code or an array of arrays of language codes keyed + * by entity id and field name. It will be used to narrow down to a single + * value the available languages to act on. * * @return * An array of returned values keyed by entity id. @@ -312,7 +311,8 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b = // Unless a language suggestion is provided we iterate on all the // available languages. $available_languages = field_available_languages($entity_type, $field); - $languages = _field_language_suggestion($available_languages, $options['language'], $field_name); + $language = !empty($options['language'][$id]) ? $options['language'][$id] : $options['language']; + $languages = _field_language_suggestion($available_languages, $language, $field_name); foreach ($languages as $langcode) { $grouped_items[$field_id][$langcode][$id] = isset($entity->{$field_name}[$langcode]) ? $entity->{$field_name}[$langcode] : array(); } @@ -348,7 +348,7 @@ function _field_invoke_multiple($op, $entity_type, $entities, &$a = NULL, &$b = // fields with an empty array (those are not equivalent on update). foreach ($grouped_entities[$field_id] as $id => $entity) { foreach ($grouped_items[$field_id] as $langcode => $items) { - if ($grouped_items[$field_id][$langcode][$id] !== array() || isset($entity->{$field_name}[$langcode])) { + if (isset($grouped_items[$field_id][$langcode][$id]) && ($grouped_items[$field_id][$langcode][$id] !== array() || isset($entity->{$field_name}[$langcode]))) { $entity->{$field_name}[$langcode] = $grouped_items[$field_id][$langcode][$id]; } } @@ -780,11 +780,11 @@ function field_attach_validate($entity_type, $entity) { * There are two levels of validation for fields in forms: widget * validation, and field validation. * - Widget validation steps are specific to a given widget's own form - * structure and UI metaphors. They are executed through FAPI's - * #element_validate property during normal form validation. + * structure and UI metaphors. They are executed through FAPI's + * #element_validate property during normal form validation. * - Field validation steps are common to a given field type, independently of - * the specific widget being used in a given form. They are defined in the - * field type's implementation of hook_field_validate(). + * the specific widget being used in a given form. They are defined in the + * field type's implementation of hook_field_validate(). * * This function performs field validation in the context of a form * submission. It converts field validation errors into form errors @@ -878,7 +878,7 @@ function field_attach_presave($entity_type, $entity) { /** * Save field data for a new entity. * - * The passed in entity must already contain its id and (if applicable) + * The passed-in entity must already contain its id and (if applicable) * revision id attributes. * Default values (if any) will be saved for fields not present in the * $entity. @@ -1075,8 +1075,13 @@ function field_attach_delete_revision($entity_type, $entity) { * An array of entities, keyed by entity id. * @param $view_mode * View mode, e.g. 'full', 'teaser'... + * @param $langcode + * (Optional) The language the field values are to be shown in. If no language + * is provided the current language is used. */ -function field_attach_prepare_view($entity_type, $entities, $view_mode) { +function field_attach_prepare_view($entity_type, $entities, $view_mode, $langcode = NULL) { + $options = array('language' => array()); + // To ensure hooks are only run once per entity, only process items without // the _field_view_prepared flag. // @todo: resolve this more generally for both entity and field level hooks. @@ -1086,17 +1091,22 @@ function field_attach_prepare_view($entity_type, $entities, $view_mode) { // Add this entity to the items to be prepared. $prepare[$id] = $entity; + // Determine the actual language to display for each field, given the + // languages available in the field data. + $options['language'][$id] = field_language($entity_type, $entity, NULL, $langcode); + // Mark this item as prepared. $entity->_field_view_prepared = TRUE; } } + $null = NULL; // First let the field types do their preparation. - _field_invoke_multiple('prepare_view', $entity_type, $prepare); + _field_invoke_multiple('prepare_view', $entity_type, $prepare, $null, $null, $options); // Then let the formatters do their own specific massaging. // field_default_prepare_view() takes care of dispatching to the correct // formatters according to the display settings for the view mode. - _field_invoke_multiple_default('prepare_view', $entity_type, $prepare, $view_mode); + _field_invoke_multiple_default('prepare_view', $entity_type, $prepare, $view_mode, $null, $options); } /** diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc index c2eb3ab6..339e9c4e 100644 --- a/modules/field/field.crud.inc +++ b/modules/field/field.crud.inc @@ -1,5 +1,4 @@ <?php -// $Id: field.crud.inc,v 1.74 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -422,7 +421,6 @@ function field_delete_field($field_name) { * will be given the following default values: * - label: the field name * - description: empty string - * - weight: 0 * - required: FALSE * - default_value_function: empty string * - settings: each omitted setting is given the default value specified in @@ -635,12 +633,11 @@ function _field_write_instance($instance, $update = FALSE) { } /** - * Reads a single instance record directly from the database. + * Reads a single instance record from the database. * - * Generally, you should use the field_info_instance() instead. - * - * This function will not return deleted instances. Use - * field_read_instances() instead for this purpose. + * Generally, you should use field_info_instance() instead, as it + * provides caching and allows other modules the opportunity to + * append additional formatters, widgets, and other information. * * @param $entity_type * The type of entity to which the field is bound. diff --git a/modules/field/field.default.inc b/modules/field/field.default.inc index eb09858a..a10d1387 100644 --- a/modules/field/field.default.inc +++ b/modules/field/field.default.inc @@ -1,5 +1,4 @@ <?php -// $Id: field.default.inc,v 1.41 2010/11/21 19:09:18 dries Exp $ /** * @file @@ -82,7 +81,7 @@ function field_default_validate($entity_type, $entity, $field, $instance, $langc if ($field['cardinality'] != FIELD_CARDINALITY_UNLIMITED && count($items) > $field['cardinality']) { $errors[$field['field_name']][$langcode][0][] = array( 'error' => 'field_cardinality', - 'message' => t('%name: this field cannot hold more than @count values.', array('%name' => t($instance['label']), '@count' => $field['cardinality'])), + 'message' => t('%name: this field cannot hold more than @count values.', array('%name' => $instance['label'], '@count' => $field['cardinality'])), ); } } @@ -135,21 +134,25 @@ function field_default_insert($entity_type, $entity, $field, $instance, $langcod * - the name of a view mode * - or an array of display settings to use for display, as found in the * 'display' entry of $instance definitions. -*/ + */ function field_default_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $display) { // Group entities, instances and items by formatter module. $modules = array(); foreach ($instances as $id => $instance) { if (is_string($display)) { $view_mode = $display; - $display = field_get_display($instance, $view_mode, $entities[$id]); + $instance_display = field_get_display($instance, $view_mode, $entities[$id]); + } + else { + $instance_display = $display; } - if ($display['type'] !== 'hidden') { - $module = $display['module']; + + if ($instance_display['type'] !== 'hidden') { + $module = $instance_display['module']; $modules[$module] = $module; $grouped_entities[$module][$id] = $entities[$id]; $grouped_instances[$module][$id] = $instance; - $grouped_displays[$module][$id] = $display; + $grouped_displays[$module][$id] = $instance_display; // hook_field_formatter_prepare_view() alters $items by reference. $grouped_items[$module][$id] = &$items[$id]; } @@ -211,7 +214,7 @@ function field_default_view($entity_type, $entity, $field, $instance, $langcode, $info = array( '#theme' => 'field', '#weight' => $display['weight'], - '#title' => t($instance['label']), + '#title' => $instance['label'], '#access' => field_access('view', $field, $entity_type, $entity), '#label_display' => $display['label'], '#view_mode' => $view_mode, diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index 02a8d56d..845f0410 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -1,5 +1,4 @@ <?php -// $Id: field.form.inc,v 1.54 2010/11/20 19:57:01 webchick Exp $ /** * @file @@ -70,7 +69,7 @@ function field_default_form($entity_type, $entity, $field, $instance, $langcode, '#language' => $langcode, '#field_parents' => $parents, '#columns' => array_keys($field['columns']), - '#title' => check_plain(t($instance['label'])), + '#title' => check_plain($instance['label']), '#description' => field_filter_xss($instance['description']), // Only the first widget should be required. '#required' => $delta == 0 && $instance['required'], @@ -152,8 +151,8 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form, break; } - $title = check_plain(t($instance['label'])); - $description = field_filter_xss(t($instance['description'])); + $title = check_plain($instance['label']); + $description = field_filter_xss($instance['description']); $id_prefix = implode('-', array_merge($parents, array($field_name))); $wrapper_id = drupal_html_id($id_prefix . '-add-more-wrapper'); @@ -414,7 +413,7 @@ function field_add_more_js($form, $form_state) { return; } - // Add a DIV around the delta receiving the AJAX effect. + // Add a DIV around the delta receiving the Ajax effect. $delta = $element['#max_delta']; $element[$delta]['#prefix'] = '<div class="ajax-new-content">' . (isset($element[$delta]['#prefix']) ? $element[$delta]['#prefix'] : ''); $element[$delta]['#suffix'] = (isset($element[$delta]['#suffix']) ? $element[$delta]['#suffix'] : '') . '</div>'; diff --git a/modules/field/field.info b/modules/field/field.info index f4416d54..8a6f0a75 100644 --- a/modules/field/field.info +++ b/modules/field/field.info @@ -1,4 +1,3 @@ -; $Id: field.info,v 1.10 2010/12/20 19:59:41 webchick Exp $ name = Field description = Field API to add fields to entities like nodes and users. package = Core @@ -11,8 +10,8 @@ dependencies[] = field_sql_storage required = TRUE stylesheets[all][] = theme/field.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc index 40dde2d9..02707f6d 100644 --- a/modules/field/field.info.inc +++ b/modules/field/field.info.inc @@ -1,5 +1,4 @@ <?php -// $Id: field.info.inc,v 1.58 2010/12/17 01:36:04 dries Exp $ /** * @file @@ -287,8 +286,6 @@ function _field_info_prepare_field($field) { * Field instance array. */ function _field_info_prepare_instance($instance, $field) { - $field_type = field_info_field_types($field['type']); - // Make sure all expected instance settings are present. $instance['settings'] += field_info_instance_settings($field['type']); @@ -735,7 +732,7 @@ function field_info_instance($entity_type, $field_name, $bundle_name) { * 'default' => array( * 'weight' => The weight of the component in displayed entities in * this view mode, - * 'visibility' => Whether the component is visible or hidden in + * 'visible' => TRUE if the component is visible, FALSE if hidden, in * displayed entities in this view mode, * ), * 'teaser' => array( @@ -793,7 +790,7 @@ function field_info_max_weight($entity_type, $bundle, $context) { if ($context == 'form') { $weights[] = $instance['widget']['weight']; } - else { + elseif (isset($instance['display'][$context]['weight'])) { $weights[] = $instance['display'][$context]['weight']; } } diff --git a/modules/field/field.install b/modules/field/field.install index ab77eb80..d56eb904 100644 --- a/modules/field/field.install +++ b/modules/field/field.install @@ -1,5 +1,4 @@ <?php -// $Id: field.install,v 1.27 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -310,18 +309,27 @@ function _update_7000_field_delete_instance($field_name, $entity_type, $bundle) /** * Utility function: fetch all the field definitions from the database. * + * Warning: unlike the field_read_fields() API function, this function returns + * all fields by default, including deleted and inactive fields, unless + * specified otherwise in the $conditions parameter. + * * @param $conditions * An array of conditions to limit the select query to. + * @param $key + * The name of the field property the return array is indexed by. Using + * anything else than 'id' might cause incomplete results if the $conditions + * do not filter out deleted fields. + * + * @return + * An array of fields matching $conditions, keyed by the property specified + * by the $key parameter. */ -function _update_7000_field_read_fields(array $conditions = array()) { +function _update_7000_field_read_fields(array $conditions = array(), $key = 'id') { $fields = array(); $query = db_select('field_config', 'fc', array('fetch' => PDO::FETCH_ASSOC)) - ->fields('fc') - ->condition('deleted', 0); - if (!empty($conditions)) { - foreach ($conditions as $column => $value) { - $query->condition($column, $value); - } + ->fields('fc'); + foreach ($conditions as $column => $value) { + $query->condition($column, $value); } foreach ($query->execute() as $record) { $field = unserialize($record['data']); @@ -338,7 +346,7 @@ function _update_7000_field_read_fields(array $conditions = array()) { $field['translatable'] = $record['translatable']; $field['deleted'] = $record['deleted']; - $fields[$field['field_name']] = $field; + $fields[$field[$key]] = $field; } return $fields; } diff --git a/modules/field/field.module b/modules/field/field.module index 089dccfa..9e03c8d9 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -1,5 +1,4 @@ <?php -// $Id: field.module,v 1.94 2011/01/02 17:26:39 webchick Exp $ /** * @file * Attach custom data fields to Drupal entities. @@ -559,7 +558,7 @@ function _field_sort_items_value_helper($a, $b) { * // the 'default' mode: * 'default' => array( * 'weight' => The weight of the pseudo-field, - * 'visibility' => Whether the pseudo-field is visible or hidden, + * 'visible' => TRUE if the pseudo-field is visible, FALSE if hidden, * ), * 'full' => ... * ), diff --git a/modules/field/field.multilingual.inc b/modules/field/field.multilingual.inc index b2bb36ca..00adf927 100644 --- a/modules/field/field.multilingual.inc +++ b/modules/field/field.multilingual.inc @@ -1,5 +1,4 @@ <?php -// $Id: field.multilingual.inc,v 1.15 2011/01/03 18:03:54 webchick Exp $ /** * @file diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.info b/modules/field/modules/field_sql_storage/field_sql_storage.info index b7e02d5e..204bdb79 100644 --- a/modules/field/modules/field_sql_storage/field_sql_storage.info +++ b/modules/field/modules/field_sql_storage/field_sql_storage.info @@ -1,4 +1,3 @@ -; $Id: field_sql_storage.info,v 1.6 2010/12/20 19:59:41 webchick Exp $ name = Field SQL storage description = Stores field data in an SQL database. package = Core @@ -8,8 +7,8 @@ dependencies[] = field files[] = field_sql_storage.test required = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.install b/modules/field/modules/field_sql_storage/field_sql_storage.install index bdb56312..647296e4 100644 --- a/modules/field/modules/field_sql_storage/field_sql_storage.install +++ b/modules/field/modules/field_sql_storage/field_sql_storage.install @@ -1,5 +1,4 @@ <?php -// $Id: field_sql_storage.install,v 1.14 2011/01/02 17:26:39 webchick Exp $ /** * @file diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.module b/modules/field/modules/field_sql_storage/field_sql_storage.module index 23f44900..6f49167e 100644 --- a/modules/field/modules/field_sql_storage/field_sql_storage.module +++ b/modules/field/modules/field_sql_storage/field_sql_storage.module @@ -1,5 +1,4 @@ <?php -// $Id: field_sql_storage.module,v 1.58 2010/12/21 04:11:12 webchick Exp $ /** * @file diff --git a/modules/field/modules/field_sql_storage/field_sql_storage.test b/modules/field/modules/field_sql_storage/field_sql_storage.test index e5d62622..f94344fa 100644 --- a/modules/field/modules/field_sql_storage/field_sql_storage.test +++ b/modules/field/modules/field_sql_storage/field_sql_storage.test @@ -1,9 +1,8 @@ <?php -// $Id: field_sql_storage.test,v 1.23 2010/12/14 19:50:05 dries Exp $ /** * @file - * Unit tests for field_sql_ storage.module + * Tests for field_sql_storage.module. * * Field_sql_storage.module implements the default back-end storage plugin * for the Field Strage API. diff --git a/modules/field/modules/list/list.info b/modules/field/modules/list/list.info index cefac307..496e7670 100644 --- a/modules/field/modules/list/list.info +++ b/modules/field/modules/list/list.info @@ -1,4 +1,3 @@ -; $Id: list.info,v 1.10 2010/12/20 19:59:41 webchick Exp $ name = List description = Defines list field types. Use with Options to create selection lists. package = Core @@ -8,8 +7,8 @@ dependencies[] = field dependencies[] = options files[] = tests/list.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/modules/list/list.install b/modules/field/modules/list/list.install index 3642b1d5..91c7649c 100644 --- a/modules/field/modules/list/list.install +++ b/modules/field/modules/list/list.install @@ -1,5 +1,4 @@ <?php -// $Id: list.install,v 1.4 2010/12/18 00:50:03 dries Exp $ /** * @file @@ -51,7 +50,7 @@ function list_field_schema($field) { */ function list_update_7001() { $fields = _update_7000_field_read_fields(array('module' => 'list')); - foreach ($fields as $field_name => $field) { + foreach ($fields as $field) { $update = array(); // Translate the old string format into the new array format. @@ -61,7 +60,7 @@ function list_update_7001() { $allowed_values = _list_update_7001_extract_allowed_values($allowed_values, $position_keys); // Additionally, float keys need to be disambiguated ('.5' is '0.5'). - if ($field['type'] == 'list_number') { + if ($field['type'] == 'list_number' && !empty($allowed_values)) { $keys = array_map(create_function('$a', 'return (string) (float) $a;'), array_keys($allowed_values)); $allowed_values = array_combine($keys, array_values($allowed_values)); } @@ -116,3 +115,15 @@ function _list_update_7001_extract_allowed_values($string, $position_keys) { return $values; } + +/** + * Re-apply list_update_7001() for deleted fields. + */ +function list_update_7002() { + // See http://drupal.org/node/1022924: list_update_7001() intitally + // overlooked deleted fields, which then caused fatal errors when the fields + // were being purged. + // list_update_7001() has the required checks to ensure it is reentrant, so + // it can simply be executed once more.. + list_update_7001(); +} \ No newline at end of file diff --git a/modules/field/modules/list/list.module b/modules/field/modules/list/list.module index ca45e68f..608679bb 100644 --- a/modules/field/modules/list/list.module +++ b/modules/field/modules/list/list.module @@ -1,5 +1,4 @@ <?php -// $Id: list.module,v 1.39 2010/12/18 00:50:03 dries Exp $ /** * @file @@ -380,7 +379,7 @@ function list_field_validate($entity_type, $entity, $field, $instance, $langcode if (!empty($allowed_values) && !isset($allowed_values[$item['value']])) { $errors[$field['field_name']][$langcode][$delta][] = array( 'error' => 'list_illegal_value', - 'message' => t('%name: illegal value.', array('%name' => t($instance['label']))), + 'message' => t('%name: illegal value.', array('%name' => $instance['label'])), ); } } diff --git a/modules/field/modules/list/tests/list.test b/modules/field/modules/list/tests/list.test index ea23e6cb..941d2b4c 100644 --- a/modules/field/modules/list/tests/list.test +++ b/modules/field/modules/list/tests/list.test @@ -1,9 +1,8 @@ <?php -// $Id: list.test,v 1.11 2010/12/18 00:50:03 dries Exp $ /** * @file - * Tests for the 'List' field types. + * Tests for list.module. */ /** @@ -98,8 +97,8 @@ class ListFieldTestCase extends FieldTestCase { } /** -* List module UI tests. -*/ + * List module UI tests. + */ class ListFieldUITestCase extends FieldTestCase { public static function getInfo() { return array( diff --git a/modules/field/modules/list/tests/list_test.info b/modules/field/modules/list/tests/list_test.info index 0760a3e7..23cac1e1 100644 --- a/modules/field/modules/list/tests/list_test.info +++ b/modules/field/modules/list/tests/list_test.info @@ -1,4 +1,3 @@ -;$Id: list_test.info,v 1.2 2010/12/20 19:59:41 webchick Exp $ name = "List test" description = "Support module for the List module tests." core = 7.x @@ -6,8 +5,8 @@ package = Testing version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/modules/list/tests/list_test.module b/modules/field/modules/list/tests/list_test.module index 98fb1721..8d534041 100644 --- a/modules/field/modules/list/tests/list_test.module +++ b/modules/field/modules/list/tests/list_test.module @@ -1,5 +1,4 @@ <?php -// $Id: list_test.module,v 1.1 2009/12/14 20:18:55 dries Exp $ /** * @file diff --git a/modules/field/modules/number/number.info b/modules/field/modules/number/number.info index 5c39c1fa..ca9e5fa8 100644 --- a/modules/field/modules/number/number.info +++ b/modules/field/modules/number/number.info @@ -1,4 +1,3 @@ -; $Id: number.info,v 1.9 2010/12/20 19:59:41 webchick Exp $ name = Number description = Defines numeric field types. package = Core @@ -7,8 +6,8 @@ core = 7.x dependencies[] = field files[] = number.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/modules/number/number.install b/modules/field/modules/number/number.install index 3c7e4384..02c7a305 100644 --- a/modules/field/modules/number/number.install +++ b/modules/field/modules/number/number.install @@ -1,5 +1,4 @@ <?php -// $Id: number.install,v 1.1 2010/09/04 15:40:51 dries Exp $ /** * @file diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module index 59144081..20e38077 100644 --- a/modules/field/modules/number/number.module +++ b/modules/field/modules/number/number.module @@ -1,5 +1,4 @@ <?php -// $Id: number.module,v 1.46 2010/10/31 12:11:59 dries Exp $ /** * @file @@ -139,13 +138,13 @@ function number_field_validate($entity_type, $entity, $field, $instance, $langco if (is_numeric($instance['settings']['min']) && $item['value'] < $instance['settings']['min']) { $errors[$field['field_name']][$langcode][$delta][] = array( 'error' => 'number_min', - 'message' => t('%name: the value may be no less than %min.', array('%name' => t($instance['label']), '%min' => $instance['settings']['min'])), + 'message' => t('%name: the value may be no less than %min.', array('%name' => $instance['label'], '%min' => $instance['settings']['min'])), ); } if (is_numeric($instance['settings']['max']) && $item['value'] > $instance['settings']['max']) { $errors[$field['field_name']][$langcode][$delta][] = array( 'error' => 'number_max', - 'message' => t('%name: the value may be no greater than %max.', array('%name' => t($instance['label']), '%max' => $instance['settings']['max'])), + 'message' => t('%name: the value may be no greater than %max.', array('%name' => $instance['label'], '%max' => $instance['settings']['max'])), ); } } @@ -368,12 +367,12 @@ function number_field_widget_validate($element, &$form_state) { case 'float': case 'decimal': $regexp = '@[^-0-9\\' . $field['settings']['decimal_separator'] . ']@'; - $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => t($instance['label']), '@separator' => $field['settings']['decimal_separator'])); + $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => $instance['label'], '@separator' => $field['settings']['decimal_separator'])); break; case 'integer': $regexp = '@[^-0-9]@'; - $message = t('Only numbers are allowed in %field.', array('%field' => t($instance['label']))); + $message = t('Only numbers are allowed in %field.', array('%field' => $instance['label'])); break; } if ($value != preg_replace($regexp, '', $value)) { diff --git a/modules/field/modules/number/number.test b/modules/field/modules/number/number.test index 21a4c94f..ec100f18 100644 --- a/modules/field/modules/number/number.test +++ b/modules/field/modules/number/number.test @@ -1,9 +1,8 @@ <?php -// $Id: number.test,v 1.1 2010/10/23 21:03:22 webchick Exp $ /** * @file - * Tests for number field types. + * Tests for number.module. */ /** diff --git a/modules/field/modules/options/options.api.php b/modules/field/modules/options/options.api.php index 906c932c..dfbb631c 100644 --- a/modules/field/modules/options/options.api.php +++ b/modules/field/modules/options/options.api.php @@ -1,5 +1,4 @@ <?php -// $Id: options.api.php,v 1.1 2009/12/14 20:18:55 dries Exp $ /** * @file diff --git a/modules/field/modules/options/options.info b/modules/field/modules/options/options.info index b9996303..02263f7c 100644 --- a/modules/field/modules/options/options.info +++ b/modules/field/modules/options/options.info @@ -1,4 +1,3 @@ -; $Id: options.info,v 1.8 2010/12/20 19:59:41 webchick Exp $ name = Options description = Defines selection, check box and radio button widgets for text and numeric fields. package = Core @@ -7,8 +6,8 @@ core = 7.x dependencies[] = field files[] = options.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/modules/options/options.module b/modules/field/modules/options/options.module index 0da436c5..385f3f47 100644 --- a/modules/field/modules/options/options.module +++ b/modules/field/modules/options/options.module @@ -1,5 +1,4 @@ <?php -// $Id: options.module,v 1.30 2010/12/06 18:04:27 webchick Exp $ /** * @file diff --git a/modules/field/modules/options/options.test b/modules/field/modules/options/options.test index e94f4c03..ea58f27f 100644 --- a/modules/field/modules/options/options.test +++ b/modules/field/modules/options/options.test @@ -1,5 +1,9 @@ <?php -// $Id: options.test,v 1.23 2010/12/18 00:50:03 dries Exp $ + +/** + * @file + * Tests for options.module. + */ class OptionsWidgetsTestCase extends FieldTestCase { public static function getInfo() { diff --git a/modules/field/modules/text/text.info b/modules/field/modules/text/text.info index 0b90b111..4c5e875d 100644 --- a/modules/field/modules/text/text.info +++ b/modules/field/modules/text/text.info @@ -1,4 +1,3 @@ -; $Id: text.info,v 1.9 2010/12/20 19:59:41 webchick Exp $ name = Text description = Defines simple text field types. package = Core @@ -8,8 +7,8 @@ dependencies[] = field files[] = text.test required = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/modules/text/text.install b/modules/field/modules/text/text.install index cbb012c4..b9bd25f1 100644 --- a/modules/field/modules/text/text.install +++ b/modules/field/modules/text/text.install @@ -1,5 +1,4 @@ <?php -// $Id: text.install,v 1.4 2010/10/20 15:57:42 webchick Exp $ /** * @file @@ -93,7 +92,7 @@ function text_update_7000() { 'module' => 'text', 'storage_type' => 'field_sql_storage', )); - foreach ($fields as $field_name => $field) { + foreach ($fields as $field) { if ($field['deleted']) { $table = "field_deleted_data_{$field['id']}"; $revision_table = "field_deleted_revision_{$field['id']}"; diff --git a/modules/field/modules/text/text.js b/modules/field/modules/text/text.js index 5de60b63..f3ae8943 100644 --- a/modules/field/modules/text/text.js +++ b/modules/field/modules/text/text.js @@ -1,4 +1,3 @@ -// $Id: text.js,v 1.5 2010/10/24 04:18:10 webchick Exp $ (function ($) { diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module index 7d101fdb..89c605cf 100644 --- a/modules/field/modules/text/text.module +++ b/modules/field/modules/text/text.module @@ -1,5 +1,4 @@ <?php -// $Id: text.module,v 1.68 2010/11/13 07:39:35 webchick Exp $ /** * @file diff --git a/modules/field/modules/text/text.test b/modules/field/modules/text/text.test index a2003eeb..b42fed7e 100644 --- a/modules/field/modules/text/text.test +++ b/modules/field/modules/text/text.test @@ -1,5 +1,9 @@ <?php -// $Id: text.test,v 1.32 2010/10/25 15:51:21 webchick Exp $ + +/** + * @file + * Tests for text.module. + */ class TextFieldTestCase extends DrupalWebTestCase { protected $instance; diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test index 79c7c971..9281273f 100644 --- a/modules/field/tests/field.test +++ b/modules/field/tests/field.test @@ -1,9 +1,8 @@ <?php -// $Id: field.test,v 1.47 2010/12/15 04:13:48 webchick Exp $ /** * @file - * Unit test file for fields in core. + * Tests for field.module. */ /** @@ -762,6 +761,55 @@ class FieldAttachOtherTestCase extends FieldAttachTestCase { $this->assertTrue($result, t('Variable $@field_name correctly populated.', array('@field_name' => $this->field_name))); } + /** + * Tests the 'multiple entity' behavior of field_attach_prepare_view(). + */ + function testFieldAttachPrepareViewMultiple() { + $entity_type = 'test_entity'; + $langcode = LANGUAGE_NONE; + + // Set the instance to be hidden. + $this->instance['display']['full']['type'] = 'hidden'; + field_update_instance($this->instance); + + // Set up a second instance on another bundle, with a formatter that uses + // hook_field_formatter_prepare_view(). + field_test_create_bundle('test_bundle_2'); + $formatter_setting = $this->randomName(); + $this->instance2 = $this->instance; + $this->instance2['bundle'] = 'test_bundle_2'; + $this->instance2['display']['full'] = array( + 'type' => 'field_test_with_prepare_view', + 'settings' => array( + 'test_formatter_setting_additional' => $formatter_setting, + ) + ); + field_create_instance($this->instance2); + + // Create one entity in each bundle. + $entity1_init = field_test_create_stub_entity(1, 1, 'test_bundle'); + $values1 = $this->_generateTestFieldValues($this->field['cardinality']); + $entity1_init->{$this->field_name}[$langcode] = $values1; + + $entity2_init = field_test_create_stub_entity(2, 2, 'test_bundle_2'); + $values2 = $this->_generateTestFieldValues($this->field['cardinality']); + $entity2_init->{$this->field_name}[$langcode] = $values2; + + // Run prepare_view, and check that the entities come out as expected. + $entity1 = clone($entity1_init); + $entity2 = clone($entity2_init); + field_attach_prepare_view($entity_type, array($entity1->ftid => $entity1, $entity2->ftid => $entity2), 'full'); + $this->assertFalse(isset($entity1->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 1 did not run through the prepare_view hook.'); + $this->assertTrue(isset($entity2->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 2 ran through the prepare_view hook.'); + + // Same thing, reversed order. + $entity1 = clone($entity1_init); + $entity2 = clone($entity2_init); + field_attach_prepare_view($entity_type, array($entity2->ftid => $entity2, $entity1->ftid => $entity1), 'full'); + $this->assertFalse(isset($entity1->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 1 did not run through the prepare_view hook.'); + $this->assertTrue(isset($entity2->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 2 ran through the prepare_view hook.'); + } + /** * Test field cache. */ @@ -1448,7 +1496,7 @@ class FieldFormTestCase extends FieldTestCase { $field_values[$weight]['value'] = (string) $value; $pattern[$weight] = "<input [^>]*value=\"$value\" [^>]*"; } - // Press 'add more' button through AJAX, and place the expected HTML result + // Press 'add more' button through Ajax, and place the expected HTML result // as the tested content. $commands = $this->drupalPostAJAX(NULL, $edit, $this->field_name . '_add_more'); $this->content = $commands[1]['data']; @@ -1568,109 +1616,109 @@ class FieldFormTestCase extends FieldTestCase { * Tests Field API form integration within a subform. */ function testNestedFieldForm() { - // Add two instances on the 'test_bundle' - field_create_field($this->field_single); - field_create_field($this->field_unlimited); - $this->instance['field_name'] = 'field_single'; - $this->instance['label'] = 'Single field'; - field_create_instance($this->instance); - $this->instance['field_name'] = 'field_unlimited'; - $this->instance['label'] = 'Unlimited field'; - field_create_instance($this->instance); - - // Create two entities. - $entity_1 = field_test_create_stub_entity(1, 1); - $entity_1->is_new = TRUE; - $entity_1->field_single[LANGUAGE_NONE][] = array('value' => 0); - $entity_1->field_unlimited[LANGUAGE_NONE][] = array('value' => 1); - field_test_entity_save($entity_1); - - $entity_2 = field_test_create_stub_entity(2, 2); - $entity_2->is_new = TRUE; - $entity_2->field_single[LANGUAGE_NONE][] = array('value' => 10); - $entity_2->field_unlimited[LANGUAGE_NONE][] = array('value' => 11); - field_test_entity_save($entity_2); - - // Display the 'combined form'. - $this->drupalGet('test-entity/nested/1/2'); - $this->assertFieldByName('field_single[und][0][value]', 0, t('Entity 1: field_single value appears correctly is the form.')); - $this->assertFieldByName('field_unlimited[und][0][value]', 1, t('Entity 1: field_unlimited value 0 appears correctly is the form.')); - $this->assertFieldByName('entity_2[field_single][und][0][value]', 10, t('Entity 2: field_single value appears correctly is the form.')); - $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 11, t('Entity 2: field_unlimited value 0 appears correctly is the form.')); - - // Submit the form and check that the entities are updated accordingly. - $edit = array( - 'field_single[und][0][value]' => 1, - 'field_unlimited[und][0][value]' => 2, - 'field_unlimited[und][1][value]' => 3, - 'entity_2[field_single][und][0][value]' => 11, - 'entity_2[field_unlimited][und][0][value]' => 12, - 'entity_2[field_unlimited][und][1][value]' => 13, - ); - $this->drupalPost(NULL, $edit, t('Save')); - field_cache_clear(); - $entity_1 = field_test_create_stub_entity(1); - $entity_2 = field_test_create_stub_entity(2); - $this->assertFieldValues($entity_1, 'field_single', LANGUAGE_NONE, array(1)); - $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(2, 3)); - $this->assertFieldValues($entity_2, 'field_single', LANGUAGE_NONE, array(11)); - $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(12, 13)); - - // Submit invalid values and check that errors are reported on the - // correct widgets. - $edit = array( - 'field_unlimited[und][1][value]' => -1, - ); - $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); - $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 1: the field validation error was reported.')); - $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-field-unlimited-und-1-value')); - $this->assertTrue($error_field, t('Entity 1: the error was flagged on the correct element.')); - $edit = array( - 'entity_2[field_unlimited][und][1][value]' => -1, - ); - $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); - $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 2: the field validation error was reported.')); - $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-entity-2-field-unlimited-und-1-value')); - $this->assertTrue($error_field, t('Entity 2: the error was flagged on the correct element.')); - - // Test that reordering works on both entities. - $edit = array( - 'field_unlimited[und][0][_weight]' => 0, - 'field_unlimited[und][1][_weight]' => -1, - 'entity_2[field_unlimited][und][0][_weight]' => 0, - 'entity_2[field_unlimited][und][1][_weight]' => -1, - ); - $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); - field_cache_clear(); - $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2)); - $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 12)); - - // Test the 'add more' buttons. Only AJAX submission is tested, because - // the two 'add more' buttons present in the form have the same #value, - // which confuses drupalPost(). - // 'Add more' button in the first entity: - $this->drupalGet('test-entity/nested/1/2'); - $this->drupalPostAJAX(NULL, array(), 'field_unlimited_add_more'); - $this->assertFieldByName('field_unlimited[und][0][value]', 3, t('Entity 1: field_unlimited value 0 appears correctly is the form.')); - $this->assertFieldByName('field_unlimited[und][1][value]', 2, t('Entity 1: field_unlimited value 1 appears correctly is the form.')); - $this->assertFieldByName('field_unlimited[und][2][value]', '', t('Entity 1: field_unlimited value 2 appears correctly is the form.')); - $this->assertFieldByName('field_unlimited[und][3][value]', '', t('Entity 1: an empty widget was added for field_unlimited value 3.')); - // 'Add more' button in the first entity (changing field values): - $edit = array( - 'entity_2[field_unlimited][und][0][value]' => 13, - 'entity_2[field_unlimited][und][1][value]' => 14, - 'entity_2[field_unlimited][und][2][value]' => 15, - ); - $this->drupalPostAJAX(NULL, $edit, 'entity_2_field_unlimited_add_more'); - $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 13, t('Entity 2: field_unlimited value 0 appears correctly is the form.')); - $this->assertFieldByName('entity_2[field_unlimited][und][1][value]', 14, t('Entity 2: field_unlimited value 1 appears correctly is the form.')); - $this->assertFieldByName('entity_2[field_unlimited][und][2][value]', 15, t('Entity 2: field_unlimited value 2 appears correctly is the form.')); - $this->assertFieldByName('entity_2[field_unlimited][und][3][value]', '', t('Entity 2: an empty widget was added for field_unlimited value 3.')); - // Save the form and check values are saved correclty. - $this->drupalPost(NULL, array(), t('Save')); - field_cache_clear(); - $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2)); - $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 14, 15)); + // Add two instances on the 'test_bundle' + field_create_field($this->field_single); + field_create_field($this->field_unlimited); + $this->instance['field_name'] = 'field_single'; + $this->instance['label'] = 'Single field'; + field_create_instance($this->instance); + $this->instance['field_name'] = 'field_unlimited'; + $this->instance['label'] = 'Unlimited field'; + field_create_instance($this->instance); + + // Create two entities. + $entity_1 = field_test_create_stub_entity(1, 1); + $entity_1->is_new = TRUE; + $entity_1->field_single[LANGUAGE_NONE][] = array('value' => 0); + $entity_1->field_unlimited[LANGUAGE_NONE][] = array('value' => 1); + field_test_entity_save($entity_1); + + $entity_2 = field_test_create_stub_entity(2, 2); + $entity_2->is_new = TRUE; + $entity_2->field_single[LANGUAGE_NONE][] = array('value' => 10); + $entity_2->field_unlimited[LANGUAGE_NONE][] = array('value' => 11); + field_test_entity_save($entity_2); + + // Display the 'combined form'. + $this->drupalGet('test-entity/nested/1/2'); + $this->assertFieldByName('field_single[und][0][value]', 0, t('Entity 1: field_single value appears correctly is the form.')); + $this->assertFieldByName('field_unlimited[und][0][value]', 1, t('Entity 1: field_unlimited value 0 appears correctly is the form.')); + $this->assertFieldByName('entity_2[field_single][und][0][value]', 10, t('Entity 2: field_single value appears correctly is the form.')); + $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 11, t('Entity 2: field_unlimited value 0 appears correctly is the form.')); + + // Submit the form and check that the entities are updated accordingly. + $edit = array( + 'field_single[und][0][value]' => 1, + 'field_unlimited[und][0][value]' => 2, + 'field_unlimited[und][1][value]' => 3, + 'entity_2[field_single][und][0][value]' => 11, + 'entity_2[field_unlimited][und][0][value]' => 12, + 'entity_2[field_unlimited][und][1][value]' => 13, + ); + $this->drupalPost(NULL, $edit, t('Save')); + field_cache_clear(); + $entity_1 = field_test_create_stub_entity(1); + $entity_2 = field_test_create_stub_entity(2); + $this->assertFieldValues($entity_1, 'field_single', LANGUAGE_NONE, array(1)); + $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(2, 3)); + $this->assertFieldValues($entity_2, 'field_single', LANGUAGE_NONE, array(11)); + $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(12, 13)); + + // Submit invalid values and check that errors are reported on the + // correct widgets. + $edit = array( + 'field_unlimited[und][1][value]' => -1, + ); + $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); + $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 1: the field validation error was reported.')); + $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-field-unlimited-und-1-value')); + $this->assertTrue($error_field, t('Entity 1: the error was flagged on the correct element.')); + $edit = array( + 'entity_2[field_unlimited][und][1][value]' => -1, + ); + $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); + $this->assertRaw(t('%label does not accept the value -1', array('%label' => 'Unlimited field')), t('Entity 2: the field validation error was reported.')); + $error_field = $this->xpath('//input[@id=:id and contains(@class, "error")]', array(':id' => 'edit-entity-2-field-unlimited-und-1-value')); + $this->assertTrue($error_field, t('Entity 2: the error was flagged on the correct element.')); + + // Test that reordering works on both entities. + $edit = array( + 'field_unlimited[und][0][_weight]' => 0, + 'field_unlimited[und][1][_weight]' => -1, + 'entity_2[field_unlimited][und][0][_weight]' => 0, + 'entity_2[field_unlimited][und][1][_weight]' => -1, + ); + $this->drupalPost('test-entity/nested/1/2', $edit, t('Save')); + field_cache_clear(); + $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2)); + $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 12)); + + // Test the 'add more' buttons. Only Ajax submission is tested, because + // the two 'add more' buttons present in the form have the same #value, + // which confuses drupalPost(). + // 'Add more' button in the first entity: + $this->drupalGet('test-entity/nested/1/2'); + $this->drupalPostAJAX(NULL, array(), 'field_unlimited_add_more'); + $this->assertFieldByName('field_unlimited[und][0][value]', 3, t('Entity 1: field_unlimited value 0 appears correctly is the form.')); + $this->assertFieldByName('field_unlimited[und][1][value]', 2, t('Entity 1: field_unlimited value 1 appears correctly is the form.')); + $this->assertFieldByName('field_unlimited[und][2][value]', '', t('Entity 1: field_unlimited value 2 appears correctly is the form.')); + $this->assertFieldByName('field_unlimited[und][3][value]', '', t('Entity 1: an empty widget was added for field_unlimited value 3.')); + // 'Add more' button in the first entity (changing field values): + $edit = array( + 'entity_2[field_unlimited][und][0][value]' => 13, + 'entity_2[field_unlimited][und][1][value]' => 14, + 'entity_2[field_unlimited][und][2][value]' => 15, + ); + $this->drupalPostAJAX(NULL, $edit, 'entity_2_field_unlimited_add_more'); + $this->assertFieldByName('entity_2[field_unlimited][und][0][value]', 13, t('Entity 2: field_unlimited value 0 appears correctly is the form.')); + $this->assertFieldByName('entity_2[field_unlimited][und][1][value]', 14, t('Entity 2: field_unlimited value 1 appears correctly is the form.')); + $this->assertFieldByName('entity_2[field_unlimited][und][2][value]', 15, t('Entity 2: field_unlimited value 2 appears correctly is the form.')); + $this->assertFieldByName('entity_2[field_unlimited][und][3][value]', '', t('Entity 2: an empty widget was added for field_unlimited value 3.')); + // Save the form and check values are saved correclty. + $this->drupalPost(NULL, array(), t('Save')); + field_cache_clear(); + $this->assertFieldValues($entity_1, 'field_unlimited', LANGUAGE_NONE, array(3, 2)); + $this->assertFieldValues($entity_2, 'field_unlimited', LANGUAGE_NONE, array(13, 14, 15)); } } @@ -1827,7 +1875,7 @@ class FieldDisplayAPITestCase extends FieldTestCase { $item = $this->entity->{$this->field_name}[LANGUAGE_NONE][$delta]; $output = field_view_value('test_entity', $this->entity, $this->field_name, $item, $display); $this->drupalSetContent(drupal_render($output)); - $this->assertText($setting . '|0:' . $value['value'], t('Value @delta was displayed with expected setting.', array('@delta' => $delta))); + $this->assertText($setting . '|0:' . $value['value'], t('Value @delta was displayed with expected setting.', array('@delta' => $delta))); } // Check that prepare_view steps are invoked. @@ -1843,7 +1891,7 @@ class FieldDisplayAPITestCase extends FieldTestCase { $item = $this->entity->{$this->field_name}[LANGUAGE_NONE][$delta]; $output = field_view_value('test_entity', $this->entity, $this->field_name, $item, $display); $this->drupalSetContent(drupal_render($output)); - $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), t('Value @delta was displayed with expected setting.', array('@delta' => $delta))); + $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), t('Value @delta was displayed with expected setting.', array('@delta' => $delta))); } // View mode: check that display settings specified in the instance are @@ -2642,7 +2690,7 @@ class FieldTranslationsTestCase extends FieldTestCase { $extra_languages = mt_rand(1, 4); $languages = $available_languages = field_available_languages($this->entity_type, $this->field); for ($i = 0; $i < $extra_languages; ++$i) { - $languages[] = $this->randomString(2); + $languages[] = $this->randomName(2); } // For each given language provide some random values. @@ -2667,10 +2715,14 @@ class FieldTranslationsTestCase extends FieldTestCase { * Test the multilanguage logic of _field_invoke_multiple(). */ function testFieldInvokeMultiple() { + // Enable field translations for the entity. + field_test_entity_info_translatable('test_entity', TRUE); + $values = array(); + $options = array(); $entities = array(); $entity_type = 'test_entity'; - $entity_count = mt_rand(1, 5); + $entity_count = mt_rand(2, 5); $available_languages = field_available_languages($this->entity_type, $this->field); for ($id = 1; $id <= $entity_count; ++$id) { @@ -2681,29 +2733,55 @@ class FieldTranslationsTestCase extends FieldTestCase { // correctly uses the result of field_available_languages(). $extra_languages = mt_rand(1, 4); for ($i = 0; $i < $extra_languages; ++$i) { - $languages[] = $this->randomString(2); + $languages[] = $this->randomName(2); } // For each given language provide some random values. - foreach ($languages as $langcode) { - for ($delta = 0; $delta < $this->field['cardinality']; $delta++) { - $values[$id][$langcode][$delta]['value'] = mt_rand(1, 127); + $language_count = count($languages); + for ($i = 0; $i < $language_count; ++$i) { + $langcode = $languages[$i]; + // Avoid to populate at least one field translation to check that + // per-entity language suggestions work even when available field values + // are different for each language. + if ($i !== $id) { + for ($delta = 0; $delta < $this->field['cardinality']; $delta++) { + $values[$id][$langcode][$delta]['value'] = mt_rand(1, 127); + } + } + // Ensure that a language for which there is no field translation is + // used as display language to prepare per-entity language suggestions. + elseif (!isset($display_language)) { + $display_language = $langcode; } } + $entity->{$this->field_name} = $values[$id]; $entities[$id] = $entity; + + // Store per-entity language suggestions. + $options['language'][$id] = field_language($entity_type, $entity, NULL, $display_language); } $grouped_results = _field_invoke_multiple('test_op_multiple', $entity_type, $entities); foreach ($grouped_results as $id => $results) { foreach ($results as $langcode => $result) { - $hash = hash('sha256', serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode]))); - // Check whether the parameters passed to _field_invoke() were correctly - // forwarded to the callback function. - $this->assertEqual($hash, $result, t('The result for entity %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode))); + if (isset($values[$id][$langcode])) { + $hash = hash('sha256', serialize(array($entity_type, $entities[$id], $this->field_name, $langcode, $values[$id][$langcode]))); + // Check whether the parameters passed to _field_invoke() were correctly + // forwarded to the callback function. + $this->assertEqual($hash, $result, t('The result for entity %id/%language is correctly stored.', array('%id' => $id, '%language' => $langcode))); + } } $this->assertEqual(count($results), count($available_languages), t('No unavailable language has been processed for entity %id.', array('%id' => $id))); } + + $null = NULL; + $grouped_results = _field_invoke_multiple('test_op_multiple', $entity_type, $entities, $null, $null, $options); + foreach ($grouped_results as $id => $results) { + foreach ($results as $langcode => $result) { + $this->assertTrue(isset($options['language'][$id]), t('The result language %language for entity %id was correctly suggested (display language: %display_language).', array('%id' => $id, '%language' => $langcode, '%display_language' => $display_language))); + } + } } /** @@ -2880,7 +2958,7 @@ class FieldBulkDeleteTestCase extends FieldTestCase { public static function getInfo() { return array( 'name' => 'Field bulk delete tests', - 'description'=> 'Bulk delete fields and instances, and clean up afterwards.', + 'description' => 'Bulk delete fields and instances, and clean up afterwards.', 'group' => 'Field API', ); } @@ -3127,7 +3205,7 @@ class EntityPropertiesTestCase extends FieldTestCase { public static function getInfo() { return array( 'name' => 'Entity properties', - 'description'=> 'Tests entity properties.', + 'description' => 'Tests entity properties.', 'group' => 'Entity API', ); } diff --git a/modules/field/tests/field_test.entity.inc b/modules/field/tests/field_test.entity.inc index 37c29e22..b7c70a67 100644 --- a/modules/field/tests/field_test.entity.inc +++ b/modules/field/tests/field_test.entity.inc @@ -1,5 +1,4 @@ <?php -// $Id: field_test.entity.inc,v 1.17 2010/11/20 19:57:01 webchick Exp $ /** * @file diff --git a/modules/field/tests/field_test.field.inc b/modules/field/tests/field_test.field.inc index 46712920..b8a2939d 100644 --- a/modules/field/tests/field_test.field.inc +++ b/modules/field/tests/field_test.field.inc @@ -1,5 +1,4 @@ <?php -// $Id: field_test.field.inc,v 1.14 2010/10/20 00:13:33 dries Exp $ /** * @file diff --git a/modules/field/tests/field_test.info b/modules/field/tests/field_test.info index 6de86895..3ff58850 100644 --- a/modules/field/tests/field_test.info +++ b/modules/field/tests/field_test.info @@ -1,4 +1,3 @@ -;$Id: field_test.info,v 1.2 2010/12/20 19:59:41 webchick Exp $ name = "Field API Test" description = "Support module for the Field API tests." core = 7.x @@ -7,8 +6,8 @@ files[] = field_test.entity.inc version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field/tests/field_test.install b/modules/field/tests/field_test.install index f9229128..59575611 100644 --- a/modules/field/tests/field_test.install +++ b/modules/field/tests/field_test.install @@ -1,5 +1,4 @@ <?php -// $Id: field_test.install,v 1.5 2010/09/11 06:03:11 webchick Exp $ /** * @file diff --git a/modules/field/tests/field_test.module b/modules/field/tests/field_test.module index 525c0286..9e2fef62 100644 --- a/modules/field/tests/field_test.module +++ b/modules/field/tests/field_test.module @@ -1,5 +1,4 @@ <?php -// $Id: field_test.module,v 1.14 2010/12/07 05:09:58 webchick Exp $ /** * @file @@ -89,7 +88,9 @@ function field_test_field_test_op($entity_type, $entity, $field, $instance, $lan function field_test_field_test_op_multiple($entity_type, $entities, $field, $instances, $langcode, &$items) { $result = array(); foreach ($entities as $id => $entity) { - $result[$id] = array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id])))); + if (isset($items[$id])) { + $result[$id] = array($langcode => hash('sha256', serialize(array($entity_type, $entity, $field['field_name'], $langcode, $items[$id])))); + } } return $result; } diff --git a/modules/field/tests/field_test.storage.inc b/modules/field/tests/field_test.storage.inc index 84b75a4a..3ca322dd 100644 --- a/modules/field/tests/field_test.storage.inc +++ b/modules/field/tests/field_test.storage.inc @@ -1,5 +1,4 @@ <?php -// $Id: field_test.storage.inc,v 1.8 2010/10/13 05:19:26 webchick Exp $ /** * @file @@ -288,7 +287,7 @@ function field_test_field_storage_query($field_id, $conditions, $count, &$cursor case '<=': case '>': case '>=': - eval('$match = $match && '. $row->{$column} . ' ' . $operator . ' '. $value); + eval('$match = $match && ' . $row->{$column} . ' ' . $operator . ' '. $value); break; case 'IN': $match = $match && in_array($row->{$column}, $value); diff --git a/modules/field/theme/field-rtl.css b/modules/field/theme/field-rtl.css index 723eac49..5d35a86a 100644 --- a/modules/field/theme/field-rtl.css +++ b/modules/field/theme/field-rtl.css @@ -1,4 +1,3 @@ -/* $Id: field-rtl.css,v 1.2 2010/05/22 20:23:01 dries Exp $ */ form .field-multiple-table th.field-label { padding-right: 0; diff --git a/modules/field/theme/field.css b/modules/field/theme/field.css index e23f50d2..9eba32f0 100644 --- a/modules/field/theme/field.css +++ b/modules/field/theme/field.css @@ -1,4 +1,3 @@ -/* $Id: field.css,v 1.9 2010/05/22 20:23:01 dries Exp $ */ /* Field display */ .field .field-label { diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php index 56502f06..e4cd85cd 100644 --- a/modules/field/theme/field.tpl.php +++ b/modules/field/theme/field.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: field.tpl.php,v 1.13 2010/03/26 17:14:45 dries Exp $ /** * @file field.tpl.php diff --git a/modules/field_ui/field_ui-rtl.css b/modules/field_ui/field_ui-rtl.css index 456d37f2..123a840b 100644 --- a/modules/field_ui/field_ui-rtl.css +++ b/modules/field_ui/field_ui-rtl.css @@ -1,4 +1,3 @@ -/* $Id: field_ui-rtl.css,v 1.3 2010/09/11 00:03:42 webchick Exp $ */ /* 'Manage fields' overview */ table.field-ui-overview tr.add-new .label-input { diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index 82470912..96beb133 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: field_ui.admin.inc,v 1.88 2010/12/15 04:13:48 webchick Exp $ /** * @file @@ -875,7 +874,7 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund 'class' => array('field-ui-overview'), 'id' => 'field-display-overview', ), - // Add AJAX wrapper. + // Add Ajax wrapper. '#prefix' => '<div id="field-display-overview-wrapper">', '#suffix' => '</div>', ); @@ -1157,7 +1156,7 @@ function field_ui_display_overview_form($form, &$form_state, $entity_type, $bund 'callback' => 'field_ui_display_overview_multistep_js', 'wrapper' => 'field-display-overview-wrapper', 'effect' => 'fade', - // The button stays hidden, so we hide the AJAX spinner too. Ad-hoc + // The button stays hidden, so we hide the Ajax spinner too. Ad-hoc // spinners will be added manually by the client-side script. 'progress' => 'none', ), @@ -1218,7 +1217,7 @@ function field_ui_display_overview_multistep_submit($form, &$form_state) { } /** - * AJAX handler for multistep buttons on the 'Manage display' screen. + * Ajax handler for multistep buttons on the 'Manage display' screen. */ function field_ui_display_overview_multistep_js($form, &$form_state) { $trigger = $form_state['triggering_element']; @@ -1793,7 +1792,7 @@ function field_ui_field_edit_form($form, &$form_state, $instance) { '#default_value' => !empty($instance['description']) ? $instance['description'] : '', '#rows' => 5, '#description' => t('Instructions to present to the user below this field on the editing form.<br />Allowed HTML tags: @tags', array('@tags' => _field_filter_xss_display_allowed_tags())), - '#weight' => 0, + '#weight' => -5, ); // Build the widget component of the instance. diff --git a/modules/field_ui/field_ui.api.php b/modules/field_ui/field_ui.api.php index 0eff874a..e07a9373 100644 --- a/modules/field_ui/field_ui.api.php +++ b/modules/field_ui/field_ui.api.php @@ -1,5 +1,4 @@ <?php -// $Id: field_ui.api.php,v 1.10 2010/11/12 03:10:38 dries Exp $ /** * @file diff --git a/modules/field_ui/field_ui.css b/modules/field_ui/field_ui.css index f9bc2816..c25d2a43 100644 --- a/modules/field_ui/field_ui.css +++ b/modules/field_ui/field_ui.css @@ -1,4 +1,3 @@ -/* $Id: field_ui.css,v 1.6 2010/11/20 09:06:32 webchick Exp $ */ /* 'Manage fields' and 'Manage display' overviews */ table.field-ui-overview tr.add-new .label-input { diff --git a/modules/field_ui/field_ui.info b/modules/field_ui/field_ui.info index 324dce84..b8b12900 100644 --- a/modules/field_ui/field_ui.info +++ b/modules/field_ui/field_ui.info @@ -1,4 +1,3 @@ -; $Id: field_ui.info,v 1.5 2010/12/20 19:59:41 webchick Exp $ name = Field UI description = User interface for the Field API. package = Core @@ -7,8 +6,8 @@ core = 7.x dependencies[] = field files[] = field_ui.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/field_ui/field_ui.js b/modules/field_ui/field_ui.js index cae909f4..b63399f3 100644 --- a/modules/field_ui/field_ui.js +++ b/modules/field_ui/field_ui.js @@ -1,4 +1,3 @@ -// $Id: field_ui.js,v 1.8 2010/11/21 08:50:49 webchick Exp $ (function($) { @@ -167,7 +166,7 @@ Drupal.fieldUIOverview = { refreshRows = rowHandler.regionChange(region); // Update the row region. rowHandler.region = region; - // AJAX-update the rows. + // Ajax-update the rows. Drupal.fieldUIOverview.AJAXRefreshRows(refreshRows); } } @@ -206,7 +205,7 @@ Drupal.fieldUIOverview = { }, /** - * Triggers AJAX refresh of selected rows. + * Triggers Ajax refresh of selected rows. * * The 'format type' selects can trigger a series of changes in child rows. * The #ajax behavior is therefore not attached directly to the selects, but @@ -215,7 +214,7 @@ Drupal.fieldUIOverview = { * @param rows * A hash object, whose keys are the names of the rows to refresh (they * will receive the 'ajax-new-content' effect on the server side), and - * whose values are the DOM element in the row that should get an AJAX + * whose values are the DOM element in the row that should get an Ajax * throbber. */ AJAXRefreshRows: function (rows) { @@ -234,7 +233,7 @@ Drupal.fieldUIOverview = { .addClass('progress-disabled') .after($throbber); - // Fire the AJAX update. + // Fire the Ajax update. $('input[name=refresh_rows]').val(rowNames.join(' ')); $('input#edit-refresh').mousedown(); @@ -295,7 +294,7 @@ Drupal.fieldUIDisplayOverview.field.prototype = { * @param region * The name of the new region for the row. * @return - * A hash object indicating which rows should be AJAX-updated as a result + * A hash object indicating which rows should be Ajax-updated as a result * of the change, in the format expected by * Drupal.displayOverview.AJAXRefreshRows(). */ diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module index 9af3327a..7355e879 100644 --- a/modules/field_ui/field_ui.module +++ b/modules/field_ui/field_ui.module @@ -1,5 +1,4 @@ <?php -// $Id: field_ui.module,v 1.34 2010/11/21 07:28:39 webchick Exp $ /** * @file @@ -24,7 +23,7 @@ function field_ui_help($path, $arg) { $output .= '<dt>' . t('What type of data the field will store') . '</dt>'; $output .= '<dd>' . t('Each field can store one type of data (text, number, file, etc.). When you define a field, you choose a particular <em>field type</em>, which corresponds to the type of data you want to store. The field type cannot be changed after you have created the field.') . '</dd>'; $output .= '<dt>' . t('How the data will be input and displayed') . '</dt>'; - $output .= '<dd>' . t('Each field type has one or more available <em>widgets</em> associated with it; each widget provides a mechanism for data input when you are editing (text box, select list, file upload, etc.). Each field type also has one or more display options, which determine how the field is displayed to site visitors. The widget and display display options can be changed after you have created the field.') . '</dd>'; + $output .= '<dd>' . t('Each field type has one or more available <em>widgets</em> associated with it; each widget provides a mechanism for data input when you are editing (text box, select list, file upload, etc.). Each field type also has one or more display options, which determine how the field is displayed to site visitors. The widget and display options can be changed after you have created the field.') . '</dd>'; $output .= '<dt>' . t('How many values the field will store') . '</dt>'; $output .= '<dd>' . t('You can store one value, a specific maximum number of values, or an unlimited number of values in each field. For example, an employee identification number field might store a single number, whereas a phone number field might store multiple phone numbers. This setting can be changed after you have created the field, but if you reduce the maximum number of values, you may lose information.') . '</dd>'; $output .= '</dl>'; @@ -234,7 +233,7 @@ function field_ui_menu_load($field_name, $entity_type, $bundle_name, $bundle_pos * Menu title callback. */ function field_ui_menu_title($instance) { - return t($instance['label']); + return $instance['label']; } /** @@ -363,4 +362,3 @@ function field_ui_form_node_type_form_submit($form, &$form_state) { $form_state['redirect'] = _field_ui_bundle_admin_path('node', $form_state['values']['type']) .'/fields'; } } - diff --git a/modules/field_ui/field_ui.test b/modules/field_ui/field_ui.test index 1f1b43f8..77f79ce3 100644 --- a/modules/field_ui/field_ui.test +++ b/modules/field_ui/field_ui.test @@ -1,9 +1,8 @@ <?php -// $Id: field_ui.test,v 1.27 2010/10/27 18:29:17 dries Exp $ /** * @file - * Unit test file for fields in core UI. + * Tests for field_ui.module. */ /** @@ -389,7 +388,7 @@ class FieldUIManageFieldsTestCase extends FieldUITestCase { 'bundle' => $this->type, 'entity_type' => 'node', 'label' => t('Hidden field'), - 'widget_type' => 'test_field_widget', + 'widget' => array('type' => 'test_field_widget'), ); field_create_instance($instance); $this->assertTrue(field_read_instance('node', $field_name, $this->type), t('An instance of the field %field was created programmatically.', array('%field' => $field_name))); diff --git a/modules/file/file.api.php b/modules/file/file.api.php index 1d0ee362..76fb9861 100644 --- a/modules/file/file.api.php +++ b/modules/file/file.api.php @@ -1,5 +1,4 @@ <?php -// $Id: file.api.php,v 1.1 2010/08/23 14:53:50 webchick Exp $ /** * @file @@ -42,7 +41,7 @@ function hook_file_download_access($field, $entity_type, $entity) { * * @see hook_file_download_access(). * - * @param &$grants + * @param $grants * An array of grants gathered by hook_file_download_access(). The array is * keyed by the module that defines the entity type's access control; the * values are Boolean grant responses for each module. diff --git a/modules/file/file.css b/modules/file/file.css index e94c8a16..aed1a9d3 100644 --- a/modules/file/file.css +++ b/modules/file/file.css @@ -1,4 +1,3 @@ -/* $Id: file.css,v 1.1 2009/08/29 12:52:32 dries Exp $ */ /** * Managed file element styles. diff --git a/modules/file/file.field.inc b/modules/file/file.field.inc index e58f0877..2af3cb62 100644 --- a/modules/file/file.field.inc +++ b/modules/file/file.field.inc @@ -1,5 +1,4 @@ <?php -// $Id: file.field.inc,v 1.42 2010/12/24 15:25:28 webchick Exp $ /** * @file @@ -203,9 +202,9 @@ function file_field_prepare_view($entity_type, $entities, $field, $instances, $l if (!file_field_displayed($item, $field)) { unset($items[$id][$delta]); } - // Ensure consecutive deltas. - $items[$id] = array_values($items[$id]); } + // Ensure consecutive deltas. + $items[$id] = array_values($items[$id]); } } @@ -448,7 +447,7 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco 'description' => '', ); - // Retrieve any values set in $form_state, as will be the case during AJAX + // Retrieve any values set in $form_state, as will be the case during Ajax // rebuilds of this form. if (isset($form_state['values'])) { $path = array_merge($element['#field_parents'], array($field['field_name'], $langcode)); @@ -568,14 +567,17 @@ function file_field_widget_upload_validators($field, $instance) { * A field array. * @param $instance * A field instance array. + * @param $data + * An array of token objects to pass to token_replace(). * @return * A file directory URI with tokens replaced. + * + * @see token_replace() */ -function file_field_widget_uri($field, $instance, $account = NULL) { +function file_field_widget_uri($field, $instance, $data = array()) { $destination = trim($instance['settings']['file_directory'], '/'); // Replace tokens. - $data = array('user' => isset($account) ? $account : $GLOBALS['user']); $destination = token_replace($destination, $data); return $field['settings']['uri_scheme'] . '://' . $destination; @@ -650,7 +652,7 @@ function file_field_widget_process($element, &$form_state, $form) { ); } - // Adjust the AJAX settings so that on upload and remove of any individual + // Adjust the Ajax settings so that on upload and remove of any individual // file, the entire group of file fields is updated together. if ($field['cardinality'] != 1) { $parents = array_slice($element['#array_parents'], 0, -1); @@ -681,7 +683,7 @@ function file_field_widget_process($element, &$form_state, $form) { /** * An element #process callback for a group of file_generic fields. * - * Adds the weight field to each row so it can be ordered and adds a new AJAX + * Adds the weight field to each row so it can be ordered and adds a new Ajax * wrapper around the entire group so it can be replaced all at once. */ function file_field_widget_process_multiple($element, &$form_state, $form) { @@ -710,7 +712,7 @@ function file_field_widget_process_multiple($element, &$form_state, $form) { } } - // Add a new wrapper around all the elements for AJAX replacement. + // Add a new wrapper around all the elements for Ajax replacement. $element['#prefix'] = '<div id="' . $element['#id'] . '-ajax-wrapper">'; $element['#suffix'] = '</div>'; @@ -770,7 +772,7 @@ function theme_file_widget($variables) { $element = $variables['element']; $output = ''; - // The "form-managed-file" class is required for proper AJAX functionality. + // The "form-managed-file" class is required for proper Ajax functionality. $output .= '<div class="file-widget form-managed-file clearfix">'; if ($element['fid']['#value'] != 0) { // Add the file size after the file name. diff --git a/modules/file/file.info b/modules/file/file.info index e2b6edeb..ffb4c774 100644 --- a/modules/file/file.info +++ b/modules/file/file.info @@ -1,4 +1,3 @@ -; $Id: file.info,v 1.3 2010/12/20 19:59:41 webchick Exp $ name = File description = Defines a file field type. package = Core @@ -7,8 +6,8 @@ core = 7.x dependencies[] = field files[] = tests/file.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/file/file.install b/modules/file/file.install index fab07ed1..47ee4fd0 100644 --- a/modules/file/file.install +++ b/modules/file/file.install @@ -1,5 +1,4 @@ <?php -// $Id: file.install,v 1.5 2010/11/21 09:24:41 webchick Exp $ /** * @file diff --git a/modules/file/file.js b/modules/file/file.js index 19cd8061..1071384f 100644 --- a/modules/file/file.js +++ b/modules/file/file.js @@ -1,11 +1,10 @@ -// $Id: file.js,v 1.6 2010/11/23 05:51:16 webchick Exp $ /** * @file * Provides JavaScript additions to the managed file field type. * * This file provides progress bar support (if available), popup windows for - * file previews, and disabling of other file fields during AJAX uploads (which + * file previews, and disabling of other file fields during Ajax uploads (which * prevents separate file fields from accidentally uploading files). */ @@ -90,7 +89,7 @@ Drupal.file = Drupal.file || { disableFields: function (event){ var clickedButton = this; - // Only disable upload fields for AJAX buttons. + // Only disable upload fields for Ajax buttons. if (!$(clickedButton).hasClass('ajax-processed')) { return; } @@ -105,7 +104,7 @@ Drupal.file = Drupal.file || { // working with. Filter out fields that are already disabled so that they // do not get enabled when we re-enable these fields at the end of behavior // processing. Re-enable in a setTimeout set to a relatively short amount - // of time (1 second). All the other mousedown handlers (like Drupal's AJAX + // of time (1 second). All the other mousedown handlers (like Drupal's Ajax // behaviors) are excuted before any timeout functions are called, so we // don't have to worry about the fields being re-enabled too soon. // @todo If the previous sentence is true, why not set the timeout to 0? diff --git a/modules/file/file.module b/modules/file/file.module index 2dd2bad3..3e452511 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -1,5 +1,4 @@ <?php -// $Id: file.module,v 1.50 2010/12/29 04:35:23 webchick Exp $ /** * @file @@ -161,7 +160,8 @@ function file_file_download($uri, $field_type = 'file') { foreach ($field_references as $entity_type => $type_references) { foreach ($type_references as $id => $reference) { // Try to load $entity and $field. - $entity = reset(entity_load($entity_type, array($id))); + $entity = entity_load($entity_type, array($id)); + $entity = reset($entity); $field = NULL; if ($entity) { // Load all fields for that entity. @@ -221,7 +221,7 @@ function file_file_download($uri, $field_type = 'file') { } /** - * Menu callback; Shared AJAX callback for file uploads and deletions. + * Menu callback; Shared Ajax callback for file uploads and deletions. * * This rebuilds the form element for a particular field item. As long as the * form processing is properly encapsulated in the widget element the form @@ -265,7 +265,7 @@ function file_ajax_upload() { $form = $form[$parent]; } - // Add the special AJAX class if a new file was added. + // Add the special Ajax class if a new file was added. if (isset($form['#file_upload_delta']) && $current_file_count < $form['#file_upload_delta']) { $form[$current_file_count]['#attributes']['class'][] = 'ajax-new-content'; } @@ -453,7 +453,7 @@ function file_managed_file_process($element, &$form_state, $form) { ); } - // Prefix and suffix used for AJAX replacement. + // Prefix and suffix used for Ajax replacement. $element['#prefix'] = '<div id="' . $element['#id'] . '-ajax-wrapper">'; $element['#suffix'] = '</div>'; @@ -976,7 +976,7 @@ function file_get_file_references($file, $field = NULL, $age = FIELD_LOAD_REVISI } } - return isset($field) ? $references[$field['field_name']] : $references; + return isset($field) ? $references[$field['field_name']] : array_filter($references); } /** diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test index 62911978..ea8c5c67 100644 --- a/modules/file/tests/file.test +++ b/modules/file/tests/file.test @@ -1,9 +1,8 @@ <?php -// $Id: file.test,v 1.29 2010/12/11 01:32:20 dries Exp $ /** * @file - * Tests file uploading through the File module. + * Tests for file.module. */ /** @@ -254,7 +253,7 @@ class FileManagedFileElementTestCase extends FileFieldTestCase { $this->drupalPost($path . '/' . $last_fid, array(), t('Save')); $this->assertRaw(t('The file id is %fid.', array('%fid' => $last_fid)), t('Empty submission did not change an existing file.')); - // Now, test the Upload and Remove buttons, with and without AJAX. + // Now, test the Upload and Remove buttons, with and without Ajax. foreach (array(FALSE, TRUE) as $ajax) { // Upload, then Submit. $last_fid_prior = $this->getLastFileId(); @@ -302,7 +301,7 @@ class FileManagedFileElementTestCase extends FileFieldTestCase { } /** - * Test class to test file field widget, single and multi-valued, with and without AJAX, with public and private files. + * Test class to test file field widget, single and multi-valued, with and without Ajax, with public and private files. */ class FileFieldWidgetTestCase extends FileFieldTestCase { public static function getInfo() { @@ -314,7 +313,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase { } /** - * Tests upload and remove buttons, with and without AJAX, for a single-valued File field. + * Tests upload and remove buttons, with and without Ajax, for a single-valued File field. */ function testSingleValuedWidget() { // Use 'page' instead of 'article', so that the 'article' image field does @@ -371,7 +370,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase { } /** - * Tests upload and remove buttons, with and without AJAX, for a multi-valued File field. + * Tests upload and remove buttons, with and without Ajax, for a multi-valued File field. */ function testMultiValuedWidget() { // Use 'page' instead of 'article', so that the 'article' image field does @@ -390,7 +389,7 @@ class FileFieldWidgetTestCase extends FileFieldTestCase { // Visit the node creation form, and upload 3 files. Since the field has // cardinality of 3, ensure the "Upload" button is displayed until after // the 3rd file, and after that, isn't displayed. - // @todo This is only testing a non-AJAX upload, because drupalPostAJAX() + // @todo This is only testing a non-Ajax upload, because drupalPostAJAX() // does not yet emulate jQuery's file upload. $this->drupalGet("node/add/$type_name"); for ($delta = 0; $delta < 3; $delta++) { @@ -933,7 +932,7 @@ class FileFieldPathTestCase extends FileFieldTestCase { // Check the path when used with tokens. // Change the path to contain multiple token directories. - $field = $this->updateFileField($field_name, $type_name, array('file_directory' => '[user:uid]/[user:name]')); + $field = $this->updateFileField($field_name, $type_name, array('file_directory' => '[current-user:uid]/[current-user:name]')); // Upload a new file into the token subdirectories. $nid = $this->uploadNodeFile($test_file, $field_name, $type_name); @@ -941,6 +940,8 @@ class FileFieldPathTestCase extends FileFieldTestCase { // Check that the file was uploaded into the subdirectory. $node = node_load($nid, NULL, TRUE); $node_file = (object) $node->{$field_name}[LANGUAGE_NONE][0]; + // Do token replacement using the same user which uploaded the file, not + // the user running the test case. $data = array('user' => $this->admin_user); $subdirectory = token_replace('[user:uid]/[user:name]', $data); $this->assertPathMatch('public://' . $subdirectory . '/' . $test_file->filename, $node_file->uri, t('The file %file was uploaded to the correct path with token replacements.', array('%file' => $node_file->uri))); @@ -1027,7 +1028,7 @@ class FileTokenReplaceTestCase extends FileFieldTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('file' => $file), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized file token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized file token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1039,7 +1040,7 @@ class FileTokenReplaceTestCase extends FileFieldTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('file' => $file), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized file token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized file token %token replaced.', array('%token' => $input))); } } } diff --git a/modules/file/tests/file_module_test.info b/modules/file/tests/file_module_test.info index 9c6ee0ad..d49bd9a9 100644 --- a/modules/file/tests/file_module_test.info +++ b/modules/file/tests/file_module_test.info @@ -1,4 +1,3 @@ -; $Id: file_module_test.info,v 1.2 2010/12/20 19:59:41 webchick Exp $ name = File test description = Provides hooks for testing File module functionality. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/file/tests/file_module_test.module b/modules/file/tests/file_module_test.module index b02134a4..ea65981c 100644 --- a/modules/file/tests/file_module_test.module +++ b/modules/file/tests/file_module_test.module @@ -1,5 +1,4 @@ <?php -// $Id: file_module_test.module,v 1.4 2010/11/13 14:04:08 dries Exp $ /** * @file diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index 465d7520..5a21e6e2 100644 --- a/modules/filter/filter.admin.inc +++ b/modules/filter/filter.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: filter.admin.inc,v 1.71 2010/12/14 02:40:15 dries Exp $ /** * @file diff --git a/modules/filter/filter.admin.js b/modules/filter/filter.admin.js index bb90755c..3bc62337 100644 --- a/modules/filter/filter.admin.js +++ b/modules/filter/filter.admin.js @@ -1,4 +1,3 @@ -// $Id: filter.admin.js,v 1.4 2010/04/16 13:55:06 dries Exp $ (function ($) { Drupal.behaviors.filterStatus = { diff --git a/modules/filter/filter.api.php b/modules/filter/filter.api.php index b43af6f9..6675e4af 100644 --- a/modules/filter/filter.api.php +++ b/modules/filter/filter.api.php @@ -1,5 +1,4 @@ <?php -// $Id: filter.api.php,v 1.22 2010/12/09 02:04:16 dries Exp $ /** * @file diff --git a/modules/filter/filter.css b/modules/filter/filter.css index 4fe4af99..f7317338 100644 --- a/modules/filter/filter.css +++ b/modules/filter/filter.css @@ -1,4 +1,3 @@ -/* $Id: filter.css,v 1.6 2010/09/19 18:10:41 dries Exp $ */ .text-format-wrapper .form-item { margin-bottom: 0; diff --git a/modules/filter/filter.info b/modules/filter/filter.info index c6b614d2..e60046d4 100644 --- a/modules/filter/filter.info +++ b/modules/filter/filter.info @@ -1,4 +1,3 @@ -; $Id: filter.info,v 1.14 2010/12/20 19:59:42 webchick Exp $ name = Filter description = Filters content in preparation for display. package = Core @@ -8,8 +7,8 @@ files[] = filter.test required = TRUE configure = admin/config/content/formats -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/filter/filter.install b/modules/filter/filter.install index b62caef9..84512cd5 100644 --- a/modules/filter/filter.install +++ b/modules/filter/filter.install @@ -1,5 +1,4 @@ <?php -// $Id: filter.install,v 1.51 2011/01/02 17:26:39 webchick Exp $ /** * @file diff --git a/modules/filter/filter.js b/modules/filter/filter.js index faee1190..94e01c1a 100644 --- a/modules/filter/filter.js +++ b/modules/filter/filter.js @@ -1,4 +1,3 @@ -// $Id: filter.js,v 1.3 2010/09/13 00:59:47 dries Exp $ (function ($) { /** diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 5365a2fe..66fadcba 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -1,5 +1,4 @@ <?php -// $Id: filter.module,v 1.361 2010/12/09 02:04:16 dries Exp $ /** * @file @@ -1392,7 +1391,7 @@ function _filter_url($text, $filter) { $domain = '(?:[A-Za-z0-9._+-]+\.)?[A-Za-z]{2,64}\b'; $ip = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}'; $auth = '[a-zA-Z0-9:%_+*~#?&=.,/;-]+@'; - $trail = '[a-zA-Z0-9:%_+*~#&\[\]=/;?\.,-]*[a-zA-Z0-9:%_+*~#&\[\]=/;-]'; + $trail = '[a-zA-Z0-9:%_+*~#&\[\]=/;?!\.,-]*[a-zA-Z0-9:%_+*~#&\[\]=/;-]'; // Prepare pattern for optional trailing punctuation. // Even these characters could have a valid meaning for the URL, such usage is @@ -1590,11 +1589,12 @@ function _filter_autop($text) { // All block level tags $block = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|p|h[1-6]|hr)'; - // Split at opening and closing PRE, SCRIPT, STYLE, OBJECT tags and comments. - // We don't apply any processing to the contents of these tags to avoid messing - // up code. We look for matched pairs and allow basic nesting. For example: + // Split at opening and closing PRE, SCRIPT, STYLE, OBJECT, IFRAME tags + // and comments. We don't apply any processing to the contents of these tags + // to avoid messing up code. We look for matched pairs and allow basic + // nesting. For example: // "processed <pre> ignored <script> ignored </script> ignored </pre> processed" - $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE); + $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|iframe|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE); // Note: PHP ensures the array consists of alternating delimiters and literals // and begins and ends with a literal (inserting NULL as required). $ignore = FALSE; @@ -1602,9 +1602,14 @@ function _filter_autop($text) { $output = ''; foreach ($chunks as $i => $chunk) { if ($i % 2) { - // Opening or closing tag? - $open = ($chunk[1] != '/' || $chunk[1] != '!'); $comment = (substr($chunk, 0, 4) == '<!--'); + if ($comment) { + // Nothing to do, this is a comment. + $output .= $chunk; + continue; + } + // Opening or closing tag? + $open = ($chunk[1] != '/'); list($tag) = preg_split('/[ >]/', substr($chunk, 2 - $open), 2); if (!$ignore) { if ($open) { @@ -1613,7 +1618,7 @@ function _filter_autop($text) { } } // Only allow a matching tag to close it. - elseif ((!$open && $ignoretag == $tag) || $comment) { + elseif (!$open && $ignoretag == $tag) { $ignore = FALSE; $ignoretag = ''; } diff --git a/modules/filter/filter.pages.inc b/modules/filter/filter.pages.inc index af32fbf3..dbbbe4c5 100644 --- a/modules/filter/filter.pages.inc +++ b/modules/filter/filter.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: filter.pages.inc,v 1.11 2010/09/16 18:00:43 dries Exp $ /** * @file @@ -40,7 +39,7 @@ function filter_tips_long() { * ), * ); * @endcode - * - long: (optional) Whether the passed in filter tips contain extended + * - long: (optional) Whether the passed-in filter tips contain extended * explanations, i.e. intended to be output on the path 'filter/tips' * (TRUE), or are in a short format, i.e. suitable to be displayed below a * form element. Defaults to FALSE. diff --git a/modules/filter/filter.test b/modules/filter/filter.test index 55d11179..a3d1bde4 100644 --- a/modules/filter/filter.test +++ b/modules/filter/filter.test @@ -1,5 +1,9 @@ <?php -// $Id: filter.test,v 1.82 2010/12/01 00:00:21 webchick Exp $ + +/** + * @file + * Tests for filter.module. + */ /** * Tests for text format and filter CRUD operations. @@ -828,6 +832,25 @@ class FilterUnitTestCase extends DrupalUnitTestCase { '<blockquote><pre>aaa</pre></blockquote>' => array( "<blockquote><pre>aaa</pre></blockquote>" => TRUE, ), + "<pre>aaa\nbbb\nccc</pre>\nddd\neee" => array( + "<pre>aaa\nbbb\nccc</pre>" => TRUE, + "<p>ddd<br />\neee</p>" => TRUE, + ), + // Comments remain unchanged and subsequent lines/paragraphs are + // transformed normally. + "aaa<!--comment-->\n\nbbb\n\nccc\n\nddd<!--comment\nwith linebreak-->\n\neee\n\nfff" => array( + "<p>aaa</p>\n<!--comment--><p>\nbbb</p>\n<p>ccc</p>\n<p>ddd</p>" => TRUE, + "<!--comment\nwith linebreak--><p>\neee</p>\n<p>fff</p>" => TRUE, + ), + // Check that a comment in a PRE will result that the text after + // the comment, but still in PRE, is not transformed. + "<pre>aaa\nbbb<!-- comment -->\n\nccc</pre>\nddd" => array( + "<pre>aaa\nbbb<!-- comment -->\n\nccc</pre>" => TRUE, + ), + // Bug 810824, paragraphs were appearing around iframe tags. + "<iframe>aaa</iframe>\n\n" => array( + "<p><iframe>aaa</iframe></p>" => FALSE, + ), ); $this->assertFilteredString($filter, $tests); @@ -1176,10 +1199,11 @@ person@example.com or mailto:person2@example.com '<a href="mailto:person@example.com">person@example.com</a>' => TRUE, '<a href="mailto:person2@example.com">mailto:person2@example.com</a>' => TRUE, ), - // URI parts. + // URI parts and special characters. ' http://trailingslash.com/ or www.trailingslash.com/ http://host.com/some/path?query=foo&bar[baz]=beer#fragment or www.host.com/some/path?query=foo&bar[baz]=beer#fragment +http://twitter.com/#!/example/status/22376963142324226 ftp://user:pass@ftp.example.com/~home/dir1 sftp://user@nonstandardport:222/dir ssh://192.168.0.100/srv/git/drupal.git @@ -1188,6 +1212,7 @@ ssh://192.168.0.100/srv/git/drupal.git '<a href="http://www.trailingslash.com/">www.trailingslash.com/</a>' => TRUE, '<a href="http://host.com/some/path?query=foo&bar[baz]=beer#fragment">http://host.com/some/path?query=foo&bar[baz]=beer#fragment</a>' => TRUE, '<a href="http://www.host.com/some/path?query=foo&bar[baz]=beer#fragment">www.host.com/some/path?query=foo&bar[baz]=beer#fragment</a>' => TRUE, + '<a href="http://twitter.com/#!/example/status/22376963142324226">http://twitter.com/#!/example/status/22376963142324226</a>' => TRUE, '<a href="ftp://user:pass@ftp.example.com/~home/dir1">ftp://user:pass@ftp.example.com/~home/dir1</a>' => TRUE, '<a href="sftp://user@nonstandardport:222/dir">sftp://user@nonstandardport:222/dir</a>' => TRUE, '<a href="ssh://192.168.0.100/srv/git/drupal.git">ssh://192.168.0.100/srv/git/drupal.git</a>' => TRUE, @@ -1457,7 +1482,7 @@ www.example.com with a newline in comments --> if (!$success) { $this->verbose('Source:<pre>' . check_plain(var_export($source, TRUE)) . '</pre>' . '<hr />' . 'Result:<pre>' . check_plain(var_export($result, TRUE)) . '</pre>' - . '<hr />' . ($is_expected ? 'Found:' : 'Not found:') + . '<hr />' . ($is_expected ? 'Expected:' : 'Not expected:') . '<pre>' . check_plain(var_export($value, TRUE)) . '</pre>' ); } diff --git a/modules/forum/forum-icon.tpl.php b/modules/forum/forum-icon.tpl.php index c98eee3e..9cf2cd8d 100644 --- a/modules/forum/forum-icon.tpl.php +++ b/modules/forum/forum-icon.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: forum-icon.tpl.php,v 1.8 2010/11/22 08:07:57 webchick Exp $ /** * @file @@ -7,7 +6,7 @@ * * Available variables: * - $new_posts: Indicates whether or not the topic contains new posts. - * - $icon: The icon to display. May be one of 'hot', 'hot-new', 'new', + * - $icon_class: The icon to display. May be one of 'hot', 'hot-new', 'new', * 'default', 'closed', or 'sticky'. * - $first_new: Indicates whether this is the first topic with new posts. * diff --git a/modules/forum/forum-list.tpl.php b/modules/forum/forum-list.tpl.php index 0c9cbcf9..bc0935f8 100644 --- a/modules/forum/forum-list.tpl.php +++ b/modules/forum/forum-list.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: forum-list.tpl.php,v 1.5 2008/10/13 12:31:42 dries Exp $ /** * @file diff --git a/modules/forum/forum-rtl.css b/modules/forum/forum-rtl.css index 575250eb..d31c9e7f 100644 --- a/modules/forum/forum-rtl.css +++ b/modules/forum/forum-rtl.css @@ -1,4 +1,3 @@ -/* $Id: forum-rtl.css,v 1.3 2007/11/27 12:09:26 goba Exp $ */ #forum tr td.forum { padding-left: 0.5em; diff --git a/modules/forum/forum-submitted.tpl.php b/modules/forum/forum-submitted.tpl.php index d67e9cc3..d310448c 100644 --- a/modules/forum/forum-submitted.tpl.php +++ b/modules/forum/forum-submitted.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: forum-submitted.tpl.php,v 1.5 2009/07/28 10:41:20 dries Exp $ /** * @file diff --git a/modules/forum/forum-topic-list.tpl.php b/modules/forum/forum-topic-list.tpl.php index 89566c46..33907036 100644 --- a/modules/forum/forum-topic-list.tpl.php +++ b/modules/forum/forum-topic-list.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: forum-topic-list.tpl.php,v 1.10 2010/04/28 20:25:21 dries Exp $ /** * @file diff --git a/modules/forum/forum.admin.inc b/modules/forum/forum.admin.inc index 84a891d2..1e6b3655 100644 --- a/modules/forum/forum.admin.inc +++ b/modules/forum/forum.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: forum.admin.inc,v 1.36 2010/08/08 19:21:25 dries Exp $ /** * @file diff --git a/modules/forum/forum.css b/modules/forum/forum.css index eb2544e8..3f3ed984 100644 --- a/modules/forum/forum.css +++ b/modules/forum/forum.css @@ -1,4 +1,3 @@ -/* $Id: forum.css,v 1.9 2010/10/03 00:41:14 dries Exp $ */ #forum .description { font-size: 0.9em; diff --git a/modules/forum/forum.info b/modules/forum/forum.info index 2558d70f..6c62fa8f 100644 --- a/modules/forum/forum.info +++ b/modules/forum/forum.info @@ -1,4 +1,3 @@ -; $Id: forum.info,v 1.15 2010/12/20 19:59:42 webchick Exp $ name = Forum description = Provides discussion forums. dependencies[] = taxonomy @@ -10,8 +9,8 @@ files[] = forum.test configure = admin/structure/forum stylesheets[all][] = forum.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/forum/forum.install b/modules/forum/forum.install index f7197087..60c40879 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -1,5 +1,4 @@ <?php -// $Id: forum.install,v 1.52 2010/10/07 00:28:19 webchick Exp $ /** * @file @@ -47,7 +46,7 @@ function forum_enable() { // Create the 'taxonomy_forums' field if it doesn't already exist. if (!field_info_field('taxonomy_forums')) { $field = array( - 'field_name' => 'taxonomy_' . $vocabulary->machine_name, + 'field_name' => 'taxonomy_forums', 'type' => 'taxonomy_term_reference', 'settings' => array( 'allowed_values' => array( @@ -60,8 +59,6 @@ function forum_enable() { ); field_create_field($field); - variable_set('forum_nav_vocabulary', $vocabulary->vid); - // Create a default forum so forum posts can be created. $edit = array( 'name' => t('General discussion'), @@ -74,7 +71,7 @@ function forum_enable() { // Create the instance on the bundle. $instance = array( - 'field_name' => 'taxonomy_' . $vocabulary->machine_name, + 'field_name' => 'taxonomy_forums', 'entity_type' => 'node', 'label' => $vocabulary->name, 'bundle' => 'forum', @@ -216,7 +213,7 @@ function forum_schema() { ), ), 'indexes' => array( - 'forum_topics' => array('tid', 'sticky', 'last_comment_timestamp'), + 'forum_topics' => array('nid', 'tid', 'sticky', 'last_comment_timestamp'), ), 'foreign keys' => array( 'tracked_node' => array( @@ -331,3 +328,97 @@ function forum_update_7001() { ->from($select) ->execute(); } + +/** + * Add new index to forum_index table. + */ +function forum_update_7002() { + db_drop_index('forum_index', 'forum_topics'); + db_add_index('forum_index', 'forum_topics', array('nid', 'tid', 'sticky', 'last_comment_timestamp')); +} + +/** + * @addtogroup updates-7.x-extra + * @{ + */ + +/** + * Rename field to 'taxonomy_forums'. + */ +function forum_update_7003() { + $messages = array(); + + $new_field_name = 'taxonomy_forums'; + + // Test to see if the taxonomy_forums field exists. + $fields = _update_7000_field_read_fields(array('field_name' => $new_field_name)); + if ($fields) { + // Since the field exists, we're done. + return; + } + + // Calculate the old field name. + $vid = variable_get('forum_nav_vocabulary', 0); + $vocabulary_machine_name = db_select('taxonomy_vocabulary', 'tv') + ->fields('tv', array('machine_name')) + ->condition('vid', $vid) + ->execute() + ->fetchField(); + $old_field_name = 'taxonomy_' . $vocabulary_machine_name; + + // Read the old fields. + $old_fields = _update_7000_field_read_fields(array('field_name' => $old_field_name)); + foreach ($old_fields as $old_field) { + if ($old_field['storage']['type'] != 'field_sql_storage') { + $messages[] = t('Cannot rename field %id (%old_field_name) to %new_field_name because it does not use the field_sql_storage storage type.', array( + '%id' => $old_field['id'], + '%old_field_name' => $old_field_name, + '%new_field_name' => $new_field_name, + )); + continue; + } + + // Update {field_config}. + db_update('field_config') + ->fields(array('field_name' => $new_field_name)) + ->condition('id', $old_field['id']) + ->execute(); + + // Update {field_config_instance}. + db_update('field_config_instance') + ->fields(array('field_name' => $new_field_name)) + ->condition('field_id', $old_field['id']) + ->execute(); + + // The tables that need updating in the form 'old_name' => 'new_name'. + $tables = array( + 'field_data_' . $old_field_name => 'field_data_' . $new_field_name, + 'field_revision_' . $old_field_name => 'field_revision_' . $new_field_name, + ); + foreach ($tables as $old_table => $new_table) { + $old_column_name = $old_field_name . '_tid'; + $new_column_name = $new_field_name . '_tid'; + + // Rename the column. + db_drop_index($old_table, $old_column_name); + db_change_field($old_table, $old_column_name, $new_column_name, array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => FALSE, + )); + db_drop_index($old_table, $new_column_name); + db_add_index($old_table, $new_column_name, array($new_column_name)); + + // Rename the table. + db_rename_table($old_table, $new_table); + } + } + + cache_clear_all('*', 'cache_field', TRUE); + + return $messages; +} + +/** + * @} End of "addtogroup updates-7.x-extra" + */ diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 5c07e885..c58b5c90 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -1,5 +1,4 @@ <?php -// $Id: forum.module,v 1.582 2010/11/29 04:53:32 webchick Exp $ /** * @file @@ -170,12 +169,9 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) { $tid = (isset($router_item['page_arguments'][0]) ? $router_item['page_arguments'][0]->tid : 0); $forum_term = forum_forum_load($tid); if ($forum_term) { - $vid = variable_get('forum_nav_vocabulary', 0); - $vocabulary = taxonomy_vocabulary_load($vid); - $links = array(); // Loop through all bundles for forum taxonomy vocabulary field. - $field = field_info_field('taxonomy_' . $vocabulary->machine_name); + $field = field_info_field('taxonomy_forums'); foreach ($field['bundles']['node'] as $type) { if (node_access('create', $type)) { $links[$type] = array( @@ -611,7 +607,7 @@ function forum_form_alter(&$form, $form_state, $form_id) { // ID from the URL (e.g., if we are on a page like node/add/forum/2, we // expect "2" to be the ID of the forum that was requested). $requested_forum_id = arg(3); - $form['taxonomy_forums'][$langcode]['#default_value'] = is_numeric($requested_forum_id) ? $requested_forum_id : NULL; + $form['taxonomy_forums'][$langcode]['#default_value'] = is_numeric($requested_forum_id) ? $requested_forum_id : ''; } } } @@ -880,7 +876,6 @@ function forum_get_topics($tid, $sortby, $forum_per_page) { ->addTag('node_access') ->orderBy('f.sticky', 'DESC') ->orderByHeader($forum_topic_list_header) - ->orderBy('f.last_comment_timestamp', 'DESC') ->limit($forum_per_page); $count_query = db_select('forum_index', 'f'); @@ -895,7 +890,29 @@ function forum_get_topics($tid, $sortby, $forum_per_page) { $nids[] = $record->nid; } if ($nids) { - $result = db_query("SELECT n.title, n.nid, n.type, n.sticky, n.created, n.uid, n.comment AS comment_mode, ncs.*, f.tid AS forum_tid, u.name, CASE ncs.last_comment_uid WHEN 0 THEN ncs.last_comment_name ELSE u2.name END AS last_comment_name FROM {node} n INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid INNER JOIN {forum} f ON n.vid = f.vid INNER JOIN {users} u ON n.uid = u.uid INNER JOIN {users} u2 ON ncs.last_comment_uid = u2.uid WHERE n.nid IN (:nids)", array(':nids' => $nids)); + $query = db_select('node', 'n')->extend('TableSort'); + $query->fields('n', array('title', 'nid', 'type', 'sticky', 'created', 'uid')); + $query->addField('n', 'comment', 'comment_mode'); + + $query->join('node_comment_statistics', 'ncs', 'n.nid = ncs.nid'); + $query->fields('ncs', array('cid', 'last_comment_uid', 'last_comment_timestamp', 'comment_count')); + + $query->join('forum_index', 'f', 'f.nid = ncs.nid'); + $query->addField('f', 'tid', 'forum_tid'); + + $query->join('users', 'u', 'n.uid = u.uid'); + $query->addField('u', 'name'); + + $query->join('users', 'u2', 'ncs.last_comment_uid = u2.uid'); + + $query->addExpression('CASE ncs.last_comment_uid WHEN 0 THEN ncs.last_comment_name ELSE u2.name END', 'last_comment_name'); + + $query + ->orderBy('f.sticky', 'DESC') + ->orderByHeader($forum_topic_list_header) + ->condition('n.nid', $nids); + + $result = $query->execute(); } else { $result = array(); @@ -1194,16 +1211,16 @@ function _forum_user_last_visit($nid) { function _forum_get_topic_order($sortby) { switch ($sortby) { case 1: - return array('field' => 'ncs.last_comment_timestamp', 'sort' => 'desc'); + return array('field' => 'f.last_comment_timestamp', 'sort' => 'desc'); break; case 2: - return array('field' => 'ncs.last_comment_timestamp', 'sort' => 'asc'); + return array('field' => 'f.last_comment_timestamp', 'sort' => 'asc'); break; case 3: - return array('field' => 'ncs.comment_count', 'sort' => 'desc'); + return array('field' => 'f.comment_count', 'sort' => 'desc'); break; case 4: - return array('field' => 'ncs.comment_count', 'sort' => 'asc'); + return array('field' => 'f.comment_count', 'sort' => 'asc'); break; } } diff --git a/modules/forum/forum.pages.inc b/modules/forum/forum.pages.inc index 6acdb23a..29307e71 100644 --- a/modules/forum/forum.pages.inc +++ b/modules/forum/forum.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: forum.pages.inc,v 1.4 2010/04/28 05:54:55 webchick Exp $ /** * @file diff --git a/modules/forum/forum.test b/modules/forum/forum.test index 119a7ab9..1dc45c6f 100644 --- a/modules/forum/forum.test +++ b/modules/forum/forum.test @@ -1,5 +1,9 @@ <?php -// $Id: forum.test,v 1.65 2010/09/28 02:30:31 dries Exp $ + +/** + * @file + * Tests for forum.module. + */ class ForumTestCase extends DrupalWebTestCase { protected $admin_user; diff --git a/modules/forum/forums.tpl.php b/modules/forum/forums.tpl.php index eee9b9f8..55a760f5 100644 --- a/modules/forum/forums.tpl.php +++ b/modules/forum/forums.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: forums.tpl.php,v 1.7 2009/12/03 20:21:50 dries Exp $ /** * @file diff --git a/modules/help/help-rtl.css b/modules/help/help-rtl.css index 61487afc..8e40a8c2 100644 --- a/modules/help/help-rtl.css +++ b/modules/help/help-rtl.css @@ -1,4 +1,3 @@ -/* $Id: help-rtl.css,v 1.2 2007/11/27 12:09:26 goba Exp $ */ .help-items { float: right; diff --git a/modules/help/help.admin.inc b/modules/help/help.admin.inc index 4b783ac9..3db06ca1 100644 --- a/modules/help/help.admin.inc +++ b/modules/help/help.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: help.admin.inc,v 1.13 2010/10/01 15:24:18 webchick Exp $ /** * @file diff --git a/modules/help/help.api.php b/modules/help/help.api.php index 36d425a0..ff2f97c6 100644 --- a/modules/help/help.api.php +++ b/modules/help/help.api.php @@ -1,5 +1,4 @@ <?php -// $Id: help.api.php,v 1.11 2010/10/06 03:43:01 webchick Exp $ /** * @file diff --git a/modules/help/help.css b/modules/help/help.css index 592390f3..92281707 100644 --- a/modules/help/help.css +++ b/modules/help/help.css @@ -1,4 +1,3 @@ -/* $Id: help.css,v 1.2 2007/05/27 17:57:48 goba Exp $ */ .help-items { float: left; /* LTR */ diff --git a/modules/help/help.info b/modules/help/help.info index dd45bb54..34fb192c 100644 --- a/modules/help/help.info +++ b/modules/help/help.info @@ -1,4 +1,3 @@ -; $Id: help.info,v 1.9 2010/12/20 19:59:42 webchick Exp $ name = Help description = Manages the display of online help. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x files[] = help.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/help/help.module b/modules/help/help.module index 6b78a5d6..773a52df 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -1,5 +1,4 @@ <?php -// $Id: help.module,v 1.99 2010/10/04 14:54:10 webchick Exp $ /** * @file diff --git a/modules/help/help.test b/modules/help/help.test index 3725a1a4..73b4dedc 100644 --- a/modules/help/help.test +++ b/modules/help/help.test @@ -1,5 +1,9 @@ <?php -// $Id: help.test,v 1.22 2010/11/27 20:25:44 dries Exp $ + +/** + * @file + * Tests for help.module. + */ class HelpTestCase extends DrupalWebTestCase { protected $big_user; diff --git a/modules/image/image-rtl.css b/modules/image/image-rtl.css index e068b7e0..2a7a855e 100644 --- a/modules/image/image-rtl.css +++ b/modules/image/image-rtl.css @@ -1,4 +1,3 @@ -/* $Id: image-rtl.css,v 1.2 2010/09/27 03:56:14 webchick Exp $ */ /** * Image upload widget. diff --git a/modules/image/image.admin.css b/modules/image/image.admin.css index f5aa5972..3115c8dc 100644 --- a/modules/image/image.admin.css +++ b/modules/image/image.admin.css @@ -1,4 +1,3 @@ -/* $Id: image.admin.css,v 1.1 2009/07/21 07:09:46 webchick Exp $ */ /** * Image style configuration pages. diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index 74002bb9..d72fdf4f 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: image.admin.inc,v 1.28 2010/11/21 07:24:53 webchick Exp $ /** * @file @@ -227,7 +226,7 @@ function image_style_form_submit($form, &$form_state) { image_style_save($style); if ($form_state['values']['op'] == t('Update style')) { - drupal_set_message('Changes to the style have been saved.'); + drupal_set_message(t('Changes to the style have been saved.')); } $form_state['redirect'] = 'admin/config/media/image-styles/edit/' . $style['name']; } diff --git a/modules/image/image.api.php b/modules/image/image.api.php index 67018e57..5b635ec7 100644 --- a/modules/image/image.api.php +++ b/modules/image/image.api.php @@ -1,5 +1,4 @@ <?php -// $Id: image.api.php,v 1.5 2010/09/11 01:54:43 dries Exp $ /** * @file diff --git a/modules/image/image.css b/modules/image/image.css index 0ae839be..7db307bf 100644 --- a/modules/image/image.css +++ b/modules/image/image.css @@ -1,4 +1,3 @@ -/* $Id: image.css,v 1.2 2010/09/27 03:56:14 webchick Exp $ */ /** * Image upload widget. diff --git a/modules/image/image.effects.inc b/modules/image/image.effects.inc index 401061f9..122af6c4 100644 --- a/modules/image/image.effects.inc +++ b/modules/image/image.effects.inc @@ -1,5 +1,4 @@ <?php -// $Id: image.effects.inc,v 1.5 2010/05/06 05:59:31 webchick Exp $ /** * @file @@ -74,7 +73,7 @@ function image_image_effect_info() { */ function image_resize_effect(&$image, $data) { if (!image_resize($image, $data['width'], $data['height'])) { - watchdog('image', 'Image resize failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR); + watchdog('image', 'Image resize failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR); return FALSE; } return TRUE; @@ -109,7 +108,7 @@ function image_scale_effect(&$image, $data) { $data['height'] = empty($data['height']) ? PHP_INT_MAX : $data['height']; if (!image_scale($image, $data['width'], $data['height'], $data['upscale'])) { - watchdog('image', 'Image scale failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR); + watchdog('image', 'Image scale failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR); return FALSE; } return TRUE; @@ -143,7 +142,7 @@ function image_crop_effect(&$image, $data) { $x = image_filter_keyword($x, $image->info['width'], $data['width']); $y = image_filter_keyword($y, $image->info['height'], $data['height']); if (!image_crop($image, $x, $y, $data['width'], $data['height'])) { - watchdog('image', 'Image crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR); + watchdog('image', 'Image crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR); return FALSE; } return TRUE; @@ -165,7 +164,7 @@ function image_crop_effect(&$image, $data) { */ function image_scale_and_crop_effect(&$image, $data) { if (!image_scale_and_crop($image, $data['width'], $data['height'])) { - watchdog('image', 'Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR); + watchdog('image', 'Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR); return FALSE; } return TRUE; @@ -184,7 +183,7 @@ function image_scale_and_crop_effect(&$image, $data) { */ function image_desaturate_effect(&$image, $data) { if (!image_desaturate($image)) { - watchdog('image', 'Image desaturate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR); + watchdog('image', 'Image desaturate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR); return FALSE; } return TRUE; @@ -237,7 +236,7 @@ function image_rotate_effect(&$image, $data) { } if (!image_rotate($image, $data['degrees'], $data['bgcolor'])) { - watchdog('image', 'Image rotate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['height'] . 'x' . $image->info['height']), WATCHDOG_ERROR); + watchdog('image', 'Image rotate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR); return FALSE; } return TRUE; diff --git a/modules/image/image.field.inc b/modules/image/image.field.inc index a65407f7..07cc1e06 100644 --- a/modules/image/image.field.inc +++ b/modules/image/image.field.inc @@ -1,5 +1,4 @@ <?php -// $Id: image.field.inc,v 1.34 2010/10/31 12:12:00 dries Exp $ /** * @file diff --git a/modules/image/image.info b/modules/image/image.info index ba007eb8..0f5afae8 100644 --- a/modules/image/image.info +++ b/modules/image/image.info @@ -1,4 +1,3 @@ -; $Id: image.info,v 1.6 2010/12/20 19:59:42 webchick Exp $ name = Image description = Provides image manipulation tools. package = Core @@ -8,8 +7,8 @@ dependencies[] = file files[] = image.test configure = admin/config/media/image-styles -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/image/image.install b/modules/image/image.install index 07032763..fbd20de5 100644 --- a/modules/image/image.install +++ b/modules/image/image.install @@ -1,5 +1,4 @@ <?php -// $Id: image.install,v 1.14 2010/11/21 09:24:41 webchick Exp $ /** * @file @@ -228,7 +227,19 @@ function image_update_7000() { db_create_table('cache_image', $schema['cache_image']); db_create_table('image_styles', $schema['image_styles']); - db_create_table('image_effect', $schema['image_effects']); + db_create_table('image_effects', $schema['image_effects']); + } +} + +/** + * Rename possibly misnamed {image_effect} table to {image_effects}. + */ +function image_update_7001() { + // Due to a bug in earlier versions of image_update_7000() it is possible + // to end up with an {image_effect} table where there should be an + // {image_effects} table. + if (!db_table_exists('image_effects') && db_table_exists('image_effect')) { + db_rename_table('image_effect', 'image_effects'); } } diff --git a/modules/image/image.module b/modules/image/image.module index 8afed879..d2d081c3 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -1,5 +1,4 @@ <?php -// $Id: image.module,v 1.54 2010/11/18 05:36:27 dries Exp $ /** * @file @@ -189,7 +188,6 @@ function image_theme() { 'alt' => '', 'title' => NULL, 'attributes' => array(), - 'getsize' => TRUE, ), ), @@ -714,7 +712,11 @@ function image_style_deliver($style, $scheme) { } /** - * Create a new image based on an image style. + * Creates a new image derivative based on an image style. + * + * Generates an image derivative by creating the destination folder (if it does + * not already exist), applying all image effects defined in $style['effects'], + * and saving a cached version of the resulting image. * * @param $style * An image style array. @@ -722,9 +724,12 @@ function image_style_deliver($style, $scheme) { * Path of the source file. * @param $destination * Path or URI of the destination file. + * * @return - * TRUE if an image derivative is generated, FALSE if no image derivative - * is generated. NULL if the derivative is being generated. + * TRUE if an image derivative was generated, or FALSE if the image derivative + * could not be generated. + * + * @see image_style_load() */ function image_style_create_derivative($style, $source, $destination) { // Get the folder for the final location of this style. @@ -799,16 +804,18 @@ function image_style_flush($style) { * @see image_style_deliver() */ function image_style_url($style_name, $path) { - $scheme = file_uri_scheme($path); - if ($scheme === 'private') { - $target = file_uri_target($path); - $url = url('system/files/styles/' . $style_name . '/' . $scheme . '/' . $target, array('absolute' => TRUE)); + $uri = image_style_path($style_name, $path); + + // If not using clean URLs, the image derivative callback is only available + // with the query string. If the file does not exist, use url() to ensure + // that it is included. Once the file exists it's fine to fall back to the + // actual file path, this avoids bootstrapping PHP once the files are built. + if (!variable_get('clean_url') && file_uri_scheme($uri) == 'public' && !file_exists($uri)) { + $directory_path = file_stream_wrapper_get_instance_by_uri($uri)->getDirectoryPath(); + return url($directory_path . '/' . file_uri_target($uri), array('absolute' => TRUE)); } - else { - $destination = image_style_path($style_name, $path); - $url = url(file_stream_wrapper_get_instance_by_scheme($scheme)->getDirectoryPath() . '/' . file_uri_target($destination), array('absolute' => TRUE)); - } - return $url; + + return file_create_url($uri); } /** @@ -1082,23 +1089,11 @@ function image_effect_apply($image, $effect) { * - title: The title text is displayed when the image is hovered in some * popular browsers. * - attributes: Associative array of attributes to be placed in the img tag. - * - getsize: If set to TRUE, the image's dimension are fetched and added as - * width/height attributes. * * @ingroup themeable */ function theme_image_style($variables) { - $style_name = $variables['style_name']; - $path = $variables['path']; - - // theme_image() can only honor the $getsize parameter with local file paths. - // The derivative image is not created until it has been requested so the file - // may not yet exist, in this case we just fallback to the URL. - $style_path = image_style_path($style_name, $path); - if (!file_exists($style_path)) { - $style_path = image_style_url($style_name, $path); - } - $variables['path'] = $style_path; + $variables['path'] = image_style_url($variables['style_name'], $variables['path']); return theme('image', $variables); } diff --git a/modules/image/image.test b/modules/image/image.test index 483f9fa5..00f79d85 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -1,12 +1,10 @@ <?php -// $Id: image.test,v 1.31 2010/09/22 03:24:09 dries Exp $ /** * @file - * Image module tests. + * Tests for image.module. */ - /** * TODO: Test the following functions. * @@ -155,13 +153,28 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase { $this->_testImageStyleUrlAndPath('private'); } + /** + * Test image_style_url() with the "public://" scheme and unclean URLs. + */ + function testImageStylUrlAndPathPublicUnclean() { + $this->_testImageStyleUrlAndPath('public', FALSE); + } + + /** + * Test image_style_url() with the "private://" schema and unclean URLs. + */ + function testImageStyleUrlAndPathPrivateUnclean() { + $this->_testImageStyleUrlAndPath('private', FALSE); + } + /** * Test image_style_url(). */ - function _testImageStyleUrlAndPath($scheme) { + function _testImageStyleUrlAndPath($scheme, $clean_url = TRUE) { // Make the default scheme neither "public" nor "private" to verify the // functions work for other than the default scheme. variable_set('file_default_scheme', 'temporary'); + variable_set('clean_url', $clean_url); // Create the directories for the styles. $directory = $scheme . '://styles/' . $this->style_name; @@ -183,6 +196,10 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase { $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.')); $generate_url = image_style_url($this->style_name, $original_uri); + if (!$clean_url) { + $this->assertTrue(strpos($generate_url, '?q=') !== FALSE, 'When using non-clean URLS, the system path contains the query string.'); + } + // Fetch the URL that generates the file. $this->drupalGet($generate_url); $this->assertResponse(200, t('Image was generated at the URL.')); @@ -695,7 +712,6 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase { // image style callback paths. $this->drupalGet(image_style_url('thumbnail', $image_uri)); $image_info['path'] = image_style_path('thumbnail', $image_uri); - $image_info['getsize'] = FALSE; $default_output = theme('image', $image_info); $this->drupalGet('node/' . $nid); $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.')); diff --git a/modules/image/tests/image_module_test.info b/modules/image/tests/image_module_test.info index 8186eb81..bfbb1217 100644 --- a/modules/image/tests/image_module_test.info +++ b/modules/image/tests/image_module_test.info @@ -1,4 +1,3 @@ -; $Id: image_module_test.info,v 1.1 2010/08/23 09:04:57 dries Exp $ name = Image test description = Provides hook implementations for testing Image module functionality. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = image_module_test.module hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/image/tests/image_module_test.module b/modules/image/tests/image_module_test.module index 474bc1a5..038bd155 100644 --- a/modules/image/tests/image_module_test.module +++ b/modules/image/tests/image_module_test.module @@ -1,5 +1,4 @@ <?php -// $Id: image_module_test.module,v 1.1 2010/08/23 09:04:57 dries Exp $ /** * @file diff --git a/modules/locale/locale.admin.inc b/modules/locale/locale.admin.inc index be511ef5..d8201dbf 100644 --- a/modules/locale/locale.admin.inc +++ b/modules/locale/locale.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: locale.admin.inc,v 1.23 2011/01/03 18:03:54 webchick Exp $ /** * @file @@ -468,6 +467,9 @@ function locale_languages_delete_form_submit($form, &$form_state) { ->fields(array('language' => '')) ->condition('language', $form_state['values']['langcode']) ->execute(); + if ($languages[$form_state['values']['langcode']]->enabled) { + variable_set('language_count', variable_get('language_count', 1) - 1); + } module_invoke_all('multilingual_settings_changed'); $variables = array('%locale' => $languages[$form_state['values']['langcode']]->name); drupal_set_message(t('The language %locale has been removed.', $variables)); @@ -539,6 +541,12 @@ function _locale_languages_configure_form_language_table(&$form, $type) { asort($providers_weight); foreach ($providers_weight as $id => $weight) { + // A language provider might be no more available if the defining module has + // been disabled after the last configuration saving. + if (!isset($language_providers[$id])) { + continue; + } + $enabled = isset($enabled_providers[$id]); $provider = $language_providers[$id]; @@ -656,7 +664,6 @@ function theme_locale_languages_configure_form($variables) { * Submit handler for language negotiation settings. */ function locale_languages_configure_form_submit($form, &$form_state) { - $language_types = array(); $configurable_types = $form['#language_types']; foreach ($configurable_types as $type) { @@ -664,7 +671,6 @@ function locale_languages_configure_form_submit($form, &$form_state) { $enabled_providers = $form_state['values'][$type]['enabled']; $enabled_providers[LANGUAGE_NEGOTIATION_DEFAULT] = TRUE; $providers_weight = $form_state['values'][$type]['weight']; - $language_types[$type] = TRUE; foreach ($providers_weight as $id => $weight) { if ($enabled_providers[$id]) { @@ -678,27 +684,11 @@ function locale_languages_configure_form_submit($form, &$form_state) { variable_set("locale_language_providers_weight_$type", $providers_weight); } - // Save non-configurable language types negotiation. - $language_types_info = language_types_info(); - $defined_providers = $form['#language_providers']; - foreach ($language_types_info as $type => $info) { - if (isset($info['fixed'])) { - $language_types[$type] = FALSE; - $negotiation = array(); - foreach ($info['fixed'] as $weight => $id) { - if (isset($defined_providers[$id])) { - $negotiation[$id] = $defined_providers[$id]; - $negotiation[$id]['weight'] = $weight; - } - } - language_negotiation_set($type, $negotiation); - } - } - - // Save language types. - variable_set('language_types', $language_types); + // Update non-configurable language types and the related language negotiation + // configuration. + language_types_set(); - $form_state['redirect'] = 'admin/config/regional/language'; + $form_state['redirect'] = 'admin/config/regional/language/configure'; drupal_set_message(t('Language negotiation configuration saved.')); } diff --git a/modules/locale/locale.api.php b/modules/locale/locale.api.php index fad2754c..2808f338 100644 --- a/modules/locale/locale.api.php +++ b/modules/locale/locale.api.php @@ -1,5 +1,4 @@ <?php -// $Id: locale.api.php,v 1.12 2010/07/16 02:37:06 dries Exp $ /** * @file diff --git a/modules/locale/locale.css b/modules/locale/locale.css index 0c35d7ae..1d875a2b 100644 --- a/modules/locale/locale.css +++ b/modules/locale/locale.css @@ -1,13 +1,12 @@ -/* $Id: locale.css,v 1.8 2010/10/08 03:30:40 webchick Exp $ */ .locale-untranslated { font-style: normal; text-decoration: line-through; } -.form-item-language, -.form-item-translation, -.form-item-group { +#locale-translation-filter-form .form-item-language, +#locale-translation-filter-form .form-item-translation, +#locale-translation-filter-form .form-item-group { float: left; /* LTR */ padding-right: .8em; /* LTR */ margin: 0.1em; diff --git a/modules/locale/locale.datepicker.js b/modules/locale/locale.datepicker.js index 681a2cc0..81f1e17b 100644 --- a/modules/locale/locale.datepicker.js +++ b/modules/locale/locale.datepicker.js @@ -1,4 +1,3 @@ -// $Id: locale.datepicker.js,v 1.1 2010/04/29 05:15:43 webchick Exp $ (function ($) { $.datepicker.regional['drupal-locale'] = { @@ -36,29 +35,29 @@ $.datepicker.regional['drupal-locale'] = { ], dayNames: [ Drupal.t('Sunday'), - Drupal.t('Monday') - Drupal.t('Tuesday') - Drupal.t('Wednesday') - Drupal.t('Thursday') - Drupal.t('Friday') + Drupal.t('Monday'), + Drupal.t('Tuesday'), + Drupal.t('Wednesday'), + Drupal.t('Thursday'), + Drupal.t('Friday'), Drupal.t('Saturday') ], dayNamesShort: [ - Drupal.t('Sun') - Drupal.t('Mon') - Drupal.t('Tue') - Drupal.t('Wed') - Drupal.t('Thu') - Drupal.t('Fri') + Drupal.t('Sun'), + Drupal.t('Mon'), + Drupal.t('Tue'), + Drupal.t('Wed'), + Drupal.t('Thu'), + Drupal.t('Fri'), Drupal.t('Sat') ], dayNamesMin: [ - Drupal.t('Su') - Drupal.t('Mo') - Drupal.t('Tu') - Drupal.t('We') - Drupal.t('Th') - Drupal.t('Fr') + Drupal.t('Su'), + Drupal.t('Mo'), + Drupal.t('Tu'), + Drupal.t('We'), + Drupal.t('Th'), + Drupal.t('Fr'), Drupal.t('Sa') ], dateFormat: Drupal.t('mm/dd/yy'), diff --git a/modules/locale/locale.info b/modules/locale/locale.info index 976fff45..714eec63 100644 --- a/modules/locale/locale.info +++ b/modules/locale/locale.info @@ -1,4 +1,3 @@ -; $Id: locale.info,v 1.16 2010/12/20 19:59:42 webchick Exp $ name = Locale description = Adds language handling functionality and enables the translation of the user interface to languages other than English. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = locale.test configure = admin/config/regional/language -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/locale/locale.install b/modules/locale/locale.install index 3f7d99b8..80b20c45 100644 --- a/modules/locale/locale.install +++ b/modules/locale/locale.install @@ -1,5 +1,4 @@ <?php -// $Id: locale.install,v 1.72 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -126,6 +125,14 @@ function locale_update_7002() { } } +/** + * Update "language_count" variable. + */ +function locale_update_7003() { + $languages = language_list('enabled'); + variable_set('language_count', count($languages[1])); +} + /** * @} End of "addtogroup updates-6.x-to-7.x" */ diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 8a82d1b0..07884614 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -1,5 +1,4 @@ <?php -// $Id: locale.module,v 1.307 2010/11/21 07:02:46 webchick Exp $ /** * @file @@ -60,9 +59,9 @@ function locale_help($path, $arg) { return '<p>' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (<em>.po</em>) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (<em>.pot</em>) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '</p>'; case 'admin/config/regional/translate/translate': return '<p>' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to <a href="@export">export</a> strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/config/regional/translate/export'))) . '</p>'; - case 'admin/structure/block/manage': - if ($arg[4] == 'locale' && $arg[5] == 0) { - return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to something other than <em>None</em>.', array('@languages' => url('admin/config/regional/language'), '@configuration' => url('admin/config/regional/language/configure'))) . '</p>'; + case 'admin/structure/block/manage/%/%': + if ($arg[4] == 'locale' && $arg[5] == 'language') { + return '<p>' . t('This block is only shown if <a href="@languages">at least two languages are enabled</a> and <a href="@configuration">language negotiation</a> is set to <em>URL</em> or <em>Session</em>.', array('@languages' => url('admin/config/regional/language'), '@configuration' => url('admin/config/regional/language/configure'))) . '</p>'; } break; } @@ -514,6 +513,8 @@ function locale_language_types_info() { 'description' => t('Order of language detection methods for user interface text. If a translation of user interface text is available in the detected language, it will be displayed.'), ), LANGUAGE_TYPE_CONTENT => array( + 'name' => t('Content'), + 'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'), 'fixed' => array(LOCALE_LANGUAGE_NEGOTIATION_INTERFACE), ), LANGUAGE_TYPE_URL => array( @@ -594,6 +595,22 @@ function locale_language_negotiation_info() { return $providers; } +/** + * Implements hook_modules_enabled(). + */ +function locale_modules_enabled($modules) { + include_once DRUPAL_ROOT . '/includes/language.inc'; + language_types_set(); + language_negotiation_purge(); +} + +/** + * Implements hook_modules_disabled(). + */ +function locale_modules_disabled($modules) { + locale_modules_enabled($modules); +} + // --------------------------------------------------------------------------------- // Locale core functionality @@ -773,7 +790,24 @@ function locale_language_list($field = 'name', $all = FALSE) { } /** - * Imports translations when new modules or themes are installed or enabled. + * Implements hook_modules_installed(). + */ +function locale_modules_installed($modules) { + locale_system_update($modules); +} + +/** + * Implements hook_themes_enabled(). + * + * @todo This is technically wrong. We must not import upon enabling, but upon + * initial installation. The theme system is missing an installation hook. + */ +function locale_themes_enabled($themes) { + locale_system_update($themes); +} + +/** + * Imports translations when new modules or themes are installed. * * This function will either import translation for the component change * right away, or start a batch if more files need to be imported. @@ -912,7 +946,7 @@ function locale_block_info() { include_once DRUPAL_ROOT . '/includes/language.inc'; $block = array(); $info = language_types_info(); - foreach (language_types_configurable() as $type) { + foreach (language_types_configurable(FALSE) as $type) { $block[$type] = array( 'info' => t('Language switcher (@type)', array('@type' => $info[$type]['name'])), // Not worth caching. diff --git a/modules/locale/locale.test b/modules/locale/locale.test index f18ad41b..42a6dbc4 100644 --- a/modules/locale/locale.test +++ b/modules/locale/locale.test @@ -1,9 +1,8 @@ <?php -// $Id: locale.test,v 1.88 2010/11/30 01:05:24 dries Exp $ /** * @file - * Tests for Locale module. + * Tests for locale.module. * * The test file includes: * - a functional test for the language configuration forms; @@ -18,6 +17,7 @@ * - a functional test for multilingual support by content type and on nodes. * - a functional test for multilingual fields. * - a functional test for comment language. + * - a functional test fot language types/negotiation info. */ @@ -130,7 +130,7 @@ class LocaleConfigurationTest extends DrupalWebTestCase { $this->drupalGet('admin/config/regional/language'); $this->clickLink(t('delete')); $this->assertText(t('Are you sure you want to delete the language'), t('"delete" link is correct.')); - // Delete the language. + // Delete an enabled language. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); // First test the 'cancel' link. $this->clickLink(t('Cancel')); @@ -145,6 +145,31 @@ class LocaleConfigurationTest extends DrupalWebTestCase { // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); $this->assertResponse(404, t('Language no longer found.')); + // Make sure the "language_count" variable has been updated correctly. + drupal_static_reset('language_list'); + $enabled = language_list('enabled'); + $this->assertEqual(variable_get('language_count', 1), count($enabled[1]), t('Language count is correct.')); + // Delete a disabled language. + // Disable an enabled language. + $edit = array( + 'enabled[fr]' => FALSE, + ); + $this->drupalPost($path, $edit, t('Save configuration')); + $this->assertNoFieldChecked('edit-enabled-fr', t('French language disabled.')); + // Get the count of enabled languages. + drupal_static_reset('language_list'); + $enabled = language_list('enabled'); + // Delete the disabled language. + $this->drupalPost('admin/config/regional/language/delete/fr', array(), t('Delete')); + // We need raw here because %locale will add HTML. + $this->assertRaw(t('The language %locale has been removed.', array('%locale' => 'French')), t('Disabled language has been removed.')); + $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.')); + // Verify that language is no longer found. + $this->drupalGet('admin/config/regional/language/delete/fr'); + $this->assertResponse(404, t('Language no longer found.')); + // Make sure the "language_count" variable has not changed. + $this->assertEqual(variable_get('language_count', 1), count($enabled[1]), t('Language count is correct.')); + // Ensure we can't delete the English language. $this->drupalGet('admin/config/regional/language/delete/en'); @@ -2224,10 +2249,13 @@ class LocaleCommentLanguageFunctionalTest extends DrupalWebTestCase { variable_set('locale_test_content_language_type', TRUE); // Set interface language detection to user and content language detection - // to URL. + // to URL. Disable inheritance from interface language to ensure content + // language will fall back to the default language if no URL language can be + // detected. $edit = array( 'language[enabled][locale-user]' => TRUE, - 'language_content[enabled][locale-url]' => TRUE + 'language_content[enabled][locale-url]' => TRUE, + 'language_content[enabled][locale-interface]' => FALSE, ); $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings')); @@ -2349,3 +2377,158 @@ class LocaleDateFormatsFunctionalTest extends DrupalWebTestCase { $this->assertText($french_date, t('French date format appears')); } } + +/** + * Functional test for language types/negotiation info. + */ +class LocaleLanguageNegotiationInfoFunctionalTest extends DrupalWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Language negotiation info', + 'description' => 'Tests alterations to language types/negotiation info.', + 'group' => 'Locale', + ); + } + + function setUp() { + parent::setUp('locale'); + require_once DRUPAL_ROOT .'/includes/language.inc'; + $admin_user = $this->drupalCreateUser(array('administer languages', 'access administration pages', 'view the administration theme')); + $this->drupalLogin($admin_user); + $this->drupalPost('admin/config/regional/language/add', array('langcode' => 'it'), t('Add language')); + } + + /** + * Tests alterations to language types/negotiation info. + */ + function testInfoAlterations() { + // Enable language type/negotiation info alterations. + variable_set('locale_test_language_types', TRUE); + variable_set('locale_test_language_negotiation_info', TRUE); + $this->languageNegotiationUpdate(); + + // Check that fixed language types are properly configured without the need + // of saving the language negotiation settings. + $this->checkFixedLanguageTypes(); + + // Make the content language type configurable by updating the language + // negotiation settings with the proper flag enabled. + variable_set('locale_test_content_language_type', TRUE); + $this->languageNegotiationUpdate(); + $type = LANGUAGE_TYPE_CONTENT; + $language_types = variable_get('language_types', drupal_language_types()); + $this->assertTrue($language_types[$type], t('Content language type is configurable.')); + + // Enable some core and custom language providers. The test language type is + // supposed to be configurable. + $test_type = 'test_language_type'; + $provider = LOCALE_LANGUAGE_NEGOTIATION_INTERFACE; + $test_provider = 'test_language_provider'; + $form_field = $type . '[enabled]['. $provider .']'; + $edit = array( + $form_field => TRUE, + $type . '[enabled][' . $test_provider . ']' => TRUE, + $test_type . '[enabled][' . $test_provider . ']' => TRUE, + ); + $this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings')); + + // Remove the interface language provider by updating the language + // negotiation settings with the proper flag enabled. + variable_set('locale_test_language_negotiation_info_alter', TRUE); + $this->languageNegotiationUpdate(); + $negotiation = variable_get("language_negotiation_$type", array()); + $this->assertFalse(isset($negotiation[$provider]), t('Interface language provider removed from the stored settings.')); + $this->assertNoFieldByXPath("//input[@name=\"$form_field\"]", NULL, t('Interface language provider unavailable.')); + + // Check that type-specific language providers can be assigned only to the + // corresponding language types. + foreach (language_types_configurable() as $type) { + $form_field = $type . '[enabled][test_language_provider_ts]'; + if ($type == $test_type) { + $this->assertFieldByXPath("//input[@name=\"$form_field\"]", NULL, t('Type-specific test language provider available for %type.', array('%type' => $type))); + } + else { + $this->assertNoFieldByXPath("//input[@name=\"$form_field\"]", NULL, t('Type-specific test language provider unavailable for %type.', array('%type' => $type))); + } + } + + // Check language negotiation results. + $this->drupalGet(''); + $last = variable_get('locale_test_language_negotiation_last', array()); + foreach (language_types() as $type) { + $langcode = $last[$type]; + $value = $type == LANGUAGE_TYPE_CONTENT || strpos($type, 'test') !== FALSE ? 'it' : 'en'; + $this->assertEqual($langcode, $value, t('The negotiated language for %type is %language', array('%type' => $type, '%language' => $langcode))); + } + + // Disable locale_test and check that everything is set back to the original + // status. + $this->languageNegotiationUpdate('disable'); + + // Check that only the core language types are available. + foreach (language_types() as $type) { + $this->assertTrue(strpos($type, 'test') === FALSE, t('The %type language is still available', array('%type' => $type))); + } + + // Check that fixed language types are properly configured, even those + // previously set to configurable. + $this->checkFixedLanguageTypes(); + + // Check that unavailable language providers are not present in the + // negotiation settings. + $negotiation = variable_get("language_negotiation_$type", array()); + $this->assertFalse(isset($negotiation[$test_provider]), t('The disabled test language provider is not part of the content language negotiation settings.')); + + // Check that configuration page presents the correct options and settings. + $this->assertNoRaw(t('Test language detection'), t('No test language type configuration available.')); + $this->assertNoRaw(t('This is a test language provider'), t('No test language provider available.')); + } + + /** + * Update language types/negotiation information. + * + * Manually invoke locale_modules_enabled()/locale_modules_disabled() since + * they would not be invoked after enabling/disabling locale_test the first + * time. + */ + private function languageNegotiationUpdate($op = 'enable') { + static $last_op = NULL; + $modules = array('locale_test'); + + // Enable/disable locale_test only if we did not already before. + if ($last_op != $op) { + $function = "module_{$op}"; + $function($modules); + // Reset hook implementation cache. + module_implements(NULL, FALSE, TRUE); + } + + drupal_static_reset('language_types_info'); + drupal_static_reset('language_negotiation_info'); + $function = "locale_modules_{$op}d"; + if (function_exists($function)) { + $function($modules); + } + + $this->drupalGet('admin/config/regional/language/configure'); + } + + /** + * Check that language negotiation for fixed types matches the stored one. + */ + private function checkFixedLanguageTypes() { + drupal_static_reset('language_types_info'); + foreach (language_types_info() as $type => $info) { + if (isset($info['fixed'])) { + $negotiation = variable_get("language_negotiation_$type", array()); + $equal = count($info['fixed']) == count($negotiation); + while ($equal && list($id) = each($negotiation)) { + list(, $info_id) = each($info['fixed']); + $equal = $info_id == $id; + } + $this->assertTrue($equal, t('language negotiation for %type is properly set up', array('%type' => $type))); + } + } + } +} diff --git a/modules/locale/tests/locale_test.info b/modules/locale/tests/locale_test.info index 551f1d56..ca297f51 100644 --- a/modules/locale/tests/locale_test.info +++ b/modules/locale/tests/locale_test.info @@ -1,4 +1,3 @@ -; $Id: locale_test.info,v 1.3 2010/12/20 19:59:42 webchick Exp $ name = "Locale Test" description = "Support module for the locale layer tests." core = 7.x @@ -6,8 +5,8 @@ package = Testing version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/locale/tests/locale_test.module b/modules/locale/tests/locale_test.module index e331b29d..14a2588d 100644 --- a/modules/locale/tests/locale_test.module +++ b/modules/locale/tests/locale_test.module @@ -1,5 +1,4 @@ <?php -// $Id: locale_test.module,v 1.6 2010/10/09 13:46:09 dries Exp $ /** * @file @@ -28,14 +27,89 @@ function locale_test_boot() { } } +/** + * Implements hook_init(). + */ +function locale_test_init() { + locale_test_store_language_negotiation(); +} + +/** + * Implements hook_language_types_info(). + */ +function locale_test_language_types_info() { + if (variable_get('locale_test_language_types', FALSE)) { + return array( + 'test_language_type' => array( + 'name' => t('Test'), + 'description' => t('A test language type.'), + ), + 'fixed_test_language_type' => array( + 'fixed' => array('test_language_provider'), + ), + ); + } +} + /** * Implements hook_language_types_info_alter(). */ function locale_test_language_types_info_alter(array &$language_types) { if (variable_get('locale_test_content_language_type', FALSE)) { - $language_types[LANGUAGE_TYPE_CONTENT] = array( - 'name' => t('Content'), - 'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'), + unset($language_types[LANGUAGE_TYPE_CONTENT]['fixed']); + } +} + +/** + * Implements hook_language_negotiation_info(). + */ +function locale_test_language_negotiation_info() { + if (variable_get('locale_test_language_negotiation_info', FALSE)) { + $info = array( + 'callbacks' => array( + 'language' => 'locale_test_language_provider', + ), + 'file' => drupal_get_path('module', 'locale_test') .'/locale_test.module', + 'weight' => -10, + 'description' => t('This is a test language provider.'), ); + + return array( + 'test_language_provider' => array( + 'name' => t('Test'), + 'types' => array(LANGUAGE_TYPE_CONTENT, 'test_language_type', 'fixed_test_language_type'), + ) + $info, + 'test_language_provider_ts' => array( + 'name' => t('Type-specific test'), + 'types' => array('test_language_type'), + ) + $info, + ); + } +} + +/** + * Implements hook_language_negotiation_info_alter(). + */ +function locale_test_language_negotiation_info_alter(array &$language_providers) { + if (variable_get('locale_test_language_negotiation_info_alter', FALSE)) { + unset($language_providers[LOCALE_LANGUAGE_NEGOTIATION_INTERFACE]); } } + +/** + * Store the last negotiated languages. + */ +function locale_test_store_language_negotiation() { + $last = array(); + foreach (language_types() as $type) { + $last[$type] = $GLOBALS[$type]->language; + } + variable_set('locale_test_language_negotiation_last', $last); +} + +/** + * Test language provider. + */ +function locale_test_language_provider($languages) { + return 'it'; +} diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index 06b3eb3a..1f3c4f72 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: menu.admin.inc,v 1.90 2010/10/20 07:40:59 webchick Exp $ /** * @file diff --git a/modules/menu/menu.admin.js b/modules/menu/menu.admin.js index 2fca932a..15bc2e7c 100644 --- a/modules/menu/menu.admin.js +++ b/modules/menu/menu.admin.js @@ -1,4 +1,3 @@ -// $Id: menu.admin.js,v 1.1 2009/10/13 01:25:58 dries Exp $ (function ($) { diff --git a/modules/menu/menu.api.php b/modules/menu/menu.api.php index 12ccabd6..3f3818e1 100644 --- a/modules/menu/menu.api.php +++ b/modules/menu/menu.api.php @@ -1,5 +1,4 @@ <?php -// $Id: menu.api.php,v 1.25 2010/04/28 05:08:24 webchick Exp $ /** * @file diff --git a/modules/menu/menu.css b/modules/menu/menu.css index 68598ef1..96f861ad 100644 --- a/modules/menu/menu.css +++ b/modules/menu/menu.css @@ -1,4 +1,3 @@ -/* $Id: menu.css,v 1.7 2009/10/17 12:10:31 dries Exp $ */ .menu-operations { width: 100px; diff --git a/modules/menu/menu.info b/modules/menu/menu.info index 0d6bf530..c4b24654 100644 --- a/modules/menu/menu.info +++ b/modules/menu/menu.info @@ -1,4 +1,3 @@ -; $Id: menu.info,v 1.11 2010/12/20 19:59:42 webchick Exp $ name = Menu description = Allows administrators to customize the site navigation menu. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = menu.test configure = admin/structure/menu -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/menu/menu.install b/modules/menu/menu.install index 7f6a1fa5..05aed283 100644 --- a/modules/menu/menu.install +++ b/modules/menu/menu.install @@ -1,5 +1,4 @@ <?php -// $Id: menu.install,v 1.26 2010/08/23 23:38:06 webchick Exp $ /** * @file diff --git a/modules/menu/menu.js b/modules/menu/menu.js index 8123ecef..40c1bfe9 100644 --- a/modules/menu/menu.js +++ b/modules/menu/menu.js @@ -1,4 +1,3 @@ -// $Id: menu.js,v 1.7 2010/11/05 19:47:20 dries Exp $ (function ($) { diff --git a/modules/menu/menu.module b/modules/menu/menu.module index 44b3772d..fc8f68a6 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -1,9 +1,14 @@ <?php -// $Id: menu.module,v 1.233 2010/09/24 00:37:43 dries Exp $ /** * @file - * Allows administrators to customize the site navigation menu. + * Allows administrators to customize the site's navigation menus. + * + * A menu (in this context) is a hierarchical collection of links, generally + * used for navigation. This is not to be confused with the + * @link menu Menu system @endlink of menu.inc and hook_menu(), which defines + * page routing requests for Drupal, and also allows the defined page routing + * URLs to be added to the main site navigation menu. */ /** @@ -20,7 +25,7 @@ function menu_help($path, $arg) { case 'admin/help#menu': $output = ''; $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('The Menu module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. Each menu is rendered in a block that can be enabled and positioned through the <a href="@blocks"">Blocks administration page</a>. You can view and manage menus on the <a href="@menus">Menus administration page</a>. For more information, see the online handbook entry for the <a href="@menu">Menu module</a>.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/handbook/modules/menu/')) . '</p>'; + $output .= '<p>' . t('The Menu module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. Each menu is rendered in a block that can be enabled and positioned through the <a href="@blocks">Blocks administration page</a>. You can view and manage menus on the <a href="@menus">Menus administration page</a>. For more information, see the online handbook entry for the <a href="@menu">Menu module</a>.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/handbook/modules/menu/')) . '</p>'; $output .= '<h3>' . t('Uses') . '</h3>'; $output .= '<dl>'; $output .= '<dt>' . t('Managing menus') . '</dt>'; @@ -352,7 +357,7 @@ function menu_parent_options($menus, $item) { /** * Page callback. - * Get all available menus and menu items as Javascript array. + * Get all the available menus and menu items as a JavaScript array. */ function menu_parent_options_js() { $available_menus = array(); @@ -535,18 +540,23 @@ function menu_node_delete($node) { function menu_node_prepare($node) { if (empty($node->menu)) { // Prepare the node for the edit form so that $node->menu always exists. - $menu_name = variable_get('menu_parent_' . $node->type, 'main-menu:0'); + $menu_name = strtok(variable_get('menu_parent_' . $node->type, 'main-menu:0'), ':'); $item = array(); if (isset($node->nid)) { + $mlid = FALSE; // Give priority to the default menu - $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name AND module = 'menu' ORDER BY mlid ASC", 0, 1, array( - ':path' => 'node/' . $node->nid, - ':menu_name' => $menu_name, - ))->fetchField(); - // Check all menus if a link does not exist in the default menu. - if (!$mlid) { - $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu' ORDER BY mlid ASC", 0, 1, array( + $type_menus = variable_get('menu_options_' . $node->type, array('main-menu' => 'main-menu')); + if (in_array($menu_name, $type_menus)) { + $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name AND module = 'menu' ORDER BY mlid ASC", 0, 1, array( + ':path' => 'node/' . $node->nid, + ':menu_name' => $menu_name, + ))->fetchField(); + } + // Check all allowed menus if a link does not exist in the default menu. + if (!$mlid && !empty($type_menus)) { + $mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu' AND menu_name IN (:type_menus) ORDER BY mlid ASC", 0, 1, array( ':path' => 'node/' . $node->nid, + ':type_menus' => array_values($type_menus), ))->fetchField(); } if ($mlid) { diff --git a/modules/menu/menu.test b/modules/menu/menu.test index a2c4ebdc..b457177c 100644 --- a/modules/menu/menu.test +++ b/modules/menu/menu.test @@ -1,9 +1,8 @@ <?php -// $Id: menu.test,v 1.42 2010/10/13 13:43:21 dries Exp $ /** * @file - * Tests file for the menu module. + * Tests for menu.module. */ class MenuTestCase extends DrupalWebTestCase { @@ -380,7 +379,7 @@ class MenuTestCase extends DrupalWebTestCase { /** * Modify a menu link using the menu module UI. * - * @param array &$item Menu link passed by reference. + * @param array $item Menu link passed by reference. */ function modifyMenuLink(&$item) { $item['link_title'] = $this->randomName(16); @@ -665,5 +664,21 @@ class MenuNodeTestCase extends DrupalWebTestCase { // Assert that there is no link for the node. $this->drupalGet(''); $this->assertNoLink($node_title); + + // Add a menu link to the Management menu. + $item = array( + 'link_path' => 'node/' . $node->nid, + 'link_title' => $this->randomName(16), + 'menu_name' => 'management', + ); + menu_link_save($item); + + // Assert that disabled Management menu is not shown on the node/$nid/edit page. + $this->drupalGet('node/' . $node->nid . '/edit'); + $this->assertText('Provide a menu link', t('Link in not allowed menu not shown in node edit form')); + // Assert that the link is still in the management menu after save. + $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); + $link = menu_link_load($item['mlid']); + $this->assertTrue($link, t('Link in not allowed menu still exists after saving node')); } } diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index 67eacad7..11ecc2c3 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -1,5 +1,4 @@ <?php -// $Id: content_types.inc,v 1.119 2010/10/13 13:43:21 dries Exp $ /** * @file @@ -70,7 +69,7 @@ function theme_node_admin_overview($variables) { $type = $variables['type']; $output = check_plain($name); - $output .= ' <small> (Machine name: ' . check_plain($type->type) . ')</small>'; + $output .= ' <small>' . t('(Machine name: @type)', array('@type' => $type->type)) . '</small>'; $output .= '<div class="description">' . filter_xss_admin($type->description) . '</div>'; return $output; } diff --git a/modules/node/content_types.js b/modules/node/content_types.js index 94fe1eb8..0031c323 100644 --- a/modules/node/content_types.js +++ b/modules/node/content_types.js @@ -1,4 +1,3 @@ -// $Id: content_types.js,v 1.10 2010/05/05 06:55:25 webchick Exp $ (function ($) { Drupal.behaviors.contentTypes = { diff --git a/modules/node/node-rtl.css b/modules/node/node-rtl.css index 169ede7f..a5fe99ea 100644 --- a/modules/node/node-rtl.css +++ b/modules/node/node-rtl.css @@ -1,4 +1,3 @@ -/* $Id: node-rtl.css,v 1.5 2009/11/17 02:50:41 webchick Exp $ */ #node-admin-content dl.multiselect dd .form-item label { display: block; diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc index 795e8a71..a6ea1b5e 100644 --- a/modules/node/node.admin.inc +++ b/modules/node/node.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: node.admin.inc,v 1.103 2010/12/09 02:16:21 dries Exp $ /** * @file @@ -388,9 +387,9 @@ function node_admin_nodes() { '#submit' => array('node_admin_nodes_submit'), ); - // Enable language column if translation module is enabled - // or if we have any node with language. - $multilanguage = (module_exists('translation') || db_query("SELECT COUNT(*) FROM {node} WHERE language <> :language", array(':language' => LANGUAGE_NONE))->fetchField()); + // Enable language column if translation module is enabled or if we have any + // node with language. + $multilanguage = (module_exists('translation') || db_query_range("SELECT 1 FROM {node} WHERE language <> :language", 0, 1, array(':language' => LANGUAGE_NONE))->fetchField()); // Build the sortable table header. $header = array( diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 8e3c0b0d..3e8029cf 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -1,5 +1,4 @@ <?php -// $Id: node.api.php,v 1.83 2011/01/03 18:03:54 webchick Exp $ /** * @file @@ -38,6 +37,7 @@ * - Creating a new node (calling node_save() on a new node): * - field_attach_presave() * - hook_node_presave() (all) + * - hook_entity_presave() (all) * - Node and revision records are written to the database * - hook_insert() (node-type-specific) * - field_attach_insert() @@ -48,6 +48,7 @@ * - Updating an existing node (calling node_save() on an existing node): * - field_attach_presave() * - hook_node_presave() (all) + * - hook_entity_presave() (all) * - Node and revision records are written to the database * - hook_update() (node-type-specific) * - field_attach_update() @@ -70,6 +71,9 @@ * - hook_entity_prepare_view() (all) * - field_attach_view() * - hook_node_view() (all) + * - hook_entity_view() (all) + * - hook_node_view_alter() (all) + * - hook_entity_view_alter() (all) * - Viewing multiple nodes (calling node_view_multiple() - note that the input * to node_view_multiple() is a set of loaded nodes, so the Loading steps * above are already done): @@ -78,13 +82,16 @@ * - hook_view() (node-type-specific) * - field_attach_view() * - hook_node_view() (all) + * - hook_entity_view() (all) * - hook_node_view_alter() (all) + * - hook_entity_view_alter() (all) * - Deleting a node (calling node_delete() or node_delete_multiple()): * - Node is loaded (see Loading section above) - * - Node and revision information is deleted from database * - hook_delete() (node-type-specific) * - hook_node_delete() (all) + * - hook_entity_delete() (all) * - field_attach_delete() + * - Node and revision information are deleted from database * - Deleting a node revision (calling node_revision_delete()): * - Node is loaded (see Loading section above) * - Revision information is deleted from database @@ -315,7 +322,7 @@ function hook_node_access_records($node) { * @see hook_node_grants() * @see hook_node_grants_alter() * - * @param &$grants + * @param $grants * The $grants array returned by hook_node_access_records(). * @param $node * The node for which the grants were acquired. @@ -360,7 +367,7 @@ function hook_node_access_records_alter(&$grants, $node) { * @see hook_node_access_records() * @see hook_node_access_records_alter() * - * @param &$grants + * @param $grants * The $grants array returned by hook_node_grants(). * @param $account * The user account requesting access to content. @@ -454,9 +461,10 @@ function hook_node_operations() { /** * Respond to node deletion. * - * This hook is invoked from node_delete_multiple() after the node has been - * removed from the node table in the database, after the type-specific - * hook_delete() has been invoked, and before field_attach_delete() is called. + * This hook is invoked from node_delete_multiple() after the type-specific + * hook_delete() has been invoked, but before hook_entity_delete and + * field_attach_delete() are called, and before the node is removed from the + * node table in the database. * * @param $node * The node that is being deleted. @@ -580,7 +588,7 @@ function hook_node_load($nodes, $types) { * @return * NODE_ACCESS_ALLOW if the operation is to be allowed; * NODE_ACCESS_DENY if the operation is to be denied; - * NODE_ACCESSS_IGNORE to not affect this operation at all. + * NODE_ACCESS_IGNORE to not affect this operation at all. */ function hook_node_access($node, $op, $account) { $type = is_string($node) ? $node : $node->type; @@ -1057,8 +1065,6 @@ function hook_prepare($node) { * displayed automatically by the node module. This hook just needs to * return the node title and form editing fields specific to the node type. * - * For a detailed usage example, see node_example.module. - * * @param $node * The node being added or edited. * @param $form_state diff --git a/modules/node/node.css b/modules/node/node.css index 1df32e34..07540fa9 100644 --- a/modules/node/node.css +++ b/modules/node/node.css @@ -1,4 +1,3 @@ -/* $Id: node.css,v 1.18 2010/09/17 14:53:21 dries Exp $ */ .node-unpublished { background-color: #fff4f4; diff --git a/modules/node/node.info b/modules/node/node.info index 86e60d15..d61ee3e6 100644 --- a/modules/node/node.info +++ b/modules/node/node.info @@ -1,4 +1,3 @@ -; $Id: node.info,v 1.15 2010/12/20 19:59:42 webchick Exp $ name = Node description = Allows content to be submitted to the site and displayed on pages. package = Core @@ -10,8 +9,8 @@ required = TRUE configure = admin/structure/types stylesheets[all][] = node.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/node/node.install b/modules/node/node.install index fe6661cd..852c1117 100644 --- a/modules/node/node.install +++ b/modules/node/node.install @@ -1,5 +1,4 @@ <?php -// $Id: node.install,v 1.62 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -396,6 +395,34 @@ function node_schema() { ), ); + $schema['history'] = array( + 'description' => 'A record of which {users} have read which {node}s.', + 'fields' => array( + 'uid' => array( + 'description' => 'The {users}.uid that read the {node} nid.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'nid' => array( + 'description' => 'The {node}.nid that was read.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'timestamp' => array( + 'description' => 'The Unix timestamp at which the read occurred.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('uid', 'nid'), + 'indexes' => array( + 'nid' => array('nid'), + ), + ); + return $schema; } @@ -442,7 +469,26 @@ function node_update_dependencies() { * @ingroup update-api-6.x-to-7.x */ function _update_7000_node_get_types() { - return db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ); + $node_types = db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ); + + // Create default settings for orphan nodes. + $all_types = db_query('SELECT DISTINCT type FROM {node}')->fetchCol(); + $extra_types = array_diff($all_types, array_keys($node_types)); + + foreach ($extra_types as $type) { + $type_object = new stdClass; + $type_object->type = $type; + + // In Drupal 6, whether you have a body field or not is a flag in the node + // type table. If it's enabled, nodes may or may not have an empty string + // for the bodies. As we can't detect what this setting should be in + // Drupal 7 without access to the Drupal 6 node type settings, we assume + // the default, which is to enable the body field. + $type_object->has_body = 1; + $type_object->body_label = 'Body'; + $node_types[$type_object->type] = $type_object; + } + return $node_types; } /** @@ -573,19 +619,6 @@ function node_update_7006(&$sandbox) { // Get node type info, specifically the body field settings. $node_types = _update_7000_node_get_types(); - // Create default settings for orphan nodes. - $extra_types = db_query('SELECT DISTINCT type FROM {node} WHERE type NOT IN (:types)', array(':types' => array_keys($node_types)))->fetchCol(); - foreach ($extra_types as $type) { - $type_object = new stdClass; - $type_object->type = $type; - // Always create a body. Querying node_revisions for a non-empty body - // would skip creating body fields for types that have a body but - // the nodes of that type so far had empty bodies. - $type_object->has_body = 1; - $type_object->body_label = 'Body'; - $node_types[$type_object->type] = $type_object; - } - // Add body field instances for existing node types. foreach ($node_types as $node_type) { if ($node_type->has_body) { @@ -803,6 +836,29 @@ function node_update_7010() { db_create_table('block_node_type', $schema['block_node_type']); } +/** + * Update the database from Drupal 6 to match the schema. + */ +function node_update_7011() { + // Drop node moderation field. + db_drop_field('node', 'moderate'); + db_drop_index('node', 'node_moderate'); + + // Change {node_revision}.status field to default to 1. + db_change_field('node_revision', 'status', 'status', array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1, + )); + + // Change {node_type}.module field default. + db_change_field('node_type', 'module', 'module', array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); +} + /** * @} End of "addtogroup updates-6.x-to-7.x" */ diff --git a/modules/node/node.js b/modules/node/node.js index a5961f97..ebf68eb3 100644 --- a/modules/node/node.js +++ b/modules/node/node.js @@ -1,4 +1,3 @@ -// $Id: node.js,v 1.8 2010/12/15 03:42:25 webchick Exp $ (function ($) { diff --git a/modules/node/node.module b/modules/node/node.module index bafb54f3..524a57fa 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1,5 +1,4 @@ <?php -// $Id: node.module,v 1.1336 2011/01/03 18:03:54 webchick Exp $ /** * @file @@ -365,7 +364,7 @@ function node_mark($nid, $timestamp) { * Either a string or object, containing the node type information. * * @return - * Node type of the passed in data. + * Node type of the passed-in data. */ function _node_extract_type($node) { return is_object($node) ? $node->type : $node; @@ -490,7 +489,6 @@ function node_type_load($name) { * Status flag indicating outcome of the operation. */ function node_type_save($info) { - $is_existing = FALSE; $existing_type = !empty($info->old_type) ? $info->old_type : $info->type; $is_existing = (bool) db_query_range('SELECT 1 FROM {node_type} WHERE type = :type', 0, 1, array(':type' => $existing_type))->fetchField(); $type = node_type_set_defaults($info); @@ -570,7 +568,7 @@ function node_add_body_field($type, $label = 'Body') { 'entity_type' => 'node', 'bundle' => $type->type, 'label' => $label, - 'widget_type' => 'text_textarea_with_summary', + 'widget' => array('type' => 'text_textarea_with_summary'), 'settings' => array('display_summary' => TRUE), 'display' => array( 'default' => array( @@ -754,17 +752,20 @@ function node_type_cache_reset() { } /** - * Set the default values for a node type. + * Sets the default values for a node type. * - * The defaults are for a type defined through hook_node_info(). - * When populating a custom node type $info should have the 'custom' - * key set to 1. + * The defaults are appropriate for a type defined through hook_node_info(), + * since 'custom' is TRUE for types defined in the user interface, and FALSE + * for types defined by modules. (The 'custom' flag prevents types from being + * deleted through the user interface.) Also, the default for 'locked' is TRUE, + * which prevents users from changing the machine name of the type. * * @param $info - * An object or array containing values to override the defaults. + * An object or array containing values to override the defaults. See + * hook_node_info() for details on what the array elements mean. * * @return - * A node type object. + * A node type object, with missing values in $info set to their defaults. */ function node_type_set_defaults($info = array()) { $info = (array) $info; @@ -1349,15 +1350,15 @@ function node_build_content($node, $view_mode = 'full', $langcode = NULL) { // The 'view' hook can be implemented to overwrite the default function // to display nodes. if (node_hook($node, 'view')) { - $node = node_invoke($node, 'view', $view_mode); + $node = node_invoke($node, 'view', $view_mode, $langcode); } // Build fields content. // In case of a multiple view, node_view_multiple() already ran the // 'prepare_view' step. An internal flag prevents the operation from running // twice. - field_attach_prepare_view('node', array($node->nid => $node), $view_mode); - entity_prepare_view('node', array($node->nid => $node)); + field_attach_prepare_view('node', array($node->nid => $node), $view_mode, $langcode); + entity_prepare_view('node', array($node->nid => $node), $langcode); $node->content += field_attach_view('node', $node, $view_mode, $langcode); // Always display a read more link on teasers because we have no way @@ -1411,7 +1412,7 @@ function node_show($node, $message = FALSE) { } /** - * Returns whether the current page is the full page view of the passed in node. + * Returns whether the current page is the full page view of the passed-in node. * * @param $node * A node object. @@ -1450,10 +1451,6 @@ function template_preprocess_node(&$variables) { $variables['title'] = check_plain($node->title); $variables['page'] = $variables['view_mode'] == 'full' && node_is_page($node); - if (!empty($node->in_preview)) { - unset($node->content['links']); - } - // Flatten the node object's member fields. $variables = array_merge((array) $node, $variables); @@ -2190,7 +2187,7 @@ function node_get_recent($number = 10) { } $nids = $query ->fields('n', array('nid')) - ->orderBy('changed', 'DESC') + ->orderBy('n.changed', 'DESC') ->range(0, $number) ->addTag('node_access') ->execute() @@ -2516,8 +2513,8 @@ function node_feed($nids = FALSE, $channel = array()) { * An array in the format expected by drupal_render(). */ function node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcode = NULL) { - field_attach_prepare_view('node', $nodes, $view_mode); - entity_prepare_view('node', $nodes); + field_attach_prepare_view('node', $nodes, $view_mode, $langcode); + entity_prepare_view('node', $nodes, $langcode); $build = array(); foreach ($nodes as $node) { $build['nodes'][$node->nid] = node_view($node, $view_mode, $langcode); diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 1b0e3fd0..ed1af3e9 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: node.pages.inc,v 1.136 2010/11/26 19:23:01 dries Exp $ /** * @file diff --git a/modules/node/node.test b/modules/node/node.test index 4c189a83..8a871c0c 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1,5 +1,9 @@ <?php -// $Id: node.test,v 1.106 2010/12/17 19:28:14 webchick Exp $ + +/** + * @file + * Tests for node.module. + */ /** * Test the node_load_multiple() function. @@ -2126,7 +2130,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('node' => $node), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized node token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized node token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -2138,7 +2142,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('node' => $node), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized node token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized node token %token replaced.', array('%token' => $input))); } } } diff --git a/modules/node/node.tokens.inc b/modules/node/node.tokens.inc index 46d329fc..80dbda51 100644 --- a/modules/node/node.tokens.inc +++ b/modules/node/node.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: node.tokens.inc,v 1.15 2010/06/29 00:57:19 dries Exp $ /** * @file diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php index a864bb8e..6d0f489d 100644 --- a/modules/node/node.tpl.php +++ b/modules/node/node.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: node.tpl.php,v 1.34 2010/12/01 00:18:15 webchick Exp $ /** * @file diff --git a/modules/node/tests/node_access_test.info b/modules/node/tests/node_access_test.info index 38bd21d4..ee2433c2 100644 --- a/modules/node/tests/node_access_test.info +++ b/modules/node/tests/node_access_test.info @@ -1,4 +1,3 @@ -; $Id: node_access_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $ name = "Node module access tests" description = "Support module for node permission testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/node/tests/node_access_test.module b/modules/node/tests/node_access_test.module index 97defc53..3004e0c9 100644 --- a/modules/node/tests/node_access_test.module +++ b/modules/node/tests/node_access_test.module @@ -1,5 +1,4 @@ <?php -// $Id: node_access_test.module,v 1.4 2010/11/20 04:33:56 webchick Exp $ /** * @file diff --git a/modules/node/tests/node_test.info b/modules/node/tests/node_test.info index 7f8e9b53..29640594 100644 --- a/modules/node/tests/node_test.info +++ b/modules/node/tests/node_test.info @@ -1,4 +1,3 @@ -; $Id: node_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $ name = "Node module tests" description = "Support module for node related testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/node/tests/node_test.module b/modules/node/tests/node_test.module index 76c7074f..b0ebc149 100644 --- a/modules/node/tests/node_test.module +++ b/modules/node/tests/node_test.module @@ -1,5 +1,4 @@ <?php -// $Id: node_test.module,v 1.14 2010/11/30 19:31:46 dries Exp $ /** * @file diff --git a/modules/node/tests/node_test_exception.info b/modules/node/tests/node_test_exception.info index 54585b35..37d2af91 100644 --- a/modules/node/tests/node_test_exception.info +++ b/modules/node/tests/node_test_exception.info @@ -1,4 +1,3 @@ -; $Id: node_test_exception.info,v 1.2 2010/12/20 19:59:42 webchick Exp $ name = "Node module exception tests" description = "Support module for node related exception testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/node/tests/node_test_exception.module b/modules/node/tests/node_test_exception.module index fc26b9e6..0fe9f35e 100644 --- a/modules/node/tests/node_test_exception.module +++ b/modules/node/tests/node_test_exception.module @@ -1,5 +1,4 @@ <?php -// $Id: node_test_exception.module,v 1.4 2010/01/09 21:54:01 webchick Exp $ /** * @file diff --git a/modules/openid/openid-rtl.css b/modules/openid/openid-rtl.css index eac22b0e..861f6d7d 100644 --- a/modules/openid/openid-rtl.css +++ b/modules/openid/openid-rtl.css @@ -1,4 +1,3 @@ -/* $Id: openid-rtl.css,v 1.1 2010/06/04 20:39:44 dries Exp $ */ #edit-openid-identifier { background-position: right 50%; diff --git a/modules/openid/openid.api.php b/modules/openid/openid.api.php index b797e807..11faa71e 100644 --- a/modules/openid/openid.api.php +++ b/modules/openid/openid.api.php @@ -1,5 +1,4 @@ <?php -// $Id: openid.api.php,v 1.5 2010/05/13 17:37:24 dries Exp $ /** * @file diff --git a/modules/openid/openid.css b/modules/openid/openid.css index dc587683..48b170fb 100644 --- a/modules/openid/openid.css +++ b/modules/openid/openid.css @@ -1,4 +1,3 @@ -/* $Id: openid.css,v 1.11 2010/05/05 16:28:06 dries Exp $ */ #edit-openid-identifier { background-image: url("login-bg.png"); diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc index 9e02f213..6945f34e 100644 --- a/modules/openid/openid.inc +++ b/modules/openid/openid.inc @@ -1,5 +1,4 @@ <?php -// $Id: openid.inc,v 1.37 2010/10/28 02:27:09 dries Exp $ /** * @file @@ -189,32 +188,33 @@ function _openid_select_service(array $services) { // Extensible Resource Identifier (XRI) Resolution Version 2.0, section 4.3.3: // Find the service with the highest priority (lowest integer value). If there // is a tie, select a random one, not just the first in the XML document. - $selected_service = NULL; shuffle($services); + $selected_service = NULL; + $selected_type_priority = FALSE; // Search for an OP Identifier Element. foreach ($services as $service) { if (!empty($service['uri'])) { + $type_priority = FALSE; if (in_array('http://specs.openid.net/auth/2.0/server', $service['types'])) { $service['version'] = 2; + $type_priority = 1; + } + elseif (in_array('http://specs.openid.net/auth/2.0/signon', $service['types'])) { + $service['version'] = 2; + $type_priority = 2; } elseif (in_array(OPENID_NS_1_0, $service['types']) || in_array(OPENID_NS_1_1, $service['types'])) { $service['version'] = 1; + $type_priority = 3; } - if (isset($service['version']) && (!$selected_service || $service['priority'] < $selected_service['priority'])) { - $selected_service = $service; - } - } - } - if (!$selected_service) { - // Search for Claimed Identifier Element. - foreach ($services as $service) { - if (!empty($service['uri']) && in_array('http://specs.openid.net/auth/2.0/signon', $service['types'])) { - $service['version'] = 2; - if (!$selected_service || $service['priority'] < $selected_service['priority']) { - $selected_service = $service; - } + if ($type_priority + && (!$selected_service + || $type_priority < $selected_type_priority + || ($type_priority == $selected_type_priority && $service['priority'] < $selected_service['priority']))) { + $selected_service = $service; + $selected_type_priority = $type_priority; } } } @@ -448,15 +448,15 @@ function _openid_dh_binary_to_long($str) { $n = 0; foreach ($bytes as $byte) { - $n = bcmul($n, pow(2, 8)); - $n = bcadd($n, $byte); + $n = _openid_math_mul($n, pow(2, 8)); + $n = _openid_math_add($n, $byte); } return $n; } function _openid_dh_long_to_binary($long) { - $cmp = bccomp($long, 0); + $cmp = _openid_math_cmp($long, 0); if ($cmp < 0) { return FALSE; } @@ -467,9 +467,9 @@ function _openid_dh_long_to_binary($long) { $bytes = array(); - while (bccomp($long, 0) > 0) { - array_unshift($bytes, bcmod($long, 256)); - $long = bcdiv($long, pow(2, 8)); + while (_openid_math_cmp($long, 0) > 0) { + array_unshift($bytes, _openid_math_mod($long, 256)); + $long = _openid_math_div($long, pow(2, 8)); } if ($bytes && ($bytes[0] > 127)) { @@ -512,11 +512,11 @@ function _openid_dh_rand($stop) { $nbytes = strlen($rbytes); } - $mxrand = bcpow(256, $nbytes); + $mxrand = _openid_math_pow(256, $nbytes); // If we get a number less than this, then it is in the // duplicated range. - $duplicate = bcmod($mxrand, $stop); + $duplicate = _openid_math_mod($mxrand, $stop); if (count($duplicate_cache) > 10) { $duplicate_cache = array(); @@ -529,9 +529,9 @@ function _openid_dh_rand($stop) { $bytes = "\x00" . _openid_get_bytes($nbytes); $n = _openid_dh_binary_to_long($bytes); // Keep looping if this value is in the low duplicated range. - } while (bccomp($n, $duplicate) < 0); + } while (_openid_math_cmp($n, $duplicate) < 0); - return bcmod($n, $stop); + return _openid_math_mod($n, $stop); } function _openid_get_bytes($num_bytes) { @@ -683,3 +683,113 @@ function openid_extract_ax_values($values, $uris) { return $output; } +/** + * Determine the available math library GMP vs. BCMath, favouring GMP for performance. + */ +function _openid_get_math_library() { + // Not drupal_static(), because a function is not going to disappear and + // change the output of this under any circumstances. + static $library; + + if (empty($library)) { + if (function_exists('gmp_add')) { + $library = 'gmp'; + } + elseif (function_exists('bcadd')) { + $library = 'bcmath'; + } + } + + return $library; +} + +/** + * Calls the add function from the available math library for OpenID. + */ +function _openid_math_add($x, $y) { + $library = _openid_get_math_library(); + switch ($library) { + case 'gmp': + return gmp_strval(gmp_add($x, $y)); + case 'bcmath': + return bcadd($x, $y); + } +} + +/** + * Calls the mul function from the available math library for OpenID. + */ +function _openid_math_mul($x, $y) { + $library = _openid_get_math_library(); + switch ($library) { + case 'gmp': + return gmp_mul($x, $y); + case 'bcmath': + return bcmul($x, $y); + } +} + +/** + * Calls the div function from the available math library for OpenID. + */ +function _openid_math_div($x, $y) { + $library = _openid_get_math_library(); + switch ($library) { + case 'gmp': + return gmp_div($x, $y); + case 'bcmath': + return bcdiv($x, $y); + } +} + +/** + * Calls the cmp function from the available math library for OpenID. + */ +function _openid_math_cmp($x, $y) { + $library = _openid_get_math_library(); + switch ($library) { + case 'gmp': + return gmp_cmp($x, $y); + case 'bcmath': + return bccomp($x, $y); + } +} + +/** + * Calls the mod function from the available math library for OpenID. + */ +function _openid_math_mod($x, $y) { + $library = _openid_get_math_library(); + switch ($library) { + case 'gmp': + return gmp_mod($x, $y); + case 'bcmath': + return bcmod($x, $y); + } +} + +/** + * Calls the pow function from the available math library for OpenID. + */ +function _openid_math_pow($x, $y) { + $library = _openid_get_math_library(); + switch ($library) { + case 'gmp': + return gmp_pow($x, $y); + case 'bcmath': + return bcpow($x, $y); + } +} + +/** + * Calls the mul function from the available math library for OpenID. + */ +function _openid_math_powmod($x, $y, $z) { + $library = _openid_get_math_library(); + switch ($library) { + case 'gmp': + return gmp_powm($x, $y, $z); + case 'bcmath': + return bcpowmod($x, $y, $z); + } +} diff --git a/modules/openid/openid.info b/modules/openid/openid.info index 9d5b134c..69623671 100644 --- a/modules/openid/openid.info +++ b/modules/openid/openid.info @@ -1,4 +1,3 @@ -; $Id: openid.info,v 1.9 2010/12/20 19:59:42 webchick Exp $ name = OpenID description = "Allows users to log into your site using OpenID." version = VERSION @@ -6,8 +5,8 @@ package = Core core = 7.x files[] = openid.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/openid/openid.install b/modules/openid/openid.install index 0e396b01..2df39aa6 100644 --- a/modules/openid/openid.install +++ b/modules/openid/openid.install @@ -1,5 +1,4 @@ <?php -// $Id: openid.install,v 1.13 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -92,20 +91,27 @@ function openid_requirements($phase) { if ($phase == 'runtime') { // Check for the PHP BC Math library. - if (!function_exists('bcadd')) { - $requirements['bcmath'] = array( + if (!function_exists('bcadd') && !function_exists('gmp_add')) { + $requirements['openid_math'] = array( 'value' => t('Not installed'), 'severity' => REQUIREMENT_ERROR, - 'description' => t('OpenID requires the BC Math library for PHP which is missing or outdated. Check the <a href="@url">PHP BC Math Library documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/en/book.bc.php')), + 'description' => t('OpenID suggests the use of either the <a href="@gmp">GMP Math</a> (recommended for performance) or <a href="@bc">BC Math</a> libraries to enable OpenID associations.', array('@gmp' => 'http://php.net/manual/en/book.gmp.php', '@bc' => 'http://www.php.net/manual/en/book.bc.php')), + ); + } + elseif (!function_exists('gmp_add')) { + $requirements['openid_math'] = array( + 'value' => t('Not optimized'), + 'severity' => REQUIREMENT_WARNING, + 'description' => t('OpenID suggests the use of the GMP Math library for PHP for optimal performance. Check the <a href="@url">GMP Math Library documentation</a> for installation instructions.', array('@url' => 'http://www.php.net/manual/en/book.gmp.php')), ); } else { - $requirements['bcmath'] = array( + $requirements['openid_math'] = array( 'value' => t('Installed'), 'severity' => REQUIREMENT_OK, ); } - $requirements['bcmath']['title'] = t('BC Math library'); + $requirements['openid_math']['title'] = t('OpenID Math library'); } return $requirements; diff --git a/modules/openid/openid.js b/modules/openid/openid.js index e60f2b77..1f204274 100644 --- a/modules/openid/openid.js +++ b/modules/openid/openid.js @@ -1,4 +1,3 @@ -// $Id: openid.js,v 1.13 2010/03/22 18:55:45 dries Exp $ (function ($) { Drupal.behaviors.openid = { diff --git a/modules/openid/openid.module b/modules/openid/openid.module index 797ec6ac..7673de88 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -1,5 +1,4 @@ <?php -// $Id: openid.module,v 1.98 2010/11/30 17:16:37 dries Exp $ /** * @file @@ -275,9 +274,9 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) { // user_exteral_login later. $_SESSION['openid']['user_login_values'] = $form_values; - // If bcmath is present, then create an association + // If a supported math library is present, then create an association. $assoc_handle = ''; - if (function_exists('bcadd')) { + if (_openid_get_math_library()) { $assoc_handle = openid_association($service['uri']); } @@ -540,8 +539,8 @@ function openid_association($op_endpoint) { $mod = OPENID_DH_DEFAULT_MOD; $gen = OPENID_DH_DEFAULT_GEN; $r = _openid_dh_rand($mod); - $private = bcadd($r, 1); - $public = bcpowmod($gen, $private, $mod); + $private = _openid_math_add($r, 1); + $public = _openid_math_powmod($gen, $private, $mod); // If there is no existing association, then request one $assoc_request = openid_association_request($public); @@ -564,7 +563,7 @@ function openid_association($op_endpoint) { if ($assoc_response['session_type'] == 'DH-SHA1') { $spub = _openid_dh_base64_to_long($assoc_response['dh_server_public']); $enc_mac_key = base64_decode($assoc_response['enc_mac_key']); - $shared = bcpowmod($spub, $private, $mod); + $shared = _openid_math_powmod($spub, $private, $mod); $assoc_response['mac_key'] = base64_encode(_openid_dh_xorsecret($shared, $enc_mac_key)); } db_insert('openid_association') diff --git a/modules/openid/openid.pages.inc b/modules/openid/openid.pages.inc index 06738a1e..6e3f096e 100644 --- a/modules/openid/openid.pages.inc +++ b/modules/openid/openid.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: openid.pages.inc,v 1.28 2010/04/24 14:49:14 dries Exp $ /** * @file diff --git a/modules/openid/openid.test b/modules/openid/openid.test index b0f88bbb..202a8355 100644 --- a/modules/openid/openid.test +++ b/modules/openid/openid.test @@ -1,5 +1,9 @@ <?php -// $Id: openid.test,v 1.32 2010/10/08 05:28:30 webchick Exp $ + +/** + * @file + * Tests for openid.module. + */ /** * Base class for OpenID tests. diff --git a/modules/openid/tests/openid_test.info b/modules/openid/tests/openid_test.info index 6b33162e..d9760b96 100644 --- a/modules/openid/tests/openid_test.info +++ b/modules/openid/tests/openid_test.info @@ -1,4 +1,3 @@ -; $Id: openid_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $ name = OpenID dummy provider description = "OpenID provider used for testing." package = Testing @@ -7,8 +6,8 @@ core = 7.x dependencies[] = openid hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/openid/tests/openid_test.install b/modules/openid/tests/openid_test.install index e6872742..3bd4978f 100644 --- a/modules/openid/tests/openid_test.install +++ b/modules/openid/tests/openid_test.install @@ -1,5 +1,4 @@ <?php -// $Id: openid_test.install,v 1.4 2009/12/04 16:49:47 dries Exp $ /** * @file diff --git a/modules/openid/tests/openid_test.module b/modules/openid/tests/openid_test.module index ce633bee..bad1184a 100644 --- a/modules/openid/tests/openid_test.module +++ b/modules/openid/tests/openid_test.module @@ -1,5 +1,4 @@ <?php -// $Id: openid_test.module,v 1.17 2010/07/07 08:05:01 webchick Exp $ /** * @file @@ -106,6 +105,10 @@ function openid_test_yadis_xrds() { <Service> <Type>http://example.com/this-is-ignored</Type> </Service> + <Service priority="5"> + <Type>http://openid.net/signon/1.0</Type> + <URI>http://example.com/this-is-only-openid-1.0</URI> + </Service> <Service priority="10"> <Type>http://specs.openid.net/auth/2.0/signon</Type> <Type>http://openid.net/srv/ax/1.0</Type> @@ -134,7 +137,7 @@ function openid_test_yadis_xrds() { } elseif (arg(3) == 'delegate') { print ' - <Service priority="5"> + <Service priority="0"> <Type>http://specs.openid.net/auth/2.0/signon</Type> <Type>http://openid.net/srv/ax/1.0</Type> <URI>' . url('openid-test/endpoint', array('absolute' => TRUE)) . '</URI> @@ -228,14 +231,14 @@ function _openid_test_endpoint_associate() { // Generate private Diffie-Helmann key. $r = _openid_dh_rand($mod); - $private = bcadd($r, 1); + $private = _openid_math_add($r, 1); // Calculate public Diffie-Helmann key. - $public = bcpowmod($gen, $private, $mod); + $public = _openid_math_powmod($gen, $private, $mod); // Calculate shared secret based on Relying Party's public key. $cpub = _openid_dh_base64_to_long($_REQUEST['openid_dh_consumer_public']); - $shared = bcpowmod($cpub, $private, $mod); + $shared = _openid_math_powmod($cpub, $private, $mod); // Encrypt the MAC key using the shared secret. $enc_mac_key = base64_encode(_openid_dh_xorsecret($shared, base64_decode(variable_get('mac_key')))); diff --git a/modules/overlay/overlay-child.css b/modules/overlay/overlay-child.css index 0ee699c6..5a297cb4 100644 --- a/modules/overlay/overlay-child.css +++ b/modules/overlay/overlay-child.css @@ -1,4 +1,3 @@ -/* $Id: overlay-child.css,v 1.8 2011/01/03 06:53:35 webchick Exp $ */ html.js { background: transparent !important; diff --git a/modules/overlay/overlay-child.js b/modules/overlay/overlay-child.js index 468aa29a..e78e3831 100644 --- a/modules/overlay/overlay-child.js +++ b/modules/overlay/overlay-child.js @@ -1,4 +1,3 @@ -// $Id: overlay-child.js,v 1.11 2010/11/06 00:18:24 dries Exp $ (function ($) { diff --git a/modules/overlay/overlay-parent.css b/modules/overlay/overlay-parent.css index fc2902dd..dad6d557 100644 --- a/modules/overlay/overlay-parent.css +++ b/modules/overlay/overlay-parent.css @@ -1,4 +1,3 @@ -/* $Id: overlay-parent.css,v 1.17 2010/11/06 00:18:24 dries Exp $ */ html.overlay-open, html.overlay-open body { diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index 27a937ff..8f11df66 100644 --- a/modules/overlay/overlay-parent.js +++ b/modules/overlay/overlay-parent.js @@ -1,4 +1,3 @@ -// $Id: overlay-parent.js,v 1.57 2010/11/06 00:18:24 dries Exp $ (function ($) { @@ -351,8 +350,9 @@ Drupal.overlay.isAdminLink = function (url) { // Turn the list of administrative paths into a regular expression. if (!this.adminPathRegExp) { - var adminPaths = '^(' + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|^(') + ')$'; - var nonAdminPaths = '^(' + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|^(') + ')$'; + var regExpPrefix = '^' + Drupal.settings.pathPrefix + '('; + var adminPaths = regExpPrefix + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|' + regExpPrefix) + ')$'; + var nonAdminPaths = regExpPrefix + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|'+ regExpPrefix) + ')$'; adminPaths = adminPaths.replace(/\*/g, '.*'); nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*'); this.adminPathRegExp = new RegExp(adminPaths); @@ -453,7 +453,7 @@ Drupal.overlay.eventhandlerAlterDisplacedElements = function (event) { Drupal.overlay.eventhandlerRestoreDisplacedElements = function (event) { var $displacedElements = $('.overlay-displace-top, .overlay-displace-bottom'); try { - $displacedElements.css({ maxWidth: null, clip: null }); + $displacedElements.css({ maxWidth: '', clip: '' }); } // IE bug that doesn't allow unsetting style.clip (http://dev.jquery.com/ticket/6512). catch (err) { @@ -678,7 +678,7 @@ Drupal.overlay.eventhandlerDispatchEvent = function (event) { * Make a regular admin link into a URL that will trigger the overlay to open. * * @param link - * A Javascript Link object (i.e. an <a> element). + * A JavaScript Link object (i.e. an <a> element). * @param parentLocation * (optional) URL to override the parent window's location with. * diff --git a/modules/overlay/overlay.api.php b/modules/overlay/overlay.api.php index c561751d..c763d1f5 100644 --- a/modules/overlay/overlay.api.php +++ b/modules/overlay/overlay.api.php @@ -1,5 +1,4 @@ <?php -// $Id: overlay.api.php,v 1.2 2010/07/17 02:12:36 dries Exp $ /** * @file diff --git a/modules/overlay/overlay.info b/modules/overlay/overlay.info index 8c324fff..c4d05ba2 100644 --- a/modules/overlay/overlay.info +++ b/modules/overlay/overlay.info @@ -1,12 +1,11 @@ -; $Id: overlay.info,v 1.3 2010/12/20 19:59:42 webchick Exp $ name = Overlay description = Displays the Drupal administration interface in an overlay. package = Core version = VERSION core = 7.x -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/overlay/overlay.install b/modules/overlay/overlay.install index 77a24b43..2fa7c84b 100644 --- a/modules/overlay/overlay.install +++ b/modules/overlay/overlay.install @@ -1,5 +1,4 @@ <?php -// $Id: overlay.install,v 1.3 2010/01/18 17:12:04 dries Exp $ /** * @file diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module index 6d62c541..84b75548 100644 --- a/modules/overlay/overlay.module +++ b/modules/overlay/overlay.module @@ -1,5 +1,4 @@ <?php -// $Id: overlay.module,v 1.34 2010/11/30 17:16:37 dries Exp $ /** * @file @@ -626,7 +625,7 @@ function overlay_overlay_parent_initialize() { $type = str_replace('<front>', variable_get('site_frontpage', 'node'), $type); } drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting'); - // Pass along the AJAX callback for rerendering sections of the parent window. + // Pass along the Ajax callback for rerendering sections of the parent window. drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting'); } @@ -643,7 +642,7 @@ function overlay_overlay_child_initialize() { // the initial rendered content of those regions here, so that we can compare // it to the same content rendered in overlay_exit(), at the end of the page // request. This allows us to check if anything actually did change, and, if - // so, trigger an immediate AJAX refresh of the parent window. + // so, trigger an immediate Ajax refresh of the parent window. if (!empty($_POST) || isset($_GET['token'])) { foreach (overlay_supplemental_regions() as $region) { overlay_store_rendered_content($region, overlay_render_region($region)); @@ -945,7 +944,7 @@ function overlay_trigger_refresh() { /** * Prints the markup obtained by rendering a single region of the page. * - * This function is intended to be called via AJAX. + * This function is intended to be called via Ajax. * * @param $region * The name of the page region to render. diff --git a/modules/overlay/overlay.tpl.php b/modules/overlay/overlay.tpl.php index fd48e0a8..54b10af1 100644 --- a/modules/overlay/overlay.tpl.php +++ b/modules/overlay/overlay.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: overlay.tpl.php,v 1.5 2010/11/06 00:18:24 dries Exp $ /** * @file diff --git a/modules/path/path.admin.inc b/modules/path/path.admin.inc index 7e792934..f10142b5 100644 --- a/modules/path/path.admin.inc +++ b/modules/path/path.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: path.admin.inc,v 1.45 2010/09/11 03:04:43 dries Exp $ /** * @file diff --git a/modules/path/path.api.php b/modules/path/path.api.php index d3b00eb4..d1a007ac 100644 --- a/modules/path/path.api.php +++ b/modules/path/path.api.php @@ -1,5 +1,4 @@ <?php -// $Id: path.api.php,v 1.2 2010/12/02 00:22:20 webchick Exp $ /** * @file diff --git a/modules/path/path.info b/modules/path/path.info index 8c013ca9..29903db6 100644 --- a/modules/path/path.info +++ b/modules/path/path.info @@ -1,4 +1,3 @@ -; $Id: path.info,v 1.10 2010/12/20 19:59:42 webchick Exp $ name = Path description = Allows users to rename URLs. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = path.test configure = admin/config/search/path -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/path/path.js b/modules/path/path.js index 681b5d0a..fcc0acc4 100644 --- a/modules/path/path.js +++ b/modules/path/path.js @@ -1,4 +1,3 @@ -// $Id: path.js,v 1.5 2010/11/05 19:47:20 dries Exp $ (function ($) { diff --git a/modules/path/path.module b/modules/path/path.module index d2147753..332287de 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -1,5 +1,4 @@ <?php -// $Id: path.module,v 1.187 2010/12/01 00:31:38 webchick Exp $ /** * @file @@ -58,7 +57,7 @@ function path_menu() { 'description' => "Change your site's URL paths by aliasing them.", 'page callback' => 'path_admin_overview', 'access arguments' => array('administer url aliases'), - 'weight' => -10, + 'weight' => -5, 'file' => 'path.admin.inc', ); $items['admin/config/search/path/edit/%path'] = array( diff --git a/modules/path/path.test b/modules/path/path.test index 9666466b..4112e5f6 100644 --- a/modules/path/path.test +++ b/modules/path/path.test @@ -1,9 +1,8 @@ <?php -// $Id: path.test,v 1.41 2010/10/09 17:38:41 webchick Exp $ /** * @file - * Tests for the path module + * Tests for path.module. */ class PathTestCase extends DrupalWebTestCase { diff --git a/modules/php/php.info b/modules/php/php.info index 1768e192..259e7432 100644 --- a/modules/php/php.info +++ b/modules/php/php.info @@ -1,4 +1,3 @@ -; $Id: php.info,v 1.8 2010/12/20 19:59:42 webchick Exp $ name = PHP filter description = Allows embedded PHP code/snippets to be evaluated. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x files[] = php.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/php/php.install b/modules/php/php.install index b5a4853d..12944ddd 100644 --- a/modules/php/php.install +++ b/modules/php/php.install @@ -1,5 +1,4 @@ <?php -// $Id: php.install,v 1.19 2010/10/20 01:15:58 dries Exp $ /** * @file diff --git a/modules/php/php.module b/modules/php/php.module index bd72a729..37bf9a1f 100644 --- a/modules/php/php.module +++ b/modules/php/php.module @@ -1,5 +1,4 @@ <?php -// $Id: php.module,v 1.29 2010/12/01 00:31:38 webchick Exp $ /** * @file diff --git a/modules/php/php.test b/modules/php/php.test index 24886c3f..8ead2ac0 100644 --- a/modules/php/php.test +++ b/modules/php/php.test @@ -1,5 +1,9 @@ <?php -// $Id: php.test,v 1.27 2010/11/29 06:38:51 webchick Exp $ + +/** + * @file + * Tests for php.module. + */ /** * Base PHP test case class. diff --git a/modules/poll/poll-bar--block.tpl.php b/modules/poll/poll-bar--block.tpl.php index b67fa6e0..3b91afc3 100644 --- a/modules/poll/poll-bar--block.tpl.php +++ b/modules/poll/poll-bar--block.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: poll-bar--block.tpl.php,v 1.1 2010/01/13 06:07:27 webchick Exp $ /** * @file diff --git a/modules/poll/poll-bar.tpl.php b/modules/poll/poll-bar.tpl.php index 0345b952..9426ff59 100644 --- a/modules/poll/poll-bar.tpl.php +++ b/modules/poll/poll-bar.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: poll-bar.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $ /** * @file diff --git a/modules/poll/poll-results--block.tpl.php b/modules/poll/poll-results--block.tpl.php index bf2babd5..f8387f56 100644 --- a/modules/poll/poll-results--block.tpl.php +++ b/modules/poll/poll-results--block.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: poll-results--block.tpl.php,v 1.1 2010/01/13 06:07:27 webchick Exp $ /** * @file * Default theme implementation to display the poll results in a block. diff --git a/modules/poll/poll-results.tpl.php b/modules/poll/poll-results.tpl.php index c894f7f0..5e14dec2 100644 --- a/modules/poll/poll-results.tpl.php +++ b/modules/poll/poll-results.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: poll-results.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $ /** * @file diff --git a/modules/poll/poll-rtl.css b/modules/poll/poll-rtl.css index 3e787550..14d42e69 100644 --- a/modules/poll/poll-rtl.css +++ b/modules/poll/poll-rtl.css @@ -1,4 +1,3 @@ -/* $Id: poll-rtl.css,v 1.2 2007/05/30 18:28:13 goba Exp $ */ .poll .bar .foreground { float: right; diff --git a/modules/poll/poll-vote.tpl.php b/modules/poll/poll-vote.tpl.php index 8aacc13b..068ff7c0 100644 --- a/modules/poll/poll-vote.tpl.php +++ b/modules/poll/poll-vote.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: poll-vote.tpl.php,v 1.4 2009/06/13 19:38:42 dries Exp $ /** * @file diff --git a/modules/poll/poll.css b/modules/poll/poll.css index fd99c215..8b04e380 100644 --- a/modules/poll/poll.css +++ b/modules/poll/poll.css @@ -1,4 +1,3 @@ -/* $Id: poll.css,v 1.8 2010/04/06 15:25:51 dries Exp $ */ .poll { overflow: hidden; diff --git a/modules/poll/poll.info b/modules/poll/poll.info index 6c4be672..16744e8c 100644 --- a/modules/poll/poll.info +++ b/modules/poll/poll.info @@ -1,4 +1,3 @@ -; $Id: poll.info,v 1.12 2010/12/20 19:59:42 webchick Exp $ name = Poll description = Allows your site to capture votes on different topics in the form of multiple choice questions. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = poll.test stylesheets[all][] = poll.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/poll/poll.install b/modules/poll/poll.install index 4d9a814c..8c73cf43 100644 --- a/modules/poll/poll.install +++ b/modules/poll/poll.install @@ -1,5 +1,4 @@ <?php -// $Id: poll.install,v 1.33 2010/08/22 13:55:53 dries Exp $ /** * @file @@ -197,3 +196,11 @@ function poll_update_7003() { 'description' => 'The sort order of this choice among all choices for the same node.', )); } + +/** + * Update the database to match the schema. + */ +function poll_update_7004() { + // Remove field default. + db_change_field('poll_vote', 'chid', 'chid', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE)); +} diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 1a8ebe9d..f45b8bda 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -1,5 +1,4 @@ <?php -// $Id: poll.module,v 1.361 2010/11/20 09:25:30 webchick Exp $ /** * @file @@ -242,7 +241,7 @@ function poll_form($node, &$form_state) { $type = node_type_get_type($node); // The submit handlers to add more poll choices require that this form is - // cached, regardless of whether AJAX is used. + // cached, regardless of whether Ajax is used. $form_state['cache'] = TRUE; $form['title'] = array( @@ -296,7 +295,7 @@ function poll_form($node, &$form_state) { } // We name our button 'poll_more' to avoid conflicts with other modules using - // AJAX-enabled buttons with the id 'more'. + // Ajax-enabled buttons with the id 'more'. $form['choice_wrapper']['poll_more'] = array( '#type' => 'submit', '#value' => t('More choices'), @@ -362,7 +361,7 @@ function poll_form($node, &$form_state) { * return just the changed part of the form. */ function poll_more_choices_submit($form, &$form_state) { - // If this is a AJAX POST, add 1, otherwise add 5 more choices to the form. + // If this is a Ajax POST, add 1, otherwise add 5 more choices to the form. if ($form_state['values']['poll_more']) { $n = $_GET['q'] == 'system/ajax' ? 1 : 5; $form_state['choice_count'] = count($form_state['values']['choice']) + $n; diff --git a/modules/poll/poll.pages.inc b/modules/poll/poll.pages.inc index 3b6dcf6e..15f3ba79 100644 --- a/modules/poll/poll.pages.inc +++ b/modules/poll/poll.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: poll.pages.inc,v 1.28 2010/10/06 13:38:40 dries Exp $ /** * @file diff --git a/modules/poll/poll.test b/modules/poll/poll.test index a08090db..6fabf956 100644 --- a/modules/poll/poll.test +++ b/modules/poll/poll.test @@ -1,9 +1,8 @@ <?php -// $Id: poll.test,v 1.39 2010/10/25 15:51:21 webchick Exp $ /** * @file - * Tests for the poll module. + * Tests for poll.module. */ class PollTestCase extends DrupalWebTestCase { @@ -426,7 +425,7 @@ class PollJSAddChoice extends DrupalWebTestCase { 'choice[new:1][chtext]' => $this->randomName(), ); - // Press 'add choice' button through AJAX, and place the expected HTML result + // Press 'add choice' button through Ajax, and place the expected HTML result // as the tested content. $commands = $this->drupalPostAJAX(NULL, $edit, array('op' => t('More choices'))); $this->content = $commands[1]['data']; @@ -653,7 +652,7 @@ class PollTokenReplaceTestCase extends PollTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('node' => $poll), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized poll token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized poll token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -661,7 +660,7 @@ class PollTokenReplaceTestCase extends PollTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('node' => $poll), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized poll token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized poll token %token replaced.', array('%token' => $input))); } } } diff --git a/modules/poll/poll.tokens.inc b/modules/poll/poll.tokens.inc index 26176e10..eda628ba 100644 --- a/modules/poll/poll.tokens.inc +++ b/modules/poll/poll.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: poll.tokens.inc,v 1.6 2010/12/01 00:31:38 webchick Exp $ /** * @file diff --git a/modules/profile/profile-block.tpl.php b/modules/profile/profile-block.tpl.php index d40356af..0bd83314 100644 --- a/modules/profile/profile-block.tpl.php +++ b/modules/profile/profile-block.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: profile-block.tpl.php,v 1.4 2009/08/06 05:05:59 webchick Exp $ /** * @file diff --git a/modules/profile/profile-listing.tpl.php b/modules/profile/profile-listing.tpl.php index 7bced7da..d484ed26 100644 --- a/modules/profile/profile-listing.tpl.php +++ b/modules/profile/profile-listing.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: profile-listing.tpl.php,v 1.7 2009/08/06 05:05:59 webchick Exp $ /** * @file diff --git a/modules/profile/profile-wrapper.tpl.php b/modules/profile/profile-wrapper.tpl.php index 4b9d3ddf..997ab986 100644 --- a/modules/profile/profile-wrapper.tpl.php +++ b/modules/profile/profile-wrapper.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: profile-wrapper.tpl.php,v 1.3 2008/10/13 12:31:42 dries Exp $ /** * @file diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index b8e029a5..d6ac3c31 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: profile.admin.inc,v 1.44 2010/10/28 02:27:09 dries Exp $ /** * @file diff --git a/modules/profile/profile.css b/modules/profile/profile.css index 4b02e7e4..c3132f99 100644 --- a/modules/profile/profile.css +++ b/modules/profile/profile.css @@ -1,4 +1,3 @@ -/* $Id: profile.css,v 1.3 2007/11/30 09:02:51 goba Exp $ */ #profile-fields td.category { font-weight: bold; diff --git a/modules/profile/profile.info b/modules/profile/profile.info index ec50d073..6f89a05c 100644 --- a/modules/profile/profile.info +++ b/modules/profile/profile.info @@ -1,4 +1,3 @@ -; $Id: profile.info,v 1.12 2010/12/20 19:59:42 webchick Exp $ name = Profile description = Supports configurable user profiles. package = Core @@ -12,8 +11,8 @@ configure = admin/config/people/profile ; See user_system_info_alter(). hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/profile/profile.install b/modules/profile/profile.install index dccbb322..5e4a17c2 100644 --- a/modules/profile/profile.install +++ b/modules/profile/profile.install @@ -1,5 +1,4 @@ <?php -// $Id: profile.install,v 1.26 2010/08/22 13:55:53 dries Exp $ /** * @file diff --git a/modules/profile/profile.js b/modules/profile/profile.js index 7ae05255..f842aa08 100644 --- a/modules/profile/profile.js +++ b/modules/profile/profile.js @@ -1,4 +1,3 @@ -// $Id: profile.js,v 1.8 2010/01/30 07:59:25 dries Exp $ (function ($) { /** diff --git a/modules/profile/profile.module b/modules/profile/profile.module index d4855d2c..2374fe8e 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -1,5 +1,4 @@ <?php -// $Id: profile.module,v 1.294 2010/10/01 15:24:18 webchick Exp $ /** * @file diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc index 993152a1..06f96323 100644 --- a/modules/profile/profile.pages.inc +++ b/modules/profile/profile.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: profile.pages.inc,v 1.28 2010/11/12 02:57:15 dries Exp $ /** * @file diff --git a/modules/profile/profile.test b/modules/profile/profile.test index 95426237..83bed25a 100644 --- a/modules/profile/profile.test +++ b/modules/profile/profile.test @@ -1,5 +1,9 @@ <?php -// $Id: profile.test,v 1.30 2010/08/30 00:22:03 webchick Exp $ + +/** + * @file + * Tests for profile.module. + */ /** * A class for common methods for testing profile fields. diff --git a/modules/rdf/rdf.api.php b/modules/rdf/rdf.api.php index aed1f466..691f7efa 100644 --- a/modules/rdf/rdf.api.php +++ b/modules/rdf/rdf.api.php @@ -1,5 +1,4 @@ <?php -// $Id: rdf.api.php,v 1.6 2010/10/01 01:44:39 webchick Exp $ /** * @file diff --git a/modules/rdf/rdf.info b/modules/rdf/rdf.info index 687129d7..0617577d 100644 --- a/modules/rdf/rdf.info +++ b/modules/rdf/rdf.info @@ -1,4 +1,3 @@ -; $Id: rdf.info,v 1.4 2010/12/20 19:59:42 webchick Exp $ name = RDF description = Enriches your content with metadata to let other applications (e.g. search engines, aggregators) better understand its relationships and attributes. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x files[] = rdf.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/rdf/rdf.install b/modules/rdf/rdf.install index 04a9c86a..10d3f8d9 100644 --- a/modules/rdf/rdf.install +++ b/modules/rdf/rdf.install @@ -1,5 +1,4 @@ <?php -// $Id: rdf.install,v 1.5 2010/10/01 01:44:39 webchick Exp $ /** * @file diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index 26abe629..ebecd423 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -1,5 +1,4 @@ <?php -// $Id: rdf.module,v 1.49 2010/12/11 02:38:24 dries Exp $ /** * @file diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test index 8a4a0f6b..9f786ab5 100644 --- a/modules/rdf/rdf.test +++ b/modules/rdf/rdf.test @@ -1,9 +1,8 @@ <?php -// $Id: rdf.test,v 1.30 2010/12/14 01:04:27 dries Exp $ /** * @file - * Tests for RDF functionality. + * Tests for rdf.module. */ class RdfMappingHookTestCase extends DrupalWebTestCase { diff --git a/modules/rdf/tests/rdf_test.info b/modules/rdf/tests/rdf_test.info index 3d6ef437..1ace4167 100644 --- a/modules/rdf/tests/rdf_test.info +++ b/modules/rdf/tests/rdf_test.info @@ -1,4 +1,3 @@ -; $Id: rdf_test.info,v 1.2 2010/12/20 19:59:42 webchick Exp $ name = "RDF module tests" description = "Support module for RDF module testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/rdf/tests/rdf_test.install b/modules/rdf/tests/rdf_test.install index a60ac50c..91a33927 100644 --- a/modules/rdf/tests/rdf_test.install +++ b/modules/rdf/tests/rdf_test.install @@ -1,5 +1,4 @@ <?php -// $Id: rdf_test.install,v 1.3 2009/12/04 16:49:47 dries Exp $ /** * @file diff --git a/modules/rdf/tests/rdf_test.module b/modules/rdf/tests/rdf_test.module index 8d005c1a..c133a33e 100644 --- a/modules/rdf/tests/rdf_test.module +++ b/modules/rdf/tests/rdf_test.module @@ -1,5 +1,4 @@ <?php -// $Id: rdf_test.module,v 1.4 2010/04/22 21:41:09 webchick Exp $ /** * @file diff --git a/modules/search/search-block-form.tpl.php b/modules/search/search-block-form.tpl.php index 6ad23e94..78447463 100644 --- a/modules/search/search-block-form.tpl.php +++ b/modules/search/search-block-form.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: search-block-form.tpl.php,v 1.6 2011/01/03 00:17:55 webchick Exp $ /** * @file diff --git a/modules/search/search-result.tpl.php b/modules/search/search-result.tpl.php index ea85c06f..30b321fb 100644 --- a/modules/search/search-result.tpl.php +++ b/modules/search/search-result.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: search-result.tpl.php,v 1.9 2010/11/21 20:36:36 dries Exp $ /** * @file diff --git a/modules/search/search-results.tpl.php b/modules/search/search-results.tpl.php index d299952d..4de724be 100644 --- a/modules/search/search-results.tpl.php +++ b/modules/search/search-results.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: search-results.tpl.php,v 1.7 2010/08/18 18:40:50 dries Exp $ /** * @file diff --git a/modules/search/search-rtl.css b/modules/search/search-rtl.css index 24f7bb0b..da9e8d9d 100644 --- a/modules/search/search-rtl.css +++ b/modules/search/search-rtl.css @@ -1,4 +1,3 @@ -/* $Id: search-rtl.css,v 1.5 2010/05/29 07:50:33 dries Exp $ */ .search-advanced .criterion { float: right; diff --git a/modules/search/search.admin.inc b/modules/search/search.admin.inc index d3c668fb..afa02def 100644 --- a/modules/search/search.admin.inc +++ b/modules/search/search.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: search.admin.inc,v 1.19 2010/10/20 01:31:07 dries Exp $ /** * @file @@ -32,18 +31,12 @@ function search_reindex_confirm_submit(&$form, &$form_state) { function _search_get_module_names() { $search_info = search_get_info(TRUE); - $modules = db_select('system', 's') - ->fields('s', array('name', 'info')) - ->condition('s.status', 1) - ->condition('s.type', 'module') - ->condition('s.name', array_keys($search_info), 'IN') - ->orderBy('s.name') - ->execute(); + $system_info = system_get_info('module'); $names = array(); - foreach ($modules as $item) { - $info = unserialize($item->info); - $names[$item->name] = $info['name']; + foreach ($search_info as $module => $info) { + $names[$module] = $system_info[$module]['name']; } + asort($names, SORT_STRING); return $names; } @@ -115,19 +108,20 @@ function search_admin_settings($form) { '#type' => 'fieldset', '#title' => t('Active search modules ') ); + $module_options = _search_get_module_names(); $form['active']['search_active_modules'] = array( '#type' => 'checkboxes', '#title' => t('Active modules'), '#title_display' => 'invisible', '#default_value' => variable_get('search_active_modules', array('node', 'user')), - '#options' => _search_get_module_names(), + '#options' => $module_options, '#description' => t('Choose which search modules are active from the available modules.') ); $form['active']['search_default_module'] = array( '#title' => t('Default search module'), '#type' => 'radios', '#default_value' => variable_get('search_default_module', 'node'), - '#options' => _search_get_module_names(), + '#options' => $module_options, '#description' => t('Choose which search module is the default.') ); $form['#validate'][] = 'search_admin_settings_validate'; diff --git a/modules/search/search.api.php b/modules/search/search.api.php index 86775647..557a56e5 100644 --- a/modules/search/search.api.php +++ b/modules/search/search.api.php @@ -1,5 +1,4 @@ <?php -// $Id: search.api.php,v 1.33 2010/11/21 20:36:36 dries Exp $ /** * @file diff --git a/modules/search/search.css b/modules/search/search.css index 223c31a8..ff7230fb 100644 --- a/modules/search/search.css +++ b/modules/search/search.css @@ -1,4 +1,3 @@ -/* $Id: search.css,v 1.5 2010/05/29 07:50:33 dries Exp $ */ .search-form { margin-bottom: 1em; diff --git a/modules/search/search.extender.inc b/modules/search/search.extender.inc index 7a684a39..b7af4d06 100644 --- a/modules/search/search.extender.inc +++ b/modules/search/search.extender.inc @@ -1,5 +1,4 @@ <?php -// $Id: search.extender.inc,v 1.10 2010/11/22 07:32:12 webchick Exp $ /** * @file diff --git a/modules/search/search.info b/modules/search/search.info index 32b6d2dd..81947389 100644 --- a/modules/search/search.info +++ b/modules/search/search.info @@ -1,4 +1,3 @@ -; $Id: search.info,v 1.13 2010/12/20 19:59:43 webchick Exp $ name = Search description = Enables site-wide keyword searching. package = Core @@ -9,8 +8,8 @@ files[] = search.test configure = admin/config/search/settings stylesheets[all][] = search.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/search/search.install b/modules/search/search.install index 62cc7d39..f0113b3f 100644 --- a/modules/search/search.install +++ b/modules/search/search.install @@ -1,5 +1,4 @@ <?php -// $Id: search.install,v 1.29 2010/08/22 13:55:53 dries Exp $ /** * @file diff --git a/modules/search/search.module b/modules/search/search.module index 7cc149e8..518272a0 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -1,5 +1,4 @@ <?php -// $Id: search.module,v 1.371 2011/01/04 05:31:09 webchick Exp $ /** * @file @@ -1005,7 +1004,6 @@ function search_form($form, &$form_state, $action = '', $keys = '', $module = NU * * @ingroup forms * @see search_box_form_submit() - * @see search-theme-form.tpl.php * @see search-block-form.tpl.php */ function search_box($form, &$form_state, $form_id) { diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc index 4cdec26a..833ea8bc 100644 --- a/modules/search/search.pages.inc +++ b/modules/search/search.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: search.pages.inc,v 1.25 2010/11/21 20:36:36 dries Exp $ /** * @file diff --git a/modules/search/search.test b/modules/search/search.test index c21d5071..4d371331 100644 --- a/modules/search/search.test +++ b/modules/search/search.test @@ -1,5 +1,9 @@ <?php -// $Id: search.test,v 1.86 2011/01/04 05:31:09 webchick Exp $ + +/** + * @file + * Tests for search.module. + */ // The search index can contain different types of content. Typically the type is 'node'. // Here we test with _test_ and _test2_ as the type. diff --git a/modules/search/tests/search_embedded_form.info b/modules/search/tests/search_embedded_form.info index 1fd889da..be2af5b7 100644 --- a/modules/search/tests/search_embedded_form.info +++ b/modules/search/tests/search_embedded_form.info @@ -1,4 +1,3 @@ -; $Id: search_embedded_form.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Search embedded form" description = "Support module for search module testing of embedded forms." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/search/tests/search_embedded_form.module b/modules/search/tests/search_embedded_form.module index 2251a9b3..c0058f74 100644 --- a/modules/search/tests/search_embedded_form.module +++ b/modules/search/tests/search_embedded_form.module @@ -1,5 +1,4 @@ <?php -// $Id: search_embedded_form.module,v 1.1 2010/08/11 14:21:39 dries Exp $ /** * @file diff --git a/modules/search/tests/search_extra_type.info b/modules/search/tests/search_extra_type.info index 64120eb0..6ca086e0 100644 --- a/modules/search/tests/search_extra_type.info +++ b/modules/search/tests/search_extra_type.info @@ -1,4 +1,3 @@ -; $Id: search_extra_type.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Test search type" description = "Support module for search module testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/search/tests/search_extra_type.module b/modules/search/tests/search_extra_type.module index 8892a84b..80c050c2 100644 --- a/modules/search/tests/search_extra_type.module +++ b/modules/search/tests/search_extra_type.module @@ -1,5 +1,4 @@ <?php -// $Id: search_extra_type.module,v 1.3 2010/08/18 18:40:50 dries Exp $ /** * @file diff --git a/modules/shortcut/shortcut-rtl.css b/modules/shortcut/shortcut-rtl.css new file mode 100644 index 00000000..4a379279 --- /dev/null +++ b/modules/shortcut/shortcut-rtl.css @@ -0,0 +1,47 @@ + +div#toolbar a#edit-shortcuts { + position: absolute; + left: 0; + top: 0; + padding: 5px 5px 5px 10px; +} +div#toolbar div.toolbar-shortcuts ul { + float: none; + margin-right: 5px; + margin-left: 10em; +} +div#toolbar div.toolbar-shortcuts ul li a { + margin-left: 5px; + margin-right: 0; + padding: 0 5px; +} +div#toolbar div.toolbar-shortcuts span.icon { + float: right; +} +div.add-or-remove-shortcuts a span.icon { + float: right; + margin-right: 8px; + margin-left: 0; +} +div.add-or-remove-shortcuts a span.text { + float: right; + padding-right: 10px; + padding-left: 0; +} +div.add-or-remove-shortcuts a:hover span.text { + -moz-border-radius: 5px 0 0 5px; + -webkit-border-top-left-radius: 5px; + -webkit-border-bottom-left-radius: 5px; + border-radius: 5px 0 0 5px; + padding-left: 6px; +} +#shortcut-set-switch .form-item-new { + padding-right: 17px; + padding-left: 0; +} +div.add-shortcut a:hover span.icon { + background-position: 0 -24px; +} +div.remove-shortcut a:hover span.icon { + background-position: -12px -24px; +} diff --git a/modules/shortcut/shortcut.admin.css b/modules/shortcut/shortcut.admin.css index bb7ba896..8ca03be8 100644 --- a/modules/shortcut/shortcut.admin.css +++ b/modules/shortcut/shortcut.admin.css @@ -1,4 +1,3 @@ -/* $Id: shortcut.admin.css,v 1.2 2010/02/25 15:58:54 dries Exp $ */ .shortcut-slot-hidden { display: none; diff --git a/modules/shortcut/shortcut.admin.inc b/modules/shortcut/shortcut.admin.inc index 4c68a333..9735d376 100644 --- a/modules/shortcut/shortcut.admin.inc +++ b/modules/shortcut/shortcut.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: shortcut.admin.inc,v 1.16 2010/10/20 01:31:07 dries Exp $ /** * @file diff --git a/modules/shortcut/shortcut.admin.js b/modules/shortcut/shortcut.admin.js index 3a384ad5..5e71e6fb 100644 --- a/modules/shortcut/shortcut.admin.js +++ b/modules/shortcut/shortcut.admin.js @@ -1,4 +1,3 @@ -// $Id: shortcut.admin.js,v 1.1 2009/10/17 00:51:52 dries Exp $ (function ($) { /** diff --git a/modules/shortcut/shortcut.api.php b/modules/shortcut/shortcut.api.php index 792a10cf..717a7c92 100644 --- a/modules/shortcut/shortcut.api.php +++ b/modules/shortcut/shortcut.api.php @@ -1,5 +1,4 @@ <?php -// $Id: shortcut.api.php,v 1.1 2009/10/17 00:51:52 dries Exp $ /** * @file diff --git a/modules/shortcut/shortcut.css b/modules/shortcut/shortcut.css index d844056e..3afcb943 100644 --- a/modules/shortcut/shortcut.css +++ b/modules/shortcut/shortcut.css @@ -1,4 +1,3 @@ -/* $Id: shortcut.css,v 1.10 2011/01/03 07:04:48 webchick Exp $ */ div#toolbar a#edit-shortcuts { float: right; padding: 5px 10px 5px 5px; @@ -16,13 +15,13 @@ div#toolbar div.toolbar-shortcuts ul { padding: 5px 0 2px 0; height: 28px; line-height: 24px; - float: left; - margin-left:5px; + float: left; /* LTR */ + margin-left:5px; /* LTR */ } div#toolbar div.toolbar-shortcuts ul li a { padding: 0 5px 0 5px; - margin-right: 5px; + margin-right: 5px; /* LTR */ -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; @@ -40,11 +39,11 @@ div#toolbar div.toolbar-shortcuts ul li a.active { } div#toolbar div.toolbar-shortcuts span.icon { - float: left; + float: left; /* LTR */ background: #444; width: 30px; height: 30px; - margin-right: 5px; + margin-right: 5px; /* LTR */ -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; @@ -88,14 +87,12 @@ div.add-or-remove-shortcuts a:hover span.text { color: #fff; background-color: #5f605b; display: block; - padding-right: 6px; + padding-right: 6px; /* LTR */ cursor: pointer; - -moz-border-radius-bottomright: 5px; - -moz-border-radius-topright: 5px; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-top-right-radius: 5px; - border-bottom-right-radius: 5px; - border-top-right-radius: 5px; + -moz-border-radius: 0 5px 5px 0; /* LTR */ + -webkit-border-top-right-radius: 5px; /* LTR */ + -webkit-border-bottom-right-radius: 5px; /* LTR */ + border-radius: 0 5px 5px 0; /* LTR */ } #shortcut-set-switch .form-type-radios { @@ -105,5 +102,5 @@ div.add-or-remove-shortcuts a:hover span.text { #shortcut-set-switch .form-item-new { padding-top: 0; - padding-left: 17px; + padding-left: 17px; /* LTR */ } diff --git a/modules/shortcut/shortcut.info b/modules/shortcut/shortcut.info index 095290da..2748c62f 100644 --- a/modules/shortcut/shortcut.info +++ b/modules/shortcut/shortcut.info @@ -1,4 +1,3 @@ -; $Id: shortcut.info,v 1.5 2010/12/20 19:59:43 webchick Exp $ name = Shortcut description = Allows users to manage customizable lists of shortcut links. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = shortcut.test configure = admin/config/user-interface/shortcut -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/shortcut/shortcut.install b/modules/shortcut/shortcut.install index 127500ce..209a9075 100644 --- a/modules/shortcut/shortcut.install +++ b/modules/shortcut/shortcut.install @@ -1,5 +1,4 @@ <?php -// $Id: shortcut.install,v 1.6 2010/08/22 13:55:53 dries Exp $ /** * @file diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module index 8b35fb36..d2ac72b3 100644 --- a/modules/shortcut/shortcut.module +++ b/modules/shortcut/shortcut.module @@ -1,5 +1,4 @@ <?php -// $Id: shortcut.module,v 1.27 2010/09/24 00:37:44 dries Exp $ /** * @file diff --git a/modules/shortcut/shortcut.png b/modules/shortcut/shortcut.png index 1d9567398e8a9825153bb464db6440b8a7bb1244..2924557bfaab7bee329231c8bd3d821a32b9e031 100644 GIT binary patch delta 520 zcmV+j0{8u}1Fi&+7aAl80{{R3q!9`n00004XF*Lt006O$eEU(8ks%#_`T6<(|NsC0 z|NsC0|NsC0|No_>quJWn;o;!d*w**>_uJdr+1c2orJ{a*eusyLPEJm2Y-}4F8%Rh< zy}i9fMMV-45_oucw6wIz$;qXqr5G3(qobg3acsA@w=FF#v9YoH`}^bL;$viA6%`dr zOG^U-17BcU|Ns90000Mne88>%000eiQchC<2GVSA8^HO)&&K)lHf5uQ0003kNkl<Z zD9>GzS&oA+5JcP95JDy!+4qGIcF6rtH+E+%m#03^gO*y=PY{ui(PR=yLF98dew;7O zu^5Lwi(voZYyyEyvd}OL`jJa!PA(~a+d&&MbK00jo&Id{X(q^jIQT)P#H~saw<;lZ zvxAdj=A4wSdu8mlrmkasRFJpN!|oo0KI;=zGz_s4|JnE{%SBfAz0cOq{MCEx{8TkE zy2`*+hOTDdYKBTmWE?D!(NzkrQgpQjS8H%(>N<9QDsv$4pP$wAtHg2N*V&>h`Cme& z{xvU-&E@>i{}M7|)z#)(WFH7*%5qz`kj$Jy(yX<Ecg)Or$5b{}LpMUECA=V0>Q*JG zTb0oIWCu6J%(*FDciS;vO<l+OsOr8uJli}7JvJJqt6_+g@c9=w)ot0@v|Et?0000< KMNUMnLSTX+Lj#Tg delta 375 zcmV--0f_#t1h4~;7YY~%0{{R3*Qw3Qkue>SNELryU|VBkU;F#}<KyC^qo8ncY!ww1 z0|Nuw+u8sC0NL8ux3{-NMMV-461}~>czAfRv9W%Bex;?NrKP1yOH0|=*hol7;o;!d z*w(bPwD<V;Y;0_Yhldy#7%eR=8yg!=PEN_m$)%;EDQUR10000DbW%=J00z=*ZyUh* z!})*4&+}?Im5l%Z0KZ8@K~#8NUC>94!!Qs;(PmJvY$`|RoYVbJXR<MZO4AGC0R?dJ ziAX3v2z({zpS|gBz9^6DsW-New}x*c1)9{_!WjE>%GrWV;j<t1p|b^>CRJnjnleD+ zFhf%`d=)ucut{I~VX2)h*d*kNS>2^T6M0{<+dp3KkMz)-LHovpTKqHjNz-$l#4&p4 zb1Gsqw8|1Rw#uPZj;&f~)nbwqjl&g<t!ijhW2-H++Cr-=K@WYhB1ZRp4quxA{R7@q VD6gR>Wpn@l002ovPDHLkV1n73u(|*M diff --git a/modules/shortcut/shortcut.test b/modules/shortcut/shortcut.test index 458dfd69..e37e1e5f 100644 --- a/modules/shortcut/shortcut.test +++ b/modules/shortcut/shortcut.test @@ -1,9 +1,8 @@ <?php -// $Id: shortcut.test,v 1.7 2010/11/27 20:25:44 dries Exp $ /** * @file - * Tests for the shortcut module. + * Tests for shortcut.module. */ /** diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index c58aa34d..b60c6829 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1,5 +1,4 @@ <?php -// $Id: drupal_web_test_case.php,v 1.257 2011/01/02 23:54:05 webchick Exp $ /** * Global variable that holds information about the tests being run. @@ -1152,7 +1151,7 @@ class DrupalWebTestCase extends DrupalTestCase { * If a user is already logged in, then the current user is logged out before * logging in the specified user. * - * Please note that neither the global $user nor the passed in user object is + * Please note that neither the global $user nor the passed-in user object is * populated with data of the logged in user. If you need full access to the * user object after logging in, it must be updated manually. If you also need * access to the plain-text password of the user (set by drupalCreateUser()), @@ -1769,17 +1768,17 @@ class DrupalWebTestCase extends DrupalTestCase { * button with the value t('Delete'), and execute different code depending * on which one is clicked. * - * This function can also be called to emulate an AJAX submission. In this + * This function can also be called to emulate an Ajax submission. In this * case, this value needs to be an array with the following keys: - * - path: A path to submit the form values to for AJAX-specific processing, + * - path: A path to submit the form values to for Ajax-specific processing, * which is likely different than the $path parameter used for retrieving * the initial form. Defaults to 'system/ajax'. * - triggering_element: If the value for the 'path' key is 'system/ajax' or - * another generic AJAX processing path, this needs to be set to the name + * another generic Ajax processing path, this needs to be set to the name * of the element. If the name doesn't identify the element uniquely, then * this should instead be an array with a single key/value pair, * corresponding to the element name and value. The callback for the - * generic AJAX processing path uses this to find the #ajax information + * generic Ajax processing path uses this to find the #ajax information * for the element, including which specific callback to use for * processing the request. * @@ -1829,7 +1828,7 @@ class DrupalWebTestCase extends DrupalTestCase { $action = isset($form['action']) ? $this->getAbsoluteUrl((string) $form['action']) : $this->getUrl(); if ($ajax) { $action = $this->getAbsoluteUrl(!empty($submit['path']) ? $submit['path'] : 'system/ajax'); - // AJAX callbacks verify the triggering element if necessary, so while + // Ajax callbacks verify the triggering element if necessary, so while // we may eventually want extra code that verifies it in the // handleForm() function, it's not currently a requirement. $submit_matches = TRUE; @@ -1886,12 +1885,45 @@ class DrupalWebTestCase extends DrupalTestCase { } /** - * Execute an AJAX submission. + * Execute an Ajax submission. * * This executes a POST as ajax.js does. It uses the returned JSON data, an * array of commands, to update $this->content using equivalent DOM * manipulation as is used by ajax.js. It also returns the array of commands. * + * @param $path + * Location of the form containing the Ajax enabled element to test. Can be + * either a Drupal path or an absolute path or NULL to use the current page. + * @param $edit + * Field data in an associative array. Changes the current input fields + * (where possible) to the values indicated. + * @param $triggering_element + * The name of the form element that is responsible for triggering the Ajax + * functionality to test. May be a string or, if the triggering element is + * a button, an associative array where the key is the name of the button + * and the value is the button label. i.e.) array('op' => t('Refresh')). + * @param $ajax_path + * (optional) Override the path set by the Ajax settings of the triggering + * element. In the absence of both the triggering element's Ajax path and + * $ajax_path 'system/ajax' will be used. + * @param $options + * (optional) Options to be forwarded to url(). + * @param $headers + * (optional) An array containing additional HTTP request headers, each + * formatted as "name: value". Forwarded to drupalPost(). + * @param $form_html_id + * (optional) HTML ID of the form to be submitted, use when there is more + * than one identical form on the same page and the value of the triggering + * element is not enough to identify the form. Note this is not the Drupal + * ID of the form but rather the HTML ID of the form. + * @param $ajax_settings + * (optional) An array of Ajax settings which if specified will be used in + * place of the Ajax settings of the triggering element. + * + * @return + * An array of Ajax commands. + * + * @see drupalPost() * @see ajax.js */ protected function drupalPostAJAX($path, $edit, $triggering_element, $ajax_path = NULL, array $options = array(), array $headers = array(), $form_html_id = NULL, $ajax_settings = NULL) { @@ -1903,7 +1935,7 @@ class DrupalWebTestCase extends DrupalTestCase { $content = $this->content; $drupal_settings = $this->drupalSettings; - // Get the AJAX settings bound to the triggering element. + // Get the Ajax settings bound to the triggering element. if (!isset($ajax_settings)) { if (is_array($triggering_element)) { $xpath = '//*[@name="' . key($triggering_element) . '" and @value="' . current($triggering_element) . '"]'; @@ -1932,7 +1964,7 @@ class DrupalWebTestCase extends DrupalTestCase { } // Unless a particular path is specified, use the one specified by the - // AJAX settings, or else 'system/ajax'. + // Ajax settings, or else 'system/ajax'. if (!isset($ajax_path)) { $ajax_path = isset($ajax_settings['url']) ? $ajax_settings['url'] : 'system/ajax'; } diff --git a/modules/simpletest/files/README.txt b/modules/simpletest/files/README.txt index ddfce559..c8f39ad3 100644 --- a/modules/simpletest/files/README.txt +++ b/modules/simpletest/files/README.txt @@ -1,4 +1,3 @@ -$Id: README.txt,v 1.2 2010/04/28 20:25:21 dries Exp $ These files are use in some tests that upload files or other operations were a file is useful. These files are copied to the files directory as specified diff --git a/modules/simpletest/files/css_test_files/css_input_without_import.css b/modules/simpletest/files/css_test_files/css_input_without_import.css index 5d455d1c..620360ab 100644 --- a/modules/simpletest/files/css_test_files/css_input_without_import.css +++ b/modules/simpletest/files/css_test_files/css_input_without_import.css @@ -1,4 +1,3 @@ -/* $Id: css_input_without_import.css,v 1.3 2010/10/08 15:36:12 dries Exp $ */ /** * @file Basic css that does not use import diff --git a/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css b/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css index 3366edd4..620360ab 100644 --- a/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css +++ b/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css @@ -1,4 +1,3 @@ -/* $Id: css_input_without_import.css.unoptimized.css,v 1.3 2010/10/08 15:36:12 dries Exp $ */ /** * @file Basic css that does not use import diff --git a/modules/simpletest/simpletest.api.php b/modules/simpletest/simpletest.api.php index 70ee9469..04c080bf 100644 --- a/modules/simpletest/simpletest.api.php +++ b/modules/simpletest/simpletest.api.php @@ -1,5 +1,4 @@ <?php -// $Id: simpletest.api.php,v 1.4 2009/12/20 21:12:54 dries Exp $ /** * @file diff --git a/modules/simpletest/simpletest.css b/modules/simpletest/simpletest.css index 588fff6c..0cf9aaa5 100644 --- a/modules/simpletest/simpletest.css +++ b/modules/simpletest/simpletest.css @@ -1,4 +1,3 @@ -/* $Id: simpletest.css,v 1.10 2010/10/09 18:09:48 webchick Exp $ */ /* Test Table */ #simpletest-form-table th.select-all { diff --git a/modules/simpletest/simpletest.info b/modules/simpletest/simpletest.info index adc405c3..33088eaa 100644 --- a/modules/simpletest/simpletest.info +++ b/modules/simpletest/simpletest.info @@ -1,4 +1,3 @@ -; $Id: simpletest.info,v 1.28 2010/12/20 19:59:43 webchick Exp $ name = Testing description = Provides a framework for unit and functional testing. package = Core @@ -33,6 +32,7 @@ files[] = tests/path.test files[] = tests/registry.test files[] = tests/schema.test files[] = tests/session.test +files[] = tests/tablesort.test files[] = tests/theme.test files[] = tests/unicode.test files[] = tests/update.test @@ -40,13 +40,14 @@ files[] = tests/xmlrpc.test files[] = tests/upgrade/upgrade.test files[] = tests/upgrade/upgrade.comment.test files[] = tests/upgrade/upgrade.filter.test +files[] = tests/upgrade/upgrade.forum.test files[] = tests/upgrade/upgrade.node.test files[] = tests/upgrade/upgrade.taxonomy.test files[] = tests/upgrade/upgrade.upload.test files[] = tests/upgrade/upgrade.locale.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/simpletest.install b/modules/simpletest/simpletest.install index e45ae9ca..0f017e75 100644 --- a/modules/simpletest/simpletest.install +++ b/modules/simpletest/simpletest.install @@ -1,5 +1,4 @@ <?php -// $Id: simpletest.install,v 1.41 2011/01/03 06:40:49 webchick Exp $ /** * @file @@ -46,7 +45,7 @@ function simpletest_requirements($phase) { ); if (!$has_domdocument) { $requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR; - $requirements['php_domdocument']['description'] =t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php'))); + $requirements['php_domdocument']['description'] = $t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php'))); } // SimpleTest currently needs 2 cURL options which are incompatible with @@ -58,7 +57,7 @@ function simpletest_requirements($phase) { ); if ($open_basedir) { $requirements['php_open_basedir']['severity'] = REQUIREMENT_ERROR; - $requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir')); + $requirements['php_open_basedir']['description'] = $t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir')); } // Check the current memory limit. If it is set too low, SimpleTest will fail @@ -66,7 +65,7 @@ function simpletest_requirements($phase) { $memory_limit = ini_get('memory_limit'); if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size(SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT)) { $requirements['php_memory_limit']['severity'] = REQUIREMENT_ERROR; - $requirements['php_memory_limit']['description'] = t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. <a href="@url">Follow these steps to continue</a>.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036')); + $requirements['php_memory_limit']['description'] = $t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. <a href="@url">Follow these steps to continue</a>.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036')); } return $requirements; diff --git a/modules/simpletest/simpletest.js b/modules/simpletest/simpletest.js index f3bc109f..c33ef982 100644 --- a/modules/simpletest/simpletest.js +++ b/modules/simpletest/simpletest.js @@ -1,4 +1,3 @@ -// $Id: simpletest.js,v 1.11 2009/04/27 20:19:37 webchick Exp $ (function ($) { /** diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index ea64aeb0..b992fd2a 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -1,5 +1,4 @@ <?php -// $Id: simpletest.module,v 1.97 2010/11/12 03:06:52 dries Exp $ /** * @file diff --git a/modules/simpletest/simpletest.pages.inc b/modules/simpletest/simpletest.pages.inc index 4f533511..31d0b2ce 100644 --- a/modules/simpletest/simpletest.pages.inc +++ b/modules/simpletest/simpletest.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: simpletest.pages.inc,v 1.33 2010/10/20 01:31:07 dries Exp $ /** * @file @@ -83,8 +82,8 @@ function theme_simpletest_test_table($variables) { // Define the images used to expand/collapse the test groups. $js = array( 'images' => array( - theme('image', array('path' => 'misc/menu-collapsed.png', 'alt' => t('Expand'), 'title' => t('Expand'))) . ' <a href="#" class="simpletest-collapse">(' . t('Expand') . ')</a>', - theme('image', array('path' => 'misc/menu-expanded.png', 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' <a href="#" class="simpletest-collapse">(' . t('Collapse') . ')</a>', + theme('image', array('path' => 'misc/menu-collapsed.png', 'width' => 7, 'height' => 7, 'alt' => t('Expand'), 'title' => t('Expand'))) . ' <a href="#" class="simpletest-collapse">(' . t('Expand') . ')</a>', + theme('image', array('path' => 'misc/menu-expanded.png', 'width' => 7, 'height' => 7, 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' <a href="#" class="simpletest-collapse">(' . t('Collapse') . ')</a>', ), ); @@ -427,10 +426,10 @@ function simpletest_result_status_image($status) { if (!isset($map)) { $map = array( - 'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('Pass'))), - 'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('Fail'))), - 'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Exception'))), - 'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Debug'))), + 'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('Pass'))), + 'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('Fail'))), + 'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Exception'))), + 'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Debug'))), ); } if (isset($map[$status])) { diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test index 228199a1..f5163642 100644 --- a/modules/simpletest/simpletest.test +++ b/modules/simpletest/simpletest.test @@ -1,5 +1,9 @@ <?php -// $Id: simpletest.test,v 1.48 2010/11/12 03:06:52 dries Exp $ + +/** + * @file + * Tests for simpletest.module. + */ class SimpleTestFunctionalTest extends DrupalWebTestCase { /** diff --git a/modules/simpletest/tests/actions.test b/modules/simpletest/tests/actions.test index 940b9941..23587f0c 100644 --- a/modules/simpletest/tests/actions.test +++ b/modules/simpletest/tests/actions.test @@ -1,5 +1,4 @@ <?php -// $Id: actions.test,v 1.18 2010/08/05 23:53:38 webchick Exp $ class ActionsConfigurationTestCase extends DrupalWebTestCase { public static function getInfo() { diff --git a/modules/simpletest/tests/actions_loop_test.info b/modules/simpletest/tests/actions_loop_test.info index e5642821..3eccda36 100644 --- a/modules/simpletest/tests/actions_loop_test.info +++ b/modules/simpletest/tests/actions_loop_test.info @@ -1,4 +1,3 @@ -; $Id: actions_loop_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = Actions loop test description = Support module for action loop testing. package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/actions_loop_test.install b/modules/simpletest/tests/actions_loop_test.install index c6776da0..b22fd85a 100644 --- a/modules/simpletest/tests/actions_loop_test.install +++ b/modules/simpletest/tests/actions_loop_test.install @@ -1,5 +1,4 @@ <?php -// $Id: actions_loop_test.install,v 1.2 2009/12/04 16:49:47 dries Exp $ /** * Implements hook_install(). diff --git a/modules/simpletest/tests/actions_loop_test.module b/modules/simpletest/tests/actions_loop_test.module index 60497518..77764907 100644 --- a/modules/simpletest/tests/actions_loop_test.module +++ b/modules/simpletest/tests/actions_loop_test.module @@ -1,5 +1,4 @@ <?php -// $Id: actions_loop_test.module,v 1.3 2009/12/04 16:49:47 dries Exp $ /** * Implements hook_trigger_info(). diff --git a/modules/simpletest/tests/ajax.test b/modules/simpletest/tests/ajax.test index b9fade22..95797924 100644 --- a/modules/simpletest/tests/ajax.test +++ b/modules/simpletest/tests/ajax.test @@ -1,5 +1,4 @@ <?php -// $Id: ajax.test,v 1.21 2010/11/29 03:00:50 webchick Exp $ class AJAXTestCase extends DrupalWebTestCase { function setUp() { @@ -11,9 +10,9 @@ class AJAXTestCase extends DrupalWebTestCase { } /** - * Assert that a command with the required properties exists within the array of AJAX commands returned by the server. + * Assert that a command with the required properties exists within the array of Ajax commands returned by the server. * - * The AJAX framework, via the ajax_deliver() and ajax_render() functions, + * The Ajax framework, via the ajax_deliver() and ajax_render() functions, * returns an array of commands. This array sometimes includes commands * automatically provided by the framework in addition to commands returned by * a particular page callback. During testing, we're usually interested that a @@ -28,7 +27,7 @@ class AJAXTestCase extends DrupalWebTestCase { * additional settings that aren't part of $needle. * * @param $haystack - * An array of AJAX commands returned by the server. + * An array of Ajax commands returned by the server. * @param $needle * Array of info we're expecting in one of those commands. * @param $message @@ -56,7 +55,7 @@ class AJAXTestCase extends DrupalWebTestCase { } /** - * Tests primary AJAX framework functions. + * Tests primary Ajax framework functions. */ class AJAXFrameworkTestCase extends AJAXTestCase { protected $profile = 'testing'; @@ -87,7 +86,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { ); $this->assertCommand($commands, $expected, t('ajax_render() loads settings added with drupal_add_js().')); - // Verify that AJAX settings are loaded for #type 'link'. + // Verify that Ajax settings are loaded for #type 'link'. $this->drupalGet('ajax-test/link'); $settings = $this->drupalGetSettings(); $this->assertEqual($settings['ajax']['ajax-link']['url'], url('filter/tips')); @@ -120,7 +119,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { } /** - * Tests AJAX framework commands. + * Tests Ajax framework commands. */ class AJAXCommandsTestCase extends AJAXTestCase { public static function getInfo() { @@ -132,7 +131,7 @@ class AJAXCommandsTestCase extends AJAXTestCase { } /** - * Test the various AJAX Commands. + * Test the various Ajax Commands. */ function testAJAXCommands() { $form_path = 'ajax_forms_test_ajax_commands_form'; @@ -324,7 +323,7 @@ class AJAXFormValuesTestCase extends AJAXTestCase { } /** - * Tests that AJAX-enabled forms work when multiple instances of the same form are on a page. + * Tests that Ajax-enabled forms work when multiple instances of the same form are on a page. */ class AJAXMultiFormTestCase extends AJAXTestCase { public static function getInfo() { @@ -338,7 +337,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase { function setUp() { parent::setUp(array('form_test')); - // Create a multi-valued field for 'page' nodes to use for AJAX testing. + // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; $field = array( 'field_name' => $field_name, @@ -363,7 +362,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase { */ function testMultiForm() { // HTML IDs for elements within the field are potentially modified with - // each AJAX submission, but these variables are stable and help target the + // each Ajax submission, but these variables are stable and help target the // desired elements. $field_name = 'field_ajax_test'; $field_xpaths = array( @@ -399,7 +398,7 @@ class AJAXMultiFormTestCase extends AJAXTestCase { } /** - * Miscellaneous AJAX tests using ajax_test module. + * Miscellaneous Ajax tests using ajax_test module. */ class AJAXElementValidation extends AJAXTestCase { public static function getInfo() { @@ -411,12 +410,12 @@ class AJAXElementValidation extends AJAXTestCase { } /** - * Try to post an AJAX change to a form that has a validated element. + * Try to post an Ajax change to a form that has a validated element. * - * The drivertext field is AJAX-enabled. An additional field is not, but + * The drivertext field is Ajax-enabled. An additional field is not, but * is set to be a required field. In this test the required field is not * filled in, and we want to see if the activation of the "drivertext" - * AJAX-enabled field fails due to the required field being empty. + * Ajax-enabled field fails due to the required field being empty. */ function testAJAXElementValidation() { $web_user = $this->drupalCreateUser(); diff --git a/modules/simpletest/tests/ajax_forms_test.info b/modules/simpletest/tests/ajax_forms_test.info index db131700..580f2723 100644 --- a/modules/simpletest/tests/ajax_forms_test.info +++ b/modules/simpletest/tests/ajax_forms_test.info @@ -1,4 +1,3 @@ -; $Id: ajax_forms_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "AJAX form test mock module" description = "Test for AJAX form calls." core = 7.x @@ -6,8 +5,8 @@ package = Testing version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module index 32146f93..d38cbbb9 100644 --- a/modules/simpletest/tests/ajax_forms_test.module +++ b/modules/simpletest/tests/ajax_forms_test.module @@ -1,9 +1,8 @@ <?php -// $Id: ajax_forms_test.module,v 1.9 2010/11/29 03:00:50 webchick Exp $ /** * @file - * Simpletest mock module for AJAX forms testing. + * Simpletest mock module for Ajax forms testing. */ /** @@ -67,7 +66,7 @@ function ajax_forms_test_simple_form($form, &$form_state) { } /** - * AJAX callback triggered by select. + * Ajax callback triggered by select. */ function ajax_forms_test_simple_form_select_callback($form, $form_state) { $commands = array(); @@ -77,7 +76,7 @@ function ajax_forms_test_simple_form_select_callback($form, $form_state) { } /** - * AJAX callback triggered by checkbox. + * Ajax callback triggered by checkbox. */ function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) { $commands = array(); @@ -88,7 +87,7 @@ function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) { /** - * Form to display the AJAX Commands. + * Form to display the Ajax Commands. * @param $form * @param $form_state * @return unknown_type @@ -154,7 +153,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { ), ); - // Shows the AJAX 'css' command. + // Shows the Ajax 'css' command. $form['css_command_example'] = array( '#value' => t("Set the the '#box' div to be blue."), '#type' => 'submit', @@ -165,7 +164,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { ); - // Shows the AJAX 'data' command. But there is no use of this information, + // Shows the Ajax 'data' command. But there is no use of this information, // as this would require a javascript client to use the data. $form['data_command_example'] = array( '#value' => t("AJAX data command: Issue command."), @@ -176,7 +175,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '<div id="data_div">Data attached to this div.</div>', ); - // Shows the AJAX 'invoke' command. + // Shows the Ajax 'invoke' command. $form['invoke_command_example'] = array( '#value' => t("AJAX invoke command: Invoke addClass() method."), '#type' => 'submit', @@ -186,7 +185,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '<div id="invoke_div">Original contents</div>', ); - // Shows the AJAX 'html' command. + // Shows the Ajax 'html' command. $form['html_command_example'] = array( '#value' => t("AJAX html: Replace the HTML in a selector."), '#type' => 'submit', @@ -196,7 +195,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '<div id="html_div">Original contents</div>', ); - // Shows the AJAX 'insert' command. + // Shows the Ajax 'insert' command. $form['insert_command_example'] = array( '#value' => t("AJAX insert: Let client insert based on #ajax['method']."), '#type' => 'submit', @@ -207,7 +206,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '<div id="insert_div">Original contents</div>', ); - // Shows the AJAX 'prepend' command. + // Shows the Ajax 'prepend' command. $form['prepend_command_example'] = array( '#value' => t("AJAX 'prepend': Click to prepend something"), '#type' => 'submit', @@ -217,7 +216,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '<div id="prepend_div">Something will be prepended to this div. </div>', ); - // Shows the AJAX 'remove' command. + // Shows the Ajax 'remove' command. $form['remove_command_example'] = array( '#value' => t("AJAX 'remove': Click to remove text"), '#type' => 'submit', @@ -227,7 +226,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '<div id="remove_div"><div id="remove_text">text to be removed</div></div>', ); - // Shows the AJAX 'restripe' command. + // Shows the Ajax 'restripe' command. $form['restripe_command_example'] = array( '#type' => 'submit', '#value' => t("AJAX 'restripe' command"), @@ -242,7 +241,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { </div>', ); - // Demonstrates the AJAX 'settings' command. The 'settings' command has + // Demonstrates the Ajax 'settings' command. The 'settings' command has // nothing visual to "show", but it can be tested via SimpleTest and via // Firebug. $form['settings_command_example'] = array( @@ -262,7 +261,7 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { } /** - * AJAX callback for 'after'. + * Ajax callback for 'after'. */ function ajax_forms_test_advanced_commands_after_callback($form, $form_state) { $selector = '#after_div'; @@ -273,7 +272,7 @@ function ajax_forms_test_advanced_commands_after_callback($form, $form_state) { } /** - * AJAX callback for 'alert'. + * Ajax callback for 'alert'. */ function ajax_forms_test_advanced_commands_alert_callback($form, $form_state) { $commands = array(); @@ -282,7 +281,7 @@ function ajax_forms_test_advanced_commands_alert_callback($form, $form_state) { } /** - * AJAX callback for 'append'. + * Ajax callback for 'append'. */ function ajax_forms_test_advanced_commands_append_callback($form, $form_state) { $selector = '#append_div'; @@ -292,7 +291,7 @@ function ajax_forms_test_advanced_commands_append_callback($form, $form_state) { } /** - * AJAX callback for 'before'. + * Ajax callback for 'before'. */ function ajax_forms_test_advanced_commands_before_callback($form, $form_state) { $selector = '#before_div'; @@ -303,14 +302,14 @@ function ajax_forms_test_advanced_commands_before_callback($form, $form_state) { } /** - * AJAX callback for 'changed'. + * Ajax callback for 'changed'. */ function ajax_forms_test_advanced_commands_changed_callback($form, $form_state) { $commands[] = ajax_command_changed('#changed_div'); return array('#type' => 'ajax', '#commands' => $commands); } /** - * AJAX callback for 'changed' with asterisk marking inner div. + * Ajax callback for 'changed' with asterisk marking inner div. */ function ajax_forms_test_advanced_commands_changed_asterisk_callback($form, $form_state) { $commands = array(); @@ -319,7 +318,7 @@ function ajax_forms_test_advanced_commands_changed_asterisk_callback($form, $for } /** - * AJAX callback for 'css'. + * Ajax callback for 'css'. */ function ajax_forms_test_advanced_commands_css_callback($form, $form_state) { $selector = '#css_div'; @@ -331,7 +330,7 @@ function ajax_forms_test_advanced_commands_css_callback($form, $form_state) { } /** - * AJAX callback for 'data'. + * Ajax callback for 'data'. */ function ajax_forms_test_advanced_commands_data_callback($form, $form_state) { $selector = '#data_div'; @@ -342,7 +341,7 @@ function ajax_forms_test_advanced_commands_data_callback($form, $form_state) { } /** - * AJAX callback for 'invoke'. + * Ajax callback for 'invoke'. */ function ajax_forms_test_advanced_commands_invoke_callback($form, $form_state) { $commands = array(); @@ -351,7 +350,7 @@ function ajax_forms_test_advanced_commands_invoke_callback($form, $form_state) { } /** - * AJAX callback for 'html'. + * Ajax callback for 'html'. */ function ajax_forms_test_advanced_commands_html_callback($form, $form_state) { $commands = array(); @@ -360,7 +359,7 @@ function ajax_forms_test_advanced_commands_html_callback($form, $form_state) { } /** - * AJAX callback for 'insert'. + * Ajax callback for 'insert'. */ function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) { $commands = array(); @@ -369,7 +368,7 @@ function ajax_forms_test_advanced_commands_insert_callback($form, $form_state) { } /** - * AJAX callback for 'prepend'. + * Ajax callback for 'prepend'. */ function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) { $commands = array(); @@ -378,7 +377,7 @@ function ajax_forms_test_advanced_commands_prepend_callback($form, $form_state) } /** - * AJAX callback for 'remove'. + * Ajax callback for 'remove'. */ function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) { $commands = array(); @@ -387,7 +386,7 @@ function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) { } /** - * AJAX callback for 'restripe'. + * Ajax callback for 'restripe'. */ function ajax_forms_test_advanced_commands_restripe_callback($form, $form_state) { $commands = array(); @@ -396,7 +395,7 @@ function ajax_forms_test_advanced_commands_restripe_callback($form, $form_state) } /** - * AJAX callback for 'settings'. + * Ajax callback for 'settings'. */ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state) { $commands = array(); @@ -407,12 +406,12 @@ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state) /** * This form and its related submit and callback functions demonstrate - * not validating another form element when a single AJAX element is triggered. + * not validating another form element when a single Ajax element is triggered. * - * The "drivertext" element is an AJAX-enabled textfield, free-form. + * The "drivertext" element is an Ajax-enabled textfield, free-form. * The "required_field" element is a textfield marked required. * - * The correct behavior is that the AJAX-enabled drivertext element should + * The correct behavior is that the Ajax-enabled drivertext element should * be able to trigger without causing validation of the "required_field". */ function ajax_forms_test_validation_form($form, &$form_state) { @@ -451,7 +450,7 @@ function ajax_forms_test_validation_form_submit($form, $form_state) { } /** - * AJAX callback for the 'drivertext' element of the validation form. + * Ajax callback for the 'drivertext' element of the validation form. */ function ajax_forms_test_validation_form_callback($form, $form_state) { drupal_set_message("ajax_forms_test_validation_form_callback invoked"); diff --git a/modules/simpletest/tests/ajax_test.info b/modules/simpletest/tests/ajax_test.info index 799c6d37..daa84cec 100644 --- a/modules/simpletest/tests/ajax_test.info +++ b/modules/simpletest/tests/ajax_test.info @@ -1,4 +1,3 @@ -; $Id: ajax_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = AJAX Test description = Support module for AJAX framework tests. package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/ajax_test.module b/modules/simpletest/tests/ajax_test.module index 4b0e19e0..4148a083 100644 --- a/modules/simpletest/tests/ajax_test.module +++ b/modules/simpletest/tests/ajax_test.module @@ -1,9 +1,8 @@ <?php -// $Id: ajax_test.module,v 1.5 2010/10/21 19:31:39 dries Exp $ /** * @file - * Helper module for AJAX framework tests. + * Helper module for Ajax framework tests. */ /** @@ -45,7 +44,7 @@ function ajax_test_render() { } /** - * Menu callback; Returns AJAX element with #error property set. + * Menu callback; Returns Ajax element with #error property set. */ function ajax_test_error() { $message = ''; diff --git a/modules/simpletest/tests/batch.test b/modules/simpletest/tests/batch.test index 48541426..d1c0e0b2 100644 --- a/modules/simpletest/tests/batch.test +++ b/modules/simpletest/tests/batch.test @@ -1,5 +1,4 @@ <?php -// $Id: batch.test,v 1.16 2010/11/27 20:25:44 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/batch_test.callbacks.inc b/modules/simpletest/tests/batch_test.callbacks.inc index 40308c73..75e66553 100644 --- a/modules/simpletest/tests/batch_test.callbacks.inc +++ b/modules/simpletest/tests/batch_test.callbacks.inc @@ -1,6 +1,5 @@ <?php -// $Id: batch_test.callbacks.inc,v 1.2 2010/10/03 02:42:25 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/batch_test.info b/modules/simpletest/tests/batch_test.info index e33fb4c0..d8ec56d7 100644 --- a/modules/simpletest/tests/batch_test.info +++ b/modules/simpletest/tests/batch_test.info @@ -1,4 +1,3 @@ -; $Id: batch_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Batch API test" description = "Support module for Batch API tests." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/batch_test.module b/modules/simpletest/tests/batch_test.module index c8710df4..1200e767 100644 --- a/modules/simpletest/tests/batch_test.module +++ b/modules/simpletest/tests/batch_test.module @@ -1,5 +1,4 @@ <?php -// $Id: batch_test.module,v 1.3 2010/10/03 02:42:25 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test index a6c0aeae..14c16a95 100644 --- a/modules/simpletest/tests/bootstrap.test +++ b/modules/simpletest/tests/bootstrap.test @@ -1,5 +1,4 @@ <?php -// $Id: bootstrap.test,v 1.35 2010/11/23 03:08:34 dries Exp $ class BootstrapIPAddressTestCase extends DrupalWebTestCase { diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test index c533722a..43d1fa12 100644 --- a/modules/simpletest/tests/cache.test +++ b/modules/simpletest/tests/cache.test @@ -1,5 +1,4 @@ <?php -// $Id: cache.test,v 1.12 2010/08/05 23:53:38 webchick Exp $ class CacheTestCase extends DrupalWebTestCase { protected $default_bin = 'cache'; diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 19dd70c2..d618ddb0 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -1,5 +1,4 @@ <?php -// $Id: common.test,v 1.138 2010/12/15 04:21:39 webchick Exp $ /** * @file @@ -1171,6 +1170,8 @@ class JavaScriptTestCase extends DrupalWebTestCase { $this->assertTrue(array_key_exists('misc/drupal.js', $javascript), t('Drupal.js is added when file is added.')); $this->assertTrue(array_key_exists('misc/collapse.js', $javascript), t('JavaScript files are correctly added.')); $this->assertEqual(base_path(), $javascript['settings']['data'][0]['basePath'], t('Base path JavaScript setting is correctly set.')); + url('', array('prefix' => &$prefix)); + $this->assertEqual(empty($prefix) ? '' : $prefix, $javascript['settings']['data'][1]['pathPrefix'], t('Path prefix JavaScript setting is correctly set.')); } /** @@ -1178,8 +1179,8 @@ class JavaScriptTestCase extends DrupalWebTestCase { */ function testAddSetting() { $javascript = drupal_add_js(array('drupal' => 'rocks', 'dries' => 280342800), 'setting'); - $this->assertEqual(280342800, $javascript['settings']['data'][1]['dries'], t('JavaScript setting is set correctly.')); - $this->assertEqual('rocks', $javascript['settings']['data'][1]['drupal'], t('The other JavaScript setting is set correctly.')); + $this->assertEqual(280342800, $javascript['settings']['data'][2]['dries'], t('JavaScript setting is set correctly.')); + $this->assertEqual('rocks', $javascript['settings']['data'][2]['drupal'], t('The other JavaScript setting is set correctly.')); } /** @@ -1209,6 +1210,7 @@ class JavaScriptTestCase extends DrupalWebTestCase { $javascript = drupal_get_js('header'); $this->assertTrue(strpos($javascript, 'basePath') > 0, t('Rendered JavaScript header returns basePath setting.')); $this->assertTrue(strpos($javascript, 'misc/jquery.js') > 0, t('Rendered JavaScript header includes jQuery.')); + $this->assertTrue(strpos($javascript, 'pathPrefix') > 0, t('Rendered JavaScript header returns pathPrefix setting.')); // Test whether drupal_add_js can be used to override a previous setting. $this->assertTrue(strpos($javascript, 'commonTestShouldAppear') > 0, t('Rendered JavaScript header returns custom setting.')); @@ -1521,6 +1523,56 @@ class DrupalRenderTestCase extends DrupalWebTestCase { $this->assertTrue(strpos($output, $second) < strpos($output, $first), t('Elements were not sorted.')); } + /** + * Test #attached functionality in children elements. + */ + function testDrupalRenderChildrenAttached() { + // The cache system is turned off for POST requests. + $request_method = $_SERVER['REQUEST_METHOD']; + $_SERVER['REQUEST_METHOD'] = 'GET'; + + // Create an element with a child and subchild. Each element loads a + // different JavaScript file using #attached. + $parent_js = drupal_get_path('module', 'user') . '/user.js'; + $child_js = drupal_get_path('module', 'forum') . '/forum.js'; + $subchild_js = drupal_get_path('module', 'book') . '/book.js'; + $element = array( + '#type' => 'fieldset', + '#cache' => array( + 'keys' => array('simpletest', 'drupal_render', 'children_attached'), + ), + '#attached' => array('js' => array($parent_js)), + '#title' => 'Parent', + ); + $element['child'] = array( + '#type' => 'fieldset', + '#attached' => array('js' => array($child_js)), + '#title' => 'Child', + ); + $element['child']['subchild'] = array( + '#attached' => array('js' => array($subchild_js)), + '#markup' => 'Subchild', + ); + + // Render the element and verify the presence of #attached JavaScript. + drupal_render($element); + $scripts = drupal_get_js(); + $this->assertTrue(strpos($scripts, $parent_js), t('The element #attached JavaScript was included.')); + $this->assertTrue(strpos($scripts, $child_js), t('The child #attached JavaScript was included.')); + $this->assertTrue(strpos($scripts, $subchild_js), t('The subchild #attached JavaScript was included.')); + + // Load the element from cache and verify the presence of the #attached + // JavaScript. + drupal_static_reset('drupal_add_js'); + $this->assertTrue(drupal_render_cache_get($element), t('The element was retrieved from cache.')); + $scripts = drupal_get_js(); + $this->assertTrue(strpos($scripts, $parent_js), t('The element #attached JavaScript was included when loading from cache.')); + $this->assertTrue(strpos($scripts, $child_js), t('The child #attached JavaScript was included when loading from cache.')); + $this->assertTrue(strpos($scripts, $subchild_js), t('The subchild #attached JavaScript was included when loading from cache.')); + + $_SERVER['REQUEST_METHOD'] = $request_method; + } + /** * Test passing arguments to the theme function. */ diff --git a/modules/simpletest/tests/common_test.css b/modules/simpletest/tests/common_test.css index 0bbfdf24..b86ceadb 100644 --- a/modules/simpletest/tests/common_test.css +++ b/modules/simpletest/tests/common_test.css @@ -1,3 +1,2 @@ -/* $Id: common_test.css,v 1.1 2010/10/03 05:11:16 webchick Exp $ */ /* This file is for testing CSS file inclusion, no contents are necessary. */ diff --git a/modules/simpletest/tests/common_test.info b/modules/simpletest/tests/common_test.info index b08a0847..4e07d820 100644 --- a/modules/simpletest/tests/common_test.info +++ b/modules/simpletest/tests/common_test.info @@ -1,4 +1,3 @@ -; $Id: common_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $ name = "Common Test" description = "Support module for Common tests." package = Testing @@ -8,8 +7,8 @@ stylesheets[all][] = common_test.css stylesheets[print][] = common_test.print.css hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index 1671f5e0..9b617880 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -1,5 +1,4 @@ <?php -// $Id: common_test.module,v 1.13 2010/08/17 21:31:13 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/common_test.print.css b/modules/simpletest/tests/common_test.print.css index 2528fafa..b86ceadb 100644 --- a/modules/simpletest/tests/common_test.print.css +++ b/modules/simpletest/tests/common_test.print.css @@ -1,3 +1,2 @@ -/* $Id: common_test.print.css,v 1.1 2010/10/03 05:11:16 webchick Exp $ */ /* This file is for testing CSS file inclusion, no contents are necessary. */ diff --git a/modules/simpletest/tests/common_test_info.txt b/modules/simpletest/tests/common_test_info.txt index 95a8277f..ae217b91 100644 --- a/modules/simpletest/tests/common_test_info.txt +++ b/modules/simpletest/tests/common_test_info.txt @@ -1,4 +1,3 @@ -; $Id: common_test_info.txt,v 1.2 2010/01/30 07:59:25 dries Exp $ ; Test parsing with a simple string. simple_string = A simple string diff --git a/modules/simpletest/tests/database_test.info b/modules/simpletest/tests/database_test.info index a315617f..660f1a05 100644 --- a/modules/simpletest/tests/database_test.info +++ b/modules/simpletest/tests/database_test.info @@ -1,4 +1,3 @@ -; $Id: database_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $ name = "Database Test" description = "Support module for Database layer tests." core = 7.x @@ -6,8 +5,8 @@ package = Testing version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/database_test.install b/modules/simpletest/tests/database_test.install index 08db2e3c..4dce2b19 100644 --- a/modules/simpletest/tests/database_test.install +++ b/modules/simpletest/tests/database_test.install @@ -1,5 +1,4 @@ <?php -// $Id: database_test.install,v 1.13 2010/07/28 10:52:12 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/database_test.module b/modules/simpletest/tests/database_test.module index 03769303..6fac3191 100644 --- a/modules/simpletest/tests/database_test.module +++ b/modules/simpletest/tests/database_test.module @@ -1,5 +1,4 @@ <?php -// $Id: database_test.module,v 1.15 2010/10/15 04:34:15 webchick Exp $ /** * Implements hook_query_alter(). diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 183e3b21..c22d1fc5 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -1,5 +1,4 @@ <?php -// $Id: database_test.test,v 1.110 2010/12/31 20:43:43 webchick Exp $ /** * Dummy class for fetching into a class. @@ -719,6 +718,21 @@ class DatabaseUpdateTestCase extends DatabaseTestCase { $this->assertIdentical($saved_name, 'Tiffany', t('Updated name successfully.')); } + /** + * Confirm updating to NULL. + */ + function testSimpleNullUpdate() { + $this->ensureSampleDataNull(); + $num_updated = db_update('test_null') + ->fields(array('age' => NULL)) + ->condition('name', 'Kermit') + ->execute(); + $this->assertIdentical($num_updated, 1, t('Updated 1 record.')); + + $saved_age = db_query('SELECT age FROM {test_null} WHERE name = :name', array(':name' => 'Kermit'))->fetchField(); + $this->assertNull($saved_age, t('Updated name successfully.')); + } + /** * Confirm that we can update a multiple records successfully. */ @@ -1310,6 +1324,27 @@ class DatabaseSelectTestCase extends DatabaseTestCase { $this->assertEqual($query, $expected, t('The flattened query contains the comment string.')); } + /** + * Test query COMMENT system against vulnerabilities. + */ + function testVulnerableComment() { + $query = db_select('test')->comment('Testing query comments */ SELECT nid FROM {node}; --'); + $name_field = $query->addField('test', 'name'); + $age_field = $query->addField('test', 'age', 'age'); + $result = $query->execute(); + + $num_records = 0; + foreach ($result as $record) { + $num_records++; + } + + $query = (string)$query; + $expected = "/* Testing query comments SELECT nid FROM {node}; -- */ SELECT test.name AS name, test.age AS age\nFROM \n{test} test"; + + $this->assertEqual($num_records, 4, t('Returned the correct number of rows.')); + $this->assertEqual($query, $expected, t('The flattened query contains the sanitised comment string.')); + } + /** * Test basic conditionals on SELECT statements. */ @@ -1687,6 +1722,9 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase { /** * Test EXISTS subquery conditionals on SELECT statements. + * + * We essentially select all rows from the {test} table that have matching + * rows in the {test_people} table based on the shared name column. */ function testExistsSubquerySelect() { // Put George into {test_people}. @@ -1703,7 +1741,7 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase { // Subquery to {test_people}. $subquery = db_select('test_people', 'tp') ->fields('tp', array('name')) - ->condition('name', 'George'); + ->where('tp.name = t.name'); $query->exists($subquery); $result = $query->execute(); @@ -1714,6 +1752,9 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase { /** * Test NOT EXISTS subquery conditionals on SELECT statements. + * + * We essentially select all rows from the {test} table that don't have + * matching rows in the {test_people} table based on the shared name column. */ function testNotExistsSubquerySelect() { // Put George into {test_people}. @@ -1731,13 +1772,12 @@ class DatabaseSelectSubqueryTestCase extends DatabaseTestCase { // Subquery to {test_people}. $subquery = db_select('test_people', 'tp') ->fields('tp', array('name')) - ->condition('name', 'George'); + ->where('tp.name = t.name'); $query->notExists($subquery); - $result = $query->execute(); - // Ensure that we got the right record. - $record = $result->fetch(); - $this->assertFalse($record, t('NOT EXISTS query returned no results.')); + // Ensure that we got the right number of records. + $people = $query->execute()->fetchCol(); + $this->assertEqual(count($people), 3, t('NOT EXISTS query returned the correct results.')); } } diff --git a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info index ef822558..030649d1 100644 --- a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info +++ b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info @@ -1,4 +1,3 @@ -; $Id: drupal_system_listing_compatible_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Drupal system listing compatible test" description = "Support module for testing the drupal_system_listing function." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module index 4155b320..b3d9bbc7 100644 --- a/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module +++ b/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module @@ -1,2 +1 @@ <?php -// $Id: drupal_system_listing_compatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $ diff --git a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info index 0a082b09..1b97a000 100644 --- a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info +++ b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info @@ -1,4 +1,3 @@ -; $Id: drupal_system_listing_incompatible_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Drupal system listing incompatible test" description = "Support module for testing the drupal_system_listing function." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module index d5db920e..b3d9bbc7 100644 --- a/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module +++ b/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module @@ -1,2 +1 @@ <?php -// $Id: drupal_system_listing_incompatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $ diff --git a/modules/simpletest/tests/entity_cache_test.info b/modules/simpletest/tests/entity_cache_test.info index 17e15afd..9926fa03 100644 --- a/modules/simpletest/tests/entity_cache_test.info +++ b/modules/simpletest/tests/entity_cache_test.info @@ -1,4 +1,3 @@ -; $Id: entity_cache_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Entity cache test" description = "Support module for testing entity cache." package = Testing @@ -7,8 +6,8 @@ core = 7.x dependencies[] = entity_cache_test_dependency hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/entity_cache_test.module b/modules/simpletest/tests/entity_cache_test.module index 244e2f8b..5ae9eccb 100644 --- a/modules/simpletest/tests/entity_cache_test.module +++ b/modules/simpletest/tests/entity_cache_test.module @@ -1,5 +1,4 @@ <?php -// $Id: entity_cache_test.module,v 1.2 2010/10/15 04:44:08 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/entity_cache_test_dependency.info b/modules/simpletest/tests/entity_cache_test_dependency.info index f1217dfb..ec93b21e 100644 --- a/modules/simpletest/tests/entity_cache_test_dependency.info +++ b/modules/simpletest/tests/entity_cache_test_dependency.info @@ -1,4 +1,3 @@ -; $Id: entity_cache_test_dependency.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Entity cache test dependency" description = "Support dependency module for testing entity cache." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/entity_cache_test_dependency.module b/modules/simpletest/tests/entity_cache_test_dependency.module index 31b7d384..73a11495 100644 --- a/modules/simpletest/tests/entity_cache_test_dependency.module +++ b/modules/simpletest/tests/entity_cache_test_dependency.module @@ -1,5 +1,4 @@ <?php -// $Id: entity_cache_test_dependency.module,v 1.2 2010/09/15 04:34:27 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/entity_crud_hook_test.info b/modules/simpletest/tests/entity_crud_hook_test.info index 99bb8eb0..c9ea4e9b 100644 --- a/modules/simpletest/tests/entity_crud_hook_test.info +++ b/modules/simpletest/tests/entity_crud_hook_test.info @@ -1,4 +1,3 @@ -; $Id: entity_crud_hook_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Entity CRUD Hooks Test" description = "Support module for CRUD hook tests." core = 7.x @@ -6,8 +5,8 @@ package = Testing version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/entity_crud_hook_test.module b/modules/simpletest/tests/entity_crud_hook_test.module index 3aa9cacc..873a162c 100644 --- a/modules/simpletest/tests/entity_crud_hook_test.module +++ b/modules/simpletest/tests/entity_crud_hook_test.module @@ -1,5 +1,4 @@ <?php -// $Id: entity_crud_hook_test.module,v 1.2 2010/12/15 03:39:42 webchick Exp $ // // Presave hooks diff --git a/modules/simpletest/tests/entity_crud_hook_test.test b/modules/simpletest/tests/entity_crud_hook_test.test index 50cf7203..3f18fc85 100644 --- a/modules/simpletest/tests/entity_crud_hook_test.test +++ b/modules/simpletest/tests/entity_crud_hook_test.test @@ -1,5 +1,4 @@ <?php -// $Id: entity_crud_hook_test.test,v 1.2 2010/12/15 03:39:42 webchick Exp $ /** * Test invocation of hooks when inserting, loading, updating or deleting an diff --git a/modules/simpletest/tests/entity_query.test b/modules/simpletest/tests/entity_query.test index c1bc3dee..d28d5a35 100644 --- a/modules/simpletest/tests/entity_query.test +++ b/modules/simpletest/tests/entity_query.test @@ -1,6 +1,5 @@ <?php -// $Id: entity_query.test,v 1.15 2010/11/14 22:07:57 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/error.test b/modules/simpletest/tests/error.test index d6a2fb7f..b1ec4b3f 100644 --- a/modules/simpletest/tests/error.test +++ b/modules/simpletest/tests/error.test @@ -1,5 +1,4 @@ <?php -// $Id: error.test,v 1.9 2010/10/16 00:00:16 webchick Exp $ /** * Tests Drupal error and exception handlers. @@ -25,21 +24,18 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { '%type' => 'Notice', '!message' => 'Undefined variable: bananas', '%function' => 'error_test_generate_warnings()', - '%line' => 44, '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'), ); $error_warning = array( '%type' => 'Warning', '!message' => 'Division by zero', '%function' => 'error_test_generate_warnings()', - '%line' => 46, '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'), ); $error_user_notice = array( '%type' => 'User warning', '!message' => 'Drupal is awesome', '%function' => 'error_test_generate_warnings()', - '%line' => 48, '%file' => drupal_realpath('modules/simpletest/tests/error_test.module'), ); @@ -97,7 +93,7 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { // varies from database to database. Check that the SQL string is displayed. $this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception)); $this->assertText($error_pdo_exception['!message'], t('Found !message in error page.', $error_pdo_exception)); - $error_details = t('in %function (line %line of %file)', $error_pdo_exception); + $error_details = t('in %function (line ', $error_pdo_exception); $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details))); } @@ -105,16 +101,16 @@ class DrupalErrorHandlerUnitTest extends DrupalWebTestCase { * Helper function: assert that the error message is found. */ function assertErrorMessage(array $error) { - $message = t('%type: !message in %function (line %line of %file).', $error); - $this->assertRaw($message, t('Error !message found.', array('!message' => $message))); + $message = t('%type: !message in %function (line ', $error); + $this->assertRaw($message, t('Found error message: !message.', array('!message' => $message))); } /** * Helper function: assert that the error message is not found. */ function assertNoErrorMessage(array $error) { - $message = t('%type: !message in %function (line %line of %file).', $error); - $this->assertNoRaw($message, t('Error !message not found.', array('!message' => $message))); + $message = t('%type: !message in %function (line ', $error); + $this->assertNoRaw($message, t('Did not find error message: !message.', array('!message' => $message))); } } diff --git a/modules/simpletest/tests/error_test.info b/modules/simpletest/tests/error_test.info index 1cb85e02..f742d62d 100644 --- a/modules/simpletest/tests/error_test.info +++ b/modules/simpletest/tests/error_test.info @@ -1,4 +1,3 @@ -; $Id: error_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Error test" description = "Support module for error and exception testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/error_test.module b/modules/simpletest/tests/error_test.module index 6fe94ffa..d062cb06 100644 --- a/modules/simpletest/tests/error_test.module +++ b/modules/simpletest/tests/error_test.module @@ -1,5 +1,4 @@ <?php -// $Id: error_test.module,v 1.5 2009/12/04 16:49:47 dries Exp $ /** * Implements hook_menu(). diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test index 467b5996..dc12b1b7 100644 --- a/modules/simpletest/tests/file.test +++ b/modules/simpletest/tests/file.test @@ -1,5 +1,4 @@ <?php -// $Id: file.test,v 1.72 2010/11/30 19:31:46 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/file_test.info b/modules/simpletest/tests/file_test.info index 38ca4ec0..24d05cf4 100644 --- a/modules/simpletest/tests/file_test.info +++ b/modules/simpletest/tests/file_test.info @@ -1,4 +1,3 @@ -; $Id: file_test.info,v 1.1 2008/09/20 07:35:53 webchick Exp $ name = "File test" description = "Support module for file handling tests." package = Testing @@ -7,8 +6,8 @@ core = 7.x files[] = file_test.module hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/file_test.module b/modules/simpletest/tests/file_test.module index 3624ccec..2865a1fa 100644 --- a/modules/simpletest/tests/file_test.module +++ b/modules/simpletest/tests/file_test.module @@ -1,5 +1,4 @@ <?php -// $Id: file_test.module,v 1.25 2010/08/22 13:52:58 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/filetransfer.test b/modules/simpletest/tests/filetransfer.test index 0ddc436e..905d23ca 100644 --- a/modules/simpletest/tests/filetransfer.test +++ b/modules/simpletest/tests/filetransfer.test @@ -1,5 +1,4 @@ <?php -// $Id: filetransfer.test,v 1.9 2010/09/01 20:08:17 dries Exp $ class FileTranferTest extends DrupalWebTestCase { diff --git a/modules/simpletest/tests/filter_test.info b/modules/simpletest/tests/filter_test.info index 88045130..4532e509 100644 --- a/modules/simpletest/tests/filter_test.info +++ b/modules/simpletest/tests/filter_test.info @@ -1,4 +1,3 @@ -; $Id: filter_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = Filter test module description = Tests filter hooks and functions. package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/filter_test.module b/modules/simpletest/tests/filter_test.module index 9d896f3b..2cebc708 100644 --- a/modules/simpletest/tests/filter_test.module +++ b/modules/simpletest/tests/filter_test.module @@ -1,5 +1,4 @@ <?php -// $Id: filter_test.module,v 1.6 2010/09/18 02:18:35 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index 79ec0983..e7ae9de3 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -1,5 +1,4 @@ <?php -// $Id: form.test,v 1.79 2010/12/30 22:52:24 webchick Exp $ /** * @file @@ -1132,13 +1131,13 @@ class FormsRebuildTestCase extends DrupalWebTestCase { } /** - * Tests that a form's action is retained after an AJAX submission. + * Tests that a form's action is retained after an Ajax submission. * - * The 'action' attribute of a form should not change after an AJAX submission - * followed by a non-AJAX submission, which triggers a validation error. + * The 'action' attribute of a form should not change after an Ajax submission + * followed by a non-Ajax submission, which triggers a validation error. */ function testPreserveFormActionAfterAJAX() { - // Create a multi-valued field for 'page' nodes to use for AJAX testing. + // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; $field = array( 'field_name' => $field_name, @@ -1157,14 +1156,14 @@ class FormsRebuildTestCase extends DrupalWebTestCase { $this->web_user = $this->drupalCreateUser(array('create page content')); $this->drupalLogin($this->web_user); - // Get the form for adding a 'page' node. Submit an "add another item" AJAX + // Get the form for adding a 'page' node. Submit an "add another item" Ajax // submission and verify it worked by ensuring the updated page has two text // field items in the field for which we just added an item. $this->drupalGet('node/add/page'); $this->drupalPostAJAX(NULL, array(), array('field_ajax_test_add_more' => t('Add another item')), 'system/ajax', array(), array(), 'page-node-form'); $this->assert(count($this->xpath('//div[contains(@class, "field-name-field-ajax-test")]//input[@type="text"]')) == 2, t('AJAX submission succeeded.')); - // Submit the form with the non-AJAX "Save" button, leaving the title field + // Submit the form with the non-Ajax "Save" button, leaving the title field // blank to trigger a validation error, and ensure that a validation error // occurred, because this test is for testing what happens when a form is // re-rendered without being re-built, which is what happens when there's diff --git a/modules/simpletest/tests/form_test.file.inc b/modules/simpletest/tests/form_test.file.inc index ea2dab2b..f9197ead 100644 --- a/modules/simpletest/tests/form_test.file.inc +++ b/modules/simpletest/tests/form_test.file.inc @@ -1,5 +1,4 @@ <?php -// $Id: form_test.file.inc,v 1.4 2010/09/19 18:39:18 dries Exp $ /** * @file @@ -11,7 +10,7 @@ * hook_menu(). */ function form_test_load_include_menu($form, &$form_state) { - // Submit the form via AJAX. That way the FAPI has to care about including + // Submit the form via Ajax. That way the FAPI has to care about including // the file specified in hook_menu(). $ajax_wrapper_id = drupal_html_id('form-test-load-include-menu-ajax-wrapper'); $form['ajax_wrapper'] = array( @@ -43,7 +42,7 @@ function form_test_load_include_submit($form, $form_state) { function form_test_load_include_menu_ajax($form) { // We don't need to return anything, since #ajax['method'] is 'append', which // does not remove the original #ajax['wrapper'] element, and status messages - // are automatically added by the AJAX framework as long as there's a wrapper + // are automatically added by the Ajax framework as long as there's a wrapper // element to add them to. return ''; } diff --git a/modules/simpletest/tests/form_test.info b/modules/simpletest/tests/form_test.info index c839bcda..430b0fe6 100644 --- a/modules/simpletest/tests/form_test.info +++ b/modules/simpletest/tests/form_test.info @@ -1,4 +1,3 @@ -; $Id: form_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $ name = "FormAPI Test" description = "Support module for Form API tests." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module index c49b2846..00be7d2e 100644 --- a/modules/simpletest/tests/form_test.module +++ b/modules/simpletest/tests/form_test.module @@ -1,5 +1,4 @@ <?php -// $Id: form_test.module,v 1.59 2010/12/30 22:52:24 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/graph.test b/modules/simpletest/tests/graph.test index 0c9014cd..c190161b 100644 --- a/modules/simpletest/tests/graph.test +++ b/modules/simpletest/tests/graph.test @@ -1,5 +1,4 @@ <?php -// $Id: graph.test,v 1.10 2010/09/04 13:33:53 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/http.php b/modules/simpletest/tests/http.php index 5400bb8f..a22938d9 100644 --- a/modules/simpletest/tests/http.php +++ b/modules/simpletest/tests/http.php @@ -1,5 +1,4 @@ <?php -// $Id: http.php,v 1.1 2010/11/05 19:05:02 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/https.php b/modules/simpletest/tests/https.php index bbbaca34..b5ffab69 100644 --- a/modules/simpletest/tests/https.php +++ b/modules/simpletest/tests/https.php @@ -1,5 +1,4 @@ <?php -// $Id: https.php,v 1.3 2010/11/05 19:05:02 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/image.test b/modules/simpletest/tests/image.test index 88ba242c..60599bee 100644 --- a/modules/simpletest/tests/image.test +++ b/modules/simpletest/tests/image.test @@ -1,5 +1,4 @@ <?php -// $Id: image.test,v 1.16 2010/09/01 20:08:17 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/image_test.info b/modules/simpletest/tests/image_test.info index 9f6d0f49..eb280e5f 100644 --- a/modules/simpletest/tests/image_test.info +++ b/modules/simpletest/tests/image_test.info @@ -1,4 +1,3 @@ -; $Id: image_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Image test" description = "Support module for image toolkit tests." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/image_test.module b/modules/simpletest/tests/image_test.module index 6f88ef31..de640f0b 100644 --- a/modules/simpletest/tests/image_test.module +++ b/modules/simpletest/tests/image_test.module @@ -1,5 +1,4 @@ <?php -// $Id: image_test.module,v 1.6 2010/03/26 17:14:45 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/lock.test b/modules/simpletest/tests/lock.test index efa71646..0b423ffd 100644 --- a/modules/simpletest/tests/lock.test +++ b/modules/simpletest/tests/lock.test @@ -1,5 +1,4 @@ <?php -// $Id: lock.test,v 1.3 2010/08/05 23:53:38 webchick Exp $ /** * Tests for the lock system. diff --git a/modules/simpletest/tests/mail.test b/modules/simpletest/tests/mail.test index 655ce98b..8a7b152d 100644 --- a/modules/simpletest/tests/mail.test +++ b/modules/simpletest/tests/mail.test @@ -1,5 +1,4 @@ <?php -// $Id: mail.test,v 1.5 2010/08/05 23:53:38 webchick Exp $ /** * Test the Drupal mailing system. diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test index ff7c7c4d..5642fcee 100644 --- a/modules/simpletest/tests/menu.test +++ b/modules/simpletest/tests/menu.test @@ -1,5 +1,4 @@ <?php -// $Id: menu.test,v 1.42 2010/12/02 17:34:24 webchick Exp $ /** * @file @@ -34,6 +33,18 @@ class MenuRouterTestCase extends DrupalWebTestCase { $this->assertNoText(t('A title with @placeholder', array('@placeholder' => 'some other text')), t('Text with placeholder substitutions not found.')); } + /** + * Tests page title of MENU_CALLBACKs. + */ + function testTitleMenuCallback() { + // Verify that the menu router item title is not visible. + $this->drupalGet(''); + $this->assertNoText(t('Menu Callback Title')); + // Verify that the menu router item title is output as page title. + $this->drupalGet('menu_callback_title'); + $this->assertText(t('Menu Callback Title')); + } + /** * Test the theme callback when it is set to use an administrative theme. */ @@ -845,6 +856,64 @@ class MenuTreeDataTestCase extends DrupalUnitTestCase { } } +/** + * Menu tree output related tests. + */ +class MenuTreeOutputTestCase extends DrupalWebTestCase { + /** + * Dummy link structure acceptable for menu_tree_output(). + */ + var $tree_data = array( + '1'=> array( + 'link' => array( 'menu_name' => 'main-menu', 'mlid' => 1, 'hidden'=>0, 'has_children' => 1, 'title' => 'Item 1', 'in_active_trail' => 1, 'access'=>1, 'href' => 'a', 'localized_options' => array('attributes' => array('title' =>'')) ), + 'below' => array( + '2' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 2, 'hidden'=>0, 'has_children' => 1, 'title' => 'Item 2', 'in_active_trail' => 1, 'access'=>1, 'href' => 'a/b', 'localized_options' => array('attributes' => array('title' =>'')) ), + 'below' => array( + '3' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 3, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 3', 'in_active_trail' => 0, 'access'=>1, 'href' => 'a/b/c', 'localized_options' => array('attributes' => array('title' =>'')) ), + 'below' => array() ), + '4' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 4, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 4', 'in_active_trail' => 0, 'access'=>1, 'href' => 'a/b/d', 'localized_options' => array('attributes' => array('title' =>'')) ), + 'below' => array() ) + ) + ) + ) + ), + '5' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 5, 'hidden'=>1, 'has_children' => 0, 'title' => 'Item 5', 'in_active_trail' => 0, 'access'=>1, 'href' => 'e', 'localized_options' => array('attributes' => array('title' =>'')) ), 'below' => array( ) ), + '6' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 6, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 6', 'in_active_trail' => 0, 'access'=>0, 'href' => 'f', 'localized_options' => array('attributes' => array('title' =>'')) ), 'below' => array( ) ), + '7' => array('link' => array( 'menu_name' => 'main-menu', 'mlid' => 7, 'hidden'=>0, 'has_children' => 0, 'title' => 'Item 7', 'in_active_trail' => 0, 'access'=>1, 'href' => 'g', 'localized_options' => array('attributes' => array('title' =>'')) ), 'below' => array( ) ) + ); + + public static function getInfo() { + return array( + 'name' => 'Menu tree output', + 'description' => 'Tests menu tree output functions.', + 'group' => 'Menu', + ); + } + + function setUp() { + parent::setUp(); + } + + /** + * Validate the generation of a proper menu tree output. + */ + function testMenuTreeData() { + $output = menu_tree_output($this->tree_data); + + // Validate that the - in main-menu is changed into an underscore + $this->assertEqual( $output['1']['#theme'], 'menu_link__main_menu', t('Hyphen is changed to a dash on menu_link')); + $this->assertEqual( $output['#theme_wrappers'][0], 'menu_tree__main_menu', t('Hyphen is changed to a dash on menu_tree wrapper')); + // Looking for child items in the data + $this->assertEqual( $output['1']['#below']['2']['#href'], 'a/b', t('Checking the href on a child item')); + $this->assertTrue( in_array('active-trail',$output['1']['#below']['2']['#attributes']['class']) , t('Checking the active trail class')); + // Validate that the hidden and no access items are missing + $this->assertFalse( isset($output['5']), t('Hidden item should be missing')); + $this->assertFalse( isset($output['6']), t('False access should be missing')); + // Item 7 is after a couple hidden items. Just to make sure that 5 and 6 are skipped and 7 still included + $this->assertTrue( isset($output['7']), t('Item after hidden items is present')); + } +} + /** * Menu breadcrumbs related tests. */ diff --git a/modules/simpletest/tests/menu_test.info b/modules/simpletest/tests/menu_test.info index b41da9b4..710e530b 100644 --- a/modules/simpletest/tests/menu_test.info +++ b/modules/simpletest/tests/menu_test.info @@ -1,4 +1,3 @@ -; $Id: menu_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Hook menu tests" description = "Support module for menu hook testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/menu_test.module b/modules/simpletest/tests/menu_test.module index 2230756a..3046a041 100644 --- a/modules/simpletest/tests/menu_test.module +++ b/modules/simpletest/tests/menu_test.module @@ -1,5 +1,4 @@ <?php -// $Id: menu_test.module,v 1.21 2010/12/02 17:34:24 webchick Exp $ /** * @file @@ -16,6 +15,13 @@ function menu_test_menu() { 'page callback' => 'node_save', 'menu_name' => menu_test_menu_name(), ); + // This item is of type MENU_CALLBACK with no parents to test title. + $items['menu_callback_title'] = array( + 'title' => 'Menu Callback Title', + 'page callback' => 'menu_test_callback', + 'type' => MENU_CALLBACK, + 'access arguments' => array('access content'), + ); // Use FALSE as 'title callback' to bypass t(). $items['menu_no_title_callback'] = array( 'title' => 'A title with @placeholder', diff --git a/modules/simpletest/tests/module.test b/modules/simpletest/tests/module.test index 7461a406..f55c08af 100644 --- a/modules/simpletest/tests/module.test +++ b/modules/simpletest/tests/module.test @@ -1,5 +1,4 @@ <?php -// $Id: module.test,v 1.26 2010/11/27 20:41:38 dries Exp $ /** * @file @@ -212,6 +211,27 @@ class ModuleUnitTest extends DrupalWebTestCase { $uninstalled_modules = variable_get('test_module_uninstall_order', array()); $this->assertTrue(in_array('comment', $uninstalled_modules), t('Comment module is in the list of uninstalled modules.')); $this->assertFalse(in_array($profile, $uninstalled_modules), t('The installation profile is not in the list of uninstalled modules.')); + + // Enable forum module again, which should enable both the poll module and + // php module. But, this time do it with poll module declaring a dependency + // on a specific version of php module in its info file. Make sure that + // module_enable() still works. + variable_set('dependency_test', 'version dependency'); + drupal_static_reset('system_rebuild_module_data'); + $result = module_enable(array('forum')); + $this->assertTrue($result, t('module_enable() returns the correct value.')); + // Verify that the fake dependency chain was installed. + $this->assertTrue(module_exists('poll') && module_exists('php'), t('Dependency chain was installed by module_enable().')); + // Verify that the original module was installed. + $this->assertTrue(module_exists('forum'), t('Module installation with version dependencies succeeded.')); + // Finally, verify that the modules were enabled in the correct order. + $enable_order = variable_get('test_module_enable_order', array()); + $php_position = array_search('php', $enable_order); + $poll_position = array_search('poll', $enable_order); + $forum_position = array_search('forum', $enable_order); + $php_before_poll = $php_position !== FALSE && $poll_position !== FALSE && $php_position < $poll_position; + $poll_before_forum = $poll_position !== FALSE && $forum_position !== FALSE && $poll_position < $forum_position; + $this->assertTrue($php_before_poll && $poll_before_forum, t('Modules were enabled in the correct order by module_enable().')); } } diff --git a/modules/simpletest/tests/module_test.file.inc b/modules/simpletest/tests/module_test.file.inc index 323edc06..c0d3ec41 100644 --- a/modules/simpletest/tests/module_test.file.inc +++ b/modules/simpletest/tests/module_test.file.inc @@ -1,5 +1,4 @@ <?php -// $Id: module_test.file.inc,v 1.3 2010/11/27 20:41:38 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/module_test.info b/modules/simpletest/tests/module_test.info index e67742f4..2e8c9c8a 100644 --- a/modules/simpletest/tests/module_test.info +++ b/modules/simpletest/tests/module_test.info @@ -1,4 +1,3 @@ -; $Id: module_test.info,v 1.3 2010/12/20 19:59:43 webchick Exp $ name = "Module test" description = "Support module for module system testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/module_test.install b/modules/simpletest/tests/module_test.install index 3f00ee72..4cc09df5 100644 --- a/modules/simpletest/tests/module_test.install +++ b/modules/simpletest/tests/module_test.install @@ -1,5 +1,4 @@ <?php -// $Id: module_test.install,v 1.1 2010/02/26 18:31:29 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/module_test.module b/modules/simpletest/tests/module_test.module index e25a701a..d781350b 100644 --- a/modules/simpletest/tests/module_test.module +++ b/modules/simpletest/tests/module_test.module @@ -1,5 +1,4 @@ <?php -// $Id: module_test.module,v 1.10 2010/11/27 20:41:38 dries Exp $ /** * Implements hook_permission(). @@ -36,6 +35,20 @@ function module_test_system_info_alter(&$info, $file, $type) { $info['dependencies'][] = 'php'; } } + elseif (variable_get('dependency_test', FALSE) == 'version dependency') { + if ($file->name == 'forum') { + // Make the forum module depend on poll. + $info['dependencies'][] = 'poll'; + } + elseif ($file->name == 'poll') { + // Make poll depend on a specific version of php module. + $info['dependencies'][] = 'php (1.x)'; + } + elseif ($file->name == 'php') { + // Set php module to a version compatible with the above. + $info['version'] = '7.x-1.0'; + } + } if ($file->name == 'seven' && $type == 'theme') { $info['regions']['test_region'] = t('Test region'); } diff --git a/modules/simpletest/tests/password.test b/modules/simpletest/tests/password.test index 2250ac3d..e100c2ef 100644 --- a/modules/simpletest/tests/password.test +++ b/modules/simpletest/tests/password.test @@ -1,5 +1,4 @@ <?php -// $Id: password.test,v 1.1 2010/12/18 00:56:18 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/path.test b/modules/simpletest/tests/path.test index efb96cc8..0c8ecdac 100644 --- a/modules/simpletest/tests/path.test +++ b/modules/simpletest/tests/path.test @@ -1,5 +1,4 @@ <?php -// $Id: path.test,v 1.8 2010/11/30 01:05:24 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/registry.test b/modules/simpletest/tests/registry.test index 421678f7..bcd8d4e0 100644 --- a/modules/simpletest/tests/registry.test +++ b/modules/simpletest/tests/registry.test @@ -1,5 +1,4 @@ <?php -// $Id: registry.test,v 1.21 2010/09/01 20:08:17 dries Exp $ class RegistryParseFileTestCase extends DrupalWebTestCase { public static function getInfo() { diff --git a/modules/simpletest/tests/requirements1_test.info b/modules/simpletest/tests/requirements1_test.info index e98368a5..b227e418 100644 --- a/modules/simpletest/tests/requirements1_test.info +++ b/modules/simpletest/tests/requirements1_test.info @@ -1,4 +1,3 @@ -; $Id: requirements1_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = Requirements 1 Test description = "Tests that a module is not installed when it fails hook_requirements('install')." package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/requirements1_test.install b/modules/simpletest/tests/requirements1_test.install index c3748895..651d911a 100644 --- a/modules/simpletest/tests/requirements1_test.install +++ b/modules/simpletest/tests/requirements1_test.install @@ -1,5 +1,4 @@ <?php -// $Id: requirements1_test.install,v 1.1 2010/05/26 07:31:46 dries Exp $ /** * Implements hook_requirements(). diff --git a/modules/simpletest/tests/requirements1_test.module b/modules/simpletest/tests/requirements1_test.module index 862c34b4..e52266b2 100644 --- a/modules/simpletest/tests/requirements1_test.module +++ b/modules/simpletest/tests/requirements1_test.module @@ -1,5 +1,4 @@ <?php -// $Id: requirements1_test.module,v 1.1 2010/05/26 07:31:46 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/requirements2_test.info b/modules/simpletest/tests/requirements2_test.info index a058fd4a..b0bf1187 100644 --- a/modules/simpletest/tests/requirements2_test.info +++ b/modules/simpletest/tests/requirements2_test.info @@ -1,4 +1,3 @@ -; $Id: requirements2_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = Requirements 2 Test description = "Tests that a module is not installed when the one it depends on fails hook_requirements('install)." dependencies[] = requirements1_test @@ -8,8 +7,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/requirements2_test.module b/modules/simpletest/tests/requirements2_test.module index d84c22aa..a4f43051 100644 --- a/modules/simpletest/tests/requirements2_test.module +++ b/modules/simpletest/tests/requirements2_test.module @@ -1,5 +1,4 @@ <?php -// $Id: requirements2_test.module,v 1.1 2010/05/26 07:31:47 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/schema.test b/modules/simpletest/tests/schema.test index f9baaac7..8945117c 100644 --- a/modules/simpletest/tests/schema.test +++ b/modules/simpletest/tests/schema.test @@ -1,5 +1,4 @@ <?php -// $Id: schema.test,v 1.24 2010/12/08 06:38:59 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test index d947c51d..bc72e5c5 100644 --- a/modules/simpletest/tests/session.test +++ b/modules/simpletest/tests/session.test @@ -1,5 +1,4 @@ <?php -// $Id: session.test,v 1.35 2010/11/13 17:40:09 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/session_test.info b/modules/simpletest/tests/session_test.info index 6f7c5305..c541d437 100644 --- a/modules/simpletest/tests/session_test.info +++ b/modules/simpletest/tests/session_test.info @@ -1,4 +1,3 @@ -; $Id: session_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Session test" description = "Support module for session data testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/session_test.module b/modules/simpletest/tests/session_test.module index 62b3fbbe..689ff099 100644 --- a/modules/simpletest/tests/session_test.module +++ b/modules/simpletest/tests/session_test.module @@ -1,5 +1,4 @@ <?php -// $Id: session_test.module,v 1.16 2010/11/13 17:40:09 webchick Exp $ /** * Implements hook_menu(). diff --git a/modules/simpletest/tests/system.base.css b/modules/simpletest/tests/system.base.css index a1348a51..c14ae9b2 100644 --- a/modules/simpletest/tests/system.base.css +++ b/modules/simpletest/tests/system.base.css @@ -1,4 +1,3 @@ -/* $Id: system.base.css,v 1.1 2010/10/06 03:34:09 webchick Exp $ */ /** * This file is for testing CSS file override in diff --git a/modules/simpletest/tests/system_dependencies_test.info b/modules/simpletest/tests/system_dependencies_test.info index 141ca636..b371f635 100644 --- a/modules/simpletest/tests/system_dependencies_test.info +++ b/modules/simpletest/tests/system_dependencies_test.info @@ -1,4 +1,3 @@ -; $Id: system_dependencies_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "System dependency test" description = "Support module for testing system dependencies." package = Testing @@ -7,8 +6,8 @@ core = 7.x hidden = TRUE dependencies[] = _missing_dependency -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/system_dependencies_test.module b/modules/simpletest/tests/system_dependencies_test.module index 779209b4..b3d9bbc7 100644 --- a/modules/simpletest/tests/system_dependencies_test.module +++ b/modules/simpletest/tests/system_dependencies_test.module @@ -1,2 +1 @@ <?php -// $Id: system_dependencies_test.module,v 1.1 2009/12/08 06:39:34 webchick Exp $ diff --git a/modules/simpletest/tests/system_test.info b/modules/simpletest/tests/system_test.info index 02ce4a11..1681ccb7 100644 --- a/modules/simpletest/tests/system_test.info +++ b/modules/simpletest/tests/system_test.info @@ -1,4 +1,3 @@ -; $Id: system_test.info,v 1.3 2008/10/24 23:32:44 webchick Exp $ name = System test description = Support module for system testing. package = Testing @@ -7,8 +6,8 @@ core = 7.x files[] = system_test.module hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module index 583a5b70..76841fb6 100644 --- a/modules/simpletest/tests/system_test.module +++ b/modules/simpletest/tests/system_test.module @@ -1,5 +1,4 @@ <?php -// $Id: system_test.module,v 1.33 2010/12/01 00:23:36 webchick Exp $ /** * Implements hook_menu(). diff --git a/modules/simpletest/tests/tablesort.test b/modules/simpletest/tests/tablesort.test new file mode 100644 index 00000000..9c068f86 --- /dev/null +++ b/modules/simpletest/tests/tablesort.test @@ -0,0 +1,166 @@ +<?php + +/** + * @file + * Various tablesort tests. + */ + +/** + * Test unicode handling features implemented in unicode.inc. + */ +class TableSortTest extends DrupalUnitTestCase { + + /** + * Storage for initial value of $_GET. + * + * @var array + */ + protected $GET = array(); + + public static function getInfo() { + return array( + 'name' => 'Tablesort', + 'description' => 'Tests table sorting.', + 'group' => 'System', + ); + } + + function setUp() { + // Save the original $_GET to be restored later. + $this->GET = $_GET; + + parent::setUp(); + } + + function tearDown() { + // Revert $_GET. + $_GET = $this->GET; + + parent::tearDown(); + } + + /** + * Test tablesort_init(). + */ + function testTableSortInit() { + + // Test simple table headers. + + $headers = array('foo', 'bar', 'baz'); + // Reset $_GET to prevent parameters from Simpletest and Batch API ending + // up in $ts['query']. + $_GET = array('q' => 'jahwohl'); + $expected_ts = array( + 'name' => 'foo', + 'sql' => '', + 'sort' => 'asc', + 'query' => array(), + ); + $ts = tablesort_init($headers); + $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE))))); + $this->assertEqual($ts, $expected_ts, t('Simple table headers sorted correctly.')); + + // Test with simple table headers plus $_GET parameters that should _not_ + // override the default. + + $_GET = array( + 'q' => 'jahwohl', + // This should not override the table order because only complex + // headers are overridable. + 'order' => 'bar', + ); + $ts = tablesort_init($headers); + $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE))))); + $this->assertEqual($ts, $expected_ts, t('Simple table headers plus non-overriding $_GET parameters sorted correctly.')); + + // Test with simple table headers plus $_GET parameters that _should_ + // override the default. + + $_GET = array( + 'q' => 'jahwohl', + 'sort' => 'DESC', + // Add an unrelated parameter to ensure that tablesort will include + // it in the links that it creates. + 'alpha' => 'beta', + ); + $expected_ts['sort'] = 'desc'; + $expected_ts['query'] = array('alpha' => 'beta'); + $ts = tablesort_init($headers); + $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE))))); + $this->assertEqual($ts, $expected_ts, t('Simple table headers plus $_GET parameters sorted correctly.')); + + // Test complex table headers. + + $headers = array( + 'foo', + array( + 'data' => '1', + 'field' => 'one', + 'sort' => 'asc', + 'colspan' => 1, + ), + array( + 'data' => '2', + 'field' => 'two', + 'sort' => 'desc', + ), + ); + // Reset $_GET from previous assertion. + $_GET = array( + 'q' => 'jahwohl', + 'order' => '2', + ); + $ts = tablesort_init($headers); + $expected_ts = array( + 'name' => '2', + 'sql' => 'two', + 'sort' => 'desc', + 'query' => array(), + ); + $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE))))); + $this->assertEqual($ts, $expected_ts, t('Complex table headers sorted correctly.')); + + // Test complex table headers plus $_GET parameters that should _not_ + // override the default. + + $_GET = array( + 'q' => 'jahwohl', + // This should not override the table order because this header does not + // exist. + 'order' => 'bar', + ); + $ts = tablesort_init($headers); + $expected_ts = array( + 'name' => '1', + 'sql' => 'one', + 'sort' => 'asc', + 'query' => array(), + ); + $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE))))); + $this->assertEqual($ts, $expected_ts, t('Complex table headers plus non-overriding $_GET parameters sorted correctly.')); + unset($_GET['sort'], $_GET['order'], $_GET['alpha']); + + // Test complex table headers plus $_GET parameters that _should_ + // override the default. + + $_GET = array( + 'q' => 'jahwohl', + 'order' => '1', + 'sort' => 'ASC', + // Add an unrelated parameter to ensure that tablesort will include + // it in the links that it creates. + 'alpha' => 'beta', + ); + $expected_ts = array( + 'name' => '1', + 'sql' => 'one', + 'sort' => 'asc', + 'query' => array('alpha' => 'beta'), + ); + $ts = tablesort_init($headers); + $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => check_plain(var_export($ts, TRUE))))); + $this->assertEqual($ts, $expected_ts, t('Complex table headers plus $_GET parameters sorted correctly.')); + unset($_GET['sort'], $_GET['order'], $_GET['alpha']); + + } +} diff --git a/modules/simpletest/tests/taxonomy_test.info b/modules/simpletest/tests/taxonomy_test.info index e0b0fd8d..8d3aa1ef 100644 --- a/modules/simpletest/tests/taxonomy_test.info +++ b/modules/simpletest/tests/taxonomy_test.info @@ -1,4 +1,3 @@ -; $Id: taxonomy_test.info,v 1.4 2010/12/20 19:59:43 webchick Exp $ name = "Taxonomy test module" description = "Tests functions and hooks not used in core". package = Testing @@ -7,8 +6,8 @@ core = 7.x hidden = TRUE dependencies[] = taxonomy -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/taxonomy_test.install b/modules/simpletest/tests/taxonomy_test.install index b901e7ab..d5c94da5 100644 --- a/modules/simpletest/tests/taxonomy_test.install +++ b/modules/simpletest/tests/taxonomy_test.install @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy_test.install,v 1.10 2009/12/04 16:49:47 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/taxonomy_test.module b/modules/simpletest/tests/taxonomy_test.module index f25065c7..aae13a2d 100644 --- a/modules/simpletest/tests/taxonomy_test.module +++ b/modules/simpletest/tests/taxonomy_test.module @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy_test.module,v 1.8 2009/12/04 16:49:47 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test index 9e2f3877..d0ad77d7 100644 --- a/modules/simpletest/tests/theme.test +++ b/modules/simpletest/tests/theme.test @@ -1,5 +1,4 @@ <?php -// $Id: theme.test,v 1.23 2010/11/14 21:04:45 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/theme_test.info b/modules/simpletest/tests/theme_test.info index 0a790f2a..7a9c2dbf 100644 --- a/modules/simpletest/tests/theme_test.info +++ b/modules/simpletest/tests/theme_test.info @@ -1,4 +1,3 @@ -; $Id: theme_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Theme test" description = "Support module for theme system testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/theme_test.module b/modules/simpletest/tests/theme_test.module index 63539d65..160d192d 100644 --- a/modules/simpletest/tests/theme_test.module +++ b/modules/simpletest/tests/theme_test.module @@ -1,5 +1,4 @@ <?php -// $Id: theme_test.module,v 1.4 2010/08/22 12:46:21 dries Exp $ /** * Implements hook_menu(). diff --git a/modules/simpletest/tests/unicode.test b/modules/simpletest/tests/unicode.test index 7e6f0348..47a4938f 100644 --- a/modules/simpletest/tests/unicode.test +++ b/modules/simpletest/tests/unicode.test @@ -1,5 +1,4 @@ <?php -// $Id: unicode.test,v 1.9 2010/08/11 10:58:22 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/update.test b/modules/simpletest/tests/update.test index a9b0e75e..966efff2 100644 --- a/modules/simpletest/tests/update.test +++ b/modules/simpletest/tests/update.test @@ -1,5 +1,4 @@ <?php -// $Id: update.test,v 1.4 2010/08/05 23:53:38 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/update_test_1.info b/modules/simpletest/tests/update_test_1.info index ab67ad64..ae9a726f 100644 --- a/modules/simpletest/tests/update_test_1.info +++ b/modules/simpletest/tests/update_test_1.info @@ -1,4 +1,3 @@ -; $Id: update_test_1.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Update test" description = "Support module for update testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/update_test_1.install b/modules/simpletest/tests/update_test_1.install index 814a74a8..f4a86c7c 100644 --- a/modules/simpletest/tests/update_test_1.install +++ b/modules/simpletest/tests/update_test_1.install @@ -1,5 +1,4 @@ <?php -// $Id: update_test_1.install,v 1.2 2010/04/28 05:28:22 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/update_test_1.module b/modules/simpletest/tests/update_test_1.module index 99b6dcbd..b3d9bbc7 100644 --- a/modules/simpletest/tests/update_test_1.module +++ b/modules/simpletest/tests/update_test_1.module @@ -1,2 +1 @@ <?php -// $Id: update_test_1.module,v 1.1 2010/02/03 18:16:23 webchick Exp $ diff --git a/modules/simpletest/tests/update_test_2.info b/modules/simpletest/tests/update_test_2.info index 78ce4b6f..ae9a726f 100644 --- a/modules/simpletest/tests/update_test_2.info +++ b/modules/simpletest/tests/update_test_2.info @@ -1,4 +1,3 @@ -; $Id: update_test_2.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Update test" description = "Support module for update testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/update_test_2.install b/modules/simpletest/tests/update_test_2.install index 6e094ac4..9c076ff6 100644 --- a/modules/simpletest/tests/update_test_2.install +++ b/modules/simpletest/tests/update_test_2.install @@ -1,5 +1,4 @@ <?php -// $Id: update_test_2.install,v 1.2 2010/04/28 05:28:22 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/update_test_2.module b/modules/simpletest/tests/update_test_2.module index 729e2eff..b3d9bbc7 100644 --- a/modules/simpletest/tests/update_test_2.module +++ b/modules/simpletest/tests/update_test_2.module @@ -1,2 +1 @@ <?php -// $Id: update_test_2.module,v 1.1 2010/02/03 18:16:23 webchick Exp $ diff --git a/modules/simpletest/tests/update_test_3.info b/modules/simpletest/tests/update_test_3.info index 23d71ba4..ae9a726f 100644 --- a/modules/simpletest/tests/update_test_3.info +++ b/modules/simpletest/tests/update_test_3.info @@ -1,4 +1,3 @@ -; $Id: update_test_3.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Update test" description = "Support module for update testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/update_test_3.install b/modules/simpletest/tests/update_test_3.install index 4a86e79b..c3f6b757 100644 --- a/modules/simpletest/tests/update_test_3.install +++ b/modules/simpletest/tests/update_test_3.install @@ -1,5 +1,4 @@ <?php -// $Id: update_test_3.install,v 1.2 2010/04/28 05:28:22 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/update_test_3.module b/modules/simpletest/tests/update_test_3.module index ea8efc90..b3d9bbc7 100644 --- a/modules/simpletest/tests/update_test_3.module +++ b/modules/simpletest/tests/update_test_3.module @@ -1,2 +1 @@ <?php -// $Id: update_test_3.module,v 1.1 2010/02/03 18:16:23 webchick Exp $ diff --git a/modules/simpletest/tests/upgrade/drupal-6.bare.database.php b/modules/simpletest/tests/upgrade/drupal-6.bare.database.php index 65c9bc57..40c75627 100644 --- a/modules/simpletest/tests/upgrade/drupal-6.bare.database.php +++ b/modules/simpletest/tests/upgrade/drupal-6.bare.database.php @@ -1,5 +1,4 @@ <?php -// $Id: drupal-6.bare.database.php,v 1.1 2010/06/28 02:05:47 webchick Exp $ /** * @file @@ -7902,7 +7901,7 @@ db_insert('users')->fields(array( 'access' => '0', 'login' => '0', 'status' => '0', - 'timezone' => NULL, + 'timezone' => '-21600', 'language' => '', 'picture' => '', 'init' => '', @@ -7923,7 +7922,7 @@ db_insert('users')->fields(array( 'access' => '1277671612', 'login' => '1277671612', 'status' => '1', - 'timezone' => NULL, + 'timezone' => '-21600', 'language' => '', 'picture' => '', 'init' => 'admin@example.com', diff --git a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php index 5fd96f1f..a9162813 100644 --- a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php +++ b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php @@ -1,5 +1,4 @@ <?php -// $Id: drupal-6.filled.database.php,v 1.6 2010/12/30 03:44:39 webchick Exp $ /** * @file diff --git a/modules/simpletest/tests/upgrade/drupal-6.forum.database.php b/modules/simpletest/tests/upgrade/drupal-6.forum.database.php new file mode 100644 index 00000000..07dfcb34 --- /dev/null +++ b/modules/simpletest/tests/upgrade/drupal-6.forum.database.php @@ -0,0 +1,261 @@ +<?php +// $Id$ + +/** + * Database additions for forum tests. + */ + +db_create_table('forum', array( + 'fields' => array( + 'nid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'vid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'tid' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'nid' => array( + 'nid', + ), + 'tid' => array( + 'tid', + ), + ), + 'primary key' => array( + 'vid', + ), + 'module' => 'forum', + 'name' => 'forum', +)); +db_insert('forum')->fields(array( + 'nid', + 'vid', + 'tid', +)) +->values(array( + 'nid' => '51', + 'vid' => '61', + 'tid' => '81', +)) +->execute(); + +db_insert('node')->fields(array( + 'nid', + 'vid', + 'type', + 'language', + 'title', + 'uid', + 'status', + 'created', + 'changed', + 'comment', + 'promote', + 'moderate', + 'sticky', + 'tnid', + 'translate', +)) +->values(array( + 'nid' => '51', + 'vid' => '61', + 'type' => 'forum', + 'language' => '', + 'title' => 'Apples', + 'uid' => '1', + 'status' => '1', + 'created' => '1298363952', + 'changed' => '1298363952', + 'comment' => '2', + 'promote' => '0', + 'moderate' => '0', + 'sticky' => '0', + 'tnid' => '0', + 'translate' => '0', +)) +->execute(); + +db_insert('node_revisions')->fields(array( + 'nid', + 'vid', + 'uid', + 'title', + 'body', + 'teaser', + 'log', + 'timestamp', + 'format', +)) +->values(array( + 'nid' => '51', + 'vid' => '61', + 'uid' => '1', + 'title' => 'Apples', + 'body' => 'A fruit.', + 'teaser' => 'A fruit.', + 'log' => '', + 'timestamp' => '1298363952', + 'format' => '1', +)) +->execute(); + +db_insert('node_comment_statistics')->fields(array( + 'nid', + 'last_comment_timestamp', + 'last_comment_name', + 'last_comment_uid', + 'comment_count', +)) +->values(array( + 'nid' => '51', + 'last_comment_timestamp' => '1298363952', + 'last_comment_name' => NULL, + 'last_comment_uid' => '1', + 'comment_count' => '0', +)) +->execute(); + +db_insert('node_type')->fields(array( + 'type', + 'name', + 'module', + 'description', + 'help', + 'has_title', + 'title_label', + 'has_body', + 'body_label', + 'min_word_count', + 'custom', + 'modified', + 'locked', + 'orig_type', +)) +->values(array( + 'type' => 'forum', + 'name' => 'Forum topic', + 'module' => 'forum', + 'description' => 'A <em>forum topic</em> is the initial post to a new discussion thread within a forum.', + 'help' => '', + 'has_title' => '1', + 'title_label' => 'Subject', + 'has_body' => '1', + 'body_label' => 'Body', + 'min_word_count' => '0', + 'custom' => '0', + 'modified' => '0', + 'locked' => '1', + 'orig_type' => 'forum', +)) +->execute(); + +db_update('system')->fields(array( + 'schema_version' => '6000', + 'status' => '1', +)) +->condition('filename', 'modules/forum/forum.module') +->execute(); + +db_insert('term_data')->fields(array( + 'tid', + 'vid', + 'name', + 'description', + 'weight', +)) +->values(array( + 'tid' => '81', + 'vid' => '101', + 'name' => 'Fruits', + 'description' => 'Fruits.', + 'weight' => '0', +)) +->execute(); + +db_insert('term_hierarchy')->fields(array( + 'tid', + 'parent', +)) +->values(array( + 'tid' => '81', + 'parent' => '0', +)) +->execute(); + +db_insert('term_node')->fields(array( + 'nid', + 'vid', + 'tid', +)) +->values(array( + 'nid' => '51', + 'vid' => '61', + 'tid' => '81', +)) +->execute(); + +db_insert('variable')->fields(array( + 'name', + 'value', +)) +->values(array( + 'name' => 'forum_nav_vocabulary', + 'value' => 's:3:"101";', +)) +->values(array( + 'name' => 'forum_containers', + 'value' => 'a:1:{i:0;s:3:"101";}', +)) +->execute(); + +db_insert('vocabulary')->fields(array( + 'vid', + 'name', + 'description', + 'help', + 'relations', + 'hierarchy', + 'multiple', + 'required', + 'tags', + 'module', + 'weight', +)) +->values(array( + 'vid' => '101', + 'name' => 'Upgrade test for forums', + 'description' => 'Vocabulary used for Forums. The name is changed from the default "Forums" so that the upgrade path may be tested.', + 'help' => '', + 'relations' => '1', + 'hierarchy' => '1', + 'multiple' => '0', + 'required' => '0', + 'tags' => '0', + 'module' => 'forum', + 'weight' => '-10', +)) +->execute(); + +db_insert('vocabulary_node_types')->fields(array( + 'vid', + 'type', +)) +->values(array( + 'vid' => '101', + 'type' => 'forum', +)) +->execute(); + diff --git a/modules/simpletest/tests/upgrade/drupal-6.locale.database.php b/modules/simpletest/tests/upgrade/drupal-6.locale.database.php index e96ca3ab..c8af6712 100644 --- a/modules/simpletest/tests/upgrade/drupal-6.locale.database.php +++ b/modules/simpletest/tests/upgrade/drupal-6.locale.database.php @@ -1,5 +1,4 @@ <?php -// $Id: drupal-6.locale.database.php,v 1.1 2010/10/05 20:04:19 webchick Exp $ /** * Database additions for locale tests. diff --git a/modules/simpletest/tests/upgrade/drupal-6.upload.database.php b/modules/simpletest/tests/upgrade/drupal-6.upload.database.php index ef72861c..493483f3 100644 --- a/modules/simpletest/tests/upgrade/drupal-6.upload.database.php +++ b/modules/simpletest/tests/upgrade/drupal-6.upload.database.php @@ -1,5 +1,4 @@ <?php -// $Id: drupal-6.upload.database.php,v 1.2 2010/11/13 01:48:14 dries Exp $ db_insert('files')->fields(array( 'fid', diff --git a/modules/simpletest/tests/upgrade/upgrade.comment.test b/modules/simpletest/tests/upgrade/upgrade.comment.test index ebf70304..5fcf0b4b 100644 --- a/modules/simpletest/tests/upgrade/upgrade.comment.test +++ b/modules/simpletest/tests/upgrade/upgrade.comment.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.comment.test,v 1.1 2010/09/11 21:52:59 webchick Exp $ /** * Upgrade test for comment.module. diff --git a/modules/simpletest/tests/upgrade/upgrade.filter.test b/modules/simpletest/tests/upgrade/upgrade.filter.test index e63fddb6..86248b74 100644 --- a/modules/simpletest/tests/upgrade/upgrade.filter.test +++ b/modules/simpletest/tests/upgrade/upgrade.filter.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.filter.test,v 1.1 2010/11/09 17:43:10 webchick Exp $ /** * Upgrade test for filter format identifiers. diff --git a/modules/simpletest/tests/upgrade/upgrade.forum.test b/modules/simpletest/tests/upgrade/upgrade.forum.test new file mode 100644 index 00000000..827988da --- /dev/null +++ b/modules/simpletest/tests/upgrade/upgrade.forum.test @@ -0,0 +1,61 @@ +<?php +// $Id$ + +/** + * Upgrade test for forum.module. + */ +class ForumUpgradePathTestCase extends UpgradePathTestCase { + public static function getInfo() { + return array( + 'name' => 'Forum upgrade path', + 'description' => 'Upgrade path tests for the Forum module.', + 'group' => 'Upgrade path', + ); + } + + public function setUp() { + // Path to the database dump files. + $this->databaseDumpFiles = array( + drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php', + drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.forum.database.php', + ); + parent::setUp(); + + $this->uninstallModulesExcept(array('comment', 'forum', 'taxonomy')); + } + + /** + * Test a successful upgrade (no negotiation). + */ + public function testForumUpgrade() { + $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + + // Work around http://drupal.org/node/931512 + $this->drupalPost('admin/structure/types/manage/forum/fields', array(), t('Save')); + + // The D6 database forum vocabulary contains the term "Fruits" with id 81. + $tid = 81; + $this->drupalGet("forum/$tid"); + + // There is one forum topic in Fruits, with the title "Apples". + $this->clickLink('Apples'); + $this->clickLink('Edit'); + + // Add a forum topic "Bananas" to the "Fruits" forum. + $edit = array( + 'title' => $title = 'Bananas', + 'body[' . LANGUAGE_NONE . '][0][value]' => $body = 'It is another fruit.', + ); + $this->drupalPost("node/add/forum/$tid", $edit, t('Save')); + $type = t('Forum topic'); + $this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was created')); + + // Retrieve node object, ensure that the topic was created and in the proper forum. + $node = $this->drupalGetNodeByTitle($title); + $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title))); + $this->assertEqual($node->taxonomy_forums[LANGUAGE_NONE][0]['tid'], $tid, 'Saved forum topic was in the expected forum'); + + $this->drupalGet("forum/$tid"); + $this->assertText('Bananas'); + } +} diff --git a/modules/simpletest/tests/upgrade/upgrade.locale.test b/modules/simpletest/tests/upgrade/upgrade.locale.test index 2d83acdb..aec559de 100644 --- a/modules/simpletest/tests/upgrade/upgrade.locale.test +++ b/modules/simpletest/tests/upgrade/upgrade.locale.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.locale.test,v 1.1 2010/10/06 20:38:29 webchick Exp $ /** * Upgrade test for locale.module. diff --git a/modules/simpletest/tests/upgrade/upgrade.node.test b/modules/simpletest/tests/upgrade/upgrade.node.test index 2b79579d..163dbef5 100644 --- a/modules/simpletest/tests/upgrade/upgrade.node.test +++ b/modules/simpletest/tests/upgrade/upgrade.node.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.node.test,v 1.4 2010/12/18 02:04:36 dries Exp $ /** * Upgrade test for node bodies. diff --git a/modules/simpletest/tests/upgrade/upgrade.poll.test b/modules/simpletest/tests/upgrade/upgrade.poll.test index b1f41eb1..9bbbf90a 100644 --- a/modules/simpletest/tests/upgrade/upgrade.poll.test +++ b/modules/simpletest/tests/upgrade/upgrade.poll.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.poll.test,v 1.4 2010/09/13 05:50:09 webchick Exp $ /** * Upgrade test for poll.module. diff --git a/modules/simpletest/tests/upgrade/upgrade.taxonomy.test b/modules/simpletest/tests/upgrade/upgrade.taxonomy.test index b3f795ae..dadb98e5 100644 --- a/modules/simpletest/tests/upgrade/upgrade.taxonomy.test +++ b/modules/simpletest/tests/upgrade/upgrade.taxonomy.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.taxonomy.test,v 1.6 2010/10/06 21:53:41 webchick Exp $ /** * Test taxonomy upgrades. diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test index 4738e5d3..8a3da818 100644 --- a/modules/simpletest/tests/upgrade/upgrade.test +++ b/modules/simpletest/tests/upgrade/upgrade.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.test,v 1.12 2010/12/28 21:46:23 webchick Exp $ /** * Perform end-to-end tests of the upgrade path. diff --git a/modules/simpletest/tests/upgrade/upgrade.upload.test b/modules/simpletest/tests/upgrade/upgrade.upload.test index dd02d3ab..e3e1dc21 100644 --- a/modules/simpletest/tests/upgrade/upgrade.upload.test +++ b/modules/simpletest/tests/upgrade/upgrade.upload.test @@ -1,5 +1,4 @@ <?php -// $Id: upgrade.upload.test,v 1.3 2010/11/21 20:35:10 webchick Exp $ /** * Upgrade test for comment.module. diff --git a/modules/simpletest/tests/url_alter_test.info b/modules/simpletest/tests/url_alter_test.info index 0455c0d5..adea384c 100644 --- a/modules/simpletest/tests/url_alter_test.info +++ b/modules/simpletest/tests/url_alter_test.info @@ -1,4 +1,3 @@ -; $Id: url_alter_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = Url_alter tests description = A support modules for url_alter hook testing. core = 7.x @@ -6,8 +5,8 @@ package = Testing version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/url_alter_test.install b/modules/simpletest/tests/url_alter_test.install index 9ac09e07..6e09ab58 100644 --- a/modules/simpletest/tests/url_alter_test.install +++ b/modules/simpletest/tests/url_alter_test.install @@ -1,5 +1,4 @@ <?php -// $Id: url_alter_test.install,v 1.1 2009/10/24 05:13:44 webchick Exp $ /** * Impelement hook_install(). diff --git a/modules/simpletest/tests/url_alter_test.module b/modules/simpletest/tests/url_alter_test.module index 4f21e449..e229ab98 100644 --- a/modules/simpletest/tests/url_alter_test.module +++ b/modules/simpletest/tests/url_alter_test.module @@ -1,5 +1,4 @@ <?php -// $Id: url_alter_test.module,v 1.3 2010/01/29 22:40:41 dries Exp $ /** * @file diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test index 3a3fe343..1b5bff38 100644 --- a/modules/simpletest/tests/xmlrpc.test +++ b/modules/simpletest/tests/xmlrpc.test @@ -1,5 +1,4 @@ <?php -// $Id: xmlrpc.test,v 1.21 2010/10/02 01:22:41 dries Exp $ /** * Perform basic XML-RPC tests that do not require addition callbacks. @@ -42,6 +41,16 @@ class XMLRPCBasicTestCase extends DrupalWebTestCase { $this->assertEqual($count, count($minimum), 'system.listMethods returned at least the minimum listing'); } + /** + * Ensure that system.methodSignature returns an array of signatures. + */ + protected function testMethodSignature() { + $url = url(NULL, array('absolute' => TRUE)) . 'xmlrpc.php'; + $signature = xmlrpc($url, array('system.methodSignature' => array('system.listMethods'))); + $this->assert(is_array($signature) && !empty($signature) && is_array($signature[0]), + t('system.methodSignature returns an array of signature arrays.')); + } + /** * Ensure that XML-RPC correctly handles invalid messages when parsing. */ diff --git a/modules/simpletest/tests/xmlrpc_test.info b/modules/simpletest/tests/xmlrpc_test.info index 7c94c797..92a93578 100644 --- a/modules/simpletest/tests/xmlrpc_test.info +++ b/modules/simpletest/tests/xmlrpc_test.info @@ -1,4 +1,3 @@ -; $Id: xmlrpc_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "XML-RPC Test" description = "Support module for XML-RPC tests according to the validator1 specification." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/simpletest/tests/xmlrpc_test.module b/modules/simpletest/tests/xmlrpc_test.module index f226aff6..db8f113b 100644 --- a/modules/simpletest/tests/xmlrpc_test.module +++ b/modules/simpletest/tests/xmlrpc_test.module @@ -1,5 +1,4 @@ <?php -// $Id: xmlrpc_test.module,v 1.7 2010/10/02 01:22:41 dries Exp $ function xmlrpc_test_arrayOfStructsTest($array) { $sum = 0; diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc index 0885cde5..6606b8b9 100644 --- a/modules/statistics/statistics.admin.inc +++ b/modules/statistics/statistics.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: statistics.admin.inc,v 1.40 2010/06/26 21:32:20 dries Exp $ /** * @file diff --git a/modules/statistics/statistics.info b/modules/statistics/statistics.info index 1127b2fd..a1339f24 100644 --- a/modules/statistics/statistics.info +++ b/modules/statistics/statistics.info @@ -1,4 +1,3 @@ -; $Id: statistics.info,v 1.12 2010/12/20 19:59:43 webchick Exp $ name = Statistics description = Logs access statistics for your site. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = statistics.test configure = admin/config/system/statistics -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/statistics/statistics.install b/modules/statistics/statistics.install index 7654c2de..d5855a77 100644 --- a/modules/statistics/statistics.install +++ b/modules/statistics/statistics.install @@ -1,5 +1,4 @@ <?php -// $Id: statistics.install,v 1.29 2011/01/02 17:26:39 webchick Exp $ /** * @file diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 3d0344ec..6b7be8ac 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -1,5 +1,4 @@ <?php -// $Id: statistics.module,v 1.340 2010/11/14 21:04:45 webchick Exp $ /** * @file diff --git a/modules/statistics/statistics.pages.inc b/modules/statistics/statistics.pages.inc index b8b2cddb..bb31f983 100644 --- a/modules/statistics/statistics.pages.inc +++ b/modules/statistics/statistics.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: statistics.pages.inc,v 1.23 2010/01/09 21:54:01 webchick Exp $ /** * @file diff --git a/modules/statistics/statistics.test b/modules/statistics/statistics.test index d80e03b5..126828f4 100644 --- a/modules/statistics/statistics.test +++ b/modules/statistics/statistics.test @@ -1,5 +1,9 @@ <?php -// $Id: statistics.test,v 1.24 2010/12/08 06:43:07 webchick Exp $ + +/** + * @file + * Tests for statistics.module. + */ /** * Sets up a base class for the Statistics module. @@ -434,7 +438,7 @@ class StatisticsTokenReplaceTestCase extends StatisticsTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('node' => $node), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Statistics token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Statistics token %token replaced.', array('%token' => $input))); } } } diff --git a/modules/statistics/statistics.tokens.inc b/modules/statistics/statistics.tokens.inc index 03d7ac81..c2c8fc3c 100644 --- a/modules/statistics/statistics.tokens.inc +++ b/modules/statistics/statistics.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: statistics.tokens.inc,v 1.4 2010/04/20 09:48:06 webchick Exp $ /** * @file diff --git a/modules/syslog/syslog.info b/modules/syslog/syslog.info index 72a6472c..a0467d49 100644 --- a/modules/syslog/syslog.info +++ b/modules/syslog/syslog.info @@ -1,4 +1,3 @@ -; $Id: syslog.info,v 1.7 2010/12/20 19:59:43 webchick Exp $ name = Syslog description = Logs and records system events to syslog. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x files[] = syslog.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/syslog/syslog.install b/modules/syslog/syslog.install index 969b1b64..12ff4fb2 100644 --- a/modules/syslog/syslog.install +++ b/modules/syslog/syslog.install @@ -1,5 +1,4 @@ <?php -// $Id: syslog.install,v 1.1 2010/08/18 01:54:36 dries Exp $ /** * @file diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module index 83fc512a..c4ee3825 100644 --- a/modules/syslog/syslog.module +++ b/modules/syslog/syslog.module @@ -1,5 +1,4 @@ <?php -// $Id: syslog.module,v 1.38 2010/09/26 23:31:36 dries Exp $ /** * @file diff --git a/modules/syslog/syslog.test b/modules/syslog/syslog.test index ec794207..691fb7de 100644 --- a/modules/syslog/syslog.test +++ b/modules/syslog/syslog.test @@ -1,5 +1,9 @@ <?php -// $Id: syslog.test,v 1.14 2010/08/05 23:53:39 webchick Exp $ + +/** + * @file + * Tests for syslog.module. + */ class SyslogTestCase extends DrupalWebTestCase { public static function getInfo() { diff --git a/modules/system/html.tpl.php b/modules/system/html.tpl.php index 89435a7d..0e012774 100644 --- a/modules/system/html.tpl.php +++ b/modules/system/html.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: html.tpl.php,v 1.6 2010/11/24 03:30:59 webchick Exp $ /** * @file diff --git a/modules/system/image.gd.inc b/modules/system/image.gd.inc index bd38c8cb..a3f76d4a 100644 --- a/modules/system/image.gd.inc +++ b/modules/system/image.gd.inc @@ -1,5 +1,4 @@ <?php -// $Id: image.gd.inc,v 1.18 2010/10/28 02:27:09 dries Exp $ /** * @file diff --git a/modules/system/maintenance-page.tpl.php b/modules/system/maintenance-page.tpl.php index ac34c52e..31de3bb2 100644 --- a/modules/system/maintenance-page.tpl.php +++ b/modules/system/maintenance-page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: maintenance-page.tpl.php,v 1.10 2010/11/24 03:30:59 webchick Exp $ /** * @file diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php index 1092da04..8ffe82aa 100644 --- a/modules/system/page.tpl.php +++ b/modules/system/page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: page.tpl.php,v 1.47 2010/11/05 01:25:33 dries Exp $ /** * @file diff --git a/modules/system/region.tpl.php b/modules/system/region.tpl.php index be8e25c6..b29e24f0 100644 --- a/modules/system/region.tpl.php +++ b/modules/system/region.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: region.tpl.php,v 1.3 2010/09/23 17:53:09 dries Exp $ /** * @file diff --git a/modules/system/system.admin-rtl.css b/modules/system/system.admin-rtl.css index bcc98e1f..362a406c 100644 --- a/modules/system/system.admin-rtl.css +++ b/modules/system/system.admin-rtl.css @@ -1,4 +1,3 @@ -/* $Id: system.admin-rtl.css,v 1.3 2010/10/09 05:18:53 webchick Exp $ */ /** * @file diff --git a/modules/system/system.admin.css b/modules/system/system.admin.css index 80405cf2..43340b58 100644 --- a/modules/system/system.admin.css +++ b/modules/system/system.admin.css @@ -1,4 +1,3 @@ -/* $Id: system.admin.css,v 1.6 2010/10/15 04:40:41 webchick Exp $ */ /** * @file diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 15489779..9e7d69dd 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: system.admin.inc,v 1.327 2011/01/04 04:02:29 webchick Exp $ /** * @file @@ -55,6 +54,7 @@ function system_admin_config_page() { /** * Provide a single block from the administration menu as a page. + * * This function is often a destination for these blocks. * For example, 'admin/structure/types' needs to have a destination to be valid * in the Drupal menu system, but too much information there might be @@ -158,7 +158,6 @@ function system_themes_page() { 'alt' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])), 'title' => t('Screenshot for !theme theme', array('!theme' => $theme->info['name'])), 'attributes' => array('class' => array('screenshot')), - 'getsize' => FALSE, ); break; } @@ -350,6 +349,14 @@ function system_theme_default() { } // Set the default theme. variable_set('theme_default', $theme); + + // Rebuild the menu. This duplicates the menu_rebuild() in theme_enable(). + // However, modules must know the current default theme in order to use + // this information in hook_menu() or hook_menu_alter() implementations, + // and doing the variable_set() before the theme_enable() could result + // in a race condition where the theme is default but not enabled. + menu_rebuild(); + // The status message depends on whether an admin theme is currently in use: // a value of 0 means the admin theme is set to be the default theme. $admin_theme = variable_get('admin_theme', 0); @@ -1030,7 +1037,7 @@ function system_modules_confirm_form($modules, $storage) { '@module' => $name, '@depends' => implode(', ', $info['depends']), ); - $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following module will be disabled: @depends.', $t_argument); + $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument); } $form['text'] = array('#markup' => theme('item_list', array('items' => $items))); @@ -1182,11 +1189,6 @@ function system_modules_submit($form, &$form_state) { } $form_state['redirect'] = 'admin/modules'; - - // Notify locale module about module changes, so translations can be - // imported. This might start a batch, and only return to the redirect - // path after that. - module_invoke('locale', 'system_update', $actions['install']); } /** diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 141f6aa6..c7db6f1d 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1,5 +1,4 @@ <?php -// $Id: system.api.php,v 1.225 2011/01/04 00:58:30 webchick Exp $ /** * @file @@ -76,6 +75,7 @@ function hook_hook_info_alter(&$hooks) { * Leave blank to use the DrupalDefaultEntityController implementation. * - base table: (used by DrupalDefaultEntityController) The name of the * entity type's base table. + * - revision table: The name of the entity type's revision table (if any). * - static cache: (used by DrupalDefaultEntityController) FALSE to disable * static caching of entities during a page request. Defaults to TRUE. * - field cache: (used by Field API loading and saving of field data) FALSE @@ -87,17 +87,18 @@ function hook_hook_info_alter(&$hooks) { * - uri callback: A function taking an entity as argument and returning the * uri elements of the entity, e.g. 'path' and 'options'. The actual entity * uri can be constructed by passing these elements to url(). - * - label callback: (optional) A function taking an entity as argument and - * returning the label of the entity. The entity label is the main string - * associated with an entity; for example, the title of a node or the - * subject of a comment. If there is an entity object property that defines - * the label, use the 'label' element of the 'entity keys' return - * value component to provide this information (see below). If more complex - * logic is needed to determine the label of an entity, you can instead - * specify a callback function here, which will be called to determine the - * entity label. See also the entity_label() function, which implements this - * logic. - * - fieldable: Set to TRUE if you want your entity type to be fieldable. + * - label callback: (optional) A function taking an entity and an entity type + * as arguments and returning the label of the entity. The entity label is + * the main string associated with an entity; for example, the title of a + * node or the subject of a comment. If there is an entity object property + * that defines the label, use the 'label' element of the 'entity keys' + * return value component to provide this information (see below). If more + * complex logic is needed to determine the label of an entity, you can + * instead specify a callback function here, which will be called to + * determine the entity label. See also the entity_label() function, which + * implements this logic. + * - fieldable: Set to TRUE if you want your entity type to accept fields + * being attached to it. * - translation: An associative array of modules registered as field * translation handlers. Array keys are the module names, array values * can be any data structure the module uses to provide field translation. @@ -123,12 +124,15 @@ function hook_hook_info_alter(&$hooks) { * build the label, a 'label callback' should be defined instead (see * the 'label callback' section above for details). * - bundle keys: An array describing how the Field API can extract the - * information it needs from the bundle objects for this type (e.g - * $vocabulary objects for terms; not applicable for nodes). This entry can - * be omitted if this type's bundles do not exist as standalone objects. - * Elements: - * - bundle: The name of the property that contains the name of the bundle - * object. + * information it needs from the bundle objects for this type. This entry + * is required if the 'path' provided in the 'bundles'/'admin' section + * identifies the bundle using a named menu placeholder whose loader + * callback returns an object (e.g., $vocabulary for taxonomy terms, or + * $node_type for nodes). If the path does not include the bundle, or the + * bundle is just a string rather than an automatically loaded object, then + * this can be omitted. Elements: + * - bundle: The name of the property of the bundle object that contains + * the name of the bundle object. * - bundles: An array describing all bundles for this object type. Keys are * bundles machine names, as found in the objects' 'bundle' property * (defined in the 'entity keys' entry above). Elements: @@ -142,9 +146,9 @@ function hook_hook_info_alter(&$hooks) { * Elements: * - path: the path of the bundle's main administration page, as defined * in hook_menu(). If the path includes a placeholder for the bundle, - * the 'bundle argument', 'bundle helper' and 'real path' keys below - * are required. - * - bundle argument: The position of the placeholder in 'path', if any. + * the 'bundle argument' and 'real path' keys below are required. + * - bundle argument: The position of the bundle placeholder in 'path', if + * any. * - real path: The actual path (no placeholder) of the bundle's main * administration page. This will be used to generate links. * - access callback: As in hook_menu(). 'user_access' will be assumed if @@ -498,8 +502,10 @@ function hook_admin_paths_alter(&$paths) { * The entities keyed by entity ID. * @param $type * The type of entities being loaded (i.e. node, user, comment). + * @param $langcode + * The language to display the entity in. */ -function hook_entity_prepare_view($entities, $type) { +function hook_entity_prepare_view($entities, $type, $langcode) { // Load a specific node into the user object for later theming. if ($type == 'user') { $nodes = mymodule_get_user_nodes(array_keys($entities)); @@ -512,8 +518,6 @@ function hook_entity_prepare_view($entities, $type) { /** * Perform periodic actions. * - * This hook will only be called if cron.php is run (e.g. by crontab). - * * Modules that require some commands to be executed periodically can * implement hook_cron(). The engine will then call the hook whenever a cron * run happens, as defined by the administrator. Typical tasks managed by @@ -649,7 +653,7 @@ function hook_element_info() { * A module may implement this hook in order to alter the element type defaults * defined by a module. * - * @param &$type + * @param $type * All element type defaults as collected by hook_element_info(). * * @see hook_element_info() @@ -821,7 +825,7 @@ function hook_css_alter(&$css) { } /** - * Alter the commands that are sent to the user through the AJAX framework. + * Alter the commands that are sent to the user through the Ajax framework. * * @param $commands * An array of all commands that will be sent to the user. @@ -871,7 +875,7 @@ function hook_page_build(&$page) { * * This hook is invoked by menu_get_item() and allows for run-time alteration of router * information (page_callback, title, and so on) before it is translated and checked for - * access. The passed in $router_item is statically cached for the current request, so this + * access. The passed-in $router_item is statically cached for the current request, so this * hook is only invoked once for any router item that is retrieved via menu_get_item(). * * Usually, modules will only want to inspect the router item and conditionally @@ -922,6 +926,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * $items['abc/def'] = array( * 'page callback' => 'mymodule_abc_view', * ); + * return $items; * } * * function mymodule_abc_view($ghi = 0, $jkl = '') { @@ -950,6 +955,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * 'page callback' => 'mymodule_abc_view', * 'page arguments' => array(1, 'foo'), * ); + * return $items; * } * @endcode * When path 'abc/def' is requested, the page callback function will get 'def' @@ -1836,7 +1842,7 @@ function hook_mail_alter(&$message) { * hook in order to reorder the implementing modules, which are otherwise * ordered by the module's system weight. * - * @param &$implementations + * @param $implementations * An array keyed by the module's name. The value of each item corresponds * to a $group, which is usually FALSE, unless the implementation is in a * file named $module.$group.inc. @@ -1863,7 +1869,7 @@ function hook_module_implements_alter(&$implementations, $hook) { * add to or alter the data generated by reading the .info file with * drupal_parse_info_file(). * - * @param &$info + * @param $info * The .info file contents, passed by reference so that it can be altered. * @param $file * Full information about the module or theme, including $file->name, and @@ -1904,9 +1910,19 @@ function hook_system_info_alter(&$info, $file, $type) { * have inherent security risks across a variety of potential use cases * (for example, the "administer filters" and "bypass node access" * permissions provided by Drupal core). When set to TRUE, a standard - * warning message defined in user_admin_permissions() will be associated - * with the permission and displayed with it on the permission - * administration page. Defaults to FALSE. + * warning message defined in user_admin_permissions() and output via + * theme_user_permission_description() will be associated with the + * permission and displayed with it on the permission administration page. + * Defaults to FALSE. + * - warning: (optional) A translated warning message to display for this + * permission on the permission administration page. This warning overrides + * the automatic warning generated by 'restrict access' being set to TRUE. + * This should rarely be used, since it is important for all permissions to + * have a clear, consistent security warning that is the same across the + * site. Use the 'description' key instead to provide any information that + * is specific to the permission you are defining. + * + * @see theme_user_permission_description() */ function hook_permission() { return array( @@ -2353,7 +2369,7 @@ function hook_flush_caches() { * enable hooks are invoked. * * @param $modules - * An array of the installed modules. + * An array of the modules that were installed. * * @see module_enable() * @see hook_modules_enabled() @@ -2375,7 +2391,7 @@ function hook_modules_installed($modules) { * invoked. * * @param $modules - * An array of the enabled modules. + * An array of the modules that were enabled. * * @see hook_enable() * @see hook_modules_installed() @@ -2396,7 +2412,7 @@ function hook_modules_enabled($modules) { * is only called on the module actually being disabled. * * @param $modules - * An array of the disabled modules. + * An array of the modules that were disabled. * * @see hook_disable() * @see hook_modules_uninstalled() @@ -2414,11 +2430,11 @@ function hook_modules_disabled($modules) { * modules a chance to perform actions when a module is uninstalled, whereas * hook_uninstall() is only called on the module actually being uninstalled. * - * It is recommended that you implement this module if your module - * stores data that may have been set by other modules. + * It is recommended that you implement this hook if your module stores + * data that may have been set by other modules. * * @param $modules - * An array of the uninstalled modules. + * An array of the modules that were uninstalled. * * @see hook_uninstall() * @see hook_modules_disabled() @@ -2547,7 +2563,7 @@ function hook_file_load($files) { * * @see file_validate() */ -function hook_file_validate(&$file) { +function hook_file_validate($file) { $errors = array(); if (empty($file->filename)) { @@ -2747,9 +2763,10 @@ function hook_file_url_alter(&$uri) { /** * Check installation requirements and do status reporting. * - * This hook has two closely related uses, determined by the $phase argument: - * checking installation requirements ($phase == 'install') - * and status reporting ($phase == 'runtime'). + * This hook has three closely related uses, determined by the $phase argument: + * - Checking installation requirements ($phase == 'install'). + * - Checking update requirements ($phase == 'update'). + * - Status reporting ($phase == 'runtime'). * * Note that this hook, like all others dealing with installation and updates, * must reside in a module_name.install file, or it will not properly abort @@ -3502,11 +3519,11 @@ function hook_install_tasks() { /** * Change the page the user is sent to by drupal_goto(). * - * @param &$path + * @param $path * A Drupal path or a full URL. - * @param &$options + * @param $options * An associative array of additional URL options to pass to url(). - * @param &$http_response_code + * @param $http_response_code * The HTTP status code to use for the redirection. See drupal_goto() for more * information. */ @@ -3889,7 +3906,7 @@ function hook_date_formats_alter(&$formats) { function hook_page_delivery_callback_alter(&$callback) { // jQuery sets a HTTP_X_REQUESTED_WITH header of 'XMLHttpRequest'. // If a page would normally be delivered as an html page, and it is called - // from jQuery, deliver it instead as an AJAX response. + // from jQuery, deliver it instead as an Ajax response. if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' && $callback == 'drupal_deliver_html_page') { $callback = 'ajax_deliver'; } @@ -3975,7 +3992,7 @@ function hook_url_outbound_alter(&$path, &$options, $original_path) { * displayed. Can be used to ensure user privacy in situations where * $account->name is too revealing. * - * @param &$name + * @param $name * The string that format_username() will return. * * @param $account diff --git a/modules/system/system.archiver.inc b/modules/system/system.archiver.inc index 903e4688..c37f07da 100644 --- a/modules/system/system.archiver.inc +++ b/modules/system/system.archiver.inc @@ -1,5 +1,4 @@ <?php -// $Id: system.archiver.inc,v 1.6 2010/12/30 22:33:04 webchick Exp $ /** * @file diff --git a/modules/system/system.base-rtl.css b/modules/system/system.base-rtl.css index 79e13d97..9099c9d7 100644 --- a/modules/system/system.base-rtl.css +++ b/modules/system/system.base-rtl.css @@ -1,4 +1,3 @@ -/* $Id: system.base-rtl.css,v 1.3 2010/09/27 03:56:14 webchick Exp $ */ /** * @file diff --git a/modules/system/system.base.css b/modules/system/system.base.css index 3ed4e080..a6748de4 100644 --- a/modules/system/system.base.css +++ b/modules/system/system.base.css @@ -1,4 +1,3 @@ -/* $Id: system.base.css,v 1.4 2011/01/03 07:04:48 webchick Exp $ */ /** * @file diff --git a/modules/system/system.cron.js b/modules/system/system.cron.js index 869d806c..af17dab5 100644 --- a/modules/system/system.cron.js +++ b/modules/system/system.cron.js @@ -1,4 +1,3 @@ -// $Id: system.cron.js,v 1.1 2009/12/15 08:45:32 dries Exp $ (function ($) { /** diff --git a/modules/system/system.info b/modules/system/system.info index cb84b7b2..e54331f5 100644 --- a/modules/system/system.info +++ b/modules/system/system.info @@ -1,4 +1,3 @@ -; $Id: system.info,v 1.21 2010/12/20 19:59:43 webchick Exp $ name = System description = Handles general site configuration for administrators. package = Core @@ -13,8 +12,8 @@ files[] = system.test required = TRUE configure = admin/config/system -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/system/system.install b/modules/system/system.install index fa2c3fe9..e0674446 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1,5 +1,4 @@ <?php -// $Id: system.install,v 1.532 2011/01/02 17:26:39 webchick Exp $ /** * @file @@ -33,7 +32,7 @@ function system_requirements($phase) { // is not running the default install profile. $profile = drupal_get_profile(); if ($profile != 'standard') { - $info = install_profile_info($profile); + $info = system_get_info('module', $profile); $requirements['install_profile'] = array( 'title' => $t('Install profile'), 'value' => $t('%profile_name (%profile-%version)', array( @@ -953,33 +952,6 @@ function system_schema() { ), ); - $schema['history'] = array( - 'description' => 'A record of which {users} have read which {node}s.', - 'fields' => array( - 'uid' => array( - 'description' => 'The {users}.uid that read the {node} nid.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'nid' => array( - 'description' => 'The {node}.nid that was read.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'timestamp' => array( - 'description' => 'The Unix timestamp at which the read occurred.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - ), - 'primary key' => array('uid', 'nid'), - 'indexes' => array( - 'nid' => array('nid'), - ), - ); $schema['menu_router'] = array( 'description' => 'Maps paths to various callbacks (access, page and title)', 'fields' => array( @@ -1555,7 +1527,7 @@ function system_schema() { 'default' => '', ), 'type' => array( - 'description' => 'The type of the item, either module, theme, theme_engine, or profile.', + 'description' => 'The type of the item, either module, theme, or theme_engine.', 'type' => 'varchar', 'length' => 12, 'not null' => TRUE, @@ -2972,6 +2944,27 @@ function system_update_7069() { variable_del('site_offline'); } +/** + * Remove the obsolete 'drupal_badge_color' and 'drupal_badge_size' variables. + */ +function system_update_7070() { + variable_del('drupal_badge_color'); + variable_del('drupal_badge_size'); +} + +/** + * Add index missed during upgrade, and fix field default. + */ +function system_update_7071() { + db_drop_index('date_format_type', 'title'); + db_add_index('date_format_type', 'title', array('title')); + db_change_field('registry', 'filename', 'filename', array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + )); +} + /** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. diff --git a/modules/system/system.js b/modules/system/system.js index 09294932..5446d28a 100644 --- a/modules/system/system.js +++ b/modules/system/system.js @@ -1,4 +1,3 @@ -// $Id: system.js,v 1.41 2010/10/13 13:43:21 dries Exp $ (function ($) { /** @@ -114,19 +113,6 @@ Drupal.behaviors.dateTime = { } }; -/** - * Show the powered by Drupal image preview - */ -Drupal.behaviors.poweredByPreview = { - attach: function (context, settings) { - $('#edit-color, #edit-size').change(function () { - var path = settings.basePath + 'misc/' + $('#edit-color').val() + '-' + $('#edit-size').val() + '.png'; - $('img.powered-by-preview').attr('src', path); - }); - } -}; - - /** * Show/hide settings for page caching depending on whether page caching is * enabled or not. diff --git a/modules/system/system.mail.inc b/modules/system/system.mail.inc index 14ba64f5..ef50642c 100644 --- a/modules/system/system.mail.inc +++ b/modules/system/system.mail.inc @@ -1,5 +1,4 @@ <?php -// $Id: system.mail.inc,v 1.2 2010/03/06 12:36:40 dries Exp $ /** * @file diff --git a/modules/system/system.maintenance.css b/modules/system/system.maintenance.css index 2bfbbb6b..5543c2db 100644 --- a/modules/system/system.maintenance.css +++ b/modules/system/system.maintenance.css @@ -1,4 +1,3 @@ -/* $Id: system.maintenance.css,v 1.1 2010/09/19 18:35:42 dries Exp $ */ /** * Update styles diff --git a/modules/system/system.menus-rtl.css b/modules/system/system.menus-rtl.css index d3d3260e..be85245b 100644 --- a/modules/system/system.menus-rtl.css +++ b/modules/system/system.menus-rtl.css @@ -1,4 +1,3 @@ -/* $Id: system.menus-rtl.css,v 1.2 2010/09/25 02:28:14 dries Exp $ */ /** * @file diff --git a/modules/system/system.menus.css b/modules/system/system.menus.css index a2b81b94..514b0295 100644 --- a/modules/system/system.menus.css +++ b/modules/system/system.menus.css @@ -1,4 +1,3 @@ -/* $Id: system.menus.css,v 1.3 2010/11/05 01:25:33 dries Exp $ */ /** * @file diff --git a/modules/system/system.messages-rtl.css b/modules/system/system.messages-rtl.css new file mode 100644 index 00000000..445417b0 --- /dev/null +++ b/modules/system/system.messages-rtl.css @@ -0,0 +1,13 @@ + +/** + * @file + * RTL Styles for system messages. + */ + +div.messages { + background-position: 99% 8px; + padding: 10px 50px 10px 10px; +} +div.messages ul { + margin: 0 1em 0 0; +} diff --git a/modules/system/system.messages.css b/modules/system/system.messages.css index e14e3b23..ffd4e8ef 100644 --- a/modules/system/system.messages.css +++ b/modules/system/system.messages.css @@ -1,4 +1,3 @@ -/* $Id: system.messages.css,v 1.1 2010/09/19 18:35:42 dries Exp $ */ /** * @file diff --git a/modules/system/system.module b/modules/system/system.module index 383dc8a1..5af9ad4e 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1,5 +1,4 @@ <?php -// $Id: system.module,v 1.1003 2011/01/04 00:56:23 webchick Exp $ /** * @file @@ -295,10 +294,10 @@ function system_element_info() { '#theme' => 'page', '#theme_wrappers' => array('html'), ); - // By default, we don't want AJAX commands being rendered in the context of an + // By default, we don't want Ajax commands being rendered in the context of an // HTML page, so we don't provide defaults for #theme or #theme_wrappers. // However, modules can set these properties (for example, to provide an HTML - // debugging page that displays rather than executes AJAX commands). + // debugging page that displays rather than executes Ajax commands). $types['ajax'] = array( '#header' => TRUE, '#commands' => array(), @@ -1079,7 +1078,7 @@ function _system_batch_theme() { * Implements hook_library(). */ function system_library() { - // Drupal's AJAX framework. + // Drupal's Ajax framework. $libraries['drupal.ajax'] = array( 'title' => 'Drupal AJAX', 'website' => 'http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax/7', @@ -2387,9 +2386,14 @@ function _system_rebuild_module_data() { drupal_alter('system_info', $modules[$key]->info, $modules[$key], $type); } - // The install profile is required, if it's a valid module. if (isset($modules[$profile])) { + // The install profile is required, if it's a valid module. $modules[$profile]->info['required'] = TRUE; + // Add a default distribution name if the profile did not provide one. This + // matches the default value used in install_profile_info(). + if (!isset($modules[$profile]->info['distribution_name'])) { + $modules[$profile]->info['distribution_name'] = 'Drupal'; + } } return $modules; @@ -2677,7 +2681,7 @@ function system_region_list($theme_key, $show = REGIONS_ALL) { // If requested, suppress hidden regions. See block_admin_display_form(). foreach ($info['regions'] as $name => $label) { if ($show == REGIONS_ALL || !isset($info['regions_hidden']) || !in_array($name, $info['regions_hidden'])) { - $list[$name] = $label; + $list[$name] = t($label); } } @@ -3451,7 +3455,7 @@ function system_page_alter(&$page) { */ function system_run_automated_cron() { // If the site is not fully installed, suppress the automated cron run. - // Otherwise it could be triggered prematurely by AJAX requests during + // Otherwise it could be triggered prematurely by Ajax requests during // installation. if (($threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0 && variable_get('install_task') == 'done') { $cron_last = variable_get('cron_last', NULL); diff --git a/modules/system/system.queue.inc b/modules/system/system.queue.inc index 3460241d..806015c2 100644 --- a/modules/system/system.queue.inc +++ b/modules/system/system.queue.inc @@ -1,5 +1,4 @@ <?php -// $Id: system.queue.inc,v 1.14 2011/01/03 18:03:54 webchick Exp $ /** * @file diff --git a/modules/system/system.test b/modules/system/system.test index 2043544d..be4e3669 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -1,5 +1,9 @@ <?php -// $Id: system.test,v 1.153 2010/12/01 00:23:36 webchick Exp $ + +/** + * @file + * Tests for system.module. + */ /** * Helper class for module test cases. @@ -1355,7 +1359,7 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase { function setUp() { parent::setUp(); - $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access')); + $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer themes', 'bypass node access', 'administer blocks')); $this->drupalLogin($this->admin_user); $this->node = $this->drupalCreateNode(); } @@ -1439,6 +1443,26 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase { $this->drupalGet('node/add'); $this->assertRaw('themes/bartik', t('Site default theme used on the add content page.')); } + + /** + * Test switching the default theme. + */ + function testSwitchDefaultTheme() { + // Enable "stark" and set it as the default theme. + theme_enable(array('stark')); + $this->drupalGet('admin/appearance'); + $this->clickLink(t('Set default'), 1); + $this->assertTrue(variable_get('theme_default', '') == 'stark', t('Site default theme switched successfully.')); + + // Test the default theme on the secondary links (blocks admin page). + $this->drupalGet('admin/structure/block'); + $this->assertText('Stark(' . t('active tab') . ')', t('Default local task on blocks admin page is the default theme.')); + // Switch back to Bartik and test again to test that the menu cache is cleared. + $this->drupalGet('admin/appearance'); + $this->clickLink(t('Set default'), 0); + $this->drupalGet('admin/structure/block'); + $this->assertText('Bartik(' . t('active tab') . ')', t('Default local task on blocks admin page has changed.')); + } } @@ -1571,13 +1595,13 @@ class TokenReplaceTestCase extends DrupalWebTestCase { // Test that the clear parameter cleans out non-existent tokens. $result = token_replace($source, array('node' => $node), array('language' => $language, 'clear' => TRUE)); - $result = $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens cleared out.'); + $result = $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens cleared out.'); // Test without using the clear parameter (non-existant token untouched). $target .= '[user:name]'; $target .= '[bogus:token]'; $result = token_replace($source, array('node' => $node), array('language' => $language)); - $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens ignored.'); + $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.'); // Check that the results of token_generate are sanitized properly. This does NOT // test the cleanliness of every token -- just that the $sanitize flag is being @@ -1585,10 +1609,39 @@ class TokenReplaceTestCase extends DrupalWebTestCase { // token, [node:title]. $raw_tokens = array('title' => '[node:title]'); $generated = token_generate('node', $raw_tokens, array('node' => $node)); - $this->assertFalse(strcmp($generated['[node:title]'], check_plain($node->title)), t('Token sanitized.')); + $this->assertEqual($generated['[node:title]'], check_plain($node->title), t('Token sanitized.')); $generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE)); - $this->assertFalse(strcmp($generated['[node:title]'], $node->title), t('Unsanitized token generated properly.')); + $this->assertEqual($generated['[node:title]'], $node->title, t('Unsanitized token generated properly.')); + } + + /** + * Test whether token-replacement works in various contexts. + */ + function testSystemTokenRecognition() { + global $language; + + // Generate prefixes and suffixes for the token context. + $tests = array( + array('prefix' => 'this is the ', 'suffix' => ' site'), + array('prefix' => 'this is the', 'suffix' => 'site'), + array('prefix' => '[', 'suffix' => ']'), + array('prefix' => '', 'suffix' => ']]]'), + array('prefix' => '[[[', 'suffix' => ''), + array('prefix' => ':[:', 'suffix' => '--]'), + array('prefix' => '-[-', 'suffix' => ':]:'), + array('prefix' => '[:', 'suffix' => ']'), + array('prefix' => '[site:', 'suffix' => ':name]'), + array('prefix' => '[site:', 'suffix' => ']'), + ); + + // Check if the token is recognized in each of the contexts. + foreach ($tests as $test) { + $input = $test['prefix'] . '[site:name]' . $test['suffix']; + $expected = $test['prefix'] . 'Drupal' . $test['suffix']; + $output = token_replace($input, array(), array('language' => $language)); + $this->assertTrue($output == $expected, t('Token recognized in string %string', array('%string' => $input))); + } } /** @@ -1620,7 +1673,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array(), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized system site information token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized system site information token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1629,7 +1682,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array(), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized system site information token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized system site information token %token replaced.', array('%token' => $input))); } } @@ -1656,7 +1709,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('date' => $date), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Date token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Date token %token replaced.', array('%token' => $input))); } } } @@ -2145,3 +2198,37 @@ class SystemAuthorizeCase extends DrupalWebTestCase { $this->assertText('System Test Username'); } } + +/** + * Test the handling of requests containing 'index.php'. + */ +class SystemIndexPhpTest extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Index.php handling', + 'description' => "Test the handling of requests containing 'index.php'.", + 'group' => 'System', + ); + } + + function setUp() { + parent::setUp(); + } + + /** + * Test index.php handling. + */ + function testIndexPhpHandling() { + $index_php = $GLOBALS['base_url'] . '/index.php'; + + $this->drupalGet($index_php, array('external' => TRUE)); + $this->assertResponse(200, t('Make sure index.php returns a valid page.')); + + $this->drupalGet($index_php, array('external' => TRUE, 'query' => array('q' => 'user'))); + $this->assertResponse(200, t('Make sure index.php?q=user returns a valid page.')); + + $this->drupalGet($index_php .'/user', array('external' => TRUE)); + $this->assertResponse(404, t("Make sure index.php/user returns a 'page not found'.")); + } +} + diff --git a/modules/system/system.theme-rtl.css b/modules/system/system.theme-rtl.css index 3c2794f5..0cd7fa64 100644 --- a/modules/system/system.theme-rtl.css +++ b/modules/system/system.theme-rtl.css @@ -1,4 +1,3 @@ -/* $Id: system.theme-rtl.css,v 1.2 2010/09/25 02:28:14 dries Exp $ */ /** * @file diff --git a/modules/system/system.theme.css b/modules/system/system.theme.css index 09f249c8..73cebee7 100644 --- a/modules/system/system.theme.css +++ b/modules/system/system.theme.css @@ -1,4 +1,3 @@ -/* $Id: system.theme.css,v 1.3 2010/09/27 01:12:45 dries Exp $ */ /** * @file diff --git a/modules/system/system.tokens.inc b/modules/system/system.tokens.inc index d07c4d52..27d7dfdb 100644 --- a/modules/system/system.tokens.inc +++ b/modules/system/system.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: system.tokens.inc,v 1.13 2010/10/28 01:33:41 dries Exp $ /** * @file diff --git a/modules/system/system.updater.inc b/modules/system/system.updater.inc index f3d6fb97..0df1ad95 100644 --- a/modules/system/system.updater.inc +++ b/modules/system/system.updater.inc @@ -1,5 +1,4 @@ <?php -// $Id: system.updater.inc,v 1.12 2011/01/04 03:06:24 webchick Exp $ /** * @file diff --git a/modules/system/theme.api.php b/modules/system/theme.api.php index 0699f53a..7fee81cb 100644 --- a/modules/system/theme.api.php +++ b/modules/system/theme.api.php @@ -1,5 +1,4 @@ <?php -// $Id: theme.api.php,v 1.5 2011/01/03 18:03:54 webchick Exp $ /** * @defgroup themeable Default theme implementations @@ -100,6 +99,8 @@ function hook_form_system_theme_settings_alter(&$form, &$form_state) { * It is called for all invocations of theme(), to allow modules to add to * or override variables for all theme hooks. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). * @param $hook @@ -146,6 +147,8 @@ function hook_preprocess(&$variables, $hook) { * hook. It should only be used if a module needs to override or add to the * theme preprocessing for a theme hook it didn't define. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). */ @@ -162,6 +165,8 @@ function hook_preprocess_HOOK(&$variables) { * It is called for all invocations of theme(), to allow modules to add to * or override variables for all theme hooks. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). * @param $hook @@ -188,6 +193,8 @@ function hook_process(&$variables, $hook) { * hook. It should only be used if a module needs to override or add to the * theme processing for a theme hook it didn't define. * + * For more detailed information, see theme(). + * * @param $variables * The variables array (modify in place). */ diff --git a/modules/taxonomy/taxonomy-term.tpl.php b/modules/taxonomy/taxonomy-term.tpl.php index ec19b36e..b515a9be 100644 --- a/modules/taxonomy/taxonomy-term.tpl.php +++ b/modules/taxonomy/taxonomy-term.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy-term.tpl.php,v 1.1 2010/02/10 06:28:10 webchick Exp $ /** * @file diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index ae5e85e4..d83f5d36 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy.admin.inc,v 1.116 2010/11/20 06:49:47 webchick Exp $ /** * @file @@ -100,10 +99,11 @@ function theme_taxonomy_overview_vocabularies($variables) { } /** - * Display form for adding and editing vocabularies. + * Form builder for the vocabulary editing form. * * @ingroup forms * @see taxonomy_form_vocabulary_submit() + * @see taxonomy_form_vocabulary_validate() */ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) { // During initial form build, add the entity to the form state for use @@ -147,7 +147,7 @@ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) { $form['machine_name'] = array( '#type' => 'machine_name', '#default_value' => $vocabulary->machine_name, - '#maxlength' => 21, + '#maxlength' => 255, '#machine_name' => array( 'exists' => 'taxonomy_vocabulary_machine_name_load', ), @@ -175,11 +175,38 @@ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) { $form['vid'] = array('#type' => 'value', '#value' => $vocabulary->vid); $form['module'] = array('#type' => 'value', '#value' => $vocabulary->module); } + $form['#validate'][] = 'taxonomy_form_vocabulary_validate'; + return $form; } /** - * Accept the form submission for a vocabulary and save the results. + * Form validation handler for taxonomy_form_vocabulary(). + * + * Makes sure that the machine name of the vocabulary is not in the + * disallowed list (names that conflict with menu items, such as 'list' + * and 'add'). + * + * @see taxonomy_form_vocabulary() + * @see taxonomy_form_vocabulary_submit() + */ +function taxonomy_form_vocabulary_validate($form, &$form_state) { + // During the deletion there is no 'machine_name' key + if (isset($form_state['values']['machine_name'])) { + // Do not allow machine names to conflict with taxonomy path arguments. + $machine_name = $form_state['values']['machine_name']; + $disallowed = array('add', 'list'); + if (in_array($machine_name, $disallowed)) { + form_set_error('machine_name', t('The machine-readable name cannot be "add" or "list".')); + } + } +} + +/** + * Form submission handler for taxonomy_form_vocabulary(). + * + * @see taxonomy_form_vocabulary() + * @see taxonomy_form_vocabulary_validate() */ function taxonomy_form_vocabulary_submit($form, &$form_state) { if ($form_state['clicked_button']['#value'] == t('Delete')) { diff --git a/modules/taxonomy/taxonomy.api.php b/modules/taxonomy/taxonomy.api.php index f4d4a034..cb778c9a 100644 --- a/modules/taxonomy/taxonomy.api.php +++ b/modules/taxonomy/taxonomy.api.php @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy.api.php,v 1.11 2010/10/23 15:30:34 webchick Exp $ /** * @file diff --git a/modules/taxonomy/taxonomy.css b/modules/taxonomy/taxonomy.css index 42408501..36cd641b 100644 --- a/modules/taxonomy/taxonomy.css +++ b/modules/taxonomy/taxonomy.css @@ -1,4 +1,3 @@ -/* $Id: taxonomy.css,v 1.5 2008/01/25 21:20:26 goba Exp $ */ tr.taxonomy-term-preview { background-color: #EEE; diff --git a/modules/taxonomy/taxonomy.info b/modules/taxonomy/taxonomy.info index bdb558cb..cf57006a 100644 --- a/modules/taxonomy/taxonomy.info +++ b/modules/taxonomy/taxonomy.info @@ -1,4 +1,3 @@ -; $Id: taxonomy.info,v 1.13 2010/12/20 19:59:43 webchick Exp $ name = Taxonomy description = Enables the categorization of content. package = Core @@ -9,8 +8,8 @@ files[] = taxonomy.module files[] = taxonomy.test configure = admin/structure/taxonomy -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install index d81d8370..f28ffedf 100644 --- a/modules/taxonomy/taxonomy.install +++ b/modules/taxonomy/taxonomy.install @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy.install,v 1.56 2010/12/14 19:50:05 dries Exp $ /** * @file @@ -567,8 +566,12 @@ function taxonomy_update_7005(&$sandbox) { // of term references stored so far for the current revision, which // provides the delta value for each term reference data insert. The // deltas are reset for each new revision. - - $field_info = _update_7000_field_read_fields(); + + $conditions = array( + 'type' => 'taxonomy_term_reference', + 'deleted' => 0, + ); + $field_info = _update_7000_field_read_fields($conditions, 'field_name'); // This is a multi-pass update. On the first call we need to initialize some // variables. diff --git a/modules/taxonomy/taxonomy.js b/modules/taxonomy/taxonomy.js index 8f08b77e..cc9cdf7a 100644 --- a/modules/taxonomy/taxonomy.js +++ b/modules/taxonomy/taxonomy.js @@ -1,4 +1,3 @@ -// $Id: taxonomy.js,v 1.7 2010/01/04 12:04:07 dries Exp $ (function ($) { /** diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index d3250c12..50d2fd60 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy.module,v 1.625 2011/01/03 18:03:54 webchick Exp $ /** * @file @@ -683,8 +682,8 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) { $langcode = $GLOBALS['language_content']->language; } - field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode); - entity_prepare_view('taxonomy_term', array($term->tid => $term)); + field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode, $langcode); + entity_prepare_view('taxonomy_term', array($term->tid => $term), $langcode); $build = array( '#theme' => 'taxonomy_term', @@ -695,12 +694,15 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) { $build += field_attach_view('taxonomy_term', $term, $view_mode, $langcode); - $build['description'] = array( - '#markup' => check_markup($term->description, $term->format, '', TRUE), - '#weight' => 0, - '#prefix' => '<div class="taxonomy-term-description">', - '#suffix' => '</div>', - ); + // Add term description if the term has one. + if (!empty($term->description)) { + $build['description'] = array( + '#markup' => check_markup($term->description, $term->format, '', TRUE), + '#weight' => 0, + '#prefix' => '<div class="taxonomy-term-description">', + '#suffix' => '</div>', + ); + } $build['#attached']['css'][] = drupal_get_path('module', 'taxonomy') . '/taxonomy.css'; @@ -728,6 +730,7 @@ function template_preprocess_taxonomy_term(&$variables) { $variables = array_merge((array) $term, $variables); // Helpful $content variable for templates. + $variables['content'] = array(); foreach (element_children($variables['elements']) as $key) { $variables['content'][$key] = $variables['elements'][$key]; } @@ -747,7 +750,7 @@ function template_preprocess_taxonomy_term(&$variables) { } /** - * Returns whether the current page is the page of the passed in term. + * Returns whether the current page is the page of the passed-in term. * * @param $term * A term object. @@ -1313,7 +1316,7 @@ function taxonomy_field_validate($entity_type, $entity, $field, $instance, $lang if (!$validate) { $errors[$field['field_name']][$langcode][$delta][] = array( 'error' => 'taxonomy_term_reference_illegal_value', - 'message' => t('%name: illegal value.', array('%name' => t($instance['label']))), + 'message' => t('%name: illegal value.', array('%name' => $instance['label'])), ); } } @@ -1467,11 +1470,12 @@ function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field, * * @param $term * A term object. + * * @return * The term name to be used as the page title. */ function taxonomy_term_title($term) { - return check_plain($term->name); + return $term->name; } /** diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc index 59dad6d6..3aed2901 100644 --- a/modules/taxonomy/taxonomy.pages.inc +++ b/modules/taxonomy/taxonomy.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy.pages.inc,v 1.57 2010/11/23 02:56:10 dries Exp $ /** * @file @@ -32,14 +31,12 @@ function taxonomy_term_page($term) { drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name); $build = array(); - // Add term heading if the term has a description - if (!empty($term->description)) { - $build['term_heading'] = array( - '#prefix' => '<div class="term-listing-heading">', - '#suffix' => '</div>', - 'term' => taxonomy_term_view($term, 'full'), - ); - } + + $build['term_heading'] = array( + '#prefix' => '<div class="term-listing-heading">', + '#suffix' => '</div>', + 'term' => taxonomy_term_view($term, 'full'), + ); if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) { $nodes = node_load_multiple($nids); diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test index a561a403..1fd47f5e 100644 --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -1,9 +1,8 @@ <?php -// $Id: taxonomy.test,v 1.99 2010/12/07 05:20:08 webchick Exp $ /** * @file - * Tests for Taxonomy module. + * Tests for taxonomy.module. */ /** @@ -649,12 +648,12 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase { $this->assertText($edit['description[value]'], t('The randomly generated term description is present.')); // Did this page request display a 'term-listing-heading'? - $this->assertPattern('|class="term-listing-heading"|', 'Term page displayed the term description element.'); + $this->assertPattern('|class="taxonomy-term-description"|', 'Term page displayed the term description element.'); // Check that it does NOT show a description when description is blank. $term->description = ''; taxonomy_term_save($term); $this->drupalGet('taxonomy/term/' . $term->tid); - $this->assertNoPattern('|class="term-listing-heading"|', 'Term page did not display the term description when description was blank.'); + $this->assertNoPattern('|class="taxonomy-term-description"|', 'Term page did not display the term description when description was blank.'); // Check that the term feed page is working. $this->drupalGet('taxonomy/term/' . $term->tid . '/feed'); @@ -1108,7 +1107,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('term' => $term1), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); } // Generate and test sanitized tokens for term2. @@ -1128,7 +1127,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('term' => $term2), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized taxonomy term token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1139,7 +1138,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('term' => $term2), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized taxonomy term token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized taxonomy term token %token replaced.', array('%token' => $input))); } // Generate and test sanitized tokens. @@ -1155,7 +1154,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('vocabulary' => $this->vocabulary), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1164,7 +1163,7 @@ class TaxonomyTokenReplaceTestCase extends TaxonomyWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('vocabulary' => $this->vocabulary), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized taxonomy vocabulary token %token replaced.', array('%token' => $input))); } } } diff --git a/modules/taxonomy/taxonomy.tokens.inc b/modules/taxonomy/taxonomy.tokens.inc index 6f1be117..f8ae4576 100644 --- a/modules/taxonomy/taxonomy.tokens.inc +++ b/modules/taxonomy/taxonomy.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: taxonomy.tokens.inc,v 1.10 2010/11/14 00:25:44 dries Exp $ /** * @file diff --git a/modules/toolbar/toolbar-rtl.css b/modules/toolbar/toolbar-rtl.css new file mode 100644 index 00000000..acbc98f8 --- /dev/null +++ b/modules/toolbar/toolbar-rtl.css @@ -0,0 +1,41 @@ + +#toolbar, +#toolbar * { + text-align: right; +} +#toolbar ul li { + float: right; +} +#toolbar ul li a { + display: inline-block; + float: none; + zoom: 1; +} +#toolbar div.toolbar-menu { + padding: 5px 50px 5px 50px; +} +#toolbar-user { + float: left; +} +#toolbar ul#toolbar-user li { + float: none; + display: inline; +} +#toolbar-menu { + float: none; +} +#toolbar-home { + float: right; +} +#toolbar ul li.home a { + position: absolute; + right: 10px; +} +#toolbar div.toolbar-menu a.toggle { + left: 10px; + right: auto; +} +* html #toolbar { + left: 0; + padding-left: 0; +} diff --git a/modules/toolbar/toolbar.css b/modules/toolbar/toolbar.css index b1ce4d8b..cbf3c14c 100644 --- a/modules/toolbar/toolbar.css +++ b/modules/toolbar/toolbar.css @@ -1,9 +1,7 @@ -/* $Id: toolbar.css,v 1.27 2011/01/03 07:04:48 webchick Exp $ */ body.toolbar { padding-top: 2.2em; } - body.toolbar-drawer { padding-top: 5.3em; } @@ -14,15 +12,15 @@ body.toolbar-drawer { */ #toolbar, #toolbar * { - margin: 0; - padding: 0; border: 0; - outline: 0; font-size: 100%; - vertical-align: baseline; line-height: inherit; - text-align: left; list-style: none; + margin: 0; + outline: 0; + padding: 0; + text-align: left; /* LTR */ + vertical-align: baseline; } /** @@ -32,37 +30,34 @@ body.toolbar-drawer { * across different themes, while still allowing browsers to resize the text. */ #toolbar { - font: normal small "Lucida Grande", Verdana, sans-serif; background: #666; color: #ccc; - position: fixed; - top: 0; + font: normal small "Lucida Grande", Verdana, sans-serif; left: 0; - right: 0; margin: 0 -20px; padding: 0 20px; - z-index: 600; + position: fixed; + right: 0; + top: 0; -moz-box-shadow: 0 3px 20px #000; -webkit-box-shadow: 0 3px 20px #000; box-shadow: 0 3px 20px #000; filter: progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10'); -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10')"; + z-index: 600; } - #toolbar div.collapsed { display: none; visibility: hidden; } - #toolbar a { color: #fff; font-size: .846em; text-decoration: none; } - #toolbar ul li, #toolbar ul li a { - float: left; + float: left; /* LTR */ } /** @@ -71,72 +66,64 @@ body.toolbar-drawer { #toolbar div.toolbar-menu { background: #000; line-height: 20px; - padding: 5px 50px 5px 10px; + padding: 5px 50px 5px 10px; /* LTR */ position: relative; } - #toolbar-home a span { - vertical-align: text-bottom; - width: 11px; - height: 14px; - display: block; background: url(toolbar.png) no-repeat 0 -45px; - text-indent: -9999px; + display: block; + height: 14px; margin: 3px 0px; + text-indent: -9999px; + vertical-align: text-bottom; + width: 11px; } - #toolbar-user { - float: right; + float: right; /* LTR */ } - #toolbar-menu { - float: left; + float: left; /* LTR */ } - #toolbar div.toolbar-menu a.toggle { - position: absolute; - right: 10px; + background: url(toolbar.png) 0 -20px no-repeat; bottom: 0; cursor: pointer; - background: url(toolbar.png) 0 -20px no-repeat; - text-indent: -9999px; + height: 25px; overflow: hidden; + position: absolute; + right: 10px; /* LTR */ + text-indent: -9999px; width: 25px; - height: 25px; } #toolbar div.toolbar-menu a.toggle:focus, #toolbar div.toolbar-menu a.toggle:hover { -background-position: -50px -20px; + background-position: -50px -20px; } - #toolbar div.toolbar-menu a.toggle-active { background-position: -25px -20px; } #toolbar div.toolbar-menu a.toggle-active.toggle:focus, #toolbar div.toolbar-menu a.toggle-active.toggle:hover { -background-position: -75px -20px; + background-position: -75px -20px; } - #toolbar div.toolbar-menu ul li a { + padding: 0 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; - padding: 0 10px; } - #toolbar div.toolbar-menu ul li a:focus, #toolbar div.toolbar-menu ul li a:hover, #toolbar div.toolbar-menu ul li a:active, #toolbar div.toolbar-menu ul li a.active:focus { background: #444; } - #toolbar div.toolbar-menu ul li a.active:hover, #toolbar div.toolbar-menu ul li a.active:active, #toolbar div.toolbar-menu ul li a.active, #toolbar div.toolbar-menu ul li.active-trail a { - text-shadow: #333 0 1px 0; background: url(toolbar.png) 0 0 repeat-x; + text-shadow: #333 0 1px 0; } /** @@ -154,10 +141,10 @@ background-position: -75px -20px; * it with position:absolute; toolbar needs its z-index to stay above overlay. */ * html #toolbar { - position: absolute; + left: -20px; margin: 0; padding-right: 0; - left: -20px; + position: absolute; right: 0; width: 100%; } diff --git a/modules/toolbar/toolbar.info b/modules/toolbar/toolbar.info index 4149ad6d..e168fd72 100644 --- a/modules/toolbar/toolbar.info +++ b/modules/toolbar/toolbar.info @@ -1,12 +1,11 @@ -; $Id: toolbar.info,v 1.5 2010/12/20 19:59:43 webchick Exp $ name = Toolbar description = Provides a toolbar that shows the top-level administration menu items and links from other modules. core = 7.x package = Core version = VERSION -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/toolbar/toolbar.js b/modules/toolbar/toolbar.js index c2a9cafe..5b61634b 100644 --- a/modules/toolbar/toolbar.js +++ b/modules/toolbar/toolbar.js @@ -1,4 +1,3 @@ -// $Id: toolbar.js,v 1.20 2010/12/01 07:05:26 webchick Exp $ (function ($) { Drupal.toolbar = Drupal.toolbar || {}; diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module index 3b86d61a..61ae648a 100644 --- a/modules/toolbar/toolbar.module +++ b/modules/toolbar/toolbar.module @@ -1,5 +1,4 @@ <?php -// $Id: toolbar.module,v 1.49 2010/12/15 03:04:38 webchick Exp $ /** * @file @@ -96,7 +95,7 @@ function theme_toolbar_toggle($variables) { $toggle_text = t('Hide shortcuts'); $variables['attributes']['class'][] = 'toggle-active'; } - return '<a href="' . url('toolbar/toggle', array('query' => drupal_get_destination())) . '" title="' . $toggle_text . '"' . drupal_attributes($variables['attributes']) . '>' . $toggle_text . '</a>'; + return l($toggle_text, 'toolbar/toggle', array('query' => drupal_get_destination(), 'attributes' => array('title' => $toggle_text) + $variables['attributes'])); } /** diff --git a/modules/toolbar/toolbar.tpl.php b/modules/toolbar/toolbar.tpl.php index d2294267..1df0cf03 100644 --- a/modules/toolbar/toolbar.tpl.php +++ b/modules/toolbar/toolbar.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: toolbar.tpl.php,v 1.11 2010/05/23 18:23:32 dries Exp $ /** * @file diff --git a/modules/tracker/tracker.css b/modules/tracker/tracker.css index 0e91826f..d3531c46 100644 --- a/modules/tracker/tracker.css +++ b/modules/tracker/tracker.css @@ -1,4 +1,3 @@ -/* $Id: tracker.css,v 1.2 2009/07/02 04:27:23 webchick Exp $ */ .page-tracker td.replies { text-align: center; diff --git a/modules/tracker/tracker.info b/modules/tracker/tracker.info index 9332162a..d640655b 100644 --- a/modules/tracker/tracker.info +++ b/modules/tracker/tracker.info @@ -1,4 +1,3 @@ -; $Id: tracker.info,v 1.11 2010/12/20 19:59:43 webchick Exp $ name = Tracker description = Enables tracking of recent content for users. dependencies[] = comment @@ -7,8 +6,8 @@ version = VERSION core = 7.x files[] = tracker.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/tracker/tracker.install b/modules/tracker/tracker.install index 38235423..244f5377 100644 --- a/modules/tracker/tracker.install +++ b/modules/tracker/tracker.install @@ -1,5 +1,4 @@ <?php -// $Id: tracker.install,v 1.6 2011/01/02 17:26:39 webchick Exp $ /** * Implements hook_uninstall(). diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 5f410214..227cf720 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -1,5 +1,4 @@ <?php -// $Id: tracker.module,v 1.175 2010/12/28 18:39:23 webchick Exp $ /** * @file diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc index fab5c947..7b1e946f 100644 --- a/modules/tracker/tracker.pages.inc +++ b/modules/tracker/tracker.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: tracker.pages.inc,v 1.32 2010/07/30 02:47:28 dries Exp $ /** * @file diff --git a/modules/tracker/tracker.test b/modules/tracker/tracker.test index 6ff3712c..3cc227ea 100644 --- a/modules/tracker/tracker.test +++ b/modules/tracker/tracker.test @@ -1,5 +1,9 @@ <?php -// $Id: tracker.test,v 1.22 2010/12/28 18:39:23 webchick Exp $ + +/** + * @file + * Tests for tracker.module. + */ class TrackerTest extends DrupalWebTestCase { protected $user; diff --git a/modules/translation/tests/translation_test.info b/modules/translation/tests/translation_test.info index 646007e6..88021e6a 100644 --- a/modules/translation/tests/translation_test.info +++ b/modules/translation/tests/translation_test.info @@ -1,4 +1,3 @@ -; $Id: translation_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Content Translation Test" description = "Support module for the content translation tests." core = 7.x @@ -6,8 +5,8 @@ package = Testing version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/translation/tests/translation_test.module b/modules/translation/tests/translation_test.module index ef02ee00..e3bb4b5f 100644 --- a/modules/translation/tests/translation_test.module +++ b/modules/translation/tests/translation_test.module @@ -1,5 +1,4 @@ <?php -// $Id: translation_test.module,v 1.1 2010/10/09 03:22:30 webchick Exp $ /** * @file diff --git a/modules/translation/translation.info b/modules/translation/translation.info index 751305f5..e3e1e4aa 100644 --- a/modules/translation/translation.info +++ b/modules/translation/translation.info @@ -1,4 +1,3 @@ -; $Id: translation.info,v 1.6 2010/12/20 19:59:43 webchick Exp $ name = Content translation description = Allows content to be translated into different languages. dependencies[] = locale @@ -7,8 +6,8 @@ version = VERSION core = 7.x files[] = translation.test -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/translation/translation.module b/modules/translation/translation.module index 599ff1fa..697929f6 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -1,5 +1,4 @@ <?php -// $Id: translation.module,v 1.91 2010/11/27 20:25:44 dries Exp $ /** * @file @@ -114,15 +113,14 @@ function translation_form_node_type_form_alter(&$form, &$form_state) { // Add translation option to content type form. $form['workflow']['language_content_type']['#options'][TRANSLATION_ENABLED] = t('Enabled, with translation'); // Description based on text from locale.module. - $form['workflow']['language_content_type']['#description'] = t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. You can also turn on translation for this content type, which lets you have content translated to any of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/config/regional/language'))); + $form['workflow']['language_content_type']['#description'] = t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. You can also turn on translation for this content type, which lets you have content translated to any of the installed languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/config/regional/language'))); } /** - * Implements hook_form_alter(). + * Implements hook_form_BASE_FORM_ID_alter(). * - * - Add translation option to content type form. - * - Alters language fields on node forms when a translation - * is about to be created. + * This function alters language fields on node edit forms when a translation is + * about to be created. */ function translation_form_node_form_alter(&$form, &$form_state) { if (translation_supported_type($form['#node']->type)) { @@ -135,7 +133,7 @@ function translation_form_node_form_alter(&$form, &$form_state) { // might need to distinguish between enabled and disabled languages, hence // we divide them in two option groups. if ($translator_widget) { - $options = array(); + $options = array($groups[1] => array(LANGUAGE_NONE => t('Language neutral'))); $language_list = locale_language_list('name', TRUE); foreach (array(1, 0) as $status) { $group = $groups[$status]; @@ -504,8 +502,23 @@ function translation_path_get_translations($path) { */ function translation_language_switch_links_alter(array &$links, $type, $path) { $language_type = variable_get('translation_language_type', LANGUAGE_TYPE_INTERFACE); - if ($type == $language_type && preg_match("!^node/(\d+)(/.+|)!", $path, $matches) && ($node = node_load((int) $matches[1]))) { - $translations = $node->tnid ? translation_node_get_translations($node->tnid) : array($node->language => $node); + + if ($type == $language_type && preg_match("!^node/(\d+)(/.+|)!", $path, $matches)) { + $node = node_load((int) $matches[1]); + + if (empty($node->tnid)) { + // If the node cannot be found nothing needs to be done. If it does not + // have translations it might be a language neutral node, in which case we + // must leave the language switch links unaltered. This is true also for + // nodes not having translation support enabled. + if (empty($node) || $node->language == LANGUAGE_NONE || !translation_supported_type($node->type)) { + return; + } + $translations = array($node->language => $node); + } + else { + $translations = translation_node_get_translations($node->tnid); + } foreach ($links as $langcode => $link) { if (isset($translations[$langcode]) && $translations[$langcode]->status) { diff --git a/modules/translation/translation.pages.inc b/modules/translation/translation.pages.inc index 0da7666d..7e4f0af2 100644 --- a/modules/translation/translation.pages.inc +++ b/modules/translation/translation.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: translation.pages.inc,v 1.18 2010/12/31 20:45:25 webchick Exp $ /** * @file @@ -38,12 +37,12 @@ function translation_node_overview($node) { $translation_node = node_load($translations[$langcode]->nid); $path = 'node/' . $translation_node->nid; $links = language_negotiation_get_switch_links($type, $path); - $title = empty($links->links[$langcode]) ? l($translation_node->title, $path) : l($translation_node->title, $links->links[$langcode]['href'], $links->links[$langcode]); + $title = empty($links->links[$langcode]['href']) ? l($translation_node->title, $path) : l($translation_node->title, $links->links[$langcode]['href'], $links->links[$langcode]); if (node_access('update', $translation_node)) { $text = t('edit'); $path = 'node/' . $translation_node->nid . '/edit'; $links = language_negotiation_get_switch_links($type, $path); - $options[] = empty($links->links[$langcode]) ? l($text, $path) : l($text, $links->links[$langcode]['href'], $links->links[$langcode]); + $options[] = empty($links->links[$langcode]['href']) ? l($text, $path) : l($text, $links->links[$langcode]['href'], $links->links[$langcode]); } $status = $translation_node->status ? t('Published') : t('Not published'); $status .= $translation_node->translate ? ' - <span class="marker">' . t('outdated') . '</span>' : ''; @@ -59,7 +58,7 @@ function translation_node_overview($node) { $path = 'node/add/' . str_replace('_', '-', $node->type); $links = language_negotiation_get_switch_links($type, $path); $query = array('query' => array('translation' => $node->nid, 'target' => $langcode)); - $options[] = empty($links->links[$langcode]) ? l($text, $path, $query) : l($text, $links->links[$langcode]['href'], array_merge_recursive($links->links[$langcode], $query)); + $options[] = empty($links->links[$langcode]['href']) ? l($text, $path, $query) : l($text, $links->links[$langcode]['href'], array_merge_recursive($links->links[$langcode], $query)); } $status = t('Not translated'); } diff --git a/modules/translation/translation.test b/modules/translation/translation.test index d03acb50..54b53d9f 100644 --- a/modules/translation/translation.test +++ b/modules/translation/translation.test @@ -1,5 +1,9 @@ <?php -// $Id: translation.test,v 1.35 2010/12/31 20:45:25 webchick Exp $ + +/** + * @file + * Tests for translation.module + */ class TranslationTestCase extends DrupalWebTestCase { protected $book; @@ -16,7 +20,7 @@ class TranslationTestCase extends DrupalWebTestCase { parent::setUp('locale', 'translation', 'translation_test'); // Setup users. - $this->admin_user = $this->drupalCreateUser(array('bypass node access', 'administer nodes', 'administer languages', 'administer content types', 'administer blocks', 'access administration pages')); + $this->admin_user = $this->drupalCreateUser(array('bypass node access', 'administer nodes', 'administer languages', 'administer content types', 'administer blocks', 'access administration pages', 'translate content')); $this->translator = $this->drupalCreateUser(array('create page content', 'edit own page content', 'translate content')); $this->drupalLogin($this->admin_user); @@ -63,6 +67,14 @@ class TranslationTestCase extends DrupalWebTestCase { $node_body = $this->randomName(); $node = $this->createPage($node_title, $node_body, 'en'); + // Unpublish the original node to check that this has no impact on the + // translation overview page, publish it again afterwards. + $this->drupalLogin($this->admin_user); + $this->drupalPost('node/' . $node->nid . '/edit', array('status' => FALSE), t('Save')); + $this->drupalGet('node/' . $node->nid . '/translate'); + $this->drupalPost('node/' . $node->nid . '/edit', array('status' => NODE_PUBLISHED), t('Save')); + $this->drupalLogin($this->translator); + // Check that the "add translation" link uses a localized path. $languages = language_list(); $this->drupalGet('node/' . $node->nid . '/translate'); @@ -121,6 +133,13 @@ class TranslationTestCase extends DrupalWebTestCase { $translation_it = $this->createTranslation($node, $this->randomName(), $this->randomName(), 'it'); $this->assertRaw($translation_it->body['it'][0]['value'], t('Content created in Italian (disabled).')); + // Confirm that language neutral is an option for translators when there are + // disabled languages. + $this->drupalGet('node/add/page'); + $this->assertFieldByXPath('//select[@name="language"]//option', LANGUAGE_NONE, t('Language neutral is available in language selection with disabled languages.')); + $node2 = $this->createPage($this->randomName(), $this->randomName(), LANGUAGE_NONE); + $this->assertRaw($node2->body[LANGUAGE_NONE][0]['value'], t('Language neutral content created with disabled languages available.')); + // Leave just one language enabled and check that the translation overview // page is still accessible. $this->drupalLogin($this->admin_user); @@ -200,6 +219,38 @@ class TranslationTestCase extends DrupalWebTestCase { $this->assertLanguageSwitchLinks($node, $node, TRUE, $type); $this->assertLanguageSwitchLinks($node, $translation_es, TRUE, $type); $this->assertLanguageSwitchLinks($node, $translation_it, TRUE, $type); + + // Create a language neutral node and check that the language switcher is + // left untouched. + $node2 = $this->createPage($this->randomName(), $this->randomName(), LANGUAGE_NONE); + $node2_en = (object) array('nid' => $node2->nid, 'language' => 'en'); + $node2_es = (object) array('nid' => $node2->nid, 'language' => 'es'); + $node2_it = (object) array('nid' => $node2->nid, 'language' => 'it'); + $this->assertLanguageSwitchLinks($node2_en, $node2_en, TRUE, $type); + $this->assertLanguageSwitchLinks($node2_en, $node2_es, TRUE, $type); + $this->assertLanguageSwitchLinks($node2_en, $node2_it, TRUE, $type); + + // Disable translation support to check that the language switcher is left + // untouched only for new nodes. + $this->drupalLogin($this->admin_user); + $edit = array('language_content_type' => 0); + $this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type')); + $this->drupalLogin($this->translator); + + // Existing translations trigger alterations even if translation support is + // disabled. + $this->assertLanguageSwitchLinks($node, $node, TRUE, $type); + $this->assertLanguageSwitchLinks($node, $translation_es, TRUE, $type); + $this->assertLanguageSwitchLinks($node, $translation_it, TRUE, $type); + + // Check that new nodes with a language assigned do not trigger language + // switcher alterations when translation support is disabled. + $node = $this->createPage($this->randomName(), $this->randomName()); + $node_es = (object) array('nid' => $node->nid, 'language' => 'es'); + $node_it = (object) array('nid' => $node->nid, 'language' => 'it'); + $this->assertLanguageSwitchLinks($node, $node, TRUE, $type); + $this->assertLanguageSwitchLinks($node, $node_es, TRUE, $type); + $this->assertLanguageSwitchLinks($node, $node_it, TRUE, $type); } /** @@ -264,12 +315,14 @@ class TranslationTestCase extends DrupalWebTestCase { * @param * $language Language code. */ - function createPage($title, $body, $language) { + function createPage($title, $body, $language = NULL) { $edit = array(); $langcode = LANGUAGE_NONE; $edit["title"] = $title; $edit["body[$langcode][0][value]"] = $body; - $edit['language'] = $language; + if (!empty($language)) { + $edit['language'] = $language; + } $this->drupalPost('node/add/page', $edit, t('Save')); $this->assertRaw(t('Basic page %title has been created.', array('%title' => $title)), t('Basic page created.')); diff --git a/modules/trigger/tests/trigger_test.info b/modules/trigger/tests/trigger_test.info index 81543d73..e5aa50df 100644 --- a/modules/trigger/tests/trigger_test.info +++ b/modules/trigger/tests/trigger_test.info @@ -1,12 +1,11 @@ -; $Id: trigger_test.info,v 1.2 2010/12/20 19:59:43 webchick Exp $ name = "Trigger Test" description = "Support module for Trigger tests." package = Testing core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/trigger/tests/trigger_test.module b/modules/trigger/tests/trigger_test.module index d19f8dc3..0e3f3f87 100644 --- a/modules/trigger/tests/trigger_test.module +++ b/modules/trigger/tests/trigger_test.module @@ -1,5 +1,4 @@ <?php -// $Id: trigger_test.module,v 1.8 2010/06/29 18:24:10 dries Exp $ /** * @file diff --git a/modules/trigger/trigger.admin.inc b/modules/trigger/trigger.admin.inc index 0bd205aa..7509eb35 100644 --- a/modules/trigger/trigger.admin.inc +++ b/modules/trigger/trigger.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: trigger.admin.inc,v 1.30 2010/10/20 16:19:24 webchick Exp $ /** * @file diff --git a/modules/trigger/trigger.api.php b/modules/trigger/trigger.api.php index f2f4c6e7..839c1d48 100644 --- a/modules/trigger/trigger.api.php +++ b/modules/trigger/trigger.api.php @@ -1,5 +1,4 @@ <?php -// $Id: trigger.api.php,v 1.7 2010/04/22 06:33:06 webchick Exp $ /** * @file diff --git a/modules/trigger/trigger.info b/modules/trigger/trigger.info index 1eb79f1d..cb76d1ad 100644 --- a/modules/trigger/trigger.info +++ b/modules/trigger/trigger.info @@ -1,4 +1,3 @@ -; $Id: trigger.info,v 1.8 2010/12/20 19:59:43 webchick Exp $ name = Trigger description = Enables actions to be fired on certain system events, such as when new content is created. package = Core @@ -7,8 +6,8 @@ core = 7.x files[] = trigger.test configure = admin/structure/trigger -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/trigger/trigger.install b/modules/trigger/trigger.install index 1f42515b..9a172a2a 100644 --- a/modules/trigger/trigger.install +++ b/modules/trigger/trigger.install @@ -1,5 +1,4 @@ <?php -// $Id: trigger.install,v 1.17 2010/08/22 13:55:53 dries Exp $ /** * @file diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module index 23a8b094..6c1f58ff 100644 --- a/modules/trigger/trigger.module +++ b/modules/trigger/trigger.module @@ -1,5 +1,4 @@ <?php -// $Id: trigger.module,v 1.66 2010/12/01 07:41:03 webchick Exp $ /** * @file diff --git a/modules/trigger/trigger.test b/modules/trigger/trigger.test index d3307d61..9a9a4ba2 100644 --- a/modules/trigger/trigger.test +++ b/modules/trigger/trigger.test @@ -1,5 +1,9 @@ <?php -// $Id: trigger.test,v 1.37 2010/10/05 06:17:29 webchick Exp $ + +/** + * @file + * Tests for trigger.module. + */ /** * Provides common helper methods. diff --git a/modules/update/tests/aaa_update_test.info b/modules/update/tests/aaa_update_test.info index 617d79a8..17da66ad 100644 --- a/modules/update/tests/aaa_update_test.info +++ b/modules/update/tests/aaa_update_test.info @@ -1,12 +1,11 @@ -; $Id: aaa_update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $ name = AAA Update test description = Support module for update module testing. package = Testing core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/update/tests/aaa_update_test.module b/modules/update/tests/aaa_update_test.module index 777fe1b7..4d67b8e4 100644 --- a/modules/update/tests/aaa_update_test.module +++ b/modules/update/tests/aaa_update_test.module @@ -1,5 +1,4 @@ <?php -// $Id: aaa_update_test.module,v 1.1 2009/10/01 19:23:21 dries Exp $ /** * @file diff --git a/modules/update/tests/bbb_update_test.info b/modules/update/tests/bbb_update_test.info index 805e56f3..016153ef 100644 --- a/modules/update/tests/bbb_update_test.info +++ b/modules/update/tests/bbb_update_test.info @@ -1,12 +1,11 @@ -; $Id: bbb_update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $ name = BBB Update test description = Support module for update module testing. package = Testing core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/update/tests/bbb_update_test.module b/modules/update/tests/bbb_update_test.module index 8cb60417..4d67b8e4 100644 --- a/modules/update/tests/bbb_update_test.module +++ b/modules/update/tests/bbb_update_test.module @@ -1,5 +1,4 @@ <?php -// $Id: bbb_update_test.module,v 1.1 2009/10/01 19:23:21 dries Exp $ /** * @file diff --git a/modules/update/tests/ccc_update_test.info b/modules/update/tests/ccc_update_test.info index cbe12016..a2855233 100644 --- a/modules/update/tests/ccc_update_test.info +++ b/modules/update/tests/ccc_update_test.info @@ -1,12 +1,11 @@ -; $Id: ccc_update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $ name = CCC Update test description = Support module for update module testing. package = Testing core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/update/tests/ccc_update_test.module b/modules/update/tests/ccc_update_test.module index 70b90a0d..4d67b8e4 100644 --- a/modules/update/tests/ccc_update_test.module +++ b/modules/update/tests/ccc_update_test.module @@ -1,5 +1,4 @@ <?php -// $Id: ccc_update_test.module,v 1.1 2009/10/01 19:23:21 dries Exp $ /** * @file diff --git a/modules/update/tests/update_test.info b/modules/update/tests/update_test.info index 4823b87b..94a2308a 100644 --- a/modules/update/tests/update_test.info +++ b/modules/update/tests/update_test.info @@ -1,4 +1,3 @@ -; $Id: update_test.info,v 1.2 2010/12/20 19:59:44 webchick Exp $ name = Update test description = Support module for update module testing. package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module index 840133ab..4e32d336 100644 --- a/modules/update/tests/update_test.module +++ b/modules/update/tests/update_test.module @@ -1,5 +1,4 @@ <?php -// $Id: update_test.module,v 1.7 2011/01/03 02:41:33 webchick Exp $ /** * Implements hook_menu(). diff --git a/modules/update/update-rtl.css b/modules/update/update-rtl.css index 623e76a2..5fc83d1a 100644 --- a/modules/update/update-rtl.css +++ b/modules/update/update-rtl.css @@ -1,4 +1,3 @@ -/* $Id: update-rtl.css,v 1.3 2007/11/27 16:22:22 goba Exp $ */ .update .project { padding-right: .25em; diff --git a/modules/update/update.api.php b/modules/update/update.api.php index b7349a19..87f95cac 100644 --- a/modules/update/update.api.php +++ b/modules/update/update.api.php @@ -1,5 +1,4 @@ <?php -// $Id: update.api.php,v 1.6 2010/12/06 06:50:08 webchick Exp $ /** * @file diff --git a/modules/update/update.authorize.inc b/modules/update/update.authorize.inc index 7265681a..c9b76dd3 100644 --- a/modules/update/update.authorize.inc +++ b/modules/update/update.authorize.inc @@ -1,5 +1,4 @@ <?php -// $Id: update.authorize.inc,v 1.9 2011/01/03 02:53:07 webchick Exp $ /** * @file @@ -102,7 +101,7 @@ function update_authorize_run_install($filetransfer, $project, $updater_name, $l * already been downloaded and extracted into. * @param FileTransfer $filetransfer * The FileTransfer object to use for performing this operation. - * @param array &$context + * @param array $context * Reference to an array used for BatchAPI storage. */ function update_authorize_batch_copy_project($project, $updater_name, $local_url, $filetransfer, &$context) { diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc index 1efb6979..2ccd97c0 100644 --- a/modules/update/update.compare.inc +++ b/modules/update/update.compare.inc @@ -1,5 +1,4 @@ <?php -// $Id: update.compare.inc,v 1.41 2010/10/04 07:26:25 webchick Exp $ /** * @file diff --git a/modules/update/update.css b/modules/update/update.css index 832195e3..d30dfb6e 100644 --- a/modules/update/update.css +++ b/modules/update/update.css @@ -1,4 +1,3 @@ -/* $Id: update.css,v 1.8 2010/10/08 00:24:09 dries Exp $ */ .update .project { font-weight: bold; diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc index 63847d26..ff69cbb1 100644 --- a/modules/update/update.fetch.inc +++ b/modules/update/update.fetch.inc @@ -1,5 +1,4 @@ <?php -// $Id: update.fetch.inc,v 1.28 2010/05/06 05:59:31 webchick Exp $ /** * @file diff --git a/modules/update/update.info b/modules/update/update.info index f3f2a4cb..67c95650 100644 --- a/modules/update/update.info +++ b/modules/update/update.info @@ -1,4 +1,3 @@ -; $Id: update.info,v 1.10 2010/12/20 19:59:43 webchick Exp $ name = Update manager description = Checks for available updates, and can securely install or update modules and themes via a web interface. version = VERSION @@ -7,8 +6,8 @@ core = 7.x files[] = update.test configure = admin/reports/updates/settings -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/update/update.install b/modules/update/update.install index 69278bab..70fb6c32 100644 --- a/modules/update/update.install +++ b/modules/update/update.install @@ -1,5 +1,4 @@ <?php -// $Id: update.install,v 1.21 2011/01/02 17:26:39 webchick Exp $ /** * @file diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc index a6707bcc..35b29290 100644 --- a/modules/update/update.manager.inc +++ b/modules/update/update.manager.inc @@ -1,5 +1,4 @@ <?php -// $Id: update.manager.inc,v 1.34 2011/01/03 02:53:07 webchick Exp $ /** * @file @@ -644,8 +643,11 @@ function update_manager_install_form_submit($form, &$form_state) { form_set_error($field, t('Provided archive contains no files.')); return; } - // Unfortunately, we can only use the directory name for this. :( - $project = drupal_substr($files[0], 0, -1); + + // Unfortunately, we can only use the directory name to determine the project + // name. Some archivers list the first file as the directory (i.e., MODULE/) + // and others list an actual file (i.e., MODULE/README.TXT). + $project = strtok($files[0], '/\\'); $archive_errors = update_manager_archive_verify($project, $local_cache, $directory); if (!empty($archive_errors)) { @@ -728,26 +730,6 @@ function update_manager_install_form_submit($form, &$form_state) { * and verify archive files. */ -/** - * Return the directory where update archive files should be extracted. - * - * If the directory does not already exist, attempt to create it. - * - * @return - * The full path to the temporary directory where update file archives - * should be extracted. - */ -function _update_manager_extract_directory() { - $directory = &drupal_static(__FUNCTION__, ''); - if (empty($directory)) { - $directory = 'temporary://update-extraction'; - if (!file_exists($directory)) { - mkdir($directory); - } - } - return $directory; -} - /** * Unpack a downloaded archive file. * @@ -771,8 +753,12 @@ function update_manager_archive_extract($file, $directory) { // old files mixed with the new files (e.g. in cases where files were removed // from a later release). $files = $archiver->listContents(); - // Unfortunately, we can only use the directory name for this. :( - $project = drupal_substr($files[0], 0, -1); + + // Unfortunately, we can only use the directory name to determine the project + // name. Some archivers list the first file as the directory (i.e., MODULE/) + // and others list an actual file (i.e., MODULE/README.TXT). + $project = strtok($files[0], '/\\'); + $extract_location = $directory . '/' . $project; if (file_exists($extract_location)) { file_unmanaged_delete_recursive($extract_location); @@ -823,13 +809,9 @@ function update_manager_file_get($url) { } // Check the cache and download the file if needed. - $cache_directory = 'temporary://update-cache'; + $cache_directory = _update_manager_cache_directory(); $local = $cache_directory . '/' . basename($parsed_url['path']); - if (!file_exists($cache_directory)) { - mkdir($cache_directory); - } - if (!file_exists($local) || update_delete_file_if_stale($local)) { return system_retrieve_file($url, $local, FALSE, FILE_EXISTS_REPLACE); } @@ -849,7 +831,7 @@ function update_manager_file_get($url) { * The short name of the project to download. * @param string $url * The URL to download a specific project release archive file. - * @param array &$context + * @param array $context * Reference to an array used for BatchAPI storage. * * @see update_manager_download_page() diff --git a/modules/update/update.module b/modules/update/update.module index f7209c4c..a66cfa51 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -1,5 +1,4 @@ <?php -// $Id: update.module,v 1.75 2011/01/03 02:17:34 webchick Exp $ /** * @file @@ -857,14 +856,71 @@ function update_flush_caches() { * @} End of "defgroup update_status_cache". */ +/** + * Return a short unique identifier for this Drupal installation. + * + * @return + * An eight character string uniquely identifying this Drupal installation. + */ +function _update_manager_unique_identifier() { + $id = &drupal_static(__FUNCTION__, ''); + if (empty($id)) { + $id = substr(hash('sha256', drupal_get_hash_salt()), 0, 8); + } + return $id; +} + +/** + * Return the directory where update archive files should be extracted. + * + * @param $create + * If TRUE, attempt to create the directory if it does not already exist. + * + * @return + * The full path to the temporary directory where update file archives + * should be extracted. + */ +function _update_manager_extract_directory($create = TRUE) { + $directory = &drupal_static(__FUNCTION__, ''); + if (empty($directory)) { + $directory = 'temporary://update-extraction-' . _update_manager_unique_identifier(); + if ($create && !file_exists($directory)) { + mkdir($directory); + } + } + return $directory; +} + +/** + * Return the directory where update archive files should be cached. + * + * @param $create + * If TRUE, attempt to create the directory if it does not already exist. + * + * @return + * The full path to the temporary directory where update file archives + * should be cached. + */ +function _update_manager_cache_directory($create = TRUE) { + $directory = &drupal_static(__FUNCTION__, ''); + if (empty($directory)) { + $directory = 'temporary://update-cache-' . _update_manager_unique_identifier(); + if ($create && !file_exists($directory)) { + mkdir($directory); + } + } + return $directory; +} + /** * Clear the temporary files and directories based on file age from disk. */ function update_clear_update_disk_cache() { - // List of update module cache directories. + // List of update module cache directories. Do not create the directories if + // they do not exist. $directories = array( - 'temporary://update-cache', - 'temporary://update-extraction', + _update_manager_cache_directory(FALSE), + _update_manager_extract_directory(FALSE), ); // Search for files and directories in base folder only without recursion. diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc index 12083503..3f5933ac 100644 --- a/modules/update/update.report.inc +++ b/modules/update/update.report.inc @@ -1,5 +1,4 @@ <?php -// $Id: update.report.inc,v 1.33 2010/10/03 22:43:16 dries Exp $ /** * @file @@ -58,25 +57,25 @@ function theme_update_report($variables) { switch ($project['status']) { case UPDATE_CURRENT: $class = 'ok'; - $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('ok'), 'title' => t('ok'))); + $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('ok'), 'title' => t('ok'))); break; case UPDATE_UNKNOWN: case UPDATE_FETCH_PENDING: case UPDATE_NOT_FETCHED: $class = 'unknown'; - $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning'))); + $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning'))); break; case UPDATE_NOT_SECURE: case UPDATE_REVOKED: case UPDATE_NOT_SUPPORTED: $class = 'error'; - $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('error'), 'title' => t('error'))); + $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('error'), 'title' => t('error'))); break; case UPDATE_NOT_CHECKED: case UPDATE_NOT_CURRENT: default: $class = 'warning'; - $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning'))); + $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning'))); break; } diff --git a/modules/update/update.settings.inc b/modules/update/update.settings.inc index aa862a83..60ac3ca8 100644 --- a/modules/update/update.settings.inc +++ b/modules/update/update.settings.inc @@ -1,5 +1,4 @@ <?php -// $Id: update.settings.inc,v 1.11 2010/06/26 21:32:20 dries Exp $ /** * @file diff --git a/modules/update/update.test b/modules/update/update.test index 6cb44914..6f9ef08e 100644 --- a/modules/update/update.test +++ b/modules/update/update.test @@ -1,8 +1,9 @@ <?php -// $Id: update.test,v 1.22 2011/01/03 02:41:33 webchick Exp $ /** * @file + * Tests for update.module. + * * This file contains tests for the update module. The overarching methodology * of these tests is we need to compare a given state of installed modules and * themes (e.g. version, project grouping, timestamps, etc) vs. a current diff --git a/modules/user/tests/user_form_test.info b/modules/user/tests/user_form_test.info index 1fb6a9a1..45d961c1 100644 --- a/modules/user/tests/user_form_test.info +++ b/modules/user/tests/user_form_test.info @@ -1,4 +1,3 @@ -; $Id: user_form_test.info,v 1.2 2010/12/21 16:31:47 webchick Exp $ name = "User module form tests" description = "Support module for user form testing." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/user/tests/user_form_test.module b/modules/user/tests/user_form_test.module index ccb21f7f..4e907f36 100644 --- a/modules/user/tests/user_form_test.module +++ b/modules/user/tests/user_form_test.module @@ -1,5 +1,4 @@ <?php -// $Id: user_form_test.module,v 1.1 2010/12/11 06:22:33 webchick Exp $ /** * @file diff --git a/modules/user/user-picture.tpl.php b/modules/user/user-picture.tpl.php index 9d62c134..a33d2661 100644 --- a/modules/user/user-picture.tpl.php +++ b/modules/user/user-picture.tpl.php @@ -1,14 +1,13 @@ <?php -// $Id: user-picture.tpl.php,v 1.5 2009/08/06 05:05:59 webchick Exp $ /** * @file - * Default theme implementation to present an picture configured for the + * Default theme implementation to present a picture configured for the * user's account. * * Available variables: * - $user_picture: Image set by the user or the site's default. Will be linked - * depending on the viewer's permission to view the users profile page. + * depending on the viewer's permission to view the user's profile page. * - $account: Array of account information. Potentially unsafe. Be sure to * check_plain() before use. * diff --git a/modules/user/user-profile-category.tpl.php b/modules/user/user-profile-category.tpl.php index 69145fc9..0de7d5d0 100644 --- a/modules/user/user-profile-category.tpl.php +++ b/modules/user/user-profile-category.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: user-profile-category.tpl.php,v 1.3 2008/10/13 12:31:43 dries Exp $ /** * @file diff --git a/modules/user/user-profile-item.tpl.php b/modules/user/user-profile-item.tpl.php index 2275c12c..042d43a8 100644 --- a/modules/user/user-profile-item.tpl.php +++ b/modules/user/user-profile-item.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: user-profile-item.tpl.php,v 1.3 2008/10/13 12:31:43 dries Exp $ /** * @file diff --git a/modules/user/user-profile.tpl.php b/modules/user/user-profile.tpl.php index f27aaf9e..50e61111 100644 --- a/modules/user/user-profile.tpl.php +++ b/modules/user/user-profile.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: user-profile.tpl.php,v 1.13 2010/01/08 07:04:09 webchick Exp $ /** * @file diff --git a/modules/user/user-rtl.css b/modules/user/user-rtl.css index b589171b..5a1442c1 100644 --- a/modules/user/user-rtl.css +++ b/modules/user/user-rtl.css @@ -1,4 +1,3 @@ -/* $Id: user-rtl.css,v 1.9 2010/09/19 18:10:42 dries Exp $ */ #permissions td.permission { padding-left: 0; @@ -8,19 +7,18 @@ /** * Password strength indicator. */ -input.password-field { - margin-left: 10px; - margin-right: 0; +.password-strength { + float: left; } -input.password-confirm { - margin-left: 10px; - margin-right: 0; +.password-strength-text { + float: left; } -.password-strength-title { - float: right; +div.password-confirm { + float: left; } +.confirm-parent, .password-parent { - float: right; + clear: right; } /* Generated by user.module but used by profile.module: */ diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 4bfb3c12..0596bde4 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: user.admin.inc,v 1.124 2010/12/15 02:59:01 webchick Exp $ /** * @file diff --git a/modules/user/user.api.php b/modules/user/user.api.php index 437e01d6..069a9f88 100644 --- a/modules/user/user.api.php +++ b/modules/user/user.api.php @@ -1,5 +1,4 @@ <?php -// $Id: user.api.php,v 1.27 2010/12/11 19:16:42 webchick Exp $ /** * @file @@ -25,18 +24,17 @@ * @see profile_user_load() */ function hook_user_load($users) { - $result = db_query('SELECT * FROM {my_table} WHERE uid IN (:uids)', array(':uids' => array_keys($users))); + $result = db_query('SELECT uid, foo FROM {my_table} WHERE uid IN (:uids)', array(':uids' => array_keys($users))); foreach ($result as $record) { - $users[$record->uid]->foo = $result->foo; + $users[$record->uid]->foo = $record->foo; } } /** * Respond to user deletion. * - * This hook is invoked from user_delete_multiple() after the account has been - * removed from the user tables in the database, and before - * field_attach_delete() is called. + * This hook is invoked from user_delete_multiple() before field_attach_delete() + * is called and before users are actually removed from the database. * * Modules should additionally implement hook_user_cancel() to process stored * user data for other account cancellation methods. @@ -128,7 +126,7 @@ function hook_user_cancel($edit, $account, $method) { * a method. If #access is defined, the method cannot be configured as default * method. * - * @param &$methods + * @param $methods * An array containing user account cancellation methods, keyed by method id. * * @see user_cancel_methods() @@ -215,7 +213,7 @@ function hook_user_categories() { * user account object is loaded, modules may add to $edit['data'] in order * to have their data serialized on save. * - * @param &$edit + * @param $edit * The array of form values submitted by the user. * @param $account * The user object on which the operation is performed. @@ -238,7 +236,7 @@ function hook_user_presave(&$edit, $account, $category) { * The module should save its custom additions to the user object into the * database. * - * @param &$edit + * @param $edit * The array of form values submitted by the user. * @param $account * The user object on which the operation is being performed. @@ -263,7 +261,7 @@ function hook_user_insert(&$edit, $account, $category) { * Modules may use this hook to update their user data in a custom storage * after a user account has been updated. * - * @param &$edit + * @param $edit * The array of form values submitted by the user. * @param $account * The user object on which the operation is performed. @@ -285,7 +283,7 @@ function hook_user_update(&$edit, $account, $category) { /** * The user just logged in. * - * @param &$edit + * @param $edit * The array of form values submitted by the user. * @param $account * The user object on which the operation was just performed. @@ -368,6 +366,25 @@ function hook_user_view_alter(&$build) { $build['#post_render'][] = 'my_module_user_post_render'; } +/** + * Inform other modules that a user role is about to be saved. + * + * Modules implementing this hook can act on the user role object before + * it has been saved to the database. + * + * @param $role + * A user role object. + * + * @see hook_user_role_insert() + * @see hook_user_role_update() + */ +function hook_user_role_presave($role) { + // Set a UUID for the user role if it doesn't already exist + if (empty($role->uuid)) { + $role->uuid = uuid_uuid(); + } +} + /** * Inform other modules that a user role has been added. * diff --git a/modules/user/user.css b/modules/user/user.css index 85829f7e..d6ed7c36 100644 --- a/modules/user/user.css +++ b/modules/user/user.css @@ -1,4 +1,3 @@ -/* $Id: user.css,v 1.23 2010/09/19 18:10:42 dries Exp $ */ #permissions td.module { font-weight: bold; @@ -58,8 +57,10 @@ input.password-field { margin-bottom: 0.4em; } div.password-confirm { - display: inline; - padding-left: 1em; + float: right; /* LTR */ + margin-top: 1.5em; + visibility: hidden; + width: 17em; } div.form-item div.password-suggestions { padding: 0.2em 0.5em; @@ -70,19 +71,11 @@ div.form-item div.password-suggestions { div.password-suggestions ul { margin-bottom: 0; } +.confirm-parent, .password-parent { + clear: left; /* LTR */ margin: 0; - width: 34.3em; -} - -/** - * Password confirmation checker. - */ -.confirm-parent { - margin: 0; -} -div.password-confirm { - visibility: hidden; + width: 36.3em; } /* Generated by user.module but used by profile.module: */ diff --git a/modules/user/user.info b/modules/user/user.info index 714d1fdf..80f6962c 100644 --- a/modules/user/user.info +++ b/modules/user/user.info @@ -1,4 +1,3 @@ -; $Id: user.info,v 1.15 2010/12/20 19:59:44 webchick Exp $ name = User description = Manages the user registration and login system. package = Core @@ -10,8 +9,8 @@ required = TRUE configure = admin/config/people stylesheets[all][] = user.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/modules/user/user.install b/modules/user/user.install index 6ee92264..df94ad53 100644 --- a/modules/user/user.install +++ b/modules/user/user.install @@ -1,5 +1,4 @@ <?php -// $Id: user.install,v 1.69 2011/01/02 17:26:40 webchick Exp $ /** * @file @@ -854,6 +853,19 @@ function user_update_7015() { )); } +/** + * Update the database to match the schema. + */ +function user_update_7016() { + // Add field default. + db_change_field('users', 'uid', 'uid', array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + )); +} + /** * @} End of "addtogroup updates-6.x-to-7.x" */ diff --git a/modules/user/user.js b/modules/user/user.js index 7549a302..44c00f34 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -1,4 +1,3 @@ -// $Id: user.js,v 1.25 2010/11/30 23:55:11 webchick Exp $ (function ($) { /** @@ -17,7 +16,7 @@ Drupal.behaviors.password = { innerWrapper.addClass('password-parent'); // Add the password confirmation layer. - $('input.password-confirm', outerWrapper).after('<div class="password-confirm">' + translate['confirmTitle'] + ' <span></span></div>').parent().addClass('confirm-parent'); + $('input.password-confirm', outerWrapper).parent().prepend('<div class="password-confirm">' + translate['confirmTitle'] + ' <span></span></div>').addClass('confirm-parent'); var confirmInput = $('input.password-confirm', outerWrapper); var confirmResult = $('div.password-confirm', outerWrapper); var confirmChild = $('span', confirmResult); diff --git a/modules/user/user.module b/modules/user/user.module index 93429356..90d313b1 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1,5 +1,4 @@ <?php -// $Id: user.module,v 1.1229 2010/12/28 21:46:23 webchick Exp $ /** * @file @@ -326,9 +325,10 @@ class UserController extends DrupalDefaultEntityController { * user. So to avoid confusion and to avoid clobbering the global $user object, * it is a good idea to assign the result of this function to a different local * variable, generally $account. If you actually do want to act as the user you - * are loading, it is essential to call @code session_save_session(FALSE); - * @endcode first. See @link http://drupal.org/node/218104 Safely impersonating - * another user @endlink for more information. + * are loading, it is essential to call drupal_save_session(FALSE); first. + * See + * @link http://drupal.org/node/218104 Safely impersonating another user @endlink + * for more information. * * @param $uid * Integer specifying the user ID to load. @@ -404,8 +404,6 @@ function user_load_by_name($name) { function user_save($account, $edit = array(), $category = 'account') { $transaction = db_transaction(); try { - $table = drupal_get_schema('users'); - if (!empty($edit['pass'])) { // Allow alternate password hashing schemes. require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); @@ -419,6 +417,9 @@ function user_save($account, $edit = array(), $category = 'account') { // Avoid overwriting an existing password with a blank password. unset($edit['pass']); } + if (isset($edit['mail'])) { + $edit['mail'] = trim($edit['mail']); + } // Load the stored entity, if any. if (!empty($account->uid) && !isset($account->original)) { @@ -441,27 +442,18 @@ function user_save($account, $edit = array(), $category = 'account') { user_module_invoke('presave', $edit, $account, $category); // Invoke presave operations of Field Attach API and Entity API. Those APIs - // require a fully-fledged (and updated) entity object, so $edit is not - // necessarily sufficient, as it technically contains submitted form values - // only. Therefore, we need to clone $account into a new object and copy any - // new property values of $edit into it. - $account_updated = clone $account; + // require a fully-fledged and updated entity object. Therefore, we need to + // copy any new property values of $edit into it. foreach ($edit as $key => $value) { - $account_updated->$key = $value; - } - field_attach_presave('user', $account_updated); - module_invoke_all('entity_presave', $account_updated, 'user'); - // Update $edit with any changes modules might have applied to the account. - foreach ($account_updated as $key => $value) { - if (!property_exists($account, $key) || $value !== $account->$key) { - $edit[$key] = $value; - } + $account->$key = $value; } + field_attach_presave('user', $account); + module_invoke_all('entity_presave', $account, 'user'); if (is_object($account) && !$account->is_new) { // Process picture uploads. - if (!$delete_previous_picture = empty($edit['picture']->fid)) { - $picture = $edit['picture']; + if (!empty($account->picture->fid) && (!isset($account->original->picture->fid) || $account->picture->fid != $account->original->picture->fid)) { + $picture = $account->picture; // If the picture is a temporary file move it to its final location and // make it permanent. if (!$picture->status) { @@ -474,26 +466,23 @@ function user_save($account, $edit = array(), $category = 'account') { // Move the temporary file into the final location. if ($picture = file_move($picture, $destination, FILE_EXISTS_RENAME)) { - $delete_previous_picture = TRUE; $picture->status = FILE_STATUS_PERMANENT; - $edit['picture'] = file_save($picture); + $account->picture = file_save($picture); file_usage_add($picture, 'user', 'user', $account->uid); } } + // Delete the previous picture if it was deleted or replaced. + if (!empty($account->original->picture->fid)) { + file_usage_delete($account->original->picture, 'user', 'user', $account->uid); + file_delete($account->original->picture); + } } - - // Delete the previous picture if it was deleted or replaced. - if ($delete_previous_picture && !empty($account->picture->fid)) { - file_usage_delete($account->picture, 'user', 'user', $account->uid); - file_delete($account->picture); - } - - $edit['picture'] = empty($edit['picture']->fid) ? 0 : $edit['picture']->fid; + $account->picture = empty($account->picture->fid) ? 0 : $account->picture->fid; // Do not allow 'uid' to be changed. - $edit['uid'] = $account->uid; + $account->uid = $account->original->uid; // Save changes to the user table. - $success = drupal_write_record('users', $edit, 'uid'); + $success = drupal_write_record('users', $account, 'uid'); if ($success === FALSE) { // The query failed - better to abort the save than risk further // data loss. @@ -501,13 +490,13 @@ function user_save($account, $edit = array(), $category = 'account') { } // Reload user roles if provided. - if (isset($edit['roles']) && is_array($edit['roles'])) { + if ($account->roles != $account->original->roles) { db_delete('users_roles') ->condition('uid', $account->uid) ->execute(); $query = db_insert('users_roles')->fields(array('uid', 'rid')); - foreach (array_keys($edit['roles']) as $rid) { + foreach (array_keys($account->roles) as $rid) { if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) { $query->values(array( 'uid' => $account->uid, @@ -519,13 +508,13 @@ function user_save($account, $edit = array(), $category = 'account') { } // Delete a blocked user's sessions to kick them if they are online. - if (isset($edit['status']) && $edit['status'] == 0) { + if ($account->original->status != $account->status && $account->status == 0) { drupal_session_destroy_uid($account->uid); } // If the password changed, delete all open sessions and recreate // the current one. - if (!empty($edit['pass'])) { + if ($account->pass != $account->original->pass) { drupal_session_destroy_uid($account->uid); if ($account->uid == $GLOBALS['user']->uid) { drupal_session_regenerate(); @@ -533,61 +522,56 @@ function user_save($account, $edit = array(), $category = 'account') { } // Save Field data. - $entity = (object) $edit; - field_attach_update('user', $entity); - - // Refresh user object. - $user = user_load($account->uid, TRUE); - // Make the original, unchanged user account available to update hooks. - if (isset($account->original)) { - $user->original = $account->original; - } + field_attach_update('user', $account); // Send emails after we have the new user object. - if (isset($edit['status']) && $edit['status'] != $account->status) { + if ($account->status != $account->original->status) { // The user's status is changing; conditionally send notification email. - $op = $edit['status'] == 1 ? 'status_activated' : 'status_blocked'; - _user_mail_notify($op, $user); + $op = $account->status == 1 ? 'status_activated' : 'status_blocked'; + _user_mail_notify($op, $account); } - user_module_invoke('update', $edit, $user, $category); - module_invoke_all('entity_update', $user, 'user'); - unset($user->original); + // Update $edit with any interim changes to $account. + foreach ($account as $key => $value) { + if (!property_exists($account->original, $key) || $value !== $account->original->$key) { + $edit[$key] = $value; + } + } + user_module_invoke('update', $edit, $account, $category); + module_invoke_all('entity_update', $account, 'user'); } else { // Allow 'uid' to be set by the caller. There is no danger of writing an // existing user as drupal_write_record will do an INSERT. - if (empty($edit['uid'])) { - $edit['uid'] = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField()); + if (empty($account->uid)) { + $account->uid = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField()); } // Allow 'created' to be set by the caller. - if (!isset($edit['created'])) { - $edit['created'] = REQUEST_TIME; + if (!isset($account->created)) { + $account->created = REQUEST_TIME; } - $edit['mail'] = trim($edit['mail']); - $success = drupal_write_record('users', $edit); + $success = drupal_write_record('users', $account); if ($success === FALSE) { // On a failed INSERT some other existing user's uid may be returned. // We must abort to avoid overwriting their account. return FALSE; } - // Build a stub user object. - $user = (object) $edit; - $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user'; + // Make sure $account is properly initialized. + $account->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user'; - field_attach_insert('user', $user); - - user_module_invoke('insert', $edit, $user, $category); - module_invoke_all('entity_insert', $user, 'user'); + field_attach_insert('user', $account); + $edit = (array) $account; + user_module_invoke('insert', $edit, $account, $category); + module_invoke_all('entity_insert', $account, 'user'); // Save user roles. - if (isset($edit['roles']) && is_array($edit['roles'])) { + if (count($account->roles) > 1) { $query = db_insert('users_roles')->fields(array('uid', 'rid')); - foreach (array_keys($edit['roles']) as $rid) { + foreach (array_keys($account->roles) as $rid) { if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) { $query->values(array( - 'uid' => $edit['uid'], + 'uid' => $account->uid, 'rid' => $rid, )); } @@ -595,8 +579,13 @@ function user_save($account, $edit = array(), $category = 'account') { $query->execute(); } } + // Clear internal properties. + unset($account->is_new); + unset($account->original); + // Clear the static loading cache. + entity_get_controller('user')->resetCache(array($account->uid)); - return $user; + return $account; } catch (Exception $e) { $transaction->rollback(); @@ -655,7 +644,6 @@ function user_validate_name($name) { * If the address is valid, nothing is returned. */ function user_validate_mail($mail) { - $mail = trim($mail); if (!$mail) { return t('You must enter an e-mail address.'); } @@ -1203,6 +1191,11 @@ function user_account_form_validate($form, &$form_state) { } } + // Trim whitespace from mail, to prevent confusing 'e-mail not valid' + // warnings often caused by cutting and pasting. + $mail = trim($form_state['values']['mail']); + form_set_value($form['account']['mail'], $mail, $form_state); + // Validate the e-mail address, and check if it is taken by an existing user. if ($error = user_validate_mail($form_state['values']['mail'])) { form_set_error('mail', $error); @@ -1480,6 +1473,7 @@ function template_preprocess_user_picture(&$variables) { function theme_user_list($variables) { $users = $variables['users']; $title = $variables['title']; + $items = array(); if (!empty($users)) { foreach ($users as $user) { @@ -2518,8 +2512,8 @@ function user_build_content($account, $view_mode = 'full', $langcode = NULL) { $account->content = array(); // Build fields content. - field_attach_prepare_view('user', array($account->uid => $account), $view_mode); - entity_prepare_view('user', array($account->uid => $account)); + field_attach_prepare_view('user', array($account->uid => $account), $view_mode, $langcode); + entity_prepare_view('user', array($account->uid => $account), $langcode); $account->content += field_attach_view('user', $account, $view_mode, $langcode); // Populate $account->content with a render() array. @@ -2823,6 +2817,10 @@ function user_role_save($role) { $query->addExpression('MAX(weight)'); $role->weight = $query->execute()->fetchField() + 1; } + + // Let modules modify the user role before it is saved to the database. + module_invoke_all('user_role_presave', $role); + if (!empty($role->rid) && $role->name) { $status = drupal_write_record('role', $role, 'rid'); module_invoke_all('user_role_update', $role); diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index d9ad3beb..697a82d2 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: user.pages.inc,v 1.78 2010/12/01 00:29:41 webchick Exp $ /** * @file diff --git a/modules/user/user.permissions.js b/modules/user/user.permissions.js index ca4e5ff7..4ef576cd 100644 --- a/modules/user/user.permissions.js +++ b/modules/user/user.permissions.js @@ -1,4 +1,3 @@ -// $Id: user.permissions.js,v 1.2 2010/04/19 21:17:16 webchick Exp $ (function ($) { /** diff --git a/modules/user/user.test b/modules/user/user.test index 064b37e0..6ecbfac7 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -1,5 +1,9 @@ <?php -// $Id: user.test,v 1.111 2010/12/18 00:56:18 dries Exp $ + +/** + * @file + * Tests for user.module. + */ class UserRegistrationTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -104,6 +108,31 @@ class UserRegistrationTestCase extends DrupalWebTestCase { $this->assertText(t('Member for'), t('User can log in after administrator approval.')); } + function testRegistrationEmailDuplicates() { + // Don't require e-mail verification. + variable_set('user_email_verification', FALSE); + + // Allow registration by site visitors without administrator approval. + variable_set('user_register', USER_REGISTER_VISITORS); + + // Set up a user to check for duplicates. + $duplicate_user = $this->drupalCreateUser(); + + $edit = array(); + $edit['name'] = $this->randomName(); + $edit['mail'] = $duplicate_user->mail; + + // Attempt to create a new account using an existing e-mail address. + $this->drupalPost('user/register', $edit, t('Create new account')); + $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying an exact duplicate email address displays an error message')); + + // Attempt to bypass duplicate email registration validation by adding spaces. + $edit['mail'] = ' ' . $duplicate_user->mail . ' '; + + $this->drupalPost('user/register', $edit, t('Create new account')); + $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying a duplicate email address with added whitespace displays an error message')); + } + function testRegistrationDefaultValues() { // Allow registration by site visitors without administrator approval. variable_set('user_register', USER_REGISTER_VISITORS); @@ -406,6 +435,7 @@ class UserLoginTestCase extends DrupalWebTestCase { 'pass' => $account->pass_raw, ); $this->drupalPost('user', $edit, t('Log in')); + $this->assertNoFieldByXPath("//input[@name='pass' and @value!='']", NULL, t('Password value attribute is blank.')); if (isset($flood_trigger)) { if ($flood_trigger == 'user') { $this->assertRaw(format_plural(variable_get('user_failed_login_user_limit', 5), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', array('@url' => url('user/password')))); @@ -1899,7 +1929,7 @@ class UserTokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('user' => $account), array('language' => $language)); - $this->assertFalse(strcmp($output, $expected), t('Sanitized user token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Sanitized user token %token replaced.', array('%token' => $input))); } // Generate and test unsanitized tokens. @@ -1909,7 +1939,7 @@ class UserTokenReplaceTestCase extends DrupalWebTestCase { foreach ($tests as $input => $expected) { $output = token_replace($input, array('user' => $account), array('language' => $language, 'sanitize' => FALSE)); - $this->assertFalse(strcmp($output, $expected), t('Unsanitized user token %token replaced.', array('%token' => $input))); + $this->assertEqual($output, $expected, t('Unsanitized user token %token replaced.', array('%token' => $input))); } } } diff --git a/modules/user/user.tokens.inc b/modules/user/user.tokens.inc index e17eacf7..8dcea4b5 100644 --- a/modules/user/user.tokens.inc +++ b/modules/user/user.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: user.tokens.inc,v 1.9 2010/12/09 08:01:56 webchick Exp $ /** * @file diff --git a/profiles/minimal/minimal.info b/profiles/minimal/minimal.info index 96404bc3..f7102f95 100644 --- a/profiles/minimal/minimal.info +++ b/profiles/minimal/minimal.info @@ -1,4 +1,3 @@ -; $Id: minimal.info,v 1.1 2010/01/04 23:08:34 webchick Exp $ name = Minimal description = Start with only a few modules enabled. version = VERSION @@ -7,8 +6,8 @@ dependencies[] = block dependencies[] = dblog files[] = minimal.profile -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/profiles/minimal/minimal.install b/profiles/minimal/minimal.install index ea325998..059f038c 100644 --- a/profiles/minimal/minimal.install +++ b/profiles/minimal/minimal.install @@ -1,5 +1,4 @@ <?php -// $Id: minimal.install,v 1.6 2010/07/08 03:41:27 webchick Exp $ /** * Implements hook_install(). diff --git a/profiles/minimal/minimal.profile b/profiles/minimal/minimal.profile index 8fb1b82f..ff8f2810 100644 --- a/profiles/minimal/minimal.profile +++ b/profiles/minimal/minimal.profile @@ -1,5 +1,4 @@ <?php -// $Id: minimal.profile,v 1.2 2010/07/22 16:16:42 dries Exp $ /** * Implements hook_form_FORM_ID_alter(). diff --git a/profiles/minimal/translations/README.txt b/profiles/minimal/translations/README.txt index d5cf7501..a0afa516 100644 --- a/profiles/minimal/translations/README.txt +++ b/profiles/minimal/translations/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.1 2010/09/22 01:49:17 webchick Exp $ This directory should be used to place downloaded translations for installing Drupal core. diff --git a/profiles/standard/standard.info b/profiles/standard/standard.info index 9abd5fa5..857f7062 100644 --- a/profiles/standard/standard.info +++ b/profiles/standard/standard.info @@ -1,4 +1,3 @@ -; $Id: standard.info,v 1.2 2010/10/25 15:48:41 webchick Exp $ name = Standard description = Install with commonly used features pre-configured. version = VERSION @@ -26,8 +25,8 @@ dependencies[] = file dependencies[] = rdf files[] = standard.profile -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/profiles/standard/standard.install b/profiles/standard/standard.install index 8e0b47b1..70829064 100644 --- a/profiles/standard/standard.install +++ b/profiles/standard/standard.install @@ -1,5 +1,4 @@ <?php -// $Id: standard.install,v 1.30 2011/01/04 18:24:24 webchick Exp $ /** * Implements hook_install(). @@ -272,7 +271,7 @@ function standard_install() { $description = st('Use tags to group articles on similar topics into categories.'); $help = st('Enter a comma-separated list of words to describe your content.'); $vocabulary = (object) array( - 'name' => 'Tags', + 'name' => st('Tags'), 'description' => $description, 'machine_name' => 'tags', 'help' => $help, @@ -299,7 +298,7 @@ function standard_install() { $instance = array( 'field_name' => 'field_' . $vocabulary->machine_name, 'entity_type' => 'node', - 'label' => $vocabulary->name, + 'label' => 'Tags', 'bundle' => 'article', 'description' => $vocabulary->help, 'widget' => array( diff --git a/profiles/standard/standard.profile b/profiles/standard/standard.profile index 97d5d876..7671c12a 100644 --- a/profiles/standard/standard.profile +++ b/profiles/standard/standard.profile @@ -1,5 +1,4 @@ <?php -// $Id: standard.profile,v 1.2 2010/07/22 16:16:42 dries Exp $ /** * Implements hook_form_FORM_ID_alter(). diff --git a/profiles/standard/translations/README.txt b/profiles/standard/translations/README.txt index d5cf7501..a0afa516 100644 --- a/profiles/standard/translations/README.txt +++ b/profiles/standard/translations/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.1 2010/09/22 01:49:17 webchick Exp $ This directory should be used to place downloaded translations for installing Drupal core. diff --git a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info index 8745a56d..030649d1 100644 --- a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info +++ b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info @@ -1,4 +1,3 @@ -; $Id: drupal_system_listing_compatible_test.info,v 1.2 2010/12/21 16:31:47 webchick Exp $ name = "Drupal system listing compatible test" description = "Support module for testing the drupal_system_listing function." package = Testing @@ -6,8 +5,8 @@ version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module index 4155b320..b3d9bbc7 100644 --- a/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module +++ b/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module @@ -1,2 +1 @@ <?php -// $Id: drupal_system_listing_compatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $ diff --git a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info index beba696f..f61b8724 100644 --- a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info +++ b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info @@ -1,4 +1,3 @@ -; $Id: drupal_system_listing_incompatible_test.info,v 1.2 2010/12/21 16:31:47 webchick Exp $ name = "Drupal system listing incompatible test" description = "Support module for testing the drupal_system_listing function." package = Testing @@ -9,8 +8,8 @@ version = VERSION core = 6.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module index d5db920e..b3d9bbc7 100644 --- a/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module +++ b/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module @@ -1,2 +1 @@ <?php -// $Id: drupal_system_listing_incompatible_test.module,v 1.1 2010/11/15 00:37:08 webchick Exp $ diff --git a/profiles/testing/testing.info b/profiles/testing/testing.info index 82fad905..dc403e5f 100644 --- a/profiles/testing/testing.info +++ b/profiles/testing/testing.info @@ -1,12 +1,11 @@ -; $Id: testing.info,v 1.2 2010/08/27 12:36:53 webchick Exp $ name = Testing description = Minimal profile for running tests. Includes absolutely required modules only. version = VERSION core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/profiles/testing/testing.install b/profiles/testing/testing.install index 6426140c..192704d7 100644 --- a/profiles/testing/testing.install +++ b/profiles/testing/testing.install @@ -1,5 +1,4 @@ <?php -// $Id: testing.install,v 1.2 2010/08/27 12:36:53 webchick Exp $ /** * Implements hook_install(). diff --git a/profiles/testing/testing.profile b/profiles/testing/testing.profile index 5d804dec..a4abe2da 100644 --- a/profiles/testing/testing.profile +++ b/profiles/testing/testing.profile @@ -1,3 +1,2 @@ <?php -// $Id: testing.profile,v 1.1 2010/08/22 15:31:18 dries Exp $ diff --git a/robots.txt b/robots.txt index a5490c6e..490fa59f 100644 --- a/robots.txt +++ b/robots.txt @@ -1,4 +1,3 @@ -# $Id: robots.txt,v 1.15 2010/12/29 04:05:07 webchick Exp $ # # robots.txt # diff --git a/scripts/code-clean.sh b/scripts/code-clean.sh index b5d69ec3..3338b6ad 100644 --- a/scripts/code-clean.sh +++ b/scripts/code-clean.sh @@ -1,5 +1,4 @@ #!/bin/sh -# $Id: code-clean.sh,v 1.10 2009/03/09 20:46:37 dries Exp $ find . -name "*~" -type f | xargs rm -f find . -name ".#*" -type f | xargs rm -f diff --git a/scripts/cron-curl.sh b/scripts/cron-curl.sh index df4ed998..9b168ab3 100644 --- a/scripts/cron-curl.sh +++ b/scripts/cron-curl.sh @@ -1,4 +1,3 @@ #!/bin/sh -# $Id: cron-curl.sh,v 1.3 2006/08/22 07:38:24 dries Exp $ curl --silent --compressed http://example.com/cron.php diff --git a/scripts/cron-lynx.sh b/scripts/cron-lynx.sh index 9ceb2dbd..904667ac 100644 --- a/scripts/cron-lynx.sh +++ b/scripts/cron-lynx.sh @@ -1,4 +1,3 @@ #!/bin/sh -# $Id: cron-lynx.sh,v 1.3 2006/08/22 07:38:24 dries Exp $ /usr/bin/lynx -source http://example.com/cron.php > /dev/null 2>&1 diff --git a/scripts/drupal.sh b/scripts/drupal.sh index 435f6144..5d064f57 100755 --- a/scripts/drupal.sh +++ b/scripts/drupal.sh @@ -1,6 +1,5 @@ #!/usr/bin/env php <?php -// $Id: drupal.sh,v 1.9 2009/09/19 10:38:47 dries Exp $ /** * Drupal shell execution script diff --git a/scripts/dump-database-d6.sh b/scripts/dump-database-d6.sh index 0feb6347..41146b07 100644 --- a/scripts/dump-database-d6.sh +++ b/scripts/dump-database-d6.sh @@ -1,6 +1,5 @@ #!/usr/bin/env php <?php -// $Id: dump-database-d6.sh,v 1.3 2010/07/30 01:28:00 dries Exp $ /** * Dump a Drupal 6 database into a Drupal 7 PHP script to test the upgrade @@ -34,7 +33,6 @@ include_once dirname(__FILE__) . '/../includes/utility.inc'; // Output the PHP header. $output = <<<ENDOFHEADER <?php -// \$Id\$ /** * @file diff --git a/scripts/generate-d6-content.sh b/scripts/generate-d6-content.sh index b5819755..bba61cae 100644 --- a/scripts/generate-d6-content.sh +++ b/scripts/generate-d6-content.sh @@ -1,6 +1,5 @@ #!/usr/bin/env php <?php -// $Id: generate-d6-content.sh,v 1.3 2010/09/11 00:39:49 webchick Exp $ /** * Generate content for a Drupal 6 database to test the upgrade process. diff --git a/scripts/password-hash.sh b/scripts/password-hash.sh index 3a7243e9..004421a8 100755 --- a/scripts/password-hash.sh +++ b/scripts/password-hash.sh @@ -1,6 +1,5 @@ #!/usr/bin/php <?php -// $Id: password-hash.sh,v 1.7 2010/05/01 08:12:23 dries Exp $ /** * Drupal hash script - to generate a hash from a plaintext password diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 0c10d5dd..2cfbcac9 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -1,5 +1,4 @@ <?php -// $Id: run-tests.sh,v 1.43 2010/11/13 13:54:58 dries Exp $ /** * @file * This script runs Drupal tests from command line. diff --git a/sites/all/README.txt b/sites/all/README.txt index 6fef9a4a..c8970883 100644 --- a/sites/all/README.txt +++ b/sites/all/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.4 2009/03/18 09:53:04 dries Exp $ This directory should be used to place downloaded and custom modules and themes which are common to all sites. Keeping contributed and diff --git a/sites/all/modules/README.txt b/sites/all/modules/README.txt index d18eb4ff..f4e35b55 100644 --- a/sites/all/modules/README.txt +++ b/sites/all/modules/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.1 2009/01/22 04:33:38 webchick Exp $ This directory should be used to place downloaded and custom modules which are common to all sites. This will allow you to more easily diff --git a/sites/all/modules/ctools/API.txt b/sites/all/modules/ctools/API.txt index 2187e8a5..29000a48 100644 --- a/sites/all/modules/ctools/API.txt +++ b/sites/all/modules/ctools/API.txt @@ -1,12 +1,25 @@ -API.txt: $Id: API.txt,v 1.16 2010/10/11 22:18:22 sdboyer Exp $ +Current API Version: 2.0.1 + +Please note that the API version is an internal number and does not match release numbers. It is entirely possible that releases will not increase the API version number, and increasing this number too often would burden contrib module maintainers who need to keep up with API changes. This file contains a log of changes to the API. -API Version 2.0 + +API Version 2.0.1 + Introduce ctools_export_crud_enable(), ctools_export_crud_disable() and + ctools_export_crud_set_status() and requisite changes. + Introduce 'object factory' to export schema, allowing modules to control + how the exportable objects are instantiated. + +API Version 2.0 Remove the deprecated callback-based behavior of the 'defaults' property on plugin types; array addition is now the only option. If you need more complex logic, do it with the 'process' callback. Introduce a global plugin type registration hook and remove the per-plugin type magic callbacks. + Introduce $owner . '_' . $api . '_hook_name' allowing modules to use their own + API hook in place of 'hook_ctools_plugin_api'. + Introduce ctools_plugin_api_get_hook() to get the hook name above. + Introduce 'cache defaults' and 'default cache bin' keys to export.inc Versions prior to 2.0 have been removed from this document. See the D6 version for that information. diff --git a/sites/all/modules/ctools/CHANGELOG.txt b/sites/all/modules/ctools/CHANGELOG.txt index 28967f3e..c5bd5e6d 100644 --- a/sites/all/modules/ctools/CHANGELOG.txt +++ b/sites/all/modules/ctools/CHANGELOG.txt @@ -1,5 +1,12 @@ Current API VERSION: 2.0. See API.txt for more information. +ctools 7.x-1.x-dev +================== +#1008120: "New custom content" shows empty form if custom content panes module is not enabled. +#999302 by troky: Fix jump menu. Apparently this wasn't actually committed the last time it was committed. +#1065976 by tekante and David_Rothstein: Reset plugin static cache during module enable to prevent stale data from harming export ui. +#1016510 by EclipseGC: Make the taxonomy system page functional. + ctools 7.x-1.x-alpha2 (05-Jan-2011) =================================== diff --git a/sites/all/modules/ctools/bulk_export/bulk_export.css b/sites/all/modules/ctools/bulk_export/bulk_export.css index a7df2cf5..14ac83b0 100644 --- a/sites/all/modules/ctools/bulk_export/bulk_export.css +++ b/sites/all/modules/ctools/bulk_export/bulk_export.css @@ -1,4 +1,3 @@ -/* $Id: bulk_export.css,v 1.1 2009/07/12 11:32:30 sdboyer Exp $ */ div.export-container { width: 48%; @@ -13,6 +12,13 @@ div.export-container table { div.export-container table input, div.export-container table th, div.export-container table td { - padding: 0 0 0 .5em; + padding: 0 0 2px .5em; margin: 0; -} \ No newline at end of file + border-right: none; + border-left: none; + vertical-align: center; +} + +div.export-container .select-all { + width: 1.5em; +} diff --git a/sites/all/modules/ctools/bulk_export/bulk_export.info b/sites/all/modules/ctools/bulk_export/bulk_export.info index 12f230b2..7e17fd73 100644 --- a/sites/all/modules/ctools/bulk_export/bulk_export.info +++ b/sites/all/modules/ctools/bulk_export/bulk_export.info @@ -1,13 +1,12 @@ -; $Id: bulk_export.info,v 1.4 2011/01/01 00:01:46 merlinofchaos Exp $ name = Bulk Export description = Performs bulk exporting of data objects known about by Chaos tools. core = 7.x dependencies[] = ctools package = Chaos tool suite -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/bulk_export/bulk_export.module b/sites/all/modules/ctools/bulk_export/bulk_export.module index 9ac962ce..f614f577 100644 --- a/sites/all/modules/ctools/bulk_export/bulk_export.module +++ b/sites/all/modules/ctools/bulk_export/bulk_export.module @@ -1,5 +1,4 @@ <?php -// $Id: bulk_export.module,v 1.6 2010/10/11 22:18:24 sdboyer Exp $ /** * @file @@ -66,7 +65,7 @@ function bulk_export_export() { drupal_set_title(t('Bulk export results')); $output = ''; $module_code = ''; - $api_code = ''; + $api_code = array(); $dependencies = array(); foreach ($form_state['code'] as $module => $api_info) { if ($module == 'general') { @@ -74,56 +73,61 @@ function bulk_export_export() { } else { foreach ($api_info as $api => $info) { - $api_code .= " if (\$module == '$module' && \$api == '$api') {\n"; - $api_code .= " return array('version' => $info[version]);\n"; - $api_code .= " }\n"; + $api_hook = ctools_plugin_api_get_hook($module, $api); + if (empty($api_code[$api_hook])) { + $api_code[$api_hook] = ''; + } + $api_code[$api_hook] .= " if (\$module == '$module' && \$api == '$api') {\n"; + $api_code[$api_hook] .= " return array('version' => $info[version]);\n"; + $api_code[$api_hook] .= " }\n"; $dependencies[$module] = TRUE; $file = $form_state['module'] . '.' . $api . '.inc'; - $code = "<?php\n"; - $code .= "// \$Id" . ": $\n\n"; + $code = "<?php\n\n"; $code .= "/**\n"; $code .= " * @file\n"; $code .= " * Bulk export of $api objects generated by Bulk export module.\n"; $code .= " */\n\n"; $code .= $info['code']; - $output .= drupal_render(drupal_get_form('ctools_export_form', $code, t('Place this in @file', array('@file' => $file)))); + $export_form = drupal_get_form('ctools_export_form', $code, t('Place this in @file', array('@file' => $file))); + $output .= drupal_render($export_form); } } } // Add hook_ctools_plugin_api at the top of the module code, if there is any. if ($api_code) { - $api = "/**\n"; - $api .= " * Implements hook_ctools_plugin_api().\n"; - $api .= " */\n"; - $api .= "function $form_state[module]_ctools_plugin_api(\$module, \$api) {\n"; - $api .= $api_code; - $api .= "}\n"; - $module_code = $api . $module_code; + foreach ($api_code as $api_hook => $text) { + $api = "\n/**\n"; + $api .= " * Implement hook_$api_hook().\n"; + $api .= " */\n"; + $api .= "function $form_state[module]_$api_hook(\$module, \$api) {\n"; + $api .= $text; + $api .= "}\n"; + $module_code = $api . $module_code; + } } if ($module_code) { - $module = "<?php\n"; - $module .= "// \$Id" . ": $\n\n"; + $module = "<?php\n\n"; $module .= "/**\n"; $module .= " * @file\n"; $module .= " * Bulk export of objects generated by Bulk export module.\n"; - $module .= " */\n\n"; + $module .= " */\n"; $module .= $module_code; - $output = drupal_render(drupal_get_form('ctools_export_form', $module, t('Place this in @file', array('@file' => $form_state['module'] . '.module')))) . $output; + $export_form = drupal_get_form('ctools_export_form', $module, t('Place this in @file', array('@file' => $form_state['module'] . '.module'))); + $output = drupal_render($export_form) . $output; } - $info = "; \$Id" . ": $\n"; // The break in the string prevents CVS from subbing the ID. - $info .= strtr("name = @module export module\n", array('@module' => $form_state['module'])); + $info = strtr("name = @module export module\n", array('@module' => $form_state['module'])); $info .= strtr("description = Export objects from CTools\n", array('@module' => $form_state['values']['name'])); foreach ($dependencies as $module => $junk) { $info .= "dependencies[] = $module\n"; } $info .= "package = Chaos tool suite\n"; $info .= "core = 7.x\n"; - $info .= "files[] = " . check_plain($form_state['module'] . '.info') . "\n"; - $output = drupal_render(drupal_get_form('ctools_export_form', $info, t('Place this in @file', array('@file' => $form_state['module'] . '.info')))) . $output; + $export_form = drupal_get_form('ctools_export_form', $info, t('Place this in @file', array('@file' => $form_state['module'] . '.info'))); + $output = drupal_render($export_form) . $output; } diff --git a/sites/all/modules/ctools/css/button.css b/sites/all/modules/ctools/css/button.css new file mode 100644 index 00000000..91a60449 --- /dev/null +++ b/sites/all/modules/ctools/css/button.css @@ -0,0 +1,32 @@ +/* $Id$ */ + +.ctools-button-processed { + border-style: solid; + border-width: 1px; + display: inline-block; + line-height: 1; +} + +.ctools-button-processed:hover { + cursor: pointer; +} + +.ctools-button-processed .ctools-content { + padding-bottom: 2px; + padding-top: 2px; +} + +.ctools-no-js .ctools-content ul, +.ctools-button-processed .ctools-content ul { + list-style-image: none; + list-style-type: none; +} + +.ctools-button-processed li { + line-height: 1.3333; +} + +.ctools-button li a { + padding-left: 12px; + padding-right: 12px; +} \ No newline at end of file diff --git a/sites/all/modules/ctools/css/collapsible-div.css b/sites/all/modules/ctools/css/collapsible-div.css index b1fc6e1a..91e78769 100644 --- a/sites/all/modules/ctools/css/collapsible-div.css +++ b/sites/all/modules/ctools/css/collapsible-div.css @@ -1,4 +1,3 @@ -/* $Id: collapsible-div.css,v 1.2 2008/11/27 17:29:34 merlinofchaos Exp $ */ .ctools-collapsible-container .ctools-toggle { float: left; diff --git a/sites/all/modules/ctools/css/context.css b/sites/all/modules/ctools/css/context.css index 8522156b..5093104c 100644 --- a/sites/all/modules/ctools/css/context.css +++ b/sites/all/modules/ctools/css/context.css @@ -1,4 +1,3 @@ -/* $Id: context.css,v 1.2 2008/12/05 00:15:36 merlinofchaos Exp $ */ .ctools-context-holder .ctools-context-title { float: left; width: 49%; diff --git a/sites/all/modules/ctools/css/ctools.css b/sites/all/modules/ctools/css/ctools.css index 4dede743..7372988d 100644 --- a/sites/all/modules/ctools/css/ctools.css +++ b/sites/all/modules/ctools/css/ctools.css @@ -1,4 +1,3 @@ -/* $Id: ctools.css,v 1.5 2010/09/07 09:02:50 sdboyer Exp $ */ .ctools-locked { color: red; border: 1px solid red; diff --git a/sites/all/modules/ctools/css/dropbutton.css b/sites/all/modules/ctools/css/dropbutton.css new file mode 100644 index 00000000..7825111a --- /dev/null +++ b/sites/all/modules/ctools/css/dropbutton.css @@ -0,0 +1,67 @@ +/* $Id$ */ + +.ctools-dropbutton-processed { + padding-right: 18px; + position: relative; + background-color: inherit; +} + +.ctools-dropbutton-processed.open { + z-index: 200; +} + +.ctools-dropbutton-processed .ctools-content li, +.ctools-dropbutton-processed .ctools-content a { + display: block; +} + +.ctools-dropbutton-processed .ctools-link { + bottom: 0; + display: block; + height: auto; + position: absolute; + right: 0; + text-indent: -9999px; /* LTR */ + top: 0; + width: 17px; +} + +.ctools-dropbutton-processed .ctools-link a { + overflow: hidden; +} + +.ctools-dropbutton-processed .ctools-content ul { + margin: 0; + overflow: hidden; +} + +.ctools-dropbutton-processed.open li + li { + padding-top: 4px; +} + +/** + * This creates the dropbutton arrow and inherits the link color + */ +.ctools-twisty { + border-bottom-color: transparent; + border-left-color: transparent; + border-right-color: transparent; + border-style: solid; + border-width: 4px 4px 0; + line-height: 0; + right: 6px; + position: absolute; + top: 0.75em; +} + +.ctools-dropbutton-processed.open .ctools-twisty { + border-bottom: 4px solid; + border-left-color: transparent; + border-right-color: transparent; + border-top-color: transparent; + top: 0.5em; +} + +.ctools-no-js .ctools-twisty { + display: none; +} diff --git a/sites/all/modules/ctools/css/dropdown.css b/sites/all/modules/ctools/css/dropdown.css index f1ad4792..bb50f3f4 100644 --- a/sites/all/modules/ctools/css/dropdown.css +++ b/sites/all/modules/ctools/css/dropdown.css @@ -1,4 +1,3 @@ -/* $Id: dropdown.css,v 1.6 2010/10/11 22:18:23 sdboyer Exp $ */ html.js div.ctools-dropdown div.ctools-dropdown-container { z-index: 1001; display: none; diff --git a/sites/all/modules/ctools/css/export-ui-list.css b/sites/all/modules/ctools/css/export-ui-list.css index f53d886d..170d128a 100644 --- a/sites/all/modules/ctools/css/export-ui-list.css +++ b/sites/all/modules/ctools/css/export-ui-list.css @@ -1,4 +1,3 @@ -/* $Id: export-ui-list.css,v 1.3 2011/01/05 23:16:59 merlinofchaos Exp $ */ body form#ctools-export-ui-list-form { margin: 0 0 20px 0; } @@ -30,4 +29,17 @@ tr.ctools-export-ui-disabled td { th.ctools-export-ui-operations, td.ctools-export-ui-operations { text-align: right; /* LTR */ + vertical-align: top; +} + +/* Force the background color to inherit so that the dropbuttons do not need + a specific background color. */ +td.ctools-export-ui-operations { + background-color: inherit; +} + +td.ctools-export-ui-operations .ctools-dropbutton { + text-align: left; /* LTR */ + position: absolute; + right: 10px; } diff --git a/sites/all/modules/ctools/css/modal.css b/sites/all/modules/ctools/css/modal.css index c3faf2d7..66c4a1c3 100644 --- a/sites/all/modules/ctools/css/modal.css +++ b/sites/all/modules/ctools/css/modal.css @@ -1,4 +1,3 @@ -/* $Id: modal.css,v 1.9 2011/01/01 00:31:27 merlinofchaos Exp $ */ div.ctools-modal-content { background: #fff; color: #000; @@ -122,7 +121,6 @@ div.ctools-modal-content .option-text-aligner label.hidden-options { background: none; } - div.ctools-modal-content .dependent-options { padding-left: 30px; } diff --git a/sites/all/modules/ctools/css/stylizer.css b/sites/all/modules/ctools/css/stylizer.css index 4a63f408..a16ec789 100644 --- a/sites/all/modules/ctools/css/stylizer.css +++ b/sites/all/modules/ctools/css/stylizer.css @@ -1,4 +1,3 @@ -/* $Id: stylizer.css,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ */ /* Farbtastic placement */ .color-form { diff --git a/sites/all/modules/ctools/css/wizard.css b/sites/all/modules/ctools/css/wizard.css index ce305f86..d42a2db0 100644 --- a/sites/all/modules/ctools/css/wizard.css +++ b/sites/all/modules/ctools/css/wizard.css @@ -1,4 +1,3 @@ -/* $Id: wizard.css,v 1.1 2008/12/06 02:13:48 merlinofchaos Exp $ */ .wizard-trail { font-size: 120%; diff --git a/sites/all/modules/ctools/ctools.api.php b/sites/all/modules/ctools/ctools.api.php index 78ae15c9..8e74d06b 100644 --- a/sites/all/modules/ctools/ctools.api.php +++ b/sites/all/modules/ctools/ctools.api.php @@ -1,5 +1,4 @@ <?php -// $Id: ctools.api.php,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -82,6 +81,42 @@ function hook_ctools_plugin_directory($owner, $plugin_type) { // Finally, if nothing matches, it's safe to return nothing at all (or NULL). } +/** + * Alter a plugin before it has been processed. + * + * This hook is useful for altering flags or other information that will be + * used or possibly overriden by the process hook if defined. + * + * @param $plugin + * An associative array defining a plugin. + * @param $info + * An associative array of plugin type info. + */ +function hook_ctools_plugin_pre_alter(&$plugin, &$info) { + // Override a function defined by the plugin. + if ($info['type'] == 'my_type') { + $plugin['my_flag'] = 'new_value'; + } +} + +/** + * Alter a plugin after it has been processed. + * + * This hook is useful for overriding the final values for a plugin after it + * has been processed. + * + * @param $plugin + * An associative array defining a plugin. + * @param $info + * An associative array of plugin type info. + */ +function hook_ctools_plugin_post_alter(&$plugin, &$info) { + // Override a function defined by the plugin. + if ($info['type'] == 'my_type') { + $plugin['my_function'] = 'new_function'; + } +} + /** * @} End of "addtogroup hooks". - */ \ No newline at end of file + */ diff --git a/sites/all/modules/ctools/ctools.info b/sites/all/modules/ctools/ctools.info index 81a66f2f..08b78877 100644 --- a/sites/all/modules/ctools/ctools.info +++ b/sites/all/modules/ctools/ctools.info @@ -1,4 +1,3 @@ -; $Id: ctools.info,v 1.10 2011/01/01 00:01:46 merlinofchaos Exp $ name = Chaos tools description = A library of helpful tools by Merlin of Chaos. core = 7.x @@ -7,9 +6,9 @@ files[] = includes/context.inc files[] = includes/math-expr.inc files[] = includes/stylizer.inc -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/ctools.install b/sites/all/modules/ctools/ctools.install index c050f228..e4447db0 100644 --- a/sites/all/modules/ctools/ctools.install +++ b/sites/all/modules/ctools/ctools.install @@ -1,5 +1,4 @@ <?php -// $Id: ctools.install,v 1.15 2010/09/07 09:02:50 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools.module b/sites/all/modules/ctools/ctools.module index 3b90bb73..7b7499ee 100644 --- a/sites/all/modules/ctools/ctools.module +++ b/sites/all/modules/ctools/ctools.module @@ -1,5 +1,4 @@ <?php -// $Id: ctools.module,v 1.40 2011/01/05 20:06:57 merlinofchaos Exp $ /** * @file @@ -10,7 +9,7 @@ * must be implemented in the module file. */ -define('CTOOLS_API_VERSION', '2.0-alpha1'); +define('CTOOLS_API_VERSION', '2.0.1'); /** * Test the CTools API version. @@ -112,10 +111,21 @@ function ctools_include($file, $module = 'ctools', $dir = 'includes') { if (!isset($used[$module][$dir][$file])) { require_once DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "$dir$file.inc"; - $used[$module][$dir][$file] = true; + $used[$module][$dir][$file] = TRUE; } } +/** + * Include .inc files in a form context. + * + * This is a variant of ctools_include that will save information in the + * the form_state so that cached forms will properly include things. + */ +function ctools_form_include(&$form_state, $file, $module = 'ctools', $dir = 'includes') { + $dir = '/' . ($dir ? $dir . '/' : ''); + form_load_include($form_state, 'inc', $module, $dir . $file); +} + /** * Provide the proper path to an image as necessary. * @@ -150,6 +160,28 @@ function ctools_add_css($file, $module = 'ctools', $dir = 'css') { drupal_add_css(drupal_get_path('module', $module) . "/$dir/$file.css"); } +/** + * Format a css file name for use with $form['#attached']['css']. + * + * This helper function is used by ctools but can also be used in other + * modules in the same way as explained in the comments of ctools_include. + * + * @code + * $form['#attached']['css'] = array(ctools_attach_css('collapsible-div')); + * $form['#attached']['css'][ctools_attach_css('collapsible-div')] = array('preprocess' => FALSE); + * @endcode + * + * @param $file + * The base file name to be included. + * @param $module + * Optional module containing the include. + * @param $dir + * Optional subdirectory containing the include file. + */ +function ctools_attach_css($file, $module = 'ctools', $dir = 'css') { + return drupal_get_path('module', $module) . "/$dir/$file.css"; +} + /** * Include js files as necessary. * @@ -193,15 +225,12 @@ function ctools_attach_js($file, $module = 'ctools', $dir = 'js') { * * @return * An array of role names keyed by role ID. + * + * @deprecated + * user_roles() should be used instead. */ function ctools_get_roles() { - static $roles = NULL; - if (!isset($roles)) { - $roles = user_roles(TRUE); - unset($roles[DRUPAL_AUTHENTICATED_RID]); - } - - return $roles; + return user_roles(); } /* @@ -338,8 +367,8 @@ function ctools_init() { * Shutdown handler used during ajax operations to help catch fatal errors. */ function ctools_shutdown_handler() { - if (function_exists('error_get_last') AND ($error = error_get_last())){ - switch($error['type']){ + if (function_exists('error_get_last') AND ($error = error_get_last())) { + switch ($error['type']) { case E_ERROR: case E_CORE_ERROR: case E_COMPILE_ERROR: @@ -370,7 +399,7 @@ function ctools_shutdown_handler() { function ctools_theme() { ctools_include('utility'); $items = array(); - _ctools_passthrough($items, 'theme'); + ctools_passthrough('ctools', 'theme', $items); return $items; } @@ -380,7 +409,7 @@ function ctools_theme() { function ctools_menu() { ctools_include('utility'); $items = array(); - _ctools_passthrough($items, 'menu'); + ctools_passthrough('ctools', 'menu', $items); return $items; } @@ -389,7 +418,8 @@ function ctools_menu() { */ function ctools_cron() { ctools_include('utility'); - _ctools_passthrough($items, 'cron'); + $items = array(); + ctools_passthrough('ctools', 'cron', $items); } /** @@ -400,7 +430,7 @@ function ctools_flush_caches() { // in an inconsistent fashion and it does not necessarily mean to *flush* // caches when running from cron. Instead it's just getting a list of cache // tables and may not do any flushing. - if (variable_get('cron_semaphore', FALSE)) { + if (!empty($GLOBALS['locks']['cron'])) { return; } @@ -409,15 +439,12 @@ function ctools_flush_caches() { } /** - * Provide a search form with a different id so that form_alters will miss it - * and thus not get advanced search settings. + * Implements hook_element_info_alter(). + * */ -function ctools_forms() { - $forms['ctools_search_form']= array( - 'callback' => 'search_form', - ); - - return $forms; +function ctools_element_info_alter(&$type) { + ctools_include('dependent'); + ctools_dependent_element_info_alter($type); } /** @@ -467,7 +494,7 @@ function ctools_ctools_plugin_type() { ctools_include('utility'); $items = array(); // Add all the plugins that have their own declaration space elsewhere. - _ctools_passthrough($items, 'plugin-type'); + ctools_passthrough('ctools', 'plugin-type', $items); return $items; } @@ -480,11 +507,11 @@ function ctools_ctools_plugin_type() { * templates based upon input when the panel was configured. */ function ctools_preprocess_node(&$vars) { - // The 'panel_identifier' attribute of the node is added when the pane is + // The 'ctools_template_identifier' attribute of the node is added when the pane is // rendered. - if (!empty($vars['node']->panel_identifier)) { - $vars['panel_identifier'] = check_plain($vars['node']->panel_identifier); - $vars['template_files'][] = 'node-panel-' . check_plain($vars['node']->panel_identifier); + if (!empty($vars['node']->ctools_template_identifier)) { + $vars['ctools_template_identifier'] = check_plain($vars['node']->ctools_template_identifier); + $vars['theme_hook_suggestions'][] = 'node__panel__' . check_plain($vars['node']->ctools_template_identifier); } } @@ -618,11 +645,10 @@ function ctools_export_ui_load($item_name, $plugin_name) { if (!$return) { ctools_include('export-ui'); $plugin = ctools_get_export_ui($plugin_name); + $handler = ctools_export_ui_get_handler($plugin); - if ($plugin) { - // Get the load callback. - $item = ctools_export_crud_load($plugin['schema'], $item_name); - return empty($item) ? FALSE : $item; + if ($handler) { + return $handler->load_item($item_name); } } @@ -734,10 +760,59 @@ function ctools_block_list_alter(&$blocks) { foreach ($blocks as $block_id => $block) { // @todo -- possibly we can set configuration for this so that users can // specify which blocks will not get rendered. - if (substr_compare($block->region, 'sidebar', 0)) { + if (substr_compare($block->region, 'sidebar', 0) >= 0) { unset($blocks[$block_id]); } } } } +/** + * Implement hook_modules_enabled to clear static caches for detecting new plugins + */ +function ctools_modules_enabled($modules) { + ctools_include('plugins'); + ctools_get_plugins_reset(); +} + +/** + * Menu theme callback. + * + * This simply ensures that Panels ajax calls are rendered in the same + * theme as the original page to prevent .css file confusion. + * + * To use this, set this as the theme callback on AJAX related menu + * items. Since the ajax page state won't be sent during ajax requests, + * it should be safe to use even if ajax isn't invoked. + */ +function ctools_ajax_theme_callback() { + if (!empty($_POST['ajax_page_state']['theme'])) { + return $_POST['ajax_page_state']['theme']; + } +} + +function ctools_ctools_entity_context_alter(&$plugin, &$entity, $plugin_id) { + ctools_include('context'); + switch ($plugin_id) { + case 'entity_id:taxonomy_term': + $plugin['no ui'] = TRUE; + break; + case 'entity:user': + $plugin = ctools_get_context('user'); + unset($plugin['no ui']); + unset($plugin['no required context ui']); + break; + } + + // Apply restrictions on taxonomy term reverse relationships whose + // restrictions are in the settings on the field. + if (!empty($plugin['parent']) && + $plugin['parent'] == 'entity_from_field' && + !empty($plugin['reverse']) && + $plugin['to entity'] == 'taxonomy_term') { + $field = field_info_field($plugin['field name']); + if (isset($field['settings']['allowed_values'][0]['vocabulary'])) { + $plugin['required context']->restrictions = array('vocabulary' => array($field['settings']['allowed_values'][0]['vocabulary'])); + } + } +} diff --git a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info index 34697927..b1af3988 100644 --- a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info +++ b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info @@ -1,13 +1,12 @@ -; $Id: ctools_access_ruleset.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $ name = Custom rulesets description = Create custom, exportable, reusable access rulesets for applications like Panels. core = 7.x package = Chaos tool suite dependencies[] = ctools -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install index b5278fa8..b1613d8b 100644 --- a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install +++ b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.install @@ -1,5 +1,4 @@ <?php -// $Id: ctools_access_ruleset.install,v 1.2 2010/10/11 22:18:24 sdboyer Exp $ /** * Schema for customizable access rulesets. diff --git a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module index 6d320e27..fb39f379 100644 --- a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module +++ b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.module @@ -1,5 +1,4 @@ <?php -// $Id: ctools_access_ruleset.module,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc b/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc index d8de9c21..782c7cab 100644 --- a/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc +++ b/sites/all/modules/ctools/ctools_access_ruleset/plugins/access/ruleset.inc @@ -1,5 +1,4 @@ <?php -// $Id: ruleset.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file @@ -76,9 +75,13 @@ function ctools_ruleset_ctools_access_get_children($plugin, $parent) { * Settings form for the 'by ruleset' access plugin */ function ctools_ruleset_ctools_access_settings(&$form, &$form_state, $conf) { - $form['markup'] = array( - '#value' => '<div class="description">' . check_plain($form_state['plugin']['ruleset']->admin_description) . '</div>', - ); + if (!empty($form_state['plugin']['ruleset']->admin_description)) { + $form['markup'] = array( + '#markup' => '<div class="description">' . check_plain($form_state['plugin']['ruleset']->admin_description) . '</div>', + ); + } + + return $form; } /** @@ -96,6 +99,11 @@ function ctools_ruleset_ctools_access_check($conf, $context, $plugin) { * Provide a summary description based upon the checked roles. */ function ctools_ruleset_ctools_access_summary($conf, $context, $plugin) { - return check_plain($plugin['ruleset']->admin_description); + if (!empty($form_state['plugin']['ruleset']->admin_description)) { + return check_plain($plugin['ruleset']->admin_description); + } + else { + return check_plain($plugin['ruleset']->admin_title); + } } diff --git a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc index a1a2db47..d2a1c605 100644 --- a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc +++ b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset.inc @@ -1,5 +1,4 @@ <?php -// $Id: ctools_access_ruleset.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ $plugin = array( 'schema' => 'ctools_access_ruleset', diff --git a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php index 540e3d2a..b1814645 100644 --- a/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php +++ b/sites/all/modules/ctools/ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php @@ -1,5 +1,4 @@ <?php -// $Id: ctools_access_ruleset_ui.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ class ctools_access_ruleset_ui extends ctools_export_ui { diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info index 79e33ffe..1f1159be 100644 --- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info +++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info @@ -1,13 +1,12 @@ -; $Id: ctools_ajax_sample.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $ name = Chaos Tools (CTools) AJAX Example description = Shows how to use the power of Chaos AJAX. package = Chaos tool suite dependencies[] = ctools core = 7.x -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install index ee2b6d90..04325dbf 100644 --- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install +++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.install @@ -1,5 +1,4 @@ <?php -// $Id: ctools_ajax_sample.install,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module index c261d9c8..463e4a80 100644 --- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module +++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module @@ -1,5 +1,4 @@ <?php -// $Id: ctools_ajax_sample.module,v 1.5 2010/12/31 23:58:52 merlinofchaos Exp $ /** * @file @@ -26,6 +25,13 @@ function ctools_ajax_sample_menu() { 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); + $items['ctools_ajax_sample/%ctools_js/hello'] = array( + 'title' => 'Hello World', + 'page callback' => 'ctools_ajax_sample_hello', + 'page arguments' => array(1), + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); $items['ctools_ajax_sample/%ctools_js/tablenix/%'] = array( 'title' => 'Hello World', 'page callback' => 'ctools_ajax_sample_tablenix', @@ -148,7 +154,8 @@ function ctools_ajax_sample_page() { if ($user->uid == 0) { $links[] = ctools_modal_text_button(t('Modal Login (default style)'), 'ctools_ajax_sample/nojs/login', t('Login via modal')); - // The extra class points to the info in ctools-sample-style which we added to the settings. + // The extra class points to the info in ctools-sample-style which we added + // to the settings, prefixed with 'ctools-modal'. $links[] = ctools_modal_text_button(t('Modal Login (custom style)'), 'ctools_ajax_sample/nojs/login', t('Login via modal'), 'ctools-modal-ctools-sample-style'); } @@ -260,9 +267,8 @@ function ctools_ajax_sample_login($js = NULL) { 'ajax' => TRUE, ); $output = ctools_modal_form_wrapper('user_login', $form_state); - if (empty($output)) { - // empty $output signifies success, so we'll use it as our $commands - // array. + if (!empty($form_state['executed'])) { + // We'll just overwrite the form output if it was successful. $output = array(); $inplace = ctools_ajax_text_button(t('remain here'), 'ctools_ajax_sample/nojs/login/inplace', t('Go to your account')); $account = ctools_ajax_text_button(t('your account'), 'ctools_ajax_sample/nojs/login/user', t('Go to your account')); @@ -282,6 +288,7 @@ function ctools_ajax_sample_login_success($js, $action) { } ctools_include('ajax'); + ctools_add_js('ajax-responder'); $commands = array(); if ($action == 'inplace') { // stay here @@ -709,7 +716,8 @@ function ctools_ajax_sample_show_raptor($object) { */ function ctools_ajax_sample_jump_menu_form() { $url = url('ctools_ajax_sample/jumped'); - $form = ctools_jump_menu(array(), array($url => t('Jump!')), array()); + $form_state = array(); + $form = ctools_jump_menu(array(), $form_state, array($url => t('Jump!')), array()); return $form; } diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/ajax-loader.gif b/sites/all/modules/ctools/ctools_ajax_sample/images/ajax-loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..d84f653789e5008da64ff04ee109471284a9e284 GIT binary patch literal 10819 zcmb`NXHZjX->;L91QJksO+b()O%YU3Q9(BX7GztHZs?ta9(o#~_ui}YE>aZ(NQ;0- z4L$TKAR+=54({iD-gD-B-kDi5`LJfznl<ab*7f`SZw;-x%2!RN0Gxn50O0ue7ytmY zw6qiy6r`u8H#9WV)YNo$chhLJ_wU~i4-ZdGP0{J}#l^*{s;W0{-mI>!Zf<T;snp%w z-MziN{{H^`{r%3)&Vhk}t*x!m(b2ZHwvv*PgM)+Y?CiwEM3G}=ZS|*5?x^XgE1Z{S z0G?b-<hQ^b7fVw&OABF7TQ?hFQ#(_v1KQN$yseWJ8X$5AhQUwHl07*9e{K>0ITjX< zw6M*zDXDPSXu-&SbaR}=R&4ujA5*e1nqVd<Dc_~X;ab)}k=wm;gGySN$2GQEFof8? zbB@TEUhO?K-7wp=m-<VSwvA}SZrdz;w(<4x5AY_Cuw?sS&rqU!fR}4j3<6JphT|er zq66dHP*xBV8Dk3$Zaz3Xw*rL77kI_=nh9ZnajL1SgEcn2d0S7xw7q@T)Xducx`*1; z($UoSo?6}8_px=neX?`9d#I|7ub7EJ77T^KnORP;F+&)O_c?f3zp(xM`SsiPowbdz zD10G~0Y<%!y&$4S1h8-UbPr^<6SyJT@A(Gi?*{OH^)uqDp3@8#<UBSa1>temfLlxx z`s#5BI0&c9darz3!be?Y&*jZS&Z2>wmCzZLYxvcVFEuibNYYPB`m&$J-Rx)@D*04o zQ0OwUmSFchNrnlj2T)s)Gr&C2Prg6aM)1H`_mp4%?qu?o`(VE#&GW*GcLAry)Qyy@ zP@T?#XC#pNRmRj>uA#tm{av$OoZPH>>1{b86PN6c>^*y8|LLmhWxpra-8aVrjJsOi z;=jpGH(P!$IOVIf^`^t?M}?r#!R}&JRD0l7dc)_{cGnlrr_<cvLq&2V$3DvL!R!(w zYb+YIIrZ&xUshD5zrT0O&U9G)g{+3(KYuNGyf9wD27$0#n9k5itE!8DR1k{?JsZug z-E9!aYNnY3?$b&Z3F_0=izo9E_|k)K#VF^7H0#^YVRSV>9D4Zjv!N&aZpo$*<5CIc zuGfFt7)2?sV;7#@mew$jr3u<{#*I{W=Ed<n=%I#5u;?&@4+aiqfhN$R;Uv@1=Mw&? zds+plW=<modT0~wmFG4`@%?brr2%*XWANQYg5S-3NfKVW)7p-l7`$p71fQ_Ul{w!u zo_(Nsjg}WKy<YV2B|YRlPd54FZ+@bkG`BHV&U#5%-THcIRj2euS?#FZM!6*EWHtO- z?|WC*mvhWlR)Jlnn5t<a$UAencAD&~()uWy6KU`0<<07g@DIil(We>6K_PbGo<4rA zaS?%j>0xM6Vz3_`8{rcifFn3~MMBbJJ&5H|NqP2J80bF>K?wP0C3FfPpb%D&wao_s zroo{en|}Z1p$Qn&)tbgSF*N1Y|6zV`q~CRAbrCVvGq*b8=KpzqapU9H!|BnY9otey z43Xk|Oozzg0PXT%20b<=T~i<t%BFDs90rw4iaK)!)vM{!N@U<xJ(gg)8Y>2dl2r(A zga<9}Cd=GdF0<ua?ur){-*L08S@@VCr!~)V6l3)`LQ)OHeY9u!Ab}%&qE`A@+r9D| zc?u98b|5fB=!&fH)f~AjvyOaIwyNxM<9d$pwS>g%EfS08;p%0Hh^^UXelY9ZY>GUc z;>9Z}@7v%w-|d6=QLbXTgo5}g-O^5{yUz6`a9bDrJgBsLD{xM9Usiwr1(Wr2HcZw2 z78s0RvkB%orAC1B#7d&=(+@B$-3c-;qE!!e=J|4EvQYS=uPgAI_p&l6USAd#Qj$DR z-|+kX?fv9^^v17dqtAmIx2#oUe}R8>hzQU4zH6<2;qiN^0CWuGm1hG&c=U8rp>W)o zo}r*cx3L+wiDX|Ozul@q;AqclHK>S(u!zGaK3B6)8H4BPpbO-NIjA7Ki!b<!K{POu z%S6d2;;ajn#RGxT6N~<FIbJMWl-eK~Bke&E@i{NeZ_3DiE*S)5RAw@DIU{(O17Hc) zu(A-+uEVAB#E+YX`HhQbq~AUpCxNeBvYATrHLE*gjG1qIk>M!ETbS*()i|B2;8B#A zLFM<JhDOdv;k^nElW<Ara8gz-EEJ7okc?E4S@CUxRl0|OhmLgE_u`UyA0p&xHl$R5 z$pBmB5sh@075Mshs7Q@>hDq018GGB<&lC0)16O}+9$R<bL)nvGohO%oyHEcp{>${{ zs%UMOujW!j!PTq4@S6%+bMe~~%JbF&nyN3!FjQ4p$hY(Q53DXheK(>$4+iJHy({Dz z4q#@M<%d3+=oXKh;bB>dV#q3~?qGMo0gEJAginDTO)-G-A_dj8RM|ZJb5^8AEnBKg z+F@aU^w4^Nk4wRil|I2e7KFJ1r;S?$sie`Z@8K<hOT#!PrPd*D_3~m6dpQ7lmot9i z%f+KMt!Y|#`K5wf>xI(o3HIM(7wR~WfbY#LDA_#?OkBzLVmnToDcbn{FQK`)ak+yj zpUY42b7n*32UxEagSpADk4s@=nhtY^E7?Kkj|5ippL|khFDk4!S}&{LI@+k}I{#y{ zcFg}a)4zv{AVym((-oUN+yaJg;<K8_!x#0Zu=Of2s$V&g4p<_TffeCri^HIaWWSJL zd_=fUj2#l~6v-Okn;bzR2WR3^oIC>|A(;+oxfxlu_{ub&{4D!;N2Jhc)XAsQ9tq)t zcMHHzkO8uGgRn9U55t-I2BQ0hMn?J&){}!XBQU7VfQ{wSFx|~>b7pL1A{epwm1!l^ z_Hb!?mA;`HnbmM<7oN+^8<DL<{65bgtpjWY@PMJp=TIm$1}0&(6K<#ydg3^Qj(u6A zcGa|CFjVT(9u6@gBezcK8`W3K4?`8q3ygYpt+X>#LdZrt6pO&*i*chQ%-5Iwnd)hv z8&V^MquCryH5TxvHhN_urMX-sv1$xpusn}UHgJ*D?0JZMMFtRY5bPH#I&o6~<jt%A z?oZ3!xkCwKRJ!YNuru4?C9ZrWN!jH=S3D;`7kQv)+0UuDaM>|Ab+x%flC2<p6TLZH zmZVQcVyl*iDnzVtY@QIH3QYbHr2wer>dGyv$@=CI(Y*zhdq3-@sTyeGqp^LxJl^;F z$%PR8Eg3%FHU{b$_cL2kL2<i%&pjjkRK9Kh>=>Id-u~jA72v5)7d-Y&sP39JW>#om zC3F;HjDT!9C?SUkW9wuPXlg{wtIDzJ0k)e&YYir(FwI`(bBJyYecM<xqaduUY91!} zIPXE^rC94$)Yuel40<+JIX~h8wZS~(hAvNDr0i|}%*)!kDX9@bt-)duvR0I(AnjNs zvp^{}3LeaEqnrVecpI$ev)mz-W8*esS?EoDlXxbb11Gr(W$CU@wc61SS|QemcrWFW zw`^xEr?jjeM{USOzwq+NYzWVaflAw8yg=~GD7cu;D$yoa7019*+cQn5{lqyPdj0M} z4)mfvU^$e<?O;mb00P^zpsI8URfrm}mAQ|RJnR|K&<)#TQ;CaV8?SDe$>8g{oFp<U z8*T@0-r=^fcQP%MGpu+Or|!e2-rzE}4g<4E%fvV7=cy)&IZ2&Y05D5QK&ftCVhLC| zuLlYykNGX~VD}Hj!!D)jj+;WhHkZCo)YZxiQNH^F-F?}q?m_rDB_DZ5z1(#Ahh2^- z1&8mc@_@^1Vm3f1BdW>Jiwu(6yO}z8=sHm72iJRfU*oD|9tZeWE;N8&I^)x?f`eKw zL&b8TVx1QTdTr4y`md?Q5_0*O59-Oaqkq4;?~%`24(Qb2v}pkJusza~X25y&l!Be0 zo73&Ttdg*VRs|tB^$?}|2N&CgwwB9aDh}9@sQbKE)tkF<H|bunlLAcy1a{`7RvKEV zX*x2iMLCkHyQ56{=!<{PLt(t|bLTxTTIG+3{M_wT+Wz@<K;y!%z2WERU*G;!5ec%E z-{AtMxgB*o^C2-OIiP}dg8XLk;-h>{91Mx{3iR@G_jmLO^kqf(+YzwNXa?38k1#US z4{zt`l%9$AXTYFyGoqri3eyvlQ=+ln-bv-S+IS4olGR$)*b@zbcb$Ocge*28Ctw+3 zf)DitMB9EEp6;{pkC~btgCaf#EG*JuCkKZ|nKtLProX_JC+wixiwEvMj@;WBwPTy` z%L6axG%AeLZm~{1Rh7p<@K0DN@;FNM0s+J*7L4?oQzJ$SF&_s%5XM^)VkQ5+t+#{9 zf0(RbeY0qwrVyO2U^`(1;}R#PavO!pu2(M)BuTgmB~V<&hLg_)?pquxmh|SSG@k#K z`c17nfuruC4GxD>KMmo~B+BPFO|!@@bhHbj@W#zpaby|~nmGH;{cC4lB7J9;LM+!; z3|FqEcZ?kAl4ZwJ$u0cSGIfjs7p(*Q?;Hz8u;8tRLKB|-*yP)>K^KcO7^?~Akf@xC zA_MeF0)#o3S4{6NRsg!t6*Km%-&c4KHYlkhS&?Mtw#HKz=i{$(=rZ5OY4owe7wdXz z=GCJ|^cKY7sz<R>eL;)w^up0+-Yl<?hYYjsoSOx=kI^fC3D1JDJ#~Cg#Df8#M_tb- zGLYxDr5b6~T|yPgdovM7q9UJ|hVbVmJx~xe2}ZgI>*hTV=Mze5g;Jj;^@a*<73G+y z-t08LgRH@hg-lIrngw}&=@wMsKI@r7klNG5LAmHb$onEQ?G#TBe29=abF?kLs}wcP z%Ii}|ZEyMq2l)bDp6<1I1=v(ba!OHgN+B4s`+Yf}drkjTD#q-bbyN+1!7|wUh$fj5 z!m*y4^IQC2l!4t%%9xQQoi=_+#XZ|DWKOP-*IBmMZm#5|Zc?shje)96oWR-anGyxN zm6C{&{0X(ZNkK(gCB<abUV$n^w11VKY8Q1}UDH2ifB7jeEvuM#YV30fpEU1yZs$>u zI2?@0RxQdKZ4im3!y1z>Yb`U0L=~Qm-VXR7ofaN}h)&)J`ngr8+A2;J$gv=O`DWp< z&jFQd_gFh;X>seOtr)cOh&ex8@G0_9m+YX8qcz8i?)fH37I}7K+FEEU&|!i$manv; z^3Z%%-P5%pM#$hR_(qWOR6nbPV>Rf3Xy_jBjsd58pCHSPrH^-+A6{07y?Ck+a%bb^ zgW>Unhy5c<34#@s=p$=2bs3!VAUO9t1)aw9lT=(KJekb$%-Br%Ot*lLo^mc#<a9Nd zkxR&7L8MI@Uo?IwpiEP`U}CcHNt@@YhCdBov3WU9)WDH`MS6#G`P16x28(F(-*V6k zk6)>+2f*kMW(^0Cf5`IlOZW2=Yx)1kLbDF|SFOdGBIN^5tM$IKtUR*=^v;k#u$)%$ z-=T^9#(8*pdb!xa{9z1eVmLX-KMdmy^>qudB$5(X1MEYQsU#O%a7<jP@5_*s2+t^6 zoKv{>>5@!43ydWa@+a?mu(Co~;R4+P9}u0<uoJeNpk=7fufYG)=rpXqAh>gSlom}} z9D`O@4-5{^(Cw#oMrS8N_7-Q8w$_-wXRd{f1@$+$^|6VpKf$%*fwD}pXFWt(8BRiu zoskY5M~V^_HyUoJjw693Zyg&rs49pOK_X8=Eyj1n@5M`U8u5*v1fXb~hgq2|hh#V7 zB`t*m7{>}Vku4GQ>y@HyPnxQi^yTrVl8=k--^kq)%}IfR*nOUr38Pv`^%%*Y#Y(5{ zOg3Qt)-JXBC}+|L`#s%}X6kgg1rA-vuz!d*@4zrKdW56&&EAEHyDg*vTrJ+N39pQ7 z>b0AE;)LH<y(>4q^sZ!RTpa-X3<qsI)jhBWwvq#29>>OP$>%9>9@+P=RgniyOU`Mc z6=BG0d&@O}7rIOywRXV<W)&`&^zD6l$Jwy`?YziUlQlPDyL(oqipusx9&eV_;Scbn zG@U2ic-68BXc-}{i#i6y3+~fg(EO`3(+Zdl9sg1)PuPJ`w^IOgVkmf*Ijvy2f<Un5 zSvQVUYm;F9US886-x2Y%L6<8$MNRoeS831ycO5>$D23J<z|M~W8ZtL98Z(~xo0#m$ zGN2@IwMSFO5{p(3dEoW5LUUf@Tw)`TflZsu($dNsnhCKtc=Z5e7^(z}PyO7noHDP! z@-khjNj(>9Az?10`p`ux3H)J4>7liD+iNQYhd~%GPKrLN;q%C20LT#c@Gz!u-V45N z5=32*D$a`4kP7}-e#GN^hDRS*Jg4PJ%NxOaT9<NOQ!XhhP~a;wZ?7=ev>MjLY{Yym z?&5`hY_Tpo&g+^x+9+<`y?3VIoQ(kh{HR}fnj}4uG6CgVwOt5q=?@0R2yf|~zZb79 zGau6vQ!-X@t3|z}F}N}DypaZUEVbog%UW?rxfV<;l07dC_-;TzxiSw}+Pu}-wdEtl z%%F+Ff&6xVND>_NVKZ3~uhXY`F+#YKc!PZ{n@rT>5FzN53+dvi=r+inxAKn>w2Q_{ zF#aX_HsfB>j!K5jFb`7BGLSIOZ5@-b_H)<n^67_J5Vmpv8O-)T6(3jIGT~6!C?S7g z<lwEN9Q6ES4Lt2VKKv_?Ylrzco!wfiAs270{C!sU%1pLr*yN#Y)P|O7L;I@<xuvAk zcMo4FLb7Lmd98*|`W4MO!vNtEnhqj=LXOjq&kcXl&ztXCKeqpCEhlV|{8u>=dBTzF z?*k*e--=wH!SoBi)uvrV6Ym@^t8C)zETAMGv?~G@5(*>wdP9Rl;v%roq!?EB@Weo0 zhSao#WZ%=-9(Li8`PKp9CCJR=Se!>B*~c~1K?D0Al(-UEEB>IQx0eag6CVPhGL4Q6 z<b=U`#%9Kg<ECdu2j+^07neST+4aEJ2b$f7cNV8|iV$mGplL&_!y*((xinQ*hs|(N zM(rm+1`cSIFdaWZWX1{o$59ynIEs{-xkglg*s++fSL>n{6N^x|(bZiwVv_umlKgR( zg%8PRfguiFUzape#qRUmfIStzpY*_TD?f!I(VwTKZtzRWePy8h?>iC`hd9b#D87qD z+*K&TWIg9*Q9FfaYcgT~&B$wn5}xuFquBkrFk2qg;KI&jQb4aVY=zM;62}_kW)ntt zZ@xnEy;5pVXTPtPsDH<@#aaB^6~~WXz^x^frbRkAn|}qIWey|Rn-T)8L7rcY+4M6= z@Hc*(tdUa{flHxp`#dIp$nDuTiHl`brB}UPL;KviP|-T+JUqs1c>UHC+GMC%?&<d% z(JpR~w$Hb-(x*4!AgGuQ&=!_0k?b8RCjmHq!GqLHxxwe4YHS@}t(#2pwXAA2>*KSc zlk+V{lhGcwHc^U9e<{y_1>G>hpruyqTxb*?`_N1Dn)O+aFvn;$GQ#Y;Alb=XC(r7J z6+H_MFp(GbXNm64HN=MKY1<5kxQXKb-W89vRZxhdfObPxMw9w3DN01}WTz~v8Xrky zCXQw|;4R<srx>`Ms}Y|K&1~&X1^=z9v|@7+-Xwu`?BvNycI;c3Op5K$8;g|!oEw2m zRMX7DSh$i<9>abUYDFR@u2Y3i3~<uPHP0v|?*4s&>G@OKh2vgc>ssmFVRMpdVVML0 z{i^YlBio{sh}0}}=an@2tKrX*)5qnRN1YBP`Pw)sIDjX6B+6UpkRE-h#VRiteh|D7 zX;_!0=6?4|1KxmStXv6sKM~gIx0<+-Mm|<ZTr~8ClhGMRRE@Hxz`5?!DAib~L-PPx zLq5FpaxbE_RYJ46UY11|4`4j#sf_19MrQ|;B*s>)n=a}sXK|u1xQ_7R2N}L{_jPHw ziid2qwmcl6u8Da!Y*ML$Kd-u$!Nc_>jIK=v0c~9F3D&j-%Go{tFlZd&>TaRv&}YJ< zSqtLhC{n`@Q$yCvJQ_Iat3V7A7y#t+uQZ!b?q0d#8OQ~R!KpWaC5hopzXX+&L+?|R zje?`3W$9kj73_S>N4YAM8TLDR2YpU!H>7=Il`<*s7JH!wU=YjKD;$Q46+gEA;mA|B zzu*5!KYut<`QP-D#RmG<>XblGYrE9-{?m_4+nvx*WUXkXe-$TIWm;H?MaT=`W$Ei{ z?eBplz|cOY$pPW91S@D_bV#f>GSDX2(+lRD=yE#1Gb}eMDX1_s6jPcXoD*A3PAYUl zXjmdmO=K8y(^+v|P*#DH=Jf-jhcNg@PR3|Vuurdh#%YtdK?l(2EYpBT_S(v7PpIS4 z=Sio~k+0COqVFpMNBheyYH4B-v-Ow_+Ba8JAr1&TX<y|nH*X8UVE+$LxKikZ&PXBP zafFzyi|D-*prDLGzAS!7=Ho2urP0NE&97OfZXWK6KFpBw>twn2xJ@VP%!SBB*t2DA z71rQf3mxGVYM~M{av&uL_Z|q9HPZ|GQ=V|nQ!{WYX`p({igvfo*p}g2XZOr@=Hv>J zJ)EQd7c<`@Gl&2O=jaEeRs{%?nBwS$vf*N%%c0QSaDAXnBSBF^+t<6Ye}s0Dup)A9 zLts|V+4!o|^3B}1=M9qOrwDZ(90UfFXh7rcymQL+EW`Ax%MS2Z*241{Zp({pD<1DM z`Bc7q<xEy;*EMN0S$ijv7BKsB!tT_>l2d)AzPrcwdHuRni^gKrlPB{OFn(+a;_4hT zj#9G{aCg3OU}(h&N^FI)Nz@q-1thBIIR3{HXMH%FqVZ(pd17v;v-^NrAkvK9OMp`} z^&|R~zxIaCeeMt;v#%?Ukzb1Nj6*L9_2dN!pmb1hMw4th0U<w-Z`5OIlLgg(Y(tCa z>n;>W8Q<+>NoG-%G;*<5h*M2F>VQZp-jo0&K{~#qEPH=gy*d?+7FwQ<;8=W}kwu>A zvch(Rkos~Ei|WWM9?GF*c4DsNTF%D@A#Hfw>4fy~B5Jp)EBieOJfxUoY+9*MTYkY` za?k*n1JtfJsu;&fnpd)$h&q%AmQ9pYH=j-03@J}#lqsQl2T_iF-xu4Z7<Xk_x0Z$e zl3a%|dIYu_g8*xb<`+s36VWCTR*TJJ>SU4d`aw;T7=D)KY4Vk=w7jO{I@&s=uEIVm z=;{QuH2UTAn0(mgz2GWLJ6vM!EqDX5WiB0Q-v;1d!l**9ONOg0DHox}1$pYtfPywl zZvdG=!oW43qs&9x-}>>&BraynNU~SizD||V*IUNc@OkQ$S0?i29$V(FgT0C&A!}N% z`^IQ|bst>)yr<0+HBMN<_Y6Y;UeI{{qJu{5FrwVLf5MV?p>L~Ze1|;U8+ss-Gt&(I z&+&5}l57}K;P+{1C~k7X%{%f8vXQ=D0zFuAd2vJd;u6`ssbrSV>@Pf^wJhR2&;PWq zPS^ibC;tPK|0^c{W_1!sXs7dIkT#bZt8AN<toE+nz=~}hydRIga&W@~fh8c3zIFk4 zPl7ku-1f9Pj1Z0?`$xxyW37VB{bRjI(J7%spCEr|s#iowR;fo=m`_zUD;fl2wfw^n z7!-B7h6rI55MZKG5$*ADux_T2QKq&gFV^9)k+yip6E7K0a9kW~i*s6FotYhY^>KS= zV?KUu^m`cL=*uSP_nn;wlWBNwIA8Ri#>A9^JQt(-ciW#Cj-AmCU9|(ub>Sr5d{I+} z35y>Gzt`jdF~mvAL^||b6z_;v)M|MEtFhLOV1fIp94an+$Po#<UBv(7<zV)i?QCBI zid9E~T#~?jRm#aMLhxd+Ixc5|4B;Fs$-s1_66{c)Dl(#T$|vnWi~X;edGUldu0w>U zs>x;gZ|xcFg^d!0=WE@?-&lr!uSUT}d7hs}j&Cov<Hsd*s*>eRDXtrlb!5|v>#s{L zJ}nZ?*?@x>J+%Do9q&MxIdRNgP*z|Eg@;G%-1#}ro!8Wq=bADq*u7?p!cxdh5pUC( znnv{V{^ly@mHFlimHWT2sNKz^3|7InduFG$hT0|jny<Pz6iDIlj?!$xl-v1I?ODfw z9Lp*-+=ukLf)05JU9-^c5z7fb4wrplQibJ#h-se<PQ<#jnvs_*=mwZ1e(woth4N=> z3MjHmV{)-P%6uq7K;K9%`AfN;xg9r13k3&rJpqR7ic@f5_WG*qXt<s563Nb(KZju0 zZ~4+fJT{R6TGN-e3h8s80FsiVhzn-caBE5R-Go(%gpcL=5mu4Tg;p5s?KKvL5ts&h zWI*acK`JrwYN2n@%OLAK0of1`(A{V}*+Gt+%HsuWdxkHXGF~}V^zrX5ino&#J<~w0 zMLHu|kOpThtzAydH{=SG-YhMsmMjIgk?(Crbs0pLRc3ZDa=5p*tv^4$+}C){sQiQ9 z^N0e;OHy1=`lnS9^caVglbxt{9j$5dut>l0^6sj6@%rffoWPf#lXb%!Vhm;VceDW* zP<hO%ert3qlVyv&pb<|1?<ljpabDm3Wbki+&9iNpc*Y7CgQhSA$ju}ROnqj6YXyGV zO?;kf`}XI8DdE~AzVBsExK%#s-u_}l<m=5{AVRxNA<1s{K}wmd<h>Y&j@!nT22YX% zY_jZ3iofYksvWtQTcq^3Bs{ONvbrOK!#}3h2<c>$ekK$e(<&dIvH&sa><D%DCU;iP zx=Kl6x;gfy?Jz73m<Bor+i!G*XdSQDhX_W^io_UJfpiFs35mKsA6sgPjTuj<u$sA% zwyu<)2b#$QysJIoNyEy2wB!#@{<k{$UoH8Ud7`t!g0!h^os)8y*%9r!_~<$`isYX~ zAMS$Uu?QcMUjUxKN)Goo_wWpZk>mXF(I<(AAvg)^OF~3OLsJ4_*7i920^daYke6O@ zfsxgr&fX9Pi+^we;$S_Uiar4flR#e|0-95c=sAfwOs%P2Bec;8OzrecYd9LVKwFyY zKEcT+@4>aPjiJ@8?WNru(Ba~z+kv@^QL|SGOriXLcmgzqbMZA~YY^07aRREeZf7+- z0}rRsn;lirt_WtKW88Z_mpeUi2!53YO~uyx$qM#nVz#>$)M#1G9TKcnbRhbUX#rS@ zW34als;$8TxVuDWC`XY?xb!m_sy>WKnJZg$8N$NHmLGBMpSncxK}`W&fLw=J2z{gb zJ#F$0dd0vnZ3k`Ah&WsFGK_Zz93ybH;PpPGYUUJ^nBmX>UlqN3?Ak^`c0(oT6Gl=! zvWV{+xRGO%pp7~#pJL{g)?{lYQ1B2>?$T2E*4tm^d1~H%xT{hLVP@u#eWW^tomm|! zJ);zv;q-R7YxeGiUxGVdx7xTh2mFn_mz&_1$~;-7{eJF7=2b=_y;|HGXdPp`ps!bz zTCuTT{>+3qY^s3J{;41}P~_W0fc=N6IyJ0!0?!KzguuDyfBhV}YzmEx2%b}r48@9s z^!>$k7A5N46%ImpsG6Id*}c4A%Bv7(YK8c1Z3I<mE7Ap>YZ<{uYMQN@2mb9}gd<4F zCkMrjGEs0|Jg8d!fboWJFHonfc+69lAL3#ZEe4m<ozZRl{3h1q6f07CitUuEQ<Jr| zb-;S#IL_s)XS$~R6(TNaQf`8-a69o3nf*~8Y<<JZn<p(=0Chr^9=&{u#rm_I#W?gx zmq2dG`oRm&#VSu^`S!&m-cpu^pa>AR4ij%>%P#k3#kGBDBdgx>rgbnil_y5MpW{c# zvDxsm9~QN4a(9fK`-N6z$|lRHjxTaERRKaAr~%&KheC<To&ueSG2#v^IPa}SOSi1C zdYh#&Xe$xAox-!+JYmbP*R>ATy4S4srcBo>3&&ZQyqNmqbm@Zm)>gemJL^00wvU9u z+D_NO`Lqfc<&UI5WTI_KKc38qy?W_AIsKI`p^Bx~F7!$jbgdZyL&Etz*1)RF-Lm<k z#s;-kUk-mt4lBO8@-3;nPQcw8;pSZoF=u6xa>1=TjQJ@AecnfXzx+p1KB>qB-fe=P zF^0^`I<?xH{iWs)o(*<{1TpYrG@mQ=1VHYd&fK1fctlxWFnRQ$fztWS0CT%L_Q`qW zl}f78)p`5BsYc7V+?(0pxLa~2^NTm=AEr-+$N#NM{<J6mPt5txkmuiQPfj#t=NzkY zWUa{O9j+@o2g|(`K0+aH{3EX%95Y~H2rm-SFTfv93?v4*JK#wXuqX!{AwDX=92ypm zfw?7xro<%#+uLS&M;0d+dIyEz&>$~M#7P5t;wYe#ohI*mNGOm1mCD3~fRa9un)^oj zK6<ANkM_OGiE9E)O+$&Za|=u}gRt(kj!)qb)-~Ff&tJEfX1xv<_BVez8}h=>+_2{p z+Z3P>0P+xKKH)!;;*Ky5p-cZvco-QujC$*;MZ2On{yHwG#j53LMY5=xy;<EArzXHS ztYmE!3c9mkhP#`qu3~*Tl3&7E42BlFLhpLEkm!o6cXOVY_tz@h*bt!tICh(Jsz8QF zA{$CITUBk~pRgnR7=O7QMDNdtRuh}F<KtSKMvQG6G&?YIUYY7GN4@pgs3_l0#=L+z zrP*q-cvWbg3P#98%Fb=iQo}CRtA~4US-#Fz_l)$>Z=-R8Ps`%uTgRK>oU&lv8J~7# z2+xv%aK)C=+zc$8S@L9Lyf@$w2${8?c3W6<PU?C+Q|GKiC-qD|tI`)d+F9VNdRLlJ zb#4FP)w?YF8&{T&COcL}|7Z%3fnBu<e{BBwwK&Dq&r&y&$VMIGQRHgVm?RulzobC< z^*Tiqg$P9=FPP1;S?pO2ta7ZxZ#STPBK-K~P5AQ<#uOx=!MTRLJA7u0g53!VzVUvV zdW`IZyC^vHtPOie?!|1R^Ao~oHb9rdirwdT@zBetEL;7DAny<*HAel4qF$&ulqQiZ zAV#6M4Zm&-hhm%xm*Z*0uW(rGdI(Oz<47t=J=KxCnvFf5WO+HbQ|ft&fJz7f&&-sV zVhek!D&{LFzmt3U?4f3Uaes_~otuz<&`i;n=_MX)UIpAfqP|mI#x34Y5*X9iLbW&K zVK>aLC=KK(sd-;R)g`u_+mJaf%@L7N!wi^Bh8IXKO6Wm?9Y=MeDxCQ?8Wk#d5Y3W8 zA%bsiQm;FPpEXg=iLmEsH1#U{@?#@r`ATp_rJGijSp?!>eLIR*;f+Kj66CuT&3aO3 zF*Cg1qsW&+3TQ53k`}4Zv+e4}Mlbr)#$4XjvFKS2$%X0@(@$v_-`=M3%w#cY+MG`c zttm^jCFpA*6E(8#Ug~+kU?e_#r8LlDklGX23e-h+4!}_)aE&?rRH4k^xZ`!BcPzbp z1)5y>NkevRoqf|&Zla#J>0y0dzUg&Mw(phxmGznO&ZURaP(0paW5&Mg`*+`N*!lX< zJvHqjNC7m_;x?B~y^+kyhR6=!0!p;H<G))?wAFdlhyS#&|D!4Y!3s<S0J#2VOXfen F{{!QIIh_Ci literal 0 HcmV?d00001 diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/loading-large.gif b/sites/all/modules/ctools/ctools_ajax_sample/images/loading-large.gif new file mode 100644 index 0000000000000000000000000000000000000000..1c72ebb554be018511ae972c3f2361dff02dce02 GIT binary patch literal 2545 zcma*pX;2es8VB%~zPr=ibVMCx-JQ^BhLDAsK)^**h(ZDp9YGuzZ%~j!<xu1hb_^th zKn@N$1VO{01`9<%h4l=A4vwQT&bVsTZjFw9P-l<Qoe!f`yKYB!tM&t1HSgzstKVP0 z|L5r^POpntls*s413v-q_U&5$!0p?&-@JMA=+UFor%yk7_RQgMOifL7c6L5^@WADA zx!vwpuU-`w7n{xIv9Yo2>}+w%FI;|aC7){7CdVvG)P{bng1y9Te*f}~*`1kQl$jwb z$tlW~rRS!X?#xfm_&6tTdp_`cjgYwbRFLNdo<jokluYIjz_QHsEcJTHQ)iQD!j=@a z(6q$rjW28VVTg$%mdEiR9l+h)kxeZ7LLaM|)R`u{(l?gI8P$gSzw(<Tzh500Jb!LY z)tcOfHs7@?s*FkqB}o)AGDR3;w$#}im8LfMi#8sk(TqKtIw%ySI|7SZv7^B})CzJI z$48Ci9Z$;Iv_*-~RzRIvGo+^JN@zSzAI;FWZ=P`#3lo<PVYzC*nFyyn1h+~gAY}{s zRIc7aS??2DV&8Ocs>JCN$S-yhg`ZnC-yvedRSmOh%;Y`Gl6bY$Z-}#C=#F4%9!I1b zWQ~f+9P?;vhCxWwlwl=lrWG|7IYo;{jjmzJ5R9?f>n%<BEwzWU%!e6>-d@>kLINUc z4wM5dAO;kq<$}Dk{2-u0$I6@2N}&cUx9nmV1dYc8jfC}%=F9WCg^OQK9C6poh#2!A z3^EU*UFZvS^)?bu3T?J;@Ahb~%I?+@4!l5!*TjC}GIslNan-RCrrd~PdHYnNLJ<pJ zKX>k+m&`$Y+NV(e>CCu%R#_8GqY4cv#j`#uRWdsg9DxWy(?oOvgCU}&@jy%c!H&-Q zqXJxajAtmQRoRa9V-RFXXh-bK*;Fum{BjpkYQGX~i@OZ^<z1=R^!fUZypHVq2|@OU zpzGFe_uqWfc3n9mX264y5h4a#H(LmC^(HB{HQA=Vx!ZGpbpXGBbvO37iL1a0SN%~I zLXG%13m@1sc-Xj%W4L?1DU+oU1=n7NEsBU(uxd?=TjTWsOJ*uzwT8*j*9Br!02Qt0 zyroia&R*ZBIndH(b#_~WkVCekW;uf#wPFLc@agb=5OiXo|Lh=d(H=Ux?<ByY2WvHd z&>Dx0n&H}kvGKqQ?w(6iGXu_g08T|_hp#ZvFzIwKF*a=oMJ~3UGAjZ?g}GOxm44td zXoyYrU*I=y*vHv89hkYH(v5R#wc)BC3dZJKb3K)f>zaM3%JP(mpecViP0eKKYf3zy z->jx_mc?mCtPEvCQ?uppk?eLJt}_IR7giW%Jr)RyI!+E-voIs*lXI*z`GQc_&D#X( z{6G};HPYj6O|$lXxBJeDaweqa{4L=tOZCjTI^&UOxXg})LRG_cr^B9Rqt(i5ORbQX zq`_xCRsH>xEYY%&*Nyi#{S_JZNlTm#K56`RI%7^amom;*h90Si&g1<Q42_J{H5#6^ z1j3mHQ&?%)wrGOHagtzauv)cP8`bUYOtZYCY=wl~>CfaFV3D|a!`3Y-GKKbL*KSbl z>I96`TR@CqPJl(>QqB~RvK~-U)`e`l4LIqj+IU^~yyIe*|BRVB>4Bup%j{tLdKz4j zY^<8P8m~GRGz*yv0&-RJE+-keJ+%m3wNeopzsltWd->eWmBVwUr)p<cFSpSfSI>X` zK~CD<;~Z*Uy3W`3+MrEYxm5qYQ!z%YI;y7DTG`UVH0;@{M{!B&id_}3DBQ?zsotuR zEGLdRx25nLm%-wjlnEi;-aN_1S7???rO~WgA67jjr&(vRa3y$u#kq<Z1%n>JbeKnw z{!T!1li9>M+sJ6AUe+*9d}2uG<Al`U$E1o=q^Ub^f!W{a5bViA_fk7CRIpv+>jhzd z|L1Rtp8uTGYyZoQ*`DS^m2dw-X{a)l+3m?ncvn^+O>)hdd3(hMtlhkRGns{<8c0I! zDDjpmwtj?@!6kA|iu3q+Ai;@JR+<V}md7p@QDWY{loNQf|7XI@v~xv6`7;{c#p%C> zfk+ln&YFC{4bhK6IxVgLs4W%^8Lk`qzWU*L>yq0A3;l}{!wKZ!ue)C)SKI)9dl1hl zhIRLV@8E}rwvE{gX(}$f6x*k)_`*<J8)s4#$the)>Ijt1=EU-Ls6-(phomeQBgtUs z5Xz~Cd*nE)Ac!0i4ep}Z1AugMB(&F?)#CU{Qc{Sp^vKsdL}vRB30H+Bbzrn`M##H3 z{W8dc_mDroEE+p8_}mnJtzZ4!RNe)zhB)Ds;S57nYSJxtek>^~&(7B+N5MPf2+2xx z5Dl&4X|c@f{Kd|z1r+N|$DmsoVp*3yOdxT^J^-VAk)Z@$4^XrPrFP-Co+MXZ+KJ(W z{JNYvraLLWA;&tRhIKOvhW|HC|L-dLvAUF(MG0(Nl?4tB{RzN7I(}Cb%hwN{crFC8 zji#aJElKvDFV+<nM6h%jvlC;)yQnfP+-ENdg>&VI1V?oUMA>*kto0^;3W8FQBSZ|{ z$v~TqE=(8DZa^i$^oht&h};P1N&wMXorKh*Z68gPV&ouy>%f36Oqkwemyeas$Qbz# zV?7Jy%o7KY6^I=P@eCji%W`o5sf(5hySYo9$l4e2`(hIV_?=H-#R6}0$WVA|*(K@3 z<A|axbLZ@~f}p0ti9^k+-n>=5?@RlcLh(meW%A4)hGzcvEpm(_w?>zhL*i&s9$2>r zAtk{8Cia|+Y+V!uX9BtpXoF%lswuRKsM!pSs!?<U-NiryhtbPpT>yhlCy!269K0|b M?FSZn2B>%I-}ej|s{jB1 literal 0 HcmV?d00001 diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/loading.gif b/sites/all/modules/ctools/ctools_ajax_sample/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..dc21df1837f54a65bbdf6a857f8358de880d63d9 GIT binary patch literal 1849 zcmb8wdr(tX9tZI2z31lM+(&YVNJFGf2tkvOm_Q&zvGyi_AW#HUXn9B?hBXvwpd#2J zk_V3<PffL0t<utpqUGUZ`T)epjMk33GVAP4cegXzVI6JVF1XvN&a~?${L#PCKl=Og z%sF#D^ZlLQoQ%zzjO(lrfyjRm<oWaGdcFS1lP80NgAX1&sH&>+`Fw$u{rmTC*|KGF za`M)#TV}I)bad2UFznc|qphtC`8^f=oX$<(wl&q1m!7azhb;@7jsBk`wa#YUYuhDl zu<zY1wN_ahtM^!Ut+l^Vxd(}U2KZE9mpXV$5Q*RoQYnh^qyIUKrkTkbroNHPDDS<S z{_~=X*Q{gM$7wD<e85R}TnRTldi7~v-VnF=scgI3bumAN|Hu1gXKBi*+w}GLb0S8J z@A=dE1i54%#sNy+q}Br=O|igL9)prRgxv*Nk^oPCOh&(%MANqDP?mi`i=DHr>q#?_ zUz%XoMCa_{j37)q5@~VlmW#Vnt+AXG@4E5Gk$ILRPr|XrsZFTUU%%BG4&BQdV_I<* z0RP&n-+0<y3$N@61375948ti0r8m2aoB#s4qpT^1$CernzuolKapTG4lH`z-#vtWu zCO`pcWV(#(o#^zqXA<hvBQKn;&6^ExM_Z6^an&WiWx)t}#P=dU2T9}3h)j`Ms+#*& zC)Rw-F4Sx)68|v2ZYn2lC|w_iQc&SS%`%opS9ZVMp)wbhYrO|imMfQgUCr5b&SX<v zXv|VBUnd4Io@g?2QTCNe)Vq?tli#c5+~XY@0TekCTOh!%pLM`QL03WCPm>xEaq8h^ z#|84{8OvOr;;4ai-#>j)vantIvy@NLDmCyZ0j7x4mdUEOv})T_rq}xq9_ggBeO;Yp zre=fTv>{|J)k`fB2Xm2;Hx^d~DD5k0W@;M2G=DMbGJ(i7-ttmz${=&+R@gRA`r|ur zD&mtBKh&;(l7~b88n?aAe7Aj1c0zek@sn@53cZ)&tNu^~Y~0@ZOs%%T@^Y)UvN`6k z_o%^lBqk)FISBYn9RRpwq<c{^tD@Rc7)QaySkyBXqvH)7w+u>WBx|l$3@C;oFkcqO zMXkE}!nMnyaEUhlnjK4o9e&GH;RT5oVCHY93xSZWKj4v75Cm?`wQCuoj9`??ZVf>q zIkxJ9e1fjAA3y-X*4RqoLX!3eNt<DS<d>1J{Kqh>@(;_B({CU3IJpdkB4_noM{N~X z+<M0Q?DH@w<N0?icL6}W;e4@D3O$Z$OhNUwJMUiTA<5bw>s8Am2%=zh1rPEG3n5f0 z6%2t9Zyqeq>H{4c%S#2s8bL-)GT9{$tyvoAB@L=lACf9&Rnv-}%}FJqc=56c=|{yA zf8K1}9nH%)cFxu)erw`!mafBg)iC4d3Y)f%;9xQF^DAjJ6Rojw!R`0HcZeB^UrOK^ z2-e8wvj-3^4m1IVL50LiaTF1MM8i+FCZW~J(3YiSlqcqg-(O=ok$v{?=)J#nt3SB% zivS$)rk5(J-6zhjPDzq>--Ah_H1BL=i|*m7i+Y#!yiOxJw4(2_CQ2~(;^2(f2YRl% z9hr&Y5HIAzSk{gam{3SLN(y96e6$NC1^qG90Lm8{aC>n>MT6?M`?RD{XZuvouFRr` zhIOZC>+zJo9=bEO>@}lvrzP>x8$+vT|FC%{;@bH|W7IUR9=~=sEONU4^!Qg1)3=w; z&nfsK;^x%Yi&8+7yjW@@MzADKGgN{K5JI#Q<q7R7ny<z2^>83gj$!*kYwClqW=T_B za!!7qn#h8+B_H~08U27IzvQVPX}R<1`ba_NI}2d*tI@idI#Zfa%%tuc>H9Jq|3_wC zr9EtV-j3w^K(E`B$2nHQR300fhOl`&2!#2G1_lpcSbK#Xg=B7(u7UL^Lyy$2U0Tc3 zP7hP+43z#P3nF!j(WtCGBSW^QF3hXKI@{aKm(&B2p4RVHi#JfM&aO*;j}+}5XNsCN zaI)Vrr{**5M}Hg=s~>N~P{>Q6SYtu%1~rYf!VU4;gs_Z<QtwuP{$p#{+Slb27u2K# IKcc1jKhN|OI{*Lx literal 0 HcmV?d00001 diff --git a/sites/all/modules/ctools/ctools_ajax_sample/images/popups-border.png b/sites/all/modules/ctools/ctools_ajax_sample/images/popups-border.png new file mode 100644 index 0000000000000000000000000000000000000000..ba939f8994e793b3aa47757c6227c7762e1fdd9c GIT binary patch literal 380 zcmV-?0fYXDP)<h;3K|Lk000e1NJLTq000yK001)x1^@s6mmnyE0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUz9!W$&RCwC#*0BnLKpY0}zvg0-IOpKr z&=NgELyK;{igT~xCioiBBKQCf?&6f=^$8b<M4kFg(FY&5#E+xyf1Rb2l5yfVK4Cea z0qUVX>Y|ny#2G<HED0LQiZ~-I6+&#iCPK=ls;c2TyRbl8{{X@S12*WfL7xq}Oz?HE zA83nqXoHq{p5G=DRG5OpNNsg@=pH=-sIg{%?@JE$y9^_k>M5dtvSf-(z);^nG*ISD zlPMUmL5~gkY|xzpDud5ibHJW`IkarBV}lJFEUBQr_iE-2hh$VxU!qsWPA&Rl$?(5I zv1hqwgDo5E*kHp3OD0%PUlD7;SySYE+S!t)h@%f}|Lw74JbF<S6+(<H<ov-u_><sM afB^tAV@t1OT?euN0000<MNUMnLSTZ5$e}?1 literal 0 HcmV?d00001 diff --git a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info index 320a6232..09e98987 100644 --- a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info +++ b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info @@ -1,13 +1,12 @@ -; $Id: ctools_custom_content.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $ name = Custom content panes description = Create custom, exportable, reusable content panes for applications like Panels. core = 7.x package = Chaos tool suite dependencies[] = ctools -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install index 4ff0f874..8348434b 100644 --- a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install +++ b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.install @@ -1,5 +1,4 @@ <?php -// $Id: ctools_custom_content.install,v 1.2 2010/10/11 22:18:21 sdboyer Exp $ /** * Schema for CTools custom content. diff --git a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module index 9676540c..a2e8ee24 100644 --- a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module +++ b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.module @@ -1,5 +1,4 @@ <?php -// $Id: ctools_custom_content.module,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc index fe634f4e..467dc580 100644 --- a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc +++ b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content.inc @@ -1,5 +1,4 @@ <?php -// $Id: ctools_custom_content.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ $plugin = array( 'schema' => 'ctools_custom_content', diff --git a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php index 9f892827..e78c89f0 100644 --- a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php +++ b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php @@ -1,5 +1,4 @@ <?php -// $Id: ctools_custom_content_ui.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ class ctools_custom_content_ui extends ctools_export_ui { @@ -99,12 +98,14 @@ class ctools_custom_content_ui extends ctools_export_ui { break; } + $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline')))); + $this->rows[$item->name] = array( 'data' => array( array('data' => check_plain($item->name), 'class' => array('ctools-export-ui-name')), array('data' => check_plain($item->admin_title), 'class' => array('ctools-export-ui-title')), array('data' => check_plain($item->category), 'class' => array('ctools-export-ui-category')), - array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations')), + array('data' => $ops, 'class' => array('ctools-export-ui-operations')), ), 'title' => check_plain($item->admin_description), 'class' => array(!empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled'), diff --git a/sites/all/modules/ctools/ctools_plugin_example/README.txt b/sites/all/modules/ctools/ctools_plugin_example/README.txt index e13b9457..42edcdc9 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/README.txt +++ b/sites/all/modules/ctools/ctools_plugin_example/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.2 2010/10/11 22:18:24 sdboyer Exp $ The CTools Plugin Example is an example for developers of how to CTools access, argument, content type, context, and relationship plugins. diff --git a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info index 7b43c9d3..b6ba31ed 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info +++ b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info @@ -1,4 +1,3 @@ -; $Id: ctools_plugin_example.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $ name = Chaos Tools (CTools) Plugin Example description = Shows how an external module can provide ctools plugins (for Panels, etc.). package = Chaos tool suite @@ -8,9 +7,9 @@ dependencies[] = page_manager dependencies[] = advanced_help core = 7.x -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module index 8ac4d6aa..442969d7 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module +++ b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.module @@ -1,5 +1,4 @@ <?php -// $Id: ctools_plugin_example.module,v 1.2 2009/10/17 22:58:24 sdboyer Exp $ /* * @file diff --git a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc index 751a8ada..10a76193 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc @@ -1,5 +1,4 @@ <?php -// $Id: ctools_plugin_example.pages_default.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc index 11d065c6..2a09eea1 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/arg_length.inc @@ -1,5 +1,4 @@ <?php -// $Id: arg_length.inc,v 1.3 2010/09/07 09:02:50 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc index 63f8dd98..bbe364c1 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/access/example_role.inc @@ -1,5 +1,4 @@ <?php -// $Id: example_role.inc,v 1.3 2010/09/07 09:02:50 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc index fe245b6a..51c7c601 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/arguments/simplecontext_arg.inc @@ -1,5 +1,4 @@ <?php -// $Id: simplecontext_arg.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc index ffe9438e..2141c215 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/no_context_content_type.inc @@ -1,5 +1,4 @@ <?php -// $Id: no_context_content_type.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $ /** * @file @@ -87,7 +86,7 @@ function no_context_content_type_render($subtype, $conf, $args, $context) { * ctools_plugin_example_no_context_content_type_edit_form. * */ -function no_context_content_type_edit_form(&$form, &$form_state) { +function no_context_content_type_edit_form($form, &$form_state) { $conf = $form_state['conf']; $form['item1'] = array( '#type' => 'textfield', @@ -114,4 +113,4 @@ function no_context_content_type_edit_form_submit(&$form, &$form_state) { foreach (array('item1', 'item2') as $key) { $form_state['conf'][$key] = $form_state['values'][$key]; } -} \ No newline at end of file +} diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc index 60ef7bc4..b0742e0c 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/relcontext_content_type.inc @@ -1,5 +1,4 @@ <?php -// $Id: relcontext_content_type.inc,v 1.3 2010/01/29 19:53:48 merlinofchaos Exp $ /** diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc index 0759aecb..82291d06 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/content_types/simplecontext_content_type.inc @@ -1,5 +1,4 @@ <?php -// $Id: simplecontext_content_type.inc,v 1.3 2010/01/29 19:53:48 merlinofchaos Exp $ /** diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc index 313d6346..0c7ef113 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/relcontext.inc @@ -1,5 +1,4 @@ <?php -// $Id: relcontext.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc index 2ddf50c0..e19a8422 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/contexts/simplecontext.inc @@ -1,5 +1,4 @@ <?php -// $Id: simplecontext.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $ /** diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc index 8807f753..d3022af7 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/panels.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: panels.pages.inc,v 1.3 2009/10/17 22:58:26 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc b/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc index 6e24ed76..62246210 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc +++ b/sites/all/modules/ctools/ctools_plugin_example/plugins/relationships/relcontext_from_simplecontext.inc @@ -1,5 +1,4 @@ <?php -// $Id: relcontext_from_simplecontext.inc,v 1.2 2010/01/29 19:53:48 merlinofchaos Exp $ /** diff --git a/sites/all/modules/ctools/help/about.html b/sites/all/modules/ctools/help/about.html index c5b8ec0c..39493ffe 100644 --- a/sites/all/modules/ctools/help/about.html +++ b/sites/all/modules/ctools/help/about.html @@ -1,4 +1,3 @@ -<!-- $Id: about.html,v 1.1 2009/01/22 01:57:18 merlinofchaos Exp $ --> The Chaos Tool Suite is a series of tools for developers to make code that I've found to be very useful to Views and Panels more readily available. Certain methods of doing things, particularly with AJAX, exportable objects, and a plugin system are proving to be ideas that are useful outside of just Views and Panels. This module does not offer much directly ot the end user, but instead creates a library for other modules to use. If you are an end user and some module asked you to install the CTools suite, then this is far as you really need to go. If you're a developer and are interested in these tools, read on! <h3>Tools provided by CTools</h3> diff --git a/sites/all/modules/ctools/help/ajax.html b/sites/all/modules/ctools/help/ajax.html index 8745e398..e69de29b 100644 --- a/sites/all/modules/ctools/help/ajax.html +++ b/sites/all/modules/ctools/help/ajax.html @@ -1 +0,0 @@ -<!-- $Id: ajax.html,v 1.1 2009/01/22 01:57:18 merlinofchaos Exp $ --> diff --git a/sites/all/modules/ctools/help/context-access.html b/sites/all/modules/ctools/help/context-access.html index 24a182be..ef2ddbf8 100644 --- a/sites/all/modules/ctools/help/context-access.html +++ b/sites/all/modules/ctools/help/context-access.html @@ -1,4 +1,3 @@ -<!-- $Id: context-access.html,v 1.1 2008/12/17 08:29:20 merlinofchaos Exp $ --> access plugins allow context based access control to pages. diff --git a/sites/all/modules/ctools/help/context-arguments.html b/sites/all/modules/ctools/help/context-arguments.html index d9910bb7..f19f597c 100644 --- a/sites/all/modules/ctools/help/context-arguments.html +++ b/sites/all/modules/ctools/help/context-arguments.html @@ -1,4 +1,3 @@ -<!-- $Id: context-arguments.html,v 1.3 2008/12/19 17:35:57 merlinofchaos Exp $ --> Arguments create a context from external input, which is assumed to be a string as though it came from a URL element. diff --git a/sites/all/modules/ctools/help/context-content.html b/sites/all/modules/ctools/help/context-content.html index b3becf12..7c18d519 100644 --- a/sites/all/modules/ctools/help/context-content.html +++ b/sites/all/modules/ctools/help/context-content.html @@ -1,4 +1,3 @@ -<!-- $Id: context-content.html,v 1.3 2009/07/18 22:06:33 merlinofchaos Exp $ --> <p>The CTools pluggable content system provides various pieces of content as discrete bits of data that can be added to other applications, such as Panels or Dashboard via the UI. Whatever the diff --git a/sites/all/modules/ctools/help/context-context.html b/sites/all/modules/ctools/help/context-context.html index 9d8c1d8d..23a96315 100644 --- a/sites/all/modules/ctools/help/context-context.html +++ b/sites/all/modules/ctools/help/context-context.html @@ -1,4 +1,3 @@ -<!-- $Id: context-context.html,v 1.1 2008/12/04 22:22:40 merlinofchaos Exp $ --> Context plugin data: diff --git a/sites/all/modules/ctools/help/context-relationships.html b/sites/all/modules/ctools/help/context-relationships.html index 9fc8a9b5..547f8912 100644 --- a/sites/all/modules/ctools/help/context-relationships.html +++ b/sites/all/modules/ctools/help/context-relationships.html @@ -1,4 +1,3 @@ -<!-- $Id: context-relationships.html,v 1.1 2008/12/04 22:22:40 merlinofchaos Exp $ --> 'title' => The title to display. 'description' => Description to display. diff --git a/sites/all/modules/ctools/help/context.html b/sites/all/modules/ctools/help/context.html index bf5ebeea..e69de29b 100644 --- a/sites/all/modules/ctools/help/context.html +++ b/sites/all/modules/ctools/help/context.html @@ -1 +0,0 @@ -<!-- $Id: context.html,v 1.1 2008/12/04 22:22:40 merlinofchaos Exp $ --> diff --git a/sites/all/modules/ctools/help/ctools.help.ini b/sites/all/modules/ctools/help/ctools.help.ini index 9de6e3b6..fcb121b8 100644 --- a/sites/all/modules/ctools/help/ctools.help.ini +++ b/sites/all/modules/ctools/help/ctools.help.ini @@ -1,4 +1,3 @@ -; $Id: ctools.help.ini,v 1.4 2010/09/07 09:02:50 sdboyer Exp $ [advanced help settings] line break = TRUE @@ -80,6 +79,10 @@ parent = ajax title = Javascript dropdown parent = ajax +[dropbutton] +title = Javascript dropbutton +parent = ajax + [dependent] title = Dependent checkboxes and radio buttons parent = ajax diff --git a/sites/all/modules/ctools/help/export-ui.html b/sites/all/modules/ctools/help/export-ui.html index 3ebeb647..d291ce4d 100644 --- a/sites/all/modules/ctools/help/export-ui.html +++ b/sites/all/modules/ctools/help/export-ui.html @@ -1,4 +1,3 @@ -<!-- $Id: export-ui.html,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ --> Most user interfaces for exportables are very similar, so CTools includes a tool to provide the framework for the most common UI. This tool is a plugin of the 'export_ui' type. In order to create a UI for your exportable object with this tool, you first need to ensure that your module supports the plugin: <pre> diff --git a/sites/all/modules/ctools/help/export.html b/sites/all/modules/ctools/help/export.html index 0e6b4f83..35019029 100644 --- a/sites/all/modules/ctools/help/export.html +++ b/sites/all/modules/ctools/help/export.html @@ -1,4 +1,3 @@ -<!-- $Id: export.html,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ --> Exportable objects are objects that can live either in the database or in code, or in both. If they live in both, then the object in code is considered to be "overridden", meaning that the version in code is ignored in favor of the version in the database. The main benefit to this is that you can move objects that are intended to be structure or feature-related into code, thus removing them entirely from the database. This is a very important part of the deployment path, since in an ideal world, the database is primarily user generated content, whereas site structure and site features should be in code. However, many many features in Drupal rely on objects being in the database and provide UIs to create them. @@ -113,7 +112,10 @@ function mymodule_schema() { <dd>Objects should contain a primary key which is a database identifier primarily used to determine if an object has been written or not. This is required for the default CRUD save callback to work.</dd> <dt>object</dt> -<dd>The class the object should be created as. Defaults as stdClass.</dd> +<dd>The class the object should be created as, if 'object factory' is not set. If this is not set either, defaults as stdClass.</dd> + +<dt>object factory</dt> +<dd>Function used to create the object. The function receives the schema and the loaded data as a parameters: your_factory_function($schema, $data). If this is set, 'object' has no effect since you can use your function to create whatever class you wish.</dd> <dt>can disable</dt> <dd>Control whether or not the exportable objects can be disabled. All this does is cause the 'disabled' field on the object to always be set appropriately, and a variable is kept to record the state. Changes made to this state must be handled by the owner of the object. Defaults to TRUE.</dd> @@ -124,12 +126,21 @@ function mymodule_schema() { <dt>default hook</dt> <dd>What hook to invoke to find exportable objects that are currently defined. These will all be gathered into a giant array. Defaults to 'default_' . $table.</dd> +<dt>cache defaults</dt> +<dd>If true, default objects will be cached so that the processing of the hook does not need to be called often. Defaults to FALSE. Recommended if you will potentially have a lot of objects in code. Not recommended if code will be the exception.</dd> + +<dt>default cache bin</dt> +<dd>If default object caching is enabled, what cache bin to use. This defaults to the basic "cache". It is highly recommended that you use a different cache bin if possible.</dd> + <dt>identifier</dt> <dd>When exporting the object, the identifier is the variable that the exported object will be placed in. Defaults to $table.</dd> <dt>bulk export</dt> <dd>Declares whether or not the exportable will be available for bulk exporting.</dd> +<dt>export type string</dt> +<dd>The export type string (Local, Overridden, Database) is normally stored as $item->type. Since type is a very common keyword, it's possible to specify what key to actually use. </dd> + <dt>list callback</dt> <dd>Bulk export callback to provide a list of exportable objects to be chosen for bulk exporting. Defaults to $module . '_' . $table . '_list' if the function exists. If it is not, a default listing function will be provided that will make a best effort to list the titles. See ctools_export_default_list().</dd> @@ -158,6 +169,9 @@ function mymodule_schema() { <dt>import callback</dt> <dd>CRUD callback to use for importing. If not provided, the default export function will be used. This function will accept the code as a single argument and, if the code evaluates, return an object represented by that code. In the case of failure, this will return a string with human readable errors.</dd> +<dt>status callback</dt> +<dd>CRUD callback to use for updating the status of an object. If the status is TRUE the object will be disabled. If the status is FALSE the object will be enabled.</dd> + In addition, each field can contain the following: <dl> <dt>no export</dt> @@ -197,6 +211,7 @@ Exportable objects have several reserved keys that are used by the CTools export <li><em>Overridden</em> is an object that lives in the database and is overriding the exported configuration of a corresponding object in code.</li> <li><em>Default</em> is an object that lives only in code.</li> </ul> +<i>Note: This key can be changed by setting 'export type string' to something else, to try and prevent "type" from conflicting.</i> </dd> </dl> diff --git a/sites/all/modules/ctools/help/modal.html b/sites/all/modules/ctools/help/modal.html index 60985929..83c45adf 100644 --- a/sites/all/modules/ctools/help/modal.html +++ b/sites/all/modules/ctools/help/modal.html @@ -1,4 +1,3 @@ -<!-- $Id: modal.html,v 1.4 2010/12/31 23:58:52 merlinofchaos Exp $ --> CTools provides a simple modal that can be used as a popup to place forms. It differs from the normal modal frameworks in that it does not do its work via an iframe. This is both an advantage and a disadvantage. The iframe simply renders normal pages in a sub-browser and they can do their thing. That makes it much easier to put arbitrary pages and forms in a modal. However, the iframe is not very good at actually communicating changes to the main page, so you cannot open the modal, have it do some work, and then modify the page. <h3>Invoking the modal</h3> @@ -198,15 +197,15 @@ If you are displaying a form -- and the vast majority of modals display forms -- ); $output = ctools_modal_form_wrapper('my_form', $form_state); // There are some possible states after calling the form wrapper: - // 1) We are not using $js and there is form output to be rendered. + // 1) We are not using $js and the form has been executed. // 2) We are using $js and the form was successfully submitted and // we need to dismiss the modal. // Most other states are handled automatically unless you set flags in // $form_state to avoid handling them, so we only deal with those two // states. - if (empty($output) && $js) { + if ($form_state['executed'] && $js) { $commands = array(); - $commands[] = ctools_modal_command_dismiss(t('Login Success'); + $commands[] = ctools_modal_command_dismiss(t('Login Success')); // In typical usage you will do something else here, such as update a // div with HTML or redirect the page based upon the results of the modal // form. diff --git a/sites/all/modules/ctools/help/object-cache.html b/sites/all/modules/ctools/help/object-cache.html index e810b17d..96481708 100644 --- a/sites/all/modules/ctools/help/object-cache.html +++ b/sites/all/modules/ctools/help/object-cache.html @@ -1,4 +1,3 @@ -<!-- $Id: object-cache.html,v 1.1 2009/01/23 23:14:04 merlinofchaos Exp $ --> The CTools Object Cache is a specialized cache for storing data that is non-volatile. This differs from the standard Drupal cache mechanism, which is volatile, meaning that the data can be cleared at any time and it is expected that any cached data can easily be reconstructed. In contrast, data stored in this cache is not expected to be reconstructable. It is primarily used for storing user input which is retrieved in stages, allowing for more complex user interface interactions. The object cache consists of 3 normal functions for cache maintenance, and 2 additional functions to facilitate locking. diff --git a/sites/all/modules/ctools/help/plugins-api.html b/sites/all/modules/ctools/help/plugins-api.html index 4392cb43..47e5d6ba 100644 --- a/sites/all/modules/ctools/help/plugins-api.html +++ b/sites/all/modules/ctools/help/plugins-api.html @@ -1,4 +1,3 @@ -<!-- $Id: plugins-api.html,v 1.3 2009/04/17 19:16:21 merlinofchaos Exp $ --> APIs are a form of plugins that are tightly associated with a module. Instead of a module providing any number of plugins, each module provides only one file for an API and this file can contain hooks that the module should invoke. Modules support this API by implementing hook_ctools_plugin_api($module, $api). If they support the API, they return a packet of data: diff --git a/sites/all/modules/ctools/help/plugins-creating.html b/sites/all/modules/ctools/help/plugins-creating.html index b1242f29..77f0315c 100644 --- a/sites/all/modules/ctools/help/plugins-creating.html +++ b/sites/all/modules/ctools/help/plugins-creating.html @@ -1,4 +1,3 @@ -<!-- $Id: plugins-creating.html,v 1.10 2010/09/07 09:02:50 sdboyer Exp $ --> There are two primary pieces to using plugins. The first is getting the data, and the second is using the data. <h3>Getting the data</h3> diff --git a/sites/all/modules/ctools/help/plugins-implementing.html b/sites/all/modules/ctools/help/plugins-implementing.html index 2ee4ce78..0ea1269e 100644 --- a/sites/all/modules/ctools/help/plugins-implementing.html +++ b/sites/all/modules/ctools/help/plugins-implementing.html @@ -1,4 +1,3 @@ -<!-- $Id: plugins-implementing.html,v 1.4 2009/11/13 00:49:28 merlinofchaos Exp $ --> To implement plugins, you need to implement a single hook in your module to tell the system where your plugins live, and then you need to implement one or more .inc files that contain the plugin data. <h3>Telling it where your plugins live</h3> diff --git a/sites/all/modules/ctools/help/plugins.html b/sites/all/modules/ctools/help/plugins.html index caf699a0..906813ee 100644 --- a/sites/all/modules/ctools/help/plugins.html +++ b/sites/all/modules/ctools/help/plugins.html @@ -1,4 +1,3 @@ -<!-- $Id: plugins.html,v 1.2 2010/09/07 09:02:50 sdboyer Exp $ --> The plugins tool allows a module to allow <b>other</b> modules (and themes!) to provide plugins which provide some kind of functionality or some kind of task. For example, in Panels there are several types of plugins: Content types (which are like blocks), layouts (which are page layouts) and styles (which can be used to style a panel). Each plugin is represented by a .inc file, and the functionality they offer can differ wildly. A module which uses plugins can implement a hook describing the plugin (which is not necessary, as defaults will be filled in) and then calls a ctools function which loads either all the known plugins (used for listing/choosing) or loads a specific plugin (used when its known which plugin is needed). From the perspective of the plugin system, a plugin is a packet of data, usually some printable info and a list of callbacks. It is up to the module implementing plugins to determine what that info means and what the callbacks do. diff --git a/sites/all/modules/ctools/help/wizard.html b/sites/all/modules/ctools/help/wizard.html index 5fbc55b6..93775dbc 100644 --- a/sites/all/modules/ctools/help/wizard.html +++ b/sites/all/modules/ctools/help/wizard.html @@ -1,4 +1,3 @@ -<!-- $Id: wizard.html,v 1.8 2010/10/15 22:13:37 merlinofchaos Exp $ --> Form wizards, or multi-step forms, are a process by which the user goes through or can use an arbitrary number of different forms to create a single object or perform a single task. Traditionally the multi-step form is difficult in Drupal because there is no easy place to put data in between forms. No longer! The form wizard tool allows a single entry point to easily set up a wizard of multiple forms, provide callbacks to handle data storage and updates between forms and when forms are completed. This tool pairs well with the <a href="&topic:ctools/object-cache&">object cache</a> tool for storage. <h3>The form info array</h3> @@ -212,13 +211,15 @@ All that's needed to tie this together is to understand how the changes made it /** * Store the values from the basic settings form. */ -function delegator_page_form_basic_submit(&$form, &$form_state) { +function delegator_page_form_basic_submit($form, &$form_state) { if (!isset($form_state['page']->pid) && empty($form_state['page']->import)) { $form_state['page']->name = $form_state['values']['name']; } $form_state['page']->admin_title = $form_state['values']['admin_title']; $form_state['page']->path = $form_state['values']['path']; + + return $form; } </pre> @@ -231,7 +232,7 @@ When using <strong>'show back' => TRUE</strong> the cached data should be assign /** * Form builder function for wizard. */ -function wizardid_step2_form(&$form, &$form_state) { +function wizardid_step2_form($form, &$form_state) { $form_state['my data'] = my_module_get_cache($form_state['cache name']); $form['example'] = array( '#type' => 'radios', @@ -242,6 +243,8 @@ function wizardid_step2_form(&$form, &$form_state) { 'setting1' => t('Setting1'), ), ); + + return $form; } /** diff --git a/sites/all/modules/ctools/includes/ajax.inc b/sites/all/modules/ctools/includes/ajax.inc index 2f463779..981ee237 100644 --- a/sites/all/modules/ctools/includes/ajax.inc +++ b/sites/all/modules/ctools/includes/ajax.inc @@ -1,5 +1,4 @@ <?php -// $Id: ajax.inc,v 1.22 2010/12/31 23:58:52 merlinofchaos Exp $ // Set this so we can tell that the file has been included at some point. define('CTOOLS_AJAX_INCLUDED', 1); diff --git a/sites/all/modules/ctools/includes/cache.inc b/sites/all/modules/ctools/includes/cache.inc index 437acefc..ca6e6f34 100644 --- a/sites/all/modules/ctools/includes/cache.inc +++ b/sites/all/modules/ctools/includes/cache.inc @@ -1,5 +1,4 @@ <?php -// $Id: cache.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/cache.plugin-type.inc b/sites/all/modules/ctools/includes/cache.plugin-type.inc index 0e8e8c81..1ab4cdd1 100644 --- a/sites/all/modules/ctools/includes/cache.plugin-type.inc +++ b/sites/all/modules/ctools/includes/cache.plugin-type.inc @@ -1,5 +1,4 @@ <?php -// $Id: cache.plugin-type.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/cleanstring.inc b/sites/all/modules/ctools/includes/cleanstring.inc index baed9e3b..e4943e43 100644 --- a/sites/all/modules/ctools/includes/cleanstring.inc +++ b/sites/all/modules/ctools/includes/cleanstring.inc @@ -34,32 +34,32 @@ * Copied from search.module's PREG_CLASS_SEARCH_EXCLUDE. */ define('CTOOLS_PREG_CLASS_ALNUM', -'\x{0}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-'. -'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-'. -'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}'. -'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-'. -'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-'. -'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-'. -'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}'. -'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-'. -'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}'. -'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-'. -'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}'. -'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-'. -'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}'. -'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}'. -'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}'. -'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}'. -'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-'. -'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-'. -'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}'. -'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}'. -'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}'. -'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}'. -'\x{3099}-\x{309e}\x{30a0}\x{30fb}-\x{30fe}\x{3190}-\x{319f}\x{31c0}-\x{31cf}'. -'\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}\x{a806}'. -'\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}\x{fd3f}'. -'\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}\x{ff5b}-'. +'\x{0}-\x{2f}\x{3a}-\x{40}\x{5b}-\x{60}\x{7b}-\x{bf}\x{d7}\x{f7}\x{2b0}-' . +'\x{385}\x{387}\x{3f6}\x{482}-\x{489}\x{559}-\x{55f}\x{589}-\x{5c7}\x{5f3}-' . +'\x{61f}\x{640}\x{64b}-\x{65e}\x{66a}-\x{66d}\x{670}\x{6d4}\x{6d6}-\x{6ed}' . +'\x{6fd}\x{6fe}\x{700}-\x{70f}\x{711}\x{730}-\x{74a}\x{7a6}-\x{7b0}\x{901}-' . +'\x{903}\x{93c}\x{93e}-\x{94d}\x{951}-\x{954}\x{962}-\x{965}\x{970}\x{981}-' . +'\x{983}\x{9bc}\x{9be}-\x{9cd}\x{9d7}\x{9e2}\x{9e3}\x{9f2}-\x{a03}\x{a3c}-' . +'\x{a4d}\x{a70}\x{a71}\x{a81}-\x{a83}\x{abc}\x{abe}-\x{acd}\x{ae2}\x{ae3}' . +'\x{af1}-\x{b03}\x{b3c}\x{b3e}-\x{b57}\x{b70}\x{b82}\x{bbe}-\x{bd7}\x{bf0}-' . +'\x{c03}\x{c3e}-\x{c56}\x{c82}\x{c83}\x{cbc}\x{cbe}-\x{cd6}\x{d02}\x{d03}' . +'\x{d3e}-\x{d57}\x{d82}\x{d83}\x{dca}-\x{df4}\x{e31}\x{e34}-\x{e3f}\x{e46}-' . +'\x{e4f}\x{e5a}\x{e5b}\x{eb1}\x{eb4}-\x{ebc}\x{ec6}-\x{ecd}\x{f01}-\x{f1f}' . +'\x{f2a}-\x{f3f}\x{f71}-\x{f87}\x{f90}-\x{fd1}\x{102c}-\x{1039}\x{104a}-' . +'\x{104f}\x{1056}-\x{1059}\x{10fb}\x{10fc}\x{135f}-\x{137c}\x{1390}-\x{1399}' . +'\x{166d}\x{166e}\x{1680}\x{169b}\x{169c}\x{16eb}-\x{16f0}\x{1712}-\x{1714}' . +'\x{1732}-\x{1736}\x{1752}\x{1753}\x{1772}\x{1773}\x{17b4}-\x{17db}\x{17dd}' . +'\x{17f0}-\x{180e}\x{1843}\x{18a9}\x{1920}-\x{1945}\x{19b0}-\x{19c0}\x{19c8}' . +'\x{19c9}\x{19de}-\x{19ff}\x{1a17}-\x{1a1f}\x{1d2c}-\x{1d61}\x{1d78}\x{1d9b}-' . +'\x{1dc3}\x{1fbd}\x{1fbf}-\x{1fc1}\x{1fcd}-\x{1fcf}\x{1fdd}-\x{1fdf}\x{1fed}-' . +'\x{1fef}\x{1ffd}-\x{2070}\x{2074}-\x{207e}\x{2080}-\x{2101}\x{2103}-\x{2106}' . +'\x{2108}\x{2109}\x{2114}\x{2116}-\x{2118}\x{211e}-\x{2123}\x{2125}\x{2127}' . +'\x{2129}\x{212e}\x{2132}\x{213a}\x{213b}\x{2140}-\x{2144}\x{214a}-\x{2b13}' . +'\x{2ce5}-\x{2cff}\x{2d6f}\x{2e00}-\x{3005}\x{3007}-\x{303b}\x{303d}-\x{303f}' . +'\x{3099}-\x{309e}\x{30a0}\x{30fb}-\x{30fe}\x{3190}-\x{319f}\x{31c0}-\x{31cf}' . +'\x{3200}-\x{33ff}\x{4dc0}-\x{4dff}\x{a015}\x{a490}-\x{a716}\x{a802}\x{a806}' . +'\x{a80b}\x{a823}-\x{a82b}\x{d800}-\x{f8ff}\x{fb1e}\x{fb29}\x{fd3e}\x{fd3f}' . +'\x{fdfc}-\x{fe6b}\x{feff}-\x{ff0f}\x{ff1a}-\x{ff20}\x{ff3b}-\x{ff40}\x{ff5b}-' . '\x{ff65}\x{ff70}\x{ff9e}\x{ff9f}\x{ffe0}-\x{fffd}'); @@ -78,7 +78,7 @@ define('CTOOLS_PREG_CLASS_ALNUM', * - 'ignore words': Set to an array of words that will be removed * rather than made safe. Defaults to an empty array. * - 'separator': Change spaces and untranslatable characters to - * this character. Defaults to '-'. + * this character. Defaults to '-' . * - 'replacements': An array of direct replacements to be made that will * be implemented via strtr(). Defaults to an empty array. * - 'transliterate': If set, use the transliteration replacements. If set @@ -138,7 +138,7 @@ function ctools_cleanstring($string, $settings = array()) { // Get rid of words that are on the ignore list if (!empty($settings['ignore words'])) { - $ignore_re = '\b'. preg_replace('/,/', '\b|\b', $settings['ignore words']) .'\b'; + $ignore_re = '\b' . preg_replace('/,/', '\b|\b', $settings['ignore words']) . '\b'; if (function_exists('mb_eregi_replace')) { $output = mb_eregi_replace($ignore_re, '', $output); @@ -154,11 +154,11 @@ function ctools_cleanstring($string, $settings = array()) { // In preparation for pattern matching, // escape the separator if and only if it is not alphanumeric. if (isset($settings['separator'])) { - if (preg_match('/^[^'. CTOOLS_PREG_CLASS_ALNUM .']+$/uD', $settings['separator'])) { + if (preg_match('/^[^' . CTOOLS_PREG_CLASS_ALNUM . ']+$/uD', $settings['separator'])) { $seppattern = $settings['separator']; } else { - $seppattern = '\\'. $settings['separator']; + $seppattern = '\\' . $settings['separator']; } // Trim any leading or trailing separators (note the need to $output = preg_replace("/^$seppattern+|$seppattern+$/", '', $output); diff --git a/sites/all/modules/ctools/includes/collapsible.theme.inc b/sites/all/modules/ctools/includes/collapsible.theme.inc index c2a91762..f7bbbb37 100644 --- a/sites/all/modules/ctools/includes/collapsible.theme.inc +++ b/sites/all/modules/ctools/includes/collapsible.theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: collapsible.theme.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/content.inc b/sites/all/modules/ctools/includes/content.inc index 39ec1abe..a55f7ec5 100644 --- a/sites/all/modules/ctools/includes/content.inc +++ b/sites/all/modules/ctools/includes/content.inc @@ -1,5 +1,4 @@ <?php -// $Id: content.inc,v 1.21 2010/12/31 23:53:34 merlinofchaos Exp $ /** * @file @@ -48,6 +47,14 @@ function ctools_content_process(&$plugin, $info) { $plugin['add form'] = $function_base . 'edit_form'; } + if (!isset($plugin['description'])) { + $plugin['description'] = ''; + } + + if (!isset($plugin['icon'])) { + $plugin['icon'] = ctools_content_admin_icon($plugin); + } + // Another ease of use check: if (!isset($plugin['content types'])) { // If a subtype plugin exists, try to use it. Otherwise assume single. @@ -270,6 +277,10 @@ function ctools_content_render($type, $subtype, $conf, $keywords = array(), $arg $content = $function($subtype, $conf, $args, $pane_context, $incoming_content); + if (empty($content)) { + return; + } + // Set up some defaults and other massaging on the content before we hand // it back to the caller. if (!isset($content->type)) { @@ -487,7 +498,6 @@ function ctools_content_configure_form_defaults($form, &$form_state) { '#default_value' => isset($conf['override_title_text']) ? $conf['override_title_text'] : '', '#size' => 35, '#id' => 'override-title-textfield', - '#process' => array('ctools_dependent_process'), '#dependency' => array('override-title-checkbox' => array(1)), '#dependency_type' => 'disable', ); @@ -743,7 +753,7 @@ function ctools_content_select_context($plugin, $subtype, $conf, $contexts) { // than it's wrong. if (is_array($subtype_info['required context'])) { if (empty($conf['context']) || count($subtype_info['required context']) != count($conf['context'])) { - foreach($subtype_info['required context'] as $index => $required) { + foreach ($subtype_info['required context'] as $index => $required) { if (!isset($conf['context'][$index])) { $filtered = ctools_context_filter($contexts, $required); if ($filtered) { diff --git a/sites/all/modules/ctools/includes/content.menu.inc b/sites/all/modules/ctools/includes/content.menu.inc index 02169f2f..11a686ab 100644 --- a/sites/all/modules/ctools/includes/content.menu.inc +++ b/sites/all/modules/ctools/includes/content.menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: content.menu.inc,v 1.9 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -52,6 +51,9 @@ function ctools_content_autocomplete_entity($type, $string = '') { $matches = array(); if ($type == 'node') { $query->addTag('node_access'); + $query->join('users', 'u', 'b.uid = u.uid'); + $query->addField('u', 'name', 'name'); + foreach ($query->execute() as $nodeish) { $name = empty($nodeish->name) ? variable_get('anonymous', t('Anonymous')) : check_plain($nodeish->name); $matches[$nodeish->title . " [id: $nodeish->nid]"] = '<span class="autocomplete_title">' . check_plain($nodeish->title) . '</span> <span class="autocomplete_user">(' . t('by @user', array('@user' => $name)) . ')</span>'; diff --git a/sites/all/modules/ctools/includes/content.plugin-type.inc b/sites/all/modules/ctools/includes/content.plugin-type.inc index 66b330e4..4c767ae8 100644 --- a/sites/all/modules/ctools/includes/content.plugin-type.inc +++ b/sites/all/modules/ctools/includes/content.plugin-type.inc @@ -1,5 +1,4 @@ <?php -// $Id: content.plugin-type.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/content.theme.inc b/sites/all/modules/ctools/includes/content.theme.inc index f3a34f60..ae4456aa 100644 --- a/sites/all/modules/ctools/includes/content.theme.inc +++ b/sites/all/modules/ctools/includes/content.theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: content.theme.inc,v 1.4 2009/10/17 22:58:25 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/context-access-admin.inc b/sites/all/modules/ctools/includes/context-access-admin.inc index 7b458983..b1558000 100644 --- a/sites/all/modules/ctools/includes/context-access-admin.inc +++ b/sites/all/modules/ctools/includes/context-access-admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: context-access-admin.inc,v 1.12 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/context-admin.inc b/sites/all/modules/ctools/includes/context-admin.inc index 1fba7bbe..bda61e3f 100644 --- a/sites/all/modules/ctools/includes/context-admin.inc +++ b/sites/all/modules/ctools/includes/context-admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: context-admin.inc,v 1.14 2010/10/11 22:18:22 sdboyer Exp $ /** * @file includes/common-context.inc @@ -102,7 +101,9 @@ function ctools_context_add_argument_form($module, &$form, &$form_state, &$form_ $args = ctools_get_arguments(); $choices = array(); foreach ($args as $name => $arg) { - $choices[$name] = $arg['title']; + if (empty($arg['no ui'])) { + $choices[$name] = $arg['title']; + } } asort($choices); @@ -167,7 +168,9 @@ function ctools_context_add_required_context_form($module, &$form, &$form_state, $choices = array(); foreach (ctools_get_contexts() as $name => $arg) { - $choices[$name] = $arg['title']; + if (empty($arg['no required context ui'])) { + $choices[$name] = $arg['title']; + } } asort($choices); @@ -261,6 +264,7 @@ function ctools_context_add_item_table_buttons($type, $module, &$form, $availabl '#value' => url("ctools/context/ajax/add/$module/$type/$cache_key", array('absolute' => TRUE)), ); + asort($available_contexts); // This also will be in the URL. $form['buttons'][$type]['item'] = array( '#attributes' => array('class' => array("ctools-$type-add-url")), @@ -379,10 +383,19 @@ function ctools_context_ajax_item_add($mechanism = NULL, $type = NULL, $cache_ke 'cache storage' => 'object', ); + if ($type == 'requiredcontext') { + $form_info += array( + 'add form name' => 'required context add form', + 'edit form name' => 'required context edit form', + ); + } + $output = ctools_plugin_configure_form($form_info, $form_state); - // If $rc is FALSE, there was no actual form. - if ($output === FALSE || !empty($form_state['complete'])) { + if (!empty($form_state['cancel'])) { + $output = array(ctools_modal_command_dismiss()); + } + else if (!empty($form_state['complete'])) { // Successful submit -- move temporary data to location. // Create a reference to the place our context lives. Since this is fairly @@ -545,10 +558,19 @@ function ctools_context_ajax_item_edit($mechanism = NULL, $type = NULL, $cache_k 'cache storage' => 'object', ); + if ($type == 'requiredcontext') { + $form_info += array( + 'add form name' => 'required context add form', + 'edit form name' => 'required context edit form', + ); + } + $output = ctools_plugin_configure_form($form_info, $form_state); - // If $rc is FALSE, there was no actual form. - if ($output === FALSE || !empty($form_state['complete'])) { + if (!empty($form_state['cancel'])) { + $output = array(ctools_modal_command_dismiss()); + } + else if (!empty($form_state['complete'])) { // successful submit $ref[$position] = $conf; if (isset($object->temporary)) { diff --git a/sites/all/modules/ctools/includes/context-task-handler.inc b/sites/all/modules/ctools/includes/context-task-handler.inc index cc512921..e1f78617 100644 --- a/sites/all/modules/ctools/includes/context-task-handler.inc +++ b/sites/all/modules/ctools/includes/context-task-handler.inc @@ -1,5 +1,4 @@ <?php -// $Id: context-task-handler.inc,v 1.35 2011/01/05 20:06:57 merlinofchaos Exp $ /** * @file @@ -44,6 +43,8 @@ function ctools_context_handler_render($task, $subtask, $contexts, $args) { if ($id) { return ctools_context_handler_render_handler($task, $subtask, $handlers[$id], $contexts, $args); } + + return FALSE; } /** @@ -168,7 +169,7 @@ function ctools_context_handler_render_handler($task, $subtask, $handler, $conte } if (isset($info['title'])) { - drupal_set_title($info['title']); + drupal_set_title($info['title'], PASS_THROUGH); } // Only directly output if $page was set to true. diff --git a/sites/all/modules/ctools/includes/context.inc b/sites/all/modules/ctools/includes/context.inc index 97c3e1a3..23fac54c 100644 --- a/sites/all/modules/ctools/includes/context.inc +++ b/sites/all/modules/ctools/includes/context.inc @@ -1,5 +1,4 @@ <?php -// $Id: context.inc,v 1.44 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -162,11 +161,18 @@ class ctools_context_required { $contexts = array($contexts); } - // Due to a bug, some contexts got recorded with an id of 0. This will - // convert them to the correct ID allowing for some earlier panels - // to continue to work. - if (!empty($context) && $context[strlen($context) - 1] === '0') { - $context[strlen($context) - 1] = 1; + // If we had requested a $context but that $context doesn't exist + // in our context list, there is a good chance that what happened + // is our context IDs changed. See if there's another context + // that satisfies our requirements. + if (!empty($context) && !isset($contexts[$context])) { + $choices = $this->filter($contexts); + + // If we got a hit, take the first one that matches. + if ($choices) { + $keys = array_keys($choices); + $context = reset($keys); + } } if (empty($context) || empty($contexts[$context])) { @@ -478,9 +484,11 @@ function ctools_context_get_all_converters() { $contexts = ctools_get_contexts(); $converters = array(); foreach ($contexts as $name => $context) { - $context_converters = _ctools_context_get_converters($name . '.', $name); - if ($context_converters) { - $converters[$context['title']] = $context_converters; + if (empty($context['no required context ui'])) { + $context_converters = _ctools_context_get_converters($name . '.', $name); + if ($context_converters) { + $converters[$context['title']] = $context_converters; + } } } @@ -524,6 +532,10 @@ function ctools_context_select($contexts, $required, $context) { if (is_array($required)) { $result = array(); foreach ($required as $id => $r) { + if (empty($required[$id])) { + continue; + } + if (($result[] = _ctools_context_select($contexts, $r, $context[$id])) === FALSE) { return FALSE; } @@ -922,7 +934,7 @@ function ctools_context_get_relevant_relationships($contexts) { // Go through each relationship foreach ($relationships as $rid => $relationship) { // For each relationship, see if there is a context that satisfies it. - if (ctools_context_filter($contexts, $relationship['required context'])) { + if (empty($relationship['no ui']) && ctools_context_filter($contexts, $relationship['required context'])) { $relevant[$rid] = $relationship['title']; } } @@ -1105,7 +1117,7 @@ function ctools_context_match_required_contexts($required, $contexts) { } foreach ($required as $r) { - $context = drupal_clone(array_shift($contexts)); + $context = clone(array_shift($contexts)); $context->identifier = $r['identifier']; $context->page_title = isset($r['title']) ? $r['title'] : ''; $context->keyword = $r['keyword']; @@ -1251,7 +1263,7 @@ function ctools_context_replace_placeholders($contexts, $arguments) { * Provide a form array for getting data to replace placeholder contexts * with real data. */ -function ctools_context_replace_form($form, $contexts) { +function ctools_context_replace_form(&$form, $contexts) { foreach ($contexts as $cid => $context) { if (empty($context->empty)) { continue; @@ -1394,7 +1406,7 @@ function ctools_access_group_summary($access, $contexts) { $descriptions[] = ctools_access_summary($plugin, $contexts, $test); } - $separator = $access['logic'] == 'and' ? t(', and ') : t(', or '); + $separator = (isset($access['logic']) && $access['logic'] == 'and') ? t(', and ') : t(', or '); return implode($separator, $descriptions); } diff --git a/sites/all/modules/ctools/includes/context.menu.inc b/sites/all/modules/ctools/includes/context.menu.inc index 39bcd9b2..ee227cb7 100644 --- a/sites/all/modules/ctools/includes/context.menu.inc +++ b/sites/all/modules/ctools/includes/context.menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: context.menu.inc,v 1.2 2008/12/30 18:21:34 merlinofchaos Exp $ /** * @file @@ -14,6 +13,7 @@ function ctools_context_menu(&$items) { 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, 'file' => 'includes/context-admin.inc', + 'theme callback' => 'ajax_base_page_theme', ); $items['ctools/context/ajax/add'] = array( 'page callback' => 'ctools_context_ajax_item_add', diff --git a/sites/all/modules/ctools/includes/context.plugin-type.inc b/sites/all/modules/ctools/includes/context.plugin-type.inc index fd28c34e..866def2e 100644 --- a/sites/all/modules/ctools/includes/context.plugin-type.inc +++ b/sites/all/modules/ctools/includes/context.plugin-type.inc @@ -1,5 +1,4 @@ <?php -// $Id: context.plugin-type.inc,v 1.2 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/context.theme.inc b/sites/all/modules/ctools/includes/context.theme.inc index 1b437d8e..8f660b8c 100644 --- a/sites/all/modules/ctools/includes/context.theme.inc +++ b/sites/all/modules/ctools/includes/context.theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: context.theme.inc,v 1.15 2011/01/05 19:56:46 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/css.inc b/sites/all/modules/ctools/includes/css.inc index 47a17c2d..238a3bc9 100644 --- a/sites/all/modules/ctools/includes/css.inc +++ b/sites/all/modules/ctools/includes/css.inc @@ -1,5 +1,4 @@ <?php -/* $Id: css.inc,v 1.18 2010/10/15 20:54:24 merlinofchaos Exp $ */ /* * @file @@ -557,7 +556,13 @@ function ctools_css_flush_caches() { // @see http://drupal.org/node/573292 // file_unmanaged_delete_recursive('public://render'); $filedir = file_default_scheme() . '://ctools/css'; - file_unmanaged_delete_recursive($filedir); + if (drupal_realpath($filedir)) { + // We use the @ because it's possible that files created by the webserver + // cannot be deleted while using drush to clear the cache. We don't really + // care that much about that, to be honest, so we use the @ to suppress + // the error message. + @file_unmanaged_delete_recursive($filedir); + } db_delete('ctools_css_cache')->execute(); } diff --git a/sites/all/modules/ctools/includes/dependent.inc b/sites/all/modules/ctools/includes/dependent.inc index 2e866dce..e812cb97 100644 --- a/sites/all/modules/ctools/includes/dependent.inc +++ b/sites/all/modules/ctools/includes/dependent.inc @@ -1,5 +1,4 @@ <?php -// $Id: dependent.inc,v 1.9 2011/01/04 01:21:30 merlinofchaos Exp $ /** * @file @@ -21,8 +20,6 @@ * When hiding checkboxes and radios you need to add their id in a div * manually via #prefix and #suffix since they don't have their own id. You * actually need to add TWO divs because it's the parent that gets hidden. - * Also be sure to retain the 'expand_checkboxes' in the #process array, - * because the views process will override it. * * Fieldsets can not be hidden by default. Adding '#input' => TRUE to the * fieldset works around that. @@ -43,7 +40,6 @@ * @code { ctools_include('dependent'); } * * On any form item, add - * - @code '#process' => array('ctools_dependent_process'), @endcode * - @code '#dependency' => array('id-of-form-without-the-#' => array(list, of, values, that, make, this, gadget, visible)), @endcode * * A fuller example, that hides the menu title when no menu is selected: @@ -72,7 +68,6 @@ * '#type' => 'textfield', * '#default_value' => '', * '#description' => t('If set to normal or tab, enter the text to use for the menu item.'), - * '#process' => array('ctools_dependent_process'), * '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')), * ); * @@ -106,7 +101,6 @@ * '#type' => 'checkboxes', * '#prefix' => '<div id="edit-elements-wrapper"><div id="edit-elements">', * '#suffix' => '</div></div>', - * '#process' => array('ctools_dependent_process', 'expand_checkboxes'), * '#dependency' => array('radio:menu[type]' => array('node')), * '#options' => array( * 'body' => t('Body'), @@ -119,37 +113,69 @@ * return system_settings_form($form); *} * @endcode + * + * Deprecated: + * + * You no longer use ctools_dependent_process(), and it should be removed + * completely. + * + * If you have a form element which isn't listed in ctools_dependent_element_info_alter + * you have to add [#pre_render'][] => 'ctools_dependent_pre_render' to your form. */ /** * Process callback to add dependency to form items. + * */ function ctools_dependent_process($element, &$form_state, &$form) { - if (isset($element['#dependency'])) { - // Don't actually add any javascript until render time. - $element['#pre_render'][] = 'ctools_dependent_pre_render'; - } - return $element; } function ctools_dependent_pre_render($element) { - if (!isset($element['#dependency_count'])) { - $element['#dependency_count'] = 1; - } - if (!isset($element['#dependency_type'])) { - $element['#dependency_type'] = 'hide'; - } + // Preprocess only items with #dependency set. + if (isset($element['#dependency'])) { + if (!isset($element['#dependency_count'])) { + $element['#dependency_count'] = 1; + } + if (!isset($element['#dependency_type'])) { + $element['#dependency_type'] = 'hide'; + } - $js = array( - 'values' => $element['#dependency'], - 'num' => $element['#dependency_count'], - 'type' => $element['#dependency_type'], - ); + $js = array( + 'values' => $element['#dependency'], + 'num' => $element['#dependency_count'], + 'type' => $element['#dependency_type'], + ); - ctools_add_js('dependent'); - $options['CTools']['dependent'][$element['#id']] = $js; - drupal_add_js($options, 'setting'); + // Add a additional wrapper id around fieldsets, textareas to support depedency on it. + if (in_array($element['#type'], array('textarea', 'fieldset', 'text_format'))) { + $element['#theme_wrappers'][] = 'container'; + $element['#attributes']['id'] = $element['#id'] . '-wrapper'; + } + + // Text formats need to unset the dependency on the textarea + // or it gets applied twice. + if ($element['#type'] == 'text_format') { + unset($element['value']['#dependency']); + } + + $element['#attached']['js'][] = ctools_attach_js('dependent'); + $options['CTools']['dependent'][$element['#id']] = $js; + $element['#attached']['js'][] = array('type' => 'setting', 'data' => $options); + + } return $element; } + +/** + * CTools alters the element_info to be able to add #process functions to + * every major form element to make it much more handy to use #dependency, + * because you don't have to add #process. + */ +function ctools_dependent_element_info_alter(&$type) { + $form_elements = array('checkbox', 'checkboxes', 'fieldset', 'item', 'markup', 'radio', 'radios', 'select', 'textarea', 'textfield', 'text_format'); + foreach ($form_elements as $element) { + $type[$element]['#pre_render'][] = 'ctools_dependent_pre_render'; + } +} diff --git a/sites/all/modules/ctools/includes/dropbutton.theme.inc b/sites/all/modules/ctools/includes/dropbutton.theme.inc new file mode 100644 index 00000000..0848666e --- /dev/null +++ b/sites/all/modules/ctools/includes/dropbutton.theme.inc @@ -0,0 +1,142 @@ +<?php +// $Id$ + +/** + * @file + * Provide a javascript based dropbutton menu. + * + * The dropbutton menu will show up as a button with a clickable twisty pointer + * to the right. When clicked the button will expand, showing the list of links. + * + * The dropbutton will stay open until either the user has moved the mouse + * away from the box for > .5 seconds, or can be immediately closed by + * clicking the twisty again. The code is smart enough that if the mouse + * moves away and then back within the .5 second window, it will not + * re-close. + * + * Multiple dropbuttons can be placed per page. + * + * If only one link is passed to the theme function, the function will render + * a ctools-button with no twisty. The twisty is only rendered when 2 or more + * links are provided. The wrapping element will be classed with both + * ctools-button and ctools-dropbutton when a dropbutton is rendered. + * + * If the user does not have javascript enabled, the link will not appear, + * and instead by default the list of links will appear as a normal inline + * list. + * + * The menu is minimally styled by default, and to make it look different + * will require your own CSS. You can apply your own class to the + * dropbutton to help style it. + * + * The twisty is rendered as a border on a widthless and heightless element. + * There is no image for the twisty. + * The color of the twisty is the color of the link by default. To adjust the + * size of the twisty, adjust the border widths on .ctools-twisty. The adjust + * the color of the twisty, assign a new color to the .ctools-button class or + * assign a color to .ctools-twisty. You shouldn't need to adjust border-color. + * + * Use the theme() function to render dropbutton e.g. + * theme('links__ctools_dropbutton', array()) where array contains a renderable + * array of links. + */ + +/** + * Delegated implementation of hook_theme() + */ +function ctools_dropbutton_theme(&$items) { + $items['links__ctools_dropbutton'] = array( + 'variables' => array('title' => NULL, 'links' => NULL, 'image' => FALSE, 'class' => NULL), + 'file' => 'includes/dropbutton.theme.inc', + ); +} + +/** + * Create a dropbutton menu. + * + * @param $title + * The text to place in the clickable area to activate the dropbutton. This + * text is indented to -9999px by default. + * @param $links + * A list of links to provide within the dropbutton, suitable for use + * in via Drupal's theme('links'). + * @param $image + * If true, the dropbutton link is an image and will not get extra decorations + * that a text dropbutton link will. + * @param $class + * An optional class to add to the dropbutton's container div to allow you + * to style a single dropbutton however you like without interfering with + * other dropbuttons. + */ +function theme_links__ctools_dropbutton($vars) { + // Check to see if the number of links is greater than 1; + // otherwise just treat this like a button. + if (!empty($vars['links'])) { + $is_drop_button = (count($vars['links']) > 1); + + // Add needed files + if ($is_drop_button) { + ctools_add_js('dropbutton'); + ctools_add_css('dropbutton'); + } + ctools_add_css('button'); + + // Provide a unique identifier for every button on the page. + static $id = 0; + $id++; + + // Wrapping div + $class = 'ctools-no-js'; + $class .= ($is_drop_button) ? ' ctools-dropbutton' : ''; + $class .= ' ctools-button'; + if (!empty($vars['class'])) { + $class .= ($vars['class']) ? (' ' . implode(' ', $vars['class'])) : ''; + } + + $output = ''; + + $output .= '<div class="' . $class . '" id="ctools-button-' . $id . '">'; + + // Add a twisty if this is a dropbutton + if ($is_drop_button) { + $vars['title'] = ($vars['title'] ? check_plain($vars['title']) : t('open')); + + $output .= '<div class="ctools-link">'; + if ($vars['image']) { + $output .= '<a href="#" class="ctools-twisty ctools-image">' . $vars['title'] . '</a>'; + } + else { + $output .= '<a href="#" class="ctools-twisty ctools-text">' . $vars['title'] . '</a>'; + } + $output .= '</div>'; // ctools-link + } + + // The button content + $output .= '<div class="ctools-content">'; + + // Check for attributes. theme_links expects an array(). + $vars['attributes'] = (!empty($vars['attributes'])) ? $vars['attributes'] : array(); + + // Remove the inline and links classes from links if they exist. + // These classes are added and styled by Drupal core and mess up the default + // styling of any link list. + if (!empty($vars['attributes']['class'])) { + $classes = $vars['attributes']['class']; + foreach ($classes as $key => $class) { + if ($class === 'inline' || $class === 'links') { + unset($vars['attributes']['class'][$key]); + } + } + } + + // Call theme_links to render the list of links. + $output .= theme_links(array('links' => $vars['links'], 'attributes' => $vars['attributes'], 'heading' => '')); + $output .= '</div>'; // ctools-content + $output .= '</div>'; // ctools-dropbutton + return $output; + } + else { + return ''; + } +} + diff --git a/sites/all/modules/ctools/includes/dropdown.theme.inc b/sites/all/modules/ctools/includes/dropdown.theme.inc index 3e030d3d..2e21559d 100644 --- a/sites/all/modules/ctools/includes/dropdown.theme.inc +++ b/sites/all/modules/ctools/includes/dropdown.theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: dropdown.theme.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/export-ui.inc b/sites/all/modules/ctools/includes/export-ui.inc index 0a13ba56..2868ae8f 100644 --- a/sites/all/modules/ctools/includes/export-ui.inc +++ b/sites/all/modules/ctools/includes/export-ui.inc @@ -1,5 +1,4 @@ <?php -// $Id: export-ui.inc,v 1.3 2010/12/31 23:50:25 merlinofchaos Exp $ /** * @file @@ -165,7 +164,7 @@ function ctools_export_ui_process(&$plugin, $info) { 'load arguments' => array($plugin['name']), 'access callback' => 'ctools_export_ui_task_access', 'access arguments' => array($plugin['name'], 'edit', $prefix_count + 2), - 'type' => MENU_DEFAULT_LOCAL_TASK, + 'type' => MENU_CALLBACK, ), ); @@ -351,6 +350,7 @@ function ctools_export_ui_process(&$plugin, $info) { $plugin['strings']['message'] += array( 'enable' => t('@plugin %title was enabled.', array('@plugin' => $plugin['title singular proper'])), 'disable' => t('@plugin %title was disabled.', array('@plugin' => $plugin['title singular proper'])), + 'no items' => t('There are no @titles to display.', array('@titles' => $plugin['title plural'])), ); } diff --git a/sites/all/modules/ctools/includes/export-ui.menu.inc b/sites/all/modules/ctools/includes/export-ui.menu.inc index bc8130e2..d27bf157 100644 --- a/sites/all/modules/ctools/includes/export-ui.menu.inc +++ b/sites/all/modules/ctools/includes/export-ui.menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: export-ui.menu.inc,v 1.4 2011/01/01 01:14:24 merlinofchaos Exp $ /** * Delegated implementation of hook_menu(). diff --git a/sites/all/modules/ctools/includes/export-ui.plugin-type.inc b/sites/all/modules/ctools/includes/export-ui.plugin-type.inc index 06e84a6f..f1a75109 100644 --- a/sites/all/modules/ctools/includes/export-ui.plugin-type.inc +++ b/sites/all/modules/ctools/includes/export-ui.plugin-type.inc @@ -1,5 +1,4 @@ <?php -// $Id: export-ui.plugin-type.inc,v 1.1 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/export.inc b/sites/all/modules/ctools/includes/export.inc index 16bf6354..eebf7f57 100644 --- a/sites/all/modules/ctools/includes/export.inc +++ b/sites/all/modules/ctools/includes/export.inc @@ -1,5 +1,4 @@ <?php -// $Id: export.inc,v 1.31 2010/12/31 23:50:25 merlinofchaos Exp $ /** * @file @@ -263,12 +262,71 @@ function ctools_export_crud_import($table, $code) { // Set these defaults just the same way that ctools_export_new_object sets // them. $item->export_type = NULL; - $item->type = t('Local'); + $item->{$export['export type string']} = t('Local'); return $item; } } +/** + * Change the status of a certain object. + * + * @param $table + * The name of the table to use to enable a certain object. This table + * must have an 'export' section containing data or this function + * will fail. + * @param $object + * The fully populated object to enable, or the machine readable name. + * @param $status + * The status, in this case, is whether or not it is 'disabled'. + */ +function ctools_export_crud_set_status($table, $object, $status) { + $schema = ctools_export_get_schema($table); + $export = $schema['export']; + + if (!empty($export['status callback']) && function_exists($export['status callback'])) { + $export['status callback']($object, $status); + } + else { + if (is_object($object)) { + ctools_export_set_object_status($object, $status); + } + else { + ctools_export_set_status($table, $object, $status); + } + } + +} + + +/** + * Enable a certain object. + * + * @param $table + * The name of the table to use to enable a certain object. This table + * must have an 'export' section containing data or this function + * will fail. + * @param $object + * The fully populated object to enable, or the machine readable name. + */ +function ctools_export_crud_enable($table, $object) { + return ctools_export_crud_set_status($table, $object, FALSE); +} + +/** + * Disable a certain object. + * + * @param $table + * The name of the table to use to disable a certain object. This table + * must have an 'export' section containing data or this function + * will fail. + * @param $object + * The fully populated object to disable, or the machine readable name. + */ +function ctools_export_crud_disable($table, $object) { + return ctools_export_crud_set_status($table, $object, TRUE); +} + /** * @} */ @@ -339,7 +397,7 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) { if (!empty($schema['join'])) { foreach ($schema['join'] as $join_key => $join) { if ($join_schema = drupal_get_schema($join['table'])) { - $query->join($join['table'], 't__' . $alias_count, 't__0' . $join['left_key'] . ' = ' . 't__' . $alias_count . '.' . $join['right_key']); + $query->join($join['table'], 't__' . $alias_count, 't__0.' . $join['left_key'] . ' = ' . 't__' . $alias_count . '.' . $join['right_key']); $query->fields('t__' . $alias_count); $alias_count++; @@ -371,9 +429,14 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) { $status = variable_get($export['status'], array()); // Unpack the results of the query onto objects and cache them. foreach ($result as $data) { - $object = _ctools_export_unpack_object($schema, $data, $export['object']); + if (isset($schema['export']['object factory']) && function_exists($schema['export']['object factory'])) { + $object = $schema['export']['object factory']($schema, $data); + } + else { + $object = _ctools_export_unpack_object($schema, $data, $export['object']); + } $object->table = $table; - $object->type = t('Normal'); + $object->{$export['export type string']} = t('Normal'); $object->export_type = EXPORT_IN_DATABASE; // Determine if default object is enabled or disabled. if (isset($status[$object->{$export['key']}])) { @@ -386,10 +449,19 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) { } } - // @todo Load subrecords. + // Load subrecords. + if (isset($export['subrecords callback']) && function_exists($export['subrecords callback'])) { + $export['subrecords callback']($cache[$table]); + } - if ($defaults = _ctools_export_get_defaults($table, $export)) { + if ($type == 'names' && !empty($args) && !empty($export['cache defaults'])) { + $defaults = _ctools_export_get_some_defaults($table, $export, $args); + } + else { + $defaults = _ctools_export_get_defaults($table, $export); + } + if ($defaults) { foreach ($defaults as $object) { if ($type == 'conditions') { // if this does not match all of our conditions, skip it. @@ -411,14 +483,14 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) { } if (!empty($cache[$table][$object->{$export['key']}])) { - $cache[$table][$object->{$export['key']}]->type = t('Overridden'); + $cache[$table][$object->{$export['key']}]->{$export['export type string']} = t('Overridden'); $cache[$table][$object->{$export['key']}]->export_type |= EXPORT_IN_CODE; if ($type == 'conditions') { $return[$object->{$export['key']}] = $cache[$table][$object->{$export['key']}]; } } else { - $object->type = t('Default'); + $object->{$export['export type string']} = t('Default'); $object->export_type = EXPORT_IN_CODE; $object->in_code_only = TRUE; $object->table = $table; @@ -493,8 +565,14 @@ function ctools_get_default_object($table, $name) { return; } - // @todo add a method to load .inc files for this. - $defaults = _ctools_export_get_defaults($table, $export); + // Try to load individually from cache if this cache is enabled. + if (!empty($export['cache defaults'])) { + $defaults = _ctools_export_get_some_defaults($table, $export, array($name)); + } + else { + $defaults = _ctools_export_get_defaults($table, $export); + } + $status = variable_get($export['status'], array()); if (!isset($defaults[$name])) { @@ -508,7 +586,7 @@ function ctools_get_default_object($table, $name) { $object->disabled = $status[$object->{$export['key']}]; } - $object->type = t('Default'); + $object->{$export['export type string']} = t('Default'); $object->export_type = EXPORT_IN_CODE; $object->in_code_only = TRUE; @@ -523,7 +601,22 @@ function ctools_get_default_object($table, $name) { function _ctools_export_get_defaults($table, $export) { $cache = &drupal_static(__FUNCTION__, array()); + // If defaults may be cached, first see if we can load from cache. + if (!isset($cache[$table]) && !empty($export['cache defaults'])) { + $cache[$table] = _ctools_export_get_defaults_from_cache($table, $export); + } + if (!isset($cache[$table])) { + // If we're caching, attempt to get a lock. We will wait a short time + // on the lock, but not too long, because it's better to just rebuild + // and throw away results than wait too long on a lock. + if (!empty($export['cache defaults'])) { + for ($counter = 0; !($lock = lock_acquire('ctools_export:' . $table)) && $counter > 5; $counter++) { + lock_wait('ctools_export:' . $table, 1); + ++$counter; + } + } + $cache[$table] = array(); if ($export['default hook']) { @@ -550,8 +643,8 @@ function _ctools_export_get_defaults($table, $export) { else { // If version checking is enabled, ensure that the object can be used. if (isset($object->api_version) && - $object->api_version >= $export['api']['minimum_version'] && - $object->api_version <= $export['api']['current_version']) { + version_compare($object->api_version, $export['api']['minimum_version']) >= 0 && + version_compare($object->api_version, $export['api']['current_version']) <= 0) { $cache[$table][$name] = $object; } } @@ -560,12 +653,102 @@ function _ctools_export_get_defaults($table, $export) { } drupal_alter($export['default hook'], $cache[$table]); + + // If we acquired a lock earlier, cache the results and release the + // lock. + if (!empty($lock)) { + // Cache the index. + $index = array_keys($cache[$table]); + cache_set('ctools_export_index:' . $table, $index, $export['default cache bin']); + + // Cache each object. + foreach ($cache[$table] as $name => $object) { + cache_set('ctools_export:' . $table . ':' . $name, $object, $export['default cache bin']); + } + lock_release('ctools_export:' . $table); + } } } return $cache[$table]; } +/** + * Attempt to load default objects from cache. + * + * We can be instructed to cache default objects by the schema. If so + * we cache them as an index which is a list of all default objects, and + * then each default object is cached individually. + * + * @return Either an array of cached objects, or NULL indicating a cache + * rebuild is necessary. + */ +function _ctools_export_get_defaults_from_cache($table, $export) { + $data = cache_get('ctools_export_index:' . $table, $export['default cache bin']); + if (!$data || !is_array($data->data)) { + return; + } + + // This is the perfectly valid case where there are no default objects, + // and we have cached this state. + if (empty($data->data)) { + return array(); + } + + $keys = array(); + foreach ($data->data as $name) { + $keys[] = 'ctools_export:' . $table . ':' . $name; + } + + $data = cache_get_multiple($keys, $export['default cache bin']); + + // If any of our indexed keys missed, then we have a fail and we need to + // rebuild. + if (!empty($keys)) { + return; + } + + // Now, translate the returned cache objects to actual objects. + $cache = array(); + foreach ($data as $cached_object) { + $cache[$cached_object->data->{$export['key']}] = $cached_object->data; + } + + return $cache; +} + +/** + * Get a limited number of default objects. + * + * This attempts to load the objects directly from cache. If it cannot, + * the cache is rebuilt. This does not disturb the general get defaults + * from cache object. + * + * This function should ONLY be called if default caching is enabled. + * It does not check, it is assumed the caller has already done so. + */ +function _ctools_export_get_some_defaults($table, $export, $names) { + foreach ($names as $name) { + $keys[] = 'ctools_export:' . $table . ':' . $name; + } + + $data = cache_get_multiple($keys, $export['default cache bin']); + + // Cache hits remove the $key from $keys by reference. Cache + // misses do not. A cache miss indicates we may have to rebuild. + if (!empty($keys)) { + return _ctools_export_get_defaults($table, $export); + } + + // Now, translate the returned cache objects to actual objects. + $cache = array(); + foreach ($data as $cached_object) { + $cache[$cached_object->data->{$export['key']}] = $cached_object->data; + } + + return $cache; +} + /** * Unpack data loaded from the database onto an object. * @@ -646,7 +829,7 @@ function ctools_var_export($var, $prefix = '') { // magic method __set_state() leaving the export broken. This // workaround avoids this by casting the object as an array for // export and casting it back to an object when evaluated. - $output .= '(object) ' . ctools_var_export((array) $var); + $output .= '(object) ' . ctools_var_export((array) $var, $prefix); } else if (is_bool($var)) { $output = $var ? 'TRUE' : 'FALSE'; @@ -708,7 +891,7 @@ function ctools_export_object($table, $object, $indent = '', $identifier = NULL, // Note: This is the *field* export callback, not the table one! if (!empty($info['export callback']) && function_exists($info['export callback'])) { - $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $value, $indent) . ";\n"; + $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $object->$field, $indent) . ";\n"; } else { $value = $object->$field; @@ -742,7 +925,7 @@ function ctools_export_get_schema($table) { // If our schema isn't loaded, it's possible we're in a state where it // simply hasn't been cached. If we've been asked, let's force the // issue. - if (!$schema) { + if (!$schema || empty($schema['export'])) { // force a schema reset: $schema = drupal_get_schema($table, TRUE); } @@ -768,6 +951,9 @@ function ctools_export_get_schema($table) { 'bulk export' => TRUE, 'list callback' => "$schema[module]_{$table}_list", 'to hook code callback' => "$schema[module]_{$table}_to_hook_code", + 'cache defaults' => FALSE, + 'default cache bin' => 'cache', + 'export type string' => 'type', ); // If the export definition doesn't have the "primary key" then the CRUD @@ -856,7 +1042,7 @@ function ctools_export_set_object_status($object, $new_status = TRUE) { $table = $object->table; $schema = ctools_export_get_schema($table); $export = $schema['export']; - $status = variable_get($schema['export']['status'], array()); + $status = variable_get($export['status'], array()); // Compare if (!$new_status && $object->export_type & EXPORT_IN_DATABASE) { @@ -866,7 +1052,7 @@ function ctools_export_set_object_status($object, $new_status = TRUE) { $status[$object->{$export['key']}] = $new_status; } - variable_set($schema['export']['status'], $status); + variable_set($export['status'], $status); } /** @@ -919,7 +1105,7 @@ function ctools_export_new_object($table, $set_defaults = TRUE) { // We don't set the export_type property here, as this object is not saved // yet. We do give it NULL so we don't generate notices trying to read it. $object->export_type = NULL; - $object->type = t('Local'); + $object->{$export['export type string']} = t('Local'); } return $object; } @@ -995,16 +1181,22 @@ function ctools_export_default_list($table, $schema) { $items = ctools_export_crud_load_all($table); $export_key = $schema['export']['key']; - foreach ($items as $item) { // Try a couple of possible obvious title keys: - if (!empty($item->admin_title)) { - $string = "$item->admin_title (" . $item->$export_key . ")"; + $keys = array('admin_title', 'title'); + if (isset($schema['export']['admin_title'])) { + array_unshift($keys, $schema['export']['admin_title']); } - elseif (!empty($item->title)) { - $string = "$item->title (" . $item->$export_key . ")"; + + $string = ''; + foreach ($keys as $key) { + if (!empty($item->$key)) { + $string = $item->$key . " (" . $item->$export_key . ")"; + break; + } } - else { + + if (empty($string)) { $string = $item->$export_key; } $list[$item->$export_key] = check_plain($string); diff --git a/sites/all/modules/ctools/includes/fields.inc b/sites/all/modules/ctools/includes/fields.inc index 6a9e632d..1617d3ac 100644 --- a/sites/all/modules/ctools/includes/fields.inc +++ b/sites/all/modules/ctools/includes/fields.inc @@ -1,5 +1,4 @@ <?php -// $Id: fields.inc,v 1.1 2010/11/01 19:07:10 merlinofchaos Exp $ /** * @file @@ -84,20 +83,49 @@ function ctools_fields_get_field_formatter_settings_form($field, $formatter_type } /** - * Helper function for generating all the formatter information associated with any fields. Especially useful for determining the fields that will be added to form that executes hook_ield_formatter_settings_form(). + * Helper function for generating all the formatter information associated with + * any fields. + * Especially useful for determining the fields that will be added to form that + * executes hook_field_formatter_settings_form(). * * @param $fields * An array of fully loaded fields. */ - function ctools_fields_get_field_formatter_info($fields) { $info = array(); + $field_info = module_invoke_all('field_formatter_info'); foreach ($fields as $field) { - $field_info = module_invoke($field['module'], 'field_formatter_info'); - if ($field_info) { - $info += $field_info; + foreach ($field_info as $format_name => $formatter_info) { + if (in_array($field['type'], $formatter_info['field types'])) { + $info += array($format_name => $formatter_info); + } } } drupal_alter('field_formatter_info', $info); return $info; } + +/** + * Returns the label of a certain field. + * + * Cribbed from Views. + */ +function ctools_field_label($field_name) { + $label_counter = array(); + // Count the amount of instances per label per field. + $instances = field_info_instances(); + foreach ($instances as $entity_type) { + foreach ($entity_type as $bundle) { + if (isset($bundle[$field_name])) { + $label_counter[$bundle[$field_name]['label']] = isset($label_counter[$bundle[$field_name]['label']]) ? ++$label_counter[$bundle[$field_name]['label']] : 1; + } + } + } + if (empty($label_counter)) { + return $field_name; + } + // Sort the field lables by it most used label and return the most used one. + arsort($label_counter); + $label_counter = array_keys($label_counter); + return $label_counter[0]; +} diff --git a/sites/all/modules/ctools/includes/jump-menu.inc b/sites/all/modules/ctools/includes/jump-menu.inc index 9acd8b71..f5867276 100644 --- a/sites/all/modules/ctools/includes/jump-menu.inc +++ b/sites/all/modules/ctools/includes/jump-menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: jump-menu.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -44,7 +43,7 @@ * set to this. * - 'inline': If set to TRUE (default) the display will be forced inline. */ -function ctools_jump_menu($form_state, $select, $options = array()) { +function ctools_jump_menu($form, &$form_state, $select, $options = array()) { $options += array( 'button' => t('Go'), 'choose' => t('- Choose -'), @@ -117,5 +116,18 @@ function ctools_jump_menu($form_state, $select, $options = array()) { * This is normally only invoked upon submit without javascript enabled. */ function ctools_jump_menu_submit($form, &$form_state) { - $form_state['redirect'] = $form_state['values']['jump']; + $redirect = $form_state['values']['jump']; + + // If the path we are redirecting to starts with the base path (for example, + // "/somepath/node/1"), we need to strip the base path off before passing it + // to $form_state['redirect']. + $base_path = base_path(); + if (strpos($redirect, $base_path) === 0) { + $redirect = substr($redirect, strlen($base_path)); + } + + // Parse the URL so that query strings and fragments are preserved in the + // redirect. + $redirect = drupal_parse_url($redirect); + $form_state['redirect'] = array($redirect['path'], $redirect); } diff --git a/sites/all/modules/ctools/includes/menu.inc b/sites/all/modules/ctools/includes/menu.inc index 8a81a519..e725ea40 100644 --- a/sites/all/modules/ctools/includes/menu.inc +++ b/sites/all/modules/ctools/includes/menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: menu.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -28,7 +27,7 @@ * - 'weight': The weight to use in ordering the tabs. * - 'type': Optional. If set to MENU_DEFAULT_LOCAL_TASK this can be used to * add a fake 'default' local task, which is useful if you have to add - * tabs to a page that has noen. + * tabs to a page that has none. */ function ctools_menu_add_tab($link = NULL) { $links = &drupal_static(__FUNCTION__, array()); diff --git a/sites/all/modules/ctools/includes/modal.inc b/sites/all/modules/ctools/includes/modal.inc index a680f15e..759391ee 100644 --- a/sites/all/modules/ctools/includes/modal.inc +++ b/sites/all/modules/ctools/includes/modal.inc @@ -1,5 +1,4 @@ <?php -// $Id: modal.inc,v 1.13 2010/12/31 23:58:52 merlinofchaos Exp $ /** * @file @@ -246,5 +245,5 @@ function ctools_modal_form_render($form_state, $output) { function ctools_modal_render($title, $output) { $commands = array(); $commands[] = ctools_modal_command_display($title, $output); - ajax_render($commands); + print ajax_render($commands); } diff --git a/sites/all/modules/ctools/includes/object-cache.cron.inc b/sites/all/modules/ctools/includes/object-cache.cron.inc index d306b60d..99f2276c 100644 --- a/sites/all/modules/ctools/includes/object-cache.cron.inc +++ b/sites/all/modules/ctools/includes/object-cache.cron.inc @@ -1,5 +1,4 @@ <?php -// $Id: object-cache.cron.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/object-cache.inc b/sites/all/modules/ctools/includes/object-cache.inc index baefd943..5de4df71 100644 --- a/sites/all/modules/ctools/includes/object-cache.inc +++ b/sites/all/modules/ctools/includes/object-cache.inc @@ -1,5 +1,4 @@ <?php -// $Id: object-cache.inc,v 1.15 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/page-wizard.inc b/sites/all/modules/ctools/includes/page-wizard.inc index ec5a87b8..a211361b 100644 --- a/sites/all/modules/ctools/includes/page-wizard.inc +++ b/sites/all/modules/ctools/includes/page-wizard.inc @@ -1,5 +1,4 @@ <?php -// $Id: page-wizard.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * Fetch metadata on a specific page_wizard plugin. diff --git a/sites/all/modules/ctools/includes/page-wizard.menu.inc b/sites/all/modules/ctools/includes/page-wizard.menu.inc index 0b8b2f63..7ed932ed 100644 --- a/sites/all/modules/ctools/includes/page-wizard.menu.inc +++ b/sites/all/modules/ctools/includes/page-wizard.menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: page-wizard.menu.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/plugins-admin.inc b/sites/all/modules/ctools/includes/plugins-admin.inc index 7b2c69c9..d4ead0a4 100644 --- a/sites/all/modules/ctools/includes/plugins-admin.inc +++ b/sites/all/modules/ctools/includes/plugins-admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugins-admin.inc,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $ /** * @file @@ -72,18 +71,21 @@ function _ctools_plugin_configure_create_form_info(&$form_info, $plugin_definiti 'show back' => TRUE, ); + $add_form = isset($form_info['add form name']) ? $form_info['add form name'] : 'add form'; + $edit_form = isset($form_info['edit form name']) ? $form_info['edit form name'] : 'edit form'; + // Figure out what the forms should actually be. Since they can be specified // in a couple of different ways (in order to support simple declarations for // the minimal forms but more complex declarations for powerful wizards). if ($op == 'add') { - if (!empty($plugin_definition['add form'])) { - $info = $plugin_definition['add form']; + if (!empty($plugin_definition[$add_form])) { + $info = $plugin_definition[$add_form]; } } if (!isset($info) || $op == 'edit') { // Use the edit form for the add form if add form was completely left off. - if (!empty($plugin_definition['edit form'])) { - $info = $plugin_definition['edit form']; + if (!empty($plugin_definition[$edit_form])) { + $info = $plugin_definition[$edit_form]; } } @@ -104,12 +106,17 @@ function _ctools_plugin_configure_create_form_info(&$form_info, $plugin_definiti else { $title = t('Configure !plugin_title', array('!plugin_title' => $plugin_definition['title'])); } - $form_info['order'] = array('form' => $title); - $form_info['forms'] = array( - 'form' => array( - 'title' => $title, - 'form id' => $info, - ), + if (empty($form_info['order'])) { + $form_info['order'] = array(); + } + $form_info['order']['form'] = $title; + + if (empty($form_info['forms'])) { + $form_info['forms'] = array(); + } + $form_info['forms']['form'] = array( + 'title' => $title, + 'form id' => $info, ); // Add the default form if one is specified. @@ -128,8 +135,12 @@ function _ctools_plugin_configure_create_form_info(&$form_info, $plugin_definiti } } else if (is_array($info)) { - $form_info['order'] = array(); - $form_info['forms'] = array(); + if (empty($form_info['order'])) { + $form_info['order'] = array(); + } + if (empty($form_info['forms'])) { + $form_info['forms'] = array(); + } $count = 0; $base = 'step'; $wrapper = NULL; diff --git a/sites/all/modules/ctools/includes/plugins.inc b/sites/all/modules/ctools/includes/plugins.inc index 5f6364ab..f395dbc1 100644 --- a/sites/all/modules/ctools/includes/plugins.inc +++ b/sites/all/modules/ctools/includes/plugins.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugins.inc,v 1.33 2011/01/05 19:58:21 merlinofchaos Exp $ /** * @file @@ -59,15 +58,27 @@ function ctools_plugin_api_info($owner, $api, $minimum_version, $current_version $cache = &drupal_static(__FUNCTION__, array()); if (!isset($cache[$owner][$api])) { $cache[$owner][$api] = array(); - foreach (module_implements('ctools_plugin_api') as $module) { - $function = $module . '_ctools_plugin_api'; + + $hook = ctools_plugin_api_get_hook($owner, $api); + + foreach (module_implements($hook) as $module) { + $function = $module . '_' . $hook; $info = $function($owner, $api); - if (!isset($info['version'])) { + // This is added to make hook_views_api() compatible with this, since + // views used a different version key. + if (isset($info['version'])) { + $version = $info['version']; + } + else if (isset($info['api'])) { + $version = $info['api']; + } + + if (!isset($version)) { continue; } // Only process if version is between minimum and current, inclusive. - if ($info['version'] >= $minimum_version && $info['version'] <= $current_version) { + if (version_compare($version, $minimum_version, '>=') && version_compare($version, $current_version, '<=')) { if (!isset($info['path'])) { $info['path'] = drupal_get_path('module', $module); } @@ -85,7 +96,7 @@ function ctools_plugin_api_info($owner, $api, $minimum_version, $current_version } // Only process if version is between minimum and current, inclusive. - if ($info['version'] >= $minimum_version && $info['version'] <= $current_version) { + if (version_compare($info['version'], $minimum_version, '>=') && version_compare($info['version'], $current_version, '<=')) { if (!isset($info['path'])) { $info['path'] = ''; } @@ -131,9 +142,21 @@ function ctools_plugin_api_include($owner, $api, $minimum_version, $current_vers $info = ctools_plugin_api_info($owner, $api, $minimum_version, $current_version); foreach ($info as $module => $plugin_info) { if (!isset($already_done[$owner][$api][$module])) { - $file = isset($plugin_info['file']) ? $plugin_info['file'] : "$module.$api.inc"; - if (file_exists("./$plugin_info[path]/$file")) { - require_once "./$plugin_info[path]/$file"; + if (isset($plugin_info["$api file"])) { + $file = isset($plugin_info["$api file"]); + } + else if (isset($plugin_info['file'])) { + $file = isset($plugin_info['file']); + } + else { + $file = "$module.$api.inc"; + } + + if (file_exists(DRUPAL_ROOT . "/$plugin_info[path]/$file")) { + require_once DRUPAL_ROOT . "/$plugin_info[path]/$file"; + } + else if (file_exists(DRUPAL_ROOT . "/$file")) { + require_once DRUPAL_ROOT . "/$plugin_info[path]/$file"; } $already_done[$owner][$api][$module] = TRUE; } @@ -142,6 +165,32 @@ function ctools_plugin_api_include($owner, $api, $minimum_version, $current_vers return $info; } +/** + * Find out what hook to use to determine if modules support an API. + * + * By default, most APIs will use hook_ctools_plugin_api, but some modules + * want sole ownership. This technique lets modules define what hook + * to use. + */ +function ctools_plugin_api_get_hook($owner, $api) { + // Allow modules to use their own hook for this. The only easy way to do + // this right now is with a magically named function. + if (function_exists($function = $owner . '_' . $api . '_hook_name')) { + $hook = $function(); + } + else if (function_exists($function = $owner . '_ctools_plugin_api_hook_name')) { + $hook = $function(); + } + + // Do this last so that if the $function above failed to return, we have a + // sane default. + if (empty($hook)) { + $hook = 'ctools_plugin_api'; + } + + return $hook; +} + /** * Fetch a group of plugins by name. * @@ -320,6 +369,7 @@ function ctools_plugin_get_plugin_type_info($flush = FALSE) { 'use hooks' => FALSE, 'defaults' => array(), 'process' => '', + 'alterable' => TRUE, 'extension' => 'inc', 'info file' => FALSE, 'hook' => $module . '_' . $plugin_type_name, @@ -338,6 +388,7 @@ function ctools_plugin_get_plugin_type_info($flush = FALSE) { * Reset all static caches that affect the result of ctools_get_plugins(). */ function ctools_get_plugins_reset() { + drupal_static_reset('ctools_plugin_setup'); drupal_static_reset('ctools_plugin_load_includes'); drupal_static_reset('ctools_plugin_api_info'); } @@ -354,7 +405,7 @@ function ctools_get_plugins_reset() { * An array of information created for this plugin. */ function ctools_plugin_load_includes($info, $filename = NULL) { - // Keep a static array so we don't hit drupal_system_listing more than necessary. + // Keep a static array so we don't hit file_scan_directory more than necessary. $all_files = &drupal_static(__FUNCTION__, array()); // store static of plugin arrays for reference because they can't be reincluded. @@ -385,7 +436,7 @@ function ctools_plugin_load_includes($info, $filename = NULL) { $extension = empty($info['info file']) ? $info['extension'] : 'info'; foreach ($directories as $module => $path) { - $all_files[$info['module']][$info['type']][$module] = drupal_system_listing('/\.' . $extension . '$/', $path, 'name', 0); + $all_files[$info['module']][$info['type']][$module] = file_scan_directory($path, '/\.' . $extension . '$/', array('key' => 'name')); } cache_set("ctools_plugin_files:$info[module]:$info[type]", $all_files[$info['module']][$info['type']]); @@ -510,7 +561,9 @@ function _ctools_list_themes() { } // Put the actual theme info objects into the array foreach (array_keys($themes) as $name) { - $themes[$name] = $all_themes[$name]; + if (isset($all_themes[$name])) { + $themes[$name] = $all_themes[$name]; + } } // Make sure the current default theme always gets the last word @@ -657,10 +710,20 @@ function _ctools_process_data($result, $plugin_type_info, $module, $path, $file) } } + // Allow the plugin to be altered before processing. + if (!empty($plugin_type_info['alterable']) && $plugin_type_info['alterable']) { + drupal_alter('ctools_plugin_pre', $result[$name], $plugin_type_info); + } + // Allow the plugin owner to do additional processing. if (!empty($plugin_type_info['process']) && $function = ctools_plugin_get_function($plugin_type_info, 'process')) { $function($result[$name], $plugin_type_info); } + + // Allow the plugin to be altered after processing. + if (!empty($plugin_type_info['alterable']) && $plugin_type_info['alterable']) { + drupal_alter('ctools_plugin_post', $result[$name], $plugin_type_info); + } } return $result; } diff --git a/sites/all/modules/ctools/includes/stylizer.inc b/sites/all/modules/ctools/includes/stylizer.inc index 5325eaab..85e99c0b 100644 --- a/sites/all/modules/ctools/includes/stylizer.inc +++ b/sites/all/modules/ctools/includes/stylizer.inc @@ -1,5 +1,4 @@ <?php -// $Id: stylizer.inc,v 1.3 2011/01/05 22:35:46 merlinofchaos Exp $ /** * @file * Create customized CSS and images from palettes created by user input. @@ -533,7 +532,7 @@ class ctools_stylizer_image_processor { } // The step size for each component - for($i = ($luminosity_input + 1); $i <= 255; $i++) { + for ($i = ($luminosity_input + 1); $i <= 255; $i++) { $palette[$i]['red'] = $red + round($step_size_red * ($i - $luminosity_input)); $palette[$i]['green'] = $green + round($step_size_green * ($i - $luminosity_input)); $palette[$i]['blue']= $blue + round($step_size_blue * ($i - $luminosity_input)); @@ -995,7 +994,7 @@ function ctools_stylizer_edit_style_form_default($form, &$form_state) { '#theme' => 'ctools_stylizer_color_scheme_form', ); - $form['top box']['color']['palette']['#tree'] = true; + $form['top box']['color']['palette']['#tree'] = TRUE; foreach ($plugin['palette'] as $key => $color) { if (empty($settings['palette'][$key])) { diff --git a/sites/all/modules/ctools/includes/stylizer.theme.inc b/sites/all/modules/ctools/includes/stylizer.theme.inc index 8e320106..85346c15 100644 --- a/sites/all/modules/ctools/includes/stylizer.theme.inc +++ b/sites/all/modules/ctools/includes/stylizer.theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: stylizer.theme.inc,v 1.3 2011/01/05 19:41:11 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/includes/utility.inc b/sites/all/modules/ctools/includes/utility.inc index 6e4f46c8..9795dd86 100644 --- a/sites/all/modules/ctools/includes/utility.inc +++ b/sites/all/modules/ctools/includes/utility.inc @@ -1,5 +1,4 @@ <?php -// $Id: utility.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -18,13 +17,13 @@ * To save time we pass the $items array in so we don't need to do array * addition. It modifies the array by reference and doesn't need to return it. */ -function _ctools_passthrough(&$items, $type = 'theme') { - $files = drupal_system_listing('/\.' . $type . '\.inc$/', drupal_get_path('module', 'ctools') . '/includes', 'name', 0); +function ctools_passthrough($module, $type, &$items) { + $files = file_scan_directory(drupal_get_path('module', $module) . '/includes', '/\.' . $type . '\.inc$/', array('key' => 'name')); foreach ($files as $file) { require_once DRUPAL_ROOT . '/' . $file->uri; list($tool) = explode('.', $file->name, 2); - $function = 'ctools_' . str_replace ('-', '_', $tool) . '_' . str_replace('-', '_', $type); + $function = $module . '_' . str_replace ('-', '_', $tool) . '_' . str_replace('-', '_', $type); if (function_exists($function)) { $function($items); } diff --git a/sites/all/modules/ctools/includes/views.inc b/sites/all/modules/ctools/includes/views.inc new file mode 100644 index 00000000..4ef6439e --- /dev/null +++ b/sites/all/modules/ctools/includes/views.inc @@ -0,0 +1,26 @@ +<?php + +/** + * Generate new context classes by argument settings on the view. + */ +function ctools_views_get_argument_context($argument) { + if ($argument['type'] == 'context') { + if (strpos($argument['context'], '.')) { + list($context, $converter) = explode('.', $argument['context'], 2); + } + else { + // Backwards-compat for before we had a system for delimiting the data + // we retrieve out of context objects. + $context = $argument['context']; + } + if ($context == 'term' || $context == 'vocabulary') { + $context = 'entity:taxonomy_' . $context; + } + elseif ($entity = entity_get_info($context)) { + $context = 'entity:' . $context; + } + $class = 'ctools_context_' . (empty($argument['context_optional']) ? 'required' : 'optional'); + $new_context = new $class($argument['label'], $context); + return $new_context; + } +} diff --git a/sites/all/modules/ctools/includes/wizard.inc b/sites/all/modules/ctools/includes/wizard.inc index d8b604d9..50cd79cf 100644 --- a/sites/all/modules/ctools/includes/wizard.inc +++ b/sites/all/modules/ctools/includes/wizard.inc @@ -1,5 +1,4 @@ <?php -// $Id: wizard.inc,v 1.20 2010/10/27 20:07:10 merlinofchaos Exp $ /** * @file @@ -49,7 +48,7 @@ function ctools_wizard_multistep_form($form_info, $step, &$form_state) { // allow order array to be optional if (empty($form_info['order'])) { - foreach($form_info['forms'] as $step_id => $params) { + foreach ($form_info['forms'] as $step_id => $params) { $form_info['order'][$step_id] = $params['title']; } } @@ -488,7 +487,7 @@ function ctools_wizard_defaults(&$form_info) { $form_info = $form_info + $defaults; // set form callbacks if they aren't defined - foreach($form_info['forms'] as $step => $params) { + foreach ($form_info['forms'] as $step => $params) { if (!$params['form id']) { $form_callback = $hook . '_' . $step . '_form'; $form_info['forms'][$step]['form id'] = $form_callback; @@ -504,7 +503,7 @@ function ctools_wizard_defaults(&$form_info) { 'finish callback' => '_finish', ); - foreach($callbacks as $key => $callback) { + foreach ($callbacks as $key => $callback) { // never overwrite if explicity defined if (empty($form_info[$key])) { $wizard_callback = $hook . $callback; diff --git a/sites/all/modules/ctools/includes/wizard.theme.inc b/sites/all/modules/ctools/includes/wizard.theme.inc index ab85e1e5..304906c0 100644 --- a/sites/all/modules/ctools/includes/wizard.theme.inc +++ b/sites/all/modules/ctools/includes/wizard.theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: wizard.theme.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/js/ajax-responder.js b/sites/all/modules/ctools/js/ajax-responder.js index ce400220..61ddcf69 100644 --- a/sites/all/modules/ctools/js/ajax-responder.js +++ b/sites/all/modules/ctools/js/ajax-responder.js @@ -1,4 +1,3 @@ -// $Id: ajax-responder.js,v 1.25 2010/10/11 22:18:22 sdboyer Exp $ /** * @file * @@ -6,6 +5,8 @@ */ (function ($) { + Drupal.CTools = Drupal.CTools || {}; + Drupal.CTools.AJAX = Drupal.CTools.AJAX || {}; /** * Grab the response from the server and store it. * @@ -95,29 +96,30 @@ return url; }; - - Drupal.CTools.AJAX.commands.attr = function(data) { - $(data.selector).attr(data.name, data.value); - }; + // Hide these in a ready to ensure that Drupal.ajax is set up first. + $(function() { + Drupal.ajax.prototype.commands.attr = function(ajax, data, status) { + $(data.selector).attr(data.name, data.value); + }; - Drupal.CTools.AJAX.commands.redirect = function(data) { - if (data.delay > 0) { - setTimeout(function () { + Drupal.ajax.prototype.commands.redirect = function(ajax, data, status) { + if (data.delay > 0) { + setTimeout(function () { + location.href = data.url; + }, data.delay); + } + else { location.href = data.url; - }, data.delay); - } - else { - location.href = data.url; - } - }; - - Drupal.CTools.AJAX.commands.reload = function(data) { - location.reload(); - }; + } + }; - Drupal.CTools.AJAX.commands.submit = function(data) { - $(data.selector).submit(); - } + Drupal.ajax.prototype.commands.reload = function(ajax, data, status) { + location.reload(); + }; + Drupal.ajax.prototype.commands.submit = function(ajax, data, status) { + $(data.selector).submit(); + } + }); })(jQuery); diff --git a/sites/all/modules/ctools/js/auto-submit.js b/sites/all/modules/ctools/js/auto-submit.js index 202b5341..4a80f79e 100644 --- a/sites/all/modules/ctools/js/auto-submit.js +++ b/sites/all/modules/ctools/js/auto-submit.js @@ -1,4 +1,3 @@ -// $Id: auto-submit.js,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ (function($){ /** * To make a form auto submit, all you have to do is 3 things: @@ -8,19 +7,19 @@ * On gadgets you want to auto-submit when changed, add the ctools-auto-submit * class. With FAPI, add: * @code - * '#attributes' => array('class' => 'ctools-auto-submit'), + * '#attributes' => array('class' => array('ctools-auto-submit')), * @endcode * * If you want to have auto-submit for every form element, * add the ctools-auto-submit-full-form to the form. With FAPI, add: * @code - * '#attributes' => array('class' => 'ctools-auto-submit-full-form'), + * '#attributes' => array('class' => array('ctools-auto-submit-full-form')), * @endcode * * Finally, you have to identify which button you want clicked for autosubmit. * The behavior of this button will be honored if it's ajaxy or not: * @code - * '#attributes' => array('class' => 'ctools-use-ajax ctools-auto-submit-click'), + * '#attributes' => array('class' => array('ctools-use-ajax', 'ctools-auto-submit-click')), * @endcode * * Currently only 'select' and 'textfield' types are supported. We probably diff --git a/sites/all/modules/ctools/js/collapsible-div.js b/sites/all/modules/ctools/js/collapsible-div.js index 4b177bf2..2a240ae8 100644 --- a/sites/all/modules/ctools/js/collapsible-div.js +++ b/sites/all/modules/ctools/js/collapsible-div.js @@ -1,4 +1,3 @@ -// $Id: collapsible-div.js,v 1.11 2010/10/11 22:18:22 sdboyer Exp $ /** * @file * Javascript required for a simple collapsible div. diff --git a/sites/all/modules/ctools/js/dependent.js b/sites/all/modules/ctools/js/dependent.js index 264f714e..9ed0a321 100644 --- a/sites/all/modules/ctools/js/dependent.js +++ b/sites/all/modules/ctools/js/dependent.js @@ -1,4 +1,3 @@ -// $Id: dependent.js,v 1.9 2011/01/01 00:19:17 merlinofchaos Exp $ /** * @file * @@ -31,12 +30,10 @@ Drupal.CTools.dependent.inArray = function(array, search_term) { var i = array.length; - if (i > 0) { - do { + while (i--) { if (array[i] == search_term) { return true; } - } while (i--); } return false; } @@ -168,6 +165,7 @@ if (Drupal.settings.CTools.dependent[id].num <= len) { // Show if the element if criteria is matched object.show(0); + object.addClass('dependent-options'); } else { // Otherwise hide. Use css rather than hide() because hide() diff --git a/sites/all/modules/ctools/js/dropbutton.js b/sites/all/modules/ctools/js/dropbutton.js new file mode 100644 index 00000000..4dd20b0b --- /dev/null +++ b/sites/all/modules/ctools/js/dropbutton.js @@ -0,0 +1,96 @@ +// $Id$ +/** + * @file + * Implement a simple, clickable dropbutton menu. + * + * See dropbutton.theme.inc for primary documentation. + * + * The javascript relies on four classes: + * - The dropbutton must be fully contained in a div with the class + * ctools-dropbutton. It must also contain the class ctools-no-js + * which will be immediately removed by the javascript; this allows for + * graceful degradation. + * - The trigger that opens the dropbutton must be an a tag wit hthe class + * ctools-dropbutton-link. The href should just be '#' as this will never + * be allowed to complete. + * - The part of the dropbutton that will appear when the link is clicked must + * be a div with class ctools-dropbutton-container. + * - Finally, ctools-dropbutton-hover will be placed on any link that is being + * hovered over, so that the browser can restyle the links. + * + * This tool isn't meant to replace click-tips or anything, it is specifically + * meant to work well presenting menus. + */ + +(function ($) { + Drupal.behaviors.CToolsDropbutton = { + attach: function() { + // Process buttons. All dropbuttons are buttons. + $('.ctools-button:not(.ctools-button-processed)') + .removeClass('ctools-no-js') + .addClass('ctools-button-processed'); + // Process dropbuttons. Not all buttons are dropbuttons. + $('.ctools-dropbutton:not(.ctools-dropbutton-processed)') + .addClass('ctools-dropbutton-processed') + .each(function() { + var $dropbutton = $(this); + var $button = $('.ctools-content', $dropbutton); + var $secondaryActions = $('li', $button).not(':first'); + var $twisty = $(".ctools-link", $dropbutton); + var open = false; + var hovering = false; + var timerID = 0; + + var toggle = function(close) { + // if it's open or we're told to close it, close it. + if (open || close) { + // If we're just toggling it, close it immediately. + if (!close) { + open = false; + $secondaryActions.slideUp(100); + $dropbutton.removeClass('open'); + } + else { + // If we were told to close it, wait half a second to make + // sure that's what the user wanted. + // Clear any previous timer we were using. + if (timerID) { + clearTimeout(timerID); + } + timerID = setTimeout(function() { + if (!hovering) { + open = false; + $secondaryActions.slideUp(100); + $dropbutton.removeClass('open'); + }}, 500); + } + } + else { + // open it. + open = true; + $secondaryActions.animate({height: "show", opacity: "show"}, 100); + $dropbutton.addClass('open'); + } + } + // Hide the secondary actions initially. + $secondaryActions.hide(); + + $twisty.click(function() { + toggle(); + return false; + }); + + $dropbutton.hover( + function() { + hovering = true; + }, // hover in + function() { // hover out + hovering = false; + toggle(true); + return false; + } + ); + }); + } + } +})(jQuery); diff --git a/sites/all/modules/ctools/js/dropdown.js b/sites/all/modules/ctools/js/dropdown.js index 5feea2d3..522f4d5d 100644 --- a/sites/all/modules/ctools/js/dropdown.js +++ b/sites/all/modules/ctools/js/dropdown.js @@ -1,4 +1,3 @@ -// $Id: dropdown.js,v 1.6 2010/10/11 22:18:22 sdboyer Exp $ /** * @file * Implement a simple, clickable dropdown menu. diff --git a/sites/all/modules/ctools/js/jump-menu.js b/sites/all/modules/ctools/js/jump-menu.js index 3310022b..f515c8c5 100644 --- a/sites/all/modules/ctools/js/jump-menu.js +++ b/sites/all/modules/ctools/js/jump-menu.js @@ -1,4 +1,3 @@ -// $Id: jump-menu.js,v 1.3 2010/10/11 22:18:22 sdboyer Exp $ (function($) { Drupal.behaviors.CToolsJumpMenu = { diff --git a/sites/all/modules/ctools/js/modal.js b/sites/all/modules/ctools/js/modal.js index 7ad5524b..4d6c6f81 100644 --- a/sites/all/modules/ctools/js/modal.js +++ b/sites/all/modules/ctools/js/modal.js @@ -1,4 +1,3 @@ -// $Id: modal.js,v 1.27 2010/12/31 22:27:02 merlinofchaos Exp $ /** * @file * @@ -245,10 +244,6 @@ $('#modal-content form:not(.ctools-use-modal-processed)', context) .addClass('ctools-use-modal-processed') .each(function() { - $('input[type=submit], button', this).click(function() { - this.form.clk = this; - }); - var element_settings = {}; element_settings.url = $(this).attr('action'); @@ -258,6 +253,12 @@ Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); Drupal.ajax[base].form = $(this); + + $('input[type=submit], button', this).click(function() { + Drupal.ajax[base].element = this; + this.form.clk = this; + }); + }); } }; @@ -384,6 +385,14 @@ event = window.event; target = event.srcElement; } + + var parents = $(target).parents().get(); + for (var i in $(target).parents().get()) { + var position = $(parents[i]).css('position'); + if (position == 'absolute' || position == 'fixed') { + return true; + } + } if( $(target).filter('*:visible').parents('#modalContent').size()) { // allow the event only if target is a visible child node of #modalContent return true; diff --git a/sites/all/modules/ctools/js/stylizer.js b/sites/all/modules/ctools/js/stylizer.js index 38727cff..dc1caaa5 100644 --- a/sites/all/modules/ctools/js/stylizer.js +++ b/sites/all/modules/ctools/js/stylizer.js @@ -1,4 +1,3 @@ -// $Id: stylizer.js,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ (function ($) { Drupal.CTools = Drupal.CTools || {}; diff --git a/sites/all/modules/ctools/page_manager/css/page-manager.css b/sites/all/modules/ctools/page_manager/css/page-manager.css index 2ba23b9f..40b2e5e3 100644 --- a/sites/all/modules/ctools/page_manager/css/page-manager.css +++ b/sites/all/modules/ctools/page_manager/css/page-manager.css @@ -1,4 +1,3 @@ -/* $Id: page-manager.css,v 1.13 2011/01/05 23:16:59 merlinofchaos Exp $ */ body form#page-manager-list-pages-form { margin: 0 0 20px 0; } @@ -54,6 +53,21 @@ body form#page-manager-list-pages-form { background: url(../images/locked-other.png) no-repeat scroll left center; /* LTR */ } +/* Force the background color to inherit so that the dropbuttons do not need + a specific background color. */ +#page-manager-list-pages td.page-manager-page-operations { + vertical-align: top; + background-color: inherit; +} + +#page-manager-list-pages td.page-manager-page-operations .ctools-dropbutton { + text-align: left; /* LTR */ + position: absolute; + right: 10px; +} + + + #page-manager-edit .page-manager-wrapper { margin: 0; padding: 0 0 0 149px; @@ -340,3 +354,20 @@ body form#page-manager-list-pages-form { line-height: 1.75em; } + +/** Override that obnoxious float on throbber. **/ +#page-manager-edit .progress-disabled { + float: none; +} + +#page-manager-edit .progress-disabled + .ajax-progress { + float: right; + position: relative; + top: -2em; +} + +#page-manager-list-pages-form .progress-disabled + .ajax-progress { + position: relative; + top: 2em; + left: -.5em; +} diff --git a/sites/all/modules/ctools/page_manager/help/about.html b/sites/all/modules/ctools/page_manager/help/about.html index 5e6729c5..fa58acaf 100644 --- a/sites/all/modules/ctools/page_manager/help/about.html +++ b/sites/all/modules/ctools/page_manager/help/about.html @@ -1,4 +1,3 @@ -<!-- $Id: about.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> The Page Manager module creates and manages pages in your Drupal site. Pages are defined as items that have a path and provide output to the user. It is a complete round trip from getting user input to providing user output. There are two types of pages that the Page Manager currently supports: diff --git a/sites/all/modules/ctools/page_manager/help/api-task-handler.html b/sites/all/modules/ctools/page_manager/help/api-task-handler.html index 64f59454..4544a2a8 100644 --- a/sites/all/modules/ctools/page_manager/help/api-task-handler.html +++ b/sites/all/modules/ctools/page_manager/help/api-task-handler.html @@ -1,4 +1,3 @@ -<!-- $Id: api-task-handler.html,v 1.1 2009/07/09 00:07:04 merlinofchaos Exp $ --> task handler definition: title -- visible title of the task handler. description -- description of the task handler. diff --git a/sites/all/modules/ctools/page_manager/help/api-task-type.html b/sites/all/modules/ctools/page_manager/help/api-task-type.html index f39ac11d..eb87265f 100644 --- a/sites/all/modules/ctools/page_manager/help/api-task-type.html +++ b/sites/all/modules/ctools/page_manager/help/api-task-type.html @@ -1,3 +1,2 @@ -<!-- $Id: api-task-type.html,v 1.1 2009/07/09 00:07:04 merlinofchaos Exp $ --> defines a task type, grouping tasks together and providing a common UI for them. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/api-task.html b/sites/all/modules/ctools/page_manager/help/api-task.html index 4eced0e2..cd6e3d0c 100644 --- a/sites/all/modules/ctools/page_manager/help/api-task.html +++ b/sites/all/modules/ctools/page_manager/help/api-task.html @@ -1,4 +1,3 @@ -<!-- $Id: api-task.html,v 1.1 2009/07/09 00:07:04 merlinofchaos Exp $ --> task definition: title -- visible title of the task. description -- description of the task. diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages-access.html b/sites/all/modules/ctools/page_manager/help/custom-pages-access.html index 25ba63a2..a2643c28 100644 --- a/sites/all/modules/ctools/page_manager/help/custom-pages-access.html +++ b/sites/all/modules/ctools/page_manager/help/custom-pages-access.html @@ -1,3 +1,2 @@ -<!-- $Id: custom-pages-access.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528072">http://drupal.org/node/528072</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html b/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html index b0bdff51..516a4292 100644 --- a/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html +++ b/sites/all/modules/ctools/page_manager/help/custom-pages-arguments.html @@ -1,3 +1,2 @@ -<!-- $Id: custom-pages-arguments.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528058">http://drupal.org/node/528058</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html b/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html index d3388bca..48cf9c39 100644 --- a/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html +++ b/sites/all/modules/ctools/page_manager/help/custom-pages-menu.html @@ -1,3 +1,2 @@ -<!-- $Id: custom-pages-menu.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528078">http://drupal.org/node/528078</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/custom-pages.html b/sites/all/modules/ctools/page_manager/help/custom-pages.html index 22ea381e..18e66d4b 100644 --- a/sites/all/modules/ctools/page_manager/help/custom-pages.html +++ b/sites/all/modules/ctools/page_manager/help/custom-pages.html @@ -1,3 +1,2 @@ -<!-- $Id: custom-pages.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528050">http://drupal.org/node/528050</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-create.html b/sites/all/modules/ctools/page_manager/help/getting-started-create.html index 3ba5ebc2..a3d295e3 100644 --- a/sites/all/modules/ctools/page_manager/help/getting-started-create.html +++ b/sites/all/modules/ctools/page_manager/help/getting-started-create.html @@ -1,3 +1,2 @@ -<!-- $Id: getting-started-create.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528038">http://drupal.org/node/528038</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html b/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html index a5d403b0..d62eb0f3 100644 --- a/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html +++ b/sites/all/modules/ctools/page_manager/help/getting-started-custom-nodes.html @@ -1,3 +1,2 @@ -<!-- $Id: getting-started-custom-nodes.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528044">http://drupal.org/node/528044</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html b/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html index a14c0ea6..7148cd96 100644 --- a/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html +++ b/sites/all/modules/ctools/page_manager/help/getting-started-custom-vocabulary.html @@ -1,3 +1,2 @@ -<!-- $Id: getting-started-custom-vocabulary.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528046">http://drupal.org/node/528046</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-members.html b/sites/all/modules/ctools/page_manager/help/getting-started-members.html index 73a4405f..87b21227 100644 --- a/sites/all/modules/ctools/page_manager/help/getting-started-members.html +++ b/sites/all/modules/ctools/page_manager/help/getting-started-members.html @@ -1,3 +1,2 @@ -<!-- $Id: getting-started-members.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528040">http://drupal.org/node/528040</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html b/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html index ad330a7f..d60bea4a 100644 --- a/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html +++ b/sites/all/modules/ctools/page_manager/help/getting-started-page-list.html @@ -1,3 +1,2 @@ -<!-- $Id: getting-started-page-list.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528036">http://drupal.org/node/528036</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/help/getting-started.html b/sites/all/modules/ctools/page_manager/help/getting-started.html index d342751d..4e4f24ae 100644 --- a/sites/all/modules/ctools/page_manager/help/getting-started.html +++ b/sites/all/modules/ctools/page_manager/help/getting-started.html @@ -1,4 +1,3 @@ -<!-- $Id: getting-started.html,v 1.2 2009/08/19 22:24:07 merlinofchaos Exp $ --> Note: this page is currently very preliminary. Please visit <a href="http://drupal.org/node/528034">http://drupal.org/node/528034</a> to help provide this documentation page! diff --git a/sites/all/modules/ctools/page_manager/help/page_manager.help.ini b/sites/all/modules/ctools/page_manager/help/page_manager.help.ini index cd946532..05cadb48 100644 --- a/sites/all/modules/ctools/page_manager/help/page_manager.help.ini +++ b/sites/all/modules/ctools/page_manager/help/page_manager.help.ini @@ -1,4 +1,3 @@ -; $Id: page_manager.help.ini,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ [advanced help settings] line break = TRUE diff --git a/sites/all/modules/ctools/page_manager/help/variants.html b/sites/all/modules/ctools/page_manager/help/variants.html index 389af330..48cf9c39 100644 --- a/sites/all/modules/ctools/page_manager/help/variants.html +++ b/sites/all/modules/ctools/page_manager/help/variants.html @@ -1,3 +1,2 @@ -<!-- $Id: variants.html,v 1.1 2009/07/22 23:42:47 merlinofchaos Exp $ --> Please visit <a href="http://drupal.org/node/528078">http://drupal.org/node/528078</a> to help provide this documentation page. \ No newline at end of file diff --git a/sites/all/modules/ctools/page_manager/js/page-list.js b/sites/all/modules/ctools/page_manager/js/page-list.js index 79686256..16b52911 100644 --- a/sites/all/modules/ctools/page_manager/js/page-list.js +++ b/sites/all/modules/ctools/page_manager/js/page-list.js @@ -1,4 +1,3 @@ -// $Id: page-list.js,v 1.3 2009/07/12 18:32:04 merlinofchaos Exp $ /** * Provide some extra responses for the page list so we can have automatic diff --git a/sites/all/modules/ctools/page_manager/page_manager.admin.inc b/sites/all/modules/ctools/page_manager/page_manager.admin.inc index 4540cb51..7b9056b7 100644 --- a/sites/all/modules/ctools/page_manager/page_manager.admin.inc +++ b/sites/all/modules/ctools/page_manager/page_manager.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_manager.admin.inc,v 1.45 2010/11/03 00:01:14 merlinofchaos Exp $ /** * @file @@ -21,6 +20,12 @@ function page_manager_list_page($js = NULL) { // TRUE if 'ajax', FALSE if otherwise. $js = $js == 'ajax'; + // If we do any form rendering, it's to completely replace a form on the + // page, so don't let it force our ids to change. + if ($js && isset($_POST['ajax_html_ids'])) { + unset($_POST['ajax_html_ids']); + } + if (module_exists('advanced_help') && !$js) { drupal_set_message(theme('advanced_help_topic', 'page_manager', 'getting-started', t('See the getting started guide for more information.'))); } @@ -108,7 +113,7 @@ function page_manager_list_page($js = NULL) { $commands = array(); $commands[] = ajax_command_replace('#page-manager-list-pages', $table); if (!empty($replace_form)) { - $commands[] = ajax_command_replace('#page-manager-list-pages-form', $form); + $commands[] = ajax_command_replace('#page-manager-list-pages-form', drupal_render($form)); } print ajax_render($commands); ajax_footer(); @@ -198,11 +203,11 @@ function page_manager_get_pages($tasks, &$pages, $task_id = NULL) { if (!empty($task['enable callback'])) { if (!empty($task['disabled'])) { - $operations[] = array( + array_unshift($operations, array( 'title' => t('Enable'), 'href' => 'admin/structure/pages/nojs/enable/' . $task_name, 'query' => array('token' => drupal_get_token($task_name)), - ); + )); } else { $operations[] = array( @@ -213,7 +218,9 @@ function page_manager_get_pages($tasks, &$pages, $task_id = NULL) { } } - $row['data']['operations'] = array('data' => theme('links', array('links' => $operations)), 'class' => array('page-manager-page-operations')); + $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline')))); + + $row['data']['operations'] = array('data' => $ops, 'class' => array('page-manager-page-operations')); $pages['disabled'][$task_name] = !empty($task['disabled']); $pages['tasks'][] = $task_name; @@ -391,7 +398,8 @@ function page_manager_edit_page($page) { drupal_set_title($page->subtask['admin title']); // Provide and process the save page form before anything else. $form_state = array('page' => &$page); - $form = drupal_render(drupal_build_form('page_manager_save_page_form', $form_state)); + $built_form = drupal_build_form('page_manager_save_page_form', $form_state); + $form = drupal_render($built_form); $operations = page_manager_get_operations($page); $args = array('summary'); @@ -436,7 +444,8 @@ function page_manager_edit_page_operation() { // Since this form should never be submitted to this page, process it late so // that we can be sure it notices changes. $form_state = array('page' => &$page); - $form = drupal_render(drupal_build_form('page_manager_save_page_form', $form_state)); + $built_form = drupal_build_form('page_manager_save_page_form', $form_state); + $form = drupal_render($built_form); $output = theme('page_manager_edit_page', array('page' => $page, 'save' => $form, 'operations' => $rendered_operations, 'content' => $content)); @@ -911,7 +920,8 @@ function _page_manager_get_operation_content($js, &$page, $active, $operation, $ $form_state['handler'] = &$form_state['page']->new_handler; } - $output = drupal_render(ctools_wizard_multistep_form($form_info, $step, $form_state)); + $built_form = ctools_wizard_multistep_form($form_info, $step, $form_state); + $output = drupal_render($built_form); $title = empty($form_state['title']) ? $operation['title'] : $form_state['title']; $titles[] = $title; $title = implode(' » ', array_filter($titles)); @@ -1387,10 +1397,8 @@ function page_manager_handler_add_form($form, $form_state, $features = array()) // This set of checkboxes is not dangerous at all. $form['features'] = array( - '#type' => 'checkboxes', - '#validated' => TRUE, + '#type' => 'item', '#title' => t('Optional features'), - '#options' => array(), '#description' => t('Check any optional features you need to be presented with forms for configuring them. If you do not check them here you will still be able to utilize these features once the new page is created. If you are not sure, leave these unchecked.'), '#tree' => TRUE, ); @@ -1408,7 +1416,6 @@ function page_manager_handler_add_form($form, $form_state, $features = array()) if ($plugin != 'default') { $form['features'][$plugin][$feature_id] += array( - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-handler' => array($plugin)), ); } diff --git a/sites/all/modules/ctools/page_manager/page_manager.info b/sites/all/modules/ctools/page_manager/page_manager.info index 16e36dfd..4791bc31 100644 --- a/sites/all/modules/ctools/page_manager/page_manager.info +++ b/sites/all/modules/ctools/page_manager/page_manager.info @@ -1,13 +1,12 @@ -; $Id: page_manager.info,v 1.5 2011/01/01 00:01:46 merlinofchaos Exp $ name = Page manager description = Provides a UI and API to manage pages within the site. core = 7.x dependencies[] = ctools package = Chaos tool suite -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/page_manager/page_manager.install b/sites/all/modules/ctools/page_manager/page_manager.install index 1771e48e..ad2781c8 100644 --- a/sites/all/modules/ctools/page_manager/page_manager.install +++ b/sites/all/modules/ctools/page_manager/page_manager.install @@ -1,5 +1,4 @@ <?php -// $Id: page_manager.install,v 1.10 2010/09/07 09:02:50 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/page_manager/page_manager.module b/sites/all/modules/ctools/page_manager/page_manager.module index e7ba2dab..7b606af5 100644 --- a/sites/all/modules/ctools/page_manager/page_manager.module +++ b/sites/all/modules/ctools/page_manager/page_manager.module @@ -1,5 +1,4 @@ <?php -// $Id: page_manager.module,v 1.26 2010/11/03 00:08:04 merlinofchaos Exp $ /** * @file @@ -96,6 +95,7 @@ function page_manager_menu() { $base = array( 'access arguments' => array('use page manager'), 'file' => 'page_manager.admin.inc', + 'theme callback' => 'ajax_base_page_theme', ); $items['admin/structure/pages'] = array( @@ -115,13 +115,13 @@ function page_manager_menu() { 'title' => 'Edit', 'page callback' => 'page_manager_edit_page', 'page arguments' => array(4), - 'type' => MENU_CALLBACK, + 'type' => MENU_NORMAL_ITEM, ) + $base; $items['admin/structure/pages/%ctools_js/operation/%page_manager_cache'] = array( 'page callback' => 'page_manager_edit_page_operation', 'page arguments' => array(3, 5), - 'type' => MENU_CALLBACK, + 'type' => MENU_NORMAL_ITEM, ) + $base; $items['admin/structure/pages/%ctools_js/enable/%page_manager_cache'] = array( @@ -158,6 +158,35 @@ function page_manager_menu() { return $items; } +function page_manager_admin_paths() { + /* @todo FIX ME this is a major resource suck. */ + return; + + $items = array(); + ctools_include('page', 'page_manager', 'plugins/tasks'); + $pages = page_manager_page_load_all(); + foreach ($pages as $page) { + // Make sure the page we're on is set to be an administrative path and that + // it is not set to be a frontpage path. + if ((isset($page->conf['admin_paths']) && $page->conf['admin_paths']) && (!isset($page->make_frontpage) || !$page->make_frontpage)) { + $path_parts = explode('/', $page->path); + foreach ($path_parts as $key => $part) { + if (strpos($part, '%') !== FALSE || strpos($part, '!') !== FALSE) { + $path_parts[$key] = '*'; + } + } + $path = implode('/', $path_parts); + if ($page->menu['type'] == 'default tab') { + array_pop($path_parts); + $parent_path = implode('/', $path_parts); + $items[$parent_path] = TRUE; + } + $items[$path] = TRUE; + } + } + return $items; +} + /** * Implements hook_menu_alter. * diff --git a/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc b/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc index f56f81c6..2f01b560 100644 --- a/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc +++ b/sites/all/modules/ctools/page_manager/plugins/cache/page_manager_context.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_manager_context.inc,v 1.1 2010/10/11 22:18:24 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc b/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc index bf3da17e..ba549b49 100644 --- a/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc +++ b/sites/all/modules/ctools/page_manager/plugins/task_handlers/http_response.inc @@ -1,5 +1,4 @@ <?php -// $Id: http_response.inc,v 1.2 2010/10/11 22:18:24 sdboyer Exp $ /** * @file @@ -16,7 +15,7 @@ $plugin = array( // Administrative fields. 'title' => t('HTTP response code'), - 'admin summary' =>'page_manager_http_response_admin_summary', + 'admin summary' => 'page_manager_http_response_admin_summary', 'admin title' => 'page_manager_http_response_title', 'operations' => array( 'settings' => array( @@ -215,7 +214,7 @@ function page_manager_http_response_title($handler, $task, $subtask) { /** * General settings for the panel */ -function page_manager_http_response_edit_settings(&$form, &$form_state) { +function page_manager_http_response_edit_settings($form, &$form_state) { $conf = $form_state['handler']->conf; $form['title'] = array( '#type' => 'textfield', @@ -236,7 +235,6 @@ function page_manager_http_response_edit_settings(&$form, &$form_state) { '#type' => 'textfield', '#title' => t('Redirect destination'), '#default_value' => $conf['destination'], - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-code' => array(301)), '#description' => t('Enter the path to redirect to. You may use keyword substitutions from contexts. You can use external urls (http://www.example.com/foo) or internal urls (node/1).'), ); @@ -244,7 +242,7 @@ function page_manager_http_response_edit_settings(&$form, &$form_state) { return $form; } -function page_manager_http_response_edit_settings_submit(&$form, &$form_state) { +function page_manager_http_response_edit_settings_submit($form, &$form_state) { $form_state['handler']->conf['title'] = $form_state['values']['title']; $form_state['handler']->conf['code'] = $form_state['values']['code']; $form_state['handler']->conf['destination'] = $form_state['values']['destination']; diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc index 94d76feb..8d62e98d 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/blog.inc @@ -1,5 +1,4 @@ <?php -// $Id: blog.inc,v 1.3 2010/01/29 21:21:20 merlinofchaos Exp $ /** * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc index 9332441b..8ad43d01 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/blog_user.inc @@ -1,5 +1,4 @@ <?php -// $Id: blog_user.inc,v 1.3 2009/10/13 18:12:09 merlinofchaos Exp $ /** * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc index 26fc8122..532e2ef1 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_site.inc @@ -1,5 +1,4 @@ <?php -// $Id: contact_site.inc,v 1.3 2010/01/29 21:21:20 merlinofchaos Exp $ /** * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for @@ -44,8 +43,12 @@ function page_manager_contact_site_menu_alter(&$items, $task) { } $callback = $items['contact']['page callback']; + if ($callback == 'drupal_get_form') { + $callback = $items['contact']['page arguments'][0]; + } + // Override the node edit handler for our purpose. - if ($callback == 'contact_site_page' || variable_get('page_manager_override_anyway', FALSE)) { + if ($callback == 'contact_site_form' || variable_get('page_manager_override_anyway', FALSE)) { $items['contact']['page callback'] = 'page_manager_contact_site'; $items['contact']['file path'] = $task['path']; $items['contact']['file'] = $task['file']; @@ -61,7 +64,7 @@ function page_manager_contact_site_menu_alter(&$items, $task) { } /** - * Entry point for our overridden node edit. + * Entry point for our overridden site contact. * * This function asks its assigned handlers who, if anyone, would like * to run with it. If no one does, it passes through to Drupal core's @@ -79,7 +82,7 @@ function page_manager_contact_site() { } module_load_include('inc', 'contact', 'contact.pages'); - $function = 'contact_site_page'; + $function = 'contact_site_form'; foreach (module_implements('page_manager_override') as $module) { $call = $module . '_page_manager_override'; if (($rc = $call('contact_site')) && function_exists($rc)) { @@ -89,6 +92,10 @@ function page_manager_contact_site() { } // Otherwise, fall back. + if ($function == 'contact_site_form') { + return drupal_get_form($function); + } + return $function(); } diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc index 88e00ca9..85305352 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/contact_user.inc @@ -1,5 +1,4 @@ <?php -// $Id: contact_user.inc,v 1.4 2010/01/21 05:59:29 sdboyer Exp $ /** * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for @@ -44,9 +43,13 @@ function page_manager_contact_user_menu_alter(&$items, $task) { if (variable_get('page_manager_contact_user_disabled', TRUE)) { return; } + $callback = $items['user/%user/contact']['page callback']; + if ($callback == 'drupal_get_form') { + $callback = $items['user/%user/contact']['page arguments'][0]; + } // Override the user view handler for our purpose. - if ($items['user/%user/contact']['page callback'] == 'contact_user_page' || variable_get('page_manager_override_anyway', FALSE)) { + if ($callback == 'contact_personal_form' || variable_get('page_manager_override_anyway', FALSE)) { $items['user/%user/contact']['page callback'] = 'page_manager_contact_user'; $items['user/%user/contact']['file path'] = $task['path']; $items['user/%user/contact']['file'] = $task['file']; @@ -55,7 +58,7 @@ function page_manager_contact_user_menu_alter(&$items, $task) { // automatically disable this task if it cannot be enabled. variable_set('page_manager_contact_user_disabled', TRUE); if (!empty($GLOBALS['page_manager_enabling_contact_user'])) { - drupal_set_message(t('Page manager module is unable to enable user/%user/contact because some other module already has overridden with %callback.', array('%callback' => $items['user/%user/contact']['page callback'])), 'error'); + drupal_set_message(t('Page manager module is unable to enable user/%user/contact because some other module already has overridden with %callback.', array('%callback' => $callback)), 'error'); } } } @@ -67,7 +70,7 @@ function page_manager_contact_user_menu_alter(&$items, $task) { * to run with it. If no one does, it passes through to Drupal core's * user view, which is user_page_view(). */ -function page_manager_contact_user($account) { +function page_manager_contact_user($form_id, $account) { // Load my task plugin: $task = page_manager_get_task('contact_user'); @@ -82,7 +85,7 @@ function page_manager_contact_user($account) { } module_load_include('inc', 'contact', 'contact.pages'); - $function = 'contact_user_page'; + $function = 'contact_personal_form'; foreach (module_implements('page_manager_override') as $module) { $call = $module . '_page_manager_override'; if (($rc = $call('contact_user')) && function_exists($rc)) { @@ -92,7 +95,7 @@ function page_manager_contact_user($account) { } // Otherwise, fall back. - return $function($account); + return drupal_get_form($function, $account); } /** diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc index 43c70a6e..0125c6f1 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/node_edit.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_edit.inc,v 1.4 2009/09/27 03:41:02 merlinofchaos Exp $ /** * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for @@ -97,8 +96,8 @@ function page_manager_node_edit($node) { // Fall back! // We've already built the form with the context, so we can't build it again, or // form_clean_id will mess up our ids. But we don't really need to, either: - $context = current($contexts); - $output = drupal_render_form($context->form_id, $context->form); + $context = reset($contexts); + $output = $context->form; } return $output; @@ -123,7 +122,7 @@ function page_manager_node_add($type) { 'uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, - 'language' => '', + 'language' => LANGUAGE_NONE, ); drupal_set_title(t('Create @name', array('@name' => $types[$type]->name))); diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc index d5f4abdf..340dc42f 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/node_view.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_view.inc,v 1.7 2010/12/31 23:56:41 merlinofchaos Exp $ /** * @file @@ -117,7 +116,7 @@ function page_manager_node_view_get_arguments($task, $subtask_id) { 'keyword' => 'node', 'identifier' => t('Node being viewed'), 'id' => 1, - 'name' => 'nid', + 'name' => 'entity_id:node', 'settings' => array(), ), ); diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc index f23db8ce..4e6e7494 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/page.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: page.admin.inc,v 1.30 2011/01/05 22:35:46 merlinofchaos Exp $ /** * @file @@ -117,7 +116,7 @@ function page_manager_page_menu(&$items, $task) { $items[$menu_path] = page_manager_page_menu_item($task, $subtask->menu, $access_arguments, $page_arguments, $load_arguments); // Add a parent menu item if one is configured. - if (isset($subtask->menu['type']) && $subtask->menu['type'] == 'default tab' && $subtask->menu['parent']['type'] != 'none') { + if (isset($subtask->menu['type']) && $subtask->menu['type'] == 'default tab') { array_pop($path); $parent_path = implode('/', $path); $items[$parent_path] = page_manager_page_menu_item($task, $subtask->menu['parent'], $access_arguments, $page_arguments, $load_arguments); @@ -444,12 +443,18 @@ function page_manager_page_form_basic($form, &$form_state) { '#type' => 'checkbox', '#default_value' => !empty($page->make_frontpage), '#title' => t('Make this your site home page.'), - '#description' => t('To set this panel as your home page you must create a unique path name with no % placeholders in the path. The site home page is currently set to %homepage on the !siteinfo configuration form.', array('!siteinfo' => l('Site Information', 'admin/settings/site-information'), '%homepage' => '/' . $frontpage)), + '#description' => t('To set this panel as your home page you must create a unique path name with no % placeholders in the path. The site home page is currently set to %homepage on the !siteinfo configuration form.', array('!siteinfo' => l(t('Site Information'), 'admin/settings/site-information'), '%homepage' => '/' . $frontpage)), + ); + $form['admin_paths'] = array( + '#type' => 'checkbox', + '#default_value' => !empty($page->conf['admin_paths']), + '#title' => t('Use this page in an admin overlay.'), + '#description' => t('Admin overlays are used in many places in Drupal 7 and administrative custom pages should probably utilize this feature.'), ); } else if ($path == $frontpage) { $form['frontpage_markup'] = array( - '#value' => '<b>' . t('This page is currently set to be your site home page. This can be modified on the !siteinfo configuration form.', array('!siteinfo' => l('Site Information', 'admin/settings/site-information'))) . '</b>', + '#value' => '<b>' . t('This page is currently set to be your site home page. This can be modified on the !siteinfo configuration form.', array('!siteinfo' => l(t('Site Information'), 'admin/settings/site-information'))) . '</b>', ); $form['frontpage'] = array( @@ -646,6 +651,7 @@ function page_manager_page_form_basic_submit(&$form, &$form_state) { } $page->make_frontpage = !empty($form_state['values']['frontpage']); + $page->conf['admin_paths'] = !empty($form_state['values']['admin_paths']); } /** @@ -693,7 +699,6 @@ function page_manager_page_form_menu($form, &$form_state) { '#type' => 'textfield', '#default_value' => $menu['title'], '#description' => t('If set to normal or tab, enter the text to use for the menu item.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab', 'action')), ); @@ -707,7 +712,6 @@ function page_manager_page_form_menu($form, &$form_state) { '#options' => menu_get_menus(), '#default_value' => $menu['name'], '#description' => t('Insert item into an available menu.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('normal')), ); } @@ -725,7 +729,6 @@ function page_manager_page_form_menu($form, &$form_state) { '#type' => 'textfield', '#default_value' => isset($menu['weight']) ? $menu['weight'] : 0, '#description' => t('The lower the weight the higher/further left it will appear.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab', 'action')), ); @@ -734,10 +737,9 @@ function page_manager_page_form_menu($form, &$form_state) { '#suffix' => '</div>', '#title' => t('Parent menu item'), '#type' => 'radios', - '#options' => array('none' => t('Already exists'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')), + '#options' => array('none' => t('No menu entry'), 'normal' => t('Normal menu item'), 'tab' => t('Menu tab')), '#default_value' => $menu['parent']['type'], '#description' => t('When providing a menu item as a default tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.'), - '#process' => array('form_process_radios', 'ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('default tab')), ); $form['menu']['parent']['title'] = array( @@ -745,7 +747,6 @@ function page_manager_page_form_menu($form, &$form_state) { '#type' => 'textfield', '#default_value' => $menu['parent']['title'], '#description' => t('If creating a parent menu item, enter the title of the item.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('normal', 'tab')), '#dependency_count' => 2, ); @@ -757,7 +758,6 @@ function page_manager_page_form_menu($form, &$form_state) { '#options' => menu_get_menus(), '#default_value' => $menu['parent']['name'], '#description' => t('Insert item into an available menu.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('normal')), '#dependency_count' => 2, ); @@ -774,7 +774,6 @@ function page_manager_page_form_menu($form, &$form_state) { '#default_value' => $menu['parent']['weight'], '#size' => 5, '#description' => t('If the parent menu item is a tab, enter the weight of the tab. The lower the number, the more to the left it will be.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('default tab'), 'radio:menu[parent][type]' => array('tab')), '#dependency_count' => 2, ); @@ -1030,7 +1029,10 @@ function page_manager_page_subtask_argument_ajax($step = NULL, $task_name = NULL ); $output = ctools_wizard_multistep_form($form_info, $step, $form_state); - if (!empty($form_state['complete'])) { + if (!empty($form_state['cancel'])) { + $commands = array(ctools_modal_command_dismiss()); + } + else if (!empty($form_state['complete'])) { if (isset($page->temporary_arguments[$keyword])) { $page->arguments[$keyword] = $page->temporary_arguments[$keyword]; } @@ -1114,7 +1116,9 @@ function page_manager_page_argument_form_change($form, &$form_state) { $options = array(); foreach ($plugins as $id => $plugin) { - $options[$id] = $plugin['title']; + if (empty($plugin['no ui'])) { + $options[$id] = $plugin['title']; + } } asort($options); @@ -1400,7 +1404,7 @@ function page_manager_page_form_clone($form, &$form_state) { '#description' => t('The name of this page. This will appear in the administrative interface to easily identify it.'), '#default_value' => $page->admin_title, ); - + $form['name'] = array( '#type' => 'machine_name', '#title' => t('Page name'), diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc index 79c03c8c..aba99c7d 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc @@ -1,5 +1,4 @@ <?php -// $Id: page.inc,v 1.24 2010/10/11 22:18:23 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc index e811e299..1dcb4190 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/poll.inc @@ -1,5 +1,4 @@ <?php -// $Id: poll.inc,v 1.2 2010/01/29 21:21:21 merlinofchaos Exp $ /** * Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc index cc997c27..b18ab94c 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/search.inc @@ -1,5 +1,4 @@ <?php -// $Id: search.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ /** * @file @@ -60,115 +59,47 @@ function page_manager_search_menu_alter(&$items, $task) { // is necessary because search/node/% and search/node need to be // different due to the way the search menu items function. + $default_info = search_get_default_module_info(); + if (empty($default_info)) { + // Nothing to do. + return; + } + // Go through each search module item. - foreach (module_implements('search') as $name) { - // Do not bother with search menu items that should not have search tabs. - if (!module_invoke($name, 'search', 'name')) { + foreach (search_get_info() as $module => $info) { + if (variable_get('page_manager_search_disabled_' . $module, TRUE)) { continue; } - // Put these items under the default search tab which is node. - $items["search/$name/%menu_tail"]['tab_parent'] = "search/node/%menu_tail"; - $items["search/$name/%menu_tail"]['tab_root'] = "search/node/%menu_tail"; - - $callback = $items["search/$name/%menu_tail"]['page callback']; - - // Even if a search page is not implemented, we need to add an extra - // entry anyway, for two reasons. - // - // 1) The 'search' menu entry actually handles all entries by default - // and that is going to be bad if the node search is overridden and - // 2) We need to have dual entries to make sure that the tabs are right. - if (variable_get('page_manager_search_disabled_' . $name, TRUE) || ($callback != 'search_view' && !variable_get('page_manager_override_anyway', FALSE))) { - $items["search/$name"] = $items["search/$name/%menu_tail"]; - - // Put these items under the real search tab. - $items["search/$name"]['tab_parent'] = 'search'; - $items["search/$name"]['tab_root'] = 'search'; - - if ($name == 'node') { - $items["search/$name"]['type'] = MENU_DEFAULT_LOCAL_TASK; - // The default tab should always be left weighted. Because of the way - // menu sorts, this item tends to float around if not weighted. - $items["search/$name"]['weight'] = -10; - $items["search/$name/%menu_tail"]['weight'] = -10; - } - - if ($callback == 'search_view' || variable_get('page_manager_override_anyway', FALSE)) { - $items["search/$name/%menu_tail"]['page callback'] = 'page_manager_search_view'; - $items["search/$name/%menu_tail"]['file path'] = $task['path']; - $items["search/$name/%menu_tail"]['file'] = $task['file']; - } - - continue; - } + $path = 'search/' . $info['path']; + $callback = $items["$path/%menu_tail"]['page callback']; if ($callback == 'search_view' || variable_get('page_manager_override_anyway', FALSE)) { - $items["search/$name/%menu_tail"]['page callback'] = 'page_manager_search_page'; - $items["search/$name/%menu_tail"]['file path'] = $task['path']; - $items["search/$name/%menu_tail"]['file'] = $task['file']; - - // Add a version that doesn't contain the menu tail for the no keywords - // version. Ordinarily this works because the top level 'search' just - // passes through. - $items["search/$name"] = $items["search/$name/%menu_tail"]; - $items["search/$name/%menu_tail"]['page arguments'] = array(1, 2); - - // Put these items under the real search tab. - $items["search/$name"]['tab_parent'] = 'search'; - $items["search/$name"]['tab_root'] = 'search'; - - // Content search is the default search link, so we have to override - // the default task as well. - if ($name == 'node') { - $items["search/$name"]['type'] = MENU_DEFAULT_LOCAL_TASK; - // The default tab should always be left weighted. Because of the way - // menu sorts, this item tends to float around if not weighted. - $items["search/$name"]['weight'] = -10; - $items["search/$name/%menu_tail"]['weight'] = -10; - - $items["search"]['page callback'] = 'page_manager_search_page'; - $items["search"]['page arguments'] = array('node'); - $items["search"]['file path'] = $task['path']; - $items["search"]['file'] = $task['file']; - } + $items["$path"]['page callback'] = 'page_manager_search_page'; + $items["$path"]['file path'] = $task['path']; + $items["$path"]['file'] = $task['file']; + + $items["$path/%menu_tail"]['page callback'] = 'page_manager_search_page'; + $items["$path/%menu_tail"]['file path'] = $task['path']; + $items["$path/%menu_tail"]['file'] = $task['file']; } else { // automatically disable this task if it cannot be enabled. - variable_set('page_manager_search_disabled_' . $name, TRUE); + variable_set('page_manager_search_disabled_' . $module, TRUE); if (!empty($GLOBALS['page_manager_enabling_search'])) { - drupal_set_message(t('Page manager module is unable to enable search/@name/%menu_tail because some other module already has overridden with %callback.', array('%callback' => $callback, '@name' => $name)), 'error'); + drupal_set_message(t('Page manager module is unable to enable @path because some other module already has overridden with %callback.', array('%callback' => $callback, '@path' => $path)), 'error'); } } } } /** - * Replacement function for normal search view. - * - * This function resets the active trail because menu system loses track - * of it due to the special way we're handling search items. - */ -function page_manager_search_view($type = 'node') { - // @TODO: test that this actually works once page_manager is upgraded. - drupal_static_reset('menu_set_active_trail'); - drupal_static_reset('menu_tree_page_data'); - menu_set_active_trail(); - - module_load_include('inc', 'search', 'search.pages'); - return search_view($type); -} - -/** - * Entry point for our overridden node view. + * Entry point for our overridden search page. * - * This function asks its assigned handlers who, if anyone, would like - * to run with it. If no one does, it passes through to Drupal core's - * node view, which is node_page_view(). */ function page_manager_search_page($type) { ctools_include('menu'); - menu_set_active_trail(ctools_get_menu_trail('search/' . $type)); +// menu_set_active_trail(ctools_get_menu_trail('search/' . $type)); // Get the arguments and construct a keys string out of them. $args = func_get_args(); @@ -255,9 +186,11 @@ function page_manager_search_enable($cache, $status) { */ function page_manager_search_subtasks($task) { $return = array(); - foreach (module_implements('search') as $name) { - if(module_invoke($name, 'search', 'name')) { - $return[$name] = page_manager_search_build_subtask($task, $name); + foreach (search_get_info() as $module => $info) { + if ($info['path']) { + // We don't pass the $info because the subtask build could be called + // singly without the $info when just the subtask needs to be built. + $return[$module] = page_manager_search_build_subtask($task, $module); } } @@ -274,17 +207,19 @@ function page_manager_search_subtask($task, $subtask_id) { /** * Build a subtask array for a given page. */ -function page_manager_search_build_subtask($task, $name) { - $type = module_invoke($name, 'search', 'name', TRUE); +function page_manager_search_build_subtask($task, $module) { + $search_info = search_get_info(); + $info = $search_info[$module]; + $path = 'search/' . $info['path']; $subtask = array( - 'name' => $name, - 'admin title' => $type, - 'admin path' => "search/$name/!keywords", - 'admin description' => t('Search @type', array('@type' => $type)), + 'name' => $module, + 'admin title' => $info['title'], + 'admin path' => "$path/!keywords", + 'admin description' => t('Search @type', array('@type' => $info['title'])), 'admin type' => t('System'), 'row class' => empty($page->disabled) ? 'page-manager-enabled' : 'page-manager-disabled', 'storage' => t('In code'), - 'disabled' => variable_get('page_manager_search_disabled_' . $name, TRUE), + 'disabled' => variable_get('page_manager_search_disabled_' . $module, TRUE), // This works for both enable AND disable 'enable callback' => 'page_manager_search_enable', ); diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc index fabf6da1..97dda0cc 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/term_view.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_view.inc,v 1.10 2011/01/06 00:16:28 merlinofchaos Exp $ /** * @file @@ -23,7 +22,7 @@ function page_manager_term_view_page_manager_tasks() { 'title' => t('Taxonomy term template'), 'admin title' => t('Taxonomy term template'), 'admin description' => t('When enabled, this overrides the default Drupal behavior for displaying taxonomy terms at <em>taxonomy/term/%term</em>. If you add variants, you may use selection criteria such as vocabulary or user access to provide different displays of the taxonomy term and associated nodes. If no variant is selected, the default Drupal taxonomy term display will be used. This page only affects items actually displayed ad taxonomy/term/%term. Some taxonomy terms, such as forums, have their displays moved elsewhere. Also please note that if you are using pathauto, aliases may make a taxonomy terms appear somewhere else, but as far as Drupal is concerned, they are still at taxonomy/term/%term.'), - 'admin path' => 'taxonomy/term/%term', + 'admin path' => 'taxonomy/term/%taxonomy_term', 'admin summary' => 'page_manager_term_view_admin_summary', // Menu hooks so that we can alter the term/%term menu entry to point to us. @@ -71,11 +70,6 @@ function page_manager_term_view_menu_alter(&$items, $task) { return; } - // @todo --fix. - variable_set('page_manager_term_view_disabled', TRUE); - drupal_set_message(t('Due to changes in taxonomy, the taxonomy integration with Page Manager is currently not implemented. See <a href="http://drupal.org/node/1016510">.'), 'error'); - return; - // Override the term view handler for our purpose, but only if someone else // has not already done so. if (isset($items['taxonomy/term/%taxonomy_term']) && $items['taxonomy/term/%taxonomy_term']['page callback'] == 'taxonomy_term_page' || variable_get('page_manager_override_anyway', FALSE)) { @@ -86,8 +80,20 @@ function page_manager_term_view_menu_alter(&$items, $task) { else { // automatically disable this task if it cannot be enabled. variable_set('page_manager_term_view_disabled', TRUE); + + if (isset($items['taxonomy/term/%taxonomy_term']['page callback'])) { + $callback = $items['taxonomy/term/%taxonomy_term']['page callback']; + } + // Because Views changes %taxonomy_term to %views_arg, check to see if that + // is why we can't enable: + else if (isset($items['taxonomy/term/%views_arg']['page callback'])) { + $callback = $items['taxonomy/term/%views_arg']['page callback']; + } + else { + $callback = t('an unknown callback'); + } if (!empty($GLOBALS['page_manager_enabling_term_view'])) { - drupal_set_message(t('Page manager module is unable to enable taxonomy/term/%term because some other module already has overridden with %callback.', array('%callback' => $items['taxonomy/term/%taxonomy_term']['page callback'])), 'error'); + drupal_set_message(t('Page manager module is unable to enable taxonomy/term/%taxonomy_term because some other module already has overridden with %callback.', array('%callback' => $callback)), 'error'); } } } @@ -102,39 +108,37 @@ function page_manager_term_view_menu_alter(&$items, $task) { function page_manager_term_view_page($term) { // While we ordinarily should never actually get feeds through here, // just in case - if ($op != 'feed') { - // Load my task plugin - $task = page_manager_get_task('term_view'); + // Load my task plugin + $task = page_manager_get_task('term_view'); - // Load the term into a context. - ctools_include('context'); - ctools_include('context-task-handler'); - $contexts = ctools_context_handler_get_task_contexts($task, '', array($terms, $depth)); + // Load the term into a context. + ctools_include('context'); + ctools_include('context-task-handler'); + $contexts = ctools_context_handler_get_task_contexts($task, '', array($term)); - if (empty($contexts)) { - return drupal_not_found(); - } + if (empty($contexts)) { + return drupal_not_found(); + } - // Add a fake tab for 'View' so that edit tabs can be added. - if (user_access('administer page manager')) { - ctools_include('menu'); - ctools_menu_add_tab(array( - 'title' => t('View'), - 'href' => $_GET['q'], - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - )); - } + $output = ctools_context_handler_render($task, '', $contexts, array($term->tid)); + if ($output !== FALSE) { + return $output; + } - $output = ctools_context_handler_render($task, '', $contexts, array($terms, $depth, $op)); - if ($output !== FALSE) { - return $output; + $function = 'taxonomy_term_page'; + foreach (module_implements('page_manager_override') as $module) { + $call = $module . '_page_manager_override'; + if (($rc = $call('term_view')) && function_exists($rc)) { + $function = $rc; + break; } } // Otherwise, fall back. - module_load_include('inc', 'taxonomy', 'taxonomy.pages'); - return taxonomy_term_page($terms, $depth, $op); + if ($function == 'taxonomy_term_page') { + module_load_include('inc', 'taxonomy', 'taxonomy.pages'); + } + return $function($term); } /** @@ -147,9 +151,9 @@ function page_manager_term_view_get_arguments($task, $subtask_id) { return array( array( 'keyword' => 'term', - 'identifier' => variable_get('page_manager_term_view_type', 'multiple') == 'multiple' ? t('Term(s) being viewed') : t('Term being viewed'), + 'identifier' => page_manager_term_view_get_type() == 'multiple' ? t('Term(s) being viewed') : t('Term being viewed'), 'id' => 1, - 'name' => variable_get('page_manager_term_view_type', 'multiple') == 'multiple' ? 'terms' : 'term', + 'name' => page_manager_term_view_get_type() == 'multiple' ? 'terms' : 'term', 'settings' => array('input_form' => 'tid', 'breadcrumb' => variable_get('page_manager_taxonomy_breadcrumb', TRUE)), 'default' => '404', ), @@ -173,11 +177,11 @@ function page_manager_term_view_get_contexts($task, $subtask_id) { /** * Settings page for this item. */ -function page_manager_term_view_settings(&$form, &$form_state) { +function page_manager_term_view_settings($form, &$form_state) { // This passes thru because the setting can also appear on the main Panels // settings form. If $settings is an array it will just pick up the default. $settings = isset($form_state->update_values) ? $form_state->update_values : array(); - page_manager_term_view_admin_settings($form, $settings); + return page_manager_term_view_admin_settings($form, $settings); } /** @@ -200,10 +204,10 @@ function page_manager_term_view_save($subtask, $cache) { /** * Provide a setting to the Panels administrative form. */ -function page_manager_term_view_admin_settings(&$form, $settings = array()) { +function page_manager_term_view_admin_settings($form, $settings = array()) { if (empty($settings)) { $settings = array( - 'page_manager_term_view_type' => variable_get('page_manager_term_view_type', 'multiple'), + 'page_manager_term_view_type' => page_manager_term_view_get_type(), 'page_manager_taxonomy_breadcrumb' => variable_get('page_manager_taxonomy_breadcrumb', TRUE), ); } @@ -212,8 +216,10 @@ function page_manager_term_view_admin_settings(&$form, $settings = array()) { '#type' => 'radios', '#title' => t('Allow multiple terms on taxonomy/term/%term'), '#options' => array('single' => t('Single term'), 'multiple' => t('Multiple terms')), - '#description' => t('By default, Drupal allows multiple terms as an argument by separating them with commas or plus signs. If you set this to single, that feature will be disabled.'), + '#description' => t('By default, Drupal allows multiple terms as an argument by separating them with commas or plus signs. If you set this to single, that feature will be disabled.') . ' ' . t('This feature does not currently work and is disabled.'), '#default_value' => $settings['page_manager_term_view_type'], + // @todo -- fix this + '#disabled' => TRUE, ); $form['page_manager_taxonomy_breadcrumb'] = array( '#title' => t('Inject hierarchy of first term into breadcrumb trail'), @@ -221,6 +227,8 @@ function page_manager_term_view_admin_settings(&$form, $settings = array()) { '#default_value' => $settings['page_manager_taxonomy_breadcrumb'], '#description' => t('If checked, taxonomy term parents will appear in the breadcrumb trail.'), ); + + return $form; } /** @@ -236,6 +244,14 @@ function page_manager_term_view_enable($cache, $status) { } } +function page_manager_term_view_get_type() { +// $view_type = variable_get('page_manager_term_view_type', 'multiple'); + // Revert to just allowing single. + $view_type = 'single'; + + return $view_type; +} + /** * Provide a nice administrative summary of the page so an admin can see at a * glance what this page does and how it is configured. @@ -263,7 +279,7 @@ function page_manager_term_view_admin_summary($task, $subtask) { array('class' => array('page-summary-operation'), 'data' => ''), ); - if (variable_get('page_manager_term_view_type', 'multiple') == 'multiple') { + if (page_manager_term_view_get_type() == 'multiple') { $message = t('Multiple terms may be used, separated by , or +.'); } else { @@ -291,4 +307,5 @@ function page_manager_term_view_admin_summary($task, $subtask) { $output = theme('table', array(), $rows, array('id' => 'page-manager-page-summary')); return $output; -} \ No newline at end of file +} + diff --git a/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc b/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc index fcac5219..246d5915 100644 --- a/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc +++ b/sites/all/modules/ctools/page_manager/plugins/tasks/user_view.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_view.inc,v 1.7 2011/01/06 00:06:18 merlinofchaos Exp $ /** * @file @@ -81,16 +80,28 @@ function page_manager_user_view_page($account) { user_build_content($account); $output = ctools_context_handler_render($task, '', $contexts, array($account->uid)); - if ($output === FALSE) { - // Fall back! - module_load_include('inc', 'user', 'user.pages'); - $output = user_view($account); + if ($output != FALSE) { + return $output; } - else { - //fire off "view" op so that triggers still work -// user_module_invoke('view', $array = array(), $account); + + $function = 'user_view'; + foreach (module_implements('page_manager_override') as $module) { + $call = $module . '_page_manager_override'; + if (($rc = $call('user_view')) && function_exists($rc)) { + $function = $rc; + break; + } + } + + // Otherwise, fall back. + if ($function == 'user_view') { + module_load_include('inc', 'user', 'user.pages'); } - return $output; + //fire off "view" op so that triggers still work + // @todo -- this doesn't work anymore, and the alternatives seem bad. + // will have to figure out how to fix this. +// user_module_invoke('view', $array = array(), $account); + return $function($account); } /** @@ -105,7 +116,7 @@ function page_manager_user_view_get_arguments($task, $subtask_id) { 'keyword' => 'user', 'identifier' => t('User being viewed'), 'id' => 1, - 'name' => 'uid', + 'name' => 'entity_id:user', 'settings' => array(), ), ); diff --git a/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php b/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php index 90ed201d..85510cd9 100644 --- a/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php +++ b/sites/all/modules/ctools/page_manager/theme/page-manager-edit-page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: page-manager-edit-page.tpl.php,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Template for the page manager page editor. diff --git a/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc b/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc index c12dcebd..6435d1ce 100644 --- a/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc +++ b/sites/all/modules/ctools/page_manager/theme/page_manager.theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_manager.theme.inc,v 1.9 2010/11/03 00:01:14 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/compare_users.inc b/sites/all/modules/ctools/plugins/access/compare_users.inc index 59e794e9..c271ff4e 100644 --- a/sites/all/modules/ctools/plugins/access/compare_users.inc +++ b/sites/all/modules/ctools/plugins/access/compare_users.inc @@ -1,5 +1,4 @@ <?php -// $Id: compare_users.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -32,7 +31,7 @@ function ctools_compare_users_settings($form, &$form_state, $conf) { $form['settings']['helptext'] = array( '#type' => 'markup', - '#value' => '<div>'. t('Grant access based on comparison of the two user contexts. For example, to grant access to a user to view their own profile, choose "logged in user" and "user being viewed" and say "grant access if equal". When they\'re the same, access will be granted.') . '</div>', + '#value' => '<div>' . t('Grant access based on comparison of the two user contexts. For example, to grant access to a user to view their own profile, choose "logged in user" and "user being viewed" and say "grant access if equal". When they\'re the same, access will be granted.') . '</div>', ); $form['settings']['equality'] = array( diff --git a/sites/all/modules/ctools/plugins/access/context_exists.inc b/sites/all/modules/ctools/plugins/access/context_exists.inc index bdf593c1..f60eb193 100644 --- a/sites/all/modules/ctools/plugins/access/context_exists.inc +++ b/sites/all/modules/ctools/plugins/access/context_exists.inc @@ -1,5 +1,4 @@ <?php -// $Id: context_exists.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/entity_bundle.inc b/sites/all/modules/ctools/plugins/access/entity_bundle.inc new file mode 100644 index 00000000..ffb83f57 --- /dev/null +++ b/sites/all/modules/ctools/plugins/access/entity_bundle.inc @@ -0,0 +1,126 @@ +<?php +// $Id$ + +/** + * @file + * Plugin to provide access control based upon entity bundle. + */ + +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'title' => t("Entity: bundle"), + 'description' => t('Control access by entity bundle.'), + 'callback' => 'ctools_entity_bundle_ctools_access_check', + 'default' => array('type' => array()), + 'settings form' => 'ctools_entity_bundle_ctools_access_settings', + 'settings form submit' => 'ctools_entity_bundle_ctools_access_settings_submit', + 'summary' => 'ctools_entity_bundle_ctools_access_summary', + 'restrictions' => 'ctools_entity_bundle_ctools_access_restrictions', + 'get child' => 'ctools_entity_bundle_ctools_access_get_child', + 'get children' => 'ctools_entity_bundle_ctools_access_get_children', +); + +function ctools_entity_bundle_ctools_access_get_child($plugin, $parent, $child) { + $plugins = ctools_entity_bundle_ctools_access_get_children($plugin, $parent); + return $plugins[$parent . ':' . $child]; +} + +function ctools_entity_bundle_ctools_access_get_children($plugin, $parent) { + $entities = entity_get_info(); + $plugins = array(); + foreach ($entities as $entity_type => $entity) { + $plugin['title'] = t('@entity: Bundle', array('@entity' => $entity['label'])); + $plugin['keyword'] = $entity_type; + $plugin['description'] = t('Control access by @entity entity bundle.', array('@entity' => $entity_type)); + $plugin['name'] = $parent . ':' . $entity_type; + $plugin['required context'] = new ctools_context_required(t(ucfirst($entity_type)), $entity_type); + $plugins[$parent . ':' . $entity_type] = $plugin; + } + + return $plugins; +} + +/** + * Settings form for the 'by entity_bundle' access plugin + */ +function ctools_entity_bundle_ctools_access_settings($form, &$form_state, $conf) { + $plugin = $form_state['plugin']; + $entity_type = explode(':', $plugin['name']); + $entity_type = $entity_type[1]; + $entity = entity_get_info($entity_type); + foreach ($entity['bundles'] as $type => $info) { + $options[$type] = check_plain($info['label']); + } + + $form['settings']['type'] = array( + '#title' => t('Entity Bundle'), + '#type' => 'checkboxes', + '#options' => $options, + '#description' => t('Only the checked entity bundles will be valid.'), + '#default_value' => $conf['type'], + ); + return $form; +} + +/** + * Compress the entity bundles allowed to the minimum. + */ +function ctools_entity_bundle_ctools_access_settings_submit($form, &$form_state) { + $form_state['values']['settings']['type'] = array_filter($form_state['values']['settings']['type']); +} + +/** + * Check for access. + */ +function ctools_entity_bundle_ctools_access_check($conf, $context) { + $entity = entity_get_info($context->type[2]); + // As far as I know there should always be a context at this point, but this + // is safe. + if (empty($context) || empty($context->data) || empty($context->data->{$entity['entity keys']['bundle']})) { + return FALSE; + } + + if (array_filter($conf['type']) && empty($conf['type'][$context->data->{$entity['entity keys']['bundle']}])) { + return FALSE; + } + + return TRUE; +} + +/** + * Inform the UI that we've eliminated a bunch of possibilities for this + * context. + */ +function ctools_entity_bundle_ctools_access_restrictions($conf, &$context) { + if (isset($context->restrictions['type'])) { + $context->restrictions['type'] = array_unique(array_merge($context->restrictions['type'], array_keys(array_filter($conf['type'])))); + } + else { + $context->restrictions['type'] = array_keys(array_filter($conf['type'])); + } +} + +/** + * Provide a summary description based upon the checked entity_bundle. + */ +function ctools_entity_bundle_ctools_access_summary($conf, $context) { + if (!isset($conf['type'])) { + $conf['type'] = array(); + } + $entity = entity_get_info($context->type[2]); + + $names = array(); + foreach (array_filter($conf['type']) as $type) { + $names[] = check_plain($entity['bundles'][$type]['label']); + } + + if (empty($names)) { + return t('@identifier is any bundle', array('@identifier' => $context->identifier)); + } + + return format_plural(count($names), '@identifier is type "@types"', '@identifier type is one of "@types"', array('@types' => implode(', ', $names), '@identifier' => $context->identifier)); +} + diff --git a/sites/all/modules/ctools/plugins/access/node_access.inc b/sites/all/modules/ctools/plugins/access/node_access.inc index 3e6320ee..fcd275d9 100644 --- a/sites/all/modules/ctools/plugins/access/node_access.inc +++ b/sites/all/modules/ctools/plugins/access/node_access.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_access.inc,v 1.10 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/node_language.inc b/sites/all/modules/ctools/plugins/access/node_language.inc index 662203b8..0fdcfc66 100644 --- a/sites/all/modules/ctools/plugins/access/node_language.inc +++ b/sites/all/modules/ctools/plugins/access/node_language.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_language.inc,v 1.11 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/node_type.inc b/sites/all/modules/ctools/plugins/access/node_type.inc index 5646626d..23a38453 100644 --- a/sites/all/modules/ctools/plugins/access/node_type.inc +++ b/sites/all/modules/ctools/plugins/access/node_type.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_type.inc,v 1.12 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -88,14 +87,31 @@ function ctools_node_type_ctools_access_summary($conf, $context) { $types = node_type_get_types(); $names = array(); + // If a node type doesn't exist, let the user know, but prevent a notice. + $missing_types = array(); + foreach (array_filter($conf['type']) as $type) { - $names[] = check_plain($types[$type]->name); + if (!empty($types[$type])) { + $names[] = check_plain($types[$type]->name); + } + else { + $missing_types[] = check_plain($type); + } } - if (empty($names)) { + if (empty($names) && empty($missing_types)) { return t('@identifier is any node type', array('@identifier' => $context->identifier)); } + if (!empty($missing_types)) { + $output = array(); + if (!empty($names)) { + $output[] = format_plural(count($names), '@identifier is type "@types"', '@identifier type is one of "@types"', array('@types' => implode(', ', $names), '@identifier' => $context->identifier)); + } + $output[] = format_plural(count($missing_types), 'Missing/ deleted type "@types"', 'Missing/ deleted type is one of "@types"', array('@types' => implode(', ', $missing_types))); + return implode(' | ', $output); + } + return format_plural(count($names), '@identifier is type "@types"', '@identifier type is one of "@types"', array('@types' => implode(', ', $names), '@identifier' => $context->identifier)); } diff --git a/sites/all/modules/ctools/plugins/access/path_visibility.inc b/sites/all/modules/ctools/plugins/access/path_visibility.inc index 160f8bfb..60b86124 100644 --- a/sites/all/modules/ctools/plugins/access/path_visibility.inc +++ b/sites/all/modules/ctools/plugins/access/path_visibility.inc @@ -1,5 +1,4 @@ <?php -// $Id: path_visibility.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/perm.inc b/sites/all/modules/ctools/plugins/access/perm.inc index eca4ac7c..67516faf 100644 --- a/sites/all/modules/ctools/plugins/access/perm.inc +++ b/sites/all/modules/ctools/plugins/access/perm.inc @@ -1,5 +1,4 @@ <?php -// $Id: perm.inc,v 1.10 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/php.inc b/sites/all/modules/ctools/plugins/access/php.inc index 71d9f91a..35da86d9 100644 --- a/sites/all/modules/ctools/plugins/access/php.inc +++ b/sites/all/modules/ctools/plugins/access/php.inc @@ -1,5 +1,4 @@ <?php -// $Id: php.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/role.inc b/sites/all/modules/ctools/plugins/access/role.inc index 2e5875e0..b6332544 100644 --- a/sites/all/modules/ctools/plugins/access/role.inc +++ b/sites/all/modules/ctools/plugins/access/role.inc @@ -1,5 +1,4 @@ <?php -// $Id: role.inc,v 1.11 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/site_language.inc b/sites/all/modules/ctools/plugins/access/site_language.inc index 1c435747..9ff2f70c 100644 --- a/sites/all/modules/ctools/plugins/access/site_language.inc +++ b/sites/all/modules/ctools/plugins/access/site_language.inc @@ -1,5 +1,4 @@ <?php -// $Id: site_language.inc,v 1.10 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/string_equal.inc b/sites/all/modules/ctools/plugins/access/string_equal.inc index 4a9ff45a..ad1c88d8 100644 --- a/sites/all/modules/ctools/plugins/access/string_equal.inc +++ b/sites/all/modules/ctools/plugins/access/string_equal.inc @@ -1,5 +1,4 @@ <?php -// $Id: string_equal.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/string_length.inc b/sites/all/modules/ctools/plugins/access/string_length.inc index 56e8c9d2..2bad6afb 100644 --- a/sites/all/modules/ctools/plugins/access/string_length.inc +++ b/sites/all/modules/ctools/plugins/access/string_length.inc @@ -1,5 +1,4 @@ <?php -// $Id: string_length.inc,v 1.3 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -55,7 +54,7 @@ function ctools_string_length_ctools_access_check($conf, $context) { $length = drupal_strlen($context->data); } - switch($conf['operator']) { + switch ($conf['operator']) { case '<': return $length < $conf['length']; case '<=': diff --git a/sites/all/modules/ctools/plugins/access/term.inc b/sites/all/modules/ctools/plugins/access/term.inc index c49dc927..36e70de4 100644 --- a/sites/all/modules/ctools/plugins/access/term.inc +++ b/sites/all/modules/ctools/plugins/access/term.inc @@ -1,5 +1,4 @@ <?php -// $Id: term.inc,v 1.8 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -61,28 +60,18 @@ function ctools_term_ctools_access_settings($form, &$form_state, $conf) { $form['settings'][$vocabulary->vid] = array( '#title' => t('Terms'), '#description' => t('Select a term or terms from @vocabulary.', array('@vocabulary' => $vocabulary->name)), //. $description, - '#process' => array('ctools_dependent_process'), '#dependency' => array('ctools-select-vid' => array($vocabulary->vid)), '#default_value' => !empty($conf[$vid]) ? $conf[$vid] : '', '#multiple' => TRUE, ); - // If it's a tag, use an autocomplete. - if ($vocabulary->tags) { - $form['settings'][$vocabulary->vid]['#type'] = 'textfield'; - $form['settings'][$vocabulary->vid]['#autocomplete_path'] = 'taxonomy/autocomplete/' . $vocabulary->vid; - } - - // Other vocabs just show a list. - else { - $terms = array(); - foreach (taxonomy_get_tree($vid) as $x => $term) { - $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name; - } - $form['settings'][$vocabulary->vid]['#type'] = 'select'; - $form['settings'][$vocabulary->vid]['#options'] = $terms; - unset($terms); + $terms = array(); + foreach (taxonomy_get_tree($vocabulary->vid) as $tid => $term) { + $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name; } + $form['settings'][$vocabulary->vid]['#type'] = 'select'; + $form['settings'][$vocabulary->vid]['#options'] = $terms; + unset($terms); } $form['settings']['vid']['#options'] = $options; return $form; @@ -110,22 +99,14 @@ function ctools_term_ctools_access_check($conf, $context) { } $return = FALSE; - // Tags get saved as an imploded array of strings. - if (!is_array($conf[$vid])) { - $terms = explode(', ', $conf[$vid]); - // For multi-term with names, we'll only accept the first term because - // that is the name we have. - return in_array($context->data->name, $terms); + + $terms = array_filter($conf[$vid]); + // For multi-term if any terms coincide, let's call that good enough: + if (isset($context->tids)) { + return (bool) array_intersect($terms, $context->tids); } else { - $terms = array_filter($conf[$vid]); - // For multi-term if any terms coincide, let's call that good enough: - if (isset($context->tids)) { - return (bool) array_intersect($terms, $context->tids); - } - else { - return in_array($context->data->tid, $terms); - } + return in_array($context->data->tid, $terms); } } @@ -133,16 +114,11 @@ function ctools_term_ctools_access_check($conf, $context) { * Provide a summary description based upon the checked terms. */ function ctools_term_ctools_access_summary($conf, $context) { - $vocab = taxonomy_vocabulary_load($conf['vid']); - if ($vocab->tags) { - $terms = explode(', ', $conf[$vocab->vid]); - } - else { - $terms = array(); - foreach ($conf[$vocab->vid] as $tid) { - $term = taxonomy_term_load($tid); - $terms[] = $term->name; - } + $vid = $conf['vid']; + $terms = array(); + foreach ($conf[$vid] as $tid) { + $term = taxonomy_term_load($tid); + $terms[] = $term->name; } return format_plural(count($terms), diff --git a/sites/all/modules/ctools/plugins/access/term_has_parent.inc b/sites/all/modules/ctools/plugins/access/term_has_parent.inc new file mode 100644 index 00000000..2c86d1cf --- /dev/null +++ b/sites/all/modules/ctools/plugins/access/term_has_parent.inc @@ -0,0 +1,161 @@ +<?php +/** + * @file + * Plugin to provide access control based upon a parent term. + */ + +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'title' => t("Taxonomy: term has parent(s)"), + 'description' => t('Control access if a term belongs to a specific parent term.'), + 'callback' => 'ctools_term_has_parent_ctools_access_check', + 'default' => array('vid' => array(), 'negate' => 0), + 'settings form' => 'ctools_term_has_parent_ctools_access_settings', + 'settings form validation' => 'ctools_term_has_parent_ctools_access_settings_validate', + 'settings form submit' => 'ctools_term_has_parent_ctools_access_settings_submit', + 'summary' => 'ctools_term_has_parent_ctools_access_summary', + 'required context' => new ctools_context_required(t('Term'), array('taxonomy_term', 'terms')), +); + +/** + * Settings form for the 'by parent term' access plugin + */ +function ctools_term_has_parent_ctools_access_settings($form, &$form_state, $conf) { + // If no configuration was saved before, set some defaults. + if (empty($conf)) { + $conf = array( + 'vid' => 0, + ); + } + if (!isset($conf['vid'])) { + $conf['vid'] = 0; + } + + $form['settings']['vid'] = array( + '#title' => t('Vocabulary'), + '#type' => 'select', + '#options' => array(), + '#description' => t('Select the vocabulary for this form.'), + '#id' => 'ctools-select-vid', + '#default_value' => $conf['vid'], + '#required' => TRUE, + ); + + ctools_include('dependent'); + $options = array(); + + // A note: Dependency works strangely on these forms as they have never been + // updated to a more modern system so they are not individual forms of their + // own like the content types. + + $form['settings']['#tree'] = TRUE; + + // Loop over each of the configured vocabularies. + foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) { + $options[$vid] = $vocabulary->name; + $form['settings'][$vid] = array( + '#title' => t('Terms'), + '#description' => t('Select a term or terms from @vocabulary.', array('@vocabulary' => $vocabulary->name)), + '#dependency' => array('ctools-select-vid' => array($vocabulary->vid)), + '#default_value' => !empty($conf[$vid]) ? $conf[$vid] : '', + '#size' => 10, + '#multiple' => TRUE, + //@todo: Remove the following workaround when the following patch is in core. {@see:http://drupal.org/node/1117526} + '#name' => sprintf("settings[%u][]", $vid), + '#attributes' => array('multiple' => 'multiple'), + ); + + $terms = array(); + foreach (taxonomy_get_tree($vocabulary->vid) as $term) { + $terms[$term->tid] = str_repeat('-', $term->depth) . ($term->depth ? ' ' : '') . $term->name; + } + $form['settings'][$vid]['#type'] = 'select'; + $form['settings'][$vid]['#options'] = $terms; + unset($terms); + } + $form['settings']['vid']['#options'] = $options; + $form['settings']['include_self'] = array( + '#title' => t('Include these term(s) as candidates?'), + '#description' => t('When this rule is evaluated, should the term(s) you select be included as candidates for access?'), + '#default_value' => $conf['include_self'], + '#type' => 'checkbox', + ); + return $form; +} + +/** + * Check for access. + */ +function ctools_term_has_parent_ctools_access_check($conf, $context) { + // As far as I know there should always be a context at this point, but this + // is safe. + if (empty($context) || empty($context->data) || empty($context->data->vid) || empty($context->data->tid)) { + return FALSE; + } + + // Get the $vid. + if (!isset($conf['vid'])) { + return FALSE; + } + $vid = $conf['vid']; + + // we'll start looking up the hierarchy from our context term id. + $current_term = $context->data->tid; + + $term=''; + + // scan up the tree. + while (true) { + // select parent as term_parent to avoid PHP5 complications with the parent keyword + //@todo: Find a way to reduce the number of queries required for really deep hierarchies. + $term = db_query("SELECT parent AS term_parent, tid AS tid FROM {taxonomy_term_hierarchy} th WHERE th.tid = :tid", array(':tid'=>$current_term))->fetchObject(); + + // if no term is found, get out of the loop + if (!$term || empty($term->tid)) { + break; + } + + // check the term selected, if the user asked it to. + if (!empty($conf['include_self']) && in_array($term->tid, $conf[$vid])) { + return TRUE; + } + + // did we find the parent TID we were looking for? + if (in_array($term->term_parent, $conf[$vid])) { + // YES, we're done! + return TRUE; + } + // Nope, we didn't find it. + + // If this is the top of the hierarchy, stop scanning. + if ($term->term_parent==0) { + break; + } + + // update the parent, and keep scanning. + $current_term = $term->term_parent; + } + + return FALSE; +} + +/** + * Provide a summary description based upon the checked terms. + */ +function ctools_term_has_parent_ctools_access_summary($conf, $context) { + $vid = (int)$conf['vid']; + $terms = array(); + foreach ($conf[$vid] as $tid) { + $term = taxonomy_term_load($tid); + $terms[] = $term->name; + } + + return format_plural(count($terms), + '@term can have the parent "@terms"', + '@term can have one of these parents: @terms', + array('@terms' => implode(', ', $terms), + '@term' => $context->identifier)); +} diff --git a/sites/all/modules/ctools/plugins/access/term_parent.inc b/sites/all/modules/ctools/plugins/access/term_parent.inc index 15a71a85..acbaf872 100644 --- a/sites/all/modules/ctools/plugins/access/term_parent.inc +++ b/sites/all/modules/ctools/plugins/access/term_parent.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_parent.inc,v 1.3 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -72,7 +71,7 @@ function ctools_term_parent_ctools_access_check($conf, $context) { } $vid = $conf['vid']; - $count = db_result(db_query('SELECT COUNT(*) FROM {term_hierarchy} th INNER JOIN {term_data} td ON th.parent = td.tid WHERE th.tid = %d AND td.vid = %d', $context->data->tid, $vid)); + $count = db_query('SELECT COUNT(*) FROM {taxonomy_term_hierarchy} th INNER JOIN {taxonomy_term_data} td ON th.parent = td.tid WHERE th.tid = :tid AND td.vid = :vid', array(':tid' => $context->data->tid, ':vid' => $vid))->fetchField(); return $count ? TRUE : FALSE; } diff --git a/sites/all/modules/ctools/plugins/access/term_vocabulary.inc b/sites/all/modules/ctools/plugins/access/term_vocabulary.inc index 8bb7e2a3..644600fc 100644 --- a/sites/all/modules/ctools/plugins/access/term_vocabulary.inc +++ b/sites/all/modules/ctools/plugins/access/term_vocabulary.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_vocabulary.inc,v 1.9 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/access/theme.inc b/sites/all/modules/ctools/plugins/access/theme.inc index eaff131d..4f4be6de 100644 --- a/sites/all/modules/ctools/plugins/access/theme.inc +++ b/sites/all/modules/ctools/plugins/access/theme.inc @@ -1,5 +1,4 @@ <?php -// $Id: theme.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/arguments/entity_id.inc b/sites/all/modules/ctools/plugins/arguments/entity_id.inc index 63cf4c68..451d444c 100644 --- a/sites/all/modules/ctools/plugins/arguments/entity_id.inc +++ b/sites/all/modules/ctools/plugins/arguments/entity_id.inc @@ -1,5 +1,4 @@ <?php -// $Id: entity_id.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -24,17 +23,20 @@ function ctools_argument_entity_id_get_child($plugin, $parent, $child) { return $plugins[$parent . ':' . $child]; } -function ctools_argument_entity_id_get_children($plugin, $parent) { +function ctools_argument_entity_id_get_children($original_plugin, $parent) { $entities = entity_get_info(); $plugins = array(); foreach ($entities as $entity_type => $entity) { + $plugin = $original_plugin; $plugin['title'] = t('@entity: ID', array('@entity' => $entity['label'])); $plugin['keyword'] = $entity_type; $plugin['description'] = t('Creates @entity context from an ID argument.', array('@entity' => $entity_type)); $plugin['name'] = $parent . ':' . $entity_type; - $plugins[$parent . ':' . $entity_type] = $plugin; + $plugin_id = $parent . ':' . $entity_type; + drupal_alter('ctools_entity_context', $plugin, $entity, $plugin_id); + $plugins[$plugin_id] = $plugin; } - + drupal_alter('ctools_entity_contexts', $plugins); return $plugins; } @@ -42,7 +44,8 @@ function ctools_argument_entity_id_get_children($plugin, $parent) { * Discover if this argument gives us the entity we crave. */ function ctools_argument_entity_id_context($arg = NULL, $conf = NULL, $empty = FALSE) { - $entity_type = $conf['keyword']; + $entity_type = explode(':', $conf['name']); + $entity_type = $entity_type[1]; // If unset it wants a generic, unfilled context. if ($empty) { return ctools_context_create_empty('entity:' . $entity_type); diff --git a/sites/all/modules/ctools/plugins/arguments/nid.inc b/sites/all/modules/ctools/plugins/arguments/nid.inc index e0caf882..9aaec0e1 100644 --- a/sites/all/modules/ctools/plugins/arguments/nid.inc +++ b/sites/all/modules/ctools/plugins/arguments/nid.inc @@ -1,5 +1,4 @@ <?php -// $Id: nid.inc,v 1.10 2010/01/29 20:18:01 merlinofchaos Exp $ /** * @file @@ -20,6 +19,7 @@ $plugin = array( '#type' => 'textfield', '#description' => t('Enter the node ID of a node for this argument'), ), + 'no ui' => TRUE, ); /** diff --git a/sites/all/modules/ctools/plugins/arguments/node_add.inc b/sites/all/modules/ctools/plugins/arguments/node_add.inc index 3282b82d..c811311b 100644 --- a/sites/all/modules/ctools/plugins/arguments/node_add.inc +++ b/sites/all/modules/ctools/plugins/arguments/node_add.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_add.inc,v 1.6 2010/10/15 22:56:51 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/arguments/node_edit.inc b/sites/all/modules/ctools/plugins/arguments/node_edit.inc index 422b6ffc..c7cdf29e 100644 --- a/sites/all/modules/ctools/plugins/arguments/node_edit.inc +++ b/sites/all/modules/ctools/plugins/arguments/node_edit.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_edit.inc,v 1.7 2010/01/29 20:18:01 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/arguments/rid.inc b/sites/all/modules/ctools/plugins/arguments/rid.inc index fbad0553..dd30848e 100644 --- a/sites/all/modules/ctools/plugins/arguments/rid.inc +++ b/sites/all/modules/ctools/plugins/arguments/rid.inc @@ -1,5 +1,4 @@ <?php -// $Id: rid.inc,v 1.2 2010/10/15 21:13:04 merlinofchaos Exp $ /** * @file @@ -40,7 +39,7 @@ function ctools_argument_rid_context($arg = NULL, $conf = NULL, $empty = FALSE) return FALSE; } - $nid = db_result(db_query("SELECT nid FROM {node_revisions} WHERE vid = %d", $arg)); + $nid = db_query('SELECT nid FROM {node_revisions} WHERE vid = :vid', array(':vid' => $arg))->fetchField(); $node = node_load($nid, $arg); if (!$node) { return FALSE; diff --git a/sites/all/modules/ctools/plugins/arguments/string.inc b/sites/all/modules/ctools/plugins/arguments/string.inc index 09048aa3..ed4ffbb6 100644 --- a/sites/all/modules/ctools/plugins/arguments/string.inc +++ b/sites/all/modules/ctools/plugins/arguments/string.inc @@ -1,5 +1,4 @@ <?php -// $Id: string.inc,v 1.7 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -42,14 +41,14 @@ function ctools_string_context($arg = NULL, $conf = NULL, $empty = FALSE) { /** * Settings form for the argument */ -function ctools_string_settings_form($form, &$form_state, $conf) { +function ctools_string_settings_form(&$form, &$form_state, $conf) { $form['settings']['use_tail'] = array( '#title' => t('Get all arguments after this one'), '#type' => 'checkbox', '#default_value' => !empty($conf['use_tail']), '#description' => t('If checked, this string will include all arguments. For example, if the path is "path/%" and the user visits "path/foo/bar", if this is not checked the string will be "foo". If it is checked the string will be "foo/bar".'), ); - return $form; +// return $form; } /** diff --git a/sites/all/modules/ctools/plugins/arguments/term.inc b/sites/all/modules/ctools/plugins/arguments/term.inc index f3efd467..652c5c16 100644 --- a/sites/all/modules/ctools/plugins/arguments/term.inc +++ b/sites/all/modules/ctools/plugins/arguments/term.inc @@ -1,5 +1,4 @@ <?php -// $Id: term.inc,v 1.12 2010/12/31 21:31:50 merlinofchaos Exp $ /** * @file @@ -29,46 +28,51 @@ $plugin = array( function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) { // If unset it wants a generic, unfilled context. if ($empty) { - return ctools_context_create_empty('term'); + return ctools_context_create_empty('entity:taxonomy_term'); } - switch ($conf['input_form']) { - case 'tid': - default: - if (!is_numeric($arg)) { - return FALSE; - } - $term = taxonomy_term_load($arg); - break; - - case 'term': - $terms = taxonomy_get_term_by_name($arg); - - $conf['vids'] = is_array($conf['vids']) ? array_filter($conf['vids']) : NULL; - if ((count($terms) > 1) && isset($conf['vids'])) { - foreach ($terms as $potential) { - foreach ($conf['vids'] as $vid => $active) { - if ($active && $potential->vid == $vid) { - $term = $potential; - // break out of the foreaches AND the case - break 3; + if (is_object($arg)) { + $term = $arg; + } + else { + switch ($conf['input_form']) { + case 'tid': + default: + if (!is_numeric($arg)) { + return FALSE; + } + $term = taxonomy_term_load($arg); + break; + + case 'term': + $terms = taxonomy_get_term_by_name($arg); + + $conf['vids'] = is_array($conf['vids']) ? array_filter($conf['vids']) : NULL; + if ((count($terms) > 1) && isset($conf['vids'])) { + foreach ($terms as $potential) { + foreach ($conf['vids'] as $vid => $active) { + if ($active && $potential->vid == $vid) { + $term = $potential; + // break out of the foreaches AND the case + break 3; + } } } } - } - $term = array_shift($terms); - break; - } + $term = array_shift($terms); + break; + } - if (empty($term)) { - return NULL; + if (empty($term)) { + return NULL; + } } if (!empty($conf['vids']) && array_filter($conf['vids']) && empty($conf['vids'][$term->vid])) { return NULL; } - $context = ctools_context_create('term', $term); + $context = ctools_context_create('entity:taxonomy_term', $term); $context->original_argument = $arg; return $context; } @@ -76,7 +80,7 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) { /** * Settings form for the argument */ -function ctools_term_settings_form($form, &$form_state, $conf) { +function ctools_term_settings_form(&$form, &$form_state, $conf) { // @todo allow synonym use like Views does. $form['settings']['input_form'] = array( '#title' => t('Argument type'), @@ -106,7 +110,7 @@ function ctools_term_settings_form($form, &$form_state, $conf) { '#default_value' => !empty($conf['breadcrumb']), '#description' => t('If checked, taxonomy term parents will appear in the breadcrumb trail.'), ); - return $form; +// return $form; } /** diff --git a/sites/all/modules/ctools/plugins/arguments/terms.inc b/sites/all/modules/ctools/plugins/arguments/terms.inc index 126504ee..4298ea91 100644 --- a/sites/all/modules/ctools/plugins/arguments/terms.inc +++ b/sites/all/modules/ctools/plugins/arguments/terms.inc @@ -1,5 +1,4 @@ <?php -// $Id: terms.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -48,14 +47,14 @@ function ctools_terms_context($arg = NULL, $conf = NULL, $empty = FALSE) { /** * Settings form for the argument */ -function ctools_terms_settings_form($form, &$form_state, $conf) { +function ctools_terms_settings_form(&$form, &$form_state, $conf) { $form['settings']['breadcrumb'] = array( '#title' => t('Inject hierarchy of first term into breadcrumb trail'), '#type' => 'checkbox', '#default_value' => !empty($conf['breadcrumb']), '#description' => t('If checked, taxonomy term parents will appear in the breadcrumb trail.'), ); - return $form; +// return $form; } /** diff --git a/sites/all/modules/ctools/plugins/arguments/uid.inc b/sites/all/modules/ctools/plugins/arguments/uid.inc index 69be25b0..a730b216 100644 --- a/sites/all/modules/ctools/plugins/arguments/uid.inc +++ b/sites/all/modules/ctools/plugins/arguments/uid.inc @@ -1,5 +1,4 @@ <?php -// $Id: uid.inc,v 1.12 2010/01/29 20:18:01 merlinofchaos Exp $ /** * @file @@ -24,6 +23,7 @@ $plugin = array( 'default' => array('to_arg' => TRUE), 'path placeholder' => '%pm_uid_arg', // This is in pagemanager. 'path placeholder to_arg' => TRUE, + 'no ui' => TRUE, ); /** diff --git a/sites/all/modules/ctools/plugins/arguments/user_name.inc b/sites/all/modules/ctools/plugins/arguments/user_name.inc index 87fccf9b..f6f3b463 100644 --- a/sites/all/modules/ctools/plugins/arguments/user_name.inc +++ b/sites/all/modules/ctools/plugins/arguments/user_name.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_name.inc,v 1.3 2010/01/29 20:18:01 merlinofchaos Exp $ /** * @file @@ -37,7 +36,7 @@ function ctools_argument_user_name_context($arg = NULL, $conf = NULL, $empty = F return ctools_context_create('user', $arg); } - $account = user_load(array('name' => $arg)); + $account = user_load_by_name($arg); if (!$account) { return NULL; } diff --git a/sites/all/modules/ctools/plugins/arguments/vid.inc b/sites/all/modules/ctools/plugins/arguments/vid.inc index 1dd4088d..bc5c7b85 100644 --- a/sites/all/modules/ctools/plugins/arguments/vid.inc +++ b/sites/all/modules/ctools/plugins/arguments/vid.inc @@ -1,5 +1,4 @@ <?php -// $Id: vid.inc,v 1.6 2010/01/29 20:18:01 merlinofchaos Exp $ /** * @file @@ -21,6 +20,7 @@ $plugin = array( '#type' => 'textfield', '#description' => t('Enter the vocabulary ID for this argument'), ), + 'no ui' => TRUE, ); /** diff --git a/sites/all/modules/ctools/plugins/cache/export_ui.inc b/sites/all/modules/ctools/plugins/cache/export_ui.inc index 4f9d0828..53483a53 100644 --- a/sites/all/modules/ctools/plugins/cache/export_ui.inc +++ b/sites/all/modules/ctools/plugins/cache/export_ui.inc @@ -1,5 +1,4 @@ <?php -// $Id: export_ui.inc,v 1.1 2010/10/11 22:18:24 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/cache/simple.inc b/sites/all/modules/ctools/plugins/cache/simple.inc index 69c98abe..215dc1a6 100644 --- a/sites/all/modules/ctools/plugins/cache/simple.inc +++ b/sites/all/modules/ctools/plugins/cache/simple.inc @@ -1,5 +1,4 @@ <?php -// $Id: simple.inc,v 1.1 2010/10/11 22:18:24 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/block/block.inc b/sites/all/modules/ctools/plugins/content_types/block/block.inc index 2e4569fe..c8e70f2f 100644 --- a/sites/all/modules/ctools/plugins/content_types/block/block.inc +++ b/sites/all/modules/ctools/plugins/content_types/block/block.inc @@ -1,5 +1,4 @@ <?php -// $Id: block.inc,v 1.17 2011/01/06 00:42:03 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/contact/contact.inc b/sites/all/modules/ctools/plugins/content_types/contact/contact.inc index 10c81e93..63283f59 100644 --- a/sites/all/modules/ctools/plugins/content_types/contact/contact.inc +++ b/sites/all/modules/ctools/plugins/content_types/contact/contact.inc @@ -1,5 +1,4 @@ <?php -// $Id: contact.inc,v 1.4 2010/10/11 22:18:24 sdboyer Exp $ if (module_exists('contact')) { /** @@ -29,7 +28,7 @@ function ctools_contact_content_type_render($subtype, $conf, $panel_args, $conte $block->title = t('Contact'); module_load_include('inc', 'contact', 'contact.pages'); - $block->content = contact_site_page(); + $block->content = drupal_get_form('contact_site_form'); return $block; } diff --git a/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc b/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc index a5589816..cb643bfd 100644 --- a/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc +++ b/sites/all/modules/ctools/plugins/content_types/contact/user_contact.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_contact.inc,v 1.3 2010/01/29 20:18:01 merlinofchaos Exp $ if (module_exists('contact')) { /** @@ -24,7 +23,7 @@ function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $ return; } - if (!_contact_user_tab_access($context->data)) { + if (!_contact_personal_tab_access($context->data)) { return; } @@ -35,7 +34,7 @@ function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $ $block->title = t('Contact @name', array('@name' => $context->data->name)); module_load_include('inc', 'contact', 'contact.pages'); - $block->content = contact_user_page($context->data); + $block->content = drupal_get_form('contact_personal_form', $context->data); return $block; } @@ -44,6 +43,7 @@ function ctools_user_contact_content_type_render($subtype, $conf, $panel_args, $ */ function ctools_user_contact_content_type_edit_form(&$form, &$form_state) { // Empty so that we can have title override. + return $form; } /** diff --git a/sites/all/modules/ctools/plugins/content_types/custom/custom.inc b/sites/all/modules/ctools/plugins/content_types/custom/custom.inc index 54460d05..f60497a6 100644 --- a/sites/all/modules/ctools/plugins/content_types/custom/custom.inc +++ b/sites/all/modules/ctools/plugins/content_types/custom/custom.inc @@ -1,5 +1,4 @@ <?php -// $Id: custom.inc,v 1.17 2011/01/05 22:57:26 merlinofchaos Exp $ /** * @file @@ -225,7 +224,7 @@ function ctools_custom_content_type_admin_info($subtype, $conf) { if (!filter_access($filter)) { return NULL; } - $block->content = '<pre>'. check_plain($settings['body']) .'</pre>'; + $block->content = '<pre>' . check_plain($settings['body']) . '</pre>'; } else { // We also need to filter through XSS admin because <script> tags can @@ -243,7 +242,7 @@ function ctools_custom_content_type_edit_form($form, &$form_state) { $form_state['settings'] = $settings; if ($settings['custom_type'] == 'fixed') { - return; // no form for this case. + return $form; // no form for this case. } $form['admin_title'] = array( @@ -259,7 +258,7 @@ function ctools_custom_content_type_edit_form($form, &$form_state) { '#title' => t('Title'), ); - $form['body'] = array( + $form['body'] = array( '#type' => 'text_format', '#title' => t('Body'), '#default_value' => $settings['body'], @@ -270,9 +269,11 @@ function ctools_custom_content_type_edit_form($form, &$form_state) { // Set extended description if both CCK and Token modules are enabled, notifying of unlisted keywords if (module_exists('content') && module_exists('token')) { $description = t('If checked, context keywords will be substituted in this content. Note that CCK fields may be used as keywords using patterns like <em>%node:field_name-formatted</em>.'); - } elseif (!module_exists('token')) { + } + elseif (!module_exists('token')) { $description = t('If checked, context keywords will be substituted in this content. More keywords will be available if you install the Token module, see http://drupal.org/project/token.'); - } else { + } + else { $description = t('If checked, context keywords will be substituted in this content.'); } @@ -303,7 +304,7 @@ function ctools_custom_content_type_edit_form($form, &$form_state) { } if (!user_access('administer custom content') || !module_exists('ctools_custom_content')) { - return; + return $form; } // Make the other form items dependent upon it. @@ -320,7 +321,6 @@ function ctools_custom_content_type_edit_form($form, &$form_state) { '#type' => 'textfield', '#title' => t('Machine name'), '#description' => t('The machine readable name of this content. It must be unique, and it must contain only alphanumeric characters and underscores. Once created, you will not be able to change this value!'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-reusable' => array(1)), ); @@ -328,7 +328,6 @@ function ctools_custom_content_type_edit_form($form, &$form_state) { '#type' => 'textfield', '#title' => t('Category'), '#description' => t('What category this content should appear in. If left blank the category will be "Miscellaneous".'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-reusable' => array(1)), ); @@ -336,7 +335,6 @@ function ctools_custom_content_type_edit_form($form, &$form_state) { '#type' => 'textarea', '#title' => t('Administrative description'), '#description' => t('A description of what this content is, does or is for, for administrative use.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-reusable' => array(1)), ); return $form; diff --git a/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc b/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc index 1b967fd5..e252064a 100644 --- a/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc +++ b/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc @@ -1,9 +1,13 @@ <?php -// $Id: entity_field.inc,v 1.3 2011/01/05 22:57:26 merlinofchaos Exp $ + +/** + * @file + * Handle rendering entity fields as panes. + */ $plugin = array( 'title' => t('Entity field'), - 'defaults' => array('label' => '', 'formatter' => ''), + 'defaults' => array('label' => 'title', 'formatter' => ''), 'content type' => 'ctools_entity_field_content_type_content_type', ); @@ -33,26 +37,28 @@ function ctools_entity_field_content_type_content_types() { foreach ($entities as $entity_type => $entity) { foreach ($entity['bundles'] as $type => $bundle) { foreach (field_info_instances($entity_type, $type) as $field_name => $field) { - if (!isset($types[$entity_type .':'. $field_name])) { - $types[$entity_type .':'. $field_name] = array( + if (!isset($types[$entity_type . ':' . $field_name])) { + $types[$entity_type . ':' . $field_name] = array( 'category' => t(ucfirst($entity_type)), 'icon' => 'icon_field.png', - 'title' => t('Field: @widget_label (@field_name) - @field_type', array( + 'title' => t('Field: @widget_label (@field_name)', array( '@widget_label' => t($field['label']), '@field_name' => $field_name, - '@field_type' => t($field['widget']['type']), )), 'description' => t('Field on the referenced entity.'), 'edit form' => array( 'ctools_entity_field_content_type_formatter_options' => array( 'default' => TRUE, - 'title' => t('Formatter Options'), + 'title' => t('Formatter options for: @widget_label (@field_name)', array( + '@widget_label' => t($field['label']), + '@field_name' => $field_name, + )), ), 'ctools_entity_field_content_type_formatter_styles' => t('Formatter Styles'), ), ); } - $context_types[$entity_type .':'. $field_name]['types'][$type] = $bundle['label']; + $context_types[$entity_type . ':' . $field_name]['types'][$type] = $bundle['label']; } } } @@ -65,6 +71,7 @@ function ctools_entity_field_content_type_content_types() { )); unset($context_types[$key]['types']); } + return $types; } @@ -90,11 +97,34 @@ function ctools_entity_field_content_type_render($subtype, $conf, $panel_args, $ } $language = field_language($entity_type, $entity, $field_name); + if (empty($conf['label']) || $conf['label'] == 'title') { + $label = 'hidden'; + $conf['label'] = 'title'; + } + else { + $label = $conf['label']; + } + + $field_settings = array( + 'label' => $label, + 'type' => $conf['formatter'], + ); + + // Get the field output, and the title.\ + if (!empty($conf['formatter_settings'])) { + $field_settings['settings'] = $conf['formatter_settings']; + } + + $field_output = field_view_field($entity_type, $entity, $field_name, $field_settings, $language); + // Build the content type block. $block = new stdClass(); $block->module = 'entity_field'; - $block->title = $field['label']; - $block->content = field_view_field($entity_type, $entity, $field_name, ($conf['formatter_settings'] ? array('label' => 'hidden', 'type' => $conf['formatter'], 'settings' => $conf['formatter_settings']) : array('label' => 'hidden', 'type' => $conf['formatter'])), $language); + if ($conf['label'] == 'title' && isset($field_output['#title'])) { + $block->title = $field_output['#title']; + } + + $block->content = $field_output; $block->delta = $ids[0]; return $block; @@ -115,6 +145,20 @@ function ctools_entity_field_content_type_formatter_options($form, &$form_state) module_load_include('inc', 'field_ui', 'field_ui.admin'); $formatter_options = field_ui_formatter_options($field['type']); + $field_label_options = array( + 'title' => t('Pane title'), + 'above' => t('Above'), + 'inline' => t('Inline'), + 'hidden' => t('Hidden'), + ); + + $form['label'] = array( + '#type' => 'select', + '#title' => t('Label'), + '#options' => $field_label_options, + '#default_value' => $conf['label'], + ); + $form['formatter'] = array( '#type' => 'select', '#title' => t('Select a formatter'), @@ -127,6 +171,7 @@ function ctools_entity_field_content_type_formatter_options($form, &$form_state) function ctools_entity_field_content_type_formatter_options_submit($form, &$form_state) { $form_state['conf']['formatter'] = $form_state['values']['formatter']; + $form_state['conf']['label'] = $form_state['values']['label']; } function ctools_entity_field_content_type_formatter_styles($form, &$form_state) { @@ -155,7 +200,7 @@ function ctools_entity_field_content_type_formatter_styles_submit($form, &$form_ foreach ($formatter_info as $info) { if (!empty($info['settings'])) { foreach ($info['settings'] as $field_name => $value) { - if (!empty($form_state['values'][$field_name])) { + if (isset($form_state['values'][$field_name])) { $form_state['conf']['formatter_settings'][$field_name] = $form_state['values'][$field_name]; } } @@ -167,5 +212,7 @@ function ctools_entity_field_content_type_formatter_styles_submit($form, &$form_ * Returns the administrative title for a type. */ function ctools_entity_field_content_type_admin_title($subtype, $conf, $context) { - return t('"@s" @field', array('@s' => $context->identifier, '@field' => $subtype)); + list($bundle, $field_name) = explode(':', $subtype); + ctools_include('fields'); + return t('"@s" @field', array('@s' => $context->identifier, '@field' => ctools_field_label($field_name))); } diff --git a/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc b/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc new file mode 100644 index 00000000..3905a310 --- /dev/null +++ b/sites/all/modules/ctools/plugins/content_types/form/entity_form_field.inc @@ -0,0 +1,114 @@ +<?php + +/** + * @file + * Handle rendering entity fields as panes. + */ + +$plugin = array( + 'title' => t('Entity field'), + 'defaults' => array('label' => '', 'formatter' => ''), + 'content type' => 'ctools_entity_form_field_content_type_content_type', +); + +/** + * Just one subtype. + * + * Ordinarily this function is meant to get just one subtype. However, we are + * using it to deal with the fact that we have changed the subtype names. This + * lets us translate the name properly. + */ +function ctools_entity_form_field_content_type_content_type($subtype) { + $types = ctools_entity_form_field_content_type_content_types(); + if (isset($types[$subtype])) { + return $types[$subtype]; + } +} + +/** + * Return all field content types available. + */ +function ctools_entity_form_field_content_type_content_types() { + // This will hold all the individual field content types. + $types = array(); + $content_types = array(); + $entities = entity_get_info(); + + foreach ($entities as $entity_type => $entity) { + foreach ($entity['bundles'] as $type => $bundle) { + foreach (field_info_instances($entity_type, $type) as $field_name => $field) { + if (!isset($types[$entity_type . ':' . $field_name])) { + $types[$entity_type . ':' . $field_name] = array( + 'category' => t('Form'), + 'icon' => 'icon_field.png', + 'title' => t('Field form: @widget_label', array( + '@widget_label' => t($field['label']), + )), + 'description' => t('Field on the referenced entity.'), + ); + } + $content_types[$entity_type . ':' . $field_name]['types'][$type] = $bundle['label']; + } + } + } + + // Create the required context for each field related to the bundle types. + foreach ($types as $key => $field_content_type) { + list($entity_type, $field_name) = explode(':', $key, 2); + $types[$key]['required context'] = new ctools_context_required(t(ucfirst($entity_type)), $entity_type, array( + 'form' => array('form'), + 'type' => array_keys($content_types[$key]['types']), + )); + unset($content_types[$key]['types']); + } + return $types; +} + +/** +* Render the custom content type. +*/ +function ctools_entity_form_field_content_type_render($subtype, $conf, $panel_args, $context) { + if (empty($context) || empty($context->data)) { + return; + } + + // Get a shortcut to the entity. + $entity = $context->data; + list($entity_type, $field_name) = explode(':', $subtype, 2); + + // Load the entity type's information for this field. + $ids = entity_extract_ids($entity_type, $entity); + $field = field_info_instance($entity_type, $field_name, $ids[2]); + + // Do not render if the entity type does not have this field. + if (empty($field)) { + return; + } + + if (isset($context->form)) { + $block->content[$field_name] = $context->form[$field_name]; + unset($context->form[$field_name]); + } + else { + $block->content = t('Entity info.'); + } + return $block; + + return $block; +} + +/** +* Returns the administrative title for a type. +*/ +function ctools_entity_form_field_content_type_admin_title($subtype, $conf, $context) { + list($entity_type, $field_name) = explode(':', $subtype, 2); + + $field = field_info_instance($entity_type, $field_name, $context->restrictions['type'][0]); + + return t('"@s" @field form', array('@s' => $context->identifier, '@field' => $field['label'])); +} + +function ctools_entity_form_field_content_type_edit_form($form, &$form_state) { + // provide a blank form so we have a place to have context setting. + return $form; +} diff --git a/sites/all/modules/ctools/plugins/content_types/form/form.inc b/sites/all/modules/ctools/plugins/content_types/form/form.inc index 4fb0380c..c6cd6840 100644 --- a/sites/all/modules/ctools/plugins/content_types/form/form.inc +++ b/sites/all/modules/ctools/plugins/content_types/form/form.inc @@ -1,5 +1,4 @@ <?php -// $Id: form.inc,v 1.3 2010/10/11 22:18:24 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -26,15 +25,12 @@ function ctools_form_content_type_render($subtype, $conf, $panel_args, &$context if (isset($context->form)) { $block->title = $context->form_title; - if (!empty($context->form_id)) { - // If this is a form, drupal_render it. - $block->content = drupal_render($context->form); - } - else { - // Otherwise just spit back what we were given. This is probably an - // error message or something. - $block->content = $context->form; + $block->content = array(); + foreach (element_children($context->form) as $element) { + $block->content[$element] = $context->form[$element]; + unset($context->form[$element]); } + $block->delta = $context->form_id; } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node/node.inc b/sites/all/modules/ctools/plugins/content_types/node/node.inc index 33a24ae3..2722a195 100644 --- a/sites/all/modules/ctools/plugins/content_types/node/node.inc +++ b/sites/all/modules/ctools/plugins/content_types/node/node.inc @@ -1,5 +1,4 @@ <?php -// $Id: node.inc,v 1.11 2010/12/31 21:09:56 merlinofchaos Exp $ /** * @file @@ -51,7 +50,7 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) { // Support node translation if (module_exists('translation')) { if ($translations = module_invoke('translation', 'node_get_translations', $nid)) { - if ($translations[$GLOBALS['language']->language]) { + if (isset($translations[$GLOBALS['language']->language])) { $nid = $translations[$GLOBALS['language']->language]->nid; } } @@ -66,6 +65,10 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) { return; } + // Don't store viewed node data on the node, this can mess up other + // views of the node. + $node = clone($node); + $block->module = 'node'; $block->delta = $node->nid; @@ -81,7 +84,7 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) { } if (!empty($conf['identifier'])) { - $node->panel_identifier = $conf['identifier']; + $node->ctools_template_identifier = $conf['identifier']; } // Handle existing configurations with the deprecated 'teaser' option. @@ -90,6 +93,12 @@ function ctools_node_content_type_render($subtype, $conf, $panel_args) { } $block->content = node_view($node, $conf['build_mode']); + + // Hide links if they've been suppressed. + if (empty($conf['links'])) { + $block->content['links']['#access'] = FALSE; + } + return $block; } @@ -143,7 +152,7 @@ function ctools_node_content_type_edit_form($form, &$form_state) { '#type' => 'textfield', '#default_value' => !empty($conf['identifier']) ? $conf['identifier'] : '', '#title' => t('Template identifier'), - '#description' => t('This identifier will be added as a template suggestion to display this node: node-panel-IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'), + '#description' => t('This identifier will be added as a template suggestion to display this node: node--panel--IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'), ); $entity = entity_get_info('node'); @@ -178,19 +187,19 @@ function ctools_node_content_type_edit_form_validate(&$form, &$form_state) { $nid = $form_state['values']['nid']; $preg_matches = array(); - $match = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches); + $match = preg_match('/\[id: (\d+)\]/', $nid, $preg_matches); if (!$match) { - $match = preg_match('/^nid: (\d+)/', $nid, $preg_matches); + $match = preg_match('/^id: (\d+)/', $nid, $preg_matches); } if ($match) { $nid = $preg_matches[1]; } if (is_numeric($nid)) { - $node = db_query('SELECT nid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject(); + $node = db_query('SELECT nid, status FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject(); } else { - $node = db_query('SELECT nid FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject(); + $node = db_query('SELECT nid, status FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject(); } if ($node) { $form_state['values']['nid'] = $node->nid; @@ -222,7 +231,7 @@ function ctools_node_content_type_admin_title($subtype, $conf) { $node = node_load($conf['nid']); if ($node) { - if (!empty($data->status) || user_access('administer nodes')) { + if (!empty($node->status) || user_access('administer nodes')) { return check_plain($node->title); } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc index 97eb6aa0..380e2604 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_attachments.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_attachments.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc index 75f5376c..e98ce5ac 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_author.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_author.inc,v 1.6 2011/01/02 16:44:11 merlinofchaos Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -33,7 +32,7 @@ function ctools_node_author_content_type_render($subtype, $conf, $panel_args, $c $block = new stdClass(); $block->module = 'node_author'; $block->title = t('Author'); - $block->content = !empty($conf['link']) ? theme('username', array('account' => $user, 'link_path' => 'user/'. $node->uid)) : check_plain(format_username($node)); + $block->content = !empty($conf['link']) ? theme('username', array('account' => $user, 'link_path' => 'user/' . $node->uid)) : check_plain(format_username($node)); $block->delta = $node->nid; return $block; diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc index 0923c988..3e69560a 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_body.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_body.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -12,37 +11,17 @@ $plugin = array( 'description' => t('The body of the referenced node.'), 'required context' => new ctools_context_required(t('Node'), 'node'), 'category' => t('Node'), + 'no ui' => TRUE, ); /** * Render the custom content type. */ function ctools_node_body_content_type_render($subtype, $conf, $panel_args, $context) { - if (empty($context) || empty($context->data)) { - return; - } - - // Get a shortcut to the node. - $node = $context->data; - - // Load information about the node type. - $type = node_type_get_type($node); - - // Do not render if the body is disabled for this node type. - if (!$type->has_body) { - return; - } - - $body = str_replace('<!--break-->', '', $node->body); - - // Build the content type block. - $block = new stdClass(); - $block->module = 'node_body'; - $block->title = $type->body_label; - $block->content = check_markup($body, $node->format, FALSE); - $block->delta = $node->nid; - - return $block; + $plugin = ctools_get_content_type('entity_field'); + $conf['formatter'] = 'text_default'; + $conf['formatter_settings'] = array(); + return $plugin['render callback']('node:body', $conf, $panel_args, $context); } /** diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc index 33367192..5d017c5c 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_children.inc @@ -16,7 +16,7 @@ if (module_exists('book')) { } function ctools_node_book_children_content_type_render($subtype, $conf, $panel_args, $context) { - $node = isset($context->data) ? drupal_clone($context->data) : NULL; + $node = isset($context->data) ? clone($context->data) : NULL; $block = new stdClass(); $block->module = 'book_children'; diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc index 9b93a6bf..6c0d50df 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_book_nav.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_book_nav.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ if (module_exists('book')) { /** @@ -23,7 +22,7 @@ function ctools_node_book_nav_content_type_render($subtype, $conf, $panel_args, $block->title = t('Book navigation'); if ($node) { - $block->content = isset($node->book) ? theme('book_navigation', $node->book) : ''; + $block->content = isset($node->book) ? theme('book_navigation', array('book_link' => $node->book)) : ''; $block->delta = $node->nid; } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc index 6706e450..b1aa2fb4 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_comment_form.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_comment_form.inc,v 1.6 2010/12/31 21:16:51 merlinofchaos Exp $ if (module_exists('comment')) { /** @@ -13,7 +12,7 @@ if (module_exists('comment')) { 'description' => t('A form to add a new comment.'), 'required context' => new ctools_context_required(t('Node'), 'node'), 'category' => t('Node'), - 'defaults' => array('anon_links' => false), + 'defaults' => array('anon_links' => FALSE), ); } @@ -42,7 +41,7 @@ function ctools_node_comment_form_content_type_render($subtype, $conf, $panel_ar ), ), ); - $block->content = drupal_build_form('comment_node_'. $node->type .'_form', $form_state); + $block->content = drupal_build_form('comment_node_' . $node->type . '_form', $form_state); } else if (!empty($conf['anon_links'])) { $block->content = theme('comment_post_forbidden', array('node' => $node)); diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc index 5aa97705..47176ea0 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_comments.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_comments.inc,v 1.9 2010/12/31 21:04:28 merlinofchaos Exp $ if (module_exists('comment')) { /** @@ -119,7 +118,7 @@ function ctools_comment_render($node, $conf) { $comments = comment_load_multiple($cids); if ($comments) { - drupal_add_css(drupal_get_path('module', 'comment') .'/comment.css'); + drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css'); comment_prepare_thread($comments); $build = comment_view_multiple($comments, $node); $build['pager']['#theme'] = 'pager'; diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc index a4a49f33..38c5b574 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_content.inc,v 1.9 2010/12/31 21:05:24 merlinofchaos Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -44,7 +43,7 @@ function ctools_node_content_content_type_render($subtype, $conf, $panel_args, $ } else { if (!empty($conf['identifier'])) { - $node->panel_identifier = $conf['identifier']; + $node->ctools_template_identifier = $conf['identifier']; } $block->title = $node->title; @@ -99,8 +98,9 @@ function ctools_node_content_render_node($node, $conf) { if (empty($conf['no_extras'])) { // Allow modules to make their own additions to the node. - module_invoke_all('node_view', $node, $conf['build_mode']); - module_invoke_all('entity_view', $node, 'node', $conf['build_mode']); + $langcode = $GLOBALS['language_content']->language; + module_invoke_all('node_view', $node, $conf['build_mode'], $langcode); + module_invoke_all('entity_view', $node, 'node', $conf['build_mode'], $langcode); } } @@ -171,7 +171,7 @@ function ctools_node_content_content_type_edit_form($form, &$form_state) { '#type' => 'textfield', '#default_value' => $conf['identifier'], '#title' => t('Template identifier'), - '#description' => t('This identifier will be added as a template suggestion to display this node: node-panel-IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'), + '#description' => t('This identifier will be added as a template suggestion to display this node: node--panel--IDENTIFIER.tpl.php. Please see the Drupal theming guide for information about template suggestions.'), ); $entity = entity_get_info('node'); diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc index 789d6c86..41c8b83d 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_created.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_created.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc index a2da7b22..6096a44f 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_links.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_links.inc,v 1.6 2010/12/31 21:06:18 merlinofchaos Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -87,7 +86,7 @@ function ctools_node_links_content_type_edit_form($form, &$form_state) { '#type' => 'textfield', '#default_value' => $conf['identifier'], '#title' => t('Identifier'), - '#description' => t('Whatever is placed here will appear in $node->panel_identifier to help theme node links displayed on the panel'), + '#description' => t('Whatever is placed here will appear in @identifier, to help theme node links displayed on the panel', array('@identifier' => $node->panel_identifier)), ); return $form; diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc index 55620065..6cb5e7ce 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_terms.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_terms.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -31,29 +30,41 @@ function ctools_node_terms_content_type_render($subtype, $conf, $panel_args, $co // Get a shortcut to the node. $node = $context->data; - if (empty($node->taxonomy)) { - return; + // Load all terms for this node from all vocabularies + $query = db_select('taxonomy_index', 't'); + $result = $query + ->fields('t') + ->condition('t.nid', $node->nid) + ->execute(); + + $tids = array(); + foreach ($result AS $term) { + $tids[] = $term->tid; } - $formatted_terms = ''; - if (empty($conf['vid']) && $conf['term_format'] == 'term-links') { - // They want all terms, formatted as term links, so we can just use - // taxonomy_link() directly. - $terms = taxonomy_link('taxonomy terms', $node); - $formatted_terms = theme('links', $terms); + // Get the real term objects + $term_objects = taxonomy_term_load_multiple($tids); + + $terms = array(); + + if (empty($conf['vid'])) { + // All terms. + foreach ($term_objects AS $term) { + $terms['taxonomy_term_' . $term->tid] = array( + 'title' => check_plain($term->name), + 'href' => 'taxonomy/term/' . $term->tid, + 'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)) + ); + } } else { // They want something special and custom, we'll have to do this ourselves. - $terms = array(); - foreach ($context->data->taxonomy as $term) { - if (empty($conf['vid']) || $term->vid == $conf['vid']) { + foreach ($term_objects as $term) { + if ($term->vid == $conf['vid']) { if ($conf['term_format'] == 'term-links') { - // We have to do this manually since taxonomy_link() doesn't let you - // filter by vocabulary, so we just replicate it for the subset of - // terms matching the requested vid. $terms['taxonomy_term_' . $term->tid] = array( 'title' => $term->name, - 'href' => taxonomy_term_path($term), + 'href' => 'taxonomy/term/' . $term->tid, 'attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)), ); } @@ -61,29 +72,31 @@ function ctools_node_terms_content_type_render($subtype, $conf, $panel_args, $co $terms[] = check_plain($term->name); } else { - $terms[] = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)))); + $terms[] = l($term->name, 'taxonomy/term/' . $term->tid, array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)))); } } } + } - switch ($conf['term_format']) { - case 'term-links': - // Since we didn't use taxonomy_link() directly, we need to invoke - // hook_link_alter() for this to work as sites will expect. - drupal_alter('link', $terms, $node); - $formatted_terms = theme('links', $terms); - break; - - case 'ul': - $formatted_terms = theme('item_list', $terms); - break; - - case 'inline-delimited': - $delimiter = isset($conf['term_delimiter']) ? $conf['term_delimiter'] : ', '; - $formatted_terms = implode($delimiter, $terms); - break; - - } + $formatted_terms = ''; + switch ($conf['term_format']) { + case 'term-links': + drupal_alter('link', $terms, $node); + $formatted_terms = theme('links', $terms); + break; + + case 'ul': + $formatted_terms = theme('item_list', $terms); + break; + + case 'inline-delimited': + $term_names = array(); + foreach ($terms AS $term) { + $term_names[] = $term['title']; + } + $delimiter = isset($conf['term_delimiter']) ? $conf['term_delimiter'] : ', '; + $formatted_terms = implode($delimiter, $term_names); + break; } // Build the content type block. @@ -147,7 +160,6 @@ function ctools_node_terms_content_type_edit_form($form, &$form_state) { '#type' => 'checkbox', '#default_value' => $conf['link'], '#description' => t('Check here to make the terms link to the term paths.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:term_format' => array('inline-delimited', 'ul')), '#prefix' => '<div class="clearfix">', '#suffix' => '</div>', @@ -158,7 +170,6 @@ function ctools_node_terms_content_type_edit_form($form, &$form_state) { '#title' => t('Term delimiter'), '#default_value' => $conf['term_delimiter'], '#size' => 10, - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:term_format' => array('inline-delimited')), ); return $form; diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc index ef31a537..6a52306b 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_title.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_title.inc,v 1.5 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -35,7 +34,7 @@ function ctools_node_title_content_type_render($subtype, $conf, $panel_args, $co $block = new stdClass(); $block->module = 'node_title'; $block->title = $type->title_label; - $block->content = !empty($conf['link']) ? l($node->title, 'node/'. $node->nid) : check_plain($node->title); + $block->content = !empty($conf['link']) ? l($node->title, 'node/' . $node->nid) : check_plain($node->title); $block->delta = $node->nid; return $block; diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc index f1aff821..f2005d08 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_type_desc.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_type_desc.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used diff --git a/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc b/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc index a38a2089..076eb06e 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_context/node_updated.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_updated.inc,v 1.5 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc index 01d3f634..1e248f50 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_attachments.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ if (module_exists('upload')) { /** @@ -24,10 +23,16 @@ function ctools_node_form_attachments_content_type_render($subtype, $conf, $pane $block->delta = 'url-path-options'; if (isset($context->form)) { - if (!empty($context->form['form_id']) && !empty($context->form['attachments']['#access'])) { - // remove the fieldset - unset($context->form['attachments']['#type']); - $block->content = drupal_render($context->form['attachments']); + if (isset($context->form['attachments'])) { + $block->content = $context->form['attachments']; + if (isset($block->content['attachments']['#group'])) { + unset($block->content['attachments']['#pre_render']); + unset($block->content['attachments']['#theme_wrappers']); + $block->content['attachments']['#type'] = ''; + } + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['attachments']['#access'] = FALSE; } } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc index 507acd87..5cb6a344 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_author.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -22,12 +21,19 @@ function ctools_node_form_author_content_type_render($subtype, $conf, $panel_arg $block->delta = 'author-options'; if (isset($context->form)) { - if (!empty($context->form['form_id']) && !empty($context->form['author']['#access'])) { - // remove the fieldset - unset($context->form['author']['#type']); - $context->form['author']['name']['#size'] /= 2; - $context->form['author']['date']['#size'] /= 2; - $block->content = drupal_render($context->form['author']); + if (!empty($context->form['author'])) { + $block->content['author'] = $context->form['author']; + if (isset($block->content['author']['#group'])) { + unset($block->content['author']['#pre_render']); + unset($block->content['author']['#theme_wrappers']); + $block->content['author']['#type'] = ''; + $block->content['author']['name']['#size'] /= 2; + $block->content['author']['date']['#size'] /= 2; + } + + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['author']['#access'] = FALSE; } } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc index f6c24cbb..ad19590f 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_book.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ if (module_exists('book')) { /** @@ -20,18 +19,19 @@ function ctools_node_form_book_content_type_render($subtype, $conf, $panel_args, $block = new stdClass(); $block->module = t('node_form'); - $block->title = t('Book options'); - $block->delta = 'book-options'; + $block->title = t('Book outline'); + $block->delta = 'book-outline'; if (isset($context->form)) { - if (!empty($context->form['form_id'])) { - $block->content = ''; - if ($context->form['parent']['#type'] != 'value') { - $block->content .= drupal_render($context->form['parent']); - } - if ($context->form['weight']['#type'] != 'value') { - $block->content .= drupal_render($context->form['weight']); - } + if (isset($context->form['book'])) { + $block->content['book'] = $context->form['book']; + unset($block->content['book']['#pre_render']); + unset($block->content['book']['#theme_wrappers']); + $block->content['book']['#type'] = ''; + + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['book']['#access'] = FALSE; } } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc index 78bb9965..a7817a07 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_buttons.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -22,10 +21,11 @@ function ctools_node_form_buttons_content_type_render($subtype, $conf, $panel_ar $block->delta = 'buttons'; if (isset($context->form)) { - $block->content = drupal_render($context->form['buttons']); - $block->content .= drupal_render($context->form['form_token']); - $block->content .= drupal_render($context->form['form_build_id']); - $block->content .= drupal_render($context->form['form_id']); + $block->content = array(); + foreach (array('actions', 'form_token', 'form_build_id', 'form_id') as $element) { + $block->content[$element] = $context->form[$element]; + unset($context->form[$element]); + } } else { $block->content = t('Node form buttons.'); diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc index 0b3e1cba..d0f137ae 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_comment.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ if (module_exists('comment')) { /** @@ -24,10 +23,15 @@ function ctools_node_form_comment_content_type_render($subtype, $conf, $panel_ar $block->delta = 'comment-options'; if (isset($context->form)) { - if (!empty($context->form['form_id']) && !empty($context->form['comment_settings']['#access'])) { - // remove the fieldset - unset($context->form['comment_settings']['#type']); - $block->content = drupal_render($context->form['comment_settings']); + if (isset($context->form['comment_settings'])) { + $block->content['comment_settings'] = $context->form['comment_settings']; + unset($block->content['comment_settings']['#pre_render']); + unset($block->content['comment_settings']['#theme_wrappers']); + $block->content['comment_settings']['#type'] = ''; + + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['comment_settings']['#access'] = FALSE; } } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc index 0dfe7402..334ff540 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_log.inc,v 1.3 2010/10/11 22:18:23 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -17,8 +16,23 @@ $plugin = array( function ctools_node_form_log_content_type_render($subtype, $conf, $panel_args, &$context) { $block = new stdClass(); $block->module = t('node_form'); + $block->title = t('Revision information'); - // @todo -- this was never implemented!? + if (isset($context->form)) { + if (isset($context->form['revision_information'])) { + $block->content['revision_information'] = $context->form['revision_information']; + unset($block->content['revision_information']['#pre_render']); + unset($block->content['revision_information']['#theme_wrappers']); + $block->content['revision_information']['#type'] = ''; + + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['revision_information']['#access'] = FALSE; + } + } + else { + $block->content = t('Revision information.'); + } return $block; } diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc index d5ef59d5..906ade4d 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_menu.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ if (module_exists('menu')) { /** @@ -24,11 +23,15 @@ function ctools_node_form_menu_content_type_render($subtype, $conf, $panel_args, $block->delta = 'menu-options'; if (isset($context->form)) { - if (!empty($context->form['form_id']) && !empty($context->form['menu']['#access'])) { - // remove the fieldset - unset($context->form['menu']['#type']); - $context->form['menu']['link_title']['#size'] /= 2; - $block->content = drupal_render($context->form['menu']); + if (isset($context->form['menu'])) { + $block->content['menu'] = $context->form['menu']; + unset($block->content['menu']['#pre_render']); + unset($block->content['menu']['#theme_wrappers']); + $block->content['menu']['#type'] = ''; + + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['menu']['#access'] = FALSE; } } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc index f47e9973..00759007 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_path.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ if (module_exists('path')) { /** @@ -24,11 +23,16 @@ function ctools_node_form_path_content_type_render($subtype, $conf, $panel_args, $block->delta = 'url-path-options'; if (isset($context->form)) { - if (!empty($context->form['form_id']) && !empty($context->form['path']['#access'])) { - // remove the fieldset - unset($context->form['path']['#type']); - $context->form['path']['path']['#size'] /= 2; - $block->content = drupal_render($context->form['path']); + if (isset($context->form['path'])) { + $block->content['path'] = $context->form['path']; + unset($block->content['path']['#pre_render']); + unset($block->content['path']['#theme_wrappers']); + $block->content['path']['#type'] = ''; + $block->content['path']['path']['#size'] /= 2; + + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['path']['#access'] = FALSE; } } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc index a45160f2..3f3cf25d 100644 --- a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_form_publishing.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ /** * @file @@ -28,10 +27,15 @@ function ctools_node_form_publishing_content_type_render($subtype, $conf, $panel $block->delta = 'publishing-options'; if (isset($context->form)) { - if (!empty($context->form['form_id']) && $context->form['options']['#type'] == 'fieldset') { - // remove the fieldset - unset($context->form['options']['#type']); - $block->content = drupal_render($context->form['options']); + if (isset($context->form['options'])) { + $block->content['options'] = $context->form['options']; + unset($block->content['options']['#pre_render']); + unset($block->content['options']['#theme_wrappers']); + $block->content['options']['#type'] = ''; + + // Set access to false on the original rather than removing so that + // vertical tabs doesn't clone it. I think this is due to references. + $context->form['options']['#access'] = FALSE; } } else { diff --git a/sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc new file mode 100644 index 00000000..f40d274d --- /dev/null +++ b/sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc @@ -0,0 +1,41 @@ +<?php + +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'single' => TRUE, + 'icon' => 'icon_node_form.png', + 'title' => t('Node form title field'), + 'description' => t('The node title form.'), + 'required context' => new ctools_context_required(t('Form'), 'node_form'), + 'category' => t('Form'), +); + +function ctools_node_form_title_content_type_render($subtype, $conf, $panel_args, &$context) { + $block = new stdClass(); + $block->module = t('node_form'); + + $block->delta = 'title-options'; + + if (isset($context->form)) { + if (!empty($context->form['title'])) { + $block->content['title'] = $context->form['title']; + unset($context->form['title']); + } + } + else { + $block->content = t('Node title form.'); + } + return $block; +} + +function ctools_node_form_title_content_type_admin_title($subtype, $conf, $context) { + return t('"@s" node form title field', array('@s' => $context->identifier)); +} + +function ctools_node_form_title_content_type_edit_form($form, &$form_state) { + // provide a blank form so we have a place to have context setting. + return $form; +} diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc b/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc index 56dabd05..f5a060ef 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_breadcrumb.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_breadcrumb.inc,v 1.4 2010/12/31 21:20:57 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc b/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc index e7a38018..0dba317d 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_feed_icons.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_feed_icons.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_help.inc b/sites/all/modules/ctools/plugins/content_types/page/page_help.inc index a813301f..da1abe69 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_help.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_help.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_help.inc,v 1.3 2010/09/07 09:02:51 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc b/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc index 589c989e..c00ca5e8 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_logo.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_logo.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -27,8 +26,9 @@ $plugin = array( */ function ctools_page_logo_content_type_render($subtype, $conf, $panel_args) { $logo = theme_get_setting('logo'); + $block = new stdClass(); + if (!empty($logo)) { - $block = new stdClass(); $image = '<img src="' . $logo . '" alt="' . t('Home') . '" />'; $block->content = l($image, '', array('html' => TRUE, 'attributes' => array('rel' => 'home', 'id' => 'logo', 'title' => t('Home')))); } diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc b/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc index e9bbfee2..e2fe37b3 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_messages.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_messages.inc,v 1.3 2010/09/07 09:02:51 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc b/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc index 6b0bc9d1..54fb97c9 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_primary_links.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_primary_links.inc,v 1.3 2010/12/31 21:21:39 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc b/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc index 548c82d5..3d13b1e3 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_secondary_links.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_secondary_links.inc,v 1.3 2010/12/31 21:22:26 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc b/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc index 306b0f6f..99501f2c 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_site_name.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_site_name.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc b/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc index e46a9903..58f913f6 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_slogan.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_slogan.inc,v 1.3 2010/09/07 09:02:51 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc b/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc index 042520fb..62a26437 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_tabs.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_tabs.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -31,7 +30,21 @@ $plugin = array( */ function ctools_page_tabs_content_type_render($subtype, $conf, $panel_args) { $block = new stdClass(); - $block->content = theme('menu_local_tasks'); + $menus = menu_local_tabs(); + switch ($conf['type']) { + case 'primary': + unset($menus['#secondary']); + break; + case 'secondary': + unset($menus['#primary']); + break; + } + if ($conf['id']) { + $menus['#theme_wrappers'][] = 'container'; + $menus['#attributes']['id'] = $conf['id']; + } + + $block->content = $menus; return $block; } diff --git a/sites/all/modules/ctools/plugins/content_types/page/page_title.inc b/sites/all/modules/ctools/plugins/content_types/page/page_title.inc index 4fa21009..e3032dfb 100644 --- a/sites/all/modules/ctools/plugins/content_types/page/page_title.inc +++ b/sites/all/modules/ctools/plugins/content_types/page/page_title.inc @@ -1,5 +1,4 @@ <?php -// $Id: page_title.inc,v 1.4 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/content_types/search/search_form.inc b/sites/all/modules/ctools/plugins/content_types/search/search_form.inc index 4e136465..2b6a322b 100644 --- a/sites/all/modules/ctools/plugins/content_types/search/search_form.inc +++ b/sites/all/modules/ctools/plugins/content_types/search/search_form.inc @@ -1,5 +1,4 @@ <?php -// $Id: search_form.inc,v 1.5 2010/12/31 21:24:40 merlinofchaos Exp $ if (module_exists('search')) { /** @@ -58,7 +57,6 @@ function ctools_search_form_content_type_render($subtype, $conf, $panel_args, $c $prompt = $conf['override_prompt'] ? $conf['prompt'] : NULL; $form_state = array( - 'no_redirect' => TRUE, 'build_info' => array( 'args' => array($path, $keys, $conf['type'], $prompt), ), @@ -66,13 +64,9 @@ function ctools_search_form_content_type_render($subtype, $conf, $panel_args, $c module_load_include('inc', 'search', 'search.pages'); - $form_id = $conf['form'] == 'simple' ? 'ctools_search_form' : 'search_form'; - $block->content = drupal_build_form($form_id, $form_state); - - // We do the redirect manually because the built in search form is stupid - // and won't redirect even though action is a valid argument for it. - if (empty($block->content)) { - drupal_goto($path . '/' . $form_state['values']['processed_keys']); + $block->content = drupal_build_form('search_form', $form_state); + if ($conf['form'] == 'simple' && isset($block->content['advanced'])) { + $block->content['advanced']['#access'] = FALSE; } return $block; @@ -85,8 +79,8 @@ function ctools_search_form_content_type_edit_form($form, &$form_state) { $conf = $form_state['conf']; $types = array(); - foreach (module_implements('search') as $name) { - $types[$name] = module_invoke($name, 'search', 'name', TRUE); + foreach (search_get_info() as $module => $info) { + $types[$module] = $info['title']; } $form['type'] = array( @@ -122,7 +116,6 @@ function ctools_search_form_content_type_edit_form($form, &$form_state) { $form['path'] = array( '#type' => 'textfield', '#default_value' => $conf['path'], - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-path-type' => array('custom')), '#suffix' => '</div>', ); @@ -137,7 +130,6 @@ function ctools_search_form_content_type_edit_form($form, &$form_state) { $form['prompt'] = array( '#type' => 'textfield', '#default_value' => $conf['prompt'], - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-override-prompt' => array(1)), '#suffix' => '</div>', ); @@ -158,14 +150,7 @@ function ctools_search_form_content_type_edit_form_submit($form, &$form_state) { * Returns the administrative title for a type. */ function ctools_search_form_content_type_admin_title($subtype, $conf, $context) { - $type = module_invoke($conf['type'], 'search', 'name', TRUE); + $info = search_get_info(); + $type = isset($info[$conf['type']]['title']) ? $info[$conf['type']]['title'] : t('Missing/broken type'); return t('@type search form', array('@type' => $type)); } - -/** - * Form alter the submit/validate onto our customized search form. - */ -function ctools_form_ctools_search_form_alter(&$form, &$form_state) { - $form['#validate'] = array('search_form_validate'); - $form['#submit'] = array('search_form_submit'); -} diff --git a/sites/all/modules/ctools/plugins/content_types/search/search_result.inc b/sites/all/modules/ctools/plugins/content_types/search/search_result.inc index 02684ea9..44cfbac5 100644 --- a/sites/all/modules/ctools/plugins/content_types/search/search_result.inc +++ b/sites/all/modules/ctools/plugins/content_types/search/search_result.inc @@ -1,5 +1,4 @@ <?php -// $Id: search_result.inc,v 1.7 2010/10/11 22:18:24 sdboyer Exp $ if (module_exists('search')) { /** @@ -32,8 +31,25 @@ if (module_exists('search')) { * Render the custom content type. */ function ctools_search_result_content_type_render($subtype, $conf, $panel_args, $context) { + $search_info = search_get_info(); + if (empty($search_info[$conf['type']])) { + return; + } + $info = $search_info[$conf['type']]; + + $keys = NULL; + if (!empty($context) && isset($context->data)) { + $keys = $context->data; + } + + $conditions = NULL; + if (isset($info['conditions_callback']) && function_exists($info['conditions_callback'])) { + // Build an optional array of more search conditions. + $conditions = $info['conditions_callback']($keys); + } + // Display nothing at all if no keywords were entered. - if (empty($context) || empty($context->data)) { + if (empty($keys) && empty($conditions)) { if (!empty($conf['override_no_key'])) { $block->title = $conf['no_key_title']; $block->content = check_markup($conf['no_key'], $conf['no_key_format'], FALSE); @@ -42,8 +58,6 @@ function ctools_search_result_content_type_render($subtype, $conf, $panel_args, return; } - $keys = $context->data; - // Build the content type block. $block = new stdClass(); $block->module = 'search'; @@ -51,20 +65,31 @@ function ctools_search_result_content_type_render($subtype, $conf, $panel_args, $results = ''; - // Need settings for: - // $no result override + // Only search if there are keywords or non-empty conditions. + if ($keys || !empty($conditions)) { + + // Collect the search results. + $results = search_data($keys, $info['module'], $conditions); + } if (!empty($conf['log'])) { // Log the search keys: - watchdog('search', '%keys (@type).', array('%keys' => $keys, '@type' => module_invoke($conf['type'], 'search', 'name')), WATCHDOG_NOTICE, l(t('results'), $_GET['q'])); + watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), WATCHDOG_NOTICE, l(t('results'), $_GET['q'])); } // Collect the search results: - $results = search_data($keys, $conf['type']); + $results = search_data($keys, $conf['type'], $conditions); + + if (!empty($results['#results'])) { + $output = "<ol class=\"search-results $conf[type]-results\">\n"; + foreach ($results['#results'] as $result) { + $output .= theme('search_result', array('result' => $result, 'module' => $conf['type'])); + } + $output .= "</ol>\n"; + $output .= theme('pager', array('tags' => NULL)); - if ($results) { $block->title = t('Search results'); - $block->content = $results; + $block->content = $output; } else { if (empty($conf['override_empty'])) { @@ -86,12 +111,9 @@ function ctools_search_result_content_type_render($subtype, $conf, $panel_args, function ctools_search_result_content_type_edit_form($form, &$form_state) { $conf = $form_state['conf']; - // Add js for collapsible fieldsets manually - drupal_add_js('misc/collapse.js'); - $types = array(); - foreach (module_implements('search') as $name) { - $types[$name] = module_invoke($name, 'search', 'name', TRUE); + foreach (search_get_info() as $module => $info) { + $types[$module] = $info['title']; } $form['type'] = array( @@ -113,74 +135,43 @@ function ctools_search_result_content_type_edit_form($form, &$form_state) { '#title' => t('Override "no result" text'), ); - $form['empty_field']['empty_title'] = array( + $form['empty_title'] = array( '#title' => t('Title'), '#type' => 'textfield', '#default_value' => $conf['empty_title'], - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-override-empty' => array(1)), ); - $form['empty_field']['empty'] = array( + $form['empty_field'] = array( + '#type' => 'text_format', '#title' => t('No result text'), - '#type' => 'textarea', '#default_value' => $conf['empty'], - '#process' => array('ctools_dependent_process'), + '#format' => $conf['empty_format'], '#dependency' => array('edit-override-empty' => array(1)), ); - $form['empty_field']['format_prefix'] = array( - '#type' => 'hidden', - '#id' => 'edit-empty-format', - '#prefix' => '<div><fieldset id="edit-empty-format" class="collapsed collapsible"><legend>' . t('Input format') . '</legend>', - '#process' => array('ctools_dependent_process'), - '#dependency' => array('edit-override-empty' => array(1)), - ); - // Yes, lots of gymnastics to make this fieldset work with dependencies. - $form['empty_field']['empty_format'] = filter_form($conf['empty_format'], NULL, array('empty_format')); - unset($form['empty_field']['empty_format']['#type']); - - $form['empty_field']['format_suffix'] = array( - '#value' => '</fieldset></div>', - ); - - $form['override_no_key'] = array( '#type' => 'checkbox', '#default_value' => $conf['override_no_key'], '#title' => t('Display text if no search keywords were submitted'), ); - $form['no_key_field']['no_key_title'] = array( + + $form['no_key_title'] = array( '#title' => t('Title'), '#type' => 'textfield', '#default_value' => $conf['no_key_title'], - '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-override-no-key' => array(1)), ); - $form['no_key_field']['no_key'] = array( - '#title' => t('No keywords text'), - '#type' => 'textarea', + $form['no_key_field'] = array( + '#type' => 'text_format', + '#title' => t('No result text'), '#default_value' => $conf['no_key'], - '#process' => array('ctools_dependent_process'), - '#dependency' => array('edit-override-no-key' => array(1)), - ); - - $form['no_key_field']['format_prefix'] = array( - '#type' => 'hidden', - '#id' => 'edit-no-key-format', - '#prefix' => '<div><fieldset id="edit-no-key-format" class="collapsed collapsible"><legend>' . t('Input format') . '</legend>', - '#process' => array('ctools_dependent_process'), + '#format' => $conf['no_key_format'], '#dependency' => array('edit-override-no-key' => array(1)), ); - // Yes, lots of gymnastics to make this fieldset work with dependencies. - $form['no_key_field']['no_key_format'] = filter_form($conf['no_key_format'], NULL, array('no_key_format')); - unset($form['no_key_field']['no_key_format']['#type']); - $form['no_key_field']['format_suffix'] = array( - '#value' => '</fieldset></div>', - ); return $form; } @@ -188,6 +179,11 @@ function ctools_search_result_content_type_edit_form($form, &$form_state) { * Submit handler for search form. */ function ctools_search_result_content_type_edit_form_submit($form, &$form_state) { + // Copy the text_format values over to where we normally store them. + $form_state['values']['empty'] = $form_state['values']['empty_field']['value']; + $form_state['values']['empty_format'] = $form_state['values']['empty_field']['format']; + $form_state['values']['no_key'] = $form_state['values']['no_key_field']['value']; + $form_state['values']['no_key_format'] = $form_state['values']['no_key_field']['format']; // Copy everything from our defaults. foreach (array_keys($form_state['plugin']['defaults']) as $key) { $form_state['conf'][$key] = $form_state['values'][$key]; @@ -198,6 +194,7 @@ function ctools_search_result_content_type_edit_form_submit($form, &$form_state) * Returns the administrative title for a type. */ function ctools_search_result_content_type_admin_title($subtype, $conf, $context) { - $type = module_invoke($conf['type'], 'search', 'name', TRUE); + $info = search_get_info(); + $type = isset($info[$conf['type']]['title']) ? $info[$conf['type']]['title'] : t('Missing/broken type'); return t('@type search result', array('@type' => $type)); } diff --git a/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc b/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc index d939c922..dc1d26f0 100644 --- a/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc +++ b/sites/all/modules/ctools/plugins/content_types/term_context/term_description.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_description.inc,v 1.4 2010/10/11 22:18:23 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -10,7 +9,7 @@ $plugin = array( 'title' => t('Term description'), 'icon' => 'icon_term.png', 'description' => t('Term description.'), - 'required context' => new ctools_context_required(t('Term'), 'term'), + 'required context' => new ctools_context_required(t('Term'), array('term', 'taxonomy_term')), 'category' => t('Taxonomy term'), ); diff --git a/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc b/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc index 9fd2865b..c5ea4a6b 100644 --- a/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc +++ b/sites/all/modules/ctools/plugins/content_types/term_context/term_list.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_list.inc,v 1.8 2010/10/11 22:18:23 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -10,19 +9,28 @@ $plugin = array( 'title' => t('List of related terms'), 'icon' => 'icon_term.png', 'description' => t('Terms related to an existing term; may be child, siblings or top level.'), - 'required context' => new ctools_context_required(t('Term'), 'term'), + 'required context' => new ctools_context_required(t('Term'), array('term', 'taxonomy_term')), 'category' => t('Taxonomy term'), - 'defaults' => array('title' => '', 'type' => 'child', 'list_type' => 'ul'), + 'defaults' => array('title' => '', 'type' => 'child', 'list_type' => 'ul', 'path' => 'taxonomy/term'), ); function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $context) { $term = isset($context->data) ? clone($context->data) : NULL; $block = new stdClass(); $block->module = 'term-list'; + $path = empty($conf['path']) ? 'taxonomy/term/%tid' : $conf['path']; + if (strpos($path, '%tid') === FALSE) { + if (substr($path, -1) != '/') { + $path .= '/'; + } + $path .= '%tid'; + } $options = ctools_admin_term_list_options(); + $skip = array(); + if ($term) { - $block->subject = $options[$conf['type']]; + $block->title = $options[$conf['type']]; $block->delta = $conf['type']; switch ($conf['type']) { case 'related': @@ -36,31 +44,40 @@ function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $con break; case 'top': - $terms = taxonomy_get_children(0, $term->vid); + $terms = taxonomy_get_tree($term->vid, 0, 1); + break; + + case 'parent': + $terms = taxonomy_get_parents($term->tid); + $block->title = format_plural(count($terms), 'Parent term', 'Parent terms'); break; case 'sibling': - $parent = db_query('SELECT parent FROM {term_hierarchy} WHERE tid = :tid', array(':tid' => $term->tid))->fetchField(); - $terms = taxonomy_get_children($parent, $term->vid); - // Remove the term that started this. - unset($terms[$term->tid]); + $parent = db_query('SELECT parent FROM {taxonomy_term_hierarchy} WHERE tid = :tid', array(':tid' => $term->tid))->fetchField(); + if ($parent) { + $terms = taxonomy_get_children($parent, $term->vid); + } + else { + $terms = taxonomy_get_tree($term->vid, 0, 1); + } + + $skip[$term->tid] = $term->tid; break; case 'synonyms': - $terms = taxonomy_get_synonyms($term->tid); + // FIXME this no longer exists, must be done with Field API +// $terms = taxonomy_get_synonyms($term->tid); break; } - if ($terms) { + + if (!empty($terms)) { foreach ($terms as $related) { - if (is_object($related)) { - $items[] = l($related->name, taxonomy_term_path($related), array('rel' => 'tag', 'title' => strip_tags($related->description))); - } - else { - $items[] = check_plain($related); + if (empty($skip[$related->tid])) { + $items[] = l($related->name, str_replace('%tid', $related->tid, $path), array('rel' => 'tag', 'title' => strip_tags($related->description))); } } - $block->content = theme('item_list', $items, NULL, $conf['list_type']); + $block->content = theme('item_list', array('items' => $items, 'type' => $conf['list_type'])); } } else { @@ -74,10 +91,11 @@ function ctools_term_list_content_type_render($subtype, $conf, $panel_args, $con function ctools_admin_term_list_options() { return array( 'child' => t('Child terms'), - 'related' => t('Related terms'), + 'related' => t('Related terms (does not work in D7)'), 'sibling' => t('Sibling terms'), 'top' => t('Top level terms'), - 'synonyms' => t('Term synonyms'), + 'synonyms' => t('Term synonyms (does not work in D7)'), + 'parent' => t('Parent term(s)'), ); } @@ -102,6 +120,13 @@ function ctools_term_list_content_type_edit_form($form, &$form_state) { '#options' => array('ul' => t('Unordered'), 'ol' => t('Ordered')), '#default_value' => $conf['list_type'], ); + + $form['path'] = array( + '#type' => 'textfield', + '#title' => t('Path'), + '#default_value' => empty($conf['path']) ? 'taxonomy/term/%tid' : $conf['path'], + '#description' => t('The path to use for the terms. You may use %tid to place the term id as part of the path; if let off, it will be appended to the end.'), + ); return $form; } diff --git a/sites/all/modules/ctools/plugins/content_types/token/icon_token.png b/sites/all/modules/ctools/plugins/content_types/token/icon_token.png new file mode 100644 index 0000000000000000000000000000000000000000..f0417cb6515aa7fb2856c90722b386ed99bfc501 GIT binary patch literal 460 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl;=8&~`zjDUQ}64!{5 z;QX|b^2DN42FH~Aq*MjZ+{E<Mpwz^a%EFVWHb6yD0X`wFE+MINE`9S#t2456o^<}3 zj-i#Dir(tW_tssyv-H%p2QS{7I(h2a%eT+pe}4bz%ad1cEnR}A?LYhN=dY$Udly~( zcH;T(jkkW}PF%M8!OyMteyqCr{ovzY|Ns978vk!K_g5e#R}$nG3>3i)7~V+8!~s>F z^K@|xskoK&Ao2MF5fKqKrozHP$H>SAhNOh)j!aFDHZd?BIiRS_#db+SLGK)kfCJAQ zqeTU>kA$3ffHDdi%#){0m?9#a#K57jfnf&sBX3Sa1{Q(l4Luqi?2o!UJvli+Tm$)4 z3=Ry8tOs@-j1d%!V{BkJBmmUGR=9zogZqi`CnIJS0S|@~)0;j>{+!9k)ZrMzp`^g{ zWb=lCjZ7>85e%#3G!7i+5^!)}RE&#@t221;=y4h|P`{c&LV^GTQ(9VBm>F9G12cn9 XiE#1KH6NpaK4b87^>bP0l+XkKLQcLN literal 0 HcmV?d00001 diff --git a/sites/all/modules/ctools/plugins/content_types/token/token.inc b/sites/all/modules/ctools/plugins/content_types/token/token.inc new file mode 100644 index 00000000..c43abd29 --- /dev/null +++ b/sites/all/modules/ctools/plugins/content_types/token/token.inc @@ -0,0 +1,115 @@ +<?php + +/** + * @file + * Plugin automatically declare 'tokens' as plugins. + */ + +/** + * Plugin decleration. + */ +$plugin = array( + 'title' => t('Tokens'), + 'content type' => 'ctools_token_content_type_content_type', + 'defaults' => array('sanitize' => TRUE), +); + +/** + * Just one subtype. + * + * Ordinarily this function is meant to get just one subtype. However, we are + * using it to deal with the fact that we have changed the subtype names. This + * lets us translate the name properly. + */ +function ctools_token_content_type_content_type($subtype) { + $types = ctools_token_content_type_content_types(); + if (isset($types[$subtype])) { + return $types[$subtype]; + } +} + +/** + * Return all field content types available. + */ +function ctools_token_content_type_content_types() { + // This will hold all the properties. + $types = array(); + $info = token_info(); + + foreach ($info['tokens'] as $entity_type => $tokens) { + foreach ($tokens as $name => $token) { + if (!empty($token['name'])) { + $token += array('description' => ''); + $types[$entity_type . ':' . $name] = array( + 'category' => t('@entity (tokens)', array('@entity' => ucfirst($entity_type))), + 'icon' => 'icon_token.png', + 'title' => $token['name'], + 'description' => $token['description'], + 'required context' => new ctools_context_required(t(ucfirst($entity_type)), $entity_type), + ); + } + } + } + + return $types; +} + +/** +* Render the custom content type. +*/ +function ctools_token_content_type_render($subtype, $conf, $panel_args, $context) { + if (empty($context) || empty($context->data)) { + return FALSE; + } + + $sanitize = $conf['sanitize']; + + $entity = $context->data; + list($entity_type, $name) = explode(':', $subtype, 2); + + $info = token_info(); + $values = token_generate($entity_type, array($name => $name), array($entity_type => $entity), array('sanitize' => $sanitize)); + if (!isset($values[$name])) { + return; + } + + // Build the content type block. + $block = new stdClass(); + $block->module = 'ctools'; + $block->title = $info['tokens'][$entity_type][$name]['name']; + $block->content = $values[$name]; + $block->delta = str_replace('_', '-', $entity_type . '-' . $name); + + return $block; +} + +/** +* Returns an edit form for custom type settings. +*/ +function ctools_token_content_type_edit_form($form, &$form_state) { + $conf = $form_state['conf']; + + $form['sanitize'] = array( + '#type' => 'checkbox', + '#default_value' => !empty($conf['sanitize']), + '#title' => t('Sanitize'), + '#description' => t('When enabled that output of the token will be stripped from dangerous HTML.'), + ); + + return $form; +} + +/** + * Validate the node selection. + */ +function ctools_token_content_type_edit_form_submit($form, &$form_state) { + $form_state['conf']['sanitize'] = $form_state['values']['sanitize']; +} + + +/** +* Returns the administrative title for a type. +*/ +function ctools_token_content_type_admin_title($subtype, $conf, $context) { + return t('"@s" @name', array('@s' => $context->identifier, '@name' => $subtype)); +} diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc index f820c329..2633fd3e 100644 --- a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc +++ b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields.inc @@ -1,5 +1,4 @@ <?php -// $Id: profile_fields.inc,v 1.9 2010/10/18 18:00:48 merlinofchaos Exp $ if (module_exists('profile') && !is_null(profile_user_categories())) { /** diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php index 375fbe0d..37368121 100644 --- a/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php +++ b/sites/all/modules/ctools/plugins/content_types/user_context/profile_fields_pane.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: profile_fields_pane.tpl.php,v 1.1 2009/04/18 02:00:35 merlinofchaos Exp $ /** * @file * Display profile fields. diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc b/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc index 3115bbc5..dbe42428 100644 --- a/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc +++ b/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_picture.inc,v 1.6 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -15,7 +14,7 @@ $plugin = array( ); function ctools_user_picture_content_type_render($subtype, $conf, $panel_args, $context) { - $account = isset($context->data) ? clone($context->data) : NULL; + $account = isset($context->data) ? clone($context->data) : FALSE; $block = new stdClass(); $block->module = 'term-list'; @@ -24,7 +23,7 @@ function ctools_user_picture_content_type_render($subtype, $conf, $panel_args, $ } $block->title = check_plain($account->name); - $block->content = theme('user_picture', $account); + $block->content = theme('user_picture', array('account' => $account)); return $block; } diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc b/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc index 33a6427c..e05c1c76 100644 --- a/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc +++ b/sites/all/modules/ctools/plugins/content_types/user_context/user_profile.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_profile.inc,v 1.11 2011/01/06 00:06:18 merlinofchaos Exp $ /** * Plugins are described by creating a $plugin array which will be used diff --git a/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc b/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc index 84021017..529b6558 100644 --- a/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc +++ b/sites/all/modules/ctools/plugins/content_types/user_context/user_signature.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_signature.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * Plugins are described by creating a $plugin array which will be used @@ -14,7 +13,7 @@ $plugin = array( ); function ctools_user_signature_content_type_render($subtype, $conf, $panel_args, $context) { - $account = isset($context->data) ? drupal_clone($context->data) : NULL; + $account = isset($context->data) ? clone($context->data) : NULL; $block = new stdClass(); $block->module = 'term-list'; diff --git a/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc b/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc index 5e7f5485..6127ac1a 100644 --- a/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc +++ b/sites/all/modules/ctools/plugins/content_types/vocabulary_context/vocabulary_terms.inc @@ -1,5 +1,4 @@ <?php -// $Id: vocabulary_terms.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $ if (module_exists('taxonomy')) { /** @@ -54,7 +53,7 @@ function _ctools_content_vocabulary_terms($vid, $max_depth, $depth = -1, $tid = $result = db_query('SELECT t.name, t.tid FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE t.vid = :vid AND h.parent = :parent ORDER BY t.weight ASC, t.name ASC', array(':vid' => $vid, ':parent' => $tid)); foreach ($result as $term) { $return[] = array( - 'data' => l($term->name, 'taxonomy/term/'. $term->tid), + 'data' => l($term->name, 'taxonomy/term/' . $term->tid), 'children' => _ctools_content_vocabulary_terms($vid, $max_depth, $depth, $term->tid), ); } diff --git a/sites/all/modules/ctools/plugins/contexts/entity.inc b/sites/all/modules/ctools/plugins/contexts/entity.inc index 08a50f14..99bfb293 100644 --- a/sites/all/modules/ctools/plugins/contexts/entity.inc +++ b/sites/all/modules/ctools/plugins/contexts/entity.inc @@ -1,5 +1,4 @@ <?php -// $Id: entity.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -42,9 +41,11 @@ function ctools_context_entity_get_children($plugin, $parent) { $plugin['context name'] = $entity_type; $plugin['name'] = $parent . ':' . $entity_type; $plugin['description'] = t('Creates @entity context from an entity ID.', array('@entity' => $entity_type)); - $plugins[$parent . ':' . $entity_type] = $plugin; + $plugin_id = $parent . ':' . $entity_type; + drupal_alter('ctools_entity_context', $plugin, $entity, $plugin_id); + $plugins[$plugin_id] = $plugin; } - + drupal_alter('ctools_entity_contexts', $plugins); return $plugins; } @@ -73,7 +74,7 @@ function ctools_context_create_entity($empty, $data = NULL, $conf = FALSE, $plug elseif (is_numeric($data)) { $id = $data; $data = entity_load($entity_type, array($id)); - $data = $data[$id]; + $data = !empty($data[$id]) ? $data[$id] : FALSE; } if (is_array($data)) { @@ -98,32 +99,33 @@ function ctools_context_create_entity($empty, $data = NULL, $conf = FALSE, $plug function ctools_context_entity_settings_form($form, &$form_state) { $conf = &$form_state['conf']; + $plugin = &$form_state['plugin']; $form['entity'] = array( - '#title' => t('Enter the title or ID of a @entity entity', array('@entity' => $conf['keyword'])), + '#title' => t('Enter the title or ID of a @entity entity', array('@entity' => $plugin['keyword'])), '#type' => 'textfield', '#maxlength' => 512, - '#autocomplete_path' => 'ctools/autocomplete/' . $conf['keyword'], + '#autocomplete_path' => 'ctools/autocomplete/' . $plugin['keyword'], '#weight' => -10, ); if (!empty($conf['id'])) { - $info = entity_load($conf['keyword'], array($conf['id'])); + $info = entity_load($plugin['keyword'], array($conf['id'])); $info = $info[$conf['id']]; if ($info) { - $entity = entity_get_info($conf['keyword']); - $uri = entity_uri($conf['keyword'], $info); + $entity = entity_get_info($plugin['keyword']); + $uri = entity_uri($plugin['keyword'], $info); if (is_array($uri) && $entity['entity keys']['label']) { - $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $conf['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE)); + $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $plugin['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE)); } elseif (is_array($uri)) { - $link = l(t("[%type id %id]", array('%type' => $conf['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE)); + $link = l(t("[%type id %id]", array('%type' => $plugin['keyword'], '%id' => $conf['id'])), $uri['path'], array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE)); } elseif ($entity['entity keys']['label']) { - $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $conf['keyword'], '%id' => $conf['id'])), file_create_url($uri), array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE)); + $link = l(t("'%title' [%type id %id]", array('%title' => $info->{$entity['entity keys']['label']}, '%type' => $plugin['keyword'], '%id' => $conf['id'])), file_create_url($uri), array('attributes' => array('target' => '_blank', 'title' => t('Open in new window')), 'html' => TRUE)); } else { - $link = t("[%type id %id]", array('%type' => $conf['keyword'], '%id' => $conf['id'])); + $link = t("[%type id %id]", array('%type' => $plugin['keyword'], '%id' => $conf['id'])); } $form['entity']['#description'] = t('Currently set to !link', array('!link' => $link)); } @@ -136,7 +138,7 @@ function ctools_context_entity_settings_form($form, &$form_state) { $form['entity_type'] = array( '#type' => 'value', - '#value' => $conf['keyword'], + '#value' => $plugin['keyword'], ); $form['set_identifier'] = array( @@ -220,6 +222,13 @@ function ctools_context_entity_convert_list($plugin) { else { $token = $plugin['context name']; } + + // Hack: we need either token.module or a core fix for this to work right, + // until then, we just muscle it. + if ($token == 'taxonomy_term') { + $token = 'term'; + } + $tokens = token_info(); if (isset($tokens['tokens'][$token])) { foreach ($tokens['tokens'][$token] as $id => $info) { @@ -237,13 +246,22 @@ function ctools_context_entity_convert_list($plugin) { function ctools_context_entity_convert($context, $type) { $entity_type = $context->type[2]; $entity = entity_get_info($entity_type); + if (isset($entity['token type'])) { $token = $entity['token type']; } else { $token = $entity_type; } + + // Hack: we need either token.module or a core fix for this to work right, + // until then, we just muscle it. + if ($token == 'taxonomy_term') { + $token = 'term'; + } + $tokens = token_info(); + if (isset($tokens['tokens'][$token][$type])) { $values = token_generate($token, array($type => $type), array($token => $context->data)); if (isset($values[$type])) { diff --git a/sites/all/modules/ctools/plugins/contexts/node.inc b/sites/all/modules/ctools/plugins/contexts/node.inc index 28389cd3..cd6d8c65 100644 --- a/sites/all/modules/ctools/plugins/contexts/node.inc +++ b/sites/all/modules/ctools/plugins/contexts/node.inc @@ -1,5 +1,4 @@ <?php -// $Id: node.inc,v 1.19 2010/10/26 23:40:43 merlinofchaos Exp $ /** * @file @@ -26,6 +25,9 @@ $plugin = array( '#type' => 'textfield', '#description' => t('Enter the node ID of a node for this context.'), ), + // This context is deprecated and should not be usable in the UI. + 'no ui' => TRUE, + 'no required context ui' => TRUE, ); /** @@ -115,19 +117,19 @@ function ctools_context_node_settings_form_validate($form, &$form_state) { $nid = $form_state['values']['node']; $preg_matches = array(); - $match = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches); + $match = preg_match('/\[id: (\d+)\]/', $nid, $preg_matches); if (!$match) { - $match = preg_match('/^nid: (\d+)/', $nid, $preg_matches); + $match = preg_match('/^id: (\d+)/', $nid, $preg_matches); } if ($match) { $nid = $preg_matches[1]; } if (is_numeric($nid)) { - $node = db_query('SELECT nid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject(); + $node = db_query('SELECT nid, status FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject(); } else { - $node = db_query('SELECT nid FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject(); + $node = db_query('SELECT nid, status FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject(); } // Do not allow unpublished nodes to be selected by unprivileged users @@ -136,7 +138,6 @@ function ctools_context_node_settings_form_validate($form, &$form_state) { } else { form_set_value($form['nid'], $node->nid, $form_state); - // $form_state['values']['nid'] = $node->nid; } } diff --git a/sites/all/modules/ctools/plugins/contexts/node_add_form.inc b/sites/all/modules/ctools/plugins/contexts/node_add_form.inc index 139f5745..55219330 100644 --- a/sites/all/modules/ctools/plugins/contexts/node_add_form.inc +++ b/sites/all/modules/ctools/plugins/contexts/node_add_form.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_add_form.inc,v 1.14 2010/10/11 22:18:23 sdboyer Exp $ /** * @file @@ -47,7 +46,7 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE } if (!empty($data)) { - $types = node_get_types(); + $types = node_type_get_types(); $type = str_replace('-', '_', $data); // Validate the node type exists. @@ -64,7 +63,7 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE include_once './' . $file; // This piece of information can let other modules know that more files // need to be included if this form is loaded from cache: - $form_state['form_load_files'] = array($file); + $form_state['build_info']['files'] = array($file); $form = drupal_build_form($form_id, $form_state); // In a form, $data is the object being edited. @@ -79,6 +78,7 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE $context->form_title = t('Submit @name', array('@name' => $types[$type]->name)); $context->node_type = $type; $context->restrictions['type'] = array($type); + $context->restrictions['form'] = array('form'); return $context; } } @@ -87,15 +87,10 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE function ctools_context_node_add_form_settings_form($form, &$form_state) { $conf = $form_state['conf']; - foreach (node_get_types() as $type => $info) { - $options[$type] = $info->name; - } - asort($options); - $form['type'] = array( '#title' => t('Node type'), '#type' => 'select', - '#options' => $options, + '#options' => node_type_get_names(), '#default_value' => $conf['type'], '#description' => t('Select the node type for this form.'), ); diff --git a/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc b/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc index b613dac7..a7b04523 100644 --- a/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc +++ b/sites/all/modules/ctools/plugins/contexts/node_edit_form.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_edit_form.inc,v 1.18 2010/10/11 22:18:23 sdboyer Exp $ /** * @file @@ -66,27 +65,28 @@ function ctools_context_create_node_edit_form($empty, $node = NULL, $conf = FALS require_once DRUPAL_ROOT . '/' . $file; // This piece of information can let other modules know that more files // need to be included if this form is loaded from cache: - $form_state['form_load_files'] = array($file); + $form_state['build_info']['files'] = array($file); $form = drupal_build_form($form_id, $form_state); // Fill in the 'node' portion of the context $context->data = $node; - $context->title = $node->title; + $context->title = isset($node->title) ? $node->title : ''; $context->argument = isset($node->nid) ? $node->nid : $node->type; $context->form = $form; $context->form_state = &$form_state; $context->form_id = $form_id; - $context->form_title = $node->title; + $context->form_title = isset($node->title) ? $node->title : ''; $context->node_type = $node->type; $context->restrictions['type'] = array($node->type); + $context->restrictions['form'] = array('form'); return $context; } } function ctools_context_node_edit_form_settings_form($form, &$form_state) { - $conf = $form_state['conf']; + $conf = &$form_state['conf']; $form['node'] = array( '#title' => t('Enter the title or NID of a node'), @@ -104,6 +104,11 @@ function ctools_context_node_edit_form_settings_form($form, &$form_state) { } } + $form['nid'] = array( + '#type' => 'value', + '#value' => $conf['nid'], + ); + $form['set_identifier'] = array( '#type' => 'checkbox', '#default_value' => FALSE, @@ -130,27 +135,27 @@ function ctools_context_node_edit_form_settings_form_validate($form, &$form_stat $nid = $form_state['values']['node']; $preg_matches = array(); - $match = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches); + $match = preg_match('/\[id: (\d+)\]/', $nid, $preg_matches); if (!$match) { - $match = preg_match('/^nid: (\d+)/', $nid, $preg_matches); + $match = preg_match('/^id: (\d+)/', $nid, $preg_matches); } if ($match) { $nid = $preg_matches[1]; } if (is_numeric($nid)) { - $node = db_query('SELECT nid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject(); + $node = db_query('SELECT nid, status FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject(); } else { - $node = db_query('SELECT nid FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject(); + $node = db_query('SELECT nid, status FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject(); } - if (!$node) { + // Do not allow unpublished nodes to be selected by unprivileged users + if (!$node || (empty($node->status) && !(user_access('administer nodes')))) { form_error($form['node'], t('Invalid node selected.')); } else { form_set_value($form['nid'], $node->nid, $form_state); - // $form_state['values']['nid'] = $node->nid; } } diff --git a/sites/all/modules/ctools/plugins/contexts/string.inc b/sites/all/modules/ctools/plugins/contexts/string.inc index 1c78fab3..c53acaea 100644 --- a/sites/all/modules/ctools/plugins/contexts/string.inc +++ b/sites/all/modules/ctools/plugins/contexts/string.inc @@ -1,5 +1,4 @@ <?php -// $Id: string.inc,v 1.8 2010/01/29 20:18:02 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/contexts/term.inc b/sites/all/modules/ctools/plugins/contexts/term.inc index 6a3524aa..1d6d48e6 100644 --- a/sites/all/modules/ctools/plugins/contexts/term.inc +++ b/sites/all/modules/ctools/plugins/contexts/term.inc @@ -1,5 +1,4 @@ <?php -// $Id: term.inc,v 1.13 2011/01/01 01:14:24 merlinofchaos Exp $ /** * @file @@ -30,6 +29,9 @@ $plugin = array( 'vid' => t('Vocabulary ID'), ), 'convert' => 'ctools_context_term_convert', + // This context is deprecated and should not be usable in the UI. + 'no ui' => TRUE, + 'no required context ui' => TRUE, ); /** @@ -88,7 +90,6 @@ function ctools_context_term_settings_form($form, &$form_state) { '#type' => 'textfield', '#description' => t('Select a term from @vocabulary.', array('@vocabulary' => $vocabulary->name)) . $description, '#autocomplete_path' => 'taxonomy/autocomplete/' . $vocabulary->vid, - '#process' => array('ctools_dependent_process'), '#dependency' => array('ctools-select-vid' => array($vocabulary->vid)), ); diff --git a/sites/all/modules/ctools/plugins/contexts/terms.inc b/sites/all/modules/ctools/plugins/contexts/terms.inc index 6218d801..b076a619 100644 --- a/sites/all/modules/ctools/plugins/contexts/terms.inc +++ b/sites/all/modules/ctools/plugins/contexts/terms.inc @@ -1,5 +1,4 @@ <?php -// $Id: terms.inc,v 1.10 2010/10/15 21:06:58 merlinofchaos Exp $ /** * @file @@ -16,7 +15,9 @@ $plugin = array( 'description' => t('Multiple taxonomy terms, as a group.'), 'context' => 'ctools_context_create_terms', 'keyword' => 'terms', + // This context is deprecated and should not be usable in the UI. 'no ui' => TRUE, + 'no required context ui' => TRUE, 'context name' => 'terms', 'convert list' => array( 'tid' => t('Term ID of first term'), diff --git a/sites/all/modules/ctools/plugins/contexts/token.inc b/sites/all/modules/ctools/plugins/contexts/token.inc index 150dc10d..5138b1cd 100644 --- a/sites/all/modules/ctools/plugins/contexts/token.inc +++ b/sites/all/modules/ctools/plugins/contexts/token.inc @@ -1,5 +1,4 @@ <?php -// $Id: token.inc,v 1.4 2010/12/31 22:46:50 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/contexts/user.inc b/sites/all/modules/ctools/plugins/contexts/user.inc index a12aa828..638d146f 100644 --- a/sites/all/modules/ctools/plugins/contexts/user.inc +++ b/sites/all/modules/ctools/plugins/contexts/user.inc @@ -1,5 +1,4 @@ <?php -// $Id: user.inc,v 1.12 2011/01/05 19:42:37 merlinofchaos Exp $ /** * @file @@ -22,7 +21,10 @@ $plugin = array( 'convert list' => 'ctools_context_user_convert_list', 'convert' => 'ctools_context_user_convert', 'convert default' => 'name', - 'js' => array('misc/autocomplete.js'), + + // This context is deprecated and should not be usable in the UI. + 'no ui' => TRUE, + 'no required context ui' => TRUE, ); /** @@ -30,7 +32,7 @@ $plugin = array( * are not always created from the UI. */ function ctools_context_create_user($empty, $data = NULL, $conf = FALSE) { - $context = new ctools_context('user'); + $context = new ctools_context(array('entity:user', 'entity', 'user')); $context->plugin = 'user'; if ($empty) { @@ -47,6 +49,11 @@ function ctools_context_create_user($empty, $data = NULL, $conf = FALSE) { $data = user_load($data['uid']); } } + // Load entity if the data provided is a numeric value. This kind of data is + // passed by some relationships. + if (is_numeric($data)) { + $data = user_load($data); + } if (!empty($data)) { $context->data = $data; @@ -75,7 +82,6 @@ function ctools_context_user_settings_form($form, &$form_state) { '#type' => 'textfield', '#maxlength' => 512, '#autocomplete_path' => 'user/autocomplete', - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:type' => array('select')), ); @@ -96,7 +102,6 @@ function ctools_context_user_settings_form($form, &$form_state) { '#default_value' => FALSE, '#title' => t('Reset identifier to username'), '#description' => t('If checked, the identifier will be reset to the user name of the selected user.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:context[context_settings][type]' => array('select')), ); diff --git a/sites/all/modules/ctools/plugins/contexts/vocabulary.inc b/sites/all/modules/ctools/plugins/contexts/vocabulary.inc index 38d00fde..4930c249 100644 --- a/sites/all/modules/ctools/plugins/contexts/vocabulary.inc +++ b/sites/all/modules/ctools/plugins/contexts/vocabulary.inc @@ -1,5 +1,4 @@ <?php -// $Id: vocabulary.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $ /** * @file @@ -19,6 +18,9 @@ $plugin = array( 'defaults' => array('vid' => ''), 'keyword' => 'vocabulary', 'context name' => 'vocabulary', + // This context is deprecated and should not be usable in the UI. + 'no ui' => TRUE, + 'no required context ui' => TRUE, ); /** diff --git a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php index 10fc50d8..4a919eac 100644 --- a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php +++ b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php @@ -1,5 +1,4 @@ <?php -// $Id: ctools_export_ui.class.php,v 1.5 2011/01/05 22:35:46 merlinofchaos Exp $ /** * Base class for export UI. @@ -38,6 +37,17 @@ class ctools_export_ui { return $title; } + /** + * Called by ctools_export_ui_load to load the item. + * + * This can be overridden for modules that want to be able to export + * items currently being edited, for example. + */ + function load_item($item_name) { + $item = ctools_export_crud_load($this->plugin['schema'], $item_name); + return empty($item) ? FALSE : $item; + } + // ------------------------------------------------------------------------ // Menu item manipulation @@ -181,7 +191,14 @@ class ctools_export_ui { $form_state['input']['form_id'] = 'ctools_export_ui_list_form'; } - $form = drupal_render(drupal_build_form('ctools_export_ui_list_form', $form_state)); + // If we do any form rendering, it's to completely replace a form on the + // page, so don't let it force our ids to change. + if ($js && isset($_POST['ajax_html_ids'])) { + unset($_POST['ajax_html_ids']); + } + + $form = drupal_build_form('ctools_export_ui_list_form', $form_state); + $form = drupal_render($form); $output = $this->list_header($form_state) . $this->list_render($form_state) . $this->list_footer($form_state); @@ -320,6 +337,7 @@ class ctools_export_ui { function list_form_submit(&$form, &$form_state) { // Filter and re-sort the pages. $plugin = $this->plugin; + $schema = ctools_export_get_schema($this->plugin['schema']); $prefix = ctools_export_ui_plugin_base_path($plugin); @@ -335,10 +353,10 @@ class ctools_export_ui { $allowed_operations = drupal_map_assoc(array_keys($plugin['allowed operations'])); $not_allowed_operations = array('import'); - if ($item->type == t('Normal')) { + if ($item->{$schema['export']['export type string']} == t('Normal')) { $not_allowed_operations[] = 'revert'; } - elseif ($item->type == t('Overridden')) { + elseif ($item->{$schema['export']['export type string']} == t('Overridden')) { $not_allowed_operations[] = 'delete'; } else { @@ -400,7 +418,8 @@ class ctools_export_ui { * TRUE if the item should be excluded. */ function list_filter($form_state, $item) { - if ($form_state['values']['storage'] != 'all' && $form_state['values']['storage'] != $item->type) { + $schema = ctools_export_get_schema($this->plugin['schema']); + if ($form_state['values']['storage'] != 'all' && $form_state['values']['storage'] != $item->{$schema['export']['export type string']}) { return TRUE; } @@ -489,8 +508,9 @@ class ctools_export_ui { function list_build_row($item, &$form_state, $operations) { // Set up sorting $name = $item->{$this->plugin['export']['key']}; + $schema = ctools_export_get_schema($this->plugin['schema']); - // Note: $item->type should have already been set up by export.inc so + // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so // we can use it safely. switch ($form_state['values']['order']) { case 'disabled': @@ -503,7 +523,7 @@ class ctools_export_ui { $this->sorts[$name] = $name; break; case 'storage': - $this->sorts[$name] = $item->type . $name; + $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name; break; } @@ -515,8 +535,11 @@ class ctools_export_ui { $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title')); } $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name')); - $this->rows[$name]['data'][] = array('data' => check_plain($item->type), 'class' => array('ctools-export-ui-storage')); - $this->rows[$name]['data'][] = array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations')); + $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage')); + + $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline')))); + + $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations')); // Add an automatic mouseover of the description if one exists. if (!empty($this->plugin['export']['admin_description'])) { @@ -557,6 +580,7 @@ class ctools_export_ui { 'header' => $this->list_table_header(), 'rows' => $this->rows, 'attributes' => array('id' => 'ctools-export-ui-list-items'), + 'empty' => $this->plugin['strings']['message']['no items'], ); return theme('table', $table); } @@ -825,7 +849,8 @@ class ctools_export_ui { // Figure out if this is a new instance of the wizard if (empty($form_state['step'])) { - $form_state['step'] = reset(array_keys($form_info['order'])); + $order = array_keys($form_info['order']); + $form_state['step'] = reset($order); } if (empty($form_info['order'][$form_state['step']]) && empty($form_info['forms'][$form_state['step']])) { @@ -970,10 +995,6 @@ class ctools_export_ui { $item = $form_state['item']; $schema = ctools_export_get_schema($this->plugin['schema']); - // TODO: Drupal 7 has a nifty method of auto guessing names from - // titles that is standard. We should integrate that here as a - // nice standard. - // Guess at a couple of our standard fields. if (!empty($this->plugin['export']['admin_title'])) { $form['info'][$this->plugin['export']['admin_title']] = array( '#type' => 'textfield', @@ -1115,7 +1136,7 @@ class ctools_export_ui { * as though the filter form had been executed. */ function set_item_state($state, $js, $input, $item) { - ctools_export_set_object_status($item, $state); + ctools_export_crud_set_status($this->plugin['schema'], $item, $state); if (!$js) { drupal_goto(ctools_export_ui_plugin_base_path($this->plugin)); diff --git a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc index fb204c3a..4e0a8497 100644 --- a/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc +++ b/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.inc @@ -1,5 +1,4 @@ <?php -// $Id: ctools_export_ui.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * The default plugin exists only to provide the base class. Other plugins diff --git a/sites/all/modules/ctools/plugins/relationships/book_parent.inc b/sites/all/modules/ctools/plugins/relationships/book_parent.inc index adc66ede..c49db76e 100644 --- a/sites/all/modules/ctools/plugins/relationships/book_parent.inc +++ b/sites/all/modules/ctools/plugins/relationships/book_parent.inc @@ -1,5 +1,4 @@ <?php -// $Id: book_parent.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc b/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc index 7e6ebcab..99d6f2d6 100644 --- a/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc +++ b/sites/all/modules/ctools/plugins/relationships/entity_from_field.inc @@ -1,5 +1,4 @@ <?php -// $Id: entity_from_field.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -23,32 +22,104 @@ function ctools_entity_from_field_get_child($plugin, $parent, $child) { return $plugins[$parent . ':' . $child]; } -function ctools_entity_from_field_get_children($plugin, $parent) { +function ctools_entity_from_field_get_children($parent_plugin, $parent) { + ctools_include('fields'); $entities = entity_get_info(); $plugins = array(); $context_types = array(); // Get the schema information for every field. $fields_info = field_info_instances(); - foreach ($fields_info as $entity_type => $entity_info) { + foreach ($fields_info as $from_entity => $entity_info) { foreach ($entity_info as $bundle => $fields) { - foreach ($fields as $field_name => $field) { - $field = field_info_field($field_name); - $module = $field['module']; - module_load_install($module); - $schema = module_invoke($module, 'field_schema', $field); - if (isset($schema['foreign keys'])) { - foreach ($schema['foreign keys'] as $key => $info) { - if (isset($info['table'])) { - foreach ($entities as $entity => $einfo) { - if ($einfo['base table'] == $info['table'] && isset($info['columns'][$einfo['entity keys']['id']])) { - $plugin['title'] = t('@field_entity from @entity on @field_name field', array('@field_entity' => $einfo['label'], '@entity' => $entities[$entity_type]['label'], '@field_name' => $field_name)); - $plugin['keyword'] = $entity; - $plugin['context name'] = $field_name . '-' . $entity_type . '-' . $entity; - $plugin['name'] = $parent . ':' . $field_name . '-' . $entity_type . '-' . $entity; - $plugin['description'] = t('Creates a @entity context from @base_entity field relationship on the @base_table table.', array('@entity' => $entity, '@base_entity' => $entity_type, '@base_table' => $einfo['base table'])); - $context_types[$parent . ':' . $field_name . '-' . $entity_type . '-' . $entity]['types'][$bundle] = $entities[$entity_type]['bundles'][$bundle]['label']; - $plugins[$parent . ':' . $field_name . '-' . $entity_type . '-' . $entity] = $plugin; + // There might be fields attached to bundles that are disabled (e.g. a + // module that declared a node's content type, is now disabled), but the + // field instance is still shown. + if (!empty($entities[$from_entity]['bundles'][$bundle])) { + foreach ($fields as $field_name => $field) { + $field = field_info_field($field_name); + $foreign_keys = NULL; + + if (!empty($field['foreign keys'])) { + $foreign_keys = $field['foreign keys']; + } + else { + // try to fetch foreign keys from schema, as not everything + // stores foreign keys properly in the field info. + $module = $field['module']; + module_load_install($module); + $schema = module_invoke($module, 'field_schema', $field); + if (!empty($schema['foreign keys'])) { + $foreign_keys = $schema['foreign keys']; + } + } + + if (is_array($foreign_keys)) { + foreach ($foreign_keys as $key => $info) { + if (isset($info['table'])) { + foreach ($entities as $to_entity => $to_entity_info) { + $from_entity_info = $entities[$from_entity]; + if (isset($to_entity_info['base table']) && $to_entity_info['base table'] == $info['table'] && isset($info['columns'][$to_entity_info['entity keys']['id']])) { + $name = $field_name . '-' . $from_entity . '-' . $to_entity; + $plugin_id = $parent . ':' . $name; + + // Record the bundle for later. + $context_types[$plugin_id]['types'][$bundle] = $from_entity_info['bundles'][$bundle]['label']; + + // We check for every bundle; this plugin may already have + // been created, so don't recreate it. + if (!isset($plugins[$plugin_id])) { + $plugin = $parent_plugin; + $replacements = array( + '@to_entity' => $to_entity_info['label'], + '@from_entity' => $from_entity_info['label'], + '@field_name' => ctools_field_label($field_name), + ); + $plugin['title'] = t('@to_entity from @from_entity (on @from_entity: @field_name)', $replacements); + $plugin['keyword'] = $to_entity; + $plugin['context name'] = $name; + $plugin['name'] = $plugin_id; + $plugin['description'] = t('Creates a @to_entity context from @from_entity using the @field_name field on @from_entity.', $replacements); + $plugin['from entity'] = $from_entity; + $plugin['to entity'] = $to_entity; + $plugin['field name'] = $field_name; + $plugin['parent'] = $parent; + + $plugins[$plugin_id] = $plugin; + +/* + -- commented out until I figure out how to actually load the reverse properly. + // Build the reverse + $plugin = $parent_plugin; + $name = $field_name . '-' . $from_entity . '-' . $to_entity . '-reverse'; + $plugin_id = $parent . ':' . $name; + + $plugin['title'] = t('@from_entity from @to_entity (on @from_entity: @field_name)', $replacements); + $plugin['keyword'] = $to_entity; + $plugin['context name'] = $name; + $plugin['name'] = $plugin_id; + $plugin['description'] = t('Creates a @from_entity context from @to_entity using the @field_name field on @from_entity.', $replacements); + + $plugin['from entity'] = $from_entity; + $plugin['to entity'] = $to_entity; + $plugin['field name'] = $field_name; + $plugin['reverse'] = TRUE; + $plugin['parent'] = $parent; + + // Since we can't apply restrictions on the reverse relationship + // we just add the required context here. + $plugin['required context'] = new ctools_context_required($to_entity_info['label'], $to_entity); + + $plugin_entities = array( + 'to' => array($from_entity => $from_entity_info), + 'from' => array($to_entity => $to_entity_info) + ); + drupal_alter('ctools_entity_context', $plugin, $plugin_entities, $plugin_id); + + $plugins[$plugin_id] = $plugin; +*/ + } + } } } } @@ -57,11 +128,24 @@ function ctools_entity_from_field_get_children($plugin, $parent) { } } } + foreach ($context_types as $key => $context) { list($parent, $plugin_name) = explode(':', $key); - list($field_name, $from_entity) = explode('-', $plugin_name); - $plugins[$key]['required context'] = new ctools_context_required(t(ucfirst($from_entity)), $from_entity, array('type' => array_keys($context['types']))); + list($field_name, $from_entity, $to_entity) = explode('-', $plugin_name); + + $from_entity_info = $entities[$from_entity]; + $to_entity_info = $entities[$to_entity]; + + $plugins[$key]['required context'] = new ctools_context_required($from_entity_info['label'], $from_entity, array('type' => array_keys($context['types']))); + + $plugin_entities = array( + 'to' => array($to_entity => $to_entity_info), + 'from' => array($from_entity => $from_entity_info) + ); + drupal_alter('ctools_entity_context', $plugins[$key], $plugin_entities, $key); } + drupal_alter('ctools_entity_contexts', $plugins); + return $plugins; } @@ -71,11 +155,11 @@ function ctools_entity_from_field_get_children($plugin, $parent) { function ctools_entity_from_field_context($context, $conf) { $plugin = $conf['name']; list($plugin, $plugin_name) = explode(':', $plugin); - list($field_name, $from_entity, $to_entity) = explode('-', $plugin_name); + list($field_name, $from_entity, $to_entity_info) = explode('-', $plugin_name); // If unset it wants a generic, unfilled context, which is just NULL. $entity_info = entity_get_info($from_entity); if (empty($context->data) || !isset($context->data->{$entity_info['entity keys']['id']})) { - return ctools_context_create_empty('entity:' . $to_entity, NULL); + return ctools_context_create_empty('entity:' . $to_entity_info, NULL); } if (isset($context->data->{$entity_info['entity keys']['id']})) { @@ -85,11 +169,11 @@ function ctools_entity_from_field_context($context, $conf) { $entity = $entity[$id]; if (isset($entity->$field_name)) { $language = field_language($from_entity, $entity, $field_name); - $to_entity_info = entity_get_info($to_entity); - $to_entity_id = $entity->{$field_name}[$language][0][$to_entity_info['entity keys']['id']]; + $to_entity_info_info = entity_get_info($to_entity_info); + $to_entity_info_id = $entity->{$field_name}[$language][0][$to_entity_info_info['entity keys']['id']]; // Send it to ctools. - return ctools_context_create('entity:' . $to_entity, $to_entity_id); + return ctools_context_create('entity:' . $to_entity_info, $to_entity_info_id); } } } diff --git a/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc b/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc index a5bfa506..809473eb 100644 --- a/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc +++ b/sites/all/modules/ctools/plugins/relationships/entity_from_schema.inc @@ -1,5 +1,4 @@ <?php -// $Id: entity_from_schema.inc,v 1.1 2011/01/05 20:34:46 merlinofchaos Exp $ /** * @file @@ -23,34 +22,81 @@ function ctools_entity_from_schema_get_child($plugin, $parent, $child) { return $plugins[$parent . ':' . $child]; } -function ctools_entity_from_schema_get_children($plugin, $parent) { +function ctools_entity_from_schema_get_children($parent_plugin, $parent) { $entities = entity_get_info(); $plugins = array(); foreach (module_implements('entity_info') as $module) { module_load_install($module); - $schemas = module_invoke($module, 'schema'); - foreach ($schemas as $table => $schema) { - foreach ($entities as $from_entity => $from_entity_info) { - if ($table == $from_entity_info['base table'] && isset($schema['foreign keys'])) { - foreach ($schema['foreign keys'] as $relationship => $info) { - foreach ($entities as $to_entity => $to_entity_info) { - if ($info['table'] == $to_entity_info['base table'] && in_array($to_entity_info['entity keys']['id'], $info['columns'])) { - $this_col = ctools_entity_from_schema_columns_filter($info['columns'], $to_entity_info['entity keys']['id']); - $plugin['title'] = t('@to_entity @relationship relationship', array('@relationship' => $relationship, '@to_entity' => $to_entity)); - $plugin['keyword'] = $to_entity; - $plugin['context name'] = $this_col . '-' . $from_entity . '-' . $to_entity; - $plugin['name'] = $parent . ':' . $this_col . '-' . $from_entity . '-' . $to_entity; - $plugin['description'] = t('Builds a @relationship relationship from a @from_entity to a @to_entity', array('@relationship' => $relationship, '@from_entity' => $from_entity, '@to_entity' => $to_entity)); - $plugin['required context'] = new ctools_context_required(t(ucfirst($from_entity_info['label'])), $from_entity); - $plugins[$parent . ':' . $this_col . '-' . $from_entity . '-' . $to_entity] = $plugin; - } + $schemas = drupal_get_schema(); + + foreach ($entities as $from_entity => $from_entity_info) { + if (empty($from_entity_info['base table'])) { + continue; + } + + $table = $from_entity_info['base table']; + if (isset($schemas[$table]['foreign keys'])) { + foreach ($schemas[$table]['foreign keys'] as $relationship => $info) { + foreach ($entities as $to_entity => $to_entity_info) { + if (empty($info['table'])) { + continue; + } + + if (isset($to_entity_info['base table']) && $info['table'] == $to_entity_info['base table'] && in_array($to_entity_info['entity keys']['id'], $info['columns'])) { + $this_col = ctools_entity_from_schema_columns_filter($info['columns'], $to_entity_info['entity keys']['id']); + + // Set up our t() replacements as we reuse these. + $replacements = array( + '@relationship' => $relationship, + '@base_table' => $table, + '@to_entity' => $to_entity_info['label'], + '@from_entity' => $from_entity_info['label'], + ); + + $name = $this_col . '-' . $from_entity . '-' . $to_entity; + $plugin_id = $parent . ':' . $name; + $plugin = $parent_plugin; + + $plugin['title'] = t('@to_entity from @from_entity (on @base_table.@relationship)', $replacements); + $plugin['keyword'] = $to_entity; + $plugin['context name'] = $name; + $plugin['name'] = $plugin_id; + $plugin['description'] = t('Builds a relationship from a @from_entity to a @to_entity using the @base_table.@relationship field.', $replacements); + + $plugin['required context'] = new ctools_context_required($from_entity_info['label'], $from_entity); + + $plugin_entities = array('to' => $to_entity_info, 'from' => $from_entity_info); + $plugin_entities = array('to' => array($to_entity => $to_entity_info), 'from' => array($from_entity => $from_entity_info)); + + drupal_alter('ctools_entity_context', $plugin, $plugin_entities, $plugin_id); + $plugins[$plugin_id] = $plugin; + + // Add the relation in the reverse direction. + $name = $this_col . '-' . $to_entity . '-' . $from_entity; + $plugin_id = $parent . ':' . $name; + $plugin = $parent_plugin; + + $plugin['title'] = t('@from_entity from @to_entity (on @base_table.@relationship)', $replacements); + $plugin['keyword'] = $to_entity; + $plugin['context name'] = $name; + $plugin['name'] = $plugin_id; + $plugin['description'] = t('Builds a relationship from a @to_entity to a @from_entity using the @base_table.@relationship field.', $replacements); + + $plugin['required context'] = new ctools_context_required($to_entity_info['label'], $to_entity); + + $plugin_entities = array('to' => $from_entity_info, 'from' => $to_entity_info); + $plugin_entities = array('to' => array($from_entity => $from_entity_info), 'from' => array($to_entity => $to_entity_info)); + drupal_alter('ctools_entity_context', $plugin, $plugin_entities, $plugin_id); + $plugins[$plugin_id] = $plugin; + } } } } } } + drupal_alter('ctools_entity_contexts', $plugins); return $plugins; } diff --git a/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc b/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc index 013d28b0..15c758a2 100644 --- a/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc +++ b/sites/all/modules/ctools/plugins/relationships/node_edit_form_from_node.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_edit_form_from_node.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/relationships/term_from_node.inc b/sites/all/modules/ctools/plugins/relationships/term_from_node.inc index 2eac8ffb..23043678 100644 --- a/sites/all/modules/ctools/plugins/relationships/term_from_node.inc +++ b/sites/all/modules/ctools/plugins/relationships/term_from_node.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_from_node.inc,v 1.6 2010/10/11 22:18:23 sdboyer Exp $ /** * @file @@ -26,13 +25,13 @@ $plugin = array( function ctools_term_from_node_context($context, $conf) { // If unset it wants a generic, unfilled context, which is just NULL. if (empty($context->data)) { - return ctools_context_create_empty('term', NULL); + return ctools_context_create_empty('entity_taxonomy:term', NULL); } if (isset($context->data->taxonomy)) { foreach ($context->data->taxonomy as $term) { if ($term->vid == $conf['vid']) { - return ctools_context_create('term', $term); + return ctools_context_create('entity:taxonomy_term', $term); } } } diff --git a/sites/all/modules/ctools/plugins/relationships/term_parent.inc b/sites/all/modules/ctools/plugins/relationships/term_parent.inc index e1a73c09..0ee9ebf0 100644 --- a/sites/all/modules/ctools/plugins/relationships/term_parent.inc +++ b/sites/all/modules/ctools/plugins/relationships/term_parent.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_parent.inc,v 1.7 2010/10/11 22:18:23 sdboyer Exp $ /** * @file relationships/term_parent.inc @@ -14,7 +13,7 @@ $plugin = array( 'title' => t('Term parent'), 'keyword' => 'parent_term', 'description' => t('Adds a taxonomy term parent from a term context.'), - 'required context' => new ctools_context_required(t('Term'), 'term'), + 'required context' => new ctools_context_required(t('Term'), 'entity_taxonomy_term'), 'context' => 'ctools_term_parent_context', 'edit form' => 'ctools_term_parent_settings_form', 'defaults' => array('type' => 'top'), @@ -26,7 +25,7 @@ $plugin = array( function ctools_term_parent_context($context, $conf) { // If unset it wants a generic, unfilled context, which is just NULL. if (empty($context->data)) { - return ctools_context_create_empty('term'); + return ctools_context_create_empty('entity:taxonomy_term'); } if (isset($context->data)) { @@ -47,7 +46,7 @@ function ctools_term_parent_context($context, $conf) { // Load the term. if ($result) { $term = taxonomy_term_load($result['tid']); - return ctools_context_create('term', $term); + return ctools_context_create('entity:taxonomy_term', $term); } } } diff --git a/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc b/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc index 9d472380..e8eaa545 100644 --- a/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc +++ b/sites/all/modules/ctools/plugins/relationships/terms_from_node.inc @@ -1,5 +1,4 @@ <?php -// $Id: terms_from_node.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/plugins/relationships/user_from_node.inc b/sites/all/modules/ctools/plugins/relationships/user_from_node.inc index dd79c956..388b1cec 100644 --- a/sites/all/modules/ctools/plugins/relationships/user_from_node.inc +++ b/sites/all/modules/ctools/plugins/relationships/user_from_node.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_from_node.inc,v 1.7 2010/01/29 20:18:02 merlinofchaos Exp $ /** * @file @@ -16,6 +15,7 @@ $plugin = array( 'description' => t('Creates the author of a node as a user context.'), 'required context' => new ctools_context_required(t('Node'), 'node'), 'context' => 'ctools_user_from_node_context', + 'no ui' => TRUE, ); /** diff --git a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc index 7ddc4923..a1fc1d8c 100644 --- a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc +++ b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer.inc @@ -1,5 +1,4 @@ <?php -// $Id: stylizer.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ $plugin = array( 'schema' => 'stylizer', diff --git a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php index 0e2b60cd..14d62939 100644 --- a/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php +++ b/sites/all/modules/ctools/stylizer/plugins/export_ui/stylizer_ui.class.php @@ -1,5 +1,4 @@ <?php -// $Id: stylizer_ui.class.php,v 1.3 2011/01/05 22:35:46 merlinofchaos Exp $ /** * UI class for Stylizer. @@ -139,6 +138,8 @@ class stylizer_ui extends ctools_export_ui { $type = t('Unknown'); } + $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline')))); + $this->rows[$item->name] = array( 'data' => array( array('data' => $type, 'class' => array('ctools-export-ui-type')), @@ -146,7 +147,7 @@ class stylizer_ui extends ctools_export_ui { array('data' => check_plain($item->admin_title), 'class' => array('ctools-export-ui-title')), array('data' => check_plain($this->style_plugin['title']), 'class' => array('ctools-export-ui-base')), array('data' => check_plain($item->type), 'class' => array('ctools-export-ui-storage')), - array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations')), + array('data' => $ops, 'class' => array('ctools-export-ui-operations')), ), 'title' => check_plain($item->admin_description), 'class' => array(!empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled'), diff --git a/sites/all/modules/ctools/stylizer/stylizer.info b/sites/all/modules/ctools/stylizer/stylizer.info index 72332ae0..96b7db6f 100644 --- a/sites/all/modules/ctools/stylizer/stylizer.info +++ b/sites/all/modules/ctools/stylizer/stylizer.info @@ -1,4 +1,3 @@ -; $Id: stylizer.info,v 1.3 2011/01/01 00:01:46 merlinofchaos Exp $ name = Stylizer description = Create custom styles for applications such as Panels. core = 7.x @@ -6,9 +5,9 @@ package = Chaos tool suite dependencies[] = ctools dependencies[] = color -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/stylizer/stylizer.install b/sites/all/modules/ctools/stylizer/stylizer.install index 1f285150..cee8b748 100644 --- a/sites/all/modules/ctools/stylizer/stylizer.install +++ b/sites/all/modules/ctools/stylizer/stylizer.install @@ -1,5 +1,4 @@ <?php -// $Id: stylizer.install,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * Schema for stylizer. diff --git a/sites/all/modules/ctools/stylizer/stylizer.module b/sites/all/modules/ctools/stylizer/stylizer.module index c68f77a4..e7278975 100644 --- a/sites/all/modules/ctools/stylizer/stylizer.module +++ b/sites/all/modules/ctools/stylizer/stylizer.module @@ -1,5 +1,4 @@ <?php -// $Id: stylizer.module,v 1.4 2011/01/05 22:53:04 merlinofchaos Exp $ /** * @file diff --git a/sites/all/modules/ctools/tests/css.test b/sites/all/modules/ctools/tests/css.test index 48a99d11..039e9757 100644 --- a/sites/all/modules/ctools/tests/css.test +++ b/sites/all/modules/ctools/tests/css.test @@ -1,5 +1,4 @@ <?php -// $Id: css.test,v 1.1 2010/10/11 22:18:22 sdboyer Exp $ /** * @file * Tests for different parts of the ctools plugin system. diff --git a/sites/all/modules/ctools/tests/ctools.plugins.test b/sites/all/modules/ctools/tests/ctools.plugins.test index a752e15d..fe1829cf 100644 --- a/sites/all/modules/ctools/tests/ctools.plugins.test +++ b/sites/all/modules/ctools/tests/ctools.plugins.test @@ -1,5 +1,4 @@ <?php -// $Id: ctools.plugins.test,v 1.3 2010/10/11 22:18:22 sdboyer Exp $ /** * @file * Tests for different parts of the ctools plugin system. diff --git a/sites/all/modules/ctools/tests/ctools_plugin_test.info b/sites/all/modules/ctools/tests/ctools_plugin_test.info index 3bc97fc0..83ec9dc0 100644 --- a/sites/all/modules/ctools/tests/ctools_plugin_test.info +++ b/sites/all/modules/ctools/tests/ctools_plugin_test.info @@ -1,4 +1,3 @@ -; $Id: ctools_plugin_test.info,v 1.2 2011/01/01 00:01:46 merlinofchaos Exp $ name = Chaos tools plugins test description = Provides hooks for testing ctools plugins. package = Chaos tool suite @@ -8,9 +7,9 @@ files[] = ctools.plugins.test files[] = object_cache.test hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/tests/ctools_plugin_test.module b/sites/all/modules/ctools/tests/ctools_plugin_test.module index f978dd48..567f6e73 100644 --- a/sites/all/modules/ctools/tests/ctools_plugin_test.module +++ b/sites/all/modules/ctools/tests/ctools_plugin_test.module @@ -1,5 +1,4 @@ <?php -// $Id: ctools_plugin_test.module,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * Define some plugin systems to test ctools plugin includes. */ diff --git a/sites/all/modules/ctools/tests/object_cache.test b/sites/all/modules/ctools/tests/object_cache.test index d46c7d20..8791d7e7 100644 --- a/sites/all/modules/ctools/tests/object_cache.test +++ b/sites/all/modules/ctools/tests/object_cache.test @@ -1,5 +1,4 @@ <?php -// $Id: object_cache.test,v 1.1 2010/10/11 22:18:22 sdboyer Exp $ /** * @file * Tests for different parts of the ctools object caching system. diff --git a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php index 853582a4..3037daa5 100644 --- a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php +++ b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray.class.php @@ -1,5 +1,4 @@ <?php -// $Id: ctoolsCachedPluginArray.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * A cached plugin object that tests inheritence including. diff --git a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php index 4be0f4a1..0f7d8584 100644 --- a/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php +++ b/sites/all/modules/ctools/tests/plugins/cached/ctoolsCachedPluginArray2.class.php @@ -1,5 +1,4 @@ <?php -// $Id: ctoolsCachedPluginArray2.class.php,v 1.1 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * A cached plugin object that tests inheritence including. diff --git a/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc b/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc index 609c7c0e..40a4bf73 100644 --- a/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc +++ b/sites/all/modules/ctools/tests/plugins/cached/plugin_array.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugin_array.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Chaos Tools plugin include using a plugin array to declare a plugin. diff --git a/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc b/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc index 5c1d2ce8..e6676154 100644 --- a/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc +++ b/sites/all/modules/ctools/tests/plugins/cached/plugin_array2.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugin_array2.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Chaos Tools plugin include using a plugin array to declare a plugin. diff --git a/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc b/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc index 4f39ff04..e3d3bfb9 100644 --- a/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc +++ b/sites/all/modules/ctools/tests/plugins/cached/plugin_array_dne.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugin_array_dne.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Chaos Tools plugin include using a plugin array to declare a plugin. diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php index 38666ce4..a3043bc6 100644 --- a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php +++ b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray.class.php @@ -1,5 +1,4 @@ <?php -// $Id: ctoolsNotCachedPluginArray.class.php,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * A cached plugin object that tests inheritence including. diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php index 5aa6db12..d7687dd0 100644 --- a/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php +++ b/sites/all/modules/ctools/tests/plugins/not_cached/ctoolsNotCachedPluginArray2.class.php @@ -1,5 +1,4 @@ <?php -// $Id: ctoolsNotCachedPluginArray2.class.php,v 1.1 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * A cached plugin object that tests including. diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc index a3c640e0..3f453935 100644 --- a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc +++ b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugin_array.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Chaos Tools plugin include using a plugin array to declare a plugin. diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc index e909cdcd..06b81757 100644 --- a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc +++ b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array2.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugin_array2.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Chaos Tools plugin include using a plugin array to declare a plugin. diff --git a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc index c1324537..1f19d2a4 100644 --- a/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc +++ b/sites/all/modules/ctools/tests/plugins/not_cached/plugin_array_dne.inc @@ -1,5 +1,4 @@ <?php -// $Id: plugin_array_dne.inc,v 1.1 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Chaos Tools plugin include using a plugin array to declare a plugin. diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views.inc index f825c809..1a7be12d 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views.inc @@ -1,5 +1,4 @@ <?php -// $Id: views.inc,v 1.17 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -80,7 +79,7 @@ function views_content_views_content_type_content_type($subtype, $plugin) { * Create the content type info array to give back to ctools for a given display. */ function _views_content_views_content_type($view) { - $title = $view->name; + $title = $view->get_human_name(); $icon = 'icon_views_page_legacy.png'; @@ -159,7 +158,7 @@ function views_content_views_content_type_render($subtype, $conf, $panel_args, $ $block = new stdClass(); $block->module = 'views'; - $block->delta = $view->name .'-'. $view->current_display; + $block->delta = $view->name . '-' . $view->current_display; if (!empty($conf['link_to_view'])) { $block->title_link = $view->get_url(); @@ -238,7 +237,7 @@ function views_content_views_select_display($form, &$form_state) { foreach ($view->display as $id => $display) { // Content pane views should never be used this way. if ($display->display_plugin != 'panel_pane') { - $displays[$id] = $display->display_title; + $displays[$id] = views_content_get_display_label($view, $id); } } @@ -273,7 +272,7 @@ function views_content_views_content_type_edit_form($form, &$form_state) { return; } - $form_state['title'] = t('Configure view @view (@display)', array('@view' => $view->name, '@display' => $view->display[$conf['display']]->display_title)); + $form_state['title'] = t('Configure view @view (@display)', array('@view' => $view->get_human_name(), '@display' => views_content_get_display_label($view, $view->current_display))); // @todo // If using the older format, just a context is listed. We should go through @@ -336,7 +335,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) { '#title' => t('Use pager'), '#default_value' => $conf['use_pager'], '#id' => 'use-pager-checkbox', - '#process' => array('ctools_dependent_process'), '#dependency' => array('override-pager-checkbox' => array(1)), ); $form['pager_settings']['pager_id'] = array( @@ -345,7 +343,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) { '#title' => t('Pager ID'), '#size' => 4, '#id' => 'use-pager-textfield', - '#process' => array('ctools_dependent_process'), '#dependency' => array('override-pager-checkbox' => array(1), 'use-pager-checkbox' => array(1)), '#dependency_count' => 2, '#suffix' => '</div>', @@ -356,7 +353,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) { '#default_value' => $conf['nodes_per_page'], '#size' => 4, '#title' => t('Num posts'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('override-pager-checkbox' => array(1)), ); @@ -366,7 +362,6 @@ function views_content_views_content_type_edit_form($form, &$form_state) { '#title' => t('Offset'), '#size' => 4, '#description' => t('The number of items to skip and not display.'), - '#process' => array('ctools_dependent_process'), '#dependency' => array('override-pager-checkbox' => array(1)), ); @@ -417,8 +412,8 @@ function views_content_views_content_type_admin_title($subtype, $conf) { return t('Deleted/missing view @view', array('@view' => $view)); } - $title = $view->display[$view->current_display]->display_title; - return t('View: @name', array('@name' => $view->name . '-' . $title)); + $title = views_content_get_display_label($view, $view->current_display); + return t('View: @name', array('@name' => $view->get_human_name() . ': ' . $title)); } /** @@ -435,7 +430,7 @@ function views_content_views_content_type_admin_info($subtype, $conf, $contexts) $block->title = t('View information'); $block->content = '<ul>'; - $block->content .= '<li>' . t('Using display @display.', array('@display' => $view->display[$display]->display_title)) . '</li>'; + $block->content .= '<li>' . t('Using display @display.', array('@display' => views_content_get_display_label($view, $display))) . '</li>'; if (!empty($conf['context']) && $arguments = $view->display_handler->get_handlers('argument')) { $argument = reset($arguments); diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc index b5aa4222..e938f539 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_attachments.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_attachments.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc index 7bcc86c9..4664d65d 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_empty.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_empty.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -12,9 +11,6 @@ $plugin = array( 'icon' => 'icon_views_page.png', 'description' => t('Display the view empty text if there are no results.'), 'required context' => new ctools_context_required(t('View'), 'view'), - 'defaults' => array( - 'which' => array(), - ), ); /** @@ -33,12 +29,16 @@ function views_content_views_empty_content_type_render($subtype, $conf, $panel_a $block->content = ''; $output = views_content_context_get_output($context); - $block->content = $output['empty']; + if (isset($output['empty'])) { + $block->content = $output['empty']; + } return $block; } function views_content_views_empty_content_type_edit_form($form, &$form_state) { + // This form does nothing; it exists to let the main form select the view context. + return $form; } function views_content_views_empty_content_type_edit_form_submit(&$form, &$form_state) { diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc index 8dd90f08..93371e21 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_exposed.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_exposed.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -12,9 +11,6 @@ $plugin = array( 'icon' => 'icon_views_page.png', 'description' => t('Display the view exposed widgets if there are no results.'), 'required context' => new ctools_context_required(t('View'), 'view'), - 'defaults' => array( - 'which' => array(), - ), ); /** @@ -39,6 +35,8 @@ function views_content_views_exposed_content_type_render($subtype, $conf, $panel } function views_content_views_exposed_content_type_edit_form($form, &$form_state) { + // This form does nothing; it exists to let the main form select the view context. + return $form; } function views_content_views_exposed_content_type_edit_form_submit(&$form, &$form_state) { diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc index 53b32592..f2fdb8af 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_feed.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_feed.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -12,13 +11,10 @@ $plugin = array( 'icon' => 'icon_views_page.png', 'description' => t('Display the view feed icon if there are no results.'), 'required context' => new ctools_context_required(t('View'), 'view'), - 'defaults' => array( - 'which' => array(), - ), ); /** - * Render the node_terms content type. + * Render the views feed content type. */ function views_content_views_feed_content_type_render($subtype, $conf, $panel_args, $context) { if (empty($context) || empty($context->data)) { @@ -39,6 +35,8 @@ function views_content_views_feed_content_type_render($subtype, $conf, $panel_ar } function views_content_views_feed_content_type_edit_form($form, &$form_state) { + // This form does nothing; it exists to let the main form select the view context. + return $form; } function views_content_views_feed_content_type_edit_form_submit(&$form, &$form_state) { diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc index 595c164f..81c87a3a 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_footer.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_footer.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -12,9 +11,6 @@ $plugin = array( 'icon' => 'icon_views_page.png', 'description' => t('Display the view footer if there are no results.'), 'required context' => new ctools_context_required(t('View'), 'view'), - 'defaults' => array( - 'which' => array(), - ), ); /** @@ -39,6 +35,8 @@ function views_content_views_footer_content_type_render($subtype, $conf, $panel_ } function views_content_views_footer_content_type_edit_form($form, &$form_state) { + // This form does nothing; it exists to let the main form select the view context. + return $form; } function views_content_views_footer_content_type_edit_form_submit(&$form, &$form_state) { diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc index 3a446556..f144d29f 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_header.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_header.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -12,9 +11,6 @@ $plugin = array( 'icon' => 'icon_views_page.png', 'description' => t('Display the view header if there are no results.'), 'required context' => new ctools_context_required(t('View'), 'view'), - 'defaults' => array( - 'which' => array(), - ), ); /** @@ -39,6 +35,8 @@ function views_content_views_header_content_type_render($subtype, $conf, $panel_ } function views_content_views_header_content_type_edit_form($form, &$form_state) { + // This form does nothing; it exists to let the main form select the view context. + return $form; } function views_content_views_header_content_type_edit_form_submit(&$form, &$form_state) { diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc index 24ae47b2..faa65692 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_pager.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_pager.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -12,9 +11,6 @@ $plugin = array( 'icon' => 'icon_views_page.png', 'description' => t('Display the view pager if there are no results.'), 'required context' => new ctools_context_required(t('View'), 'view'), - 'defaults' => array( - 'which' => array(), - ), ); /** @@ -39,6 +35,9 @@ function views_content_views_pager_content_type_render($subtype, $conf, $panel_a } function views_content_views_pager_content_type_edit_form($form, &$form_state) { + // This form does nothing; it exists to let the main form select the view context. + return $form; + } function views_content_views_pager_content_type_edit_form_submit(&$form, &$form_state) { diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc index 630e12a5..f1ccd1a7 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_panes.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_panes.inc,v 1.24 2011/01/05 19:53:36 merlinofchaos Exp $ /** * @file @@ -14,7 +13,6 @@ function views_content_views_panes_ctools_content_types() { return array( 'title' => t('View panes'), 'admin settings' => 'views_content_admin_form', - 'js' => array(drupal_get_path('module', 'ctools') . '/js/dependent.js'), ); } @@ -88,10 +86,7 @@ function _views_content_panes_content_type($view, $display) { return; } - $title = $display->handler->get_option('pane_title'); - if (!$title) { - $title = t('@view: @display', array('@view' => $view->name, '@display' => $display->display_title)); - } + $title = views_content_get_display_title($view, $display->id); $description = $display->handler->get_option('pane_description'); if (!$description) { @@ -108,19 +103,9 @@ function _views_content_panes_content_type($view, $display) { $contexts = array(); $arguments = $display->handler->get_argument_input(); + ctools_include('views'); foreach ($arguments as $argument) { - if ($argument['type'] == 'context') { - if (strpos($argument['context'], '.')) { - list($context, $converter) = explode('.', $argument['context'], 2); - } - else { - // Backwards-compat for before we had a system for delimiting the data - // we retrieve out of context objects. - $context = $argument['context']; - } - $class = 'ctools_context_' . (empty($argument['context_optional']) ? 'required' : 'optional'); - $contexts[] = new $class($argument['label'], $context); - } + $contexts[] = ctools_views_get_argument_context($argument); } $allow = $display->handler->get_option('allow'); @@ -151,6 +136,8 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a } $view->set_display($display); + views_content_views_panes_add_defaults($conf, $view); + if (!$view->display_handler->access($GLOBALS['user']) || !$view->display_handler->panel_pane_display) { return; } @@ -160,13 +147,12 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a $args = array(); $arguments = $view->display_handler->get_option('arguments'); - $context_keys = array_keys($contexts); foreach ($view->display_handler->get_argument_input() as $id => $argument) { switch ($argument['type']) { case 'context': $key = array_shift($context_keys); - if (isset($contexts [$key])) { + if (isset($contexts[$key])) { if (strpos($argument['context'], '.')) { list($context, $converter) = explode('.', $argument['context'], 2); $args[] = ctools_context_convert_context($contexts[$key], $converter); @@ -182,11 +168,11 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a break; case 'panel': - $args[] = $panel_args[$argument['panel']]; + $args[] = isset($panel_args[$argument['panel']]) ? $panel_args[$argument['panel']] : NULL; break; case 'user': - $args[] = (isset($conf['arguments'][$id]) && $conf['arguments'][$id] !== '') ? $conf['arguments'][$id] : NULL; + $args[] = (isset($conf['arguments'][$id]) && $conf['arguments'][$id] !== '') ? ctools_context_keyword_substitute($conf['arguments'][$id], array(), $contexts) : NULL; break; case 'wildcard': @@ -207,6 +193,7 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a while (count($args) && end($args) === NULL) { array_pop($args); } + $view->set_arguments($args); $allow = $view->display_handler->get_option('allow'); @@ -223,7 +210,7 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a $block = new stdClass(); $block->module = 'views'; - $block->delta = $view->name . $display; + $block->delta = $view->name . '-' . $display; if (($allow['link_to_view'] && !empty($conf['link_to_view'])) || (!$allow['link_to_view'] && $view->display_handler->get_option('link_to_view'))) { @@ -325,6 +312,26 @@ function views_content_views_panes_content_type_render($subtype, $conf, $panel_a return $block; } +/** + * Add defaults to view pane settings. + * This helps cover us if $allow settings changed and there are no actual + * settings for a particular item. + */ +function views_content_views_panes_add_defaults(&$conf, $view) { + $conf += array( + 'link_to_view' => $view->display_handler->get_option('link_to_view'), + 'more_link' => $view->display_handler->get_option('more_link'), + 'feed_icons' => FALSE, + 'use_pager' => $view->display_handler->get_option('use_pager'), + 'pager_id' => $view->display_handler->get_option('element_id'), + 'items_per_page' => $view->display_handler->get_option('items_per_page'), + 'offset' => $view->display_handler->get_option('offset'), + 'path_override' => FALSE, + 'path' => $view->get_path(), + 'fields_override' => $view->display_handler->get_option('fields_override'), + ); +} + /** * Returns an edit form for a block. */ @@ -337,27 +344,23 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) { $view = views_get_view($name); if (empty($view)) { - $form['markup'] = array('#value' => t('Broken/missing/deleted view.')); - return; + $form['markup'] = array('#markup' => t('Broken/missing/deleted view.')); + return $form; } $view->set_display($display_id); + // If it couldn't set the display and we got the default display instead, + // fail. + if ($view->current_display == 'default') { + $form['markup'] = array('#markup' => t('Broken/missing/deleted view display.')); + return $form; + } + $allow = $view->display_handler->get_option('allow'); // Provide defaults for everything in order to prevent warnings. - if (empty($conf)) { - $conf['link_to_view'] = $view->display_handler->get_option('link_to_view'); - $conf['more_link'] = $view->display_handler->get_option('more_link'); - $conf['feed_icons'] = FALSE; - $conf['use_pager'] = $view->display_handler->get_option('use_pager'); - $conf['pager_id'] = $view->display_handler->get_option('element_id'); - $conf['items_per_page'] = $view->display_handler->get_option('items_per_page'); - $conf['offset'] = $view->display_handler->get_option('offset'); - $conf['path_override'] = FALSE; - $conf['path'] = $view->get_path(); - $conf['fields_override'] = $view->display_handler->get_option('fields_override'); - } + views_content_views_panes_add_defaults($conf, $view); $form['arguments']['#tree'] = TRUE; @@ -366,7 +369,8 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) { $form['arguments'][$id] = array( '#type' => 'textfield', '#default_value' => isset($conf['arguments'][$id]) ? $conf['arguments'][$id] : '', - '#title' => $argument['label'], + '#description' => t('You may use keywords for substitutions.'), + '#title' => check_plain($argument['label']), ); } } @@ -405,7 +409,7 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) { foreach ($view->display_handler->get_handlers('field') as $field => $handler) { $title = $handler->ui_name(); if ($handler->options['label']) { - $title .= ' ('. $handler->options['label'] .')'; + $title .= ' (' . check_plain($handler->options['label']) . ')'; } $form['fields_override'][$field] = array( @@ -431,7 +435,6 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) { '#title' => t('Pager ID'), '#size' => 4, '#id' => 'use-pager-textfield', - '#process' => array('ctools_dependent_process'), '#dependency' => array('use-pager-checkbox' => array(1)), '#suffix' => '</div>', ); @@ -465,15 +468,11 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) { if (!empty($contexts)) { $form['path']['#description'] .= ' ' . t('You may use substitutions in this path.'); - // Add js for collapsible fieldsets manually - drupal_add_js('misc/collapse.js'); - - // We have to create a manual fieldset because fieldsets do not support IDs. - // Use 'hidden' instead of 'markup' so that the process will run. - $form['contexts_prefix'] = array( - '#type' => 'hidden', - '#id' => 'edit-path-substitutions', - '#prefix' => '<div><fieldset id="edit-path-substitutions" class="collapsed collapsible"><legend>' . t('Substitutions') . '</legend>', + $form['contexts'] = array( + '#type' => 'fieldset', + '#title' => t('Substitutions'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, ); $rows = array(); @@ -487,10 +486,7 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) { } $header = array(t('Keyword'), t('Value')); - $form['contexts']['context'] = array('#value' => theme('table', $header, $rows)); - $form['contexts_suffix'] = array( - '#value' => '</fieldset></div>', - ); + $form['contexts']['context'] = array('#markup' => theme('table', array('header' => $header, 'rows' => $rows))); } } @@ -512,7 +508,8 @@ function views_content_views_panes_content_type_edit_form($form, &$form_state) { $exposed_form_state['exposed_form_plugin'] = $view->display_handler->get_plugin('exposed_form'); } $view->init_handlers(); - $exposed_form = views_exposed_form($exposed_form_state); + $exposed_form = array(); + $exposed_form = views_exposed_form($exposed_form, $exposed_form_state); $form['exposed'] = array( '#tree' => TRUE, @@ -569,8 +566,11 @@ function views_content_views_panes_content_type_admin_title($subtype, $conf, $co } $view->set_display($display); - $title = $view->display_handler->get_option('pane_title'); - return check_plain($title ? $title : $view->name); + views_content_views_panes_add_defaults($conf, $view); + + $title = views_content_get_display_title($view, $display); + + return check_plain($title); } /** @@ -587,6 +587,7 @@ function views_content_views_panes_content_type_admin_info($subtype, $conf, $con } $view->set_display($display_name); + views_content_views_panes_add_defaults($conf, $view); // Add arguments first if (!empty($conf['arguments'])) { @@ -596,7 +597,7 @@ function views_content_views_panes_content_type_admin_info($subtype, $conf, $con foreach ($conf['arguments'] as $key => $value) { $label = $argument_input[$key]['label']; - $info[] = $label .': '. $value; + $info[] = $label . ': ' . $value; } } diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc index 82334801..827d3603 100644 --- a/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_row.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_row.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file @@ -45,10 +44,14 @@ function views_content_views_row_content_type_render($subtype, $conf, $panel_arg // This guarantees the view is rendered normally which must happen. $view = views_content_context_get_view($context); $output = views_content_context_get_output($context); + // Rows are keyed by result id value and need to be reset. + $output['rows'] = array_values($output['rows']); if (empty($conf['use_fields']) || empty($view->style_plugin->row_plugin)) { foreach ($conf['rows'] as $row) { // We store the row number 1-indexed but they are 0-indexed internally. - $block->content .= $output['rows'][$row - 1]; + if (isset($output['rows'][$row - 1])) { + $block->content .= $output['rows'][$row - 1]; + } } } else { @@ -71,24 +74,36 @@ function views_content_views_row_content_type_render($subtype, $conf, $panel_arg function views_content_views_row_content_type_edit_form($form, &$form_state) { // This form does nothing; it exists to let the main form select the view context. + return $form; } -function views_content_views_row_content_type_edit_form_submit(&$form, &$form_state) { - +function views_content_views_row_content_type_edit_form_submit($form, &$form_state) { } -function views_content_views_row_edit(&$form, &$form_state) { +function views_content_views_row_edit($form, &$form_state) { $conf = $form_state['conf']; + $contexts = $form_state['contexts']; - if (empty($form_state['contexts'][$conf['context']])) { - $form['markup'] = array('#value' => '<p>' . t('Invalid context selected.') . '</p>'); - return; + if (empty($contexts[$conf['context']])) { + $form['markup'] = array('#markup' => '<p>' . t('Invalid context selected.') . '</p>'); + return $form; } - $view = views_content_context_get_view($form_state['contexts'][$conf['context']]); + if (!isset($contexts[$conf['context']]->argument)) { + $name = $contexts[$conf['context']]->placeholder['conf']['name']; + list($plugin, $view_data) = explode(':', $name); + list($view_name, $display_id) = explode('-', $view_data); + } + else { + $view_data = $contexts[$conf['context']]->argument; + list($view_name, $display_id) = explode(':', $view_data); + } + $contexts[$conf['context']]->data['name'] = $view_name; + $contexts[$conf['context']]->data['display'] = $display_id; + $view = views_content_context_get_view($contexts[$conf['context']]); if (empty($view)) { - $form['markup'] = array('#value' => '<p>' . t('Context contains an invalid view.') . '</p>'); - return; + $form['markup'] = array('#markup' => '<p>' . t('Context contains an invalid view.') . '</p>'); + return $form; } // Support Views 2 and Views 3. @@ -100,8 +115,8 @@ function views_content_views_row_edit(&$form, &$form_state) { $rows = $view->display_handler->get_option('items_per_page'); } if (empty($rows)) { - $form['markup'] = array('#value' => '<p>' . t('The view must have a maximum number of items set to use this content type.') . '</p>'); - return; + $form['markup'] = array('#markup' => '<p>' . t('The view must have a maximum number of items set to use this content type.') . '</p>'); + return $form; } foreach (range(1, $rows) as $row) { @@ -129,10 +144,10 @@ function views_content_views_row_edit(&$form, &$form_state) { '#default_value' => $conf['fields'], '#prefix' => '<div id="edit-fields-wrapper"><div id="edit-fields">', '#suffix' => '</div></div>', - '#process' => array('ctools_dependent_process', 'expand_checkboxes'), '#dependency' => array('edit-use-fields' => array(TRUE)), ); } + return $form; } function views_content_views_row_edit_validate(&$form, &$form_state) { diff --git a/sites/all/modules/ctools/views_content/plugins/content_types/views_view.inc b/sites/all/modules/ctools/views_content/plugins/content_types/views_view.inc new file mode 100644 index 00000000..dfb1175c --- /dev/null +++ b/sites/all/modules/ctools/views_content/plugins/content_types/views_view.inc @@ -0,0 +1,52 @@ +<?php + +/** + * @file + * Allow a view context to be displayed as whole. + */ + +$plugin = array( + 'title' => t('Entire view'), + 'category' => t('View context'), + 'icon' => 'icon_views_page.png', + 'description' => t('Display the entire view.'), + 'required context' => new ctools_context_required(t('View'), 'view'), +); + +/** + * Render the views view content type. + */ +function views_content_views_view_content_type_render($subtype, $conf, $panel_args, $context) { + if (empty($context) || empty($context->data)) { + return; + } + + // Build the content type block. + $block = new stdClass(); + $block->module = 'views_view'; + $block->delta = $context->argument; + $block->title = ''; + $block->content = ''; + + $output = views_content_context_get_output($context); + $output = $output['view']->preview(); + $block->content = $output; + + return $block; +} + +function views_content_views_view_content_type_edit_form($form, &$form_state) { + // This form does nothing; it exists to let the main form select the view context. + return $form; +} + +function views_content_views_view_content_type_edit_form_submit(&$form, &$form_state) { + // Kept so we guarantee we have a submit handler. +} + +/** + * Returns the administrative title for a type. + */ +function views_content_views_view_content_type_admin_title($subtype, $conf, $context) { + return t('"@context" entire view', array('@context' => $context->identifier)); +} diff --git a/sites/all/modules/ctools/views_content/plugins/contexts/view.inc b/sites/all/modules/ctools/views_content/plugins/contexts/view.inc index fed1f8f9..1e926e45 100644 --- a/sites/all/modules/ctools/views_content/plugins/contexts/view.inc +++ b/sites/all/modules/ctools/views_content/plugins/contexts/view.inc @@ -1,5 +1,4 @@ <?php -// $Id: view.inc,v 1.2 2010/10/11 22:18:24 sdboyer Exp $ /** * @file @@ -17,29 +16,61 @@ $plugin = array( 'description' => t('Loads a view result into a context that can then be displayed across a panel or turned into other contexts.'), 'context' => 'views_content_context_view_create', - 'settings form' => 'views_content_context_view_settings_form', - 'settings form validate' => 'views_content_context_view_settings_form_validate', - 'settings form submit' => 'views_content_context_view_settings_form_submit', + 'edit form' => 'views_content_context_view_settings_form', + 'edit form validate' => 'views_content_context_view_settings_form_validate', + 'edit form submit' => 'views_content_context_view_settings_form_submit', 'defaults' => array('view' => ''), 'keyword' => 'view', 'context name' => 'view', - /* - 'convert list' => 'views_content_context_view_convert_list', - 'convert' => 'views_content_context_view_convert', - */ - - /* - 'placeholder form' => array( - '#type' => 'textfield', - '#description' => t('Enter the node ID of a node for this context.'), - ), - */ + 'get child' => 'views_content_context_view_get_child', + 'get children' => 'views_content_context_view_get_children', ); -function views_content_context_view_create($empty, $data = NULL, $conf = FALSE) { +function views_content_context_view_get_child($plugin, $parent, $child) { + list($name, $id) = explode('-', $child, 2); + $view = views_get_view($name); + if (!$view) { + return; + } + + $view->set_display($id); + if ($view->current_display != $id) { + return; + } + + $info = _views_content_get_context_from_display($view, $id, $parent, FALSE); + if ($info) { + return $info; + } + return; +} + +function views_content_context_view_get_children($plugin, $parent) { + $types = array( + 'view' => $plugin, + ); + + // We're keeping the 'view' context around for legacy reasons but + // we want to disable the UI so you can't add it that way anymore. + $types['view']['no ui'] = TRUE; + + $views = views_get_applicable_views('returns context'); + foreach ($views as $data) { + list($view, $id) = $data; + $info = _views_content_get_context_from_display($view, $id, $parent, FALSE); + if ($info) { + $info['no required context ui'] = TRUE; + $types[$info['name']] = $info; + } + } + + return $types; +} + +function views_content_context_view_create($empty, $data = NULL, $conf = FALSE, $plugin = array()) { $context = new ctools_context('view'); $context->plugin = 'view'; @@ -49,20 +80,31 @@ function views_content_context_view_create($empty, $data = NULL, $conf = FALSE) if ($conf) { if (is_array($data) && !empty($data['view'])) { + // This code is left in for backward compatibility. Will not be used + // with child plugins. list($name, $display_id) = explode(':', $data['view'], 2); $data = views_get_view($name); if ($data) { $data->set_display($display_id); } } + else if (!empty($plugin['view name'])) { + $data = views_get_view($plugin['view name']); + $data->set_display($plugin['view display id']); + } } - if (is_object($data)) { + if (is_object($data) && $data->current_display != 'default') { // We don't store the loaded view as we don't want the view object - // cached. + // cached. However, in order to extract it you can use: + // @code + // $output = views_content_context_get_output($context); + // $view = $output['view']; + // @endcode $context->data = array( 'name' => $data->name, 'display' => $data->current_display, + 'args' => $data->args, ); // At runtime, this can get populated. Once it is populated this @@ -82,10 +124,7 @@ function views_content_context_view_settings_form($form, &$form_state) { $views = views_get_applicable_views('returns context'); foreach ($views as $data) { list($view, $id) = $data; - $title = $view->display_handler->get_option('admin_title'); - if (!$title) { - $title = $view->name; - } + $title = views_content_get_display_title($view, $id, 'admin_title'); $options[$view->name . ':' . $id] = $title; } diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc b/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc index de8f3e9c..55ed9457 100644 --- a/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc +++ b/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc @@ -1,5 +1,4 @@ <?php -// $Id: node_from_view.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc b/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc index e99dcf8f..bc75062a 100644 --- a/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc +++ b/sites/all/modules/ctools/views_content/plugins/relationships/term_from_view.inc @@ -1,5 +1,4 @@ <?php -// $Id: term_from_view.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc b/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc index 62e907ff..eb594859 100644 --- a/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc +++ b/sites/all/modules/ctools/views_content/plugins/relationships/user_from_view.inc @@ -1,5 +1,4 @@ <?php -// $Id: user_from_view.inc,v 1.2 2010/10/11 22:18:22 sdboyer Exp $ /** * @file diff --git a/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc b/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc new file mode 100644 index 00000000..4da5fe55 --- /dev/null +++ b/sites/all/modules/ctools/views_content/plugins/relationships/view_from_argument.inc @@ -0,0 +1,101 @@ +<?php +// $Id$ + +/** + * @file + * Plugin to provide an relationship handler for a view by argument input settings. + */ + +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'title' => t('View From Argument'), + 'description' => t('Creates a view context from argument input settings.'), + 'context' => 'views_content_view_from_argument_context', + 'get child' => 'views_content_view_from_argument_get_child', + 'get children' => 'views_content_view_from_argument_get_children', +); + +function views_content_view_from_argument_get_child($plugin, $parent, $child) { + list($name, $id) = explode('-', $child, 2); + $view = views_get_view($name); + if (!$view) { + return; + } + + $view->set_display($id); + if ($view->current_display != $id) { + return; + } + + $info = _views_content_get_context_from_display($view, $id, $parent, TRUE); + if ($info) { + return $info; + } + return; +} + +function views_content_view_from_argument_get_children($plugin, $parent) { + $types = array(); + + $views = views_get_applicable_views('returns context'); + foreach ($views as $data) { + list($view, $id) = $data; + $info = _views_content_get_context_from_display($view, $id, $parent, TRUE); + if ($info) { + $types[$info['name']] = $info; + } + } + + return $types; +} + +/** + * Return a new context based on an existing context. + */ +function views_content_view_from_argument_context($contexts, $conf) { + $name = $conf['name']; + list($plugin, $view_data) = explode(':', $name); + list($view_name, $display_id) = explode('-', $view_data); + $keys = array_keys($conf['context']); + + if (empty($contexts[$keys[0]]->data)) { + return ctools_context_create_empty('view', NULL); + } + + // Load our view up. + $data = views_get_view($view_name); + if ($data) { + // Set the display. + $data->set_display($display_id); + $context_keys = array_keys($contexts); + foreach ($data->display_handler->get_argument_input() as $id => $argument) { + if ($argument['type'] == 'context') { + $key = array_shift($context_keys); + if (isset($contexts [$key])) { + if (strpos($argument['context'], '.')) { + list($context, $converter) = explode('.', $argument['context'], 2); + $args[] = ctools_context_convert_context($contexts[$key], $converter); + } + else { + $args[] = $contexts[$key]->argument; + } + } + } + } + // remove any trailing NULL arguments as these are non-args: + while (count($args) && end($args) === NULL) { + array_pop($args); + } + $data->set_arguments($args); + if ($path = $data->display_handler->get_option('inherit_panels_path')) { + $data->override_path = $_GET['q']; + } + } + + if (isset($contexts[$keys[0]]->data)) { + return ctools_context_create('view', $data); + } +} diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc index 6e35bce2..db564c7f 100644 --- a/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc +++ b/sites/all/modules/ctools/views_content/plugins/views/views_content.views.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_content.views.inc,v 1.4 2010/09/07 09:02:51 sdboyer Exp $ /** * @file @@ -14,6 +13,7 @@ function views_content_views_plugins() { 'display' => array( 'panel_pane' => array( 'title' => t('Content pane'), + 'admin' => t('Content pane'), 'help' => t('Is available as content for a panel or dashboard display.'), 'handler' => 'views_content_plugin_display_panel_pane', 'path' => drupal_get_path('module', 'views_content') . '/plugins/views', @@ -27,6 +27,7 @@ function views_content_views_plugins() { ), 'ctools_context' => array( 'title' => t('Context'), + 'admin' => t('Context'), 'help' => t('Makes the view results available as a context for use in Panels and other applications.'), 'handler' => 'views_content_plugin_display_ctools_context', 'path' => drupal_get_path('module', 'views_content') . '/plugins/views', diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc index 6a5759fd..55febe17 100644 --- a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc +++ b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_ctools_context.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_content_plugin_display_ctools_context.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Contains the block display plugin. @@ -11,6 +10,12 @@ * @ingroup views_display_plugins */ class views_content_plugin_display_ctools_context extends views_plugin_display { + /** + * If this variable is true, this display counts as a context. We use this + * variable so that we can easily build plugins against this display type. + */ + var $context_display = TRUE; + function get_style_type() { return 'context'; } function defaultable_sections($section = NULL) { @@ -33,6 +38,8 @@ class views_content_plugin_display_ctools_context extends views_plugin_display { $options['defaults']['default']['style_options'] = FALSE; $options['defaults']['default']['row_plugin'] = FALSE; $options['defaults']['default']['row_options'] = FALSE; + $options['inherit_panels_path'] = array('default' => 0); + $options['argument_input'] = array('default' => array()); return $options; } @@ -55,7 +62,7 @@ class views_content_plugin_display_ctools_context extends views_plugin_display { */ function render() { if (!empty($this->previewing)) { - return theme($this->theme_functions(), $this->view); + return theme($this->theme_functions(), array('view' => $this->view)); } else { // We want to process the view like we're theming it, but not actually @@ -91,6 +98,10 @@ class views_content_plugin_display_ctools_context extends views_plugin_display { $categories['context'] = array( 'title' => t('Context settings'), + 'column' => 'second', + 'build' => array( + '#weight' => -10, + ), ); $admin_title = $this->get_option('admin_title'); @@ -108,6 +119,17 @@ class views_content_plugin_display_ctools_context extends views_plugin_display { 'value' => $admin_title, ); + $options['inherit_panels_path'] = array( + 'category' => 'context', + 'title' => t('Use Panel path'), + 'value' => $this->get_option('inherit_panels_path') ? t('Yes') : t('No'), + ); + + $options['argument_input'] = array( + 'category' => 'context', + 'title' => t('Argument input'), + 'value' => t('Edit'), + ); } /** @@ -130,6 +152,63 @@ class views_content_plugin_display_ctools_context extends views_plugin_display { '#description' => t('This is the title that will appear for this view context in the configure context dialog. If left blank, the view name will be used.'), ); break; + case 'inherit_panels_path': + $form['#title'] .= t('Inherit path from panel display'); + + $form['inherit_panels_path'] = array( + '#type' => 'select', + '#options' => array(1 => t('Yes'), 0 => t('No')), + '#default_value' => $this->get_option('inherit_panels_path'), + '#description' => t('If yes, all links generated by Views, such as more links, summary links, and exposed input links will go to the panels display path, not the view, if the display has a path.'), + ); + break; + case 'argument_input': + $form['#title'] .= t('Choose the data source for view arguments'); + $argument_input = $this->get_argument_input(); + ctools_include('context'); + ctools_include('dependent'); + $form['argument_input']['#tree'] = TRUE; + + $converters = ctools_context_get_all_converters(); + ksort($converters); + + foreach ($argument_input as $id => $argument) { + $form['argument_input'][$id] = array( + '#tree' => TRUE, + ); + + $safe = str_replace(array('][', '_', ' ', ':'), '-', $id); + $type_id = 'edit-argument-input-' . $safe; + + $form['argument_input'][$id]['type'] = array( + '#type' => 'select', + '#options' => array( + 'none' => t('No argument'), + 'context' => t('From context'), + ), + '#id' => $type_id, + '#title' => t('@arg source', array('@arg' => $argument['name'])), + '#default_value' => $argument['type'], + ); + + $form['argument_input'][$id]['context'] = array( + '#type' => 'select', + '#title' => t('Required context'), + '#description' => t('If "From context" is selected, which type of context to use.'), + '#default_value' => $argument['context'], + '#options' => $converters, + '#dependency' => array($type_id => array('context')), + ); + + $form['argument_input'][$id]['context_optional'] = array( + '#type' => 'checkbox', + '#title' => t('Context is optional'), + '#description' => t('This context need not be present for the pane to function. If you plan to use this, ensure that the argument handler can handle empty values gracefully.'), + '#default_value' => $argument['context_optional'], + '#dependency' => array($type_id => array('context')), + ); + } + break; } } @@ -142,15 +221,49 @@ class views_content_plugin_display_ctools_context extends views_plugin_display { parent::options_submit($form, $form_state); switch ($form_state['section']) { case 'admin_title': + case 'argument_input': + case 'inherit_panels_path': $this->set_option($form_state['section'], $form_state['values'][$form_state['section']]); break; } } /** - * Block views use exposed widgets only if AJAX is set. + * Adjust the array of argument input to match the current list of + * arguments available for this display. This ensures that changing + * the arguments doesn't cause the argument input field to just + * break. */ - function uses_exposed() { - return FALSE; + function get_argument_input() { + $arguments = $this->get_option('argument_input'); + $handlers = $this->get_handlers('argument'); + + // We use a separate output so as to seamlessly discard info for + // arguments that no longer exist. + $output = array(); + + foreach ($handlers as $id => $handler) { + if (empty($arguments[$id])) { + $output[$id] = array( + 'type' => 'none', + 'context' => 'any', + 'context_optional' => FALSE, + 'name' => $handler->ui_name(), + ); + } + else { + $output[$id] = $arguments[$id]; + $output[$id]['name'] = $handler->ui_name(); + } + } + + return $output; + } + + function get_path() { + if ($this->get_option('inherit_panels_path')) { + return $_GET['q']; + } + return parent::get_path(); } } diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc index f8108a9b..06225afb 100644 --- a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc +++ b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_display_panel_pane.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_content_plugin_display_panel_pane.inc,v 1.7 2011/01/01 01:27:38 merlinofchaos Exp $ /** * The plugin that handles a panel_pane. @@ -65,6 +64,10 @@ class views_content_plugin_display_panel_pane extends views_plugin_display { $categories['panel_pane'] = array( 'title' => t('Pane settings'), + 'column' => 'second', + 'build' => array( + '#weight' => -10, + ), ); $pane_title = $this->get_option('pane_title'); @@ -240,6 +243,9 @@ class views_content_plugin_display_panel_pane extends views_plugin_display { ctools_include('dependent'); $form['argument_input']['#tree'] = TRUE; + $converters = ctools_context_get_all_converters(); + ksort($converters); + foreach ($argument_input as $id => $argument) { $form['argument_input'][$id] = array( '#tree' => TRUE, @@ -262,14 +268,12 @@ class views_content_plugin_display_panel_pane extends views_plugin_display { '#title' => t('@arg source', array('@arg' => $argument['name'])), '#default_value' => $argument['type'], ); - $form['argument_input'][$id]['context'] = array( '#type' => 'select', '#title' => t('Required context'), '#description' => t('If "From context" is selected, which type of context to use.'), '#default_value' => $argument['context'], - '#options' => ctools_context_get_all_converters(), - '#process' => array('form_process_select', 'ctools_dependent_process'), + '#options' => $converters, '#dependency' => array($type_id => array('context')), ); @@ -278,7 +282,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display { '#title' => t('Context is optional'), '#description' => t('This context need not be present for the pane to function. If you plan to use this, ensure that the argument handler can handle empty values gracefully.'), '#default_value' => $argument['context_optional'], - '#process' => array('form_process_checkbox', 'ctools_dependent_process'), '#dependency' => array($type_id => array('context')), ); @@ -288,7 +291,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display { '#description' => t('If "From panel argument" is selected, which panel argument to use.'), '#default_value' => $argument['panel'], '#options' => array(0 => t('First'), 1 => t('Second'), 2 => t('Third'), 3 => t('Fourth'), 4 => t('Fifth'), 5 => t('Sixth')), - '#process' => array('form_process_select', 'ctools_dependent_process'), '#dependency' => array($type_id => array('panel')), ); @@ -297,7 +299,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display { '#title' => t('Fixed argument'), '#description' => t('If "Fixed" is selected, what to use as an argument.'), '#default_value' => $argument['fixed'], - '#process' => array('ctools_dependent_process'), '#dependency' => array($type_id => array('fixed')), ); @@ -306,7 +307,6 @@ class views_content_plugin_display_panel_pane extends views_plugin_display { '#title' => t('Label'), '#description' => t('If this argument is presented to the panels user, what label to apply to it.'), '#default_value' => empty($argument['label']) ? $argument['name'] : $argument['label'], - '#process' => array('ctools_dependent_process'), '#dependency' => array($type_id => array('user')), ); } diff --git a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc index ce79b583..837f2e17 100644 --- a/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc +++ b/sites/all/modules/ctools/views_content/plugins/views/views_content_plugin_style_ctools_context.inc @@ -1,5 +1,4 @@ <?php -// $Id: views_content_plugin_style_ctools_context.inc,v 1.2 2010/10/11 22:18:23 sdboyer Exp $ /** * @file * Contains the default style plugin. diff --git a/sites/all/modules/ctools/views_content/views_content.info b/sites/all/modules/ctools/views_content/views_content.info index f7132f3c..1da408bf 100644 --- a/sites/all/modules/ctools/views_content/views_content.info +++ b/sites/all/modules/ctools/views_content/views_content.info @@ -1,4 +1,3 @@ -; $Id: views_content.info,v 1.6 2011/01/01 00:01:46 merlinofchaos Exp $ name = Views content panes description = Allows Views content to be used in Panels, Dashboard and other modules which use the CTools Content API. package = Views @@ -10,9 +9,9 @@ files[] = plugins/views/views_content_plugin_display_ctools_context.inc files[] = plugins/views/views_content_plugin_display_panel_pane.inc files[] = plugins/views/views_content_plugin_style_ctools_context.inc -; Information added by drupal.org packaging script on 2011-01-06 -version = "7.x-1.0-alpha2" +; Information added by drupal.org packaging script on 2011-05-31 +version = "7.x-1.0-beta1" core = "7.x" project = "ctools" -datestamp = "1294276864" +datestamp = "1306885315" diff --git a/sites/all/modules/ctools/views_content/views_content.module b/sites/all/modules/ctools/views_content/views_content.module index aee8ad1d..e5074f5f 100644 --- a/sites/all/modules/ctools/views_content/views_content.module +++ b/sites/all/modules/ctools/views_content/views_content.module @@ -1,5 +1,4 @@ <?php -// $Id: views_content.module,v 1.8 2010/11/01 18:51:22 merlinofchaos Exp $ /** * @file views_content.module @@ -166,6 +165,7 @@ function views_content_context_get_view(&$context) { $context->view = views_get_view($context->data['name']); if ($context->view) { $context->view->set_display($context->data['display']); + $context->view->set_arguments($context->data['args']); } } @@ -183,3 +183,101 @@ function views_content_context_get_output(&$context) { return $context->output; } + +/** + * Get the title to display for a views content display for pane or context. + */ +function views_content_get_display_title($view, $display_id, $option = 'pane_title') { + $handler = $view->display[$display_id]->handler; + $title = $handler->get_option($option); + if (!$title) { + if ($handler->display->display_title == $handler->definition['title']) { + $title = t('View: @view', array('@view' => $view->get_human_name())); + } + else { + $title = t('View: @view: @display', array('@view' => $view->get_human_name(), '@display' => $handler->display->display_title)); + } + } + + return $title; +} + +/** + * Get the proper label for a display. + * + * Views renamed the default to Master, but it can still have a conflicting + * display title. Fix that. + */ +function views_content_get_display_label($view, $display_id) { + $title = $display_id == 'default' ? t('Master') : $view->display[$display_id]->display_title; + return $title; +} + +/** + * Get the child plugin for a view context display. + * + * This can return both the context and relationship style. The + * $required parameter is used to distinguish if context is required + * or not, so we know whether we need it suitable as a pure context + * (i.e, no context required) or a relationship (i.e, context required). + */ +function _views_content_get_context_from_display($view, $id, $parent, $required = TRUE) { + $title = views_content_get_display_title($view, $id, 'admin_title'); + + $description = $view->description; + $contexts = array(); + + $arguments = $view->display_handler->get_argument_input(); + ctools_include('views'); + foreach ($arguments as $argument) { + $argument['label'] = $argument['name'] ? $argument['name'] : ''; + $contexts[] = ctools_views_get_argument_context($argument); + } + + $pass = FALSE; + if ($required) { + // If context is required, make sure we have at least one optional + // or required context. + foreach ($contexts as $context) { + if (is_object($context)) { + $pass = TRUE; + break; + } + } + + if (!$pass) { + return; + } + } + else { + // If context is not required, then having any required context + // causes a fail. + foreach ($contexts as $context) { + if (is_object($context) && get_class($context) == 'ctools_context_required') { + return; + } + } + + // Since we know we don't want contexts, we an unset this now. + $contexts = array(); + } + + if ($required) { + $function = 'views_content_view_from_argument_context'; + } + else { + $function = 'views_content_context_view_create'; + } + + return array( + 'title' => $title, + 'description' => filter_xss_admin($description), + 'required context' => $contexts, + 'keyword' => 'view', + 'context' => $function, + 'context name' => $view->name, + 'name' => $parent . ':' . $view->name . '-' . $id, + 'view name' => $view->name, + 'view display id' => $id, + ); +} diff --git a/sites/all/modules/google_analytics/README.txt b/sites/all/modules/google_analytics/README.txt index a17a80eb..1628cf78 100644 --- a/sites/all/modules/google_analytics/README.txt +++ b/sites/all/modules/google_analytics/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.10.2.4 2011/02/07 16:56:27 hass Exp $ Module: Google Analytics Author: Alexander Hass <http://drupal.org/user/85918> @@ -39,9 +38,10 @@ default the following pages are listed for exclusion: admin admin/* -user/*/* +batch node/add* node/*/* +user/*/* These defaults are changeable by the website administrator or any other user with 'administer google analytics' permission. diff --git a/sites/all/modules/google_analytics/googleanalytics.admin.inc b/sites/all/modules/google_analytics/googleanalytics.admin.inc index 4102eec8..f690bcc4 100644 --- a/sites/all/modules/google_analytics/googleanalytics.admin.inc +++ b/sites/all/modules/google_analytics/googleanalytics.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: googleanalytics.admin.inc,v 1.24.2.28 2011/02/07 14:41:11 hass Exp $ /** * @file @@ -87,7 +86,7 @@ function googleanalytics_admin_settings_form($form_state) { // Page specific visibility configurations. $php_access = user_access('use PHP for tracking visibility'); $visibility = variable_get('googleanalytics_visibility_pages', 0); - $pages = variable_get('googleanalytics_pages', ''); + $pages = variable_get('googleanalytics_pages', GOOGLEANALYTICS_PAGES); $form['tracking']['page_vis_settings'] = array( '#type' => 'fieldset', @@ -198,8 +197,8 @@ function googleanalytics_admin_settings_form($form_state) { '#title' => t('List of download file extensions'), '#title_display' => 'invisible', '#type' => 'textfield', - '#default_value' => variable_get('googleanalytics_trackfiles_extensions', GA_TRACKFILES_EXTENSIONS), - '#description' => t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: !extensions', array('!extensions' => GA_TRACKFILES_EXTENSIONS)), + '#default_value' => variable_get('googleanalytics_trackfiles_extensions', GOOGLEANALYTICS_TRACKFILES_EXTENSIONS), + '#description' => t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: !extensions', array('!extensions' => GOOGLEANALYTICS_TRACKFILES_EXTENSIONS)), '#maxlength' => 255, ); $form['tracking']['linktracking']['googleanalytics_trackoutboundaspageview'] = array( @@ -235,6 +234,24 @@ function googleanalytics_admin_settings_form($form_state) { '#default_value' => variable_get('googleanalytics_trackadsense', FALSE), ); + // Privacy specific configurations. + $form['tracking']['privacy'] = array( + '#type' => 'fieldset', + '#title' => t('Privacy'), + ); + $form['tracking']['privacy']['googleanalytics_tracker_anonymizeip'] = array( + '#type' => 'checkbox', + '#title' => t('Anonymize visitors IP address'), + '#description' => t('Tell Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage. Note that this will slightly reduce the accuracy of geographic reporting. In some countries it is not allowed to collect personally identifying information for privacy reasons and this setting may help you to comply with the local laws.'), + '#default_value' => variable_get('googleanalytics_tracker_anonymizeip', 0), + ); + $form['tracking']['privacy']['googleanalytics_privacy_donottrack'] = array( + '#type' => 'checkbox', + '#title' => t('Universal web tracking opt-out'), + '#description' => t('If enabled and your server receives the <a href="http://donottrack.us/">Do-Not-Track</a> header from the client browser, the Google Analytics module will not embed any tracking code into your site. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision. This feature is currently limited to logged in users and disabled page caching.'), + '#default_value' => variable_get('googleanalytics_privacy_donottrack', 1), + ); + // Backward compatibility only. // TODO: If currently not in use, hide the UI and later remove the code. $segmentation = variable_get('googleanalytics_segmentation', array()); @@ -268,6 +285,7 @@ function googleanalytics_admin_settings_form($form_state) { } $form['googleanalytics_custom_var'] = array( + '#collapsed' => TRUE, '#collapsible' => TRUE, '#description' => t('You can add Google Analytics <a href="!custom_var_documentation">Custom Variables</a> here. These will be added to every page that Google Analytics tracking code appears on. Google Analytics will only accept custom variables if the <em>name</em> and <em>value</em> combined are less than 64 bytes after URL encoding. Keep the names as short as possible and expect long values to get trimmed. You may use tokens in custom variable values. Global and user tokens are always available; on node pages, node tokens are also available.', array('!custom_var_documentation' => 'http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingCustomVariables.html')), '#theme' => 'googleanalytics_admin_custom_var_table', @@ -341,13 +359,6 @@ function googleanalytics_admin_settings_form($form_state) { '#collapsed' => TRUE, ); - $form['advanced']['googleanalytics_tracker_anonymizeip'] = array( - '#type' => 'checkbox', - '#title' => t('Anonymize visitors IP address'), - '#description' => t('Tell Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage. Note that this will slightly reduce the accuracy of geographic reporting. In some countries it is not allowed to collect personally identifying information for privacy reasons and this setting may help you to comply with the local laws.'), - '#default_value' => variable_get('googleanalytics_tracker_anonymizeip', 0), - ); - $form['advanced']['googleanalytics_cache'] = array( '#type' => 'checkbox', '#title' => t('Locally cache tracking code file'), diff --git a/sites/all/modules/google_analytics/googleanalytics.admin.js b/sites/all/modules/google_analytics/googleanalytics.admin.js index 3571c8c9..796eee6a 100644 --- a/sites/all/modules/google_analytics/googleanalytics.admin.js +++ b/sites/all/modules/google_analytics/googleanalytics.admin.js @@ -1,4 +1,3 @@ -// $Id: googleanalytics.admin.js,v 1.1.2.7 2011/02/07 15:20:57 hass Exp $ (function ($) { /** @@ -98,6 +97,20 @@ Drupal.behaviors.trackingSettingsSummary = { return Drupal.t('Multiple top-level domains'); } }); + + $('fieldset#edit-privacy', context).drupalSetSummary(function (context) { + var vals = []; + if ($('input#edit-googleanalytics-tracker-anonymizeip', context).is(':checked')) { + vals.push('Anonymize IP'); + } + if ($('input#edit-googleanalytics-privacy-donottrack', context).is(':checked')) { + vals.push('Universal web tracking opt-out'); + } + if (!vals.length) { + return Drupal.t('No privacy'); + } + return Drupal.t('@items enabled', {'@items' : vals.join(', ')}); + }); } }; diff --git a/sites/all/modules/google_analytics/googleanalytics.info b/sites/all/modules/google_analytics/googleanalytics.info index b0bd35f3..0888a39e 100644 --- a/sites/all/modules/google_analytics/googleanalytics.info +++ b/sites/all/modules/google_analytics/googleanalytics.info @@ -1,4 +1,3 @@ -; $Id: googleanalytics.info,v 1.12.2.3 2011/01/02 22:01:30 hass Exp $ name = "Google Analytics" description = Allows your site to be tracked by Google Analytics by adding a Javascript tracking code to every page. core = 7.x @@ -6,9 +5,9 @@ package = Statistics configure = admin/config/system/googleanalytics files[] = googleanalytics.test -; Information added by drupal.org packaging script on January 1, 1970 - 00:00 -version = "7.x-1.1" +; Information added by drupal.org packaging script on 2011-03-28 +version = "7.x-1.2" core = "7.x" project = "google_analytics" -datestamp = "1297103606" +datestamp = "1301340367" diff --git a/sites/all/modules/google_analytics/googleanalytics.install b/sites/all/modules/google_analytics/googleanalytics.install index fafba6f0..ebb90064 100644 --- a/sites/all/modules/google_analytics/googleanalytics.install +++ b/sites/all/modules/google_analytics/googleanalytics.install @@ -1,5 +1,4 @@ <?php -// $Id: googleanalytics.install,v 1.22.2.16 2011/02/07 14:29:06 hass Exp $ /** * @file @@ -10,19 +9,6 @@ * Implements hook_install(). */ function googleanalytics_install() { - variable_set('googleanalytics_visibility_roles', 0); - variable_set('googleanalytics_visibility_pages', 0); - - // Remove tracking from all administrative pages, see http://drupal.org/node/34970. - $pages = array( - 'admin', - 'admin/*', - 'user/*/*', - 'node/add*', - 'node/*/*', - ); - variable_set('googleanalytics_pages', implode("\n", $pages)); - // By German laws it's always best to enable the anonymizing of IP addresses. // NOTE: If this is also an important default setting in other countries, please let us know! $countries = array( @@ -43,7 +29,7 @@ function googleanalytics_uninstall() { variable_del('googleanalytics_codesnippet_after'); variable_del('googleanalytics_cross_domains'); variable_del('googleanalytics_custom'); - variable_del('googleanalytics_custom_vars'); + variable_del('googleanalytics_custom_var'); variable_del('googleanalytics_domain_mode'); variable_del('googleanalytics_js_scope'); variable_del('googleanalytics_last_cache'); @@ -396,3 +382,35 @@ function googleanalytics_update_7004() { return t('Renamed "googleanalytics_visibility" settings variable to googleanalytics_visibility_pages.'); } + +/** + * Path visibility filter setting should hide "batch" path. + */ +function googleanalytics_update_7005() { + // Current pages setting. + $pages = array( + 'admin', + 'admin/*', + 'user/*/*', + 'node/add*', + 'node/*/*', + ); + + $diff = array_diff($pages, preg_split('/(\r\n?|\n)/', variable_get('googleanalytics_pages', implode("\n", $pages)))); + if (empty($diff)) { + // No diff to previous settings found. Update with new settings. + $pages = array( + 'admin', + 'admin/*', + 'batch', + 'node/add*', + 'node/*/*', + 'user/*/*', + ); + variable_set('googleanalytics_pages', implode("\n", $pages)); + return t('Added "batch" to path visibility filter setting.'); + } + else { + return t('Custom path visibility filter setting found. Update skipped!'); + } +} diff --git a/sites/all/modules/google_analytics/googleanalytics.js b/sites/all/modules/google_analytics/googleanalytics.js index 3e8ca35a..ba4e88ca 100644 --- a/sites/all/modules/google_analytics/googleanalytics.js +++ b/sites/all/modules/google_analytics/googleanalytics.js @@ -1,4 +1,3 @@ -// $Id: googleanalytics.js,v 1.11.2.8 2011/02/06 19:22:05 hass Exp $ (function ($) { $(document).ready(function() { @@ -8,13 +7,13 @@ $(document).ready(function() { // characters are [ ] { } ( ) * + ? - . , \ ^ $ # and whitespace. The character | is excluded // in this function as it's used to separate the domains names. RegExp.escapeDomains = function(text) { - return text.replace(/[-[\]{}()*+?.,\\^$#\s]/g, "\\$&"); + return (text) ? text.replace(/[-[\]{}()*+?.,\\^$#\s]/g, "\\$&") : ''; } // Attach onclick event to document only and catch clicks on all elements. $(document.body).click(function(event) { - // Catch only the first parent link of a clicked element. - $(event.target).parents("a:first,area:first").andSelf().filter("a,area").each(function() { + // Catch the closest surrounding link of a clicked element. + $(event.target).closest("a,area").each(function() { var ga = Drupal.settings.googleanalytics; // Expression to check for absolute internal links. @@ -37,7 +36,6 @@ $(document).ready(function() { else if (isInternalSpecial.test(this.href)) { // Keep the internal URL for Google Analytics website overlay intact. _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]); - setTimeout('document.location = "' + this.href + '"', 100); } } else { @@ -47,26 +45,17 @@ $(document).ready(function() { } else if (ga.trackOutbound && this.href) { if (ga.trackDomainMode == 2 && isCrossDomain.test(this.href)) { - // Top-level cross domain clicked. + // Top-level cross domain clicked. document.location is handled by _link internally. _gaq.push(["_link", this.href]); } else if (ga.trackOutboundAsPageview) { // Track all external links as page views after URL cleanup. // Currently required, if click should be tracked as goal. _gaq.push(["_trackPageview", '/outbound/' + this.href.replace(/^(https?|ftp|news|nntp|telnet|irc|ssh|sftp|webcal):\/\//i, '').split('/').join('--')]); - setTimeout('document.location = "' + this.href + '"', 100); } else { // External link clicked. _gaq.push(["_trackEvent", "Outbound links", "Click", this.href]); - - // First, delay the outbound click by a fraction of a second. - // This delay will hardly be noticeable by the user, but it will provide the - // browser more time load the tracking code. Without this method, it's possible - // that a user can click on the outbound link before the tracking code loads, - // in which case the event will not be recorded. - // See http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55527 - setTimeout('document.location = "' + this.href + '"', 100); } } } diff --git a/sites/all/modules/google_analytics/googleanalytics.module b/sites/all/modules/google_analytics/googleanalytics.module index a00c2ff4..918135f2 100644 --- a/sites/all/modules/google_analytics/googleanalytics.module +++ b/sites/all/modules/google_analytics/googleanalytics.module @@ -1,5 +1,4 @@ <?php -// $Id: googleanalytics.module,v 1.70.2.13 2011/02/07 17:30:49 hass Exp $ /* * @file @@ -10,7 +9,10 @@ * @author: Alexander Hass <http://drupal.org/user/85918> */ -define('GA_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip'); +define('GOOGLEANALYTICS_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip'); + +// Remove tracking from all administrative pages, see http://drupal.org/node/34970. +define('GOOGLEANALYTICS_PAGES', "admin\nadmin/*\nbatch\nnode/add*\nnode/*/*\nuser/*/*"); /** * Implements hook_help(). @@ -107,7 +109,7 @@ function googleanalytics_page_alter(&$page) { if ($track_mailto = variable_get('googleanalytics_trackmailto', 1)) { $link_settings['trackMailto'] = $track_mailto; } - if (($track_download = variable_get('googleanalytics_trackfiles', 1)) && ($trackfiles_extensions = variable_get('googleanalytics_trackfiles_extensions', GA_TRACKFILES_EXTENSIONS))) { + if (($track_download = variable_get('googleanalytics_trackfiles', 1)) && ($trackfiles_extensions = variable_get('googleanalytics_trackfiles_extensions', GOOGLEANALYTICS_TRACKFILES_EXTENSIONS))) { $link_settings['trackDownload'] = $track_download; $link_settings['trackDownloadExtensions'] = $trackfiles_extensions; } @@ -150,7 +152,7 @@ function googleanalytics_page_alter(&$page) { // Site search tracking support. $url_custom = ''; if (module_exists('search') && variable_get('googleanalytics_site_search', FALSE) && arg(0) == 'search' && $keys = googleanalytics_search_get_keys()) { - $url_custom = drupal_json_encode(rawurldecode(url('search/' . arg(1), array('query' => array('search' => $keys))))); + $url_custom = '(window.googleanalytics_search_results) ? ' . drupal_json_encode(url('search/' . arg(1), array('query' => array('search' => $keys)))) . ' : ' . drupal_json_encode(url('search/' . arg(1), array('query' => array('search' => 'no-results:' . $keys, 'cat' => 'no-results')))); } // If this node is a translation of another node, pass the original @@ -239,12 +241,12 @@ function googleanalytics_page_alter(&$page) { if (!empty($segmentation)) { $script .= $segmentation; } - if (!empty($codesnippet_before)) { - $script .= $codesnippet_before; - } if (!empty($custom_var)) { $script .= $custom_var; } + if (!empty($codesnippet_before)) { + $script .= $codesnippet_before; + } if (empty($url_custom)) { $script .= '_gaq.push(["_trackPageview"]);'; } @@ -309,11 +311,25 @@ function googleanalytics_form_user_profile_form_alter(&$form, &$form_state) { break; } + // Disable tracking for visitors who have opted out from tracking via DNT (Do-Not-Track) header. + $disabled = FALSE; + if (variable_get('googleanalytics_privacy_donottrack', 1) && !empty($_SERVER['HTTP_DNT'])) { + $disabled = TRUE; + + // Override settings value. + $account->data['googleanalytics']['custom'] = FALSE; + + $description .= '<span class="admin-disabled">'; + $description .= ' ' . t('You have opted out from tracking via browser privacy settings.'); + $description .= '</span>'; + } + $form['googleanalytics']['custom'] = array( '#type' => 'checkbox', '#title' => t('Enable user tracking'), '#description' => $description, - '#default_value' => isset($account->data['googleanalytics']['custom']) ? $account->data['googleanalytics']['custom'] : ($custom == 1) + '#default_value' => isset($account->data['googleanalytics']['custom']) ? $account->data['googleanalytics']['custom'] : ($custom == 1), + '#disabled' => $disabled, ); return $form; @@ -340,6 +356,36 @@ function googleanalytics_cron() { } } +/** + * Implements hook_preprocess_search_results(). + * + * Collects and adds the number of search results to the head. + */ +function googleanalytics_preprocess_search_results(&$variables) { + // There is no search result $variable available that hold the number of items + // found. But the pager item mumber can tell the number of search results. + global $pager_total_items; + + drupal_add_js('window.googleanalytics_search_results = ' . intval($pager_total_items[0]) . ';', array('type' => 'inline', 'group' => JS_LIBRARY-1)); +} + +/** + * Helper function for grabbing search keys. Function is missing in D7. + * + * http://api.drupal.org/api/function/search_get_keys/6 + */ +function googleanalytics_search_get_keys() { + static $return; + if (!isset($return)) { + // Extract keys as remainder of path + // Note: support old GET format of searches for existing links. + $path = explode('/', $_GET['q'], 3); + $keys = empty($_REQUEST['keys']) ? '' : $_REQUEST['keys']; + $return = count($path) == 3 ? $path[2] : $keys; + } + return $return; +} + /** * Download/Synchronize/Cache tracking code file locally. * @@ -409,23 +455,6 @@ function googleanalytics_clear_js_cache() { } } -/** - * Helper function for grabbing search keys. Function is missing in D7. - * - * http://api.drupal.org/api/function/search_get_keys/6 - */ -function googleanalytics_search_get_keys() { - static $return; - if (!isset($return)) { - // Extract keys as remainder of path - // Note: support old GET format of searches for existing links. - $path = explode('/', $_GET['q'], 3); - $keys = empty($_REQUEST['keys']) ? '' : $_REQUEST['keys']; - $return = count($path) == 3 ? $path[2] : $keys; - } - return $return; -} - /** * Tracking visibility check for an user object. * @@ -439,7 +468,7 @@ function _googleanalytics_visibility_user($account) { $enabled = FALSE; // Is current user a member of a role that should be tracked? - if (_googleanalytics_visibility_roles($account)) { + if (_googleanalytics_visibility_header($account) && _googleanalytics_visibility_roles($account)) { // Use the user's block visibility setting, if necessary. if (($custom = variable_get('googleanalytics_custom', 0)) != 0) { @@ -499,7 +528,7 @@ function _googleanalytics_visibility_pages() { if (!isset($page_match)) { $visibility = variable_get('googleanalytics_visibility_pages', 0); - $setting_pages = variable_get('googleanalytics_pages', ''); + $setting_pages = variable_get('googleanalytics_pages', GOOGLEANALYTICS_PAGES); // Match path if necessary. if (!empty($setting_pages)) { @@ -533,3 +562,18 @@ function _googleanalytics_visibility_pages() { } return $page_match; } + +/** + * Based on headers send by clients this function returns TRUE if GA code should + * be added to the current page and otherwise FALSE. + */ +function _googleanalytics_visibility_header($account) { + + if (($account->uid || variable_get('cache', 0) == 0) && variable_get('googleanalytics_privacy_donottrack', 1) && !empty($_SERVER['HTTP_DNT'])) { + // Disable tracking if caching is disabled or a visitors is logged in and + // have opted out from tracking via DNT (Do-Not-Track) header. + return FALSE; + } + + return TRUE; +} diff --git a/sites/all/modules/google_analytics/googleanalytics.test b/sites/all/modules/google_analytics/googleanalytics.test index 22d3f3b5..9015f4df 100644 --- a/sites/all/modules/google_analytics/googleanalytics.test +++ b/sites/all/modules/google_analytics/googleanalytics.test @@ -1,5 +1,4 @@ <?php -// $Id: googleanalytics.test,v 1.2.2.8 2011/02/07 14:11:43 hass Exp $ /** * @file @@ -44,7 +43,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase { variable_set('googleanalytics_account', $ua_code); // Show tracking on "every page except the listed pages". - variable_set('googleanalytics_visibility', 0); + variable_set('googleanalytics_visibility_pages', 0); // Disable tracking one "admin*" pages only. variable_set('googleanalytics_pages', "admin\nadmin/*"); // Enable tracking only for authenticated users only. @@ -62,7 +61,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase { $this->assertNoRaw('google-analytics.com/ga.js', '[testGoogleAnalyticsPageVisibility]: Tracking code is not displayed on admin subpage.'); // Test whether tracking code display is properly flipped. - variable_set('googleanalytics_visibility', 1); + variable_set('googleanalytics_visibility_pages', 1); $this->drupalGet('admin'); $this->assertRaw($ua_code, '[testGoogleAnalyticsPageVisibility]: Tracking code is displayed on admin page.'); $this->drupalGet('admin/config/system/googleanalytics'); @@ -77,7 +76,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase { $this->assertNoRaw($ua_code, '[testGoogleAnalyticsPageVisibility]: Tracking code is NOT displayed for anonymous.'); // Switch back to every page except the listed pages. - variable_set('googleanalytics_visibility', 0); + variable_set('googleanalytics_visibility_pages', 0); // Enable tracking code for all user roles. variable_set('googleanalytics_roles', array()); @@ -95,7 +94,7 @@ class GoogleAnalyticsBasicTest extends DrupalWebTestCase { variable_set('googleanalytics_account', $ua_code); // Show tracking code on every page except the listed pages. - variable_set('googleanalytics_visibility', 0); + variable_set('googleanalytics_visibility_pages', 0); // Enable tracking code for all user roles. variable_set('googleanalytics_roles', array()); diff --git a/sites/all/modules/google_analytics/googleanalytics.tokens.inc b/sites/all/modules/google_analytics/googleanalytics.tokens.inc index 2af09110..0ab195cb 100644 --- a/sites/all/modules/google_analytics/googleanalytics.tokens.inc +++ b/sites/all/modules/google_analytics/googleanalytics.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: googleanalytics.tokens.inc,v 1.1.2.4 2011/02/07 15:33:38 hass Exp $ /** * @file diff --git a/sites/all/modules/imce/README.txt b/sites/all/modules/imce/README.txt index 1c7f1c0c..ac82c125 100644 --- a/sites/all/modules/imce/README.txt +++ b/sites/all/modules/imce/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.18.2.1 2010/11/08 04:37:21 ufku Exp $ IMCE http://drupal.org/project/imce diff --git a/sites/all/modules/imce/css/imce-content.css b/sites/all/modules/imce/css/imce-content.css index 6aae3e5b..f746e0de 100644 --- a/sites/all/modules/imce/css/imce-content.css +++ b/sites/all/modules/imce/css/imce-content.css @@ -1,10 +1,10 @@ -/* $Id: imce-content.css,v 1.9 2010/10/09 05:47:47 ufku Exp $ */ /*Body*/ body.imce { padding: 2px; background: none; text-align: left; + height: auto; } /*Main container*/ @@ -253,6 +253,9 @@ body.imce { background-color: #07f; color: #fff; } +#file-list tr.selected span { + color: #fff; +} #file-list td.name img { vertical-align: middle; margin-right: 3px; @@ -305,6 +308,7 @@ body.imce { #ops-list a span { display: inline-block; color: #0e1f43; + padding-left: 1px; } #ops-list li.loading a { background-image: url(loading.gif); diff --git a/sites/all/modules/imce/imce.info b/sites/all/modules/imce/imce.info index 56461245..30a923f6 100644 --- a/sites/all/modules/imce/imce.info +++ b/sites/all/modules/imce/imce.info @@ -1,13 +1,12 @@ -; $Id: imce.info,v 1.7.2.2 2011/01/13 09:09:40 ufku Exp $ name = "IMCE" description = "An image/file uploader and browser supporting personal directories and user quota." core = "7.x" package = "Media" configure = "admin/config/media/imce" -; Information added by drupal.org packaging script on January 1, 1970 - 00:00 -version = "7.x-1.2" +; Information added by drupal.org packaging script on 2011-06-06 +version = "7.x-1.4" core = "7.x" project = "imce" -datestamp = "1296601518" +datestamp = "1307386616" diff --git a/sites/all/modules/imce/imce.install b/sites/all/modules/imce/imce.install index 458119f9..865236bb 100644 --- a/sites/all/modules/imce/imce.install +++ b/sites/all/modules/imce/imce.install @@ -1,5 +1,4 @@ <?php -// $Id: imce.install,v 1.8.2.1 2011/01/18 08:56:19 ufku Exp $ /** * @file @@ -82,7 +81,13 @@ function imce_update_7001(&$sandbox) { $file->uri = file_stream_wrapper_uri_normalize($scheme . $relpath); unset($file->filepath); if (!db_query("SELECT 1 FROM {file_managed} WHERE fid = :fid", array(':fid' => $file->fid))->fetchField()) { - drupal_write_record('file_managed', $file); + // Check duplicate uri + if ($fid = db_query("SELECT fid FROM {file_managed} WHERE uri = :uri", array(':uri' => $file->uri))->fetchField()) { + $file->fid = $fid; + } + else { + drupal_write_record('file_managed', $file); + } } file_usage_add($file, 'imce', 'file', $file->fid); $sandbox['progress']++; diff --git a/sites/all/modules/imce/imce.module b/sites/all/modules/imce/imce.module index 1632e94d..fe93a120 100644 --- a/sites/all/modules/imce/imce.module +++ b/sites/all/modules/imce/imce.module @@ -1,5 +1,4 @@ <?php -// $Id: imce.module,v 1.36 2010/10/09 05:48:35 ufku Exp $ /** * @file diff --git a/sites/all/modules/imce/inc/imce.admin.inc b/sites/all/modules/imce/inc/imce.admin.inc index 3dd43782..4ff3077b 100644 --- a/sites/all/modules/imce/inc/imce.admin.inc +++ b/sites/all/modules/imce/inc/imce.admin.inc @@ -1,5 +1,4 @@ <?php -// $Id: imce.admin.inc,v 1.7.2.1 2010/12/12 07:14:44 ufku Exp $ /** * @file @@ -283,10 +282,30 @@ function imce_profile_form($form, &$form_state, $pid = 0) { $form = array('profile' => $form); $form['pid'] = array('#type' => 'hidden', '#value' => $pid); $form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration')); + $form['#validate'][] = 'imce_profile_validate'; $form['#submit'][] = 'imce_profile_submit'; return $form; } +/** + * Profile form validate. + */ +function imce_profile_validate($form, &$form_state) { + $profile = &$form_state['values']['profile']; + $dim_re = '/^\d+x\d+$/'; + $dim_error = t('Dimensions must be specified in <kbd>WIDTHxHEIGHT</kbd> format.'); + // Check max image dimensions + if ($profile['dimensions'] && !preg_match($dim_re, $profile['dimensions'])) { + return form_set_error('profile][dimensions', $dim_error); + } + // Check thumbnails dimensions + foreach ($profile['thumbnails'] as $i => $thumb) { + if (trim($thumb['name']) != '' && !preg_match($dim_re, $thumb['dimensions'])) { + return form_set_error("profile][thumbnails][$i][dimensions", $dim_error); + } + } +} + /** * Profile form submit. */ @@ -598,7 +617,7 @@ function imce_update_profiles($pid, $profile = NULL) { function imce_clean_profile_fields(&$profile) { $clean = array(); foreach ($profile['thumbnails'] as $thumb) { - if (trim($thumb['name']) != '' && preg_match('/^\d+x\d+$/', $thumb['dimensions'])) { + if (trim($thumb['name']) != '') { $clean[] = $thumb; } } diff --git a/sites/all/modules/imce/inc/imce.core.profiles.inc b/sites/all/modules/imce/inc/imce.core.profiles.inc index 39247a31..74957733 100644 --- a/sites/all/modules/imce/inc/imce.core.profiles.inc +++ b/sites/all/modules/imce/inc/imce.core.profiles.inc @@ -1,5 +1,4 @@ <?php -// $Id: imce.core.profiles.inc,v 1.3 2010/05/14 19:57:24 ufku Exp $ /** * @file diff --git a/sites/all/modules/imce/inc/imce.js.inc b/sites/all/modules/imce/inc/imce.js.inc index 08b5e70e..fce9d729 100644 --- a/sites/all/modules/imce/inc/imce.js.inc +++ b/sites/all/modules/imce/inc/imce.js.inc @@ -1,5 +1,4 @@ <?php -// $Id: imce.js.inc,v 1.2 2010/03/17 21:36:38 ufku Exp $ /** * @file diff --git a/sites/all/modules/imce/inc/imce.page.inc b/sites/all/modules/imce/inc/imce.page.inc index b4dc6d04..c5b6907c 100644 --- a/sites/all/modules/imce/inc/imce.page.inc +++ b/sites/all/modules/imce/inc/imce.page.inc @@ -1,5 +1,4 @@ <?php -// $Id: imce.page.inc,v 1.10.2.4 2011/01/10 13:03:02 ufku Exp $ /** * @file @@ -876,11 +875,14 @@ function imce_directory_info($dirname, $imce) { } $info = FALSE; - if (imce_reg_dir($dirname) && file_prepare_directory(imce_dir_uri($imce, $dirname))) { - foreach ($imce['directories'] as $name => $prop) { - if ($prop['subnav'] && ($name == '.' || strpos($dirname . '/', $name . '/') === 0)) { - $info = $prop; - $info['name'] = $dirname; + if (imce_reg_dir($dirname)) { + $diruri = imce_dir_uri($imce, $dirname); + if (file_prepare_directory($diruri)) { + foreach ($imce['directories'] as $name => $prop) { + if ($prop['subnav'] && ($name == '.' || strpos($dirname . '/', $name . '/') === 0)) { + $info = $prop; + $info['name'] = $dirname; + } } } } diff --git a/sites/all/modules/imce/js/imce.js b/sites/all/modules/imce/js/imce.js index 91552233..2a2f9b40 100644 --- a/sites/all/modules/imce/js/imce.js +++ b/sites/all/modules/imce/js/imce.js @@ -1,4 +1,3 @@ -// $Id: imce.js,v 1.26.2.2 2010/12/12 07:15:56 ufku Exp $ (function($) { //Global container. @@ -329,7 +328,7 @@ opClick: function(name) { }); }); var diff = left + $opcon.width() - $('#imce-content').width(); - $opcon.css({left: diff > 0 ? left - diff : left}); + $opcon.css({left: diff > 0 ? left - diff - 1 : left}); $(Op.li).addClass('active'); $(imce.opCloseLink).fadeIn(300); imce.vars.op = name; @@ -554,9 +553,9 @@ setMessage: function (msg, type) { $box.css({opacity: 0, display: 'block'}).html(msg); $box.dequeue(); }); - var q = $box.queue().length; + var q = $box.queue().length, t = imce.vars.msgT || 1000; q = q < 2 ? 1 : q < 3 ? 0.8 : q < 4 ? 0.7 : 0.4;//adjust speed with respect to queue length - $box.fadeTo(600 * q, 1).fadeTo(1000 * q, 1).fadeOut(400 * q); + $box.fadeTo(600 * q, 1).fadeTo(t * q, 1).fadeOut(400 * q); $(logs).append(msg); return false; }, diff --git a/sites/all/modules/imce/js/imce_extras.js b/sites/all/modules/imce/js/imce_extras.js index 4f736e5f..349de2d1 100644 --- a/sites/all/modules/imce/js/imce_extras.js +++ b/sites/all/modules/imce/js/imce_extras.js @@ -1,4 +1,3 @@ -// $Id: imce_extras.js,v 1.9 2010/10/06 04:42:57 ufku Exp $ //This pack implemets: keyboard shortcuts, file sorting, resize bars, and inline thumbnail preview. (function($) { diff --git a/sites/all/modules/imce/js/imce_set_app.js b/sites/all/modules/imce/js/imce_set_app.js index 667294c1..23908688 100644 --- a/sites/all/modules/imce/js/imce_set_app.js +++ b/sites/all/modules/imce/js/imce_set_app.js @@ -1,4 +1,3 @@ -// $Id: imce_set_app.js,v 1.8.2.1 2010/12/12 07:14:44 ufku Exp $ /* * IMCE Integration by URL * Ex-1: http://example.com/imce?app=XEditor|url@urlFieldId|width@widthFieldId|height@heightFieldId diff --git a/sites/all/modules/imce/js/imce_set_inline.js b/sites/all/modules/imce/js/imce_set_inline.js index 462efef1..82706b74 100644 --- a/sites/all/modules/imce/js/imce_set_inline.js +++ b/sites/all/modules/imce/js/imce_set_inline.js @@ -1,11 +1,10 @@ -// $Id: imce_set_inline.js,v 1.5 2010/06/02 08:29:40 ufku Exp $ - (function($) { var ii = window.imceInline = {}; -ii.initiate = function() { - $('div.imce-inline-wrapper').show().find('a').click(function() { +// Drupal behavior +Drupal.behaviors.imceInline = {attach: function(context, settings) { + $('div.imce-inline-wrapper', context).not('.processed').addClass('processed').show().find('a').click(function() { var i = this.name.indexOf('-IMCE-'); ii.activeTextarea = $('#'+ this.name.substr(0, i)).get(0); ii.activeType = this.name.substr(i+6); @@ -17,7 +16,7 @@ ii.initiate = function() { ii.pop.focus(); return false; }); -}; +}}; //function to be executed when imce loads. ii.load = function(win) { @@ -56,6 +55,4 @@ ii.insert = function (file, win) { ii.insertAtCursor(ii.activeTextarea, html, type); }; -$(document).ready(ii.initiate); - })(jQuery); \ No newline at end of file diff --git a/sites/all/modules/imce/js/jquery.form.js b/sites/all/modules/imce/js/jquery.form.js index 17597c8b..69bf8997 100644 --- a/sites/all/modules/imce/js/jquery.form.js +++ b/sites/all/modules/imce/js/jquery.form.js @@ -1,7 +1,6 @@ -//$Id: jquery.form.js,v 1.2 2010/03/17 21:36:38 ufku Exp $ /* * jQuery Form Plugin - * version: 2.43 (12-MAR-2010) + * version: 2.67 (12-MAR-2011) * @requires jQuery v1.3.2 or later */ -(function(b){b.fn.ajaxSubmit=function(s){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof s=="function"){s={success:s}}var e=b.trim(this.attr("action"));if(e){e=(e.match(/^([^#]+)/)||[])[1]}e=e||window.location.href||"";s=b.extend({url:e,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},s||{});var u={};this.trigger("form-pre-serialize",[this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(s.beforeSerialize&&s.beforeSerialize(this,s)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var m=this.formToArray(s.semantic);if(s.data){s.extraData=s.data;for(var f in s.data){if(s.data[f] instanceof Array){for(var g in s.data[f]){m.push({name:f,value:s.data[f][g]})}}else{m.push({name:f,value:s.data[f]})}}}if(s.beforeSubmit&&s.beforeSubmit(m,this,s)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[m,this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var d=b.param(m);if(s.type.toUpperCase()=="GET"){s.url+=(s.url.indexOf("?")>=0?"&":"?")+d;s.data=null}else{s.data=d}var t=this,l=[];if(s.resetForm){l.push(function(){t.resetForm()})}if(s.clearForm){l.push(function(){t.clearForm()})}if(!s.dataType&&s.target){var p=s.success||function(){};l.push(function(k){var j=s.replaceTarget?"replaceWith":"html";b(s.target)[j](k).each(p,arguments)})}else{if(s.success){l.push(s.success)}}s.success=function(q,k,v){for(var n=0,j=l.length;n<j;n++){l[n].apply(s,[q,k,v||t,t])}};var c=b("input:file",this).fieldValue();var r=false;for(var i=0;i<c.length;i++){if(c[i]){r=true}}var h=false;if((c.length&&s.iframe!==false)||s.iframe||r||h){if(s.closeKeepAlive){b.get(s.closeKeepAlive,o)}else{o()}}else{b.ajax(s)}this.trigger("form-submit-notify",[this,s]);return this;function o(){var w=t[0];if(b(":input[name=submit]",w).length){alert('Error: Form elements must not be named "submit".');return}var q=b.extend({},b.ajaxSettings,s);var H=b.extend(true,{},b.extend(true,{},b.ajaxSettings),q);var v="jqFormIO"+(new Date().getTime());var D=b('<iframe id="'+v+'" name="'+v+'" src="'+q.iframeSrc+'" onload="(jQuery(this).data(\'form-plugin-onload\'))()" />');var F=D[0];D.css({position:"absolute",top:"-1000px",left:"-1000px"});var G={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;D.attr("src",q.iframeSrc)}};var E=q.global;if(E&&!b.active++){b.event.trigger("ajaxStart")}if(E){b.event.trigger("ajaxSend",[G,q])}if(H.beforeSend&&H.beforeSend(G,H)===false){H.global&&b.active--;return}if(G.aborted){return}var k=false;var A=0;var j=w.clk;if(j){var y=j.name;if(y&&!j.disabled){q.extraData=q.extraData||{};q.extraData[y]=j.value;if(j.type=="image"){q.extraData[y+".x"]=w.clk_x;q.extraData[y+".y"]=w.clk_y}}}function x(){var K=t.attr("target"),I=t.attr("action");w.setAttribute("target",v);if(w.getAttribute("method")!="POST"){w.setAttribute("method","POST")}if(w.getAttribute("action")!=q.url){w.setAttribute("action",q.url)}if(!q.skipEncodingOverride){t.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(q.timeout){setTimeout(function(){A=true;B()},q.timeout)}var J=[];try{if(q.extraData){for(var L in q.extraData){J.push(b('<input type="hidden" name="'+L+'" value="'+q.extraData[L]+'" />').appendTo(w)[0])}}D.appendTo("body");D.data("form-plugin-onload",B);w.submit()}finally{w.setAttribute("action",I);K?w.setAttribute("target",K):t.removeAttr("target");b(J).remove()}}if(q.forceSync){x()}else{setTimeout(x,10)}var z=100;function B(){if(k){return}var I=true;try{if(A){throw"timeout"}var J,M;M=F.contentWindow?F.contentWindow.document:F.contentDocument?F.contentDocument:F.document;var N=q.dataType=="xml"||M.XMLDocument||b.isXMLDoc(M);a("isXml="+N);if(!N&&(M.body==null||M.body.innerHTML=="")){if(--z){a("requeing onLoad callback, DOM not available");setTimeout(B,250);return}a("Could not access iframe DOM after 100 tries.");return}a("response detected");k=true;G.responseText=M.body?M.body.innerHTML:null;G.responseXML=M.XMLDocument?M.XMLDocument:M;G.getResponseHeader=function(P){var O={"content-type":q.dataType};return O[P]};if(q.dataType=="json"||q.dataType=="script"){var n=M.getElementsByTagName("textarea")[0];if(n){G.responseText=n.value}else{var L=M.getElementsByTagName("pre")[0];if(L){G.responseText=L.innerHTML}}}else{if(q.dataType=="xml"&&!G.responseXML&&G.responseText!=null){G.responseXML=C(G.responseText)}}J=b.httpData(G,q.dataType)}catch(K){a("error caught:",K);I=false;G.error=K;b.handleError(q,G,"error",K)}if(I){q.success(J,"success");if(E){b.event.trigger("ajaxSuccess",[G,q])}}if(E){b.event.trigger("ajaxComplete",[G,q])}if(E&&!--b.active){b.event.trigger("ajaxStop")}if(q.complete){q.complete(G,I?"success":"error")}setTimeout(function(){D.removeData("form-plugin-onload");D.remove();G.responseXML=null},100)}function C(n,I){if(window.ActiveXObject){I=new ActiveXObject("Microsoft.XMLDOM");I.async="false";I.loadXML(n)}else{I=(new DOMParser()).parseFromString(n,"text/xml")}return(I&&I.documentElement&&I.documentElement.tagName!="parsererror")?I:null}}};b.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(d){d.preventDefault();b(this).ajaxSubmit(c)}).bind("click.form-plugin",function(i){var h=i.target;var f=b(h);if(!(f.is(":submit,input:image"))){var d=f.closest(":submit");if(d.length==0){return}h=d[0]}var g=this;g.clk=h;if(h.type=="image"){if(i.offsetX!=undefined){g.clk_x=i.offsetX;g.clk_y=i.offsetY}else{if(typeof b.fn.offset=="function"){var j=f.offset();g.clk_x=i.pageX-j.left;g.clk_y=i.pageY-j.top}else{g.clk_x=i.pageX-h.offsetLeft;g.clk_y=i.pageY-h.offsetTop}}}setTimeout(function(){g.clk=g.clk_x=g.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(q){var p=[];if(this.length==0){return p}var d=this[0];var h=q?d.getElementsByTagName("*"):d.elements;if(!h){return p}for(var k=0,m=h.length;k<m;k++){var e=h[k];var f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}var r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(var g=0,c=r.length;g<c;g++){p.push({name:f,value:r[g]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0],f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(typeof j=="undefined"){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return c.value};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c==undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c==undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(c)}else{if(window.opera&&window.opera.postError){window.opera.postError(c)}}}}})(jQuery); +(function(b){b.fn.ajaxSubmit=function(t){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof t=="function"){t={success:t}}var h=this.attr("action");var d=(typeof h==="string")?b.trim(h):"";if(d){d=(d.match(/^([^#]+)/)||[])[1]}d=d||window.location.href||"";t=b.extend(true,{url:d,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var u={};this.trigger("form-pre-serialize",[this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(t.beforeSerialize&&t.beforeSerialize(this,t)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var f,p,m=this.formToArray(t.semantic);if(t.data){t.extraData=t.data;for(f in t.data){if(t.data[f] instanceof Array){for(var i in t.data[f]){m.push({name:f,value:t.data[f][i]})}}else{p=t.data[f];p=b.isFunction(p)?p():p;m.push({name:f,value:p})}}}if(t.beforeSubmit&&t.beforeSubmit(m,this,t)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[m,this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var c=b.param(m);if(t.type.toUpperCase()=="GET"){t.url+=(t.url.indexOf("?")>=0?"&":"?")+c;t.data=null}else{t.data=c}var s=this,l=[];if(t.resetForm){l.push(function(){s.resetForm()})}if(t.clearForm){l.push(function(){s.clearForm()})}if(!t.dataType&&t.target){var r=t.success||function(){};l.push(function(n){var k=t.replaceTarget?"replaceWith":"html";b(t.target)[k](n).each(r,arguments)})}else{if(t.success){l.push(t.success)}}t.success=function(w,n,x){var v=t.context||t;for(var q=0,k=l.length;q<k;q++){l[q].apply(v,[w,n,x||s,s])}};var g=b("input:file",this).length>0;var e="multipart/form-data";var j=(s.attr("enctype")==e||s.attr("encoding")==e);if(t.iframe!==false&&(g||t.iframe||j)){if(t.closeKeepAlive){b.get(t.closeKeepAlive,o)}else{o()}}else{b.ajax(t)}this.trigger("form-submit-notify",[this,t]);return this;function o(){var v=s[0];if(b(":input[name=submit],:input[id=submit]",v).length){alert('Error: Form elements must not have name or id of "submit".');return}var B=b.extend(true,{},b.ajaxSettings,t);B.context=B.context||B;var E="jqFormIO"+(new Date().getTime()),z="_"+E;var w=b('<iframe id="'+E+'" name="'+E+'" src="'+B.iframeSrc+'" />');var A=w[0];w.css({position:"absolute",top:"-1000px",left:"-1000px"});var x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){a("aborting upload...");var n="aborted";this.aborted=1;w.attr("src",B.iframeSrc);x.error=n;B.error&&B.error.call(B.context,x,"error",n);I&&b.event.trigger("ajaxError",[x,B,n]);B.complete&&B.complete.call(B.context,x,"error")}};var I=B.global;if(I&&!b.active++){b.event.trigger("ajaxStart")}if(I){b.event.trigger("ajaxSend",[x,B])}if(B.beforeSend&&B.beforeSend.call(B.context,x,B)===false){if(B.global){b.active--}return}if(x.aborted){return}var H=0;var y=v.clk;if(y){var F=y.name;if(F&&!y.disabled){B.extraData=B.extraData||{};B.extraData[F]=y.value;if(y.type=="image"){B.extraData[F+".x"]=v.clk_x;B.extraData[F+".y"]=v.clk_y}}}function G(){var O=s.attr("target"),M=s.attr("action");v.setAttribute("target",E);if(v.getAttribute("method")!="POST"){v.setAttribute("method","POST")}if(v.getAttribute("action")!=B.url){v.setAttribute("action",B.url)}if(!B.skipEncodingOverride){s.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(B.timeout){setTimeout(function(){H=true;D()},B.timeout)}var N=[];try{if(B.extraData){for(var P in B.extraData){N.push(b('<input type="hidden" name="'+P+'" value="'+B.extraData[P]+'" />').appendTo(v)[0])}}w.appendTo("body");A.attachEvent?A.attachEvent("onload",D):A.addEventListener("load",D,false);v.submit()}finally{v.setAttribute("action",M);if(O){v.setAttribute("target",O)}else{s.removeAttr("target")}b(N).remove()}}if(B.forceSync){G()}else{setTimeout(G,10)}var K,L,J=50;function D(){if(x.aborted){return}var R=A.contentWindow?A.contentWindow.document:A.contentDocument?A.contentDocument:A.document;if(!R||R.location.href==B.iframeSrc){return}A.detachEvent?A.detachEvent("onload",D):A.removeEventListener("load",D,false);var N=true;try{if(H){throw"timeout"}var S=B.dataType=="xml"||R.XMLDocument||b.isXMLDoc(R);a("isXml="+S);if(!S&&window.opera&&(R.body==null||R.body.innerHTML=="")){if(--J){a("requeing onLoad callback, DOM not available");setTimeout(D,250);return}}x.responseText=R.body?R.body.innerHTML:R.documentElement?R.documentElement.innerHTML:null;x.responseXML=R.XMLDocument?R.XMLDocument:R;x.getResponseHeader=function(U){var T={"content-type":B.dataType};return T[U]};var Q=/(json|script)/.test(B.dataType);if(Q||B.textarea){var M=R.getElementsByTagName("textarea")[0];if(M){x.responseText=M.value}else{if(Q){var P=R.getElementsByTagName("pre")[0];var n=R.getElementsByTagName("body")[0];if(P){x.responseText=P.textContent}else{if(n){x.responseText=n.innerHTML}}}}}else{if(B.dataType=="xml"&&!x.responseXML&&x.responseText!=null){x.responseXML=C(x.responseText)}}K=k(x,B.dataType,B)}catch(O){a("error caught:",O);N=false;x.error=O;B.error&&B.error.call(B.context,x,"error",O);I&&b.event.trigger("ajaxError",[x,B,O])}if(x.aborted){a("upload aborted");N=false}if(N){B.success&&B.success.call(B.context,K,"success",x);I&&b.event.trigger("ajaxSuccess",[x,B])}I&&b.event.trigger("ajaxComplete",[x,B]);if(I&&!--b.active){b.event.trigger("ajaxStop")}B.complete&&B.complete.call(B.context,x,N?"success":"error");setTimeout(function(){w.removeData("form-plugin-onload");w.remove();x.responseXML=null},100)}var C=b.parseXML||function(n,M){if(window.ActiveXObject){M=new ActiveXObject("Microsoft.XMLDOM");M.async="false";M.loadXML(n)}else{M=(new DOMParser()).parseFromString(n,"text/xml")}return(M&&M.documentElement&&M.documentElement.nodeName!="parsererror")?M:null};var q=b.parseJSON||function(n){return window["eval"]("("+n+")")};var k=function(Q,O,N){var M=Q.getResponseHeader("content-type")||"",n=O==="xml"||!O&&M.indexOf("xml")>=0,P=n?Q.responseXML:Q.responseText;if(n&&P.documentElement.nodeName==="parsererror"){b.error&&b.error("parsererror")}if(N&&N.dataFilter){P=N.dataFilter(P,O)}if(typeof P==="string"){if(O==="json"||!O&&M.indexOf("json")>=0){P=q(P)}else{if(O==="script"||!O&&M.indexOf("javascript")>=0){b.globalEval(P)}}}return P}}};b.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};if(!b.isReady&&d.s){a("DOM not ready, queuing ajaxForm");b(function(){b(d.s,d.c).ajaxForm(c)});return this}a("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(f){if(!f.isDefaultPrevented()){f.preventDefault();b(this).ajaxSubmit(c)}}).bind("click.form-plugin",function(j){var i=j.target;var g=b(i);if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");if(f.length==0){return}i=f[0]}var h=this;h.clk=i;if(i.type=="image"){if(j.offsetX!=undefined){h.clk_x=j.offsetX;h.clk_y=j.offsetY}else{if(typeof b.fn.offset=="function"){var k=g.offset();h.clk_x=j.pageX-k.left;h.clk_y=j.pageY-k.top}else{h.clk_x=j.pageX-i.offsetLeft;h.clk_y=j.pageY-i.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(q){var p=[];if(this.length===0){return p}var d=this[0];var g=q?d.getElementsByTagName("*"):d.elements;if(!g){return p}var k,h,f,r,e,m,c;for(k=0,m=g.length;k<m;k++){e=g[k];f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(h=0,c=r.length;h<c;h++){p.push({name:f,value:r[h]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0];f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(j===undefined){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return b(c).val()};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c===undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c===undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(c)}else{if(window.opera&&window.opera.postError){window.opera.postError(c)}}}}})(jQuery); diff --git a/sites/all/modules/imce/tpl/imce-content.tpl.php b/sites/all/modules/imce/tpl/imce-content.tpl.php index 8b3bece7..53a397c9 100644 --- a/sites/all/modules/imce/tpl/imce-content.tpl.php +++ b/sites/all/modules/imce/tpl/imce-content.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: imce-content.tpl.php,v 1.12 2010/10/06 04:42:57 ufku Exp $ $imce =& $imce_ref['imce'];//keep this line. ?> diff --git a/sites/all/modules/imce/tpl/imce-file-list.tpl.php b/sites/all/modules/imce/tpl/imce-file-list.tpl.php index 0a666ae3..9447fa08 100644 --- a/sites/all/modules/imce/tpl/imce-file-list.tpl.php +++ b/sites/all/modules/imce/tpl/imce-file-list.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: imce-file-list.tpl.php,v 1.9 2010/03/17 21:36:39 ufku Exp $ $imce =& $imce_ref['imce'];//keep this line. /* diff --git a/sites/all/modules/imce/tpl/imce-page.tpl.php b/sites/all/modules/imce/tpl/imce-page.tpl.php index 0a8710d3..197858a9 100644 --- a/sites/all/modules/imce/tpl/imce-page.tpl.php +++ b/sites/all/modules/imce/tpl/imce-page.tpl.php @@ -1,6 +1,4 @@ -<?php -// $Id: imce-page.tpl.php,v 1.10 2010/03/17 23:19:55 ufku Exp $ -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $GLOBALS['language']->language; ?>" xml:lang="<?php print $GLOBALS['language']->language; ?>" class="imce"> diff --git a/sites/all/modules/imce_wysiwyg/CHANGELOG.txt b/sites/all/modules/imce_wysiwyg/CHANGELOG.txt index d3ac5683..7e7f9a81 100644 --- a/sites/all/modules/imce_wysiwyg/CHANGELOG.txt +++ b/sites/all/modules/imce_wysiwyg/CHANGELOG.txt @@ -1,4 +1,3 @@ -// $Id: CHANGELOG.txt,v 1.7 2010/04/18 17:37:09 sun Exp $ IMCE Wysiwyg x.x-x.x, xxxx-xx-xx -------------------------------- diff --git a/sites/all/modules/imce_wysiwyg/README.txt b/sites/all/modules/imce_wysiwyg/README.txt index fdf63bfa..be288e15 100644 --- a/sites/all/modules/imce_wysiwyg/README.txt +++ b/sites/all/modules/imce_wysiwyg/README.txt @@ -1,4 +1,3 @@ -/* $Id: README.txt,v 1.3 2009/07/06 22:27:13 sun Exp $ */ -- SUMMARY -- diff --git a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info index a5f327e6..83a67558 100644 --- a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info +++ b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.info @@ -1,4 +1,3 @@ -; $Id: imce_wysiwyg.info,v 1.4 2010/04/18 17:37:09 sun Exp $ name = IMCE Wysiwyg API bridge description = Makes IMCE available as plugin for client-side editors integrated via Wysiwyg API. package = User interface @@ -7,9 +6,9 @@ dependencies[] = imce dependencies[] = wysiwyg files[] = imce_wysiwyg.module -; Information added by drupal.org packaging script on 2010-07-11 +; Information added by drupal.org packaging script on 2011-02-25 version = "7.x-1.x-dev" core = "7.x" project = "imce_wysiwyg" -datestamp = "1278834568" +datestamp = "1298619435" diff --git a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module index 95d53391..c1b819a2 100644 --- a/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module +++ b/sites/all/modules/imce_wysiwyg/imce_wysiwyg.module @@ -1,5 +1,4 @@ <?php -// $Id: imce_wysiwyg.module,v 1.5 2010/02/21 00:07:00 sun Exp $ /** * @file diff --git a/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js b/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js index c5b7d397..81d60e69 100644 --- a/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js +++ b/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js @@ -1,4 +1,3 @@ -// $Id: imce_wysiwyg.js,v 1.4 2010/02/21 00:07:00 sun Exp $ /** * Wysiwyg API integration helper function. diff --git a/sites/all/modules/imce_wysiwyg/translations/de.po b/sites/all/modules/imce_wysiwyg/translations/de.po deleted file mode 100644 index e380c21d..00000000 --- a/sites/all/modules/imce_wysiwyg/translations/de.po +++ /dev/null @@ -1,39 +0,0 @@ -# $Id$ -# -# LANGUAGE translation of Drupal (general) -# Copyright 2009 NAME <EMAIL@ADDRESS> -# Generated from files: -# imce_wysiwyg.module,v 1.4 2009/03/04 15:52:16 sun -# imce_wysiwyg.info,v 1.2 2009/02/23 12:49:16 sun -# -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2009-10-30 13:31+0100\n" -"PO-Revision-Date: 2009-10-30 15:12+0100\n" -"Last-Translator: Thomas Zahreddin <thomas@voicehero.net>\n" -"Language-Team: German <tz@it-arts.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-Language: German\n" -"X-Poedit-Country: Germany\n" -"X-Poedit-SourceCharset: utf-8\n" - -#: imce_wysiwyg.module:41;55 -msgid "IMCE" -msgstr "IMCE" - -#: imce_wysiwyg.info:0 -msgid "IMCE Wysiwyg API bridge" -msgstr "IMCE Wysiwyg API bridge" - -#: imce_wysiwyg.info:0 -msgid "Makes IMCE available as plugin for client-side editors integrated via Wysiwyg API." -msgstr "Integriert IMCE als Plugin in Wysiwyg - Editoren (via API)." - -#: imce_wysiwyg.info:0 -msgid "User interface" -msgstr "Benutzeroberfläche" - diff --git a/sites/all/modules/imce_wysiwyg/translations/imce_wysiwyg.pot b/sites/all/modules/imce_wysiwyg/translations/imce_wysiwyg.pot deleted file mode 100644 index 382d8822..00000000 --- a/sites/all/modules/imce_wysiwyg/translations/imce_wysiwyg.pot +++ /dev/null @@ -1,37 +0,0 @@ -# $Id$ -# -# LANGUAGE translation of Drupal (general) -# Copyright YEAR NAME <EMAIL@ADDRESS> -# Generated from files: -# imce_wysiwyg.module,v 1.4 2009/03/04 15:52:16 sun -# imce_wysiwyg.info,v 1.2 2009/02/23 12:49:16 sun -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2009-10-30 13:31+0100\n" -"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" -"Last-Translator: NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" - -#: imce_wysiwyg.module:41;55 -msgid "IMCE" -msgstr "" - -#: imce_wysiwyg.info:0 -msgid "IMCE Wysiwyg API bridge" -msgstr "" - -#: imce_wysiwyg.info:0 -msgid "Makes IMCE available as plugin for client-side editors integrated via Wysiwyg API." -msgstr "" - -#: imce_wysiwyg.info:0 -msgid "User interface" -msgstr "" - diff --git a/sites/all/modules/token/README.txt b/sites/all/modules/token/README.txt index eeacce97..230774e9 100644 --- a/sites/all/modules/token/README.txt +++ b/sites/all/modules/token/README.txt @@ -1,3 +1,2 @@ -$Id: README.txt,v 1.2 2010/03/06 22:12:11 davereid Exp $ Provides common and resuable token UI elements and missing core tokens. diff --git a/sites/all/modules/token/jquery.treeTable.css b/sites/all/modules/token/jquery.treeTable.css index 017a5dde..bec225ae 100644 --- a/sites/all/modules/token/jquery.treeTable.css +++ b/sites/all/modules/token/jquery.treeTable.css @@ -1,4 +1,3 @@ -/* $Id: jquery.treeTable.css,v 1.2 2010/07/10 13:57:47 davereid Exp $ */ /* jQuery TreeTable Core 2.0 stylesheet * diff --git a/sites/all/modules/token/jquery.treeTable.js b/sites/all/modules/token/jquery.treeTable.js index 00fb8107..fd8d0c2d 100644 --- a/sites/all/modules/token/jquery.treeTable.js +++ b/sites/all/modules/token/jquery.treeTable.js @@ -1,4 +1,3 @@ -// $Id: jquery.treeTable.js,v 1.1 2010/03/16 23:48:58 davereid Exp $ /* * jQuery treeTable Plugin 2.3.0 diff --git a/sites/all/modules/token/tests/token_test.info b/sites/all/modules/token/tests/token_test.info index f0324c24..859fcccf 100644 --- a/sites/all/modules/token/tests/token_test.info +++ b/sites/all/modules/token/tests/token_test.info @@ -5,9 +5,9 @@ core = 7.x files[] = token_test.module hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-12 -version = "7.x-1.0-beta1" +; Information added by drupal.org packaging script on 2011-05-19 +version = "7.x-1.0-beta2" core = "7.x" project = "token" -datestamp = "1294805790" +datestamp = "1305833216" diff --git a/sites/all/modules/token/token.css b/sites/all/modules/token/token.css index 351bb7c5..c8500c51 100644 --- a/sites/all/modules/token/token.css +++ b/sites/all/modules/token/token.css @@ -1,4 +1,3 @@ -/* $Id: token.css,v 1.3 2010/09/06 14:55:41 davereid Exp $ */ .token-tree { font-size: 0.85em; @@ -9,3 +8,11 @@ padding-top: 0; padding-bottom: 0; } + +.token-group { + font-weight: bold; +} + +.js .token-group { + font-weight: normal; +} diff --git a/sites/all/modules/token/token.info b/sites/all/modules/token/token.info index 1bcb425a..d7be5709 100644 --- a/sites/all/modules/token/token.info +++ b/sites/all/modules/token/token.info @@ -1,4 +1,3 @@ -; $Id: token.info,v 1.12 2010/11/18 00:20:33 davereid Exp $ name = Token description = Provides a user interface for the Token API and some missing core tokens. core = 7.x @@ -8,9 +7,9 @@ files[] = token.tokens.inc files[] = token.pages.inc files[] = token.test -; Information added by drupal.org packaging script on 2011-01-12 -version = "7.x-1.0-beta1" +; Information added by drupal.org packaging script on 2011-05-19 +version = "7.x-1.0-beta2" core = "7.x" project = "token" -datestamp = "1294805790" +datestamp = "1305833216" diff --git a/sites/all/modules/token/token.install b/sites/all/modules/token/token.install index b4466bc9..ded68e9f 100644 --- a/sites/all/modules/token/token.install +++ b/sites/all/modules/token/token.install @@ -1,5 +1,4 @@ <?php -// $Id: token.install,v 1.15 2010/12/08 16:25:09 davereid Exp $ /** * Implements hook_requirements(). diff --git a/sites/all/modules/token/token.js b/sites/all/modules/token/token.js index 30406322..59715f47 100644 --- a/sites/all/modules/token/token.js +++ b/sites/all/modules/token/token.js @@ -1,4 +1,3 @@ -// $Id: token.js,v 1.3 2010/03/20 19:48:25 davereid Exp $ (function ($) { diff --git a/sites/all/modules/token/token.module b/sites/all/modules/token/token.module index f0e8692e..ad4107ba 100644 --- a/sites/all/modules/token/token.module +++ b/sites/all/modules/token/token.module @@ -1,5 +1,4 @@ <?php -// $Id: token.module,v 1.61 2011/01/12 03:26:59 davereid Exp $ /** * The maximum depth for token tree recursion. @@ -11,6 +10,12 @@ define('TOKEN_MAX_DEPTH', 9); */ function token_help($path, $arg) { if ($path == 'admin/help#token') { + if (current_path() != 'admin/help/token') { + // Because system_modules() executes hook_help() for each module to 'test' + // if they will return anything, but not actually display it, we want to + // return a TRUE value if this is not actually the help page. + return TRUE; + } $output = '<dl>'; $output .= '<dt>' . t('List of the currently available tokens on this site') . '</dt>'; $output .= '<dd>' . theme('token_tree', array('token_types' => 'all', 'click_insert' => FALSE, 'show_restricted' => TRUE)) . '</dd>'; @@ -170,7 +175,7 @@ function token_form_alter(&$form, $form_state, $form_id) { * Clear token caches and static variables. */ function token_clear_cache() { - cache_clear_all(NULL, 'cache_token'); + cache_clear_all('*', 'cache_token', TRUE); drupal_static_reset('token_get_info'); drupal_static_reset('token_get_global_token_types'); drupal_static_reset('token_build_tree'); @@ -302,10 +307,13 @@ function token_get_info($token_type = NULL, $token = NULL) { foreach (array_keys($token_info['types']) as $type_key) { if (isset($token_info['types'][$type_key]['type'])) { + $base_type = $token_info['types'][$type_key]['type']; // If this token type extends another token type, then merge in // the base token type's tokens. - $token_info['tokens'] += array($type_key => array()); - $token_info['tokens'][$type_key] += $token_info['tokens'][$token_info['types'][$type_key]['type']]; + if (isset($token_info['tokens'][$base_type])) { + $token_info['tokens'] += array($type_key => array()); + $token_info['tokens'][$type_key] += $token_info['tokens'][$base_type]; + } } else { // Add a 'type' value to each token type so we can properly use @@ -729,7 +737,7 @@ function _token_build_tree($token_type, array $options) { ); $info = token_get_info(); - if ($options['depth'] <= 0 || !isset($info['types'][$token_type])) { + if ($options['depth'] <= 0 || !isset($info['types'][$token_type]) || !isset($info['tokens'][$token_type])) { return array(); } @@ -916,3 +924,47 @@ function _token_menu_link_translate(&$item) { return $map; } + +/** + * Prepare a string for use as a valid token name. + * + * @param $name + * The token name to clean. + * @return + * The cleaned token name. + */ +function token_clean_token_name($name) { + static $names = array(); + + if (!isset($names[$name])) { + $cleaned_name = strtr($name, array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')); + $cleaned_name = preg_replace('/[^\w\-]/i', '', $cleaned_name); + $cleaned_name = trim($cleaned_name, '-'); + $names[$name] = $cleaned_name; + } + + return $names[$name]; +} + +/** + * Do not use this function yet. Its API has not been finalized. + */ +function token_render_array(array $array, array $options = array()) { + $rendered = array_map('render', $array); + if (!empty($options['sanitize'])) { + $rendered = array_map('check_plain', $rendered); + } + $join = isset($options['join']) ? $options['join'] : ', '; + return implode($join, $rendered); +} + +/** + * Do not use this function yet. Its API has not been finalized. + */ +function token_render_array_value($value, array $options = array()) { + $rendered = render($value); + if (!empty($options['sanitize'])) { + $rendered = check_plain($rendered); + } + return $rendered; +} diff --git a/sites/all/modules/token/token.pages.inc b/sites/all/modules/token/token.pages.inc index 8d2935ab..ee98b926 100644 --- a/sites/all/modules/token/token.pages.inc +++ b/sites/all/modules/token/token.pages.inc @@ -1,5 +1,4 @@ <?php -// $Id: token.pages.inc,v 1.13 2010/12/18 01:53:33 davereid Exp $ /** * @file diff --git a/sites/all/modules/token/token.test b/sites/all/modules/token/token.test index ef1c817e..87ffeed6 100644 --- a/sites/all/modules/token/token.test +++ b/sites/all/modules/token/token.test @@ -1,5 +1,4 @@ <?php -// $Id: token.test,v 1.32 2011/01/12 03:26:59 davereid Exp $ /** * Helper test class with some added functions for testing. @@ -12,13 +11,16 @@ class TokenTestHelper extends DrupalWebTestCase { parent::setUp($modules); } - function assertToken($type, $object, $token, $expected, array $options = array()) { - $this->assertTokens($type, $object, array($token => $expected), $options); + function assertToken($type, $data, $token, $expected, array $options = array()) { + $this->assertTokens($type, $data, array($token => $expected), $options); } - function assertTokens($type, $object, array $tokens, array $options = array()) { + function assertTokens($type, $data, array $tokens, array $options = array()) { $token_input = drupal_map_assoc(array_keys($tokens)); - $values = token_generate($type, $token_input, array($type => $object), $options); + if (!is_array($data)) { + $data = array($type => $data); + } + $values = token_generate($type, $token_input, $data, $options); foreach ($tokens as $token => $expected) { if (!isset($expected)) { $this->assertTrue(!isset($values[$token]), t("Token value for [@type:@token] was not generated.", array('@type' => $type, '@token' => $token))); @@ -32,9 +34,12 @@ class TokenTestHelper extends DrupalWebTestCase { } } - function assertNoTokens($type, $object, array $tokens, array $options = array()) { + function assertNoTokens($type, $data, array $tokens, array $options = array()) { $token_input = drupal_map_assoc($tokens); - $values = token_generate($type, $token_input, array($type => $object), $options); + if (!is_array($data)) { + $data = array($type => $data); + } + $values = token_generate($type, $token_input, $data, $options); foreach ($tokens as $token) { $this->assertTrue(!isset($values[$token]), t("Token value for [@type:@token] was not generated.", array('@type' => $type, '@token' => $token))); } @@ -177,6 +182,33 @@ class TokenUnitTestCase extends TokenTestHelper { } } +class TokenURLTestCase extends TokenTestHelper { + public static function getInfo() { + return array( + 'name' => 'URL token tests', + 'description' => 'Test the URL tokens.', + 'group' => 'Token', + ); + } + + function setUp($modules = array()) { + parent::setUp($modules); + $this->saveAlias('node/1', 'first-node'); + variable_set('clean_url', 1); + } + + function testURLTokens() { + $tokens = array( + 'absolute' => 'http://example.com/first-node', + 'relative' => base_path() . 'first-node', + 'path' => 'node/1', + 'alias' => 'first-node', + 'brief' => 'example.com/first-node', + ); + $this->assertTokens('url', array('path' => 'node/1', 'options' => array('base_url' => 'http://example.com')), $tokens); + } +} + class TokenCommentTestCase extends TokenTestHelper { public static function getInfo() { return array( @@ -349,7 +381,7 @@ class TokenMenuTestCase extends TokenTestHelper { 'root:parent' => NULL, 'root:root' => NULL, ); - $this->assertTokens('menu-link', $parent_link, $tokens); + $this->assertTokens('menu-link', array('menu-link' => $parent_link), $tokens); // Add a node menu link $node_link = array( @@ -739,3 +771,36 @@ class TokenCurrentPageTestCase extends TokenTestHelper { $this->assertPageTokens("node/{$node->nid}", $tokens); } } + +class TokenArrayTestCase extends TokenTestHelper { + public static function getInfo() { + return array( + 'name' => 'Array token tests', + 'description' => 'Test the array tokens.', + 'group' => 'Token', + ); + } + + function testArrayTokens() { + $array = array(0 => 'a', 1 => 'b', 2 => 'c', 4 => 'd'); + + // Test the profile token values. + $tokens = array( + 'first' => 'a', + 'last' => 'd', + 'value:0' => 'a', + 'value:2' => 'c', + 'count' => 4, + 'keys' => '0, 1, 2, 4', + 'keys:value:3' => '4', + 'keys:join' => '0124', + 'reversed' => 'd, c, b, a', + 'reversed:keys' => '4, 2, 1, 0', + 'join:/' => 'a/b/c/d', + 'join' => 'abcd', + 'join:, ' => 'a, b, c, d', + 'join: ' => 'a b c d', + ); + $this->assertTokens('array', $array, $tokens); + } +} diff --git a/sites/all/modules/token/token.tokens.inc b/sites/all/modules/token/token.tokens.inc index e85ab679..29ac76f8 100644 --- a/sites/all/modules/token/token.tokens.inc +++ b/sites/all/modules/token/token.tokens.inc @@ -1,5 +1,4 @@ <?php -// $Id: token.tokens.inc,v 1.37 2011/01/09 20:49:07 davereid Exp $ /** * @file @@ -149,6 +148,11 @@ function token_token_info() { 'type' => 'file', ); } + $info['tokens']['user']['roles'] = array( + 'name' => t('Roles'), + 'description' => t('The user roles associated with the user account.'), + 'type' => 'array', + ); // Current user tokens. $info['tokens']['current-user']['ip-address'] = array( @@ -210,6 +214,7 @@ function token_token_info() { 'dynamic' => TRUE, ); + // URL tokens. $info['types']['url'] = array( 'name' => t('URL'), 'description' => t('Tokens related to URLs.'), @@ -231,6 +236,44 @@ function token_token_info() { 'name' => t('Absolute URL'), 'description' => t('The absolute URL.'), ); + $info['tokens']['url']['brief'] = array( + 'name' => t('Brief URL'), + 'description' => t('The URL without the protocol and trailing backslash.'), + ); + + // Array tokens. + $info['types']['array'] = array( + 'name' => t('Array'), + 'description' => t('Tokens related to arrays of strings.'), + 'needs-data' => 'array', + ); + $info['tokens']['array']['first'] = array( + 'name' => t('First'), + 'description' => t('The first element of the array.'), + ); + $info['tokens']['array']['last'] = array( + 'name' => t('Last'), + 'description' => t('The last element of the array.'), + ); + $info['tokens']['array']['count'] = array( + 'name' => t('Count'), + 'description' => t('The number of elements in the array.'), + ); + $info['tokens']['array']['reversed'] = array( + 'name' => t('Reversed'), + 'description' => t('The array reversed.'), + 'type' => 'array', + ); + $info['tokens']['array']['keys'] = array( + 'name' => t('Keys'), + 'description' => t('The array of keys of the array.'), + 'type' => 'array', + ); + $info['tokens']['array']['join'] = array( + 'name' => t('Imploded'), + 'description' => t('The values of the array joined together with a custom string in-between each value.'), + 'dynamic' => TRUE, + ); return $info; } @@ -392,6 +435,9 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar $replacements[$original] = theme('user_picture', array('account' => $account)); } break; + case 'roles': + $replacements[$original] = token_render_array($account->roles, $options); + break; } } @@ -401,9 +447,12 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar $account->picture->description = ''; $replacements += token_generate('file', $picture_tokens, array('file' => $account->picture), $options); } - if (($url_tokens = token_find_with_prefix($tokens, 'url'))) { + if ($url_tokens = token_find_with_prefix($tokens, 'url')) { $replacements += token_generate('url', $url_tokens, entity_uri('user', $account), $options); } + if ($role_tokens = token_find_with_prefix($tokens, 'roles')) { + $replacements += token_generate('array', $role_tokens, array('array' => $account->roles), $options); + } } // Current user tokens. @@ -525,6 +574,9 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar case 'relative': $replacements[$original] = url($path, array('absolute' => FALSE) + $url_options); break; + case 'brief': + $replacements[$original] = preg_replace(array('!^https?://!', '!/$!'), '', url($path, $url_options)); + break; } } } @@ -555,6 +607,64 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar } } + // Array tokens. + if ($type == 'array' && !empty($data['array']) && is_array($data['array'])) { + $array = $data['array']; + + foreach ($tokens as $name => $original) { + switch ($name) { + case 'first': + $first = reset($array); + $replacements[$original] = token_render_array_value($first, $options); + reset($array); + break; + case 'last': + $last = end($array); + $replacements[$original] = token_render_array_value($last, $options); + reset($array); + break; + case 'count': + $replacements[$original] = count($array); + break; + case 'keys': + $keys = array_keys($array); + $replacements[$original] = token_render_array($keys, $options); + break; + case 'reversed': + $reversed = array_reverse($array, TRUE); + $replacements[$original] = token_render_array($reversed, $options); + break; + case 'join': + $replacements[$original] = token_render_array($array, array('join' => '') + $options); + break; + } + } + + // Dynamic tokens. + if ($value_tokens = token_find_with_prefix($tokens, 'value')) { + foreach ($value_tokens as $key => $original) { + if (isset($array[$key])) { + $replacements[$original] = token_render_array_value($array[$key], $options); + } + } + } + if ($join_tokens = token_find_with_prefix($tokens, 'join')) { + foreach ($join_tokens as $join => $original) { + $replacements[$original] = token_render_array($array, array('join' => $join) + $options); + } + } + + // Chained token relationships. + if ($key_tokens = token_find_with_prefix($tokens, 'keys')) { + $replacements += token_generate('array', $key_tokens, array('array' => array_keys($array)), $options); + } + if ($reversed_tokens = token_find_with_prefix($tokens, 'reversed')) { + $replacements += token_generate('array', $reversed_tokens, array('array' => array_reverse($array, TRUE)), $options); + } + + // @todo Handle if the array values are not strings and could be chained. + } + // If $type is a token type, $data[$type] is empty but $data[$entity_type] is // not, re-run token replacements. if (empty($data[$type]) && ($entity_type = token_get_entity_mapping('token', $type)) && $entity_type != $type && !empty($data[$entity_type]) && empty($options['recursive'])) { @@ -851,9 +961,10 @@ function _token_profile_fields() { $fields = &drupal_static(__FUNCTION__); if (!isset($fields)) { + $fields = array(); $results = db_query("SELECT name, title, category, type FROM {profile_field}"); foreach ($results as $field) { - $field->token_name = strtr($field->name, '_', '-'); + $field->token_name = token_clean_token_name($field->name); $fields[$field->token_name] = $field; } } diff --git a/sites/all/themes/README.txt b/sites/all/themes/README.txt index 507485f8..e9425214 100644 --- a/sites/all/themes/README.txt +++ b/sites/all/themes/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.1 2009/01/22 04:33:38 webchick Exp $ This directory should be used to place downloaded and custom themes which are common to all sites. This will allow you to more easily diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index 6ebacffe..0472f02b 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -1,5 +1,4 @@ <?php -// $Id: default.settings.php,v 1.51 2010/10/11 23:49:48 dries Exp $ /** * @file @@ -282,11 +281,11 @@ ini_set('session.cookie_lifetime', 2000000); /** * Drupal automatically generates a unique session cookie name for each site - * based on on its full domain name. If you have multiple domains pointing at - * the same Drupal site, you can either redirect them all to a single domain - * (see comment in .htaccess), or uncomment the line below and specify their - * shared base domain. Doing so assures that users remain logged in as they - * cross between your various domains. + * based on its full domain name. If you have multiple domains pointing at the + * same Drupal site, you can either redirect them all to a single domain (see + * comment in .htaccess), or uncomment the line below and specify their shared + * base domain. Doing so assures that users remain logged in as they cross + * between your various domains. */ # $cookie_domain = 'example.com'; @@ -369,8 +368,7 @@ ini_set('session.cookie_lifetime', 2000000); * the cache. If the site has mostly anonymous users except a few known * editors/administrators, the Vary header can be omitted. This allows for * better caching in HTTP proxies (including reverse proxies), i.e. even if - * clients send different cookies, they still get content served from the cache - * if aggressive caching is enabled and the minimum cache time is non-zero. + * clients send different cookies, they still get content served from the cache. * However, authenticated users should access the site directly (i.e. not use an * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid * getting cached pages from the proxy. diff --git a/sites/example.sites.php b/sites/example.sites.php index 17758240..08c1020f 100644 --- a/sites/example.sites.php +++ b/sites/example.sites.php @@ -1,5 +1,4 @@ <?php -// $Id: example.sites.php,v 1.3 2010/04/15 12:01:28 dries Exp $ /** * @file diff --git a/themes/README.txt b/themes/README.txt index 686fe344..3fb27ed1 100644 --- a/themes/README.txt +++ b/themes/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.3 2009/10/08 01:44:22 dries Exp $ This directory is reserved for core theme files. Custom or contributed themes should be placed in their own subdirectory of the sites/all/themes directory. diff --git a/themes/bartik/bartik.info b/themes/bartik/bartik.info index 6f3521cc..efdb8846 100644 --- a/themes/bartik/bartik.info +++ b/themes/bartik/bartik.info @@ -1,4 +1,3 @@ -; $Id: bartik.info,v 1.5 2010/11/07 00:27:20 dries Exp $ name = Bartik description = A flexible, recolorable theme with many regions. @@ -35,8 +34,8 @@ regions[footer] = Footer settings[shortcut_module_link] = 0 -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/themes/bartik/color/color.inc b/themes/bartik/color/color.inc index b66e5604..fa323eda 100644 --- a/themes/bartik/color/color.inc +++ b/themes/bartik/color/color.inc @@ -1,5 +1,4 @@ <?php -// $Id: color.inc,v 1.7 2010/12/14 19:53:14 dries Exp $ // Put the logo path into JavaScript for the live preview. drupal_add_js(array('color' => array('logo' => theme_get_setting('logo', 'bartik'))), 'setting'); diff --git a/themes/bartik/color/preview.css b/themes/bartik/color/preview.css index 61f2035b..48a4a833 100644 --- a/themes/bartik/color/preview.css +++ b/themes/bartik/color/preview.css @@ -1,4 +1,3 @@ -/* $Id: preview.css,v 1.5 2010/12/14 02:50:24 dries Exp $ */ /* ---------- Color form ----------- */ #color_scheme_form #palette .form-item { diff --git a/themes/bartik/color/preview.js b/themes/bartik/color/preview.js index bf60cb3a..b40bcf7d 100644 --- a/themes/bartik/color/preview.js +++ b/themes/bartik/color/preview.js @@ -1,4 +1,3 @@ -// $Id: preview.js,v 1.5 2010/12/11 21:37:41 webchick Exp $ (function ($) { Drupal.color = { diff --git a/themes/bartik/css/colors.css b/themes/bartik/css/colors.css index b937362c..fd83374a 100644 --- a/themes/bartik/css/colors.css +++ b/themes/bartik/css/colors.css @@ -1,4 +1,3 @@ -/* $Id: colors.css,v 1.10 2011/01/04 05:24:13 webchick Exp $ */ /* ---------- Color Module Styles ----------- */ @@ -24,8 +23,12 @@ body.overlay { } #header { background-color: #48a9e4; - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0779bf), to(#48a9e4)); - background-image: -moz-linear-gradient(-90deg, #0779bf, #48a9e4); + background-image: -moz-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: -ms-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: -o-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #0779bf), color-stop(1, #48a9e4)); + background-image: -webkit-linear-gradient(top, #0779bf 0%, #48a9e4 100%); + background-image: linear-gradient(top, #0779bf 0%, #48a9e4 100%); } a { color: #0071B3; diff --git a/themes/bartik/css/ie-rtl.css b/themes/bartik/css/ie-rtl.css index b07c3fde..6358bf37 100644 --- a/themes/bartik/css/ie-rtl.css +++ b/themes/bartik/css/ie-rtl.css @@ -1,4 +1,3 @@ -/* $Id: ie-rtl.css,v 1.7 2011/01/04 02:59:37 webchick Exp $ */ fieldset legend { left: 6px; diff --git a/themes/bartik/css/ie.css b/themes/bartik/css/ie.css index aafaf19b..7a658336 100644 --- a/themes/bartik/css/ie.css +++ b/themes/bartik/css/ie.css @@ -1,4 +1,3 @@ -/* $Id: ie.css,v 1.12 2011/01/04 02:59:37 webchick Exp $ */ .block { zoom: 1; diff --git a/themes/bartik/css/ie6.css b/themes/bartik/css/ie6.css index cb233a51..435fab02 100644 --- a/themes/bartik/css/ie6.css +++ b/themes/bartik/css/ie6.css @@ -1,4 +1,3 @@ -/* $Id: ie6.css,v 1.5 2010/12/02 23:54:56 dries Exp $ */ #content { overflow: hidden; diff --git a/themes/bartik/css/layout-rtl.css b/themes/bartik/css/layout-rtl.css index b1cb06bd..fa81e4f8 100644 --- a/themes/bartik/css/layout-rtl.css +++ b/themes/bartik/css/layout-rtl.css @@ -1,4 +1,3 @@ -/* $Id: layout-rtl.css,v 1.5 2010/11/30 17:43:52 dries Exp $ */ /* ---------- Basic Layout RTL Styles ----------- */ diff --git a/themes/bartik/css/layout.css b/themes/bartik/css/layout.css index 9f8227c9..b561f4c0 100644 --- a/themes/bartik/css/layout.css +++ b/themes/bartik/css/layout.css @@ -1,4 +1,3 @@ -/* $Id: layout.css,v 1.8 2011/01/04 05:24:13 webchick Exp $ */ /* ---------- Basic Layout Styles ----------- */ diff --git a/themes/bartik/css/maintenance-page.css b/themes/bartik/css/maintenance-page.css index fb21ae4b..c13c77b9 100644 --- a/themes/bartik/css/maintenance-page.css +++ b/themes/bartik/css/maintenance-page.css @@ -1,13 +1,14 @@ -/* $Id: maintenance-page.css,v 1.6 2010/11/26 11:00:37 webchick Exp $ */ body.maintenance-page { background-color: #fff; color: #000; } .maintenance-page #page-wrapper { + background: #fff; margin-left: auto; margin-right: auto; min-width: 0; + min-height: 0; width: 800px; border: 1px solid #ddd; margin-top: 40px; @@ -24,7 +25,6 @@ body.maintenance-page { width: auto; } .maintenance-page #header div.section, -.maintenance-page #messages, .maintenance-page #main { width: 700px; } @@ -58,6 +58,10 @@ body.maintenance-page { padding: 0; margin-top: 30px; } +.maintenance-page #messages div.messages { + margin: 0; +} .maintenance-page #messages div.section { padding: 0; + width: auto; } diff --git a/themes/bartik/css/print.css b/themes/bartik/css/print.css index d6f3131b..61ca3fa7 100644 --- a/themes/bartik/css/print.css +++ b/themes/bartik/css/print.css @@ -1,4 +1,3 @@ -/* $Id: print.css,v 1.2 2010/09/09 15:27:08 webchick Exp $ */ /* ---------- General Layout ---------- */ diff --git a/themes/bartik/css/style-rtl.css b/themes/bartik/css/style-rtl.css index 5220c67f..d25006fa 100644 --- a/themes/bartik/css/style-rtl.css +++ b/themes/bartik/css/style-rtl.css @@ -1,4 +1,3 @@ -/* $Id: style-rtl.css,v 1.19 2011/01/04 06:23:29 dries Exp $ */ /* ------------------ Reset Styles ------------------ */ diff --git a/themes/bartik/css/style.css b/themes/bartik/css/style.css index d37754ca..7c142778 100644 --- a/themes/bartik/css/style.css +++ b/themes/bartik/css/style.css @@ -1,4 +1,3 @@ -/* $Id: style.css,v 1.53 2011/01/04 06:23:29 dries Exp $ */ /* ---------- Overall Specifications ---------- */ @@ -159,7 +158,7 @@ blockquote:after { line-height: 0.1em; vertical-align: -.45em; } -blockquote :first-child { +blockquote > p:first-child { display: inline; } a.feed-icon { @@ -1067,25 +1066,26 @@ div.messages { /* -------------- Password Meter ------------- */ +.confirm-parent, +.password-parent { + width: 34em; +} .password-parent, div.form-item div.password-suggestions { position: relative; - width: auto; -} -#password-strength { - float: none; - left: 16em; - position: absolute; - width: 11.5em; } -#password-strength-text, +.password-strength-text, .password-strength-title, div.password-confirm { font-size: 0.82em; } -#password-strength-text { +.password-strength-text { margin-top: 0.2em; } +div.password-confirm { + margin-top: 2.2em; + width: 20.73em; +} /* ---------------- Buttons ---------------- */ @@ -1136,7 +1136,7 @@ fieldset { .fieldset-wrapper { margin-top: 25px; } -.node-form .fieldset-wrapper { +.node-form .vertical-tabs .fieldset-wrapper { margin-top: 0; } .filter-wrapper { @@ -1213,6 +1213,13 @@ fieldset legend a:active { fieldset .fieldset-wrapper { padding: 0 10px; } +fieldset .fieldset-description { + margin-top: 5px; + margin-bottom: 1em; + line-height: 1.4; + color: #3c3c3c; + font-style: italic; +} input { margin: 2px 0; padding: 4px; @@ -1247,12 +1254,6 @@ input.form-submit:focus { .form-item label { font-size: 0.929em; } -fieldset .description { - margin-top: 5px; - line-height: 1.4; - color: #3c3c3c; - font-style: italic; -} .form-type-radio label, .form-type-checkbox label { margin-left: 4px; diff --git a/themes/bartik/template.php b/themes/bartik/template.php index 685331a7..d523a0ab 100644 --- a/themes/bartik/template.php +++ b/themes/bartik/template.php @@ -1,5 +1,4 @@ <?php -// $Id: template.php,v 1.13 2010/12/14 01:04:27 dries Exp $ /** * Add body classes if certain regions have content. @@ -106,7 +105,6 @@ function bartik_process_maintenance_page(&$variables) { * Override or insert variables into the node template. */ function bartik_preprocess_node(&$variables) { - $variables['submitted'] = t('published by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date'])); if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } diff --git a/themes/bartik/templates/comment-wrapper.tpl.php b/themes/bartik/templates/comment-wrapper.tpl.php index 09b8e1c1..864dc41c 100644 --- a/themes/bartik/templates/comment-wrapper.tpl.php +++ b/themes/bartik/templates/comment-wrapper.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: comment-wrapper.tpl.php,v 1.2 2010/09/25 02:05:51 dries Exp $ /** * @file diff --git a/themes/bartik/templates/comment.tpl.php b/themes/bartik/templates/comment.tpl.php index 3135c65d..d64487d0 100644 --- a/themes/bartik/templates/comment.tpl.php +++ b/themes/bartik/templates/comment.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: comment.tpl.php,v 1.4 2010/12/01 00:18:15 webchick Exp $ /** * @file diff --git a/themes/bartik/templates/maintenance-page.tpl.php b/themes/bartik/templates/maintenance-page.tpl.php index 9c35121a..6deef1e3 100644 --- a/themes/bartik/templates/maintenance-page.tpl.php +++ b/themes/bartik/templates/maintenance-page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: maintenance-page.tpl.php,v 1.4 2010/11/30 17:55:13 dries Exp $ /** * @file diff --git a/themes/bartik/templates/node.tpl.php b/themes/bartik/templates/node.tpl.php index f5907d9b..f215b477 100644 --- a/themes/bartik/templates/node.tpl.php +++ b/themes/bartik/templates/node.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: node.tpl.php,v 1.2 2010/12/01 00:18:15 webchick Exp $ /** * @file diff --git a/themes/bartik/templates/page.tpl.php b/themes/bartik/templates/page.tpl.php index ed18127e..7b0f9909 100644 --- a/themes/bartik/templates/page.tpl.php +++ b/themes/bartik/templates/page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: page.tpl.php,v 1.9 2010/11/07 21:48:56 dries Exp $ /** * @file diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine index 6b935026..d293b85c 100644 --- a/themes/engines/phptemplate/phptemplate.engine +++ b/themes/engines/phptemplate/phptemplate.engine @@ -1,5 +1,4 @@ <?php -// $Id: phptemplate.engine,v 1.75 2010/02/23 19:03:37 webchick Exp $ /** * @file diff --git a/themes/garland/color/color.inc b/themes/garland/color/color.inc index 416983b7..16336929 100644 --- a/themes/garland/color/color.inc +++ b/themes/garland/color/color.inc @@ -1,5 +1,4 @@ <?php -// $Id: color.inc,v 1.5 2010/04/03 08:05:08 webchick Exp $ $info = array( diff --git a/themes/garland/color/preview.css b/themes/garland/color/preview.css index b63c078c..cf324380 100644 --- a/themes/garland/color/preview.css +++ b/themes/garland/color/preview.css @@ -1,4 +1,3 @@ -/* $Id: preview.css,v 1.5 2010/04/28 20:08:39 dries Exp $ */ /* Positioning */ #preview { diff --git a/themes/garland/comment.tpl.php b/themes/garland/comment.tpl.php index d083ea9a..900afc10 100644 --- a/themes/garland/comment.tpl.php +++ b/themes/garland/comment.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: comment.tpl.php,v 1.21 2010/12/01 00:18:15 webchick Exp $ ?> <div class="<?php print $classes . ' ' . $zebra; ?>"<?php print $attributes; ?>> diff --git a/themes/garland/fix-ie-rtl.css b/themes/garland/fix-ie-rtl.css index 48162548..fb1901b3 100644 --- a/themes/garland/fix-ie-rtl.css +++ b/themes/garland/fix-ie-rtl.css @@ -1,4 +1,3 @@ -/* $Id: fix-ie-rtl.css,v 1.6 2010/04/28 20:08:39 dries Exp $ */ body { /* Center layout */ diff --git a/themes/garland/fix-ie.css b/themes/garland/fix-ie.css index 8753da1d..1a1c131b 100644 --- a/themes/garland/fix-ie.css +++ b/themes/garland/fix-ie.css @@ -1,4 +1,3 @@ -/* $Id: fix-ie.css,v 1.13 2010/04/28 20:08:39 dries Exp $ */ body { /* Center layout */ diff --git a/themes/garland/garland.info b/themes/garland/garland.info index 31925c1b..adc37e38 100644 --- a/themes/garland/garland.info +++ b/themes/garland/garland.info @@ -1,4 +1,3 @@ -; $Id: garland.info,v 1.10 2010/11/07 00:27:20 dries Exp $ name = Garland description = A multi-column theme which can be configured to modify colors and switch between fixed and fluid width layouts. package = Core @@ -8,8 +7,8 @@ stylesheets[all][] = style.css stylesheets[print][] = print.css settings[garland_width] = fluid -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/themes/garland/maintenance-page.tpl.php b/themes/garland/maintenance-page.tpl.php index 1c22bc81..75fb1471 100644 --- a/themes/garland/maintenance-page.tpl.php +++ b/themes/garland/maintenance-page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: maintenance-page.tpl.php,v 1.16 2010/03/04 09:03:08 dries Exp $ /** * @file diff --git a/themes/garland/node.tpl.php b/themes/garland/node.tpl.php index 50fb3c71..27808f4f 100644 --- a/themes/garland/node.tpl.php +++ b/themes/garland/node.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: node.tpl.php,v 1.24 2010/12/01 00:18:15 webchick Exp $ ?> <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>> diff --git a/themes/garland/page.tpl.php b/themes/garland/page.tpl.php index 4857a67f..326255cd 100644 --- a/themes/garland/page.tpl.php +++ b/themes/garland/page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: page.tpl.php,v 1.48 2010/11/20 04:03:51 webchick Exp $ ?> <?php print render($page['header']); ?> diff --git a/themes/garland/print.css b/themes/garland/print.css index 2b74d167..df4f0ae2 100644 --- a/themes/garland/print.css +++ b/themes/garland/print.css @@ -1,4 +1,3 @@ -/* $Id: print.css,v 1.9 2010/04/28 20:08:39 dries Exp $ */ body, input, diff --git a/themes/garland/style-rtl.css b/themes/garland/style-rtl.css index 67d90303..58aed578 100644 --- a/themes/garland/style-rtl.css +++ b/themes/garland/style-rtl.css @@ -1,4 +1,3 @@ -/* $Id: style-rtl.css,v 1.23 2010/09/27 01:12:45 dries Exp $ */ html { direction: rtl; diff --git a/themes/garland/style.css b/themes/garland/style.css index dc8fd8df..f36fa965 100644 --- a/themes/garland/style.css +++ b/themes/garland/style.css @@ -1,4 +1,3 @@ -/* $Id: style.css,v 1.88 2011/01/03 07:04:48 webchick Exp $ */ /** * Generic elements diff --git a/themes/garland/template.php b/themes/garland/template.php index 45818aaa..1b144f12 100644 --- a/themes/garland/template.php +++ b/themes/garland/template.php @@ -1,5 +1,4 @@ <?php -// $Id: template.php,v 1.45 2010/12/01 00:18:15 webchick Exp $ /** * Return a themed breadcrumb trail. diff --git a/themes/garland/theme-settings.php b/themes/garland/theme-settings.php index dc2ea336..24543416 100644 --- a/themes/garland/theme-settings.php +++ b/themes/garland/theme-settings.php @@ -1,5 +1,4 @@ <?php -// $Id: theme-settings.php,v 1.3 2010/09/04 15:21:09 dries Exp $ /** * @file diff --git a/themes/seven/ie.css b/themes/seven/ie.css index 74e56fa4..4b256950 100644 --- a/themes/seven/ie.css +++ b/themes/seven/ie.css @@ -1,4 +1,3 @@ -/* $Id: ie.css,v 1.4 2010/09/23 17:54:20 dries Exp $ */ /* IE7 renders legends in nested fieldsets without a width. */ fieldset legend { diff --git a/themes/seven/ie6.css b/themes/seven/ie6.css index c3735ba5..7d1c320b 100644 --- a/themes/seven/ie6.css +++ b/themes/seven/ie6.css @@ -1,4 +1,3 @@ -/* $Id: ie6.css,v 1.7 2010/10/03 02:46:12 dries Exp $ */ ul.menu li, ul.menu li a, diff --git a/themes/seven/images/fc-rtl.png b/themes/seven/images/fc-rtl.png new file mode 100644 index 0000000000000000000000000000000000000000..e02cf9cd9e45465cd89d047353b5796bafaf4a9f GIT binary patch literal 76 zcmeAS@N?(olHy`uVBq!ia0vp^AAp#Vg9%9H|J+guq=Y?P978nDCtDOhJF`5{fUAw0 ZfuVqHg>TF{Z&si*gQu&X%Q~loCIEij64U?y literal 0 HcmV?d00001 diff --git a/themes/seven/maintenance-page.tpl.php b/themes/seven/maintenance-page.tpl.php index 6cd43c40..aeef310d 100644 --- a/themes/seven/maintenance-page.tpl.php +++ b/themes/seven/maintenance-page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: maintenance-page.tpl.php,v 1.2 2009/11/22 23:44:09 webchick Exp $ ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>"> diff --git a/themes/seven/page.tpl.php b/themes/seven/page.tpl.php index 6327c092..85353a7b 100644 --- a/themes/seven/page.tpl.php +++ b/themes/seven/page.tpl.php @@ -1,5 +1,4 @@ <?php -// $Id: page.tpl.php,v 1.15 2010/11/20 04:03:51 webchick Exp $ ?> <div id="branding" class="clearfix"> <?php print $breadcrumb; ?> diff --git a/themes/seven/reset.css b/themes/seven/reset.css index 90ab4705..0bdc29ae 100644 --- a/themes/seven/reset.css +++ b/themes/seven/reset.css @@ -1,4 +1,3 @@ -/* $Id: reset.css,v 1.13 2010/12/19 04:58:13 webchick Exp $ */ /** * Reset CSS styles. diff --git a/themes/seven/seven.info b/themes/seven/seven.info index 10d306c1..599879f7 100644 --- a/themes/seven/seven.info +++ b/themes/seven/seven.info @@ -1,4 +1,3 @@ -; $Id: seven.info,v 1.6 2010/11/07 00:27:20 dries Exp $ name = Seven description = A simple one-column, tableless, fluid width administration theme. package = Core @@ -14,8 +13,8 @@ regions[page_bottom] = Page bottom regions[sidebar_first] = First sidebar regions_hidden[] = sidebar_first -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/themes/seven/style-rtl.css b/themes/seven/style-rtl.css index 755ad2fb..6328193c 100644 --- a/themes/seven/style-rtl.css +++ b/themes/seven/style-rtl.css @@ -1,4 +1,3 @@ -/* $Id: style-rtl.css,v 1.2 2010/10/15 04:37:15 webchick Exp $ */ /** * Generic elements. diff --git a/themes/seven/style.css b/themes/seven/style.css index 851d2d81..66303c50 100644 --- a/themes/seven/style.css +++ b/themes/seven/style.css @@ -1,4 +1,3 @@ -/* $Id: style.css,v 1.86 2011/01/03 07:04:48 webchick Exp $ */ /** * Generic elements. @@ -918,7 +917,7 @@ div.add-or-remove-shortcuts { #dashboard div.block h2 { margin: 0; font-size: 1em; - padding: 3px 9px 3px 19px; + padding: 3px 10px; } #dashboard div.block div.content { padding: 10px 5px 5px 5px; diff --git a/themes/seven/template.php b/themes/seven/template.php index b01d8b91..4582749b 100644 --- a/themes/seven/template.php +++ b/themes/seven/template.php @@ -1,5 +1,4 @@ <?php -// $Id: template.php,v 1.25 2010/11/20 04:03:51 webchick Exp $ /** * Override or insert variables into the maintenance page template. @@ -89,10 +88,10 @@ function seven_tablesort_indicator($variables) { $style = $variables['style']; $theme_path = drupal_get_path('theme', 'seven'); if ($style == 'asc') { - return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending'))); + return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending'))); } else { - return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending'))); + return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'width' => 13, 'height' => 13, 'title' => t('sort descending'))); } } @@ -104,6 +103,9 @@ function seven_css_alter(&$css) { if (isset($css['misc/vertical-tabs.css'])) { $css['misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css'; } + if (isset($css['misc/vertical-tabs-rtl.css'])) { + $css['misc/vertical-tabs-rtl.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs-rtl.css'; + } // Use Seven's jQuery UI theme style instead of the default one. if (isset($css['misc/ui/jquery.ui.theme.css'])) { $css['misc/ui/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'seven') . '/jquery.ui.theme.css'; diff --git a/themes/seven/vertical-tabs-rtl.css b/themes/seven/vertical-tabs-rtl.css new file mode 100644 index 00000000..a9598c36 --- /dev/null +++ b/themes/seven/vertical-tabs-rtl.css @@ -0,0 +1,21 @@ + +/** + * Override of misc/vertical-tabs-rtl.css. + */ +div.vertical-tabs { + background: #fff url(images/fc-rtl.png) repeat-y right 0; +} +div.vertical-tabs .vertical-tabs-list { + float: right; + margin: 0 0 -1px -100%; +} +div.vertical-tabs ul li.selected a, +div.vertical-tabs ul li.selected a:hover, +div.vertical-tabs ul li.selected a:focus, +div.vertical-tabs ul li.selected a:active { + border-left-color: #fff; +} +div.vertical-tabs .vertical-tabs-panes { + margin: 0 265px 0 0; + padding: 10px 0 10px 15px; +} diff --git a/themes/seven/vertical-tabs.css b/themes/seven/vertical-tabs.css index 0de228b8..4f662225 100644 --- a/themes/seven/vertical-tabs.css +++ b/themes/seven/vertical-tabs.css @@ -1,10 +1,9 @@ -/* $Id: vertical-tabs.css,v 1.10 2010/11/19 20:45:04 dries Exp $ */ /** * Override of misc/vertical-tabs.css. */ div.vertical-tabs { - background: #fff url(images/fc.png) repeat-y 0 0; + background: #fff url(images/fc.png) repeat-y 0 0; /* LTR */ border: 1px solid #ccc; margin: 10px 0; position: relative; @@ -16,10 +15,10 @@ div.vertical-tabs fieldset { } div.vertical-tabs .vertical-tabs-list { border-bottom: 1px solid #ccc; - float: left; + float: left; /* LTR */ font-size: 1em; line-height: 1; - margin: 0 -100% -1px 0; + margin: 0 -100% -1px 0; /* LTR */ padding: 0; width: 240px; } @@ -56,7 +55,7 @@ div.vertical-tabs ul li.selected a:hover, div.vertical-tabs ul li.selected a:focus, div.vertical-tabs ul li.selected a:active { background: #fff; - border-right-color: #fff; + border-right-color: #fff; /* LTR */ border-top: 1px solid #ccc; } div.vertical-tabs ul li.first.selected a, @@ -67,8 +66,8 @@ div.vertical-tabs ul li.selected a:focus strong { text-decoration: underline; } div.vertical-tabs .vertical-tabs-panes { - margin: 0 0 0 265px; - padding: 10px 15px 10px 0; + margin: 0 0 0 265px; /* LTR */ + padding: 10px 15px 10px 0; /* LTR */ } div.vertical-tabs .vertical-tabs-panes legend { display: none; @@ -76,3 +75,19 @@ div.vertical-tabs .vertical-tabs-panes legend { .vertical-tabs-pane .fieldset-wrapper > div:first-child { padding-top: 5px; } + +/** + * Prevent text inputs from overflowing when container is too narrow. "width" is + * applied to override hardcoded cols or size attributes and used in conjunction + * with "box-sizing" to prevent box model issues from occurring in most browsers. +*/ +.vertical-tabs .form-type-textfield input { + width: 100%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +* html .vertical-tabs .form-type-textfield, +* html .vertical-tabs .form-textarea-wrapper { + width: 95%; /* IE6 */ +} diff --git a/themes/stark/README.txt b/themes/stark/README.txt index ffe0eb07..e7af281e 100644 --- a/themes/stark/README.txt +++ b/themes/stark/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.2 2009/12/20 19:43:10 dries Exp $ ABOUT STARK ----------- diff --git a/themes/stark/layout.css b/themes/stark/layout.css index c622ff8c..43bb93f8 100644 --- a/themes/stark/layout.css +++ b/themes/stark/layout.css @@ -1,4 +1,3 @@ -/* $Id: layout.css,v 1.3 2009/08/03 03:04:34 webchick Exp $ */ /** * @file diff --git a/themes/stark/stark.info b/themes/stark/stark.info index 62251ade..d860b8d8 100644 --- a/themes/stark/stark.info +++ b/themes/stark/stark.info @@ -1,4 +1,3 @@ -; $Id: stark.info,v 1.4 2010/11/07 00:27:20 dries Exp $ name = Stark description = This theme demonstrates Drupal's default HTML markup and CSS styles. To learn how to build your own theme and override Drupal's default code, see the <a href="http://drupal.org/theme-guide">Theming Guide</a>. package = Core @@ -6,8 +5,8 @@ version = VERSION core = 7.x stylesheets[all][] = layout.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/themes/tests/README.txt b/themes/tests/README.txt index 6cdb1dc9..5ddaa8ca 100644 --- a/themes/tests/README.txt +++ b/themes/tests/README.txt @@ -1,4 +1,3 @@ -// $Id: README.txt,v 1.1 2009/10/06 01:38:55 webchick Exp $ The themes in this subdirectory are all used by the Drupal core testing framework. They are not functioning themes that could be used on a real site diff --git a/themes/tests/test_theme/template.php b/themes/tests/test_theme/template.php index 5681d5be..ef8118a6 100644 --- a/themes/tests/test_theme/template.php +++ b/themes/tests/test_theme/template.php @@ -1,5 +1,4 @@ <?php -// $Id: template.php,v 1.2 2010/08/22 12:46:21 dries Exp $ /** * Tests a theme overriding a suggestion of a base theme hook. diff --git a/themes/tests/test_theme/test_theme.info b/themes/tests/test_theme/test_theme.info index 16938a76..2dfc17d9 100644 --- a/themes/tests/test_theme/test_theme.info +++ b/themes/tests/test_theme/test_theme.info @@ -1,4 +1,3 @@ -; $Id: test_theme.info,v 1.3 2010/11/07 00:27:20 dries Exp $ name = Test theme description = Theme for testing the theme system core = 7.x @@ -16,8 +15,8 @@ hidden = TRUE ; file within the theme folder. stylesheets[all][] = system.base.css -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/themes/tests/update_test_basetheme/update_test_basetheme.info b/themes/tests/update_test_basetheme/update_test_basetheme.info index 27e6fb3f..f45f7e07 100644 --- a/themes/tests/update_test_basetheme/update_test_basetheme.info +++ b/themes/tests/update_test_basetheme/update_test_basetheme.info @@ -1,11 +1,10 @@ -; $Id: update_test_basetheme.info,v 1.2 2010/11/07 00:27:20 dries Exp $ name = Update test base theme description = Test theme which acts as a base theme for other test subthemes. core = 7.x hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/themes/tests/update_test_subtheme/update_test_subtheme.info b/themes/tests/update_test_subtheme/update_test_subtheme.info index 2b21a98e..d4719a49 100644 --- a/themes/tests/update_test_subtheme/update_test_subtheme.info +++ b/themes/tests/update_test_subtheme/update_test_subtheme.info @@ -1,12 +1,11 @@ -; $Id: update_test_subtheme.info,v 1.2 2010/11/07 00:27:20 dries Exp $ name = Update test subtheme description = Test theme which uses update_test_basetheme as the base theme. core = 7.x base theme = update_test_basetheme hidden = TRUE -; Information added by drupal.org packaging script on 2011-01-05 -version = "7.0" +; Information added by drupal.org packaging script on 2011-05-25 +version = "7.2" project = "drupal" -datestamp = "1294208756" +datestamp = "1306357016" diff --git a/update.php b/update.php index b860b964..e238f9d3 100644 --- a/update.php +++ b/update.php @@ -1,5 +1,4 @@ <?php -// $Id: update.php,v 1.328 2011/01/04 05:57:26 webchick Exp $ /** * Root directory of Drupal installation. @@ -57,9 +56,10 @@ function update_script_selection_form($form, &$form_state) { foreach ($updates as $module => $update) { if (!isset($update['start'])) { $form['start'][$module] = array( - '#title' => $module, - '#item' => $update['warning'], - '#prefix' => '<div class="warning">', + '#type' => 'item', + '#title' => $module . ' module', + '#markup' => $update['warning'], + '#prefix' => '<div class="messages warning">', '#suffix' => '</div>', ); $incompatible_updates_exist = TRUE; @@ -351,9 +351,18 @@ require_once DRUPAL_ROOT . '/includes/unicode.inc'; unl_bootstrap(); update_prepare_d7_bootstrap(); +// Temporarily disable configurable timezones so the upgrade process uses the +// site-wide timezone. This prevents a PHP notice during session initlization +// and before offsets have been converted in user_update_7002(). +$configurable_timezones = variable_get('configurable_timezones', 1); +$conf['configurable_timezones'] = 0; + // Determine if the current user has access to run update.php. drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION); +// Reset configurable timezones. +$conf['configurable_timezones'] = $configurable_timezones; + // Only allow the requirements check to proceed if the current user has access // to run updates (since it may expose sensitive information about the site's // configuration). @@ -378,6 +387,10 @@ if (empty($op) && update_access_allowed()) { // Set up theme system for the maintenance page. drupal_maintenance_theme(); + // Rebuild the registry to ensure that removed hooks in modules do not result + // in undefined function errors and that newly defined hooks are called. + registry_rebuild(); + // Check the update requirements for Drupal. update_check_requirements(); diff --git a/xmlrpc.php b/xmlrpc.php index 32fe7ef1..b202dc29 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -1,5 +1,4 @@ <?php -// $Id: xmlrpc.php,v 1.20 2010/10/02 01:22:41 dries Exp $ /** * @file -- GitLab