summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2011-05-04 20:21:42 (GMT)
committerEarl Miles2011-05-04 20:21:42 (GMT)
commit8beebb55aa9e9895052a2cab97da3407afae5548 (patch)
treee7d8222e4f80b608bcbd90e4839ee296e788fbee
parent429d3608a94b0a2436c7cd60062ecc8d36e67061 (diff)
Empty master branch.master
-rw-r--r--CHANGELOG.txt312
-rw-r--r--README.txt28
-rw-r--r--css/views-admin.css655
-rw-r--r--css/views-list-rtl.css27
-rw-r--r--css/views-list.css83
-rw-r--r--css/views-tabs.css5
-rw-r--r--css/views.css95
-rw-r--r--docs/docs.php657
-rw-r--r--documentation-standards.txt6
-rw-r--r--handlers/views_handler_argument.inc773
-rw-r--r--handlers/views_handler_argument_date.inc66
-rw-r--r--handlers/views_handler_argument_formula.inc54
-rw-r--r--handlers/views_handler_argument_many_to_one.inc157
-rw-r--r--handlers/views_handler_argument_null.inc59
-rw-r--r--handlers/views_handler_argument_numeric.inc93
-rw-r--r--handlers/views_handler_argument_string.inc215
-rw-r--r--handlers/views_handler_field.inc806
-rw-r--r--handlers/views_handler_field_boolean.inc56
-rw-r--r--handlers/views_handler_field_counter.inc41
-rw-r--r--handlers/views_handler_field_custom.inc34
-rw-r--r--handlers/views_handler_field_date.inc74
-rw-r--r--handlers/views_handler_field_markup.inc41
-rw-r--r--handlers/views_handler_field_numeric.inc95
-rw-r--r--handlers/views_handler_field_prerender_list.inc111
-rw-r--r--handlers/views_handler_field_url.inc38
-rw-r--r--handlers/views_handler_filter.inc613
-rw-r--r--handlers/views_handler_filter_boolean_operator.inc148
-rw-r--r--handlers/views_handler_filter_boolean_operator_string.inc27
-rw-r--r--handlers/views_handler_filter_date.inc152
-rw-r--r--handlers/views_handler_filter_equality.inc38
-rw-r--r--handlers/views_handler_filter_float.inc22
-rw-r--r--handlers/views_handler_filter_in_operator.inc359
-rw-r--r--handlers/views_handler_filter_many_to_one.inc103
-rw-r--r--handlers/views_handler_filter_numeric.inc302
-rw-r--r--handlers/views_handler_filter_string.inc302
-rw-r--r--handlers/views_handler_relationship.inc152
-rw-r--r--handlers/views_handler_sort.inc86
-rw-r--r--handlers/views_handler_sort_date.inc69
-rw-r--r--handlers/views_handler_sort_formula.inc47
-rw-r--r--handlers/views_handler_sort_menu_hierarchy.inc19
-rw-r--r--handlers/views_handler_sort_random.inc27
-rw-r--r--help/about.html17
-rw-r--r--help/analyze-theme.html23
-rw-r--r--help/api-default-views.html101
-rw-r--r--help/api-example.html179
-rw-r--r--help/api-handlers.html70
-rw-r--r--help/api-plugins.html79
-rw-r--r--help/api-tables.html234
-rw-r--r--help/api.html22
-rw-r--r--help/argument.html57
-rw-r--r--help/display-attachment.html1
-rw-r--r--help/display-block.html10
-rw-r--r--help/display-default.html4
-rw-r--r--help/display-feed.html1
-rw-r--r--help/display-page.html3
-rw-r--r--help/display.html7
-rw-r--r--help/embed.html24
-rw-r--r--help/example-author-block.html77
-rw-r--r--help/example-recent-stories.html57
-rw-r--r--help/example-user-feed.html73
-rw-r--r--help/example-users-by-role.html47
-rw-r--r--help/field.html5
-rw-r--r--help/filter.html12
-rw-r--r--help/getting-started.html22
-rw-r--r--help/images/node-term_node-term_data-large.pngbin4141 -> 0 bytes
-rw-r--r--help/images/node-term_node-term_data.pngbin3457 -> 0 bytes
-rw-r--r--help/images/overview-ui-large.pngbin83826 -> 0 bytes
-rw-r--r--help/images/overview-ui-small.pngbin44890 -> 0 bytes
-rw-r--r--help/images/style-breakdown-large.pngbin47381 -> 0 bytes
-rw-r--r--help/images/style-breakdown.pngbin15182 -> 0 bytes
-rw-r--r--help/images/views1-admin-large.pngbin67878 -> 0 bytes
-rw-r--r--help/images/views1-admin.pngbin24372 -> 0 bytes
-rw-r--r--help/images/views1-changeviewtype-large.pngbin37394 -> 0 bytes
-rw-r--r--help/images/views1-changeviewtype.pngbin17456 -> 0 bytes
-rw-r--r--help/images/views2-addaview-large.pngbin46121 -> 0 bytes
-rw-r--r--help/images/views2-addaview.pngbin19262 -> 0 bytes
-rw-r--r--help/images/views2-adddisplay-large.pngbin43413 -> 0 bytes
-rw-r--r--help/images/views2-adddisplay.pngbin19976 -> 0 bytes
-rw-r--r--help/images/views2-addfields-large.pngbin29487 -> 0 bytes
-rw-r--r--help/images/views2-addfields.pngbin13043 -> 0 bytes
-rw-r--r--help/images/views2-addfieldsajax-large.pngbin26423 -> 0 bytes
-rw-r--r--help/images/views2-addfieldsajax.pngbin16005 -> 0 bytes
-rw-r--r--help/images/views2-admin-large.pngbin53418 -> 0 bytes
-rw-r--r--help/images/views2-admin.pngbin19994 -> 0 bytes
-rw-r--r--help/images/views2-changedisplaystyle-large.pngbin43090 -> 0 bytes
-rw-r--r--help/images/views2-changedisplaystyle.pngbin16163 -> 0 bytes
-rw-r--r--help/images/views2-fieldspreview-large.pngbin40484 -> 0 bytes
-rw-r--r--help/images/views2-fieldspreview.pngbin12480 -> 0 bytes
-rw-r--r--help/images/views2-newview-large.pngbin36263 -> 0 bytes
-rw-r--r--help/images/views2-newview.pngbin17308 -> 0 bytes
-rw-r--r--help/images/views2-rearrangefields-large.pngbin34183 -> 0 bytes
-rw-r--r--help/images/views2-rearrangefields.pngbin19129 -> 0 bytes
-rw-r--r--help/images/views2-tablestyle-large.pngbin38890 -> 0 bytes
-rw-r--r--help/images/views2-tablestyle.pngbin20917 -> 0 bytes
-rw-r--r--help/menu.html21
-rw-r--r--help/new.html113
-rw-r--r--help/overrides.html6
-rw-r--r--help/path.html7
-rw-r--r--help/relationship.html13
-rw-r--r--help/sort.html24
-rw-r--r--help/style-comment-rss.html1
-rw-r--r--help/style-fields.html5
-rw-r--r--help/style-grid.html20
-rw-r--r--help/style-list.html20
-rw-r--r--help/style-node-rss.html1
-rw-r--r--help/style-node.html9
-rw-r--r--help/style-row.html3
-rw-r--r--help/style-rss.html3
-rw-r--r--help/style-summary-unformatted.html3
-rw-r--r--help/style-summary.html3
-rw-r--r--help/style-table.html13
-rw-r--r--help/style-unformatted.html1
-rw-r--r--help/style.html13
-rw-r--r--help/theme-css.html75
-rw-r--r--help/updating.html2
-rw-r--r--help/using-theme.html50
-rw-r--r--help/view-type.html21
-rw-r--r--help/views.help.ini203
-rw-r--r--images/arrow-active.pngbin313 -> 0 bytes
-rw-r--r--images/expanded-options.pngbin228 -> 0 bytes
-rw-r--r--images/overridden.gifbin175 -> 0 bytes
-rw-r--r--images/sprites.pngbin1926 -> 0 bytes
-rw-r--r--images/status-active.gifbin2196 -> 0 bytes
-rw-r--r--includes/admin.inc3072
-rw-r--r--includes/ajax.inc184
-rw-r--r--includes/analyze.inc108
-rw-r--r--includes/base.inc127
-rw-r--r--includes/cache.inc269
-rw-r--r--includes/convert.inc542
-rw-r--r--includes/form.inc298
-rw-r--r--includes/handlers.inc1387
-rw-r--r--includes/plugins.inc378
-rw-r--r--includes/query.inc1019
-rw-r--r--includes/tabs.inc192
-rw-r--r--includes/view.inc2034
-rw-r--r--js/ajax.js312
-rw-r--r--js/ajax_view.js155
-rw-r--r--js/base.js122
-rw-r--r--js/dependent.js190
-rw-r--r--js/tabs.js437
-rw-r--r--modules/aggregator.views.inc384
-rw-r--r--modules/aggregator/views_handler_argument_aggregator_category_cid.inc20
-rw-r--r--modules/aggregator/views_handler_argument_aggregator_fid.inc21
-rw-r--r--modules/aggregator/views_handler_field_aggregator_category.inc52
-rw-r--r--modules/aggregator/views_handler_field_aggregator_title_link.inc43
-rw-r--r--modules/aggregator/views_handler_field_aggregator_xss.inc13
-rw-r--r--modules/aggregator/views_handler_filter_aggregator_category_cid.inc19
-rw-r--r--modules/aggregator/views_plugin_row_aggregator_rss.inc64
-rw-r--r--modules/book.views.inc124
-rw-r--r--modules/book.views_convert.inc80
-rw-r--r--modules/comment.views.inc561
-rw-r--r--modules/comment.views_convert.inc131
-rw-r--r--modules/comment.views_default.inc360
-rw-r--r--modules/comment/views_handler_argument_comment_user_uid.inc40
-rw-r--r--modules/comment/views_handler_field_comment.inc49
-rw-r--r--modules/comment/views_handler_field_comment_depth.inc13
-rw-r--r--modules/comment/views_handler_field_comment_link.inc37
-rw-r--r--modules/comment/views_handler_field_comment_link_delete.inc14
-rw-r--r--modules/comment/views_handler_field_comment_link_edit.inc24
-rw-r--r--modules/comment/views_handler_field_comment_link_reply.inc15
-rw-r--r--modules/comment/views_handler_field_comment_node_link.inc62
-rw-r--r--modules/comment/views_handler_field_comment_username.inc47
-rw-r--r--modules/comment/views_handler_field_ncs_last_comment_name.inc45
-rw-r--r--modules/comment/views_handler_field_ncs_last_updated.inc11
-rw-r--r--modules/comment/views_handler_field_node_comment.inc18
-rw-r--r--modules/comment/views_handler_field_node_new_comments.inc98
-rw-r--r--modules/comment/views_handler_filter_comment_user_uid.inc22
-rw-r--r--modules/comment/views_handler_filter_ncs_last_updated.inc17
-rw-r--r--modules/comment/views_handler_filter_node_comment.inc14
-rw-r--r--modules/comment/views_handler_sort_comment_thread.inc20
-rw-r--r--modules/comment/views_handler_sort_ncs_last_comment_name.inc22
-rw-r--r--modules/comment/views_handler_sort_ncs_last_updated.inc12
-rw-r--r--modules/comment/views_plugin_row_comment_rss.inc41
-rw-r--r--modules/comment/views_plugin_row_comment_view.inc49
-rw-r--r--modules/contact.views.inc32
-rw-r--r--modules/contact/views_handler_field_contact_link.inc57
-rw-r--r--modules/filter.views.inc54
-rw-r--r--modules/filter/views_handler_field_filter_format_name.inc28
-rw-r--r--modules/locale.views.inc246
-rw-r--r--modules/locale/views_handler_argument_locale_group.inc34
-rw-r--r--modules/locale/views_handler_argument_locale_language.inc32
-rw-r--r--modules/locale/views_handler_field_locale_group.inc13
-rw-r--r--modules/locale/views_handler_field_locale_language.inc11
-rw-r--r--modules/locale/views_handler_field_locale_link_edit.inc44
-rw-r--r--modules/locale/views_handler_filter_locale_group.inc17
-rw-r--r--modules/locale/views_handler_filter_locale_language.inc16
-rw-r--r--modules/locale/views_handler_filter_locale_version.inc21
-rw-r--r--modules/node.views.inc841
-rw-r--r--modules/node.views_convert.inc181
-rw-r--r--modules/node.views_default.inc383
-rw-r--r--modules/node/views_handler_argument_dates_various.inc168
-rw-r--r--modules/node/views_handler_argument_node_language.inc31
-rw-r--r--modules/node/views_handler_argument_node_nid.inc25
-rw-r--r--modules/node/views_handler_argument_node_type.inc35
-rw-r--r--modules/node/views_handler_argument_node_vid.inc27
-rw-r--r--modules/node/views_handler_field_history_user_timestamp.inc71
-rw-r--r--modules/node/views_handler_field_node.inc63
-rw-r--r--modules/node/views_handler_field_node_link.inc38
-rw-r--r--modules/node/views_handler_field_node_link_delete.inc29
-rw-r--r--modules/node/views_handler_field_node_link_edit.inc29
-rw-r--r--modules/node/views_handler_field_node_revision_link_delete.inc37
-rw-r--r--modules/node/views_handler_field_node_revision_link_revert.inc38
-rw-r--r--modules/node/views_handler_field_node_type.inc12
-rw-r--r--modules/node/views_handler_filter_history_user_timestamp.inc71
-rw-r--r--modules/node/views_handler_filter_node_access.inc32
-rw-r--r--modules/node/views_handler_filter_node_status.inc13
-rw-r--r--modules/node/views_handler_filter_node_type.inc16
-rw-r--r--modules/node/views_plugin_argument_default_node.inc27
-rw-r--r--modules/node/views_plugin_argument_validate_node.inc122
-rw-r--r--modules/node/views_plugin_row_node_rss.inc139
-rw-r--r--modules/node/views_plugin_row_node_view.inc72
-rw-r--r--modules/poll.views.inc55
-rw-r--r--modules/profile.views.inc244
-rw-r--r--modules/profile.views_convert.inc39
-rw-r--r--modules/profile/views_handler_field_profile_date.inc81
-rw-r--r--modules/profile/views_handler_field_profile_list.inc30
-rw-r--r--modules/profile/views_handler_filter_profile_selection.inc23
-rw-r--r--modules/search.views.inc223
-rw-r--r--modules/search.views_convert.inc23
-rw-r--r--modules/search.views_default.inc151
-rw-r--r--modules/search/views_handler_field_search_score.inc81
-rw-r--r--modules/search/views_handler_filter_search.inc112
-rw-r--r--modules/search/views_handler_sort_search_score.inc24
-rw-r--r--modules/search/views_plugin_row_search_view.inc33
-rw-r--r--modules/statistics.views.inc267
-rw-r--r--modules/statistics.views_convert.inc51
-rw-r--r--modules/statistics.views_default.inc304
-rw-r--r--modules/statistics/views_handler_field_accesslog_path.inc45
-rw-r--r--modules/system.views.inc217
-rw-r--r--modules/system/views_handler_argument_file_fid.inc17
-rw-r--r--modules/system/views_handler_field_file.inc52
-rw-r--r--modules/system/views_handler_field_file_status.inc10
-rw-r--r--modules/system/views_handler_filter_file_status.inc12
-rw-r--r--modules/taxonomy.views.inc430
-rw-r--r--modules/taxonomy.views_convert.inc94
-rw-r--r--modules/taxonomy.views_default.inc184
-rw-r--r--modules/taxonomy/views_handler_argument_taxonomy.inc19
-rw-r--r--modules/taxonomy/views_handler_argument_term_node_tid.inc41
-rw-r--r--modules/taxonomy/views_handler_argument_term_node_tid_depth.inc126
-rw-r--r--modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc58
-rw-r--r--modules/taxonomy/views_handler_argument_vocabulary_vid.inc19
-rw-r--r--modules/taxonomy/views_handler_field_taxonomy.inc58
-rw-r--r--modules/taxonomy/views_handler_field_term_node_tid.inc118
-rw-r--r--modules/taxonomy/views_handler_filter_term_node_tid.inc302
-rw-r--r--modules/taxonomy/views_handler_filter_term_node_tid_depth.inc89
-rw-r--r--modules/taxonomy/views_handler_filter_vocabulary_vid.inc18
-rw-r--r--modules/taxonomy/views_handler_relationship_node_term_data.inc74
-rw-r--r--modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc124
-rw-r--r--modules/translation.views.inc177
-rw-r--r--modules/translation/views_handler_argument_node_language.inc31
-rw-r--r--modules/translation/views_handler_argument_node_tnid.inc25
-rw-r--r--modules/translation/views_handler_field_node_language.inc12
-rw-r--r--modules/translation/views_handler_field_node_translation_link.inc32
-rw-r--r--modules/translation/views_handler_filter_node_language.inc15
-rw-r--r--modules/translation/views_handler_filter_node_tnid.inc38
-rw-r--r--modules/translation/views_handler_filter_node_tnid_child.inc15
-rw-r--r--modules/translation/views_handler_relationship_translation.inc96
-rw-r--r--modules/upload.views.inc163
-rw-r--r--modules/upload.views_convert.inc107
-rw-r--r--modules/upload/views_handler_field_upload_description.inc72
-rw-r--r--modules/upload/views_handler_field_upload_fid.inc83
-rw-r--r--modules/upload/views_handler_filter_upload_fid.inc17
-rw-r--r--modules/user.views.inc410
-rw-r--r--modules/user.views_convert.inc60
-rw-r--r--modules/user/views_handler_argument_user_uid.inc29
-rw-r--r--modules/user/views_handler_argument_users_roles_rid.inc17
-rw-r--r--modules/user/views_handler_field_user.inc47
-rw-r--r--modules/user/views_handler_field_user_language.inc28
-rw-r--r--modules/user/views_handler_field_user_link.inc42
-rw-r--r--modules/user/views_handler_field_user_link_delete.inc17
-rw-r--r--modules/user/views_handler_field_user_link_edit.inc17
-rw-r--r--modules/user/views_handler_field_user_mail.inc32
-rw-r--r--modules/user/views_handler_field_user_name.inc62
-rw-r--r--modules/user/views_handler_field_user_picture.inc22
-rw-r--r--modules/user/views_handler_field_user_roles.inc46
-rw-r--r--modules/user/views_handler_filter_user_current.inc27
-rw-r--r--modules/user/views_handler_filter_user_name.inc143
-rw-r--r--modules/user/views_handler_filter_user_roles.inc10
-rw-r--r--modules/user/views_plugin_argument_default_current_user.inc16
-rw-r--r--modules/user/views_plugin_argument_default_user.inc63
-rw-r--r--modules/user/views_plugin_argument_validate_user.inc105
-rw-r--r--modules/views.views.inc59
-rw-r--r--plugins/views_plugin_access.inc81
-rw-r--r--plugins/views_plugin_access_none.inc10
-rw-r--r--plugins/views_plugin_access_perm.inc39
-rw-r--r--plugins/views_plugin_access_role.inc59
-rw-r--r--plugins/views_plugin_argument_default.inc78
-rw-r--r--plugins/views_plugin_argument_default_php.inc51
-rw-r--r--plugins/views_plugin_argument_validate.inc70
-rw-r--r--plugins/views_plugin_argument_validate_numeric.inc27
-rw-r--r--plugins/views_plugin_argument_validate_php.inc47
-rw-r--r--plugins/views_plugin_cache.inc282
-rw-r--r--plugins/views_plugin_cache_none.inc18
-rw-r--r--plugins/views_plugin_cache_time.inc47
-rw-r--r--plugins/views_plugin_display.inc1877
-rw-r--r--plugins/views_plugin_display_attachment.inc231
-rw-r--r--plugins/views_plugin_display_block.inc192
-rw-r--r--plugins/views_plugin_display_default.inc55
-rw-r--r--plugins/views_plugin_display_feed.inc201
-rw-r--r--plugins/views_plugin_display_page.inc480
-rw-r--r--plugins/views_plugin_exposed_form.inc92
-rw-r--r--plugins/views_plugin_exposed_form_basic.inc12
-rw-r--r--plugins/views_plugin_exposed_form_input_required.inc77
-rw-r--r--plugins/views_plugin_row.inc139
-rw-r--r--plugins/views_plugin_row_fields.inc70
-rw-r--r--plugins/views_plugin_style.inc234
-rw-r--r--plugins/views_plugin_style_default.inc24
-rw-r--r--plugins/views_plugin_style_grid.inc44
-rw-r--r--plugins/views_plugin_style_list.inc37
-rw-r--r--plugins/views_plugin_style_rss.inc103
-rw-r--r--plugins/views_plugin_style_summary.inc58
-rw-r--r--plugins/views_plugin_style_summary_unformatted.inc34
-rw-r--r--plugins/views_plugin_style_table.inc253
-rw-r--r--theme/theme.inc698
-rw-r--r--theme/views-exposed-form.tpl.php47
-rw-r--r--theme/views-more.tpl.php16
-rw-r--r--theme/views-ui-edit-item.tpl.php45
-rw-r--r--theme/views-ui-edit-tab.tpl.php95
-rw-r--r--theme/views-ui-edit-view.tpl.php45
-rw-r--r--theme/views-ui-list-views.tpl.php41
-rw-r--r--theme/views-view-field.tpl.php22
-rw-r--r--theme/views-view-fields.tpl.php38
-rw-r--r--theme/views-view-grid.tpl.php36
-rw-r--r--theme/views-view-list.tpl.php20
-rw-r--r--theme/views-view-row-comment.tpl.php17
-rw-r--r--theme/views-view-row-node.tpl.php20
-rw-r--r--theme/views-view-row-rss.tpl.php14
-rw-r--r--theme/views-view-rss.tpl.php19
-rw-r--r--theme/views-view-summary-unformatted.tpl.php19
-rw-r--r--theme/views-view-summary.tpl.php19
-rw-r--r--theme/views-view-table.tpl.php41
-rw-r--r--theme/views-view-unformatted.tpl.php16
-rw-r--r--theme/views-view.tpl.php82
-rw-r--r--views.info4
-rw-r--r--views.install297
-rw-r--r--views.module1219
-rw-r--r--views2.doxy1252
-rw-r--r--views_export/views_export.css12
-rw-r--r--views_export/views_export.info6
-rw-r--r--views_export/views_export.module255
-rw-r--r--views_ui.info5
-rw-r--r--views_ui.module296
342 files changed, 1 insertions, 40975 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
deleted file mode 100644
index 34b12a6..0000000
--- a/CHANGELOG.txt
+++ /dev/null
@@ -1,312 +0,0 @@
-CHANGELOG for Views 2 for Drupal 6
-
-Views 2.x-dev
- Bug fixes:
- o Table style when not overriding sorts put sorts in wrong order.
- o #488908 by sl27257: "Node: Has new content" only worked when exposed.
- o #451110 by wonder95: Fixed missing word in transform case help text.
- o #385904 by JirkaRybka: Prevent duplication of id edit-submit on views exposed form.
- o #489888 by TheRec: Remove erroneous "alt" attribute from <a> when using link rewriting.
- o #499078 by Darren Oh: Make sure theme is initialized for pre_render hook.
- o #490516 by v_20q: Some fields not properly being marked as translatable due to option unpacking bug.
- o #484222 by dereine: Attachment displays were ignoring access settings.
- o #503098 by Davide Goode: Feed displays should have link displays since they link to a page display.
- o #381346 by ayalon: Allow Taxonomy: Tid as a field, which is now needed for rewrites which may need tids.
- o #485296 by overall and deekayen: Remove unnecessary t() call.
- o #460838 by Darren Oh: Make DISTINCT more distinct.
- o #503774 by dereine: Cache time failed to return the proper cutoff time.
- o #506098: Table sorting with no default was overriding sorts even tho it was not supposed to.
- o #407538: Ensure views_break_phrase() will stop providing warnings on empty strings.
- o #420850 by dereine: Commas should not be used to separate items in a profile list field.
- o #482162 by agentrickard: link path needed further sanitization to properly encode special characters.
- o Tables would not accept 0 as having data so columns with zeroes would lose data when merging with other columns.
- o #529164: Fatal typo in profile list field.
- o #537870 by dww: Fixed a bug in the [uplodate_fid-size] token where format_size() was called on it twice.
- o #510910 by mfb: Fixed bug where multiple fields sharing a column in a table was broken so only the final field would display.
- o #546586 by dww: Fixed bugs that prevented '0' being a valid rewrite text or empty text for a view field. Also fixes a logic bug regarding the handling of the 'Count the number 0 as empty' setting.
- o #507884 by TheRec: Removed matching title (alt) attribute on node links.\
- o #468370 by emackn: Proper timezone support on postgres.
- o #508124 by voxpelli: Optionally allow boolean to treat NULL as FALSE.
- o #487528 by dereine: Fix typo in 'Maximum length' field instructions.
- o #303800 by Justin W Freeman: Improve dashes to spaces transformation.
- o #538530 by elcuco: Views export textareas should be LTR.
- o #538204 by dereine: User picture should be sortable.
- o #540122 by stella: Attachment displays should attach even if arguments caused the primary display to abort.
- o #544098 by joachim: Fix validation quirks with defaulted handlers.
- o #485872 by dereine: Make sure views.css is always loaded for all users.
- o #442982 by killes: Make destroy() method more robust so that views are more readily reused.
- o #520558 by bdurbin: node access filter not properly checking 'view'.
- o #535424 by Hugo Wetterberg: Download file link could provide empty a tag if no file is available.
- o #554000 by killes: Preview checking wrong flag for preview state causes feeds to display incorrectly when embedded.
- o #554016 by webchick: views_embed_view() should check view access.
- o #523222 by gpk: Contact link should not be allowed for the anonymous user.
- o #563540 by dereine: Fix description of cache plugin settings.
- o #564536 by dereine: Node links should allow language setting from node data.
- o #551752 by dereine: Clean up row counter code.
- o #451208 by dereine and superbaloo: Fix grid style to not leave missing tds in bottom row.
- o #561892 by dereine: Unchecking "rewrite this field" but leaving a value caused field to be rewritten anyway.
- o #408894 by dereine: Views AJAX incorrectly used "access content" permission.
- o #574150 by dereine: Remove user search because user.module does not store user keywords.
- o #511908 by dww: Too many check plains in selects because of problems with checkboxes.
-
- Other changes:
- o Implement a post_render hook (for themes too) and cache method.
- o #501552 by neclimdul: Work around a core bug with DISTINCT on nodes.
- o #430068 by overall and aclight: Improvements to the global "counter" field.
- o #492002 by iterato: Allow "target" specification in field linking.
- o #466454 by neclimdul: PHP strict fixes.
- o Can now directly add a taxonomy term relationship to nodes, allowing more control by vocabulary.
- o #472194: !1 can now be used with field rewriting to get the raw argument.
- o #480162: Fields row style now contains option to hide empty fields.
- o #433318: Special handling for empty fields, allowing them to avoid rewriting and not be displayed.
- o #354457 by ausvalue: Example integrating node_example.module with Views API.
- o #479728 by enboig: Allow "Does not start with" and "Does not end with" as string operators.
- o #511468 by dereine: State which view was saved after saving a view.
- o #520632 by DamZ: Add comment hostname and mail to available comment fields.
- o #523580 by JirkaRybka: More documentation on Reduce Duplicates option.
- o #510920 by apanag: Add set_current_page() method to view class.
- o #337741 by joachim: Allow profile fields to have "link to user" option.
- o #534680 by dagmar: Visual indicator if checkbox will expand options.
- o #512650 by sdboyer: Multiple many to one arguments on the same relationship were not relationship safe.
- o #536994 by dboulet: Store result in variables for use in unformatted style.
- o #458194 by voxpelli: Add first and last row classes to table style.
- o #254895: Add form to clean up Views 1 tables.
-
-Views 2.6
- Bugs fixed:
- o #419226 by kelvincool: Respect admin theme during views ajax operations.
- o #419270 by voxpelli: set_where_group() could fail if no previous groups.
- o #422054 by yhahn: Protect exports from impropertly indenting multiline strings.
- o #437070 by mikeryan: Base table formerly limited to 32 characters.
- o #317271 by quicksketch: ensure_my_table() limited to one relationship per table.
- o #441520 by jonathan1055: Allow the "time ago" date format to work on future dates as well.
- o #445398 by casey: reduce_value_options() using wrong value array.
- o #451370 by skwashd: base.js had some DOS line endings.
- o #454754 by dww: Fix PGSQL related errors with comment author filtering.
- o #384286 by dww: Make it possible to expose the filter for "Node: Has new content"
- o #463634 by alienbrain: "Empty field name" incorrectly specified.
- o #463580 by ximo: AJAX summary links broken in some displays.
- o #468336 by psynaptic: Fix broken hook_views_admin_links_alter
- o #422868 by mattman: Breadcrumbs not properly substuting % replacements.
- o #440676 by dereine and Razorraser: View import form crashed on empty view input.
- o #461842 by dereine: Use gmtime() instead of format_date() to prevent localization of dates in RSS feeds.
- o #316556 by darrenoh and JirkaRybka: More 1.x upgrade fixes.
- o #382398 by elcuco: Force LTR in the views admin.
- o #461144: Fix trimming to correctly remove tags when they are trimmed in half.
- o #330956: Theme: Information only scanned information from the default theme.
- o SA-CONTRIB-2009-037: Filter checkboxes could be displayed unfiltered allowing XSS attacks.
-
- Other changes:
- o #298616: Add argument for node updated time similar to node created time.
- o #325607 by bangpound: Automatically sort exports from bulk export.
- o #323049 by yched: Allow Empty/Not Empty on select many to one.
- o #340701 by swentel: Restore allowing Views to set block caching mode.
- o #347892 by dww: Allow <any> option in Boolean filters.
- o #358314 by brmassa: Catch the exposed filter form so it doesn't process twice on a single view.
- o #154865 by Zack Rosen, josh_k and KarenS: Allow user contact form as a field.
- o #411880 by fgm: Add "options callback" to items using in_operator handler.
- o #360657 by yhahn: new hook_views_default_views_alter().
- o #430068 by dereine: New global counter field for displaying row number.
- o #420340 by derine: Translate node type filter.
- o #325796 by yang_yi_cn: Translate node type argument.
- o #446726 by yhahn: Improved performance for js dependencies.
- o #437760 by leeneman: Remove duplicate terms from taxonomy term argument title.
- o #354270 by dereine: Allow "tag" to be added to the theme template suggestions.
- o #408180 by joachim: Allow taxonomy term parent argument.
- o #469456 by dereine: Automatically give .info file during views bulk export.
- o #424460 by thePanz: Customizable breadcrumb title for arguments.
- o #436398 by Pasqualle: Support for aggregator category table.
- o #424648 by quicksketch and dereine: Allow format selection on filesize field.
- o #478312 by yhahn: Provide specific node access filter.
- o #479878 by dereine: User language field.
- o #468824 by eaton: Pluggable caching mechanism which can cache both the query result and rendered result.
- o #399534 by clemens.tolboom and drewish: Add fragment and query string as options when making fields into links.
- o #315915 by dixon_: Add another base row class to rows.
- o #353403 by agentrickard: Field to provide "more" text.
- o #377896 by dereine: When ticked "link to node" show node title as a href title attribute.
- o #386098 by dereine: Add "watchdog" as a debug logging options.
- o #409428 by gpk: Missing field: node input format.
- o #271833 by grugnog, agentrickard and others: Taxonomy depth in filter.
-
-Views 2.5
- Bugs fixed:
- o #363817 by thePanz: Empty fields in table could still trigger separators.
- o #388952 by nikita@protsenko.com: Ensure taxonomy term validator sets the validated title when available.
- o #392176: Trim on word boundary would stop at newlines.
- o #415706 by dww: Fix broken relationship in search that caused SQL error.
- o #428742 by fralenuvol: Fix broken relationship causing sql error with multiple taxonomy term arguments.
- o #428102 with help from deviantintegral: Broken option_definition() causes warnings.
-
- Other changes:
- o #379382 by neochief: Add option to strip tags during advanced rendering.
- o #400914 by joachim: Add a link field to get to comments for a node that works just like the normal links.
- o #402650 by drewish: Bulk export views alphabetically by view name.
- o #349157 by yched: Support CCK build modes in node style.
-
-Views 2.4
- Bugs fixed:
- o #371466 by dereine: Fix incorrect link to comments.
- o #371923 by noahb: Summaries could be distinct even when they should not be.
- o #368764: Fix User ID validator to actually have proper dependencies.
- o #375342 by dww: node_comment_statistics should be INNER joined because there is always 1:1 reference.
- o #372959: Archive view should not use AJAX by default.
- o #373155: Not clearing "many to one" data breaks some attachment displays.
- o #375000 by elcuco: View name should always be LTR.
- o #378534 by dww: Validators do not fire if argument === 0 due to PHP loose type conversions.
- o #378164 by yched: Unexposed taxonomy filter could accidentally stop working.
- o #371923 by David_Rothstein: Another DISTINCT fix related to summaries.
- o #365831 by tomiyana: Fix typos in help.
- o #357368 by Pasquale: schema descriptions should not be translated.
- o #379602 by dww: Add a second "time ago" variant to dates to allow NOT printing the word "ago".
- o #379354 by neochief: Add an extra regex to remove mangled HTML entities in output rewriting.
- o #362830: Search was mostly broken, especially score but also searching on multiple terms.
- o #350376 by pfournier: Missing "return" statement caused certain argument date validation to fail.
- o #364082 by hass: Unique key missing on views_view table.
- o #366250 by sirkitree: Fix deprecated jquery selectors so we can work with jquery 1.2.6 as well as 1.3.2.
- o #386986: 2 or more relationships could block a normal table from being added.
- o #371219 by aclight: Incorrect logic in views_many_to_one_helper::ensure_my_table()
- o #376570 by yhahn: Better AJAX scrolling.
- o #412576 by yhahn: Restore missing views_handler_filter_float class.
- o #378710: Add strip_tags() to path when displaying a field as a link as a path can never have HTML in it.
- o #380560: UI could suddenly cause errors with get_handlers() in certain situations with relationships.
- o #342215: Occasional "holes" could appear in taxonomy term field causing query errors when relationship is used but not present.
- o #414074 by dereine: Prevent fields becoming not editable by having just spaces in them in the Views UI.
- o #378724: Displaying uploaded files as a link accidentally made the entire field a link rather than each one.
- o #415672 by yhahn: Views inadvertently rounds negative numbers down instead of up when truncating.
- o #408414 by rb7: Prevent empty links with the "has new comments" field.
- o #406680 by B√ľke Beyond: Missing clear-block caused problems in IE for Views UI.
- o #373771 by dropcube: Fix missing aggregator feed trying to use non-existing handlers.
- o #341960 by sun: Clean up dependent.js javascript declarations which potentially caused .js errors.
- o #372227: On Debian etch, tables would lose fields due to PHP bug.
-
- Other changes:
- o #375182 by vaish: Allow a reset parameter to views_get_all_views().
- o #356276 by nedjo: Locale support.
- o #316556 by Darren Oh: Better Views 1.x upgrades.
- o #383242 by dww: Allow - Any - instead of <Any> as an option in the Views tools menu.
- o #303800 by KarenS: Additional dashes to spaces option in taxonomy argument validator.
- o #327366 by yched: Allow row styles to follow relationships too.
- o #405130 by dereine: Make the output field rewrite a textfield rather than textarea.
-
-Views 2.3
- Bugs fixed:
- o #349739: Fix arguments not getting transmitted to attachment displays properly.
- o #354707: Display attachment happened too early preventing default arguments from passing to the attachment.
- o #277321 by nedjo: Use AJAX properly supports summaries in attachments.
- o #291292 by sammys (reroll by jaydub): Proper use of DISTINCT on summary views on pgsql.
- o #291079 by sammys (reroll by jaydub): Fix use of GROUP BY on pgsql.
- o #295246 by webchick: Wrong table type on views object cache caused truncation of cached data and mysterious errors on large views.
- o #315007 by Garrett Albright, Paul Kishimoto and catch: Take into account page count when using comment new link.
- o #317562 by ingaro: Wrong date format for PGSQL.
- o #327604 by mr.baileys: Fix improper use of multibyte library when mb library unavailable.
- o #335926 by sapark and drewish: "January, 2009" should be "January 2009".
- o #341263 by cdale: Prevent exposed filter forms from processing during batch operations.
- o #342322 by drewish: Correct label for translation status.
- o #343223 by alienbrain: Ensure path before join.
- o #343284 by andypost: Fix odd/even reversed in table style compared to Drupal core.
- o #345545 by mfb: Correct occasional Drupal.settings related javascript error.
- o #345546: Fix Node: Created day argument off by 1 error.
- o #345707 by aries: Do not display breadcrumb link if no link text.
- o #355939 by yhager: Fix missing comment GUID in comment RSS style.
- o #321332 with help from brahms: views_handler_field_markup only worked if format was named "format".
- o #348322 by Darren Oh: Fix missing /code in api plugins help.
- o #353090 by eaton: RSS feeds were not using all of the Drupal hooks to ensure full compatibility with core feeds.
- o #293832 by drewish: Allow menu items to have administrative description.
- o #345528: Mini-pager generated invalid HTML with empty li tags.
- o #351745: Exposed taxonomy term autocomplete filter failed if term existed in multiple vocabularies.
- o #353002: tracker view had wrong argument and was not picking up comments by the selected user.
- o Case sensitivity on string filter checkmark was backward.
- o #355919: views_theme() needed to include plugin theme files to detect functions.
- o #353515: Many characters could get incorrectly translated in exposed filters combined with ajax tablesorting.
- o #359818: Delete button should say Revert when reverting a view to default.
- o #359132 by grugnog: CSS files should be marked conditional so they don't impact the CSS cache.
- o #360637: Extra slash in theme includes could cause some systems to fail.
- o #363081: Disabled views could still provide blocks.
- o #366666 by Deadmonk also yched: File size field should not try to print a size on NULL values.
- o #367203: Improper caching of default views caused incomplete handlers that could WSOD.
- o #365283: views_handler_filter_ncs_last_updated improperly registered causing fatal errors trying to use it.
- o #365712: select list exposed filters were trying to limit to list when selecting "All" even when "limit" was not selected.
- o #357196 by Grugnog: hook_views_pre_view not getting $display_id sent properly.
-
- Other changes:
- o #288801 by drewish and eaton: Aggregator item support! Make views of feeds!
- o #335647 by markus_petrux: Add memory and a reset button to the Views list page.
- o #343047 by alienbrain: Allow all handlers to participate in view validation.
- o #339223 by greggles: Allow taxonomy term tid to be sortable.
- o #324378 by eigentor: CSS improvements to the view list page.
- o #354736 by Shai: Clarification on exposed filter text.
- o #364637 by moshe and dww: Allow preprocessors to add row classes to table style.
- o #349178 by agentrickard: Add generic link handling plus a custom text field. Also automatic trimming.
- o #368234 by dww and neclimdul: Allow the "Anonymous" user to have a different (or no) name in User: name field.
- o #368754 by dww: User ID validator, with role testing.
- o #369505 by dww: Add helper function to get the value of a view argument.
- o #353002 by neclimdul: Provide a filter for user posted or commented on to complement the argument with the same functionality.
-
- 2.3 API Notes:
- A minor change in the API now requires that styles that render fields MUST
- render them in order, first by row and then by field ID. Not doing so will
- cause the token expansion to fail.
-
-Views 2.2
- Bugs fixed:
- o #305756: Number formatting caused illogical rounding.
- o #324272 by neochief: hook_pre_render never called.
- o #324058: Broken queries created by string values in multiple fields.
- o #324726: "tag" fields should be autocomplete in View edit.
- o #324058 by yched: Make aliases safer for many to one tables.
- o #325765: Prevent key merge errors on query::add_where and query::add_having.
- o #324378: Minor usability improvements to the list page.
- o #326934: Need another check to make sure already added aliases do not get blown away.
- o #324513: If a relationship table was added more than 1 hop away from the base, SQL errors resulted.
- o #326129 by mindgame: Not between operator did not function.
- o #326198: != mistakenly typod as = (display only)
- o #326379: Provide a default title for the archive view.
- o #327151: Add filter for node_counter.timestamp.
- o #327113: Clean up error text when display will not validate.
- o #307287: (Panels related) view::preview() would override previously set arguments if no arguments were sent.
- o #321589: Comment template preprocessor misnamed so it would not fire.
- o #329746: Comment rendering in the node row style was not working.
- o #321109: view::destroy() needs to unset current_display or future init_displays won't work.
- o #325115: If the block description is not set, show the display title as well as the view name in block administration.
- o #327604 by henrrrik: should use multibyte string functions.
- o #328933 by cmyers: views_handler_filter_date fails to use exposed operator.
- o #332568 by Moonshine: Correct views performance timers.
- o #332679 by yched: render_link() does not check for empty data.
- o #333593: Incorrect reference to non-existent views_handler_join in help/api-tables.html.
- o #334337 by miro_dietiker: Documentation clarification for arguments, blocks and PHP Code plugins.
- o #336456 by dww: Date filter had trouble with NULL operators.
- o #336125 by nedjo: Missing filter for node translation.
- o #337360: Menu selection causes crash if menu module not active.
- o #339295 by katbailey: AJAX paging could fail with the same view in multiple tabs.
- o #339676 by nedjo: Source translation had wrong filter handler.
- o #340002 by hass: Allow the "Add display" button to wrap for translations whose phrase is longer.
- o #340033 by pancho: Clearer wording on some field help texts.
- o #340515: views_perm() was incorrectly views_ui_perm().
- o #330897: Invalid displays causing 'path' lookup to crash.
- o #339674 by nedjo: Translation code cleanup.
- o #341897: views_perm() mistakenly declared in views_ui.module.
-
- Other changes:
- o Reorganize the analysis code into analyze.inc to make it easier for people to find the code and use it externally.
- o #298884 by neclimdul: Requested missing filter to filter for whether a user has a picture or not.
- o #336531 by dww: Set boolean filter to not use a checkbox which is lesser UI.
- o #338632 by drewish: Remove use of format_rss_channel and use proper templating instead.
- o #326034 by yched: Allow short names in admin summaries via new "title short" definition.
- o #335613 by swentel: Add hook_views_api() setting to bulk export.
- o #339707 by nedjo: Add filter to show child translations.
- o #284768 by drewish: Proper templates for RSS feeds rather than format_rss_item().
-
-
-Views 2.1
- Bugs fixed:
- o #322862: 1.0037 debug code left in.
- o #322908: README.txt update.
- o #323014 by yched: Typo in exposed filter text.
- o #323033: Using empty/is not empty in string/numeric filters caused notices.
- o #322874 by yched: Errors in summary for some filters.
- o #323282: Taxonomy term default choice handled incorrectly.
- o #323318: Exposed taxonomy term failed if not set force single.
-
-Views 2.0
- o First 2.0 official release
-
diff --git a/README.txt b/README.txt
index 52dc458..6ea10b8 100644
--- a/README.txt
+++ b/README.txt
@@ -1,27 +1 @@
-
-Welcome to Views 2. Please see the advanced help for more information.
-
-If you're having trouble installing this module, please ensure that your
-tar program is not flattening the directory tree, truncating filenames
-or losing files.
-
-Installing Views:
-
-Place the entirety of this directory in sites/all/modules/views
-
-Navigate to administer >> build >> modules. Enable Views and Views UI.
-
-If upgrading from Drupal 5 and Views 1, your views need to be
-converted manually. See administer >> build >> modules >> views >> tools >> convert.
-
-If you're new to Views, try the Simple Views module which can create some
-often used Views for you, this might save you some time.
-
-Recommended modules for use with Views:
- CCK
- Voting API
- Views Bonus Pack
- Views Bulk Operations
-
-Experimental modules:
- Views OR \ No newline at end of file
+master branch is unused. Please see versioned branches instead.
diff --git a/css/views-admin.css b/css/views-admin.css
deleted file mode 100644
index e9cd147..0000000
--- a/css/views-admin.css
+++ /dev/null
@@ -1,655 +0,0 @@
-
-/*
- * Summary pad
- */
-/* set up some defaults so weird themes don't override us too badly. */
-.views-tabset {
- color: #494949;
- background-color: white;
-}
-
-.views-tabset a:visited,
-.views-tabset a:hover,
-.views-tabset a {
- color: #027AC6;
-}
-
-.views-tabset .views-tab fieldset {
- margin-top: 0;
-}
-
-/*
- * First column: display drawers
- */
-.views-tabset .views-tabs {
- background: #F6F6F6;
- border-top: #D6DBDE 1px solid;
- border-bottom: #D6DBDE 1px solid;
- border-left: #D6DBDE 1px solid;
- float: left;
- width: 117px;
- margin-right: 0;
-}
-
-* html .views-tabset .views-tabs {
- width: 114px;
- position: relative;
- left: 4px;
-}
-
-.views-tabset .views-tabs ul {
- list-style-type: none !important;
- list-style-image: none !important;
- padding: 0;
- margin: 0;
- position: relative;
-}
-
-.views-tabset .views-tabs ul li {
- background: #efefef;
- list-style-type: none;
- list-style-image: none;
- line-height: 100%;
- border-bottom: #D6DBDE 1px solid;
- margin: 0;
- padding: 0;
- position: relative;
-}
-
-.views-tabset .views-tabs ul li.active {
- background: #fff url(../images/arrow-active.png) no-repeat right;
- position: relative;
- width: 118px;
- margin-right: -1px;
-}
-
-.views-tabset .views-tabs ul li a {
- display: block;
- font-size: 90%;
- color: #777;
- font-weight: normal;
- padding: 0.5em;
-}
-
-.views-tabset .views-tabs ul li a:hover {
- background-color: #f6f6f6;
- text-decoration: none;
-}
-
-.views-tabset .views-tabs ul li.active a {
- color: #000;
- font-weight: bold;
-}
-
-.views-tabset .views-tabs ul li.active a:hover {
- color: #000;
- background: #fff url(../images/arrow-active.png) no-repeat right;
-}
-
-.views-tabset .extra {
- text-align: center;
- margin-right: 0;
-}
-
-.views-tabset .extra input {
- margin-top: 0;
- margin-right: 0;
- white-space: normal;
-}
-
-/*
- * Three columns with setting-summaries
- */
-.views-tabset .views-display {
- border: #D6DBDE 1px solid;
- margin-left: 118px; /* 118 -1 causes borders to overlap */
- min-height: 302px;
- _height: 300px; /*stupid IE hack */
-}
-
-* html .views-tabset .views-display {
- margin-left: 114px;
-}
-
-div.views-display-deleted,
-div.views-display-deleted div.top,
-div.views-display-deleted div.tab-section {
- background-color: #eee;
-}
-
-.views-display {
- background: #fff;
-}
-
-.views-display div {
- font-size: 8pt;
- line-height: 12pt;
-}
-
-.views-display .top {
- padding: 0.5em 0em 0em 1em;
- background: #fff;
-}
-
-.views-display .top .display-title {
- font-weight: bold;
-}
-.views-display .top .display-description {
- margin-left: 1em;
- font-style: italic;
- overflow: hide;
- white-space: nowrap;
- font-size: 90%;
-}
-
-.views-display .tab-section {
- width: 32.5%;
- padding: 0;
- margin: 0;
- float: left;
- min-height: 273px;
- _height: 274px;
-}
-
-.views-display .tab-section .inside {
- margin: 0.5em 0.5em 0.5em 1em;
-}
-
-.views-display .tab-section .inside .views-category {
- margin-bottom: 1em;
- background: #f6f6f6;
- border: 1px #efefef solid;
-}
-
-.views-display .tab-section .inside .views-category-content {
- padding: 0em 0em 0.5em 1em;
-}
-
-.views-display .tab-section .inside .views-category-title {
- padding: .1em .1em .1em .3em;
- margin: 0 0 .1em 0;
- font-size: 9pt;
- font-weight: bold;
- background-color: #efefef;
- border-bottom: 1px #efefef solid;
-}
-
-.views-display .tab-section .links {
- float: right;
- font-size: 6pt;
- position: relative;
- display: inline;
-}
-
-.views-display .tab-section .links a {
- font-size: 6pt;
- font-style: italic;
-}
-
-.views-display .form-submit,
-#views-ajax-pad .form-submit {
- margin: 0;
-}
-
-.views-display .middle {
- width: 34%;
-}
-
-.views-basic-info {
- margin: 0.5em 0em 0 0;
- padding: 0.5em;
-}
-
-/*
- * AJAX pad, the bottom part where settings are edited.
- */
-#views-ajax-pad {
- background: transparent;
- margin-top: 0px;
-}
-
-#views-ajax-title {
- background: #f6f6f6;
- border-left: #D6DBDE 1px solid;
- border-right: #D6DBDE 1px solid;
- margin: 0 0 0 118px;
- padding: 1em 1em 0em 1em;
- font-weight: bold;
-}
-
-#views-ajax-pad .message {
- background: #f6f6f6;
- margin-left: 118px;
- border: #D6DBDE 1px solid;
- border-top: 0;
- /* padding: 3em 0em; */
- text-align: center;
- font-style: italic;
-}
-
-#views-ajax-pad form {
- background: #fff;
- margin-left: 118px;
- border: #D6DBDE 1px solid;
- padding-top: 3px;
- border-top: 0;
-}
-
-#views-ajax-pad .views-messages {
- background: transparent;
- margin-left: 118px;
- padding: 5px;
- border: #D6DBDE 1px solid;
- border-top: 0;
-}
-
-#views-ajax-pad .form-buttons {
- margin: 0;
- padding: 0.5em 1em;
- background: #f6f6f6;
- clear: left;
-}
-
-#views-ajax-pad .clear {
- clear: left;
-}
-
-#views-ajax-pad .form-buttons .form-submit {
- margin: 0 .5em 0 0;
- padding: 0;
-}
-
-#views-ajax-pad .form-item {
- margin: 0.5em;
- padding: 0em 0.5em;
-}
-
-/* These put checkboxes closer together */
-#views-ajax-pad .form-checkboxes .form-item,
-#views-ajax-pad .form-checkboxes .description,
-#views-ajax-pad .form-checkboxes input,
-#views-ajax-pad .form-radios .form-item,
-#views-ajax-pad .form-radios label,
-#views-ajax-pad .form-radios input {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-#views-ajax-pad .form-item .form-checkboxes,
-#views-ajax-pad .form-checkboxes input,
-#views-ajax-pad .form-checkboxes label,
-#views-ajax-pad .form-item .form-checkboxes .form-item,
-#views-ajax-pad .form-item .form-radios,
-#views-ajax-pad .form-radios input,
-#views-ajax-pad .form-radios label,
-#views-ajax-pad .form-item .form-radios .form-item {
- padding-left: 0;
- margin-left: 0;
-}
-
-#views-ajax-pad .form-checkboxes .description,
-#views-ajax-pad .form-radios .description {
- margin-left: 2em;
-}
-
-#views-ajax-pad {
- display: none;
-}
-
-html.js #views-ajax-pad {
- display: block;
-}
-
-.views-override,
-.views-expose {
- padding: 0.5em 1em 0em 1em;
-}
-
-#views-ajax-pad .views-override .form-submit,
-#views-ajax-pad .views-expose .form-submit {
- float: right;
- margin: 0 .5em 0 1em;
-}
-
-#views-ajax-pad .views-expose .description,
-#views-ajax-pad .views-override .description {
- margin-bottom: .25em;
-}
-
-/*
- * Some column widths for use within the ajax pad
- */
-#views-ajax-pad .views-left-10 {
- float: left;
- width: 10%;
-}
-
-#views-ajax-pad .views-left-20 {
- float: left;
- width: 20%;
-}
-
-#views-ajax-pad .views-left-25 {
- float: left;
- width: 25%;
-}
-
-#views-ajax-pad .views-left-30 {
- float: left;
- width: 30%;
-}
-
-#views-ajax-pad .views-left-40 {
- float: left;
- width: 40%;
-}
-
-#views-ajax-pad .views-left-50 {
- float: left;
- width: 49.5%;
-}
-
-#views-ajax-pad .views-right-50 {
- float: right;
- width: 50%;
-}
-
-#views-ajax-pad .views-right-60 {
- float: right;
- width: 60%;
-}
-
-#views-ajax-pad .views-right-70 {
- float: right;
- width: 70%;
-}
-
-#views-ajax-pad .views-left-75 {
- float: left;
- width: 75%;
-}
-
-#views-ajax-pad .views-radio-box {
- overflow: auto;
- height: 22em;
-}
-
-#views-ajax-pad fieldset {
- margin: 0 .5em;
-}
-
-#views-ajax-pad table td .form-item,
-#views-ajax-pad table td .form-item input,
-#views-ajax-pad table td .form-item select {
- padding: 0;
- margin: 0;
-}
-
-#views-ajax-pad label.hidden-options {
- background: transparent url(../images/arrow-active.png) no-repeat right;
- height: 12px;
- padding-right: 12px;
-}
-
-#views-ajax-pad label.expanded-options {
- background: transparent url(../images/expanded-options.png) no-repeat right;
- height: 12px;
- padding-right: 16px;
-}
-
-#views-ajax-pad .dependent-options {
- padding-left: 30px;
-}
-
-/*
- * Add, Rearrange and Configure buttons using sprites
- */
-a.views-button-configure,
-a.views-button-add,
-a.views-button-rearrange,
-a.views-button-remove {
- background:transparent url(../images/sprites.png);
- display: inline-block;
- float: right;
- height: 12px;
- width: 16px;
- margin: 2px 0px 1px 0px;
- border-bottom: #C2C9CE 1px solid;
- border-right: #C2C9CE 1px solid;
- padding: 0px;
-}
-
-a.views-button-remove {
- background-position: 0px -72px;
- position: relative;
- top: -4px;
-}
-a.views-button-remove:hover {
- background-position: 0px -84px;
-}
-
-a.views-button-configure {
- background-position: 0px -48px;
- margin: 0;
-}
-a.views-button-configure:hover {
- background-position: 0px -60px;
-}
-
-a.views-button-add {
- background-position: 0px -24px;
-}
-a.views-button-add:hover {
- background-position: 0px -36px;
-}
-
-a.views-button-rearrange {
- background-position: 0px 0px;
-}
-a.views-button-rearrange:hover {
- background-position: 0px -12px;
-}
-
-a.views-button-remove span,
-a.views-button-rearrange span,
-a.views-button-configure span,
-a.views-button-add span {
- display: none;
-}
-
-html.js #arrange thead {
- display: none;
-}
-
-html.js .views-remove-checkbox {
- display: none;
-}
-
-a.views-button-remove {
- display: none;
-}
-
-html.js a.views-button-remove {
- display: inline;
-}
-
-#arrange tr.even,
-#arrange tr.odd,
-#arrange td {
- padding-top: 0;
- padding-bottom: 0;
-}
-
-#arrange .form-item {
- padding: 0;
-}
-
-div.changed {
- background-color: #ffe;
- font-weight: bold;
-}
-
-div.view-changed {
- display: none;
- float: right;
- font-style: italic;
- color: #f93;
- padding-left: 1em;
-}
-
-div.views-tab div.changed a {
-
-}
-
-div.changed div.view-changed {
- display: block;
-}
-
-.views-display .tab-section .inside .overridden {
- /* all this so we don't mess up background-color */
-/* background-image: url(../images/overridden.gif);
- background-repeat: no-repeat;
- background-position: left;
- padding-left: 10px; */
-}
-
-.views-display .tab-section .views-category-content.overridden {
- background-image: none;
-}
-
-.views-display .tab-section .inside .defaulted {
- color: #aaa;
- font-style: italic;
-}
-
-.views-display .tab-section .inside .defaulted a {
- font-style: italic;
-}
-
-.hilited {
- color: #000;
- font-weight: bold;
- background-color: #ffd;
- padding-left: 10px;
-}
-
-#views-ajax-pad fieldset {
- background: transparent;
- padding-left: 10px;
-}
-
-#views-ajax-pad pre {
- overflow: auto;
- border: 1px solid #333;
- background-color: #f0f0f0;
- padding: .5em;
-}
-
-form#views-add-display-form {
- margin-bottom: 0em;
- border-bottom: 1px solid #ccc;
-}
-
-form#views-add-display-form select {
- width: 8.5em;
-}
-
-#views-ui-edit-view-form {
- margin: 0;
- padding: 0;
-}
-
-#views-live-preview {
- padding-top: .5em;
-}
-
-form#views-ui-preview-form,
-#center form#views-ui-preview-form {
- border: 1px solid #D6DBDE;
- margin: 0 0 .5em 0;
- padding: .5em;
-}
-
-form#views-ui-preview-form div#preview-display-id-wrapper,
-form#views-ui-preview-form div#preview-args-wrapper {
- float: left;
- margin: 0;
- padding: 0 1em 0 0;
-}
-
-form#views-ui-preview-form input#preview-submit {
- margin: 1.7em 0 0 0;
-}
-
-.view-locked {
- color: red;
- border: 1px solid red;
- padding: 1em;
-}
-
-/* Hide by default only with js */
-html.js .views-hidden {
- display: none;
-}
-
-.views-query-info {
-/* overflow: auto; */
-}
-
-.views-query-info pre {
- white-space: pre; /* CSS2 */
- white-space: -moz-pre-wrap; /* Mozilla */
- white-space: -hp-pre-wrap; /* HP printers */
- white-space: -o-pre-wrap; /* Opera 7 */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: pre-wrap; /* CSS 2.1 */
- white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
- word-wrap: break-word; /* IE */
- max-height: 200px;
- overflow: scroll;
-}
-
-.views-quick-links {
- float: right;
-}
-
-.views-quick-links ul.links li {
- padding-left: 1em;
-}
-
-.views-quick-links li.last {
-}
-
-.views-edit-view .advanced-help-link {
- padding-right: 3px;
-}
-
-#views-ajax-title .advanced-help-link {
- position: relative;
- top: 2px;
- padding-right: 3px;
-}
-
-#views-ajax-pad input,
-#views-ajax-pad textarea {
- max-width: 95%;
-}
-
-.remove-display {
- float: right;
- margin: 0;
- padding: .2em 1em 0 0;
- position: relative;
- top: .1em;
-}
-
-.views-display .remove-display form,
-.remove-display input {
- margin: 0 !important;
-}
-
-.views-validator-options {
- padding: 0 1em;
- margin: 0 1em;
- border: 1px solid;
-}
diff --git a/css/views-list-rtl.css b/css/views-list-rtl.css
deleted file mode 100644
index 1b62fc3..0000000
--- a/css/views-list-rtl.css
+++ /dev/null
@@ -1,27 +0,0 @@
-
-table.views-entry {
- clear: right; /* RTL */
-}
-
-table.views-entry td.view-ops {
- text-align: left; /* RTL */
-}
-
-#views-ui-list-views-form .form-item {
- padding-left: 1em; /* RTL */
- float: right; /* RTL */
-}
-
-#edit-order-wrapper {
- clear: right; /* RTL */
-}
-
-#edit-views-apply,
-#edit-views-reset {
- float: right; /* RTL */
-}
-
-.views-entry .advanced-help-link {
- padding-left: 3px; /* RTL */
-}
-
diff --git a/css/views-list.css b/css/views-list.css
deleted file mode 100644
index 1aa001d..0000000
--- a/css/views-list.css
+++ /dev/null
@@ -1,83 +0,0 @@
-
-table.views-entry {
- margin: 3px 0;
- border: 1px solid #ddd;
- background-color: white;
- color: #494949; /* matches garland */
- clear: left; /* LTR */
- width: 100%;
-}
-
-table.views-entry tbody {
- border: none;
-}
-
-table.views-entry td.view-ops {
- width: 45%;
- text-align: right; /* LTR */
- background-color: #eee;
-}
-
-table.views-entry td.view-name {
- background-color: #eee;
-}
-
-table.views-entry .description {
- vertical-align: top;
-}
-
-body form#views-ui-list-views-form {
- margin: 0 0 1.5em 0;
-}
-
-#views-ui-list-views-form .form-item {
- padding-right: 1em; /* LTR */
- float: left; /* LTR */
- margin-top: 0;
- margin-bottom: 0;
-}
-
-#edit-order-wrapper {
- clear: left; /* LTR */
-}
-
-#edit-views-apply,
-#edit-views-reset {
- margin-top: 1.65em;
- float: left; /* LTR */
-}
-
-.views-entry .advanced-help-link {
- position: relative;
- top: 2px;
- padding-right: 3px; /* LTR */
-}
-
-table.view-disabled {
- color: #999;
-}
-
-table.views-entry td {
- line-height: 1.4;
- padding-bottom: 10px;
-}
-table.view-disabled td {
- line-height: 1.4;
- padding-bottom: 10px;
- background: none;
-}
-table.view-enabled td.view-name,
-table.view-enabled td.view-ops,
-table.view-disabled td.view-name,
-table.view-disabled td.view-ops {
- line-height: 1.6;
- padding-bottom: 0.3em;
-}
-table.views-entry td.view-name,
-table.views-entry td.view-ops {
- background: #eee;
-}
-table.view-enabled td.view-name,
-table.view-enabled td.view-ops {
- background: #E4F0F8;
-}
diff --git a/css/views-tabs.css b/css/views-tabs.css
deleted file mode 100644
index e884e07..0000000
--- a/css/views-tabs.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/* $Id */
-
-.ui-tabs-hide {
- display: none;
-}
diff --git a/css/views.css b/css/views.css
deleted file mode 100644
index 9aaa4a1..0000000
--- a/css/views.css
+++ /dev/null
@@ -1,95 +0,0 @@
-.views-exposed-form .views-exposed-widget {
- float: left;
- padding: .5em 1em 0 0;
-}
-
-.views-exposed-form .views-exposed-widget .form-submit {
- margin-top: 1.6em;
-}
-
-.views-exposed-form .form-item,
-.views-exposed-form .form-submit {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-.views-exposed-form label {
- font-weight: bold;
-}
-
-.views-exposed-widgets {
- margin-bottom: .5em;
-}
-
-html.js a.views-throbbing,
-html.js span.views-throbbing {
- background:url(../images/status-active.gif) no-repeat right center;
- padding-right:18px;
-}
-
-/* administrative hover links */
-
-div.view div.views-admin-links {
- font-size: xx-small;
- margin-right: 1em;
- margin-top: 1em;
- width: 95%;
-}
-
-.block div.view div.views-admin-links {
- margin-top: 0;
-}
-
-div.view div.views-admin-links ul {
- padding-left: 0;
-}
-
-div.view div.views-admin-links li a {
- color: #ccc;
-}
-
-div.view div.views-admin-links li {
- padding-bottom: 2px;
- z-index: 201;
-}
-
-div.view div.views-admin-links-hover a,
-div.view div.views-admin-links:hover a {
- color: #000;
-}
-
-div.view div.views-admin-links-hover,
-div.view div.views-admin-links:hover {
- background: transparent;;
-}
-
-div.view div.views-admin-links a:before {
- content: "[";
-}
-
-div.view div.views-admin-links a:after {
- content: "]";
-}
-
-div.view div.views-hide {
- display: none;
-}
-
-/** For IE we add the class via js; for other browsers we rely on :hover **/
-div.view div.views-hide-hover,
-div.view:hover div.views-hide {
- display: block;
- position: absolute;
- z-index: 200;
-}
-
-/* don't do this one in IE */
-div.view:hover div.views-hide {
- margin-top: -1.5em;
-}
-
-/* Remove the border on tbody that system puts in */
-.views-view-grid tbody {
- border-top: none;
-}
-
diff --git a/docs/docs.php b/docs/docs.php
deleted file mode 100644
index 1548113..0000000
--- a/docs/docs.php
+++ /dev/null
@@ -1,657 +0,0 @@
-<?php
-/**
- * @file
- * This file contains no working PHP code; it exists to provide additional documentation
- * for doxygen as well as to document hooks in the standard Drupal manner.
- */
-
-/**
- * @mainpage Views 2 API Manual
- *
- * Much of this information is actually stored in the advanced help; please
- * check the API topic. This help will primarily be aimed at documenting
- * classes and function calls.
- *
- * An online version of the advanced help API documentation is available from:
- * @link http://views-help.doc.logrus.com/help/views/api @endlink
- *
- * Topics:
- * - @ref view_lifetime
- * - @ref views_hooks
- * - @ref views_handlers
- * - @ref views_plugins
- * - @ref views_templates
- */
-
-/**
- * @page view_lifetime The life of a view
- *
- * This page explains the basic cycle of a view and what processes happen.
- */
-
-/**
- * @page views_handlers About Views' handlers
- *
- * This page explains what views handlers are, how they're written, and what
- * the basic conventions are.
- *
- * - @ref views_field_handlers
- * - @ref views_sort_handlers
- * - @ref views_filter_handlers
- * - @ref views_argument_handlers
- * - @ref views_relationship_handlers
- */
-
-/**
- * @page views_plugins About Views' plugins
- *
- * This page explains what views plugins are, how they're written, and what
- * the basic conventions are.
- *
- * - @ref views_display_plugins
- * - @ref views_style_plugins
- * - @ref views_row_plugins
- */
-
-/**
- * @defgroup views_hooks Views' hooks
- * @{
- * Hooks that can be implemented by other modules in order to implement the
- * Views API.
- */
-
-/**
- * Describe table structure to Views.
- *
- * This hook should be placed in MODULENAME.views.inc and it will be auto-loaded.
- * This must either be in the same directory as the .module file or in a subdirectory
- * named 'includes'.
- *
- * The full documentation for this hook is in the advanced help.
- * @link http://views-help.doc.logrus.com/help/views/api-tables @endlink
- */
-function hook_views_data() {
- // This example describes how to write hook_views_data() for the following
- // table:
- //
- // CREATE TABLE example_table (
- // nid INT(11) NOT NULL COMMENT 'Primary key; refers to {node}.nid.',
- // plain_text_field VARCHAR(32) COMMENT 'Just a plain text field.',
- // numeric_field INT(11) COMMENT 'Just a numeric field.',
- // boolean_field INT(1) COMMENT 'Just an on/off field.',
- // timestamp_field INT(8) COMMENT 'Just a timestamp field.',
- // PRIMARY KEY(nid)
- // );
-
- // The 'group' index will be used as a prefix in the UI for any of this
- // table's fields, sort criteria, etc. so it's easy to tell where they came
- // from.
- $data['example_table']['table']['group'] = t('Example table');
-
- // Define this as a base table. In reality this is not very useful for
- // this table, as it isn't really a distinct object of its own, but
- // it makes a good example.
- $data['example_table']['table']['base'] = array(
- 'field' => 'nid',
- 'title' => t('Example table'),
- 'help' => t("Example table contains example content and can be related to nodes."),
- 'weight' => -10,
- );
-
- // This table references the {node} table.
- // This creates an 'implicit' relationship to the node table, so that when 'Node'
- // is the base table, the fields are automatically available.
- $data['example_table']['table']['join'] = array(
- // Index this array by the table name to which this table refers.
- // 'left_field' is the primary key in the referenced table.
- // 'field' is the foreign key in this table.
- 'node' => array(
- 'left_field' => 'nid',
- 'field' => 'nid',
- ),
- );
-
- // Next, describe each of the individual fields in this table to Views. For
- // each field, you may define what field, sort, argument, and/or filter
- // handlers it supports. This will determine where in the Views interface you
- // may use the field.
-
- // Node ID field.
- $data['example_table']['nid'] = array(
- 'title' => t('Example content'),
- 'help' => t('Some example content that references a node.'),
- // Because this is a foreign key to the {node} table. This allows us to
- // have, when the view is configured with this relationship, all the fields
- // for the related node available.
- 'relationship' => array(
- 'base' => 'node',
- 'field' => 'nid',
- 'handler' => 'views_handler_relationship',
- 'label' => t('Example node'),
- ),
- );
-
- // Example plain text field.
- $data['example_table']['plain_text_field'] = array(
- 'title' => t('Plain text field'),
- 'help' => t('Just a plain text field.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_string',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- );
-
- // Example numeric text field.
- $data['example_table']['numeric_field'] = array(
- 'title' => t('Numeric field'),
- 'help' => t('Just a numeric field.'),
- 'field' => array(
- 'handler' => 'views_handler_field_numeric',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_numeric',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- );
-
- // Example boolean field.
- $data['example_table']['boolean_field'] = array(
- 'title' => t('Boolean field'),
- 'help' => t('Just an on/off field.'),
- 'field' => array(
- 'handler' => 'views_handler_field_boolean',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_boolean_operator',
- 'label' => t('Published'),
- 'type' => 'yes-no',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- );
-
- // Example timestamp field.
- $data['example_table']['timestamp_field'] = array(
- 'title' => t('Timestamp field'),
- 'help' => t('Just a timestamp field.'),
- 'field' => array(
- 'handler' => 'views_handler_field_date',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort_date',
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_date',
- ),
- );
-
- return $data;
-}
-
-/**
- * The full documentation for this hook is now in the advanced help.
- *
- * This hook should be placed in MODULENAME.views.inc and it will be auto-loaded.
- * This must either be in the same directory as the .module file or in a subdirectory
- * named 'includes'.
- *
- * This is a stub list as a reminder that this needs to be doc'd and is not used
- * in views anywhere so might not be remembered when this is formally documented:
- * - style: 'even empty'
- */
-function hook_views_plugins() {
- // example code here
-}
-
-/**
- * Register handler, file and parent information so that handlers can be
- * loaded only on request.
- *
- * The full documentation for this hook is in the advanced help.
- */
-function hook_views_handlers() {
- // example code here
-}
-
-/**
- * Register View API information. This is required for your module to have
- * its include files loaded; for example, when implementing
- * hook_views_default_views().
- *
- * @return
- * An array with the following possible keys:
- * - api: (required) The version of the Views API the module implements.
- * - path: (optional) If includes are stored somewhere other than within
- * the root module directory or a subdirectory called includes, specify
- * its path here.
- */
-function hook_views_api() {
- return array(
- 'api' => 2,
- 'path' => drupal_get_path('module', 'example') . '/includes/views',
- );
-}
-
-/**
- * This hook allows modules to provide their own views which can either be used
- * as-is or as a "starter" for users to build from.
- *
- * This hook should be placed in MODULENAME.views_default.inc and it will be
- * auto-loaded. This must either be in the same directory as the .module file
- * or in a subdirectory named 'includes'.
- *
- * The $view->disabled boolean flag indicates whether the View should be
- * enabled or disabled by default.
- *
- * @return
- * An associative array containing the structures of views, as generated from
- * the Export tab, keyed by the view name. A best practice is to go through
- * and add t() to all title and label strings, with the exception of menu
- * strings.
- */
-function hook_views_default_views() {
- // Begin copy and paste of output from the Export tab of a view.
- $view = new view;
- $view->name = 'frontpage';
- $view->description = t('Emulates the default Drupal front page; you may set the default home page path to this view to make it your front page.');
- $view->tag = t('default');
- $view->view_php = '';
- $view->base_table = 'node';
- $view->is_cacheable = '0';
- $view->api_version = 2;
- $view->disabled = FALSE; // Edit this to true to make a default view disabled initially
- $view->display = array();
- $display = new views_display;
- $display->id = 'default';
- $display->display_title = t('Defaults');
- $display->display_plugin = 'default';
- $display->position = '1';
- $display->display_options = array (
- 'style_plugin' => 'default',
- 'style_options' =>
- array (
- ),
- 'row_plugin' => 'node',
- 'row_options' =>
- array (
- 'teaser' => 1,
- 'links' => 1,
- ),
- 'relationships' =>
- array (
- ),
- 'fields' =>
- array (
- ),
- 'sorts' =>
- array (
- 'sticky' =>
- array (
- 'id' => 'sticky',
- 'table' => 'node',
- 'field' => 'sticky',
- 'order' => 'ASC',
- ),
- 'created' =>
- array (
- 'id' => 'created',
- 'table' => 'node',
- 'field' => 'created',
- 'order' => 'ASC',
- 'relationship' => 'none',
- 'granularity' => 'second',
- ),
- ),
- 'arguments' =>
- array (
- ),
- 'filters' =>
- array (
- 'promote' =>
- array (
- 'id' => 'promote',
- 'table' => 'node',
- 'field' => 'promote',
- 'operator' => '=',
- 'value' => '1',
- 'group' => 0,
- 'exposed' => false,
- 'expose' =>
- array (
- 'operator' => false,
- 'label' => '',
- ),
- ),
- 'status' =>
- array (
- 'id' => 'status',
- 'table' => 'node',
- 'field' => 'status',
- 'operator' => '=',
- 'value' => '1',
- 'group' => 0,
- 'exposed' => false,
- 'expose' =>
- array (
- 'operator' => false,
- 'label' => '',
- ),
- ),
- ),
- 'items_per_page' => 10,
- 'use_pager' => '1',
- 'pager_element' => 0,
- 'title' => '',
- 'header' => '',
- 'header_format' => '1',
- 'footer' => '',
- 'footer_format' => '1',
- 'empty' => '',
- 'empty_format' => '1',
- );
- $view->display['default'] = $display;
- $display = new views_display;
- $display->id = 'page';
- $display->display_title = t('Page');
- $display->display_plugin = 'page';
- $display->position = '2';
- $display->display_options = array (
- 'defaults' =>
- array (
- 'access' => true,
- 'title' => true,
- 'header' => true,
- 'header_format' => true,
- 'header_empty' => true,
- 'footer' => true,
- 'footer_format' => true,
- 'footer_empty' => true,
- 'empty' => true,
- 'empty_format' => true,
- 'items_per_page' => true,
- 'offset' => true,
- 'use_pager' => true,
- 'pager_element' => true,
- 'link_display' => true,
- 'php_arg_code' => true,
- 'exposed_options' => true,
- 'style_plugin' => true,
- 'style_options' => true,
- 'row_plugin' => true,
- 'row_options' => true,
- 'relationships' => true,
- 'fields' => true,
- 'sorts' => true,
- 'arguments' => true,
- 'filters' => true,
- 'use_ajax' => true,
- 'distinct' => true,
- ),
- 'relationships' =>
- array (
- ),
- 'fields' =>
- array (
- ),
- 'sorts' =>
- array (
- ),
- 'arguments' =>
- array (
- ),
- 'filters' =>
- array (
- ),
- 'path' => 'frontpage',
- );
- $view->display['page'] = $display;
- $display = new views_display;
- $display->id = 'feed';
- $display->display_title = t('Feed');
- $display->display_plugin = 'feed';
- $display->position = '3';
- $display->display_options = array (
- 'defaults' =>
- array (
- 'access' => true,
- 'title' => false,
- 'header' => true,
- 'header_format' => true,
- 'header_empty' => true,
- 'footer' => true,
- 'footer_format' => true,
- 'footer_empty' => true,
- 'empty' => true,
- 'empty_format' => true,
- 'use_ajax' => true,
- 'items_per_page' => true,
- 'offset' => true,
- 'use_pager' => true,
- 'pager_element' => true,
- 'use_more' => true,
- 'distinct' => true,
- 'link_display' => true,
- 'php_arg_code' => true,
- 'exposed_options' => true,
- 'style_plugin' => false,
- 'style_options' => false,
- 'row_plugin' => false,
- 'row_options' => false,
- 'relationships' => true,
- 'fields' => true,
- 'sorts' => true,
- 'arguments' => true,
- 'filters' => true,
- ),
- 'relationships' =>
- array (
- ),
- 'fields' =>
- array (
- ),
- 'sorts' =>
- array (
- ),
- 'arguments' =>
- array (
- ),
- 'filters' =>
- array (
- ),
- 'displays' =>
- array (
- 'default' => 'default',
- 'page' => 'page',
- ),
- 'style_plugin' => 'rss',
- 'style_options' =>
- array (
- 'mission_description' => 1,
- 'description' => '',
- ),
- 'row_plugin' => 'node_rss',
- 'row_options' =>
- array (
- 'item_length' => 'default',
- ),
- 'path' => 'rss.xml',
- 'title' => t('Front page feed'),
- );
- $view->display['feed'] = $display;
- // End copy and paste of Export tab output.
-
- // Add view to list of views to provide.
- $views[$view->name] = $view;
-
- // ...Repeat all of the above for each view the module should provide.
-
- // At the end, return array of default views.
- return $views;
-}
-
-/**
- * This hook is called right before all default views are cached to the
- * database. It takes a keyed array of views by reference.
- */
-function hook_views_default_views_alter(&$views) {
- if (isset($views['taxonomy_term'])) {
- $views['taxonomy_term']->set_display('default');
- $views['taxonomy_term']->display_handler->set_option('title', 'Categories');
- }
-}
-
-/**
- * Stub hook documentation
- *
- * This hook should be placed in MODULENAME.views_convert.inc and it will be auto-loaded.
- * This must either be in the same directory as the .module file or in a subdirectory
- * named 'includes'.
- */
-function hook_views_convert() {
- // example code here
-}
-
-/**
- * Stub hook documentation
- */
-function hook_views_query_substitutions() {
- // example code here
-}
-
-/**
- * This hook is called at the very beginning of views processing,
- * before anything is done.
- *
- * Adding output to the view cam be accomplished by placing text on
- * $view->attachment_before and $view->attachment_after
- */
-function hook_views_pre_view(&$view, &$display_id, &$args) {
- // example code here
-}
-
-/**
- * This hook is called right before the build process, but after displays
- * are attached and the display performs its pre_execute phase.
- *
- * Adding output to the view cam be accomplished by placing text on
- * $view->attachment_before and $view->attachment_after
- */
-function hook_views_pre_build(&$view) {
- // example code here
-}
-
-/**
- * This hook is called right before the execute process. The query is
- * now fully built, but it has not yet been run through db_rewrite_sql.
- *
- * Adding output to the view cam be accomplished by placing text on
- * $view->attachment_before and $view->attachment_after
- */
-function hook_views_pre_execute(&$view) {
- // example code here
-}
-
-/**
- * This hook is called right before the render process. The query has
- * been executed, and the pre_render() phase has already happened for
- * handlers, so all data should be available.
- *
- * Adding output to the view cam be accomplished by placing text on
- * $view->attachment_before and $view->attachment_after
- *
- * This hook can be utilized by themes.
- */
-function hook_views_pre_render(&$view) {
- // example code here
-}
-
-/**
- * Post process any rendered data.
- *
- * This can be valuable to be able to cache a view and still have some level of
- * dynamic output. In an ideal world, the actual output will include HTML
- * comment based tokens, and then the post process can replace those tokens.
- *
- * Example usage. If it is known that the view is a node view and that the
- * primary field will be a nid, you can do something like this:
- *
- * <!--post-FIELD-NID-->
- *
- * And then in the post render, create an array with the text that should
- * go there:
- *
- * strtr($output, array('<!--post-FIELD-1-->', 'output for FIELD of nid 1');
- *
- * All of the cached result data will be available in $view->result, as well,
- * so all ids used in the query should be discoverable.
- *
- * This hook can be utilized by themes.
- */
-function hook_views_post_render(&$view, &$output, &$cache) {
-
-}
-
-/**
- * Stub hook documentation
- *
- * This hook should be placed in MODULENAME.views.inc and it will be auto-loaded.
- * This must either be in the same directory as the .module file or in a subdirectory
- * named 'includes'.
- *
- */
-function hook_views_query_alter(&$view, &$query) {
- // example code here
-}
-
-/**
- * This hook should be placed in MODULENAME.views.inc and it will be auto-loaded.
- * This must either be in the same directory as the .module file or in a subdirectory
- * named 'includes'.
- *
- * Alter the links that appear over a view. They are in a format suitable for
- * theme('links').
- *
- * Warning: $view is not a reference in PHP4 and cannot be modified here. But it IS
- * a reference in PHP5, and can be modified. Please be careful with it.
- *
- * @see theme_links
- */
-function hook_views_admin_links_alter(&$links, $view) {
- // example code here
-}
-
-/**
- * This hook should be placed in MODULENAME.views.inc and it will be auto-loaded.
- * This must either be in the same directory as the .module file or in a subdirectory
- * named 'includes'.
- *
- * Alter the rows that appear with a view, which includes path and query information.
- * The rows are suitable for theme('table').
- *
- * Warning: $view is not a reference in PHP4 and cannot be modified here. But it IS
- * a reference in PHP5, and can be modified. Please be careful with it.
- *
- * @see theme_table
- */
-function hook_views_preview_info_alter(&$rows, $view) {
- // example code here
-}
-
-/**
- * @}
- */
diff --git a/documentation-standards.txt b/documentation-standards.txt
deleted file mode 100644
index ea61135..0000000
--- a/documentation-standards.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-- If the interface text is *bolded*, it got strong tags.
-- If it's a button they need to click, that's *bold* too.
-- If the text is not bolded (ex: links to click, options to check), it
-got /italicized/.
-- If it's user-entered text it got 'single quotes'.
-
diff --git a/handlers/views_handler_argument.inc b/handlers/views_handler_argument.inc
deleted file mode 100644
index 2a341a1..0000000
--- a/handlers/views_handler_argument.inc
+++ /dev/null
@@ -1,773 +0,0 @@
-<?php
-
-/**
- * @defgroup views_argument_handlers Handlers for arguments
- * @{
- */
-
-/**
- * Base class for arguments.
- *
- * The basic argument works for very simple arguments such as nid and uid
- *
- * Definition terms for this handler:
- * - name field: The field to use for the name to use in the summary, which is
- * the displayed output. For example, for the node: nid argument,
- * the argument itself is the nid, but node.title is displayed.
- * - name table: The table to use for the name, should it not be in the same
- * table as the argument.
- * - empty field name: For arguments that can have no value, such as taxonomy
- * which can have "no term", this is the string which
- * will be displayed for this lack of value. Be sure to use
- * t().
- * - validate type: A little used string to allow an argument to restrict
- * which validator is available to just one. Use the
- * validator ID. This probably should not be used at all,
- * and may disappear or change.
- * - numeric: If set to TRUE this field is numeric and will use %d instead of
- * %s in queries.
- *
- * @ingroup views_argument_handlers
- */
-class views_handler_argument extends views_handler {
- var $name_field = NULL;
- /**
- * Constructor
- */
- function construct() {
- parent::construct();
-
- if (!empty($this->definition['name field'])) {
- $this->name_field = $this->definition['name field'];
- }
- if (!empty($this->definition['name table'])) {
- $this->name_table = $this->definition['name table'];
- }
- }
-
- function init(&$view, &$options) {
- parent::init($view, $options);
- }
-
- /**
- * Give an argument the opportunity to modify the breadcrumb, if it wants.
- * This only gets called on displays where a breadcrumb is actually used.
- *
- * The breadcrumb will be in the form of an array, with the keys being
- * the path and the value being the already sanitized title of the path.
- */
- function set_breadcrumb(&$breadcrumb) { }
-
- /**
- * Determine if the argument can generate a breadcrumb
- *
- * @return TRUE/FALSE
- */
- function uses_breadcrumb() {
- $info = $this->default_actions($this->options['default_action']);
- return !empty($info['breadcrumb']);
- }
-
- function is_wildcard($arg = NULL) {
- if (!isset($arg)) {
- $arg = $this->argument;
- }
-
- return !empty($this->options['wildcard']) && $this->options['wildcard'] === $arg;
- }
-
- function wildcard_title() {
- return $this->options['wildcard_substitution'];
- }
-
- /**
- * Determine if the argument needs a style plugin.
- *
- * @return TRUE/FALSE
- */
- function needs_style_plugin() {
- $info = $this->default_actions($this->options['default_action']);
- $validate_info = $this->default_actions($this->options['validate_fail']);
- return !empty($info['style plugin']) || !empty($validate_info['style plugin']);
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['default_action'] = array('default' => 'ignore');
- $options['style_plugin'] = array('default' => 'default_summary');
- $options['style_options'] = array('default' => array());
- $options['wildcard'] = array('default' => 'all');
- $options['wildcard_substitution'] = array('default' => t('All'), 'translatable' => TRUE);
- $options['title'] = array('default' => '', 'translatable' => TRUE);
- $options['breadcrumb'] = array('default' => '', 'translatable' => TRUE);
- $options['default_argument_type'] = array('default' => 'fixed');
- $options['default_argument'] = array('default' => '');
- $options['validate_type'] = array('default' => 'none');
- $options['validate_fail'] = array('default' => 'not found');
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- $defaults = $this->default_actions();
-
- $form['title'] = array(
- '#prefix' => '<div class="clear-block">',
- '#suffix' => '</div>',
- '#type' => 'textfield',
- '#title' => t('Title'),
- '#default_value' => $this->options['title'],
- '#description' => t('The title to use when this argument is present. It will override the title of the view and titles from previous arguments. You can use percent substitution here to replace with argument titles. Use "%1" for the first argument, "%2" for the second, etc.'),
- );
-
- $form['breadcrumb'] = array(
- '#prefix' => '<div class="clear-block">',
- '#suffix' => '</div>',
- '#type' => 'textfield',
- '#title' => t('Breadcrumb'),
- '#default_value' => $this->options['breadcrumb'],
- '#description' => t('The Breadcrumb title to use when this argument is present. If no breadcrumb is setted here, default Title values will be used, see "Title" for percent substitutions.'),
- );
-
- $form['clear_start'] = array(
- '#value' => '<div class="clear-block">',
- );
-
- $form['defaults_start'] = array(
- '#value' => '<div class="views-left-50">',
- );
-
- $form['default_action'] = array(
- '#type' => 'radios',
- '#title' => t('Action to take if argument is not present'),
- '#default_value' => $this->options['default_action'],
- );
-
- $form['defaults_stop'] = array(
- '#value' => '</div>',
- );
-
- $form['wildcard'] = array(
- '#prefix' => '<div class="views-right-50">',
- // prefix and no suffix means these two items will be grouped together.
- '#type' => 'textfield',
- '#title' => t('Wildcard'),
- '#size' => 20,
- '#default_value' => $this->options['wildcard'],
- '#description' => t('If this value is received as an argument, the argument will be ignored; i.e, "all values"'),
- );
-
- $form['wildcard_substitution'] = array(
- '#suffix' => '</div>',
- '#type' => 'textfield',
- '#title' => t('Wildcard title'),
- '#size' => 20,
- '#default_value' => $this->options['wildcard_substitution'],
- '#description' => t('The title to use for the wildcard in substitutions elsewhere.'),
- );
-
- $form['clear_stop'] = array(
- '#value' => '</div>',
- );
-
- $options = array();
- $validate_options = array();
- foreach ($defaults as $id => $info) {
- $options[$id] = $info['title'];
- if (empty($info['default only'])) {
- $validate_options[$id] = $info['title'];
- }
- if (!empty($info['form method'])) {
- $this->{$info['form method']}($form, $form_state);
- }
- }
-
- $form['default_action']['#options'] = $options;
-
- $form['validate_options_div_prefix'] = array(
- '#id' => 'views-validator-options',
- '#value' => '<fieldset id="views-validator-options"><legend>' . t('Validator options') . '</legend>',
- );
-
- $form['validate_type'] = array(
- '#type' => 'select',
- '#title' => t('Validator'),
- '#default_value' => $this->options['validate_type'],
- );
-
- $validate_types = array('none' => t('<Basic validation>'));
- $plugins = views_fetch_plugin_data('argument validator');
- foreach ($plugins as $id => $info) {
- if (!empty($info['no ui'])) {
- continue;
- }
-
- $valid = TRUE;
- if (!empty($info['type'])) {
- $valid = FALSE;
- if (empty($this->definition['validate type'])) {
- continue;
- }
- foreach ((array) $info['type'] as $type) {
- if ($type == $this->definition['validate type']) {
- $valid = TRUE;
- break;
- }
- }
- }
-
- // If we decide this validator is ok, add it to the list.
- if ($valid) {
- $plugin = views_get_plugin('argument validator', $id);
- if ($plugin) {
- $plugin->init($this->view, $this, $id);
- if ($plugin->access() || $this->options['validate_type'] == $id) {
- $plugin->validate_form($form, $form_state, $id);
- $validate_types[$id] = $info['title'];
- }
- }
- }
- }
-
- asort($validate_types);
- $form['validate_type']['#options'] = $validate_types;
-
- $form['validate_fail'] = array(
- '#type' => 'select',
- '#title' => t('Action to take if argument does not validate'),
- '#default_value' => $this->options['validate_fail'],
- '#options' => $validate_options,
- );
-
- $form['validate_options_div_suffix'] = array(
- '#value' => '</fieldset>',
- );
- }
-
- /**
- * Provide a list of default behaviors for this argument if the argument
- * is not present.
- *
- * Override this method to provide additional (or fewer) default behaviors.
- */
- function default_actions($which = NULL) {
- $defaults = array(
- 'ignore' => array(
- 'title' => t('Display all values'),
- 'method' => 'default_ignore',
- 'breadcrumb' => TRUE, // generate a breadcrumb to here
- ),
- 'not found' => array(
- 'title' => t('Hide view / Page not found (404)'),
- 'method' => 'default_not_found',
- 'hard fail' => TRUE, // This is a hard fail condition
- ),
- 'empty' => array(
- 'title' => t('Display empty text'),
- 'method' => 'default_empty',
- 'breadcrumb' => TRUE, // generate a breadcrumb to here
- ),
- 'summary asc' => array(
- 'title' => t('Summary, sorted ascending'),
- 'method' => 'default_summary',
- 'method args' => array('asc'),
- 'style plugin' => TRUE,
- 'breadcrumb' => TRUE, // generate a breadcrumb to here
- ),
- 'summary desc' => array(
- 'title' => t('Summary, sorted descending'),
- 'method' => 'default_summary',
- 'method args' => array('desc'),
- 'style plugin' => TRUE,
- 'breadcrumb' => TRUE, // generate a breadcrumb to here
- ),
- 'default' => array(
- 'title' => t('Provide default argument'),
- 'method' => 'default_default',
- 'form method' => 'default_argument_form',
- 'has default argument' => TRUE,
- 'default only' => TRUE, // this can only be used for missing argument, not validation failure
- ),
- );
-
- if ($which) {
- if (!empty($defaults[$which])) {
- return $defaults[$which];
- }
- }
- else {
- return $defaults;
- }
- }
-
- /**
- * Provide a form for selecting the default argument when the
- * default action is set to provide default argument.
- */
- function default_argument_form(&$form, &$form_state) {
- $plugins = views_fetch_plugin_data('argument default');
- $options = array();
-
- // This construct uses 'hidden' and not markup because process doesn't
- // run. It also has an extra div because the dependency wants to hide
- // the parent in situations like this, so we need a second div to
- // make this work.
- $form['default_options_div_prefix'] = array(
- '#type' => 'hidden',
- '#id' => 'views-default-options',
- '#prefix' => '<div><fieldset id="views-default-options"><legend>' . t('Provide default argument options') . '</legend>',
- '#process' => array('views_process_dependency'),
- '#dependency' => array('radio:options[default_action]' => array('default')),
- );
-
- $form['default_argument_type'] = array(
- '#prefix' => '<div id="edit-options-default-argument-type-wrapper">',
- '#suffix' => '</div>',
- '#type' => 'radios',
- '#id' => 'edit-options-default-argument-type',
- '#title' => t('Default argument type'),
- '#default_value' => $this->options['default_argument_type'],
- '#process' => array('expand_radios', 'views_process_dependency'),
- '#dependency' => array('radio:options[default_action]' => array('default')),
- );
-
- foreach ($plugins as $id => $info) {
- $plugin = views_get_plugin('argument default', $id);
- if ($plugin) {
- $plugin->init($this->view, $this, $id);
-
- if ($plugin->access() || $this->options['default_argument_type'] == $id) {
- $options[$id] = $info['title'];
- $plugin->argument_form($form, $form_state);
- }
- }
- }
-
- $form['default_options_div_suffix'] = array(
- '#value' => '</fieldset></div>',
- );
-
- asort($options);
- $form['default_argument_type']['#options'] = $options;
- }
-
- /**
- * Handle the default action, which means our argument wasn't present.
- *
- * Override this method only with extreme care.
- *
- * @return
- * A boolean value; if TRUE, continue building this view. If FALSE,
- * building the view will be aborted here.
- */
- function default_action($info = NULL) {
- if (!isset($info)) {
- $info = $this->default_actions($this->options['default_action']);
- }
-
- if (!$info) {
- return FALSE;
- }
-
- if (!empty($info['method args'])) {
- return call_user_func_array(array(&$this, $info['method']), $info['method args']);
- }
- else {
- return $this->{$info['method']}();
- }
- }
-
- /**
- * How to act if validation failes
- */
- function validate_fail() {
- $info = $this->default_actions($this->options['validate_fail']);
- return $this->default_action($info);
- }
- /**
- * Default action: ignore.
- *
- * If an argument was expected and was not given, in this case, simply
- * ignore the argument entirely.
- */
- function default_ignore() {
- return TRUE;
- }
-
- /**
- * Default action: not found.
- *
- * If an argument was expected and was not given, in this case, report
- * the view as 'not found' or hide it.
- */
- function default_not_found() {
- // Set a failure condition and let the display manager handle it.
- $this->view->build_info['fail'] = TRUE;
- return FALSE;
- }
-
- /**
- * Default action: empty
- *
- * If an argument was expected and was not given, in this case, display
- * the view's empty text
- */
- function default_empty() {
- // We return with no query; this will force the empty text.
- $this->view->built = TRUE;
- $this->view->executed = TRUE;
- $this->view->result = array();
- return FALSE;
- }
-
- /**
- * This just returns true. The view argument builder will know where
- * to find the argument from.
- */
- function default_default() {
- return TRUE;
- }
-
- /**
- * Determine if the argument is set to provide a default argument.
- */
- function has_default_argument() {
- $info = $this->default_actions($this->options['default_action']);
- return !empty($info['has default argument']);
- }
-
- /**
- * Get a default argument, if available.
- */
- function get_default_argument() {
- $plugin = views_get_plugin('argument default', $this->options['default_argument_type']);
- if ($plugin) {
- $plugin->init($this->view, $this);
- return $plugin->get_argument();
- }
- }
-
- /**
- * Default action: summary.
- *
- * If an argument was expected and was not given, in this case, display
- * a summary query.
- */
- function default_summary($order) {
- $this->view->build_info['summary'] = TRUE;
- $this->view->build_info['summary_level'] = $this->options['id'];
-
- // Change the display style to the summary style for this
- // argument.
- $this->view->plugin_name = $this->options['style_plugin'];
- $this->view->style_options = $this->options['style_options'];
-
- // Clear out the normal primary field and whatever else may have
- // been added and let the summary do the work.
- $this->query->clear_fields();
- $this->summary_query();
-
- $this->summary_sort($order);
-
- // Summaries have their own sorting and fields, so tell the View not
- // to build these.
- $this->view->build_sort = $this->view->build_fields = FALSE;
- return TRUE;
- }
-
- /**
- * Build the info for the summary query.
- *
- * This must:
- * - add_groupby: group on this field in order to create summaries.
- * - add_field: add a 'num_nodes' field for the count. Usually it will
- * be a count on $view->base_field
- * - set_count_field: Reset the count field so we get the right paging.
- *
- * @return
- * The alias used to get the number of records (count) for this entry.
- */
- function summary_query() {
- $this->ensure_my_table();
- // Add the field.
- $this->base_alias = $this->query->add_field($this->table_alias, $this->real_field);
-
- $this->summary_name_field();
- return $this->summary_basics();
- }
-
- /**
- * Add the name field, which is the field displayed in summary queries.
- * This is often used when the argument is numeric.
- */
- function summary_name_field() {
- // Add the 'name' field. For example, if this is a uid argument, the
- // name field would be 'name' (i.e, the username).
-
- if (isset($this->name_table)) {
- // if the alias is different then we're probably added, not ensured,
- // so look up the join and add it instead.
- if ($this->table_alias != $this->table) {
- $j = views_get_table_join($this->name_table, $this->table);
- if ($j) {
- $join = drupal_clone($j);
- $join->left_table = $this->table_alias;
- $this->name_table_alias = $this->query->add_table($this->name_table, $this->relationship, $join);
- }
- }
- else {
- $this->name_table_alias = $this->query->ensure_table($this->name_table, $this->relationship);
- }
- }
- else {
- $this->name_table_alias = $this->table_alias;
- }
-
- if (isset($this->name_field)) {
- $this->name_alias = $this->query->add_field($this->name_table_alias, $this->name_field);
- }
- else {
- $this->name_alias = $this->base_alias;
- }
- }
-
- /**
- * Some basic summary behavior that doesn't need to be repeated as much as
- * code that goes into summary_query()
- */
- function summary_basics($count_field = TRUE) {
- // Add the number of nodes counter
- $field = $this->query->base_table . '.' . $this->query->base_field;
- $distinct = ($this->view->display_handler->get_option('distinct') && empty($this->query->no_distinct));
-
- $count_alias = $this->query->add_field(NULL, $field, 'num_records',
- array('count' => TRUE, 'distinct' => $distinct));
- $this->query->add_groupby($this->name_alias);
-
- if ($count_field) {
- $this->query->set_count_field($this->table_alias, $this->real_field);
- }
-
- $this->count_alias = $count_alias;
- }
-
- /**
- * Sorts the summary based upon the user's selection. The base variant of
- * this is usually adequte.
- *
- * @param $order
- * The order selected in the UI.
- */
- function summary_sort($order) {
- $this->query->add_orderby(NULL, NULL, $order, $this->name_alias);
- }
-
- /**
- * Provide the argument to use to link from the summary to the next level;
- * this will be called once per row of a summary, and used as part of
- * $view->get_url().
- *
- * @param $data
- * The query results for the row.
- */
- function summary_argument($data) {
- return $data->{$this->base_alias};
- }
-
- /**
- * Provides the name to use for the summary. By default this is just
- * the name field.
- *
- * @param $data
- * The query results for the row.
- */
- function summary_name($data) {
- $value = $data->{$this->name_alias};
- if (empty($value) && !empty($this->definition['empty field name'])) {
- $value = $this->definition['empty field name'];
- }
- return check_plain($value);
- }
-
- /**
- * Set up the query for this argument.
- *
- * The argument sent may be found at $this->argument.
- */
- function query() {
- $this->ensure_my_table();
- $placeholder = empty($this->definition['numeric']) ? "'%s'" : '%d';
- $this->query->add_where(0, "$this->table_alias.$this->real_field = $placeholder", $this->argument);
- }
-
- /**
- * Get the title this argument will assign the view, given the argument.
- *
- * This usually needs to be overridden to provide a proper title.
- */
- function title() {
- return check_plain($this->argument);
- }
-
- /**
- * Called by the view object to get the title. This may be set by a
- * validator so we don't necessarily call through to title().
- */
- function get_title() {
- if (isset($this->validated_title)) {
- return $this->validated_title;
- }
- else {
- return $this->title();
- }
- }
-
- /**
- * Validate that this argument works. By default, all arguments are valid.
- */
- function validate_arg($arg) {
- // By using % in URLs, arguments could be validated twice; this eases
- // that pain.
- if (isset($this->argument_validated)) {
- return $this->argument_validated;
- }
-
- if ($this->is_wildcard($arg)) {
- return $this->argument_validated = TRUE;
- }
-
- if ($this->options['validate_type'] == 'none') {
- return $this->argument_validated = $this->validate_argument_basic($arg);
- }
-
- $plugin = views_get_plugin('argument validator', $this->options['validate_type']);
- if ($plugin) {
- $plugin->init($this->view, $this, $this->options['validate_type']);
- return $this->argument_validated = $plugin->validate_argument($arg);
- }
-
- // If the plugin isn't found, fall back to the basic validation path:
- return $this->argument_validated = $this->validate_argument_basic($arg);
- }
-
- /**
- * Called by the menu system to validate an argument.
- *
- * This checks to see if this is a 'soft fail', which means that if the
- * argument fails to validate, but there is an action to take anyway,
- * then validation cannot actually fail.
- */
- function validate_argument($arg) {
- $validate_info = $this->default_actions($this->options['validate_fail']);
- if (empty($validate_info['hard fail'])) {
- return TRUE;
- }
-
- $rc = $this->validate_arg($arg);
-
- // If the validator has changed the validate fail condition to a
- // soft fail, deal with that:
- $validate_info = $this->default_actions($this->options['validate_fail']);
- if (empty($validate_info['hard fail'])) {
- return TRUE;
- }
-
- return $rc;
- }
-
- /**
- * Provide a basic argument validation.
- *
- * This can be overridden for more complex types; the basic
- * validator only checks to see if the argument is not NULL
- * or is numeric if the definition says it's numeric.
- */
- function validate_argument_basic($arg) {
- if (!isset($arg) || $arg === '') {
- return FALSE;
- }
-
- if (isset($this->definition['numeric']) && !isset($this->options['break_phrase']) && !is_numeric($arg)) {
- return FALSE;
- }
-
- return TRUE;
- }
-
- /**
- * Set the input for this argument
- *
- * @return TRUE if it successfully validates; FALSE if it does not.
- */
- function set_argument($arg) {
- $this->argument = $arg;
- return $this->validate_arg($arg);
- }
-
- /**
- * Get the value of this argument.
- */
- function get_value() {
- // If we already processed this argument, we're done.
- if (isset($this->argument)) {
- return $this->argument;
- }
-
- // Otherwise, we have to pretend to process ourself to find the value.
- $value = NULL;
- // Find the position of this argument within the view.
- $position = 0;
- foreach ($this->view->argument as $id => $argument) {
- if ($id == $this->options['id']) {
- break;
- }
- $position++;
- }
-
- $arg = isset($this->view->args[$position]) ? $this->view->args[$position] : NULL;
- $this->position = $position;
-
- // Clone ourselves so that we don't break things when we're really
- // processing the arguments.
- $argument = drupal_clone($this);
- if (!isset($arg) && $argument->has_default_argument()) {
- $arg = $argument->get_default_argument();
- }
- // Set the argument, which will also validate that the argument can be set.
- if ($argument->set_argument($arg)) {
- $value = $argument->argument;
- }
- unset($argument);
- return $value;
- }
-}
-
-/**
- * A special handler to take the place of missing or broken handlers.
- *
- * @ingroup views_argument_handlers
- */
-class views_handler_argument_broken extends views_handler_argument {
- function ui_name($short = FALSE) {
- return t('Broken/missing handler');
- }
-
- function ensure_my_table() { /* No table to ensure! */ }
- function query() { /* No query to run */ }
- function options_form(&$form, &$form_state) {
- $form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
- '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
- );
- }
-
- /**
- * Determine if the handler is considered 'broken'
- */
- function broken() { return TRUE; }
-}
-
-/**
- * @}
- */
diff --git a/handlers/views_handler_argument_date.inc b/handlers/views_handler_argument_date.inc
deleted file mode 100644
index 2bd3b58..0000000
--- a/handlers/views_handler_argument_date.inc
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
- * Abstract argument handler for dates.
- *
- * Adds an option to set a default argument based on the current date.
- *
- * @param $arg_format
- * The format string to use on the current time when
- * creating a default date argument.
- *
- * Definitions terms:
- * - many to one: If true, the "many to one" helper will be used.
- * - invalid input: A string to give to the user for obviously invalid input.
- * This is deprecated in favor of argument validators.
- * @see views_many_to_one_helper
- *
- * @ingroup views_argument_handlers
- */
-class views_handler_argument_date extends views_handler_argument_formula {
- var $option_name = 'default_argument_date';
- var $arg_format = 'Y-m-d';
-
- /**
- * Add an option to set the default value to the current date.
- */
- function default_argument_form(&$form, &$form_state) {
- parent::default_argument_form($form, $form_state);
- $form['default_argument_type']['#options'] += array('date' => t('Current date'));
- $form['default_argument_type']['#options'] += array('node_created' => t("Current node's creation time"));
- $form['default_argument_type']['#options'] += array('node_changed' => t("Current node's update time")); }
-
- /**
- * Set the empty argument value to the current date,
- * formatted appropriately for this argument.
- */
- function get_default_argument($raw = FALSE) {
- if (!$raw && $this->options['default_argument_type'] == 'date') {
- return date($this->arg_format, time());
- }
- else if (!$raw) {
- foreach (range(1, 3) as $i) {
- $node = menu_get_object('node', $i);
- if (!empty($node)) {
- continue;
- }
- }
-
- if (arg(0) == 'node' && is_numeric(arg(1))) {
- $node = node_load(arg(1));
- }
-
- if (empty($node)) {
- return parent::get_default_argument();
- }
- else if ($this->options['default_argument_type'] == 'node_created') {
- return date($this->arg_format, $node->created);
- }
- else if ($this->options['default_argument_type'] == 'node_changed') {
- return date($this->arg_format, $node->changed);
- }
- }
- else {
- return parent::get_default_argument($raw);
- }
- }
-}
diff --git a/handlers/views_handler_argument_formula.inc b/handlers/views_handler_argument_formula.inc
deleted file mode 100644
index 67e0b39..0000000
--- a/handlers/views_handler_argument_formula.inc
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Abstract argument handler for simple formulae.
- *
- * Child classes of this object should implement summary_argument, at least.
- *
- * Definition terms:
- * - formula: The formula to use for this handler.
- *
- * @ingroup views_argument_handlers
- */
-class views_handler_argument_formula extends views_handler_argument {
- var $formula = NULL;
- /**
- * Constructor
- */
- function construct() {
- parent::construct();
-
- if (!empty($this->definition['formula'])) {
- $this->formula = $this->definition['formula'];
- }
- }
-
- function get_formula() {
- return str_replace('***table***', $this->table_alias, $this->formula);
- }
-
- /**
- * Build the summary query based on a formula
- */
- function summary_query() {
- $this->ensure_my_table();
- // Now that our table is secure, get our formula.
- $formula = $this->get_formula();
-
- // Add the field.
- $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field);
- $this->query->set_count_field(NULL, $formula, $this->field);
-
- return $this->summary_basics(FALSE);
- }
-
- /**
- * Build the query based upon the formula
- */
- function query() {
- $this->ensure_my_table();
- // Now that our table is secure, get our formula.
- $formula = $this->get_formula();
-
- $this->query->add_where(0, "$formula = '%s'", $this->argument);
- }
-}
diff --git a/handlers/views_handler_argument_many_to_one.inc b/handlers/views_handler_argument_many_to_one.inc
deleted file mode 100644
index fbc741e..0000000
--- a/handlers/views_handler_argument_many_to_one.inc
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php
-/**
- * An argument handler for use in fields that have a many to one relationship
- * with the table(s) to the left. This adds a bunch of options that are
- * reasonably common with this type of relationship.
- * Definition terms:
- * - numeric: If true, the field will be considered numeric. Probably should
- * always be set TRUE as views_handler_argument_string has many to one
- * capabilities.
- *
- * @ingroup views_argument_handlers
- */
-class views_handler_argument_many_to_one extends views_handler_argument {
- function init(&$view, &$options) {
- parent::init($view, $options);
- $this->helper = new views_many_to_one_helper($this);
-
- // Ensure defaults for these, during summaries and stuff:
- $this->operator = 'or';
- $this->value = array();
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- if (!empty($this->definition['numeric'])) {
- $options['break_phrase'] = array('default' => FALSE);
- }
-
- $options['add_table'] = array('default' => FALSE);
- $options['require_value'] = array('default' => FALSE);
-
- views_many_to_one_helper::option_definition($options);
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
-
- // allow + for or, , for and
- if (!empty($this->definition['numeric'])) {
- $form['break_phrase'] = array(
- '#type' => 'checkbox',
- '#title' => t('Allow multiple terms per argument.'),
- '#description' => t('If selected, users can enter multiple arguments in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'),
- '#default_value' => !empty($this->options['break_phrase']),
- );
- }
-
- $form['add_table'] = array(
- '#type' => 'checkbox',
- '#title' => t('Allow multiple arguments to work together.'),
- '#description' => t('If selected, multiple instances of this argument can work together, as though multiple terms were supplied to the same argument. This setting is not compatible with the "Reduce duplicates" setting.'),
- '#default_value' => !empty($this->options['add_table']),
- );
-
- $form['require_value'] = array(
- '#type' => 'checkbox',
- '#title' => t('Do not display items with no value in summary'),
- '#default_value' => !empty($this->options['require_value']),
- );
-
- $this->helper->options_form($form, $form_state);
- }
-
- /**
- * Override ensure_my_table so we can control how this joins in.
- * The operator actually has influence over joining.
- */
- function ensure_my_table() {
- $this->helper->ensure_my_table();
- }
-
- function query() {
- if (empty($this->argument)) {
- parent::ensure_my_table();
- $this->query->add_where(0, "$this->table_alias.$this->real_field IS NULL");
- return;
- }
-
- if (!empty($this->options['break_phrase'])) {
- views_break_phrase($this->argument, $this);
- }
- else {
- $this->value = array($this->argument);
- $this->operator = 'or';
- }
-
- $this->helper->add_filter();
- }
-
- function title() {
- if (!$this->argument) {
- return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized');
- }
-
- if (!empty($this->options['break_phrase'])) {
- views_break_phrase($this->argument, $this);
- }
- else {
- $this->value = array($this->argument);
- $this->operator = 'or';
- }
-
- // @todo -- both of these should check definition for alternate keywords.
-
- if (empty($this->value)) {
- return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized');
- }
-
- if ($this->value === array(-1)) {
- return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
- }
-
- return implode($this->operator == 'or' ? ' + ' : ', ', $this->title_query());
- }
-
- function summary_query() {
- $field = $this->table . '.' . $this->field;
- $join = $this->get_join();
-
- if (!empty($this->options['require_value'])) {
- $join->type = 'INNER';
- }
-
- if (empty($this->options['add_table']) || empty($this->view->many_to_one_tables[$field])) {
- $this->table_alias = $this->query->ensure_table($this->table, $this->relationship, $join);
- }
- else {
- $this->table_alias = $this->helper->summary_join();
- }
-
- // Add the field.
- $this->base_alias = $this->query->add_field($this->table_alias, $this->real_field);
-
- $this->summary_name_field();
-
- return $this->summary_basics();
- }
-
- function summary_argument($data) {
- $value = $data->{$this->base_alias};
- if (empty($value)) {
- $value = 0;
- }
-
- return $value;
- }
-
- /**
- * Override for specific title lookups.
- */
- function title_query() {
- return $this->value;
- }
-}
-
diff --git a/handlers/views_handler_argument_null.inc b/handlers/views_handler_argument_null.inc
deleted file mode 100644
index 4010b84..0000000
--- a/handlers/views_handler_argument_null.inc
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/**
- * Argument handler that ignores the argument.
- */
-class views_handler_argument_null extends views_handler_argument {
- function option_definition() {
- $options = parent::option_definition();
- $options['must_not_be'] = array('default' => FALSE);
- return $options;
- }
-
- /**
- * Override options_form() so that only the relevant options
- * are displayed to the user.
- */
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $form['must_not_be'] = array(
- '#type' => 'checkbox',
- '#title' => t('Fail basic validation if any argument is given'),
- '#default_value' => !empty($this->options['must_not_be']),
- '#description' => t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'),
- );
-
- unset($form['wildcard']);
- unset($form['wildcard_substitution']);
- }
-
- /**
- * Override default_actions() to remove actions that don't
- * make sense for a null argument.
- */
- function default_actions($which = NULL) {
- if ($which) {
- if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) {
- return parent::default_actions($which);
- }
- return;
- }
- $actions = parent::default_actions();
- unset($actions['summary asc']);
- unset($actions['summary desc']);
- return $actions;
- }
-
- function validate_argument_basic($arg) {
- if (!empty($this->options['must_not_be'])) {
- return !isset($arg);
- }
-
- return parent::validate_argument_basic($arg);
- }
-
- /**
- * Override the behavior of query() to prevent the query
- * from being changed in any way.
- */
- function query() {}
-}
diff --git a/handlers/views_handler_argument_numeric.inc b/handlers/views_handler_argument_numeric.inc
deleted file mode 100644
index ddde1d1..0000000
--- a/handlers/views_handler_argument_numeric.inc
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/**
- * @file
- * Contains the numeric argument handler.
- */
-
-/**
- * Basic argument handler for arguments that are numeric. Incorporates
- * break_phrase.
- *
- * @ingroup views_argument_handlers
- */
-class views_handler_argument_numeric extends views_handler_argument {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['break_phrase'] = array('default' => FALSE);
- $options['not'] = array('default' => FALSE);
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
-
- // allow + for or, , for and
- $form['break_phrase'] = array(
- '#type' => 'checkbox',
- '#title' => t('Allow multiple terms per argument.'),
- '#description' => t('If selected, users can enter multiple arguments in the form of 1+2+3 or 1,2,3.'),
- '#default_value' => !empty($this->options['break_phrase']),
- );
-
- $form['not'] = array(
- '#type' => 'checkbox',
- '#title' => t('Exclude the argument'),
- '#description' => t('If selected, the numbers entered in the argument will be excluded rather than limiting the view.'),
- '#default_value' => !empty($this->options['not']),
- );
- }
-
- function title() {
- if (!$this->argument) {
- return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized');
- }
-
- if (!empty($this->options['break_phrase'])) {
- views_break_phrase($this->argument, $this);
- }
- else {
- $this->value = array($this->argument);
- $this->operator = 'or';
- }
-
- if (empty($this->value)) {
- return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized');
- }
-
- if ($this->value === array(-1)) {
- return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
- }
-
- return implode($this->operator == 'or' ? ' + ' : ', ', $this->title_query());
- }
-
- /**
- * Override for specific title lookups.
- */
- function title_query() {
- return $this->value;
- }
-
- function query() {
- $this->ensure_my_table();
-
- if (!empty($this->options['break_phrase'])) {
- views_break_phrase($this->argument, $this);
- }
- else {
- $this->value = array($this->argument);
- }
-
- if (count($this->value) > 1) {
- $operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
- $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
- $this->query->add_where(0, "$this->table_alias.$this->real_field $operator ($placeholders)", $this->value);
- }
- else {
- $operator = empty($this->options['not']) ? '=' : '!=';
- $this->query->add_where(0, "$this->table_alias.$this->real_field $operator %d", $this->argument);
- }
- }
-}
diff --git a/handlers/views_handler_argument_string.inc b/handlers/views_handler_argument_string.inc
deleted file mode 100644
index 93c375c..0000000
--- a/handlers/views_handler_argument_string.inc
+++ /dev/null
@@ -1,215 +0,0 @@
-<?php
-
-/**
- * Basic argument handler to implement string arguments that may have length
- * limits.
- *
- * @ingroup views_argument_handlers
- */
-class views_handler_argument_string extends views_handler_argument {
- function init(&$view, &$options) {
- parent::init($view, $options);
- if (!empty($this->definition['many to one'])) {
- $this->helper = new views_many_to_one_helper($this);
-
- // Ensure defaults for these, during summaries and stuff:
- $this->operator = 'or';
- $this->value = array();
- }
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['glossary'] = array('default' => FALSE);
- $options['limit'] = array('default' => 0);
- $options['case'] = array('default' => 'none');
- $options['path_case'] = array('default' => 'none');
- $options['transform_dash'] = array('default' => FALSE);
-
- if (!empty($this->definition['many to one'])) {
- $options['add_table'] = array('default' => FALSE);
- $options['require_value'] = array('default' => FALSE);
- }
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
-
- $form['glossary'] = array(
- '#type' => 'checkbox',
- '#title' => t('Glossary mode'),
- '#description' => t('Glossary mode applies a limit to the number of characters used in the argument, which allows the summary view to act as a glossary.'),
- '#default_value' => $this->options['glossary'],
- );
-
- $form['limit'] = array(
- '#type' => 'textfield',
- '#title' => t('Character limit'),
- '#description' => t('How many characters of the argument to filter against. If set to 1, all fields starting with the letter in the argument would be matched.'),
- '#default_value' => $this->options['limit'],
- '#process' => array('views_process_dependency'),
- '#dependency' => array('edit-options-glossary' => array(TRUE)),
- );
-
- $form['case'] = array(
- '#type' => 'select',
- '#title' => t('Case'),
- '#description' => t('When printing the argument result, how to transform the case.'),
- '#options' => array(
- 'none' => t('No transform'),
- 'upper' => t('Upper case'),
- 'lower' => t('Lower case'),
- 'ucfirst' => t('Capitalize first letter'),
- 'ucwords' => t('Capitalize each word'),
- ),
- '#default_value' => $this->options['case'],
- );
-
- $form['path_case'] = array(
- '#type' => 'select',
- '#title' => t('Case in path'),
- '#description' => t('When printing url paths, how to transform the case of the argument. Do not use this unless with Postgres as it uses case sensitive comparisons.'),
- '#options' => array(
- 'none' => t('No transform'),
- 'upper' => t('Upper case'),
- 'lower' => t('Lower case'),
- 'ucfirst' => t('Capitalize first letter'),
- 'ucwords' => t('Capitalize each word'),
- ),
- '#default_value' => $this->options['path_case'],
- );
-
- $form['transform_dash'] = array(
- '#type' => 'checkbox',
- '#title' => t('Transform spaces to dashes in URL'),
- '#default_value' => $this->options['transform_dash'],
- );
-
- if (!empty($this->definition['many to one'])) {
- $form['add_table'] = array(
- '#type' => 'checkbox',
- '#title' => t('Allow multiple arguments to work together.'),
- '#description' => t('If selected, multiple instances of this argument can work together, as though multiple terms were supplied to the same argument. This setting is not compatible with the "Reduce duplicates" setting.'),
- '#default_value' => !empty($this->options['add_table']),
- );
-
- $form['require_value'] = array(
- '#type' => 'checkbox',
- '#title' => t('Do not display items with no value in summary'),
- '#default_value' => !empty($this->options['require_value']),
- );
- }
- }
-
- /**
- * Build the summary query based on a string
- */
- function summary_query() {
- if (empty($this->definition['many to one'])) {
- $this->ensure_my_table();
- }
- else {
- $this->table_alias = $this->helper->summary_join();
- }
-
- if (empty($this->options['glossary'])) {
- // Add the field.
- $this->base_alias = $this->name_alias = $this->query->add_field($this->table_alias, $this->real_field);
- $this->query->set_count_field($this->table_alias, $this->real_field);
- }
- else {
- // Add the field.
- $formula = $this->get_formula();
- $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field . '_truncated');
- $this->query->set_count_field(NULL, $formula, $this->field, $this->field . '_truncated');
- }
-
- return $this->summary_basics(FALSE);
- }
-
- /**
- * Get the formula for this argument.
- *
- * $this->ensure_my_table() MUST have been called prior to this.
- */
- function get_formula() {
- return "SUBSTR($this->table_alias.$this->real_field, 1, " . intval($this->options['limit']) . ")";
- }
-
- /**
- * Build the query based upon the formula
- */
- function query() {
- $argument = $this->argument;
- if (!empty($this->options['transform_dash'])) {
- $argument = strtr($argument, '-', ' ');
- }
-
- if (!empty($this->definition['many to one'])) {
- if (!empty($this->options['glossary'])) {
- $this->helper->formula = TRUE;
- }
- $this->value = array($argument);
- $this->helper->ensure_my_table();
- $this->helper->add_filter();
- return;
- }
-
- $this->ensure_my_table();
- if (empty($this->options['glossary'])) {
- $field = "$this->table_alias.$this->real_field";
- }
- else {
- $field = $this->get_formula();
- }
-
- $this->query->add_where(0, "$field = '%s'", $argument);
- }
-
- function summary_argument($data) {
- $value = $this->case_transform($data->{$this->base_alias}, 'path_case');
- if (!empty($this->options['transform_dash'])) {
- $value = strtr($value, ' ', '-');
- }
- return $value;
- }
-
- function case_transform($string, $option) {
- global $multibyte;
-
- switch ($this->options[$option]) {
- default:
- return $string;
- case 'upper':
- return drupal_strtoupper($string);
- case 'lower':
- return drupal_strtolower($string);
- case 'ucfirst':
- return drupal_strtoupper(drupal_substr($string, 0, 1)) . drupal_substr($string, 1);
- case 'ucwords':
- if ($multibyte == UNICODE_MULTIBYTE) {
- return mb_convert_case($string, MB_CASE_TITLE);
- } else {
- return ucwords($string);
- }
- }
- }
-
- function title() {
- $title = $this->case_transform($this->argument, 'case');
- if (!empty($this->options['transform_dash'])) {
- $title = strtr($title, '-', ' ');
- }
-
- return check_plain($title);
- }
-
- function summary_name($data) {
- return $this->case_transform(parent::summary_name($data), 'case');
- }
-
-}
-
diff --git a/handlers/views_handler_field.inc b/handlers/views_handler_field.inc
deleted file mode 100644
index c2db4e1..0000000
--- a/handlers/views_handler_field.inc
+++ /dev/null
@@ -1,806 +0,0 @@
-<?php
-/**
- * @defgroup views_field_handlers Views' field handlers
- * @{
- * Handlers to tell Views how to build and display fields.
- *
- */
-
-/**
- * Base field handler that has no options and renders an unformatted field.
- *
- * Definition terms:
- * - additional fields: An array of fields that should be added to the query
- * for some purpose. The array is in the form of:
- * array('identifier' => array('table' => tablename,
- * 'field' => fieldname); as many fields as are necessary
- * may be in this array.
- * - click sortable: If TRUE, this field may be click sorted.
- */
-class views_handler_field extends views_handler {
- var $field_alias = 'unknown';
- var $aliases = array();
-
- /**
- * Construct a new field handler.
- */
- function construct() {
- parent::construct();
-
- $this->additional_fields = array();
- if (!empty($this->definition['additional fields'])) {
- $this->additional_fields = $this->definition['additional fields'];
- }
-
- if (!isset($this->options['exclude'])) {
- $this->options['exclude'] = '';
- }
- }
-
- /**
- * Determine if this field can allow advanced rendering.
- *
- * Fields can set this to FALSE if they do not wish to allow
- * token based rewriting or link-making.
- */
- function allow_advanced_render() {
- return TRUE;
- }
-
- function init(&$view, $options) {
- parent::init($view, $options);
-
- $this->options += array(
- 'exclude' => FALSE,
- );
- }
-
- /**
- * Called to add the field to a query.
- */
- function query() {
- $this->ensure_my_table();
- // Add the field.
- $this->field_alias = $this->query->add_field($this->table_alias, $this->real_field);
-
- $this->add_additional_fields();
- }
-
- /**
- * Add 'additional' fields to the query.
- *
- * @param $fields
- * An array of fields. The key is an identifier used to later find the
- * field alias used. The value is either a string in which case it's
- * assumed to be a field on this handler's table; or it's an array in the
- * form of
- * @code array('table' => $tablename, 'field' => $fieldname) @endcode
- */
- function add_additional_fields($fields = NULL) {
- if (!isset($fields)) {
- // notice check
- if (empty($this->additional_fields)) {
- return;
- }
- $fields = $this->additional_fields;
- }
- if (!empty($fields) && is_array($fields)) {
- foreach ($fields as $identifier => $info) {
- if (is_array($info)) {
- if (isset($info['table'])) {
- $table_alias = $this->query->ensure_table($info['table'], $this->relationship);
- }
- else {
- $table_alias = $this->table_alias;
- }
- $this->aliases[$identifier] = $this->query->add_field($table_alias, $info['field']);
- }
- else {
- $this->aliases[$info] = $this->query->add_field($this->table_alias, $info);
- }
- }
- }
- }
-
- /**
- * Called to determine what to tell the clicksorter.
- */
- function click_sort($order) {
- $this->query->add_orderby($this->table, $this->field, $order, $this->field_alias);
- }
-
- /**
- * Determine if this field is click sortable.
- */
- function click_sortable() {
- return !empty($this->definition['click sortable']);
- }
-
- /**
- * Get this field's label.
- */
- function label() {
- if (!isset($this->options['label'])) {
- return '';
- }
- return $this->options['label'];
- }
-
- /**
- * Return DIV or SPAN based upon the field's element type.
- */
- function element_type() {
- if (isset($this->definition['element type'])) {
- return $this->definition['element type'];
- }
-
- return 'span';
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['label'] = array('default' => $this->definition['title'], 'translatable' => TRUE);
- $options['alter'] = array(
- 'contains' => array(
- 'alter_text' => array('default' => FALSE),
- 'text' => array('default' => '', 'translatable' => TRUE),
- 'make_link' => array('default' => FALSE),
- 'path' => array('default' => '', 'translatable' => TRUE),
- 'alt' => array('default' => '', 'translatable' => TRUE),
- 'link_class' => array('default' => ''),
- 'prefix' => array('default' => '', 'translatable' => TRUE),
- 'suffix' => array('default' => '', 'translatable' => TRUE),
- 'target' => array('default' => '', 'translatable' => TRUE),
- 'trim' => array('default' => FALSE),
- 'max_length' => array('default' => ''),
- 'word_boundary' => array('default' => TRUE),
- 'ellipsis' => array('default' => TRUE),
- 'strip_tags' => array('default' => FALSE),
- 'html' => array('default' => FALSE),
- ),
- );
- $options['empty'] = array('default' => '', 'translatable' => TRUE);
- $options['hide_empty'] = array('default' => FALSE);
- $options['empty_zero'] = array('default' => FALSE);
-
- return $options;
- }
-
- /**
- * Default options form that provides the label widget that all fields
- * should have.
- */
- function options_form(&$form, &$form_state) {
- $form['label'] = array(
- '#type' => 'textfield',
- '#title' => t('Label'),
- '#default_value' => isset($this->options['label']) ? $this->options['label'] : '',
- '#description' => t('The label for this field that will be displayed to end users if the style requires it.'),
- );
- $form['exclude'] = array(
- '#type' => 'checkbox',
- '#title' => t('Exclude from display'),
- '#default_value' => $this->options['exclude'],
- '#description' => t('Check this box to not display this field, but still load it in the view. Use this option to not show a grouping field in each record, or when doing advanced theming.'),
- );
-
- if ($this->allow_advanced_render()) {
- $form['alter']['#tree'] = TRUE;
- $form['alter']['alter_text'] = array(
- '#type' => 'checkbox',
- '#title' => t('Rewrite the output of this field'),
- '#description' => t('If checked, you can alter the output of this field by specifying a string of text with replacement tokens that can use any existing field output.'),
- '#default_value' => $this->options['alter']['alter_text'],
- );
-
- $form['alter']['text'] = array(
- '#title' => t('Text'),
- '#type' => 'textarea',
- '#default_value' => $this->options['alter']['text'],
- '#description' => t('The text to display for this field. You may include HTML. You may enter data from this view as per the "Replacement patterns" below.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-alter-text' => array(1)
- ),
- );
-
- $form['alter']['make_link'] = array(
- '#type' => 'checkbox',
- '#title' => t('Output this field as a link'),
- '#description' => t('If checked, this field will be made into a link. The destination must be given below.'),
- '#default_value' => $this->options['alter']['make_link'],
- );
- $form['alter']['path'] = array(
- '#title' => t('Link path'),
- '#type' => 'textfield',
- '#default_value' => $this->options['alter']['path'],
- '#description' => t('The Drupal path or absolute URL for this link. You may enter data from this view as per the "Replacement patterns" below.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-make-link' => array(1)
- ),
- );
- $form['alter']['link_class'] = array(
- '#title' => t('Link class'),
- '#type' => 'textfield',
- '#default_value' => $this->options['alter']['link_class'],
- '#description' => t('The CSS class to apply to the link.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-make-link' => array(1)
- ),
- );
- $form['alter']['alt'] = array(
- '#title' => t('Alt text'),
- '#type' => 'textfield',
- '#default_value' => $this->options['alter']['alt'],
- '#description' => t('Text to place as "alt" text which most browsers display as a tooltip when hovering over the link.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-make-link' => array(1)
- ),
- );
- $form['alter']['prefix'] = array(
- '#title' => t('Prefix text'),
- '#type' => 'textfield',
- '#default_value' => $this->options['alter']['prefix'],
- '#description' => t('Any text to display before this link. You may include HTML.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-make-link' => array(1)
- ),
- );
- $form['alter']['suffix'] = array(
- '#title' => t('Suffix text'),
- '#type' => 'textfield',
- '#default_value' => $this->options['alter']['suffix'],
- '#description' => t('Any text to display after this link. You may include HTML.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-make-link' => array(1)
- ),
- );
- $form['alter']['target'] = array(
- '#title' => t('Target'),
- '#type' => 'textfield',
- '#default_value' => $this->options['alter']['target'],
- '#description' => t("Target of the link, such as _blank, _parent or an iframe's name. This field is rarely used."),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-make-link' => array(1)
- ),
- );
-
-
- // Get a list of the available fields and arguments for token replacement.
- $options = array();
- foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {
- $options[t('Fields')]["[$field]"] = $handler->ui_name();
- // We only use fields up to (and including) this one.
- if ($field == $this->options['id']) {
- break;
- }
- }
- $count = 0; // This lets us prepare the key as we want it printed.
- foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
- $options[t('Arguments')]['%' . ++$count] = t('@argument title', array('@argument' => $handler->ui_name()));
- $options[t('Arguments')]['!' . $count] = t('@argument input', array('@argument' => $handler->ui_name()));
- }
-
- $this->document_self_tokens($options[t('Fields')]);
-
- // Default text.
- $output = t('<p>You must add some additional fields to this display before using this field. These fields may be marked as <em>Exclude from display</em> if you prefer. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields.</p>');
- // We have some options, so make a list.
- if (!empty($options)) {
- $output = t('<p>The following substitution patterns are available for this display. Use the pattern shown on the left to display the value indicated on the right. Note that due to rendering order, you cannot use fields that come after this field; if you need a field not listed here, rearrange your fields.</p>');
- foreach (array_keys($options) as $type) {
- if (!empty($options[$type])) {
- $items = array();
- foreach ($options[$type] as $key => $value) {
- $items[] = $key . ' == ' . $value;
- }
- $output .= theme('item_list', $items, $type);
- }
- }
- }
- // This construct uses 'hidden' and not markup because process doesn't
- // run. It also has an extra div because the dependency wants to hide
- // the parent in situations like this, so we need a second div to
- // make this work.
- $form['alter']['help'] = array(
- '#type' => 'hidden',
- '#id' => 'views-tokens-help',
- '#prefix' => '<div><fieldset id="views-tokens-help"><legend>' . t('Replacement patterns') . '</legend>' . $output . '</fieldset></div>',
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-make-link' => array(1),
- 'edit-options-alter-alter-text' => array(1),
- ),
- );
-
- $form['alter']['trim'] = array(
- '#type' => 'checkbox',
- '#title' => t('Trim this field to a maximum length'),
- '#description' => t('If checked, this field be trimmed to a maximum length in characters.'),
- '#default_value' => $this->options['alter']['trim'],
- );
-
- $form['alter']['max_length'] = array(
- '#title' => t('Maximum length'),
- '#type' => 'textfield',
- '#default_value' => $this->options['alter']['max_length'],
- '#description' => t('The maximum number of characters this field can be.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-trim' => array(1)
- ),
- );
-
- $form['alter']['word_boundary'] = array(
- '#type' => 'checkbox',
- '#title' => t('Trim only on a word boundary'),
- '#description' => t('If checked, this field be trimmed only on a word boundary. This is guaranteed to be the maximum characters stated or less. If there are no word boundaries this could trim a field to nothing.'),
- '#default_value' => $this->options['alter']['word_boundary'],
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-trim' => array(1)
- ),
- );
-
- $form['alter']['ellipsis'] = array(
- '#type' => 'checkbox',
- '#title' => t('Add an ellipsis'),
- '#description' => t('If checked, a "..." will be added if a field was trimmed.'),
- '#default_value' => $this->options['alter']['ellipsis'],
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-trim' => array(1)
- ),
- );
-
- $form['alter']['strip_tags'] = array(
- '#type' => 'checkbox',
- '#title' => t('Strip HTML tags'),
- '#description' => t('If checked, all HTML tags will be stripped.'),
- '#default_value' => $this->options['alter']['strip_tags'],
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-trim' => array(1)
- ),
- );
-
- $form['alter']['html'] = array(
- '#type' => 'checkbox',
- '#title' => t('Field can contain HTML'),
- '#description' => t('If checked, HTML corrector will be run to ensure tags are properly closed after trimming.'),
- '#default_value' => $this->options['alter']['html'],
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-alter-trim' => array(1)
- ),
- );
- }
- $form['empty'] = array(
- '#type' => 'textfield',
- '#title' => t('Empty text'),
- '#default_value' => $this->options['empty'],
- '#description' => t('If the field is empty, display this text instead.'),
- );
-
- $form['empty_zero'] = array(
- '#type' => 'checkbox',
- '#title' => t('Count the number 0 as empty'),
- '#default_value' => $this->options['empty_zero'],
- '#description' => t('If the field contains the number zero, display the empty text instead'),
- );
-
- $form['hide_empty'] = array(
- '#type' => 'checkbox',
- '#title' => t('Hide if empty'),
- '#default_value' => $this->options['hide_empty'],
- '#description' => t('Do not display anything for this field if it is empty. Note that the field label may still be displayed. Check style or row style settings to hide labels for empty fields.'),
- );
- }
-
- /**
- * Provide extra data to the administration form
- */
- function admin_summary() {
- return $this->label();
- }
-
- /**
- * Run before any fields are rendered.
- *
- * This gives the handlers some time to set up before any handler has
- * been rendered.
- *
- * @param $values
- * An array of all objects returned from the query.
- */
- function pre_render($values) { }
-
- /**
- * Render the field.
- *
- * @param $values
- * The values retrieved from the database.
- */
- function render($values) {
- $value = $values->{$this->field_alias};
- return check_plain($value);
- }
-
- /**
- * Render a field using advanced settings.
- *
- * This renders a field normally, then decides if render-as-link and
- * text-replacement rendering is necessary.
- */
- function advanced_render($values) {
- if ($this->allow_advanced_render() && method_exists($this, 'render_item')) {
- $raw_items = $this->get_items($values);
- }
- else {
- $this->last_render = $value = $this->render($values);
- $this->original_value = $value;
- }
-
- if ($this->allow_advanced_render()) {
- $tokens = NULL;
- if (method_exists($this, 'render_item')) {
- $items = array();
- foreach ($raw_items as $count => $item) {
- $this->last_render = $this->render_item($count, $item);
- $this->original_value = $this->last_render;
-
- $alter = $item + $this->options['alter'];
- $items[] = $this->render_text($alter);
- }
-
- $value = $this->render_items($items);
- }
- else {
- $value = $this->render_text($this->options['alter']);
- }
-
- // This happens here so that render_as_link can get the unaltered value of
- // this field as a token rather than the altered value.
- $this->last_render = $value;
- }
-
- if (empty($this->last_render)) {
- if ($this->last_render !== 0 || !empty($this->options['empty_zero'])) {
- $this->last_render = $this->options['empty'];
- }
- }
-
- return $this->last_render;
- }
-
- /**
- * Perform an advanced text render for the item.
- *
- * This is separated out as some fields may render lists, and this allows
- * each item to be handled individually.
- */
- function render_text($alter) {
- $value = $this->last_render;
- if ($this->options['hide_empty'] && empty($value) && ($value !== 0 || $this->options['empty_zero'])) {
- return '';
- }
-
- if (!empty($alter['alter_text']) && $alter['text'] !== '') {
- $tokens = $this->get_render_tokens($alter);
- $value = $this->render_altered($alter, $tokens);
- }
-
- if (!empty($alter['trim']) && !empty($alter['max_length'])) {
- $value = $this->render_trim_text($alter, $value);
- }
-
- if (!empty($alter['make_link']) && !empty($alter['path'])) {
- if (!isset($tokens)) {
- $tokens = $this->get_render_tokens($alter);
- }
- $value = $this->render_as_link($alter, $value, $tokens);
- }
-
- return $value;
- }
-
- /**
- * Render this field as altered text, from a fieldset set by the user.
- */
- function render_altered($alter, $tokens) {
- // Filter this right away as our substitutions are already sanitized.
- $value = filter_xss_admin($alter['text']);
- $value = strtr($value, $tokens);
-
- return $value;
- }
-
- /**
- * Trim the field down to the specified length.
- */
- function render_trim_text($alter, $value) {
- if (!empty($alter['strip_tags'])) {
- $value = strip_tags($value);
- // NOTE: It's possible that some external fields might override the
- // element type so if someone from, say, CCK runs into a bug here,
- // this may be why =)
- $this->definition['element type'] = 'span';
- }
-
- if (drupal_strlen($value) <= $alter['max_length']) {
- return $value;
- }
-
- $value = drupal_substr($value, 0, $alter['max_length']);
-
- if (!empty($alter['word_boundary'])) {
- if (preg_match("/(.*)\b.+/us", $value, $matches)) {
- $value = $matches[1];
- }
- }
- // Remove scraps of HTML entities from the end of a strings
- $value = rtrim(preg_replace('/(?:<(?!.+>)|&(?!.+;)).*$/us', '', $value));
-
- if (!empty($alter['ellipsis'])) {
- $value .= '...';
- }
-
- if (!empty($alter['html'])) {
- $value = _filter_htmlcorrector($value);
- }
-
- return $value;
- }
-
- /**
- * Render this field as a link, with the info from a fieldset set by
- * the user.
- */
- function render_as_link($alter, $text, $tokens) {
- $value = '';
-
- if (!empty($alter['prefix'])) {
- $value .= filter_xss_admin(strtr($alter['prefix'], $tokens));
- }
-
- $options = array(
- 'html' => 'true',
- );
-
- // $path will be run through check_url() by l() so we do not need to
- // sanitize it ourselves.
- $path = $alter['path'];
-
- // Use strip tags as there should never be HTML in the path.
- // However, we need to preserve special characters like " that
- // were removed by check_plain().
- $path = strip_tags(html_entity_decode(strtr($path, $tokens)));
-
- // Parse the URL and move any query and fragment parameters out of the path.
- $url = parse_url($path);
- if (isset($url['query'])) {
- $path = strtr($path, array('?' . $url['query'] => ''));
- $options['query'] = $url['query'];
- }
- if (isset($url['fragment'])) {
- $path = strtr($path, array('#' . $url['fragment'] => ''));
- $options['fragment'] = $url['fragment'];
- }
-
- $alt = strtr($alter['alt'], $tokens);
- // Set the title attribute of the link only if it improves accessibility
- if ($alt && $alt != $text) {
- $options['attributes']['title'] = $alt;
- }
-
- $class = strtr($alter['link_class'], $tokens);
- if ($class) {
- $options['attributes']['class'] = $class;
- }
-
- $target = check_plain(trim($alter['target']));
- if (!empty($target)) {
- $options['attributes']['target'] = $target;
- }
-
- // If the query and fragment were programatically assigned overwrite any
- // parsed values.
- if (isset($alter['query'])) {
- $options['query'] = strtr($alter['query'], $tokens);
- }
- if (isset($alter['fragment'])) {
- $options['fragment'] = strtr($alter['fragment'], $tokens);
- }
- if (isset($this->options['alter']['language'])) {
- $options['language'] = $this->options['alter']['language'];
- }
-
- $value .= l($text, $path, $options);
-
- if (!empty($alter['suffix'])) {
- $value .= filter_xss_admin(strtr($alter['suffix'], $tokens));
- }
-
- return $value;
- }
-
- /**
- * Get the 'render' tokens to use for advanced rendering.
- *
- * This runs through all of the fields and arguments that
- * are available and gets their values. This will then be
- * used in one giant str_replace().
- */
- function get_render_tokens($item) {
- $tokens = array();
- if (!empty($this->view->build_info['substitutions'])) {
- $tokens = $this->view->build_info['substitutions'];
- }
- $count = 0;
- foreach ($this->view->display_handler->get_handlers('argument') as $arg => $handler) {
- $token = '%' . ++$count;
- if (!isset($tokens[$token])) {
- $tokens[$token] = '';
- }
-
- $tokens['!' . $count] = isset($this->view->args[$count - 1]) ? check_plain($this->view->args[$count - 1]) : '';
- }
-
- // Now add replacements for our fields.
- foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {
- if (isset($handler->last_render)) {
- $tokens["[$field]"] = $handler->last_render;
- }
- else {
- $tokens["[$field]"] = '';
- }
- // We only use fields up to (and including) this one.
- if ($field == $this->options['id']) {
- break;
- }
-
- $this->add_self_tokens($tokens, $item);
- }
-
- return $tokens;
- }
-
- /**
- * Add any special tokens this field might use for itself.
- *
- * This method is intended to be overridden by items that generate
- * fields as a list. For example, the field that displays all terms
- * on a node might have tokens for the tid and the term.
- *
- * By convention, tokens should follow the format of [token-subtoken]
- * where token is the field ID and subtoken is the field. If the
- * field ID is terms, then the tokens might be [terms-tid] and [terms-name].
- */
- function add_self_tokens(&$tokens, $item) { }
-
- /**
- * Document any special tokens this field might use for itself.
- *
- * @see add_self_tokens() for details.
- */
- function document_self_tokens(&$tokens) { }
-
- /**
- * Call out to the theme() function, which probably just calls render() but
- * allows sites to override output fairly easily.
- */
- function theme($values) {
- return theme($this->theme_functions(), $this->view, $this, $values);
- }
-
- function theme_functions() {
- $themes = array();
- $hook = 'views_view_field';
-
- $display = $this->view->display[$this->view->current_display];
-
- if (!empty($display)) {
- $themes[] = $hook . '__' . $this->view->name . '__' . $display->id . '__' . $this->options['id'];
- $themes[] = $hook . '__' . $this->view->name . '__' . $display->id;
- $themes[] = $hook . '__' . $display->id . '__' . $this->options['id'];
- $themes[] = $hook . '__' . $display->id;
- if ($display->id != $display->display_plugin) {
- $themes[] = $hook . '__' . $this->view->name . '__' . $display->display_plugin . '__' . $this->options['id'];
- $themes[] = $hook . '__' . $this->view->name . '__' . $display->display_plugin;
- $themes[] = $hook . '__' . $display->display_plugin . '__' . $this->options['id'];
- $themes[] = $hook . '__' . $display->display_plugin;
- }
- }
- $themes[] = $hook . '__' . $this->view->name . '__' . $this->options['id'];
- $themes[] = $hook . '__' . $this->view->name;
- $themes[] = $hook . '__' . $this->options['id'];
- $themes[] = $hook;
-
- return $themes;
- }
-}
-
-/**
- * A special handler to take the place of missing or broken handlers.
- */
-class views_handler_field_broken extends views_handler_field {
- function ui_name($short = FALSE) {
- return t('Broken/missing handler');
- }
-
- function ensure_my_table() { /* No table to ensure! */ }
- function query() { /* No query to run */ }
- function options_form(&$form, &$form_state) {
- $form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
- '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
- );
- }
-
- /**
- * Determine if the handler is considered 'broken'
- */
- function broken() { return TRUE; }
-}
-
-/**
- * Render a numeric value as a size.
- */
-class views_handler_field_file_size extends views_handler_field {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['file_size_display'] = array('default' => 'formatted');
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $form['file_size_display'] = array(
- '#title' => t('File size display'),
- '#type' => 'select',
- '#options' => array(
- 'formatted' => t('Formatted (in KB or MB)'),
- 'bytes' => t('Raw bytes'),
- ),
- );
- }
-
- function render($values) {
- if ($values->{$this->field_alias}) {
- switch ($this->options['file_size_display']) {
- case 'bytes':
- return $values->{$this->field_alias};
- case 'formatted':
- default:
- return format_size($values->{$this->field_alias});
- }
- }
- else {
- return '';
- }
- }
-}
-
-/**
- * A handler to run a field through simple XSS filtering
- */
-class views_handler_field_xss extends views_handler_field {
- function render($values) {
- $value = $values->{$this->field_alias};
- return filter_xss($value);
- }
-}
-
-/**
- * @}
- */
-
diff --git a/handlers/views_handler_field_boolean.inc b/handlers/views_handler_field_boolean.inc
deleted file mode 100644
index 926d5ec..0000000
--- a/handlers/views_handler_field_boolean.inc
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-/**
- * A handler to provide proper displays for booleans.
- *
- * Allows for display of true/false, yes/no, on/off.
- *
- * @ingroup views_field_handlers
- */
-class views_handler_field_boolean extends views_handler_field {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['type'] = array('default' => 'yes-no');
- $options['not'] = array('definition bool' => 'reverse');
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $form['type'] = array(
- '#type' => 'select',
- '#title' => t('Output format'),
- '#options' => array(
- 'yes-no' => t('Yes/No'),
- 'true-false' => t('True/False'),
- 'on-off' => t('On/Off'),
- ),
- '#default_value' => $this->options['type'],
- );
- $form['not'] = array(
- '#type' => 'checkbox',
- '#title' => t('Reverse'),
- '#description' => t('If checked, true will be displayed as false.'),
- '#default_value' => $this->options['not'],
- );
- }
-
- function render($values) {
- $value = $values->{$this->field_alias};
- if (!empty($this->options['not'])) {
- $value = !$value;
- }
-
- switch ($this->options['type']) {
- case 'yes-no':
- default:
- return $value ? t('Yes') : t('No');
- case 'true-false':
- return $value ? t('True') : t('False');
- case 'on-off':
- return $value ? t('On') : t('Off');
- }
- }
-}
diff --git a/handlers/views_handler_field_counter.inc b/handlers/views_handler_field_counter.inc
deleted file mode 100644
index bc09ef1..0000000
--- a/handlers/views_handler_field_counter.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-class views_handler_field_counter extends views_handler_field {
- function option_definition() {
- $options = parent::option_definition();
- $options['counter_start'] = array('default' => 1);
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
-
- $form['counter_start'] = array(
- '#type' => 'textfield',
- '#title' => t('Starting value'),
- '#default_value' => $this->options['counter_start'],
- '#description' => t('Specify the number the counter should start at.'),
- //'#process' => array('views_process_dependency'),
- '#size' => 2,
- );
- }
-
- function query() {
- // do nothing -- to override the parent query.
- }
-
- function render($values) {
- // Note: 1 is subtracted from the counter start value below because the
- // counter value is incremented by 1 at the end of this function.
- $count = is_numeric($this->options['counter_start']) ? $this->options['counter_start'] - 1 : 0;
- $pager = $this->view->pager;
- // Get the base count of the pager.
- if ($pager['use_pager']) {
- $count += ($pager['items_per_page'] * $pager['current_page']) + $pager['offset'];
- }
- // Add the counter for the current site.
- $count += $this->view->row_index + 1;
-
- return $count;
- }
-}
diff --git a/handlers/views_handler_field_custom.inc b/handlers/views_handler_field_custom.inc
deleted file mode 100644
index 3f4a6de..0000000
--- a/handlers/views_handler_field_custom.inc
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
- * A handler to provide a field that is completely custom by the administrator.
- *
- * @ingroup views_field_handlers
- */
-class views_handler_field_custom extends views_handler_field {
- function query() {
- // do nothing -- to override the parent query.
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- // Override the alter text option to always alter the text.
- $options['alter']['contains']['alter_text'] = array('default' => TRUE);
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
-
- // Remove the checkbox
- unset($form['alter']['alter_text']);
- unset($form['alter']['text']['#dependency']);
- unset($form['alter']['text']['#process']);
- }
-
- function render($values) {
- // Nothing to render.
- return '';
- }
-}
diff --git a/handlers/views_handler_field_date.inc b/handlers/views_handler_field_date.inc
deleted file mode 100644
index 3387988..0000000
--- a/handlers/views_handler_field_date.inc
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
- * A handler to provide proper displays for dates.
- *
- * @ingroup views_field_handlers
- */
-class views_handler_field_date extends views_handler_field {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['date_format'] = array('default' => 'small');
- $options['custom_date_format'] = array('default' => '');
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $time = time();
-
- $form['date_format'] = array(
- '#type' => 'select',
- '#title' => t('Date format'),
- '#options' => array(
- 'small' => format_date($time, 'small'),
- 'medium' => format_date($time, 'medium'),
- 'large' => format_date($time, 'large'),
- 'custom' => t('Custom'),
- 'raw time ago' => t('Time ago'),
- 'time ago' => t('Time ago (with "ago" appended)'),
- 'raw time span' => t('Time span (future dates start with - )'),
- 'time span' => t('Time span (with "ago/hence" appended)'),
- ),
- '#default_value' => isset($this->options['date_format']) ? $this->options['date_format'] : 'small',
- );
- $form['custom_date_format'] = array(
- '#type' => 'textfield',
- '#title' => t('Custom date format'),
- '#description' => t('If "Custom", see <a href="http://us.php.net/manual/en/function.date.php" target="_blank">the PHP docs</a> for date formats. If "Time ago" this is the the number of different units to display, which defaults to two.'),
- '#default_value' => isset($this->options['custom_date_format']) ? $this->options['custom_date_format'] : '',
- '#process' => array('views_process_dependency'),
- '#dependency' => array('edit-options-date-format' => array('custom', 'raw time ago', 'time ago', 'raw time span', 'time span')),
- );
- }
-
- function render($values) {
- $value = $values->{$this->field_alias};
- $format = $this->options['date_format'];
- if (in_array($format, array('custom', 'raw time ago', 'time ago', 'raw time span', 'time span'))) {
- $custom_format = $this->options['custom_date_format'];
- }
-
- if (!$value) {
- return theme('views_nodate');
- }
- else {
- $time_diff = time() - $value; // will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence)
- switch ($format) {
- case 'raw time ago':
- return format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2);
- case 'time ago':
- return t('%time ago', array('%time' => format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2)));
- case 'raw time span':
- return ($time_diff < 0 ? '-' : '') . format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2);
- case 'time span':
- return t(($time_diff < 0 ? '%time hence' : '%time ago'), array('%time' => format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)));
- case 'custom':
- return format_date($value, $format, $custom_format);
- default:
- return format_date($value, $format);
- }
- }
- }
-}
diff --git a/handlers/views_handler_field_markup.inc b/handlers/views_handler_field_markup.inc
deleted file mode 100644
index f3ea447..0000000
--- a/handlers/views_handler_field_markup.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/**
- * A handler to run a field through check_markup, using a companion
- * format field.
- *
- * - format: (REQUIRED) The field in this table used to control the format
- * such as the 'format' field in the node, which goes with the
- * 'body' field.
- *
- * @ingroup views_field_handlers
- */
-class views_handler_field_markup extends views_handler_field {
- /**
- * Constructor; calls to base object constructor.
- */
- function construct() {
- parent::construct();
-
- $this->format = $this->definition['format'];
-
- $this->additional_fields = array();
- if (!is_numeric($this->format)) {
- $this->additional_fields['format'] = array('field' => $this->format);
- }
- }
-
- function render($values) {
- $value = $values->{$this->field_alias};
- $format = is_numeric($this->format) ? $this->format : $values->{$this->aliases['format']};
- return check_markup($value, $format, FALSE);
- }
-
- function element_type() {
- if (isset($this->definition['element type'])) {
- return $this->definition['element type'];
- }
-
- return 'div';
- }
-}
diff --git a/handlers/views_handler_field_numeric.inc b/handlers/views_handler_field_numeric.inc
deleted file mode 100644
index efa3c0f..0000000
--- a/handlers/views_handler_field_numeric.inc
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-/**
- * Render a field as a numeric value
- *
- * Definition terms:
- * - float: If true this field contains a decimal value. If unset this field
- * will be assumed to be integer.
- *
- * @ingroup views_field_handlers
- */
-class views_handler_field_numeric extends views_handler_field {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['set_precision'] = array('default' => FALSE);
- $options['precision'] = array('default' => 0);
- $options['decimal'] = array('default' => '.', 'translatable' => TRUE);
- $options['separator'] = array('default' => ',', 'translatable' => TRUE);
- $options['prefix'] = array('default' => '', 'translatable' => TRUE);
- $options['suffix'] = array('default' => '', 'translatable' => TRUE);
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
-
- if (!empty($this->definition['float'])) {
- $form['set_precision'] = array(
- '#type' => 'checkbox',
- '#title' => t('Round'),
- '#description' => t('If checked, the number will be rounded.'),
- '#default_value' => $this->options['set_precision'],
- );
- $form['precision'] = array(
- '#type' => 'textfield',
- '#title' => t('Precision'),
- '#default_value' => $this->options['precision'],
- '#description' => t('Specify how many digits to print after the decimal point.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array('edit-options-set-precision' => array(TRUE)),
- '#size' => 2,
- );
- $form['decimal'] = array(
- '#type' => 'textfield',
- '#title' => t('Decimal point'),
- '#default_value' => $this->options['decimal'],
- '#description' => t('What single character to use as a decimal point.'),
- '#size' => 2,
- );
- }
- $form['separator'] = array(
- '#type' => 'textfield',
- '#title' => t('Thousands separator'),
- '#default_value' => $this->options['separator'],
- '#description' => t('What single character to use as the thousands separator.'),
- '#size' => 2,
- );
- $form['prefix'] = array(
- '#type' => 'textfield',
- '#title' => t('Prefix'),
- '#default_value' => $this->options['prefix'],
- '#description' => t('Text to put before the number, such as currency symbol.'),
- );
- $form['suffix'] = array(
- '#type' => 'textfield',
- '#title' => t('Suffix'),
- '#default_value' => $this->options['suffix'],
- '#description' => t('Text to put after the number, such as currency symbol.'),
- );
- }
-
- function render($values) {
- $value = $values->{$this->field_alias};
- if (!empty($this->options['set_precision'])) {
- $value = number_format($value, $this->options['precision'], $this->options['decimal'], $this->options['separator']);
- }
- else {
- $remainder = abs($value) - intval(abs($value));
- $value = $value > 0 ? floor($value) : ceil($value);
- $value = number_format($value, 0, '', $this->options['separator']);
- if ($remainder) {
- // The substr may not be locale safe.
- $value .= $this->options['decimal'] . substr($remainder, 2);
- }
- }
-
- // Check to see if hiding should happen before adding prefix and suffix.
- if ($this->options['hide_empty'] && empty($value) && ($value !== 0 || $this->options['empty_zero'])) {
- return '';
- }
-
- return check_plain($this->options['prefix'] . $value . $this->options['suffix']);
- }
-}
diff --git a/handlers/views_handler_field_prerender_list.inc b/handlers/views_handler_field_prerender_list.inc
deleted file mode 100644
index c04e3d1..0000000
--- a/handlers/views_handler_field_prerender_list.inc
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
-/**
- * Field handler to provide a list of items.
- *
- * The items are expected to be loaded by a child object during pre_render,
- * and 'my field' is expected to be the pointer to the items in the list.
- *
- * Items to render should be in a list in $this->items
- *
- * @ingroup views_field_handlers
- */
-class views_handler_field_prerender_list extends views_handler_field {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['type'] = array('default' => 'separator');
- $options['separator'] = array('default' => ', ');
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $form['type'] = array(
- '#type' => 'radios',
- '#title' => t('Display type'),
- '#options' => array(
- 'ul' => t('Unordered list'),
- 'ol' => t('Ordered list'),
- 'separator' => t('Simple separator'),
- ),
- '#default_value' => $this->options['type'],
- );
-
- $form['separator'] = array(
- '#type' => 'textfield',
- '#title' => t('Separator'),
- '#default_value' => $this->options['separator'],
- '#process' => array('views_process_dependency'),
- '#dependency' => array('radio:options[type]' => array('separator')),
- );
- }
-
- /**
- * Render the field.
- *
- * This function is deprecated, but left in for older systems that have not
- * yet or won't update their prerender list fields. If a render_item method
- * exists, this will not get used by advanced_render.
- */
- function render($values) {
- $field = $values->{$this->field_alias};
- if (!empty($this->items[$field])) {
- if ($this->options['type'] == 'separator') {
- return implode(check_plain($this->options['separator']), $this->items[$field]);
- }
- else {
- return theme('item_list', $this->items[$field], NULL, $this->options['type']);
- }
- }
- }
-
- /**
- * Render all items in this field together.
- *
- * When using advanced render, each possible item in the list is rendered
- * individually. Then the items are all pasted together.
- */
- function render_items($items) {
- if (!empty($items)) {
- if ($this->options['type'] == 'separator') {
- return implode(check_plain($this->options['separator']), $items);
- }
- else {
- return theme('item_list', $items, NULL, $this->options['type']);
- }
- }
- }
-
- /**
- * Return an array of items for the field.
- *
- * Items should be stored in the result array, if possible, as an array
- * with 'value' as the actual displayable value of the item, plus
- * any items that might be found in the 'alter' options array for
- * creating links, such as 'path', 'fragment', 'query' etc, such a thing
- * is to be made. Additionally, items that might be turned into tokens
- * should also be in this array.
- */
- function get_items($values) {
- $field = $values->{$this->field_alias};
- if (!empty($this->items[$field])) {
- return $this->items[$field];
- }
-
- return array();
- }
-
- /**
- * Determine if advanced rendering is allowed.
- *
- * By default, advanced rendering will NOT be allowed if the class
- * inheriting from this does not implement a 'render_items' method.
- */
- function allow_advanced_render() {
- // Note that the advanced render bits also use the presence of
- // this method to determine if it needs to render items as a list.
- return method_exists($this, 'render_item');
- }
-}
diff --git a/handlers/views_handler_field_url.inc b/handlers/views_handler_field_url.inc
deleted file mode 100644
index cb27165..0000000
--- a/handlers/views_handler_field_url.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-/**
- * Field handler to provide simple renderer that turns a URL into a clickable link.
- *
- * @ingroup views_field_handlers
- */
-class views_handler_field_url extends views_handler_field {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['display_as_link'] = array('default' => TRUE);
-
- return $options;
- }
-
- /**
- * Provide link to the page being visited.
- */
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $form['display_as_link'] = array(
- '#title' => t('Display as link'),
- '#type' => 'checkbox',
- '#default_value' => !empty($this->options['display_as_link']),
- );
- }
-
- function render($values) {
- $value = $values->{$this->field_alias};
- if (!empty($this->options['display_as_link'])) {
- return l(check_plain($value), $value, array('html' => TRUE));
- }
- else {
- return $value;
- }
- }
-}
diff --git a/handlers/views_handler_filter.inc b/handlers/views_handler_filter.inc
deleted file mode 100644
index 7fb59d3..0000000
--- a/handlers/views_handler_filter.inc
+++ /dev/null
@@ -1,613 +0,0 @@
-<?php
-/**
- * @defgroup views_filter_handlers Views' filter handlers
- * @{
- * Handlers to tell Views how to filter queries.
- *
- * Definition items:
- * - allow empty: If true, the 'IS NULL' and 'IS NOT NULL' operators become
- * available as standard operators.
- * -
- */
-
-/**
- * Base class for filters.
- */
-class views_handler_filter extends views_handler {
- /**
- * Provide some extra help to get the operator/value easier to use.
- *
- * This likely has to be overridden by filters which are more complex
- * than simple operator/value.
- */
- function init(&$view, $options) {
- parent::init($view, $options);
-
- $this->operator = $this->options['operator'];
- $this->value = $this->options['value'];
-
- // Compatibility: Set use_operator to true if the old way of using
- // the operator is set and use_operator is NULL (was never set).
- if (!empty($options['exposed']) && !empty($options['expose']['operator']) && !isset($options['expose']['use_operator'])) {
- $this->options['expose']['use_operator'] = TRUE;
- }
-
- // If there are relationships in the view, allow empty should be true
- // so that we can do IS NULL checks on items. Not all filters respect
- // allow empty, but string and numeric do and that covers enough.
- if ($this->view->display_handler->get_option('relationships')) {
- $this->definition['allow empty'] = TRUE;
- }
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['operator'] = array('default' => '=');
- $options['value'] = array('default' => '');
- $options['group'] = array('default' => '0');
- $options['exposed'] = array('default' => FALSE);
- $options['expose'] = array(
- 'contains' => array(
- 'operator' => array('default' => FALSE),
- 'label' => array('default' => '', 'translatable' => TRUE),
- ),
- );
-
- return $options;
- }
-
- /**
- * Display the filter on the administrative summary
- */
- function admin_summary() {
- return check_plain((string) $this->operator) . ' ' . check_plain((string) $this->value);
- }
-
- /**
- * Determine if a filter can be exposed.
- */
- function can_expose() { return TRUE; }
-
- /**
- * Provide the basic form which calls through to subforms.
- * If overridden, it is best to call through to the parent,
- * or to at least make sure all of the functions in this form
- * are called.
- */
- function options_form(&$form, &$form_state) {
- if ($this->can_expose()) {
- $this->show_expose_button($form, $form_state);
- }
- $form['op_val_start'] = array('#value' => '<div class="clear-block">');
- $this->show_operator_form($form, $form_state);
- $this->show_value_form($form, $form_state);
- $form['op_val_end'] = array('#value' => '</div>');
- if ($this->can_expose()) {
- $this->show_expose_form($form, $form_state);
- }
- }
-
- /**
- * Simple validate handler
- */
- function options_validate(&$form, &$form_state) {
- $this->operator_validate($form, $form_state);
- $this->value_validate($form, $form_state);
- if (!empty($this->options['exposed'])) {
- $this->expose_validate($form, $form_state);
- }
-
- }
-
- /**
- * Simple submit handler
- */
- function options_submit(&$form, &$form_state) {
- unset($form_state['values']['expose_button']); // don't store this.
- $this->operator_submit($form, $form_state);
- $this->value_submit($form, $form_state);
- if (!empty($this->options['exposed'])) {
- $this->expose_submit($form, $form_state);
- }
- }
-
- /**
- * Shortcut to display the operator form.
- */
- function show_operator_form(&$form, &$form_state) {
- $this->operator_form($form, $form_state);
- $form['operator']['#prefix'] = '<div class="views-left-30">';
- $form['operator']['#suffix'] = '</div>';
- }
-
- /**
- * Provide a form for setting the operator.
- *
- * This may be overridden by child classes, and it must
- * define $form['operator'];
- */
- function operator_form(&$form, &$form_state) {
- $options = $this->operator_options();
- if (!empty($options)) {
- $form['operator'] = array(
- '#type' => count($options) < 10 ? 'radios' : 'select',
- '#title' => t('Operator'),
- '#default_value' => $this->operator,
- '#options' => $options,
- );
- }
- }
-
- /**
- * Provide a list of options for the default operator form.
- * Should be overridden by classes that don't override operator_form
- */
- function operator_options() { return array(); }
-
- /**
- * Validate the operator form.
- */
- function operator_validate($form, &$form_state) { }
-
- /**
- * Perform any necessary changes to the form values prior to storage.
- * There is no need for this function to actually store the data.
- */
- function operator_submit($form, &$form_state) { }
-
- /**
- * Shortcut to display the value form.
- */
- function show_value_form(&$form, &$form_state) {
- $this->value_form($form, $form_state);
- if (empty($this->no_operator)) {
- $form['value']['#prefix'] = '<div class="views-right-70">' . (isset($form['value']['#prefix']) ? $form['value']['#prefix'] : '');
- $form['value']['#suffix'] = (isset($form['value']['#suffix']) ? $form['value']['#suffix'] : '') . '</div>';
- }
- }
-
- /**
- * Provide a form for setting options.
- *
- * This should be overridden by all child classes and it must
- * define $form['value']
- */
- function value_form(&$form, &$form_state) { $form['value'] = array(); }
-
- /**
- * Validate the options form.
- */
- function value_validate($form, &$form_state) { }
-
- /**
- * Perform any necessary changes to the form values prior to storage.
- * There is no need for this function to actually store the data.
- */
- function value_submit($form, &$form_state) { }
-
- /**
- * Shortcut to display the expose/hide button.
- */
- function show_expose_button(&$form, &$form_state) {
- $form['expose_button'] = array(
- '#prefix' => '<div class="views-expose clear-block">',
- '#suffix' => '</div>',
- );
- if (empty($this->options['exposed'])) {
- $form['expose_button']['button'] = array(
- '#type' => 'submit',
- '#value' => t('Expose'),
- '#submit' => array('views_ui_config_item_form_expose'),
- );
- $form['expose_button']['markup'] = array(
- '#prefix' => '<div class="description">',
- '#value' => t('This item is currently not exposed. If you <strong>expose</strong> it, users will be able to change the filter as they view it.'),
- '#suffix' => '</div>',
- );
- }
- else {
- $form['expose_button']['button'] = array(
- '#type' => 'submit',
- '#value' => t('Hide'),
- '#submit' => array('views_ui_config_item_form_expose'),
- );
- $form['expose_button']['markup'] = array(
- '#prefix' => '<div class="description">',
- '#value' => t('This item is currently exposed. If you <strong>hide</strong> it, users will not be able to change the filter as they view it.'),
- '#suffix' => '</div>',
- );
- }
- }
-
- /**
- * Shortcut to display the exposed options form.
- */
- function show_expose_form(&$form, &$form_state) {
- if (empty($this->options['exposed'])) {
- return;
- }
-
- $form['expose'] = array(
- '#prefix' => '<div class="views-expose-options clear-block">',
- '#suffix' => '</div>',
- );
- $this->expose_form($form, $form_state);
-
- // When we click the expose button, we add new gadgets to the form but they
- // have no data in $_POST so their defaults get wiped out. This prevents
- // these defaults from getting wiped out. This setting will only be TRUE
- // during a 2nd pass rerender.
- if (!empty($form_state['force_expose_options'])) {
- foreach (element_children($form['expose']) as $id) {
- if (isset($form['expose'][$id]['#default_value']) && !isset($form['expose'][$id]['#value'])) {
- $form['expose'][$id]['#value'] = $form['expose'][$id]['#default_value'];
- }
- }
- }
- }
-
- /**
- * Overridable form for exposed filter options.
- *
- * If overridden, it is best to call the parent or re-implement
- * the stuff here.
- *
- * Many filters will need to override this in order to provide options
- * that are nicely tailored to the given filter.
- */
- function expose_form(&$form, &$form_state) {
- $form['expose']['start_left'] = array(
- '#value' => '<div class="views-left-50">',
- );
-
- $this->expose_form_left($form, $form_state);
-
- $form['expose']['end_left'] = array(
- '#value' => '</div>',
- );
-
- $form['expose']['start_checkboxes'] = array(
- '#value' => '<div class="form-checkboxes views-left-40 clear-block">',
- );
-
- $this->expose_form_right($form, $form_state);
-
- $form['expose']['end_checkboxes'] = array(
- '#value' => '</div>',
- );
- }
-
- /**
- * Handle the 'left' side fo the exposed options form.
- */
- function expose_form_left(&$form, &$form_state) {
- if (!empty($form['operator']['#type'])) {
- $form['expose']['use_operator'] = array(
- '#type' => 'checkbox',
- '#title' => t('Unlock operator'),
- '#description' => t('When checked, the operator will be exposed to the user'),
- '#default_value' => !empty($this->options['expose']['use_operator']),
- );
- $form['expose']['operator'] = array(
- '#type' => 'textfield',
- '#default_value' => $this->options['expose']['operator'],
- '#title' => t('Operator identifier'),
- '#size' => 40,
- '#description' => t('This will appear in the URL after the ? to identify this operator.'),
- '#process' => array('views_process_dependency'),
- '#dependency' => array(
- 'edit-options-expose-use-operator' => array(1)
- ),
- );
- }
- else {
- $form['expose']['operator'] = array(
- '#type' => 'value',
- '#value' => '',
- );
- }
-
- $form['expose']['identifier'] = array(
- '#type' => 'textfield',
- '#default_value' => $this->options['expose']['identifier'],
- '#title' => t('Filter identifier'),
- '#size' => 40,
- '#description' => t('This will appear in the URL after the ? to identify this filter. Cannot be blank.'),
- );
- $form['expose']['label'] = array(
- '#type' => 'textfield',
- '#default_value' => $this->options['expose']['label'],
- '#title' => t('Label'),
- '#size' => 40,
- );
- }
-
- /**
- * Handle the 'right' side fo the exposed options form.
- */
- function expose_form_right(&$form, &$form_state) {
- $form['expose']['optional'] = array(
- '#type' => 'checkbox',
- '#title' => t('Optional'),
- '#description' => t('This exposed filter is optional and will have added options to allow it not to be set.'),
- '#default_value' => $this->options['expose']['optional'],
- );
- if (empty($this->no_single)) {
- $form['expose']['single'] = array(
- '#type' => 'checkbox',
- '#title' => t('Force single'),
- '#description' => t('Force this exposed filter to accept only one option.'),
- '#default_value' => $this->options['expose']['single'],
- );
- }
- $form['expose']['remember'] = array(
- '#type' => 'checkbox',
- '#title' => t('Remember'),
- '#description' => t('Remember the last setting the user gave this filter.'),
- '#default_value' => $this->options['expose']['remember'],
- );
- }
-
- /**
- * Validate the options form.
- */
- function expose_validate($form, &$form_state) {
- if (empty($this->options['expose']['identifier'])) {
- if (empty($form_state['values']['options']['expose']['identifier'])) {
- form_error($form['expose']['identifier'], t('The identifier is required if the filter is exposed.'));
- }
- }
-
- if (!empty($form_state['values']['options']['expose']['identifier']) && $form_state['values']['options']['expose']['identifier'] == 'value') {
- form_error($form['expose']['identifier'], t('This identifier is not allowed.'));
- }
- }
-
- /**
- * Perform any necessary changes to the form exposes prior to storage.
- * There is no need for this function to actually store the data.
- */
- function expose_submit($form, &$form_state) { }
-
- /**
- * Provide default options for exposed filters.
- */
- function expose_options() {
- $this->options['expose'] = array(
- 'use_operator' => FALSE,
- 'operator' => $this->options['id'] . '_op',
- 'identifier' => $this->options['id'],
- 'label' => $this->ui_name(),
- 'remember' => FALSE,
- 'single' => TRUE,
- 'optional' => TRUE,
- );
- }
-
- /**
- * Render our chunk of the exposed filter form when selecting
- *
- * You can override this if it doesn't do what you expect.
- */
- function exposed_form(&$form, &$form_state) {
- if (empty($this->options['exposed'])) {
- return;
- }
-
- if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator'])) {
- $operator = $this->options['expose']['operator'];
- $this->operator_form($form, $form_state);
- $form[$operator] = $form['operator'];
-
- if (isset($form[$operator]['#title'])) {
- unset($form[$operator]['#title']);
- }
-
- $this->exposed_translate($form[$operator], 'operator');
-
- unset($form['operator']);
- }
-
- if (!empty($this->options['expose']['identifier'])) {
- $value = $this->options['expose']['identifier'];
- $this->value_form($form, $form_state);
- $form[$value] = $form['value'];
-
- if (isset($form[$value]['#title']) && !empty($form[$value]['#type']) && $form[$value]['#type'] != 'checkbox') {
- unset($form[$value]['#title']);
- }
-
- $this->exposed_translate($form[$value], 'value');
-
- if (!empty($form['#type']) && ($form['#type'] == 'checkboxes' || ($form['#type'] == 'select' && !empty($form['#multiple'])))) {
- unset($form[$value]['#default_value']);
- }
-
- if (!empty($form['#type']) && $form['#type'] == 'select' && empty($form['#multiple'])) {
- $form[$value]['#default_value'] = 'All';
- }
-
- if ($value != 'value') {
- unset($form['value']);
- }
- }
- }
-
- /**
- * Make some translations to a form item to make it more suitable to
- * exposing.
- */
- function exposed_translate(&$form, $type) {
- if (!isset($form['#type'])) {
- return;
- }
-
- if ($form['#type'] == 'radios') {
- $form['#type'] = 'select';
- }
- // Checkboxes don't work so well in exposed forms due to GET conversions.
- if ($form['#type'] == 'checkboxes') {
- if (empty($form['#no_convert']) || !empty($this->options['expose']['single'])) {
- $form['#type'] = 'select';
- }
- if (empty($this->options['expose']['single'])) {
- $form['#multiple'] = TRUE;
- }
- }
- if (!empty($this->options['expose']['single']) && isset($form['#multiple'])) {
- unset($form['#multiple']);
- $form['#size'] = NULL;
- }
-
- if ($type == 'value' && !empty($this->options['expose']['optional']) && $form['#type'] == 'select' && empty($form['#multiple'])) {
- $any_label = variable_get('views_exposed_filter_any_label', 'old_any') == 'old_any' ? t('<Any>') : t('- Any -');
- $form['#options'] = array('All' => $any_label) + $form['#options'];
- $form['#default_value'] = 'All';
- }
- }
-
- /**
- * Tell the renderer about our exposed form. This only needs to be
- * overridden for particularly complex forms. And maybe not even then.
- */
- function exposed_info() {
- if (empty($this->options['exposed'])) {
- return;
- }
-
- return array(
- 'operator' => $this->options['expose']['operator'],
- 'value' => $this->options['expose']['identifier'],
- 'label' => $this->options['expose']['label'],
- );
- }
-
- /**
- * Check to see if input from the exposed filters should change
- * the behavior of this filter.
- */
- function accept_exposed_input($input) {
- if (empty($this->options['exposed'])) {
- return TRUE;
- }
-
-
- if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator']) && isset($input[$this->options['expose']['operator']])) {
- $this->operator = $input[$this->options['expose']['operator']];
- }
-
- if (!empty($this->options['expose']['identifier'])) {
- $value = $input[$this->options['expose']['identifier']];
-
- // Various ways to check for the absence of optional input.
- if (!empty($this->options['expose']['optional'])) {
- if ($value == 'All' || $value === array()) {
- return FALSE;
- }
-
- if (!empty($this->no_single) && $value === '') {
- return FALSE;
- }
- }
-
-
- if (isset($value)) {
- $this->value = $value;
- if (!empty($this->options['expose']['single'])) {
- $this->value = array($value);
- }
- }
- else {
- return FALSE;
- }
- }
-
- return TRUE;
- }
-
- function store_exposed_input($input, $status) {
- if (empty($this->options['exposed']) || empty($this->options['expose']['identifier'])) {
- return TRUE;
- }
-
- if (empty($this->options['expose']['remember'])) {
- return;
- }
-
- // Figure out which display id is responsible for the filters, so we
- // know where to look for session stored values.
- $display_id = ($this->view->display_handler->is_defaulted('filters')) ? 'default' : $this->view->current_display;
-
- // shortcut test.
- $operator = !empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator']);
-
- // false means that we got a setting that means to recuse ourselves,
- // so we should erase whatever happened to be there.
- if (!$status && isset($_SESSION['views'][$this->view->name][$display_id])) {
- $session = &$_SESSION['views'][$this->view->name][$display_id];
- if ($operator && isset($session[$this->options['expose']['operator']])) {
- unset($session[$this->options['expose']['operator']]);
- }
-
- if (isset($session[$this->options['expose']['identifier']])) {
- unset($session[$this->options['expose']['identifier']]);
- }
- }
-
- if ($status) {
- if (!isset($_SESSION['views'][$this->view->name][$display_id])) {
- $_SESSION['views'][$this->view->name][$display_id] = array();
- }
-
- $session = &$_SESSION['views'][$this->view->name][$display_id];
-
- if ($operator && isset($input[$this->options['expose']['operator']])) {
- $session[$this->options['expose']['operator']] = $input[$this->options['expose']['operator']];
- }
-
- $session[$this->options['expose']['identifier']] = $input[$this->options['expose']['identifier']];
- }
- }
-
- /**
- * Add this filter to the query.
- *
- * Due to the nature of fapi, the value and the operator have an unintended
- * level of indirection. You will find them in $this->operator
- * and $this->value respectively.
- */
- function query() {
- $this->ensure_my_table();
- $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . $this->operator . " '%s'", $this->value);
- }
-}
-
-
-/**
- * A special handler to take the place of missing or broken handlers.
- */
-class views_handler_filter_broken extends views_handler_filter {
- function ui_name($short = FALSE) {
- return t('Broken/missing handler');
- }
-
- function ensure_my_table() { /* No table to ensure! */ }
- function query() { /* No query to run */ }
- function options_form(&$form, &$form_state) {
- $form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
- '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
- );
- }
-
- /**
- * Determine if the handler is considered 'broken'
- */
- function broken() { return TRUE; }
-}
-
-
-/**
- * @}
- */
diff --git a/handlers/views_handler_filter_boolean_operator.inc b/handlers/views_handler_filter_boolean_operator.inc
deleted file mode 100644
index 45b6cae..0000000
--- a/handlers/views_handler_filter_boolean_operator.inc
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-/**
- * Simple filter to handle matching of boolean values
- *
- * Definition items:
- * - label: (REQUIRED) The label for the checkbox.
- * - type: For basic 'true false' types, an item can specify the following:
- * - true-false: True/false (this is the default)
- * - yes-no: Yes/No
- * - on-off: On/Off
- */
-class views_handler_filter_boolean_operator extends views_handler_filter {
- // exposed filter options
- var $no_single = TRUE;
- // Don't display empty space where the operator would be.
- var $no_operator = TRUE;
- // Whether to accept NULL as a false value or not
- var $accept_null = FALSE;
-
- function construct() {
- $this->value_value = t('True');
- if (isset($this->definition['label'])) {
- $this->value_value = $this->definition['label'];
- }
- if (isset($this->definition['accept_null'])) {
- $this->accept_null = (bool) $this->definition['accept null'];
- }
- $this->value_options = NULL;
- parent::construct();
- }
-
- /**
- * Return the possible options for this filter.
- *
- * Child classes should override this function to set the possible values
- * for the filter. Since this is a boolean filter, the array should have
- * two possible keys: 1 for "True" and 0 for "False", although the labels
- * can be whatever makes sense for the filter. These values are used for
- * configuring the filter, when the filter is exposed, and in the admin
- * summary of the filter. Normally, this should be static data, but if it's
- * dynamic for some reason, child classes should use a guard to reduce
- * database hits as much as possible.
- */
- function get_value_options() {
- if (isset($this->definition['type'])) {
- if ($this->definition['type'] == 'yes-no') {
- $this->value_options = array(1 => t('Yes'), 0 => t('No'));
- }
- if ($this->definition['type'] == 'on-off') {
- $this->value_options = array(1 => t('On'), 0 => t('Off'));
- }
- }
-
- // Provide a fallback if the above didn't set anything.
- if (!isset($this->value_options)) {
- $this->value_options = array(1 => t('True'), 0 => t('False'));
- }
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['value']['default'] = FALSE;
-
- return $options;
- }
-
- function operator_form(&$form, &$form_state) {
- $form['operator'] = array();
- }
-
- function value_form(&$form, &$form_state) {
- if (empty($this->value_options)) {
- // Initialize the array of possible values for this filter.
- $this->get_value_options();
- }
- if (!empty($form_state['exposed'])) {
- // Exposed filter: use a select box to save space.
- $filter_form_type = 'select';
- }
- else {
- // Configuring a filter: use radios for clarity.
- $filter_form_type = 'radios';
- }
- $form['value'] = array(
- '#type' => $filter_form_type,
- '#title' => $this->value_value,
- '#options' => $this->value_options,
- '#default_value' => $this->value,
- );
- if (!empty($this->options['exposed'])) {
- $identifier = $this->options['expose']['identifier'];
- if (!isset($form_state['input'][$identifier])) {
- $form_state['input'][$identifier] = $this->value;
- }
- // If we're configuring an exposed filter, add an <Any> option.
- $any_label = variable_get('views_exposed_filter_any_label', 'old_any') == 'old_any' ? t('<Any>') : t('- Any -');
- if ($form['value']['#type'] != 'select') {
- $any_label = check_plain($any_label);
- }
- $form['value']['#options'] = array('All' => $any_label) + $form['value']['#options'];
- }
- }
-
- function value_validate(&$form, &$form_state) {
- if ($form_state['values']['options']['value'] == 'All' && empty($form_state['values']['options']['expose']['optional'])) {
- form_set_error('value', t('You must select a value unless this is an optional exposed filter.'));
- }
- }
-
- function admin_summary() {
- if (!empty($this->options['exposed'])) {
- return t('exposed');
- }
- if (empty($this->value_options)) {
- $this->get_value_options();
- }
- // Now that we have the valid options for this filter, just return the
- // human-readable label based on the current value. The value_options
- // array is keyed with either 0 or 1, so if the current value is not
- // empty, use the label for 1, and if it's empty, use the label for 0.
- return $this->value_options[!empty($this->value)];
- }
-
- function expose_options() {
- parent::expose_options();
- $this->options['expose']['operator'] = '';
- $this->options['expose']['label'] = $this->value_value;
- $this->options['expose']['optional'] = FALSE;
- }
-
- function query() {
- $this->ensure_my_table();
-
- $where = "$this->table_alias.$this->real_field ";
-
- if (empty($this->value)) {
- $where .= '= 0';
- if ($this->accept_null) {
- $where = '(' . $where . " OR $this->table_alias.$this->real_field IS NULL)";
- }
- }
- else {
- $where .= '<> 0';
- }
- $this->query->add_where($this->options['group'], $where);
- }
-}
diff --git a/handlers/views_handler_filter_boolean_operator_string.inc b/handlers/views_handler_filter_boolean_operator_string.inc
deleted file mode 100644
index bd7bd87..0000000
--- a/handlers/views_handler_filter_boolean_operator_string.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * Simple filter to handle matching of boolean values.
- *
- * This handler checks to see if a string field is empty (equal to '') or not.
- * It is otherwise identical to the parent operator.
- *
- * Definition items:
- * - label: (REQUIRED) The label for the checkbox.
- */
-class views_handler_filter_boolean_operator_string extends views_handler_filter_boolean_operator {
- function query() {
- $this->ensure_my_table();
- $where = "$this->table_alias.$this->real_field ";
-
- if (empty($this->value)) {
- $where .= "= ''";
- if ($this->accept_null) {
- $where = '(' . $where . " OR $this->table_alias.$this->real_field IS NULL)";
- }
- }
- else {
- $where .= "<> ''";
- }
- $this->query->add_where($this->options['group'], $where);
- }
-}
diff --git a/handlers/views_handler_filter_date.inc b/handlers/views_handler_filter_date.inc
deleted file mode 100644
index fd9b3d3..0000000
--- a/handlers/views_handler_filter_date.inc
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-
-/**
- * Filter to handle dates stored as a timestamp.
- */
-class views_handler_filter_date extends views_handler_filter_numeric {
- function option_definition() {
- $options = parent::option_definition();
-
- // value is already set up properly, we're just adding our new field to it.
- $options['value']['type']['default'] = 'date';
-
- return $options;
- }
-
- /**
- * Add a type selector to the value form
- */
- function value_form(&$form, &$form_state) {
- if (empty($form_state['exposed'])) {
- $form['value']['type'] = array(
- '#type' => 'radios',
- '#title' => t('Value type'),
- '#options' => array(
- 'date' => t('A date in any machine readable format. CCYY-MM-DD HH:MM:SS is preferred.'),
- 'offset' => t('An offset from the current time such as "+1 day" or "-2 hours and 30 minutes"'),
- ),
- '#default_value' => !empty($this->value['type']) ? $this->value['type'] : 'date',
- );
- }
- parent::value_form($form, $form_state);
- }
-
- function options_validate(&$form, &$form_state) {
- parent::options_validate($form, $form_state);
-
- if (!empty($form_state['values']['options']['expose']['optional'])) {
- // Who cares what the value is if it's exposed and optional.
- return;
- }
-
- $this->validate_valid_time($form['value'], $form_state['values']['options']['operator'], $form_state['values']['options']['value']);
- }
-
- function exposed_validate(&$form, &$form_state) {
- if (empty($this->options['exposed'])) {
- return;
- }
-
- if (!empty($this->options['expose']['optional'])) {
- // Who cares what the value is if it's exposed and optional.
- return;
- }
-
- $value = &$form_state['values'][$this->options['expose']['identifier']];
- if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator'])) {
- $operator = $form_state['values'][$this->options['expose']['operator']];
- }
- else {
- $operator = $this->operator;
- }
-
- $this->validate_valid_time($this->options['expose']['identifier'], $operator, $value);
-
- }
-
- /**
- * Validate that the time values convert to something usable.
- */
- function validate_valid_time(&$form, $operator, $value) {
- $operators = $this->operators();
-
- if ($operators[$operator]['values'] == 1) {
- $convert = strtotime($value['value']);
- if ($convert == -1 || $convert === FALSE) {
- form_error($form['value'], t('Invalid date format.'));
- }
- }
- elseif ($operators[$operator]['values'] == 2) {
- $min = strtotime($value['min']);
- if ($min == -1 || $min === FALSE) {
- form_error($form['min'], t('Invalid date format.'));
- }
- $max = strtotime($value['max']);
- if ($max == -1 || $max === FALSE) {
- form_error($form['max'], t('Invalid date format.'));
- }
- }
- }
-
- function accept_exposed_input($input) {
- if (empty($this->options['exposed'])) {
- return TRUE;
- }
-
- // Store this because it will get overwritten.
- $type = $this->value['type'];
- $rc = parent::accept_exposed_input($input);
-
- // Don't filter if value(s) are empty.
- $operators = $this->operators();
- if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator'])) {
- $operator = $input[$this->options['expose']['operator']];
- }
- else {
- $operator = $this->operator;
- }
-
- if ($operators[$operator]['values'] == 1) {
- if ($this->value['value'] == '') {
- return FALSE;
- }
- }
- else {
- if ($this->value['min'] == '' || $this->value['max'] == '') {
- return FALSE;
- }
- }
-
- // restore what got overwritten by the parent.
- $this->value['type'] = $type;
- return $rc;
- }
-
- function op_between($field) {
- if ($this->operator == 'between') {
- $a = intval(strtotime($this->value['min'], 0));
- $b = intval(strtotime($this->value['max'], 0));
- }
- else {
- $a = intval(strtotime($this->value['max'], 0));
- $b = intval(strtotime($this->value['min'], 0));
- }
-
- if ($this->value['type'] == 'offset') {
- $a = '***CURRENT_TIME***' . sprintf('%+d', $a); // keep sign
- $b = '***CURRENT_TIME***' . sprintf('%+d', $b); // keep sign
- }
- // %s is safe here because strtotime scrubbed the input and we might
- // have a string if using offset.
- $this->query->add_where($this->options['group'], "$field >= %s", $a);
- $this->query->add_where($this->options['group'], "$field <= %s", $b);
- }
-
- function op_simple($field) {
- $value = intval(strtotime($this->value['value'], 0));
- if (!empty($this->value['type']) && $this->value['type'] == 'offset') {
- $value = '***CURRENT_TIME***' . sprintf('%+d', $value); // keep sign
- }
- $this->query->add_where($this->options['group'], "$field $this->operator %s", $value);
- }
-}
diff --git a/handlers/views_handler_filter_equality.inc b/handlers/views_handler_filter_equality.inc
deleted file mode 100644
index 95ccaba..0000000
--- a/handlers/views_handler_filter_equality.inc
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * Simple filter to handle equal to / not equal to filters
- */
-class views_handler_filter_equality extends views_handler_filter {
- // exposed filter options
- var $no_single = TRUE;
-
- /**
- * Provide simple equality operator
- */
- function operator_options() {
- return array(
- '=' => t('Is equal to'),
- '!=' => t('Is not equal to'),
- );
- }
-
- /**
- * Provide a simple textfield for equality
- */
- function value_form(&$form, &$form_state) {
- $form['value'] = array(
- '#type' => 'textfield',
- '#title' => t('Value'),
- '#size' => 30,
- '#default_value' => $this->value,
- );
-
- if (!empty($form_state['exposed'])) {
- $identifier = $this->options['expose']['identifier'];
- if (!isset($form_state['input'][$identifier])) {
- $form_state['input'][$identifier] = $this->value;
- }
- }
- }
-}
-
diff --git a/handlers/views_handler_filter_float.inc b/handlers/views_handler_filter_float.inc
deleted file mode 100644
index d96f121..0000000
--- a/handlers/views_handler_filter_float.inc
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
- * Simple filter to handle greater than/less than filters.
- * It based on views_handler_filter_numeric but deals with
- * float numbers.
- */
-class views_handler_filter_float extends views_handler_filter_numeric {
- function op_between($field) {
- if ($this->operator == 'between') {
- $this->query->add_where($this->options['group'], "$field >= %f", $this->value['min']);
- $this->query->add_where($this->options['group'], "$field <= %f", $this->value['max']);
- }
- else {
- $this->query->add_where($this->options['group'], "$field <= %f OR $field >= %f", $this->value['min'], $this->value['max']);
- }
- }
-
- function op_simple($field) {
- $this->query->add_where($this->options['group'], "$field $this->operator %f", $this->value['value']);
- }
-}
diff --git a/handlers/views_handler_filter_in_operator.inc b/handlers/views_handler_filter_in_operator.inc
deleted file mode 100644
index c06a251..0000000
--- a/handlers/views_handler_filter_in_operator.inc
+++ /dev/null
@@ -1,359 +0,0 @@
-<?php
-/**
- * Simple filter to handle matching of multiple options selectable via checkboxes
- *
- * Definition items:
- * - numeric: If set to true, this item will use numeric operators instead of string.
- *
- */
-class views_handler_filter_in_operator extends views_handler_filter {
- var $value_form_type = 'checkboxes';
-
- function construct() {
- parent::construct();
- $this->value_title = t('Options');
- $this->value_options = NULL;
- }
-
- /**
- * Child classes should be used to override this function and set the
- * 'value options', unless 'options callback' is defined as a valid function
- * or static public method to generate these values.
- *
- * This can use a guard to be used to reduce database hits as much as
- * possible.
- */
- function get_value_options() {
- if (isset($this->value_options)) {
- return;
- }
-
- if (isset($this->definition['options callback']) && is_callable($this->definition['options callback'])) {
- $this->value_options = call_user_func($this->definition['options callback']);
- }
- else {
- $this->value_options = array(t('Yes'), t('No'));
- }
- }
-
- function expose_options() {
- parent::expose_options();
- $this->options['expose']['reduce'] = FALSE;
- }
-
- function expose_form_right(&$form, &$form_state) {
- parent::expose_form_right($form, $form_state);
- $form['expose']['reduce'] = array(
- '#type' => 'checkbox',
- '#title' => t('Limit list to selected items'),
- '#description' => t('If checked, the only items presented to the user will be the ones selected here.'),
- '#default_value' => !empty($this->options['expose']['reduce']), // safety
- );
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['operator']['default'] = 'in';
- $options['value']['default'] = array();
-
- return $options;
- }
-
- /**
- * This kind of construct makes it relatively easy for a child class
- * to add or remove functionality by overriding this function and
- * adding/removing items from this array.
- */
- function operators() {
- $operators = array(
- 'in' => array(
- 'title' => t('Is one of'),
- 'short' => t('in'),
- 'short_single' => t('='),
- 'method' => 'op_simple',
- 'values' => 1,
- ),
- 'not in' => array(
- 'title' => t('Is not one of'),
- 'short' => t('not in'),
- 'short_single' => t('<>'),
- 'method' => 'op_simple',
- 'values' => 1,
- ),
- );
- // if the definition allows for the empty operator, add it.
- if (!empty($this->definition['allow empty'])) {
- $operators += array(
- 'empty' => array(
- 'title' => t('Is empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('empty'),
- 'values' => 0,
- ),
- 'not empty' => array(
- 'title' => t('Is not empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('not empty'),
- 'values' => 0,
- ),
- );
- }
-
- return $operators;
- }
-
- /**
- * Build strings from the operators() for 'select' options
- */
- function operator_options($which = 'title') {
- $options = array();
- foreach ($this->operators() as $id => $info) {
- $options[$id] = $info[$which];
- }
-
- return $options;
- }
-
- function operator_values($values = 1) {
- $options = array();
- foreach ($this->operators() as $id => $info) {
- if (isset($info['values']) && $info['values'] == $values) {
- $options[] = $id;
- }
- }
-
- return $options;
- }
-
- function value_form(&$form, &$form_state) {
- $form['value'] = array();
-
- $this->get_value_options();
- $options = $this->value_options;
- $default_value = (array) $this->value;
-
- $which = 'all';
- if (!empty($form['operator'])) {
- $source = ($form['operator']['#type'] == 'radios') ? 'radio:options[operator]' : 'edit-options-operator';
- }
- if (!empty($form_state['exposed'])) {
- $identifier = $this->options['expose']['identifier'];
-
- if (empty($this->options['expose']['use_operator']) || empty($this->options['expose']['operator'])) {
- // exposed and locked.
- $which = in_array($this->operator, $this->operator_values(1)) ? 'value' : 'none';
- }
- else {
- $source = 'edit-' . form_clean_id($this->options['expose']['operator']);
- }
-
- if (!empty($this->options['expose']['reduce'])) {
- $options = $this->reduce_value_options();
-
- if (empty($this->options['expose']['single']) && !empty($this->options['expose']['optional'])) {
- $default_value = array();
- }
- }
-
- if (!empty($this->options['expose']['single'])) {
- if (!empty($this->options['expose']['optional']) && (empty($default_value) || !empty($this->options['expose']['reduce']))) {
- $default_value = 'All';
- }
- else if (empty($default_value)) {
- $keys = array_keys($options);
- $default_value = array_shift($keys);
- }
- else {
- $copy = $default_value;
- $default_value = array_shift($copy);
- }
- }
- }
-
- if ($which == 'all' || $which == 'value') {
- $form['value'] = array(
- '#type' => $this->value_form_type,
- '#title' => $this->value_title,
- '#options' => $options,
- '#default_value' => $default_value,
- // These are only valid for 'select' type, but do no harm to checkboxes.
- '#multiple' => TRUE,
- '#size' => count($options) > 8 ? 8 : count($options),
- );
- if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier])) {
- $form_state['input'][$identifier] = $default_value;
- }
-
- $process = array();
- if ($this->value_form_type == 'checkboxes') {
- // If this form element will use checkboxes in the UI, we need to
- // check_plain() all the options ourselves since FAPI is inconsistent
- // about this. However, instead of directly doing that to the #options
- // right now, we define a #process callback since we might change our
- // mind later and convert this into a 'select' form element, which
- // would lead to double-escaping the options.
- $process[] = 'views_process_check_options';
- }
- if ($which == 'all') {
- if (empty($form_state['exposed']) && ($this->value_form_type == 'checkboxes' || $this->value_form_type == 'radios')) {
- $process[] = "expand_$this->value_form_type";
- $form['value']['#prefix'] = '<div id="edit-options-value-wrapper">';
- $form['value']['#suffix'] = '</div>';
- }
- $process[] = 'views_process_dependency';
- $form['value']['#dependency'] = array($source => $this->operator_values(1));
- }
- if (!empty($process)) {
- $form['value']['#process'] = $process;
- }
- }
- }
-
- /**
- * When using exposed filters, we may be required to reduce the set.
- */
- function reduce_value_options($input = NULL) {
- if (!isset($input)) {
- $input = $this->value_options;
- }
-
- // Because options may be an array of strings, or an array of mixed arrays
- // and strings (optgroups) or an array of objects, we have to
- // step through and handle each one individually.
- $options = array();
- foreach ($input as $id => $option) {
- if (is_array($option)) {
- $options[$id] = $this->reduce_value_options($option);
- continue;
- }
- else if (is_object($option)) {
- $keys = array_keys($option->option);
- $key = array_shift($keys);
- if (isset($this->options['value'][$key])) {
- $options[$id] = $option;
- }
- }
- else if (isset($this->options['value'][$id])) {
- $options[$id] = $option;
- }
- }
- return $options;
- }
-
- function accept_exposed_input($input) {
- // A very special override because the All state for this type of
- // filter could have a default:
- if (empty($this->options['exposed'])) {
- return TRUE;
- }
-
- // If this is single and optional, this says that yes this filter will
- // participate, but using the default settings, *if* 'limit is true.
- if (!empty($this->options['expose']['single']) && !empty($this->options['expose']['optional']) && !empty($this->options['expose']['limit'])) {
- $identifier = $this->options['expose']['identifier'];
- if ($input[$identifier] == 'All') {
- return TRUE;
- }
- }
-
- return parent::accept_exposed_input($input);
- }
-
- function value_submit($form, &$form_state) {
- // Drupal's FAPI system automatically puts '0' in for any checkbox that
- // was not set, and the key to the checkbox if it is set.
- // Unfortunately, this means that if the key to that checkbox is 0,
- // we are unable to tell if that checkbox was set or not.
-
- // Luckily, the '#value' on the checkboxes form actually contains
- // *only* a list of checkboxes that were set, and we can use that
- // instead.
-
- $form_state['values']['options']['value'] = $form['value']['#value'];
-// $form_state['values']['options']['value'] = array_filter($form_state['values']['options']['value']);
- }
-
- function admin_summary() {
- if (!empty($this->options['exposed'])) {
- return t('exposed');
- }
- $info = $this->operators();
-
- $this->get_value_options();
-
- if (!is_array($this->value)) {
- return;
- }
-
- $operator = check_plain($info[$this->operator]['short']);
- $values = '';
- if (in_array($this->operator, $this->operator_values(1))) {
- if (count($this->value) == 1) {
- // If any, use the 'single' short name of the operator instead.
- if (isset($info[$this->operator]['short_single'])) {
- $operator = check_plain($info[$this->operator]['short_single']);
- }
-
- $keys = $this->value;
- $key = array_shift($keys);
- if (isset($this->value_options[$key])) {
- $values = check_plain($this->value_options[$key]);
- }
- else {
- $values = t('Unknown');
- }
- }
- else {
- foreach ($this->value as $value) {
- if ($values !== '') {
- $values .= ', ';
- }
- if (strlen($values) > 8) {
- $values .= '...';
- break;
- }
- $values .= check_plain($this->value_options[$value]);
- }
- }
- }
-
- return $operator . (($values !== '') ? ' ' . $values : '');
- }
-
- function query() {
- $info = $this->operators();
- if (!empty($info[$this->operator]['method'])) {
- $this->{$info[$this->operator]['method']}();
- }
- }
-
- function op_simple() {
- if (empty($this->value)) {
- return;
- }
- $this->ensure_my_table();
- $placeholder = !empty($this->definition['numeric']) ? '%d' : "'%s'";
-
- $replace = array_fill(0, sizeof($this->value), $placeholder);
- $in = ' (' . implode(", ", $replace) . ')';
-
- // We use array_values() because the checkboxes keep keys and that can cause
- // array addition problems.
- $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . $this->operator . $in, array_values($this->value));
- }
-
- function op_empty() {
- $this->ensure_my_table();
- $field = "$this->table_alias.$this->real_field";
-
- if ($this->operator == 'empty') {
- $operator = "IS NULL";
- }
- else {
- $operator = "IS NOT NULL";
- }
-
- $this->query->add_where($this->options['group'], "$field $operator");
- }
-}
diff --git a/handlers/views_handler_filter_many_to_one.inc b/handlers/views_handler_filter_many_to_one.inc
deleted file mode 100644
index 0c3e2f2..0000000
--- a/handlers/views_handler_filter_many_to_one.inc
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-/**
- * Complex filter to handle filtering for many to one relationships,
- * such as terms (many terms per node) or roles (many roles per user).
- *
- * The construct method needs to be overridden to provide a list of options;
- * alternately, the value_form and admin_summary methods need to be overriden
- * to provide something that isn't just a select list.
- */
-class views_handler_filter_many_to_one extends views_handler_filter_in_operator {
- function init(&$view, &$options) {
- parent::init($view, $options);
- $this->helper = new views_many_to_one_helper($this);
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['operator']['default'] = 'or';
- $options['value']['default'] = array();
-
- return $options;
- }
-
- function operators() {
- $operators = array(
- 'or' => array(
- 'title' => t('Is one of'),
- 'short' => t('or'),
- 'short_single' => t('='),
- 'method' => 'op_helper',
- 'values' => 1,
- 'ensure_my_table' => 'helper',
- ),
- 'and' => array(
- 'title' => t('Is all of'),
- 'short' => t('and'),
- 'short_single' => t('='),
- 'method' => 'op_helper',
- 'values' => 1,
- 'ensure_my_table' => 'helper',
- ),
- 'not' => array(
- 'title' => t('Is none of'),
- 'short' => t('not'),
- 'short_single' => t('<>'),
- 'method' => 'op_helper',
- 'values' => 1,
- 'ensure_my_table' => 'helper',
- ),
- );
- // if the definition allows for the empty operator, add it.
- if (!empty($this->definition['allow empty'])) {
- $operators += array(
- 'empty' => array(
- 'title' => t('Is empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('empty'),
- 'values' => 0,
- ),
- 'not empty' => array(
- 'title' => t('Is not empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('not empty'),
- 'values' => 0,
- ),
- );
- }
-
- return $operators;
- }
-
- var $value_form_type = 'select';
- function value_form(&$form, &$form_state) {
- parent::value_form($form, $form_state);
-
- if (empty($form_state['exposed'])) {
- $this->helper->options_form($form, $form_state);
- }
- }
-
- /**
- * Override ensure_my_table so we can control how this joins in.
- * The operator actually has influence over joining.
- */
- function ensure_my_table() {
- // Defer to helper if the operator specifies it.
- $info = $this->operators();
- if (isset($info[$this->operator]['ensure_my_table']) && $info[$this->operator]['ensure_my_table'] == 'helper') {
- return $this->helper->ensure_my_table();
- }
-
- return parent::ensure_my_table();
- }
-
- function op_helper() {
- if (empty($this->value)) {
- return;
- }
- $this->helper->add_filter();
- }
-}
diff --git a/handlers/views_handler_filter_numeric.inc b/handlers/views_handler_filter_numeric.inc
deleted file mode 100644
index 60b1d52..0000000
--- a/handlers/views_handler_filter_numeric.inc
+++ /dev/null
@@ -1,302 +0,0 @@
-<?php
-
-/**
- * Simple filter to handle greater than/less than filters
- */
-class views_handler_filter_numeric extends views_handler_filter {
- var $no_single = TRUE;
- function option_definition() {
- $options = parent::option_definition();
-
- $options['value'] = array(
- 'contains' => array(
- 'min' => array('default' => ''),
- 'max' => array('default' => ''),
- 'value' => array('default' => ''),
- ),
- );
-
- return $options;
- }
-
- function operators() {
- $operators = array(
- '<' => array(
- 'title' => t('Is less than'),
- 'method' => 'op_simple',
- 'short' => t('<'),
- 'values' => 1,
- ),
- '<=' => array(
- 'title' => t('Is less than or equal to'),
- 'method' => 'op_simple',
- 'short' => t('<='),
- 'values' => 1,
- ),
- '=' => array(
- 'title' => t('Is equal to'),
- 'method' => 'op_simple',
- 'short' => t('='),
- 'values' => 1,
- ),
- '!=' => array(
- 'title' => t('Is not equal to'),
- 'method' => 'op_simple',
- 'short' => t('!='),
- 'values' => 1,
- ),
- '>=' => array(
- 'title' => t('Is greater than or equal to'),
- 'method' => 'op_simple',
- 'short' => t('>='),
- 'values' => 1,
- ),
- '>' => array(
- 'title' => t('Is greater than'),
- 'method' => 'op_simple',
- 'short' => t('>'),
- 'values' => 1,
- ),
- 'between' => array(
- 'title' => t('Is between'),
- 'method' => 'op_between',
- 'short' => t('between'),
- 'values' => 2,
- ),
- 'not between' => array(
- 'title' => t('Is not between'),
- 'method' => 'op_between',
- 'short' => t('not between'),
- 'values' => 2,
- ),
- );
-
- // if the definition allows for the empty operator, add it.
- if (!empty($this->definition['allow empty'])) {
- $operators += array(
- 'empty' => array(
- 'title' => t('Is empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('empty'),
- 'values' => 0,
- ),
- 'not empty' => array(
- 'title' => t('Is not empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('not empty'),
- 'values' => 0,
- ),
- );
- }
-
- return $operators;
- }
-
- /**
- * Provide a list of all the numeric operators
- */
- function operator_options($which = 'title') {
- $options = array();
- foreach ($this->operators() as $id => $info) {
- $options[$id] = $info[$which];
- }
-
- return $options;
- }
-
- function operator_values($values = 1) {
- $options = array();
- foreach ($this->operators() as $id => $info) {
- if ($info['values'] == $values) {
- $options[] = $id;
- }
- }
-
- return $options;
- }
- /**
- * Provide a simple textfield for equality
- */
- function value_form(&$form, &$form_state) {
- $form['value']['#tree'] = TRUE;
-
- // We have to make some choices when creating this as an exposed
- // filter form. For example, if the operator is locked and thus
- // not rendered, we can't render dependencies; instead we only
- // render the form items we need.
- $which = 'all';
- if (!empty($form['operator'])) {
- $source = ($form['operator']['#type'] == 'radios') ? 'radio:options[operator]' : 'edit-options-operator';
- }
-
- if (!empty($form_state['exposed'])) {
- $identifier = $this->options['expose']['identifier'];
-
- if (empty($this->options['expose']['use_operator']) || empty($this->options['expose']['operator'])) {
- // exposed and locked.
- $which = in_array($this->operator, $this->operator_values(2)) ? 'minmax' : 'value';
- }
- else {
- $source = 'edit-' . form_clean_id($this->options['expose']['operator']);
- }
- }
-
- if ($which == 'all') {
- $form['value']['value'] = array(
- '#type' => 'textfield',
- '#title' => empty($form_state['exposed']) ? t('Value') : '',
- '#size' => 30,
- '#default_value' => $this->value['value'],
- '#process' => array('views_process_dependency'),
- '#dependency' => array($source => $this->operator_values(1)),
- );
- if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier]['value'])) {
- $form_state['input'][$identifier]['value'] = $this->value['value'];
- }
- }
- else if ($which == 'value') {
- // When exposed we drop the value-value and just do value if
- // the operator is locked.
- $form['value'] = array(
- '#type' => 'textfield',
- '#title' => empty($form_state['exposed']) ? t('Value') : '',
- '#size' => 30,
- '#default_value' => $this->value['value'],
- );
- if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier])) {
- $form_state['input'][$identifier] = $this->value['value'];
- }
- }
-
- if ($which == 'all' || $which == 'minmax') {
- $form['value']['min'] = array(
- '#type' => 'textfield',
- '#title' => empty($form_state['exposed']) ? t('Min') : '',
- '#size' => 30,
- '#default_value' => $this->value['min'],
- );
- $form['value']['max'] = array(
- '#type' => 'textfield',
- '#title' => empty($form_state['exposed']) ? t('And max') : t('And'),
- '#size' => 30,
- '#default_value' => $this->value['max'],
- );
- if ($which == 'all') {
- $dependency = array(
- '#process' => array('views_process_dependency'),
- '#dependency' => array($source => $this->operator_values(2)),
- );
- $form['value']['min'] += $dependency;
- $form['value']['max'] += $dependency;
- }
- if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier]['min'])) {
- $form_state['input'][$identifier]['min'] = $this->value['min'];
- }
- if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier]['max'])) {
- $form_state['input'][$identifier]['max'] = $this->value['max'];
- }
-
- if (!isset($form['value'])) {
- // Ensure there is something in the 'value'.
- $form['value'] = array(
- '#type' => 'value',
- '#value' => NULL
- );
- }
- }
- }
-
- function query() {
- $this->ensure_my_table();
- $field = "$this->table_alias.$this->real_field";
-
- $info = $this->operators();
- if (!empty($info[$this->operator]['method'])) {
- $this->{$info[$this->operator]['method']}($field);
- }
- }
-
- function op_between($field) {
- if ($this->operator == 'between') {
- $this->query->add_where($this->options['group'], "$field >= %d", $this->value['min']);
- $this->query->add_where($this->options['group'], "$field <= %d", $this->value['max']);
- }
- else {
- $this->query->add_where($this->options['group'], "$field <= %d OR $field >= %d", $this->value['min'], $this->value['max']);
- }
- }
-
- function op_simple($field) {
- $this->query->add_where($this->options['group'], "$field $this->operator %d", $this->value['value']);
- }
-
- function op_empty($field) {
- if ($this->operator == 'empty') {
- $operator = "IS NULL";
- }
- else {
- $operator = "IS NOT NULL";
- }
-
- $this->query->add_where($this->options['group'], "$field $operator");
- }
-
- function admin_summary() {
- if (!empty($this->options['exposed'])) {
- return t('exposed');
- }
-
- $options = $this->operator_options('short');
- $output = check_plain($options[$this->operator]);
- if (in_array($this->operator, $this->operator_values(2))) {
- $output .= ' ' . t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));
- }
- elseif (in_array($this->operator, $this->operator_values(1))) {
- $output .= ' ' . check_plain($this->value['value']);
- }
- return $output;
- }
-
- /**
- * Do some minor translation of the exposed input
- */
- function accept_exposed_input($input) {
- if (empty($this->options['exposed'])) {
- return TRUE;
- }
-
- // rewrite the input value so that it's in the correct format so that
- // the parent gets the right data.
- if (!empty($this->options['expose']['identifier'])) {
- $value = &$input[$this->options['expose']['identifier']];
- if (!is_array($value)) {
- $value = array(
- 'value' => $value,
- );
- }
- }
-
- $rc = parent::accept_exposed_input($input);
-
- if (!empty($this->options['expose']['optional'])) {
- // We have to do some of our own optional checking.
- $info = $this->operators();
- if (!empty($info[$this->operator]['values'])) {
- switch ($info[$this->operator]['values']) {
- case 1:
- if ($value['value'] === '') {
- return FALSE;
- }
- break;
- case 2:
- if ($value['min'] === '' && $value['max'] === '') {
- return FALSE;
- }
- break;
- }
- }
- }
-
- return $rc;
- }
-}
diff --git a/handlers/views_handler_filter_string.inc b/handlers/views_handler_filter_string.inc
deleted file mode 100644
index 49fda09..0000000
--- a/handlers/views_handler_filter_string.inc
+++ /dev/null
@@ -1,302 +0,0 @@
-<?php
-
-/**
- * Basic textfield filter to handle string filtering commands
- * including equality, like, not like, etc.
- */
-class views_handler_filter_string extends views_handler_filter {
- // exposed filter options
- var $no_single = TRUE;
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['case'] = array('default' => TRUE);
-
- return $options;
- }
-
- /**
- * This kind of construct makes it relatively easy for a child class
- * to add or remove functionality by overriding this function and
- * adding/removing items from this array.
- */
- function operators() {
- $operators = array(
- '=' => array(
- 'title' => t('Is equal to'),
- 'short' => t('='),
- 'method' => 'op_equal',
- 'values' => 1,
- ),
- '!=' => array(
- 'title' => t('Is not equal to'),
- 'short' => t('!='),
- 'method' => 'op_equal',
- 'values' => 1,
- ),
- 'contains' => array(
- 'title' => t('Contains'),
- 'short' => t('contains'),
- 'method' => 'op_contains',
- 'values' => 1,
- ),
- 'word' => array(
- 'title' => t('Contains any word'),
- 'short' => t('has word'),
- 'method' => 'op_word',
- 'values' => 1,
- ),
- 'allwords' => array(
- 'title' => t('Contains all words'),
- 'short' => t('has all'),
- 'method' => 'op_word',
- 'values' => 1,
- ),
- 'starts' => array(
- 'title' => t('Starts with'),
- 'short' => t('begins'),
- 'method' => 'op_starts',
- 'values' => 1,
- ),
- 'not_starts' => array(
- 'title' => t('Does not start with'),
- 'short' => t('not_begins'),
- 'method' => 'op_not_starts',
- 'values' => 1,
- ),
- 'ends' => array(
- 'title' => t('Ends with'),
- 'short' => t('ends'),
- 'method' => 'op_ends',
- 'values' => 1,
- ),
- 'not_ends' => array(
- 'title' => t('Does not end with'),
- 'short' => t('not_ends'),
- 'method' => 'op_not_ends',
- 'values' => 1,
- ),
- 'not' => array(
- 'title' => t('Does not contain'),
- 'short' => t('!has'),
- 'method' => 'op_not',
- 'values' => 1,
- ),
- );
- // if the definition allows for the empty operator, add it.
- if (!empty($this->definition['allow empty'])) {
- $operators += array(
- 'empty' => array(
- 'title' => t('Is empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('empty'),
- 'values' => 0,
- ),
- 'not empty' => array(
- 'title' => t('Is not empty (NULL)'),
- 'method' => 'op_empty',
- 'short' => t('not empty'),
- 'values' => 0,
- ),
- );
- }
-
- return $operators;
- }
-
- /**
- * Build strings from the operators() for 'select' options
- */
- function operator_options($which = 'title') {
- $options = array();
- foreach ($this->operators() as $id => $info) {
- $options[$id] = $info[$which];
- }
-
- return $options;
- }
-
- function admin_summary() {
- if (!empty($this->options['exposed'])) {
- return t('exposed');
- }
-
- $options = $this->operator_options('short');
- $output = check_plain($options[$this->operator]);
- if (in_array($this->operator, $this->operator_values(1))) {
- $output .= ' ' . check_plain($this->value);
- }
- return $output;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $form['case'] = array(
- '#type' => 'checkbox',
- '#title' => t('Case sensitive'),
- '#default_value' => $this->options['case'],
- '#description' => t('Case sensitive filters may be faster. MySQL might ignore case sensitivity.'),
- );
- }
-
- function operator_values($values = 1) {
- $options = array();
- foreach ($this->operators() as $id => $info) {
- if (isset($info['values']) && $info['values'] == $values) {
- $options[] = $id;
- }
- }
-
- return $options;
- }
-
- /**
- * Provide a simple textfield for equality
- */
- function value_form(&$form, &$form_state) {
- // We have to make some choices when creating this as an exposed
- // filter form. For example, if the operator is locked and thus
- // not rendered, we can't render dependencies; instead we only
- // render the form items we need.
- $which = 'all';
- if (!empty($form['operator'])) {
- $source = ($form['operator']['#type'] == 'radios') ? 'radio:options[operator]' : 'edit-options-operator';
- }
- if (!empty($form_state['exposed'])) {
- $identifier = $this->options['expose']['identifier'];
-
- if (empty($this->options['expose']['use_operator']) || empty($this->options['expose']['operator'])) {
- // exposed and locked.
- $which = in_array($this->operator, $this->operator_values(1)) ? 'value' : 'none';
- }
- else {
- $source = 'edit-' . form_clean_id($this->options['expose']['operator']);
- }
- }
-
- if ($which == 'all' || $which == 'value') {
- $form['value'] = array(
- '#type' => 'textfield',
- '#title' => t('Value'),
- '#size' => 30,
- '#default_value' => $this->value,
- );
- if (!empty($form_state['exposed']) && !isset($form_state['input'][$identifier])) {
- $form_state['input'][$identifier] = $this->value;
- }
-
- if ($which == 'all') {
- $form['value'] += array(
- '#process' => array('views_process_dependency'),
- '#dependency' => array($source => $this->operator_values(1)),
- );
- }
- }
-
- if (!isset($form['value'])) {
- // Ensure there is something in the 'value'.
- $form['value'] = array(
- '#type' => 'value',
- '#value' => NULL
- );
- }
- }
-
- function case_transform() {
- return !empty($this->options['case']) ? '' : 'UPPER';
- }
-
- /**
- * Add this filter to the query.
- *
- * Due to the nature of fapi, the value and the operator have an unintended
- * level of indirection. You will find them in $this->operator
- * and $this->value respectively.
- */
- function query() {
- $this->ensure_my_table();
- $field = "$this->table_alias.$this->real_field";
- $upper = $this->case_transform();
-
- $info = $this->operators();
- if (!empty($info[$this->operator]['method'])) {
- $this->{$info[$this->operator]['method']}($field, $upper);
- }
- }
-
- function op_equal($field, $upper) {
- // operator is either = or !=
- $this->query->add_where($this->options['group'], "$upper(%s) $this->operator $upper('%s')", $field, $this->value);
- }
-
- function op_contains($field, $upper) {
- $this->query->add_where($this->options['group'], "$upper(%s) LIKE $upper('%%%s%%')", $field, $this->value);
- }
-
- function op_word($field, $upper) {
- $where = array();
- preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' ' . $this->value, $matches, PREG_SET_ORDER);
- foreach ($matches as $match) {
- $phrase = false;
- // Strip off phrase quotes
- if ($match[2]{0} == '"') {
- $match[2] = substr($match[2], 1, -1);
- $phrase = true;
- }
- $words = trim($match[2], ',?!();:-');
- $words = $phrase ? array($words) : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY);
- foreach ($words as $word) {
- $where[] = "$upper(%s) LIKE $upper('%%%s%%')";
- $values[] = $field;
- $values[] = trim($word, " ,!?");
- }
- }
-
- if (!$where) {
- return;
- }
-
- if ($this->operator == 'word') {
- $where = '(' . implode(' OR ', $where) . ')';
- }
- else {
- $where = implode(' AND ', $where);
- }
- // previously this was a call_user_func_array but that's unnecessary
- // as views will unpack an array that is a single arg.
- $this->query->add_where($this->options['group'], $where, $values);
- }
-
- function op_starts($field, $upper) {
- $this->query->add_where($this->options['group'], "$upper(%s) LIKE $upper('%s%%')", $field, $this->value);
- }
-
- function op_not_starts($field, $upper) {
- $this->query->add_where($this->options['group'], "$upper(%s) NOT LIKE $upper('%s%%')", $field, $this->value);
- }
-
- function op_ends($field, $upper) {
- $this->query->add_where($this->options['group'], "$upper(%s) LIKE $upper('%%%s')", $field, $this->value);
- }
-
- function op_not_ends($field, $upper) {
- $this->query->add_where($this->options['group'], "$upper(%s) NOT LIKE $upper('%%%s')", $field, $this->value);
- }
-
- function op_not($field, $upper) {
- $this->query->add_where($this->options['group'], "$upper(%s) NOT LIKE $upper('%%%s%%')", $field, $this->value);
- }
-
- function op_empty($field) {
- if ($this->operator == 'empty') {
- $operator = "IS NULL";
- }
- else {
- $operator = "IS NOT NULL";
- }
-
- $this->query->add_where($this->options['group'], "$field $operator");
- }
-
-}
diff --git a/handlers/views_handler_relationship.inc b/handlers/views_handler_relationship.inc
deleted file mode 100644
index 8d3641f..0000000
--- a/handlers/views_handler_relationship.inc
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-/**
- * @file
- * Views' relationship handlers.
- */
-
-/**
- * @defgroup views_relationship_handlers Views' relationship handlers
- * @{
- * Handlers to tell Views how to create alternate relationships.
- */
-
-/**
- * Simple relationship handler that allows a new version of the primary table
- * to be linked in.
- *
- * The base relationship handler can only handle a single join. Some relationships
- * are more complex and might require chains of joins; for those, you must
- * utilize a custom relationship handler.
- *
- * Definition items:
- * - base: The new base table this relationship will be adding. This does not
- * have to be a declared base table, but if there are no tables that
- * utilize this base table, it won't be very effective.
- * - base field: The field to use in the relationship; if left out this iwll be
- * assumed to be the primary field.
- * - relationship table: The actual table this relationship operates against.
- * This is analogous to using a 'table' override.
- * - relationship field: The actual field this relationsihp operates against.
- * This is analogous to using a 'real field' override.
- * - label: The default label to provide for this relationship, which is
- * shown in parentheses next to any field/sort/filter/argument that uses
- * the relationship.
- */
-class views_handler_relationship extends views_handler {
- /**
- * Init handler to let relationships live on tables other than
- * the table they operate on.
- */
- function init(&$view, $options) {
- parent::init($view, $options);
- if (isset($this->definition['relationship table'])) {
- $this->table = $this->definition['relationship table'];
- }
- if (isset($this->definition['relationship field'])) {
- $this->field = $this->definition['relationship field'];
- }
- }
-
- /**
- * Get this field's label.
- */
- function label() {
- if (!isset($this->options['label'])) {
- return $this->ui_name();
- }
- return $this->options['label'];
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $label = !empty($this->definition['label']) ? $this->definition['label'] : $this->definition['field'];
- $options['label'] = array('default' => $label, 'translatable' => TRUE);
- $options['required'] = array('default' => FALSE);
-
- return $options;
- }
-
- /**
- * Default options form that provides the label widget that all fields
- * should have.
- */
- function options_form(&$form, &$form_state) {
- $form['label'] = array(
- '#type' => 'textfield',
- '#title' => t('Label'),
- '#default_value' => isset($this->options['label']) ? $this->options['label'] : '',
- '#description' => t('The label for this relationship that will be displayed only administratively.'),
- );
-
- $form['required'] = array(
- '#type' => 'checkbox',
- '#title' => t('Require this relationship'),
- '#description' => t('If required, items that do not contain this relationship will not appear.'),
- '#default_value' => !empty($this->options['required']),
- );
- }
-
- /**
- * Called to implement a relationship in a query.
- */
- function query() {
- // Figure out what base table this relationship brings to the party.
- $table_data = views_fetch_data($this->definition['base']);
- $base_field = empty($this->definition['base field']) ? $table_data['table']['base']['field'] : $this->definition['base field'];
-
- $this->ensure_my_table();
-
- $def = $this->definition;
- $def['table'] = $this->definition['base'];
- $def['field'] = $base_field;
- $def['left_table'] = $this->table_alias;
- $def['left_field'] = $this->field;
- if (!empty($this->options['required'])) {
- $def['type'] = 'INNER';
- }
-
- if (!empty($def['join_handler']) && class_exists($def['join_handler'])) {
- $join = new $def['join_handler'];
- }
- else {
- $join = new views_join();
- }
-
- $join->definition = $def;
- $join->construct();
- $join->adjusted = TRUE;
-
- // use a short alias for this:
- $alias = $def['table'] . '_' . $this->table;
-
- $this->alias = $this->query->add_relationship($alias, $join, $this->definition['base'], $this->relationship);
- }
-}
-
-/**
- * A special handler to take the place of missing or broken handlers.
- */
-class views_handler_relationship_broken extends views_handler_relationship {
- function ui_name($short = FALSE) {
- return t('Broken/missing handler');
- }
-
- function ensure_my_table() { /* No table to ensure! */ }
- function query() { /* No query to run */ }
- function options_form(&$form, &$form_state) {
- $form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
- '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
- );
- }
-
- /**
- * Determine if the handler is considered 'broken'
- */
- function broken() { return TRUE; }
-}
-
-/**
- * @}
- */
diff --git a/handlers/views_handler_sort.inc b/handlers/views_handler_sort.inc
deleted file mode 100644
index ead0f5c..0000000
--- a/handlers/views_handler_sort.inc
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-/**
- * @defgroup views_sort_handlers Views' sort handlers
- * @{
- * Handlers to tell Views how to sort queries
- */
-
-/**
- * Base sort handler that has no options and performs a simple sort
- */
-class views_handler_sort extends views_handler {
- /**
- * Called to add the sort to a query.
- */
- function query() {
- $this->ensure_my_table();
- // Add the field.
- $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
- }
-
- function option_definition() {
- $options = parent::option_definition();
-
- $options['order'] = array('default' => 'ASC');
-
- return $options;
- }
-
- /**
- * Display whether or not the sort order is ascending or descending
- */
- function admin_summary() {
- switch ($this->options['order']) {
- case 'ASC':
- case 'asc':
- default:
- $type = t('asc');
- break;
- case 'DESC';
- case 'desc';
- $type = t('desc');
- break;
- }
- return '<span class="views-ascending"><span>' . $type . '</span></span>';
- }
-
- /**
- * Basic options for all sort criteria
- */
- function options_form(&$form, &$form_state) {
- $form['order'] = array(
- '#type' => 'radios',
- '#title' => t('Sort order'),
- '#options' => array('ASC' => t('Ascending'), 'DESC' => t('Descending')),
- '#default_value' => $this->options['order'],
- );
- }
-}
-
-/**
- * A special handler to take the place of missing or broken handlers.
- */
-class views_handler_sort_broken extends views_handler_sort {
- function ui_name($short = FALSE) {
- return t('Broken/missing handler');
- }
-
- function ensure_my_table() { /* No table to ensure! */ }
- function query() { /* No query to run */ }
- function options_form(&$form, &$form_state) {
- $form['markup'] = array(
- '#prefix' => '<div class="form-item description">',
- '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
- );
- }
-
- /**
- * Determine if the handler is considered 'broken'
- */
- function broken() { return TRUE; }
-}
-
-
-/**
- * @}
- */
diff --git a/handlers/views_handler_sort_date.inc b/handlers/views_handler_sort_date.inc
deleted file mode 100644
index 8101482..0000000
--- a/handlers/views_handler_sort_date.inc
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-/**
- * Basic sort handler for dates.
- *
- * This handler enables granularity, which is the ability to make dates
- * equivalent based upon nearness.
- *
- * @ingroup views_sort_handlers
- */
-class views_handler_sort_date extends views_handler_sort {
- function option_definition() {
- $options = parent::option_definition();
-
- $options['granularity'] = array('default' => 'second');
-
- return $options;
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
-
- $form['granularity'] = array(
- '#type' => 'radios',
- '#title' => t('Granularity'),
- '#options' => array(
- 'second' => t('Second'),
- 'minute' => t('Minute'),
- 'hour' => t('Hour'),
- 'day' => t('Day'),
- 'month' => t('Month'),
- 'year' => t('Year'),
- ),
- '#description' => t('The granularity is the smallest unit to use when determining whether two dates are the same; for example, if the granularity is "Year" then all dates in 1999, regardless of when they fall in 1999, will be considered the same date.'),
- '#default_value' => $this->options['granularity'],
- );
- }
-
- /**
- * Called to add the sort to a query.
- */
- function query() {
- $this->ensure_my_table();
- switch ($this->options['granularity']) {
- case 'second':
- default:
- $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
- return;
- case 'minute':
- $formula = views_date_sql_format('YmdHi', "$this->table_alias.$this->real_field");
- break;
- case 'hour':
- $formula = views_date_sql_format('YmdH', "$this->table_alias.$this->real_field");
- break;
- case 'day':
- $formula = views_date_sql_format('Ymd', "$this->table_alias.$this->real_field");
- break;
- case 'month':
- $formula = views_date_sql_format('Ym', "$this->table_alias.$this->real_field");
- break;
- case 'year':
- $formula = views_date_sql_format('Y', "$this->table_alias.$this->real_field");
- break;
- }
-
- // Add the field.
- $this->query->add_orderby(NULL, $formula, $this->options['order'], $this->table_alias . '_' . $this->field . '_' . $this->options['granularity']);
- }
-}
diff --git a/handlers/views_handler_sort_formula.inc b/handlers/views_handler_sort_formula.inc
deleted file mode 100644
index 30a6451..0000000
--- a/handlers/views_handler_sort_formula.inc
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Base sort handler that has no options and performs a simple sort
- *
- * Definition items:
- * - formula: The formula to use to sort on, such as with a random sort.
- * The formula should be an array, with keys for database
- * types, and 'default' for non-specified. 'default' is
- * required, all others ('mysql', 'mysqli' and 'pgsql' are
- * optional). It is recommended you use 'default' for mysql
- * and create specific overrides for pgsql when the formulae
- * differ.
- *
- * @ingroup views_sort_handlers
- */
-class views_handler_sort_formula extends views_handler_sort {
- /**
- * Constructor to take the formula this sorts on.
- */
- function construct() {
- $this->formula = $this->definition['formula'];
- if (is_array($this->formula) && !isset($this->formula['default'])) {
- $this->error = t('views_handler_sort_formula missing default: @formula', array('@formula' => var_export($this->formula, TRUE)));
- }
- parent::construct();
- }
- /**
- * Called to add the sort to a query.
- */
- function query() {
- if (is_array($this->formula)) {
- global $db_type;
- if (isset($this->formula[$db_type])) {
- $formula = $this->formula[$db_type];
- }
- else {
- $formula = $this->formula['default'];
- }
- }
- else {
- $formula = $this->formula;
- }
- $this->ensure_my_table();
- // Add the field.
- $this->query->add_orderby(NULL, $formula, $this->options['order'], $this->table_alias . '_' . $this->field);
- }
-}
diff --git a/handlers/views_handler_sort_menu_hierarchy.inc b/handlers/views_handler_sort_menu_hierarchy.inc
deleted file mode 100644
index 294b3c4..0000000
--- a/handlers/views_handler_sort_menu_hierarchy.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-/**
- * Sort in menu hierarchy order.
- *
- * Given a field name of 'p' this produces an ORDER BY on p1, p2, ..., p9.
- * This is only really useful for the {menu_links} table.
- *
- * @ingroup views_sort_handlers
- */
-class views_handler_sort_menu_hierarchy extends views_handler_sort {
- function query() {
- $this->ensure_my_table();
- $max_depth = isset($this->definition['max depth']) ? $this->definition['max depth'] : MENU_MAX_DEPTH;
- for ($i = 1; $i <= $max_depth; ++$i) {
- $this->query->add_orderby($this->table_alias, $this->field . $i, $this->options['order']);
- }
- }
-}
diff --git a/handlers/views_handler_sort_random.inc b/handlers/views_handler_sort_random.inc
deleted file mode 100644
index 0a926b3..0000000
--- a/handlers/views_handler_sort_random.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
- * Handle a random sort.
- */
-class views_handler_sort_random extends views_handler_sort {
- function query() {
- global $db_type;
- switch ($db_type) {
- case 'mysql':
- case 'mysqli':
- $formula = 'RAND()';
- break;
- case 'pgsql':
- $formula = 'RANDOM()';
- break;
- }
- if (!empty($formula)) {
- $this->query->add_orderby(NULL, $formula, $this->options['order'], '_' . $this->field);
- }
- }
-
- function options_form(&$form, &$form_state) {
- parent::options_form($form, $form_state);
- $form['order']['#access'] = FALSE;
- }
-}
diff --git a/help/about.html b/help/about.html
deleted file mode 100644
index 1792053..0000000
--- a/help/about.html
+++ /dev/null
@@ -1,17 +0,0 @@
-The views module allows administrators and site designers to create, manage, and display lists of content. Each list managed by the views module is known as a "view", and the output of a view is known as a "display". Displays are provided in either block or page form, and a single view may have multiple displays. Optional navigation aids, including a system path and menu item, can be set for each page-based display of a view. By default, views may be created that list content (a <em>Node</em> view type), content revisions (a <em>Node revisions</em> view type) or users (a <em>User</em> view type). A view may be restricted to members of specific user roles, and may be added, edited or deleted at the <a href="base_url:admin/build/views">views administration page</a>
-
-The "building block" design of the views system provides power and flexibility, allowing parameters to be specified only when needed. While an advanced view may use all of available parameters to create complex and highly interactive applications, a simple content listing may specify only a few options. All views rely on a conceptual framework that includes:
-
-<ul>
- <li><a href="topic:views/field">Fields</a>, or the individual pieces of data being displayed. Adding the fields <em>Node: Title</em>, <em>Node: Type</em>, and <em>Node: Post date</em> to a node view, for example, includes the title, content type and creation date in the displayed results </li>
-
- <li><a href="topic:views/relationship">Relationships</a>, or information about how data elements relate to one another. If relationship data is available, like that provided by a CCK <em>nodereference</em> field, items from a related node may be included in the view </li>
-
- <li><a href="topic:views/argument">Arguments</a>, or additional parameters that dynamically refine the view results, passed as part of the path. Adding an argument of <em>Node: Type</em> to a node view with a path of "content", for example, dynamically filters the displayed items by content type. In this example (shown with Clean URLs enabled), accessing the view through the path "<em>http://www.example.com/content/page</em>" displays all posts of the type "page", the path "<em>http://www.example.com/content/story</em>" displays all posts of the type "story", and "<em>http://www.example.com/content</em>" displays all posts regardless of type) </li>
-
- <li><a href="topic:views/sort">Sort criteria</a>, which determine the order of items displayed in the view results. Adding the sort criteria <em>Node: Post date</em> (in descending order) to a node <em>view</em>, for example, sorts the displayed posts in descending order by creation date </li>
-
- <li><a href="topic:views/filter">Filters</a>, which limit items displayed in the results. Adding the filter <em>Node: Published</em> (and setting it equal to "Published") to a node view, for example, prevents unpublished items from being displayed</li>
-
- <li><a href="topic:views/display">Displays</a>, which control where the output will be seen. Every view has a default display, which doesn't actually display the view anywhere, but is used to hold the default settings for the view, and is used when the view is called programmatically if another display is not specified. Much more useful to users are the <a href="topic:views/display-page">page</a> display, which gives a view a path and allows it to be the primary content of a page, or the <a href="topic:views/display-block">block</a> display which allows it to appear as secondary content on other pages.</li>
-</ul>
diff --git a/help/analyze-theme.html b/help/analyze-theme.html
deleted file mode 100644
index 30bb871..0000000
--- a/help/analyze-theme.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<p>You may use any of the following possible theme files to modify individual parts of your view. In total, there are four parts to theming a view.</p>
-<ul>
- <li> The <strong>display</strong> theme is usually views-view.tpl.php and it largely controls the decorations around a view; where the header, footer, pager, more link, feed icon, etc, will be placed. </li>
-
- <li> The <strong>style</strong> will control how all of the results of the display are put together. It may be as simple as just displaying all of the rows, or it may be a complex table generator or something in between. </li>
-
- <li> The <strong>row</strong> style controls each individual row; not all styles utilize the row style (notably the table), but most others do.
-
- <li> Finally, <strong>field</strong> themes allow you to override the look and even the data of each individual field, if the style uses fields. The actual template the system will use should be hilighted in <strong>bold</strong>.</li>
-</ul>
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/style-breakdown-large.png"><img src="path:images/style-breakdown.png" /></a>
-<em>A breakdown of View output</em>
-</div>
-
-<p>The link to the left of each type will give you information about the default template used for that type. You may cut and paste this and place it in your theme with the appropriate template, or you may copy the base file from the views/theme directory (or, if provided by a module, from the module's directory). <strong>It is important that you clear the theme registry cache every time you add a new template, or the new template will not be picked up.</strong></p>
-
-<p><strong>Important note:</strong> You place your custom template files in your theme directory, <strong>not views/theme</strong>. This is always true of theming with Drupal.
-
-<p>In addition to this tool, the very useful <a href="http://drupal.org/project/devel">devel</a> module contains a tool called the "Theme developer" which does a good job of visually showing you which areas of your site use which themes. Be careful with it, though, as the theme developer causes the Views edit page to break.</p>
-
-<p>Also, this feature will only work properly with Drupal 6.3 and later; prior to Drupal 6.3 <a href="http://drupal.org/node/241570">this patch</a> will be required.</p>
diff --git a/help/api-default-views.html b/help/api-default-views.html
deleted file mode 100644
index 1445f0f..0000000
--- a/help/api-default-views.html
+++ /dev/null
@@ -1,101 +0,0 @@
-Views can be stored in the database, which is typical of smaller sites and hobby sites. However, Views may also be stored directly in the code as "default" views, (which simply means they're available by default). Modules often come with views that are specific to the module data, but it's also possible -- and <b>highly</b> recommended -- that sites which have separate "development" and "production" sites export their views into default views in a site-specific module. This makes it very easy to transfer views from dev to production without making database changes.
-
-<h3>Creating a module</h3>
-First, create a directory in <em>sites/all/modules</em> for your new module. Call it whatever you like, but for this example we will call it <em>mymodule</em>.
-
-In this directory, create a <em>mymodule.module</em> file. It can be empty for now, but it should at least contain an opening PHP tag:
-<pre>&lt;?php
-// $Id $
-</pre>
-
-It should not contain a closing ?&gt; tag, as the closing ?&gt; tag is not required and anything AFTER the closing tag, such as a space or a linefeed, will be displayed directly to the browser and can potentially cause problems.
-
-The .module file will contain functions and drupal hooks. Hooks are specially named functions that Drupal will call in order to get your module's response at certain times while generating pages. The only function you will need for this exercise is the 'views_api' hook that tells Views that this module supports the Views API and what version:
-
-<pre>function mymodule_views_api() {
- return array('api' => 2.0);
-}
-</pre>
-
-For other uses you may well add additional functions.
-
-Second, you need to create a <em>mymodule.info</em> file:
-
-<pre>; $Id $
-name = My module
-description = My site specific module.
-core = 6.x
-</pre>
-
-Once you have these two files set up, you should be able to activate your new module at the <em>Administer >> Site building >> Modules</em> page.
-<h3>Exporting your views</h3>
-
-The easiest way to do this is to activate the 'views_export' module, and navigate to <em>Administer >> Views >> Tools >> Bulk export</em> Place a check next to each view that you want in your module, type the module name into the text field, and click export. This will create the entire <em>hook_views_default_views()</em> function for you.
-
-You can also export individual views. If you do this, keep in mind that this export does not include the line that adds the exported $view into the larger $views array:
-
-<pre>$views[$view->name] = $view</pre>
-
-To place this into your <em>hook_views_default_views()</em> you will need to place that after the view, and make sure the function returns $views at the end.
-
-<h3>Placing your exported views into your module</h3>
-Cut and paste the entire output of the bulk export tool into mymodule.views_default.inc -- and be sure to put a &lt;?php at the top of the file so that the webserver knows that it's PHP code! Then visit the Views tools page and clear the Views cache. Your views should now be listed as <b>Overridden</b> on the view list page. If you <b>revert</b> these views, they will be removed from the database, but will remain in code.
-
-<h3>Theming your views in your module</h3>
-You can theme these views in the module and not need to rely on the theme to do this at all; and in fact, the theme can continue to override these just like it ordinarily would, even if your module provides a theme. This is very useful for distributing a module where the view needs to look "just so."
-
-To do this, you need to implement <em>hook_theme()</em> in your module:
-<pre>function mymodule_theme($existing) {
- return array(
- 'views_view__viewname_displayid' => array (
- 'arguments' => array('view' => NULL),
- 'template' => 'views-view--viewname--displayid',
- 'original hook' => 'views_view',
- ),
- );
-}
-</pre>
-
-There are a small number of gotchas in doing this that you must be aware of.
-
-<ol>
-<li>When referring to a template filename, you always use dashes in the name. i.e, <em>views-view--viewname--displayid.tpl.php</em>. However, when referring to the hook or function names, you use underscores instead of dashes. i.e, <em>views_view</em> and <em>views_view__viewname_displayid</em></li>
-
-<li>The 'arguments' change based upon which of the 3 types you're overriding. There's the 'display', the 'style' and the 'row' style. The above code is assuming the display, which is usually just <em>views_view</em>. Here are the possibilities:
-
-<pre>display: array('view' => NULL),
-style: array('view' => NULL, 'options' => NULL, 'rows' => NULL, 'title' => NULL),
-row style: array('view' => NULL, 'options' => NULL, 'row' => NULL),
-</pre>
-
-Be sure to use the right arguments line or the theme system will not properly translate.
-</li>
-<li>The 'template' line should never include the extension, so drop the .tpl.php from it.</li>
-
-<li>You need to make sure that the Views preprocess functions get registered. The 'original hook' line in the definition does that, but it can only do it if it comes after the Views registration, which actually happens very late in theme building. 99% of the time, your module will come before Views. You have two choices to deal with this:
-<ol>
- <li>Set your module's weight to 11 or higher in the database. Views' weight is 10. You can make this happen automatically when the module is first installed by creating a mymodule.install file and using this code:
- <pre>function mymodule_install() {
- db_query("UPDATE {system} SET weight = 11 WHERE name = 'mymodule'");
-}
-</pre>
- If you use this method, the <em>original hook</em> should be set to the name of the original template being used. i.e, if this is a variate of views-view-list.tpl.php, this should be 'views_view_list'.
- </li>
- <li>You can also just force it to list the preprocessors without actually having to detect them. This doesn't require modifying your module's weight, which is not always possible, you can insert this code into the array:
- <pre> 'preprocess functions' => array(
- 'template_preprocess',
- 'template_preprocess_views_view',
- 'mymodule_preprocess_views_view__viewname_displayid',
- ),
-</pre>
-
- The first one is the global 'template_preprocess' function which all templates utilize. It does some basic things such as setting up $zebra and a few other items. See <a href="http://api.drupal.org/api/function/template_preprocess/6">api.drupal.org</a> for specifics.
-
- The second one is the plugin specific preprocess. Like 'original hook' it should conform to the name used by the original template. i.e, if the original template was <em>views-view-list.tpl.php</em> then that preprocess function would be named <em>template_preprocess_views_view_list</em>.
-
- The third one is your module's preprocess function, if it needs one. In general, you probably will not need one, and you should only attempt to use one if you are reasonably familiar with the concept of preprocess functions and Drupal's theme system in general. See Drupal's theme documentation for more information.
- </li>
-</ol>
-</li>
-</ol>
-
diff --git a/help/api-example.html b/help/api-example.html
deleted file mode 100644
index 61852bb..0000000
--- a/help/api-example.html
+++ /dev/null
@@ -1,179 +0,0 @@
-
-For the new table defined by the Node example module to be understood by the views module you need to create a node_example.views.inc file that describes the table and its relationships to the rest of the database. In order for views to know that this file is to be loaded you need to implement hook_views_api. This is done by adding the following function into your node_example.module file
-
-<pre>
-&lt;?php
-/**
- * Implementation of hook_views_api().
- *
- * This tells drupal that there is Views integration file named
- * module-name.views.inc
- */
-function node_example_views_api() {
- // Note that you can include 'path' in this array so that your views.inc
- // file can be stored in a different location.
- return array(
- 'api' => 2.0
- );
-}
-?&gt;
-</pre>
-
-Below is the contents of a simple node_example.views.inc file that allows you to create views that include the new color and quantity information.
-
-<pre>
-&lt;?php
-
-/**
- * This file is used to tell the views module about the new node_example table.
- *
- * Database definition:
- * @code
- * CREATE TABLE node_example (
- * vid int(10) unsigned NOT NULL default '0',
- * nid int(10) unsigned NOT NULL default '0',
- * color varchar(255) NOT NULL default '',
- * quantity int(10) unsigned NOT NULL default '0',
- * PRIMARY KEY (vid, nid),
- * KEY `node_example_nid` (nid)
- * )
- * @endcode
- */
-
-function node_example_views_data() {
- // Basic table information.
-
- // ----------------------------------------------------------------
- // node_example table
- // New group within Views called 'Example'
- // The group will appear in the UI in the dropdown tha allows you
- // to narrow down which fields and filters are available.
-
- $data = array();
- $data['node_example']['table']['group'] = t('Example');
-
- // Let Views know that our example table joins to the 'node'
- // base table. This means it will be available when listing
- // nodes and automatically make its fields appear.
- //
- // We also show up for node revisions.
- $data['node_example']['table']['join'] = array(
- 'node_revisions' => array(
- 'left_field' => 'vid',
- 'field' => 'vid',
- ),
- 'node' => array(
- 'left_field' => 'vid',
- 'field' => 'vid',
- ),
- );
-
- // quantity
- $data['node_example']['quantity'] = array(
- 'title' => t('Quantity'),
- 'help' => t('Quantity of items.'),
- 'field' => array(
- 'handler' => 'views_handler_field_numeric',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_numeric',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- );
-
- // Color
- $data['node_example']['color'] = array(
- 'title' => t('Color'),
- 'help' => t('Color of item.'),
-
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_string',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- );
-
- return $data;
-}
-
-?&gt;
-</pre>
-
-Some notes on usage:
-
-Within Views, click on the Add tab. You have a number of type options here. Normally you would select either 'Node' (if you only want to display information on current nodes) or 'Node revision' (if you want to display information on all revisions of the nodes)
-
-With this configuration you always pull out of the database, data for every single node, whether or not it has color and quantity information. To display information on just those nodes that have color and quantity information you can use a filter so that only nodes which don't have a NULL color or a NULL quantity are displayed.
-
-<h3>Type/relationship extension</h3>
-
-When your tables have first class data, you will often need to have own View types and View relationships defined. With the current node_example table this isn't required although I try to justify it below on an efficiency basis. See [[http://groups.drupal.org/node/17236#comment-58980|this discussion]] as to why it isn't justified.
-
-Pulling data out of the database for every node when you only want data for the new Example node type is inefficient. To reduce the initial data extraction to just that relating to the new Example nodes requires that you make the node_example table the base table. This can be done by adding the following code into the node_example.views.inc file just before the 'return $data;'
-
-<pre>
-&lt;?php
-
-// **** Begin optional extra for type and relationships ****
-
- // Use node_example as a new base table
- // by creating a new views type called 'Node example'
- // This allows it to be selected as the 'view type'
- // when you initially add a new view.
- $data['node_example']['table']['base'] = array(
- 'field' => 'vid',
- 'title' => t('Node example'),
- 'help' => t("Node example type with color and quantity information."),
- 'weight' => -9,
- );
-
- // When using the new 'Node example' type you need to use relationships
- // to access fields in other tables.
-
- // Relationship to the 'Node revision' table
- $data['node_example']['vid'] = array(
- 'title' => t('Node revision'),
- 'help' => t('The particular node revision the color and quantity is attached to'),
- 'relationship' => array(
- 'label' => t('Node revision'),
- 'base' => 'node_revisions',
- 'base field' => 'vid',
- // This allows us to not show this relationship if the base is already
- // node_revisions so users won't create circular relationships.
- 'skip base' => array('node', 'node_revisions'),
- ),
- );
-
- // Relationship to the 'Node' table
- $data['node_example']['nid'] = array(
- 'title' => t('Node'),
- 'help' => t('The particular node the color and quantity is attached to'),
- 'relationship' => array(
- 'label' => t('Node'),
- 'base' => 'node',
- 'base field' => 'nid',
- // This allows us to not show this relationship if the base is already
- // node so users won't create circular relationships.
- 'skip base' => array('node', 'node_revisions'),
- ),
- );
-
-// **** End optional extra for type and relationships ****
-
-?&gt;
-</pre>
-
-The above code adds a new 'Node example' to the view types that can be selected within the Add tab window of views. Selecting this sets the node_example table to be the base table.
-
-If you select 'Node example' as view type, when you initially go into the edit window of views you will find the only fields available are the color and quantity fields. To get fields from other tables you need to add a relationship. Relationships may be found at the top in the same column as the fields.
diff --git a/help/api-handlers.html b/help/api-handlers.html
deleted file mode 100644
index 0c51fc5..0000000
--- a/help/api-handlers.html
+++ /dev/null
@@ -1,70 +0,0 @@
-In Views, a handler is an object that is part of the view and is part of the query building flow.
-
-Handlers are objects; much of the time, the base handlers will work, but often you'll need to override the handler for something. One typical handler override will be views_handler_filter_operator_in which allows you to have a filter select from a list of options; you'll need to override this to provide your list.
-
-Handlers have two distint code flows; the UI flow and the view building flow.
-
-For the query flow:
-
-<dl>
-<dt>handler-&gt;construct()</dt>
-<dd>Create the initial handler; at this time it is not yet attached to a view. It is here that you can set basic defaults if needed, but there will be no knowledge of the environment yet.</dd>
-<dt>handler-&gt;set_definition()</dt>
-<dd>Set the data from hook_views_data() relevant to the handler.</dd>
-<dt>handler-&gt;init()</dt>
-<dd>Attach the handler to a view, and usually provides the options from the display.</dd>
-<dt>handler-&gt;pre_query()</dt>
-<dd>Run prior to the query() stage to do early processing.</dd>
-<dt>handler-&gt;query()</dt>
-<dd>Do the bulk of the work this handler needs to do to add itself to the query.</dd>
-</dl>
-
-Fields, being the only handlers concerned with output, also have an extended piece of the flow:
-<dl>
-<dt>handler-&gt;pre_render()</dt>
-<dd>Called prior to the actual rendering, this allows handlers to query for extra data; the entire resultset is available here, and this is where items that have "multiple values" per record can do their extra query for all of the records available. There are several examples of this at work in the code.</dd>
-<dt>handler-&gt;render()</dt>
-<dd>This does the actual work of rendering the field.</dd>
-</dl>
-
-Most handlers are just extensions of existing classes with a few tweaks that are specific to the field in question. For example:
-
-<pre>
-/**
- * Filter by node type
- */
-class views_handler_filter_node_type extends views_handler_filter_in_operator {
- function get_value_options() {
- if (!isset($this-&gt;value_options)) {
- $this-&gt;value_title = t('Node type');
- $types = node_get_types();
- foreach ($types as $type =&gt; $info) {
- $options[$type] = $info-&gt;name;
- }
- $this-&gt;value_options = $options;
- }
- }
-}
-</pre>
-
-<i>views_handler_filter_in_operator</i> provides a simple mechanism to set the list used and the rest of the handler is perfectly fine for this.
-
-Handlers are stored in their own files; for these files to be loaded by Views on demand, they must first be registered. Since Views core handlers are also loaded this way, it's imperative that your module also implement this pattern in order to prevent code crashes when your handler's parent class is not yet available.
-
-To register handlers, you must implement <strong>hook_views_handlers()</strong>. This hook returns an array with two keys; the first key is <em>info</em> which contains the modulename (which is only necessary if you're registering handlers on behalf of another module, such as what Views does) and <em>path</em>, which is the search path to find the files. This path is only necessary if your files will not be stored in the same directory as the .module file.
-
-The other key is <em>handlers</em> which contains a full array of handlers and the information for each handler. The key to each handler array is the name of the handler class. It can contain:
-<dl>
-<dt><strong>parent</strong></dt>
-<dd>The class that this handler extends. This is important to make sure that the parent class is included before your handler class. Without this, you may cause people's sites to crash in a difficult to recover state. Be sure you get this right!</dd>
-<dt><strong>file</strong></dt>
-<dd>The filename the handler is in. By default, this will be classname.inc -- however, you can have multiple similar handlers together in one file. However, because there is only one parent, please be sure that the parentage on these handlers matches! Otherwise you will run into whitescreens as not all parents will be loaded.</dd>
-</dl>
-
-You can see examples of this function in any of the various module.views.inc files in the views modules directory.
-
-The best place to learn more about handlers and how they work is to explore <a href="http://views.doc.logrus.com">the views API site</a> and use existing handlers as a guide and a model. Understanding how views_handler and its child classes work is handy but you can do a lot just following these models. You can also explore the views module directory, particularly node.views.inc.
-
-Please note that while all handler names in views are prefixed with views_, you should use your own module's name to prefix your handler names in order to ensure namespace safety. Note that the basic pattern for handler naming goes like this:
-
-[module]_handler_[type]_[tablename]_[fieldname]. Sometimes table and fieldname are not appropriate, but something that resembles what the table/field would be can be used. \ No newline at end of file
diff --git a/help/api-plugins.html b/help/api-plugins.html
deleted file mode 100644
index 6d48c37..0000000
--- a/help/api-plugins.html
+++ /dev/null
@@ -1,79 +0,0 @@
-In Views, a plugin is a bit like a handler, but plugins are not directly responsible for building the query. Instead, they are objects that are used to display the view or make other modifications.
-
-There are 6 types of plugins in Views:
-<dl>
-<dt>Display</dt>
-<dd>Display plugins are responsible for controlling <strong>where</strong> a view lives. Page and block are the most common displays, as well as the ubiquitous 'default' display which is likely what will be embedded.</dd>
-<dt>Style</dt>
-<dd>Style plugins control how a view is displayed. For the most part they are object wrappers around theme templates.
-<dt>Row style</dt>
-<dd>Row styles handle each individual record from a node.</dd>
-<dt>Argument default</dt>
-<dd>Argument default plugins allow pluggable ways of providing arguments for blocks. Views includes plugins to extract node and user IDs from the URL; additional plugins could be used for a wide variety of tasks.</dd>
-<dt>Argument validator</dt>
-<dd>Validator plugins can ensure arguments are valid, and even do transformations on the arguments.</dd>
-<dt>Access</dt>
-<dd>Access plugins are responsible for controlling access to the view.</dd>
-</dl>
-
-Plugins are registered by implementing <strong>hook_views_plugins()</strong> in your modulename.views.inc file and returning an array of data.
-
-The array will look something like this:
-<code>
- return array(
- 'display' => array(
- // ... list of display plugins,
- ),
- 'style' => array(
- // ... list of style plugins,
- ),
- 'row' => array(
- // ... list of row style plugins,
- ),
- 'argument default' => array(
- // ... list of argument default plugins,
- ),
- 'argument validator' => array(
- // ... list of argument validator plugins,
- ),
- 'access' => array(
- // ... list of access plugins,
- ),
- );
-</code>
-
-Each plugin will be registered with an identifier for the plugin, plus a fairly lengthy list of items that can define how and where the plugin is used. Here is an example from Views core:
-
-<code>
- 'node' => array(
- 'title' => t('Node'),
- 'help' => t('Display the node with standard node view.'),
- 'handler' => 'views_plugin_row_node_view',
- 'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules
- 'theme' => 'views_view_row_node',
- 'base' => array('node'), // only works with 'node' as base.
- 'uses options' => TRUE,
- 'type' => 'normal',
- ),
-</code>
-
-Of particular interest is the <em>path</em> directive, which works a little differently from handler registration; each plugin must define its own path, rather than relying on a global info for the paths. Also, there is an optional <em>parent</em> directive which is automatically filled in to be the base parent for the plugin type. Usually this is enough, but if your plugin derives from something other than the base, it must be filled in. For example:
-
-<code>
- 'feed' => array(
- 'title' => t('Feed'),
- 'help' => t('Display the view as a feed, such as an RSS feed.'),
- 'handler' => 'views_plugin_display_feed',
- 'parent' => 'page', // so it knows to load the page plugin .inc file
- 'uses hook menu' => TRUE,
- 'use ajax' => FALSE,
- 'use pager' => FALSE,
- 'accept attachments' => FALSE,
- 'admin' => t('Feed'),
- 'help topic' => 'display-feed',
- ),
-</code>
-
-Note that unlike handler registration, where parentage is referred to by object name, with plugins it is referred to by the unique plugin identifier. Please be sure to prefix your plugin identifiers with your module name to ensure namespace safety; after all, two different modules could try to implement the 'grid2' plugin, and that would cause one plugin to completely fail.
-
-...TODO: Finish this document....
diff --git a/help/api-tables.html b/help/api-tables.html
deleted file mode 100644
index 2b519c5..0000000
--- a/help/api-tables.html
+++ /dev/null
@@ -1,234 +0,0 @@
-Tables are described to Views via hook_views_data(), which returns an array of table information, keyed by the name of the table. For example, if your module is describing three tables, 'foo', 'bar' and 'baz', your array will look like this:
-<pre>$data = array(
- 'foo' =&gt; array(
- // ...info here...
- ),
- 'bar' =&gt; array(
- // ...info here...
- ),
- 'baz' =&gt; array(
- // ...info here...
- ),
-);
-</pre>
-
-The key should be the actual database name of the table (not including prefix), but it can be an alias as long as the join information (explained later) contains the real name of the table.
-
-Each item in the array should be a field in the table, with the exception of a special information section called 'table'. Example:
-
-<pre>$data['foo'] = array(
- 'table' =&gt; array(
- // ... info about the table, described later ...
- ),
- 'bar' =&gt; array(
- // ... info about the field named 'bar', i.e, foo.bar,
- ),
- 'baz' =&gt; array(
- // ... info about the field named 'baz', i.e, foo.baz,
- ),
-);
-</pre>
-
-Once you get down to an array that contains actual data, that piece of the array will often be referred to as the definition.
-
-<h2>The 'table' section</h2>
-Each table should have a 'table' section in it, which is used to set default information for the table, such as the group, as well as the very important joins and whether or not this is a base table.
-
-First, there are several items that are actually for fields but can be placed here so that all fields within the table inherit them:
-<dl>
-<dt>group</dt>
-<dd>The name of the group this item will be with. In the UI, this is displayed as Group: Title. For example, "Node: Node ID", "Taxonomy: Term description", etc. It is important to be consistent with groups, because the UI sorts by group, and allows filtering by group to find fields as well.</dd>
-<dt>title</dt>
-<dd>The actual name of the field; it should be concise and descriptive.</dd>
-<dt>help</dt>
-<dd>A longer description to help describe what the field is or does. It should try to be only a line or two so as not to clutter the UI.</dd>
-</dl>
-
-In general, having 'title' and 'help' at the table level doesn't make a lot of sense, but usually every item in a table is in the same group. Thus it is very common to define the 'group':
-
-<pre>
- $data['foo']['table']['group'] = t('Foo');
-</pre>
-
-<h3>Base table</h3>
-If your table is a base table -- meaning it can be the primary, central table for a View to use, you can declare it to be a base table. This primarily provides UI information so that it can be selected.
-For example:
-<pre>
- // Advertise this table as a possible base table
- $data['node']['table']['base'] = array(
- 'field' =&gt; 'nid',
- 'title' =&gt; t('Node'),
- 'help' =&gt; t("Nodes are a Drupal site's primary content."),
- 'weight' =&gt; -10,
- );
-</pre>
-
-The following tags are available in the
-<dl>
-<dt>field</dt>
-<dd>The primary key field for this table. For Views to treat any table as a base table, it <b>must</b> have a primary field. For node this is the 'nid', for users this is the 'uid', etc. <strong>Without a single primary key field (i.e. not a composite key), Views will not be able to utilize the table as a base table.</strong> If your table does not have a primary key field, it is not too difficult to just add a serial field to it, usually.</dd>
-<dt>title</dt>
-<dd>The title of this table in the UI. It should be singular and describe the object that this table contains from the perspective of the user.</dd>
-<dt>help</dt>
-<dd>A short piece of text to describe what object this table contains.</dd>
-<dt>database</dt>
-<dd>If this table is held in a different database from your Drupal database, specify it as a string in the exact same format as the settings.php file. This is a special purpose variable that will probably be only used in site specific code, and <b>it must be the same database type as your Drupal database</b>. Also, don't try to join it to any table that isn't in the same database. That'll just create all kinds of silly errors. For example:
-<pre>
- // In settings.php for your site
- // Your drupal (site) database needs to be called 'default'
- $db_url['default'] = 'mysqli://user:pass@host/drupal_db';
- $db_url['budget'] = 'mysqli://user:pass@host/other_db';
-</pre>
-Then when you are describing the external database in your base table you would write something like this:
-<pre>
- $data[$table]['table']['base'] = array(
- 'field' => 'Primary key',
- 'title' => t('Field name'),
- 'help' => t('Field description'),
- 'database' => 'budget',
- 'weight' => -10,
- );
-</pre>
-</dd>
-</dl>
-
-<h3>Linking your table to existing base tables</h3>
-For Views to use your table, it has to either be a base table, or know how to link to an existing base table. Or sometimes both. Views uses this information to create a path to the base table; when the table is added to the query, Views will walk along this path, adding all tables required into the query.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/node-term_node-term_data-large.png"><img src="path:images/node-term_node-term_data.png" /></a>
-<em>How term_data joins to node</em>
-</div>
-
-In the above example, to use these with 'node' as the base table, both 'term_data' and 'term_node' need to be defined, and they each need a join handler for node:
-
-<pre>
-$data['term_data']['table']['join']['node'] = array(
- 'left_table' =&gt; 'term_node',
- 'left_field' =&gt; 'tid',
- 'field' =&gt; 'tid',
-);
-</pre>
-
-The above can be read as "In order to join to the node table, the term_data table must first link to the term_node table, and they join on the 'tid' field.". When adding this table to the query for a node view, Views will look at this and then look for the term_node table.
-
-<pre>
-$data['term_node']['table']['join']['node'] = array(
- 'left_field' =&gt; 'nid',
- 'field' =&gt; 'nid',
-);
-</pre>
-
-Above, the fact that 'left_table' is left out lets us know that term_node links directly to the node table, using the 'nid' field on both sides of the join.
-
-Quite a few more fields are available in this definition:
-<dl>
- <dt>handler</dt>
- <dd>The name of the handler object to use. Defaults to 'views_join'. You may create custom join handlers that may or may not use any of the data below, as they see fit.</dd>
- <dt>table</dt>
- <dd>Table to join. This is optional, and should only be used if the table being referenced is an alias.</dd>
- <dt>field</dt>
- <dd>Field to join on. This is required.</dd>
- <dt>left_table</dt>
- <dd>The next step toward the final destination. If this is the final destination it may be omitted.</dd>
- <dt>left_field</dt>
- <dd>The field to join to on the left side. This is required.</dd>
- <dt>type</dt>
- <dd>Either LEFT (default) or INNER.</dd>
- <dt>extra</dt>
- <dd>Either a string that's directly added, or an array of items. Each item is, itself, an array:
- <dl>
- <dt>field</dt>
- <dd>Field or formula</dd>
- <dt>operator</dt>
- <dd>Similar to filters, this is the operator, such as &gt;, &lt;, =, etc. Defaults to = or IN.</dd>
- <dt>value</dt>
- <dd>Must be set. If an array, operator will be defaulted to IN.</dd>
- <dt>numeric</dt>
- <dd>If true, the value will not be surrounded in quotes, and %d will be used for its placeholder.</dd>
- <dt>extra type</dt>
- <dd> How all the extras will be combined. Either AND or OR. Defaults to AND.</dd>
- </dl>
- </dd>
-</dl>
-
-<h2>Describing fields on tables</h2>
-Aside from the special table tag, each table can also have an unlimited number of field designations; these correspond roughly to fields on the table, though it is very common to use non-fields to display data that isn't directly in a field, such as data arrived from formulae, or special links related to the object the table is part of.
-
-Each field is described in the view data with an array, keyed to the database name of the field. This array may contain some information fields, plus an entry in each of the five types of items Views has per field: argument, field, filter, relationship, sort. For example:
-
-<pre>
-$data['node']['nid'] = array(
- 'title' =&gt; t('Nid'),
- 'help' =&gt; t('The node ID of the node.'), // The help that appears on the UI,
- // Information for displaying the nid
- 'field' =&gt; array(
- 'handler' =&gt; 'views_handler_field_node',
- 'click sortable' =&gt; TRUE,
- ),
- // Information for accepting a nid as an argument
- 'argument' =&gt; array(
- 'handler' =&gt; 'views_handler_argument_node_nid',
- 'name field' =&gt; 'title', // the field to display in the summary.
- 'numeric' =&gt; TRUE,
- 'validate type' =&gt; 'nid',
- ),
- // Information for accepting a nid as a filter
- 'filter' =&gt; array(
- 'handler' =&gt; 'views_handler_filter_numeric',
- ),
- // Information for sorting on a nid.
- 'sort' =&gt; array(
- 'handler' =&gt; 'views_handler_sort',
- ),
-);
-</pre>
-
-The above example describes the 'nid' field on the 'node' table, providing 4 of the 5 handlers. Note that while field is normally expected to be the database name of the field, it doesn't have to be; you can use an alias (which is how you get multiple handlers per field) or something completely made up for items that aren't tied to the database. For example:
-
-<pre>
-$data['node']['edit_node'] = array(
- 'field' =&gt; array(
- 'title' =&gt; t('Edit link'),
- 'help' =&gt; t('Provide a simple link to edit the node.'),
- 'handler' =&gt; 'views_handler_field_node_link_edit',
- ),
-);
-</pre>
-
-The above handler definition an edit link to a node, but this isn't a field in and of itself. For aliased fields, here is another example:
-
-<pre>
-$data['users']['uid_current'] = array(
- 'real field' =&gt; 'uid',
- 'title' =&gt; t('Current'),
- 'help' =&gt; t('Filter the view to the currently logged in user.'),
- 'filter' =&gt; array(
- 'handler' =&gt; 'views_handler_filter_user_current',
- ),
-);
-</pre>
-
-The above definition provides an alternate filter handler on the uid field for the current user.
-
-The following items are allowed in the field definition:
-
-<dl>
-<dt>group, title, help</dt>
-<dd>As above, these fields are for the UI. If placed here, any of these fields will override a setting on the base table.</dd>
-<dt>real field</dt>
-<dd>If this field is an alias, the "real field" may be placed here, and the handler will never know the difference.</dd>
-
-<dt>field</dt>
-<dd>A handler definition for the "Field" section, which is a field that may be displayed in a view. The definition is an array; the contents of the array are completely up to the handler, other than the 'handler' definition. If omitted, handler will default to 'views_handler_field'.</dd>
-<dt>filter</dt>
-<dd>A handler definition for the "Filters" section, which will be used to apply WHERE clauses to the view. The definition is an array; the contents of the array are completely up to the handler, other than the 'handler' definition. If omitted, handler will default to 'views_handler_filter'.</dd>
-<dt>sort</dt>
-<dd>A handler definition for the "Sort criteria" section, which will be used to add an ORDER BY clause to the view. The definition is an array; the contents of the array are completely up to the handler, other than the 'handler' definition. If omitted, handler will default to 'views_handler_sort'.</dd>
-<dt>relationship</dt>
-<dd>A handler definition for the "Field" section, which is a way to bring in new or alternative base tables in the view. The definition is an array; the contents of the array are completely up to the handler, other than the 'handler' definition. If omitted, handler will default to 'views_handler_relationship'. The basic relationship handler requires 'base' and 'base field' to be set; 'base' and 'base field' represent the "right" half of the join that will use this field as the left side.</dd>
-<dt>argument</dt>
-<dd>A handler definition for the "Field" section, which is method of accepting user input from the URL or some other source. The definition is an array; the contents of the array are completely up to the handler, other than the 'handler' definition. If omitted, handler will default to 'views_handler_argument'.</dd>
-</dl>
-
-For more information about what handlers need/use what data, visit <a href="http://views.doc.logrus.com">the Views API site</a> and check out the available handlers.
diff --git a/help/api.html b/help/api.html
deleted file mode 100644
index 66e3f87..0000000
--- a/help/api.html
+++ /dev/null
@@ -1,22 +0,0 @@
-Views allows modules to describe their tables relationships to each other, as well as fields, filters, sort criteria and arguments via <strong>hook_views_data()</strong>. Whenever Views deems it necessary, this hook is called, the data aggregated together and cached. <strong>hook_views_data_alter()</strong> may also be used to modify existing data, changing other module's handlers or adding handlers to other module's tables.
-
-Views also allows modules to create new display types, style types, row styles, argument default handlers and argument validators via <strong>hook_views_handlers()</strong> and <strong>hook_views_plugins()</strong>.
-
-These hooks are kept in a file named MODULENAME.views.inc. This file is automatically included upon need, so there is no need to try and include this in hook_init or any other method of including .inc files. This file should store hook_views_data, hook_views_data_alter(), hook_views_plugins(), hook_views_handlers(), as well as any other hooks and subsidiary data that will only be used by your module when Views is active. All handlers and plugins provided by your module should be in separate .inc files.
-
-There are two similar files, MODULENAME.views_default.inc and MODULENAME.views_convert.inc which contain default views and views 1 to views 2 convert helpers, respectively.
-
-<h3>hook_views_api()</h3>
-<strong>In order for your files to be included, your module must first implement hook_views_api()</strong> in the main .module file. This module should return array of information. The following items may be returned:
-
-<dl>
-<dt><strong>api</strong></dt>
-<dd>This must appear; it should be the oldest API version that your module can work with. If Views is currently running an older version of the API, it will ignore your module's views integration. This is a good thing, as it will prevent code crashes, at the expense of your module's functionality disappearing.
-<br />
-You may find the current Views API version by calling <strong>views_api_version()</strong> which is implemented at the top of views.module. This version numbering starts at 2.0. Every time changes are made to the Views handlers and plugins or other aspects of the Views API, the number will tick up (by either .001, .01 .1 or 1 depending upon how major the changes are). Note that <strong>views_api_version()</strong> was introduced in Views 2.0-rc2 and may not exist prior to that version. You may use function_exists() to test to see if this function is there.
-<br />
-Often these versions are basically compatible with each other and Views won't care if your module implements 2.000, 2.001, 2.002, etc. Your module can request that it won't work with any version older than a given version, however. Views will determine, itself, if a newer version will work.
-</dd>
-<dt><strong>path</strong></dt>
-<dd>If your *.views*.inc files are not in the same directory as the .module file, then return the full path here. You should probably use something like drupal_get_path('module', 'yourmodulename') . '/includepath'.</dd>
-</dl>
diff --git a/help/argument.html b/help/argument.html
deleted file mode 100644
index 174a9e3..0000000
--- a/help/argument.html
+++ /dev/null
@@ -1,57 +0,0 @@
-Arguments are input. While they often come from the URL, <strong>they don't always</strong> so please don't be shocked when they don't. Each display type may have its own source for arguments. Block displays have no source of arguments at all; they cannot pull arguments from the URL, and often require use of the default argument PHP code in order to get arguments. The argument default plugins can be used to get arguments into a block view. See "Provide default", below.
-
-In general, arguments are used to filter the view, and in that sense they have a very close relationship to filters, but that isn't necessarily true for every argument. Arguments can be used for any purpose, really; the extent of what the argument does is up to the developer of the argument, but the arguments that come with Views are almost entirely filters.
-
-A typical use of an argument might be to reduce a view to a single node, a single user, or nodes with a given taxonomy term.
-
-<h3>Action to take if argument is not present</h3>
-<dl>
-<dt>Ignore</dt>
-<dd>The argument is removed from the view as though it weren't there and all results will be displayed.</dd>
-
-<dt>Hide view / Page not found</dt>
-<dd>The view will remove itself entirely if the argument is not present; for a block this means it simply won't a appear. For page views the View will return a 404 and present a "Page not found" error. </dd>
-
-<dt>Display empty text</dt>
-<dd>The value of the <a href=topic:views/empty-text>empty text</a> will be displayed.</dd>
-
-<dt>Summary</dt>
-<dd>The view will attempt to display a summary of arguments available, based upon the view, and provide links to the view with those arguments. Summaries have their own style handlers as well as options. The default summary style simply displays a list of arguments with a count of entries found per argument. This special mode is a very powerful part of Views.</dd>
-
-<dt>Provide default</dt>
-<dd>If no argument is given, a default argument can be selected. The method of choosing the default argument is selectable and pluggable.</dd>
-</dl>
-
-<h3>Wildcards</h3>
-All arguments have a 'wildcard', which is an argument that means to use all values. In practice, it is the same as 'Ignore' above, where the argument is simply removed and the view is created without the argument. The wildcard title is used in titles and breadcrumb trails.
-<h3>Default arguments</h3>
-Default argument selection is available <strong>only if the action to take is "Provide default"</strong>. When that is selected, a new fieldset will appear letting you choose what the default argument will be. Views provides the following default selectors by default (but other modules may add more):
-<dl>
-<dt>Fixed entry </dt>
-<dd>You may directly enter what the argument will be. This is not a variable, it will always be the same argument. </dd>
-<dt>Node ID from URL</dt>
-<dd>This will attempt to find a Node ID from the URL, and is primarily useful for the Node: ID argument (though other arguments that use Node IDs, such as the CCK Node Reference argument, will find it useful too). For example, when visiting the path 'node/1' or 'node/1/edit' it will know that the '1' in that path is a node ID and use it.</dd>
-<dt>User ID from URL</dt>
-<dd>Like Node ID from URL, this will attempt to find a user ID from the path. It also includes an option to look for a node and use the node author as the user ID.</dd>
-<dt>User ID from logged in user</dt>
-<dd>You can use this to easily default a menu item to the logged in user. For example, if you created the path 'blogs' and gave it a User: ID argument with this default, 'blogs' would go to the user's own blogs, and blogs/1 would go to User ID 1's blogs.</dd>
-</dl>
-
-Please bear in mind that the selection of default argument happens only if an argument is not provided. If using a display that has no argument source, such as a block, this will be the case 100% of the time. However, if using a display that reads arguments from the URL, this will happen only if the URL did not contain an argument.
-<h3>Argument validation</h3>
-Arguments can also have validators, which are pluggable systems used to ensure that arguments fit within certain parameters. When a validator is chosen, it may provide some settings for the validator, including the action to take if an argument is presented, but it fails to validate. These actions are generally the same as the default actions above, excluding the ability to provide another default.
-
-If a view provides a menu option, such as a tab, if the argument does not validate the tab will not appear.
-
-This sytem can have other validators plugged in; by default, Views provides:
-<dl>
-<dt>Basic validation</dt>
-<dd>Ensures that the argument is present. A PHP NULL value (from eg. PHP default argument code) will invalidate.</dd>
-<dt>Node</dt>
-<dd>Ensure that the argument is a valid Node ID. You may select which types of node the validator will accept.</dd>
-<dt>Taxonomy term</dt>
-<dd>Ensure that the argument is a valid taxonomy term. This includes options to limit to specific vocabularies and can transform the argument to the right type depending upon the actual argument. Set the Argument Type option to the actual type of data that the argument being used is expecting.</dd>
-<dt>PHP Code</dt>
-<dd>You may enter arbitrary PHP code, similar to the php block visibility code, to determine if the argument is valid or not.</dd>
-
-</dl>
diff --git a/help/display-attachment.html b/help/display-attachment.html
deleted file mode 100644
index 9963b25..0000000
--- a/help/display-attachment.html
+++ /dev/null
@@ -1 +0,0 @@
-Attachment displays are 'attached' to another display in the same view. When the display is visited, the attached display will also be rendered and may be placed before, after or both before and after the original display. Attachment displays are often useful for displaying an argument summary view along with a page display that accepts arguments. This can be used to provide a kind of glossary. \ No newline at end of file
diff --git a/help/display-block.html b/help/display-block.html
deleted file mode 100644
index 158cad0..0000000
--- a/help/display-block.html
+++ /dev/null
@@ -1,10 +0,0 @@
-Block displays will show up on your blocks administration page. Once a block display is created and saved, it can be enabled and positioned in your theme by visiting <strong>administer &gt;&gt; site building &gt;&gt; blocks</strong> and selecting it from the list.
-
-Blocks <strong>do not</strong> accept arguments from any source; the only way to get arguments to a block is to provide defaults to it, possibly via the PHP Code default setting.
-
-<ul>
-<li>Edit the argument in question; you may want to override this argument if you have multiple displays using it.</li>
-<li>Change the "Action to take if argument is not present" to "Provide default argument". This will bring up a new box called "Provide default argument options".</li>
-<li>The most common default argument type used for blocks is Node from URL, where it attempts to determine if the URL refers to a node, for example if visiting 'node/1' or 'node/1/edit'. User ID from URL is also very common.</li>
-<li>If you change the default argument type to 'PHP Code' (note: You must have permission to use PHP code on your site) you can enter PHP to define the argument needed. Simply return the argument.</li>
-</ul>
diff --git a/help/display-default.html b/help/display-default.html
deleted file mode 100644
index 309690a..0000000
--- a/help/display-default.html
+++ /dev/null
@@ -1,4 +0,0 @@
-The default display is primarily a display to store settings, and isn't actually used anywhere within the Views system. It is possible for external programs to use the default display, but if they do they will (hopefully) tell you which display they will be working with. The default display is also a convenient display to use to embed into your site using PHP snippets; this is useful, for example, in node content, but this is something that should generally only be done by administrators.
-
-In general, you probably want to add either a <a href="topic:views/display-page">page display</a> or a <a href="topic:views/display-block">block display</a>.
-
diff --git a/help/display-feed.html b/help/display-feed.html
deleted file mode 100644
index a5c0a65..0000000
--- a/help/display-feed.html
+++ /dev/null
@@ -1 +0,0 @@
-A feed display allows you to attach an RSS feed to a view. \ No newline at end of file
diff --git a/help/display-page.html b/help/display-page.html
deleted file mode 100644
index 30274ab..0000000
--- a/help/display-page.html
+++ /dev/null
@@ -1,3 +0,0 @@
-Page displays have a <a href="topic:views/path">path</a> and an optional <a href="topic:views/menu">menu</a> component. Page displays will be the primary content for the page, meaning they will be displayed in the main content area when you visit the URL that corresponds to the path.
-
-Page displays take their arguments from the URL. You can embed arguments into the URL using %; in previous versions of Views, this was '$arg'. For example, 'node/%/foo' will accept URLs such as 'node/1/foo'. \ No newline at end of file
diff --git a/help/display.html b/help/display.html
deleted file mode 100644
index cd4a24a..0000000
--- a/help/display.html
+++ /dev/null
@@ -1,7 +0,0 @@
-Displays tell Views where the output should go. By adding a display to a View, you can have your view appear as a page, or as a block, or even as an attachment to a different display on the view.
-
-Each display can have its own settings, but when it's created, a display will take all of its <em>basic settings</em> from the <strong>default display</strong> which all Views must have. For most settings, there is an <strong>override</strong> button that will override that single setting for the current display. Overridden settings will have a mark in the summary for that display.
-
-Please keep in mind that when you are editing a setting on a display that is not overridden, then by default you are editing that for all displays.
-
-For <strong>fields</strong>, <strong>arguments</strong>, <strong>sorts</strong>, <strong>filters</strong> and <strong>relationships</strong>, you can only override <em>all</em> of them or none of them. To do this, click on the header for the filters or the rearrange button. Once you override, the display will then have its own copies of the fields/filters/etc and changes to the defaults will not be reflected on your display. \ No newline at end of file
diff --git a/help/embed.html b/help/embed.html
deleted file mode 100644
index e39fbf5..0000000
--- a/help/embed.html
+++ /dev/null
@@ -1,24 +0,0 @@
-You can easily embed the results of a view into other parts of your site;
-either with code as a module, or in nodes or blocks as snippets. The
-easiest way is to use the function <strong>views_embed_view()</strong>:
-
-<code>/**
- * Embed a view using a PHP snippet.
- *
- * This function is meant to be called from PHP snippets, should one wish to
- * embed a view in a node or something. It's meant to provide the simplest
- * solution and doesn't really offer a lot of options, but breaking the function
- * apart is pretty easy, and this provides a worthwhile guide to doing so.
- *
- * @param $name
- * The name of the view to embed.
- * @param $display_id
- * The display id to embed. If unsure, use 'default', as it will always be
- * valid. But things like 'page' or 'block' should work here.
- * @param ...
- * Any additional parameters will be passed as arguments.
- */
-function views_embed_view($name, $display_id = 'default') {
-</code>
-
-To figure out the id of a display, hover your mouse over the tab to select that display. Everything after the '#views-tab-' is the id of that display. This ID is guaranteed never to change unless you delete the display and create a new one.
diff --git a/help/example-author-block.html b/help/example-author-block.html
deleted file mode 100644
index c85e443..0000000
--- a/help/example-author-block.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<p>In this example you will create a context-sensitive block that shows the titles of recent blog entries by an author when viewing one of their posts. This will demonstrate using Views <em>arguments</em> to dynamically filter a view's contents at display time.</p>
-
-<p>Before working through this example, enable the <strong>Blog</strong> module and populate some entries from a few different users.</p>
-
-<h3>Creating the View</h3>
-<p>The first step is creating a view for our recent blog entries block. Because the block will show the titles of blog entries, this view is considered a "Node" type. Go to <a target="_blank" href="/admin/build/views/add">add new view</a>, enter the following properties, and click <strong>Next</strong>:</p>
-
-<dl>
- <dt>View name</dt>
- <dd>recent_blog_entries</dd>
- <dt>View description</dt>
- <dd>List of recent blog entries for a given author.</dd>
- <dt>View tag</dt>
- <dd>blog</dd>
- <dt>View type</dt>
- <dd>Node</dd>
-</dl>
-
-<h3>Generating a list of blog entries</h3>
-<p>It will be much easier to see the view progress if we can see it doing something. In this section, we will create a basic view displaying blog entry titles.</p>
-
-<ol>
-<li>In the third column, locate the <strong>Fields</strong> area. Generally speaking, fields are the pieces of information that you want to display in the view (in this case, node title). Click the <strong>+</strong> icon to add a field.</li>
-<li>Scroll down to <strong>Defaults: Add fields</strong>, below the settings table. A large selection of fields will be available.</li>
-<li>In the <strong>Groups</strong> drop-down menu, select <em>Node</em>. This will limit the list to only the default fields exposed by Node module.</li>
-<li>Scroll down the list, select the <em>Node: Title</em> field, and click <strong>Add</strong>.</li>
-<li>You will now be presented with settings for the <em>Node: Title</em> field. Delete the label from the <strong>Label</strong> field, so that each individual node title is not prefixed with the word "Title." Additionally, check the <em>Link this field to its node</em> box so that visitors who see an interesting title can click directly on it to read the blog entry to which it belongs.</li>
-<li>When finished, click <strong>Update</strong>. If you scroll down to the <strong>Live Preview</strong> section, you should now see a list of several node titles; however both blog entries and other node types will be in the list. Let's fix that.</li>
-<li>In the fourth column, locate the <strong>Filters</strong> area. Filters limit the results displayed in the view, and we can use this to our advantage here by showing node titles only from blog entries and not every type of node. Click the <strong>+</strong> icon to add a filter.</li>
-<li>As before, scroll down to the <strong>Defaults: Add filters</strong> section, select <em>Node</em> from the <strong>Groups</strong> select box to limit the list of options to only those exposed by Node module.</li>
-<li>Scroll down and select the <em>Node: Type</em> field and click <strong>Add</strong>. In the settings page that appears, leave <strong>Operator</strong> as <em>Is one of</em> and select <em>Blog entry</em> under <strong>Node type</strong>. Click <strong>Update</strong> when finished.</li>
-<li>Now, by scrolling down to <strong>Live preview</strong>, you'll see that the list only shows blog entries.</li>
-</ol>
-
-<h3>Adding context with arguments</h3>
-<p>While filters are very useful for limiting the results of a view when the condition is always consistent (for example, a view of blog entry nodes should <em>always</em> be filtered by the blog entry type), something filters can't do is smart decision-making based on the page context. In our case, we want the view to display a different list of blog entries when looking at a post by user 'admin' than we do when looking at a post by user 'member', and filters won't be able to help.</p>
-
-<p>Luckily, there's another way to filter a view's content: <em>arguments</em>. Through arguments, Views are able to obtain additional context (typically via dynamic URLs with IDs in them) and can take this context into consideration when displaying the view.</p>
-
-<p>Let's walk through adding and configuring an argument to our view so that we can change its contents based on post author.</p>
-
-<ol>
-<li>In the third column, locate the <strong>Arguments</strong> area. Click the <strong>+</strong> icon to add an argument.</li>
-<li>Because we are basing the view around content <em>authors</em>, this time under <strong>Groups</strong> select <em>User</em>. Check <em>User: Uid</em> and click <strong>Add</strong>.</li>
-<li>The <strong>Defaults: Configure Argument User: Uid</strong> settings page has a lot going on, but only a few things that need our attention.</li>
-<li>The <strong>Title</strong> field here, unlike the Title field under <em>Basic Settings</em>, can be based upon the context that the view is being displayed in. Change the title to 'Recent entries by %1.' %1 will later be expanded to the user's name (based on the User: Uid argument) when the view is displayed.</li>
-<li>Under <strong>Action to take if argument is not present</strong>, there are a variety of options, ranging from displaying a 404 or a 403 page to simply displaying all values in the view. In our case, if an argument isn't specified (which it won't be, since this view will be displayed in a sidebar block, not as a page with its own URL), we want to give it a default one to act on. Select <em>Provide default argument</em>.</li>
-<li>Assuming JavaScript is enabled in your browser, you should now get another selection for <strong>Default argument type</strong>. Select <em>User ID from URL</em>, which will then provide a new option, <em>Also look for a node and use the node author</em>. Select it. This will cause Views to first see if it can figure out a user ID from the current URL (for example, user/1). If it can't, it will instead check to see if the current page is a node page (such as node/42) and, if so, take the user ID from the node's author field instead.</li>
-<li><strong>Validator options</strong> provide a useful way to control what kind of arguments your view will accept. Select <em>User</em> as the <strong>Validator</strong>. By default, changing this setting will check the incoming argument and ensure it's a valid user ID; if not, the view will be hidden from the page.</li>
-<li>Once you have changed the argument's title, default argument, and validator options, click <strong>Update</strong> to save your changes.</li>
-<li>You'll notice that now the Live preview no longer shows anything. Did we just break the view? Fortunately, no. It's merely abiding by our wishes to hide itself if there is no valid user ID given to it. Try entering a '1' in the <strong>Arguments</strong> box and clicking <strong>Preview</strong>. You should now see a list of only user 1's blog entries.</li>
-</ol>
-
-<h3>Creating the block</h3>
-<p>So the live preview is now showing basically what we want. There's just one problem: we have no way to stick what we've done so far into a sidebar block! Let's fix that by adding a new <strong>Display</strong>.</p>
-
-<ol>
-<li>In the first column, under <strong>Defaults</strong>, there is a select box containing entries such as <em>Page</em>, <em>Feed</em>, and, yes, <em>Block</em>! Select <em>Block</em> and click <strong>Add display</strong>.</li>
-<li>There's not much else to do here as far as Views is concerned. Under <strong>Block settings</strong>, click the <em>None</em> link next to <strong>Admin</strong> and fill in a description for the block in the administrative interface, such as: 'Recent blog entries by author.' and click <strong>Update</strong>.</li>
-<li>Save your work by clicking the <strong>Save</strong> button at the bottom of the Views interface. You should receive a message that the view has been saved.</li>
-<li>Next, navigate to the <a target="_blank" href="/admin/build/block">blocks interface</a> and drag the 'Recent blog entries by author' block to the right sidebar region (or similar) and click <strong>Save blocks</strong>.</li>
-<li>You'll notice this appeared to do nothing. No block shows in the sidebar. But remember, we are looking at an adminitrative page; we are not looking at a page that would provide a user ID context. Navigate to the <a target="_blank" href="/blog">main blog listing</a> and click on an entry there. You should now see a sidebar block, titled something like "Recent entries by admin," with a list of blog entries beneath it.</li>
-</ol>
-
-<h3>Finishing touches</h3>
-<p>There are still a few remaining things to do before our view is complete. For example, we said that the block was to show <em>recent</em> blog entries, but instead it's showing them in the order they were entered, with oldest on top. Additionally, even unpublished entries are showing in the list currently.</p>
-
-<ol>
-<li>Return to the <a target="_blank" href="/admin/build/views/edit/recent_blog_entries">recent_blog_entries view edit page</a>.</li>
-<li>Add an additional filter by clicking the <strong>+</strong> icon in the <strong>Filters</strong> section in the fourth column.</li>
-<li>Change <strong>Groups</strong> to <em>Node</em> and select <em>Node: Published</em>. Click <strong>Add</strong>.</li>
-<li>Under the <strong>Published</strong> selection, choose <em>Yes</em> and click <strong>Update</strong>.</li>
-<li>To handle sorting, locate the <strong>Sort criteria</strong> area, just above filters, and click the <strong>+</strong> icon there.</li>
-<li>Under <strong>Groups</strong>, again select <em>Node</em>. From the list of options, check <em>Node: Post date</em> and click <strong>Add</strong>.</li>
-<li>In the settings page, change <strong>Sort order</strong> to <em>Descending</em>. This will place the newer posts on top of the older ones. Click <strong>Update</strong> when finished.</li>
-<li>Finally, <strong>Save</strong> the view for your new settings to take effect.</li>
-</ol>
diff --git a/help/example-recent-stories.html b/help/example-recent-stories.html
deleted file mode 100644
index ef8dd6a..0000000
--- a/help/example-recent-stories.html
+++ /dev/null
@@ -1,57 +0,0 @@
-In this example you will create a list of nodes of the content type "story", to be shown in a block. Through this step-by-step process, you will become familiar with some basic steps in creating a view, and familiarize yourself with the Views User Interface.
-
-<ol>
-<li><h3>Creating a new view</h3>
-<p>Go to <a target="_blank" href="base_url:admin/build/views/add">add new view</a>. Give your new view the name 'recent_stories', description 'Recent Stories', tag 'story', type 'Node' and click <strong>Next</strong>.</p></li>
-<li><h3>About the interface</h3>
-<p>You have been brought to Views User Interface. As you start, you are editing the "Default" options for the view. In the 1st column on the left you can see the drop-down menu offers 'block', for example, to select settings specific only to block views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options will then appear below this main area. Most likely, you will need to scroll a bit to see the options appear.</p></li>
-<li><h3>Selecting the fields to display</h3>
- <ol>
- <li>In 3rd column locate the <strong>Fields</strong> options. Click the <strong>+</strong> icon to add fields.</li>
- <li>Scroll down to <strong>Defaults: Add fields</strong>. In the <strong>Groups</strong> drop-down menu select 'Node', then check the following two fields: <em>Node: Post date</em>, <em>Node: Title</em>. Then click <strong>Add</strong>.</li>
- <li>You will be taken through the fields you added one at a time. Make the changes specified below.
- <ul>
- <li>For the <em>Post date</em> field: Delete the 'Post date' label. Change the <strong>Date format</strong> to <em>Custom</em>, and the <strong>Custom date format</strong> to 'F j, Y, g:i a' (do not type the single quotes; for the meaning of these letter codes, click on <em>the PHP docs</em> link under that box to arrive at the explanation). Click <strong>Update</strong>.</li>
- <li>For the <em>Title</em> field: Delete the 'Title' label. Select <em>Link this field to its node.</em> Click <strong>Update</strong>.</li>
- </ul>
- </li>
- <li>Scroll back up to <strong>Fields</strong> and click the <strong>&uarr;&darr;</strong> icon to rearrange fields.</li>
- <li>Drag the four-sided arrow next to <em>Node: Title</em> so that it appears above <em>Node: Post date</em>. Click <strong>Update</strong> to save the new field order.</li>
- </ol>
-</li>
-<li><h3>Filtering to <em>story</em> nodes only</h3>
- <ol>
- <li>Click the <strong>+</strong> icon next to <strong>Filters</strong>.</li>
- <li>In the <strong>Groups</strong> drop-down menu select 'Node', then check the <em>Node: Published</em> and <em>Node: Type</em> filters, and click <strong>Add</strong>.</li>
- <li>Select the <em>Published</em> checkbox. Click <strong>Update</strong></li>
- <li>Select <em>Is one of</em> and check <em>Story</em> in the <em>Node Type</em> field. Click <strong>Update</strong>.</li>
- </ol>
-</li>
-<li><h3>Sorting to show most recent first</h3>
- <ol>
- <li>Scroll up to <strong>Sort criteria</strong> and click the <strong>+</strong> icon.</li>
- <li>In the <strong>Groups</strong> drop-down menu below, select 'Node', then check <em>Node: Post date</em>, and click <strong>Add</strong>. Alternatively, you may instead check <em>Node: Last comment time</em>, or <em>Node: Updated/commented date</em>, or <em>Node: Updated date</em>.</li>
- <li>Select <em>Descending</em> <strong>Sort order</strong>. Click <strong>Update</strong>.</li>
- </ol>
-</li>
-<li><h3>Refining the basic settings</h3>
- <ul>
- <li>In 1st column under <strong>Basic settings</strong> locate these options:
- <ul>
- <li><em>Items to Display</em> setting, click <em>10</em>. Change the '10' to '4'. Click <strong>Update</strong></li>
- <li><em>Style</em> setting, click <em>Unformatted</em>. Change to <em>List</em>. Click <strong>Update</strong>.</li>
- </ul>
- </li>
- </ul>
-</li>
-<li><h3>Adding a block display for custom options</h3>
- <ol>
- <li>In the dropdown on the left, ensure that <em>Block</em> is selected, and click <strong>Add Display</strong>.</li>
- <li>Under <strong>Block settings</strong>, click the <em>None</em> link next to the <em>Admin</em> setting. Change <strong>Block: Block admin description</strong> to 'Recent Stories'.</li>
- </ol>
-</li>
-<li><h3>Saving the view</h3>
-<p>Click <strong>Save</strong> to save your work.</p></li>
-<li><h3>Instructing Drupal to show the block</h3>
-<p>Finally, you should tell Drupal to show this block. Configure your block by going to <a target="_blank" href="base_url:admin/build/block">admin/build/block</a>. Locate the block in the list: it is labeled <em>Recent Stories</em>. Place this block in a region and click <strong>Save</strong>. You may click <em>Configure</em> to set a different title, to determine which roles can view the block, and on which pages it appears; If you want your block on the front page only, enter '&lt;front&gt;'.</p></li>
-</ol>
diff --git a/help/example-user-feed.html b/help/example-user-feed.html
deleted file mode 100644
index 613bd91..0000000
--- a/help/example-user-feed.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<p>In this example you will create a <em>Feed display</em> to show nodes by individual users, dynamically selected through the URL. You will become familiar with the Views 2 interface, as well as learn how to use an argument to pull in a user name and use it in a dynamically created path.</p>
-<p>A <em>feed</em> is a data format that places your site's content into a file that can be read and displayed by news reader programs. When visiting a site, you may notice a small <a href="http://drupal.org/misc/feed.png">RSS transmission icon</a>, whereby clicking on it, you can subscribe to the site's most recent content. This makes it easier for your visitors to keep up to date with your website. You can also use this format to aggregate information into other sites. For more information, please watch a video from Common Craft about <a href="http://www.commoncraft.com/rss_plain_english">RSS in plain English</a>.</p>
-<p>Note, Drupal automatically creates a feed for your website, but you may want to create feeds with specific information. In this case, a list per user. </p>
-<ol>
- <li>
- <h3>Creating a new view </h3>
- <ol>
- <li>Go to <a target="_blank" href="/admin/build/views/add">add new view</a>. Give it the name 'user_feed', description 'A feed of user nodes.', tag 'users', type 'Node' and click Next.</li>
- </ol>
- </li>
- <li><strong>About the Interface.</strong> You have been brought to the Views User Interface. As you start, you are editing the &quot;Default&quot; options for the view. In the 1st column on the left- you can see the pull-down menu offers 'Feed', for example, to select settings specific only to RSS views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options appear below this main area. Most likely, you will need to scroll to see the options appear. As you make changes, these options will appear in bold until you save your view.</li>
- <li>
- <h3>Change default display</h3>
- <ol>
- <li>Under <strong>Basic Settings</strong> in the 2nd column, click <em>Row style: Fields</em></li>
- <li>A menu loads below, <em>Defaults: How should each row in this view be styled</em>, check the <em>Node</em> option, and click <strong>Update</strong>.</li>
- <li>This loads another options menu, <em>Defaults: Row style options</em> click <strong>Update</strong>.</li>
- </ol>
- </li>
- <li>
- <h3>Create the RSS view </h3>
- <ol>
- <li>In the 1st column, select 'Feed' in the drop-down menu, and click <strong>Add Display</strong>.</li>
- <li>Under <strong>Basic Settings </strong>in the 2nd column, click<em> Row style:Missing style plugin</em></li>
- <li>Note, options appear below the Views Interface, you may need to scroll to see <em>Feed: How should each row in this view be styled</em><br />
- tick <strong>Node</strong>, then <strong>Update</strong></li>
- <li>This loads the next options menu- <em>Display type: </em>select &quot;Use default RSS settings&quot;, click <strong>Update</strong>.</li>
- </ol>
- </li>
- <li>
- <h3>Set the path for accessing your feed</h3>
- <ol>
- <li> In the 2nd column under <strong>Feed settings</strong>, click <em>Path: None </em></li>
- <li>In options below <em>Feed: The menu path or URL of this view</em> enter in the path with an argument feeds/%/rss.xml</li>
- <li>Click <strong>Update</strong></li>
- </ol>
- </li>
- <li>
- <h3>Set up your arguments to say which user's nodes to display</h3>
- <ol>
- <li>To the right of <strong>Arguments</strong>, click the + sign to add and argument</li>
- <li>In the Feed: Add arguments menu that loads below, select User in the pull-down menu</li>
- <li>Check the box <em>User: Name</em>, click <strong>Add</strong></li>
- <li>Scroll down to options to find <strong>Case in path:</strong> select <em>Lower case</em></li>
- <li>Check the box <em>Transform spaces to dashes in URL</em></li>
- <li>Click <strong>Update default display</strong></li>
- </ol>
- </li>
- <li>
- <h3>Sort to show most recent at top of feed</h3>
- <ol>
- <li>Scroll up to <strong>Sort criteria</strong> in the right most column and click the + icon.</li>
- <li>In the <strong>Groups</strong> drop-down menu below, select 'Node', then check <em>Node: Post date</em>, and click <strong>Add</strong>. </li>
- <li>Select <em>Descending</em> <strong>Sort order</strong>. Click <strong>Update</strong>.</li>
- </ol>
- </li>
- <li>
- <h3>Set filters to hide unpublished entries</h3>
- <ol>
- <li>Click the + icon next to <strong>Filters</strong>. In the options below, select <em>Node</em> under <strong>Groups</strong> drop-down menu, choose the <em>Node: Published</em> filter, and click <strong>Add</strong>.</li>
- <li>Check the box <em>Published</em>. Click <strong>Update default display</strong></li>
- </ol>
- </li>
- <li>
- <h3>Test</h3>
- <ol>
- <li>Click <strong>Save</strong></li>
- <li>Under <strong>Live preview</strong> type in the name of a user, in lowercase, replacing spaces with dashes, click <strong>Preview</strong>.</li>
- <li>You should test and find your feeds at URLs like http://yoursite.com/feeds/user-name/rss.xml</li>
- <li>You can use this path for aggregating on another site. You can also attach the RSS feed to another display of view to make the feed link appear on that display.</li>
- </ol>
- </li>
-</ol> \ No newline at end of file
diff --git a/help/example-users-by-role.html b/help/example-users-by-role.html
deleted file mode 100644
index ae9e1c6..0000000
--- a/help/example-users-by-role.html
+++ /dev/null
@@ -1,47 +0,0 @@
-In this example you will create a page view listing users on your site. Through this step-by-step process, you will become familiar with some basic steps in creating a view, and familiarize yourself with the Views User Interface.
-
-<ol>
-<li><h3>Creating a new view</h3>
-<p>Go to <a target="_blank" href="base_url:admin/build/views/add">add new view</a>. Give your new view the name 'user_list', description 'A simple user listing.', tag 'users', type 'User' and click <strong>Next</strong>.</p></li>
-<li><h3>About the Interface</h3>
-<p>You have been brought to the Views User Interface. As you start, you are editing the "Default" options for the view. In the 1st column on the left you can see the drop-down menu offers 'block', for example, to select settings specific only to block views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options will then appear below this main area. Most likely, you will need to scroll to see the options appear. As you make changes, these options will appear in bold until you save your view.</p></li>
-<li><h3>Creating a page display; choosing a URL and creating a menu link</h3>
- <ol>
- <li>In the 1st column, ensure that 'Page' is selected in the drop-down menu, and click <strong>Add Display</strong>.</li>
- <li>Next we'll define the path for this page. A page must have a path, and we define it early so that Views doesn't warn us "Display Page uses path but path is undefined." Locate the <strong>Page settings</strong> in the 2nd column, and click the <em>None</em> link next to the <em>Path</em> setting. In the options editing area that appears below, set the path to 'user_list' (or something else if you prefer) and click <strong>Update</strong>.</li>
- <li>Next to <em>Menu</em> setting, Click the <em>No menu</em> link. In the options which appear below, select <em>Normal menu entry</em>, and set the title to 'User list' and click <strong>Update</strong>.</li>
- <li>Scroll up to <strong>Basic settings</strong>, in that same 2nd column, and click the <em>No</em> link next to <em>Use pager</em>. Below, in the options, select <em>Full pager</em> and click <strong>Update default display</strong>.</li>
- </ol>
-</li>
-<li><h3>Selecting the fields to display</h3>
- <ol>
- <li>In 3rd column locate the <strong>Fields</strong> options. Click the <strong>+</strong> icon to add fields.</li>
- <li>Scroll down to <strong>Defaults: Add fields</strong>. In the <strong>Groups</strong> drop-down menu select 'User', then check the following fields: <em>User: Created date</em>, <em>User: Delete link</em>, <em>User: Edit link</em>, <em>User: Last access</em>, <em>User: Name</em> and <em>User: Picture</em>. Then click <strong>Add</strong>.</li>
- <li>You will be taken through the fields you added one at a time. Click <strong>Update default display</strong> to go to each next field. Leave the default options on all fields except <em>Delete link</em>; change that field's label to 'Operations'.</li>
- <li>Scroll back up to <strong>Fields</strong> and click the <strong>&uarr;&darr;</strong> icon to rearrange fields. Down below, drag the <em>Name</em> field, by dragging its four-sided arrow, to the top. Drag the <em>Delete link (Operations)</em> field to the bottom, and the <em>Edit link</em> field just above it. Then click <strong>Update</strong>.</li>
- </ol>
-</li>
-<li><h3>Seeing what we've done so far</h3>
-<p>At this point, you have done enough to create a valid view. If you scroll down, you will see a preview of your view. If it doesn't show already, click the <strong>Preview</strong> button; but generally this display updates automatically whenever you finish working in one of the mini forms.</p></li>
-<li><h3>Styling the view as a table; combining related fields into columns</h3>
- <ol>
- <li>Under <strong>Basic settings</strong>, in the 1st column, click the <em>Unformatted</em> link next to the <em>Style</em> setting. In the options below, under <strong>Page: How should this view be styled</strong>, choose <em>Table</em> and click <strong>Update default display</strong>.</li>
- <li>You will be taken to a <strong>Page: Style options</strong> form to edit the table settings. Locate our <em>Edit link</em> field in this mini form, and notice the <strong>Column</strong> drop-down. Change this drop-down to show <em>Operations</em>. In the <strong>Separator</strong> column next to the <em>Operations</em> field, type ' | ' (note the spaces around the <strong>|</strong> symbol). Check all of the <strong>Sortable</strong> checkboxes, and set <strong>Default sort</strong> to <em>Name</em>. When finished, click <strong>Update default display</strong>.</li>
- </ol>
-</li>
-<li><h3>Filtering the user list to exclude unwanted entries</h3>
- <ol>
- <li>Click the <strong>+</strong> icon next to <strong>Filters</strong>.</li>
- <li>In the <strong>Groups</strong> drop-down menu select 'User', then check the <em>User: Name</em> filter, and click <strong>Add</strong>.</li>
- <li>Select <em>Is not one of</em> and enter 'Anonymous' in the <strong>Usernames</strong> box. Click <strong>Update default display</strong>.</li>
- </ol>
-</li>
-<li><h3>Adding an argument to list users by role dynamically</h3>
- <ol>
- <li>Scroll up to <strong>Arguments</strong>, and click its <strong>+</strong> icon.</li>
- <li>Check the <em>User: Roles</em> argument, and click <strong>Add</strong>. Set the title to '%1' (don't type the quotes), and under <strong>Action to take if argument is not present</strong> select <em>Summary, sorted ascending</em>. Leave the other settings as they are. Click <strong>Update default display</strong>, and click <strong>Update</strong> through the prompts that follow to accept their default values.</li>
- </ol>
-</li>
-<li><h3>Saving the view</h3>
-<p>Finally, click the <strong>Save</strong> button to save your work. At the very top, click <strong>View "Page"</strong> to go to your new view!</p></li>
-</ol>
diff --git a/help/field.html b/help/field.html
deleted file mode 100644
index e563176..0000000
--- a/help/field.html
+++ /dev/null
@@ -1,5 +0,0 @@
-Fields are the individual pieces of data being displayed. Adding the fields <em>Node: Title</em>, <em>Node: Type</em>, and <em>Node: Post date</em> to a node view, for example, includes the title, content type and creation date in the displayed results).
-
-Fields may not appear on every display, because not all style plugins actually use fields. For example, the 'node' row plugin simply displays the node through Drupal's normal mechanisms, and fields are not involved.
-
-For the most part, the field settings should be self explanatory. Fields will appear in the order that they are arranged in, and they will usually appear with the label they are given. \ No newline at end of file
diff --git a/help/filter.html b/help/filter.html
deleted file mode 100644
index b4cb5a0..0000000
--- a/help/filter.html
+++ /dev/null
@@ -1,12 +0,0 @@
-Filters are used to reduce the data set that Views provides. That is to say, without any filters applied, Views will return all of your content. You don't want that, so at least some filters must be used.
-
-Some very commonly used filters:
-<ul>
-<li> The 'Node: Published' filter is used to restrict a node View to only nodes that are are have the 'published' box checked. This can be very important to prevent users from viewing content they should not have access to.</li>
-<li> The 'Node: Promoted to front page' filter can be used to show only nodes that have the 'promote to front page' turned on. </li>
-<li> The 'Node: Type' filter is useful for showing only certain types of nodes. Let's say you wanted users to see only nodes that were 'book' nodes, or a combination of 'book' nodes and 'staff-blog' nodes. This filter allows you to select exactly that.</li>
-<li> The 'User: Current' filter will show only nodes that the logged in user has authored.</li>
-<li> The 'Node: Post date' filter can be used to show only nodes posted before, after, or between a range of dates.</li>
-</ul>
-
-The above list is only a tiny fraction of the filters available in Views, referenced here to give an idea of the kinds of tasks filters can accomplish.
diff --git a/help/getting-started.html b/help/getting-started.html
deleted file mode 100644
index c184834..0000000
--- a/help/getting-started.html
+++ /dev/null
@@ -1,22 +0,0 @@
-For those new to Views, it can be a complex system that appears totally overwhelming. The good news is that the UI is designed to compartmentalize everything; this means that for the most part, you can ignore the parts you're not interested in. Start small and build your way up.
-
-Because of this, the edit UI can seem overwhelming at first, but there are really just a few things you <strong>have</strong> to know. The rest you can find through exploration. The Views Edit UI image, below, gives an overview of what you'll find on the edit UI.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/overview-ui-large.png"><img src="path:images/overview-ui-small.png" /></a>
-<em>The Views Edit UI</em>
-</div>
-
-Notes:
-1) Every view has a number of <a href="topic:views/display">displays</a> which represent where output will be placed. If you're familiar with the original Views 1, you could set a view to be a 'page', with a URL (path), or a block that could show up in a sidebar. With Views 2, you can add as many displays as you like. In addition, you have the <em>default</em> display which contains the basic settings, but doesn't actually show up anywhere.
-
-2) When you click on the link for an item, a form will open up. For browsers with smaller resolutions, you may have to scroll down a little to see this form. If a form is open, the item its attached to will be highlighted.
-
-3) <a href="topic:views/overrides">Overrides</a> mean that a particular display is <strong>not</strong> using default settings. When you create a new display, many of its settings will start off using default values. This will be indicated by italics and a lighter color. <strong>If you change these values without first overriding them, you will change the default value for all displays that use them.</strong>
-
-4) Some items, particularly styles, have additional settings. Ordinarily when you <em>update</em> a style, if it has additional settings you will automatically see that form next. Often, you will need to go directly to those settings.
-
-5) You can safely leave a view page to go and do other things. If you come back, the view will still be there, stored in a cache. Keep in mind, however, that while you do this, that view is <em>locked</em>, meaning another user cannot edit this view without breaking the lock. Breaking the lock will discard your changes.
-
-It helps to have something particular in mind that you want to accomplish when using Views. Here are a couple of ideas and a brief sketch of how to accomplish what you want.
-
diff --git a/help/images/node-term_node-term_data-large.png b/help/images/node-term_node-term_data-large.png
deleted file mode 100644
index 4fcd191..0000000
--- a/help/images/node-term_node-term_data-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/node-term_node-term_data.png b/help/images/node-term_node-term_data.png
deleted file mode 100644
index de1273c..0000000
--- a/help/images/node-term_node-term_data.png
+++ /dev/null
Binary files differ
diff --git a/help/images/overview-ui-large.png b/help/images/overview-ui-large.png
deleted file mode 100644
index 04fbe90..0000000
--- a/help/images/overview-ui-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/overview-ui-small.png b/help/images/overview-ui-small.png
deleted file mode 100644
index ed7595f..0000000
--- a/help/images/overview-ui-small.png
+++ /dev/null
Binary files differ
diff --git a/help/images/style-breakdown-large.png b/help/images/style-breakdown-large.png
deleted file mode 100644
index 698b8cc..0000000
--- a/help/images/style-breakdown-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/style-breakdown.png b/help/images/style-breakdown.png
deleted file mode 100644
index d7513a8..0000000
--- a/help/images/style-breakdown.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views1-admin-large.png b/help/images/views1-admin-large.png
deleted file mode 100644
index 06744bd..0000000
--- a/help/images/views1-admin-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views1-admin.png b/help/images/views1-admin.png
deleted file mode 100644
index 398c145..0000000
--- a/help/images/views1-admin.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views1-changeviewtype-large.png b/help/images/views1-changeviewtype-large.png
deleted file mode 100644
index 5c58d81..0000000
--- a/help/images/views1-changeviewtype-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views1-changeviewtype.png b/help/images/views1-changeviewtype.png
deleted file mode 100644
index 6b1798a..0000000
--- a/help/images/views1-changeviewtype.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-addaview-large.png b/help/images/views2-addaview-large.png
deleted file mode 100644
index bbad1b1..0000000
--- a/help/images/views2-addaview-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-addaview.png b/help/images/views2-addaview.png
deleted file mode 100644
index 546ea16..0000000
--- a/help/images/views2-addaview.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-adddisplay-large.png b/help/images/views2-adddisplay-large.png
deleted file mode 100644
index 51c3675..0000000
--- a/help/images/views2-adddisplay-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-adddisplay.png b/help/images/views2-adddisplay.png
deleted file mode 100644
index dff143e..0000000
--- a/help/images/views2-adddisplay.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-addfields-large.png b/help/images/views2-addfields-large.png
deleted file mode 100644
index b7c1ba5..0000000
--- a/help/images/views2-addfields-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-addfields.png b/help/images/views2-addfields.png
deleted file mode 100644
index e70c758..0000000
--- a/help/images/views2-addfields.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-addfieldsajax-large.png b/help/images/views2-addfieldsajax-large.png
deleted file mode 100644
index a9308a0..0000000
--- a/help/images/views2-addfieldsajax-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-addfieldsajax.png b/help/images/views2-addfieldsajax.png
deleted file mode 100644
index 3043d04..0000000
--- a/help/images/views2-addfieldsajax.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-admin-large.png b/help/images/views2-admin-large.png
deleted file mode 100644
index d262bc5..0000000
--- a/help/images/views2-admin-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-admin.png b/help/images/views2-admin.png
deleted file mode 100644
index c273363..0000000
--- a/help/images/views2-admin.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-changedisplaystyle-large.png b/help/images/views2-changedisplaystyle-large.png
deleted file mode 100644
index 09925df..0000000
--- a/help/images/views2-changedisplaystyle-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-changedisplaystyle.png b/help/images/views2-changedisplaystyle.png
deleted file mode 100644
index 5a82ea5..0000000
--- a/help/images/views2-changedisplaystyle.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-fieldspreview-large.png b/help/images/views2-fieldspreview-large.png
deleted file mode 100644
index e2730b4..0000000
--- a/help/images/views2-fieldspreview-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-fieldspreview.png b/help/images/views2-fieldspreview.png
deleted file mode 100644
index 5a41ab2..0000000
--- a/help/images/views2-fieldspreview.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-newview-large.png b/help/images/views2-newview-large.png
deleted file mode 100644
index 498627a..0000000
--- a/help/images/views2-newview-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-newview.png b/help/images/views2-newview.png
deleted file mode 100644
index b522d2c..0000000
--- a/help/images/views2-newview.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-rearrangefields-large.png b/help/images/views2-rearrangefields-large.png
deleted file mode 100644
index acfed4c..0000000
--- a/help/images/views2-rearrangefields-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-rearrangefields.png b/help/images/views2-rearrangefields.png
deleted file mode 100644
index 562df08..0000000
--- a/help/images/views2-rearrangefields.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-tablestyle-large.png b/help/images/views2-tablestyle-large.png
deleted file mode 100644
index 67e9e6b..0000000
--- a/help/images/views2-tablestyle-large.png
+++ /dev/null
Binary files differ
diff --git a/help/images/views2-tablestyle.png b/help/images/views2-tablestyle.png
deleted file mode 100644
index f899740..0000000
--- a/help/images/views2-tablestyle.png
+++ /dev/null
Binary files differ
diff --git a/help/menu.html b/help/menu.html
deleted file mode 100644
index 9fd34b5..0000000
--- a/help/menu.html
+++ /dev/null
@@ -1,21 +0,0 @@
-Page displays can hook into the Drupal menu system and provide <strong>menu links</strong> that will appear in the Navigation system as well as <strong>tabs</strong> that can be used to keep Views next to each other.
-
-For simple <strong>menu links</strong>, there is very little you need to do; simply select 'Normal menu entry' and fill in the text for the title. This will appear in the Navigation menu by default; you will need to visit the menu administration page to move this to another menu.
-
-Tabs are not quite so simple; there are some complex rules for using tabs in Drupal.
-<ol>
-<li> All tabs must have a parent, which is the next level up in the path hierarchy. For example, if the view path is 'example/taba' then the parent must be 'example'.
-<li> All tabs must have one and only one default tab; this is usually the same content as the parent.
-<li> If a parent does not exist, when creating the 'default' tab, Views will allow you to also create a parent item. It will automatically set up the URL for you when it does this.
-<li> Tab weight is used to control what order the tabs are displayed in. Lower numbers will display more to the left. For tabs whose numbers are the same, they will be displayed alphabetically.
-<li> Drupal only supports 2 levels of tabs, so be careful about trying to put tabs within tabs within tabs. That won't work.
-</ol>
-
-For example, if you have two views that you want to be tabs, you could set it up like this:
-<ul>
-<li> In the first view, set the path to 'tabs/tab1'. Set it to be the 'default tab', set the title to 'Tab 1' and the weight to 0.
-<li> Click update and you will be taken to a form that lets you define the parent. Since 'tabs' doesn't already exist in the system, select 'Normal menu item', and set the title to 'Tabs'.
-<li> On the second view, set the path to 'tabs/tab2'; set it to be a 'Menu tab', and set the title to 'Tab 2'.
-</ul>
-
-With this done, you will now have a Navigation link named 'Tabs' and when you click on it, you will go to the tabs, with 'Tab 1' being the default tab that appears. You can then click between Tab 1 and Tab 2.
diff --git a/help/new.html b/help/new.html
deleted file mode 100644
index 93b5dd5..0000000
--- a/help/new.html
+++ /dev/null
@@ -1,113 +0,0 @@
-Views 2 is the newest major release of Views and it is specifically coded for Drupal 6. Views 2 retains all of the core functionality of Views 1, together with a completely revamped user interface and a large set of new features which greatly expand upon the original feature-set of Views 1. This document is a side-by-side comparison of Views 1 versus Views 2 from a user's perspective, detailing the UI changes, some new ways to perform old tasks, the cool new features of Views 2 and how these features can be used to address some of the shortcomings of Views 1.
-
-<h2>Admin interface</h2>
-The first thing that pops out after you install Views 2 is the radically different admin interface:
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-admin-large.png"><img src="path:images/views2-admin.png" /></a>
-<em>Views 2 admin interface</em>
-</div>
-
-compared to the old comfy Views 1 interface:
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views1-admin-large.png"><img src="path:images/views1-admin.png" /></a>
-<em>Views 1 admin interface</em>
-</div>
-
-The new admin interface performs the same functions as the old -- listing all the views in the system, providing links to add or import views and a link to Views Tools -- but has been compacted, with each view displayed as a paragraph style-row compared to the table of Views 1 and set of filters on top to ease locating views among a large list.
-
-Context-help is available by clicking the small blue question-mark icon. Context-help in Views 2 is provided by the <a href="http://drupal.org/project/advanced_help">Advanced Help</a> module, so make sure to install that together with installing Views 2. The small blue help icons will be available in various parts of the Views UI. In particular, look for them as part of the description of a <strong>display</strong>, when setting <strong>style</strong> options, and in various editing sections such as <strong>path</strong>, <strong>menu</strong> and the like.
-
-Several new attributes of each view are visible in the filter header:
-<ol>
-<li><strong>Tag</strong> - This is just another label for organizing and sorting views. Tags can be any text. Views that are provided by modules will often be tagged together to make it easy to find them.</li>
-<li><strong>Display</strong> - In Views 1 each view query was tied to its display; in other words your fields, sorts, filters, and arguments could only be displayed in the single page or block display provided in the view definition. In Views 2, view displays have been decoupled from view queries - it is now possible to have multiple page, block, and feed displays from a single view. More on view displays later. </li>
-<li><strong>Type</strong> - Views 2 view types are radically different from Views 1 types. Views 1 types basically defined how the node list displays were <i>styled</i> - you had Full Nodes, Teaser List, Table View, and so on. In Views 2 view display styles have been broken out into the separate <i>Style</i> attribute. View types now refer to the primary table on which information for the query will be retrieved which controls what arguments, fields, sort criteria and filters are available. Views 2 view types are discussed later.
-</li>
-</ol>
-
-<h2>Adding a view</h2>
-So let's jump in and add a view. For this example, we're going to create a <strong>user</strong> view, which will display a list of users.
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-addaview-large.png"><img src="path:images/views2-addaview.png" /></a>
-<em>Adding a view</em>
-</div>
-
-The first step in adding a view is simply entering a name (only alphanumeric characters, no spaces) a description, tag, and the view type. To get the user view, we selected the <strong>User</strong> radio button.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-newview-large.png"><img src="path:images/views2-newview.png" /></a>
-<em>Configuring the new view</em>
-</div>
-
-This might be the 2nd whoa moment as the interface here is also completely revamped from Views 1.x. The best way to summarize is to say all the pieces from the Views 1.x interface are still there...just in different places. Fields, arguments, sort critera and filters are all still there there, just in new AJAXY-flavours.
-
-Let's start by adding some fields:
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-addfields-large.png"><img src="path:images/views2-addfields.png" /></a>
-<em>Adding fields</em>
-</div>
-
-Clicking on the [+] icon next to the word Fields unfurls a section beneath the view information with all the available fields grouped by Comment, File, Node, Node revision, Taxonomy and User, and probably a few others. This is a general paradigm for the Views 2 interface -- clicking on a widget or link unfurls a section beneath the view information with the relevant interface. Usually, what is being edited will be hilited in yellow, as well.
-
-When adding items, you can use the Groups drop-down box to show only a subset of the fields available according to the above groups, or select All to see all fields available, which is what was selected when the section unfurled. For our example, we're selecting the 'User' group and adding the <strong>User: E-mail</strong>, <strong>User: Name</strong> and <strong>User: Picture</strong> fields.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-addfieldsajax-large.png"><img src="path:images/views2-addfieldsajax.png" /></a>
-<em>Adding fields</em>
-</div>
-
-Once we add our fields they show up in the Fields section of the interface. We will be walked through each field we added, so keep clicking <strong>update</strong>, even if you don't make changes to the field and you will see the next one.
-
-The fields we added can be rearranged by clicking the up/down icon, right next to the add icon we used earlier. We can also remove a field using the same interface.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-rearrangefields-large.png"><img src="path:images/views2-rearrangefields.png" /></a>
-<em>Rearranging fields</em>
-</div>
-
-From here, the fields can be dragged up and down by grabbing the little drag handle on the left and moving them where you like. Making a change to any part of the view by clicking update usually triggers a refresh of the view preview which is conveniently located right below the main interface.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-fieldspreview-large.png"><img src="path:images/views2-fieldspreview.png" /></a>
-<em>Views preview</em>
-</div>
-
-Now that we have some fields set up we can turn our attention to Basic Settings for the view.
-
-It's important to note that all the interface elements pertain to the current <i>Display</i> selected for the view. As mentioned before a view can have multiple displays. The first time you create a view you'll be manipulating the <i>Default</i> display. You can add displays using the Add Display button, whose Basic Settings are completely different from each other; this lets you have as many displays of a view as you would like all sharing items such as Sort Criteria, Filters and Arguments but different display settings like Title, Style, Fields, and Pager settings. Also, any display you add automatically inherits display settings from the default display initially, so you can keep a core of common settings in your default display and add additional settings for every other display.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-adddisplay-large.png"><img src="path:images/views2-adddisplay.png" /></a>
-<em>Adding a <strong>Page</strong> display </em>
-</div>
-Let's stick with the Default display and twiddle some settings. We can set the <i>Title</i> to "User View 1" and the <i>Style</i> to Table. As mentioned earlier, view styles in Views 2 correspond more to view types in Views 1 (remember, List, Table, Teasers, Full nodes).
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views1-changeviewtype-large.png"><img src="path:images/views1-changeviewtype.png" /></a>
-<em>Selecting a Views 1 View Type</em>
-</div>
-
-In Views 2, view <i>styles</i> control how a view display looks. These styles are significantly different from the Types in Views 1; in particular, types have been 'broken up'; there is now the <em>style</em> as well as the <em>row style</em> which focus on different parts of the output.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/style-breakdown-large.png"><img src="path:images/style-breakdown.png" /></a>
-<em>A breakdown of View output</em>
-</div>
-
-We change the style by clicking on the current style on the left hand side of the View information area.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-changedisplaystyle-large.png"><img src="path:images/views2-changedisplaystyle.png" /></a>
-<em>Selecting a Views 2 Display Style</em>
-</div>
-
-We're given the style options of <strong>Grid</strong>, <strong>List</strong>, <strong>Table</strong> and <strong>Unformatted</strong>. Additional display styles can be added by modules which have Views <i>style plugins</i>. Choosing a style reveals a "settings" button which you can click to configure the style you've chosen. In the shot below we've selected and are configuring the Table style, which we're using to produce a more compact output than we had earlier.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/views2-tablestyle-large.png"><img src="path:images/views2-tablestyle.png" /></a>
-<em>Selecting and configuring the table style</em>
-</div>
-
-... TODO: Finish this document ... \ No newline at end of file
diff --git a/help/overrides.html b/help/overrides.html
deleted file mode 100644
index 77a0af0..0000000
--- a/help/overrides.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-If an item is <strong>using defaults</strong> then it is using values from the <strong>default display</strong>. <em>IMPORTANT NOTE:</em> If you modify this value, you are modifying the <strong>default display</strong> and thus modifying for all displays that are using default values.
-
-If that is not what you intend, you must click the <strong>override</strong> button. Once overridden, that display now has its own version of the value; modifying it will not modify it for other displays.
-
-For <strong>Relationships</strong>, <strong>arguments</strong>, <strong>fields</strong>, <strong>sort criteria</strong>, and <strong>filters</strong>, each of these must be overridden as a group! In other words, you cannot override a single filter, but instead must override allr filters. A message will appear on the item to let you know what its status is, but you can only change the status by clicking on the header or the rearrange button for that item. \ No newline at end of file
diff --git a/help/path.html b/help/path.html
deleted file mode 100644
index 142534c..0000000
--- a/help/path.html
+++ /dev/null
@@ -1,7 +0,0 @@
-If a display has a path that means that it can be retrieved directly by calling a URL as a first class page on your Drupal site. Any items after the path will be passed into the view as arguments. For example, if the path is <strong>foo/bar</strong> and a user visits <strong>http://www.example.com/foo/bar/baz/beta</strong>, 'baz' and 'beta' will be given as arguments to the view. These can be handled by adding items to the <a href="topic:views/arguments">arguments</a> section.
-
-You may also use placeholders in your path to represent arguments that come in the middle. For example, the path <strong>node/%/someview</strong> would expect the first argument to be the second part of the path. For example, <strong>node/21/someview</strong> would have an argument of '21'.
-
-<em>Note:</em> Views 1 used <strong>$arg</strong> for this kind of thing. $arg is no longer allowed as part of the path. You must use % instead.
-
-If multiple displays <strong>within the same view</strong> have the same path, the user will get the first display they have access to. This means you can create successfuly less restricted displays in order to give administrators and privileged users different content at the same path. \ No newline at end of file
diff --git a/help/relationship.html b/help/relationship.html
deleted file mode 100644
index 0f89184..0000000
--- a/help/relationship.html
+++ /dev/null
@@ -1,13 +0,0 @@
-Relationships allow you to expand the query to include objects other than the base query. This is actually made more difficult to understand by the fact that Views actually includes a few relationships by default, and doesn't tell you they're there. For historical reasons, it would be inconvenient to remove these default relationships. When relationships are present, all fields (including relationships) will gain a new form item to let you select which relationship they will use. They will default to using no relationship at all.
-
-The main example of the relationship that is there by default is the node --&gt; user relationship; every node has an author, and if a node is in the query, the user who wrote that node is automatically made available. [Note: the author considers it an error that this relationship is automatic, but by the time it was realized this was in error, it was too late to change it.]
-
-A similar relationship that is <b>not</b> automatically made available is for node revisions. Each revision has its own author, which is the user who made the revision. By adding the "Node revision: User" relationship, all of the 'user' fields, sorts, filters and arguments available to a user will now be available for the revision author.
-
-When a relationship is added to the view, all applicable items will gain a "Relationship" select box, where you can choose which version of that particular item you wish to use. This can be illustrated with an example:
-
-A 'comment' view contains the relationships 'Comment: node' and 'Comment: user'. This means that all the fields for the node that a comment is attached to are available, and all the user fields for that node author also become available. The other relationship makes fields for the author of the comment available -- very often not the author of the node!
-
-When you add the "User: name" field, you will be presented with a select box. Either the node relationship or the user relationship must be selected, because there are two possible user names in the view to choose from.
-
-Another example of relationships involves the <strong>Files</strong> table. In Drupal, files are related to users, but files are not necessarily related to nodes. However, the upload.module allows some files to be attached to nodes. The only way for Views to deal with this discrepancy is with relationships. When creating a 'node' view, it's possible to add an uploaded files relationship to get file data for nodes that were attached with the upload module. It is also possible to go the other way; from a files view you may add a relationship via the Upload table to view information about the node.
diff --git a/help/sort.html b/help/sort.html
deleted file mode 100644
index 9a5640f..0000000
--- a/help/sort.html
+++ /dev/null
@@ -1,24 +0,0 @@
-Sort criteria determine what order the records are retrieved from the database and displayed in; generally, all you need to do is pick a field and choose ascending (1, 2, 3, 4) or descending (4, 3, 2, 1) and it will be done. If you have multiple sort criteria, the second (and later) items only come into play if the first item is the same.
-
-Different data types sort just a little bit differently from others:
-<dl>
-<dt>Number fields</dt>
-<dd>Number fields sort like you would expect. 1 comes before 2 which comes before 10 which comes before 100 which comes before 200, etc.</dd>
-<dt>Text fields</dt>
-<dd>Text fields always sort alphabetically, even if the text contains numbers. This can have some odd effects if you have numbers stored in text, because the values 1, 3, 7, 10, 12, 20, 100, 120 will sort like this:
-<ul>
-<li> 1 </li>
-<li> 10 </li>
-<li> 100 </li>
-<li> 12 </li>
-<li> 120 </li>
-<li> 200 </li>
-<li> 3 </li>
-<li> 7 </li>
-</ul>
-
-This is because these fields sort purely by characters, and not numeric value. i.e, comparing 200 and 3, the '2' comes before the '3', therefore, '200' is "smaller" than '3'.
-</dd>
-<dt>Date fields</dt>
-<dd>Date fields often can have a 'granularity', which is a way of making similar dates actually be the same date. Take two dates that are close to each other: <strong>May 1, 2007 5:30 am</strong> and <strong>May 1, 2007 9:45am</strong>. Without granularity, the two dates are compared and the first date comes before the second date. However, if the granularity is set to 'day' it only looks at the parts of the date up to the day: <strong>May 1, 2007</strong> and <strong>May 1, 2007</strong>. At that point, they are the same, and the sort would move on to the next sort criterion.</dd>
-</dl>
diff --git a/help/style-comment-rss.html b/help/style-comment-rss.html
deleted file mode 100644
index c047ee7..0000000
--- a/help/style-comment-rss.html
+++ /dev/null
@@ -1 +0,0 @@
-This row style is only available to RSS styles. It produces XML necessary for an RSS feed for the comment. \ No newline at end of file
diff --git a/help/style-fields.html b/help/style-fields.html
deleted file mode 100644
index 0afde7a..0000000
--- a/help/style-fields.html
+++ /dev/null
@@ -1,5 +0,0 @@
-The <strong>fields</strong> row style displays each field defined in the view, one after another. Each field defines its own output.
-
-By default, each field is put in a &lt;div&gt; unless it is selected to be <em>inline</em>. If it is inline, it is put in a &lt;span&gt;. Two items in &lt;div&gt;s will be displayed one after another, with the second one below the first. Two items in &lt;span&gt;s will be displayed on the same line. One item in a &lt;span&gt; next to &lt;div&gt;s is the same as two items in &lt;div&gt;s. This means that for the <em>inline</em> setting to do anything, at least two consecutive items must be set inline.
-
-You may define a separator which will be placed between each item. This separator may be html. You can use &amp;nbsp; to print blank space. \ No newline at end of file
diff --git a/help/style-grid.html b/help/style-grid.html
deleted file mode 100644
index 8667d0a..0000000
--- a/help/style-grid.html
+++ /dev/null
@@ -1,20 +0,0 @@
-The <strong>grid</strong> style will display each row of your view within a grid. You may customize the number of columns, though it defaults to 4. A grid looks like this:
-
-<table width="100%">
-<tr><td>row 1</td><td>row 2</td><td>row 3</td><td>row 4</td></tr>
-<tr><td>row 5</td><td>row 6</td><td>row 7</td><td>row 8</td></tr>
-<tr><td>row 9</td><td>row 10</td><td>row 11</td><td>row 12</td></tr>
-<tr><td>row 13</td><td>row 14</td><td>row 15</td><td>row 16</td></tr>
-</table>
-
-The above uses the 'horizontal' alignment, where rows are added into the grid from left to right.
-
-With a vertical alignment, rows will be placed from top to bottom, like this:
-<table width="100%">
-<tr><td>row 1</td><td>row 5</td><td>row 9</td><td>row 13</td></tr>
-<tr><td>row 2</td><td>row 6</td><td>row 10</td><td>row 14</td></tr>
-<tr><td>row 3</td><td>row 7</td><td>row 11</td><td>row 15</td></tr>
-<tr><td>row 4</td><td>row 8</td><td>row 12</td><td>row 16</td></tr>
-</table>
-
-This style uses a <a href="topic:views/style-row">row style</a> to determine what each row will look like. \ No newline at end of file
diff --git a/help/style-list.html b/help/style-list.html
deleted file mode 100644
index 0884338..0000000
--- a/help/style-list.html
+++ /dev/null
@@ -1,20 +0,0 @@
-The <strong>List</strong> view style will display every row of the view as part of an HTML list construct. For example:
-<ul>
-<li> Row 1 </li>
-<li> Row 2 </li>
-<li> Row 3 </li>
-<li> Row 4 </li>
-</ul>
-
-You may select whether or not the list is <em>ordered</em> which just means whether or not it uses numbers instead of the bullet:
-
-<ol>
-<li> Row 1 </li>
-<li> Row 2 </li>
-<li> Row 3 </li>
-<li> Row 4 </li>
-</ol>
-
-The list style also uses a <em>row style</em> which means that it doesn't care what the actual output for each row of the view is.
-
-If you need information about using CSS to style list views, you may find this <a href="http://www.alistapart.com/stories/taminglists/">A list apart guide to styling lists</a> useful. \ No newline at end of file
diff --git a/help/style-node-rss.html b/help/style-node-rss.html
deleted file mode 100644
index 9cce414..0000000
--- a/help/style-node-rss.html
+++ /dev/null
@@ -1 +0,0 @@
-This row style is only available to RSS styles. It produces XML necessary for an RSS feed for the node record. \ No newline at end of file
diff --git a/help/style-node.html b/help/style-node.html
deleted file mode 100644
index 393d1ca..0000000
--- a/help/style-node.html
+++ /dev/null
@@ -1,9 +0,0 @@
-The <strong>node</strong> row style will display each item of the view through Drupal's standard <em>node_view()</em> function. Views has very little control over this output, except for the options you see. Instead, the output is run through the standard node template mechanism (typically <strong>node.tpl.php</strong> or a variant thereof) and any decisions about what is output may be done there.
-
-Views does add an extra 'suggestion' to the list of possible node templates: <strong>node-view-VIEWNAME.tpl.php</strong> -- you may use this to theme a node specifically for the view. This can be handy for creating very small teasers and the like.
-
-You may opt to display the full node body or the node teaser, and you may add the node links (such as he 'comment' links that appear after a node) or not.
-
-Because of this behavior, <strong>the node row style does not utilize fields</strong> and the Fields section will not be displayed.
-
-<strong>Please note that this row style performs a node_load() for every row, and as such can produce a lot of extra queries.</strong> Sometimes this is necessary, but it can have a negative impact on your site's performance! \ No newline at end of file
diff --git a/help/style-row.html b/help/style-row.html
deleted file mode 100644
index 3eae5ac..0000000
--- a/help/style-row.html
+++ /dev/null
@@ -1,3 +0,0 @@
-A row style is an individual style to display only an individual record within a view. For example, a <strong>node</strong> type view would display one node per row; a <strong>user</strong> type view would display one user per row.
-
-Some row styles use <em>fields</em> which means you select from the available fields to display; others do not; they are able to use the base type and create a display. Usually, row styles that do not use fields <em>produce less efficient (slower) views</em>, so bear this in mind when contemplating the performance of your site. \ No newline at end of file
diff --git a/help/style-rss.html b/help/style-rss.html
deleted file mode 100644
index 0b18443..0000000
--- a/help/style-rss.html
+++ /dev/null
@@ -1,3 +0,0 @@
-The <strong>RSS</strong> output style is only available for <em>Feed</em> display types. It will display the view as an RSS feed, which is a specialized XML output. This output is not user visible, but can be parsed by feed readers for aggregation.
-
-You may supply a description for the RSS feed; most feed readers will display this description along with the contents of the feed. You may also select to use the site's mission statement for the description. \ No newline at end of file
diff --git a/help/style-summary-unformatted.html b/help/style-summary-unformatted.html
deleted file mode 100644
index 258acf5..0000000
--- a/help/style-summary-unformatted.html
+++ /dev/null
@@ -1,3 +0,0 @@
-The <strong>unformatted summary</strong> style is only available for <em>summary</em> styles, which are when an argument has been set to provide a summary if it was not provided with a value. This summary provides the possible candidates for the argument one after another with no special formatting. If <em>inline</em> is selected, the summary items will be enclosed within &lt;span&gt; tags. Otherwise the items will be in &lt;div&gt; tags.
-
-You can also elect to display the number of matching records for the argument, plus change the number of items per page for the summary. This is often useful because summary views are often quite small, but other views quite space intensive. It is very common to have far more records available in the summary view than in the more normal view. \ No newline at end of file
diff --git a/help/style-summary.html b/help/style-summary.html
deleted file mode 100644
index f5b01ec..0000000
--- a/help/style-summary.html
+++ /dev/null
@@ -1,3 +0,0 @@
-The <strong>list summary</strong> style is only available for <em>summary</em> styles, which are when an argument has been set to provide a summary if it was not provided with a value. This summary provides a list of possible candidates for the argument in a standard HTML list. Like the normal list style, you may set this list to be ordered or not.
-
-You can also elect to display the number of matching records for the argument, plus change the number of items per page for the summary. This is often useful because summary views are often quite small, but other views quite space intensive. It is very common to have far more records available in the summary view than in the more normal view. \ No newline at end of file
diff --git a/help/style-table.html b/help/style-table.html
deleted file mode 100644
index b8ade8a..0000000
--- a/help/style-table.html
+++ /dev/null
@@ -1,13 +0,0 @@
-The <strong>table</strong> style will display the View results as a table; each row of the table will correspond to a row from the view result.
-
-When setting the table options, each field in the view will be presented with some information next to each field:
-<dl>
-<dt> <strong>Column</strong> </dt>
-<dd> By default, each field is its own column. However, you can place multiple fields in the same column. To do this, pick which field you want to represent the column, then pick another field and set the 'column' value to that field. You can place as many fields as you like in a single column, but only the main field in a column can be click-sorted.</dd>
-<dt> <strong>Separator</strong> </dt>
-<dd> If you have multiple fields in the same column, the separator will be placed between each one. At the very least, &amp;nbsp; should be used, as without the separator the fields will be placed very close to each other. Common separators are a bullet, the | symbol, and a comma. If there are no other fields in the column, the separator will have no effect.</dd>
-<dt> <strong>Sortable</strong> </dt>
-<dd> If checked, the header for the column will be clickable, and the user may re-sort the table by clicking on this to sort by that field. At this time Views does not support click-sorting to sort by multiple columns at the same time.</dd>
-<dt> <strong>Default sort</strong> </dt>
-<dd> You may select a column which will be sorted by default when the table is first viewed. This column will be highlighted to the user. You may also select whether the default sort is ascending or descending.</dd>
-</dl> \ No newline at end of file
diff --git a/help/style-unformatted.html b/help/style-unformatted.html
deleted file mode 100644
index 99fa3de..0000000
--- a/help/style-unformatted.html
+++ /dev/null
@@ -1 +0,0 @@
-The unformatted output style simply places each row of the view, one after another, with no additional formatting.
diff --git a/help/style.html b/help/style.html
deleted file mode 100644
index ed9ac42..0000000
--- a/help/style.html
+++ /dev/null
@@ -1,13 +0,0 @@
-The Views' <strong>style</strong> system is how you customize the output produced by your view. A view style is basically a smart theme template that processes the view data and then outputs it. All styles in Views can be <a href="topic:views/using-theme">overridden</a> by placing copies of the templates in your theme directory and then modifying them. See the <a href="topic:views/analyze-theme">theme: information</a> link available on all views to get hints for which templates a given view is using.
-
-<div class="help-box" style="text-align:center">
-<a href="path:images/style-breakdown-large.png"><img src="path:images/style-breakdown.png" /></a>
-<em>A breakdown of View output</em>
-</div>
-By default, the style is <em>unformatted</em>, which means that there is very little style actually used; the records are simply displayed one after another, enclosed in a &lt;div&gt; tag so that you can use <a href="topic:views/theme-css">CSS to manipulate the view</a>.
-
-Some styles use a separate <a href="topic:views/style-row">row style</a> to determine how each row of the View looks. This is useful for mixing and matching styles to more readily produce exactly the kind of output you need.
-
-Many styles can be <strong>grouped</strong>. For styles that can, there will be a 'grouping field' option; pick one of the fields to group by. This grouping field will be displayed as a header, and all rows will be displayed beneath it.
-
-Each style is its own entity. \ No newline at end of file
diff --git a/help/theme-css.html b/help/theme-css.html
deleted file mode 100644
index 3be998f..0000000
--- a/help/theme-css.html
+++ /dev/null
@@ -1,75 +0,0 @@
-Views uses a wide array of CSS classes on all of its content to ensure that you can easily and accurately select exactly the content you need in order to manipulate it with CSS.
-
-Typically, every view is wrapped in a div with the name of the view as part of its class (for all these examples, we will assume the name of the view is <strong>myview</strong>), as well as the generic class 'view':
-
-<pre>
-&lt;div class="view view-myview"&gt;
-...
-&lt;/div&gt;
-</pre>
-
-In your CSS, you can modify all views:
-
-<pre>
-div.view {
- border: 1px solid black;
-}
-</pre>
-
-Or just your view:
-
-<pre>
-div.view-myview {
- background: yellow;
-}
-</pre>
-
-By default, the general view template also provides the following classes to easily style other areas of the view:
-<ul>
-<li> .view-header </li>
-<li> .view-filters </li>
-<li> .view-content </li>
-<li> .view-empty (if an "empty" text is used when the view has no results) </li>
-<li> .view-footer </li>
-<li> .feed-icon </li>
-<li> .attachment-before (if using an "attachment" display)</li>
-<li> .attachment-after (if using an "attachment" display)</li>
-</ul>
-
-So for example:
-<pre>
-div.view-myview div.view-header {
- /* make the header stand out */
- font-size: 120%;
- font-weight: bold;
-}
-
-div.view-myview div.view-footer {
- /* Make the footer less important */
- font-size: 80%;
- font-style: italic;
- color: #CCC;
-}
-</pre>
-
-In the above example, we whimsically made the header bold and in a bigger font, and the footer smaller, italicized, and greyish.
-
-<h3>Views with fields</h3>
-If your view has fields, each field is uniquely tagged with its ID. A field's ID may be gleaned from the Theme: Information page. Note that due to CSS rules, any _ in the id will be converted to - automatically, so if you have a field whose id is 'edit_node' (this is the field used to provide an "edit" link to a node), it will be 'edit-node'. Additionally, to make sure that the view IDs don't conflict with other css classes in the system, they will be pretended with 'views-field-'; thus, the final CSS class for the field with the id 'edit_node' will be <strong>views-field-edit-node</strong>.
-
-Exactly how this appears is going to depend upon the style you're using. For example, the 'unformatted' style uses <strong>div.views-field-edit-node</strong> and <strong>div.views-label-edit-node</strong> to access that particular field, but a table would use <strong>td.views-field-edit-node</strong> and <strong>th.views-field-edit-node</strong> to access the table header; or just <strong>.views-field-edit-node</strong> to affect both.
-
-<pre>
-.view-myview th {
- color: red; /* make all headers red */
-}
-
-.view-myview .views-field-title {
- font-weight: bold; /* Make the 'title' field bold */
-}
-
-.view-myview td.views-field-body {
- font-size: 60%; /* Make the text in the body field small */
-}
-</pre>
-
diff --git a/help/updating.html b/help/updating.html
deleted file mode 100644
index 844c46c..0000000
--- a/help/updating.html
+++ /dev/null
@@ -1,2 +0,0 @@
-TODO: This document needs to be fleshed out.
-
diff --git a/help/using-theme.html b/help/using-theme.html
deleted file mode 100644
index f80d71c..0000000
--- a/help/using-theme.html
+++ /dev/null
@@ -1,50 +0,0 @@
-Views theme templates are straightforward to use with the Drupal theming system. If you are unfamiliar with the theming system at all, you should probably at least read <a href="http://drupal.org/node/173880">drupal.org theming documentation</a>. That said, these are the important things you need to know:
-
-<ol>
-<li> Copy a base Views template to one of the names provided from the Theme: Information section of the View. Copy this template right into your theme directory. </li>
-<li> Clear the theme registry. See the <a href="http://drupal.org/node/173880#theme-registry">instructions</a> for how to do this. </li>
-<li> Your new template should now operate; assuming you picked a nicely named template that includes the view name, that template should now be active for your view. A good example is <strong>views-view-list--foobar.tpl.php</strong> which would work for a view named 'foobar'.</li>
-<li> You can now modify this template all you like.</li>
-</ol>
-
-For any template that uses fields, the fields will be in array. In order to use this effectively, you will need to understand enough PHP to fetch data from an array. This is a place where the <a href="http://drupal.org/project/devel">devel module</a> can really help you, because you can use its dsm() function right in your template to see what variables it uses. There is an alternative to dsm() that works without devel module, but it's a bit longer to use.
-
-For example, I placed the following code inside a loop in views-view-table.php.php:
-<code> &lt;?php drupal_set_message('&lt;pre&gt;' . var_export($row, true) . '&lt;/pre&gt;'); ?&gt;
-</code>
-
-And it produced this output:
-<code> array (
- 'nid' =&gt; '97',
- 'title' =&gt; 'Scisco Ideo Vicis Feugiat Qui',
- 'name' =&gt; 'luwrepuslan',
- )
-</code>
-
-My view had three fields:
-<code>Node: Nid
-Node: Title
-User: Name
-</code>
-
-The contents of the $row variable included these fields, in precisely the order that I had arranged them to using the Views rearrange link. Also worth noting, though, is that each field also has an identifier so it can easily be pulled out of the row should I want to display it differently. Using
-<code>&lt;?php print $row['title']; ?&gt;
-</code>
-
-Would print just the title for that row. Please remember that I'm doing this inside the loop, so this will get repeated for every row of the view.
-
-The IDs used to fetch items from the array, id <strong>$row['title']</strong> can be quickly and easily looked up on the Theme: Information page. Once a field has been added to the view, its ID will not change, but note that if there are two "title" fields in a view, one will be 'title' and the other will be 'title1', in order to prevent namespace collisions.
-
-The important thing here is that Views does provide IDs. Views doesn't tell you what these IDs are, but it's easy to get them by dumping the row data and doing a simple visual inspection. Views does guarantee that these IDs will not change, unless you actually add a new field and remove the existing one (in which case 'title', above, would become 'title1').
-
-<h2>The basic fields template</h2>
-
-The most common template people will need to rewrite is the "simple" views-view-fields.tpl.php, which is the template used by the <i>Fields</i> row style and all it does is display a simple list of fields. However, it is not that simple to the user. Because the template can't inherently know what the fields are, it has to go through an array in a loop.
-
-This loop isn't very handy when you really want to have fine control over the template by placing your fields precisely where and how you want. Relax, though; if you know what your fields are, you can rewrite this. If you end up writing your own HTML, the only part that is really important is the content for each field. We know from above that you can get the ID for each field on the Theme: Information page from the view. In the header for the template, we can see that the fields are all in the $fields array, and each field is an object. That leads us to this:
-
-<code>&lt;?php print $fields['some_id']-&gt;content; ?&gt;</code>
-
-Assuming you replace some_id with an id found on the theme: information page, this code will print the content for that field. You can also get the label and some other data about the field, as well as the raw information. Complete details for what is available are documented directly in views-view-fields.tpl.php.
-
-Keep in mind that if you rewrite your templates using this, you'll need to maintain this template whenever changes are made to the fields of the view; while this isn't generally recommend, sometimes it's necessary to get the kind of control you might ultimately need.
diff --git a/help/view-type.html b/help/view-type.html
deleted file mode 100644
index bdb80fc..0000000
--- a/help/view-type.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<p>The <strong>view type</strong> describes how this view is stored; Views is capable of having Views entirely in code that are not in the database. This allows modules to easily ship with Views built in, and it allows you to create a module to store your views for easy deployment between development and production servers.</p>
-
-<dl>
-<dt><strong>Normal</strong></dt>
-<dd>Normal views are stored in your database and are completely local to your system.</dd>
-
-<dt><strong>Default</strong></dt>
-<dd>Default views are stored only in code and are not anywhere in your database. They may be <strong>enabled</strong> or <strong>disabled</strong> but you may not completely remove them from your system. You can <strong>override</strong> the view which will create a local copy of your view. If you do this, future updates to the version in code will not affect your view.</dd>
-
-<dt><strong>Overridden</strong></dt>
-<dd>Overridden views are stored both in code and in the database; while overridden, the version that is in code is completely dormant. If you <strong>revert</strong> the view, the version in the database will be deleted, and the version that is in code will once again be used.</dd>
-</dl>
-
-You may store your views in code with the following procedure:
-<ol>
-<li> Create a module to store the views. </li>
-<li> Add the function <em>MODULENAME_views_default_views()</em> to this module. </li>
-<li> Export the view you wish to store in your module in code. Cut and paste that into the abovenamed function. Make sure the last line of the view is: <em>$views[$view-&gt;name] = $view;</em></li>
-<li> Make sure the last line of the function is <em>return $views;</em></li>
-<li> After you make any changes, be sure to <strong>clear the Views' cache</strong>. You may do this from the <strong>Tools</strong> menu.</li>
-</ol>
diff --git a/help/views.help.ini b/help/views.help.ini
deleted file mode 100644
index 3a7ac23..0000000
--- a/help/views.help.ini
+++ /dev/null
@@ -1,203 +0,0 @@
-[advanced help settings]
-line break = TRUE
-
-[about]
-title = "What is Views?"
-weight = -40
-
-[getting-started]
-title = "Getting started"
-weight = -45
-
-[example-users-by-role]
-title = "Create a page to list users by role"
-parent = getting-started
-weight = -10
-
-[example-recent-stories]
-title = "Create a block of recent stories"
-parent = getting-started
-weight = 0
-
-[example-user-feed]
-title = "Create an RSS feed of user posts"
-parent = getting-started
-weight = 30
-
-[example-author-block]
-title = "Create a block of author's recent blog posts"
-parent = getting-started
-weight = 40
-
-[view-type]
-title = "View types"
-
-[display]
-title = "Displays"
-weight = -30
-
-[display-default]
-title = "Default display"
-parent = display
-weight = -20
-
-[display-page]
-title = "Page display"
-parent = display
-weight = -15
-
-[display-block]
-title = "Block display"
-parent = display
-weight = -10
-
-[display-attachment]
-title = "Attachment display"
-parent = display
-
-[display-feed]
-title = "Feed display"
-parent = display
-
-[argument]
-title = "Arguments"
-parent = about
-
-[field]
-title = "Fields"
-parent = about
-
-[sort]
-title = "Sorts"
-parent = about
-
-[filter]
-title = "Filters"
-parent = about
-
-[relationship]
-title = "Relationships"
-parent = about
-
-[style]
-title = "Output styles (View styles)"
-weight = -20
-
-[style-row]
-title = "View row styles"
-parent = style
-weight = 10
-
-[style-list]
-title = "List output style"
-parent = style
-
-[style-unformatted]
-title = "Unformatted output style"
-parent = style
-weight = -6
-
-[style-table]
-title = "Table output style"
-parent = style
-weight = -5
-
-[style-grid]
-title = "Grid output style"
-parent = style
-weight = -5
-
-[style-rss]
-title = "RSS output style"
-parent = style
-weight = -5
-
-[style-fields]
-title = "Fields row style"
-parent = style-row
-
-[style-node]
-title = "Node row style"
-parent = style-row
-
-[style-node-rss]
-title = "Node RSS item row style"
-parent = style-row
-
-[style-comment-rss]
-title = "Comment RSS item row style"
-parent = style-row
-
-[style-summary-unformatted]
-title = "Unformatted summary style"
-parent = "style"
-weight = 10
-
-[style-summary]
-title = "List summary style"
-parent = "style"
-weight = 10
-
-[menu]
-title = "Menu options (page display)"
-
-[path]
-title = "Path options (page display)"
-
-[analyze-theme]
-title = "Theme information"
-
-[using-theme]
-title = "Using Views templates"
-parent = analyze-theme
-
-[theme-css]
-title = "Using CSS with Views"
-parent = analyze-theme
-
-[overrides]
-title = What are overrides?
-
-[embed]
-title = Embedding a view into other parts of your site
-
-[new]
-title = What's new in Views 2
-weight = -42
-
-[updating]
-title = Updating your views from Views 1 to Views 2
-
-; API related
-[api]
-title = "Views' API"
-weight = 100
-
-[api-tables]
-title = "Describing tables to Views"
-weight = -100
-parent = api
-
-[api-default-views]
-title = "Using default views in your module"
-weight = -90
-parent = api
-
-[api-handlers]
-title = "How Views handlers work"
-weight = -50
-parent = api
-
-[api-plugins]
-title = "How Views plugins work"
-weight = -40
-parent = api
-
-[api-upgrading]
-title = "Upgrading your module Views 1 to Views 2"
-parent = api
-
-[api-example]
-title = Integrating the Node Example module
-parent = api
-weight = 100 \ No newline at end of file
diff --git a/images/arrow-active.png b/images/arrow-active.png
deleted file mode 100644
index 3bbd3c2..0000000
--- a/images/arrow-active.png
+++ /dev/null
Binary files differ
diff --git a/images/expanded-options.png b/images/expanded-options.png
deleted file mode 100644
index b7b755c..0000000
--- a/images/expanded-options.png
+++ /dev/null
Binary files differ
diff --git a/images/overridden.gif b/images/overridden.gif
deleted file mode 100644
index b781191..0000000
--- a/images/overridden.gif
+++ /dev/null
Binary files differ
diff --git a/images/sprites.png b/images/sprites.png
deleted file mode 100644
index 9083622..0000000
--- a/images/sprites.png
+++ /dev/null
Binary files differ
diff --git a/images/status-active.gif b/images/status-active.gif
deleted file mode 100644
index 207e95c..0000000
--- a/images/status-active.gif
+++ /dev/null
Binary files differ
diff --git a/includes/admin.inc b/includes/admin.inc
deleted file mode 100644
index 3dc1c3e..0000000
--- a/includes/admin.inc
+++ /dev/null
@@ -1,3072 +0,0 @@
-<?php
-/**
- * @file admin.inc
- * Provides the Views' administrative interface.
- */
-
-/**
- * Page callback to list views in the system.
- */
-function views_ui_list_views($arg = NULL) {
- if ($arg != NULL) {
- return drupal_not_found();
- }
-
- $output = theme('views_ui_list_views');
- views_ui_check_advanced_help();
- return $output;
-}
-
-/**
- * Check to see if the advanced help module is installed, and if not put up
- * a message.
- *
- * Only call this function if the user is already in a position for this to
- * be useful.
- */
-function views_ui_check_advanced_help() {
- if (variable_get('views_hide_help_message', FALSE)) {
- return;
- }
-
- if (!module_exists('advanced_help')) {
- $filename = db_result(db_query("SELECT filename FROM {system} WHERE type = 'module' AND name = 'advanced_help'"));
- if ($filename && file_exists($filename)) {
- drupal_set_message(t('If you <a href="@modules">enable the advanced help module</a>, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('@modules' => url('admin/build/modules'),'@hide' => url('admin/build/views/tools'))));
- }
- else {
- drupal_set_message(t('If you install the advanced help module from !href, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('!href' => l('http://drupal.org/project/advanced_help', 'http://drupal.org/project/advanced_help'), '@hide' => url('admin/build/views/tools'))));
- }
- }
-}
-
-/**
- * Preprocess the list views theme
- */
-function template_preprocess_views_ui_list_views(&$vars) {
- $items = array();
- $sorts = array();
-
- $views = views_get_all_views();
-
- // Respond to a reset command by clearing session and doing a drupal goto
- // back to the base URL.
- if (isset($_GET['op']) && $_GET['op'] == t('Reset')) {
- unset($_SESSION['views']['#admin']);
- drupal_goto('admin/build/views');
- }
- if (count($_GET) <= 1) {
- if (isset($_SESSION['views']['#admin']) && is_array($_SESSION['views']['#admin'])) {
- $_GET += $_SESSION['views']['#admin'];
- }
- }
- else {
- $_SESSION['views']['#admin'] = $_GET;
- unset($_SESSION['views']['#admin']['q']);
- }
-
- $form_state = array(
- 'views' => $views,
- 'input' => $_GET,
- 'method' => 'get',
- 'rerender' => TRUE,
- 'no_redirect' => TRUE,
- );
-
- $vars['widgets'] = drupal_build_form('views_ui_list_views_form', $form_state);
-
- $vars['help_type_icon'] = theme('advanced_help_topic', 'views', 'view-type');
-
- $base_tables = views_fetch_base_tables();
-
- foreach ($views as $view) {
- if ($form_state['values']['tag'] != 'all') {
- if ($form_state['values']['tag'] == 'none') {
- if (!empty($view->tag)) {
- continue;
- }
- }
- else if ($form_state['values']['tag'] != $view->tag) {
- continue;
- }
- }
- if ($form_state['values']['type'] != 'all' && $form_state['values']['type'] != $view->type) {
- continue;
- }
-
- if ($form_state['values']['base'] != 'all' && $form_state['values']['base'] != $view->base_table) {
- continue;
- }
-
- if ($form_state['values']['display'] != 'all' && empty($view->display[$form_state['values']['display']])) {
- continue;
- }
-
- $item = new stdClass();
- $item->ops = array();
- if (empty($view->disabled)) {
- $item->ops[] = l(t('Edit'), "admin/build/views/edit/$view->name");
- $item->ops[] = l(t('Export'), "admin/build/views/export/$view->name");
- $item->ops[] = l(t('Clone'), "admin/build/views/clone/$view->name");
- }
- if ($view->type != t('Default')) {
- $text = $view->type == t('Overridden') ? t('Revert') : t('Delete');
- $item->ops[] = l($text, "admin/build/views/delete/$view->name");
- }
- else {
- if (empty($view->disabled)) {
- $item->ops[] = l(t('Disable'), "admin/build/views/disable/$view->name", array('query' => drupal_get_destination()));
- }
- else {
- $item->ops[] = l(t('Enable'), "admin/build/views/enable/$view->name", array('query' => drupal_get_destination()));
- }
- }
-
- $item->ops = implode(' | ', $item->ops);
- if (empty($view->display)) {
- $item->path = t('Warning! Broken view!');
- }
- else {
- $item->path = $raw_path = $view->get_path();
- $item->path = $item->path && empty($view->disabled) && strpos($item->path, '%') === FALSE ? l($item->path, $item->path) : check_plain($item->path);
- }
-
- $item->type = $view->type;
- $item->name = $view->name;
-
- if (!empty($view->tag)) {
- $item->tag = $view->tag;
- }
-
- $item->title = $view->get_title();
- $item->base = !empty($base_tables[$view->base_table]['title']) ? $base_tables[$view->base_table]['title'] : t('Broken');
-
- $item->displays = array();
- foreach ($view->display as $display) {
- if (!empty($display->handler->definition['admin'])) {
- $item->displays[$display->handler->definition['admin']] = TRUE;
- }
- }
-
- if ($item->displays) {
- ksort($item->displays);
- $item->displays = implode(', ', array_keys($item->displays));
- }
-
- $item->description = check_plain($view->description);
- $item->classes = empty($view->disabled) ? 'view-enabled' : 'view-disabled';
- $items[] = $item;
-
- $sort = intval(empty($view->disabled) xor $form_state['values']['sort'] == 'asc');
-
- switch ($form_state['values']['order']) {
- case 'name':
- default:
- $sort .= strtolower($view->name);
- break;
- case 'title':
- $sort .= strtolower($item->title);
- break;
- case 'path':
- $sort .= strtolower($raw_path); // $path;
- break;
- case 'type':
- $sort .= $view->type . $view->name;
- break;
- case 'tag':
- $sort .= strtolower($view->tag);
- break;
- case 'desc':
- $sort .= strtolower($view->description);
- break;
- }
-
- $sorts[] = $sort;
- }
-
- if ($form_state['values']['sort'] == 'desc') {
- arsort($sorts);
- }
- else {
- asort($sorts);
- }
-
- $i = array();
- foreach ($sorts as $id => $title) {
- $i[] = $items[$id];
- }
-
- views_add_css('views-list');
- $vars['views'] = $i;
-
- $getting_started = theme('advanced_help_topic', 'views', 'getting-started', 'title');
- if (!$getting_started) {
- $getting_started = t('Install the advanced help module for the getting started');
- }
-
- $vars['help'] = t('Not sure what to do? Try the "!getting-started" page.', array('!getting-started' => $getting_started));
-}
-
-/**
- * Provide a form for sorting and filtering the list of views.
- */
-function views_ui_list_views_form(&$form_state) {
- if (!variable_get('clean_url', FALSE)) {
- $form['q'] = array(
- '#type' => 'hidden',
- '#value' => $_GET['q'],
- );
- }
-
- $all = array('all' => t('<All>'));
- $none = array('none' => t('<None>'));
-
- $form['type'] = array(
- '#type' => 'select',
- '#title' => t('Storage'),
- '#options' => array(
- 'all' => t('<All>'),
- t('Normal') => t('Normal'),
- t('Default') => t('Default'),
- t('Overridden') => t('Overridden'),
- ),
- '#default_value' => 'all',
- );
-
- $bases = array();
- foreach (views_fetch_base_tables() as $table => $info) {
- $bases[$table] = $info['title'];
- }
-
- $form['base'] = array(
- '#type' => 'select',
- '#title' => t('Type'),
- '#options' => array_merge($all, $bases),
- '#default_value' => 'all',
- );
-
- $tags = array();
-
- $extras = array();
- foreach ($form_state['views'] as $name => $view) {
- if (!empty($view->tag)) {
- $tags[$view->tag] = $view->tag;
- }
- }
-
- asort($tags);
-
- $form['tag'] = array(
- '#type' => 'select',
- '#title' => t('Tag'),
- '#options' => array_merge($all, $none, $tags),
- '#default_value' => 'all',
- );
-
- $displays = array();
- foreach (views_fetch_plugin_data('display') as $id => $info) {
- if (!empty($info['admin'])) {
- $displays[$id] = $info['admin'];
- }
- }
-
- asort($displays);
-
- $form['display'] = array(
- '#type' => 'select',
- '#title' => t('Displays'),
- '#options' => array_merge($all, $displays),
- '#default_value' => 'all',
- );
-
- $form['order'] = array(
- '#type' => 'select',
- '#title' => t('Sort by'),
- '#options' => array(
- 'name' => t('Name'),
- 'title' => t('Title'),
- 'tag' => t('Tag'),
- 'path' => t('Path'),
- 'type' => t('Type'),
- 'desc' => t('Description'),
- ),
- '#default_value' => 'name',
- );
-
- $form['sort'] = array(
- '#type' => 'select',
- '#title' => t('Order'),
- '#options' => array(
- 'asc' => t('Up'),
- 'desc' => t('Down'),
- ),
- '#default_value' => 'asc',
- );
-
- $form['submit'] = array(
- '#name' => '', // so it won't in the $_GET args
- '#type' => 'submit',
- '#id' => 'edit-views-apply',
- '#value' => t('Apply'),
- );
-
- if (!empty($_SESSION['views']['#admin'])) {
- $form['reset'] = array(
- '#type' => 'submit',
- '#id' => 'edit-views-reset',
- '#value' => t('Reset'),
- );
- }
-
- $form['#theme'] = array('views_ui_list_views_form');
- return $form;
-}
-
-function theme_views_ui_list_views_form($form) {
- // Don't render these:
- unset($form['form_id']);
- unset($form['form_build_id']);
- unset($form['form_token']);
- return drupal_render($form);
-}
-
-/**
- * Page callback for the live preview.
- *
- * @todo make this use a template
- */
-function views_ui_preview($js, $view) {
- // Take off the items we know so that we can have just the args passed
- // in for later use.
- $func_args = func_get_args();
- array_shift($func_args); // $js
- array_shift($func_args); // $view
- $display_id = (count($func_args)) ? array_shift($func_args) : 'default';
-
- $form_state = array(
- 'display_id' => $display_id,
- 'view_args' => $func_args ? implode('/', $func_args) : '',
- 'rerender' => TRUE,
- 'no_redirect' => TRUE,
- 'view' => &$view,
- 'ajax' => $js
- );
-
- $output = drupal_build_form('views_ui_preview_form', $form_state);
- $args = array();
- if (isset($form_state['view_args']) && $form_state['view_args'] !== '') {
- $args = explode('/', $form_state['view_args']);
- }
-
- $errors = $view->validate();
- if ($errors === TRUE) {
- $view->ajax = $js;
- $view->live_preview = TRUE;
-
- // Store the current view URL for later use:
- $view->set_display($form_state['display_id']);
- $view->set_arguments($args);
-
- if ($view->display_handler->get_option('path')) {
- $path = $view->get_url();
- }
-
- // Make view links come back to preview.
- $view->override_path = 'admin/build/views/nojs/preview/' . $view->name . '/' . $form_state['display_id'];
-
- // also override $_GET['q'] so we get the pager
- $_GET['q'] = $view->override_path;
- if ($form_state['view_args']) {
- $_GET['q'] .= '/' . $form_state['view_args'];
- }
-
- $preview = $view->preview($form_state['display_id'], $args);
-
- // Get information from the preview for display.
- if (!empty($view->build_info['query'])) {
- $rows = array();
- $query = db_prefix_tables($view->build_info['query']);
- if ($view->build_info['query_args']) {
- _db_query_callback($view->build_info['query_args'], TRUE);
- $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
- }
- $rows[] = array('<strong>' . t('Query') . '</strong>', '<pre>' . check_plain($query) . '</pre>');
- if (!empty($view->additional_queries)) {
- $queries = '<strong>' . t('These queries were run during view rendering:') . '</strong>';
- foreach ($view->additional_queries as $query) {
- if ($queries) {
- $queries .= "\n";
- }
- $queries .= t('[@time ms]', array('@time' => intval($query[1] * 100000) / 100)) . ' ' . $query[0];
- }
-
- $rows[] = array('<strong>' . t('Other queries') . '</strong>', '<pre>' . $queries . '</pre>');
- }
-
- $rows[] = array('<strong>' . t('Title') . '</strong>', filter_xss_admin($view->get_title()));
- if (isset($path)) {
- $path = l($path, $path);
- }
- else {
- $path = t('This display has no path.');
- }
-
- $rows[] = array('<strong>' . t('Path') . '</strong>', $path);
-
- $rows[] = array('<strong>' . t('Query build time') . '</strong>', t('@time ms', array('@time' => intval($view->build_time * 100000) / 100)));
- $rows[] = array('<strong>' . t('Query execute time') . '</strong>', t('@time ms', array('@time' => intval($view->execute_time * 100000) / 100)));
- $rows[] = array('<strong>' . t('View render time') . '</strong>', t('@time ms', array('@time' => intval($view->render_time * 100000) / 100)));
- drupal_alter('views_preview_info', $rows, $view);
-
- $info = theme('table', array(), $rows);
- }
- else {
- $info = theme('table', array(), array(array('<strong>' . t('Query') . '</strong>', t('No query was run'))));
- }
- }
- else {
- foreach ($errors as $error) {
- drupal_set_message($error, 'error');
- }
- $preview = t('Unable to preview due to validation errors.');
- $info = '';
- }
-
- $info = '<div class="views-query-info">' . $info . '</div>';
-
- if (variable_get('views_ui_query_on_top', FALSE)) {
- $output .= $info . $preview;
- }
- else {
- $output .= $preview . $info;
- }
-
- if (!$js) {
- views_add_css('views-admin');
- drupal_set_title($view->get_title());
- return $output;
- }
- else {
- views_include('ajax');
- $object = new stdClass();
- if (!empty($view->js_settings)) {
- $object->js = $view->js_settings;
- }
- $object->display = '';
- if ($messages = theme('status_messages')) {
- $object->display = '<div class="views-messages">' . $messages . '</div>';
- }
- $object->display .= $output;
- $object->title = $view->get_title();
- views_ajax_render($object);
- }
-}
-
-/**
- * Form for generating argument information for the live preview.
- */
-function views_ui_preview_form(&$form_state) {
- $view = &$form_state['view'];
- $view->init_display();
- $options = array();
- foreach ($view->display as $id => $display) {
- $options[$id] = $display->display_title;
- }
-
- $form['#attributes'] = array(
- 'class' => 'clear-block',
- );
-
- $form['display_id'] = array(
- '#type' => 'select',
- '#title' => t('Display'),
- '#options' => $options,
- '#default_value' => $form_state['display_id'],
- '#id' => 'preview-display-id',
- );
-
- $form['args'] = array(
- '#type' => 'textfield',
- '#title' => t('Arguments'),
- '#default_value' => $form_state['view_args'],
- '#description' => t('Separate arguments with a / as though they were a URL path.'),
- '#id' => 'preview-args',
- );
-
- $form['preview'] = array(
- '#type' => 'submit',
- '#value' => t('Preview'),
- '#id' => 'preview-submit',
- );
-
- $form['#action'] = url("admin/build/views/nojs/preview/$view->name");
- return $form;
-}
-
-/**
- * Submit the preview form.
- *
- * This just takes the data and stores it on the form state in a
- * known location. The caller will be responsible for using it.
- */
-function views_ui_preview_form_submit(&$form, &$form_state) {
- $form_state['display_id'] = $form_state['values']['display_id'];
- $form_state['view_args'] = $form_state['values']['args'];
-}
-
-/**
- * Page callback to add a new view.
- */
-function views_ui_add_page() {
- $form_state = array(
- 'view' => NULL
- );
-
- return drupal_build_form('views_ui_add_form', $form_state);
-}
-
-/**
- * Page callback to add a new view.
- */
-function views_ui_clone_page($view) {
- $form_state = array(
- 'view' => $view->copy(),
- );
-
- drupal_set_title(t('Clone view %view', array('%view' => $view->name)));
- return drupal_build_form('views_ui_add_form', $form_state);
-}
-
-/**
- * Form constructor callback to create the views Add Form, phase 1.
- */
-function views_ui_add_form(&$form_state) {
- $view = $form_state['view'];
- $form = array();
-
- $form['name'] = array(
- '#type' => 'textfield',
- '#title' => t('View name'),
- '#description' => t('This is the unique name of the view. It must contain only alphanumeric characters and underscores; it is used to identify the view internally and to generate unique theming template names for this view. If overriding a module provided view, the name must not be changed or instead a new view will be created.'),
- '#required' => TRUE,
- '#maxlength' => 32,
- '#default_value' => $view ? $view->name : '',
- '#attributes' => array('dir'=>'ltr'),
- );
-
- $form['description'] = array(
- '#type' => 'textfield',
- '#title' => t('View description'),
- '#description' => t('This description will appear on the Views administrative UI to tell you what the view is about.'),
- '#default_value' => $view ? $view->description : '',
- );
-
- $form['tag'] = array(
- '#type' => 'textfield',
- '#title' => t('View tag'),
- '#description' => t('Enter an optional tag for this view; it is used only to help sort views on the administrative page.'),
- '#default_value' => $view ? $view->tag : '',
- '#autocomplete_path' => 'admin/views/ajax/autocomplete/tag',
- );
-
- $base_tables = array();
- foreach (views_fetch_base_tables() as $table => $info) {
- $base_tables[$table] = $info['title'] . '<div class="description">' . $info['description'] . '</div>';
- }
-
- $form['base_table'] = array(
- '#type' => 'radios',
- '#title' => t('View type'),
- '#description' => t('The view type is the primary table for which information is being retrieved. The view type controls what arguments, fields, sort criteria and filters are available, so once this is set it <strong>cannot be changed</strong>.'),
- '#default_value' => $view ? $view->base_table : 'node',
- '#options' => $base_tables,
- );
-
- if ($view) {
- $form['base_table']['#disabled'] = TRUE;
- }
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Next'),
- '#validate' => array('views_ui_add_form_validate'),
- '#submit' => array('views_ui_add_form_submit'),
- );
-
- return $form;
-}
-
-/**
- * Validate the add view form.
- */
-function views_ui_add_form_validate($form, &$form_state) {
- $name = $form_state['values']['name'];
-
- // View name must be alphanumeric or underscores, no other punctuation.
- if (preg_match('/[^a-zA-Z0-9_]/', $name)) {
- form_error($form['name'], t('View name must be alphanumeric or underscores only.'));
- }
-
- // View name must already exist.
- $view = views_get_view($form_state['values']['name']);
- if ($view && $view->type != t('Default')) {
- form_error($form['name'], t('You must use a unique name for this view.'));
- }
-}
-
-/**
- * Process the add view form
- */
-function views_ui_add_form_submit($form, &$form_state) {
- $view = $form_state['view'] ? $form_state['view'] : views_new_view();
- $view->name = $form_state['values']['name'];
- $view->description = $form_state['values']['description'];
- $view->tag = $form_state['values']['tag'];
- if (empty($form['base_table']['#disabled'])) {
- $view->base_table = $form_state['values']['base_table'];
- }
-
- views_ui_cache_set($view);
- $form_state['redirect'] ='admin/build/views/edit/' . $view->name;
-}
-
-/**
- * Page to delete a view.
- */
-function views_ui_delete_confirm(&$form_state, $view) {
- $form_state['view'] = &$view;
- $form = array();
-
- $cancel = 'admin/build/views';
- if (!empty($_REQUEST['cancel'])) {
- $cancel = $_REQUEST['cancel'];
- }
-
- if ($view->type == t('Overridden')) {
- $title = t('Are you sure you want to revert the view %name?', array('%name' => $view->name));
- $desc = t('Reverting the view will delete the view that is in the database, reverting it to the original default view. Any changes you have made will be lost and cannot be recovered.');
- $button = t('Revert');
- }
- else {
- $title = t('Are you sure you want to delete the view %name?', array('%name' => $view->name));
- $desc = t('Deleting a view cannot be undone.');
- $button = t('Delete');
- }
-
- return confirm_form($form,
- $title,
- $cancel,
- $desc,
- $button,
- t('Cancel'));
-}
-
-/**
- * Submit handler to delete a view.
- */
-function views_ui_delete_confirm_submit(&$form, &$form_state) {
- $form_state['view']->delete();
- views_object_cache_clear('view', $form_state['view']->name);
- drupal_set_message(t('The view has been deleted.'));
- $form_state['redirect'] = 'admin/build/views';
-}
-
-/**
- * Page to delete a view.
- */
-function views_ui_break_lock_confirm(&$form_state, $view) {
- $form_state['view'] = &$view;
- $form = array();
-
- if (empty($view->locked)) {
- return t('There is no lock on view %view to break.', array('%name' => $view->name));
- }
-
- $cancel = 'admin/build/views/edit/' . $view->name;
- if (!empty($_REQUEST['cancel'])) {
- $cancel = $_REQUEST['cancel'];
- }
-
- $account = user_load($view->locked->uid);
- return confirm_form($form,
- t('Are you sure you want to break the lock on view %name?',
- array('%name' => $view->name)),
- $cancel,
- t('By breaking this lock, any unsaved changes made by !user will be lost!', array('!user' => theme('username', $account))),
- t('Break lock'),
- t('Cancel'));
-}
-
-/**
- * Submit handler to break_lock a view.
- */
-function views_ui_break_lock_confirm_submit(&$form, &$form_state) {
- db_query("DELETE FROM {views_object_cache} WHERE obj = 'view' AND name = '%s'", $form_state['view']->name);
- $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
- drupal_set_message(t('The lock has been broken and you may now edit this view.'));
-}
-
-/**
- * The main view edit page
- */
-function views_ui_edit_page($view) {
- drupal_set_title(t('Edit view %view', array('%view' => $view->name)));
- $output = theme('views_ui_edit_view', $view);
- views_ui_check_advanced_help();
- return $output;
-}
-
-/**
- * Export a view for cut & paste.
- */
-function views_ui_export_page(&$form_state, $view) {
- $code = $view->export();
- $lines = substr_count($code, "\n");
- $form['code'] = array(
- '#type' => 'textarea',
- '#title' => $view->name,
- '#default_value' => $code,
- '#rows' => $lines,
- );
- return $form;
-}
-
-/**
- * Import a view from cut & paste
- */
-function views_ui_import_page(&$form_state) {
- $form['name'] = array(
- '#type' => 'textfield',
- '#title' => t('View name'),
- '#description' => t('Enter the name to use for this view if it is different from the source view. Leave blank to use the name of the view.'),
- );
-
- $form['view'] = array(
- '#type' => 'textarea',
- '#title' => t('Paste view code here'),
- '#required' => TRUE,
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Import'),
- '#submit' => array('views_ui_import_submit'),
- '#validate' => array('views_ui_import_validate'),
- );
- return $form;
-}
-
-/**
- * Validate handler to import a view
- */
-function views_ui_import_validate($form, &$form_state) {
- $view = '';
- views_include('view');
- ob_start();
- eval($form_state['values']['view']);
- ob_end_clean();
-
- if (!is_object($view)) {
- return form_error($form['view'], t('Unable to interpret view code.'));
- }
-
- if (empty($view->api_version) || $view->api_version < 2) {
- // Check for some value that would only exist on a Views 1 view.
- if (isset($view->url) || isset($view->page) || isset($view->block)) {
- views_include('convert');
- $view = views1_import($view);
- drupal_set_message(t('You are importing a view created in Views version 1. You may need to adjust some parameters to work correctly in version 2.'), 'warning');
- }
- else {
- form_error($form['view'], t('That view is not compatible with this version of Views.'));
- }
- }
-
- // View name must be alphanumeric or underscores, no other punctuation.
- if (!empty($form_state['values']['name']) && preg_match('/[^a-zA-Z0-9_]/', $form_state['values']['name'])) {
- form_error($form['name'], t('View name must be alphanumeric or underscores only.'));
- }
-
- if ($form_state['values']['name']) {
- $view->name = $form_state['values']['name'];
- }
-
- $test = views_get_view($view->name);
- if ($test && $test->type != t('Default')) {
- form_set_error('', t('A view by that name already exists; please choose a different name'));
- }
-
- $view->init_display();
-
- $broken = FALSE;
- // Make sure that all plugins and handlers needed by this view actually exist.
- foreach ($view->display as $id => $display) {
- if (empty($display->handler) || !empty($display->handler->broken)) {
- drupal_set_message(t('Display plugin @plugin is not available.', array('@plugin' => $display->display_plugin)), 'error');
- $broken = TRUE;
- continue;
- }
-
- $plugin = views_get_plugin('style', $display->handler->get_option('style_plugin'));
- if (!$plugin) {
- drupal_set_message(t('Style plugin @plugin is not available.', array('@plugin' => $display->handler->get_option('style_plugin'))), 'error');
- $broken = TRUE;
- }
- else if ($plugin->uses_row_plugin()) {
- $plugin = views_get_plugin('row', $display->handler->get_option('row_plugin'));
- if (!$plugin) {
- drupal_set_message(t('Row plugin @plugin is not available.', array('@plugin' => $display->handler->get_option('row_plugin'))), 'error');
- $broken = TRUE;
- }
- }
-
- foreach (views_object_types() as $type => $info) {
- $handlers = $display->handler->get_handlers($type);
- if ($handlers) {
- foreach ($handlers as $id => $handler) {
- if ($handler->broken()) {
- drupal_set_message(t('@type handler @table.@field is not available.', array(
- '@type' => $info['stitle'],
- '@table' => $handler->table,
- '@field' => $handler->field,
- )), 'error');
- $broken = TRUE;
- }
- }
- }
- }
- }
-
- if ($broken) {
- form_set_error('', t('Unable to import view.'));
- }
-
- $form_state['view'] = &$view;
-}
-
-/**
- * Submit handler for view import
- */
-function views_ui_import_submit($form, &$form_state) {
- // Store in cache and then go to edit.
- views_ui_cache_set($form_state['view']);
- $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
-}
-
-/**
- * The main edit view form, which is really just a save/cancel/delete button.
- */
-function views_ui_edit_view_form(&$form_state, $view) {
- $form['buttons']['save'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- '#validate' => array('views_ui_edit_view_form_validate'),
- '#submit' => array('views_ui_edit_view_form_submit'),
- );
-
- $form['buttons']['cancel'] = array(
- '#type' => 'submit',
- '#value' => t('Cancel'),
- '#submit' => array('views_ui_edit_view_form_cancel'),
- );
-
- if (is_numeric($view->vid)) {
- $form['buttons']['delete'] = array(
- '#type' => 'submit',
- '#value' => t('Delete'),
- '#submit' => array('views_ui_edit_view_form_delete'),
- );
- }
-
- $form_state['view'] = &$view;
- return $form;
-}
-
-/**
- * Validate that a view is complete and whole.
- */
-function views_ui_edit_view_form_validate($form, &$form_state) {
- // Do not validate cancel or delete.
- if (empty($form_state['clicked_button']['#value']) || $form_state['clicked_button']['#value'] != t('Save')) {
- return;
- }
-
- $errors = $form_state['view']->validate();
- if ($errors !== TRUE) {
- foreach ($errors as $error) {
- form_set_error('', $error);
- }
- }
-}
-
-/**
- * Submit handler for the edit view form.
- */
-function views_ui_edit_view_form_submit($form, &$form_state) {
- // Go through and remove displayed scheduled for removal.
- foreach ($form_state['view']->display as $id => $display) {
- if (!empty($display->deleted)) {
- unset($form_state['view']->display[$id]);
- }
- }
-
- $form_state['view']->save();
- drupal_set_message(t('The view %name has been saved.', array('%name' => $form_state['view']->name)));
-
- // Make sure menu items get rebuilt as neces
- menu_rebuild();
-
- // Clear the views cache.
- cache_clear_all('*', 'cache_views');
-
- // Clear the page cache.
- cache_clear_all();
-
- // Remove this view from cache so we can edit it properly.
- views_object_cache_clear('view', $form_state['view']->name);
-}
-
-/**
- * Submit handler for the edit view form.
- */
-function views_ui_edit_view_form_cancel($form, &$form_state) {
- // Remove this view from cache so edits will be lost.
- views_object_cache_clear('view', $form_state['view']->name);
- if (empty($form['view']->vid)) {
- // I seem to have to drupal_goto here because I can't get fapi to
- // honor the redirect target. Not sure what I screwed up here.
- drupal_goto('admin/build/views');
- }
-}
-
-function views_ui_edit_view_form_delete($form, &$form_state) {
- unset($_REQUEST['destination']);
- // Redirect to the delete confirm page
- $form_state['redirect'] = array('admin/build/views/delete/' . $form_state['view']->name, 'cancel=admin/build/views/edit/' . $form_state['view']->name);
-}
-
-/**
- * Preprocess the view edit page.
- */
-function template_preprocess_views_ui_edit_view(&$vars) {
- $view = &$vars['view'];
-
- $vars['save_button'] = drupal_get_form('views_ui_edit_view_form', $view);
-
- $table = views_fetch_data($view->base_table);
- $vars['base_table'] = !empty($table['table']['base']['title']) ?
- $table['table']['base']['title'] : t('Unknown or missing table name');
-
- views_include('tabs');
- $tabs = new views_tabset;
-
- $vars['message'] = '<div class="message">' . t("Click on an item to edit that item's details.") . '</div>';
-
- if (!$view->set_display('default')) {
- drupal_set_message(t('This view has a broken default display and cannot be used.'), 'error');
- }
-
- foreach ($view->display as $display) {
- list($title, $body) = views_ui_display_tab($view, $display);
- // The first display is the default.
- $tabs->set($display->id, $title, $body);
- }
-
- // This is the area that will render beneath the links
- $form_state = array(
- 'view' => &$view,
- 'ajax' => FALSE,
- );
-
- $display_button = drupal_build_form('views_ui_add_display_form', $form_state);
- $analyze_button = drupal_get_form('views_ui_analyze_view_button', $view);
- $tabs->add_extra($display_button . $analyze_button);
-
- $vars['tabs'] = $tabs->render();
-
- $form_state = array(
- 'display_id' => 'default',
- 'view_args' => '',
- 'rerender' => FALSE,
- 'no_redirect' => TRUE,
- 'view' => &$view,
- 'input' => array(),
- );
- $vars['preview'] = drupal_build_form('views_ui_preview_form', $form_state);
-
- $vars['locked'] = NULL;
- if (isset($view->locked) && is_object($view->locked)) {
- $account = user_load($view->locked->uid);
- $vars['locked'] = theme('username', $account);
- $vars['lock_age'] = format_interval(time() - $view->locked->updated);
- $vars['break'] = url('admin/build/views/break-lock/' . $view->name);
- }
-
- $vars['quick_links_raw'] = array(
- array(
- 'title' => t('Export'),
- 'alt' => t("Export this view"),
- 'href' => "admin/build/views/export/$view->name",
- ),
- array(
- 'title' => t('Clone'),
- 'alt' => t("Create a copy of this view"),
- 'href' => "admin/build/views/clone/$view->name",
- ),
- );
-
- $paths = array();
- foreach ($view->display as $id => $display) {
- if (!empty($display->handler) && $display->handler->has_path()) {
- $path = $display->handler->get_path();
- if (strpos($path, '%') === FALSE && !isset($paths[$path])) {
- $vars['quick_links_raw'][] = array(
- 'title' => t('View "@display"', array('@display' => $display->display_title)),
- 'alt' => t("Go to the real page for this display"),
- 'href' => $path,
- );
- // Displays can have the same path; no point in showing more than one link.
- $paths[$path] = TRUE;
- }
- }
- }
-
- $vars['quick_links'] = theme('links', $vars['quick_links_raw']);
- views_add_css('views-admin');
- views_add_css('views');
- views_add_js('ajax');
- drupal_add_js('misc/jquery.form.js');
-
- // Also add any js files required by plugins:
- $plugins = views_fetch_plugin_data();
- foreach ($plugins as $type => $type_plugins) {
- foreach ($type_plugins as $name => $plugin) {
- if (!empty($plugin['js'])) {
- foreach ($plugin['js'] as $file) {
- drupal_add_js($file);
- }
- }
- }
- }
-
- $settings = array('views' => array('ajax' => array(
- 'id' => '#views-ajax-pad',
- 'title' => '#views-ajax-title',
- 'defaultForm' => $vars['message'],
- )));
-
- drupal_add_js($settings, 'setting');
-}
-
-function template_preprocess_views_ui_edit_tab(&$vars) {
- $view = $vars['view'];
- $display = $vars['display'];
- $plugin = $display->handler->definition;
-
- $top = $left = $middle = $right = '';
-
- // If this form was submitted it was already handled, so force it not to
- // submit again.
-
- $vars['remove'] = '';
- if (empty($plugin['no remove'])) {
- if (!empty($_POST['form_id']) && $_POST['form_id'] == 'views_ui_remove_display_form') {
- unset($_POST['form_id']);
- }
- $form_state = array('view' => &$view, 'display_id' => $display->id, 'ajax' => FALSE);
- $vars['remove'] = drupal_build_form('views_ui_remove_display_form', $form_state);
- }
-
- // basic fields
- $vars['title'] = check_plain($display->display_title);
- $vars['description'] = check_plain($plugin['help']);
-
- // Special fields if tihs is the default display.
- $vars['default'] = ($display->id == 'default');
- $vars['details_class'] = views_ui_item_css('details');
- if (!empty($view->changed_sections['details'])) {
- $vars['details_changed'] = TRUE;
- }
-
- $tag = empty($view->tag) ? t('None') : $view->tag;
- $vars['details'] = t('Tag') . ': ' . l($tag, "admin/build/views/nojs/details/$view->name", array('attributes' => array('class' => 'views-ajax-link')));
-
- // Calculate options from display plugin.
- $options = $categories = array();
- $display->handler->options_summary($categories, $options);
-
- // Build all of the options we were returned and put them into the
- // category data fields.
- foreach ($options as $id => $option) {
- if (empty($categories[$option['category']]['data'])) {
- $categories[$option['category']]['data'] = array();
- }
- $categories[$option['category']]['data'][$id] = array();
- $data = &$categories[$option['category']]['data'][$id];
- $data['content'] = '';
- $data['links'] = '';
- $data['overridden'] = FALSE;
- $data['defaulted'] = FALSE;
-
- // If there are optional links, build them first so they float properly.
- if (!empty($option['links'])) {
- foreach ($option['links'] as $link_id => $link_value) {
- $data['links'] .= $display->handler->option_link($link_value, $link_id, 'views-button-configure');
- }
- }
- if (!empty($option['title'])) {
- $data['content'] .= $option['title'] . ': ';
- }
-
- $data['content'] .= $display->handler->option_link($option['value'], $id, '', empty($option['desc']) ? '' : $option['desc']);
- if (!empty($display->handler->options['defaults'][$id])) {
- $display_id = 'default';
- $data['defaulted'] = TRUE;
- }
- else {
- $display_id = $display->id;
- if (!$display->handler->is_default_display()) {
- if ($display->handler->defaultable_sections($id)) {
- $data['overridden'] = TRUE;
- }
- }
- }
- $data['class'] = views_ui_item_css($display_id . '-' . $id);
- if (!empty($view->changed_sections[$display_id . '-' . $id])) {
- $data['changed'] = TRUE;
- }
- }
-
- $vars['categories'] = $categories;
-
- // Add a help icon
- if (isset($plugin['help topic'])) {
- $vars['display_help_icon'] = theme('advanced_help_topic', $plugin['module'], $plugin['help topic']);
- }
- else {
- $vars['display_help_icon'] = '';
- }
-
- // Fetch style plugin info because it has some effect on how/what we render.
- $style_plugin = $display->handler->get_plugin();
-
- $vars['fields'] = '';
- $vars['fields'] = theme('views_ui_edit_item', 'field', $view, $display, !($style_plugin && $style_plugin->uses_fields()));
- $vars['relationships'] = theme('views_ui_edit_item', 'relationship', $view, $display);
- $vars['arguments'] = theme('views_ui_edit_item', 'argument', $view, $display);
- $vars['filters'] = theme('views_ui_edit_item', 'filter', $view, $display);
- $vars['sorts'] = theme('views_ui_edit_item', 'sort', $view, $display);
-}
-
-/**
- * Generate the summary output for a single display to render in a tab.
- */
-function views_ui_display_tab($view, $display) {
- if (isset($display->handler)) {
- $plugin = $display->handler->definition;
- }
- if (empty($plugin)) {
- $title = isset($display->display_title) ? $display->display_title : t('Invalid');
- return array($title, t("Error: Display @display refers to a plugin named '@plugin', but that plugin doesn't exist!", array('@display' => $display->id, '@plugin' => $display->display_plugin)));
-
- // @todo We can do a better 'plugin does not exist' tab.
- }
-
- // The display should always be initialized prior to this call.
- if (empty($display->handler)) {
- return FALSE;
- }
-
- $body = theme('views_ui_edit_tab', $view, $display);
- return array($display->display_title, $body);
-}
-
-/**
- * Add information about a section to a display.
- */
-function template_preprocess_views_ui_edit_item(&$vars) {
- $type = $vars['type'];
- $view = $vars['view'];
- $display = $vars['display'];
-
- $types = views_object_types();
-
- $vars['overridden'] = FALSE;
- $vars['defaulted'] = FALSE;
-
- if ($vars['no_fields']) {
- $vars['title'] = $types[$type]['title'];
- $vars['item_help_icon'] = theme('advanced_help_topic', 'views', $type);
- $vars['rearrange'] = NULL;
- $vars['add'] = NULL;
- return;
- }
-
- $vars['rearrange'] = l('<span>' . t('Rearrange') . '</span>', "admin/build/views/nojs/rearrange/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-button-rearrange views-ajax-link', 'title' => t('Rearrange')), 'html' => true));
-
- $vars['add'] = l('<span>' . t('Add') . '</span>', "admin/build/views/nojs/add-item/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-button-add views-ajax-link', 'title' => t('Add')), 'html' => true));
-
- if (!$display->handler->is_default_display()) {
- if (!$display->handler->is_defaulted($types[$type]['plural'])) {
- $vars['overridden'] = TRUE;
- }
- else {
- $vars['defaulted'] = TRUE;
- }
- }
-
- $vars['title'] = l($types[$type]['title'], "admin/build/views/nojs/config-type/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-ajax-link')));
-// $vars['title'] = l($types[$type]['title'], "admin/build/views/nojs/config-type/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-ajax-link')));
-
- $fields = array();
-
- static $relationships = NULL;
- if (!isset($relationships)) {
- // Get relationship labels
- $relationships = array();
- // @todo: get_handlers()
- foreach ($display->handler->get_option('relationships') as $id => $relationship) {
- $handler = views_get_handler($relationship['table'], $relationship['field'], 'relationship');
- if (empty($handler)) {
- continue;
- }
- $handler->init($view, $relationship);
- $relationships[$id] = $handler->label();
- }
- }
-
- // @todo: get_handlers()
- foreach ($display->handler->get_option($types[$type]['plural']) as $id => $field) {
- $fields[$id] = array();
-
- $handler = views_get_handler($field['table'], $field['field'], $type);
- if (empty($handler)) {
- $fields[$id]['class'] = 'broken';
- $fields[$id]['title'] = t("Error: handler for @table > @field doesn't exist!", array('@table' => $field['table'], '@field' => $field['field']));
- $fields[$id]['info'] = '';
- continue;
- }
- $handler->init($view, $field);
-
- $field_name = $handler->ui_name(TRUE);
- if (!empty($field['relationship']) && !empty($relationships[$field['relationship']])) {
- $field_name = '(' . $relationships[$field['relationship']] . ') ' . $field_name;
- }
-
- $fields[$id]['title'] = l($field_name, "admin/build/views/nojs/config-item/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-ajax-link'), 'html' => TRUE));
- $fields[$id]['class'] = views_ui_item_css($display->id . '-' . $type . '-' . $id);
- if (!empty($view->changed_sections[$display->id . '-' . $type . '-' . $id])) {
- $fields[$id]['changed'] = TRUE;
- }
- $fields[$id]['info'] = $handler->admin_summary();
-
- if ($handler->has_extra_options()) {
- $fields[$id]['links'] = l('<span>' . t('Settings') . '</span>', "admin/build/views/nojs/config-item-extra/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Settings')), 'html' => true));
- }
-
- if ($handler->needs_style_plugin()) {
- $style_plugin = views_fetch_plugin_data('style', $handler->options['style_plugin']);
- $style_title = empty($style_plugin['title']) ? t('Missing style plugin') : $style_plugin['title'];
- $pid = $id . '-style-plugin';
-
- if (!empty($style_plugin['uses options'])) {
- $fields[$pid]['links'] = l('<span>' . t('Change settings for this style') . '</span>', "admin/build/views/nojs/config-style/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Settings')), 'html' => true));
- }
-
- $fields[$pid]['title'] = ' ' . t('&nbsp; Style: !style', array('!style' => l($style_title, "admin/build/views/nojs/change-style/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-ajax-link')))));
- $fields[$pid]['class'] = views_ui_item_css($display->id . '-' . $type . '-' . $pid);
- if (!empty($view->changed_sections[$display->id . '-' . $type . '-' . $pid])) {
- $fields[$pid]['changed'] = TRUE;
- }
- $fields[$pid]['info'] = '';
- }
- }
-
- $vars['fields'] = $fields;
- $vars['item_help_icon'] = theme('advanced_help_topic', 'views', $type);
-}
-
-/**
- * Regenerate the tabs for AJAX updates.
- */
-function views_ui_regenerate_tabs(&$view, $display_id = NULL, $object = NULL) {
- if (empty($display_id)) {
- $displays = array_keys($view->display);
- }
- elseif (!is_array($display_id)) {
- $displays = array($display_id);
- if ($display_id != 'default') {
- $displays[] = 'default';
- }
- }
- else {
- $displays = $display_id;
- }
-
- if (!$view->set_display('default')) {
- views_ajax_render(t('Invalid display id found while regenerating tabs'));
- }
-
- if (!is_object($object)) {
- $object = new stdClass();
- }
-
- $object->replace = array();
- foreach ($displays as $id) {
- list($title, $body) = views_ui_display_tab($view, $view->display[$id]);
- $object->replace['#views-tab-' . $id] = $body;
- $object->replace['#views-tab-title-' . $id] = check_plain($title);
- }
-
- if (!empty($view->changed)) {
- $object->changed = TRUE;
- }
-
- views_ajax_render($object);
-}
-
-/**
- * Provide standard buttons for the forms to make it easy. Also provide
- * a hidden op operator because the forms plugin doesn't seem to properly
- * provide which button was clicked.
- */
-function views_ui_standard_form_buttons(&$form, &$form_state, $form_id, $name = NULL, $third = NULL, $submit = NULL) {
- $form['buttons'] = array(
- '#prefix' => '<div class="clear-block"><div class="form-buttons">',
- '#suffix' => '</div></div>',
- );
-
- if (empty($name)) {
- $name = t('Update');
- }
- // remove default validate handler
- $form['#validate'] = array();
-
- if (empty($form_state['ok_button'])) {
- // but be sure submit button validates!
- $form['buttons']['submit'] = array(
- '#type' => 'submit',
- '#value' => $name,
- '#submit' => array($form_id . '_submit'),
- '#validate' => array('views_ui_standard_submit', $form_id . '_validate'),
- );
- }
-
- $cancel_submit = function_exists($form_id . '_cancel') ? $form_id . '_cancel' : 'views_ui_standard_cancel';
- $form['buttons']['cancel'] = array(
- '#type' => 'submit',
- '#value' => empty($form_state['ok_button']) ? t('Cancel') : t('Ok'),
- '#submit' => array($cancel_submit),
- '#validate' => array(),
- );
-
- if ($third) {
- if (empty($submit)) {
- $submit = 'third';
- }
- $third_submit = function_exists($form_id . '_' . $submit) ? $form_id . '_' . $submit : 'views_ui_standard_cancel';
-
- $form['buttons'][$submit] = array(
- '#type' => 'submit',
- '#value' => $third,
- '#validate' => array(),
- '#submit' => array($third_submit),
- );
- }
-
- // Compatibility, to be removed later:
- // We used to set these items on the form, but now we want them on the $form_state:
- if (isset($form['#title'])) {
- $form_state['title'] = $form['#title'];
- }
- if (isset($form['#help_topic'])) {
- $form_state['help_topic'] = $form['#help_topic'];
- }
- if (isset($form['#help_module'])) {
- $form_state['help_module'] = $form['#help_module'];
- }
- if (isset($form['#url'])) {
- $form_state['url'] = $form['#url'];
- }
- if (isset($form['#js'])) {
- if (!empty($form_state['js settings']) && is_array($form_state['js settings'])) {
- $form_state['js settings'] = array_merge($form_state['js settings'], $form['#js']);
- }
- else {
- $form_state['js settings'] = $form['#js'];
- }
- }
- if (isset($form['#section'])) {
- $form_state['#section'] = $form['#section'];
- }
- // Finally, we never want these cached -- our object cache does that for us.
- $form['#no_cache'] = TRUE;
-
- // If this isn't an ajaxy form, then we want to set the title.
- if (!empty($form['#title'])) {
- drupal_set_title($form['#title']);
- }
- views_add_css('views-admin');
-}
-
-/**
- * Basic submit handler applicable to all 'standard' forms
- */
-function views_ui_standard_submit($form, &$form_state) {
- if (!empty($form['#section'])) {
- $form_state['view']->changed_sections[$form['#section']] = TRUE;
- }
-}
-
-/**
- * Submit handler for cancel button
- */
-function views_ui_standard_cancel($form, &$form_state) {
- $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
-}
-
-// --------------------------------------------------------------------------
-// Various subforms for editing the pieces of a view.
-
-function views_ui_ajax_forms($key = NULL) {
- $forms = array(
- 'display' => array(
- 'form_id' => 'views_ui_edit_display_form',
- 'args' => array('section'),
- ),
- 'remove-display' => array(
- 'form_id' => 'views_ui_remove_display_form',
- 'args' => array(),
- ),
- 'config-type' => array(
- 'form_id' => 'views_ui_config_type_form',
- 'args' => array('type'),
- ),
- 'rearrange' => array(
- 'form_id' => 'views_ui_rearrange_form',
- 'args' => array('type'),
- ),
- 'add-item' => array(
- 'form_id' => 'views_ui_add_item_form',
- 'args' => array('type'),
- ),
- 'config-item' => array(
- 'form_id' => 'views_ui_config_item_form',
- 'args' => array('type', 'id'),
- ),
- 'config-item-extra' => array(
- 'form_id' => 'views_ui_config_item_extra_form',
- 'args' => array('type', 'id'),
- ),
- 'change-style' => array(
- 'form_id' => 'views_ui_change_style_form',
- 'args' => array('type', 'id'),
- ),
- 'config-style' => array(
- 'form_id' => 'views_ui_config_style_form',
- 'args' => array('type', 'id'),
- ),
- );
-
- if ($key) {
- return !empty($forms[$key]) ? $forms[$key] : NULL;
- }
-
- return $forms;
-}
-
-/**
- * Build a form identifier that we can use to see if one form
- * is the same as another. Since the arguments differ slightly
- * we do a lot of spiffy concenation here.
- */
-function views_ui_build_identifier($key, $view, $display_id, $args) {
- $form = views_ui_ajax_forms($key);
- $identifier = implode('-', array($key, $view->name, $display_id));
-
- foreach ($form['args'] as $id) {
- $arg = (!empty($args)) ? array_shift($args) : NULL;
- $identifier .= '-' . $arg;
- }
- return $identifier;
-}
-
-/**
- * Build up a $form_state object suitable for use with drupal_build_form
- * based on known information about a form.
- */
-function views_ui_build_form_state($js, $key, &$view, $display_id, $args) {
- $form = views_ui_ajax_forms($key);
- // Build up form state
- $form_state = array(
- 'form_key' => $key,
- 'form_id' => $form['form_id'],
- 'view' => &$view,
- 'ajax' => $js,
- 'display_id' => $display_id,
- 'no_redirect' => TRUE,
- );
-
- foreach ($form['args'] as $id) {
- $form_state[$id] = (!empty($args)) ? array_shift($args) : NULL;
- }
-
- return $form_state;
-}
-
-/**
- * Create the URL for one of our standard AJAX forms based upon known
- * information about the form.
- */
-function views_ui_build_form_url($form_state) {
- $form = views_ui_ajax_forms($form_state['form_key']);
- $ajax = empty($form_state['ajax']) ? 'nojs' : 'ajax';
- $name = $form_state['view']->name;
- $url = "admin/build/views/$ajax/$form_state[form_key]/$name/$form_state[display_id]";
- foreach ($form['args'] as $arg) {
- $url .= '/' . $form_state[$arg];
- }
- return $url;
-}
-
-/**
- * Add another form to the stack; clicking 'update' will go to this form
- * rather than closing the ajax pad.
- */
-function views_ui_add_form_to_stack($key, &$view, $display_id, $args, $top = FALSE) {
- if (empty($view->stack)) {
- $view->stack = array();
- }
-
- $stack = array(views_ui_build_identifier($key, $view, $display_id, $args), $key, &$view, $display_id, $args);
- if ($top) {
- array_unshift($view->stack, $stack);
- }
- else {
- $view->stack[] = $stack;
- }
-}
-
-/**
- * Generic entry point to handle forms.
- *
- * We do this for consistency and to make it easy to chain forms
- * together. This only works for forms that use both $view
- * and $display_id, so we have a couple of ajax forms that we don't
- * use with this system.
- */
-function views_ui_ajax_form($js, $key, &$view, $display_id) {
- $form = views_ui_ajax_forms($key);
- if (empty($form)) {
- return drupal_not_found();
- }
-
- views_include('ajax');
- $args = func_get_args();
- // Remove the known args
- array_splice($args, 0, 4);
-
- $form_state = views_ui_build_form_state($js, $key, $view, $display_id, $args);
- // check to see if this is the top form of the stack. If it is, pop
- // it off; if it isn't, the user clicked somewhere else and the stack is
- // now irrelevant.
- if (!empty($view->stack)) {
- $identifier = views_ui_build_identifier($key, $view, $display_id, $args);
- $top = array_shift($view->stack);
- if (array_shift($top) != $identifier) {
- $view->stack = array();
- }
- }
-
- $output = views_ajax_form_wrapper($form_state['form_id'], $form_state);
-
- if (!$output) {
- // Sometimes we need to re-generate the form for multi-step type operations.
- $object = NULL;
- if (!empty($view->stack)) {
- $stack = $view->stack; // copy so the next shift doesn't break the array
- $top = array_shift($stack);
- $top[0] = $js; // change identifier into $js setting
- $form_state = call_user_func_array('views_ui_build_form_state', $top);
- $form_state['input'] = array(); // this is a new form, make sure it
- // doesn't try to inherit $_POST info.
- if (!$js) {
- return drupal_goto(views_ui_build_form_url($form_state));
- }
- $object = views_ajax_form_wrapper($form_state['form_id'], $form_state);
- $object->url = url(views_ui_build_form_url($form_state));
- }
- else if (!$js) {
- // if nothing on the stack, non-js forms just go back to the main view editor.
- return drupal_goto("admin/build/views/edit/$view->name");
- }
- // regenerate all tabs because changes to the default tab could ripple.
- return views_ui_regenerate_tabs($view, NULL, $object);
- }
-
- return ($js) ? views_ajax_render($output) : $output;
-}
-
-/**
- * AJAX callback to add a display.
- */
-function views_ui_add_display($js, $view) {
- views_include('ajax');
- $form_state = array(
- 'view' => &$view,
- 'ajax' => $js,
- );
-
- $output = views_ajax_form_wrapper('views_ui_add_display_form', $form_state);
-
- if ($js) {
- // If we don't have an output object, it was submitted. Set up the submission.
- if (empty($output)) {
- $id = $form_state['id'];
-
- // Make sure the new display is active
- if (!$view->set_display('default')) {
- views_ajax_render(t('Unable to initialize default display'));
- }
-
- // Render the new display
- list($title, $body) = views_ui_display_tab($view, $view->display[$id]);
-
- // Instruct the javascript on the browser to render the new tab.
- $output = new stdClass;
- $output->tab = array('#views-tab-' . $id => array('title' => $title, 'body' => $body));
- }
- // Render the command object. This automatically exits.
- views_ajax_render($output);
- }
-
- // But the non-js variant will return output if it didn't redirect us.
- return $output;
-}
-
-/**
- * Form to add a display to a view.
- */
-function views_ui_add_display_form(&$form_state) {
- $view = &$form_state['view'];
-
- $form['display']['display'] = array(
- '#type' => 'select',
- '#options' => views_fetch_plugin_names('display'),
- '#default_value' => 'page',
- );
-
- $form['display']['add_display'] = array(
- '#type' => 'submit',
- '#value' => t('Add display'),
- '#submit' => array('views_ui_add_display_form_submit'),
- );
-
- $form['#id'] = 'views-add-display-form';
- $form['#attributes'] = array('class' => 'views-ajax-form');
- $form['#action'] = url("admin/build/views/nojs/add-display/$view->name");
-
- return $form;
-}
-
-/**
- * Submit handler to add a display to a view.
- */
-function views_ui_add_display_form_submit($form, &$form_state) {
- // Create the new display
- $plugin = $form_state['values']['display'];
- $form_state['id'] = $form_state['view']->add_display($plugin);
-
- // Store in cache
- views_ui_cache_set($form_state['view']);
-
- // Send it back
- $form_state['redirect'] = array('admin/build/views/edit/' . $form_state['view']->name, NULL, 'views-tab-' . $form_state['id']);
-}
-
-/**
- * Form to remove a display from a view.
- */
-function views_ui_remove_display_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
-
- if (empty($view->display[$display_id]->deleted)) {
- $form['display'] = array(
- '#prefix' => '<div class="display-button remove-display">',
- '#suffix' => '</div>',
- );
- $form['remove_display'] = array(
- '#type' => 'submit',
- '#value' => t('Remove display'),
- '#submit' => array('views_ui_remove_display_form_submit'),
- );
- }
- else {
- $form['display'] = array(
- '#prefix' => '<div class="display-button restore-display">',
- '#suffix' => '</div>',
- );
- $form['restore_display'] = array(
- '#type' => 'submit',
- '#value' => t('Restore display'),
- '#submit' => array('views_ui_remove_display_form_restore'),
- );
- }
- $form['#action'] = url("admin/build/views/nojs/remove-display/$view->name/$display_id");
- $form['#attributes'] = array('class' => 'views-ajax-form');
-
- return $form;
-}
-
-/**
- * Submit handler to add a remove to a display from a view.
- */
-function views_ui_remove_display_form_submit($form, &$form_state) {
- // Create the new display
- $plugin = views_fetch_plugin_data('display', $form_state['view']->display[$form_state['display_id']]->display_plugin);
- if (empty($plugin['no remove'])) {
- $id = $form_state['display_id'];
- $form_state['view']->display[$id]->deleted = TRUE;
-
- // Store in cache
- views_ui_cache_set($form_state['view']);
- }
-}
-
-/**
- * Submit handler to add a restore a removed display to a view.
- */
-function views_ui_remove_display_form_restore($form, &$form_state) {
- // Create the new display
- $id = $form_state['display_id'];
- $form_state['view']->display[$id]->deleted = FALSE;
-
- // Store in cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Page callback to display analysis information on a view.
- */
-function views_ui_analyze_view($js, $view) {
- views_include('ajax');
- $form_state = array(
- 'view' => &$view,
- 'ajax' => $js,
- );
-
- $output = views_ajax_form_wrapper('views_ui_analyze_view_form', $form_state);
-
- if ($js) {
- // If we don't have an output object, it was submitted. Set up the submission.
- if (empty($output)) {
- return views_ui_regenerate_tabs($view);
- }
- return views_ajax_render($output);
-
- }
- return $output;
-}
-
-/**
- * This form doesn't particularly do much; it's really just providing a link
- * but a button seems like it would be nicer here.
- *
- * It has no submit or anything, as we will never actually submit this form
- * where the form is placed.
- */
-function views_ui_analyze_view_button(&$form_state, $view) {
- $form['#action'] = url("admin/build/views/nojs/analyze/$view->name");
- $form['#attributes'] = array('class' => 'views-ajax-form');
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Analyze'),
- );
-
- return $form;
-}
-
-/**
- * Form constructor callback to display analysis information on a view
- */
-function views_ui_analyze_view_form(&$form_state) {
- $view = &$form_state['view'];
-
- $form['#title'] = t('View analysis');
- $form['#section'] = 'analyze';
-
- views_include('analyze');
- $messages = views_analyze_view($view);
-
- $form['analysis'] = array(
- '#prefix' => '<div class="form-item">',
- '#suffix' => '</div>',
- '#value' => views_analyze_format_result($view, $messages),
- );
-
- // Inform the standard button function that we want an OK button.
- $form_state['ok_button'] = TRUE;
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_analyze_view_form');
- return $form;
-}
-
-/**
- * Submit handler for views_ui_analyze_view_form
- */
-function views_ui_analyze_view_form_submit($form, &$form_state) {
- $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
-}
-
-/**
- * Page callback to edit details of a view.
- */
-function views_ui_edit_details($js, $view) {
- views_include('ajax');
- $form_state = array(
- 'view' => &$view,
- 'ajax' => $js,
- );
-
- $output = views_ajax_form_wrapper('views_ui_edit_details_form', $form_state);
-
- if ($js) {
- // If we don't have an output object, it was submitted. Set up the submission.
- if (empty($output)) {
- return views_ui_regenerate_tabs($view);
- }
- return views_ajax_render($output);
-
- }
- return $output;
-}
-
-/**
- * Form constructor callback to edit details of a view
- */
-function views_ui_edit_details_form(&$form_state) {
- $view = &$form_state['view'];
-
- $form['#title'] = t('View details');
- $form['#section'] = 'details';
-
- $form['description'] = array(
- '#type' => 'textfield',
- '#title' => t('View description'),
- '#description' => t('This description will appear on the Views administrative UI to tell you what the view is about.'),
- '#default_value' => $view->description,
- );
-
- $form['tag'] = array(
- '#type' => 'textfield',
- '#title' => t('View tag'),
- '#description' => t('Enter an optional tag for this view; it is used only to help sort views on the administrative page.'),
- '#default_value' => $view->tag,
- '#autocomplete_path' => 'admin/views/ajax/autocomplete/tag',
- );
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_edit_details_form');
- return $form;
-}
-
-/**
- * Submit handler for views_ui_edit_details_form
- */
-function views_ui_edit_details_form_submit($form, &$form_state) {
- $form_state['view']->description = $form_state['values']['description'];
- $form_state['view']->tag = $form_state['values']['tag'];
- views_ui_cache_set($form_state['view']);
- $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
-}
-
-/**
- * Form constructor callback to edit display of a view
- */
-function views_ui_edit_display_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $section = $form_state['section'];
-
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $display = &$view->display[$display_id];
-
- // Get form from the handler.
- $display->handler->options_form($form, $form_state);
- $name = NULL;
- if (isset($form_state['update_name'])) {
- $name = $form_state['update_name'];
- }
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_edit_display_form', $name);
- return $form;
-}
-
-/**
- * Validate handler for views_ui_edit_display_form
- */
-function views_ui_edit_display_form_validate($form, &$form_state) {
- $display = &$form_state['view']->display[$form_state['display_id']];
- $display->handler->options_validate($form, $form_state);
-}
-
-/**
- * Submit handler for views_ui_edit_display_form
- */
-function views_ui_edit_display_form_submit($form, &$form_state) {
- $display = &$form_state['view']->display[$form_state['display_id']];
- $display->handler->options_submit($form, $form_state);
-
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Override handler for views_ui_edit_display_form
- */
-function views_ui_edit_display_form_override($form, &$form_state) {
- $display = &$form_state['view']->display[$form_state['display_id']];
- $display->handler->options_override($form, $form_state);
-
- views_ui_cache_set($form_state['view']);
- $form_state['rerender'] = TRUE;
- $form_state['rebuild'] = TRUE;
-}
-/**
- * Form to config items in the views UI.
- */
-function views_ui_config_type_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $type = $form_state['type'];
-
- $types = views_object_types();
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $display = &$view->display[$display_id];
- $form['#title'] = check_plain($display->display_title) . ': ';
- $form['#title'] .= t('Configure @type', array('@type' => $types[$type]['ltitle']));
- $form['#section'] = $display_id . 'config-item';
-
- if ($display->handler->defaultable_sections($types[$type]['plural'])) {
- $form_state['section'] = $types[$type]['plural'];
- $display->handler->add_override_button($form, $form_state, $form_state['section']);
- }
-
- if (!empty($types[$type]['options']) && function_exists($types[$type]['options'])) {
- $options = $type . '_options';
- $form[$options] = array('#tree' => TRUE);
- $types[$type]['options']($form, $form_state);
- }
-
- $name = NULL;
- if (isset($form_state['update_name'])) {
- $name = $form_state['update_name'];
- }
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_config_type_form', $name);
- return $form;
-}
-
-/**
- * Submit handler for type configuration form
- */
-function views_ui_config_type_form_submit($form, &$form_state) {
- $types = views_object_types();
- $display = &$form_state['view']->display[$form_state['display_id']];
-
- // Store in cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Configure settings particular to filters.
- */
-function views_ui_config_filters_form(&$form, &$form_state) {
-
-}
-
-/**
- * Form to rearrange items in the views UI.
- */
-function views_ui_rearrange_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $type = $form_state['type'];
-
- $types = views_object_types();
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $display = &$view->display[$display_id];
- $form['#title'] = check_plain($display->display_title) . ': ';
- $form['#title'] .= t('Rearrange @type', array('@type' => $types[$type]['ltitle']));
- $form['#section'] = $display_id . 'rearrange-item';
-
- if ($display->handler->defaultable_sections($types[$type]['plural'])) {
- $form_state['section'] = $types[$type]['plural'];
- $display->handler->add_override_button($form, $form_state, $form_state['section']);
- }
-
- $count = 0;
-
- // Get relationship labels
- $relationships = array();
- // @todo: get_handlers()
- foreach ($display->handler->get_option('relationships') as $id => $relationship) {
- $handler = views_get_handler($relationship['table'], $relationship['field'], 'relationship');
- if (empty($handler)) {
- continue;
- }
- $handler->init($view, $relationship);
- $relationships[$id] = $handler->label();
- }
-
- // @todo: get_handlers()
- foreach ($display->handler->get_option($types[$type]['plural']) as $id => $field) {
- $form[$id] = array('#tree' => TRUE);
- $form[$id]['weight'] = array(
- '#type' => 'weight',
- '#delta' => 25,
- '#default_value' => ++$count,
- );
- $handler = views_get_handler($field['table'], $field['field'], $type);
- if ($handler) {
- $handler->init($view, $field);
- $name = $handler->ui_name() . ' ' . $handler->admin_summary();
- if (!empty($field['relationship']) && !empty($relationships[$field['relationship']])) {
- $name = '(' . $relationships[$field['relationship']] . ') ' . $name;
- }
-
- $form[$id]['name'] = array(
- '#value' => $name,
- );
- }
- else {
- $form[$id]['name'] = array('#value' => t('Broken field @id', array('@id' => $id)));
- }
- $form[$id]['removed'] = array(
- '#type' => 'checkbox',
- '#id' => 'views-removed-' . $id,
- '#attributes' => array('class' => 'views-remove-checkbox'),
- '#default_value' => 0,
- );
- }
-
- // Add javascript settings that will be added via $.extend for tabledragging
- $form['#js']['tableDrag']['arrange']['weight'][0] = array(
- 'target' => 'weight',
- 'source' => NULL,
- 'relationship' => 'sibling',
- 'action' => 'order',
- 'hidden' => TRUE,
- 'limit' => 0,
- );
-
- $name = NULL;
- if (isset($form_state['update_name'])) {
- $name = $form_state['update_name'];
- }
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_rearrange_form');
- return $form;
-}
-
-/**
- * Turn the rearrange form into a proper table
- */
-function theme_views_ui_rearrange_form($form) {
- $rows = array();
- foreach (element_children($form) as $id) {
- if (isset($form[$id]['name'])) {
- $row = array();
- $row[] = drupal_render($form[$id]['name']);
- $form[$id]['weight']['#attributes']['class'] = 'weight';
- $row[] = drupal_render($form[$id]['weight']);
- $row[] = drupal_render($form[$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => 'views-button-remove views-remove-link', 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true));
-
- $rows[] = array('data' => $row, 'class' => 'draggable', 'id' => 'views-row-' . $id);
- }
- }
- if (empty($rows)) {
- $rows[] = array(array('data' => t('No fields available.'), 'colspan' => '2'));
- }
-
- $header = array('', t('Weight'), t('Remove'));
- drupal_add_tabledrag('arrange', 'order', 'sibling', 'weight');
- $output = drupal_render($form['override']);
- $output .= theme('table', $header, $rows, array('id' => 'arrange'));
- $output .= drupal_render($form);
- return $output;
-
-}
-
-/**
- * Submit handler for rearranging form
- */
-function views_ui_rearrange_form_submit($form, &$form_state) {
- $types = views_object_types();
- $display = &$form_state['view']->display[$form_state['display_id']];
-
- $old_fields = $display->handler->get_option($types[$form_state['type']]['plural']);
- $new_fields = $order = array();
-
- // Make an array with the weights
- foreach ($form_state['values'] as $field => $info) {
- // add each value that is a field with a weight to our list, but only if
- // it has had its 'removed' checkbox checked.
- if (is_array($info) && isset($info['weight']) && empty($info['removed'])) {
- $order[$field] = $info['weight'];
- }
- }
-
- // Sort the array
- asort($order);
-
- // Create a new list of fields in the new order.
- foreach (array_keys($order) as $field) {
- $new_fields[$field] = $old_fields[$field];
- }
- $display->handler->set_option($types[$form_state['type']]['plural'], $new_fields);
-
- // Store in cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Form to add_item items in the views UI.
- */
-function views_ui_add_item_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $type = $form_state['type'];
-
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $display = &$view->display[$display_id];
-
- $types = views_object_types();
- $form['#title'] = check_plain($display->display_title) . ': ';
- $form['#title'] .= t('Add @type', array('@type' => $types[$type]['ltitle']));
- $form['#section'] = $display_id . 'add-item';
-
- // Figure out all the base tables allowed based upon what the relationships provide.
- $base_tables = $view->get_base_tables();
- $options = views_fetch_fields(array_keys($base_tables), $type);
-
- if (!empty($options)) {
- $groups = array('all' => t('<All>'));
- $form['group'] = array(
- '#type' => 'select',
- '#title' => t('Groups'),
- '#options' => array(),
- '#attributes' => array('class' => 'views-master-dependent'),
- );
-
- $form['name'] = array(
- '#prefix' => '<div class="views-radio-box form-checkboxes">',
- '#suffix' => '</div>',
- '#tree' => TRUE,
- '#default_value' => 'all',
- );
-
- // Group options first to simplify the DOM objects that Views
- // dependent JS will act upon.
- $grouped_options = array();
- foreach ($options as $key => $option) {
- $group = preg_replace('/[^a-z0-9]/', '-', strtolower($option['group']));
- $groups[$group] = $option['group'];
- $grouped_options[$group][$key] = $option;
- }
-
- foreach ($grouped_options as $group => $group_options) {
- $form['name'][$group . '_start'] = array('#type' => 'markup', '#value' => '<div class="views-dependent-all views-dependent-' . $group . '">');
- foreach ($group_options as $key => $option) {
- $form['name'][$key] = array(
- '#type' => 'checkbox',
- '#title' => t('!group: !field', array('!group' => $option['group'], '!field' => $option['title'])),
- '#description' => $option['help'],
- '#return_value' => $key,
- );
- }
- $form['name'][$group . '_end'] = array('#type' => 'markup', '#value' => '</div>');
- }
-
- $form['group']['#options'] = $groups;
- }
- else {
- $form['markup'] = array(
- '#value' => '<div class="form-item">' . t('There are no @types available to add.', array('@types' => $types[$type]['ltitle'])) . '</div>',
- );
- }
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_add_item_form', t('Add'));
-
- return $form;
-}
-
-/**
- * Submit handler for adding new item(s) to a view.
- */
-function views_ui_add_item_form_submit($form, &$form_state) {
- $type = $form_state['type'];
- $types = views_object_types();
-
- if (!empty($form_state['values']['name']) && is_array($form_state['values']['name'])) {
- // Loop through each of the items that were checked and add them to the view.
- foreach (array_keys(array_filter($form_state['values']['name'])) as $field) {
- list($table, $field) = explode('.', $field, 2);
- $id = $form_state['view']->add_item($form_state['display_id'], $type, $table, $field);
-
- // check to see if this type has settings, if so add the settings form first
- $handler = views_get_handler($table, $field, $type);
- if ($handler && $handler->has_extra_options()) {
- views_ui_add_form_to_stack('config-item-extra', $form_state['view'], $form_state['display_id'], array($type, $id));
- }
- // Then add the form to the stack
- views_ui_add_form_to_stack('config-item', $form_state['view'], $form_state['display_id'], array($type, $id));
- }
- }
-
- // Store in cache
- views_ui_cache_set($form_state['view']);
-}
-
-
-/**
- * Form to config_item items in the views UI.
- */
-function views_ui_config_item_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $type = $form_state['type'];
- $id = $form_state['id'];
-
- $form = array('options' => array('#tree' => TRUE));
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $item = $view->get_item($display_id, $type, $id);
-
- if ($item) {
- $handler = views_get_handler($item['table'], $item['field'], $type);
- if (empty($handler)) {
- $form['markup'] = array('#value' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
- }
- else {
- $handler->init($view, $item);
- $types = views_object_types();
-
- if ($view->display_handler->defaultable_sections($types[$type]['plural'])) {
- $form_state['section'] = $types[$type]['plural'];
- $view->display_handler->add_override_button($form['options'], $form_state, $form_state['section']);
- }
-
- // A whole bunch of code to figure out what relationships are valid for
- // this item.
- $relationships = $view->display_handler->get_option('relationships');
- $relationship_options = array();
-
- foreach ($relationships as $relationship) {
- // relationships can't link back to self. But also, due to ordering,
- // relationships can only link to prior relationships.
- if ($type == 'relationship' && $id == $relationship['id']) {
- break;
- }
- $relationship_handler = views_get_handler($relationship['table'], $relationship['field'], 'relationship');
- // ignore invalid/broken relationships.
- if (empty($relationship_handler)) {
- continue;
- }
-
- // If this relationship is valid for this type, add it to the list.
- $data = views_fetch_data($relationship['table']);
- $base = $data[$relationship['field']]['relationship']['base'];
- $base_fields = views_fetch_fields($base, $form_state['type']);
- if (isset($base_fields[$item['table'] . '.' . $item['field']])) {
- $relationship_handler->init($view, $relationship);
- $relationship_options[$relationship['id']] = $relationship_handler->label();
- }
- }
-
- if (!empty($relationship_options)) {
- // Make sure the existing relationship is even valid. If not, force
- // it to none.
- $base_fields = views_fetch_fields($view->base_table, $form_state['type']);
- if (isset($base_fields[$item['table'] . '.' . $item['field']])) {
- $relationship_options = array_merge(array('none' => t('Do not use a relationship')), $relationship_options);
- }
- $rel = empty($item['relationship']) ? 'none' : $item['relationship'];
- if (empty($relationship_options[$rel])) {
- // Pick the first relationship.
- $rel = key($relationship_options);
- // We want this relationship option to get saved even if the user
- // skips submitting the form.
- $view->set_item_option($display_id, $type, $id, 'relationship', $rel);
- $temp_view = $view->clone_view();
- views_ui_cache_set($temp_view);
- }
-
- $form['options']['relationship'] = array(
- '#type' => 'select',
- '#title' => t('Relationship'),
- '#options' => $relationship_options,
- '#default_value' => $rel,
- );
- }
- else {
- $form['options']['relationship'] = array(
- '#type' => 'value',
- '#value' => 'none',
- );
- }
-
- $form['#title'] = check_plain($view->display[$display_id]->display_title) . ': ';
- $form['#title'] .= t('Configure @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
-
- $form['#section'] = $display_id . '-' . $type . '-' . $id;
-
- // Get form from the handler.
- $handler->options_form($form['options'], $form_state);
- $form_state['handler'] = &$handler;
- }
-
- $name = NULL;
- if (isset($form_state['update_name'])) {
- $name = $form_state['update_name'];
- }
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_config_item_form', $name, t('Remove'), 'remove');
- }
- return $form;
-}
-
-/**
- * Submit handler for configing new item(s) to a view.
- */
-function views_ui_config_item_form_validate($form, &$form_state) {
- $form_state['handler']->options_validate($form['options'], $form_state);
-}
-
-/**
- * Submit handler for configing new item(s) to a view.
- */
-function views_ui_config_item_form_submit($form, &$form_state) {
- // Run it through the handler's submit function.
- $form_state['handler']->options_submit($form['options'], $form_state);
- $item = $form_state['handler']->options;
-
- // Unset a button
- unset($form_state['values']['options']['expose_button']);
-
- // Store the data we're given.
- foreach ($form_state['values']['options'] as $key => $value) {
- $item[$key] = $value;
- }
-
- // Store the item back on the view
- $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $item);
-
- $handler = views_get_handler($item['table'], $item['field'], $form_state['type']);
- $handler->init($form_state['view'], $item);
- if ($handler && $handler->needs_style_plugin()) {
- views_ui_add_form_to_stack('change-style', $form_state['view'], $form_state['display_id'], array($form_state['type'], $form_state['id']), TRUE);
- }
-
- // Write to cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Submit handler for removing an item from a view
- */
-function views_ui_config_item_form_remove($form, &$form_state) {
- // Store the item back on the view
- $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], NULL);
-
- // Write to cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Override handler for views_ui_edit_display_form
- */
-function views_ui_config_item_form_expose($form, &$form_state) {
- $item = &$form_state['handler']->options;
- // flip
- $item['exposed'] = empty($item['exposed']);
-
- // If necessary, set new defaults:
- if ($item['exposed']) {
- $form_state['handler']->expose_options();
- }
-
- $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $item);
-
- views_ui_cache_set($form_state['view']);
- $form_state['rerender'] = TRUE;
- $form_state['rebuild'] = TRUE;
- $form_state['force_expose_options'] = TRUE;
-}
-
-/**
- * Form to config_item items in the views UI.
- */
-function views_ui_config_item_extra_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $type = $form_state['type'];
- $id = $form_state['id'];
-
- $form = array('options' => array('#tree' => TRUE));
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $item = $view->get_item($display_id, $type, $id);
-
- if ($item) {
- $handler = views_get_handler($item['table'], $item['field'], $type);
- if (empty($handler)) {
- $form['markup'] = array('#value' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
- break;
- }
- else {
- $handler->init($view, $item);
- $types = views_object_types();
-
- $form['#title'] = check_plain($view->display[$display_id]->display_title) . ': ';
- $form['#title'] .= t('Configure extra settings for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
-
- $form['#section'] = $display_id . '-' . $type . '-' . $id;
-
- // Get form from the handler.
- $handler->extra_options_form($form['options'], $form_state);
- $form_state['handler'] = &$handler;
-
- }
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_config_item_extra_form');
- }
- return $form;
-}
-
-/**
- * Submit handler for configing new item(s) to a view.
- */
-function views_ui_config_item_extra_form_validate($form, &$form_state) {
- $form_state['handler']->extra_options_validate($form['options'], $form_state);
-}
-
-/**
- * Submit handler for configing new item(s) to a view.
- */
-function views_ui_config_item_extra_form_submit($form, &$form_state) {
- // Run it through the handler's submit function.
- $form_state['handler']->extra_options_submit($form['options'], $form_state);
- $item = $form_state['handler']->options;
-
- // Store the data we're given.
- foreach ($form_state['values']['options'] as $key => $value) {
- $item[$key] = $value;
- }
-
- // Store the item back on the view
- $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $item);
-
- // Write to cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Form to change_style items in the views UI.
- */
-function views_ui_change_style_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $type = $form_state['type'];
- $id = $form_state['id'];
-
- $form = array('options' => array('#tree' => TRUE));
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $item = $view->get_item($display_id, $type, $id);
-
- if ($item) {
- $handler = views_get_handler($item['table'], $item['field'], $type);
- if (empty($handler)) {
- $form['markup'] = array('#value' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
- break;
- }
- $handler->init($view, $item);
- $types = views_object_types();
- $form['#title'] = t('Change summary style for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
-
- $form['#section'] = $display_id . '-' . $type . '-' . $id . '-style-plugin';
-
- $form['style_plugin'] = array(
- '#type' => 'radios',
- '#options' => views_fetch_plugin_names('style', 'summary'),
- '#default_value' => $item['style_plugin'],
- );
-
- $form_state['handler'] = &$handler;
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_change_style_form');
- }
- return $form;
-}
-
-function views_ui_change_style_form_validate($form, &$form_state) {
- // Run it through the handler's submit function.
- $form_state['handler']->options_validate($form['options'], $form_state);
-
- $plugin = views_get_plugin('style', $form_state['values']['style_plugin']);
- if (!$plugin) {
- form_error($form['style_plugin'], t('Internal error: broken plugin.'));
- }
-}
-
-/**
- * Submit handler for configing new item(s) to a view.
- */
-function views_ui_change_style_form_submit($form, &$form_state) {
- // Run it through the handler's submit function.
- $form_state['handler']->options_submit($form['options'], $form_state);
- $item = $form_state['handler']->options;
-
- $plugin = views_get_plugin('style', $form_state['values']['style_plugin']);
- if (!$plugin) {
- drupal_set_message(t('Internal error: broken plugin.'), 'error');
- return;
- }
-
- $plugin->init($form_state['view'], $form_state['view']->display[$form_state['display_id']]);
-
- // If changing style plugin, reset options to defaults.
- if (empty($item['style_plugin']) || $item['style_plugin'] != $form_state['values']['style_plugin']) {
- $item['style_options'] = $plugin->options;
- }
-
- // Store the data we're given.
- $item['style_plugin'] = $form_state['values']['style_plugin'];
-
- // Store the item back on the view
- $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $item);
-
- if (!empty($plugin->definition['uses options'])) {
- views_ui_add_form_to_stack('config-style', $form_state['view'], $form_state['display_id'], array($form_state['type'], $form_state['id']), TRUE);
- }
-
- // Write to cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Form to config_style items in the views UI.
- */
-function views_ui_config_style_form(&$form_state) {
- $view = &$form_state['view'];
- $display_id = $form_state['display_id'];
- $type = $form_state['type'];
- $id = $form_state['id'];
-
- $form = array('options' => array('#tree' => TRUE));
- if (!$view->set_display($display_id)) {
- views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
- }
- $item = $view->get_item($display_id, $type, $id);
-
- if ($item) {
- $handler = views_get_handler($item['table'], $item['field'], $type);
- if (empty($handler)) {
- $form['markup'] = array('#value' => t("Error: handler for @table > @field doesn't exist!", array('@table' => $item['table'], '@field' => $item['field'])));
- break;
- }
- $handler->init($view, $item);
- $types = views_object_types();
-
- $form['#title'] = check_plain($view->display[$display_id]->display_title) . ': ';
- $form['#title'] .= t('Configure summary style for @type %item', array('@type' => $types[$type]['lstitle'], '%item' => $handler->ui_name()));
-
- $form['#section'] = $display_id . '-' . $type . '-style-options';
-
- $plugin = views_get_plugin('style', $item['style_plugin']);
- if ($plugin) {
- $form['style_options'] = array(
- '#tree' => TRUE,
- );
- $plugin->init($view, $view->display[$display_id], $item['style_options']);
-
- $plugin->options_form($form['style_options'], $form_state);
- }
-
- $form_state['handler'] = &$handler;
-
- views_ui_standard_form_buttons($form, $form_state, 'views_ui_config_style_form');
- }
- return $form;
-}
-
-/**
- * Submit handler for configing new item(s) to a view.
- */
-function views_ui_config_style_form_submit($form, &$form_state) {
- // Run it through the handler's submit function.
- $form_state['handler']->options_submit($form['style_options'], $form_state);
- $item = $form_state['handler']->options;
-
- // Store the data we're given.
- $item['style_options'] = $form_state['values']['style_options'];
-
- // Store the item back on the view
- $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $item);
-
- // Write to cache
- views_ui_cache_set($form_state['view']);
-}
-
-/**
- * Get a list of roles in the system.
- */
-function views_ui_get_roles() {
- static $roles = NULL;
- if (!isset($roles)) {
- $roles = array();
- $result = db_query("SELECT r.rid, r.name FROM {role} r ORDER BY r.name");
- while ($obj = db_fetch_object($result)) {
- $roles[$obj->rid] = $obj->name;
- }
- }
-
- return $roles;
-}
-
-/**
- * Get a css safe id for a particular section.
- */
-function views_ui_item_css($item) {
- return views_css_safe('views-item-' . $item);
-}
-
-/**
- * Page callback for the Views enable page.
- */
-function views_ui_enable_page($view) {
- $views_status = variable_get('views_defaults', array());
- $views_status[$view->name] = FALSE; // false is enabled
- variable_set('views_defaults', $views_status);
- views_invalidate_cache();
- menu_rebuild();
- drupal_goto('admin/build/views');
-}
-
-/**
- * Page callback for the Views enable page
- */
-function views_ui_disable_page($view) {
- $views_status = variable_get('views_defaults', array());
- $views_status[$view->name] = TRUE; // True is disabled
- variable_set('views_defaults', $views_status);
- views_invalidate_cache();
- menu_rebuild();
- drupal_goto('admin/build/views');
-}
-
-/**
- * Page callback for the tools - other page
- */
-function views_ui_admin_tools() {
- $form['clear_cache'] = array(
- '#type' => 'submit',
- '#value' => t("Clear Views' cache"),
- '#submit' => array('views_ui_tools_clear_cache'),
- );
-
- $form['views_sql_signature'] = array(
- '#type' => 'checkbox',
- '#title' => t('Add Views signature to all SQL queries'),
- '#description' => t("All Views-generated queries will include a special 'VIEWS' = 'VIEWS' string in the WHERE clause. This makes identifying Views queries in database server logs simpler, but should only be used when troubleshooting."),
- '#default_value' => variable_get('views_sql_signature', FALSE),
- );
-
- $form['views_skip_cache'] = array(
- '#type' => 'checkbox',
- '#title' => t('Disable views data caching'),
- '#description' => t("Views caches data about tables, modules and views available, to increase performance. By checking this box, Views will skip this cache and always rebuild this data when needed. This can have a serious performance impact on your site."),
- '#default_value' => variable_get('views_skip_cache', FALSE),
- );
-
- $form['views_hide_help_message'] = array(
- '#type' => 'checkbox',
- '#title' => t('Ignore missing advanced help module'),
- '#description' => t("Views uses the advanced help module to provide help text; if this module is not present Views will complain, unless this setting is checked."),
- '#default_value' => variable_get('views_hide_help_message', FALSE),
- );
-
- $form['views_ui_query_on_top'] = array(
- '#type' => 'checkbox',
- '#title' => t('Show query above live preview'),
- '#description' => t("The live preview feature will show you the output of the view you're creating, as well as the view. Check here to show the query and other information above the view; leave this unchecked to show that information below the view."),
- '#default_value' => variable_get('views_ui_query_on_top', FALSE),
- );
-
- $form['views_show_additional_queries'] = array(
- '#type' => 'checkbox',
- '#title' => t('Show other queries run during render during live preview'),
- '#description' => t("Drupal has the potential to run many queries while a view is being rendered. Checking this box will display every query run during view render as part of the live preview."),
- '#default_value' => variable_get('views_show_additional_queries', FALSE),
- );
-
- $form['views_no_hover_links'] = array(
- '#type' => 'checkbox',
- '#title' => t('Do not show hover links over views'),
- '#description' => t("To make it easier to administrate your views, Views provides 'hover' links to take you to the edit and export screen of a view whenever the view is used. This can be distracting on some themes, though; if it is problematic, you can turn it off here."),
- '#default_value' => variable_get('views_no_hover_links', FALSE),
- );
-
- $form['views_devel_output'] = array(
- '#type' => 'checkbox',
- '#title' => t('Enable views performance statistics via the Devel module'),
- '#description' => t("Check this to enable some Views query and performance statistics <em>if Devel is installed</em>."),
- '#default_value' => variable_get('views_devel_output', FALSE),
- );
-
- $form['views_no_javascript'] = array(
- '#type' => 'checkbox',
- '#title' => t('Disable javascript with Views'),
- '#description' => t("If you are having problems with the javascript, you can disable it here; the Views UI should degrade and still be usable without javascript, it just not as good."),
- '#default_value' => variable_get('views_no_javascript', FALSE),
- );
-
- $regions = system_region_list(variable_get('theme_default', 'garland'));
- $regions['watchdog'] = t('Watchdog');
-
- $form['views_devel_region'] = array(
- '#type' => 'select',
- '#title' => t('Page region to output performance statistics'),
- '#default_value' => variable_get('views_devel_region', 'footer'),
- '#options' => $regions,
- );
-
- $form['views_exposed_filter_any_label'] = array(
- '#type' => 'select',
- '#title' => t('Label for "Any" value on optional single-select exposed filters'),
- '#options' => array('old_any' => t('<Any>'), 'new_any' => t('- Any -')),
- '#default_value' => variable_get('views_exposed_filter_any_label', 'old_any'),
- );
-
- return system_settings_form($form);
-}
-
-/**
- * Submit hook to clear the views cache.
- */
-function views_ui_tools_clear_cache() {
- views_invalidate_cache();
- drupal_set_message(t('The cache has been cleared.'));
-}
-
-/**
- * Submit hook to clear Drupal's theme registry (thereby triggering
- * a templates rescan).
- */
-function views_ui_config_item_form_rescan($form, &$form_state) {
- drupal_rebuild_theme_registry();
-
- // The 'Theme: Information' page is about to be shown again. That page
- // analyzes the output of theme_get_registry(). However, this latter
- // function uses an internal cache (which was initialized before we
- // called drupal_rebuild_theme_registry()) so it won't reflect the
- // current state of our theme registry. The only way to clear that cache
- // is to re-initialize the theme system:
- unset($GLOBALS['theme']);
- init_theme();
-
- $form_state['rerender'] = TRUE;
- $form_state['rebuild'] = TRUE;
-}
-
-/**
- * Override handler for views_ui_edit_display_form
- */
-function views_ui_edit_display_form_change_theme($form, &$form_state) {
- // This is just a temporary variable.
- $form_state['view']->theme = $form_state['values']['theme'];
-
- views_ui_cache_set($form_state['view']);
- $form_state['rerender'] = TRUE;
- $form_state['rebuild'] = TRUE;
-}
-
-/**
- * Page callback for views tag autocomplete
- */
-function views_ui_autocomplete_tag($string = '') {
- $matches = array();
- // get matches from default views:
- views_include('view');
- $views = views_discover_default_views();
- foreach ($views as $view) {
- if (!empty($view->tag) && strpos($view->tag, $string) === 0) {
- $matches[$view->tag] = $view->tag;
- }
- }
-
- if ($string) {
- $result = db_query_range("SELECT DISTINCT tag FROM {views_view} WHERE LOWER(tag) LIKE LOWER('%s%%')", $string, 0, 10 - count($matches));
- while ($view = db_fetch_object($result)) {
- $matches[$view->tag] = check_plain($view->tag);
- }
- }
-
- drupal_json($matches);
-}
-
-// ------------------------------------------------------------------
-// Get information from the Views data
-
-function _views_weight_sort($a, $b) {
- if ($a['weight'] != $b['weight']) {
- return $a['weight'] < $b['weight'] ? -1 : 1;
- }
- if ($a['title'] != $b['title']) {
- return $a['title'] < $b['title'] ? -1 : 1;
- }
-
- return 0;
-}
-
-/**
- * Fetch a list of all base tables available
- *
- * @return
- * A keyed array of in the form of 'base_table' => 'Description'.
- */
-function views_fetch_base_tables() {
- static $base_tables = array();
- if (empty($base_tables)) {
- $weights = array();
- $tables = array();
- $data = views_fetch_data();
- foreach ($data as $table => $info) {
- if (!empty($info['table']['base'])) {
- $tables[$table] = array(
- 'title' => $info['table']['base']['title'],
- 'description' => $info['table']['base']['help'],
- 'weight' => !empty($info['table']['base']['weight']) ? $info['table']['base']['weight'] : 0,
- );
- }
- }
- uasort($tables, '_views_weight_sort');
- $base_tables = $tables;
- }
-
- return $base_tables;
-}
-
-function _views_sort_types($a, $b) {
- if ($a['group'] != $b['group']) {
- return $a['group'] < $b['group'] ? -1 : 1;
- }
-
- if ($a['title'] != $b['title']) {
- return $a['title'] < $b['title'] ? -1 : 1;
- }
-
- return 0;
-}
-
-/**
- * Fetch a list of all fields available for a given base type.
- *
- * @return
- * A keyed array of in the form of 'base_table' => 'Description'.
- */
-function views_fetch_fields($base, $type) {
- static $fields = array();
- if (empty($fields)) {
- $data = views_fetch_data();
- $start = views_microtime();
- // This constructs this ginormous multi dimensional array to
- // collect the important data about fields. In the end,
- // the structure looks a bit like this (using nid as an example)
- // $strings['nid']['filter']['title'] = 'string'.
- //
- // This is constructed this way because the above referenced strings
- // can appear in different places in the actual data structure so that
- // the data doesn't have to be repeated a lot. This essentially lets
- // each field have a cheap kind of inheritance.
-
- foreach ($data as $table => $table_data) {
- $bases = array();
- $strings = array();
- $skip_bases = array();
- foreach ($table_data as $field => $info) {
- // Collect table data from this table
- if ($field == 'table') {
- // calculate what tables this table can join to.
- if (!empty($info['join'])) {
- $bases = array_keys($info['join']);
- }
- // And it obviously joins to itself.
- $bases[] = $table;
- continue;
- }
- foreach (array('field', 'sort', 'filter', 'argument', 'relationship') as $key) {
- if (!empty($info[$key])) {
- if (!empty($info[$key]['skip base'])) {
- foreach ((array) $info[$key]['skip base'] as $base_name) {
- $skip_bases[$field][$key][$base_name] = TRUE;
- }
- }
- elseif (!empty($info['skip base'])) {
- foreach ((array) $info['skip base'] as $base_name) {
- $skip_bases[$field][$key][$base_name] = TRUE;
- }
- }
- foreach (array('title', 'group', 'help', 'base') as $string) {
- // First, try the lowest possible level
- if (!empty($info[$key][$string])) {
- $strings[$field][$key][$string] = $info[$key][$string];
- }
- // Then try the field level
- elseif (!empty($info[$string])) {
- $strings[$field][$key][$string] = $info[$string];
- }
- // Finally, try the table level
- elseif (!empty($table_data['table'][$string])) {
- $strings[$field][$key][$string] = $table_data['table'][$string];
- }
- else {
- if ($string != 'base') {
- $strings[$field][$key][$string] = t("Error: missing @component", array('@component' => $string));
- }
- }
- }
- }
- }
- }
- foreach ($bases as $base_name) {
- foreach ($strings as $field => $field_strings) {
- foreach ($field_strings as $type_name => $type_strings) {
- if (empty($skip_bases[$field][$type_name][$base_name])) {
- $fields[$base_name][$type_name]["$table.$field"] = $type_strings;
- }
- }
- }
- }
- }
-// vsm('Views UI data build time: ' . (views_microtime() - $start) * 1000 . ' ms');
- }
-
- // If we have an array of base tables available, go through them
- // all and add them together. Duplicate keys will be lost and that's
- // Just Fine.
- if (is_array($base)) {
- $strings = array();
- foreach ($base as $base_table) {
- if (isset($fields[$base_table][$type])) {
- $strings += $fields[$base_table][$type];
- }
- }
- uasort($strings, '_views_sort_types');
- return $strings;
- }
-
- if (isset($fields[$base][$type])) {
- uasort($fields[$base][$type], '_views_sort_types');
- return $fields[$base][$type];
- }
- return array();
-}
-
-/**
- * Fetch a list of all base tables available
- *
- * @param $type
- * Either 'display', 'style' or 'row'
- * @param $key
- * For style plugins, this is an optional type to restrict to. May be 'normal',
- * 'summary', 'feed' or others based on the neds of the display.
- * @param $base
- * An array of possible base tables.
- *
- * @return
- * A keyed array of in the form of 'base_table' => 'Description'.
- */
-function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
- $data = views_fetch_plugin_data();
-
- $plugins[$type] = array();
-
- foreach ($data[$type] as $id => $plugin) {
- // Skip plugins that don't conform to our key.
- if ($key && (empty($plugin['type']) || $plugin['type'] != $key)) {
- continue;
- }
- if (empty($plugin['no ui']) && (empty($base) || empty($plugin['base']) || array_intersect($base, $plugin['base']))) {
- $plugins[$type][$id] = $plugin['title'];
- }
- }
-
- if (!empty($plugins[$type])) {
- asort($plugins[$type]);
- return $plugins[$type];
- }
- // fall-through
- return array();
-}
-
-
-/**
- * Theme the form for the table style plugin
- */
-function theme_views_ui_style_plugin_table($form) {
- $output = drupal_render($form['description_markup']);
-
- $header = array(
- t('Field'),
- t('Column'),
- t('Separator'),
- array(
- 'data' => t('Sortable'),
- 'align' => 'center',
- ),
- array(
- 'data' => t('Default sort'),
- 'align' => 'center',
- ),
- );
- $rows = array();
- foreach (element_children($form['columns']) as $id) {
- $row = array();
- $row[] = drupal_render($form['info'][$id]['name']);
- $row[] = drupal_render($form['columns'][$id]);
- $row[] = drupal_render($form['info'][$id]['separator']);
- if (!empty($form['info'][$id]['sortable'])) {
- $row[] = array(
- 'data' => drupal_render($form['info'][$id]['sortable']),
- 'align' => 'center',
- );
- $row[] = array(
- 'data' => drupal_render($form['default'][$id]),
- 'align' => 'center',
- );
- }
- else {
- $row[] = '';
- $row[] = '';
- }
- $rows[] = $row;
- }
-
- // Add the special 'None' row.
- $rows[] = array(t('None'), '', '', '', array('align' => 'center', 'data' => drupal_render($form['default'][-1])));
-
- $output .= theme('table', $header, $rows);
- $output .= drupal_render($form);
- return $output;
-}
-
diff --git a/includes/ajax.inc b/includes/ajax.inc
deleted file mode 100644
index 1e743b2..0000000
--- a/includes/ajax.inc
+++ /dev/null
@@ -1,184 +0,0 @@
-<?php
-
-/**
- * @file ajax.inc
- *
- * Handles the server side AJAX interactions of Views.
- *
- * @defgroup ajax Views ajax library
- * @{
- */
-
-/**
- * Menu callback to load a view via AJAX.
- */
-function views_ajax() {
- if (isset($_REQUEST['view_name']) && isset($_REQUEST['view_display_id'])) {
- $name = $_REQUEST['view_name'];
- $display_id = $_REQUEST['view_display_id'];
- $args = isset($_REQUEST['view_args']) && $_REQUEST['view_args'] !== '' ? explode('/', $_REQUEST['view_args']) : array();
- $path = isset($_REQUEST['view_path']) ? $_REQUEST['view_path'] : NULL;
- $dom_id = isset($_REQUEST['view_dom_id']) ? $_REQUEST['view_dom_id'] : NULL;
- $pager_element = isset($_REQUEST['pager_element']) ? $_REQUEST['pager_element'] : NULL;
- views_include('ajax');
- $object = new stdClass();
-
- $object->status = FALSE;
- $object->display = '';
-
- $arg = explode('/', $_REQUEST['view_path']);
-
- if ($arg[0] == 'admin' || (variable_get('node_admin_theme', '0') && $arg[0] == 'node' && ($arg[1] == 'add' || $arg[2] == 'edit'))) {
- global $custom_theme;
- $custom_theme = variable_get('admin_theme', '0');
- drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
- }
- // Load the view.
- if ($view = views_get_view($name)) {
- if ($view->access($display_id)) {
-
- // Fix 'q' for paging.
- if (!empty($path)) {
- $_GET['q'] = $path;
- }
-
- // Override the display's pager_element with the one actually used.
- if (isset($pager_element)) {
- $view->display[$display_id]->handler->set_option('pager_element', $pager_element);
- }
- // Reuse the same DOM id so it matches that in Drupal.settings.
- $view->dom_id = $dom_id;
-
- $errors = $view->validate();
- if ($errors === TRUE) {
- $object->status = TRUE;
- $object->title = $view->get_title();
- $object->display .= $view->preview($display_id, $args);
- }
- else {
- foreach ($errors as $error) {
- drupal_set_message($error, 'error');
- }
- }
- // Register the standard JavaScript callback.
- $object->__callbacks = array('Drupal.Views.Ajax.ajaxViewResponse');
- // Allow other modules to extend the data returned.
- drupal_alter('ajax_data', $object, 'views', $view);
- }
- }
- $messages = theme('status_messages');
- $object->messages = $messages ? '<div class="views-messages">' . $messages . '</div>' : '';
-
- views_ajax_render($object);
- }
-}
-
-/**
- * Simple render function to make sure output is what we want.
- *
- * This function renders an object into JSON, and that object contains
- * commands to the ajax response parser on the other side. The actual
- * commands that can be sent are completely dependent upon the client
- * javascript parser, which can be anything, but this function assumes
- * that 'display', at least, will be displayed in some kind of ajax
- * spot or popup.
- */
-function views_ajax_render($output = NULL, $title = NULL, $url = NULL, $js = NULL) {
- if (empty($output)) {
- $output->display = t('Server reports invalid input error.');
- $output->title = t('Error');
- }
- elseif (!is_object($output)) {
- $temp = new stdClass();
- $temp->display = $output;
- $temp->title = $title;
- $temp->url = $url;
- $output = $temp;
- }
- if (!empty($js)) {
- $output->js = $js;
- }
-
- drupal_json($output);
- exit;
-}
-
-/**
- * Wrapper around drupal_build_form to handle some AJAX stuff automatically.
- * This makes some assumptions about the client.
- */
-function views_ajax_form_wrapper($form_id, &$form_state) {
- // This won't override settings already in.
- $form_state += array(
- 're_render' => FALSE,
- 'no_redirect' => !empty($form_state['ajax']),
- );
-
- $output = drupal_build_form($form_id, $form_state);
- if (!empty($form_state['ajax']) && empty($form_state['executed'])) {
- // If the form didn't execute and we're using ajax, build up a
- // json command object to render.
- $object = new stdClass();
- $object->display = '';
- if ($messages = theme('status_messages')) {
- $object->display = '<div class="views-messages">' . $messages . '</div>';
- }
- $object->display .= $output;
-
- $object->title = empty($form_state['title']) ? '' : $form_state['title'];
- if (!empty($form_state['help_topic'])) {
- $module = !empty($form_state['help_module']) ? $form_state['help_module'] : 'views';
- $object->title = theme('advanced_help_topic', $module, $form_state['help_topic']) . $object->title;
- }
- $object->url = empty($form_state['url']) ? url($_GET['q'], array('absolute' => TRUE)) : $form_state['url'];
- $object->js = empty($form_state['js settings']) ? NULL : $form_state['js settings'];
- if (!empty($form_state['#section'])) {
- $object->hilite = '.' . views_ui_item_css($form_state['#section']);
- }
-
- $output = $object;
- }
-
- // These forms have the title built in, so set the title here:
- if (empty($form_state['ajax']) && !empty($form_state['title'])) {
- drupal_set_title($form_state['title']);
- }
-
- return $output;
-}
-
-
-/**
- * Page callback for views user autocomplete
- */
-function views_ajax_autocomplete_user($string = '') {
- // The user enters a comma-separated list of tags. We only autocomplete the last tag.
- $array = drupal_explode_tags($string);
-
- // Fetch last tag
- $last_string = trim(array_pop($array));
- $matches = array();
- if ($last_string != '') {
- $prefix = count($array) ? implode(', ', $array) . ', ' : '';
-
- if (strpos('anonymous', strtolower($last_string)) !== FALSE) {
- $matches[$prefix . 'Anonymous'] = 'Anonymous';
- }
- $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $last_string, 0, 10);
-
- while ($account = db_fetch_object($result)) {
- $n = $account->name;
- // Commas and quotes in terms are special cases, so encode 'em.
- if (strpos($account->name, ',') !== FALSE || strpos($account->name, '"') !== FALSE) {
- $n = '"' . str_replace('"', '""', $account->name) . '"';
- }
- $matches[$prefix . $n] = check_plain($account->name);
- }
- }
-
- drupal_json($matches);
-}
-
-/**
- * @}
- */
diff --git a/includes/analyze.inc b/includes/analyze.inc
deleted file mode 100644
index 450efb2..0000000
--- a/includes/analyze.inc
+++ /dev/null
@@ -1,108 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains the view analyze tool code.
- *
- * This tool is a small plugin manager to perform analysis on a view and
- * report results to the user. This tool is meant to let modules that
- * provide data to Views also help users properly use that data by
- * detecting invalid configurations. Views itself comes with only a
- * small amount of analysis tools, but more could easily be added either
- * by modules or as patches to Views itself.
- */
-
-/**
- * Analyze a review and return the results.
- *
- * @return
- * An array of analyze results organized into arrays keyed by 'ok',
- * 'warning' and 'error'.
- */
-function views_analyze_view(&$view) {
- $view->init_display();
- $messages = module_invoke_all('views_analyze', $view);
-
- return $messages;
-}
-
-/**
- * Format the analyze result into a message string.
- *
- * This is based upon the format of drupal_set_message which uses separate
- * boxes for "ok", "warning" and "error".
- */
-function views_analyze_format_result($view, $messages) {
- if (empty($messages)) {
- $messages = array(views_ui_analysis(t('View analysis can find nothing to report.'), 'ok'));
- }
-
- $types = array('ok' => array(), 'warning' => array(), 'error' => array());
- foreach ($messages as $message) {
- if (empty($types[$message['type']])) {
- $types[$message['type']] = array();
- }
- $types[$message['type']][] = $message['message'];
- }
-
- $output = '';
- foreach ($types as $type => $messages) {
- $message = '';
- if (count($messages) > 1) {
- $message = theme('item_list', $messages);
- }
- else if ($messages) {
- $message = array_shift($messages);
- }
-
- if ($message) {
- $output .= "<div class=\"$type\">$message</div>";
- }
- }
-
- return $output;
-}
-
-/**
- * Format an analysis message.
- *
- * This tool should be called by any module responding to the analyze hook
- * to properly format the message. It is usually used in the form:
- * @code
- * $ret[] = views_ui_analysis(t('This is the message'), 'ok');
- * @endcode
- *
- * The 'ok' status should be used to provide information about things
- * that are acceptable. In general analysis isn't interested in 'ok'
- * messages, but instead the 'warning', which is a category for items
- * that may be broken unless the user knows what he or she is doing,
- * and 'error' for items that are definitely broken are much more useful.
- *
- * @param $messages
- * The message to report.
- * @param $type
- * The type of message. This should be "ok", "warning" or "error". Other
- * values can be used but how they are treated by the output routine
- * is undefined.
- */
-function views_ui_analysis($message, $type = 'error') {
- return array('message' => $message, 'type' => $type);
-}
-
-/**
- * Implementation of hook_views_analyze().
- *
- * This is the basic views analysis that checks for very minimal problems.
- * There are other analysis tools in core specific sections, such as
- * node.views.inc as well.
- */
-function views_ui_views_analyze($view) {
- $ret = array();
- // Check for something other than the default display:
- if (count($view->display) < 2) {
- $ret[] = views_ui_analysis(t('This view has only a default display and therefore will not be placed anywhere on your site; perhaps you want to add a page or a block display.'), 'warning');
- }
-
- return $ret;
-}
-
diff --git a/includes/base.inc b/includes/base.inc
deleted file mode 100644
index 4013b95..0000000
--- a/includes/base.inc
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-/**
- * @file
- *
- * Provides the basic object definitions used by plugins and handlers.
- */
-
-/**
- * Basic definition for many views objects
- */
-class views_object {
- /**
- * Except for displays, options for the object will be held here.
- */
- var $options = array();
- /**
- * Information about options for all kinds of purposes will be held here.
- * @code
- * 'option_name' => array(
- * - 'default' => default value,
- * - 'translatable' => TRUE/FALSE (wrap in t() on export if true),
- * - 'contains' => array of items this contains, with its own defaults, etc.
- * If contains is set, the default will be ignored and assumed to
- * be array()
- *
- * ),
- * @endcode
- * Each option may have any of the following functions:
- * - export_option_OPTIONNAME -- Special export handling if necessary.
- * - translate_option_OPTIONNAME -- Special handling for translating data
- * within the option, if necessary.
- */
- function option_definition() { return array(); }
-
- /**
- * Views handlers use a special construct function so that we can more
- * easily construct them with variable arguments.
- */
- function construct() { $this->set_default_options(); }
-
- /**
- * Set default options on this object. Called by the constructor in a
- * complex chain to deal with backward compatibility.
- */
- function options() { }
-
- /**
- * Set default options.
- * For backward compatibility, it sends the options array; this is a
- * feature that will likely disappear at some point.
- */
- function set_default_options() {
- $this->_set_option_defaults($this->options, $this->option_definition());
-
- // Retained for complex defaults plus backward compatibility.
- $this->options($this->options);
- }
-
- function _set_option_defaults(&$storage, $options, $level = 0) {
- foreach ($options as $option => $definition) {
- if (isset($definition['contains']) && is_array($definition['contains'])) {
- $storage[$option] = array();
- $this->_set_option_defaults($storage[$option], $definition['contains'], $level++);
- }
- elseif (!empty($definition['translatable']) && !empty($definition['default'])) {
- $storage[$option] = t($definition['default']);
- }
- else {
- $storage[$option] = isset($definition['default']) ? $definition['default'] : NULL;
- }
- }
- }
-
- /**
- * Unpack options over our existing defaults, drilling down into arrays
- * so that defaults don't get totally blown away.
- */
- function unpack_options(&$storage, $options, $definition = NULL) {
- if (!is_array($options)) {
- return;
- }
-
- if (!isset($definition)) {
- $definition = $this->option_definition();
- }
-
- foreach ($options as $key => $value) {
- if (is_array($value)) {
- if (!isset($storage[$key]) || !is_array($storage[$key])) {
- $storage[$key] = array();
- }
-
- $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array());
- }
- else if (!empty($definition[$key]['translatable']) && !empty($value)) {
- $storage[$key] = t($value);
- }
- else {
- $storage[$key] = $value;
- }
- }
- }
-
- /**
- * Let the handler know what its full definition is.
- */
- function set_definition($definition) {
- $this->definition = $definition;
- if (isset($definition['field'])) {
- $this->real_field = $definition['field'];
- }
- }
-
- function destroy() {
- if (isset($this->view)) {
- unset($this->view);
- }
-
- if (isset($this->display)) {
- unset($this->display);
- }
-
- if (isset($this->query)) {
- unset($this->query);
- }
- }
-}
diff --git a/includes/cache.inc b/includes/cache.inc
deleted file mode 100644
index 47ac941..0000000
--- a/includes/cache.inc
+++ /dev/null
@@ -1,269 +0,0 @@
-<?php
-/**
- * @file cache.inc
- *
- * Functions to load Views' data so that it knows what is available to
- * build queries from.
- */
-
-/**
- * Load views files on behalf of modules.
- */
-function _views_include_handlers() {
- views_module_include('views.inc');
-}
-
-/**
- * Load default views files on behalf of modules.
- */
-function _views_include_default_views() {
- views_module_include('views_default.inc');
-}
-
-/**
- * Fetch Views' data from the cache
- */
-function _views_fetch_data($table = NULL) {
- static $cache = NULL;
- if (!isset($cache)) {
- $start = views_microtime();
- // NOTE: This happens whether we retrieve them from cache or otherwise.
- views_include_handlers();
-
- $data = views_cache_get('views_data', TRUE);
- if (!empty($data->data)) {
- $cache = $data->data;
- }
-
- if (empty($cache)) {
- $cache = module_invoke_all('views_data');
- foreach (module_implements('views_data_alter') as $module) {
- $function = $module . '_views_data_alter';
- $function($cache);
- }
-
- views_cache_set('views_data', $cache, TRUE);
- }
-
- vpr('Views data build time: ' . (views_microtime() - $start) * 1000 . ' ms');
- }
-
- if (!$table) {
- return $cache;
- }
- if (isset($cache[$table])) {
- return $cache[$table];
- }
-
- // Return an empty array if there is no match.
- return array();
-}
-
-/**
- * Fetch the plugin data from cache.
- */
-function _views_fetch_plugin_data($type = NULL, $plugin = NULL) {
- static $cache = NULL;
- if (!isset($cache)) {
- $start = views_microtime();
- views_include_handlers();
-
- $cache = views_discover_plugins();
-
- vpr('Views plugins build time: ' . (views_microtime() - $start) * 1000 . ' ms');
- }
-
- if (!$type && !$plugin) {
- return $cache;
- }
- else if (!$plugin) {
- // Not in the if above so the else below won't run
- if (isset($cache[$type])) {
- return $cache[$type];
- }
- }
- else if (isset($cache[$type][$plugin])) {
- return $cache[$type][$plugin];
- }
-
- // Return an empty array if there is no match.
- return array();
-}
-
-/**
- * Scan all modules for default views and rebuild the default views cache.
- *
- * @return An associative array of all known default views.
- */
-function _views_discover_default_views() {
- static $cache = NULL;
-
- if (!isset($cache)) {
- $data = views_cache_get('views_default_views', TRUE);
-
- if (isset($data->data) && is_array($data->data)) {
- $cache = $data->data;
- }
- else {
- views_include_default_views();
- $defaults = module_invoke_all('views_default_views');
- $cache = array();
-
- foreach ($defaults as $name => $view) {
- // Only views with a sufficiently high api version are eligible.
- if (isset($view->api_version) && $view->api_version >= 2) {
- // Do not cache dead handlers.
- $view->destroy();
- $cache[$name] = $view;
- }
- }
-
- // Allow modules to modify default views before they are cached.
- drupal_alter('views_default_views', $cache);
-
- views_cache_set('views_default_views', $cache, TRUE);
- }
- }
-
- return $cache;
-}
-
-/**
- * Set a cached item in the views cache.
- *
- * This is just a convenience wrapper around cache_set().
- *
- * @param $cid
- * The cache ID of the data to store.
- * @param $data
- * The data to store in the cache. Complex data types will be automatically serialized before insertion.
- * Strings will be stored as plain text and not serialized.
- * @param $use_language
- * If TRUE, the data will be cached specific to the currently active language.
- */
-function views_cache_set($cid, $data, $use_language = FALSE) {
- global $language;
-
- if (variable_get('views_skip_cache', FALSE)) {
- return;
- }
- if ($use_language) {
- $cid .= ':' . $language->language;
- }
-
- cache_set($cid, $data, 'cache_views');
-}
-
-/**
- * Return data from the persistent views cache.
- *
- * This is just a convenience wrapper around cache_get().
- *
- * @param $cid
- * The cache ID of the data to retrieve.
- * @param $use_language
- * If TRUE, the data will be requested specific to the currently active language.
- */
-function views_cache_get($cid, $use_language = FALSE) {
- global $language;
-
- if (variable_get('views_skip_cache', FALSE)) {
- return 0;
- }
- if ($use_language) {
- $cid .= ':' . $language->language;
- }
-
- return cache_get($cid, 'cache_views');
-}
-
-/**
- * @defgroup views_object_cache Non-volatile cache storage
- * @{
- * The non-volatile object cache is used to store an object while it is
- * being edited, so that we don't have to save until we're completely
- * done. The cache should be 'cleaned' on a regular basis, meaning to
- * remove old objects from the cache, but otherwise the data in this
- * cache must remain stable, as it includes unsaved changes.
- */
-
-/**
- * Get an object from the non-volatile Views cache.
- *
- * This function caches in memory as well, so that multiple calls to this
- * will not result in multiple database reads.
- *
- * @param $obj
- * A 32 character or less string to define what kind of object is being
- * stored; primarily this is used to prevent collisions.
- * @param $name
- * The name of the view (or other object) being stored.
- * @param $skip_cache
- * Skip the memory cache, meaning this must be read from the db again.
- *
- * @return
- * The data that was cached.
- */
-function views_object_cache_get($obj, $name, $skip_cache = FALSE) {
- static $cache = array();
- $key = "$obj:$name";
- if ($skip_cache) {
- unset($cache[$key]);
- }
-
- if (!array_key_exists($key, $cache)) {
- $data = db_fetch_object(db_query("SELECT * FROM {views_object_cache} WHERE sid = '%s' AND obj = '%s' AND name = '%s'", session_id(), $obj, $name));
- if ($data) {
- $cache[$key] = unserialize($data->data);
- }
- }
- return isset($cache[$key]) ? $cache[$key] : NULL;
-}
-
-/**
- * Store an object in the non-volatile Views cache.
- *
- * @param $obj
- * A 32 character or less string to define what kind of object is being
- * stored; primarily this is used to prevent collisions.
- * @param $name
- * The name of the view (or other object) being stored.
- * @param $cache
- * The object to be cached. This will be serialized prior to writing.
- */
-function views_object_cache_set($obj, $name, $cache) {
- views_object_cache_clear($obj, $name);
- db_query("INSERT INTO {views_object_cache} (sid, obj, name, data, updated) VALUES ('%s', '%s', '%s', '%s', %d)", session_id(), $obj, $name, serialize($cache), time());
-}
-
-/**
- * Remove an object from the non-volatile Views cache
- *
- * @param $obj
- * A 32 character or less string to define what kind of object is being
- * stored; primarily this is used to prevent collisions.
- * @param $name
- * The name of the view (or other object) being stored.
- */
-function views_object_cache_clear($obj, $name) {
- db_query("DELETE FROM {views_object_cache} WHERE sid = '%s' AND obj = '%s' AND name = '%s'", session_id(), $obj, $name);
-}
-
-/**
- * Remove all objects in the object cache that are older than the
- * specified age.
- *
- * @param $age
- * The minimum age of objects to remove, in seconds. For example, 86400 is
- * one day. Defaults to 7 days.
- */
-function views_object_cache_clean($age = NULL) {
- if (empty($age)) {
- $age = 86400 * 7; // 7 days
- }
- db_query("DELETE FROM {views_object_cache} WHERE updated < %d", time() - $age);
-}
-
-/**
- * @}
- */
diff --git a/includes/convert.inc b/includes/convert.inc
deleted file mode 100644
index b4934d0..0000000
--- a/includes/convert.inc
+++ /dev/null
@@ -1,542 +0,0 @@
-<?php
-/**
- * @file convert.inc
- *
- * Contains forms and routines to convert older views to newer views.
- */
-
-/**
- * Page callback for the tools - Views 1 convert page
- */
-function views_ui_admin_convert() {
- if (!db_table_exists('view_view')) {
- return t('There are no Views 1 views stored in the database to convert.');
- }
- $items = array();
- $sorts = array();
-
- $header = array(
- array('data' => t('View name'), 'field' => 'name', 'sort' => 'asc'),
- array('data' => t('Description')),
- array('data' => t('Operations')),
- );
- $current_views = views_get_all_views();
-
- $result = db_query("SELECT v.* FROM {view_view} v");
- while ($view = db_fetch_object($result)) {
- $ops = array();
- if (!isset($current_views[$view->name])) {
- $ops[] = l(t('Convert'), "admin/build/views1/convert/$view->name");
- }
- else {
- $ops[] = t('Converted');
- }
- $ops[] = l(t('Delete'), "admin/build/views1/delete/$view->name");
-
- $item = array();
- $item[] = check_plain($view->name);
- $item[] = check_plain($view->description);
- $item[] = implode(' | ', $ops);
- $items[] = $item;
-
- $ts = tablesort_init($header);
- switch ($ts['sql']) {
- case 'name':
- default:
- $sorts[] = $item[0];
- break;
- case 'title':
- $sorts[] = $item[1];
- break;
- }
- }
-
- if (!empty($ts)) {
- if (strtolower($ts['sort']) == 'desc') {
- arsort($sorts);
- }
- else {
- asort($sorts);
- }
- }
-
- $i = array();
- foreach ($sorts as $id => $title) {
- $i[] = $items[$id];
- }
- $output = t('The table below lists Views version 1 views that are stored in the database. You can either convert them to work in Views version 2, or delete them. The views are convertible only if there is no Views 2 view with the same name.');
- $output .= theme('table', $header, $i);
-
- $output .= drupal_get_form('views_ui_convert_cleanup_form');
- return $output;
-}
-
-/**
- * Provide form to clean up Views 1 tables.
- */
-function views_ui_convert_cleanup_form() {
- $form['verify'] = array(
- '#type' => 'checkbox',
- '#title' => t('Remove all Views 1 tables'),
- '#description' => t('Check this box and then click clean up to drop all Views 1 tables. Warning: this operation will not be reversible! Do this only if you are sure you no longer need this data.'),
- '#required' => TRUE,
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Clean up'),
- );
-
- return $form;
-}
-
-function views_ui_convert_cleanup_form_submit($form, $form_state) {
- if (empty($form_state['values']['verify'])) {
- drupal_set_message('Please check the box to verify you want to destroy your Views 1 table data.');
- return;
- }
-
- $ret = array();
- if (db_table_exists('view_view')) {
- db_drop_table($ret, 'view_view');
- }
- if (db_table_exists('view_sort')) {
- db_drop_table($ret, 'view_sort');
- }
- if (db_table_exists('view_argument')) {
- db_drop_table($ret, 'view_argument');
- }
- if (db_table_exists('view_tablefield')) {
- db_drop_table($ret, 'view_tablefield');
- }
- if (db_table_exists('view_filter')) {
- db_drop_table($ret, 'view_filter');
- }
- if (db_table_exists('view_exposed_filter')) {
- db_drop_table($ret, 'view_exposed_filter');
- }
-
- drupal_set_message(t('All Views 1 tables have been removed.'));
-}
-
-/**
- * Page callback for the tools - Views 1 convert page
- */
-function views_ui_convert1($name) {
- $old = views1_load($name);
- if (!$old) {
- return t('Unable to find view.');
- }
-
- $view = views1_import($old);
-
- if ($view) {
- views_ui_cache_set($view);
- drupal_goto('admin/build/views/edit/' . $view->name);
- }
- else {
- return t('Unable to convert view.');
- }
-}
-
-/**
- * Page to delete a Views 1 view.
- */
-function views_ui_delete1_confirm(&$form_state, $vid) {
- $form_state['vid'] = $vid;
- $form = array();
-
- $cancel = 'admin/build/views/tools/convert';
- if (!empty($_REQUEST['cancel'])) {
- $cancel = $_REQUEST['cancel'];
- }
- return confirm_form($form,
- t('Are you sure you want to delete the view %name?', array('%name' => $view->name)),
- $cancel,
- t('This action cannot be undone.'),
- t('Delete'),
- t('Cancel'));
-}
-
-/**
- * Submit handler to delete a view.
- */
-function views_ui_delete1_confirm_submit(&$form, &$form_state) {
- views1_delete($form_state['vid']);
- drupal_set_message(t('The view has been deleted'));
- $form_state['redirect'] = 'admin/build/views/tools/convert';
-}
-
-/**
- * Convert a Views 1 view to a Views 2 view.
- */
-function views1_import($imported) {
- views_include_handlers();
- views_module_include('views_convert.inc');
-
- $view = views_new_view();
-
- $view->name = $imported->name;
- $view->description = $imported->description;
-
- if (!empty($imported->page) && !empty($imported->url)) {
- $page_display = $view->add_display('page');
- }
- if (!empty($imported->block)) {
- $block_display = $view->add_display('block');
- }
- $view->init_display();
-
- $handler = &$view->display['default']->handler;
- $handler->set_option('title', $imported->page_title);
- $handler->set_option('header', $imported->page_header);
- $handler->set_option('header_format', $imported->page_header_format);
- $handler->set_option('footer', $imported->page_footer);
- $handler->set_option('footer_format', $imported->page_footer_format);
- $handler->set_option('empty', $imported->page_empty);
- $handler->set_option('empty_format', $imported->page_empty_format);
-
- $handler->set_option('use_pager', $imported->use_pager);
- $handler->set_option('items_per_page', $imported->nodes_per_page);
- $handler->set_option('pager_element', 0);
- $handler->set_option('offset', 0);
-
- $access = array('type' => 'none', 'role' => array(), 'perm' => '');
- if ($imported->access) {
- $access['type'] = 'role';
- $access['role'] = drupal_map_assoc($imported->access);
- }
-
- $handler->set_option('access', $access);
- if (!empty($imported->page) && !empty($imported->url)) {
- $handler = &$view->display[$page_display]->handler;
- $url = str_replace('$arg', '%', $imported->url);
- $handler->set_option('path', $url);
- if ($imported->menu) {
- $menu = array('type' => 'normal');
- if ($imported->menu_tab) {
- $menu['type'] = 'tab';
- }
- if ($imported->menu_tab_default) {
- $menu['type'] = 'default tab';
- }
- $menu['title'] = $imported->menu_title ? $imported->menu_title : $imported->page_title;
- $handler->set_option('menu', $menu);
-
- if ($menu['type'] == 'default tab') {
- $tab_options = array('type' => 'none');
- switch ($imported->menu_tab_default_parent_type) {
- case 'tab':
- case 'normal':
- $tab_options['type'] = $imported->menu_tab_default_parent_type;
- break;
- }
- }
- $tab_options['title'] = $imported->menu_parent_title;
- $tab_options['weight'] = $imported->menu_parent_tab_weight;
- $handler->set_option('tab_options', $tab_options);
- }
- }
-
- views1_convert_style($view, $handler, $imported->page_type);
-
- if (!empty($imported->block)) {
- $handler = &$view->display[$block_display]->handler;
-
- if (!empty($imported->block_title)) {
- if (!empty($imported->page)) {
- $handler->set_override('title');
- }
- $handler->set_option('title', $imported->block_title);
- }
-
- if (!empty($imported->page)) {
- $handler->set_override('use_pager');
- }
- $handler->set_option('use_pager', FALSE);
-
- if ($imported->nodes_per_block != $imported->nodes_per_page) {
- $handler->set_option('items_per_page', $imported->nodes_per_block);
- $handler->set_option('offset', 0);
- }
-
- if (empty($imported->block_use_page_header)) {
- if (!empty($imported->page)) {
- $handler->set_override('header');
- }
- if (!empty($imported->block_header)) {
- $handler->set_option('header', $imported->block_header);
- $handler->set_option('header_format', $imported->block_header_format);
- }
- }
- if (empty($imported->block_use_page_footer)) {
- if (!empty($imported->page)) {
- $handler->set_override('footer');
- }
- if (!empty($imported->block_footer)) {
- $handler->set_option('footer', $imported->block_footer);
- $handler->set_option('footer_format', $imported->block_footer_format);
- }
- }
- if (empty($imported->block_use_page_empty)) {
- if (!empty($imported->page)) {
- $handler->set_override('empty');
- }
- if (!empty($imported->block_empty)) {
- $handler->set_option('empty', $imported->block_empty);
- $handler->set_option('empty_format', $imported->block_empty_format);
- }
- }
-
- $handler->set_option('use_more', $imported->block_more);
-
- if (!empty($imported->page)) {
- $handler->set_override('style_plugin');
- }
- views1_convert_style($view, $handler, $imported->block_type);
- }
-
- // For each of the fields, arguments, filters, and sorts in the old view,
- // check if a handler for this item exists in Views 2 and add it,
- // then see if any other modules want to adapt it using hook_views_convert().
-
- foreach ($imported->field as $field) {
- $id = $view->add_item('default', 'field', $field['tablename'], $field['field'], array('label' => $field['label']));
- if ($view->display_handler->get_option('style_plugin') == 'table') {
- $options = $view->display_handler->get_option('style_options');
- if (!empty($field['sortable'])) {
- $options['info'][$id]['sortable'] = TRUE;
- if (!empty($field['defaultsort'])) {
- $options['default'] = $id;
- }
- }
- $view->display_handler->set_option('style_options', $options);
- }
- foreach (module_implements('views_convert') as $module) {
- module_invoke($module, 'views_convert', 'default', 'field', $view, $field, $id);
- }
- }
- foreach ($imported->sort as $field) {
- $id = $view->add_item('default', 'sort', $field['tablename'], $field['field'], array('order' => $field['sortorder']));
- foreach (module_implements('views_convert') as $module) {
- module_invoke($module, 'views_convert', 'default', 'sort', $view, $field, $id);
- }
- }
- $actions = array('ignore', 'not found', 'ignore', 'summary asc', 'summary asc', 'summary desc', 'summary asc', 'empty');
- foreach ($imported->argument as $id => $field) {
- if (!empty($imported->view_args_php)) {
- $field['argoptions']['default_action'] = 'default';
- $field['argoptions']['default_argument_type'] = 'php';
- $field['argoptions']['default_argument_php'] = '$args = eval(\''. str_replace("'", "\\'", $imported->view_args_php) .'\');'."\n";
- $field['argoptions']['default_argument_php'] .= 'if (isset($args['. $field['position'] .'])) {'."\n";
- $field['argoptions']['default_argument_php'] .= ' return $args['. $field['position'] .'];'."\n";
- $field['argoptions']['default_argument_php'] .= '}';
- $field['argoptions']['validate_fail'] = $actions[$field['argdefault']];
- }
- else {
- $field['argoptions']['default_action'] = $actions[$field['argdefault']];
- }
- if (!empty($field['title'])) {
- $field['argoptions']['title'] = $field['title'];
- }
- if (!empty($field['wildcard'])) {
- $field['argoptions']['wildcard'] = $field['wildcard'];
- }
- if (!empty($field['wildcard_substitution'])) {
- $field['argoptions']['wildcard_substitution'] = $field['wildcard_substitution'];
- }
- // Arguments didn't used to be identified by table.name so we just have to
- // leave that out.
- foreach (module_implements('views_convert') as $module) {
- module_invoke($module, 'views_convert', 'default', 'argument', $view, $field, NULL);
- }
- }
- foreach ($imported->filter as $field) {
- $options = $field['value'] == '' ? array() : array('value' => $field['value']);
- $id = $view->add_item('default', 'filter', $field['tablename'], $field['field'], $options);
- foreach (module_implements('views_convert') as $module) {
- module_invoke($module, 'views_convert', 'default', 'filter', $view, $field, $id);
- }
- }
- // Exposed filters now get added to the filter array, not as a separate array.
- $count = 0;
- foreach ($imported->exposed_filter as $field) {
- list(, $id) = explode('.', $field['field'], 2);
- $item = $view->get_item('default', 'filter', $id);
- if (views_get_handler($item['table'], $item['field'], 'filter')) {
- $item['exposed'] = TRUE;
-
- // Use the count to emulate the old, hardcoded filter naming.
- $item['expose']['identifier'] = 'filter' . $count;
- $item['expose']['label'] = $field['label'];
- $item['expose']['operator'] = $field['operator'] ? 'op' . $count : '';
- $item['expose']['optional'] = $field['optional'];
- $item['expose']['single'] = $field['single'];
- $view->set_item('default', 'filter', $id, $item);
- }
- $count++;
- foreach (module_implements('views_convert') as $module) {
- module_invoke($module, 'views_convert', 'default', 'exposed_filter', $view, $field, $id);
- }
- }
-
- return $view;
-}
-
-function views1_convert_style(&$view, &$handler, $type) {
- switch ($type) {
- case 'list':
- $handler->set_option('style_plugin', 'list');
- $handler->set_option('style_options', array('type' => 'ul'));
- $handler->set_option('row_plugin', 'fields');
- break;
- case 'node':
- $handler->set_option('row_plugin', 'node');
- $handler->set_option('row_options', array('teaser' => FALSE, 'links' => TRUE));
- break;
- case 'teaser':
- $handler->set_option('row_plugin', 'node');
- $handler->set_option('row_options', array('teaser' => TRUE, 'links' => TRUE));
- break;
- case 'table':
- $options = array();
- $options['columns'] = array();
- $options['default'] = '';
- $options['info'] = array();
- $options['override'] = FALSE;
- $options['order'] = 'asc';
-
- $handler->set_option('style_plugin', 'table');
- $handler->set_option('style_options', $options);
- break;
- default:
- // Ask around if anybody else knows.
- foreach (module_implements('views_convert') as $module) {
- module_invoke($module, 'views_convert', $handler->display->id, 'style', $view, $type);
- }
- }
-}
-/**
- * Load a version 1 view from the database.
- *
- */
-function views1_load($arg) {
- static $cache = array();
- $which = is_numeric($arg) ? 'vid' : 'name';
- if (isset($cache[$which][$arg])) {
- return $cache[$which][$arg];
- }
-
- $where = (is_numeric($arg) ? "v.vid = %d" : "v.name = '%s'");
- $view = db_fetch_object(db_query("SELECT v.* FROM {view_view} v WHERE $where", $arg));
-
- if (!$view->name) {
- return NULL;
- }
-
- $view->access = ($view->access ? explode(', ', $view->access) : array());
-
- // load the sorting criteria too.
- $result = db_query("SELECT * FROM {view_sort} vs WHERE vid = $view->vid ORDER BY position ASC");
-
- $view->sort = array();
- while ($sort = db_fetch_array($result)) {
- if (substr($sort['field'], 0, 2) == 'n.') {
- $sort['field'] = 'node' . substr($sort['field'], 1);
- }
- $sort['id'] = $sort['field'];
- $bits = explode('.', $sort['field']);
- $sort['tablename'] = $bits[0];
- $sort['field'] = $bits[1];
- $view->sort[$sort['position']] = $sort;
- }
-
- $result = db_query("SELECT * FROM {view_argument} WHERE vid = $view->vid ORDER BY position ASC");
-
- $view->argument = array();
- while ($arg = db_fetch_array($result)) {
- $arg['id'] = $arg['type'];
- $view->argument[$arg['position']] = $arg;
- }
-
- $result = db_query("SELECT * FROM {view_tablefield} WHERE vid = $view->vid ORDER BY position ASC");
-
- $view->field = array();
- while ($arg = db_fetch_array($result)) {
- if ($arg['tablename'] == 'n') {
- $arg['tablename'] = 'node';
- }
- $arg['id'] = $arg['fullname'] = "$arg[tablename].$arg[field]";
- $arg['queryname'] = "$arg[tablename]_$arg[field]";
- $view->field[] = $arg;
- }
-
- $result = db_query("SELECT * FROM {view_filter} WHERE vid = $view->vid ORDER BY position ASC");
-
- // TODO - Is it safe to ignore this $filters variable? This function depends
- // on lots of additional code needed to call hook_implements and construct
- // all the views tables, so using it will add a lot of code to this file.
- //$filters = _views_get_filters();
- $view->filter = array();
- while ($filter = db_fetch_array($result)) {
- if (substr($filter['field'], 0, 2) == 'n.') {
- $filter['field'] = 'node' . substr($filter['field'], 1);
- }
-
- if ($filter['operator'] == 'AND' ||
- $filter['operator'] == 'OR' ||
- $filter['operator'] == 'NOR') {
- // TODO - need another way to identify this type of filter
- // without being able to call hook_implements().
- //|| $filters[$filter['field']]['value-type'] == 'array' ) {
- if ($filter['value'] !== NULL && $filter['value'] !== '') {
- $filter['value'] = explode(',', $filter['value']);
- }
- else {
- $filter['value'] = array();
- }
- }
- $filter['id'] = $filter['field'];
- $bits = explode('.', $filter['field']);
- $filter['tablename'] = $bits[0];
- $filter['field'] = $bits[1];
- $view->filter[$filter['position']] = $filter;
- }
-
- $result = db_query("SELECT * FROM {view_exposed_filter} WHERE vid = $view->vid ORDER BY position ASC");
-
- $view->exposed_filter = array();
- while ($arg = db_fetch_array($result)) {
- $arg['id'] = $arg['field'];
- $view->exposed_filter[] = $arg;
- }
-
- $cache['vid'][$view->vid] = $view;
- $cache['name'][$view->name] = $view;
-
- return $view;
-}
-
-/**
- * Delete a version 1 view from the database.
- *
- */
-function views1_delete($arg) {
- static $cache = array();
- $where = (is_numeric($arg) ? "v.vid = %d" : "v.name = '%s'");
- $view = db_fetch_object(db_query("SELECT v.* FROM {view_view} v WHERE $where", $arg));
-
- if (!$view->name) {
- return NULL;
- }
-
-
-
- $result = db_query("DELETE FROM {view_sort} WHERE vid = $view->vid");
- $result = db_query("DELETE FROM {view_argument} WHERE vid = $view->vid");
- $result = db_query("DELETE FROM {view_tablefield} WHERE vid = $view->vid");
- $result = db_query("DELETE FROM {view_filter} WHERE vid = $view->vid");
- $result = db_query("DELETE FROM {view_exposed_filter} WHERE vid = $view->vid");
- $result = db_query("DELETE FROM {view_view} WHERE vid = $view->vid");
-}
-
diff --git a/includes/form.inc b/includes/form.inc
deleted file mode 100644
index 8de9426..0000000
--- a/includes/form.inc
+++ /dev/null
@@ -1,298 +0,0 @@
-<?php
-
-/**
- * @file form.inc
- * Views' replacements for Drupal's form functions.
- *
- */
-function _drupal_build_form($form_id, &$form_state) {
- // Ensure that we have some defaults.
-
- // These are defaults only; if already set they will not be overridden.
- $form_state += array('storage' => NULL, 'submitted' => FALSE, 'input' => $_POST, 'method' => 'post');
-
- $args = isset($form_state['args']) ? $form_state['args'] : array();
- $cacheable = FALSE;
-
- if (isset($_SESSION['batch_form_state'])) {
- // We've been redirected here after a batch processing : the form has
- // already been processed, so we grab the post-process $form_state value
- // and move on to form display. See _batch_finished() function.
- $form_state = $_SESSION['batch_form_state'];
- unset($_SESSION['batch_form_state']);
- }
- else {
- // If the incoming $_POST contains a form_build_id, we'll check the
- // cache for a copy of the form in question. If it's there, we don't
- // have to rebuild the form to proceed. In addition, if there is stored
- // form_state data from a previous step, we'll retrieve it so it can
- // be passed on to the form processing code.
- if (isset($_POST['form_id']) && $_POST['form_id'] == $form_id && !empty($_POST['form_build_id'])) {
- $form = form_get_cache($_POST['form_build_id'], $form_state);
- if (!empty($form['#no_cache']) || empty($form)) {
- unset($form);
- }
- }
-
- // If the previous bit of code didn't result in a populated $form
- // object, we're hitting the form for the first time and we need
- // to build it from scratch.
- if (!isset($form)) {
- $form_state['post'] = $form_state['input'];
- // Use a copy of the function's arguments for manipulation
- $args_temp = $args;
- $args_temp[0] = &$form_state;
- array_unshift($args_temp, $form_id);
-
- $form = call_user_func_array('drupal_retrieve_form', $args_temp);
- $form_build_id = 'form-' . md5(mt_rand());
- $form['#build_id'] = $form_build_id;
-
- if ($form_state['method'] == 'get' && !isset($form['#method'])) {
- $form['#method'] = 'get';
- }
-
- drupal_prepare_form($form_id, $form, $form_state);
- // Store a copy of the unprocessed form for caching and indicate that it
- // is cacheable if #cache will be set.
- $original_form = $form;
- $cacheable = TRUE;
- unset($form_state['post']);
- }
- $form['#post'] = $form_state['input'];
-
- // Now that we know we have a form, we'll process it (validating,
- // submitting, and handling the results returned by its submission
- // handlers. Submit handlers accumulate data in the form_state by
- // altering the $form_state variable, which is passed into them by
- // reference.
- drupal_process_form_new($form_id, $form, $form_state);
-
- // If we were told not to redirect, but not told to re-render, return
- // here.
- if (!empty($form_state['executed']) && empty($form_state['rerender'])) {
- return;
- }
-
- if ($cacheable && !empty($form['#cache']) && empty($form['#no_cache'])) {
- // Caching is done past drupal_process_form so #process callbacks can
- // set #cache. By not sending the form state, we avoid storing
- // $form_state['storage'].
- form_set_cache($form_build_id, $original_form, NULL);
- }
- }
-
- // Most simple, single-step forms will be finished by this point --
- // drupal_process_form() usually redirects to another page (or to
- // a 'fresh' copy of the form) once processing is complete. If one
- // of the form's handlers has set $form_state['redirect'] to FALSE,
- // the form will simply be re-rendered with the values still in its
- // fields.
- //
- // If $form_state['storage'] or $form_state['rebuild'] have been
- // set by any submit or validate handlers, however, we know that
- // we're in a complex multi-part process of some sort and the form's
- // workflow is NOT complete. We need to construct a fresh copy of
- // the form, passing in the latest $form_state in addition to any
- // other variables passed into drupal_get_form().
-
- if (!empty($form_state['rebuild']) || !empty($form_state['storage'])) {
- $form = drupal_rebuild_form_new($form_id, $form_state, $args);
- }
-
- // If we haven't redirected to a new location by now, we want to
- // render whatever form array is currently in hand.
- return drupal_render_form($form_id, $form);
-}
-
-/**
- * Views' replacement of drupal_rebuild_form.
- *
- * This change merely respects a form's wishes not to be cached.
- */
-function drupal_rebuild_form_new($form_id, &$form_state, $args, $form_build_id = NULL) {
- // Remove the first argument. This is $form_id.when called from
- // drupal_get_form and the original $form_state when called from some AHAH
- // callback. Neither is needed. After that, put in the current state.
- $args[0] = &$form_state;
- // And the form_id.
- array_unshift($args, $form_id);
- $form = call_user_func_array('drupal_retrieve_form', $args);
-
- if (!isset($form_build_id)) {
- // We need a new build_id for the new version of the form.
- $form_build_id = 'form-' . md5(mt_rand());
- }
- $form['#build_id'] = $form_build_id;
- drupal_prepare_form($form_id, $form, $form_state);
-
- if (empty($form['#no_cache'])) {
- // Now, we cache the form structure so it can be retrieved later for
- // validation. If $form_state['storage'] is populated, we'll also cache
- // it so that it can be used to resume complex multi-step processes.
- form_set_cache($form_build_id, $form, $form_state);
- }
-
- // Originally this called drupal_process_form, but all that happens there
- // is form_builder and then submission; and the rebuilt form is not
- // allowed to submit. Therefore, just do this:
- $form['#post'] = $form_state['input'];
- $form = form_builder($form_id, $form, $form_state);
-
- return $form;
-}
-
-/**
- * Views' replacement for drupal_process_form that accepts commands
- * not to redirect, as well as forcing processing of 'get' method forms.
- */
-function drupal_process_form_new($form_id, &$form, &$form_state) {
- // submitting, and handling the results returned by its submission
- // handlers. Submit handlers accumulate data in the form_state by
- // altering the $form_state variable, which is passed into them by
- // reference.
- $form_state['values'] = array();
-
- // With $_GET, these forms are always submitted.
- if ($form_state['method'] == 'get') {
- if (!isset($form['#post']['form_build_id'])) {
- $form['#post']['form_build_id'] = $form['#build_id'];
- }
- if (!isset($form['#post']['form_id'])) {
- $form['#post']['form_id'] = $form_id;
- }
- if (!isset($form['#post']['form_token']) && isset($form['#token'])) {
- $form['#post']['form_token'] = drupal_get_token($form['#token']);
- }
- }
-
- $form = form_builder($form_id, $form, $form_state);
- // Only process the form if it is programmed or the form_id coming
- // from the POST data is set and matches the current form_id.
-
- if ((!empty($form['#programmed'])) || (!empty($form['#post']) && (isset($form['#post']['form_id']) && ($form['#post']['form_id'] == $form_id)))) {
- drupal_validate_form_new($form_id, $form, $form_state);
-
- // form_clean_id() maintains a cache of element IDs it has seen,
- // so it can prevent duplicates. We want to be sure we reset that
- // cache when a form is processed, so scenerios that result in
- // the form being built behind the scenes and again for the
- // browser don't increment all the element IDs needlessly.
- form_clean_id(NULL, TRUE);
-
- if ((!empty($form_state['submitted'])) && !form_get_errors() && empty($form_state['rebuild'])) {
- $form_state['redirect'] = NULL;
- form_execute_handlers('submit', $form, $form_state);
-
- // We'll clear out the cached copies of the form and its stored data
- // here, as we've finished with them. The in-memory copies are still
- // here, though.
- if (variable_get('cache', CACHE_DISABLED) == CACHE_DISABLED && !empty($form_state['values']['form_build_id'])) {
- cache_clear_all('form_' . $form_state['values']['form_build_id'], 'cache_form');
- cache_clear_all('storage_' . $form_state['values']['form_build_id'], 'cache_form');
- }
-
- // If batches were set in the submit handlers, we process them now,
- // possibly ending execution. We make sure we do not react to the batch
- // that is already being processed (if a batch operation performs a
- // drupal_execute).
- if ($batch =& batch_get() && !isset($batch['current_set'])) {
- // The batch uses its own copies of $form and $form_state for
- // late execution of submit handers and post-batch redirection.
- $batch['form'] = $form;
- $batch['form_state'] = $form_state;
- $batch['progressive'] = !$form['#programmed'];
- batch_process();
- // Execution continues only for programmatic forms.
- // For 'regular' forms, we get redirected to the batch processing
- // page. Form redirection will be handled in _batch_finished(),
- // after the batch is processed.
- }
-
- // If no submit handlers have populated the $form_state['storage']
- // bundle, and the $form_state['rebuild'] flag has not been set,
- // we're finished and should redirect to a new destination page
- // if one has been set (and a fresh, unpopulated copy of the form
- // if one hasn't). If the form was called by drupal_execute(),
- // however, we'll skip this and let the calling function examine
- // the resulting $form_state bundle itself.
- if (!$form['#programmed'] && empty($form_state['rebuild']) && empty($form_state['storage'])) {
- if (!empty($form_state['no_redirect'])) {
- $form_state['executed'] = TRUE;
- }
- else {
- drupal_redirect_form($form, $form_state['redirect']);
- }
- }
- }
- }
-}
-
-/**
- * The original version of drupal_validate_form does not have an override for
- * the static check to only validate a form id once. Unfortunately, we need
- * to be able to overridet his.
- */
-function drupal_validate_form_new($form_id, $form, &$form_state) {
- static $validated_forms = array();
-
- if (isset($validated_forms[$form_id]) && empty($form_state['must_validate'])) {
- return;
- }
-
- // If the session token was set by drupal_prepare_form(), ensure that it
- // matches the current user's session.
- if (isset($form['#token'])) {
- if (!drupal_valid_token($form_state['values']['form_token'], $form['#token'])) {
- // Setting this error will cause the form to fail validation.
- form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.'));
- }
- }
-
- _form_validate($form, $form_state, $form_id);
- $validated_forms[$form_id] = TRUE;
-}
-
-/**
- * Process callback to add dependency to form items.
- *
- * Usage:
- *
- * On any form item, add
- * - @code '#process' => 'views_process_dependency' @endcode
- * - @code '#dependency' => array('id-of-form-without-the-#' => array(list, of, values, that, make, this, gadget, visible)); @endcode
- */
-function views_process_dependency($element, $edit, &$form_state, &$form) {
- if (isset($element['#dependency'])) {
- if (!isset($element['#dependency_count'])) {
- $element['#dependency_count'] = 1;
- }
- if (!empty($form_state['ajax'])) {
- $form_state['js settings']['viewsAjax']['formRelationships'][$element['#id']] = array('num' => $element['#dependency_count'], 'values' => $element['#dependency']);
- }
- else {
- views_add_js('dependent');
- $options['viewsAjax']['formRelationships'][$element['#id']] = array('num' => $element['#dependency_count'], 'values' => $element['#dependency']);
- drupal_add_js($options, 'setting');
- }
- }
-
- return $element;
-}
-
-/**
- * #process callback to see if we need to check_plain() the options.
- *
- * Since FAPI is inconsistent, the #options are sanitized for you in all cases
- * _except_ checkboxes. We have form elements that are sometimes 'select' and
- * sometimes 'checkboxes', so we need decide late in the form rendering cycle
- * if the options need to be sanitized before they're rendered. This callback
- * inspects the type, and if it's still 'checkboxes', does the sanitation.
- */
-function views_process_check_options($element, $edit, &$form_state, &$form) {
- if ($element['#type'] == 'checkboxes' || $element['#type'] == 'checkbox') {
- $element['#options'] = array_map('check_plain', $element['#options']);
- }
- return $element;
-}
-
diff --git a/includes/handlers.inc b/includes/handlers.inc
deleted file mode 100644
index 7de3222..0000000
--- a/includes/handlers.inc
+++ /dev/null
@@ -1,1387 +0,0 @@
-<?php
-/**
- * @file handlers.inc
- * Defines the various handler objects to help build and display views.
- */
-
-/**
- * Instantiate and construct a new handler
- */
-function _views_create_handler($definition, $type = 'handler') {
-// vpr('Instantiating handler ' . $definition['handler']);
- if (empty($definition['handler'])) {
- return;
- }
-
- if (!class_exists($definition['handler']) && !views_include_handler($definition, $type)) {
- return;
- }
-
- $handler = new $definition['handler'];
- $handler->set_definition($definition);
- // let the handler have something like a constructor.
- $handler->construct();
-
- return $handler;
-}
-
-/**
- * Attempt to find the include file for a given handler from its definition.
- *
- * This will also attempt to include all parents, though we're maxing the
- * parent chain to 10 to prevent infinite loops.
- */
-function views_include_handler($definition, $type, $count = 0) {
- // Do not proceed if the class already exists.
- if (isset($definition['handler']) && class_exists($definition['handler'])) {
- return TRUE;
- }
-
- // simple infinite loop prevention.
- if ($count > 10) {
- vpr(t('Handler @handler include tried to loop infinitely!', array('@handler' => $definition['handler'])));
- return FALSE;
- }
-
- if (!isset($definition['path'])) {
- if ($type == 'handler') {
- $definition += views_fetch_handler_data($definition['handler']);
- }
- else {
- $definition += views_fetch_plugin_data($type, $definition['handler']);
- }
- }
-
- if (!empty($definition['parent'])) {
- if ($type == 'handler') {
- $parent = views_fetch_handler_data($definition['parent']);
- }
- else {
- $parent = views_fetch_plugin_data($type, $definition['parent']);
- }
-
- if ($parent) {
- $rc = views_include_handler($parent, $type, $count + 1);
- // If the parent chain cannot be included, don't try; this will
- // help alleviate problems with modules with cross dependencies.
- if (!$rc) {
- return FALSE;
- }
- }
- }
-
- if (isset($definition['path']) && $definition['file']) {
- $filename = './' . $definition['path'] . '/' . $definition['file'];
- if (file_exists($filename)) {
- require_once $filename;
- }
- }
-
- return class_exists($definition['handler']);
-}
-
-/**
- * Prepare a handler's data by checking defaults and such.
- */
-function _views_prepare_handler($definition, $data, $field) {
- foreach (array('group', 'title', 'title short', 'help', 'real field') as $key) {
- if (!isset($definition[$key])) {
- // First check the field level
- if (!empty($data[$field][$key])) {
- $definition[$key] = $data[$field][$key];
- }
- // Then if that doesn't work, check the table level
- else if (!empty($data['table'][$key])) {
- $definition[$key] = $data['table'][$key];
- }
- }
- }
-
- return _views_create_handler($definition);
-}
-
-/**
- * Fetch the handler data from cache.
- */
-function views_fetch_handler_data($handler = NULL) {
- static $cache = NULL;
- if (!isset($cache)) {
- $start = views_microtime();
-
- $cache = views_discover_handlers();
-
- vpr('Views handlers build time: ' . (views_microtime() - $start) * 1000 . ' ms');
- }
-
- if (!$handler) {
- return $cache;
- }
- else if (isset($cache[$handler])) {
- return $cache[$handler];
- }
-
- // Return an empty array if there is no match.
- return array();
-}
-
-/**
- * Builds and return a list of all handlers available in the system.
- *
- * @return Nested array of handlers
- */
-function views_discover_handlers() {
- $cache = array();
- // Get handlers from all modules.
- foreach (module_implements('views_handlers') as $module) {
- $function = $module . '_views_handlers';
- $result = $function();
- if (!is_array($result)) {
- continue;
- }
-
- $module_dir = isset($result['info']['module']) ? $result['info']['module'] : $module;
- $path = isset($result['info']['path']) ? $result['info']['path'] : drupal_get_path('module', $module_dir);
-
- foreach ($result['handlers'] as $handler => $def) {
- if (!isset($def['module'])) {
- $def['module'] = $module_dir;
- }
- if (!isset($def['path'])) {
- $def['path'] = $path;
- }
- if (!isset($def['file'])) {
- $def['file'] = "$handler.inc";
- }
- if (!isset($def['handler'])) {
- $def['handler'] = $handler;
- }
- // merge the new data in
- $cache[$handler] = $def;
- }
- }
- return $cache;
-}
-
-/**
- * Fetch a handler to join one table to a primary table from the data cache
- */
-function views_get_table_join($table, $base_table) {
- $data = views_fetch_data($table);
- if (isset($data['table']['join'][$base_table])) {
- $h = $data['table']['join'][$base_table];
- if (!empty($h['handler']) && class_exists($h['handler'])) {
- $handler = new $h['handler'];
- }
- else {
- $handler = new views_join();
- }
-
- // Fill in some easy defaults
- $handler->definition = $h;
- if (empty($handler->definition['table'])) {
- $handler->definition['table'] = $table;
- }
- // If this is empty, it's a direct link.
- if (empty($handler->definition['left_table'])) {
- $handler->definition['left_table'] = $base_table;
- }
-
- if (isset($h['arguments'])) {
- call_user_func_array(array(&$handler, 'construct'), $h['arguments']);
- }
- else {
- $handler->construct();
- }
-
- return $handler;
- }
- // DEBUG -- identify missing handlers
- vpr("Missing join: $table $base_table");
-}
-
-/**
- * Base handler, from which all the other handlers are derived.
- * It creates a common interface to create consistency amongst
- * handlers and data.
- *
- * This class would be abstract in PHP5, but PHP4 doesn't understand that.
- *
- * Definition terms:
- * - table: The actual table this uses; only specify if different from
- * the table this is attached to.
- * - real field: The actual field this uses; only specify if different from
- * the field this item is attached to.
- * - group: A text string representing the 'group' this item is attached to,
- * for display in the UI. Examples: "Node", "Taxonomy", "Comment",
- * "User", etc. This may be inherited from the parent definition or
- * the 'table' definition.
- * - title: The title for this handler in the UI. This may be inherited from
- * the parent definition or the 'table' definition.
- * - help: A more informative string to give to the user to explain what this
- * field/handler is or does.
- * - access callback: If this field should have access control, this could
- * be a function to use. 'user_access' is a common
- * function to use here. If not specified, no access
- * control is provided.
- * - access arguments: An array of arguments for the access callback.
- */
-class views_handler extends views_object {
- /**
- * init the handler with necessary data.
- * @param $view
- * The $view object this handler is attached to.
- * @param $options
- * The item from the database; the actual contents of this will vary
- * based upon the type of handler.
- */
- function init(&$view, $options) {
- $this->view = &$view;
- $this->unpack_options($this->options, $options);
-
- // This exist on most handlers, but not all. So they are still optional.
- if (isset($options['table'])) {
- $this->table = $options['table'];
- }
-
- if (isset($this->definition['real field'])) {
- $this->real_field = $this->definition['real field'];
- }
-
- if (isset($this->definition['field'])) {
- $this->real_field = $this->definition['field'];
- }
-
- if (isset($options['field'])) {
- $this->field = $options['field'];
- if (!isset($this->real_field)) {
- $this->real_field = $options['field'];
- }
- }
-
- $this->query = &$view->query;
- }
-
- /**
- * Return a string representing this handler's name in the UI.
- */
- function ui_name($short = FALSE) {
- $title = ($short && isset($this->definition['title short'])) ? $this->definition['title short'] : $this->definition['title'];
- return t('!group: !title', array('!group' => $this->definition['group'], '!title' => $title));
- }
-
- /**
- * Provide a form for setting options.
- */
- function options_form(&$form, &$form_state) { }
-
- /**
- * Validate the options form.
- */
- function options_validate($form, &$form_state) { }
-
- /**
- * Perform any necessary changes to the form values prior to storage.
- * There is no need for this function to actually store the data.
- */
- function options_submit($form, &$form_state) { }
-
- /**
- * If a handler has 'extra options' it will get a little settings widget and
- * another form called extra_options.
- */
- function has_extra_options() { return FALSE; }
-
- /**
- * Provide defaults for the handler.
- */
- function extra_options(&$option) { }
-
- /**
- * Provide a form for setting options.
- */
- function extra_options_form(&$form, &$form_state) { }
-
- /**
- * Validate the options form.
- */
- function extra_options_validate($form, &$form_state) { }
-
- /**
- * Perform any necessary changes to the form values prior to storage.
- * There is no need for this function to actually store the data.
- */
- function extra_options_submit($form, &$form_state) { }
-
- /**
- * Set new exposed option defaults when exposed setting is flipped
- * on.
- */
- function expose_options() { }
- /**
- * Render our chunk of the exposed filter form when selecting
- */
- function exposed_form(&$form, &$form_state) { }
-
- /**
- * Validate the exposed filter form
- */
- function exposed_validate(&$form, &$form_state) { }
-
- /**
- * Submit the exposed filter form
- */
- function exposed_submit(&$form, &$form_state) { }
-
- /**
- * Get information about the exposed form for the form renderer.
- *
- * @return
- * An array with the following keys:
- * - operator: The $form key of the operator. Set to NULL if no operator.
- * - value: The $form key of the value. Set to NULL if no value.
- * - label: The label to use for this piece.
- */
- function exposed_info() { }
-
- /**
- * Check whether current user has access to this handler.
- *
- * @return boolean
- */
- function access() {
- if (isset($this->definition['access callback']) && function_exists($this->definition['access callback'])) {
- if (isset($this->definition['access arguments']) && is_array($this->definition['access arguments'])) {
- return call_user_func_array($this->definition['access callback'], $this->definition['access arguments']);
- }
- return $this->definition['access callback']();
- }
-
- return TRUE;
- }
-
- /**
- * Run before the view is built.
- *
- * This gives all the handlers some time to set up before any handler has
- * been fully run.
- */
- function pre_query() { }
-
- /**
- * Called just prior to query(), this lets a handler set up any relationship
- * it needs.
- */
- function set_relationship() {
- // Ensure this gets set to something.
- $this->relationship = NULL;
-
- // Don't process non-existant relationships.
- if (empty($this->options['relationship']) || $this->options['relationship'] == 'none') {
- return;
- }
-
- $relationship = $this->options['relationship'];
-
- // Ignore missing/broken relationships.
- if (empty($this->view->relationship[$relationship])) {
- return;
- }
-
- // Check to see if the relationship has already processed. If not, then we
- // cannot process it.
- if (empty($this->view->relationship[$relationship]->alias)) {
- return;
- }
-
- // Finally!
- $this->relationship = $this->view->relationship[$relationship]->alias;
- }
-
- /**
- * Add this handler into the query.
- *
- * If we were using PHP5, this would be abstract.
- */
- function query() { }
-
- /**
- * Ensure the main table for this handler is in the query. This is used
- * a lot.
- */
- function ensure_my_table() {
- if (!isset($this->table_alias)) {
- if (!method_exists($this->query, 'ensure_table')) { vpr_trace(); exit; }
- $this->table_alias = $this->query->ensure_table($this->table, $this->relationship);
- }
- return $this->table_alias;
- }
-
- /**
- * Provide text for the administrative summary
- */
- function admin_summary() { }
-
- /**
- * Determine if the argument needs a style plugin.
- *
- * @return TRUE/FALSE
- */
- function needs_style_plugin() { return FALSE; }
-
- /**
- * Determine if this item is 'exposed', meaning it provides form elements
- * to let users modify the view.
- *
- * @return TRUE/FALSE
- */
- function is_exposed() {
- return !empty($this->options['exposed']);
- }
-
- /**
- * Take input from exposed filters and assign to this handler, if necessary.
- */
- function accept_exposed_input($input) { return TRUE; }
-
- /**
- * If set to remember exposed input in the session, store it there.
- */
- function store_exposed_input($input, $status) { return TRUE; }
-
- /**
- * Get the join object that should be used for this handler.
- *
- * This method isn't used a great deal, but it's very handy for easily
- * getting the join if it is necessary to make some changes to it, such
- * as adding an 'extra'.
- */
- function get_join() {
- // get the join from this table that links back to the base table.
- // Determine the primary table to seek
- if (empty($this->query->relationships[$this->relationship])) {
- $base_table = $this->query->base_table;
- }
- else {
- $base_table = $this->query->relationships[$this->relationship]['base'];
- }
-
- $join = views_get_table_join($this->table, $base_table);
- if ($join) {
- return drupal_clone($join);
- }
- }
-
- /**
- * Validates the handler against the complete View.