summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/modules
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
commit8a7a4f8e58df35a10fda833a9904eb8fd961a1ca (patch)
tree35e2f907372d637f76c0e3c3ac1c0f27f2dc1391 /kolab.org/www/drupal-7.15/sites/all/modules/views/modules
parent146e20fc2d0941a6783641f26b3ea074dc03fc84 (diff)
downloadkolab.org-www-8a7a4f8e58df35a10fda833a9904eb8fd961a1ca.tar.gz
upgrade to drupal 7.15
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/modules')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator.views.inc415
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc21
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_fid.inc21
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_iid.inc25
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_category.inc55
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_title_link.inc50
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_xss.inc12
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_filter_aggregator_category_cid.inc20
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_plugin_row_aggregator_rss.inc73
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/book.views.inc123
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views.inc648
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views_default.inc283
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_argument_comment_user_uid.inc56
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment.inc67
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc15
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link.inc63
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_approve.inc31
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_delete.inc23
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_edit.inc46
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_reply.inc24
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_node_link.inc59
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_username.inc52
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc23
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_comment_name.inc49
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_updated.inc13
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_comment.inc21
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_new_comments.inc110
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc24
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc19
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_node_comment.inc16
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_comment_thread.inc20
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_comment_name.inc24
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_updated.inc13
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_rss.inc151
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_view.inc96
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact.views.inc16
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact/views_handler_field_contact_link.inc51
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field.views.inc429
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_argument_field_list.inc56
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_field_field.inc874
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_filter_field_list.inc13
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_relationship_entity_reverse.inc83
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/file.views.inc81
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter.views.inc41
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter/views_handler_field_filter_format_name.inc30
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/image.views.inc80
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale.views.inc206
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_group.inc35
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_language.inc33
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_group.inc16
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_language.inc31
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc55
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_group.inc18
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_language.inc21
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_version.inc23
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views.inc753
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_default.inc315
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_template.inc132
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_dates_various.inc179
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_language.inc30
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_nid.inc23
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_type.inc33
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_uid_revision.inc14
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_vid.inc25
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_history_user_timestamp.inc76
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node.inc79
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link.inc42
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_delete.inc25
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_edit.inc25
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_path.inc47
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision.inc65
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_delete.inc38
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_revert.inc38
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_type.inc45
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_history_user_timestamp.inc80
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_access.inc34
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc16
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_type.inc19
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc24
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_default_node.inc25
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_validate_node.inc133
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc166
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_view.inc107
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/poll.views.inc55
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile.views.inc224
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_date.inc83
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_list.inc35
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_filter_profile_selection.inc25
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views.inc211
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views_default.inc118
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_argument_search.inc95
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_field_search_score.inc76
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_filter_search.inc206
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_sort_search_score.inc27
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_plugin_row_search_view.inc38
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views.inc271
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views_default.inc252
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics/views_handler_field_accesslog_path.inc52
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system.views.inc575
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_argument_file_fid.inc22
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file.inc55
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_extension.inc14
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_filemime.inc33
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_status.inc12
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_uri.inc30
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_file_status.inc13
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_system_type.inc16
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views.inc511
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views_default.inc108
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_taxonomy.inc24
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid.inc43
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth.inc139
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc59
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc21
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_vid.inc21
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_taxonomy.inc80
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_link_edit.inc54
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_node_tid.inc142
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc349
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid_depth.inc94
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_machine_name.inc20
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_vid.inc20
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_relationship_node_term_data.inc95
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc150
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc221
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation.views.inc150
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_argument_node_tnid.inc25
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_language.inc32
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_link_translate.inc23
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_translation_link.inc43
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_language.inc20
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid.inc39
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid_child.inc16
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_relationship_translation.inc98
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user.views.inc572
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_user_uid.inc32
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_users_roles_rid.inc17
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user.inc50
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_language.inc31
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link.inc52
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_cancel.inc27
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_edit.inc24
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_mail.inc38
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_name.inc77
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_permissions.inc62
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_picture.inc109
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_roles.inc49
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_current.inc31
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_name.inc145
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_permissions.inc29
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_roles.inc22
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_current_user.inc17
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_user.inc76
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_validate_user.inc135
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_row_user_view.inc81
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/views.views.inc105
156 files changed, 14457 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator.views.inc
new file mode 100644
index 0000000..0ca9e33
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator.views.inc
@@ -0,0 +1,415 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for aggregator.module
+ */
+
+/**
+ * @defgroup views_aggregator_module aggregator.module handlers
+ *
+ * Includes the core 'aggregator_feed,' 'aggregator_category,' and 'aggregator_item'
+ * tables.
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function aggregator_views_data() {
+ // ----------------------------------------------------------------------
+ // Main Aggregator Item base table
+
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['aggregator_item']['table']['group'] = t('Aggregator');
+
+ // Advertise this table as a possible base table
+ $data['aggregator_item']['table']['base'] = array(
+ 'field' => 'iid',
+ 'title' => t('Aggregator item'),
+ 'help' => t("Aggregator items are imported from external RSS and Atom news feeds."),
+ );
+
+ // ----------------------------------------------------------------
+ // Fields
+
+ // item id.
+ $data['aggregator_item']['iid'] = array(
+ 'title' => t('Feed Item ID'),
+ 'help' => t('The unique ID of the aggregator item.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ 'numeric' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // iid
+ $data['aggregator_item']['iid'] = array(
+ 'title' => t('Item ID'),
+ 'help' => t('The unique ID of the aggregator item.'), // The help that appears on the UI,
+ // Information for displaying the iid
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ // Information for accepting a iid as an argument
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_aggregator_iid',
+ 'name field' => 'title', // the field to display in the summary.
+ 'numeric' => TRUE,
+ ),
+ // Information for accepting a nid as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ // Information for sorting on a nid.
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // title
+ $data['aggregator_item']['title'] = array(
+ 'title' => t('Title'), // The item it appears as on the UI,
+ 'help' => t('The title of the aggregator item.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_aggregator_title_link',
+ 'extra' => array('link'),
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // link
+ $data['aggregator_item']['link'] = array(
+ 'title' => t('Link'), // The item it appears as on the UI,
+ 'help' => t('The link to the original source URL of the item.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_url',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // author
+ $data['aggregator_item']['author'] = array(
+ 'title' => t('Author'), // The item it appears as on the UI,
+ 'help' => t('The author of the original imported item.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_aggregator_xss',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // guid
+ $data['aggregator_item']['guid'] = array(
+ 'title' => t('GUID'), // The item it appears as on the UI,
+ 'help' => t('The guid of the original imported item.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_xss',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // feed body
+ $data['aggregator_item']['description'] = array(
+ 'title' => t('Body'), // The item it appears as on the UI,
+ 'help' => t('The actual content of the imported item.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_aggregator_xss',
+ 'click sortable' => FALSE,
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // item timestamp
+ $data['aggregator_item']['timestamp'] = array(
+ 'title' => t('Timestamp'), // The item it appears as on the UI,
+ 'help' => t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_date',
+ ),
+ );
+
+
+ // ----------------------------------------------------------------------
+ // Aggregator feed table
+
+ $data['aggregator_feed']['table']['group'] = t('Aggregator feed');
+
+ // Explain how this table joins to others.
+ $data['aggregator_feed']['table']['join'] = array(
+ 'aggregator_item' => array(
+ 'left_field' => 'fid',
+ 'field' => 'fid',
+ ),
+ );
+
+ // fid
+ $data['aggregator_feed']['fid'] = array(
+ 'title' => t('Feed ID'),
+ 'help' => t('The unique ID of the aggregator feed.'), // The help that appears on the UI,
+ // Information for displaying the fid
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ // Information for accepting a fid as an argument
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_aggregator_fid',
+ 'name field' => 'title', // the field to display in the summary.
+ 'numeric' => TRUE,
+ ),
+ // Information for accepting a nid as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ // Information for sorting on a fid.
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // title
+ $data['aggregator_feed']['title'] = array(
+ 'title' => t('Title'), // The item it appears as on the UI,
+ 'help' => t('The title of the aggregator feed.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_aggregator_title_link',
+ 'extra' => array('link'),
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // link
+ $data['aggregator_feed']['link'] = array(
+ 'title' => t('Link'), // The item it appears as on the UI,
+ 'help' => t('The link to the source URL of the feed.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_url',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // feed last updated
+ $data['aggregator_feed']['checked'] = array(
+ 'title' => t('Last checked'), // The item it appears as on the UI,
+ 'help' => t('The date the feed was last checked for new content.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_date',
+ ),
+ );
+
+ // feed description
+ $data['aggregator_feed']['description'] = array(
+ 'title' => t('Description'), // The item it appears as on the UI,
+ 'help' => t('The description of the aggregator feed.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_xss',
+ 'click sortable' => FALSE,
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // feed last updated
+ $data['aggregator_feed']['modified'] = array(
+ 'title' => t('Last modified'), // The item it appears as on the UI,
+ 'help' => t('The date of the most recent new content on the feed.'),
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_date',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // Aggregator category feed table
+
+ $data['aggregator_category_feed']['table']['join'] = array(
+ 'aggregator_item' => array(
+ 'left_field' => 'fid',
+ 'field' => 'fid',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // Aggregator category table
+
+ $data['aggregator_category']['table']['group'] = t('Aggregator category');
+
+ $data['aggregator_category']['table']['join'] = array(
+ 'aggregator_item' => array(
+ 'left_table' => 'aggregator_category_feed',
+ 'left_field' => 'cid',
+ 'field' => 'cid',
+ ),
+ );
+
+ // cid
+ $data['aggregator_category']['cid'] = array(
+ 'title' => t('Category ID'),
+ 'help' => t('The unique ID of the aggregator category.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_aggregator_category_cid',
+ 'name field' => 'title',
+ 'numeric' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_aggregator_category_cid',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // title
+ $data['aggregator_category']['title'] = array(
+ 'title' => t('Category'),
+ 'help' => t('The title of the aggregator category.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_aggregator_category',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * Implements hook_views_plugins
+ */
+function aggregator_views_plugins() {
+ return array(
+ 'module' => 'views', // This just tells our themes are elsewhere.
+ 'row' => array(
+ 'aggregator_rss' => array(
+ 'title' => t('Aggregator item'),
+ 'help' => t('Display the aggregator item using the data from the original source.'),
+ 'handler' => 'views_plugin_row_aggregator_rss',
+ 'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules
+ 'theme' => 'views_view_row_rss',
+ 'base' => array('aggregator_item'), // only works with 'node' as base.
+ 'uses options' => TRUE,
+ 'type' => 'feed',
+ 'help topic' => 'style-aggregator-rss',
+ ),
+ ),
+ );
+}
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc
new file mode 100644
index 0000000..c67832c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_category_cid.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Argument handler to accept an aggregator category id.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_aggregator_category_cid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title(). Get the title of the category.
+ */
+ function title_query() {
+ $titles = array();
+
+ $result = db_query("SELECT c.title FROM {aggregator_category} c WHERE c.cid IN (:cid)", array(':cid' => $this->value));
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->title);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_fid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_fid.inc
new file mode 100644
index 0000000..ed11288
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_fid.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Argument handler to accept an aggregator feed id.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_aggregator_fid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title(). Get the title of the feed.
+ */
+ function title_query() {
+ $titles = array();
+
+ $result = db_query("SELECT f.title FROM {aggregator_feed} f WHERE f.fid IN (:fids)", array(':fids' => $this->value));
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->title);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_iid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_iid.inc
new file mode 100644
index 0000000..fe19ab6
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_argument_aggregator_iid.inc
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * Argument handler to accept an aggregator item id.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_aggregator_iid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title(). Get the title of the category.
+ */
+ function title_query() {
+ $titles = array();
+ $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
+
+ $result = db_select('aggregator_item')
+ ->condition('iid', $this->value, 'IN')
+ ->fields(array('title'))
+ ->execute();
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->title);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_category.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_category.inc
new file mode 100644
index 0000000..0564810
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_category.inc
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Field handler to provide simple renderer that allows linking to aggregator
+ * category.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_aggregator_category extends views_handler_field {
+ /**
+ * Constructor to provide additional field to add.
+ */
+ function construct() {
+ parent::construct();
+ $this->additional_fields['cid'] = 'cid';
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_category'] = array('default' => FALSE);
+ return $options;
+ }
+
+ /**
+ * Provide link to category option
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_category'] = array(
+ '#title' => t('Link this field to its aggregator category page'),
+ '#description' => t('This will override any other link you have set.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['link_to_category']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ /**
+ * Render whatever the data is as a link to the category.
+ *
+ * Data should be made XSS safe prior to calling this function.
+ */
+ function render_link($data, $values) {
+ $cid = $this->get_value($values, 'cid');
+ if (!empty($this->options['link_to_category']) && !empty($cid) && $data !== NULL && $data !== '') {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "aggregator/category/$cid";
+ }
+ return $data;
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_title_link.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_title_link.inc
new file mode 100644
index 0000000..d428f44
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_title_link.inc
@@ -0,0 +1,50 @@
+<?php
+
+ /**
+ * Field handler that turns an item's title into a clickable link to the original
+ * source article.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_aggregator_title_link extends views_handler_field {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['link'] = 'link';
+ }
+
+ 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) {
+ $form['display_as_link'] = array(
+ '#title' => t('Display as link'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['display_as_link']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+
+ function render_link($data, $values) {
+ $link = $this->get_value($values, 'link');
+ if (!empty($this->options['display_as_link'])) {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = $link;
+ $this->options['alter']['html'] = TRUE;
+ }
+
+ return $data;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_xss.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_xss.inc
new file mode 100644
index 0000000..0813e35
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_field_aggregator_xss.inc
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Filters htmls tags from item.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_aggregator_xss extends views_handler_field {
+ function render($values) {
+ $value = $this->get_value($values);
+ return aggregator_filter_xss($value);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_filter_aggregator_category_cid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_filter_aggregator_category_cid.inc
new file mode 100644
index 0000000..27cf674
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_handler_filter_aggregator_category_cid.inc
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Filter by aggregator category cid
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_aggregator_category_cid extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (isset($this->value_options)) {
+ return;
+ }
+
+ $this->value_options = array();
+
+ $result = db_query('SELECT * FROM {aggregator_category} ORDER BY title');
+ foreach ($result as $category) {
+ $this->value_options[$category->cid] = $category->title;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_plugin_row_aggregator_rss.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_plugin_row_aggregator_rss.inc
new file mode 100644
index 0000000..35aadec
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/aggregator/views_plugin_row_aggregator_rss.inc
@@ -0,0 +1,73 @@
+<?php
+/**
+ * @file
+ * Contains the Aggregator Item RSS row style plugin.
+ */
+
+/**
+ * Plugin which loads an aggregator item and formats it as an RSS item.
+ */
+class views_plugin_row_aggregator_rss extends views_plugin_row {
+ var $base_table = 'aggregator_item';
+ var $base_field = 'iid';
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['item_length'] = array('default' => 'default');
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['item_length'] = array(
+ '#type' => 'select',
+ '#title' => t('Display type'),
+ '#options' => array(
+ 'fulltext' => t('Full text'),
+ 'teaser' => t('Title plus teaser'),
+ 'title' => t('Title only'),
+ 'default' => t('Use default RSS settings'),
+ ),
+ '#default_value' => $this->options['item_length'],
+ );
+ }
+
+ function render($row) {
+ $iid = $row->{$this->field_alias};
+ $sql = "SELECT ai.iid, ai.fid, ai.title, ai.link, ai.author, ai.description, ";
+ $sql .= "ai.timestamp, ai.guid, af.title AS feed_title, ai.link AS feed_LINK ";
+ $sql .= "FROM {aggregator_item} ai LEFT JOIN {aggregator_feed} af ON ai.fid = af.fid ";
+ $sql .= "WHERE ai.iid = :iid";
+
+ $item = db_query($sql, array(':iid' => $iid))->fetchObject();
+
+ $item->elements = array(
+ array(
+ 'key' => 'pubDate',
+ 'value' => gmdate('r', $item->timestamp),
+ ),
+ array(
+ 'key' => 'dc:creator',
+ 'value' => $item->author,
+ ),
+ array(
+ 'key' => 'guid',
+ 'value' => $item->guid,
+ 'attributes' => array('isPermaLink' => 'false')
+ ),
+ );
+
+ foreach ($item->elements as $element) {
+ if (isset($element['namespace'])) {
+ $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $element['namespace']);
+ }
+ }
+
+ return theme($this->theme_functions(), array(
+ 'view' => $this->view,
+ 'options' => $this->options,
+ 'row' => $item
+ ));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/book.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/book.views.inc
new file mode 100644
index 0000000..2b1a82a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/book.views.inc
@@ -0,0 +1,123 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for book.module
+ */
+
+/**
+ * @defgroup views_book_module book.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function book_views_data() {
+ // ----------------------------------------------------------------------
+ // book table
+
+ $data['book']['table']['group'] = t('Book');
+ $data['book']['table']['join'] = array(
+ 'node' => array(
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ ),
+ );
+
+ $data['book']['bid'] = array(
+ 'title' => t('Top level book'),
+ 'help' => t('The book the node is in.'),
+ 'relationship' => array(
+ 'base' => 'node',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('Book'),
+ ),
+ // There is no argument here; if you need an argument, add the relationship
+ // and use the node: nid argument.
+ );
+
+ // ----------------------------------------------------------------------
+ // menu_links table -- this is aliased so we can get just book relations
+
+ // Book hierarchy and weight data are now in {menu_links}.
+ $data['book_menu_links']['table']['group'] = t('Book');
+ $data['book_menu_links']['table']['join'] = array(
+ 'node' => array(
+ 'table' => 'menu_links',
+ 'left_table' => 'book',
+ 'left_field' => 'mlid',
+ 'field' => 'mlid',
+ ),
+ );
+
+ $data['book_menu_links']['weight'] = array(
+ 'title' => t('Weight'),
+ 'help' => t('The weight of the book page.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ $data['book_menu_links']['depth'] = array(
+ 'title' => t('Depth'),
+ 'help' => t('The depth of the book page in the hierarchy; top level books have a depth of 1.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument',
+ ),
+ );
+
+ $data['book_menu_links']['p'] = array(
+ 'title' => t('Hierarchy'),
+ 'help' => t('The order of pages in the book hierarchy.'),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_menu_hierarchy',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // book_parent table -- this is an alias of the book table which
+ // represents the parent book.
+
+ // The {book} record for the parent node.
+ $data['book_parent']['table']['group'] = t('Book');
+ $data['book_parent']['table']['join'] = array(
+ 'node' => array(
+ 'table' => 'book',
+ 'left_table' => 'book_menu_links',
+ 'left_field' => 'plid',
+ 'field' => 'mlid',
+ ),
+ );
+
+ $data['book_parent']['nid'] = array(
+ 'title' => t('Parent'),
+ 'help' => t('The parent book node.'),
+ 'relationship' => array(
+ 'base' => 'node',
+ 'base field' => 'nid',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('Book parent'),
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views.inc
new file mode 100644
index 0000000..e22ccd5
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views.inc
@@ -0,0 +1,648 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for comment.module
+ */
+
+/**
+ * @defgroup views_comment_module comment.module handlers
+ *
+ * Includes the tables 'comment' and 'node_comment_statistics'
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+
+function comment_views_data() {
+ $data['comments']['moved to'] = 'comment';
+ $data['comment']['comment']['moved to'] = array('field_data_comment_body', 'comment_body');
+ $data['comment']['comment']['field']['moved to'] = array('field_data_comment_body', 'comment_body');
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['comment']['table']['group'] = t('Comment');
+
+ $data['comment']['table']['base'] = array(
+ 'field' => 'cid',
+ 'title' => t('Comment'),
+ 'help' => t("Comments are responses to node content."),
+ 'access query tag' => 'comment_access',
+ );
+ $data['comment']['table']['entity type'] = 'comment';
+
+ // Provide a "default relationship" to keep older views from choking.
+ $data['comment']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'cid',
+ ),
+ );
+
+ // ----------------------------------------------------------------
+ // Fields
+
+ // subject
+ $data['comment']['subject'] = array(
+ 'title' => t('Title'),
+ 'help' => t('The title of the comment.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_comment',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // cid
+ $data['comment']['cid'] = array(
+ 'title' => t('ID'),
+ 'help' => t('The comment ID of the field'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_comment',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ ),
+ );
+
+ // name (of comment author)
+ $data['comment']['name'] = array(
+ 'title' => t('Author'),
+ 'help' => t("The name of the comment's author. Can be rendered as a link to the author's homepage."),
+ 'field' => array(
+ 'handler' => 'views_handler_field_comment_username',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // homepage
+ $data['comment']['homepage'] = array(
+ 'title' => t("Author's website"),
+ 'help' => t("The website address of the comment's author. Can be rendered as a link. Will be empty if the author is a registered user."),
+ 'field' => array(
+ 'handler' => 'views_handler_field_url',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // hostname
+ $data['comment']['hostname'] = array(
+ 'title' => t('Hostname'),
+ 'help' => t('Hostname of user that posted the comment.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // mail
+ $data['comment']['mail'] = array(
+ 'title' => t('Mail'),
+ 'help' => t('Email of user that posted the comment. Will be empty if the author is a registered user.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // created (when comment was posted)
+ $data['comment']['created'] = array(
+ 'title' => t('Post date'),
+ 'help' => t('Date and time of when the comment was created.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ $data['comments']['timestamp']['moved to'] = array('comment', 'changed');
+ // changed (when comment was last updated)
+ $data['comment']['changed'] = array(
+ 'title' => t('Updated date'),
+ 'help' => t('Date and time of when the comment was last updated.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ $data['comments']['timestamp_fulldate']['moved to'] = array('comment', 'changed_fulldata');
+ $data['comment']['changed_fulldata'] = array(
+ 'title' => t('Created date'),
+ 'help' => t('Date in the form of CCYYMMDD.'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_fulldate',
+ ),
+ );
+
+ $data['comments']['timestamp_year_month']['moved to'] = array('comment', 'changed_year_month');
+ $data['comment']['changed_year_month'] = array(
+ 'title' => t('Created year + month'),
+ 'help' => t('Date in the form of YYYYMM.'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_year_month',
+ ),
+ );
+
+ $data['comments']['timestamp_year']['moved to'] = array('comment', 'changed_year');
+ $data['comment']['changed_year'] = array(
+ 'title' => t('Created year'),
+ 'help' => t('Date in the form of YYYY.'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_year',
+ ),
+ );
+
+ $data['comments']['timestamp_month']['moved to'] = array('comment', 'changed_month');
+ $data['comment']['changed_month'] = array(
+ 'title' => t('Created month'),
+ 'help' => t('Date in the form of MM (01 - 12).'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_month',
+ ),
+ );
+
+ $data['comments']['timestamp_day']['moved to'] = array('comment', 'changed_day');
+ $data['comment']['changed_day'] = array(
+ 'title' => t('Created day'),
+ 'help' => t('Date in the form of DD (01 - 31).'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_day',
+ ),
+ );
+
+ $data['comments']['timestamp_week']['moved to'] = array('comment', 'changed_week');
+ $data['comment']['changed_week'] = array(
+ 'title' => t('Created week'),
+ 'help' => t('Date in the form of WW (01 - 53).'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_week',
+ ),
+ );
+
+ // status (approved or not)
+ $data['comment']['status'] = array(
+ 'title' => t('Approved'),
+ 'help' => t('Whether the comment is approved (or still in the moderation queue).'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ 'output formats' => array(
+ 'approved-not-approved' => array(t('Approved'), t('Not Approved')),
+ ),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Approved comment'),
+ 'type' => 'yes-no',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // link to view comment
+ $data['comment']['view_comment'] = array(
+ 'field' => array(
+ 'title' => t('View link'),
+ 'help' => t('Provide a simple link to view the comment.'),
+ 'handler' => 'views_handler_field_comment_link',
+ ),
+ );
+
+ // link to edit comment
+ $data['comment']['edit_comment'] = array(
+ 'field' => array(
+ 'title' => t('Edit link'),
+ 'help' => t('Provide a simple link to edit the comment.'),
+ 'handler' => 'views_handler_field_comment_link_edit',
+ ),
+ );
+
+ // link to delete comment
+ $data['comment']['delete_comment'] = array(
+ 'field' => array(
+ 'title' => t('Delete link'),
+ 'help' => t('Provide a simple link to delete the comment.'),
+ 'handler' => 'views_handler_field_comment_link_delete',
+ ),
+ );
+
+
+ // link to approve comment
+ $data['comment']['approve_comment'] = array(
+ 'field' => array(
+ 'title' => t('Approve link'),
+ 'help' => t('Provide a simple link to approve the comment.'),
+ 'handler' => 'views_handler_field_comment_link_approve',
+ ),
+ );
+
+ // link to reply to comment
+ $data['comment']['replyto_comment'] = array(
+ 'field' => array(
+ 'title' => t('Reply-to link'),
+ 'help' => t('Provide a simple link to reply to the comment.'),
+ 'handler' => 'views_handler_field_comment_link_reply',
+ ),
+ );
+
+ $data['comment']['thread'] = array(
+ 'field' => array(
+ 'title' => t('Depth'),
+ 'help' => t('Display the depth of the comment if it is threaded.'),
+ 'handler' => 'views_handler_field_comment_depth',
+ ),
+ 'sort' => array(
+ 'title' => t('Thread'),
+ 'help' => t('Sort by the threaded order. This will keep child comments together with their parents.'),
+ 'handler' => 'views_handler_sort_comment_thread',
+ ),
+ );
+
+ $data['comment']['nid'] = array(
+ 'title' => t('Nid'),
+ 'help' => t('The node ID to which the comment is a reply to.'),
+ 'relationship' => array(
+ 'title' => t('Content'),
+ 'help' => t('The content to which the comment is a reply to.'),
+ 'base' => 'node',
+ 'base field' => 'nid',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('Content'),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ ),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ ),
+ );
+
+ $data['comment']['uid'] = array(
+ 'title' => t('Author uid'),
+ 'help' => t('If you need more fields than the uid add the comment: author relationship'),
+ 'relationship' => array(
+ 'title' => t('Author'),
+ 'help' => t("The User ID of the comment's author."),
+ 'base' => 'users',
+ 'base field' => 'uid',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('author'),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ ),
+ 'field' => array(
+ 'handler' => 'views_handler_field_user',
+ ),
+ );
+
+ $data['comment']['pid'] = array(
+ 'title' => t('Parent CID'),
+ 'help' => t('The Comment ID of the parent comment.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ ),
+ 'relationship' => array(
+ 'title' => t('Parent comment'),
+ 'help' => t('The parent comment.'),
+ 'base' => 'comment',
+ 'base field' => 'cid',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('Parent comment'),
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // node_comment_statistics table
+
+ // define the group
+ $data['node_comment_statistics']['table']['group'] = t('Content');
+
+ // joins
+ $data['node_comment_statistics']['table']['join'] = array(
+ //...to the node table
+ 'node' => array(
+ 'type' => 'INNER',
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ ),
+ );
+
+ // last_comment_timestamp
+ $data['node_comment_statistics']['last_comment_timestamp'] = array(
+ 'title' => t('Last comment time'),
+ 'help' => t('Date and time of when the last comment was posted.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_last_comment_timestamp',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ // last_comment_name (author's name)
+ $data['node_comment_statistics']['last_comment_name'] = array(
+ 'title' => t("Last comment author"),
+ 'help' => t('The name of the author of the last posted comment.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_ncs_last_comment_name',
+ 'click sortable' => TRUE,
+ 'no group by' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_ncs_last_comment_name',
+ 'no group by' => TRUE,
+ ),
+ );
+
+ // comment_count
+ $data['node_comment_statistics']['comment_count'] = array(
+ 'title' => t('Comment count'),
+ 'help' => t('The number of comments a node has.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument',
+ ),
+ );
+
+ // last_comment_timestamp
+ $data['node_comment_statistics']['last_updated'] = array(
+ 'title' => t('Updated/commented date'),
+ 'help' => t('The most recent of last comment posted or node updated time.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_ncs_last_updated',
+ 'click sortable' => TRUE,
+ 'no group by' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_ncs_last_updated',
+ 'no group by' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_ncs_last_updated',
+ ),
+ );
+
+ $data['node_comment_statistics']['cid'] = array(
+ 'title' => t('Last comment CID'),
+ 'help' => t('Display the last comment of a node'),
+ 'relationship' => array(
+ 'title' => t('Last Comment'),
+ 'help' => t('The last comment of a node.'),
+ 'group' => t('Comment'),
+ 'base' => 'comment',
+ 'base field' => 'cid',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('Last Comment'),
+ ),
+ );
+
+ // last_comment_uid
+ $data['node_comment_statistics']['last_comment_uid'] = array(
+ 'title' => t('Last comment uid'),
+ 'help' => t('The User ID of the author of the last comment of a node.'),
+ 'relationship' => array(
+ 'title' => t('Last comment author'),
+ 'base' => 'users',
+ 'base field' => 'uid',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('Last comment author'),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ ),
+ 'field' => array(
+ 'handler' => 'views_handler_filter_user_name',
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * Use views_data_alter to add items to the node table that are
+ * relevant to comments.
+ */
+function comment_views_data_alter(&$data) {
+ // new comments
+ $data['node']['new_comments'] = array(
+ 'title' => t('New comments'),
+ 'help' => t('The number of new comments on the node.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_node_new_comments',
+ 'no group by' => TRUE,
+ ),
+ );
+
+ $data['node']['comments_link'] = array(
+ 'field' => array(
+ 'title' => t('Add comment link'),
+ 'help' => t('Display the standard add comment link used on regular nodes, which will only display if the viewing user has access to add a comment.'),
+ 'handler' => 'views_handler_field_comment_node_link',
+ ),
+ );
+
+ // Comment status of the node
+ $data['node']['comment'] = array(
+ 'title' => t('Comment status'),
+ 'help' => t('Whether comments are enabled or disabled on the node.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_node_comment',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_comment',
+ ),
+ );
+
+ $data['node']['uid_touch'] = array(
+ 'title' => t('User posted or commented'),
+ 'help' => t('Display nodes only if a user posted the node or commented on the node.'),
+ 'argument' => array(
+ 'field' => 'uid',
+ 'name table' => 'users',
+ 'name field' => 'name',
+ 'handler' => 'views_handler_argument_comment_user_uid',
+ 'no group by' => TRUE,
+ ),
+ 'filter' => array(
+ 'field' => 'uid',
+ 'name table' => 'users',
+ 'name field' => 'name',
+ 'handler' => 'views_handler_filter_comment_user_uid'
+ ),
+ );
+
+ $data['node']['cid'] = array(
+ 'title' => t('Comments of the node'),
+ 'help' => t('Relate all comments on the node. This will create 1 duplicate record for every comment. Usually if you need this it is better to create a comment view.'),
+ 'relationship' => array(
+ 'group' => t('Comment'),
+ 'label' => t('Comments'),
+ 'base' => 'comment',
+ 'base field' => 'nid',
+ 'relationship field' => 'nid',
+ 'handler' => 'views_handler_relationship',
+ ),
+ );
+
+}
+
+/**
+ * Implements hook_views_plugins
+ */
+function comment_views_plugins() {
+ return array(
+ 'module' => 'views',
+ 'row' => array(
+ 'comment' => array(
+ 'title' => t('Comment'),
+ 'help' => t('Display the comment with standard comment view.'),
+ 'handler' => 'views_plugin_row_comment_view',
+ 'theme' => 'views_view_row_comment',
+ 'path' => drupal_get_path('module', 'views') . '/modules/comment', // not necessary for most modules
+ 'base' => array('comment'), // only works with 'comment' as base.
+ 'uses options' => TRUE,
+ 'type' => 'normal',
+ 'help topic' => 'style-comment',
+ ),
+ 'comment_rss' => array(
+ 'title' => t('Comment'),
+ 'help' => t('Display the comment as RSS.'),
+ 'handler' => 'views_plugin_row_comment_rss',
+ 'theme' => 'views_view_row_rss',
+ 'path' => drupal_get_path('module', 'views') . '/modules/comment', // not necessary for most modules
+ 'base' => array('comment'), // only works with 'comment' as base.
+ 'uses options' => TRUE,
+ 'type' => 'feed',
+ 'help topic' => 'style-comment-rss',
+ ),
+ ),
+ );
+}
+
+/**
+ * Template helper for theme_views_view_row_comment
+ */
+function template_preprocess_views_view_row_comment(&$vars) {
+ $options = $vars['options'];
+ $view = &$vars['view'];
+ $plugin = &$view->style_plugin->row_plugin;
+ $comment = $plugin->comments[$vars['row']->{$vars['field_alias']}];
+ $node = $plugin->nodes[$comment->nid];
+ // Put the view on the node so we can retrieve it in the preprocess.
+ $node->view = &$view;
+
+ $build = comment_view_multiple(array($comment->cid => $comment), $node, $plugin->options['view_mode']);
+ // If we're displaying the comments without links, remove them from the
+ // renderable array. There is no way to avoid building them in the first
+ // place (see comment_build_content()).
+ if (empty($options['links'])) {
+ foreach ($build as $cid => &$comment_build) {
+ if (isset($comment_build['links'])) {
+ unset($comment_build['links']);
+ }
+ }
+ }
+ $vars['comment'] = drupal_render($build);
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views_default.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views_default.inc
new file mode 100644
index 0000000..44ebac9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment.views_default.inc
@@ -0,0 +1,283 @@
+<?php
+
+/**
+ * @file
+ * Bulk export of views_default objects generated by Bulk export module.
+ */
+
+/**
+ * Implementation of hook_views_default_views()
+ */
+function comment_views_default_views() {
+ $views = array();
+
+ $view = new view;
+ $view->name = 'comments_recent';
+ $view->description = 'Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.';
+ $view->tag = 'default';
+ $view->base_table = 'comment';
+ $view->human_name = 'Recent comments';
+ $view->core = 0;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['title'] = 'Recent comments';
+ $handler->display->display_options['use_more'] = TRUE;
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'some';
+ $handler->display->display_options['pager']['options']['items_per_page'] = 5;
+ $handler->display->display_options['style_plugin'] = 'list';
+ $handler->display->display_options['row_plugin'] = 'fields';
+ /* Relationship: Comment: Content */
+ $handler->display->display_options['relationships']['nid']['id'] = 'nid';
+ $handler->display->display_options['relationships']['nid']['table'] = 'comment';
+ $handler->display->display_options['relationships']['nid']['field'] = 'nid';
+ /* Field: Comment: Title */
+ $handler->display->display_options['fields']['subject']['id'] = 'subject';
+ $handler->display->display_options['fields']['subject']['table'] = 'comment';
+ $handler->display->display_options['fields']['subject']['field'] = 'subject';
+ $handler->display->display_options['fields']['subject']['label'] = '';
+ $handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
+ /* Field: Comment: Updated date */
+ $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['table'] = 'comment';
+ $handler->display->display_options['fields']['timestamp']['field'] = 'changed';
+ $handler->display->display_options['fields']['timestamp']['label'] = '';
+ $handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
+ /* Sort criterion: Comment: Updated date */
+ $handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
+ $handler->display->display_options['sorts']['timestamp']['table'] = 'comment';
+ $handler->display->display_options['sorts']['timestamp']['field'] = 'changed';
+ $handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
+ /* Filter criterion: Content: Published or admin */
+ $handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
+ $handler->display->display_options['filters']['status_extra']['table'] = 'node';
+ $handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
+ $handler->display->display_options['filters']['status_extra']['relationship'] = 'nid';
+ $handler->display->display_options['filters']['status_extra']['group'] = 0;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page');
+ $handler->display->display_options['defaults']['style_plugin'] = FALSE;
+ $handler->display->display_options['style_plugin'] = 'list';
+ $handler->display->display_options['defaults']['style_options'] = FALSE;
+ $handler->display->display_options['defaults']['row_plugin'] = FALSE;
+ $handler->display->display_options['row_plugin'] = 'fields';
+ $handler->display->display_options['row_options']['inline'] = array(
+ 'title' => 'title',
+ 'timestamp' => 'timestamp',
+ );
+ $handler->display->display_options['row_options']['separator'] = '&nbsp;';
+ $handler->display->display_options['defaults']['row_options'] = FALSE;
+ $handler->display->display_options['defaults']['fields'] = FALSE;
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['relationship'] = 'nid';
+ $handler->display->display_options['fields']['title']['label'] = 'Reply to';
+ $handler->display->display_options['fields']['title']['link_to_node'] = 1;
+ /* Field: Comment: Updated date */
+ $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['table'] = 'comment';
+ $handler->display->display_options['fields']['timestamp']['field'] = 'changed';
+ $handler->display->display_options['fields']['timestamp']['label'] = '';
+ $handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
+ /* Field: Comment: Title */
+ $handler->display->display_options['fields']['subject']['id'] = 'subject';
+ $handler->display->display_options['fields']['subject']['table'] = 'comment';
+ $handler->display->display_options['fields']['subject']['field'] = 'subject';
+ $handler->display->display_options['fields']['subject']['label'] = '';
+ $handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
+ /* Field: Comment: Comment */
+ $handler->display->display_options['fields']['comment']['id'] = 'comment';
+ $handler->display->display_options['fields']['comment']['table'] = 'field_data_comment_body';
+ $handler->display->display_options['fields']['comment']['field'] = 'comment_body';
+ $handler->display->display_options['fields']['comment']['label'] = '';
+ $handler->display->display_options['path'] = 'comments/recent';
+
+ /* Display: Block */
+ $handler = $view->new_display('block', 'Block', 'block');
+ $translatables['comments_recent'] = array(
+ t('Master'),
+ t('Recent comments'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Content'),
+ t('Page'),
+ t('Reply to'),
+ t('Block'),
+ );
+
+ $views['comments_recent'] = $view;
+
+ $view = new view;
+ $view->name = 'tracker';
+ $view->description = 'Shows all new activity on system.';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Tracker';
+ $view->core = 0;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['title'] = 'Recent posts';
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+ $handler->display->display_options['style_plugin'] = 'table';
+ $handler->display->display_options['style_options']['columns'] = array(
+ 'type' => 'type',
+ 'title' => 'title',
+ 'name' => 'name',
+ 'comment_count' => 'comment_count',
+ 'last_comment_timestamp' => 'last_comment_timestamp',
+ 'timestamp' => 'title',
+ 'new_comments' => 'comment_count',
+ );
+ $handler->display->display_options['style_options']['default'] = 'last_comment_timestamp';
+ $handler->display->display_options['style_options']['info'] = array(
+ 'type' => array(
+ 'sortable' => 1,
+ 'separator' => '',
+ ),
+ 'title' => array(
+ 'sortable' => 1,
+ 'separator' => '&nbsp;',
+ ),
+ 'name' => array(
+ 'sortable' => 1,
+ 'separator' => '',
+ ),
+ 'comment_count' => array(
+ 'sortable' => 1,
+ 'separator' => '<br />',
+ ),
+ 'last_comment_timestamp' => array(
+ 'sortable' => 1,
+ 'separator' => '&nbsp;',
+ ),
+ 'timestamp' => array(
+ 'separator' => '',
+ ),
+ 'new_comments' => array(
+ 'separator' => '',
+ ),
+ );
+ $handler->display->display_options['style_options']['override'] = 1;
+ $handler->display->display_options['style_options']['order'] = 'desc';
+ /* Relationship: Content: Author */
+ $handler->display->display_options['relationships']['uid']['id'] = 'uid';
+ $handler->display->display_options['relationships']['uid']['table'] = 'node';
+ $handler->display->display_options['relationships']['uid']['field'] = 'uid';
+ /* Field: Content: Type */
+ $handler->display->display_options['fields']['type']['id'] = 'type';
+ $handler->display->display_options['fields']['type']['table'] = 'node';
+ $handler->display->display_options['fields']['type']['field'] = 'type';
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ /* Field: User: Name */
+ $handler->display->display_options['fields']['name']['id'] = 'name';
+ $handler->display->display_options['fields']['name']['table'] = 'users';
+ $handler->display->display_options['fields']['name']['field'] = 'name';
+ $handler->display->display_options['fields']['name']['relationship'] = 'uid';
+ $handler->display->display_options['fields']['name']['label'] = 'Author';
+ /* Field: Content: Comment count */
+ $handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
+ $handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
+ $handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
+ $handler->display->display_options['fields']['comment_count']['label'] = 'Replies';
+ /* Field: Content: Last comment time */
+ $handler->display->display_options['fields']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
+ $handler->display->display_options['fields']['last_comment_timestamp']['table'] = 'node_comment_statistics';
+ $handler->display->display_options['fields']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
+ $handler->display->display_options['fields']['last_comment_timestamp']['label'] = 'Last Post';
+ /* Field: Content: Has new content */
+ $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['table'] = 'history';
+ $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['label'] = '';
+ $handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
+ $handler->display->display_options['fields']['timestamp']['comments'] = 1;
+ /* Field: Content: New comments */
+ $handler->display->display_options['fields']['new_comments']['id'] = 'new_comments';
+ $handler->display->display_options['fields']['new_comments']['table'] = 'node';
+ $handler->display->display_options['fields']['new_comments']['field'] = 'new_comments';
+ $handler->display->display_options['fields']['new_comments']['label'] = '';
+ $handler->display->display_options['fields']['new_comments']['hide_empty'] = TRUE;
+ $handler->display->display_options['fields']['new_comments']['suffix'] = ' new';
+ $handler->display->display_options['fields']['new_comments']['link_to_comment'] = 1;
+ /* Sort criterion: Content: Last comment time */
+ $handler->display->display_options['sorts']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
+ $handler->display->display_options['sorts']['last_comment_timestamp']['table'] = 'node_comment_statistics';
+ $handler->display->display_options['sorts']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
+ /* Contextual filter: Content: User posted or commented */
+ $handler->display->display_options['arguments']['uid_touch']['id'] = 'uid_touch';
+ $handler->display->display_options['arguments']['uid_touch']['table'] = 'node';
+ $handler->display->display_options['arguments']['uid_touch']['field'] = 'uid_touch';
+ $handler->display->display_options['arguments']['uid_touch']['exception']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['uid_touch']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['uid_touch']['title'] = 'Recent posts for %1';
+ $handler->display->display_options['arguments']['uid_touch']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['uid_touch']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['uid_touch']['specify_validation'] = 1;
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = '1';
+ $handler->display->display_options['filters']['status']['group'] = 0;
+ $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page');
+ $handler->display->display_options['path'] = 'tracker';
+ $handler->display->display_options['menu']['type'] = 'normal';
+ $handler->display->display_options['menu']['title'] = 'Recent posts';
+ $translatables['tracker'] = array(
+ t('Master'),
+ t('Recent posts'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('Type'),
+ t('Title'),
+ t('Author'),
+ t('Replies'),
+ t('.'),
+ t(','),
+ t('Last Post'),
+ t(' new'),
+ t('All'),
+ t('Recent posts for %1'),
+ t('Page'),
+ );
+
+ $views['tracker'] = $view;
+
+ return $views;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_argument_comment_user_uid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_argument_comment_user_uid.inc
new file mode 100644
index 0000000..11144a9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_argument_comment_user_uid.inc
@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * Argument handler to accept a user id to check for nodes that
+ * user posted or commented on.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_comment_user_uid extends views_handler_argument {
+ function title() {
+ if (!$this->argument) {
+ $title = variable_get('anonymous', t('Anonymous'));
+ }
+ else {
+ $title = db_query('SELECT u.name FROM {users} u WHERE u.uid = :uid', array(':uid' => $this->argument))->fetchField();
+ }
+ if (empty($title)) {
+ return t('No user');
+ }
+
+ return check_plain($title);
+ }
+
+ function default_actions($which = NULL) {
+ // Disallow summary views on this argument.
+ if (!$which) {
+ $actions = parent::default_actions();
+ unset($actions['summary asc']);
+ unset($actions['summary desc']);
+ return $actions;
+ }
+
+ if ($which != 'summary asc' && $which != 'summary desc') {
+ return parent::default_actions($which);
+ }
+ }
+
+ function query($group_by = FALSE) {
+ $this->ensure_my_table();
+
+ $subselect = db_select('comment', 'c');
+ $subselect->addField('c', 'cid');
+ $subselect->condition('c.uid', $this->argument);
+ $subselect->where("c.nid = $this->table_alias.nid");
+
+ $condition = db_or()
+ ->condition("$this->table_alias.uid", $this->argument, '=')
+ ->exists($subselect);
+
+ $this->query->add_where(0, $condition);
+ }
+
+ function get_sort_name() {
+ return t('Numerical', array(), array('context' => 'Sort order'));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment.inc
new file mode 100644
index 0000000..b855b63
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment.inc
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Field handler to allow linking to a comment.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment extends views_handler_field {
+ /**
+ * Override init function to provide generic option to link to comment.
+ */
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ if (!empty($this->options['link_to_comment'])) {
+ $this->additional_fields['cid'] = 'cid';
+ $this->additional_fields['nid'] = 'nid';
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_comment'] = array('default' => TRUE);
+ $options['link_to_node'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ /**
+ * Provide link-to-comment option
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_comment'] = array(
+ '#title' => t('Link this field to its comment'),
+ '#description' => t("Enable to override this field's links."),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['link_to_comment'],
+ );
+ $form['link_to_node'] = array(
+ '#title' => t('Link field to the node if there is no comment.'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['link_to_node'],
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_comment'])) {
+ $this->options['alter']['make_link'] = TRUE;
+ $nid = $this->get_value($values, 'nid');
+ $cid = $this->get_value($values, 'cid');
+ if (!empty($cid)) {
+ $this->options['alter']['path'] = "comment/" . $cid;
+ $this->options['alter']['fragment'] = "comment-" . $cid;
+ }
+ // If there is no comment link to the node.
+ else if ($this->options['link_to_node']) {
+ $this->options['alter']['path'] = "node/" . $nid;
+ }
+ }
+
+ return $data;
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc
new file mode 100644
index 0000000..8872a6a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Field handler to display the depth of a comment.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_depth extends views_handler_field {
+ /**
+ * Work out the depth of this comment
+ */
+ function render($values) {
+ $comment_thread = $this->get_value($values);
+ return count(explode('.', $comment_thread)) - 1;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link.inc
new file mode 100644
index 0000000..e0e0ba7
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link.inc
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Base field handler to present a link.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_link extends views_handler_field_entity {
+ function construct() {
+ parent::construct();
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['text'] = array('default' => '', 'translatable' => TRUE);
+ $options['link_to_node'] = array('default' => FALSE);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['text'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Text to display'),
+ '#default_value' => $this->options['text'],
+ );
+ $form['link_to_node'] = array(
+ '#title' => t('Link field to the node if there is no comment.'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['link_to_node'],
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function render($values) {
+ $value = $this->get_value($values, 'cid');
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+
+ function render_link($data, $values) {
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
+ $comment = $this->get_value($values);
+ $nid = $comment->nid;
+ $cid = $comment->cid;
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['html'] = TRUE;
+
+ if (!empty($cid)) {
+ $this->options['alter']['path'] = "comment/" . $cid;
+ $this->options['alter']['fragment'] = "comment-" . $cid;
+ }
+ // If there is no comment link to the node.
+ else if ($this->options['link_to_node']) {
+ $this->options['alter']['path'] = "node/" . $nid;
+ }
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_approve.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_approve.inc
new file mode 100644
index 0000000..8063e20
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_approve.inc
@@ -0,0 +1,31 @@
+<?php
+/**
+ * @file
+ * Provides a comment approve link.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_link_approve extends views_handler_field_comment_link {
+ function access() {
+ //needs permission to administer comments in general
+ return user_access('administer comments');
+ }
+
+ function render_link($data, $values) {
+ $status = $this->get_value($values, 'status');
+
+ // Don't show an approve link on published nodes.
+ if ($status == COMMENT_PUBLISHED) {
+ return;
+ }
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('approve');
+ $cid = $this->get_value($values, 'cid');
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "comment/" . $cid . "/approve";
+ $this->options['alter']['query'] = drupal_get_destination() + array('token' => drupal_get_token("comment/$cid/approve"));
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_delete.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_delete.inc
new file mode 100644
index 0000000..b74661b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_delete.inc
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Field handler to present a link to delete a node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_link_delete extends views_handler_field_comment_link {
+ function access() {
+ //needs permission to administer comments in general
+ return user_access('administer comments');
+ }
+
+ function render_link($data, $values) {
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
+ $cid = $this->get_value($values, 'cid');
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "comment/" . $cid . "/delete";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_edit.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_edit.inc
new file mode 100644
index 0000000..ffd1f93
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_edit.inc
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Field handler to present a link node edit.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_link_edit extends views_handler_field_comment_link {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['destination'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $form['destination'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Use destination'),
+ '#description' => t('Add destination to the link'),
+ '#default_value' => $this->options['destination'],
+ '#fieldset' => 'more',
+ );
+ }
+
+ function render_link($data, $values) {
+ parent::render_link($data, $values);
+ // ensure user has access to edit this comment.
+ $comment = $this->get_value($values);
+ if (!comment_access('edit', $comment)) {
+ return;
+ }
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
+ unset($this->options['alter']['fragment']);
+
+ if (!empty($this->options['destination'])) {
+ $this->options['alter']['query'] = drupal_get_destination();
+ }
+
+ $this->options['alter']['path'] = "comment/" . $comment->cid . "/edit";
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_reply.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_reply.inc
new file mode 100644
index 0000000..1564164
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_link_reply.inc
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Field handler to present a link to delete a node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_link_reply extends views_handler_field_comment_link {
+ function access() {
+ //check for permission to reply to comments
+ return user_access('post comments');
+ }
+
+ function render_link($data, $values) {
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('reply');
+ $nid = $this->get_value($values, 'nid');
+ $cid = $this->get_value($values, 'cid');
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "comment/reply/" . $nid . '/' . $cid;
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_node_link.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_node_link.inc
new file mode 100644
index 0000000..0e4f610
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_node_link.inc
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Handler for showing comment module's node link.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_node_link extends views_handler_field_entity {
+ function construct() {
+ parent::construct();
+
+ // Add the node fields that comment_link will need..
+ $this->additional_fields['nid'] = array(
+ 'field' => 'nid',
+ );
+ $this->additional_fields['type'] = array(
+ 'field' => 'type',
+ );
+ $this->additional_fields['comment'] = array(
+ 'field' => 'comment',
+ );
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['teaser'] = array('default' => 0);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['teaser'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Show teaser-style link'),
+ '#default_value' => $this->options['teaser'],
+ '#description' => t('Show the comment link in the form used on standard node teasers, rather than the full node form.'),
+ '#fieldset' => 'more',
+ );
+
+ parent::options_form($form, $form_state);
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function render($values) {
+ // Build fake $node.
+ $node = $this->get_value($values);
+
+ // Call comment.module's hook_link: comment_link($type, $node = NULL, $teaser = FALSE)
+ // Call node by reference so that something is changed here
+ comment_node_view($node, $this->options['teaser'] ? 'teaser' : 'full');
+ // question: should we run these through: drupal_alter('link', $links, $node);
+ // might this have unexpected consequences if these hooks expect items in $node that we don't have?
+
+ // Only render the links, if they are defined.
+ return !empty($node->content['links']['comment']) ? drupal_render($node->content['links']['comment']) : '';
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_username.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_username.inc
new file mode 100644
index 0000000..6b6186e
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_username.inc
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Field handler to allow linking to a user account or homepage.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_comment_username extends views_handler_field {
+ /**
+ * Override init function to add uid and homepage fields.
+ */
+ function init(&$view, &$data) {
+ parent::init($view, $data);
+ $this->additional_fields['uid'] = 'uid';
+ $this->additional_fields['homepage'] = 'homepage';
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_user'] = array('default' => TRUE);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['link_to_user'] = array(
+ '#title' => t("Link this field to its user or an author's homepage"),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['link_to_user'],
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_user'])) {
+ $account = new stdClass();
+ $account->uid = $this->get_value($values, 'uid');
+ $account->name = $this->get_value($values);
+ $account->homepage = $this->get_value($values, 'homepage');
+
+ return theme('username', array(
+ 'account' => $account
+ ));
+ }
+ else {
+ return $data;
+ }
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc
new file mode 100644
index 0000000..2bfa970
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * Field handler to display the timestamp of a comment with the count of comments.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_last_comment_timestamp extends views_handler_field_date {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['comment_count'] = 'comment_count';
+ }
+
+ function render($values) {
+ $comment_count = $this->get_value($values, 'comment_count');
+ if (empty($this->options['empty_zero']) || $comment_count) {
+ return parent::render($values);
+ }
+ else {
+ return NULL;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_comment_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_comment_name.inc
new file mode 100644
index 0000000..63f948f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_comment_name.inc
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * Field handler to present the name of the last comment poster.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_ncs_last_comment_name extends views_handler_field {
+ function query() {
+ // last_comment_name only contains data if the user is anonymous. So we
+ // have to join in a specially related user table.
+ $this->ensure_my_table();
+ // join 'users' to this table via vid
+ $join = new views_join();
+ $join->construct('users', $this->table_alias, 'last_comment_uid', 'uid');
+ $join->extra = array(array('field' => 'uid', 'operator' => '!=', 'value' => '0'));
+
+ // ncs_user alias so this can work with the sort handler, below.
+// $this->user_table = $this->query->add_relationship(NULL, $join, 'users', $this->relationship);
+ $this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join);
+
+ $this->field_alias = $this->query->add_field(NULL, "COALESCE($this->user_table.name, $this->table_alias.$this->field)", $this->table_alias . '_' . $this->field);
+
+ $this->user_field = $this->query->add_field($this->user_table, 'name');
+ $this->uid = $this->query->add_field($this->table_alias, 'last_comment_uid');
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['link_to_user'] = array('default' => TRUE);
+
+ return $options;
+ }
+
+ function render($values) {
+ if (!empty($this->options['link_to_user'])) {
+ $account = new stdClass();
+ $account->name = $this->get_value($values);
+ $account->uid = $values->{$this->uid};
+ return theme('username', array(
+ 'account' => $account
+ ));
+ }
+ else {
+ return $this->sanitize_value($this->get_value($values));
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_updated.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_updated.inc
new file mode 100644
index 0000000..3950ffb
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_ncs_last_updated.inc
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Field handler to display the newer of last comment / node updated.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_ncs_last_updated extends views_handler_field_date {
+ function query() {
+ $this->ensure_my_table();
+ $this->node_table = $this->query->ensure_table('node', $this->relationship);
+ $this->field_alias = $this->query->add_field(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)", $this->table_alias . '_' . $this->field);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_comment.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_comment.inc
new file mode 100644
index 0000000..6892fed
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_comment.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Display node comment status.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_comment extends views_handler_field {
+ function render($values) {
+ $value = $this->get_value($values);
+ switch ($value) {
+ case COMMENT_NODE_HIDDEN:
+ default:
+ return t('Hidden');
+ case COMMENT_NODE_CLOSED:
+ return t('Closed');
+ case COMMENT_NODE_OPEN:
+ return t('Open');
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_new_comments.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_new_comments.inc
new file mode 100644
index 0000000..0ecdfc6
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_node_new_comments.inc
@@ -0,0 +1,110 @@
+<?php
+
+/**
+ * Field handler to display the number of new comments.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_new_comments extends views_handler_field_numeric {
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+
+ // translate an older setting:
+ if (!empty($options['no_empty'])) {
+ $this->options['hide_empty'] = TRUE;
+ unset($this->options['no_empty']);
+ }
+ }
+
+ function construct() {
+ parent::construct();
+ $this->additional_fields['nid'] = 'nid';
+ $this->additional_fields['type'] = 'type';
+ $this->additional_fields['comment_count'] = array('table' => 'node_comment_statistics', 'field' => 'comment_count');
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['link_to_comment'] = array('default' => TRUE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['link_to_comment'] = array(
+ '#title' => t('Link this field to new comments'),
+ '#description' => t("Enable to override this field's links."),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['link_to_comment'],
+ );
+
+ parent::options_form($form, $form_state);
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ $this->field_alias = $this->table . '_' . $this->field;
+ }
+
+ function pre_render(&$values) {
+ global $user;
+ if (!$user->uid || empty($values)) {
+ return;
+ }
+
+ $nids = array();
+ $ids = array();
+ foreach ($values as $id => $result) {
+ $nids[] = $result->{$this->aliases['nid']};
+ $values[$id]->{$this->field_alias} = 0;
+ // Create a reference so we can find this record in the values again.
+ if (empty($ids[$result->{$this->aliases['nid']}])) {
+ $ids[$result->{$this->aliases['nid']}] = array();
+ }
+ $ids[$result->{$this->aliases['nid']}][] = $id;
+ }
+
+ if ($nids) {
+ $result = db_query("SELECT n.nid, COUNT(c.cid) as num_comments FROM {node} n INNER JOIN {comment} c ON n.nid = c.nid
+ LEFT JOIN {history} h ON h.nid = n.nid AND h.uid = :h_uid WHERE n.nid IN (:nids)
+ AND c.changed > GREATEST(COALESCE(h.timestamp, :timestamp), :timestamp) AND c.status = :status GROUP BY n.nid ", array(
+ ':status' => COMMENT_PUBLISHED,
+ ':h_uid' => $user->uid,
+ ':nids' => $nids,
+ ':timestamp' => NODE_NEW_LIMIT,
+ ));
+
+ foreach ($result as $node) {
+ foreach ($ids[$node->nid] as $id) {
+ $values[$id]->{$this->field_alias} = $node->num_comments;
+ }
+ }
+ }
+ }
+
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_comment']) && $data !== NULL && $data !== '') {
+ $node = new stdClass();
+ $node->nid = $this->get_value($values, 'nid');
+ $node->type = $this->get_value($values, 'type');
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = 'node/' . $node->nid;
+ $this->options['alter']['query'] = comment_new_page_count($this->get_value($values, 'comment_count'), $this->get_value($values), $node);
+ $this->options['alter']['fragment'] = 'new';
+ }
+
+ return $data;
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ if (!empty($value)) {
+ return $this->render_link(parent::render($values), $values);
+ }
+ else {
+ $this->options['alter']['make_link'] = FALSE;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc
new file mode 100644
index 0000000..4f9e711
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Filter handler to accept a user id to check for nodes that user posted or
+ * commented on.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_comment_user_uid extends views_handler_filter_user_name {
+ function query() {
+ $this->ensure_my_table();
+
+ $subselect = db_select('comment', 'c');
+ $subselect->addField('c', 'cid');
+ $subselect->condition('c.uid', $this->value, $this->operator);
+ $subselect->where("c.nid = $this->table_alias.nid");
+
+ $condition = db_or()
+ ->condition("$this->table_alias.uid", $this->value, $this->operator)
+ ->exists($subselect);
+
+ $this->query->add_where($this->options['group'], $condition);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc
new file mode 100644
index 0000000..3818db9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Filter handler for the newer of last comment / node updated
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_ncs_last_updated extends views_handler_filter_date {
+ function query() {
+ $this->ensure_my_table();
+ $this->node_table = $this->query->ensure_table('node', $this->relationship);
+
+ $field = "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)";
+
+ $info = $this->operators();
+ if (!empty($info[$this->operator]['method'])) {
+ $this->{$info[$this->operator]['method']}($field);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_node_comment.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_node_comment.inc
new file mode 100644
index 0000000..659eaa6
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_node_comment.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Filter based on comment node status
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_comment extends views_handler_filter_in_operator {
+ function get_value_options() {
+ $this->value_options = array(
+ COMMENT_NODE_HIDDEN => t('Hidden'),
+ COMMENT_NODE_CLOSED => t('Closed'),
+ COMMENT_NODE_OPEN => t('Open'),
+ );
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_comment_thread.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_comment_thread.inc
new file mode 100644
index 0000000..e529b2a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_comment_thread.inc
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Sort handler for ordering by thread
+ */
+class views_handler_sort_comment_thread extends views_handler_sort {
+ function query() {
+ $this->ensure_my_table();
+
+ //Read comment_render() in comment.module for an explanation of the
+ //thinking behind this sort.
+ if ($this->options['order'] == 'DESC') {
+ $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);
+ }
+ else {
+ $alias = $this->table_alias . '_' . $this->real_field . 'asc';
+ //@todo is this secure?
+ $this->query->add_orderby(NULL, "SUBSTRING({$this->table_alias}.{$this->real_field}, 1, (LENGTH({$this->table_alias}.{$this->real_field}) - 1))", $this->options['order'], $alias);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_comment_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_comment_name.inc
new file mode 100644
index 0000000..8eca177
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_comment_name.inc
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Sort handler to sort by last comment name which might be in 2 different
+ * fields.
+ *
+ * @ingroup views_sort_handlers
+ */
+class views_handler_sort_ncs_last_comment_name extends views_handler_sort {
+ function query() {
+ $this->ensure_my_table();
+ $join = new views_join();
+ $join->construct('users', $this->table_alias, 'last_comment_uid', 'uid');
+
+ // @todo this might be safer if we had an ensure_relationship rather than guessing
+ // the table alias. Though if we did that we'd be guessing the relationship name
+ // so that doesn't matter that much.
+// $this->user_table = $this->query->add_relationship(NULL, $join, 'users', $this->relationship);
+ $this->user_table = $this->query->ensure_table('ncs_users', $this->relationship, $join);
+ $this->user_field = $this->query->add_field($this->user_table, 'name');
+
+ // Add the field.
+ $this->query->add_orderby(NULL, "LOWER(COALESCE($this->user_table.name, $this->table_alias.$this->field))", $this->options['order'], $this->table_alias . '_' . $this->field);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_updated.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_updated.inc
new file mode 100644
index 0000000..04b01a1
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_sort_ncs_last_updated.inc
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Sort handler for the newer of last comment / node updated.
+ *
+ * @ingroup views_sort_handlers
+ */
+class views_handler_sort_ncs_last_updated extends views_handler_sort_date {
+ function query() {
+ $this->ensure_my_table();
+ $this->node_table = $this->query->ensure_table('node', $this->relationship);
+ $this->field_alias = $this->query->add_orderby(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)", $this->options['order'], $this->table_alias . '_' . $this->field);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_rss.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_rss.inc
new file mode 100644
index 0000000..7576bb5
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_rss.inc
@@ -0,0 +1,151 @@
+<?php
+/**
+ * @file
+ * Contains the comment RSS row style plugin.
+ */
+
+/**
+ * Plugin which formats the comments as RSS items.
+ */
+class views_plugin_row_comment_rss extends views_plugin_row {
+ var $base_table = 'comment';
+ var $base_field = 'cid';
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['item_length'] = array('default' => 'default');
+ $options['links'] = FALSE;
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $form['item_length'] = array(
+ '#type' => 'select',
+ '#title' => t('Display type'),
+ '#options' => $this->options_form_summary_options(),
+ '#default_value' => $this->options['item_length'],
+ );
+ $form['links'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display links'),
+ '#default_value' => $this->options['links'],
+ );
+ }
+
+
+ function pre_render($result) {
+ $cids = array();
+ $nids = array();
+
+ foreach ($result as $row) {
+ $cids[] = $row->cid;
+ }
+
+ $this->comments = comment_load_multiple($cids);
+ foreach ($this->comments as &$comment) {
+ $comment->depth = count(explode('.', $comment->thread)) - 1;
+ $nids[] = $comment->nid;
+ }
+
+ $this->nodes = node_load_multiple($nids);
+ }
+
+ /**
+ * Return the main options, which are shown in the summary title
+ *
+ * @see views_plugin_row_node_rss::options_form_summary_options()
+ * @todo: Maybe provide a views_plugin_row_rss_entity and reuse this method
+ * in views_plugin_row_comment|node_rss.inc
+ */
+ function options_form_summary_options() {
+ $entity_info = entity_get_info('node');
+ $options = array();
+ if (!empty($entity_info['view modes'])) {
+ foreach ($entity_info['view modes'] as $mode => $settings) {
+ $options[$mode] = $settings['label'];
+ }
+ }
+ $options['title'] = t('Title only');
+ $options['default'] = t('Use site default RSS settings');
+ return $options;
+ }
+
+
+ function render($row) {
+ global $base_url;
+
+ $cid = $row->{$this->field_alias};
+ if (!is_numeric($cid)) {
+ return;
+ }
+
+ $item_length = $this->options['item_length'];
+ if ($item_length == 'default') {
+ $item_length = variable_get('feed_item_length', 'teaser');
+ }
+
+ // Load the specified comment and its associated node:
+ $comment = $this->comments[$cid];
+ if (empty($comment) || empty($this->nodes[$comment->nid])) {
+ return;
+ }
+
+ $item_text = '';
+
+ $uri = entity_uri('comment', $comment);
+ $comment->link = url($uri['path'], $uri['options'] + array('absolute' => TRUE));
+ $comment->rss_namespaces = array();
+ $comment->rss_elements = array(
+ array(
+ 'key' => 'pubDate',
+ 'value' => gmdate('r', $comment->created),
+ ),
+ array(
+ 'key' => 'dc:creator',
+ 'value' => $comment->name,
+ ),
+ array(
+ 'key' => 'guid',
+ 'value' => 'comment ' . $comment->cid . ' at ' . $base_url,
+ 'attributes' => array('isPermaLink' => 'false'),
+ ),
+ );
+
+ // The comment gets built and modules add to or modify
+ // $comment->rss_elements and $comment->rss_namespaces.
+ $build = comment_view($comment, $this->nodes[$comment->nid], 'rss');
+ unset($build['#theme']);
+
+ if (!empty($comment->rss_namespaces)) {
+ $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $comment->rss_namespaces);
+ }
+
+ // Hide the links if desired.
+ if (!$this->options['links']) {
+ hide($build['links']);
+ }
+
+ if ($item_length != 'title') {
+ // We render comment contents and force links to be last.
+ $build['links']['#weight'] = 1000;
+ $item_text .= drupal_render($build);
+ }
+
+ $item = new stdClass();
+ $item->description = $item_text;
+ $item->title = $comment->subject;
+ $item->link = $comment->link;
+ $item->elements = $comment->rss_elements;
+ $item->cid = $comment->cid;
+
+ return theme($this->theme_functions(), array(
+ 'view' => $this->view,
+ 'options' => $this->options,
+ 'row' => $item
+ ));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_view.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_view.inc
new file mode 100644
index 0000000..284fa5f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_plugin_row_comment_view.inc
@@ -0,0 +1,96 @@
+<?php
+/**
+ * @file
+ * Contains the node RSS row style plugin.
+ */
+
+/**
+ * Plugin which performs a comment_view on the resulting object.
+ */
+class views_plugin_row_comment_view extends views_plugin_row {
+ var $base_field = 'cid';
+ var $base_table = 'comment';
+
+ /**
+ * Stores all comments which are preloaded.
+ */
+ var $comments = array();
+
+ /**
+ * Stores all nodes of all comments which are preloaded.
+ */
+ var $nodes = array();
+
+ function summary_title() {
+ return t('Settings');
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['links'] = array('default' => TRUE);
+ $options['view_mode'] = array('default' => 'full');
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $options = $this->options_form_summary_options();
+ $form['view_mode'] = array(
+ '#type' => 'select',
+ '#options' => $options,
+ '#title' => t('View mode'),
+ '#default_value' => $this->options['view_mode'],
+ );
+
+ $form['links'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display links'),
+ '#default_value' => $this->options['links'],
+ );
+ }
+
+
+ /**
+ * Return the main options, which are shown in the summary title.
+ */
+ function options_form_summary_options() {
+ $entity_info = entity_get_info('comment');
+ $options = array();
+ if (!empty($entity_info['view modes'])) {
+ foreach ($entity_info['view modes'] as $mode => $settings) {
+ $options[$mode] = $settings['label'];
+ }
+ }
+ if (empty($options)) {
+ $options = array(
+ 'full' => t('Full content')
+ );
+ }
+
+ return $options;
+ }
+
+ function pre_render($result) {
+ $cids = array();
+
+ foreach ($result as $row) {
+ $cids[] = $row->cid;
+ }
+
+ // Load all comments.
+ $cresult = comment_load_multiple($cids);
+ $nids = array();
+ foreach ($cresult as $comment) {
+ $comment->depth = count(explode('.', $comment->thread)) - 1;
+ $this->comments[$comment->cid] = $comment;
+ $nids[] = $comment->nid;
+ }
+
+ // Load all nodes of the comments.
+ $nodes = node_load_multiple(array_unique($nids));
+ foreach ($nodes as $node) {
+ $this->nodes[$node->nid] = $node;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact.views.inc
new file mode 100644
index 0000000..85bcb94
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact.views.inc
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for contact.module
+ */
+
+function contact_views_data() {
+ $data['users']['contact'] = array(
+ 'field' => array(
+ 'title' => t('Link to contact page'),
+ 'help' => t('Provide a simple link to the user contact page.'),
+ 'handler' => 'views_handler_field_contact_link',
+ ),
+ );
+ return $data;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact/views_handler_field_contact_link.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact/views_handler_field_contact_link.inc
new file mode 100644
index 0000000..0a44f21
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/contact/views_handler_field_contact_link.inc
@@ -0,0 +1,51 @@
+<?php
+/**
+ * A field that links to the user contact page, if access is permitted.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_contact_link extends views_handler_field_user_link {
+
+ function options_form(&$form, &$form_state) {
+ $form['text']['#title'] = t('Link label');
+ $form['text']['#required'] = TRUE;
+ $form['text']['#default_value'] = empty($this->options['text']) ? t('contact') : $this->options['text'];
+ parent::options_form($form, $form_state);
+ }
+
+ // An example of field level access control.
+ // We must override the access method in the parent class, as that requires
+ // the 'access user profiles' permission, which the contact form does not.
+ function access() {
+ return user_access('access user contact forms');
+ }
+
+ function render_link($data, $values) {
+ global $user;
+ $uid = $this->get_value($values, 'uid');
+
+ if (empty($uid)) {
+ return;
+ }
+
+ $account = user_load($uid);
+ if (empty($account)) {
+ return;
+ }
+
+ // Check access when we pull up the user account so we know
+ // if the user has made the contact page available.
+ $menu_item = menu_get_item("user/$uid/contact");
+ if (!$menu_item['access'] || empty($account->data['contact'])) {
+ return;
+ }
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = 'user/' . $account->uid . '/contact';
+ $this->options['alter']['attributes'] = array('title' => t('Contact %user', array('%user' => $account->name)));
+
+ $text = $this->options['text'];
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field.views.inc
new file mode 100644
index 0000000..dd4363f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field.views.inc
@@ -0,0 +1,429 @@
+<?php
+
+/**
+ * @file
+ * Provide Views data and handlers for field.module
+ */
+
+/**
+ * @defgroup views_field_module field.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ *
+ * Field modules can implement hook_field_views_data() to override
+ * the default behavior for adding fields.
+ */
+function field_views_data() {
+ $data = array();
+ foreach (field_info_fields() as $field) {
+ if ($field['storage']['type'] != 'field_sql_storage') {
+ continue;
+ }
+
+ $module = $field['module'];
+ $result = (array) module_invoke($module, 'field_views_data', $field);
+
+ if (empty($result)) {
+ $result = field_views_field_default_views_data($field);
+ }
+ drupal_alter('field_views_data', $result, $field, $module);
+
+ if (is_array($result)) {
+ $data = drupal_array_merge_deep($result, $data);
+ }
+ }
+
+ return $data;
+}
+
+/**
+ * Implements hook_views_data_alter()
+ *
+ * Field modules can implement hook_field_views_data_views_data_alter() to
+ * alter the views data on a per field basis. This is weirdly named so as
+ * not to conflict with the drupal_alter('field_views_data') in
+ * field_views_data.
+ */
+function field_views_data_alter(&$data) {
+ foreach (field_info_fields() as $field) {
+ if ($field['storage']['type'] != 'field_sql_storage') {
+ continue;
+ }
+
+ $function = $field['module'] . '_field_views_data_views_data_alter';
+ if (function_exists($function)) {
+ $function($data, $field);
+ }
+ }
+}
+
+/**
+ * Returns the label of a certain field.
+ *
+ * Therefore it looks up in all bundles to find the most used instance.
+ */
+function field_views_field_label($field_name) {
+ $label_counter = array();
+ $all_labels = array();
+ // Count the amount of instances per label per field.
+ $instances = field_info_instances();
+ foreach ($instances as $entity_name => $entity_type) {
+ foreach ($entity_type as $bundle) {
+ if (isset($bundle[$field_name])) {
+ $label_counter[$bundle[$field_name]['label']] = isset($label_counter[$bundle[$field_name]['label']]) ? ++$label_counter[$bundle[$field_name]['label']] : 1;
+ $all_labels[$entity_name][$bundle[$field_name]['label']] = TRUE;
+ }
+ }
+ }
+ if (empty($label_counter)) {
+ return array($field_name, $all_labels);
+ }
+ // Sort the field lables by it most used label and return the most used one.
+ arsort($label_counter);
+ $label_counter = array_keys($label_counter);
+ return array($label_counter[0], $all_labels);
+}
+
+/**
+ * Default views data implementation for a field.
+ */
+function field_views_field_default_views_data($field) {
+ $field_types = field_info_field_types();
+
+ // Check the field module is available.
+ if (!isset($field_types[$field['type']])) {
+ return;
+ }
+
+ $data = array();
+
+ $current_table = _field_sql_storage_tablename($field);
+ $revision_table = _field_sql_storage_revision_tablename($field);
+
+ // The list of entity:bundle that this field is used in.
+ $bundles_names = array();
+ $supports_revisions = FALSE;
+ $entity_tables = array();
+ $current_tables = array();
+ $revision_tables = array();
+ $groups = array();
+
+ $group_name = count($field['bundles']) > 1 ? t('Field') : NULL;
+
+ // Build the relationships between the field table and the entity tables.
+ foreach ($field['bundles'] as $entity => $bundles) {
+ $entity_info = entity_get_info($entity);
+ $groups[$entity] = $entity_info['label'];
+
+ // Override Node to Content.
+ if ($groups[$entity] == t('Node')) {
+ $groups[$entity] = t('Content');
+ }
+
+ // If only one bundle use this as the default name.
+ if (empty($group_name)) {
+ $group_name = $groups[$entity];
+ }
+
+ $entity_tables[$entity_info['base table']] = $entity;
+ $current_tables[$entity] = $entity_info['base table'];
+ if (isset($entity_info['revision table'])) {
+ $entity_tables[$entity_info['revision table']] = $entity;
+ $revision_tables[$entity] = $entity_info['revision table'];
+ }
+
+ $data[$current_table]['table']['join'][$entity_info['base table']] = array(
+ 'left_field' => $entity_info['entity keys']['id'],
+ 'field' => 'entity_id',
+ 'extra' => array(
+ array('field' => 'entity_type', 'value' => $entity),
+ array('field' => 'deleted', 'value' => 0, 'numeric' => TRUE),
+ ),
+ );
+
+ if (!empty($entity_info['entity keys']['revision']) && !empty($entity_info['revision table'])) {
+ $data[$revision_table]['table']['join'][$entity_info['revision table']] = array(
+ 'left_field' => $entity_info['entity keys']['revision'],
+ 'field' => 'revision_id',
+ 'extra' => array(
+ array('field' => 'entity_type', 'value' => $entity),
+ array('field' => 'deleted', 'value' => 0, 'numeric' => TRUE),
+ ),
+ );
+
+ $supports_revisions = TRUE;
+ }
+
+ foreach ($bundles as $bundle) {
+ $bundles_names[] = t('@entity:@bundle', array('@entity' => $entity, '@bundle' => $bundle));
+ }
+ }
+
+ $tables = array();
+ $tables[FIELD_LOAD_CURRENT] = $current_table;
+ if ($supports_revisions) {
+ $tables[FIELD_LOAD_REVISION] = $revision_table;
+ }
+
+ $add_fields = array('delta', 'language', 'bundle');
+ foreach ($field['columns'] as $column_name => $attributes) {
+ $add_fields[] = _field_sql_storage_columnname($field['field_name'], $column_name);
+ }
+
+ // Note: we don't have a label available here, because we are at the field
+ // level, not at the instance level. So we just go through all instances
+ // and take the one which is used the most frequently.
+ $field_name = $field['field_name'];
+ list($label, $all_labels) = field_views_field_label($field_name);
+ foreach ($tables as $type => $table) {
+ if ($type == FIELD_LOAD_CURRENT) {
+ $group = $group_name;
+ $old_column = 'entity_id';
+ $column = $field['field_name'];
+ }
+ else {
+ $group = t('@group (historical data)', array('@group' => $group_name));
+ $old_column = 'revision_id';
+ $column = $field['field_name'] . '-' . $old_column;
+ }
+
+ $data[$table][$old_column]['field']['moved to'] = array($table, $column);
+ $data[$table][$column] = array(
+ 'group' => $group,
+ 'title' => $label,
+ 'title short' => $label,
+ 'help' => t('Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),
+ );
+
+ // Go through and create a list of aliases for all possible combinations of
+ // entity type + name.
+ $aliases = array();
+ $also_known = array();
+ foreach ($all_labels as $entity_name => $labels) {
+ foreach ($labels as $label_name => $true) {
+ if ($type == FIELD_LOAD_CURRENT) {
+ if ($group_name != $groups[$entity_name] || $label != $label_name) {
+ $aliases[] = array(
+ 'base' => $current_tables[$entity_name],
+ 'group' => $groups[$entity_name],
+ 'title' => $label_name,
+ 'help' => t('This is an alias of @group: @field.', array('@group' => $group_name, '@field' => $label)),
+ );
+ }
+ $also_known[] = t('@group: @field', array('@group' => $groups[$entity_name], '@field' => $label_name));
+ }
+ else {
+ if ($group_name != $groups[$entity_name] && $label != $label_name && isset($revision_tables[$entity_name])) {
+ $aliases[] = array(
+ 'base' => $revision_tables[$entity_name],
+ 'group' => t('@group (historical data)', array('@group' => $groups[$entity_name])),
+ 'title' => $label_name,
+ 'help' => t('This is an alias of @group: @field.', array('@group' => $group_name, '@field' => $label)),
+ );
+ }
+ $also_known[] = t('@group (historical data): @field', array('@group' => $groups[$entity_name], '@field' => $label_name));
+ }
+ }
+ }
+ if ($aliases) {
+ $data[$table][$column]['aliases'] = $aliases;
+ $data[$table][$column]['help'] .= ' ' . t('Also known as: !also.', array('!also' => implode(', ', $also_known)));
+ }
+
+ $keys = array_keys($field['columns']);
+ $real_field = reset($keys);
+ $data[$table][$column]['field'] = array(
+ 'table' => $table,
+ 'handler' => 'views_handler_field_field',
+ 'click sortable' => TRUE,
+ 'field_name' => $field['field_name'],
+ // Provide a real field for group by.
+ 'real field' => $column . '_' . $real_field,
+ 'additional fields' => $add_fields,
+ 'entity_tables' => $entity_tables,
+ // Default the element type to div, let the UI change it if necessary.
+ 'element type' => 'div',
+ 'is revision' => $type == FIELD_LOAD_REVISION,
+ );
+ }
+
+ foreach ($field['columns'] as $column => $attributes) {
+ $allow_sort = TRUE;
+
+ // Identify likely filters and arguments for each column based on field type.
+ switch ($attributes['type']) {
+ case 'int':
+ case 'mediumint':
+ case 'tinyint':
+ case 'bigint':
+ case 'serial':
+ case 'numeric':
+ case 'float':
+ $filter = 'views_handler_filter_numeric';
+ $argument = 'views_handler_argument_numeric';
+ $sort = 'views_handler_sort';
+ break;
+ case 'text':
+ case 'blob':
+ // It does not make sense to sort by blob or text.
+ $allow_sort = FALSE;
+ default:
+ $filter = 'views_handler_filter_string';
+ $argument = 'views_handler_argument_string';
+ $sort = 'views_handler_sort';
+ break;
+ }
+
+
+ if (count($field['columns']) == 1 || $column == 'value') {
+ $title = t('@label (!name)', array('@label' => $label, '!name' => $field['field_name']));
+ // CCK used the first 10 characters of $label. Probably doesn't matter.
+ $title_short = $label;
+ }
+ else {
+ $title = t('@label (!name:!column)', array('@label' => $label, '!name' => $field['field_name'], '!column' => $column));
+ $title_short = t('@label:!column', array('@label' => $label, '!column' => $column));
+ }
+
+ foreach ($tables as $type => $table) {
+ if ($type == FIELD_LOAD_CURRENT) {
+ $group = $group_name;
+ }
+ else {
+ $group = t('@group (historical data)', array('@group' => $group_name));
+ }
+ $column_real_name = $field['storage']['details']['sql'][$type][$table][$column];
+
+ // Load all the fields from the table by default.
+ $additional_fields = array_values($field['storage']['details']['sql'][$type][$table]);
+
+ $data[$table][$column_real_name] = array(
+ 'group' => $group,
+ 'title' => $title,
+ 'title short' => $title_short,
+ 'help' => t('Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),
+ );
+
+ // Go through and create a list of aliases for all possible combinations of
+ // entity type + name.
+ $aliases = array();
+ $also_known = array();
+ foreach ($all_labels as $entity_name => $labels) {
+ foreach ($labels as $label_name => $true) {
+ if ($group_name != $groups[$entity_name] || $label != $label_name) {
+ if (count($field['columns']) == 1 || $column == 'value') {
+ $alias_title = t('@label (!name)', array('@label' => $label_name, '!name' => $field['field_name']));
+ // CCK used the first 10 characters of $label. Probably doesn't matter.
+ }
+ else {
+ $alias_title = t('@label (!name:!column)', array('@label' => $label_name, '!name' => $field['field_name'], '!column' => $column));
+ }
+ $aliases[] = array(
+ 'group' => $groups[$entity_name],
+ 'title' => $alias_title,
+ 'help' => t('This is an alias of @group: @field.', array('@group' => $group_name, '@field' => $title)),
+ );
+ }
+ $also_known[] = t('@group: @field', array('@group' => $groups[$entity_name], '@field' => $title));
+ }
+ }
+ if ($aliases) {
+ $data[$table][$column_real_name]['aliases'] = $aliases;
+ $data[$table][$column_real_name]['help'] .= ' ' . t('Also known as: !also.', array('!also' => implode(', ', $also_known)));
+ }
+
+ $data[$table][$column_real_name]['argument'] = array(
+ 'field' => $column_real_name,
+ 'table' => $table,
+ 'handler' => $argument,
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ 'empty field name' => t('<No value>'),
+ );
+ $data[$table][$column_real_name]['filter'] = array(
+ 'field' => $column_real_name,
+ 'table' => $table,
+ 'handler' => $filter,
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ 'allow empty' => TRUE,
+ );
+ if (!empty($allow_sort)) {
+ $data[$table][$column_real_name]['sort'] = array(
+ 'field' => $column_real_name,
+ 'table' => $table,
+ 'handler' => $sort,
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ );
+ }
+
+ // Expose additional delta column for multiple value fields.
+ if ($field['cardinality'] > 1 || $field['cardinality'] == FIELD_CARDINALITY_UNLIMITED) {
+ $title_delta = t('@label (!name:delta)', array('@label' => $label, '!name' => $field['field_name']));
+ $title_short_delta = t('@label:delta', array('@label' => $label));
+
+ $data[$table]['delta'] = array(
+ 'group' => $group,
+ 'title' => $title_delta,
+ 'title short' => $title_short_delta,
+ 'help' => t('Delta - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),
+ );
+ $data[$table]['delta']['field'] = array(
+ 'handler' => 'views_handler_field_numeric',
+ );
+ $data[$table]['delta']['argument'] = array(
+ 'field' => 'delta',
+ 'table' => $table,
+ 'handler' => 'views_handler_argument_numeric',
+ 'additional fields' => $additional_fields,
+ 'empty field name' => t('<No value>'),
+ 'field_name' => $field['field_name'],
+ );
+ $data[$table]['delta']['filter'] = array(
+ 'field' => 'delta',
+ 'table' => $table,
+ 'handler' => 'views_handler_filter_numeric',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ 'allow empty' => TRUE,
+ );
+ $data[$table]['delta']['sort'] = array(
+ 'field' => 'delta',
+ 'table' => $table,
+ 'handler' => 'views_handler_sort',
+ 'additional fields' => $additional_fields,
+ 'field_name' => $field['field_name'],
+ );
+ }
+ }
+ }
+
+ return $data;
+}
+
+/**
+ * Have a different filter handler for lists. This should allow to select values of the list.
+ */
+function list_field_views_data($field) {
+ $data = field_views_field_default_views_data($field);
+ foreach ($data as $table_name => $table_data) {
+ foreach ($table_data as $field => $field_data) {
+ if (isset($field_data['filter']) && $field != 'delta') {
+ $data[$table_name][$field]['filter']['handler'] = 'views_handler_filter_field_list';
+ }
+ if (isset($field_data['argument']) && $field != 'delta') {
+ $data[$table_name][$field]['argument']['handler'] = 'views_handler_argument_field_list';
+ }
+ }
+ }
+ return $data;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_argument_field_list.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_argument_field_list.inc
new file mode 100644
index 0000000..f8f10e9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_argument_field_list.inc
@@ -0,0 +1,56 @@
+<?php
+/**
+ * @file
+ * Contains views_handler_argument_field_list handler
+ */
+
+/**
+ * Argument handler for list field to show the human readable name in the summary.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_field_list extends views_handler_argument_numeric {
+ /**
+ * @var array
+ * Stores the allowed values of this field.
+ */
+ var $allowed_values = NULL;
+
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ $field = field_info_field($this->definition['field_name']);
+ $this->allowed_values = list_allowed_values($field);
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['summary']['contains']['human'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $form['summary']['human'] = array(
+ '#title' => t('Display list value as human readable'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['summary']['human'],#
+ '#dependency' => array('radio:options[default_action]' => array('summary')),
+ );
+ }
+
+
+ function summary_name($data) {
+ $value = $data->{$this->name_alias};
+ // If the list element has a human readable name show it,
+ if (isset($this->allowed_values[$value]) && !empty($this->options['summary']['human'])) {
+ return field_filter_xss($this->allowed_values[$value]);
+ }
+ // else fallback to the key.
+ else {
+ return check_plain($value);
+ }
+ }
+}
+
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_field_field.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_field_field.inc
new file mode 100644
index 0000000..8e0b767
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_field_field.inc
@@ -0,0 +1,874 @@
+<?php
+
+/**
+ * Helper function: Return an array of formatter options for a field type.
+ *
+ * Borrowed from field_ui.
+ */
+function _field_view_formatter_options($field_type = NULL) {
+ $options = &drupal_static(__FUNCTION__);
+
+ if (!isset($options)) {
+ $field_types = field_info_field_types();
+ $options = array();
+ foreach (field_info_formatter_types() as $name => $formatter) {
+ foreach ($formatter['field types'] as $formatter_field_type) {
+ // Check that the field type exists.
+ if (isset($field_types[$formatter_field_type])) {
+ $options[$formatter_field_type][$name] = $formatter['label'];
+ }
+ }
+ }
+ }
+
+ if ($field_type) {
+ return !empty($options[$field_type]) ? $options[$field_type] : array();
+ }
+ return $options;
+}
+
+/**
+ * A field that displays fields.
+ */
+class views_handler_field_field extends views_handler_field {
+ /**
+ * An array to store field renderable arrays for use by render_items.
+ */
+ public $items = array();
+
+ /**
+ * Store the field informations.
+ */
+ public $field_info = array();
+
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+
+ $this->field_info = $field = field_info_field($this->definition['field_name']);
+ $this->multiple = FALSE;
+ $this->limit_values = FALSE;
+
+ if ($field['cardinality'] > 1 || $field['cardinality'] == FIELD_CARDINALITY_UNLIMITED) {
+ $this->multiple = TRUE;
+
+ // If "Display all values in the same row" is FALSE, then we always limit
+ // in order to show a single unique value per row.
+ if (!$this->options['group_rows']) {
+ $this->limit_values = TRUE;
+ }
+
+ // If "First and last only" is chosen, limit the values
+ if (!empty($this->options['delta_first_last'])) {
+ $this->limit_values = TRUE;
+ }
+
+ // Otherwise, we only limit values if the user hasn't selected "all", 0, or
+ // the value matching field cardinality.
+ if ((intval($this->options['delta_limit']) && ($this->options['delta_limit'] != $field['cardinality'])) || intval($this->options['delta_offset'])) {
+ $this->limit_values = TRUE;
+ }
+ }
+ }
+
+ /**
+ * Return TRUE if the user has access to view this field.
+ */
+ function access() {
+ $base_table = $this->get_base_table();
+ return field_access('view', $this->field_info, $this->definition['entity_tables'][$base_table]);
+ }
+
+ /**
+ * Set the base_table and base_table_alias.
+ */
+ function get_base_table() {
+ if (!isset($this->base_table)) {
+ // This base_table is coming from the entity not the field.
+ $this->base_table = $this->view->base_table;
+
+ // If the current field is under a relationship you can't be sure that the
+ // base table of the view is the base table of the current field.
+ // For example a field from a node author on a node view does have users as base table.
+ if (!empty($this->options['relationship']) && $this->options['relationship'] != 'none') {
+ $relationships = $this->view->display_handler->get_option('relationships');
+ if (!empty($relationships[$this->options['relationship']])) {
+ $options = $relationships[$this->options['relationship']];
+ $data = views_fetch_data($options['table']);
+ $this->base_table = $data[$options['field']]['relationship']['base'];
+ }
+ }
+ }
+
+ return $this->base_table;
+ }
+
+ /**
+ * Called to add the field to a query.
+ *
+ * By default, the only columns added to the query are entity_id and
+ * entity_type. This is because other needed data is fetched by entity_load().
+ * Other columns are added only if they are used in groupings, or if
+ * 'add fields to query' is specifically set to TRUE in the field definition.
+ *
+ * The 'add fields to query' switch is used by modules which need all data
+ * present in the query itself (such as "sphinx").
+ */
+ function query($use_groupby = FALSE) {
+ $this->get_base_table();
+
+ $params = array();
+ if ($use_groupby) {
+ // When grouping on a "field API" field (whose "real_field" is set to
+ // entity_id), retrieve the minimum entity_id to have a valid entity_id to
+ // pass to field_view_field().
+ $params = array(
+ 'function' => 'min',
+ );
+
+ $this->ensure_my_table();
+ }
+
+ // Get the entity type according to the base table of the field.
+ // Then add it to the query as a formula. That way we can avoid joining
+ // the field table if all we need is entity_id and entity_type.
+ $entity_type = $this->definition['entity_tables'][$this->base_table];
+ $entity_info = entity_get_info($entity_type);
+
+ if (isset($this->relationship)) {
+ $this->base_table_alias = $this->relationship;
+ }
+ else {
+ $this->base_table_alias = $this->base_table;
+ }
+
+ // We always need the base field (entity_id / revision_id).
+ if (empty($this->definition['is revision'])) {
+ $this->field_alias = $this->query->add_field($this->base_table_alias, $entity_info['entity keys']['id'], '', $params);
+ }
+ else {
+ $this->field_alias = $this->query->add_field($this->base_table_alias, $entity_info['entity keys']['revision'], '', $params);
+ $this->aliases['entity_id'] = $this->query->add_field($this->base_table_alias, $entity_info['entity keys']['id'], '', $params);
+ }
+
+
+ // The alias needs to be unique, so we use both the field table and the entity type.
+ $entity_type_alias = $this->definition['table'] . '_' . $entity_type . '_entity_type';
+ $this->aliases['entity_type'] = $this->query->add_field(NULL, "'$entity_type'", $entity_type_alias);
+
+ $fields = $this->additional_fields;
+ // We've already added entity_type, so we can remove it from the list.
+ $entity_type_key = array_search('entity_type', $fields);
+ if ($entity_type_key !== FALSE) {
+ unset($fields[$entity_type_key]);
+ }
+
+ if ($use_groupby) {
+ // Add the fields that we're actually grouping on.
+ $options = array();
+
+ if ($this->options['group_column'] != 'entity_id') {
+ $options = array($this->options['group_column'] => $this->options['group_column']);
+ }
+
+ $options += $this->options['group_columns'];
+
+
+ $fields = array();
+ $rkey = $this->definition['is revision'] ? 'FIELD_LOAD_REVISION' : 'FIELD_LOAD_CURRENT';
+ // Go through the list and determine the actual column name from field api.
+ foreach ($options as $column) {
+ $name = $column;
+ if (isset($this->field_info['storage']['details']['sql'][$rkey][$this->table][$column])) {
+ $name = $this->field_info['storage']['details']['sql'][$rkey][$this->table][$column];
+ }
+
+ $fields[$column] = $name;
+ }
+
+ $this->group_fields = $fields;
+ }
+
+ // Add additional fields (and the table join itself) if needed.
+ if ($this->add_field_table($use_groupby)) {
+ $this->ensure_my_table();
+ $this->add_additional_fields($fields);
+
+ // Filter by language, if field translation is enabled.
+ $field = $this->field_info;
+ if (field_is_translatable($entity_type, $field) && !empty($this->view->display_handler->options['field_language_add_to_query'])) {
+ $column = $this->table_alias . '.language';
+ // By the same reason as field_language the field might be LANGUAGE_NONE in reality so allow it as well.
+ // @see this::field_language()
+ global $language_content;
+ $default_language = language_default('language');
+ $language = str_replace(array('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***'),
+ array($language_content->language, $default_language),
+ $this->view->display_handler->options['field_language']);
+ $placeholder = $this->placeholder();
+ $language_fallback_candidates = array($language);
+ if (variable_get('locale_field_language_fallback', TRUE) && module_exists('locale')) {
+ $language_fallback_candidates = array_merge($language_fallback_candidates, language_fallback_get_candidates());
+ }
+ else {
+ $language_fallback_candidates[] = LANGUAGE_NONE;
+ }
+ $this->query->add_where_expression(0, "$column IN($placeholder) OR $column IS NULL", array($placeholder => $language_fallback_candidates));
+ }
+ }
+
+ // The revision id inhibits grouping.
+ // So, stop here if we're using grouping, or if aren't adding all columns to
+ // the query.
+ if ($use_groupby || empty($this->definition['add fields to query'])) {
+ return;
+ }
+
+ $this->add_additional_fields(array('revision_id'));
+ }
+
+ /**
+ * Determine if the field table should be added to the query.
+ */
+ function add_field_table($use_groupby) {
+ // Grouping is enabled, or we are explicitly required to do this.
+ if ($use_groupby || !empty($this->definition['add fields to query'])) {
+ return TRUE;
+ }
+ // This a multiple value field, but "group multiple values" is not checked.
+ if ($this->multiple && !$this->options['group_rows']) {
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ /**
+ * Determine if this field is click sortable.
+ */
+ function click_sortable() {
+ // Not click sortable in any case.
+ if (empty($this->definition['click sortable'])) {
+ return FALSE;
+ }
+ // A field is not click sortable if it's a multiple field with
+ // "group multiple values" checked, since a click sort in that case would
+ // add a join to the field table, which would produce unwanted duplicates.
+ if ($this->multiple && $this->options['group_rows']) {
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ /**
+ * Called to determine what to tell the clicksorter.
+ */
+ function click_sort($order) {
+ // No column selected, can't continue.
+ if (empty($this->options['click_sort_column'])) {
+ return;
+ }
+
+ $this->ensure_my_table();
+ $column = _field_sql_storage_columnname($this->definition['field_name'], $this->options['click_sort_column']);
+ if (!isset($this->aliases[$column])) {
+ // Column is not in query; add a sort on it (without adding the column).
+ $this->aliases[$column] = $this->table_alias . '.' . $column;
+ }
+ $this->query->add_orderby(NULL, NULL, $order, $this->aliases[$column]);
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ // option_definition runs before init/construct, so no $this->field_info
+ $field = field_info_field($this->definition['field_name']);
+ $field_type = field_info_field_types($field['type']);
+ $column_names = array_keys($field['columns']);
+ $default_column = '';
+ // Try to determine a sensible default.
+ if (count($column_names) == 1) {
+ $default_column = $column_names[0];
+ }
+ elseif (in_array('value', $column_names)) {
+ $default_column = 'value';
+ }
+
+ // If the field has a "value" column, we probably need that one.
+ $options['click_sort_column'] = array(
+ 'default' => $default_column,
+ );
+ $options['type'] = array(
+ 'default' => $field_type['default_formatter'],
+ );
+ $options['settings'] = array(
+ 'default' => array(),
+ );
+ $options['group_column'] = array(
+ 'default' => $default_column,
+ );
+ $options['group_columns'] = array(
+ 'default' => array(),
+ );
+
+ // Options used for multiple value fields.
+ $options['group_rows'] = array(
+ 'default' => TRUE,
+ );
+ // If we know the exact number of allowed values, then that can be
+ // the default. Otherwise, default to 'all'.
+ $options['delta_limit'] = array(
+ 'default' => ($field['cardinality'] > 1) ? $field['cardinality'] : 'all',
+ );
+ $options['delta_offset'] = array(
+ 'default' => 0,
+ );
+ $options['delta_reversed'] = array(
+ 'default' => FALSE,
+ );
+ $options['delta_first_last'] = array(
+ 'default' => FALSE,
+ );
+
+ $options['multi_type'] = array(
+ 'default' => 'separator'
+ );
+ $options['separator'] = array(
+ 'default' => ', '
+ );
+
+ $options['field_api_classes'] = array(
+ 'default' => FALSE,
+ );
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $field = $this->field_info;
+ $formatters = _field_view_formatter_options($field['type']);
+ $column_names = array_keys($field['columns']);
+
+ // If this is a multiple value field, add its options.
+ if ($this->multiple) {
+ $this->multiple_options_form($form, $form_state);
+ }
+
+ // No need to ask the user anything if the field has only one column.
+ if (count($field['columns']) == 1) {
+ $form['click_sort_column'] = array(
+ '#type' => 'value',
+ '#value' => isset($column_names[0]) ? $column_names[0] : '',
+ );
+ }
+ else {
+ $form['click_sort_column'] = array(
+ '#type' => 'select',
+ '#title' => t('Click sort column'),
+ '#options' => drupal_map_assoc($column_names),
+ '#default_value' => $this->options['click_sort_column'],
+ '#description' => t('Used by Style: Table to determine the actual column to click sort the field on. The default is usually fine.'),
+ '#fieldset' => 'more',
+ );
+ }
+
+ $form['type'] = array(
+ '#type' => 'select',
+ '#title' => t('Formatter'),
+ '#options' => $formatters,
+ '#default_value' => $this->options['type'],
+ '#ajax' => array(
+ 'path' => views_ui_build_form_url($form_state),
+ ),
+ '#submit' => array('views_ui_config_item_form_submit_temporary'),
+ '#executes_submit_callback' => TRUE,
+ );
+
+ $form['field_api_classes'] = array(
+ '#title' => t('Use field template'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['field_api_classes'],
+ '#description' => t('If checked, field api classes will be added using field.tpl.php (or equivalent). This is not recommended unless your CSS depends upon these classes. If not checked, template will not be used.'),
+ '#fieldset' => 'style_settings',
+ '#weight' => 20,
+ );
+
+ if ($this->multiple) {
+ $form['field_api_classes']['#description'] .= ' ' . t('Checking this option will cause the group Display Type and Separator values to be ignored.');
+ }
+
+ // Get the currently selected formatter.
+ $format = $this->options['type'];
+
+ $formatter = field_info_formatter_types($format);
+ $settings = $this->options['settings'] + field_info_formatter_settings($format);
+
+ // Provide an instance array for hook_field_formatter_settings_form().
+ ctools_include('fields');
+ $instance = ctools_fields_fake_field_instance($this->definition['field_name'], '_dummy', $formatter, $settings);
+
+ // Store the settings in a '_dummy' view mode.
+ $instance['display']['_dummy'] = array(
+ 'type' => $format,
+ 'settings' => $settings,
+ );
+
+ // Get the settings form.
+ $settings_form = array('#value' => array());
+ $function = $formatter['module'] . '_field_formatter_settings_form';
+ if (function_exists($function)) {
+ $settings_form = $function($field, $instance, '_dummy', $form, $form_state);
+ }
+ $form['settings'] = $settings_form;
+ }
+
+ /**
+ * Provide options for multiple value fields.
+ */
+ function multiple_options_form(&$form, &$form_state) {
+ $field = $this->field_info;
+
+ $form['multiple_field_settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Multiple field settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ '#weight' => 5,
+ );
+
+ $form['group_rows'] = array(
+ '#title' => t('Display all values in the same row'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['group_rows'],
+ '#description' => t('If checked, multiple values for this field will be shown in the same row. If not checked, each value in this field will create a new row. If using group by, please make sure to group by "Entity ID" for this setting to have any effect.'),
+ '#fieldset' => 'multiple_field_settings',
+ );
+
+ // Make the string translatable by keeping it as a whole rather than
+ // translating prefix and suffix separately.
+ list($prefix, $suffix) = explode('@count', t('Display @count value(s)'));
+
+ if ($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED) {
+ $type = 'textfield';
+ $options = NULL;
+ $size = 5;
+ }
+ else {
+ $type = 'select';
+ $options = drupal_map_assoc(range(1, $field['cardinality']));
+ $size = 1;
+ }
+ $form['multi_type'] = array(
+ '#type' => 'radios',
+ '#title' => t('Display type'),
+ '#options' => array(
+ 'ul' => t('Unordered list'),
+ 'ol' => t('Ordered list'),
+ 'separator' => t('Simple separator'),
+ ),
+ '#dependency' => array('edit-options-group-rows' => array(TRUE)),
+ '#default_value' => $this->options['multi_type'],
+ '#fieldset' => 'multiple_field_settings',
+ );
+
+ $form['separator'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Separator'),
+ '#default_value' => $this->options['separator'],
+ '#dependency' => array(
+ 'radio:options[multi_type]' => array('separator'),
+ 'edit-options-group-rows' => array(TRUE),
+ ),
+ '#dependency_count' => 2,
+ '#fieldset' => 'multiple_field_settings',
+ );
+
+ $form['delta_limit'] = array(
+ '#type' => $type,
+ '#size' => $size,
+ '#field_prefix' => $prefix,
+ '#field_suffix' => $suffix,
+ '#options' => $options,
+ '#default_value' => $this->options['delta_limit'],
+ '#prefix' => '<div class="container-inline">',
+ '#dependency' => array('edit-options-group-rows' => array(TRUE)),
+ '#fieldset' => 'multiple_field_settings',
+ );
+
+ list($prefix, $suffix) = explode('@count', t('starting from @count'));
+ $form['delta_offset'] = array(
+ '#type' => 'textfield',
+ '#size' => 5,
+ '#field_prefix' => $prefix,
+ '#field_suffix' => $suffix,
+ '#default_value' => $this->options['delta_offset'],
+ '#dependency' => array('edit-options-group-rows' => array(TRUE)),
+ '#description' => t('(first item is 0)'),
+ '#fieldset' => 'multiple_field_settings',
+ );
+ $form['delta_reversed'] = array(
+ '#title' => t('Reversed'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['delta_reversed'],
+ '#suffix' => $suffix,
+ '#dependency' => array('edit-options-group-rows' => array(TRUE)),
+ '#description' => t('(start from last values)'),
+ '#fieldset' => 'multiple_field_settings',
+ );
+ $form['delta_first_last'] = array(
+ '#title' => t('First and last only'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['delta_first_last'],
+ '#suffix' => '</div>',
+ '#dependency' => array('edit-options-group-rows' => array(TRUE)),
+ '#fieldset' => 'multiple_field_settings',
+ );
+ }
+
+ /**
+ * Extend the groupby form with group columns.
+ */
+ function groupby_form(&$form, &$form_state) {
+ parent::groupby_form($form, $form_state);
+ // With "field API" fields, the column target of the grouping function
+ // and any additional grouping columns must be specified.
+ $group_columns = array(
+ 'entity_id' => t('Entity ID'),
+ ) + drupal_map_assoc(array_keys($this->field_info['columns']), 'ucfirst');
+
+ $form['group_column'] = array(
+ '#type' => 'select',
+ '#title' => t('Group column'),
+ '#default_value' => $this->options['group_column'],
+ '#description' => t('Select the column of this field to apply the grouping function selected above.'),
+ '#options' => $group_columns,
+ );
+
+ $options = drupal_map_assoc(array('bundle', 'language', 'entity_type'), 'ucfirst');
+
+ // Add on defined fields, noting that they're prefixed with the field name.
+ $form['group_columns'] = array(
+ '#type' => 'checkboxes',
+ '#title' => t('Group columns (additional)'),
+ '#default_value' => $this->options['group_columns'],
+ '#description' => t('Select any additional columns of this field to include in the query and to group on.'),
+ '#options' => $options + $group_columns,
+ );
+ }
+
+ function groupby_form_submit(&$form, &$form_state) {
+ parent::groupby_form_submit($form, $form_state);
+ $item =& $form_state['handler']->options;
+
+ // Add settings for "field API" fields.
+ $item['group_column'] = $form_state['values']['options']['group_column'];
+ $item['group_columns'] = array_filter($form_state['values']['options']['group_columns']);
+ }
+
+ /**
+ * Load the entities for all fields that are about to be displayed.
+ */
+ function post_execute(&$values) {
+ if (!empty($values)) {
+ // Divide the entity ids by entity type, so they can be loaded in bulk.
+ $entities_by_type = array();
+ $revisions_by_type = array();
+ foreach ($values as $key => $object) {
+ if (isset($object->{$this->field_alias}) && !isset($values[$key]->_field_data[$this->field_alias])) {
+ $entity_type = $object->{$this->aliases['entity_type']};
+ if (empty($this->definition['is revision'])) {
+ $entity_id = $object->{$this->field_alias};
+ $entities_by_type[$entity_type][$key] = $entity_id;
+ }
+ else {
+ $revision_id = $object->{$this->field_alias};
+ $entity_id = $object->{$this->aliases['entity_id']};
+ $entities_by_type[$entity_type][$key] = array($entity_id, $revision_id);
+ }
+ }
+ }
+
+ // Load the entities.
+ foreach ($entities_by_type as $entity_type => $entity_ids) {
+ $entity_info = entity_get_info($entity_type);
+ if (empty($this->definition['is revision'])) {
+ $entities = entity_load($entity_type, $entity_ids);
+ $keys = $entity_ids;
+ }
+ else {
+ // Revisions can't be loaded multiple, so we have to load them
+ // one by one.
+ $entities = array();
+ $keys = array();
+ foreach ($entity_ids as $key => $combined) {
+ list($entity_id, $revision_id) = $combined;
+ $entity = entity_load($entity_type, array($entity_id), array($entity_info['entity keys']['revision'] => $revision_id));
+ if ($entity) {
+ $entities[$revision_id] = array_shift($entity);
+ $keys[$key] = $revision_id;
+ }
+ }
+ }
+
+ foreach ($keys as $key => $entity_id) {
+ // If this is a revision, load the revision instead.
+ if (isset($entities[$entity_id])) {
+ $values[$key]->_field_data[$this->field_alias] = array(
+ 'entity_type' => $entity_type,
+ 'entity' => $entities[$entity_id],
+ );
+ }
+ }
+ }
+
+ // Now, transfer the data back into the resultset so it can be easily used.
+ foreach ($values as $row_id => &$value) {
+ $value->{'field_' . $this->options['id']} = $this->set_items($value, $row_id);
+ }
+ }
+ }
+
+ /**
+ * 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['group_rows']) {
+ return implode('', $items);
+ }
+
+ if ($this->options['multi_type'] == 'separator') {
+ return implode(filter_xss_admin($this->options['separator']), $items);
+ }
+ else {
+ return theme('item_list',
+ array(
+ 'items' => $items,
+ 'title' => NULL,
+ 'type' => $this->options['multi_type']
+ ));
+ }
+ }
+ }
+
+ function get_items($values) {
+ return $values->{'field_' . $this->options['id']};
+ }
+
+ function get_value($values, $field = NULL) {
+ // Go ahead and render and store in $this->items.
+ $entity = clone $values->_field_data[$this->field_alias]['entity'];
+
+ $entity_type = $values->_field_data[$this->field_alias]['entity_type'];
+ $langcode = $this->field_language($entity_type, $entity);
+ // If we are grouping, copy our group fields into the cloned entity.
+ // It's possible this will cause some weirdness, but there's only
+ // so much we can hope to do.
+ if (!empty($this->group_fields)) {
+ // first, test to see if we have a base value.
+ $base_value = array();
+ // Note: We would copy original values here, but it can cause problems.
+ // For example, text fields store cached filtered values as
+ // 'safe_value' which doesn't appear anywhere in the field definition
+ // so we can't affect it. Other side effects could happen similarly.
+ $data = FALSE;
+ foreach ($this->group_fields as $field_name => $column) {
+ if (property_exists($values, $this->aliases[$column])) {
+ $base_value[$field_name] = $values->{$this->aliases[$column]};
+ if (isset($base_value[$field_name])) {
+ $data = TRUE;
+ }
+ }
+ }
+
+ // If any of our aggregated fields have data, fake it:
+ if ($data) {
+ // Now, overwrite the original value with our aggregated value.
+ // This overwrites it so there is always just one entry.
+ $entity->{$this->definition['field_name']}[$langcode] = array($base_value);
+ }
+ else {
+ $entity->{$this->definition['field_name']}[$langcode] = array();
+ }
+ }
+
+ // The field we are trying to display doesn't exist on this entity.
+ if (!isset($entity->{$this->definition['field_name']})) {
+ return array();
+ }
+
+ // We are supposed to show only certain deltas.
+ if ($this->limit_values && !empty($entity->{$this->definition['field_name']})) {
+ $all_values = !empty($entity->{$this->definition['field_name']}[$langcode]) ? $entity->{$this->definition['field_name']}[$langcode] : array();
+ if ($this->options['delta_reversed']) {
+ $all_values = array_reverse($all_values);
+ }
+
+ // Offset is calculated differently when row grouping for a field is
+ // not enabled. Since there are multiple rows, the delta needs to be
+ // taken into account, so that different values are shown per row.
+ if (!$this->options['group_rows'] && isset($this->aliases['delta']) && isset($values->{$this->aliases['delta']})) {
+ $delta_limit = 1;
+ $offset = $values->{$this->aliases['delta']};
+ }
+ // Single fields don't have a delta available so choose 0.
+ elseif (!$this->options['group_rows'] && !$this->multiple) {
+ $delta_limit = 1;
+ $offset = 0;
+ }
+ else {
+ $delta_limit = $this->options['delta_limit'];
+ $offset = intval($this->options['delta_offset']);
+
+ // We should only get here in this case if there's an offset, and
+ // in that case we're limiting to all values after the offset.
+ if ($delta_limit == 'all') {
+ $delta_limit = count($all_values) - $offset;
+ }
+ }
+
+ // Determine if only the first and last values should be shown
+ $delta_first_last = $this->options['delta_first_last'];
+
+ $new_values = array();
+ for ($i = 0; $i < $delta_limit; $i++) {
+ $new_delta = $offset + $i;
+
+ if (isset($all_values[$new_delta])) {
+ // If first-last option was selected, only use the first and last values
+ if (!$delta_first_last
+ // Use the first value.
+ || $new_delta == $offset
+ // Use the last value.
+ || $new_delta == ($delta_limit + $offset - 1)) {
+ $new_values[] = $all_values[$new_delta];
+ }
+ }
+ }
+ $entity->{$this->definition['field_name']}[$langcode] = $new_values;
+ }
+
+ if ($field == 'entity') {
+ return $entity;
+ }
+ else {
+ return !empty($entity->{$this->definition['field_name']}[$langcode]) ? $entity->{$this->definition['field_name']}[$langcode] : array();
+ }
+ }
+
+ /**
+ * Return an array of items for the field.
+ */
+ function set_items($values, $row_id) {
+ if (empty($values->_field_data[$this->field_alias]) || empty($values->_field_data[$this->field_alias]['entity'])) {
+ return array();
+ }
+
+ $display = array(
+ 'type' => $this->options['type'],
+ 'settings' => $this->options['settings'],
+ 'label' => 'hidden',
+ // Pass the View object in the display so that fields can act on it.
+ 'views_view' => $this->view,
+ 'views_field' => $this,
+ 'views_row_id' => $row_id,
+ );
+
+
+ $entity_type = $values->_field_data[$this->field_alias]['entity_type'];
+ $entity = $this->get_value($values, 'entity');
+ if (!$entity) {
+ return array();
+ }
+
+ $langcode = $this->field_language($entity_type, $entity);
+ $render_array = field_view_field($entity_type, $entity, $this->definition['field_name'], $display, $langcode);
+
+ $items = array();
+ if ($this->options['field_api_classes']) {
+ // Make a copy.
+ $array = $render_array;
+ return array(array('rendered' => drupal_render($render_array)));
+ }
+
+ foreach (element_children($render_array) as $count) {
+ $items[$count]['rendered'] = $render_array[$count];
+ // field_view_field() adds an #access property to the render array that
+ // determines whether or not the current user is allowed to view the
+ // field in the context of the current entity. We need to respect this
+ // parameter when we pull out the children of the field array for
+ // rendering.
+ if (isset($render_array['#access'])) {
+ $items[$count]['rendered']['#access'] = $render_array['#access'];
+ }
+ // Only add the raw field items (for use in tokens) if the curent user
+ // has access to view the field content.
+ if ((!isset($items[$count]['rendered']['#access']) || $items[$count]['rendered']['#access']) && !empty($render_array['#items'][$count])) {
+ $items[$count]['raw'] = $render_array['#items'][$count];
+ }
+ }
+ return $items;
+ }
+
+ function render_item($count, $item) {
+ return render($item['rendered']);
+ }
+
+ function document_self_tokens(&$tokens) {
+ $field = $this->field_info;
+ foreach ($field['columns'] as $id => $column) {
+ $tokens['[' . $this->options['id'] . '-' . $id . ']'] = t('Raw @column', array('@column' => $id));
+ }
+ }
+
+ function add_self_tokens(&$tokens, $item) {
+ $field = $this->field_info;
+ foreach ($field['columns'] as $id => $column) {
+ // Use filter_xss_admin because it's user data and we can't be sure it is safe.
+ // We know nothing about the data, though, so we can't really do much else.
+
+ if (isset($item['raw'])) {
+ // If $item['raw'] is an array then we can use as is, if it's an object
+ // we cast it to an array, if it's neither, we can't use it.
+ $raw = is_array($item['raw']) ? $item['raw'] :
+ (is_object($item['raw']) ? (array)$item['raw'] : NULL);
+ }
+ if (isset($raw) && isset($raw[$id]) && is_scalar($raw[$id])) {
+ $tokens['[' . $this->options['id'] . '-' . $id . ']'] = filter_xss_admin($raw[$id]);
+ }
+ else {
+ // Take sure that empty values are replaced as well.
+ $tokens['[' . $this->options['id'] . '-' . $id . ']'] = '';
+ }
+ }
+ }
+
+ /**
+ * Return the language code of the language the field should be displayed in,
+ * according to the settings.
+ */
+ function field_language($entity_type, $entity) {
+ global $language_content;
+
+ if (field_is_translatable($entity_type, $this->field_info)) {
+ $default_language = language_default('language');
+ $language = str_replace(array('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***'),
+ array($language_content->language, $default_language),
+ $this->view->display_handler->options['field_language']);
+
+ // Give the Field Language API a chance to fallback to a different language
+ // (or LANGUAGE_NONE), in case the field has no data for the selected language.
+ // field_view_field() does this as well, but since the returned language code
+ // is used before calling it, the fallback needs to happen explicitly.
+ $language = field_language($entity_type, $entity, $this->field_info['field_name'], $language);
+
+ return $language;
+ }
+ else {
+ return LANGUAGE_NONE;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_filter_field_list.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_filter_field_list.inc
new file mode 100644
index 0000000..971fb35
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_filter_field_list.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * Filter handler which uses list-fields as options.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_field_list extends views_handler_filter_in_operator {
+ function get_value_options() {
+ $field = field_info_field($this->definition['field_name']);
+ $this->value_options = list_allowed_values($field);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_relationship_entity_reverse.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_relationship_entity_reverse.inc
new file mode 100644
index 0000000..c83fa11
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/field/views_handler_relationship_entity_reverse.inc
@@ -0,0 +1,83 @@
+<?php
+/**
+ * @file
+ * Views' relationship handlers.
+ */
+
+/**
+ * A relationship handlers which reverse entity references.
+ *
+ * @ingroup views_relationship_handlers
+ */
+class views_handler_relationship_entity_reverse extends views_handler_relationship {
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+
+ $this->field_info = field_info_field($this->definition['field_name']);
+ }
+
+ /**
+ * Called to implement a relationship in a query.
+ */
+ function query() {
+ $this->ensure_my_table();
+ // First, relate our base table to the current base table to the
+ // field, using the base table's id field to the field's column.
+ $views_data = views_fetch_data($this->table);
+ $left_field = $views_data['table']['base']['field'];
+
+ $first = array(
+ 'left_table' => $this->table_alias,
+ 'left_field' => $left_field,
+ 'table' => $this->definition['field table'],
+ 'field' => $this->definition['field field'],
+ );
+ if (!empty($this->options['required'])) {
+ $first['type'] = 'INNER';
+ }
+
+ if (!empty($this->definition['join_extra'])) {
+ $first['extra'] = $this->definition['join_extra'];
+ }
+
+ if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {
+ $first_join = new $this->definition['join_handler'];
+ }
+ else {
+ $first_join = new views_join();
+ }
+ $first_join->definition = $first;
+ $first_join->construct();
+ $first_join->adjusted = TRUE;
+
+ $this->first_alias = $this->query->add_table($this->definition['field table'], $this->relationship, $first_join);
+
+ // Second, relate the field table to the entity specified using
+ // the entity id on the field table and the entity's id field.
+ $second = array(
+ 'left_table' => $this->first_alias,
+ 'left_field' => 'entity_id',
+ 'table' => $this->definition['base'],
+ 'field' => $this->definition['base field'],
+ );
+
+ if (!empty($this->options['required'])) {
+ $second['type'] = 'INNER';
+ }
+
+ if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {
+ $second_join = new $this->definition['join_handler'];
+ }
+ else {
+ $second_join = new views_join();
+ }
+ $second_join->definition = $second;
+ $second_join->construct();
+ $second_join->adjusted = TRUE;
+
+ // use a short alias for this:
+ $alias = $this->definition['field_name'] . '_' . $this->table;
+
+ $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/file.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/file.views.inc
new file mode 100644
index 0000000..30db20b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/file.views.inc
@@ -0,0 +1,81 @@
+<?php
+/**
+ * @file
+ *
+ * Provide views data and handlers for file.module
+ */
+
+/**
+ * @defgroup views_file_module file.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_field_views_data().
+ *
+ * Views integration for file fields. Adds a file relationship to the default
+ * field data.
+ *
+ * @see field_views_field_default_views_data()
+ */
+function file_field_views_data($field) {
+ $data = field_views_field_default_views_data($field);
+ foreach ($data as $table_name => $table_data) {
+ // Add the relationship only on the fid field.
+ $data[$table_name][$field['field_name'] . '_fid']['relationship'] = array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'file_managed',
+ 'entity type' => 'file',
+ 'base field' => 'fid',
+ 'label' => t('file from !field_name', array('!field_name' => $field['field_name'])),
+ );
+ }
+
+ return $data;
+}
+
+/**
+ * Implements hook_field_views_data_views_data_alter().
+ *
+ * Views integration to provide reverse relationships on file fields.
+ */
+function file_field_views_data_views_data_alter(&$data, $field) {
+ foreach ($field['bundles'] as $entity_type => $bundles) {
+ $entity_info = entity_get_info($entity_type);
+ $pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type;
+
+ list($label, $all_labels) = field_views_field_label($field['field_name']);
+ $entity = $entity_info['label'];
+ if ($entity == t('Node')) {
+ $entity = t('Content');
+ }
+
+ $data['file_managed'][$pseudo_field_name]['relationship'] = array(
+ 'title' => t('@entity using @field', array('@entity' => $entity, '@field' => $label)),
+ 'help' => t('Relate each @entity with a @field set to the file.', array('@entity' => $entity, '@field' => $label)),
+ 'handler' => 'views_handler_relationship_entity_reverse',
+ 'field_name' => $field['field_name'],
+ 'field table' => _field_sql_storage_tablename($field),
+ 'field field' => $field['field_name'] . '_fid',
+ 'base' => $entity_info['base table'],
+ 'base field' => $entity_info['entity keys']['id'],
+ 'label' => t('!field_name', array('!field_name' => $field['field_name'])),
+ 'join_extra' => array(
+ 0 => array(
+ 'field' => 'entity_type',
+ 'value' => $entity_type,
+ ),
+ 1 => array(
+ 'field' => 'deleted',
+ 'value' => 0,
+ 'numeric' => TRUE,
+ ),
+ ),
+ );
+ }
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter.views.inc
new file mode 100644
index 0000000..c13d887
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter.views.inc
@@ -0,0 +1,41 @@
+<?php
+/**
+ * @file
+ * Provide basic views data for filter.module.
+ */
+
+/**
+ * @defgroup views_filter_module filter.module handlers
+ *
+ * Only includes the table 'filter_formats'.
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function filter_views_data() {
+ // ----------------------------------------------------------------------
+ // filter_format table
+
+ // Have not defined $data['filter_formats']['table']['group'] since
+ // no fields are defined here yet.
+ $data['filter_formats']['moved to'] = 'filter_format';
+ $data['filter_format']['table']['join'] = array(
+ 'node_revision' => array(
+ 'left_field' => 'format',
+ 'field' => 'format',
+ ),
+ 'node' => array(
+ 'left_table' => 'node_revision',
+ 'left_field' => 'format',
+ 'field' => 'format',
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter/views_handler_field_filter_format_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter/views_handler_field_filter_format_name.inc
new file mode 100644
index 0000000..9b7b457
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/filter/views_handler_field_filter_format_name.inc
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Field handler to output the name of an input format.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_filter_format_name extends views_handler_field {
+ function construct() {
+ parent::construct();
+ // Be explicit about the table we are using.
+ $this->additional_fields['name'] = array('table' => 'filter_formats', 'field' => 'name');
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function render($values) {
+ $format_name = $this->get_value($values, 'name');
+ if (!$format_name) {
+ // Default or invalid input format.
+ // filter_formats() will reliably return the default format even if the
+ // current user is unprivileged.
+ $format = filter_formats(filter_default_format());
+ return $this->sanitize_value($format->name);
+ }
+ return $this->sanitize_value($format_name);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/image.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/image.views.inc
new file mode 100644
index 0000000..1dec9e4
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/image.views.inc
@@ -0,0 +1,80 @@
+<?php
+/**
+ * @file
+ *
+ * Provide views data and handlers for image.module
+ */
+
+/**
+ * @defgroup views_image_module image.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_field_views_data().
+ *
+ * Views integration for image fields. Adds an image relationship to the default
+ * field data.
+ *
+ * @see field_views_field_default_views_data()
+ */
+function image_field_views_data($field) {
+ $data = field_views_field_default_views_data($field);
+ foreach ($data as $table_name => $table_data) {
+ // Add the relationship only on the fid field.
+ $data[$table_name][$field['field_name'] . '_fid']['relationship'] = array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'file_managed',
+ 'base field' => 'fid',
+ 'label' => t('image from !field_name', array('!field_name' => $field['field_name'])),
+ );
+ }
+
+ return $data;
+}
+
+/**
+ * Implements hook_field_views_data_views_data_alter().
+ *
+ * Views integration to provide reverse relationships on image fields.
+ */
+function image_field_views_data_views_data_alter(&$data, $field) {
+ foreach ($field['bundles'] as $entity_type => $bundles) {
+ $entity_info = entity_get_info($entity_type);
+ $pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type;
+
+ list($label, $all_labels) = field_views_field_label($field['field_name']);
+ $entity = $entity_info['label'];
+ if ($entity == t('Node')) {
+ $entity = t('Content');
+ }
+
+ $data['file_managed'][$pseudo_field_name]['relationship'] = array(
+ 'title' => t('@entity using @field', array('@entity' => $entity, '@field' => $label)),
+ 'help' => t('Relate each @entity with a @field set to the image.', array('@entity' => $entity, '@field' => $label)),
+ 'handler' => 'views_handler_relationship_entity_reverse',
+ 'field_name' => $field['field_name'],
+ 'field table' => _field_sql_storage_tablename($field),
+ 'field field' => $field['field_name'] . '_fid',
+ 'base' => $entity_info['base table'],
+ 'base field' => $entity_info['entity keys']['id'],
+ 'label' => t('!field_name', array('!field_name' => $field['field_name'])),
+ 'join_extra' => array(
+ 0 => array(
+ 'field' => 'entity_type',
+ 'value' => $entity_type,
+ ),
+ 1 => array(
+ 'field' => 'deleted',
+ 'value' => 0,
+ 'numeric' => TRUE,
+ ),
+ ),
+ );
+ }
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale.views.inc
new file mode 100644
index 0000000..057b2a6
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale.views.inc
@@ -0,0 +1,206 @@
+<?php
+
+/**
+ * @file
+ *
+ * Provides views data and handlers for locale.module.
+ */
+
+/**
+ * @defgroup views_locale_module locale.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data().
+ */
+function locale_views_data() {
+ // Basic table information.
+
+ // Define the base group of this table.
+ $data['locales_source']['table']['group'] = t('Locale source');
+
+ // Advertise this table as a possible base table.
+ $data['locales_source']['table']['base'] = array(
+ 'field' => 'lid',
+ 'title' => t('Locale source'),
+ 'help' => t('A source string for translation, in English or the default site language.'),
+ );
+
+ // lid
+ $data['locales_source']['lid'] = array(
+ 'title' => t('LID'),
+ 'help' => t('The ID of the source string.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ 'numeric' => TRUE,
+ 'validate type' => 'lid',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // location
+ $data['locales_source']['location'] = array(
+ 'group' => t('Locale source'),
+ 'title' => t('Location'),
+ 'help' => t('A description of the location or context of the string.'),
+ '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',
+ ),
+ );
+
+ // Group field
+ $data['locales_source']['textgroup'] = array(
+ 'group' => t('Locale source'),
+ 'title' => t('Group'),
+ 'help' => t('The group the translation is in.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_locale_group',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_locale_group',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_locale_group',
+ ),
+ );
+
+ // Source field
+ $data['locales_source']['source'] = array(
+ 'group' => t('Locale source'),
+ 'title' => t('Source'),
+ 'help' => t('The full original string.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // Version field
+ $data['locales_source']['version'] = array(
+ 'group' => t('Locale source'),
+ 'title' => t('Version'),
+ 'help' => t('The version of Drupal core that this string is for.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_locale_version',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ $data['locales_source']['edit_lid'] = array(
+ 'group' => t('Locale source'),
+ 'field' => array(
+ 'title' => t('Edit link'),
+ 'help' => t('Provide a simple link to edit the translations.'),
+ 'handler' => 'views_handler_field_locale_link_edit',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // Locales target table
+
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['locales_target']['table']['group'] = t('Locale target');
+
+ // Join information
+ $data['locales_target']['table']['join'] = array(
+ 'locales_source' => array(
+ 'left_field' => 'lid',
+ 'field' => 'lid',
+ ),
+ );
+
+ // Translation field
+ $data['locales_target']['translation'] = array(
+ 'group' => t('Locale target'),
+ 'title' => t('Translation'),
+ 'help' => t('The full translation string.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // Language field
+ $data['locales_target']['language'] = array(
+ 'group' => t('Locale target'),
+ 'title' => t('Language'),
+ 'help' => t('The language this translation is in.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_locale_language',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_locale_language',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_locale_language',
+ ),
+ );
+
+ $data['locales_target']['plid'] = array(
+ 'group' => t('Locale target'),
+ 'title' => t('Singular LID'),
+ 'help' => t('The ID of the parent translation.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ ),
+ );
+
+ // Plural
+ $data['locales_target']['plural'] = array(
+ 'group' => t('Locale target'),
+ 'title' => t('Plural'),
+ 'help' => t('Whether or not the translation is plural.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Plural'),
+ 'type' => 'yes-no',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_group.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_group.inc
new file mode 100644
index 0000000..1525560
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_group.inc
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * Argument handler to accept a language.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_locale_group extends views_handler_argument {
+ function construct() {
+ parent::construct('group');
+ }
+
+ /**
+ * Override the behavior of summary_name(). Get the user friendly version
+ * of the group.
+ */
+ function summary_name($data) {
+ return $this->locale_group($data->{$this->name_alias});
+ }
+
+ /**
+ * Override the behavior of title(). Get the user friendly version
+ * of the language.
+ */
+ function title() {
+ return $this->locale_group($this->argument);
+ }
+
+ function locale_group($group) {
+ $groups = module_invoke_all('locale', 'groups');
+ // Sort the list.
+ asort($groups);
+ return isset($groups[$group]) ? $groups[$group] : t('Unknown group');
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_language.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_language.inc
new file mode 100644
index 0000000..8d4f38c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_argument_locale_language.inc
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * Argument handler to accept a language.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_locale_language extends views_handler_argument {
+ function construct() {
+ parent::construct('language');
+ }
+
+ /**
+ * Override the behavior of summary_name(). Get the user friendly version
+ * of the language.
+ */
+ function summary_name($data) {
+ return $this->locale_language($data->{$this->name_alias});
+ }
+
+ /**
+ * Override the behavior of title(). Get the user friendly version
+ * of the language.
+ */
+ function title() {
+ return $this->locale_language($this->argument);
+ }
+
+ function locale_language($langcode) {
+ $languages = views_language_list();
+ return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_group.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_group.inc
new file mode 100644
index 0000000..22339e8
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_group.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Field handler to translate a group into its readable form.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_locale_group extends views_handler_field {
+ function render($values) {
+ $groups = module_invoke_all('locale', 'groups');
+ // Sort the list.
+ asort($groups);
+ $value = $this->get_value($values);
+ return isset($groups[$value]) ? $groups[$value] : '';
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_language.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_language.inc
new file mode 100644
index 0000000..0ff36a8
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_language.inc
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * Field handler to translate a language into its readable form.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_locale_language extends views_handler_field {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['native_language'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ $form['native_language'] = array(
+ '#title' => t('Native language'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['native_language'],
+ '#description' => t('If enabled, the native name of the language will be displayed'),
+ );
+ }
+
+ function render($values) {
+ $languages = locale_language_list(empty($this->$options['native_language']) ? 'name' : 'native');
+ $value = $this->get_value($values);
+ return isset($languages[$value]) ? $languages[$value]->name : '';
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc
new file mode 100644
index 0000000..6c8f8f4
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Field handler to present a link to edit a translation.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_locale_link_edit extends views_handler_field {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['lid'] = 'lid';
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['text'] = array('default' => '', 'translatable' => TRUE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['text'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Text to display'),
+ '#default_value' => $this->options['text'],
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function access() {
+ // Ensure user has access to edit translations.
+ return user_access('translate interface');
+ }
+
+ function render($values) {
+ $value = $this->get_value($values, 'lid');
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+
+ function render_link($data, $values) {
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = 'admin/build/translate/edit/' . $data;
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_group.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_group.inc
new file mode 100644
index 0000000..1941549
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_group.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * Filter by locale group.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_locale_group extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_title = t('Group');
+ $groups = module_invoke_all('locale', 'groups');
+ // Sort the list.
+ asort($groups);
+ $this->value_options = $groups;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_language.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_language.inc
new file mode 100644
index 0000000..9c7ba90
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_language.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Filter by language.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_locale_language extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_title = t('Language');
+ $languages = array(
+ '***CURRENT_LANGUAGE***' => t("Current user's language"),
+ '***DEFAULT_LANGUAGE***' => t("Default site language"),
+ LANGUAGE_NONE => t('No language')
+ );
+ $languages = array_merge($languages, views_language_list());
+ $this->value_options = $languages;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_version.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_version.inc
new file mode 100644
index 0000000..d828b2c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/locale/views_handler_filter_locale_version.inc
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * Filter by version.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_locale_version extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_title = t('Version');
+ // Enable filtering by the current installed Drupal version.
+ $versions = array('***CURRENT_VERSION***' => t('Current installed version'));
+ $result = db_query('SELECT DISTINCT(version) FROM {locales_source} ORDER BY version');
+ foreach ($result as $row) {
+ if (!empty($row->version)) {
+ $versions[$row->version] = $row->version;
+ }
+ }
+ $this->value_options = $versions;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views.inc
new file mode 100644
index 0000000..bff3544
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views.inc
@@ -0,0 +1,753 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for node.module
+ */
+
+/**
+ * @defgroup views_node_module node.module handlers
+ *
+ * Includes the tables 'node', 'node_revision' and 'history'.
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function node_views_data() {
+ // ----------------------------------------------------------------
+ // node table -- basic table information.
+
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['node']['table']['group'] = t('Content');
+
+ // Advertise this table as a possible base table
+ $data['node']['table']['base'] = array(
+ 'field' => 'nid',
+ 'title' => t('Content'),
+ 'weight' => -10,
+ 'access query tag' => 'node_access',
+ 'defaults' => array(
+ 'field' => 'title',
+ ),
+ );
+ $data['node']['table']['entity type'] = 'node';
+
+
+ // For other base tables, explain how we join
+ $data['node']['table']['join'] = array(
+ // this explains how the 'node' table (named in the line above)
+ // links toward the node_revision table.
+ 'node_revision' => array(
+ 'handler' => 'views_join', // this is actually optional
+ 'left_table' => 'node_revision', // Because this is a direct link it could be left out.
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ // also supported:
+ // 'type' => 'INNER',
+ // 'extra' => array(array('field' => 'fieldname', 'value' => 'value', 'operator' => '='))
+ // Unfortunately, you can't specify other tables here, but you can construct
+ // alternative joins in the handlers that can do that.
+ // 'table' => 'the actual name of this table in the database',
+ ),
+ );
+
+ // ----------------------------------------------------------------
+ // node table -- fields
+
+ // nid
+ $data['node']['nid'] = array(
+ 'title' => t('Nid'),
+ 'help' => t('The node ID.'), // The help that appears on the UI,
+ // Information for displaying the nid
+ 'field' => array(
+ 'handler' => 'views_handler_field_node',
+ 'click sortable' => TRUE,
+ ),
+ // Information for accepting a nid as an argument
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_nid',
+ 'name field' => 'title', // the field to display in the summary.
+ 'numeric' => TRUE,
+ 'validate type' => 'nid',
+ ),
+ // Information for accepting a nid as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ // Information for sorting on a nid.
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // title
+ // This definition has more items in it than it needs to as an example.
+ $data['node']['title'] = array(
+ 'title' => t('Title'), // The item it appears as on the UI,
+ 'help' => t('The content title.'), // The help that appears on the UI,
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'field' => 'title', // the real field. This could be left out since it is the same.
+ 'group' => t('Content'), // The group it appears in on the UI. Could be left out.
+ 'handler' => 'views_handler_field_node',
+ 'click sortable' => TRUE,
+ 'link_to_node default' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a title as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // created field
+ $data['node']['created'] = array(
+ 'title' => t('Post date'), // The item it appears as on the UI,
+ 'help' => t('The date the content was posted.'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ // changed field
+ $data['node']['changed'] = array(
+ 'title' => t('Updated date'), // The item it appears as on the UI,
+ 'help' => t('The date the content was last updated.'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ // Content type
+ $data['node']['type'] = array(
+ 'title' => t('Type'), // The item it appears as on the UI,
+ 'help' => t('The content type (for example, "blog entry", "forum post", "story", etc).'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_node_type',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_type',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_type',
+ ),
+ );
+
+ // published status
+ $data['node']['status'] = array(
+ 'title' => t('Published'),
+ 'help' => t('Whether or not the content is published.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ 'output formats' => array(
+ 'published-notpublished' => array(t('Published'), t('Not published')),
+ ),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Published'),
+ 'type' => 'yes-no',
+ 'use equal' => TRUE, // Use status = 1 instead of status <> 0 in WHERE statment
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // published status + extra
+ $data['node']['status_extra'] = array(
+ 'title' => t('Published or admin'),
+ 'help' => t('Filters out unpublished content if the current user cannot view it.'),
+ 'filter' => array(
+ 'field' => 'status',
+ 'handler' => 'views_handler_filter_node_status',
+ 'label' => t('Published or admin'),
+ ),
+ );
+
+ // promote status
+ $data['node']['promote'] = array(
+ 'title' => t('Promoted to front page'),
+ 'help' => t('Whether or not the content is promoted to the front page.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ 'output formats' => array(
+ 'promoted-notpromoted' => array(t('Promoted'), t('Not promoted')),
+ ),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Promoted to front page'),
+ 'type' => 'yes-no',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // sticky
+ $data['node']['sticky'] = array(
+ 'title' => t('Sticky'), // The item it appears as on the UI,
+ 'help' => t('Whether or not the content is sticky.'), // The help that appears on the UI,
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ 'output formats' => array(
+ 'sticky' => array(t('Sticky'), ''),
+ ),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Sticky'),
+ 'type' => 'yes-no',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ 'help' => t('Whether or not the content is sticky. To list sticky content first, set this to descending.'),
+ ),
+ );
+
+ // Define some fields based upon views_handler_field_entity in the entity
+ // table so they can be re-used with other query backends.
+ // @see views_handler_field_entity
+
+ $data['node']['view_node']['moved to'] = array('views_entity_node', 'view_node');
+ $data['views_entity_node']['view_node'] = array(
+ 'field' => array(
+ 'title' => t('Link'),
+ 'help' => t('Provide a simple link to the content.'),
+ 'handler' => 'views_handler_field_node_link',
+ ),
+ );
+
+ $data['node']['edit_node']['moved to'] = array('views_entity_node', 'edit_node');
+ $data['views_entity_node']['edit_node'] = array(
+ 'field' => array(
+ 'title' => t('Edit link'),
+ 'help' => t('Provide a simple link to edit the content.'),
+ 'handler' => 'views_handler_field_node_link_edit',
+ ),
+ );
+
+ $data['node']['delete_node']['moved to'] = array('views_entity_node', 'delete_node');
+ $data['views_entity_node']['delete_node'] = array(
+ 'field' => array(
+ 'title' => t('Delete link'),
+ 'help' => t('Provide a simple link to delete the content.'),
+ 'handler' => 'views_handler_field_node_link_delete',
+ ),
+ );
+
+ $data['node']['path'] = array(
+ 'field' => array(
+ 'title' => t('Path'),
+ 'help' => t('The aliased path to this content.'),
+ 'handler' => 'views_handler_field_node_path',
+ ),
+ );
+
+
+ // Bogus fields for aliasing purposes.
+
+ $data['node']['created_fulldate'] = array(
+ 'title' => t('Created date'),
+ 'help' => t('Date in the form of CCYYMMDD.'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_fulldate',
+ ),
+ );
+
+ $data['node']['created_year_month'] = array(
+ 'title' => t('Created year + month'),
+ 'help' => t('Date in the form of YYYYMM.'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_year_month',
+ ),
+ );
+
+ $data['node']['created_year'] = array(
+ 'title' => t('Created year'),
+ 'help' => t('Date in the form of YYYY.'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_year',
+ ),
+ );
+
+ $data['node']['created_month'] = array(
+ 'title' => t('Created month'),
+ 'help' => t('Date in the form of MM (01 - 12).'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_month',
+ ),
+ );
+
+ $data['node']['created_day'] = array(
+ 'title' => t('Created day'),
+ 'help' => t('Date in the form of DD (01 - 31).'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_day',
+ ),
+ );
+
+ $data['node']['created_week'] = array(
+ 'title' => t('Created week'),
+ 'help' => t('Date in the form of WW (01 - 53).'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_week',
+ ),
+ );
+
+ $data['node']['changed_fulldate'] = array(
+ 'title' => t('Updated date'),
+ 'help' => t('Date in the form of CCYYMMDD.'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_fulldate',
+ ),
+ );
+
+ $data['node']['changed_year_month'] = array(
+ 'title' => t('Updated year + month'),
+ 'help' => t('Date in the form of YYYYMM.'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_year_month',
+ ),
+ );
+
+ $data['node']['changed_year'] = array(
+ 'title' => t('Updated year'),
+ 'help' => t('Date in the form of YYYY.'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_year',
+ ),
+ );
+
+ $data['node']['changed_month'] = array(
+ 'title' => t('Updated month'),
+ 'help' => t('Date in the form of MM (01 - 12).'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_month',
+ ),
+ );
+
+ $data['node']['changed_day'] = array(
+ 'title' => t('Updated day'),
+ 'help' => t('Date in the form of DD (01 - 31).'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_day',
+ ),
+ );
+
+ $data['node']['changed_week'] = array(
+ 'title' => t('Updated week'),
+ 'help' => t('Date in the form of WW (01 - 53).'),
+ 'argument' => array(
+ 'field' => 'changed',
+ 'handler' => 'views_handler_argument_node_created_week',
+ ),
+ );
+
+ // uid field
+ $data['node']['uid'] = array(
+ 'title' => t('Author uid'),
+ 'help' => t('The user authoring the content. If you need more fields than the uid add the content: author relationship'),
+ 'relationship' => array(
+ 'title' => t('Author'),
+ 'help' => t('Relate content to the user who created it.'),
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'users',
+ 'field' => 'uid',
+ 'label' => t('author'),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_user_name',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ ),
+ 'field' => array(
+ 'handler' => 'views_handler_field_user',
+ ),
+ );
+
+ $data['node']['uid_revision'] = array(
+ 'title' => t('User has a revision'),
+ 'help' => t('All nodes where a certain user has a revision'),
+ 'real field' => 'nid',
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_uid_revision',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_uid_revision',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // Content revision table
+
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['node_revisions']['moved to'] = 'node_revision';
+ $data['node_revision']['table']['group'] = t('Content revision');
+ // Support the conversion of the field body
+ $data['node_revisions']['body']['moved to'] = array('field_revision_data', 'body-revision_id');
+
+ // Advertise this table as a possible base table
+ $data['node_revision']['table']['base'] = array(
+ 'field' => 'vid',
+ 'title' => t('Content revision'),
+ 'help' => t('Content revision is a history of changes to content.'),
+ 'defaults' => array(
+ 'field' => 'title',
+ ),
+ );
+
+ // For other base tables, explain how we join
+ $data['node_revision']['table']['join'] = array(
+ // Directly links to node table.
+ 'node' => array(
+ 'left_field' => 'vid',
+ 'field' => 'vid',
+ ),
+ );
+
+ // uid field for node revision
+ $data['node_revision']['uid'] = array(
+ 'title' => t('User'),
+ 'help' => t('Relate a content revision to the user who created the revision.'),
+ 'relationship' => array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'users',
+ 'base field' => 'uid',
+ 'label' => t('revision user'),
+ ),
+ );
+
+ // nid
+ $data['node_revision']['vid'] = array(
+ 'title' => t('Vid'),
+ 'help' => t('The revision ID of the content revision.'), // The help that appears on the UI,
+ // Information for displaying the nid
+ 'field' => array(
+ 'click sortable' => TRUE,
+ ),
+ // Information for accepting a nid as an argument
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_vid',
+ 'click sortable' => TRUE,
+ 'numeric' => TRUE,
+ ),
+ // Information for accepting a nid as a filter
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ // Information for sorting on a nid.
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'relationship' => array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'node',
+ 'base field' => 'vid',
+ 'title' => t('Content'),
+ 'label' => t('Get the actual content from a content revision.'),
+ ),
+ );
+
+ // title
+ $data['node_revision']['title'] = array(
+ 'title' => t('Title'), // The item it appears as on the UI,
+ 'help' => t('The content title.'), // The help that appears on the UI,
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'field' => 'title', // the real field
+ 'handler' => 'views_handler_field_node_revision',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // log field
+ $data['node_revision']['log'] = array(
+ 'title' => t('Log message'), // The item it appears as on the UI,
+ 'help' => t('The log message entered when the revision was created.'), // The help that appears on the UI,
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_xss',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // revision timestamp
+ // changed field
+ $data['node_revision']['timestamp'] = array(
+ 'title' => t('Updated date'), // The item it appears as on the UI,
+ 'help' => t('The date the node was last updated.'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ $data['node_revision']['revert_revision'] = array(
+ 'field' => array(
+ 'title' => t('Revert link'),
+ 'help' => t('Provide a simple link to revert to the revision.'),
+ 'handler' => 'views_handler_field_node_revision_link_revert',
+ ),
+ );
+
+ $data['node_revision']['delete_revision'] = array(
+ 'field' => array(
+ 'title' => t('Delete link'),
+ 'help' => t('Provide a simple link to delete the content revision.'),
+ 'handler' => 'views_handler_field_node_revision_link_delete',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // Node access table
+
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['node_access']['table']['group'] = t('Content access');
+
+ // For other base tables, explain how we join
+ $data['node_access']['table']['join'] = array(
+ // Directly links to node table.
+ 'node' => array(
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ ),
+ );
+ // nid field
+ $data['node_access']['nid'] = array(
+ 'title' => t('Access'),
+ 'help' => t('Filter by access.'),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_access',
+ 'help' => t('Filter for content by view access. <strong>Not necessary if you are using node as your base table.</strong>'),
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // History table
+
+ // We're actually defining a specific instance of the table, so let's
+ // alias it so that we can later add the real table for other purposes if we
+ // need it.
+ $data['history_user']['moved to'] = 'history';
+ $data['history']['table']['group'] = t('Content');
+
+ // Explain how this table joins to others.
+ $data['history']['table']['join'] = array(
+ // Directly links to node table.
+ 'node' => array(
+ 'table' => 'history',
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ 'extra' => array(
+ array('field' => 'uid', 'value' => '***CURRENT_USER***', 'numeric' => TRUE),
+ ),
+ ),
+ );
+
+ $data['history']['timestamp'] = array(
+ 'title' => t('Has new content'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_history_user_timestamp',
+ 'help' => t('Show a marker if the content is new or updated.'),
+ ),
+ 'filter' => array(
+ 'help' => t('Show only content that is new or updated.'),
+ 'handler' => 'views_handler_filter_history_user_timestamp',
+ ),
+ );
+ return $data;
+}
+
+/**
+ * Implements hook_views_plugins().
+ */
+function node_views_plugins() {
+ return array(
+ 'module' => 'views', // This just tells our themes are elsewhere.
+ 'row' => array(
+ 'node' => array(
+ 'title' => t('Content'),
+ 'help' => t('Display the content with standard node view.'),
+ 'handler' => 'views_plugin_row_node_view',
+ 'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules
+ 'base' => array('node'), // only works with 'node' as base.
+ 'uses options' => TRUE,
+ 'type' => 'normal',
+ 'help topic' => 'style-node',
+ ),
+ 'node_rss' => array(
+ 'title' => t('Content'),
+ 'help' => t('Display the content with standard node view.'),
+ 'handler' => 'views_plugin_row_node_rss',
+ 'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules
+ 'theme' => 'views_view_row_rss',
+ 'base' => array('node'), // only works with 'node' as base.
+ 'uses options' => TRUE,
+ 'type' => 'feed',
+ 'help topic' => 'style-node-rss',
+ ),
+ ),
+ 'argument validator' => array(
+ 'node' => array(
+ 'title' => t('Content'),
+ 'handler' => 'views_plugin_argument_validate_node',
+ ),
+ ),
+ 'argument default' => array(
+ 'node' => array(
+ 'title' => t('Content ID from URL'),
+ 'handler' => 'views_plugin_argument_default_node'
+ ),
+ ),
+ );
+}
+
+/**
+ * Implements hook_preprocess_node
+ */
+function node_row_node_view_preprocess_node(&$vars) {
+ $node = $vars['node'];
+ $options = $vars['view']->style_plugin->row_plugin->options;
+
+ // Prevent the comment form from showing up if this is not a page display.
+ if ($vars['view_mode'] == 'full' && !$vars['view']->display_handler->has_path()) {
+ $node->comment = FALSE;
+ }
+
+ if (!$options['links']) {
+ unset($vars['content']['links']);
+ }
+
+ if (!empty($options['comments']) && user_access('access comments') && $node->comment) {
+ $vars['content']['comments'] = comment_node_page_additions($node);
+ }
+}
+
+/**
+ * Implements hook_views_query_substitutions().
+ */
+function node_views_query_substitutions() {
+ return array(
+ '***ADMINISTER_NODES***' => intval(user_access('administer nodes')),
+ '***VIEW_OWN_UNPUBLISHED_NODES***' => intval(user_access('view own unpublished content')),
+ '***BYPASS_NODE_ACCESS***' => intval(user_access('bypass node access')),
+ );
+}
+
+/**
+ * Implements hook_views_analyze().
+ */
+function node_views_analyze($view) {
+ $ret = array();
+ // Check for something other than the default display:
+ if ($view->base_table == 'node') {
+ foreach ($view->display as $id => $display) {
+ if (empty($display->handler)) {
+ continue;
+ }
+ if (!$display->handler->is_defaulted('access') || !$display->handler->is_defaulted('filters')) {
+ // check for no access control
+ $access = $display->handler->get_option('access');
+ if (empty($access['type']) || $access['type'] == 'none') {
+ $select = db_select('role', 'r');
+ $select->innerJoin('role_permission', 'p', 'r.rid = p.rid');
+ $result = $select->fields('r', array('name'))
+ ->fields('p', array('permission'))
+ ->condition('r.name', array('anonymous user', 'authenticated user'), 'IN')
+ ->condition('p.permission', 'access content')
+ ->execute();
+
+ foreach ($result as $role) {
+ $role->safe = TRUE;
+ $roles[$role->name] = $role;
+ }
+ if (!($roles['anonymous user']->safe && $roles['authenticated user']->safe)) {
+ $ret[] = views_ui_analysis(t('Some roles lack permission to access content, but display %display has no access control.', array('%display' => $display->display_title)), 'warning');
+ }
+ $filters = $display->handler->get_option('filters');
+ foreach ($filters as $filter) {
+ if ($filter['table'] == 'node' && ($filter['field'] == 'status' || $filter['field'] == 'status_extra')) {
+ continue 2;
+ }
+ }
+ $ret[] = views_ui_analysis(t('Display %display has no access control but does not contain a filter for published nodes.', array('%display' => $display->display_title)), 'warning');
+ }
+ }
+ }
+ }
+ foreach ($view->display as $id => $display) {
+ if ($display->display_plugin == 'page') {
+ if ($display->handler->get_option('path') == 'node/%') {
+ $ret[] = views_ui_analysis(t('Display %display has set node/% as path. This will not produce what you want. If you want to have multiple versions of the node view, use panels.', array('%display' => $display->display_title)), 'warning');
+ }
+ }
+ }
+
+ return $ret;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_default.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_default.inc
new file mode 100644
index 0000000..93886a7
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_default.inc
@@ -0,0 +1,315 @@
+<?php
+
+/**
+ * @file
+ * Bulk export of views_default objects generated by Bulk export module.
+ */
+
+/**
+ * Implementation of hook_views_default_views()
+ */
+function node_views_default_views() {
+ $views = array();
+
+ $view = new view;
+ $view->name = 'archive';
+ $view->description = 'Display a list of months that link to content for that month.';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Archive';
+ $view->core = 0;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['title'] = 'Monthly archive';
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['style_plugin'] = 'default';
+ $handler->display->display_options['row_plugin'] = 'node';
+ /* Sort criterion: Content: Post date */
+ $handler->display->display_options['sorts']['created']['id'] = 'created';
+ $handler->display->display_options['sorts']['created']['table'] = 'node';
+ $handler->display->display_options['sorts']['created']['field'] = 'created';
+ $handler->display->display_options['sorts']['created']['order'] = 'DESC';
+ /* Contextual filter: Content: Created year + month */
+ $handler->display->display_options['arguments']['created_year_month']['id'] = 'created_year_month';
+ $handler->display->display_options['arguments']['created_year_month']['table'] = 'node';
+ $handler->display->display_options['arguments']['created_year_month']['field'] = 'created_year_month';
+ $handler->display->display_options['arguments']['created_year_month']['default_action'] = 'summary';
+ $handler->display->display_options['arguments']['created_year_month']['exception']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['created_year_month']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['created_year_month']['title'] = '%1';
+ $handler->display->display_options['arguments']['created_year_month']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['created_year_month']['summary']['sort_order'] = 'desc';
+ $handler->display->display_options['arguments']['created_year_month']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['created_year_month']['summary_options']['override'] = TRUE;
+ $handler->display->display_options['arguments']['created_year_month']['summary_options']['items_per_page'] = '30';
+ $handler->display->display_options['arguments']['created_year_month']['specify_validation'] = 1;
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = 1;
+ $handler->display->display_options['filters']['status']['group'] = 0;
+ $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page');
+ $handler->display->display_options['path'] = 'archive';
+
+ /* Display: Block */
+ $handler = $view->new_display('block', 'Block', 'block');
+ $handler->display->display_options['defaults']['arguments'] = FALSE;
+ /* Contextual filter: Content: Created year + month */
+ $handler->display->display_options['arguments']['created_year_month']['id'] = 'created_year_month';
+ $handler->display->display_options['arguments']['created_year_month']['table'] = 'node';
+ $handler->display->display_options['arguments']['created_year_month']['field'] = 'created_year_month';
+ $handler->display->display_options['arguments']['created_year_month']['default_action'] = 'summary';
+ $handler->display->display_options['arguments']['created_year_month']['exception']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['created_year_month']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['created_year_month']['title'] = '%1';
+ $handler->display->display_options['arguments']['created_year_month']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['created_year_month']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['created_year_month']['summary_options']['items_per_page'] = '30';
+ $handler->display->display_options['arguments']['created_year_month']['specify_validation'] = 1;
+ $translatables['archive'] = array(
+ t('Master'),
+ t('Monthly archive'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('All'),
+ t('%1'),
+ t('Page'),
+ t('Block'),
+ );
+
+ $views['archive'] = $view;
+
+ $view = new view;
+ $view->name = 'frontpage';
+ $view->description = '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 = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Front page';
+ $view->core = 0;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['style_plugin'] = 'default';
+ $handler->display->display_options['row_plugin'] = 'node';
+ $handler->display->display_options['row_options']['links'] = 1;
+ /* Sort criterion: Content: Sticky */
+ $handler->display->display_options['sorts']['sticky']['id'] = 'sticky';
+ $handler->display->display_options['sorts']['sticky']['table'] = 'node';
+ $handler->display->display_options['sorts']['sticky']['field'] = 'sticky';
+ $handler->display->display_options['sorts']['sticky']['order'] = 'DESC';
+ /* Sort criterion: Content: Post date */
+ $handler->display->display_options['sorts']['created']['id'] = 'created';
+ $handler->display->display_options['sorts']['created']['table'] = 'node';
+ $handler->display->display_options['sorts']['created']['field'] = 'created';
+ $handler->display->display_options['sorts']['created']['order'] = 'DESC';
+ /* Filter criterion: Content: Promoted to front page */
+ $handler->display->display_options['filters']['promote']['id'] = 'promote';
+ $handler->display->display_options['filters']['promote']['table'] = 'node';
+ $handler->display->display_options['filters']['promote']['field'] = 'promote';
+ $handler->display->display_options['filters']['promote']['value'] = '1';
+ $handler->display->display_options['filters']['promote']['group'] = 0;
+ $handler->display->display_options['filters']['promote']['expose']['operator'] = FALSE;
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = '1';
+ $handler->display->display_options['filters']['status']['group'] = 0;
+ $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page');
+ $handler->display->display_options['path'] = 'frontpage';
+
+ /* Display: Feed */
+ $handler = $view->new_display('feed', 'Feed', 'feed');
+ $handler->display->display_options['defaults']['title'] = FALSE;
+ $handler->display->display_options['title'] = 'Front page feed';
+ $handler->display->display_options['pager']['type'] = 'some';
+ $handler->display->display_options['style_plugin'] = 'rss';
+ $handler->display->display_options['row_plugin'] = 'node_rss';
+ $handler->display->display_options['path'] = 'rss.xml';
+ $handler->display->display_options['displays'] = array(
+ 'default' => 'default',
+ 'page' => 'page',
+ );
+ $handler->display->display_options['sitename_title'] = '1';
+ $translatables['frontpage'] = array(
+ t('Master'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('Page'),
+ t('Feed'),
+ t('Front page feed'),
+ );
+
+ $views['frontpage'] = $view;
+
+ $view = new view;
+ $view->name = 'glossary';
+ $view->description = 'A list of all content, by letter.';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Glossary';
+ $view->core = 0;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['use_ajax'] = TRUE;
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = 36;
+ $handler->display->display_options['style_plugin'] = 'table';
+ $handler->display->display_options['style_options']['columns'] = array(
+ 'title' => 'title',
+ 'name' => 'name',
+ 'changed' => 'changed',
+ );
+ $handler->display->display_options['style_options']['default'] = 'title';
+ $handler->display->display_options['style_options']['info'] = array(
+ 'title' => array(
+ 'sortable' => 1,
+ 'separator' => '',
+ ),
+ 'name' => array(
+ 'sortable' => 1,
+ 'separator' => '',
+ ),
+ 'changed' => array(
+ 'sortable' => 1,
+ 'separator' => '',
+ ),
+ );
+ $handler->display->display_options['style_options']['override'] = 1;
+ $handler->display->display_options['style_options']['sticky'] = 0;
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['link_to_node'] = 1;
+ /* Field: User: Name */
+ $handler->display->display_options['fields']['name']['id'] = 'name';
+ $handler->display->display_options['fields']['name']['table'] = 'users';
+ $handler->display->display_options['fields']['name']['field'] = 'name';
+ $handler->display->display_options['fields']['name']['label'] = 'Author';
+ $handler->display->display_options['fields']['name']['link_to_user'] = 1;
+ /* Field: Content: Updated date */
+ $handler->display->display_options['fields']['changed']['id'] = 'changed';
+ $handler->display->display_options['fields']['changed']['table'] = 'node';
+ $handler->display->display_options['fields']['changed']['field'] = 'changed';
+ $handler->display->display_options['fields']['changed']['label'] = 'Last update';
+ $handler->display->display_options['fields']['changed']['date_format'] = 'large';
+ /* Contextual filter: Content: Title */
+ $handler->display->display_options['arguments']['title']['id'] = 'title';
+ $handler->display->display_options['arguments']['title']['table'] = 'node';
+ $handler->display->display_options['arguments']['title']['field'] = 'title';
+ $handler->display->display_options['arguments']['title']['default_action'] = 'default';
+ $handler->display->display_options['arguments']['title']['exception']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['title']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['title']['default_argument_options']['argument'] = 'a';
+ $handler->display->display_options['arguments']['title']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['title']['specify_validation'] = 1;
+ $handler->display->display_options['arguments']['title']['glossary'] = 1;
+ $handler->display->display_options['arguments']['title']['limit'] = '1';
+ $handler->display->display_options['arguments']['title']['case'] = 'upper';
+ $handler->display->display_options['arguments']['title']['path_case'] = 'lower';
+ $handler->display->display_options['arguments']['title']['transform_dash'] = 0;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page');
+ $handler->display->display_options['path'] = 'glossary';
+ $handler->display->display_options['menu']['type'] = 'normal';
+ $handler->display->display_options['menu']['title'] = 'Glossary';
+ $handler->display->display_options['menu']['weight'] = '0';
+
+ /* Display: Attachment */
+ $handler = $view->new_display('attachment', 'Attachment', 'attachment');
+ $handler->display->display_options['pager']['type'] = 'none';
+ $handler->display->display_options['pager']['options']['offset'] = '0';
+ $handler->display->display_options['defaults']['arguments'] = FALSE;
+ /* Contextual filter: Content: Title */
+ $handler->display->display_options['arguments']['title']['id'] = 'title';
+ $handler->display->display_options['arguments']['title']['table'] = 'node';
+ $handler->display->display_options['arguments']['title']['field'] = 'title';
+ $handler->display->display_options['arguments']['title']['default_action'] = 'summary';
+ $handler->display->display_options['arguments']['title']['exception']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['title']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['title']['default_argument_options']['argument'] = 'a';
+ $handler->display->display_options['arguments']['title']['summary']['format'] = 'unformatted_summary';
+ $handler->display->display_options['arguments']['title']['summary_options']['items_per_page'] = '25';
+ $handler->display->display_options['arguments']['title']['summary_options']['inline'] = 1;
+ $handler->display->display_options['arguments']['title']['summary_options']['separator'] = ' | ';
+ $handler->display->display_options['arguments']['title']['specify_validation'] = 1;
+ $handler->display->display_options['arguments']['title']['glossary'] = 1;
+ $handler->display->display_options['arguments']['title']['limit'] = '1';
+ $handler->display->display_options['arguments']['title']['case'] = 'upper';
+ $handler->display->display_options['arguments']['title']['path_case'] = 'lower';
+ $handler->display->display_options['arguments']['title']['transform_dash'] = 0;
+ $handler->display->display_options['displays'] = array(
+ 'default' => 'default',
+ 'page' => 'page',
+ );
+ $handler->display->display_options['inherit_arguments'] = 0;
+ $translatables['glossary'] = array(
+ t('Master'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('Title'),
+ t('Author'),
+ t('Last update'),
+ t('All'),
+ t('Page'),
+ t('Attachment'),
+ );
+
+ $views['glossary'] = $view;
+
+ return $views;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_template.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_template.inc
new file mode 100644
index 0000000..ca0ed75
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node.views_template.inc
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @file
+ * Contains views templates on behalf of the node module.
+ */
+function node_views_templates() {
+ // Only the standard install profile has the image field provided so only show it for it.
+ if (variable_get('install_profile', 'standard') != 'standard') {
+ return array();
+ }
+ $view = new view;
+ $view->name = 'image_gallery';
+ $view->description = 'Shows all images which was uploaded on the "field_image" field';
+ $view->tag = '';
+ $view->base_table = 'node';
+ $view->human_name = 'Image Gallery';
+ $view->core = 7;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Defaults */
+ $handler = $view->new_display('default', 'Defaults', 'default');
+ $handler->display->display_options['title'] = 'Image gallery';
+ $handler->display->display_options['access']['type'] = 'perm';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = '24';
+ $handler->display->display_options['pager']['options']['offset'] = '0';
+ $handler->display->display_options['pager']['options']['id'] = '0';
+ $handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
+ $handler->display->display_options['style_plugin'] = 'grid';
+ $handler->display->display_options['style_options']['fill_single_line'] = 1;
+ $handler->display->display_options['row_plugin'] = 'fields';
+ /* Field: Content: Image */
+ $handler->display->display_options['fields']['field_image']['id'] = 'field_image';
+ $handler->display->display_options['fields']['field_image']['table'] = 'field_data_field_image';
+ $handler->display->display_options['fields']['field_image']['field'] = 'field_image';
+ $handler->display->display_options['fields']['field_image']['label'] = '';
+ $handler->display->display_options['fields']['field_image']['alter']['alter_text'] = 0;
+ $handler->display->display_options['fields']['field_image']['alter']['make_link'] = 0;
+ $handler->display->display_options['fields']['field_image']['alter']['absolute'] = 0;
+ $handler->display->display_options['fields']['field_image']['alter']['external'] = 0;
+ $handler->display->display_options['fields']['field_image']['alter']['trim'] = 0;
+ $handler->display->display_options['fields']['field_image']['alter']['nl2br'] = 0;
+ $handler->display->display_options['fields']['field_image']['alter']['word_boundary'] = 1;
+ $handler->display->display_options['fields']['field_image']['alter']['ellipsis'] = 1;
+ $handler->display->display_options['fields']['field_image']['alter']['strip_tags'] = 0;
+ $handler->display->display_options['fields']['field_image']['alter']['html'] = 0;
+ $handler->display->display_options['fields']['field_image']['element_label_colon'] = 1;
+ $handler->display->display_options['fields']['field_image']['element_default_classes'] = 1;
+ $handler->display->display_options['fields']['field_image']['hide_empty'] = 0;
+ $handler->display->display_options['fields']['field_image']['empty_zero'] = 0;
+ $handler->display->display_options['fields']['field_image']['click_sort_column'] = 'fid';
+ $handler->display->display_options['fields']['field_image']['settings'] = array(
+ 'image_style' => 'thumbnail',
+ 'image_link' => 'content',
+ );
+ $handler->display->display_options['fields']['field_image']['field_api_classes'] = 0;
+ /* Field: User: Name */
+ $handler->display->display_options['fields']['name']['id'] = 'name';
+ $handler->display->display_options['fields']['name']['table'] = 'users';
+ $handler->display->display_options['fields']['name']['field'] = 'name';
+ $handler->display->display_options['fields']['name']['label'] = 'Author';
+ $handler->display->display_options['fields']['name']['alter']['alter_text'] = 0;
+ $handler->display->display_options['fields']['name']['alter']['make_link'] = 0;
+ $handler->display->display_options['fields']['name']['alter']['absolute'] = 0;
+ $handler->display->display_options['fields']['name']['alter']['external'] = 0;
+ $handler->display->display_options['fields']['name']['alter']['trim'] = 0;
+ $handler->display->display_options['fields']['name']['alter']['nl2br'] = 0;
+ $handler->display->display_options['fields']['name']['alter']['word_boundary'] = 1;
+ $handler->display->display_options['fields']['name']['alter']['ellipsis'] = 1;
+ $handler->display->display_options['fields']['name']['alter']['strip_tags'] = 0;
+ $handler->display->display_options['fields']['name']['alter']['html'] = 0;
+ $handler->display->display_options['fields']['name']['element_label_colon'] = 1;
+ $handler->display->display_options['fields']['name']['element_default_classes'] = 1;
+ $handler->display->display_options['fields']['name']['hide_empty'] = 0;
+ $handler->display->display_options['fields']['name']['empty_zero'] = 0;
+ $handler->display->display_options['fields']['name']['link_to_user'] = 1;
+ $handler->display->display_options['fields']['name']['overwrite_anonymous'] = 0;
+ /* Contextual filter: Content: Has taxonomy term ID */
+ $handler->display->display_options['arguments']['tid']['id'] = 'tid';
+ $handler->display->display_options['arguments']['tid']['table'] = 'taxonomy_index';
+ $handler->display->display_options['arguments']['tid']['field'] = 'tid';
+ $handler->display->display_options['arguments']['tid']['default_action'] = 'summary';
+ $handler->display->display_options['arguments']['tid']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['tid']['default_argument_skip_url'] = 0;
+ $handler->display->display_options['arguments']['tid']['summary']['number_of_records'] = '1';
+ $handler->display->display_options['arguments']['tid']['summary']['format'] = 'unformatted_summary';
+ $handler->display->display_options['arguments']['tid']['summary_options']['items_per_page'] = '25';
+ $handler->display->display_options['arguments']['tid']['summary_options']['inline'] = 0;
+ $handler->display->display_options['arguments']['tid']['break_phrase'] = 0;
+ $handler->display->display_options['arguments']['tid']['add_table'] = 0;
+ $handler->display->display_options['arguments']['tid']['require_value'] = 0;
+ $handler->display->display_options['arguments']['tid']['reduce_duplicates'] = 0;
+ $handler->display->display_options['arguments']['tid']['set_breadcrumb'] = 0;
+ /* Filter criterion: Content: Image (field_image) - fid */
+ $handler->display->display_options['filters']['field_image_fid']['id'] = 'field_image_fid';
+ $handler->display->display_options['filters']['field_image_fid']['table'] = 'field_data_field_image';
+ $handler->display->display_options['filters']['field_image_fid']['field'] = 'field_image_fid';
+ $handler->display->display_options['filters']['field_image_fid']['operator'] = 'not empty';
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = '1';
+
+ /* Display: Gallery page */
+ $handler = $view->new_display('page', 'Gallery page', 'page_1');
+ $handler->display->display_options['path'] = 'gallery';
+ $translatables['image_gallery'] = array(
+ t('Defaults'),
+ t('Image gallery'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('Author'),
+ t('All'),
+ t('Gallery page'),
+ );
+
+ $views[$view->name] = $view;
+
+ return $views;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_dates_various.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_dates_various.inc
new file mode 100644
index 0000000..95404f1
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_dates_various.inc
@@ -0,0 +1,179 @@
+<?php
+/**
+ * @defgroup views_argument_handlers Handlers for arguments
+ * @{
+ */
+
+/**
+ * @file
+ * Argument handler for a full date (CCYYMMDD)
+ */
+class views_handler_argument_node_created_fulldate extends views_handler_argument_date {
+ /**
+ * Constructor implementation
+ */
+ function construct() {
+ parent::construct();
+ $this->format = 'F j, Y';
+ $this->arg_format = 'Ymd';
+ $this->formula = views_date_sql_format($this->arg_format, "***table***.$this->real_field");
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function summary_name($data) {
+ $created = $data->{$this->name_alias};
+ return format_date(strtotime($created . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function title() {
+ return format_date(strtotime($this->argument . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
+ }
+}
+
+/**
+ * Argument handler for a year (CCYY)
+ */
+class views_handler_argument_node_created_year extends views_handler_argument_date {
+ /**
+ * Constructor implementation
+ */
+ function construct() {
+ parent::construct();
+ $this->arg_format = 'Y';
+ $this->formula = views_date_sql_extract('YEAR', "***table***.$this->real_field");
+ }
+}
+
+/**
+ * Argument handler for a year plus month (CCYYMM)
+ */
+class views_handler_argument_node_created_year_month extends views_handler_argument_date {
+ /**
+ * Constructor implementation
+ */
+ function construct() {
+ parent::construct();
+ $this->format = 'F Y';
+ $this->arg_format = 'Ym';
+ $this->formula = views_date_sql_format($this->arg_format, "***table***.$this->real_field");
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function summary_name($data) {
+ $created = $data->{$this->name_alias};
+ return format_date(strtotime($created . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function title() {
+ return format_date(strtotime($this->argument . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
+ }
+}
+
+/**
+ * Argument handler for a month (MM)
+ */
+class views_handler_argument_node_created_month extends views_handler_argument_date {
+ /**
+ * Constructor implementation
+ */
+ function construct() {
+ parent::construct();
+ $this->formula = views_date_sql_extract('MONTH', "***table***.$this->real_field");
+ $this->format = 'F';
+ $this->arg_format = 'm';
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function summary_name($data) {
+ $month = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
+ return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC" ), 'custom', $this->format, 'UTC');
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function title() {
+ $month = str_pad($this->argument, 2, '0', STR_PAD_LEFT);
+ return format_date(strtotime("2005" . $month . "15" . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
+ }
+
+ function summary_argument($data) {
+ // Make sure the argument contains leading zeroes.
+ return str_pad($data->{$this->base_alias}, 2, '0', STR_PAD_LEFT);
+ }
+}
+
+/**
+ * Argument handler for a day (DD)
+ */
+class views_handler_argument_node_created_day extends views_handler_argument_date {
+ /**
+ * Constructor implementation
+ */
+ function construct() {
+ parent::construct();
+ $this->formula = views_date_sql_extract('DAY', "***table***.$this->real_field");
+ $this->format = 'j';
+ $this->arg_format = 'd';
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function summary_name($data) {
+ $day = str_pad($data->{$this->name_alias}, 2, '0', STR_PAD_LEFT);
+ // strtotime respects server timezone, so we need to set the time fixed as utc time
+ return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function title() {
+ $day = str_pad($this->argument, 2, '0', STR_PAD_LEFT);
+ return format_date(strtotime("2005" . "05" . $day . " 00:00:00 UTC"), 'custom', $this->format, 'UTC');
+ }
+
+ function summary_argument($data) {
+ // Make sure the argument contains leading zeroes.
+ return str_pad($data->{$this->base_alias}, 2, '0', STR_PAD_LEFT);
+ }
+}
+
+/**
+ * Argument handler for a week.
+ */
+class views_handler_argument_node_created_week extends views_handler_argument_date {
+ /**
+ * Constructor implementation
+ */
+ function construct() {
+ parent::construct();
+ $this->arg_format = 'w';
+ $this->formula = views_date_sql_extract('WEEK', "***table***.$this->real_field");
+ }
+
+ /**
+ * Provide a link to the next level of the view
+ */
+ function summary_name($data) {
+ $created = $data->{$this->name_alias};
+ return t('Week @week', array('@week' => $created));
+ }
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_language.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_language.inc
new file mode 100644
index 0000000..1978168
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_language.inc
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Argument handler to accept a language.
+ */
+class views_handler_argument_node_language extends views_handler_argument {
+ function construct() {
+ parent::construct('language');
+ }
+
+ /**
+ * Override the behavior of summary_name(). Get the user friendly version
+ * of the language.
+ */
+ function summary_name($data) {
+ return $this->node_language($data->{$this->name_alias});
+ }
+
+ /**
+ * Override the behavior of title(). Get the user friendly version of the
+ * node type.
+ */
+ function title() {
+ return $this->node_language($this->argument);
+ }
+
+ function node_language($langcode) {
+ $languages = views_language_list();
+ return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_nid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_nid.inc
new file mode 100644
index 0000000..991bc8d
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_nid.inc
@@ -0,0 +1,23 @@
+<?php
+/**
+ * @file
+ * Provide node nid argument handler.
+ */
+
+/**
+ * Argument handler to accept a node id.
+ */
+class views_handler_argument_node_nid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title(). Get the title of the node.
+ */
+ function title_query() {
+ $titles = array();
+
+ $result = db_query("SELECT n.title FROM {node} n WHERE n.nid IN (:nids)", array(':nids' => $this->value));
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->title);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_type.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_type.inc
new file mode 100644
index 0000000..638973d
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_type.inc
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Argument handler to accept a node type.
+ */
+class views_handler_argument_node_type extends views_handler_argument {
+ function construct() {
+ parent::construct('type');
+ }
+
+ /**
+ * Override the behavior of summary_name(). Get the user friendly version
+ * of the node type.
+ */
+ function summary_name($data) {
+ return $this->node_type($data->{$this->name_alias});
+ }
+
+ /**
+ * Override the behavior of title(). Get the user friendly version of the
+ * node type.
+ */
+ function title() {
+ return $this->node_type($this->argument);
+ }
+
+ function node_type($type) {
+ $output = node_type_get_name($type);
+ if (empty($output)) {
+ $output = t('Unknown content type');
+ }
+ return check_plain($output);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_uid_revision.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_uid_revision.inc
new file mode 100644
index 0000000..995872c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_uid_revision.inc
@@ -0,0 +1,14 @@
+<?php
+// $Id$
+
+/**
+ * Filter handler to accept a user id to check for nodes that
+ * user posted or created a revision on.
+ */
+class views_handler_argument_node_uid_revision extends views_handler_argument_comment_user_uid {
+ function query($group_by = FALSE) {
+ $this->ensure_my_table();
+ $placeholder = $this->placeholder();
+ $this->query->add_where_expression(0, "$this->table_alias.uid = $placeholder OR ((SELECT COUNT(*) FROM {node_revision} nr WHERE nr.uid = $placeholder AND nr.nid = $this->table_alias.nid) > 0)", array($placeholder => $this->argument));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_vid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_vid.inc
new file mode 100644
index 0000000..55db56a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_argument_node_vid.inc
@@ -0,0 +1,25 @@
+<?php
+/**
+ * @file
+ * Provide node vid argument handler.
+ */
+
+/**
+ * Argument handler to accept a node revision id.
+ */
+class views_handler_argument_node_vid extends views_handler_argument_numeric {
+ // No constructor is necessary.
+
+ /**
+ * Override the behavior of title(). Get the title of the revision.
+ */
+ function title_query() {
+ $titles = array();
+
+ $result = db_query("SELECT n.title FROM {node_revision} n WHERE n.nid IN (:nids)", array(':nids' => $this->value));
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->title);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_history_user_timestamp.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_history_user_timestamp.inc
new file mode 100644
index 0000000..45f6c56
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_history_user_timestamp.inc
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Field handler to display the marker for new content.
+ *
+ * The handler is named history_user, because of compability reasons, the table is history.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_history_user_timestamp extends views_handler_field_node {
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ global $user;
+ if ($user->uid) {
+ $this->additional_fields['created'] = array('table' => 'node', 'field' => 'created');
+ $this->additional_fields['changed'] = array('table' => 'node', 'field' => 'changed');
+ if (module_exists('comment') && !empty($this->options['comments'])) {
+ $this->additional_fields['last_comment'] = array('table' => 'node_comment_statistics', 'field' => 'last_comment_timestamp');
+ }
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['comments'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ if (module_exists('comment')) {
+ $form['comments'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Check for new comments as well'),
+ '#default_value' => !empty($this->options['comments']),
+ '#fieldset' => 'more',
+ );
+ }
+ }
+
+ function query() {
+ // Only add ourselves to the query if logged in.
+ global $user;
+ if (!$user->uid) {
+ return;
+ }
+ parent::query();
+ }
+
+ function render($values) {
+ // Let's default to 'read' state.
+ // This code shadows node_mark, but it reads from the db directly and
+ // we already have that info.
+ $mark = MARK_READ;
+ global $user;
+ if ($user->uid) {
+ $last_read = $this->get_value($values);
+ $created = $this->get_value($values, 'created');
+ $changed = $this->get_value($values, 'changed');
+
+ $last_comment = module_exists('comment') && !empty($this->options['comments']) ? $this->get_value($values, 'last_comment') : 0;
+
+ if (!$last_read && $created > NODE_NEW_LIMIT) {
+ $mark = MARK_NEW;
+ }
+ elseif ($changed > $last_read && $changed > NODE_NEW_LIMIT) {
+ $mark = MARK_UPDATED;
+ }
+ elseif ($last_comment > $last_read && $last_comment > NODE_NEW_LIMIT) {
+ $mark = MARK_UPDATED;
+ }
+ return $this->render_link(theme('mark', array('type' => $mark)), $values);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node.inc
new file mode 100644
index 0000000..eb90f01
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node.inc
@@ -0,0 +1,79 @@
+<?php
+/**
+ * @file
+ * Contains the basic 'node' field handler.
+ */
+
+/**
+ * Field handler to provide simple renderer that allows linking to a node.
+ * Definition terms:
+ * - link_to_node default: Should this field have the checkbox "link to node" enabled by default.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node extends views_handler_field {
+
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ // Don't add the additional fields to groupby
+ if (!empty($this->options['link_to_node'])) {
+ $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');
+ if (module_exists('translation')) {
+ $this->additional_fields['language'] = array('table' => 'node', 'field' => 'language');
+ }
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_node'] = array('default' => isset($this->definition['link_to_node default']) ? $this->definition['link_to_node default'] : FALSE);
+ return $options;
+ }
+
+ /**
+ * Provide link to node option
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_node'] = array(
+ '#title' => t('Link this field to the original piece of content'),
+ '#description' => t("Enable to override this field's links."),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['link_to_node']),
+ );
+
+ parent::options_form($form, $form_state);
+ }
+
+ /**
+ * Render whatever the data is as a link to the node.
+ *
+ * Data should be made XSS safe prior to calling this function.
+ */
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_node']) && !empty($this->additional_fields['nid'])) {
+ if ($data !== NULL && $data !== '') {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/" . $this->get_value($values, 'nid');
+ if (isset($this->aliases['language'])) {
+ $languages = language_list();
+ $language = $this->get_value($values, 'language');
+ if (isset($languages[$language])) {
+ $this->options['alter']['language'] = $languages[$language];
+ }
+ else {
+ unset($this->options['alter']['language']);
+ }
+ }
+ }
+ else {
+ $this->options['alter']['make_link'] = FALSE;
+ }
+ }
+ return $data;
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link.inc
new file mode 100644
index 0000000..ee9c2b9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link.inc
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Field handler to present a link to the node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_link extends views_handler_field_entity {
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['text'] = array('default' => '', 'translatable' => TRUE);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['text'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Text to display'),
+ '#default_value' => $this->options['text'],
+ );
+ parent::options_form($form, $form_state);
+
+ // The path is set by render_link function so don't allow to set it.
+ $form['alter']['path'] = array('#access' => FALSE);
+ $form['alter']['external'] = array('#access' => FALSE);
+ }
+
+ function render($values) {
+ if ($entity = $this->get_value($values)) {
+ return $this->render_link($entity, $values);
+ }
+ }
+
+ function render_link($node, $values) {
+ if (node_access('view', $node)) {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/$node->nid";
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
+ return $text;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_delete.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_delete.inc
new file mode 100644
index 0000000..3e8075c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_delete.inc
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Field handler to present a link to delete a node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_link_delete extends views_handler_field_node_link {
+
+ /**
+ * Renders the link.
+ */
+ function render_link($node, $values) {
+ // Ensure user has access to delete this node.
+ if (!node_access('delete', $node)) {
+ return;
+ }
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/$node->nid/delete";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_edit.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_edit.inc
new file mode 100644
index 0000000..f082c31
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_link_edit.inc
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Field handler to present a link node edit.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_link_edit extends views_handler_field_node_link {
+
+ /**
+ * Renders the link.
+ */
+ function render_link($node, $values) {
+ // Ensure user has access to edit this node.
+ if (!node_access('update', $node)) {
+ return;
+ }
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/$node->nid/edit";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_path.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_path.inc
new file mode 100644
index 0000000..725869b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_path.inc
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * @file
+ * Handler for node path field.
+ */
+
+/**
+ * Field handler to present the path to the node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_path extends views_handler_field {
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['absolute'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function construct() {
+ parent::construct();
+ $this->additional_fields['nid'] = 'nid';
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ $form['absolute'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Use absolute link (begins with "http://")'),
+ '#default_value' => $this->options['absolute'],
+ '#description' => t('Enable this option to output an absolute link. Required if you want to use the path as a link destination (as in "output this field as a link" above).'),
+ '#fieldset' => 'alter',
+ );
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function render($values) {
+ $nid = $this->get_value($values, 'nid');
+ return url("node/$nid", array('absolute' => $this->options['absolute']));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision.inc
new file mode 100644
index 0000000..3195e64
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision.inc
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Contains the basic 'node_revision' field handler.
+ */
+
+/**
+ * A basic node_revision handler.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_revision extends views_handler_field_node {
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ if (!empty($this->options['link_to_node_revision'])) {
+ $this->additional_fields['vid'] = 'vid';
+ $this->additional_fields['nid'] = 'nid';
+ if (module_exists('translation')) {
+ $this->additional_fields['language'] = array('table' => 'node', 'field' => 'language');
+ }
+ }
+ }
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_node_revision'] = array('default' => FALSE);
+ return $options;
+ }
+
+ /**
+ * Provide link to revision option.
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_node_revision'] = array(
+ '#title' => t('Link this field to its content revision'),
+ '#description' => t('This will override any other link you have set.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['link_to_node_revision']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ /**
+ * Render whatever the data is as a link to the node.
+ *
+ * Data should be made XSS safe prior to calling this function.
+ */
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_node_revision']) && $data !== NULL && $data !== '') {
+ $this->options['alter']['make_link'] = TRUE;
+ $nid = $this->get_value($values, 'nid');
+ $vid = $this->get_value($values, 'vid');
+ $this->options['alter']['path'] = "node/" . $nid . '/revisions/' . $vid . '/view';
+ if (module_exists('translation')) {
+ $language = $this->get_value($values, 'language');
+ $languages = language_list();
+ if (isset($languages[$language])) {
+ $this->options['alter']['language'] = $languages[$language];
+ }
+ }
+ }
+ else {
+ return parent::render_link($data, $values);
+ }
+ return $data;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_delete.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_delete.inc
new file mode 100644
index 0000000..b005c2e
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_delete.inc
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Field handler to present delete a node revision.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_revision_link_delete extends views_handler_field_node_link {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['node_vid'] = array('table' => 'node', 'field' => 'vid');
+ }
+
+ function access() {
+ return user_access('delete revisions') || user_access('administer nodes');
+ }
+
+ function render_link($data, $values) {
+ // ensure user has access to delete this node.
+ $node = $this->get_value($values);
+ $node->status = 1; // unpublished nodes ignore access control
+ if (!node_access('delete', $node)) {
+ return;
+ }
+
+ // Current revision cannot be deleted.
+ if ($node->vid == $this->get_value($values, 'node_vid')) {
+ return;
+ }
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/$node->nid/revisions/$node->vid/delete";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_revert.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_revert.inc
new file mode 100644
index 0000000..f26c0a3
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_revision_link_revert.inc
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Field handler to present a link to revert a node to a revision.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_revision_link_revert extends views_handler_field_node_link {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['node_vid'] = array('table' => 'node', 'field' => 'vid');
+ }
+
+ function access() {
+ return user_access('revert revisions') || user_access('administer nodes');
+ }
+
+ function render_link($data, $values) {
+ // ensure user has access to edit this node.
+ $node = $this->get_value($values);
+ $node->status = 1; // unpublished nodes ignore access control
+ if (!node_access('update', $node)) {
+ return;
+ }
+
+ // Current revision cannot be reverted.
+ if ($node->vid == $this->get_value($values, 'node_vid')) {
+ return;
+ }
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('revert');
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/$node->nid/revisions/$node->vid/revert";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_type.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_type.inc
new file mode 100644
index 0000000..6d6202a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_field_node_type.inc
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * Field handler to translate a node type into its readable form.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_type extends views_handler_field_node {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['machine_name'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ /**
+ * Provide machine_name option for to node type display.
+ */
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $form['machine_name'] = array(
+ '#title' => t('Output machine name'),
+ '#description' => t('Display field as the content type machine name.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['machine_name']),
+ '#fieldset' => 'more',
+ );
+ }
+
+ /**
+ * Render node type as human readable name, unless using machine_name option.
+ */
+ function render_name($data, $values) {
+ if ($this->options['machine_name'] != 1 && $data !== NULL && $data !== '') {
+ return t($this->sanitize_value(node_type_get_name($data)));
+ }
+ return $this->sanitize_value($data);
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->render_name($value, $values), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_history_user_timestamp.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_history_user_timestamp.inc
new file mode 100644
index 0000000..a13f531
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_history_user_timestamp.inc
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Filter for new content
+ *
+ * The handler is named history_user, because of compability reasons, the table is history.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_history_user_timestamp extends views_handler_filter {
+ // Don't display empty space where the operator would be.
+ var $no_operator = TRUE;
+
+ function expose_form(&$form, &$form_state) {
+ parent::expose_form($form, $form_state);
+ // @todo There are better ways of excluding required and multiple (object flags)
+ unset($form['expose']['required']);
+ unset($form['expose']['multiple']);
+ unset($form['expose']['remember']);
+ }
+
+ function value_form(&$form, &$form_state) {
+ // Only present a checkbox for the exposed filter itself. There's no way
+ // to tell the difference between not checked and the default value, so
+ // specifying the default value via the views UI is meaningless.
+ if (!empty($form_state['exposed'])) {
+ if (isset($this->options['expose']['label'])) {
+ $label = $this->options['expose']['label'];
+ }
+ else {
+ $label = t('Has new content');
+ }
+ $form['value'] = array(
+ '#type' => 'checkbox',
+ '#title' => $label,
+ '#default_value' => $this->value,
+ );
+ }
+ }
+
+ function query() {
+ global $user;
+ // This can only work if we're logged in.
+ if (!$user || !$user->uid) {
+ return;
+ }
+
+ // Don't filter if we're exposed and the checkbox isn't selected.
+ if ((!empty($this->options['exposed'])) && empty($this->value)) {
+ return;
+ }
+
+ // Hey, Drupal kills old history, so nodes that haven't been updated
+ // since NODE_NEW_LIMIT are bzzzzzzzt outta here!
+
+ $limit = REQUEST_TIME - NODE_NEW_LIMIT;
+
+ $this->ensure_my_table();
+ $field = "$this->table_alias.$this->real_field";
+ $node = $this->query->ensure_table('node', $this->relationship);
+
+ $clause = '';
+ $clause2 = '';
+ if (module_exists('comment')) {
+ $ncs = $this->query->ensure_table('node_comment_statistics', $this->relationship);
+ $clause = ("OR $ncs.last_comment_timestamp > (***CURRENT_TIME*** - $limit)");
+ $clause2 = "OR $field < $ncs.last_comment_timestamp";
+ }
+
+ // NULL means a history record doesn't exist. That's clearly new content.
+ // Unless it's very very old content. Everything in the query is already
+ // type safe cause none of it is coming from outside here.
+ $this->query->add_where_expression($this->options['group'], "($field IS NULL AND ($node.changed > (***CURRENT_TIME*** - $limit) $clause)) OR $field < $node.changed $clause2");
+ }
+
+ function admin_summary() {
+ if (!empty($this->options['exposed'])) {
+ return t('exposed');
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_access.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_access.inc
new file mode 100644
index 0000000..37306f8
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_access.inc
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Filter by node_access records.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_access extends views_handler_filter {
+ function admin_summary() { }
+ function operator_form(&$form, &$form_state) { }
+ function can_expose() {
+ return FALSE;
+ }
+
+ /**
+ * See _node_access_where_sql() for a non-views query based implementation.
+ */
+ function query() {
+ if (!user_access('administer nodes')) {
+ $table = $this->ensure_my_table();
+ $grants = db_or();
+ foreach (node_access_grants('view') as $realm => $gids) {
+ foreach ($gids as $gid) {
+ $grants->condition(db_and()
+ ->condition($table . '.gid', $gid)
+ ->condition($table . '.realm', $realm)
+ );
+ }
+ }
+
+ $this->query->add_where('AND', $grants);
+ $this->query->add_where('AND', $table . '.grant_view', 1, '>=');
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc
new file mode 100644
index 0000000..0babe5b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Filter by published status
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_status extends views_handler_filter {
+ function admin_summary() { }
+ function operator_form(&$form, &$form_state) { }
+ function can_expose() { return FALSE; }
+
+ function query() {
+ $table = $this->ensure_my_table();
+ $this->query->add_where_expression($this->options['group'], "$table.status = 1 OR ($table.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0 AND ***VIEW_OWN_UNPUBLISHED_NODES*** = 1) OR ***BYPASS_NODE_ACCESS*** = 1");
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_type.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_type.inc
new file mode 100644
index 0000000..8312691
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_type.inc
@@ -0,0 +1,19 @@
+<?php
+/**
+ * Filter by node type
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_type extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_title = t('Content types');
+ $types = node_type_get_types();
+ foreach ($types as $type => $info) {
+ $options[$type] = t($info->name);
+ }
+ asort($options);
+ $this->value_options = $options;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc
new file mode 100644
index 0000000..9c6055c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc
@@ -0,0 +1,24 @@
+<?php
+/**
+ * @file
+ * Contains handler views_handler_filter_node_uid_revision.
+ */
+
+/**
+ * Filter handler to check for revisions a certain user has created.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_uid_revision extends views_handler_filter_user_name {
+ function query($group_by = FALSE) {
+ $this->ensure_my_table();
+
+ $placeholder = $this->placeholder();
+
+ $args = array_values($this->value);
+
+ $this->query->add_where_expression($this->options['group'], "$this->table_alias.uid IN($placeholder) " . $condition . " OR
+ ((SELECT COUNT(*) FROM {node_revision} nr WHERE nr.uid IN($placeholder) AND nr.nid = $this->table_alias.nid) > 0)", array($placeholder => $args),
+ $args);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_default_node.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_default_node.inc
new file mode 100644
index 0000000..f88af08
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_default_node.inc
@@ -0,0 +1,25 @@
+<?php
+/**
+ * @file
+ * Contains the node from URL argument default plugin.
+ */
+
+/**
+ * Default argument plugin to extract a node via menu_get_object
+ *
+ * This plugin actually has no options so it odes not need to do a great deal.
+ */
+class views_plugin_argument_default_node extends views_plugin_argument_default {
+ function get_argument() {
+ foreach (range(1, 3) as $i) {
+ $node = menu_get_object('node', $i);
+ if (!empty($node)) {
+ return $node->nid;
+ }
+ }
+
+ if (arg(0) == 'node' && is_numeric(arg(1))) {
+ return arg(1);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_validate_node.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_validate_node.inc
new file mode 100644
index 0000000..498ee76
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_argument_validate_node.inc
@@ -0,0 +1,133 @@
+<?php
+/**
+ * @file
+ * Contains the 'node' argument validator plugin.
+ */
+
+/**
+ * Validate whether an argument is an acceptable node.
+ */
+class views_plugin_argument_validate_node extends views_plugin_argument_validate {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['types'] = array('default' => array());
+ $options['access'] = array('default' => FALSE);
+ $options['access_op'] = array('default' => 'view');
+ $options['nid_type'] = array('default' => 'nid');
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $types = node_type_get_types();
+ foreach ($types as $type => $info) {
+ $options[$type] = check_plain(t($info->name));
+ }
+
+ $form['types'] = array(
+ '#type' => 'checkboxes',
+ '#title' => t('Content types'),
+ '#options' => $options,
+ '#default_value' => $this->options['types'],
+ '#description' => t('Choose one or more content types to validate with.'),
+ );
+
+ $form['access'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Validate user has access to the content'),
+ '#default_value' => $this->options['access'],
+ );
+ $form['access_op'] = array(
+ '#type' => 'radios',
+ '#title' => t('Access operation to check'),
+ '#options' => array('view' => t('View'), 'update' => t('Edit'), 'delete' => t('Delete')),
+ '#default_value' => $this->options['access_op'],
+ '#dependency' => array('edit-options-validate-options-node-access' => array(TRUE)),
+ );
+
+ $form['nid_type'] = array(
+ '#type' => 'select',
+ '#title' => t('Filter value format'),
+ '#options' => array(
+ 'nid' => t('Node ID'),
+ 'nids' => t('Node IDs separated by , or +'),
+ ),
+ '#default_value' => $this->options['nid_type'],
+ );
+ }
+
+ function options_submit(&$form, &$form_state, &$options = array()) {
+ // filter trash out of the options so we don't store giant unnecessary arrays
+ $options['types'] = array_filter($options['types']);
+ }
+
+ function convert_options(&$options) {
+ if (!isset($options['types']) && !empty($this->argument->options['validate_argument_node_type'])) {
+ $options['types'] = isset($this->argument->options['validate_argument_node_type']) ? $this->argument->options['validate_argument_node_type'] : array();
+ $options['access'] = !empty($this->argument->options['validate_argument_node_access']);
+ $options['access_op'] = isset($this->argument->options['validate_argument_node_access_op']) ? $this->argument->options['validate_argument_node_access_op'] : 'view';
+ $options['nid_type'] = isset($this->argument->options['validate_argument_nid_type']) ? $this->argument->options['validate_argument_nid_type'] : array();
+ }
+ }
+
+ function validate_argument($argument) {
+ $types = $this->options['types'];
+
+ switch ($this->options['nid_type']) {
+ case 'nid':
+ if (!is_numeric($argument)) {
+ return FALSE;
+ }
+ $node = node_load($argument);
+ if (!$node) {
+ return FALSE;
+ }
+
+ if (!empty($this->options['access'])) {
+ if (!node_access($this->options['access_op'], $node)) {
+ return FALSE;
+ }
+ }
+
+ // Save the title() handlers some work.
+ $this->argument->validated_title = check_plain($node->title);
+
+ if (empty($types)) {
+ return TRUE;
+ }
+
+ return isset($types[$node->type]);
+ break;
+ case 'nids':
+ $nids = new stdClass();
+ $nids->value = array($argument);
+ $nids = views_break_phrase($argument, $nids);
+ if ($nids->value == array(-1)) {
+ return FALSE;
+ }
+
+ $test = drupal_map_assoc($nids->value);
+ $titles = array();
+
+ $result = db_query("SELECT * FROM {node} WHERE nid IN (:nids)", array(':nids' => $nids->value));
+ foreach ($result as $node) {
+ if ($types && empty($types[$node->type])) {
+ return FALSE;
+ }
+
+ if (!empty($this->options['access'])) {
+ if (!node_access($this->options['access_op'], $node)) {
+ return FALSE;
+ }
+ }
+
+ $titles[] = check_plain($node->title);
+ unset($test[$node->nid]);
+ }
+
+ $this->argument->validated_title = implode($nids->operator == 'or' ? ' + ' : ', ', $titles);
+ // If this is not empty, we did not find a nid.
+ return empty($test);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc
new file mode 100644
index 0000000..189ff1f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc
@@ -0,0 +1,166 @@
+<?php
+/**
+ * @file
+ * Contains the node RSS row style plugin.
+ */
+
+/**
+ * Plugin which performs a node_view on the resulting object
+ * and formats it as an RSS item.
+ */
+class views_plugin_row_node_rss extends views_plugin_row {
+ // Basic properties that let the row style follow relationships.
+ var $base_table = 'node';
+ var $base_field = 'nid';
+
+ // Stores the nodes loaded with pre_render.
+ var $nodes = array();
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['item_length'] = array('default' => 'default');
+ $options['links'] = FALSE;
+
+ return $options;
+ }
+
+ /**
+ * Override init function to convert fulltext view-mode to full.
+ */
+ function init(&$view, &$display, $options = NULL) {
+ parent::init($view, $display, $options);
+
+ if ($this->options['item_length'] == 'fulltext') {
+ $this->options['item_length'] = 'full';
+ }
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $form['item_length'] = array(
+ '#type' => 'select',
+ '#title' => t('Display type'),
+ '#options' => $this->options_form_summary_options(),
+ '#default_value' => $this->options['item_length'],
+ );
+ $form['links'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display links'),
+ '#default_value' => $this->options['links'],
+ );
+ }
+
+ /**
+ * Return the main options, which are shown in the summary title.
+ */
+ function options_form_summary_options() {
+ $entity_info = entity_get_info('node');
+ $options = array();
+ if (!empty($entity_info['view modes'])) {
+ foreach ($entity_info['view modes'] as $mode => $settings) {
+ $options[$mode] = $settings['label'];
+ }
+ }
+ $options['title'] = t('Title only');
+ $options['default'] = t('Use site default RSS settings');
+ return $options;
+ }
+
+ function summary_title() {
+ $options = $this->options_form_summary_options();
+ return check_plain($options[$this->options['item_length']]);
+ }
+
+
+ function pre_render($values) {
+ $nids = array();
+ foreach ($values as $row) {
+ $nids[] = $row->{$this->field_alias};
+ }
+ if (!empty($nids)) {
+ $this->nodes = node_load_multiple($nids);
+ }
+ }
+
+ function render($row) {
+ // For the most part, this code is taken from node_feed() in node.module
+ global $base_url;
+
+ $nid = $row->{$this->field_alias};
+ if (!is_numeric($nid)) {
+ return;
+ }
+
+ $display_mode = $this->options['item_length'];
+ if ($display_mode == 'default') {
+ $display_mode = variable_get('feed_item_length', 'teaser');
+ }
+
+ // Load the specified node:
+ $node = $this->nodes[$nid];
+ if (empty($node)) {
+ return;
+ }
+
+ $item_text = '';
+
+ $uri = entity_uri('node', $node);
+ $node->link = url($uri['path'], $uri['options'] + array('absolute' => TRUE));
+ $node->rss_namespaces = array();
+ $node->rss_elements = array(
+ array(
+ 'key' => 'pubDate',
+ 'value' => gmdate('r', $node->created),
+ ),
+ array(
+ 'key' => 'dc:creator',
+ 'value' => $node->name,
+ ),
+ array(
+ 'key' => 'guid',
+ 'value' => $node->nid . ' at ' . $base_url,
+ 'attributes' => array('isPermaLink' => 'false'),
+ ),
+ );
+
+ // The node gets built and modules add to or modify $node->rss_elements
+ // and $node->rss_namespaces.
+
+ $build_mode = $display_mode;
+
+ $build = node_view($node, $build_mode);
+ unset($build['#theme']);
+
+ if (!empty($node->rss_namespaces)) {
+ $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $node->rss_namespaces);
+ } else if (module_exists('rdf')) {
+ $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, rdf_get_namespaces());
+ }
+
+ // Hide the links if desired.
+ if (!$this->options['links']) {
+ hide($build['links']);
+ }
+
+ if ($display_mode != 'title') {
+ // We render node contents and force links to be last.
+ $build['links']['#weight'] = 1000;
+ $item_text .= drupal_render($build);
+ }
+
+ $item = new stdClass();
+ $item->description = $item_text;
+ $item->title = $node->title;
+ $item->link = $node->link;
+ $item->elements = $node->rss_elements;
+ $item->nid = $node->nid;
+
+ return theme($this->theme_functions(), array(
+ 'view' => $this->view,
+ 'options' => $this->options,
+ 'row' => $item
+ ));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_view.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_view.inc
new file mode 100644
index 0000000..d745add
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/node/views_plugin_row_node_view.inc
@@ -0,0 +1,107 @@
+<?php
+/**
+ * @file
+ * Contains the node view row style plugin.
+ */
+
+/**
+ * Plugin which performs a node_view on the resulting object.
+ *
+ * Most of the code on this object is in the theme function.
+ *
+ * @ingroup views_row_plugins
+ */
+class views_plugin_row_node_view extends views_plugin_row {
+ // Basic properties that let the row style follow relationships.
+ var $base_table = 'node';
+ var $base_field = 'nid';
+
+ // Stores the nodes loaded with pre_render.
+ var $nodes = array();
+
+ function init(&$view, &$display, $options = NULL) {
+ parent::init($view, $display, $options);
+ // Handle existing views with the deprecated 'teaser' option.
+ if (isset($this->options['teaser'])) {
+ $this->options['build_mode'] = $this->options['teaser'] ? 'teaser' : 'full';
+ }
+ // Handle existing views which has used build_mode instead of view_mode.
+ if (isset($this->options['build_mode'])) {
+ $this->options['view_mode'] = $this->options['build_mode'];
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['view_mode'] = array('default' => 'teaser');
+ $options['links'] = array('default' => TRUE);
+ $options['comments'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $options = $this->options_form_summary_options();
+ $form['view_mode'] = array(
+ '#type' => 'select',
+ '#options' => $options,
+ '#title' => t('View mode'),
+ '#default_value' => $this->options['view_mode'],
+ );
+ $form['links'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display links'),
+ '#default_value' => $this->options['links'],
+ );
+ $form['comments'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display comments'),
+ '#default_value' => $this->options['comments'],
+ );
+ }
+
+ /**
+ * Return the main options, which are shown in the summary title.
+ */
+ function options_form_summary_options() {
+ $entity_info = entity_get_info('node');
+ $options = array();
+ if (!empty($entity_info['view modes'])) {
+ foreach ($entity_info['view modes'] as $mode => $settings) {
+ $options[$mode] = $settings['label'];
+ }
+ }
+ if (empty($options)) {
+ $options = array(
+ 'teaser' => t('Teaser'),
+ 'full' => t('Full content')
+ );
+ }
+
+ return $options;
+ }
+
+ function summary_title() {
+ $options = $this->options_form_summary_options();
+ return check_plain($options[$this->options['view_mode']]);
+ }
+
+ function pre_render($values) {
+ $nids = array();
+ foreach ($values as $row) {
+ $nids[] = $row->{$this->field_alias};
+ }
+ $this->nodes = node_load_multiple($nids);
+ }
+
+ function render($row) {
+ $node = $this->nodes[$row->{$this->field_alias}];
+ $node->view = $this->view;
+ $build = node_view($node, $this->options['view_mode']);
+
+ return drupal_render($build);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/poll.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/poll.views.inc
new file mode 100644
index 0000000..5819b7e
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/poll.views.inc
@@ -0,0 +1,55 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for poll.module
+ */
+
+/**
+ * @defgroup views_poll_module poll.module handlers
+ *
+ * Includes only the core 'poll' table for now.
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function poll_views_data() {
+ // Basic table information.
+ $data['poll']['table']['group'] = t('Poll');
+
+ // Join to 'node' as a base table.
+ $data['poll']['table']['join'] = array(
+ 'node' => array(
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ ),
+ );
+
+ // ----------------------------------------------------------------
+ // Fields
+
+ // poll active status
+ $data['poll']['active'] = array(
+ 'title' => t('Active'),
+ 'help' => t('Whether the poll is open for voting.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Active'),
+ 'type' => 'yes-no',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile.views.inc
new file mode 100644
index 0000000..65ad71d
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile.views.inc
@@ -0,0 +1,224 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for user.module
+ */
+
+/**
+ * @defgroup views_profile_module profile.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function profile_views_data() {
+ $data['profile_values']['moved to'] = 'profile_value';
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['profile_value']['table']['group'] = t('Profile');
+
+ $data['profile_value']['table']['join'] = array(
+ 'node' => array(
+ 'left_table' => 'profile_value',
+ 'left_field' => 'uid',
+ 'field' => 'uid',
+ ),
+ 'users' => array(
+ 'left_table' => 'profile_value',
+ 'left_field' => 'uid',
+ 'field' => 'uid',
+ ),
+ );
+
+ $fields = profile_views_get_fields();
+ foreach ($fields as $field) {
+ $table_name = 'profile_value_' . str_replace('-', '_', $field->name);
+ $data[$table_name] = array(
+ 'table' => array(
+ 'group' => t('Profile'),
+ 'join' => array(
+ 'node' => array(
+ 'table' => 'profile_value',
+ 'left_table' => 'users',
+ 'left_field' => 'uid',
+ 'field' => 'uid',
+ 'extra' => array(array('field' => 'fid', 'value' => $field->fid)),
+ ),
+ 'users' => array(
+ 'table' => 'profile_value',
+ 'left_field' => 'uid',
+ 'field' => 'uid',
+ 'extra' => array(array('field' => 'fid', 'value' => $field->fid)),
+ ),
+ ),
+ ),
+ );
+ // All fields in the table are named 'value'.
+ $data[$table_name]['value'] = profile_views_fetch_field($field);
+ }
+
+ return $data;
+}
+
+/**
+ * Get all profile fields
+ */
+function profile_views_get_fields() {
+ static $fields = NULL;
+
+ if (!isset($fields)) {
+ $fields = array();
+ $results = db_query("SELECT * FROM {profile_field} ORDER BY category, weight");
+
+ foreach ($results as $row) {
+ if (!empty($row->options)) {
+ if (!in_array(substr($row->options, 0, 2), array('a:', 'b:', 'i:', 'f:', 'o:', 's:', ))) {
+ // unserialized fields default version
+ $options = $row->options;
+ unset($row->options);
+ $row->options = $options;
+ }
+ else {
+ // serialized fields or modified version
+ $row->options = unserialize(db_decode_blob($row->options));
+ }
+ }
+ $fields[$row->fid] = $row;
+ }
+ }
+ return $fields;
+}
+
+
+/**
+ * Add profile fields to view table
+ */
+function profile_views_fetch_field($field) {
+ $data = array(
+ 'title' => t('@category: @field-name', array('@category' => $field->category, '@field-name' => $field->title)),
+ );
+
+ // Add fields specific to the profile type.
+ switch ($field->type) {
+ case 'textfield':
+ $data += array(
+ 'help' => t('Profile textfield'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_user',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ break;
+ case 'textarea':
+ $data += array(
+ 'help' => t('Profile textarea'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_markup',
+ 'format' => filter_default_format(),
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ break;
+ case 'checkbox':
+ $data += array(
+ 'help' => t('Profile checkbox'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'accept null' => TRUE,
+ ),
+ // @todo there ought to be a boolean argument handler
+ );
+
+ break;
+ case 'url':
+ $data += array(
+ 'help' => t('Profile URL'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_url',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ break;
+ case 'selection':
+ $data += array(
+ 'help' => t('Profile selection'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_profile_selection',
+ 'fid' => $field->fid,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ break;
+ case 'list':
+ $data += array(
+ 'help' => t('Profile freeform list %field-name.', array('%field-name' => $field->title)),
+ 'field' => array(
+ 'handler' => 'views_handler_field_profile_list',
+ 'no group by' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ break;
+ case 'date':
+ $data += array(
+ 'help' => t('Profile date %field-name.', array('%field-name' => $field->title)),
+ 'field' => array(
+ 'handler' => 'views_handler_field_profile_date',
+ ),
+ );
+
+ break;
+ }
+
+ // @todo: add access control to hidden fields.
+ return $data;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_date.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_date.inc
new file mode 100644
index 0000000..e6b5fbc
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_date.inc
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Field handler display a profile date
+ *
+ * The dates are stored serialized, which makes them mostly useless from
+ * SQL. About all we can do is unserialize and display them.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_profile_date extends views_handler_field_date {
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ // we can't do "time ago" so remove it from the form.
+ unset($form['date_format']['#options']['time ago']);
+ }
+
+ /**
+ * Display a profile field of type 'date'
+ */
+ function render($values) {
+ $value = $this->get_value($values);
+ if (!$value) {
+ return;
+ }
+ $value = unserialize($value);
+ $format = $this->options['date_format'];
+ switch ($format) {
+ case 'custom':
+ $format = $this->options['custom_date_format'];
+ break;
+ case 'small':
+ $format = variable_get('date_format_short', 'm/d/Y - H:i');
+ break;
+ case 'medium':
+ $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
+ break;
+ case 'large':
+ $format = variable_get('date_format_long', 'l, F j, Y - H:i');
+ break;
+ }
+
+ // Note: Avoid PHP's date() because it does not handle dates before
+ // 1970 on Windows. This would make the date field useless for e.g.
+ // birthdays.
+
+ // But we *can* deal with non-year stuff:
+ $date = gmmktime(0, 0, 0, $value['month'], $value['day'], $value['year']);
+ $replace = array(
+ // day
+ 'd' => sprintf('%02d', $value['day']),
+ 'D' => NULL,
+ 'l' => NULL,
+ 'N' => NULL,
+ 'S' => date('S', $date),
+ 'w' => NULL,
+ 'j' => $value['day'],
+ // month
+ 'F' => date('F', $date),
+ 'm' => sprintf('%02d', $value['month']),
+ 'M' => date('M', $date),
+ 'n' => date('n', $date),
+
+ 'Y' => $value['year'],
+ 'y' => substr($value['year'], 2, 2),
+
+ // kill time stuff
+ 'a' => NULL,
+ 'A' => NULL,
+ 'g' => NULL,
+ 'G' => NULL,
+ 'h' => NULL,
+ 'H' => NULL,
+ 'i' => NULL,
+ 's' => NULL,
+ ':' => NULL,
+ 'T' => NULL,
+ ' - ' => NULL,
+ ':' => NULL,
+ );
+
+ return strtr($format, $replace);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_list.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_list.inc
new file mode 100644
index 0000000..e3eaa30
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_field_profile_list.inc
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Field handler display a profile list item.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_profile_list extends views_handler_field_prerender_list {
+ /**
+ * Break up our field into a proper list.
+ */
+ function pre_render(&$values) {
+ $this->items = array();
+ foreach ($values as $value) {
+ $field = $this->get_value($value);
+ $this->items[$field] = array();
+ foreach (preg_split("/[,\n\r]/", $field) as $item) {
+ if ($item != '' && $item !== NULL) {
+ $this->items[$field][] = array('item' => $item);
+ }
+ }
+ }
+ }
+
+ function render_item($count, $item) {
+ return $item['item'];
+ }
+
+ function document_self_tokens(&$tokens) {
+ $tokens['[' . $this->options['id'] . '-item' . ']'] = t('The text of the profile item.');
+ }
+
+ function add_self_tokens(&$tokens, $item) {
+ $tokens['[' . $this->options['id'] . '-item' . ']'] = $item['item'];
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_filter_profile_selection.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_filter_profile_selection.inc
new file mode 100644
index 0000000..9906753
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/profile/views_handler_filter_profile_selection.inc
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * Filter by a selection widget in the profile.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_profile_selection extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (isset($this->value_options)) {
+ return;
+ }
+
+ $this->value_options = array();
+ $all_options = profile_views_get_fields();
+ $field = $all_options[$this->definition['fid']];
+
+ $lines = preg_split("/[,\n\r]/", $field->options);
+ foreach ($lines as $line) {
+ if ($line = trim($line)) {
+ $this->value_options[$line] = $line;
+ }
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views.inc
new file mode 100644
index 0000000..6f0bc1b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views.inc
@@ -0,0 +1,211 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for search.module
+ */
+
+/**
+ * @defgroup views_search_module search.module handlers
+ *
+ * Includes the tables 'search_index'
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function search_views_data() {
+ // Basic table information.
+
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['search_index']['table']['group'] = t('Search');
+
+ // For other base tables, explain how we join
+ $data['search_index']['table']['join'] = array(
+ 'node' => array(
+ 'left_field' => 'nid',
+ 'field' => 'sid',
+ ),
+ );
+
+ $data['search_total']['table']['join'] = array(
+ 'node' => array(
+ 'left_table' => 'search_index',
+ 'left_field' => 'word',
+ 'field' => 'word',
+ ),
+ 'users' => array(
+ 'left_table' => 'search_index',
+ 'left_field' => 'word',
+ 'field' => 'word',
+ )
+ );
+
+ $data['search_dataset']['table']['join'] = array(
+ 'node' => array(
+ 'left_table' => 'search_index',
+ 'left_field' => 'sid',
+ 'field' => 'sid',
+ 'extra' => 'search_index.type = search_dataset.type',
+ 'type' => 'INNER',
+ ),
+ 'users' => array(
+ 'left_table' => 'search_index',
+ 'left_field' => 'sid',
+ 'field' => 'sid',
+ 'extra' => 'search_index.type = search_dataset.type',
+ 'type' => 'INNER',
+ ),
+ );
+
+ // ----------------------------------------------------------------
+ // Fields
+
+ // score
+ $data['search_index']['score'] = array(
+ 'title' => t('Score'),
+ 'help' => t('The score of the search item. This will not be used if the search filter is not also present.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_search_score',
+ 'click sortable' => TRUE,
+ 'float' => TRUE,
+ 'no group by' => TRUE,
+ ),
+ // Information for sorting on a search score.
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_search_score',
+ 'no group by' => TRUE,
+ ),
+ );
+
+ // Search node links: forward links.
+ $data['search_node_links_from']['table']['group'] = t('Search');
+ $data['search_node_links_from']['table']['join'] = array(
+ 'node' => array(
+ 'arguments' => array('search_node_links', 'node', 'nid', 'nid', NULL, 'INNER'),
+ ),
+ );
+ $data['search_node_links_from']['sid'] = array(
+ 'title' => t('Links from'),
+ 'help' => t('Other nodes that are linked from the node.'),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_nid',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_equality',
+ ),
+ );
+
+ // Search node links: backlinks.
+ $data['search_node_links_to']['table']['group'] = t('Search');
+ $data['search_node_links_to']['table']['join'] = array(
+ 'node' => array(
+ 'arguments' => array('search_node_links', 'node', 'nid', 'sid', NULL, 'INNER'),
+ ),
+ );
+ $data['search_node_links_to']['nid'] = array(
+ 'title' => t('Links to'),
+ 'help' => t('Other nodes that link to the node.'),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_nid',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_equality',
+ ),
+ );
+
+ // search filter
+ $data['search_index']['keys'] = array(
+ 'title' => t('Search Terms'), // The item it appears as on the UI,
+ 'help' => t('The terms to search for.'), // The help that appears on the UI,
+ // Information for searching terms using the full search syntax
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_search',
+ 'no group by' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_search',
+ 'no group by' => TRUE,
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * Implements hook_views_plugins
+ */
+function search_views_plugins() {
+ return;
+ // DISABLED. This currently doesn't work.
+ return array(
+ 'module' => 'views', // This just tells our themes are elsewhere.
+ 'row' => array(
+ 'search' => array(
+ 'title' => t('Search'),
+ 'help' => t('Display the results with standard search view.'),
+ 'handler' => 'views_plugin_row_search_view',
+ 'theme' => 'views_view_row_search',
+ 'path' => drupal_get_path('module', 'views') . '/modules/search', // not necessary for most modules
+ 'base' => array('node'), // only works with 'node' as base.
+ 'type' => 'normal',
+ ),
+ 'views_handler_argument_search' => array(
+ 'parent' => 'views_handler_argument',
+ ),
+ ),
+ );
+}
+
+/**
+ * Template helper for theme_views_view_row_search
+ */
+function template_preprocess_views_view_row_search(&$vars) {
+ $vars['node'] = ''; // make sure var is defined.
+ $nid = $vars['row']->nid;
+ if (!is_numeric($nid)) {
+ return;
+ }
+
+ // @todo: Once the search row is fixed this node_load should be replace by a node_load_multiple
+ $node = node_load($nid);
+
+ if (empty($node)) {
+ return;
+ }
+
+ // Build the node body.
+ $node = node_build_content($node, FALSE, FALSE);
+ $node->body = drupal_render($node->content);
+
+ // Fetch comments for snippet
+ $node->body .= module_invoke('comment', 'nodeapi', $node, 'update index');
+
+ // Fetch terms for snippet
+ $node->body .= module_invoke('taxonomy', 'nodeapi', $node, 'update index');
+
+ $vars['url'] = url('node/' . $nid);
+ $vars['title'] = check_plain($node->title);
+
+ $info = array();
+ $info['type'] = node_type_get_name($node);
+ $info['user'] = theme('username', array('acccount' => $node));
+ $info['date'] = format_date($node->changed, 'small');
+ $extra = module_invoke_all('node_search_result', $node);
+ if (isset($extra) && is_array($extra)) {
+ $info = array_merge($info, $extra);
+ }
+ $vars['info_split'] = $info;
+ $vars['info'] = implode(' - ', $info);
+
+ $vars['node'] = $node;
+ // @todo: get score from ???
+//$vars['score'] = $item->score;
+ $vars['snippet'] = search_excerpt($vars['view']->value, $node->body);
+}
+
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views_default.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views_default.inc
new file mode 100644
index 0000000..449dfb3
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search.views_default.inc
@@ -0,0 +1,118 @@
+<?php
+
+/**
+ * @file
+ * Bulk export of views_default objects generated by Bulk export module.
+ */
+
+/**
+ * Implementation of hook_views_default_views()
+ */
+function search_views_default_views() {
+ $views = array();
+
+ $view = new view;
+ $view->name = 'backlinks';
+ $view->description = 'Displays a list of nodes that link to the node, using the search backlinks table.';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Backlinks';
+ $view->core = 0;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = 30;
+ $handler->display->display_options['style_plugin'] = 'list';
+ $handler->display->display_options['style_options']['type'] = 'ol';
+ $handler->display->display_options['row_plugin'] = 'fields';
+ /* No results behavior: Global: Text area */
+ $handler->display->display_options['empty']['text']['id'] = 'area';
+ $handler->display->display_options['empty']['text']['table'] = 'views';
+ $handler->display->display_options['empty']['text']['field'] = 'area';
+ $handler->display->display_options['empty']['text']['empty'] = FALSE;
+ $handler->display->display_options['empty']['text']['content'] = 'No backlinks found.';
+ $handler->display->display_options['empty']['text']['format'] = '1';
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['label'] = '';
+ $handler->display->display_options['fields']['title']['link_to_node'] = 1;
+ /* Contextual filter: Search: Links to */
+ $handler->display->display_options['arguments']['nid']['id'] = 'nid';
+ $handler->display->display_options['arguments']['nid']['table'] = 'search_node_links_to';
+ $handler->display->display_options['arguments']['nid']['field'] = 'nid';
+ $handler->display->display_options['arguments']['nid']['default_action'] = 'not found';
+ $handler->display->display_options['arguments']['nid']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['nid']['title'] = 'Pages that link to %1';
+ $handler->display->display_options['arguments']['nid']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['nid']['specify_validation'] = 1;
+ $handler->display->display_options['arguments']['nid']['validate']['type'] = 'node';
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = 1;
+ $handler->display->display_options['filters']['status']['group'] = 0;
+ $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page');
+ $handler->display->display_options['path'] = 'node/%/backlinks';
+ $handler->display->display_options['menu']['type'] = 'tab';
+ $handler->display->display_options['menu']['title'] = 'What links here';
+ $handler->display->display_options['menu']['weight'] = '0';
+
+ /* Display: What links here */
+ $handler = $view->new_display('block', 'What links here', 'block');
+ $handler->display->display_options['defaults']['use_more'] = FALSE;
+ $handler->display->display_options['use_more'] = TRUE;
+ $handler->display->display_options['defaults']['style_plugin'] = FALSE;
+ $handler->display->display_options['style_plugin'] = 'list';
+ $handler->display->display_options['defaults']['style_options'] = FALSE;
+ $handler->display->display_options['defaults']['row_plugin'] = FALSE;
+ $handler->display->display_options['row_plugin'] = 'fields';
+ $handler->display->display_options['defaults']['row_options'] = FALSE;
+ $handler->display->display_options['defaults']['arguments'] = FALSE;
+ /* Contextual filter: Search: Links to */
+ $handler->display->display_options['arguments']['nid']['id'] = 'nid';
+ $handler->display->display_options['arguments']['nid']['table'] = 'search_node_links_to';
+ $handler->display->display_options['arguments']['nid']['field'] = 'nid';
+ $handler->display->display_options['arguments']['nid']['default_action'] = 'default';
+ $handler->display->display_options['arguments']['nid']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['nid']['title'] = 'What links here';
+ $handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
+ $handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['nid']['specify_validation'] = 1;
+ $handler->display->display_options['arguments']['nid']['validate']['type'] = 'node';
+ $translatables['backlinks'] = array(
+ t('Master'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('No backlinks found.'),
+ t('All'),
+ t('Pages that link to %1'),
+ t('Page'),
+ t('What links here'),
+ );
+
+ $views['backlinks'] = $view;
+
+ return $views;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_argument_search.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_argument_search.inc
new file mode 100644
index 0000000..1b2c6e5
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_argument_search.inc
@@ -0,0 +1,95 @@
+<?php
+
+/**
+ * Argument that accepts query keys for search.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_search extends views_handler_argument {
+
+ /**
+ * Take sure that parseSearchExpression is runned and everything is set up for it.
+ *
+ * @param $input
+ * The search phrase which was input by the user.
+ */
+ function query_parse_search_expression($input) {
+ if (!isset($this->search_query)) {
+ $this->search_query = db_select('search_index', 'i', array('target' => 'slave'))->extend('viewsSearchQuery');
+ $this->search_query->searchExpression($input, $this->view->base_table);
+ $this->search_query->publicParseSearchExpression();
+ }
+ }
+
+ /**
+ * Add this argument to the query.
+ */
+ function query($group_by = FALSE) {
+ $required = FALSE;
+ $this->query_parse_search_expression($this->argument);
+ if (!isset($this->search_query)) {
+ $required = TRUE;
+ }
+ else {
+ $words = $this->search_query->words();
+ if (empty($words)) {
+ $required = TRUE;
+ }
+ }
+ if ($required) {
+ if ($this->operator == 'required') {
+ $this->query->add_where(0, 'FALSE');
+ }
+ }
+ else {
+ $search_index = $this->ensure_my_table();
+
+ $search_condition = db_and();
+
+ // Create a new join to relate the 'search_total' table to our current 'search_index' table.
+ $join = new views_join;
+ $join->construct('search_total', $search_index, 'word', 'word');
+ $search_total = $this->query->add_relationship('search_total', $join, $search_index);
+
+ $this->search_score = $this->query->add_field('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE));
+
+ if (empty($this->query->relationships[$this->relationship])) {
+ $base_table = $this->query->base_table;
+ }
+ else {
+ $base_table = $this->query->relationships[$this->relationship]['base'];
+ }
+ $search_condition->condition("$search_index.type", $base_table);
+
+ if (!$this->search_query->simple()) {
+ $search_dataset = $this->query->add_table('search_dataset');
+ $conditions = $this->search_query->conditions();
+ $condition_conditions =& $conditions->conditions();
+ foreach ($condition_conditions as $key => &$condition) {
+ // Take sure we just look at real conditions.
+ if (is_numeric($key)) {
+ // Replace the conditions with the table alias of views.
+ $this->search_query->condition_replace_string('d.', "$search_dataset.", $condition);
+ }
+ }
+ $search_conditions =& $search_condition->conditions();
+ $search_conditions = array_merge($search_conditions, $condition_conditions);
+ }
+ else {
+ // Stores each condition, so and/or on the filter level will still work.
+ $or = db_or();
+ foreach ($words as $word) {
+ $or->condition("$search_index.word", $word);
+ }
+
+ $search_condition->condition($or);
+ }
+
+ $this->query->add_where(0, $search_condition);
+ $this->query->add_groupby("$search_index.sid");
+ $matches = $this->search_query->matches();
+ $placeholder = $this->placeholder();
+ $this->query->add_having_expression(0, "COUNT(*) >= $placeholder", array($placeholder => $matches));
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_field_search_score.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_field_search_score.inc
new file mode 100644
index 0000000..96f124d
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_field_search_score.inc
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Field handler to provide simple renderer that allows linking to a node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_search_score extends views_handler_field_numeric {
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['alternate_sort'] = array('default' => '');
+ $options['alternate_order'] = array('default' => 'asc');
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $style_options = $this->view->display_handler->get_option('style_options');
+ if (isset($style_options['default']) && $style_options['default'] == $this->options['id']) {
+ $handlers = $this->view->display_handler->get_handlers('field');
+ $options = array('' => t('No alternate'));
+ foreach ($handlers as $id => $handler) {
+ $options[$id] = $handler->ui_name();
+ }
+
+ $form['alternate_sort'] = array(
+ '#type' => 'select',
+ '#title' => t('Alternative sort'),
+ '#description' => t('Pick an alternative default table sort field to use when the search score field is unavailable.'),
+ '#options' => $options,
+ '#default_value' => $this->options['alternate_sort'],
+ );
+
+ $form['alternate_order'] = array(
+ '#type' => 'select',
+ '#title' => t('Alternate sort order'),
+ '#options' => array('asc' => t('Ascending'), 'desc' => t('Descending')),
+ '#default_value' => $this->options['alternate_order'],
+ );
+ }
+
+ parent::options_form($form, $form_state);
+ }
+
+ function query() {
+ // Check to see if the search filter added 'score' to the table.
+ // Our filter stores it as $handler->search_score -- and we also
+ // need to check its relationship to make sure that we're using the same
+ // one or obviously this won't work.
+ foreach ($this->view->filter as $handler) {
+ if (isset($handler->search_score) && $handler->relationship == $this->relationship) {
+ $this->field_alias = $handler->search_score;
+ $this->table_alias = $handler->table_alias;
+ return;
+ }
+ }
+
+ // Hide this field if no search filter is in place.
+ $this->options['exclude'] = TRUE;
+ if (!empty($this->options['alternate_sort'])) {
+ if (isset($this->view->style_plugin->options['default']) && $this->view->style_plugin->options['default'] == $this->options['id']) {
+ // Since the style handler initiates fields, we plug these values right into the active handler.
+ $this->view->style_plugin->options['default'] = $this->options['alternate_sort'];
+ $this->view->style_plugin->options['order'] = $this->options['alternate_order'];
+ }
+ }
+ }
+
+ function render($values) {
+ // Only render if we exist.
+ if (isset($this->table_alias)) {
+ return parent::render($values);
+ }
+ }
+
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_filter_search.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_filter_search.inc
new file mode 100644
index 0000000..c5defd8
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_filter_search.inc
@@ -0,0 +1,206 @@
+<?php
+
+/**
+ * Field handler to provide simple renderer that allows linking to a node.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_search extends views_handler_filter {
+ var $always_multiple = TRUE;
+
+ /**
+ * Stores a viewsSearchQuery object to be able to use the search.module "api".
+ *
+ * @var viewsSearchQuery
+ */
+ var $search_query = NULL;
+
+ /**
+ * Checks if the search query has been parsed.
+ */
+ var $parsed = FALSE;
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['operator']['default'] = 'optional';
+
+ return $options;
+ }
+
+ /**
+ * Provide simple equality operator
+ */
+ function operator_form(&$form, &$form_state) {
+ $form['operator'] = array(
+ '#type' => 'radios',
+ '#title' => t('On empty input'),
+ '#default_value' => $this->operator,
+ '#options' => array(
+ 'optional' => t('Show All'),
+ 'required' => t('Show None'),
+ ),
+ );
+ }
+
+ /**
+ * Provide a simple textfield for equality
+ */
+ function value_form(&$form, &$form_state) {
+ $form['value'] = array(
+ '#type' => 'textfield',
+ '#size' => 15,
+ '#default_value' => $this->value,
+ '#attributes' => array('title' => t('Enter the terms you wish to search for.')),
+ '#title' => empty($form_state['exposed']) ? t('Value') : '',
+ );
+ }
+
+ /**
+ * Validate the options form.
+ */
+ function exposed_validate(&$form, &$form_state) {
+ if (!isset($this->options['expose']['identifier'])) {
+ return;
+ }
+
+ $key = $this->options['expose']['identifier'];
+ if (!empty($form_state['values'][$key])) {
+ $this->query_parse_search_expression($form_state['values'][$key]);
+ if (count($this->search_query->words()) == 0) {
+ form_set_error($key, format_plural(variable_get('minimum_word_size', 3), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
+ }
+ }
+ }
+
+ /**
+ * Take sure that parseSearchExpression is runned and everything is set up for it.
+ *
+ * @param $input
+ * The search phrase which was input by the user.
+ */
+ function query_parse_search_expression($input) {
+ if (!isset($this->search_query)) {
+ $this->parsed = TRUE;
+ $this->search_query = db_select('search_index', 'i', array('target' => 'slave'))->extend('viewsSearchQuery');
+ $this->search_query->searchExpression($input, $this->view->base_table);
+ $this->search_query->publicParseSearchExpression();
+ }
+ }
+
+ /**
+ * 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() {
+ // Since attachment views don't validate the exposed input, parse the search
+ // expression if required.
+ if (!$this->parsed) {
+ $this->query_parse_search_expression($this->value);
+ }
+ $required = FALSE;
+ if (!isset($this->search_query)) {
+ $required = TRUE;
+ }
+ else {
+ $words = $this->search_query->words();
+ if (empty($words)) {
+ $required = TRUE;
+ }
+ }
+ if ($required) {
+ if ($this->operator == 'required') {
+ $this->query->add_where($this->options['group'], 'FALSE');
+ }
+ }
+ else {
+ $search_index = $this->ensure_my_table();
+
+ $search_condition = db_and();
+
+ // Create a new join to relate the 'serach_total' table to our current 'search_index' table.
+ $join = new views_join;
+ $join->construct('search_total', $search_index, 'word', 'word');
+ $search_total = $this->query->add_relationship('search_total', $join, $search_index);
+
+ $this->search_score = $this->query->add_field('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE));
+
+ if (empty($this->query->relationships[$this->relationship])) {
+ $base_table = $this->query->base_table;
+ }
+ else {
+ $base_table = $this->query->relationships[$this->relationship]['base'];
+ }
+ $search_condition->condition("$search_index.type", $base_table);
+ if (!$this->search_query->simple()) {
+ $search_dataset = $this->query->add_table('search_dataset');
+ $conditions = $this->search_query->conditions();
+ $condition_conditions =& $conditions->conditions();
+ foreach ($condition_conditions as $key => &$condition) {
+ // Take sure we just look at real conditions.
+ if (is_numeric($key)) {
+ // Replace the conditions with the table alias of views.
+ $this->search_query->condition_replace_string('d.', "$search_dataset.", $condition);
+ }
+ }
+ $search_conditions =& $search_condition->conditions();
+ $search_conditions = array_merge($search_conditions, $condition_conditions);
+ }
+ else {
+ // Stores each condition, so and/or on the filter level will still work.
+ $or = db_or();
+ foreach ($words as $word) {
+ $or->condition("$search_index.word", $word);
+ }
+
+ $search_condition->condition($or);
+ }
+
+ $this->query->add_where($this->options['group'], $search_condition);
+ $this->query->add_groupby("$search_index.sid");
+ $matches = $this->search_query->matches();
+ $placeholder = $this->placeholder();
+ $this->query->add_having_expression($this->options['group'], "COUNT(*) >= $placeholder", array($placeholder => $matches));
+ }
+ // Set to NULL to prevent PDO exception when views object is cached.
+ $this->search_query = NULL;
+ }
+}
+
+class viewsSearchQuery extends SearchQuery {
+ public function &conditions() {
+ return $this->conditions;
+ }
+ public function words() {
+ return $this->words;
+ }
+
+ public function simple() {
+ return $this->simple;
+ }
+
+ public function matches() {
+ return $this->matches;
+ }
+
+ public function publicParseSearchExpression() {
+ return $this->parseSearchExpression();
+ }
+
+ function condition_replace_string($search, $replace, &$condition) {
+ if ($condition['field'] instanceof DatabaseCondition) {
+ $conditions =& $condition['field']->conditions();
+ foreach ($conditions as $key => &$subcondition) {
+ if (is_numeric($key)) {
+ $this->condition_replace_string($search, $replace, $subcondition);
+ }
+ }
+ }
+ else {
+ $condition['field'] = str_replace($search, $replace, $condition['field']);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_sort_search_score.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_sort_search_score.inc
new file mode 100644
index 0000000..614d83a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_handler_sort_search_score.inc
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Field handler to provide simple renderer that allows linking to a node.
+ *
+ * @ingroup views_sort_handlers
+ */
+class views_handler_sort_search_score extends views_handler_sort {
+ function query() {
+ // Check to see if the search filter/argument added 'score' to the table.
+ // Our filter stores it as $handler->search_score -- and we also
+ // need to check its relationship to make sure that we're using the same
+ // one or obviously this won't work.
+ foreach (array('filter', 'argument') as $type) {
+ foreach ($this->view->{$type} as $handler) {
+ if (isset($handler->search_score) && $handler->relationship == $this->relationship) {
+ $this->query->add_orderby(NULL, NULL, $this->options['order'], $handler->search_score);
+ $this->table_alias = $handler->table_alias;
+ return;
+ }
+ }
+ }
+
+ // Do absolutely nothing if there is no filter/argument in place; there is no reason to
+ // sort on the raw scores with this handler.
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_plugin_row_search_view.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_plugin_row_search_view.inc
new file mode 100644
index 0000000..7383344
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/search/views_plugin_row_search_view.inc
@@ -0,0 +1,38 @@
+<?php
+/**
+ * @file
+ * Contains the search row style plugin.
+ */
+
+/**
+ * Plugin which performs a node_view on the resulting object.
+ */
+class views_plugin_row_search_view extends views_plugin_row {
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['score'] = array('default' => TRUE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['score'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display score'),
+ '#default_value' => $this->options['score'],
+ );
+ }
+
+ /**
+ * Override the behavior of the render() function.
+ */
+ function render($row) {
+ return theme($this->theme_functions(),
+ array(
+ 'view' => $this->view,
+ 'options' => $this->options,
+ 'row' => $row
+ ));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views.inc
new file mode 100644
index 0000000..187d9f1
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views.inc
@@ -0,0 +1,271 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for statistics.module
+ */
+
+/**
+ * @defgroup views_statistics_module statistics.module handlers
+ *
+ * Includes the ability to create views of just the statistics table.
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function statistics_views_data() {
+ // Basic table information.
+
+ // ----------------------------------------------------------------
+ // node_counter table
+
+ $data['node_counter']['table']['group'] = t('Content statistics');
+
+ $data['node_counter']['table']['join'] = array(
+ // ...to the node table
+ 'node' => array(
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ ),
+ );
+
+ // totalcount
+ $data['node_counter']['totalcount'] = array(
+ 'title' => t('Total views'),
+ 'help' => t('The total number of times the node has been viewed.'),
+
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // daycount
+ $data['node_counter']['daycount'] = array(
+ 'title' => t('Views today'),
+ 'help' => t('The total number of times the node has been viewed today.'),
+
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // timestamp
+ $data['node_counter']['timestamp'] = array(
+ 'title' => t('Most recent view'),
+ 'help' => t('The most recent time the node has been viewed.'),
+
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+
+ // ----------------------------------------------------------------
+ // accesslog table
+
+ $data['accesslog']['table']['group'] = t('Access log');
+
+ // Advertise this table as a possible base table
+ $data['accesslog']['table']['base'] = array(
+ 'field' => 'aid',
+ 'title' => t('Access log'),
+ 'help' => t('Stores site access information.'),
+ 'weight' => 10,
+ );
+
+ // For other base tables, explain how we join
+ $data['accesslog']['table']['join'] = array(
+ 'users' => array(
+ 'field' => 'uid',
+ 'left_field' => 'uid',
+ ),
+ );
+
+ // accesslog.aid
+ $data['accesslog']['aid'] = array(
+ 'title' => t('Aid'),
+ 'help' => t('Unique access event ID.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ 'name field' => 'wid',
+ 'numeric' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // session id
+ $data['accesslog']['sid'] = array(
+ 'title' => t('Session ID'),
+ 'help' => t('Browser session ID of user that visited page.'),
+
+ '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',
+ ),
+ );
+
+ // title
+ $data['accesslog']['title'] = array(
+ 'title' => t('Page title'),
+ 'help' => t('Title of page visited.'),
+
+ 'field' => array(
+ 'handler' => 'views_handler_field_accesslog_path',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // path
+ $data['accesslog']['path'] = array(
+ 'title' => t('Path'),
+ 'help' => t('Internal path to page visited (relative to Drupal root.)'),
+
+ 'field' => array(
+ 'handler' => 'views_handler_field_accesslog_path',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ //No argument here. Can't send forward slashes as arguments.
+ //Can be worked around by node ID.
+ //(but what about aliases?)
+ );
+
+ // referrer
+ $data['accesslog']['url'] = array(
+ 'title' => t('Referrer'),
+ 'help' => t('Referrer URI.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_url',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // hostname
+ $data['accesslog']['hostname'] = array(
+ 'title' => t('Hostname'),
+ 'help' => t('Hostname of user that visited the page.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // user
+ $data['accesslog']['uid'] = array(
+ 'title' => t('User'),
+ 'help' => t('The user who visited the site.'),
+ 'relationship' => array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'users',
+ 'base field' => 'uid',
+ ),
+ );
+
+ // timer
+ $data['accesslog']['timer'] = array(
+ 'title' => t('Timer'),
+ 'help' => t('Time in milliseconds that the page took to load.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // timestamp
+ $data['accesslog']['timestamp'] = array(
+ 'title' => t('Timestamp'),
+ 'help' => t('Timestamp of when the page was visited.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+
+ return $data;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views_default.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views_default.inc
new file mode 100644
index 0000000..84a9427
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics.views_default.inc
@@ -0,0 +1,252 @@
+<?php
+
+/**
+ * @file
+ * Bulk export of views_default objects generated by Bulk export module.
+ */
+
+/**
+ * Implementation of hook_views_default_views()
+ */
+function statistics_views_default_views() {
+ $views = array();
+
+ $view = new view;
+ $view->name = 'popular';
+ $view->description = 'Shows the most-viewed nodes on the site. This requires the statistics to be enabled at administer >> reports >> access log settings.';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Popular content';
+ $view->core = 0;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['title'] = 'Popular content';
+ $handler->display->display_options['use_more'] = TRUE;
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+ $handler->display->display_options['style_plugin'] = 'table';
+ $handler->display->display_options['style_options']['columns'] = array(
+ 'type' => 'type',
+ 'title' => 'title',
+ 'name' => 'name',
+ 'timestamp' => 'title',
+ 'totalcount' => 'totalcount',
+ );
+ $handler->display->display_options['style_options']['default'] = '-1';
+ $handler->display->display_options['style_options']['info'] = array(
+ 'type' => array(
+ 'sortable' => 0,
+ 'separator' => '',
+ ),
+ 'title' => array(
+ 'sortable' => 0,
+ 'separator' => '',
+ ),
+ 'name' => array(
+ 'sortable' => 0,
+ 'separator' => '',
+ ),
+ 'timestamp' => array(
+ 'separator' => '',
+ ),
+ 'totalcount' => array(
+ 'sortable' => 0,
+ 'separator' => '',
+ ),
+ );
+ $handler->display->display_options['style_options']['override'] = 0;
+ $handler->display->display_options['style_options']['order'] = 'desc';
+ /* Field: Content: Type */
+ $handler->display->display_options['fields']['type']['id'] = 'type';
+ $handler->display->display_options['fields']['type']['table'] = 'node';
+ $handler->display->display_options['fields']['type']['field'] = 'type';
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ /* Field: User: Name */
+ $handler->display->display_options['fields']['name']['id'] = 'name';
+ $handler->display->display_options['fields']['name']['table'] = 'users';
+ $handler->display->display_options['fields']['name']['field'] = 'name';
+ $handler->display->display_options['fields']['name']['label'] = 'Author';
+ /* Field: Content: Has new content */
+ $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['table'] = 'history';
+ $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['label'] = '';
+ $handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
+ $handler->display->display_options['fields']['timestamp']['comments'] = 1;
+ /* Sort criterion: Content statistics: Total views */
+ $handler->display->display_options['sorts']['totalcount']['id'] = 'totalcount';
+ $handler->display->display_options['sorts']['totalcount']['table'] = 'node_counter';
+ $handler->display->display_options['sorts']['totalcount']['field'] = 'totalcount';
+ $handler->display->display_options['sorts']['totalcount']['order'] = 'DESC';
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = '1';
+ $handler->display->display_options['filters']['status']['group'] = 0;
+ $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+ /* Filter criterion: Content statistics: Total views */
+ $handler->display->display_options['filters']['totalcount']['id'] = 'totalcount';
+ $handler->display->display_options['filters']['totalcount']['table'] = 'node_counter';
+ $handler->display->display_options['filters']['totalcount']['field'] = 'totalcount';
+ $handler->display->display_options['filters']['totalcount']['operator'] = '>';
+ $handler->display->display_options['filters']['totalcount']['value']['value'] = '0';
+ $handler->display->display_options['filters']['totalcount']['group'] = 0;
+ $handler->display->display_options['filters']['totalcount']['expose']['operator'] = FALSE;
+
+ /* Display: Popular (page) */
+ $handler = $view->new_display('page', 'Popular (page)', 'page');
+ $handler->display->display_options['path'] = 'popular/all';
+ $handler->display->display_options['menu']['type'] = 'default tab';
+ $handler->display->display_options['menu']['title'] = 'Popular content';
+ $handler->display->display_options['menu']['weight'] = '-1';
+ $handler->display->display_options['tab_options']['type'] = 'normal';
+ $handler->display->display_options['tab_options']['title'] = 'Popular content';
+ $handler->display->display_options['tab_options']['weight'] = '';
+
+ /* Display: Today (page) */
+ $handler = $view->new_display('page', 'Today (page)', 'page_1');
+ $handler->display->display_options['defaults']['fields'] = FALSE;
+ /* Field: Content: Type */
+ $handler->display->display_options['fields']['type']['id'] = 'type';
+ $handler->display->display_options['fields']['type']['table'] = 'node';
+ $handler->display->display_options['fields']['type']['field'] = 'type';
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ /* Field: User: Name */
+ $handler->display->display_options['fields']['name']['id'] = 'name';
+ $handler->display->display_options['fields']['name']['table'] = 'users';
+ $handler->display->display_options['fields']['name']['field'] = 'name';
+ $handler->display->display_options['fields']['name']['label'] = 'Author';
+ /* Field: Content: Has new content */
+ $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['table'] = 'history';
+ $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
+ $handler->display->display_options['fields']['timestamp']['label'] = '';
+ $handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
+ $handler->display->display_options['fields']['timestamp']['comments'] = 1;
+ /* Field: Content statistics: Views today */
+ $handler->display->display_options['fields']['daycount']['id'] = 'daycount';
+ $handler->display->display_options['fields']['daycount']['table'] = 'node_counter';
+ $handler->display->display_options['fields']['daycount']['field'] = 'daycount';
+ $handler->display->display_options['defaults']['sorts'] = FALSE;
+ /* Sort criterion: Content statistics: Views today */
+ $handler->display->display_options['sorts']['daycount']['id'] = 'daycount';
+ $handler->display->display_options['sorts']['daycount']['table'] = 'node_counter';
+ $handler->display->display_options['sorts']['daycount']['field'] = 'daycount';
+ $handler->display->display_options['sorts']['daycount']['order'] = 'DESC';
+ $handler->display->display_options['path'] = 'popular/today';
+ $handler->display->display_options['menu']['type'] = 'tab';
+ $handler->display->display_options['menu']['title'] = 'Today\'s popular content';
+ $handler->display->display_options['menu']['weight'] = '0';
+ $handler->display->display_options['tab_options']['type'] = 'normal';
+ $handler->display->display_options['tab_options']['title'] = 'Popular content';
+ $handler->display->display_options['tab_options']['weight'] = '0';
+
+ /* Display: Popular (block) */
+ $handler = $view->new_display('block', 'Popular (block)', 'block');
+ $handler->display->display_options['defaults']['style_plugin'] = FALSE;
+ $handler->display->display_options['style_plugin'] = 'list';
+ $handler->display->display_options['defaults']['style_options'] = FALSE;
+ $handler->display->display_options['defaults']['row_plugin'] = FALSE;
+ $handler->display->display_options['row_plugin'] = 'fields';
+ $handler->display->display_options['row_options']['inline'] = array(
+ 'title' => 'title',
+ 'totalcount' => 'totalcount',
+ );
+ $handler->display->display_options['defaults']['row_options'] = FALSE;
+ $handler->display->display_options['defaults']['fields'] = FALSE;
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['label'] = '';
+ $handler->display->display_options['fields']['title']['link_to_node'] = 1;
+ /* Field: Content statistics: Total views */
+ $handler->display->display_options['fields']['totalcount']['id'] = 'totalcount';
+ $handler->display->display_options['fields']['totalcount']['table'] = 'node_counter';
+ $handler->display->display_options['fields']['totalcount']['field'] = 'totalcount';
+ $handler->display->display_options['fields']['totalcount']['label'] = '';
+ $handler->display->display_options['fields']['totalcount']['prefix'] = ' (';
+ $handler->display->display_options['fields']['totalcount']['suffix'] = ')';
+
+ /* Display: Today (block) */
+ $handler = $view->new_display('block', 'Today (block)', 'block_1');
+ $handler->display->display_options['defaults']['title'] = FALSE;
+ $handler->display->display_options['title'] = 'Today\'s popular content';
+ $handler->display->display_options['defaults']['link_display'] = FALSE;
+ $handler->display->display_options['link_display'] = 'page_1';
+ $handler->display->display_options['defaults']['style_plugin'] = FALSE;
+ $handler->display->display_options['style_plugin'] = 'list';
+ $handler->display->display_options['defaults']['style_options'] = FALSE;
+ $handler->display->display_options['defaults']['row_plugin'] = FALSE;
+ $handler->display->display_options['row_plugin'] = 'fields';
+ $handler->display->display_options['row_options']['inline'] = array(
+ 'title' => 'title',
+ 'daycount' => 'daycount',
+ );
+ $handler->display->display_options['defaults']['row_options'] = FALSE;
+ $handler->display->display_options['defaults']['fields'] = FALSE;
+ /* Field: Content: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['label'] = '';
+ $handler->display->display_options['fields']['title']['link_to_node'] = 1;
+ /* Field: Content statistics: Views today */
+ $handler->display->display_options['fields']['daycount']['id'] = 'daycount';
+ $handler->display->display_options['fields']['daycount']['table'] = 'node_counter';
+ $handler->display->display_options['fields']['daycount']['field'] = 'daycount';
+ $handler->display->display_options['fields']['daycount']['label'] = '';
+ $handler->display->display_options['fields']['daycount']['prefix'] = ' (';
+ $handler->display->display_options['fields']['daycount']['suffix'] = ')';
+ $handler->display->display_options['defaults']['sorts'] = FALSE;
+ /* Sort criterion: Content statistics: Views today */
+ $handler->display->display_options['sorts']['daycount']['id'] = 'daycount';
+ $handler->display->display_options['sorts']['daycount']['table'] = 'node_counter';
+ $handler->display->display_options['sorts']['daycount']['field'] = 'daycount';
+ $handler->display->display_options['sorts']['daycount']['order'] = 'DESC';
+ $translatables['popular'] = array(
+ t('Master'),
+ t('Popular content'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('Type'),
+ t('Title'),
+ t('Author'),
+ t('Popular (page)'),
+ t('Today (page)'),
+ t('Views today'),
+ t('.'),
+ t(','),
+ t('Popular (block)'),
+ t(' ('),
+ t(')'),
+ t('Today (block)'),
+ t('Today\'s popular content'),
+ );
+
+ $views['popular'] = $view;
+
+ return $views;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics/views_handler_field_accesslog_path.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics/views_handler_field_accesslog_path.inc
new file mode 100644
index 0000000..d0daa69
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/statistics/views_handler_field_accesslog_path.inc
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Field handler to provide simple renderer that turns a URL into a clickable link.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_accesslog_path extends views_handler_field {
+ /**
+ * Override init function to provide generic option to link to node.
+ */
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ if (!empty($this->options['display_as_link'])) {
+ $this->additional_fields['path'] = 'path';
+ }
+ }
+
+ 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) {
+ $form['display_as_link'] = array(
+ '#title' => t('Display as link'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['display_as_link']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+
+ function render_link($data, $values) {
+ if (!empty($this->options['display_as_link'])) {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = $this->get_value($values, 'path');
+ $this->options['alter']['html'] = TRUE;
+ }
+
+ return $data;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system.views.inc
new file mode 100644
index 0000000..d49385c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system.views.inc
@@ -0,0 +1,575 @@
+<?php
+/**
+ * @file
+ *
+ * Provide views data and handlers for system tables that are not represented by
+ * their own module.
+ */
+
+/**
+ * @defgroup views_system_module system.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function system_views_data() {
+ $data = array();
+
+ // ----------------------------------------------------------------------
+ // file_managed table
+
+ $data['files']['moved to'] = 'file_managed';
+ $data['file_managed']['table']['group'] = t('File');
+
+ // Advertise this table as a possible base table
+ $data['file_managed']['table']['base'] = array(
+ 'field' => 'fid',
+ 'title' => t('File'),
+ 'help' => t("Files maintained by Drupal and various modules."),
+ 'defaults' => array(
+ 'field' => 'filename'
+ ),
+ );
+ $data['file_managed']['table']['entity type'] = 'file';
+
+
+ // The file table does not inherently join to the node table,
+ // but may things (such as upload.module) can add relationships
+ // that allow file fields to be used.
+
+ // fid
+ $data['file_managed']['fid'] = array(
+ 'title' => t('File ID'),
+ 'help' => t('The ID of the file.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_file',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_file_fid',
+ 'name field' => 'filename', // the field to display in the summary.
+ 'numeric' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // filename
+ $data['file_managed']['filename'] = array(
+ 'title' => t('Name'),
+ 'help' => t('The name of the file.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_file',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // uri
+ $data['file_managed']['uri'] = array(
+ 'title' => t('Path'),
+ 'help' => t('The path of the file.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_file_uri',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // filemime
+ $data['file_managed']['filemime'] = array(
+ 'title' => t('Mime type'),
+ 'help' => t('The mime type of the file.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_file_filemime',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // extension
+ $data['file_managed']['extension'] = array(
+ 'title' => t('Extension'),
+ 'help' => t('The extension of the file.'),
+ 'real field' => 'filename',
+ 'field' => array(
+ 'handler' => 'views_handler_field_file_extension',
+ 'click sortable' => FALSE,
+ ),
+ );
+
+ // filesize
+ $data['file_managed']['filesize'] = array(
+ 'title' => t('Size'),
+ 'help' => t('The size of the file.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_file_size',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ );
+
+ // status
+ $data['file_managed']['status'] = array(
+ 'title' => t('Status'),
+ 'help' => t('The status of the file.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_file_status',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_file_status',
+ ),
+ );
+
+ // timestamp field
+ $data['file_managed']['timestamp'] = array(
+ 'title' => t('Upload date'),
+ 'help' => t('The date the file was uploaded.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ // uid
+ $data['file_managed']['uid'] = array(
+ 'title' => t('User who uploaded'),
+ 'help' => t('The user that uploaded the file.'),
+ 'relationship' => array(
+ 'title' => t('User who uploaded'),
+ 'label' => t('User who uploaded'),
+ 'base' => 'users',
+ 'base field' => 'uid',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // file_usage table
+
+ $data['file_usage']['table']['group'] = t('File Usage');
+
+ // Provide field-type-things to several base tables; on the core files table ("file_managed") so
+ // that we can create relationships from files to entities, and then on each core entity type base
+ // table so that we can provide general relationships between entities and files.
+ $data['file_usage']['table']['join'] = array(
+ // Link ourself to the {file_managed} table so we can provide file->entity relationships.
+ 'file_managed' => array(
+ 'field' => 'fid',
+ 'left_field' => 'fid',
+ ),
+ // Link ourself to the {node} table so we can provide node->file relationships.
+ 'node' => array(
+ 'field' => 'id',
+ 'left_field' => 'nid',
+ 'extra' => array(array('field' => 'type', 'value' => 'node')),
+ ),
+ // Link ourself to the {users} table so we can provide user->file relationships.
+ 'users' => array(
+ 'field' => 'id',
+ 'left_field' => 'uid',
+ 'extra' => array(array('field' => 'type', 'value' => 'user')),
+ ),
+ // Link ourself to the {comment} table so we can provide comment->file relationships.
+ 'comment' => array(
+ 'field' => 'id',
+ 'left_field' => 'cid',
+ 'extra' => array(array('field' => 'type', 'value' => 'comment')),
+ ),
+ // Link ourself to the {taxonomy_term_data} table so we can provide taxonomy_term->file relationships.
+ 'taxonomy_term_data' => array(
+ 'field' => 'id',
+ 'left_field' => 'tid',
+ 'extra' => array(array('field' => 'type', 'value' => 'taxonomy_term')),
+ ),
+ // Link ourself to the {taxonomy_vocabulary} table so we can provide taxonomy_vocabulary->file relationships.
+ 'taxonomy_vocabulary' => array(
+ 'field' => 'id',
+ 'left_field' => 'vid',
+ 'extra' => array(array('field' => 'type', 'value' => 'taxonomy_vocabulary')),
+ ),
+ );
+
+ // Provide a relationship between the files table and each entity type, and between each entity
+ // type and the files table. Entity->file relationships are type-restricted in the joins
+ // declared above, and file->entity relationships are type-restricted in the relationship
+ // declarations below.
+
+ // Relationships between files and nodes.
+ $data['file_usage']['file_to_node'] = array(
+ 'title' => t('Content'),
+ 'help' => t('Content that is associated with this file, usually because this file is in a field on the content.'),
+ // Only provide this field/relationship/etc. when the 'file_managed' base table is present.
+ 'skip base' => array('node', 'node_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'id',
+ 'relationship' => array(
+ 'title' => t('Content'),
+ 'label' => t('Content'),
+ 'base' => 'node',
+ 'base field' => 'nid',
+ 'relationship field' => 'id',
+ 'extra' => array(array('field' => 'type', 'value' => 'node')),
+ ),
+ );
+ $data['file_usage']['node_to_file'] = array(
+ 'title' => t('File'),
+ 'help' => t('A file that is associated with this node, usually because it is in a field on the node.'),
+ // Only provide this field/relationship/etc. when the 'node' base table is present.
+ 'skip base' => array('file_managed', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'fid',
+ 'relationship' => array(
+ 'title' => t('File'),
+ 'label' => t('File'),
+ 'base' => 'file_managed',
+ 'base field' => 'fid',
+ 'relationship field' => 'fid',
+ ),
+ );
+
+ // Relationships between files and users.
+ $data['file_usage']['file_to_user'] = array(
+ 'title' => t('User'),
+ 'help' => t('A user that is associated with this file, usually because this file is in a field on the user.'),
+ // Only provide this field/relationship/etc. when the 'file_managed' base table is present.
+ 'skip base' => array('node', 'node_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'id',
+ 'relationship' => array(
+ 'title' => t('User'),
+ 'label' => t('User'),
+ 'base' => 'users',
+ 'base field' => 'uid',
+ 'relationship field' => 'id',
+ 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'user')),
+ ),
+ );
+ $data['file_usage']['user_to_file'] = array(
+ 'title' => t('File'),
+ 'help' => t('A file that is associated with this user, usually because it is in a field on the user.'),
+ // Only provide this field/relationship/etc. when the 'users' base table is present.
+ 'skip base' => array('file_managed', 'node', 'node_revision', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'fid',
+ 'relationship' => array(
+ 'title' => t('File'),
+ 'label' => t('File'),
+ 'base' => 'file_managed',
+ 'base field' => 'fid',
+ 'relationship field' => 'fid',
+ ),
+ );
+
+ // Relationships between files and comments.
+ $data['file_usage']['file_to_comment'] = array(
+ 'title' => t('Comment'),
+ 'help' => t('A comment that is associated with this file, usually because this file is in a field on the comment.'),
+ // Only provide this field/relationship/etc. when the 'file_managed' base table is present.
+ 'skip base' => array('node', 'node_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'id',
+ 'relationship' => array(
+ 'title' => t('Comment'),
+ 'label' => t('Comment'),
+ 'base' => 'comment',
+ 'base field' => 'cid',
+ 'relationship field' => 'id',
+ 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'comment')),
+ ),
+ );
+ $data['file_usage']['comment_to_file'] = array(
+ 'title' => t('File'),
+ 'help' => t('A file that is associated with this comment, usually because it is in a field on the comment.'),
+ // Only provide this field/relationship/etc. when the 'comment' base table is present.
+ 'skip base' => array('file_managed', 'node', 'node_revision', 'users', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'fid',
+ 'relationship' => array(
+ 'title' => t('File'),
+ 'label' => t('File'),
+ 'base' => 'file_managed',
+ 'base field' => 'fid',
+ 'relationship field' => 'fid',
+ ),
+ );
+
+ // Relationships between files and taxonomy_terms.
+ $data['file_usage']['file_to_taxonomy_term'] = array(
+ 'title' => t('Taxonomy Term'),
+ 'help' => t('A taxonomy term that is associated with this file, usually because this file is in a field on the taxonomy term.'),
+ // Only provide this field/relationship/etc. when the 'file_managed' base table is present.
+ 'skip base' => array('node', 'node_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'id',
+ 'relationship' => array(
+ 'title' => t('Taxonomy Term'),
+ 'label' => t('Taxonomy Term'),
+ 'base' => 'taxonomy_term_data',
+ 'base field' => 'tid',
+ 'relationship field' => 'id',
+ 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'taxonomy_term')),
+ ),
+ );
+ $data['file_usage']['taxonomy_term_to_file'] = array(
+ 'title' => t('File'),
+ 'help' => t('A file that is associated with this taxonomy term, usually because it is in a field on the taxonomy term.'),
+ // Only provide this field/relationship/etc. when the 'taxonomy_term_data' base table is present.
+ 'skip base' => array('file_managed', 'node', 'node_revision', 'users', 'comment', 'taxonomy_vocabulary'),
+ 'real field' => 'fid',
+ 'relationship' => array(
+ 'title' => t('File'),
+ 'label' => t('File'),
+ 'base' => 'file_managed',
+ 'base field' => 'fid',
+ 'relationship field' => 'fid',
+ ),
+ );
+
+ // Relationships between files and taxonomy_vocabulary items.
+ $data['file_usage']['file_to_taxonomy_vocabulary'] = array(
+ 'title' => t('Taxonomy Vocabulary'),
+ 'help' => t('A taxonomy vocabulary that is associated with this file, usually because this file is in a field on the taxonomy vocabulary.'),
+ // Only provide this field/relationship/etc. when the 'file_managed' base table is present.
+ 'skip base' => array('node', 'node_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'),
+ 'real field' => 'id',
+ 'relationship' => array(
+ 'title' => t('Taxonomy Vocabulary'),
+ 'label' => t('Taxonomy Vocabulary'),
+ 'base' => 'taxonomy_vocabulary',
+ 'base field' => 'vid',
+ 'relationship field' => 'id',
+ 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'taxonomy_vocabulary')),
+ ),
+ );
+ $data['file_usage']['taxonomy_vocabulary_to_file'] = array(
+ 'title' => t('File'),
+ 'help' => t('A file that is associated with this taxonomy vocabulary, usually because it is in a field on the taxonomy vocabulary.'),
+ // Only provide this field/relationship/etc. when the 'taxonomy_vocabulary' base table is present.
+ 'skip base' => array('file_managed', 'node', 'node_revision', 'users', 'comment', 'taxonomy_term_data'),
+ 'real field' => 'fid',
+ 'relationship' => array(
+ 'title' => t('File'),
+ 'label' => t('File'),
+ 'base' => 'file_managed',
+ 'base field' => 'fid',
+ 'relationship field' => 'fid',
+ ),
+ );
+
+ // Provide basic fields from the {file_usage} table to all of the base tables we've declared
+ // joins to (because there is no 'skip base' property on these fields).
+ $data['file_usage']['module'] = array(
+ 'title' => t('Module'),
+ 'help' => t('The module managing this file relationship.'),
+ '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',
+ ),
+ );
+ $data['file_usage']['type'] = array(
+ 'title' => t('Entity type'),
+ 'help' => t('The type of entity that is related to the file.'),
+ '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',
+ ),
+ );
+ $data['file_usage']['count'] = array(
+ 'title' => t('Use count'),
+ 'help' => t('The number of times the file is used by this entity.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // system table
+ $data['system']['table']['group'] = t('System');
+
+ // Advertise this table as a possible base table
+ $data['system']['table']['base'] = array(
+ 'field' => 'filename',
+ 'title' => t('Module/Theme/Theme engine'),
+ 'help' => t('Modules/Themes/Theme engines in your codebase.'),
+ );
+
+ // fields
+ // - filename
+ $data['system']['filename'] = array(
+ 'title' => t('Module/Theme/Theme engine filename'),
+ 'help' => t('The path of the primary file for this item, relative to the Drupal root; e.g. modules/node/node.module.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ 'name field' => 'filename', // the field to display in the summary.
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+ // - name
+ $data['system']['name'] = array(
+ 'title' => t('Module/Theme/Theme engine name'),
+ 'help' => t('The name of the item; e.g. node.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ 'name field' => 'name', // the field to display in the summary.
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+ // - type
+ $data['system']['type'] = array(
+ 'title' => t('Type'),
+ 'help' => t('The type of the item, either module, theme, or theme_engine.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ 'name field' => 'type', // the field to display in the summary.
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_system_type',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+ // - status
+ $data['system']['status'] = array(
+ 'title' => t('Status'),
+ 'help' => t('Boolean indicating whether or not this item is enabled.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ 'name field' => 'status', // the field to display in the summary.
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+ // - schema version
+ $data['system']['schema_version'] = array(
+ 'title' => t('Schema version'),
+ 'help' => t("The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed."),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ 'name field' => 'schema_version', // the field to display in the summary.
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ return $data;
+}
+
+function _views_file_status($choice = NULL) {
+ $status = array(
+ 0 => t('Temporary'),
+ FILE_STATUS_PERMANENT => t('Permanent'),
+ );
+
+ if (isset($choice)) {
+ return isset($status[$choice]) ? $status[$choice] : t('Unknown');
+ }
+
+ return $status;
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_argument_file_fid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_argument_file_fid.inc
new file mode 100644
index 0000000..8a4088f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_argument_file_fid.inc
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Argument handler to accept multiple file ids.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_file_fid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title_query(). Get the filenames.
+ */
+ function title_query() {
+ $titles = db_select('file_managed', 'f')
+ ->fields('f', array('filename'))
+ ->condition('fid', $this->value)
+ ->execute()
+ ->fetchCol();
+ foreach ($titles as &$title) {
+ $title = check_plain($title);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file.inc
new file mode 100644
index 0000000..f642b89
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file.inc
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Field handler to provide simple renderer that allows linking to a file.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_file extends views_handler_field {
+ /**
+ * Constructor to provide additional field to add.
+ */
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ if (!empty($options['link_to_file'])) {
+ $this->additional_fields['uri'] = 'uri';
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_file'] = array('default' => FALSE);
+ return $options;
+ }
+
+ /**
+ * Provide link to file option
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_file'] = array(
+ '#title' => t('Link this field to download the file'),
+ '#description' => t("Enable to override this field's links."),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['link_to_file']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ /**
+ * Render whatever the data is as a link to the file.
+ *
+ * Data should be made XSS safe prior to calling this function.
+ */
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_file']) && $data !== NULL && $data !== '') {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = file_create_url($this->get_value($values, 'uri'));
+ }
+
+ return $data;
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_extension.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_extension.inc
new file mode 100644
index 0000000..e64fbc9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_extension.inc
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * Returns a pure file extension of the file, for example 'module'.
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_file_extension extends views_handler_field {
+ function render($values) {
+ $value = $this->get_value($values);
+ if (preg_match('/\.([^\.]+)$/', $value, $match)) {
+ return $this->sanitize_value($match[1]);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_filemime.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_filemime.inc
new file mode 100644
index 0000000..0b29c79
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_filemime.inc
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * Field handler to add rendering MIME type images as an option on the filemime field.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_file_filemime extends views_handler_field_file {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['filemime_image'] = array('default' => FALSE);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['filemime_image'] = array(
+ '#title' => t('Display an icon representing the file type, instead of the MIME text (such as "image/jpeg")'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['filemime_image']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function render($values) {
+ $data = $values->{$this->field_alias};
+ if (!empty($this->options['filemime_image']) && $data !== NULL && $data !== '') {
+ $fake_file = (object) array('filemime' => $data);
+ $data = theme('file_icon', array('file' => $fake_file));
+ }
+
+ return $this->render_link($data, $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_status.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_status.inc
new file mode 100644
index 0000000..84d9148
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_status.inc
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Field handler to translate a node type into its readable form.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_file_status extends views_handler_field {
+ function render($values) {
+ $value = $this->get_value($values);
+ return _views_file_status($value);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_uri.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_uri.inc
new file mode 100644
index 0000000..d36aba3
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_field_file_uri.inc
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * Field handler to add rendering file paths as file URLs instead of as internal file URIs.
+ */
+class views_handler_field_file_uri extends views_handler_field_file {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['file_download_path'] = array('default' => FALSE);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['file_download_path'] = array(
+ '#title' => t('Display download path instead of file storage URI'),
+ '#description' => t('This will provide the full download URL rather than the internal filestream address.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['file_download_path']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function render($values) {
+ $data = $values->{$this->field_alias};
+ if (!empty($this->options['file_download_path']) && $data !== NULL && $data !== '') {
+ $data = file_create_url($data);
+ }
+ return $this->render_link($data, $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_file_status.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_file_status.inc
new file mode 100644
index 0000000..3133755
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_file_status.inc
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Filter by file status.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_file_status extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_options = _views_file_status();
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_system_type.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_system_type.inc
new file mode 100644
index 0000000..5a9a811
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/system/views_handler_filter_system_type.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Filter by system type.
+ */
+class views_handler_filter_system_type extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_title = t('Type');
+ // Enable filtering by type.
+ $types = array();
+ $types = db_query('SELECT DISTINCT(type) FROM {system} ORDER BY type')->fetchAllKeyed(0, 0);
+ $this->value_options = $types;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views.inc
new file mode 100644
index 0000000..7dd225b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views.inc
@@ -0,0 +1,511 @@
+<?php
+/**
+ * @file
+ *
+ * Provide views data and handlers for taxonomy.module
+ */
+
+/**
+ * @defgroup views_taxonomy_module taxonomy.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function taxonomy_views_data() {
+ $data = array();
+
+ // ----------------------------------------------------------------------
+ // taxonomy_vocabulary table
+
+ $data['vocabulary']['moved to'] = 'taxonomy_vocabulary';
+ $data['taxonomy_vocabulary']['table']['group'] = t('Taxonomy vocabulary');
+
+ $data['taxonomy_vocabulary']['table']['join'] = array(
+ // vocabulary links to taxonomy_term_data directly via vid.
+ 'taxonomy_term_data' => array(
+ 'left_field' => 'vid',
+ 'field' => 'vid',
+ ),
+ );
+
+ // Provide a "default relationship" to keep older views from choking.
+ $data['taxonomy_vocabulary']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'term_node_tid',
+ ),
+ );
+
+ // vocabulary name
+ $data['taxonomy_vocabulary']['name'] = array(
+ 'title' => t('Name'), // The item it appears as on the UI,
+ 'field' => array(
+ 'help' => t('Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'),
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ 'help' => t('The taxonomy vocabulary name'),
+ ),
+ );
+ $data['taxonomy_vocabulary']['machine_name'] = array(
+ 'title' => t('Machine name'), // The item it appears as on the UI,
+ 'field' => array(
+ 'help' => t('Machine-Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'),
+ 'handler' => 'views_handler_field',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'),
+ 'handler' => 'views_handler_filter_vocabulary_machine_name',
+ ),
+ 'argument' => array(
+ 'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'),
+ 'handler' => 'views_handler_argument_vocabulary_machine_name',
+ ),
+ );
+ $data['taxonomy_vocabulary']['vid'] = array(
+ 'title' => t('Vocabulary ID'), // The item it appears as on the UI,
+ 'help' => t('The taxonomy vocabulary ID'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_vocabulary_vid',
+ 'name field' => 'name',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+ $data['taxonomy_vocabulary']['description'] = array(
+ 'title' => t('Description'), // The item it appears as on the UI,
+ 'help' => t('The taxonomy vocabulary description'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // taxonomy_term_data table
+
+ $data['term_data']['moved to'] = 'taxonomy_term_data';
+ $data['taxonomy_term_data']['table']['group'] = t('Taxonomy term');
+ $data['taxonomy_term_data']['table']['base'] = array(
+ 'field' => 'tid',
+ 'title' => t('Term'),
+ 'help' => t('Taxonomy terms are attached to nodes.'),
+ 'access query tag' => 'term_access',
+ );
+ $data['taxonomy_term_data']['table']['entity type'] = 'taxonomy_term';
+
+
+
+ // The term data table
+ $data['taxonomy_term_data']['table']['join'] = array(
+ 'taxonomy_vocabulary' => array(
+ 'field' => 'vid',
+ 'left_field' => 'vid',
+ ),
+ // This is provided for many_to_one argument
+ 'taxonomy_index' => array(
+ 'field' => 'tid',
+ 'left_field' => 'tid',
+ ),
+ );
+
+ // Provide a "default relationship" to keep older views from choking.
+ $data['taxonomy_term_data']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'term_node_tid',
+ ),
+ );
+
+ // tid field
+ $data['taxonomy_term_data']['tid'] = array(
+ 'title' => t('Term ID'),
+ 'help' => t('The tid of a taxonomy term.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_taxonomy',
+ 'name field' => 'name',
+ 'zero is null' => TRUE,
+ ),
+ 'filter' => array(
+ 'title' => t('Term'),
+ 'help' => t('Taxonomy term chosen from autocomplete or select widget.'),
+ 'handler' => 'views_handler_filter_term_node_tid',
+ 'hierarchy table' => 'taxonomy_term_hierarchy',
+ 'numeric' => TRUE,
+ ),
+ );
+
+ $data['taxonomy_term_data']['tid_representative'] = array(
+ 'relationship' => array(
+ 'title' => t('Representative node'),
+ 'label' => t('Representative node'),
+ 'help' => t('Obtains a single representative node for each term, according to a chosen sort criterion.'),
+ 'handler' => 'views_handler_relationship_groupwise_max',
+ 'relationship field' => 'tid',
+ 'outer field' => 'taxonomy_term_data.tid',
+ 'argument table' => 'taxonomy_term_data',
+ 'argument field' => 'tid',
+ 'base' => 'node',
+ 'field' => 'nid',
+ ),
+ );
+
+ // Term name field
+ $data['taxonomy_term_data']['name'] = array(
+ 'title' => t('Name'),
+ 'help' => t('The taxonomy term name.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_taxonomy',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ 'help' => t('Taxonomy term name.'),
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ 'help' => t('Taxonomy term name.'),
+ 'many to one' => TRUE,
+ 'empty field name' => t('Uncategorized'),
+ ),
+ );
+
+ // taxonomy weight
+ $data['taxonomy_term_data']['weight'] = array(
+ 'title' => t('Weight'),
+ 'help' => t('The term weight field'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ );
+
+ // Term description
+ $data['taxonomy_term_data']['description'] = array(
+ 'title' => t('Term description'),
+ 'help' => t('The description associated with a taxonomy term.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_markup',
+ 'format' => array('field' => 'format'),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ // Term vocabulary
+ $data['taxonomy_term_data']['vid'] = array(
+ 'title' => t('Vocabulary'),
+ 'help' => t('Filter the results of "Taxonomy: Term" to a particular vocabulary.'),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_vocabulary_vid',
+ ),
+ );
+
+ // Link to edit the term
+ $data['taxonomy_term_data']['edit_term'] = array(
+ 'field' => array(
+ 'title' => t('Term edit link'),
+ 'help' => t('Provide a simple link to edit the term.'),
+ 'handler' => 'views_handler_field_term_link_edit',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // taxonomy_index table
+
+ $data['term_node']['moved to'] = 'taxonomy_index';
+ $data['taxonomy_index']['table']['group'] = t('Taxonomy term');
+
+ $data['taxonomy_index']['table']['join'] = array(
+ 'taxonomy_term_data' => array(
+ // links directly to taxonomy_term_data via tid
+ 'left_field' => 'tid',
+ 'field' => 'tid',
+ ),
+ 'node' => array(
+ // links directly to node via nid
+ 'left_field' => 'nid',
+ 'field' => 'nid',
+ ),
+ 'taxonomy_term_hierarchy' => array(
+ 'left_field' => 'tid',
+ 'field' => 'tid',
+ ),
+ );
+
+ $data['taxonomy_index']['nid'] = array(
+ 'title' => t('Content with term'),
+ 'help' => t('Relate all content tagged with a term.'),
+ 'relationship' => array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'node',
+ 'base field' => 'nid',
+ 'label' => t('node'),
+ 'skip base' => 'node',
+ ),
+ );
+
+ // @todo This stuff needs to move to a node field since
+ // really it's all about nodes.
+ // tid field
+ $data['taxonomy_index']['tid'] = array(
+ 'group' => t('Content'),
+ 'title' => t('Has taxonomy term ID'),
+ 'help' => t('Display content if it has the selected taxonomy terms.'),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_term_node_tid',
+ 'name table' => 'taxonomy_term_data',
+ 'name field' => 'name',
+ 'empty field name' => t('Uncategorized'),
+ 'numeric' => TRUE,
+ 'skip base' => 'taxonomy_term_data',
+ ),
+ 'filter' => array(
+ 'title' => t('Has taxonomy term'),
+ 'handler' => 'views_handler_filter_term_node_tid',
+ 'hierarchy table' => 'taxonomy_term_hierarchy',
+ 'numeric' => TRUE,
+ 'skip base' => 'taxonomy_term_data',
+ 'allow empty' => TRUE,
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // term_hierarchy table
+
+ $data['taxonomy_term_hierarchy']['table']['group'] = t('Taxonomy term');
+
+ $data['term_hierarchy']['moved to'] = 'taxonomy_term_hierarchy';
+ $data['taxonomy_term_hierarchy']['table']['join'] = array(
+ 'taxonomy_term_hierarchy' => array(
+ // links to self through left.parent = right.tid (going down in depth)
+ 'left_field' => 'tid',
+ 'field' => 'parent',
+ ),
+ 'taxonomy_term_data' => array(
+ // links directly to taxonomy_term_data via tid
+ 'left_field' => 'tid',
+ 'field' => 'tid',
+ ),
+ );
+
+ // Provide a "default relationship" to keep older views from choking.
+ $data['taxonomy_term_hierarchy']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'term_node_tid',
+ ),
+ );
+
+ $data['taxonomy_term_hierarchy']['parent'] = array(
+ 'title' => t('Parent term'),
+ 'help' => t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.'),
+ 'relationship' => array(
+ 'base' => 'taxonomy_term_data',
+ 'field' => 'parent',
+ 'label' => t('Parent'),
+ ),
+ 'argument' => array(
+ 'help' => t('The parent term of the term.'),
+ 'handler' => 'views_handler_argument_taxonomy',
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * Implements hook_views_data_alter().
+ */
+function taxonomy_views_data_alter(&$data) {
+ $data['node']['term_node_tid'] = array(
+ 'title' => t('Taxonomy terms on node'),
+ 'help' => t('Relate nodes to taxonomy terms, specifiying which vocabulary or vocabularies to use. This relationship will cause duplicated records if there are multiple terms.'),
+ 'relationship' => array(
+ 'handler' => 'views_handler_relationship_node_term_data',
+ 'label' => t('term'),
+ 'base' => 'taxonomy_term_data',
+ ),
+ 'field' => array(
+ 'title' => t('All taxonomy terms'),
+ 'help' => t('Display all taxonomy terms associated with a node from specified vocabularies.'),
+ 'handler' => 'views_handler_field_term_node_tid',
+ 'no group by' => TRUE,
+ ),
+ );
+
+ $data['node']['term_node_tid_depth'] = array(
+ 'help' => t('Display content if it has the selected taxonomy terms, or children of the selected terms. Due to additional complexity, this has fewer options than the versions without depth.'),
+ 'real field' => 'nid',
+ 'argument' => array(
+ 'title' => t('Has taxonomy term ID (with depth)'),
+ 'handler' => 'views_handler_argument_term_node_tid_depth',
+ 'accept depth modifier' => TRUE,
+ ),
+ 'filter' => array(
+ 'title' => t('Has taxonomy terms (with depth)'),
+ 'handler' => 'views_handler_filter_term_node_tid_depth',
+ ),
+ );
+
+ $data['node']['term_node_tid_depth_modifier'] = array(
+ 'title' => t('Has taxonomy term ID depth modifier'),
+ 'help' => t('Allows the "depth" for Taxonomy: Term ID (with depth) to be modified via an additional contextual filter value.'),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_term_node_tid_depth_modifier',
+ ),
+ );
+}
+
+/**
+ * Implements hook_field_views_data().
+ *
+ * Views integration for taxonomy_term_reference fields. Adds a term relationship to the default
+ * field data.
+ *
+ * @see field_views_field_default_views_data()
+ */
+function taxonomy_field_views_data($field) {
+ $data = field_views_field_default_views_data($field);
+ foreach ($data as $table_name => $table_data) {
+ foreach ($table_data as $field_name => $field_data) {
+ if (isset($field_data['filter']) && $field_name != 'delta') {
+ $data[$table_name][$field_name]['filter']['handler'] = 'views_handler_filter_term_node_tid';
+ $data[$table_name][$field_name]['filter']['vocabulary'] = $field['settings']['allowed_values'][0]['vocabulary'];
+ }
+ }
+
+ // Add the relationship only on the tid field.
+ $data[$table_name][$field['field_name'] . '_tid']['relationship'] = array(
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'taxonomy_term_data',
+ 'base field' => 'tid',
+ 'label' => t('term from !field_name', array('!field_name' => $field['field_name'])),
+ );
+
+ }
+
+ return $data;
+}
+
+/**
+ * Implements hook_field_views_data_views_data_alter().
+ *
+ * Views integration to provide reverse relationships on term references.
+ */
+function taxonomy_field_views_data_views_data_alter(&$data, $field) {
+ foreach ($field['bundles'] as $entity_type => $bundles) {
+ $entity_info = entity_get_info($entity_type);
+ $pseudo_field_name = 'reverse_' . $field['field_name'] . '_' . $entity_type;
+
+ list($label, $all_labels) = field_views_field_label($field['field_name']);
+ $entity = $entity_info['label'];
+ if ($entity == t('Node')) {
+ $entity = t('Content');
+ }
+
+ $data['taxonomy_term_data'][$pseudo_field_name]['relationship'] = array(
+ 'title' => t('@entity using @field', array('@entity' => $entity, '@field' => $label)),
+ 'help' => t('Relate each @entity with a @field set to the term.', array('@entity' => $entity, '@field' => $label)),
+ 'handler' => 'views_handler_relationship_entity_reverse',
+ 'field_name' => $field['field_name'],
+ 'field table' => _field_sql_storage_tablename($field),
+ 'field field' => $field['field_name'] . '_tid',
+ 'base' => $entity_info['base table'],
+ 'base field' => $entity_info['entity keys']['id'],
+ 'label' => t('!field_name', array('!field_name' => $field['field_name'])),
+ 'join_extra' => array(
+ 0 => array(
+ 'field' => 'entity_type',
+ 'value' => $entity_type,
+ ),
+ 1 => array(
+ 'field' => 'deleted',
+ 'value' => 0,
+ 'numeric' => TRUE,
+ ),
+ ),
+ );
+ }
+}
+
+/**
+ * Implements hook_views_plugins
+ */
+function taxonomy_views_plugins() {
+ return array(
+ 'module' => 'views', // This just tells our themes are elsewhere.
+ 'argument validator' => array(
+ 'taxonomy_term' => array(
+ 'title' => t('Taxonomy term'),
+ 'handler' => 'views_plugin_argument_validate_taxonomy_term',
+ 'path' => drupal_get_path('module', 'views') . '/modules/taxonomy', // not necessary for most modules
+ ),
+ ),
+ 'argument default' => array(
+ 'taxonomy_tid' => array(
+ 'title' => t('Taxonomy term ID from URL'),
+ 'handler' => 'views_plugin_argument_default_taxonomy_tid',
+ 'path' => drupal_get_path('module', 'views') . '/modules/taxonomy',
+ 'parent' => 'fixed',
+ ),
+ ),
+ );
+}
+
+/**
+ * Helper function to set a breadcrumb for taxonomy.
+ */
+function views_taxonomy_set_breadcrumb(&$breadcrumb, &$argument) {
+ if (empty($argument->options['set_breadcrumb'])) {
+ return;
+ }
+
+ $args = $argument->view->args;
+ $parents = taxonomy_get_parents_all($argument->argument);
+ foreach (array_reverse($parents) as $parent) {
+ // Unfortunately parents includes the current argument. Skip.
+ if ($parent->tid == $argument->argument) {
+ continue;
+ }
+ if (!empty($argument->options['use_taxonomy_term_path'])) {
+ $path = taxonomy_term_uri($parent);
+ }
+ else {
+ $args[$argument->position] = $parent->tid;
+ $path = $argument->view->get_url($args);
+ }
+ $breadcrumb[$path] = check_plain($parent->name);
+ }
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views_default.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views_default.inc
new file mode 100644
index 0000000..db53fc2
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy.views_default.inc
@@ -0,0 +1,108 @@
+<?php
+
+/**
+ * @file
+ * Bulk export of views_default objects generated by Bulk export module.
+ */
+
+/**
+ * Implementation of hook_views_default_views()
+ */
+function taxonomy_views_default_views() {
+ $views = array();
+
+ $view = new view;
+ $view->name = 'taxonomy_term';
+ $view->description = 'A view to emulate Drupal core\'s handling of taxonomy/term.';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Taxonomy term';
+ $view->core = 7;
+ $view->api_version = '3.0';
+ $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['query_comment'] = FALSE;
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['style_plugin'] = 'default';
+ $handler->display->display_options['row_plugin'] = 'node';
+ /* Sort criterion: Content: Sticky */
+ $handler->display->display_options['sorts']['sticky']['id'] = 'sticky';
+ $handler->display->display_options['sorts']['sticky']['table'] = 'node';
+ $handler->display->display_options['sorts']['sticky']['field'] = 'sticky';
+ $handler->display->display_options['sorts']['sticky']['order'] = 'DESC';
+ /* Sort criterion: Content: Post date */
+ $handler->display->display_options['sorts']['created']['id'] = 'created';
+ $handler->display->display_options['sorts']['created']['table'] = 'node';
+ $handler->display->display_options['sorts']['created']['field'] = 'created';
+ $handler->display->display_options['sorts']['created']['order'] = 'DESC';
+ /* Contextual filter: Content: Has taxonomy term ID (with depth) */
+ $handler->display->display_options['arguments']['term_node_tid_depth']['id'] = 'term_node_tid_depth';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['table'] = 'node';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['field'] = 'term_node_tid_depth';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['default_action'] = 'not found';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['exception']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['term_node_tid_depth']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['term_node_tid_depth']['title'] = '%1';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['specify_validation'] = 1;
+ $handler->display->display_options['arguments']['term_node_tid_depth']['validate']['type'] = 'taxonomy_term';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['depth'] = '0';
+ $handler->display->display_options['arguments']['term_node_tid_depth']['break_phrase'] = 1;
+ /* Contextual filter: Content: Has taxonomy term ID depth modifier */
+ $handler->display->display_options['arguments']['term_node_tid_depth_modifier']['id'] = 'term_node_tid_depth_modifier';
+ $handler->display->display_options['arguments']['term_node_tid_depth_modifier']['table'] = 'node';
+ $handler->display->display_options['arguments']['term_node_tid_depth_modifier']['field'] = 'term_node_tid_depth_modifier';
+ $handler->display->display_options['arguments']['term_node_tid_depth_modifier']['exception']['title_enable'] = 1;
+ $handler->display->display_options['arguments']['term_node_tid_depth_modifier']['default_argument_type'] = 'fixed';
+ $handler->display->display_options['arguments']['term_node_tid_depth_modifier']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['term_node_tid_depth_modifier']['specify_validation'] = 1;
+ /* Filter criterion: Content: Published or admin */
+ $handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
+ $handler->display->display_options['filters']['status_extra']['table'] = 'node';
+ $handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
+ $handler->display->display_options['filters']['status_extra']['group'] = 0;
+ $handler->display->display_options['filters']['status_extra']['expose']['operator'] = FALSE;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page');
+ $handler->display->display_options['path'] = 'taxonomy/term/%';
+
+ /* Display: Feed */
+ $handler = $view->new_display('feed', 'Feed', 'feed');
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = 15;
+ $handler->display->display_options['style_plugin'] = 'rss';
+ $handler->display->display_options['row_plugin'] = 'node_rss';
+ $handler->display->display_options['path'] = 'taxonomy/term/%/%/feed';
+ $handler->display->display_options['displays'] = array(
+ 'page' => 'page',
+ 'default' => 0,
+ );
+ $translatables['taxonomy_term'] = array(
+ t('Master'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('All'),
+ t('%1'),
+ t('Page'),
+ t('Feed'),
+ );
+
+ $views['taxonomy_term'] = $view;
+
+ return $views;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_taxonomy.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_taxonomy.inc
new file mode 100644
index 0000000..5c32ea4
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_taxonomy.inc
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Argument handler for basic taxonomy tid.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_taxonomy extends views_handler_argument_numeric {
+
+ /**
+ * Override the behavior of title(). Get the title of the node.
+ */
+ function title() {
+ // There might be no valid argument.
+ if ($this->argument) {
+ $term = taxonomy_term_load($this->argument);
+ if (!empty($term)) {
+ return check_plain($term->name);
+ }
+ }
+ // TODO review text
+ return t('No name');
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid.inc
new file mode 100644
index 0000000..e36c778
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid.inc
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Allow taxonomy term ID(s) as argument.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_term_node_tid extends views_handler_argument_many_to_one {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['set_breadcrumb'] = array('default' => FALSE);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ $form['set_breadcrumb'] = array(
+ '#type' => 'checkbox',
+ '#title' => t("Set the breadcrumb for the term parents"),
+ '#description' => t('If selected, the breadcrumb trail will include all parent terms, each one linking to this view. Note that this only works if just one term was received.'),
+ '#default_value' => !empty($this->options['set_breadcrumb']),
+ );
+ }
+
+ function set_breadcrumb(&$breadcrumb) {
+ if (empty($this->options['set_breadcrumb']) || !is_numeric($this->argument)) {
+ return;
+ }
+
+ return views_taxonomy_set_breadcrumb($breadcrumb, $this);
+ }
+
+ function title_query() {
+ $titles = array();
+ $result = db_select('taxonomy_term_data', 'td')
+ ->fields('td', array('name'))
+ ->condition('td.tid', $this->value)
+ ->execute();
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->name);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth.inc
new file mode 100644
index 0000000..03b1409
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth.inc
@@ -0,0 +1,139 @@
+<?php
+/**
+ * Argument handler for taxonomy terms with depth.
+ *
+ * This handler is actually part of the node table and has some restrictions,
+ * because it uses a subquery to find nodes with.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_term_node_tid_depth extends views_handler_argument {
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['depth'] = array('default' => 0);
+ $options['break_phrase'] = array('default' => FALSE);
+ $options['set_breadcrumb'] = array('default' => FALSE);
+ $options['use_taxonomy_term_path'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['depth'] = array(
+ '#type' => 'weight',
+ '#title' => t('Depth'),
+ '#default_value' => $this->options['depth'],
+ '#description' => t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).'),
+ );
+
+ $form['break_phrase'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Allow multiple values'),
+ '#description' => t('If selected, users can enter multiple values in the form of 1+2+3. Due to the number of JOINs it would require, AND will be treated as OR with this filter.'),
+ '#default_value' => !empty($this->options['break_phrase']),
+ );
+
+ $form['set_breadcrumb'] = array(
+ '#type' => 'checkbox',
+ '#title' => t("Set the breadcrumb for the term parents"),
+ '#description' => t('If selected, the breadcrumb trail will include all parent terms, each one linking to this view. Note that this only works if just one term was received.'),
+ '#default_value' => !empty($this->options['set_breadcrumb']),
+ );
+
+ $form['use_taxonomy_term_path'] = array(
+ '#type' => 'checkbox',
+ '#title' => t("Use Drupal's taxonomy term path to create breadcrumb links"),
+ '#description' => t('If selected, the links in the breadcrumb trail will be created using the standard drupal method instead of the custom views method. This is useful if you are using modules like taxonomy redirect to modify your taxonomy term links.'),
+ '#default_value' => !empty($this->options['use_taxonomy_term_path']),
+ '#dependency' => array('edit-options-set-breadcrumb' => array(TRUE)),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function set_breadcrumb(&$breadcrumb) {
+ if (empty($this->options['set_breadcrumb']) || !is_numeric($this->argument)) {
+ return;
+ }
+
+ return views_taxonomy_set_breadcrumb($breadcrumb, $this);
+ }
+
+ /**
+ * Override default_actions() to remove summary actions.
+ */
+ 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']);
+ unset($actions['summary asc by count']);
+ unset($actions['summary desc by count']);
+ return $actions;
+ }
+
+ function query($group_by = FALSE) {
+ $this->ensure_my_table();
+
+ if (!empty($this->options['break_phrase'])) {
+ $tids = new stdClass();
+ $tids->value = $this->argument;
+ $tids = views_break_phrase($this->argument, $tids);
+ if ($tids->value == array(-1)) {
+ return FALSE;
+ }
+
+ if (count($tids->value) > 1) {
+ $operator = 'IN';
+ }
+ else {
+ $operator = '=';
+ }
+
+ $tids = $tids->value;
+ }
+ else {
+ $operator = "=";
+ $tids = $this->argument;
+ }
+ // Now build the subqueries.
+ $subquery = db_select('taxonomy_index', 'tn');
+ $subquery->addField('tn', 'nid');
+ $where = db_or()->condition('tn.tid', $tids, $operator);
+ $last = "tn";
+
+ if ($this->options['depth'] > 0) {
+ $subquery->leftJoin('taxonomy_term_hierarchy', 'th', "th.tid = tn.tid");
+ $last = "th";
+ foreach (range(1, abs($this->options['depth'])) as $count) {
+ $subquery->leftJoin('taxonomy_term_hierarchy', "th$count", "$last.parent = th$count.tid");
+ $where->condition("th$count.tid", $tids, $operator);
+ $last = "th$count";
+ }
+ }
+ elseif ($this->options['depth'] < 0) {
+ foreach (range(1, abs($this->options['depth'])) as $count) {
+ $subquery->leftJoin('taxonomy_term_hierarchy', "th$count", "$last.tid = th$count.parent");
+ $where->condition("th$count.tid", $tids, $operator);
+ $last = "th$count";
+ }
+ }
+
+ $subquery->condition($where);
+ $this->query->add_where(0, "$this->table_alias.$this->real_field", $subquery, 'IN');
+ }
+
+ function title() {
+ $term = taxonomy_term_load($this->argument);
+ if (!empty($term)) {
+ return check_plain($term->name);
+ }
+ // TODO review text
+ return t('No name');
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc
new file mode 100644
index 0000000..da71796
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc
@@ -0,0 +1,59 @@
+<?php
+
+/**
+ * Argument handler for to modify depth for a previous term.
+ *
+ * This handler is actually part of the node table and has some restrictions,
+ * because it uses a subquery to find nodes with.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_term_node_tid_depth_modifier extends views_handler_argument {
+ function options_form(&$form, &$form_state) { }
+ function query($group_by = FALSE) { }
+ function pre_query() {
+ // We don't know our argument yet, but it's based upon our position:
+ $argument = isset($this->view->args[$this->position]) ? $this->view->args[$this->position] : NULL;
+ if (!is_numeric($argument)) {
+ return;
+ }
+
+ if ($argument > 10) {
+ $argument = 10;
+ }
+
+ if ($argument < -10) {
+ $argument = -10;
+ }
+
+ // figure out which argument preceded us.
+ $keys = array_reverse(array_keys($this->view->argument));
+ $skip = TRUE;
+ foreach ($keys as $key) {
+ if ($key == $this->options['id']) {
+ $skip = FALSE;
+ continue;
+ }
+
+ if ($skip) {
+ continue;
+ }
+
+ if (empty($this->view->argument[$key])) {
+ continue;
+ }
+
+ if (isset($handler)) {
+ unset($handler);
+ }
+
+ $handler = &$this->view->argument[$key];
+ if (empty($handler->definition['accept depth modifier'])) {
+ continue;
+ }
+
+ // Finally!
+ $handler->options['depth'] = $argument;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc
new file mode 100644
index 0000000..b91b08f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Argument handler to accept a vocabulary machine name.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_vocabulary_machine_name extends views_handler_argument_string {
+ /**
+ * Override the behavior of title(). Get the name of the vocabulary..
+ */
+ function title() {
+ $title = db_query("SELECT v.name FROM {taxonomy_vocabulary} v WHERE v.machine_name = :machine_name", array(':machine_name' => $this->argument))->fetchField();
+
+ if (empty($title)) {
+ return t('No vocabulary');
+ }
+
+ return check_plain($title);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_vid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_vid.inc
new file mode 100644
index 0000000..d79859b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_vid.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Argument handler to accept a vocabulary id.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_vocabulary_vid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title(). Get the name of the vocabulary.
+ */
+ function title() {
+ $title = db_query("SELECT v.name FROM {taxonomy_vocabulary} v WHERE v.vid = :vid", array(':vid' => $this->argument))->fetchField();
+
+ if (empty($title)) {
+ return t('No vocabulary');
+ }
+
+ return check_plain($title);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_taxonomy.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_taxonomy.inc
new file mode 100644
index 0000000..c1ccb6d
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_taxonomy.inc
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * Field handler to provide simple renderer that allows linking to a taxonomy
+ * term.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_taxonomy extends views_handler_field {
+ /**
+ * Constructor to provide additional field to add.
+ *
+ * This constructer assumes the taxonomy_term_data table. If using another
+ * table, we'll need to be more specific.
+ */
+ function construct() {
+ parent::construct();
+ $this->additional_fields['vid'] = 'vid';
+ $this->additional_fields['tid'] = 'tid';
+ $this->additional_fields['vocabulary_machine_name'] = array(
+ 'table' => 'taxonomy_vocabulary',
+ 'field' => 'machine_name',
+ );
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_taxonomy'] = array('default' => FALSE);
+ $options['convert_spaces'] = array('default' => FALSE);
+ return $options;
+ }
+
+ /**
+ * Provide link to taxonomy option
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_taxonomy'] = array(
+ '#title' => t('Link this field to its taxonomy term page'),
+ '#description' => t("Enable to override this field's links."),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['link_to_taxonomy']),
+ );
+ $form['convert_spaces'] = array(
+ '#title' => t('Convert spaces in term names to hyphens'),
+ '#description' => t('This allows links to work with Views taxonomy term arguments.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['convert_spaces']),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ /**
+ * Render whatever the data is as a link to the taxonomy.
+ *
+ * Data should be made XSS safe prior to calling this function.
+ */
+ function render_link($data, $values) {
+ $tid = $this->get_value($values, 'tid');
+ if (!empty($this->options['link_to_taxonomy']) && !empty($tid) && $data !== NULL && $data !== '') {
+ $term = new stdClass();
+ $term->tid = $tid;
+ $term->vid = $this->get_value($values, 'vid');
+ $term->vocabulary_machine_name = $values->{$this->aliases['vocabulary_machine_name']};
+ $this->options['alter']['make_link'] = TRUE;
+ $uri = entity_uri('taxonomy_term', $term);
+ $this->options['alter']['path'] = $uri['path'];
+ }
+
+ if (!empty($this->options['convert_spaces'])) {
+ $data = str_replace(' ', '-', $data);
+ }
+
+ return $data;
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_link_edit.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_link_edit.inc
new file mode 100644
index 0000000..ae1f0a5
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_link_edit.inc
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * Field handler to present a term edit link.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_term_link_edit extends views_handler_field {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['tid'] = 'tid';
+ $this->additional_fields['vid'] = 'vid';
+ $this->additional_fields['vocabulary_machine_name'] = array(
+ 'table' => 'taxonomy_vocabulary',
+ 'field' => 'machine_name',
+ );
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['text'] = array('default' => '', 'translatable' => TRUE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['text'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Text to display'),
+ '#default_value' => $this->options['text'],
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function render($values) {
+ // Mock a term object for taxonomy_term_edit_access(). Use machine name and
+ // vid to ensure compatibility with vid based and machine name based
+ // access checks. See http://drupal.org/node/995156
+ $term = new stdClass();
+ $term->vid = $values->{$this->aliases['vid']};
+ $term->vocabulary_machine_name = $values->{$this->aliases['vocabulary_machine_name']};
+ if (taxonomy_term_edit_access($term)) {
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
+ $tid = $this->get_value($values, 'tid');
+ return l($text, 'taxonomy/term/'. $tid . '/edit', array('query' => drupal_get_destination()));
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_node_tid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_node_tid.inc
new file mode 100644
index 0000000..4a6c7a4
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_field_term_node_tid.inc
@@ -0,0 +1,142 @@
+<?php
+
+/**
+ * Field handler to display all taxonomy terms of a node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_term_node_tid extends views_handler_field_prerender_list {
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ // @todo: Wouldn't it be possible to use $this->base_table and no if here?
+ if ($view->base_table == 'node_revision') {
+ $this->additional_fields['nid'] = array('table' => 'node_revision', 'field' => 'nid');
+ }
+ else {
+ $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');
+ }
+
+ // Convert legacy vids option to machine name vocabularies.
+ if (!empty($this->options['vids'])) {
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($this->options['vids'] as $vid) {
+ if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
+ $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
+ }
+ }
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['link_to_taxonomy'] = array('default' => TRUE);
+ $options['limit'] = array('default' => FALSE);
+ $options['vocabularies'] = array('default' => array());
+
+ return $options;
+ }
+
+ /**
+ * Provide "link to term" option.
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_taxonomy'] = array(
+ '#title' => t('Link this field to its term page'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['link_to_taxonomy']),
+ );
+
+ $form['limit'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Limit terms by vocabulary'),
+ '#default_value'=> $this->options['limit'],
+ '#fieldset' => 'more',
+ );
+
+ $options = array();
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($vocabularies as $voc) {
+ $options[$voc->machine_name] = check_plain($voc->name);
+ }
+
+ $form['vocabularies'] = array(
+ '#prefix' => '<div><div id="edit-options-vocabularies">',
+ '#suffix' => '</div></div>',
+ '#type' => 'checkboxes',
+ '#title' => t('Vocabularies'),
+ '#options' => $options,
+ '#default_value' => $this->options['vocabularies'],
+ '#dependency' => array('edit-options-limit' => array(TRUE)),
+ '#fieldset' => 'more',
+ );
+
+ parent::options_form($form, $form_state);
+ }
+
+ /**
+ * Add this term to the query
+ */
+ function query() {
+ $this->add_additional_fields();
+ }
+
+ function pre_render(&$values) {
+ $this->field_alias = $this->aliases['nid'];
+ $nids = array();
+ foreach ($values as $result) {
+ if (!empty($result->{$this->aliases['nid']})) {
+ $nids[] = $result->{$this->aliases['nid']};
+ }
+ }
+
+ if ($nids) {
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->innerJoin('taxonomy_index', 'tn', 'td.tid = tn.tid');
+ $query->innerJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->fields('td');
+ $query->addField('tn', 'nid', 'node_nid');
+ $query->addField('tv', 'name', 'vocabulary');
+ $query->addField('tv', 'machine_name', 'vocabulary_machine_name');
+ $query->orderby('td.weight');
+ $query->orderby('td.name');
+ $query->condition('tn.nid', $nids);
+ $query->addTag('term_access');
+ $vocabs = array_filter($this->options['vocabularies']);
+ if (!empty($this->options['limit']) && !empty($vocabs)) {
+ $query->condition('tv.machine_name', $vocabs);
+ }
+ $result = $query->execute();
+
+ foreach ($result as $term) {
+ $this->items[$term->node_nid][$term->tid]['name'] = check_plain($term->name);
+ $this->items[$term->node_nid][$term->tid]['tid'] = $term->tid;
+ $this->items[$term->node_nid][$term->tid]['vocabulary_machine_name'] = check_plain($term->vocabulary_machine_name);
+ $this->items[$term->node_nid][$term->tid]['vocabulary'] = check_plain($term->vocabulary);
+
+ if (!empty($this->options['link_to_taxonomy'])) {
+ $this->items[$term->node_nid][$term->tid]['make_link'] = TRUE;
+ $this->items[$term->node_nid][$term->tid]['path'] = 'taxonomy/term/' . $term->tid;
+ }
+ }
+ }
+ }
+
+ function render_item($count, $item) {
+ return $item['name'];
+ }
+
+ function document_self_tokens(&$tokens) {
+ $tokens['[' . $this->options['id'] . '-tid' . ']'] = t('The taxonomy term ID for the term.');
+ $tokens['[' . $this->options['id'] . '-name' . ']'] = t('The taxonomy term name for the term.');
+ $tokens['[' . $this->options['id'] . '-vocabulary-machine-name' . ']'] = t('The machine name for the vocabulary the term belongs to.');
+ $tokens['[' . $this->options['id'] . '-vocabulary' . ']'] = t('The name for the vocabulary the term belongs to.');
+ }
+
+ function add_self_tokens(&$tokens, $item) {
+ foreach(array('tid', 'name', 'vocabulary_machine_name', 'vocabulary') as $token) {
+ // Replace _ with - for the vocabulary machine name.
+ $tokens['[' . $this->options['id'] . '-' . str_replace('_', '-', $token). ']'] = isset($item[$token]) ? $item[$token] : '';
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc
new file mode 100644
index 0000000..25f9a7b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc
@@ -0,0 +1,349 @@
+<?php
+
+/**
+ * Filter by term id.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_term_node_tid extends views_handler_filter_many_to_one {
+ // Stores the exposed input for this filter.
+ var $validated_exposed_input = NULL;
+
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ if (!empty($this->definition['vocabulary'])) {
+ $this->options['vocabulary'] = $this->definition['vocabulary'];
+ }
+
+ // Convert legacy vid option to machine name vocabulary.
+ if (isset($this->options['vid']) && !empty($this->options['vid']) & empty($this->options['vocabulary'])) {
+ $vocabularies = taxonomy_get_vocabularies();
+ $vid = $this->options['vid'];
+ if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
+ $this->options['vocabulary'] = $vocabularies[$vid]->machine_name;
+ }
+ }
+ }
+
+ function has_extra_options() { return TRUE; }
+
+ function get_value_options() { /* don't overwrite the value options */ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['type'] = array('default' => 'textfield');
+ $options['limit'] = array('default' => TRUE);
+ $options['vocabulary'] = array('default' => 0);
+ $options['hierarchy'] = array('default' => 0);
+ $options['error_message'] = array('default' => TRUE);
+
+ return $options;
+ }
+
+ function extra_options_form(&$form, &$form_state) {
+ $vocabularies = taxonomy_get_vocabularies();
+ $options = array();
+ foreach ($vocabularies as $voc) {
+ $options[$voc->machine_name] = check_plain($voc->name);
+ }
+
+ if ($this->options['limit']) {
+ // We only do this when the form is displayed.
+ if (empty($this->options['vocabulary'])) {
+ $first_vocabulary = reset($vocabularies);
+ $this->options['vocabulary'] = $first_vocabulary->machine_name;
+ }
+
+ if (empty($this->definition['vocabulary'])) {
+ $form['vocabulary'] = array(
+ '#type' => 'radios',
+ '#title' => t('Vocabulary'),
+ '#options' => $options,
+ '#description' => t('Select which vocabulary to show terms for in the regular options.'),
+ '#default_value' => $this->options['vocabulary'],
+ );
+ }
+ }
+
+ $form['type'] = array(
+ '#type' => 'radios',
+ '#title' => t('Selection type'),
+ '#options' => array('select' => t('Dropdown'), 'textfield' => t('Autocomplete')),
+ '#default_value' => $this->options['type'],
+ );
+
+ $form['hierarchy'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Show hierarchy in dropdown'),
+ '#default_value' => !empty($this->options['hierarchy']),
+ '#dependency' => array('radio:options[type]' => array('select')),
+ );
+ }
+
+ function value_form(&$form, &$form_state) {
+ $vocabulary = taxonomy_vocabulary_machine_name_load($this->options['vocabulary']);
+ if (empty($vocabulary) && $this->options['limit']) {
+ $form['markup'] = array(
+ '#markup' => '<div class="form-item">' . t('An invalid vocabulary is selected. Please change it in the options.') . '</div>',
+ );
+ return;
+ }
+
+ if ($this->options['type'] == 'textfield') {
+ $default = '';
+ if ($this->value) {
+ $result = db_select('taxonomy_term_data', 'td')
+ ->fields('td')
+ ->condition('td.tid', $this->value)
+ ->execute();
+ foreach ($result as $term) {
+ if ($default) {
+ $default .= ', ';
+ }
+ $default .= $term->name;
+ }
+ }
+
+ $form['value'] = array(
+ '#title' => $this->options['limit'] ? t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->name)) : t('Select terms'),
+ '#type' => 'textfield',
+ '#default_value' => $default,
+ );
+
+ if ($this->options['limit']) {
+ $form['value']['#autocomplete_path'] = 'admin/views/ajax/autocomplete/taxonomy/' . $vocabulary->vid;
+ }
+ }
+ else {
+ if (!empty($this->options['hierarchy']) && $this->options['limit']) {
+ $tree = taxonomy_get_tree($vocabulary->vid);
+ $options = array();
+
+ if ($tree) {
+ foreach ($tree as $term) {
+ $choice = new stdClass();
+ $choice->option = array($term->tid => str_repeat('-', $term->depth) . $term->name);
+ $options[] = $choice;
+ }
+ }
+ }
+ else {
+ $options = array();
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->innerJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->fields('td');
+ $query->orderby('tv.weight');
+ $query->orderby('tv.name');
+ $query->orderby('td.weight');
+ $query->orderby('td.name');
+ $query->addTag('term_access');
+ if ($this->options['limit']) {
+ $query->condition('tv.machine_name', $vocabulary->machine_name);
+ }
+ $result = $query->execute();
+ foreach ($result as $term) {
+ $options[$term->tid] = $term->name;
+ }
+ }
+
+ $default_value = (array) $this->value;
+
+ if (!empty($form_state['exposed'])) {
+ $identifier = $this->options['expose']['identifier'];
+
+ if (!empty($this->options['expose']['reduce'])) {
+ $options = $this->reduce_value_options($options);
+
+ if (!empty($this->options['expose']['multiple']) && empty($this->options['expose']['required'])) {
+ $default_value = array();
+ }
+ }
+
+ if (empty($this->options['expose']['multiple'])) {
+ if (empty($this->options['expose']['required']) && (empty($default_value) || !empty($this->options['expose']['reduce']))) {
+ $default_value = 'All';
+ }
+ elseif (empty($default_value)) {
+ $keys = array_keys($options);
+ $default_value = array_shift($keys);
+ }
+ else {
+ $copy = $default_value;
+ $default_value = array_shift($copy);
+ }
+ }
+ }
+ $form['value'] = array(
+ '#type' => 'select',
+ '#title' => $this->options['limit'] ? t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->name)) : t('Select terms'),
+ '#multiple' => TRUE,
+ '#options' => $options,
+ '#size' => min(9, count($options)),
+ '#default_value' => $default_value,
+ );
+
+ if (!empty($form_state['exposed']) && isset($identifier) && !isset($form_state['input'][$identifier])) {
+ $form_state['input'][$identifier] = $default_value;
+ }
+ }
+
+
+ if (empty($form_state['exposed'])) {
+ // Retain the helper option
+ $this->helper->options_form($form, $form_state);
+ }
+ }
+
+ function value_validate($form, &$form_state) {
+ // We only validate if they've chosen the text field style.
+ if ($this->options['type'] != 'textfield') {
+ return;
+ }
+
+ $values = drupal_explode_tags($form_state['values']['options']['value']);
+ $tids = $this->validate_term_strings($form['value'], $values);
+
+ if ($tids) {
+ $form_state['values']['options']['value'] = $tids;
+ }
+ }
+
+ function accept_exposed_input($input) {
+ if (empty($this->options['exposed'])) {
+ return TRUE;
+ }
+
+ // If view is an attachment and is inheriting exposed filters, then assume
+ // exposed input has already been validated
+ if (!empty($this->view->is_attachment) && $this->view->display_handler->uses_exposed()) {
+ $this->validated_exposed_input = (array) $this->view->exposed_raw_input[$this->options['expose']['identifier']];
+ }
+
+ // If it's non-required and there's no value don't bother filtering.
+ if (!$this->options['expose']['required'] && empty($this->validated_exposed_input)) {
+ return FALSE;
+ }
+
+ $rc = parent::accept_exposed_input($input);
+ if ($rc) {
+ // If we have previously validated input, override.
+ if (isset($this->validated_exposed_input)) {
+ $this->value = $this->validated_exposed_input;
+ }
+ }
+
+ return $rc;
+ }
+
+ function exposed_validate(&$form, &$form_state) {
+ if (empty($this->options['exposed'])) {
+ return;
+ }
+
+ $identifier = $this->options['expose']['identifier'];
+
+ // We only validate if they've chosen the text field style.
+ if ($this->options['type'] != 'textfield') {
+ if ($form_state['values'][$identifier] != 'All') {
+ $this->validated_exposed_input = (array) $form_state['values'][$identifier];
+ }
+ return;
+ }
+
+ if (empty($this->options['expose']['identifier'])) {
+ return;
+ }
+
+ $values = drupal_explode_tags($form_state['values'][$identifier]);
+
+ $tids = $this->validate_term_strings($form[$identifier], $values);
+ if ($tids) {
+ $this->validated_exposed_input = $tids;
+ }
+ }
+
+ /**
+ * Validate the user string. Since this can come from either the form
+ * or the exposed filter, this is abstracted out a bit so it can
+ * handle the multiple input sources.
+ *
+ * @param $form
+ * The form which is used, either the views ui or the exposed filters.
+ * @param $values
+ * The taxonomy names which will be converted to tids.
+ *
+ * @return array
+ * The taxonomy ids fo all validated terms.
+ */
+ function validate_term_strings(&$form, $values) {
+ if (empty($values)) {
+ return array();
+ }
+
+ $tids = array();
+ $names = array();
+ $missing = array();
+ foreach ($values as $value) {
+ $missing[strtolower($value)] = TRUE;
+ $names[] = $value;
+ }
+
+ if (!$names) {
+ return FALSE;
+ }
+
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->innerJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->fields('td');
+ $query->condition('td.name', $names);
+ $query->condition('tv.machine_name', $this->options['vocabulary']);
+ $query->addTag('term_access');
+ $result = $query->execute();
+ foreach ($result as $term) {
+ unset($missing[strtolower($term->name)]);
+ $tids[] = $term->tid;
+ }
+
+ if ($missing && !empty($this->options['error_message'])) {
+ form_error($form, format_plural(count($missing), 'Unable to find term: @terms', 'Unable to find terms: @terms', array('@terms' => implode(', ', array_keys($missing)))));
+ }
+ elseif ($missing && empty($this->options['error_message'])) {
+ $tids = array(0);
+ }
+
+ return $tids;
+ }
+
+ function value_submit($form, &$form_state) {
+ // prevent array_filter from messing up our arrays in parent submit.
+ }
+
+ function expose_form(&$form, &$form_state) {
+ parent::expose_form($form, $form_state);
+ if ($this->options['type'] != 'select') {
+ unset($form['expose']['reduce']);
+ }
+ $form['error_message'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display error message'),
+ '#default_value' => !empty($this->options['error_message']),
+ );
+ }
+
+ function admin_summary() {
+ // set up $this->value_options for the parent summary
+ $this->value_options = array();
+
+ if ($this->value) {
+ $result = db_select('taxonomy_term_data', 'td')
+ ->fields('td')
+ ->condition('td.tid', $this->value)
+ ->execute();
+ foreach ($result as $term) {
+ $this->value_options[$term->tid] = $term->name;
+ }
+ }
+ return parent::admin_summary();
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid_depth.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid_depth.inc
new file mode 100644
index 0000000..3955269
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid_depth.inc
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Filter handler for taxonomy terms with depth.
+ *
+ * This handler is actually part of the node table and has some restrictions,
+ * because it uses a subquery to find nodes with.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_term_node_tid_depth extends views_handler_filter_term_node_tid {
+ function operator_options($which = 'title') {
+ return array(
+ 'or' => t('Is one of'),
+ );
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['depth'] = array('default' => 0);
+
+ return $options;
+ }
+
+ function extra_options_form(&$form, &$form_state) {
+ parent::extra_options_form($form, $form_state);
+
+ $form['depth'] = array(
+ '#type' => 'weight',
+ '#title' => t('Depth'),
+ '#default_value' => $this->options['depth'],
+ '#description' => t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).'),
+ );
+ }
+
+ function query() {
+ // If no filter values are present, then do nothing.
+ if (count($this->value) == 0) {
+ return;
+ }
+ elseif (count($this->value) == 1) {
+ // Somethis $this->value is an array with a single element so convert it.
+ if (is_array($this->value)) {
+ $this->value = current($this->value);
+ }
+ $operator = '=';
+ }
+ else {
+ $operator = 'IN';# " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
+ }
+
+ // The normal use of ensure_my_table() here breaks Views.
+ // So instead we trick the filter into using the alias of the base table.
+ // See http://drupal.org/node/271833
+ // If a relationship is set, we must use the alias it provides.
+ if (!empty($this->relationship)) {
+ $this->table_alias = $this->relationship;
+ }
+ // If no relationship, then use the alias of the base table.
+ elseif (isset($this->query->table_queue[$this->query->base_table]['alias'])) {
+ $this->table_alias = $this->query->table_queue[$this->query->base_table]['alias'];
+ }
+ // This should never happen, but if it does, we fail quietly.
+ else {
+ return;
+ }
+
+ // Now build the subqueries.
+ $subquery = db_select('taxonomy_index', 'tn');
+ $subquery->addField('tn', 'nid');
+ $where = db_or()->condition('tn.tid', $this->value, $operator);
+ $last = "tn";
+
+ if ($this->options['depth'] > 0) {
+ $subquery->leftJoin('taxonomy_term_hierarchy', 'th', "th.tid = tn.tid");
+ $last = "th";
+ foreach (range(1, abs($this->options['depth'])) as $count) {
+ $subquery->leftJoin('taxonomy_term_hierarchy', "th$count", "$last.parent = th$count.tid");
+ $where->condition("th$count.tid", $this->value, $operator);
+ $last = "th$count";
+ }
+ }
+ elseif ($this->options['depth'] < 0) {
+ foreach (range(1, abs($this->options['depth'])) as $count) {
+ $subquery->leftJoin('taxonomy_term_hierarchy', "th$count", "$last.tid = th$count.parent");
+ $where->condition("th$count.tid", $this->value, $operator);
+ $last = "th$count";
+ }
+ }
+
+ $subquery->condition($where);
+ $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field", $subquery, 'IN');
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_machine_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_machine_name.inc
new file mode 100644
index 0000000..5d2c9f5
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_machine_name.inc
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Filter by vocabulary machine name.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_vocabulary_machine_name extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (isset($this->value_options)) {
+ return;
+ }
+
+ $this->value_options = array();
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($vocabularies as $voc) {
+ $this->value_options[$voc->machine_name] = $voc->name;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_vid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_vid.inc
new file mode 100644
index 0000000..a02f7b2
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_filter_vocabulary_vid.inc
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Filter by vocabulary id.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_vocabulary_vid extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (isset($this->value_options)) {
+ return;
+ }
+
+ $this->value_options = array();
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($vocabularies as $voc) {
+ $this->value_options[$voc->vid] = $voc->name;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_relationship_node_term_data.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_relationship_node_term_data.inc
new file mode 100644
index 0000000..1855cae
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_relationship_node_term_data.inc
@@ -0,0 +1,95 @@
+<?php
+/**
+ * @file
+ * Views' relationship handlers.
+ */
+
+
+/**
+ * Relationship handler to return the taxonomy terms of nodes.
+ *
+ * @ingroup views_relationship_handlers
+ */
+class views_handler_relationship_node_term_data extends views_handler_relationship {
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+
+ // Convert legacy vids option to machine name vocabularies.
+ if (!empty($this->options['vids'])) {
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($this->options['vids'] as $vid) {
+ if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
+ $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
+ }
+ }
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['vocabularies'] = array('default' => array());
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $vocabularies = taxonomy_get_vocabularies();
+ $options = array();
+ foreach ($vocabularies as $voc) {
+ $options[$voc->machine_name] = check_plain($voc->name);
+ }
+
+ $form['vocabularies'] = array(
+ '#type' => 'checkboxes',
+ '#title' => t('Vocabularies'),
+ '#options' => $options,
+ '#default_value' => $this->options['vocabularies'],
+ '#description' => t('Choose which vocabularies you wish to relate. Remember that every term found will create a new record, so this relationship is best used on just one vocabulary that has only one term per node.'),
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ /**
+ * Called to implement a relationship in a query.
+ */
+ function query() {
+ $this->ensure_my_table();
+
+ $def = $this->definition;
+ $def['table'] = 'taxonomy_term_data';
+
+ if (!array_filter($this->options['vocabularies'])) {
+ $term_node = $this->query->add_table('taxonomy_index', $this->relationship);
+ $def['left_table'] = 'taxonomy_index';
+ $def['left_field'] = 'tid';
+ $def['field'] = 'tid';
+ $def['type'] = empty($this->options['required']) ? 'LEFT' : 'INNER';
+ }
+ else {
+ // If vocabularies are supplied join a subselect instead
+ $def['left_table'] = $this->table_alias;
+ $def['left_field'] = 'nid';
+ $def['field'] = 'nid';
+ $def['type'] = empty($this->options['required']) ? 'LEFT' : 'INNER';
+
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->addJoin($def['type'], 'taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->addJoin($def['type'], 'taxonomy_index', 'tn', 'tn.tid = td.tid');
+ $query->condition('tv.machine_name', array_filter($this->options['vocabularies']));
+ $query->addTag('term_access');
+ $query->fields('td');
+ $query->fields('tn', array('nid'));
+ $def['table formula'] = $query;
+ }
+
+ $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, 'taxonomy_term_data', $this->relationship);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
new file mode 100644
index 0000000..17ee634
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc
@@ -0,0 +1,150 @@
+<?php
+/**
+ * @file
+ * Taxonomy tid default argument.
+ */
+
+class views_plugin_argument_default_taxonomy_tid extends views_plugin_argument_default {
+ function init(&$view, &$argument, $options) {
+ parent::init($view, $argument, $options);
+
+ // Convert legacy vids option to machine name vocabularies.
+ if (!empty($this->options['vids'])) {
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($this->options['vids'] as $vid) {
+ if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
+ $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
+ }
+ }
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['term_page'] = array('default' => TRUE);
+ $options['node'] = array('default' => FALSE);
+ $options['anyall'] = array('default' => ',');
+ $options['limit'] = array('default' => FALSE);
+ $options['vocabularies'] = array('default' => array());
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['term_page'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Load default filter from term page'),
+ '#default_value' => $this->options['term_page'],
+ );
+ $form['node'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Load default filter from node page, that\'s good for related taxonomy blocks'),
+ '#default_value' => $this->options['node'],
+ );
+
+ $form['limit'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Limit terms by vocabulary'),
+ '#default_value'=> $this->options['limit'],
+ '#process' => array('form_process_checkbox', 'ctools_dependent_process'),
+ '#dependency' => array(
+ 'edit-options-argument-default-taxonomy-tid-node' => array(1),
+ ),
+ );
+
+ $options = array();
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($vocabularies as $voc) {
+ $options[$voc->machine_name] = check_plain($voc->name);
+ }
+
+ $form['vocabularies'] = array(
+ '#prefix' => '<div><div id="edit-options-vids">',
+ '#suffix' => '</div></div>',
+ '#type' => 'checkboxes',
+ '#title' => t('Vocabularies'),
+ '#options' => $options,
+ '#default_value' => $this->options['vocabularies'],
+ '#process' => array('form_process_checkboxes', 'ctools_dependent_process'),
+ '#dependency' => array(
+ 'edit-options-argument-default-taxonomy-tid-limit' => array(1),
+ 'edit-options-argument-default-taxonomy-tid-node' => array(1),
+ ),
+ );
+
+ $form['anyall'] = array(
+ '#type' => 'radios',
+ '#title' => t('Multiple-value handling'),
+ '#default_value'=> $this->options['anyall'],
+ '#process' => array('form_process_radios', 'ctools_dependent_process'),
+ '#options' => array(
+ ',' => t('Filter to items that share all terms'),
+ '+' => t('Filter to items that share any term'),
+ ),
+ '#dependency' => array(
+ 'edit-options-argument-default-taxonomy-tid-node' => array(1),
+ ),
+ );
+ }
+
+ function options_submit(&$form, &$form_state, &$options = array()) {
+ // Filter unselected items so we don't unnecessarily store giant arrays.
+ $options['vocabularies'] = array_filter($options['vocabularies']);
+ }
+
+ function get_argument() {
+ // Load default argument from taxonomy page.
+ if (!empty($this->options['term_page'])) {
+ if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
+ return arg(2);
+ }
+ }
+ // Load default argument from node.
+ if (!empty($this->options['node'])) {
+ foreach (range(1, 3) as $i) {
+ $node = menu_get_object('node', $i);
+ if (!empty($node)) {
+ break;
+ }
+ }
+ // Just check, if a node could be detected.
+ if ($node) {
+ $taxonomy = array();
+ $fields = field_info_instances('node', $node->type);
+ foreach ($fields as $name => $info) {
+ $field_info = field_info_field($name);
+ if ($field_info['type'] == 'taxonomy_term_reference') {
+ $items = field_get_items('node', $node, $name);
+ if (is_array($items)) {
+ foreach ($items as $item) {
+ $taxonomy[$item['tid']] = $field_info['settings']['allowed_values'][0]['vocabulary'];
+ }
+ }
+ }
+ }
+ if (!empty($this->options['limit'])) {
+ $tids = array();
+ // filter by vocabulary
+ foreach ($taxonomy as $tid => $vocab) {
+ if (!empty($this->options['vocabularies'][$vocab])) {
+ $tids[] = $tid;
+ }
+ }
+ return implode($this->options['anyall'], $tids);
+ }
+ // Return all tids.
+ else {
+ return implode($this->options['anyall'], array_keys($taxonomy));
+ }
+ }
+ }
+
+ // If the current page is a view that takes tid as an argument,
+ // find the tid argument and return it.
+ $views_page = views_get_page_view();
+ if ($views_page && isset($views_page->argument['tid'])) {
+ return $views_page->argument['tid']->argument;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc
new file mode 100644
index 0000000..c81c619
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc
@@ -0,0 +1,221 @@
+<?php
+/**
+ * @file
+ * Contains the 'taxonomy term' argument validator plugin.
+ */
+
+/**
+ * Validate whether an argument is an acceptable node.
+ */
+class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument_validate {
+ function init(&$view, &$argument, $options) {
+ parent::init($view, $argument, $options);
+
+ // Convert legacy vids option to machine name vocabularies.
+ if (!empty($this->options['vids'])) {
+ $vocabularies = taxonomy_get_vocabularies();
+ foreach ($this->options['vids'] as $vid) {
+ if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
+ $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
+ }
+ }
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['vocabularies'] = array('default' => array());
+ $options['type'] = array('default' => 'tid');
+ $options['transform'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $vocabularies = taxonomy_get_vocabularies();
+ $options = array();
+ foreach ($vocabularies as $voc) {
+ $options[$voc->machine_name] = check_plain($voc->name);
+ }
+
+ $form['vocabularies'] = array(
+ '#type' => 'checkboxes',
+ '#prefix' => '<div id="edit-options-validate-argument-vocabulary-wrapper">',
+ '#suffix' => '</div>',
+ '#title' => t('Vocabularies'),
+ '#options' => $options,
+ '#default_value' => $this->options['vocabularies'],
+ '#description' => t('If you wish to validate for specific vocabularies, check them; if none are checked, all terms will pass.'),
+ );
+
+ $form['type'] = array(
+ '#type' => 'select',
+ '#title' => t('Filter value type'),
+ '#options' => array(
+ 'tid' => t('Term ID'),
+ 'tids' => t('Term IDs separated by , or +'),
+ 'name' => t('Term name'),
+ 'convert' => t('Term name converted to Term ID'),
+ ),
+ '#default_value' => $this->options['type'],
+ '#description' => t('Select the form of this filter value; if using term name, it is generally more efficient to convert it to a term ID and use Taxonomy: Term ID rather than Taxonomy: Term Name" as the filter.'),
+ );
+
+ $form['transform'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Transform dashes in URL to spaces in term name filter values'),
+ '#default_value' => $this->options['transform'],
+ );
+ }
+
+ function options_submit(&$form, &$form_state, &$options = array()) {
+ // Filter unselected items so we don't unnecessarily store giant arrays.
+ $options['vocabularies'] = array_filter($options['vocabularies']);
+ }
+
+ function convert_options(&$options) {
+ if (!isset($options['vocabularies']) && !empty($this->argument->options['validate_argument_vocabulary'])) {
+ $options['vocabularies'] = $this->argument->options['validate_argument_vocabulary'];
+ $options['type'] = $this->argument->options['validate_argument_type'];
+ $options['transform'] = isset($this->argument->options['validate_argument_transform']) ? $this->argument->options['validate_argument_transform'] : FALSE;
+ }
+ }
+
+ function validate_argument($argument) {
+ $vocabularies = array_filter($this->options['vocabularies']);
+ $type = $this->options['type'];
+ $transform = $this->options['transform'];
+
+ switch ($type) {
+ case 'tid':
+ if (!is_numeric($argument)) {
+ return FALSE;
+ }
+
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->leftJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->fields('td');
+ $query->fields('tv', array('machine_name'));
+ $query->condition('td.tid', $argument);
+ $query->addTag('term_access');
+ $term = $query->execute()->fetchObject();
+ if (!$term) {
+ return FALSE;
+ }
+ $this->argument->validated_title = check_plain($term->name);
+ return empty($vocabularies) || !empty($vocabularies[$term->machine_name]);
+
+ case 'tids':
+ // An empty argument is not a term so doesn't pass.
+ if (empty($argument)) {
+ return FALSE;
+ }
+
+ $tids = new stdClass();
+ $tids->value = $argument;
+ $tids = views_break_phrase($argument, $tids);
+ if ($tids->value == array(-1)) {
+ return FALSE;
+ }
+
+ $test = drupal_map_assoc($tids->value);
+ $titles = array();
+
+ // check, if some tids already verified
+ static $validated_cache = array();
+ foreach ($test as $tid) {
+ if (isset($validated_cache[$tid])) {
+ if ($validated_cache[$tid] === FALSE) {
+ return FALSE;
+ }
+ else {
+ $titles[] = $validated_cache[$tid];
+ unset($test[$tid]);
+ }
+ }
+ }
+
+ // if unverified tids left - verify them and cache results
+ if (count($test)) {
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->leftJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->fields('td');
+ $query->fields('tv', array('machine_name'));
+ $query->condition('td.tid', $test);
+
+ $result = $query->execute();
+
+ foreach ($result as $term) {
+ if ($vocabularies && empty($vocabularies[$term->machine_name])) {
+ $validated_cache[$term->tid] = FALSE;
+ return FALSE;
+ }
+
+ $titles[] = $validated_cache[$term->tid] = check_plain($term->name);
+ unset($test[$term->tid]);
+ }
+ }
+
+ // Remove duplicate titles
+ $titles = array_unique($titles);
+
+ $this->argument->validated_title = implode($tids->operator == 'or' ? ' + ' : ', ', $titles);
+ // If this is not empty, we did not find a tid.
+ return empty($test);
+
+ case 'name':
+ case 'convert':
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->leftJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->fields('td');
+ $query->fields('tv', array('machine_name'));
+ if (!empty($vocabularies)) {
+ $query->condition('tv.machine_name', $vocabularies);
+ }
+ if ($transform) {
+ $query->where("replace(td.name, ' ', '-') = :name", array(':name' => $argument));
+ }
+ else {
+ $query->condition('td.name', $argument);
+ }
+ $term = $query->execute()->fetchObject();
+
+ if ($term && (empty($vocabularies) || !empty($vocabularies[$term->machine_name]))) {
+ if ($type == 'convert') {
+ $this->argument->argument = $term->tid;
+ }
+ $this->argument->validated_title = check_plain($term->name);
+ return TRUE;
+ }
+ return FALSE;
+ }
+ }
+
+ function process_summary_arguments(&$args) {
+ $type = $this->options['type'];
+ $transform = $this->options['transform'];
+ $vocabularies = array_filter($this->options['vocabularies']);
+
+ if ($type == 'convert') {
+ $arg_keys = array_flip($args);
+
+ $query = db_select('taxonomy_term_data', 'td');
+ $query->condition('tid', $args);
+ $query->addField('td', 'tid', 'tid');
+ if (!empty($vocabularies)) {
+ $query->leftJoin('taxonomy_vocabulary', 'tv', 'td.vid = tv.vid');
+ $query->condition('tv.machine_name', $vocabularies);
+ }
+ if ($transform) {
+ $query->addExpression("REPLACE(td.name, ' ', '-')", 'name');
+ }
+ else {
+ $query->addField('td', 'name', 'name');
+ }
+
+ foreach ($query->execute()->fetchAllKeyed() as $tid => $term) {
+ $args[$arg_keys[$tid]] = $term;
+ }
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation.views.inc
new file mode 100644
index 0000000..8189faa
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation.views.inc
@@ -0,0 +1,150 @@
+<?php
+
+/**
+ * @file
+ *
+ * Provide views data and handlers for translation.module
+ */
+
+/**
+ * @defgroup views_translation_module translation.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data_alter().
+ *
+ * Add translation information to the node table.
+ */
+function translation_views_data_alter(&$data) {
+
+ // Joins
+ $data['node']['table']['join']['node'] = array(
+ 'left_field' => 'tnid',
+ 'field' => 'tnid',
+ );
+
+ // Language field
+ $data['node']['language'] = array(
+ 'group' => t('Content translation'),
+ 'title' => t('Language'),
+ 'help' => t('The language the content is in.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_node_language',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_language',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_language',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // The translation ID (nid of the "source" translation)
+ $data['node']['tnid'] = array(
+ 'group' => t('Content translation'),
+ 'title' => t('Translation set node ID'),
+ 'help' => t('The ID of the translation set the content belongs to.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_node',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_tnid',
+ 'name field' => 'title', // the field to display in the summary.
+ 'numeric' => TRUE,
+ 'validate type' => 'tnid',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'relationship' => array(
+ 'title' => t('Source translation'),
+ 'help' => t('The source that this content was translated from.'),
+ 'base' => 'node',
+ 'base field' => 'nid',
+ 'handler' => 'views_handler_relationship',
+ 'label' => t('Source translation'),
+ ),
+ );
+
+ // The source translation.
+ $data['node']['translation'] = array(
+ 'group' => t('Content translation'),
+ 'title' => t('Translations'),
+ 'help' => t('Versions of content in different languages.'),
+ 'relationship' => array(
+ 'title' => t('Translations'),
+ 'help' => t('Versions of content in different languages.'),
+ 'base' => 'node',
+ 'base field' => 'tnid',
+ 'relationship table' => 'node',
+ 'relationship field' => 'nid',
+ 'handler' => 'views_handler_relationship_translation',
+ 'label' => t('Translations'),
+ ),
+ );
+
+ // The source translation.
+ $data['node']['source_translation'] = array(
+ 'group' => t('Content translation'),
+ 'title' => t('Source translation'),
+ 'help' => t('Content that is either untranslated or is the original version of a translation set.'),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_tnid',
+ ),
+ );
+
+ // The source translation.
+ $data['node']['child_translation'] = array(
+ 'group' => t('Node translation'),
+ 'title' => t('Child translation'),
+ 'help' => t('Content that is a translation of a source translation.'),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_tnid_child',
+ ),
+ );
+
+ // Translation status
+ $data['node']['translate'] = array(
+ 'group' => t('Content translation'),
+ 'title' => t('Translation status'),
+ 'help' => t('The translation status of the content - whether or not the translation needs to be updated.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Outdated'),
+ 'type' => 'yes-no',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // Translate node link.
+ $data['node']['translate_node'] = array(
+ 'group' => t('Content translation'),
+ 'title' => t('Translate link'),
+ 'help' => t('Provide a simple link to translate the node.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_node_link_translate',
+ ),
+ );
+
+
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_argument_node_tnid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_argument_node_tnid.inc
new file mode 100644
index 0000000..9dd29a1
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_argument_node_tnid.inc
@@ -0,0 +1,25 @@
+<?php
+/**
+ * @file
+ * Provide node tnid argument handler.
+ */
+
+/**
+ * Argument handler to accept a node translation id.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_node_tnid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title(). Get the title of the node.
+ */
+ function title_query() {
+ $titles = array();
+
+ $result = db_query("SELECT n.title FROM {node} n WHERE n.tnid IN (:tnids)", array(':tnids' => $this->value));
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->title);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_language.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_language.inc
new file mode 100644
index 0000000..b2e8d9c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_language.inc
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * Field handler to translate a language into its readable form.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_language extends views_handler_field_node {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['native_language'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ $form['native_language'] = array(
+ '#title' => t('Native language'),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['native_language'],
+ '#description' => t('If enabled, the native name of the language will be displayed'),
+ );
+ }
+
+ function render($values) {
+ $languages = views_language_list(empty($this->options['native_language']) ? 'name' : 'native');
+ $value = $this->get_value($values);
+ $value = isset($languages[$value]) ? $languages[$value] : '';
+ return $this->render_link($value, $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_link_translate.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_link_translate.inc
new file mode 100644
index 0000000..962b4f9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_link_translate.inc
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Field handler to present a link node translate.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_link_translate extends views_handler_field_node_link {
+ function render_link($data, $values) {
+ // ensure user has access to edit this node.
+ $node = $this->get_value($values);
+ $node->status = 1; // unpublished nodes ignore access control
+ if (empty($node->language) || !translation_supported_type($node->type) || !node_access('view', $node) || !user_access('translate content')) {
+ return;
+ }
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/$node->nid/translate";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('translate');
+ return $text;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_translation_link.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_translation_link.inc
new file mode 100644
index 0000000..537ba60
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_field_node_translation_link.inc
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Field handler to present a link to the node.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_node_translation_link extends views_handler_field {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['nid'] = 'nid';
+ $this->additional_fields['tnid'] = 'tnid';
+ $this->additional_fields['title'] = 'title';
+ $this->additional_fields['language'] = 'language';
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function render($values) {
+ $value = $this->get_value($values, 'tnid');
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+
+ function render_link($data, $values) {
+ global $language;
+
+ $tnid = $this->get_value($values, 'tnid');
+ // Only load translations if the node isn't in the current language.
+ if ($this->get_value($values, 'language') != $language->language) {
+ $translations = translation_node_get_translations($tnid);
+ if (isset($translations[$language->language])) {
+ $values->{$this->aliases['nid']} = $translations[$language->language]->nid;
+ $values->{$this->aliases['title']} = $translations[$language->language]->title;
+ }
+ }
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "node/" . $this->get_value($values, 'nid');
+ return $this->get_value($values, 'title');
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_language.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_language.inc
new file mode 100644
index 0000000..73af163
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_language.inc
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Filter by language.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_language extends views_handler_filter_in_operator {
+ function get_value_options() {
+ if (!isset($this->value_options)) {
+ $this->value_title = t('Language');
+ $languages = array(
+ '***CURRENT_LANGUAGE***' => t("Current user's language"),
+ '***DEFAULT_LANGUAGE***' => t("Default site language"),
+ LANGUAGE_NONE => t('No language')
+ );
+ $languages = array_merge($languages, views_language_list());
+ $this->value_options = $languages;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid.inc
new file mode 100644
index 0000000..6d8cfe7
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid.inc
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Filter by whether the node is the original translation.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_tnid extends views_handler_filter {
+ function admin_summary() { }
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['operator']['default'] = 1;
+
+ return $options;
+ }
+
+ /**
+ * Provide simple boolean operator
+ */
+ function operator_form(&$form, &$form_state) {
+ $form['operator'] = array(
+ '#type' => 'radios',
+ '#title' => t('Include untranslated content'),
+ '#default_value' => $this->operator,
+ '#options' => array(
+ 1 => t('Yes'),
+ 0 => t('No'),
+ ),
+ );
+ }
+
+ function can_expose() { return FALSE; }
+
+ function query() {
+ $table = $this->ensure_my_table();
+ // Select for source translations (tnid = nid). Conditionally, also accept either untranslated nodes (tnid = 0).
+ $this->query->add_where_expression($this->options['group'], "$table.tnid = $table.nid" . ($this->operator ? " OR $table.tnid = 0" : ''));
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid_child.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid_child.inc
new file mode 100644
index 0000000..f0d953b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_filter_node_tnid_child.inc
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Filter by whether the node is not the original translation.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_node_tnid_child extends views_handler_filter {
+ function admin_summary() { }
+ function operator_form(&$form, &$form_state) { }
+ function can_expose() { return FALSE; }
+
+ function query() {
+ $table = $this->ensure_my_table();
+ $this->query->add_where_expression($this->options['group'], "$table.tnid <> $table.nid AND $table.tnid > 0");
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_relationship_translation.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_relationship_translation.inc
new file mode 100644
index 0000000..b7d2641
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/translation/views_handler_relationship_translation.inc
@@ -0,0 +1,98 @@
+<?php
+
+/**
+ * Handles relationships for content translation sets and provides multiple
+ * options.
+ *
+ * @ingroup views_relationship_handlers
+ */
+class views_handler_relationship_translation extends views_handler_relationship {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['language'] = array('default' => 'current');
+
+ return $options;
+ }
+
+ /**
+ * Add a translation selector.
+ */
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $options = array(
+ 'all' => t('All'),
+ 'current' => t('Current language'),
+ 'default' => t('Default language'),
+ );
+ $options = array_merge($options, locale_language_list());
+ $form['language'] = array(
+ '#type' => 'select',
+ '#options' => $options,
+ '#default_value' => $this->options['language'],
+ '#title' => t('Translation option'),
+ '#description' => t('The translation options allows you to select which translation or translations in a translation set join on. Select "Current language" or "Default language" to join on the translation in the current or default language respectively. Select a specific language to join on a translation in that language. If you select "All", each translation will create a new row, which may appear to cause duplicates.'),
+ );
+ }
+
+ /**
+ * 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';
+ }
+
+ $def['extra'] = array();
+ if ($this->options['language'] != 'all') {
+ switch ($this->options['language']) {
+ case 'current':
+ $def['extra'][] = array(
+ 'field' => 'language',
+ 'value' => '***CURRENT_LANGUAGE***',
+ );
+ break;
+ case 'default':
+ $def['extra'][] = array(
+ 'field' => 'language',
+ 'value' => '***DEFAULT_LANGUAGE***',
+ );
+ break;
+ // Other values will be the language codes.
+ default:
+ $def['extra'][] = array(
+ 'field' => 'language',
+ 'value' => $this->options['language'],
+ );
+ break;
+ }
+ }
+
+ 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);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user.views.inc
new file mode 100644
index 0000000..1d7f161
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user.views.inc
@@ -0,0 +1,572 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers for user.module
+ */
+
+/**
+ * @defgroup views_user_module user.module handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function user_views_data() {
+ // ----------------------------------------------------------------
+ // users table
+
+ // Define the base group of this table. Fields that don't
+ // have a group defined will go into this field by default.
+ $data['users']['table']['group'] = t('User');
+
+ $data['users']['table']['base'] = array(
+ 'field' => 'uid',
+ 'title' => t('User'),
+ 'help' => t('Users who have created accounts on your site.'),
+ 'access query tag' => 'user_access',
+ );
+ $data['users']['table']['entity type'] = 'user';
+
+
+ $data['users']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'uid',
+ ),
+ 'node_revision' => array(
+ 'table' => 'node_revision',
+ 'field' => 'uid',
+ ),
+ 'file' => array(
+ 'table' => 'file',
+ 'field' => 'uid',
+ ),
+ );
+
+ // uid
+ $data['users']['uid'] = array(
+ 'title' => t('Uid'),
+ 'help' => t('The user ID'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_user',
+ 'click sortable' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_user_uid',
+ 'name field' => 'name', // display this field in the summary
+ ),
+ 'filter' => array(
+ 'title' => t('Name'),
+ 'handler' => 'views_handler_filter_user_name',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'relationship' => array(
+ 'title' => t('Content authored'),
+ 'help' => t('Relate content to the user who created it. This relationship will create one record for each content item created by the user.'),
+ 'handler' => 'views_handler_relationship',
+ 'base' => 'node',
+ 'base field' => 'uid',
+ 'field' => 'uid',
+ 'label' => t('nodes'),
+ ),
+ );
+
+ // uid
+ $data['users']['uid_representative'] = array(
+ 'relationship' => array(
+ 'title' => t('Representative node'),
+ 'label' => t('Representative node'),
+ 'help' => t('Obtains a single representative node for each user, according to a chosen sort criterion.'),
+ 'handler' => 'views_handler_relationship_groupwise_max',
+ 'relationship field' => 'uid',
+ 'outer field' => 'users.uid',
+ 'argument table' => 'users',
+ 'argument field' => 'uid',
+ 'base' => 'node',
+ 'field' => 'nid',
+ ),
+ );
+
+ // uid
+ $data['users']['uid_current'] = array(
+ 'real field' => 'uid',
+ 'title' => t('Current'),
+ 'help' => t('Filter the view to the currently logged in user.'),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_user_current',
+ 'type' => 'yes-no',
+ ),
+ );
+
+ // name
+ $data['users']['name'] = array(
+ 'title' => t('Name'), // The item it appears as on the UI,
+ 'help' => t('The user or author name.'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_user_name',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ 'title' => t('Name (raw)'),
+ 'help' => t('The user or author name. This filter does not check if the user exists and allows partial matching. Does not utilize autocomplete.')
+ ),
+ );
+
+ // mail
+ // Note that this field implements field level access control.
+ $data['users']['mail'] = array(
+ 'title' => t('E-mail'), // The item it appears as on the UI,
+ 'help' => t('Email address for a given user. This field is normally not shown to users, so be cautious when using it.'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_user_mail',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ // language
+ $data['users']['language'] = array(
+ 'title' => t('Language'), // The item it appears as on the UI,
+ 'help' => t('Language of the user'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_user_language',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_node_language',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_node_language',
+ ),
+ );
+
+ // picture
+ $data['users']['picture_fid']['moved to'] = array('users', 'picture');
+ $data['users']['picture'] = array(
+ 'title' => t('Picture'),
+ 'help' => t("The user's picture, if allowed."), // The help that appears on the UI,
+ // Information for displaying the uid
+ 'field' => array(
+ 'handler' => 'views_handler_field_user_picture',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Has Avatar'),
+ 'type' => 'yes-no',
+ ),
+ );
+
+ // link
+ $data['users']['view_user'] = array(
+ 'field' => array(
+ 'title' => t('Link'),
+ 'help' => t('Provide a simple link to the user.'),
+ 'handler' => 'views_handler_field_user_link',
+ ),
+ );
+
+ // created field
+ $data['users']['created'] = array(
+ 'title' => t('Created date'), // The item it appears as on the UI,
+ 'help' => t('The date the user was created.'), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ $data['users']['created_fulldate'] = array(
+ 'title' => t('Created date'),
+ 'help' => t('Date in the form of CCYYMMDD.'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_fulldate',
+ ),
+ );
+
+ $data['users']['created_year_month'] = array(
+ 'title' => t('Created year + month'),
+ 'help' => t('Date in the form of YYYYMM.'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_year_month',
+ ),
+ );
+
+ $data['users']['timestamp_year']['moved to'] = array('users', 'created_year');
+ $data['users']['created_year'] = array(
+ 'title' => t('Created year'),
+ 'help' => t('Date in the form of YYYY.'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_year',
+ ),
+ );
+
+ $data['users']['created_month'] = array(
+ 'title' => t('Created month'),
+ 'help' => t('Date in the form of MM (01 - 12).'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_month',
+ ),
+ );
+
+ $data['users']['created_day'] = array(
+ 'title' => t('Created day'),
+ 'help' => t('Date in the form of DD (01 - 31).'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_day',
+ ),
+ );
+
+ $data['users']['created_week'] = array(
+ 'title' => t('Created week'),
+ 'help' => t('Date in the form of WW (01 - 53).'),
+ 'argument' => array(
+ 'field' => 'created',
+ 'handler' => 'views_handler_argument_node_created_week',
+ ),
+ );
+
+ // access field
+ $data['users']['access'] = array(
+ 'title' => t('Last access'), // The item it appears as on the UI,
+ 'help' => t("The user's last access date."), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ // login field
+ $data['users']['login'] = array(
+ 'title' => t('Last login'), // The item it appears as on the UI,
+ 'help' => t("The user's last login date."), // The help that appears on the UI,
+ 'field' => array(
+ 'handler' => 'views_handler_field_date',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_date',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_date',
+ ),
+ );
+
+ // active status
+ $data['users']['status'] = array(
+ 'title' => t('Active'), // The item it appears as on the UI,
+ 'help' => t('Whether a user is active or blocked.'), // The help that appears on the UI,
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_boolean',
+ 'click sortable' => TRUE,
+ 'output formats' => array(
+ 'active-blocked' => array(t('Active'), t('Blocked')),
+ ),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_boolean_operator',
+ 'label' => t('Active'),
+ 'type' => 'yes-no',
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ );
+
+ // log field
+ $data['users']['signature'] = array(
+ 'title' => t('Signature'), // The item it appears as on the UI,
+ 'help' => t("The user's signature."), // The help that appears on the UI,
+ // Information for displaying a title as a field
+ 'field' => array(
+ 'handler' => 'views_handler_field_markup',
+ 'format' => filter_fallback_format(),
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ );
+
+ $data['users']['edit_node'] = array(
+ 'field' => array(
+ 'title' => t('Edit link'),
+ 'help' => t('Provide a simple link to edit the user.'),
+ 'handler' => 'views_handler_field_user_link_edit',
+ ),
+ );
+
+ $data['users']['cancel_node'] = array(
+ 'field' => array(
+ 'title' => t('Cancel link'),
+ 'help' => t('Provide a simple link to cancel the user.'),
+ 'handler' => 'views_handler_field_user_link_cancel',
+ ),
+ );
+
+ $data['users']['data'] = array(
+ 'title' => t('Data'),
+ 'help' => t('Provide serialized data of the user'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_serialized',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // users_roles table
+
+ $data['users_roles']['table']['group'] = t('User');
+
+ // Explain how this table joins to others.
+ $data['users_roles']['table']['join'] = array(
+ // Directly links to users table.
+ 'users' => array(
+ 'left_field' => 'uid',
+ 'field' => 'uid',
+ ),
+ );
+
+ $data['users_roles']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'uid',
+ ),
+ 'node_revision' => array(
+ 'table' => 'node_revision',
+ 'field' => 'uid',
+ ),
+ );
+
+ $data['users_roles']['rid'] = array(
+ 'title' => t('Roles'),
+ 'help' => t('Roles that a user belongs to.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_user_roles',
+ 'no group by' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_user_roles',
+ 'numeric' => TRUE,
+ 'allow empty' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_users_roles_rid',
+ 'name table' => 'role',
+ 'name field' => 'name',
+ 'empty field name' => t('No role'),
+ 'zero is null' => TRUE,
+ 'numeric' => TRUE,
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // role table
+
+ $data['role']['table']['join'] = array(
+ // Directly links to users table.
+ 'users' => array(
+ 'left_table' => 'users_roles',
+ 'left_field' => 'rid',
+ 'field' => 'rid',
+ ),
+ // needed for many to one helper sometimes
+ 'users_roles' => array(
+ 'left_field' => 'rid',
+ 'field' => 'rid',
+ ),
+ );
+
+ $data['role']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'uid',
+ ),
+ 'node_revision' => array(
+ 'table' => 'node_revision',
+ 'field' => 'uid',
+ ),
+ );
+
+ // permission table
+ $data['role_permission']['table']['group'] = t('User');
+ $data['role_permission']['table']['join'] = array(
+ // Directly links to users table.
+ 'users' => array(
+ 'left_table' => 'users_roles',
+ 'left_field' => 'rid',
+ 'field' => 'rid',
+ ),
+ );
+
+ $data['role_permission']['permission'] = array(
+ 'title' => t('Permission'),
+ 'help' => t('The user permissions.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_user_permissions',
+ 'no group by' => TRUE,
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_user_permissions',
+ ),
+ );
+
+ // ----------------------------------------------------------------------
+ // authmap table
+
+ $data['authmap']['table']['group'] = t('User');
+ $data['authmap']['table']['join'] = array(
+ // Directly links to users table.
+ 'users' => array(
+ 'left_field' => 'uid',
+ 'field' => 'uid',
+ ),
+ );
+
+ $data['authmap']['table']['default_relationship'] = array(
+ 'node' => array(
+ 'table' => 'node',
+ 'field' => 'uid',
+ ),
+ 'node_revision' => array(
+ 'table' => 'node_revision',
+ 'field' => 'uid',
+ ),
+ );
+
+ $data['authmap']['aid'] = array(
+ 'title' => t('Authmap ID'),
+ 'help' => t('The Authmap ID.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_numeric',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_numeric',
+ 'numeric' => TRUE,
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_numeric',
+ 'numeric' => TRUE,
+ ),
+ );
+ $data['authmap']['authname'] = array(
+ 'title' => t('Authentication name'),
+ 'help' => t('The unique authentication name.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+ $data['authmap']['module'] = array(
+ 'title' => t('Authentication module'),
+ 'help' => t('The name of the module managing the authentication entry.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field',
+ ),
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string',
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string',
+ ),
+ );
+
+ return $data;
+}
+
+/**
+ * Implements hook_views_plugins
+ */
+function user_views_plugins() {
+ return array(
+ 'module' => 'views', // This just tells our themes are elsewhere.
+ 'row' => array(
+ 'user' => array(
+ 'title' => t('User'),
+ 'help' => t('Display the user with standard user view.'),
+ 'handler' => 'views_plugin_row_user_view',
+ 'base' => array('users'), // only works with 'users' as base.
+ 'uses options' => TRUE,
+ 'type' => 'normal',
+ 'help topic' => 'style-users',
+ ),
+ ),
+ 'argument default' => array(
+ 'user' => array(
+ 'title' => t('User ID from URL'),
+ 'handler' => 'views_plugin_argument_default_user',
+ 'path' => drupal_get_path('module', 'views') . '/modules/user', // not necessary for most modules
+ ),
+ 'current_user' => array(
+ 'title' => t('User ID from logged in user'),
+ 'handler' => 'views_plugin_argument_default_current_user',
+ 'path' => drupal_get_path('module', 'views') . '/modules/user', // not necessary for most modules
+ ),
+ ),
+ 'argument validator' => array(
+ 'user' => array(
+ 'title' => t('User'),
+ 'handler' => 'views_plugin_argument_validate_user',
+ 'path' => drupal_get_path('module', 'views') . '/modules/user', // not necessary for most modules
+ ),
+ ),
+ );
+}
+
+/**
+ * Allow replacement of current userid so we can cache these queries
+ */
+function user_views_query_substitutions($view) {
+ global $user;
+ return array('***CURRENT_USER***' => intval($user->uid));
+}
+
+/**
+ * @}
+ */
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_user_uid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_user_uid.inc
new file mode 100644
index 0000000..21785a9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_user_uid.inc
@@ -0,0 +1,32 @@
+<?php
+/**
+ * @file
+ * Provide user uid argument handler.
+ */
+
+/**
+ * Argument handler to accept a user id.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_user_uid extends views_handler_argument_numeric {
+ /**
+ * Override the behavior of title(). Get the name of the user.
+ *
+ * @return array
+ * A list of usernames.
+ */
+ function title_query() {
+ if (!$this->argument) {
+ return array(variable_get('anonymous', t('Anonymous')));
+ }
+
+ $titles = array();
+
+ $result = db_query("SELECT u.name FROM {users} u WHERE u.uid IN (:uids)", array(':uids' => $this->value));
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->name);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_users_roles_rid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_users_roles_rid.inc
new file mode 100644
index 0000000..89b3704
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_argument_users_roles_rid.inc
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Allow role ID(s) as argument.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_users_roles_rid extends views_handler_argument_many_to_one {
+ function title_query() {
+ $titles = array();
+
+ $result = db_query("SELECT name FROM {role} WHERE rid IN (:rids)", array(':rids' => $this->value));
+ foreach ($result as $term) {
+ $titles[] = check_plain($term->name);
+ }
+ return $titles;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user.inc
new file mode 100644
index 0000000..f90a6f9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user.inc
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * Field handler to provide simple renderer that allows linking to a user.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user extends views_handler_field {
+ /**
+ * Override init function to provide generic option to link to user.
+ */
+ function init(&$view, &$data) {
+ parent::init($view, $data);
+ if (!empty($this->options['link_to_user'])) {
+ $this->additional_fields['uid'] = 'uid';
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_user'] = array('default' => TRUE);
+ return $options;
+ }
+
+ /**
+ * Provide link to node option
+ */
+ function options_form(&$form, &$form_state) {
+ $form['link_to_user'] = array(
+ '#title' => t('Link this field to its user'),
+ '#description' => t("Enable to override this field's links."),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['link_to_user'],
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_user']) && user_access('access user profiles') && ($uid = $this->get_value($values, 'uid')) && $data !== NULL && $data !== '') {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "user/" . $uid;
+ }
+ return $data;
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_language.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_language.inc
new file mode 100644
index 0000000..96b784b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_language.inc
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * Views field handler for user language.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_language extends views_handler_field_user {
+
+ function render_link($data, $values) {
+ $uid = $this->get_value($values, 'uid');
+ if (!empty($this->options['link_to_user']) && user_access('access user profiles') && $uid) {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = 'user/' . $uid;
+ }
+ if (empty($data)) {
+ $lang = language_default();
+ }
+ else {
+ $lang = language_list();
+ $lang = $lang[$data];
+ }
+
+ return $this->sanitize_value($lang->name);
+ }
+
+ function render($values) {
+ $value = $this->get_value($values);
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link.inc
new file mode 100644
index 0000000..36135d5
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link.inc
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Field handler to present a link to the user.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_link extends views_handler_field {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['uid'] = 'uid';
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['text'] = array('default' => '', 'translatable' => TRUE);
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['text'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Text to display'),
+ '#default_value' => $this->options['text'],
+ );
+ parent::options_form($form, $form_state);
+ }
+
+ // An example of field level access control.
+ function access() {
+ return user_access('access user profiles');
+ }
+
+ function query() {
+ $this->ensure_my_table();
+ $this->add_additional_fields();
+ }
+
+ function render($values) {
+ $value = $this->get_value($values, 'uid');
+ return $this->render_link($this->sanitize_value($value), $values);
+ }
+
+ function render_link($data, $values) {
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
+
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "user/" . $data;
+
+ return $text;
+ }
+
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_cancel.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_cancel.inc
new file mode 100644
index 0000000..4debce9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_cancel.inc
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Field handler to present a link to user cancel.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_link_cancel extends views_handler_field_user_link {
+
+ function render_link($data, $values) {
+ $uid = $values->{$this->aliases['uid']};
+
+ // Build a pseudo account object to be able to check the access.
+ $account = new stdClass();
+ $account->uid = $uid;
+
+ if ($uid && user_cancel_access($account)) {
+ $this->options['alter']['make_link'] = TRUE;
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('cancel');
+
+ $this->options['alter']['path'] = "user/$uid/cancel";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ return $text;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_edit.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_edit.inc
new file mode 100644
index 0000000..4f25bf6
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_link_edit.inc
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Field handler to present a link to user edit.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_link_edit extends views_handler_field_user_link {
+ function render_link($data, $values) {
+ // Build a pseudo account object to be able to check the access.
+ $account = new stdClass();
+ $account->uid = $data;
+
+ if ($data && user_edit_access($account)) {
+ $this->options['alter']['make_link'] = TRUE;
+
+ $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
+
+ $this->options['alter']['path'] = "user/$data/edit";
+ $this->options['alter']['query'] = drupal_get_destination();
+
+ return $text;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_mail.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_mail.inc
new file mode 100644
index 0000000..8408e64
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_mail.inc
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Field handler to provide acess control for the email field.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_mail extends views_handler_field_user {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_user'] = array('default' => 'mailto');
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ $form['link_to_user'] = array(
+ '#title' => t('Link this field'),
+ '#type' => 'radios',
+ '#options' => array(
+ 0 => t('No link'),
+ 'user' => t('To the user'),
+ 'mailto' => t("With a mailto:"),
+ ),
+ '#default_value' => $this->options['link_to_user'],
+ );
+ }
+
+ function render_link($data, $values) {
+ parent::render_link($data, $values);
+
+ if ($this->options['link_to_user'] == 'mailto') {
+ $this->options['alter']['make_link'] = TRUE;
+ $this->options['alter']['path'] = "mailto:" . $data;
+ }
+
+ return $data;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_name.inc
new file mode 100644
index 0000000..26cdbce
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_name.inc
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Field handler to provide simple renderer that allows using a themed user link.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_name extends views_handler_field_user {
+ /**
+ * Add uid in the query so we can test for anonymous if needed.
+ */
+ function init(&$view, &$data) {
+ parent::init($view, $data);
+ if (!empty($this->options['overwrite_anonymous']) || !empty($this->options['format_username'])) {
+ $this->additional_fields['uid'] = 'uid';
+ }
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+
+ $options['overwrite_anonymous'] = array('default' => FALSE);
+ $options['anonymous_text'] = array('default' => '', 'translatable' => TRUE);
+ $options['format_username'] = array('default' => TRUE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['format_username'] = array(
+ '#title' => t('Use formatted username'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['format_username']),
+ '#description' => t('If checked, the username will be formatted by the system. If unchecked, it will be displayed raw.'),
+ '#fieldset' => 'more',
+ );
+ $form['overwrite_anonymous'] = array(
+ '#title' => t('Overwrite the value to display for anonymous users'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['overwrite_anonymous']),
+ '#description' => t('Enable to display different text for anonymous users.'),
+ '#fieldset' => 'more',
+ );
+ $form['anonymous_text'] = array(
+ '#title' => t('Text to display for anonymous users'),
+ '#type' => 'textfield',
+ '#default_value' => $this->options['anonymous_text'],
+ '#dependency' => array(
+ 'edit-options-overwrite-anonymous' => array(1),
+ ),
+ '#fieldset' => 'more',
+ );
+
+ parent::options_form($form, $form_state);
+ }
+
+ function render_link($data, $values) {
+ $account = new stdClass();
+ $account->uid = $this->get_value($values, 'uid');
+ $account->name = $this->get_value($values);
+ if (!empty($this->options['link_to_user']) || !empty($this->options['overwrite_anonymous'])) {
+ if (!empty($this->options['overwrite_anonymous']) && !$account->uid) {
+ // This is an anonymous user, and we're overriting the text.
+ return check_plain($this->options['anonymous_text']);
+ }
+ elseif (!empty($this->options['link_to_user'])) {
+ $account->name = $this->get_value($values);
+ return theme('username', array('account' => $account));
+ }
+ }
+ // If we want a formatted username, do that.
+ if (!empty($this->options['format_username'])) {
+ return format_username($account);
+ }
+ // Otherwise, there's no special handling, so return the data directly.
+ return $data;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_permissions.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_permissions.inc
new file mode 100644
index 0000000..e20f27f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_permissions.inc
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Field handler to provide a list of permissions.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_permissions extends views_handler_field_prerender_list {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid');
+ }
+
+ function query() {
+ $this->add_additional_fields();
+ $this->field_alias = $this->aliases['uid'];
+ }
+
+ function pre_render(&$values) {
+ $uids = array();
+ $this->items = array();
+
+ foreach ($values as $result) {
+ $uids[] = $this->get_value($result, NULL, TRUE);
+ }
+
+ if ($uids) {
+ // Get a list of all the modules implementing a hook_permission() and sort by
+ // display name.
+ $module_info = system_get_info('module');
+ $modules = array();
+ foreach (module_implements('permission') as $module) {
+ $modules[$module] = $module_info[$module]['name'];
+ }
+ asort($modules);
+
+ $permissions = module_invoke_all('permission');
+
+ $result = db_query("SELECT u.uid, u.rid, rp.permission FROM {role_permission} rp INNER JOIN {users_roles} u ON u.rid = rp.rid WHERE u.uid IN (:uids) AND rp.module IN (:modules) ORDER BY rp.permission",
+ array(':uids' => $uids, ':modules' => array_keys($modules)));
+
+ foreach ($result as $perm) {
+ $this->items[$perm->uid][$perm->permission]['permission'] = $permissions[$perm->permission]['title'];
+ }
+ }
+ }
+
+ function render_item($count, $item) {
+ return $item['permission'];
+ }
+
+ /*
+ function document_self_tokens(&$tokens) {
+ $tokens['[' . $this->options['id'] . '-role' . ']'] = t('The name of the role.');
+ $tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.');
+ }
+
+ function add_self_tokens(&$tokens, $item) {
+ $tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role'];
+ $tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid'];
+ }
+ */
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_picture.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_picture.inc
new file mode 100644
index 0000000..940a89a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_picture.inc
@@ -0,0 +1,109 @@
+<?php
+
+/**
+ * Field handler to provide simple renderer that allows using a themed user link.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_picture extends views_handler_field {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['uid'] = 'uid';
+ $this->additional_fields['name'] = 'name';
+ $this->additional_fields['mail'] = 'mail';
+ }
+
+ function element_type($none_supported = FALSE, $default_empty = FALSE, $inline = FALSE) {
+ if ($inline) {
+ return 'span';
+ }
+ if ($none_supported) {
+ if ($this->options['element_type'] === '0') {
+ return '';
+ }
+ }
+ if ($this->options['element_type']) {
+ return check_plain($this->options['element_type']);
+ }
+ if ($default_empty) {
+ return '';
+ }
+ if (isset($this->definition['element type'])) {
+ return $this->definition['element type'];
+ }
+
+ return 'div';
+ }
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_photo_to_profile'] = array('default' => TRUE);
+ $options['image_style'] = array('default' => '');
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ $form['link_photo_to_profile'] = array(
+ '#title' => t("Link to user's profile"),
+ '#description' => t("Link the user picture to the user's profile"),
+ '#type' => 'checkbox',
+ '#default_value' => $this->options['link_photo_to_profile'],
+ );
+
+ if (module_exists('image')) {
+ $styles = image_styles();
+ $style_options = array('' => t('Default'));
+ foreach ($styles as $style) {
+ $style_options[$style['name']] = $style['name'];
+ }
+
+ $form['image_style'] = array(
+ '#title' => t('Image style'),
+ '#description' => t('Using <em>Default</em> will use the site-wide image style for user pictures set in the <a href="!account-settings">Account settings</a>.', array('!account-settings' => url('admin/config/people/accounts', array('fragment' => 'edit-personalization')))),
+ '#type' => 'select',
+ '#options' => $style_options,
+ '#default_value' => $this->options['image_style'],
+ );
+ }
+ }
+
+ function render($values) {
+ if ($this->options['image_style'] && module_exists('image')) {
+ // @todo: Switch to always using theme('user_picture') when it starts
+ // supporting image styles. See http://drupal.org/node/1021564
+ if ($picture_fid = $this->get_value($values)) {
+ $picture = file_load($picture_fid);
+ $picture_filepath = $picture->uri;
+ }
+ else {
+ $picture_filepath = variable_get('user_picture_default', '');
+ }
+ if (file_valid_uri($picture_filepath)) {
+ $output = theme('image_style', array('style_name' => $this->options['image_style'], 'path' => $picture_filepath));
+ if ($this->options['link_photo_to_profile'] && user_access('access user profiles')) {
+ $uid = $this->get_value($values, 'uid');
+ $output = l($output, "user/$uid", array('html' => TRUE));
+ }
+ }
+ else {
+ $output = '';
+ }
+ }
+ else {
+ // Fake an account object.
+ $account = new stdClass();
+ if ($this->options['link_photo_to_profile']) {
+ // Prevent template_preprocess_user_picture from adding a link
+ // by not setting the uid.
+ $account->uid = $this->get_value($values, 'uid');
+ }
+ $account->name = $this->get_value($values, 'name');
+ $account->mail = $this->get_value($values, 'mail');
+ $account->picture = $this->get_value($values);
+ $output = theme('user_picture', array('account' => $account));
+ }
+
+ return $output;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_roles.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_roles.inc
new file mode 100644
index 0000000..f556107
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_field_user_roles.inc
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Field handler to provide a list of roles.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_user_roles extends views_handler_field_prerender_list {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['uid'] = array('table' => 'users', 'field' => 'uid');
+ }
+
+ function query() {
+ $this->add_additional_fields();
+ $this->field_alias = $this->aliases['uid'];
+ }
+
+ function pre_render(&$values) {
+ $uids = array();
+ $this->items = array();
+
+ foreach ($values as $result) {
+ $uids[] = $this->get_value($result, NULL, TRUE);
+ }
+
+ if ($uids) {
+ $result = db_query("SELECT u.uid, u.rid, r.name FROM {role} r INNER JOIN {users_roles} u ON u.rid = r.rid WHERE u.uid IN (:uids) ORDER BY r.name",
+ array(':uids' => $uids));
+ foreach ($result as $role) {
+ $this->items[$role->uid][$role->rid]['role'] = check_plain($role->name);
+ $this->items[$role->uid][$role->rid]['rid'] = $role->rid;
+ }
+ }
+ }
+
+ function render_item($count, $item) {
+ return $item['role'];
+ }
+
+ function document_self_tokens(&$tokens) {
+ $tokens['[' . $this->options['id'] . '-role' . ']'] = t('The name of the role.');
+ $tokens['[' . $this->options['id'] . '-rid' . ']'] = t('The role ID of the role.');
+ }
+
+ function add_self_tokens(&$tokens, $item) {
+ $tokens['[' . $this->options['id'] . '-role' . ']'] = $item['role'];
+ $tokens['[' . $this->options['id'] . '-rid' . ']'] = $item['rid'];
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_current.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_current.inc
new file mode 100644
index 0000000..14deb0d
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_current.inc
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * Filter handler for the current user.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_user_current extends views_handler_filter_boolean_operator {
+ function construct() {
+ parent::construct();
+ $this->value_value = t('Is the logged in user');
+ }
+
+ function query() {
+ $this->ensure_my_table();
+
+ $field = $this->table_alias . '.' . $this->real_field . ' ';
+ $or = db_or();
+
+ if (empty($this->value)) {
+ $or->condition($field, '***CURRENT_USER***', '<>');
+ if ($this->accept_null) {
+ $or->isNull($field);
+ }
+ }
+ else {
+ $or->condition($field, '***CURRENT_USER***', '=');
+ }
+ $this->query->add_where($this->options['group'], $or);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_name.inc
new file mode 100644
index 0000000..c885e1b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_name.inc
@@ -0,0 +1,145 @@
+<?php
+
+/**
+ * Filter handler for usernames.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_user_name extends views_handler_filter_in_operator {
+ var $always_multiple = TRUE;
+
+ function value_form(&$form, &$form_state) {
+ $values = array();
+ if ($this->value) {
+ $result = db_query("SELECT * FROM {users} u WHERE uid IN (:uids)", array(':uids' => $this->value));
+ foreach ($result as $account) {
+ if ($account->uid) {
+ $values[] = $account->name;
+ }
+ else {
+ $values[] = 'Anonymous'; // Intentionally NOT translated.
+ }
+ }
+ }
+
+ sort($values);
+ $default_value = implode(', ', $values);
+ $form['value'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Usernames'),
+ '#description' => t('Enter a comma separated list of user names.'),
+ '#default_value' => $default_value,
+ '#autocomplete_path' => 'admin/views/ajax/autocomplete/user',
+ );
+
+ if (!empty($form_state['exposed']) && !isset($form_state['input'][$this->options['expose']['identifier']])) {
+ $form_state['input'][$this->options['expose']['identifier']] = $default_value;
+ }
+ }
+
+ function value_validate($form, &$form_state) {
+ $values = drupal_explode_tags($form_state['values']['options']['value']);
+ $uids = $this->validate_user_strings($form['value'], $values);
+
+ if ($uids) {
+ $form_state['values']['options']['value'] = $uids;
+ }
+ }
+
+ function accept_exposed_input($input) {
+ $rc = parent::accept_exposed_input($input);
+
+ if ($rc) {
+ // If we have previously validated input, override.
+ if (isset($this->validated_exposed_input)) {
+ $this->value = $this->validated_exposed_input;
+ }
+ }
+
+ return $rc;
+ }
+
+ function exposed_validate(&$form, &$form_state) {
+ if (empty($this->options['exposed'])) {
+ return;
+ }
+
+ if (empty($this->options['expose']['identifier'])) {
+ return;
+ }
+
+ $identifier = $this->options['expose']['identifier'];
+ $values = drupal_explode_tags($form_state['values'][$identifier]);
+
+ $uids = $this->validate_user_strings($form[$identifier], $values);
+
+ if ($uids) {
+ $this->validated_exposed_input = $uids;
+ }
+ }
+
+ /**
+ * Validate the user string. Since this can come from either the form
+ * or the exposed filter, this is abstracted out a bit so it can
+ * handle the multiple input sources.
+ */
+ function validate_user_strings(&$form, $values) {
+ $uids = array();
+ $placeholders = array();
+ $args = array();
+ $results = array();
+ foreach ($values as $value) {
+ if (strtolower($value) == 'anonymous') {
+ $uids[] = 0;
+ }
+ else {
+ $missing[strtolower($value)] = TRUE;
+ $args[] = $value;
+ $placeholders[] = "'%s'";
+ }
+ }
+
+ if (!$args) {
+ return $uids;
+ }
+
+ $result = db_query("SELECT * FROM {users} WHERE name IN (:names)", array(':names' => $args));
+ foreach ($result as $account) {
+ unset($missing[strtolower($account->name)]);
+ $uids[] = $account->uid;
+ }
+
+ if ($missing) {
+ form_error($form, format_plural(count($missing), 'Unable to find user: @users', 'Unable to find users: @users', array('@users' => implode(', ', array_keys($missing)))));
+ }
+
+ return $uids;
+ }
+
+ function value_submit($form, &$form_state) {
+ // prevent array filter from removing our anonymous user.
+ }
+
+ // Override to do nothing.
+ function get_value_options() { }
+
+ function admin_summary() {
+ // set up $this->value_options for the parent summary
+ $this->value_options = array();
+
+ if ($this->value) {
+ $result = db_query("SELECT * FROM {users} u WHERE uid IN (:uids)", array(':uids' => $this->value));
+
+ foreach ($result as $account) {
+ if ($account->uid) {
+ $this->value_options[$account->uid] = $account->name;
+ }
+ else {
+ $this->value_options[$account->uid] = 'Anonymous'; // Intentionally NOT translated.
+ }
+ }
+ }
+
+ return parent::admin_summary();
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_permissions.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_permissions.inc
new file mode 100644
index 0000000..4cf51db
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_permissions.inc
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Filter handler for user roles.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_user_permissions extends views_handler_filter_many_to_one {
+ function get_value_options() {
+ $module_info = system_get_info('module');
+
+ // Get a list of all the modules implementing a hook_permission() and sort by
+ // display name.
+ $modules = array();
+ foreach (module_implements('permission') as $module) {
+ $modules[$module] = $module_info[$module]['name'];
+ }
+ asort($modules);
+
+ $this->value_options = array();
+ foreach ($modules as $module => $display_name) {
+ if ($permissions = module_invoke($module, 'permission')) {
+ foreach ($permissions as $perm => $perm_item) {
+ // @todo: group by module but views_handler_filter_many_to_one does not support this.
+ $this->value_options[$perm] = check_plain(strip_tags($perm_item['title']));
+ }
+ }
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_roles.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_roles.inc
new file mode 100644
index 0000000..cbf985d
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_handler_filter_user_roles.inc
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Filter handler for user roles.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_user_roles extends views_handler_filter_many_to_one {
+ function get_value_options() {
+ $this->value_options = user_roles(TRUE);
+ unset($this->value_options[DRUPAL_AUTHENTICATED_RID]);
+ }
+
+ /**
+ * Override empty and not empty operator labels to be clearer for user roles.
+ */
+ function operators() {
+ $operators = parent::operators();
+ $operators['empty']['title'] = t("Only has the 'authenticated user' role");
+ $operators['not empty']['title'] = t("Has roles in addition to 'authenticated user'");
+ return $operators;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_current_user.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_current_user.inc
new file mode 100644
index 0000000..d79226c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_current_user.inc
@@ -0,0 +1,17 @@
+<?php
+/**
+ * @file
+ * Contains the current user argument default plugin.
+ */
+
+/**
+ * Default argument plugin to extract the global $user
+ *
+ * This plugin actually has no options so it odes not need to do a great deal.
+ */
+class views_plugin_argument_default_current_user extends views_plugin_argument_default {
+ function get_argument() {
+ global $user;
+ return $user->uid;
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_user.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_user.inc
new file mode 100644
index 0000000..d14e345
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_default_user.inc
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * Contains the user from URL argument default plugin.
+ */
+
+/**
+ * Default argument plugin to extract a user via menu_get_object
+ */
+class views_plugin_argument_default_user extends views_plugin_argument_default {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['user'] = array('default' => '', 'bool' => TRUE, 'translatable' => FALSE);
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['user'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Also look for a node and use the node author'),
+ '#default_value' => $this->options['user'],
+ );
+ }
+
+ function convert_options(&$options) {
+ if (!isset($options['user']) && isset($this->argument->options['default_argument_user'])) {
+ $options['user'] = $this->argument->options['default_argument_user'];
+ }
+ }
+
+ function get_argument() {
+ foreach (range(1, 3) as $i) {
+ $user = menu_get_object('user', $i);
+ if (!empty($user)) {
+ return $user->uid;
+ }
+ }
+
+ foreach (range(1, 3) as $i) {
+ $user = menu_get_object('user_uid_optional', $i);
+ if (!empty($user)) {
+ return $user->uid;
+ }
+ }
+
+ if (!empty($this->options['user'])) {
+ foreach (range(1, 3) as $i) {
+ $node = menu_get_object('node', $i);
+ if (!empty($node)) {
+ return $node->uid;
+ }
+ }
+ }
+
+ if (arg(0) == 'user' && is_numeric(arg(1))) {
+ return arg(1);
+ }
+
+ if (!empty($this->options['user'])) {
+ if (arg(0) == 'node' && is_numeric(arg(1))) {
+ $node = node_load(arg(1));
+ if ($node) {
+ return $node->uid;
+ }
+ }
+ }
+
+ // If the current page is a view that takes uid as an argument, return the uid.
+ $view = views_get_page_view();
+
+ if ($view && isset($view->argument['uid'])) {
+ return $view->argument['uid']->argument;
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_validate_user.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_validate_user.inc
new file mode 100644
index 0000000..4dfa4bc
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_argument_validate_user.inc
@@ -0,0 +1,135 @@
+<?php
+
+/**
+ * Validate whether an argument is a valid user.
+ *
+ * This supports either numeric arguments (UID) or strings (username) and
+ * converts either one into the user's UID. This validator also sets the
+ * argument's title to the username.
+ */
+class views_plugin_argument_validate_user extends views_plugin_argument_validate {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['type'] = array('default' => 'uid');
+ $options['restrict_roles'] = array('default' => FALSE);
+ $options['roles'] = array('default' => array());
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ $form['type'] = array(
+ '#type' => 'radios',
+ '#title' => t('Type of user filter value to allow'),
+ '#options' => array(
+ 'uid' => t('Only allow numeric UIDs'),
+ 'name' => t('Only allow string usernames'),
+ 'either' => t('Allow both numeric UIDs and string usernames'),
+ ),
+ '#default_value' => $this->options['type'],
+ );
+
+ $form['restrict_roles'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Restrict user based on role'),
+ '#default_value' => $this->options['restrict_roles'],
+ );
+
+ $form['roles'] = array(
+ '#type' => 'checkboxes',
+ '#prefix' => '<div id="edit-options-validate-options-user-roles-wrapper">',
+ '#suffix' => '</div>',
+ '#title' => t('Restrict to the selected roles'),
+ '#options' => array_map('check_plain', user_roles(TRUE)),
+ '#default_value' => $this->options['roles'],
+ '#description' => t('If no roles are selected, users from any role will be allowed.'),
+ '#dependency' => array(
+ 'edit-options-validate-options-user-restrict-roles' => array(1),
+ ),
+ );
+ }
+
+ function options_submit(&$form, &$form_state, &$options = array()) {
+ // filter trash out of the options so we don't store giant unnecessary arrays
+ $options['roles'] = array_filter($options['roles']);
+ }
+
+ function convert_options(&$options) {
+ if (!isset($options['type']) && isset($this->argument->options['validate_user_argument_type'])) {
+ $options['type'] = $this->argument->options['validate_user_argument_type'];
+ $options['restrict_roles'] = $this->argument->options['validate_user_restrict_roles'];
+ $options['roles'] = $this->argument->options['validate_user_roles'];
+ }
+ }
+
+ function validate_argument($argument) {
+ $type = $this->options['type'];
+ // is_numeric() can return false positives, so we ensure it's an integer.
+ // However, is_integer() will always fail, since $argument is a string.
+ if (is_numeric($argument) && $argument == (int)$argument) {
+ if ($type == 'uid' || $type == 'either') {
+ if ($argument == $GLOBALS['user']->uid) {
+ // If you assign an object to a variable in PHP, the variable
+ // automatically acts as a reference, not a copy, so we use
+ // clone to ensure that we don't actually mess with the
+ // real global $user object.
+ $account = clone $GLOBALS['user'];
+ }
+ $where = 'uid = :argument';
+ }
+ }
+ else {
+ if ($type == 'name' || $type == 'either') {
+ $name = !empty($GLOBALS['user']->name) ? $GLOBALS['user']->name : variable_get('anonymous', t('Anonymous'));
+ if ($argument == $name) {
+ $account = clone $GLOBALS['user'];
+ }
+ $where = "name = :argument";
+ }
+ }
+
+ // If we don't have a WHERE clause, the argument is invalid.
+ if (empty($where)) {
+ return FALSE;
+ }
+
+ if (!isset($account)) {
+ $query = "SELECT uid, name FROM {users} WHERE $where";
+ $account = db_query($query, array(':argument' => $argument))->fetchObject();
+ }
+ if (empty($account)) {
+ // User not found.
+ return FALSE;
+ }
+
+ // See if we're filtering users based on roles.
+ if (!empty($this->options['restrict_roles']) && !empty($this->options['roles'])) {
+ $roles = $this->options['roles'];
+ $account->roles = array();
+ $account->roles[] = $account->uid ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID;
+ $result = db_query('SELECT rid FROM {users_roles} WHERE uid = :uid', array(':uid' => $account->uid));
+ foreach ($result as $role) {
+ $account->roles[] = $role->rid;
+ }
+ if (!(bool) array_intersect($account->roles, $roles)) {
+ return FALSE;
+ }
+ }
+
+ $this->argument->argument = $account->uid;
+ $this->argument->validated_title = isset($account->name) ? check_plain($account->name) : check_plain(variable_get('anonymous', t('Anonymous')));
+ return TRUE;
+ }
+
+ function process_summary_arguments(&$args) {
+ // If the validation says the input is an username, we should reverse the
+ // argument so it works for example for generation summary urls.
+ $uids_arg_keys = array_flip($args);
+ if ($this->options['type'] == 'name') {
+ $users = user_load_multiple($args);
+ foreach ($users as $uid => $account) {
+ $args[$uids_arg_keys[$uid]] = $account->name;
+ }
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_row_user_view.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_row_user_view.inc
new file mode 100644
index 0000000..b48f459
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/user/views_plugin_row_user_view.inc
@@ -0,0 +1,81 @@
+<?php
+
+/**
+ * @file
+ * Contains the user view row plugin.
+ */
+
+/**
+ * A row plugin which renders a user via user_view.
+ *
+ * @ingroup views_row_plugins
+ */
+class views_plugin_row_user_view extends views_plugin_row {
+ var $base_table = 'users';
+ var $base_field = 'uid';
+
+ // Store the users to be used for pre_render.
+ var $users = array();
+
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['view_mode'] = array('default' => 'full');
+
+ return $options;
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $options = $this->options_form_summary_options();
+ $form['view_mode'] = array(
+ '#type' => 'select',
+ '#options' => $options,
+ '#title' => t('View mode'),
+ '#default_value' => $this->options['view_mode'],
+ );
+ $form['help']['#markup'] = t("Display the user with standard user view. It might be necessary to add a user-profile.tpl.php in your themes template folder, because the default <a href=\"@user-profile-api-link\">user-profile</a>e template don't show the username per default.", array('@user-profile-api-link' => url('http://api.drupal.org/api/drupal/modules--user--user-profile.tpl.php/7')));
+ }
+
+
+ /**
+ * Return the main options, which are shown in the summary title.
+ */
+ function options_form_summary_options() {
+ $entity_info = entity_get_info('user');
+ $options = array();
+ if (!empty($entity_info['view modes'])) {
+ foreach ($entity_info['view modes'] as $mode => $settings) {
+ $options[$mode] = $settings['label'];
+ }
+ }
+ if (empty($options)) {
+ $options = array(
+ 'full' => t('User account')
+ );
+ }
+
+ return $options;
+ }
+
+ function summary_title() {
+ $options = $this->options_form_summary_options();
+ return check_plain($options[$this->options['view_mode']]);
+ }
+
+ function pre_render($values) {
+ $uids = array();
+ foreach ($values as $row) {
+ $uids[] = $row->{$this->field_alias};
+ }
+ $this->users = user_load_multiple($uids);
+ }
+
+ function render($row) {
+ $account = $this->users[$row->{$this->field_alias}];
+ $account->view = $this->view;
+ $build = user_view($account, $this->options['view_mode']);
+
+ return drupal_render($build);
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/views.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/views.views.inc
new file mode 100644
index 0000000..6aa8a09
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/views.views.inc
@@ -0,0 +1,105 @@
+<?php
+/**
+ * @file
+ * Provide views data and handlers that aren't tied to any other module.
+ */
+
+/**
+ * @defgroup views_views_module miscellaneous handlers
+ *
+ * @{
+ */
+
+/**
+ * Implements hook_views_data()
+ */
+function views_views_data() {
+ $data['views']['table']['group'] = t('Global');
+ $data['views']['table']['join'] = array(
+ // #global is a special flag which let's a table appear all the time.
+ '#global' => array(),
+ );
+
+ $data['views']['random'] = array(
+ 'title' => t('Random'),
+ 'help' => t('Randomize the display order.'),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort_random',
+ ),
+ );
+
+ $data['views']['null'] = array(
+ 'title' => t('Null'),
+ 'help' => t('Allow a contextual filter value to be ignored. The query will not be altered by this contextual filter value. Can be used when contextual filter values come from the URL, and a part of the URL needs to be ignored.'),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_null',
+ ),
+ );
+
+ $data['views']['nothing'] = array(
+ 'title' => t('Custom text'),
+ 'help' => t('Provide custom text or link.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_custom',
+ ),
+ );
+
+ $data['views']['counter'] = array(
+ 'title' => t('View result counter'),
+ 'help' => t('Displays the actual position of the view result'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_counter',
+ ),
+ );
+
+ $data['views']['area'] = array(
+ 'title' => t('Text area'),
+ 'help' => t('Provide markup text for the area.'),
+ 'area' => array(
+ 'handler' => 'views_handler_area_text',
+ ),
+ );
+
+ $data['views']['view'] = array(
+ 'title' => t('View area'),
+ 'help' => t('Insert a view inside an area.'),
+ 'area' => array(
+ 'handler' => 'views_handler_area_view',
+ ),
+ );
+
+ $data['views']['result'] = array(
+ 'title' => t('Result summary'),
+ 'help' => t('Shows result summary, for example the items per page.'),
+ 'area' => array(
+ 'handler' => 'views_handler_area_result',
+ ),
+ );
+
+ if (module_exists('contextual')) {
+ $data['views']['contextual_links'] = array(
+ 'title' => t('Contextual Links'),
+ 'help' => t('Display fields in a contextual links menu.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_contextual_links',
+ ),
+ );
+ }
+
+ if (module_invoke('ctools', 'api_version', '1.7.1')) {
+ $data['views']['expression'] = array(
+ 'title' => t('Math expression'),
+ 'help' => t('Evaluates a mathematical expression and displays it.'),
+ 'field' => array(
+ 'handler' => 'views_handler_field_math',
+ 'float' => TRUE,
+ ),
+ );
+ }
+
+ return $data;
+}
+
+/**
+ * @}
+ */