diff --git client/hosting_client.module client/hosting_client.module index 3fda20a..188092f 100644 --- client/hosting_client.module +++ client/hosting_client.module @@ -592,3 +592,13 @@ function hosting_client_autocomplete($type, $keyword) { drupal_json($matches); exit(); } + +/** + * Views integration + */ +function hosting_client_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'hosting_client'), + ); +} diff --git client/hosting_client.views.inc client/hosting_client.views.inc new file mode 100644 index 0000000..76e124e --- /dev/null +++ client/hosting_client.views.inc @@ -0,0 +1,51 @@ + array( + 'group' => 'Hosting Client', + 'title' => 'Client', + 'join' => array( + 'node' => array( + 'left_field' => 'vid', + 'field' => 'vid', + ), + ), + ), + 'name' => array( + 'title' => t('Name'), + 'help' => t('The name of the client.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + ), + 'organization' => array( + 'title' => t('Organization'), + 'help' => t('The name of the client organization.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + ), + 'email' => array( + 'title' => t('Email'), + 'help' => t('The email contact address for this client.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + ); + + return $data; +} diff --git db_server/hosting_db_server.module db_server/hosting_db_server.module index bb63036..10a3ea9 100644 --- db_server/hosting_db_server.module +++ db_server/hosting_db_server.module @@ -270,3 +270,12 @@ function hosting_db_server_hosting_summary() { return $summary; } +/** + * Views integration + */ +function hosting_db_server_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'hosting_db_server'), + ); +} diff --git db_server/hosting_db_server.views.inc db_server/hosting_db_server.views.inc new file mode 100644 index 0000000..5f133e1 --- /dev/null +++ db_server/hosting_db_server.views.inc @@ -0,0 +1,72 @@ + array( + 'path' => drupal_get_path('module', 'hosting_db_server'), + ), + 'handlers' => array( + 'hosting_db_server_handler_filter_db_server_type' => array( + 'parent' => 'views_handler_filter_in_operator', + ), + ), + ); +} + +/** + * Implements hook_views_data(). + */ + +function hosting_db_server_views_data() { + $data['hosting_db_server'] = array( + 'table' => array( + 'group' => 'Hosting DB Sever', + 'title' => 'Database Sever', + 'join' => array( + 'node' => array( + 'left_field' => 'vid', + 'field' => 'vid', + ), + ), + ), + 'db_type' => array( + 'title' => t('Type'), + 'help' => t('The name of the database server.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'hosting_db_server_handler_filter_db_server_type', + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + ), + 'db_user' => array( + 'title' => t('Username'), + 'help' => t('The username for the database.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'db_passwd' => array( + 'title' => t('Password'), + 'help' => t('The password for the database.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + ); + + return $data; +} diff --git db_server/hosting_db_server_handler_filter_db_server_type.inc db_server/hosting_db_server_handler_filter_db_server_type.inc new file mode 100644 index 0000000..49351e1 --- /dev/null +++ db_server/hosting_db_server_handler_filter_db_server_type.inc @@ -0,0 +1,19 @@ +value_options)) { + $this->value_title = t('DB Sever Type'); + $result = db_query("SELECT DISTINCT(db_type) FROM {hosting_db_server}"); + while ($db_server = db_fetch_object($result)) { + $options[$db_server->db_type] = $db_server->db_type; + } + + $this->value_options = $options; + } + } +} + diff --git package/hosting_package.module package/hosting_package.module index 7ca7179..c9258e3 100644 --- package/hosting_package.module +++ package/hosting_package.module @@ -363,3 +363,12 @@ function hosting_package_list($ref, $type = null) { return theme('table', $header, $rows, array('class' => 'hosting-table')) . theme('pager', null, 25, 2); } +/** + * Views integration + */ +function hosting_package_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'hosting_package'), + ); +} diff --git package/hosting_package.views.inc package/hosting_package.views.inc new file mode 100644 index 0000000..78657f6 --- /dev/null +++ package/hosting_package.views.inc @@ -0,0 +1,73 @@ + array( + 'path' => drupal_get_path('module', 'hosting_package'), + ), + 'handlers' => array( + 'hosting_package_handler_filter_hosting_package_type' => array( + 'parent' => 'views_handler_filter_in_operator', + ), + ), + ); +} + +/** + * Implements hook_views_data(). + */ +function hosting_package_views_data() { + $data['hosting_package'] = array( + 'table' => array( + 'group' => 'Hosting Package', + 'title' => 'Package', + 'join' => array( + 'node' => array( + 'left_field' => 'vid', + 'field' => 'vid', + ), + ), + ), + 'package_type' => array( + 'title' => t('Type'), + 'help' => t('The type of the package (e.g. module, theme, profile).'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'hosting_package_handler_filter_hosting_package_type', + ), + ), + 'short_name' => array( + 'title' => t('Name'), + 'help' => t('The name used .'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + ), + 'description' => array( + 'title' => t('Description'), + 'help' => t('The description information for this package.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + ); + + return $data; +} + + diff --git package/hosting_package_handler_filter_hosting_package_type.inc package/hosting_package_handler_filter_hosting_package_type.inc new file mode 100644 index 0000000..23fd9ca --- /dev/null +++ package/hosting_package_handler_filter_hosting_package_type.inc @@ -0,0 +1,18 @@ +value_options)) { + $this->value_title = t('Package Type'); + $types = _hosting_package_types(); + foreach ($types as $type => $name) { + $options[$type] = $name; + } + $this->value_options = $options; + } + } +} + diff --git platform/hosting_platform.module platform/hosting_platform.module index d7d929e..0520abc 100644 --- platform/hosting_platform.module +++ platform/hosting_platform.module @@ -279,3 +279,13 @@ function hosting_platform_hosting_summary() { $summary['platforms'] = theme('item_list', array_map('_hosting_node_link', array_keys($platforms)), t('Platforms')); return $summary; } + +/** + * Views integration + */ +function hosting_platform_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'hosting_platform'), + ); +} diff --git platform/hosting_platform.views.inc platform/hosting_platform.views.inc new file mode 100644 index 0000000..88a43b4 --- /dev/null +++ platform/hosting_platform.views.inc @@ -0,0 +1,83 @@ + array( + 'path' => drupal_get_path('module', 'hosting_platform'), + ), + 'handlers' => array( + 'hosting_platform_handler_filter_hosting_platform_type' => array( + 'parent' => 'views_handler_filter_in_operator', + ), + ), + ); +} + +/** + * Implements hook_views_data(). + */ +function hosting_platform_views_data() { + $data['hosting_platform'] = array( + 'table' => array( + 'group' => 'Hosting Platform', + 'title' => 'Platform', + 'join' => array( + 'node' => array( + 'left_field' => 'vid', + 'field' => 'vid', + ), + ), + ), + 'publish_path' => array( + 'title' => t('Publish Path'), + 'help' => t('The path on the server where this platform is installed.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'web_server' => array( + 'title' => t('Web Server'), + 'help' => t('The webserver this platform is installed on.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'release_id' => array( + 'title' => t('Release ID'), + 'help' => t('The release ID.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'verified' => array( + 'title' => t('Verfied Date'), + 'help' => t('The description information for this platform.'), + 'field' => array( + 'handler' => 'views_handler_field_date', + 'click sortable' => TRUE, + ), + ), + 'status' => array( + 'title' => t('Status'), + 'help' => t('The descri.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + ); + + return $data; +} + + diff --git site/hosting_site.module site/hosting_site.module index e785acf..10cfde9 100644 --- site/hosting_site.module +++ site/hosting_site.module @@ -903,3 +903,12 @@ function _hosting_site_form_populate($element, $value, $value2 = null) { exit(); } +/** + * Views integration + */ +function hosting_site_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'hosting_site'), + ); +} diff --git site/hosting_site.views.inc site/hosting_site.views.inc new file mode 100644 index 0000000..80295db --- /dev/null +++ site/hosting_site.views.inc @@ -0,0 +1,126 @@ + array( + 'path' => drupal_get_path('module', 'hosting_site'), + ), + 'handlers' => array( + /* add handlers */ + ), + ); +} + +/** + * Implements hook_views_data(). + */ +function hosting_site_views_data() { + $data['hosting_site'] = array( + 'table' => array( + 'group' => 'Hosting Site', + 'title' => 'Site', + 'join' => array( + 'node' => array( + 'left_field' => 'vid', + 'field' => 'vid', + ), + ), + ), + 'client' => array( + 'title' => t('Client ID'), + 'help' => t('The ID of the client for this site.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'db_server' => array( + 'title' => t('DB Server ID'), + 'help' => t('The database server id.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'platform' => array( + 'title' => t('Platform ID'), + 'help' => t('The ID of the platform this site is installed on.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'profile' => array( + 'title' => t('Profile ID'), + 'help' => t('The ID of the profile package installed on this site.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'language' => array( + 'title' => t('Language'), + 'help' => t('The default language of this site.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'last_cron' => array( + 'title' => t('Last Cron Run'), + 'help' => t('The time the last cron run was executed on this site.'), + 'field' => array( + 'handler' => 'views_handler_field_date', + 'click sortable' => TRUE, + ), + ), + 'verified' => array( + 'title' => t('Verified'), + 'help' => t('The last date verified task run on this site.'), + 'field' => array( + 'handler' => 'views_handler_field_date', + 'click sortable' => TRUE, + ), + ), + 'status' => array( + 'title' => t('Status'), + 'help' => t('The current state of this site.'), + 'field' => array( + 'handler' => 'views_handler_field', + ), + ), + 'port' => array( + 'title' => t('Port'), + 'help' => t('The HTTP port the site is running on.'), + 'field' => array( + 'handler' => 'views_handler_field_numberic', + 'click sortable' => TRUE, + ), + ), + 'ssl' => array( + 'title' => t('SSL'), + 'help' => t(''), + 'field' => array( + 'handler' => 'views_handler_field', + ), + ), + 'ssl_redirect' => array( + 'title' => t('SSL Redirect'), + 'help' => t(''), + 'field' => array( + 'handler' => 'views_handler_field', + ), + ), + ); + + return $data; +} + + diff --git task/hosting_task.module task/hosting_task.module index 2c90c42..4f8d088 100644 --- task/hosting_task.module +++ task/hosting_task.module @@ -646,3 +646,13 @@ function _hosting_task_list($filter_by, $filter_value, $count = 5, $element = 0, return $output; } } + +/** + * Views integration + */ +function hosting_task_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'hosting_task'), + ); +} diff --git task/hosting_task.views.inc task/hosting_task.views.inc new file mode 100644 index 0000000..40ec686 --- /dev/null +++ task/hosting_task.views.inc @@ -0,0 +1,77 @@ + array( + 'path' => drupal_get_path('module', 'hosting_task'), + ), + 'handlers' => array( + 'hosting_task_handler_filter_hosting_task_type' => array( + 'parent' => 'views_handler_filter_in_operator', + ), + ), + ); +} + +/** + * Implements hook_views_data(). + */ +function hosting_task_views_data() { + $data['hosting_task'] = array( + 'table' => array( + 'group' => 'Hosting Task', + 'title' => 'Task', + 'join' => array( + 'node' => array( + 'left_field' => 'vid', + 'field' => 'vid', + ), + ), + ), + 'task_type' => array( + 'title' => t('Type'), + 'help' => t(''), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'hosting_task_handler_filter_hosting_task_type', + ), + ), + 'rid' => array( + 'title' => t('RID'), + 'help' => t(''), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'task_status' => array( + 'title' => t('Status'), + 'help' => t('Current status of the task.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'executed' => array( + 'title' => t('Executed'), + 'help' => t('Date this task was executed.'), + 'field' => array( + 'handler' => 'views_handler_field_date', + 'click sortable' => TRUE, + ), + ), + ); + return $data; +} + + diff --git task/hosting_task_handler_filter_hosting_task_type.inc task/hosting_task_handler_filter_hosting_task_type.inc new file mode 100644 index 0000000..8eefcf6 --- /dev/null +++ task/hosting_task_handler_filter_hosting_task_type.inc @@ -0,0 +1,21 @@ +value_options)) { + $this->value_title = t('Task Type'); + $tasks = array(); + foreach (array('site', 'platform') as $task) { + $types = hosting_available_tasks('site'); + foreach ($types as $type => $task) { + $options[$type] = $task['title']; + } + } + $this->value_options = $options; + } + } +} + diff --git web_server/hosting_web_server.module web_server/hosting_web_server.module index 411237a..12fb963 100644 --- web_server/hosting_web_server.module +++ web_server/hosting_web_server.module @@ -510,3 +510,13 @@ function hosting_web_server_form_alter($form_id, &$form) { break; } } + +/** + * Views integration + */ +function hosting_web_server_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'hosting_web_server'), + ); +} diff --git web_server/hosting_web_server.views.inc web_server/hosting_web_server.views.inc new file mode 100644 index 0000000..b388253 --- /dev/null +++ web_server/hosting_web_server.views.inc @@ -0,0 +1,106 @@ + array( + 'path' => drupal_get_path('module', 'hosting_web_server'), + ), + 'handlers' => array( + 'hosting_web_server_handler_filter_hosting_web_server_type' => array( + 'parent' => 'views_handler_filter_in_operator', + ), + ), + ); +} + +/** + * Implements hook_views_data(). + */ +function hosting_web_server_views_data() { + $data['hosting_web_server'] = array( + 'table' => array( + 'group' => 'Hosting Web Sever', + 'title' => 'Package', + 'join' => array( + 'node' => array( + 'left_field' => 'vid', + 'field' => 'vid', + ), + ), + ), + 'ip_address' => array( + 'title' => t('IP Address'), + 'help' => t('IP address of the webserver.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'script_user' => array( + 'title' => t('Script User'), + 'help' => t('User.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'web_group' => array( + 'title' => t('Web group'), + 'help' => t('The group.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'config_path' => array( + 'title' => t('Config Path'), + 'help' => t('The path where configuration files are saved.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'backup_path' => array( + 'title' => t('Backup Path'), + 'help' => t('The path where backup files are saved.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'restart_cmd' => array( + 'title' => t('Restart Command'), + 'help' => t('Command use to restart the webserver.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'drush_path' => array( + 'title' => t('Drush Path'), + 'help' => t('The path to drush on this server.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + 'ports' => array( + 'title' => t('Ports'), + 'help' => t('.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + ), + ); + return $data; +} + +