• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/locale.views.inc

Go to the documentation of this file.
00001 <?php
00002 
00018 function locale_views_data() {
00019   // Basic table information.
00020 
00021   // Define the base group of this table.
00022   $data['locales_source']['table']['group']  = t('Locale source');
00023 
00024   // Advertise this table as a possible base table.
00025   $data['locales_source']['table']['base'] = array(
00026     'field' => 'lid',
00027     'title' => t('Locale source'),
00028     'help' => t('A source string for translation, in English or the default site language.'),
00029   );
00030 
00031   // lid
00032   $data['locales_source']['lid'] = array(
00033     'title' => t('LID'),
00034     'help' => t('The ID of the source string.'),
00035     'field' => array(
00036       'handler' => 'views_handler_field',
00037       'click sortable' => TRUE,
00038     ),
00039     'argument' => array(
00040       'handler' => 'views_handler_argument_numeric',
00041       'numeric' => TRUE,
00042       'validate type' => 'lid',
00043     ),
00044     'filter' => array(
00045       'handler' => 'views_handler_filter_numeric',
00046     ),
00047     'sort' => array(
00048       'handler' => 'views_handler_sort',
00049     ),
00050   );
00051 
00052   // location
00053   $data['locales_source']['location'] = array(
00054     'group' => t('Locale source'),
00055     'title' => t('Location'),
00056     'help' => t('A description of the location or context of the string.'),
00057     'field' => array(
00058       'handler' => 'views_handler_field',
00059       'click sortable' => TRUE,
00060      ),
00061     'sort' => array(
00062       'handler' => 'views_handler_sort',
00063     ),
00064     'filter' => array(
00065       'handler' => 'views_handler_filter_string',
00066     ),
00067     'argument' => array(
00068       'handler' => 'views_handler_argument_string',
00069     ),
00070   );
00071 
00072   // Group field
00073   $data['locales_source']['textgroup'] = array(
00074     'group' => t('Locale source'),
00075     'title' => t('Group'),
00076     'help' => t('The group the translation is in.'),
00077     'field' => array(
00078       'handler' => 'views_handler_field_locale_group',
00079       'click sortable' => TRUE,
00080     ),
00081     'filter' => array(
00082       'handler' => 'views_handler_filter_locale_group',
00083     ),
00084     'argument' => array(
00085       'handler' => 'views_handler_argument_locale_group',
00086     ),
00087   );
00088 
00089   // Source field
00090   $data['locales_source']['source'] = array(
00091     'group' => t('Locale source'),
00092     'title' => t('Source'),
00093     'help' => t('The full original string.'),
00094     'field' => array(
00095       'handler' => 'views_handler_field',
00096     ),
00097     'filter' => array(
00098       'handler' => 'views_handler_filter_string',
00099     ),
00100   );
00101 
00102   // Version field
00103   $data['locales_source']['version'] = array(
00104     'group' => t('Locale source'),
00105     'title' => t('Version'),
00106     'help' => t('The version of Drupal core that this string is for.'),
00107     'field' => array(
00108       'handler' => 'views_handler_field',
00109       'click sortable' => TRUE,
00110     ),
00111     'filter' => array(
00112       'handler' => 'views_handler_filter_locale_version',
00113     ),
00114     'argument' => array(
00115       'handler' => 'views_handler_argument_string',
00116     ),
00117   );
00118 
00119   $data['locales_source']['edit_lid'] = array(
00120     'group' => t('Locale source'),
00121     'field' => array(
00122       'title' => t('Edit link'),
00123       'help' => t('Provide a simple link to edit the translations.'),
00124       'handler' => 'views_handler_field_locale_link_edit',
00125     ),
00126   );
00127 
00128   // ----------------------------------------------------------------------
00129   // Locales target table
00130 
00131   // Define the base group of this table. Fields that don't
00132   // have a group defined will go into this field by default.
00133   $data['locales_target']['table']['group']  = t('Locale target');
00134 
00135   // Join information
00136   $data['locales_target']['table']['join'] = array(
00137     'locales_source' => array(
00138       'left_field' => 'lid',
00139       'field' => 'lid',
00140     ),
00141   );
00142 
00143   // Translation field
00144   $data['locales_target']['translation'] = array(
00145     'group' => t('Locale target'),
00146     'title' => t('Translation'),
00147     'help' => t('The full translation string.'),
00148     'field' => array(
00149       'handler' => 'views_handler_field',
00150     ),
00151     'filter' => array(
00152       'handler' => 'views_handler_filter_string',
00153     ),
00154   );
00155 
00156   // Language field
00157   $data['locales_target']['language'] = array(
00158     'group' => t('Locale target'),
00159     'title' => t('Language'),
00160     'help' => t('The language this translation is in.'),
00161     'field' => array(
00162       'handler' => 'views_handler_field_locale_language',
00163       'click sortable' => TRUE,
00164     ),
00165     'filter' => array(
00166       'handler' => 'views_handler_filter_locale_language',
00167     ),
00168     'argument' => array(
00169       'handler' => 'views_handler_argument_locale_language',
00170     ),
00171   );
00172 
00173   $data['locales_target']['plid'] = array(
00174     'group' => t('Locale target'),
00175     'title' => t('Singular LID'),
00176     'help' => t('The ID of the parent translation.'),
00177     'field' => array(
00178       'handler' => 'views_handler_field',
00179     ),
00180   );
00181 
00182   // Plural
00183   $data['locales_target']['plural'] = array(
00184     'group' => t('Locale target'),
00185     'title' => t('Plural'),
00186     'help' => t('Whether or not the translation is plural.'),
00187     'field' => array(
00188       'handler' => 'views_handler_field_boolean',
00189       'click sortable' => TRUE,
00190     ),
00191     'filter' => array(
00192       'handler' => 'views_handler_filter_boolean_operator',
00193       'label' => t('Plural'),
00194       'type' => 'yes-no',
00195     ),
00196     'sort' => array(
00197       'handler' => 'views_handler_sort',
00198     ),
00199   );
00200 
00201   return $data;
00202 }
00203 

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1