simplenews.views.inc 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. <?php
  2. /**
  3. * @file
  4. * Views interface for simplenews.
  5. */
  6. /**
  7. * Implements hook_views_data().
  8. */
  9. function simplenews_views_data() {
  10. /* ------------ Definitions for Simplenews mailspool ----------------------*/
  11. $data['simplenews_mail_spool']['table'] = array(
  12. 'base' => array(
  13. 'field' => 'msid',
  14. 'title' => t('Simplenews mailspool'),
  15. 'help' => t('Spool for temporary storage of newsletter emails.'),
  16. 'weight' => 10,
  17. 'database' => 'default',
  18. ),
  19. 'group' => t('Simplenews spool'),
  20. );
  21. $data['simplenews_mail_spool']['msid'] = array(
  22. 'title' => t('Ms ID'),
  23. 'help' => t('The primary identifier for a mail spool record.'),
  24. 'field' => array(
  25. 'handler' => 'views_handler_field_numeric',
  26. 'click sortable' => TRUE,
  27. ),
  28. 'filter' => array(
  29. 'handler' => 'views_handler_filter_numeric',
  30. 'allow empty' => TRUE,
  31. ),
  32. 'argument' => array(
  33. 'handler' => 'views_handler_argument_numeric',
  34. ),
  35. 'sort' => array(
  36. 'handler' => 'views_handler_sort',
  37. ),
  38. );
  39. $data['simplenews_mail_spool']['mail'] = array(
  40. 'title' => t('Subscriber'),
  41. 'help' => t('The formatted email address of mail message receipient.'),
  42. 'field' => array(
  43. 'handler' => 'views_handler_field',
  44. 'click sortable' => TRUE,
  45. ),
  46. 'filter' => array(
  47. 'handler' => 'views_handler_filter_string',
  48. 'allow empty' => TRUE,
  49. ),
  50. 'argument' => array(
  51. 'handler' => 'views_handler_argument_string',
  52. ),
  53. 'sort' => array(
  54. 'handler' => 'views_handler_sort',
  55. ),
  56. );
  57. $data['simplenews_mail_spool']['nid'] = array(
  58. 'title' => t('Node ID'),
  59. 'help' => t('The {node}.nid of this newsletter.'),
  60. 'field' => array(
  61. 'handler' => 'views_handler_field_numeric',
  62. 'click sortable' => TRUE,
  63. ),
  64. 'filter' => array(
  65. 'handler' => 'views_handler_filter_numeric',
  66. 'allow empty' => TRUE,
  67. ),
  68. 'argument' => array(
  69. 'handler' => 'views_handler_argument_numeric',
  70. ),
  71. 'sort' => array(
  72. 'handler' => 'views_handler_sort',
  73. ),
  74. 'relationship' => array(
  75. 'handler' => 'views_handler_relationship',
  76. 'base' => 'node',
  77. 'base field' => 'nid',
  78. 'label' => t('Node'),
  79. ),
  80. );
  81. $data['simplenews_mail_spool']['tid'] = array(
  82. 'title' => t('Term ID'),
  83. 'help' => t('The {term_data}.tid this newsletter issue belongs to.'),
  84. 'field' => array(
  85. 'handler' => 'views_handler_field_numeric',
  86. 'click sortable' => TRUE,
  87. ),
  88. 'filter' => array(
  89. 'handler' => 'views_handler_filter_numeric',
  90. 'allow empty' => TRUE,
  91. ),
  92. 'argument' => array(
  93. 'handler' => 'views_handler_argument_numeric',
  94. ),
  95. 'sort' => array(
  96. 'handler' => 'views_handler_sort',
  97. ),
  98. 'relationship' => array(
  99. 'handler' => 'views_handler_relationship',
  100. 'base' => 'taxonomy_term_data',
  101. 'base field' => 'tid',
  102. 'label' => t('Issue'),
  103. ),
  104. );
  105. $data['simplenews_mail_spool']['snid'] = array(
  106. 'title' => t('Subscriber ID'),
  107. 'help' => t('The {simplenews_subscriber}.snid foreign key for this spool'),
  108. 'field' => array(
  109. 'handler' => 'views_handler_field_numeric',
  110. 'click sortable' => TRUE,
  111. ),
  112. 'filter' => array(
  113. 'handler' => 'views_handler_filter_numeric',
  114. 'allow empty' => TRUE,
  115. ),
  116. 'argument' => array(
  117. 'handler' => 'views_handler_argument_numeric',
  118. ),
  119. 'sort' => array(
  120. 'handler' => 'views_handler_sort',
  121. ),
  122. 'relationship' => array(
  123. 'handler' => 'views_handler_relationship',
  124. 'base' => 'simplenews_subscriber',
  125. 'base field' => 'snid',
  126. 'label' => t('Subscriber'),
  127. ),
  128. );
  129. $data['simplenews_mail_spool']['status'] = array(
  130. 'title' => t('Sent status'),
  131. 'help' => t('The sent status of the email (0 = hold, 1 = pending, 2 = done).'),
  132. 'field' => array(
  133. 'handler' => 'simplenews_handler_field_newsletter_status',
  134. 'click sortable' => TRUE,
  135. ),
  136. 'filter' => array(
  137. 'handler' => 'simplenews_handler_filter_newsletter_status',
  138. 'allow empty' => TRUE,
  139. ),
  140. 'argument' => array(
  141. 'handler' => 'views_handler_argument_numeric',
  142. ),
  143. 'sort' => array(
  144. 'handler' => 'views_handler_sort',
  145. ),
  146. );
  147. $data['simplenews_mail_spool']['error'] = array(
  148. 'title' => t('Error'),
  149. 'help' => t('A boolean indicating whether an error occured while sending the email.'),
  150. 'field' => array(
  151. 'handler' => 'views_handler_field_boolean',
  152. 'click sortable' => TRUE,
  153. ),
  154. 'filter' => array(
  155. 'handler' => 'views_handler_filter_boolean_operator',
  156. 'allow empty' => TRUE,
  157. ),
  158. 'argument' => array(
  159. 'handler' => 'views_handler_argument_numeric',
  160. ),
  161. 'sort' => array(
  162. 'handler' => 'views_handler_sort',
  163. ),
  164. );
  165. $data['simplenews_mail_spool']['timestamp'] = array(
  166. 'title' => t('Timestamp'),
  167. 'help' => t('The time status was set or changed.'),
  168. 'field' => array(
  169. 'handler' => 'views_handler_field_date',
  170. 'click sortable' => TRUE,
  171. ),
  172. 'filter' => array(
  173. 'handler' => 'views_handler_filter_date',
  174. 'allow empty' => TRUE,
  175. ),
  176. 'argument' => array(
  177. 'handler' => 'views_handler_argument_date',
  178. ),
  179. 'sort' => array(
  180. 'handler' => 'views_handler_sort_date',
  181. ),
  182. );
  183. $data['simplenews_mail_spool']['data'] = array(
  184. 'title' => t('Data'),
  185. 'help' => t('A serialized array of name value pairs that are related to the email address.'),
  186. 'field' => array(
  187. 'handler' => 'views_handler_field',
  188. 'click sortable' => TRUE,
  189. ),
  190. 'filter' => array(
  191. 'handler' => 'views_handler_filter_string',
  192. 'allow empty' => TRUE,
  193. ),
  194. 'argument' => array(
  195. 'handler' => 'views_handler_argument_string',
  196. ),
  197. 'sort' => array(
  198. 'handler' => 'views_handler_sort',
  199. ),
  200. );
  201. /* ------------ Definitions for Simplenews issue ----------------------*/
  202. $data['simplenews_newsletter']['table'] = array(
  203. // Define the base group of this table. Fields that don't
  204. // have a group defined will go into this field by default.
  205. 'group' => t('Simplenews issue'),
  206. );
  207. // Joins
  208. $data['simplenews_newsletter']['table']['join'] = array(
  209. 'node' => array(
  210. 'left_field' => 'nid',
  211. 'field' => 'nid',
  212. ),
  213. 'taxonomy_term_data' => array(
  214. 'left_field' => 'tid',
  215. 'field' => 'tid',
  216. ),
  217. );
  218. $data['simplenews_newsletter']['tid'] = array(
  219. 'title' => t('Term ID'),
  220. 'help' => t('The {term_data}.tid (= newsletter series) this issue belongs to.'),
  221. 'field' => array(
  222. 'handler' => 'views_handler_field_numeric',
  223. 'click sortable' => TRUE,
  224. ),
  225. 'filter' => array(
  226. 'handler' => 'views_handler_filter_numeric',
  227. 'allow empty' => TRUE,
  228. ),
  229. 'argument' => array(
  230. 'handler' => 'views_handler_argument_numeric',
  231. ),
  232. 'sort' => array(
  233. 'handler' => 'views_handler_sort',
  234. ),
  235. 'relationship' => array(
  236. 'handler' => 'views_handler_relationship',
  237. 'base' => 'taxonomy_term_data',
  238. 'base field' => 'tid',
  239. 'label' => t('Newsletter'),
  240. ),
  241. );
  242. $data['simplenews_newsletter']['status'] = array(
  243. 'title' => t('Sent status'), // The item it appears as on the UI,
  244. 'help' => t('Newsletter sent status: 0: Not sent, 1: Pending (being sent or waiting for cron to run), 2: Sent.'), // The help that appears on the UI,
  245. 'field' => array(
  246. 'handler' => 'simplenews_handler_field_newsletter_status',
  247. 'click sortable' => TRUE,
  248. ),
  249. 'filter' => array(
  250. 'handler' => 'simplenews_handler_filter_newsletter_status',
  251. ),
  252. 'argument' => array(
  253. 'handler' => 'views_handler_argument_numeric',
  254. ),
  255. 'sort' => array(
  256. 'handler' => 'views_handler_sort',
  257. ),
  258. );
  259. $data['simplenews_newsletter']['sent_subscriber_count'] = array(
  260. 'title' => t('Subscriber count'),
  261. 'help' => t('The count of subscribers of the newsletter at the time it was sent.'),
  262. 'field' => array(
  263. 'handler' => 'views_handler_field_numeric',
  264. 'click sortable' => TRUE,
  265. ),
  266. 'filter' => array(
  267. 'handler' => 'views_handler_filter_numeric',
  268. 'allow empty' => TRUE,
  269. ),
  270. 'argument' => array(
  271. 'handler' => 'views_handler_argument_numeric',
  272. ),
  273. 'sort' => array(
  274. 'handler' => 'views_handler_sort',
  275. ),
  276. );
  277. $data['simplenews_newsletter']['send'] = array(
  278. 'field' => array(
  279. 'title' => t('Send newsletter'),
  280. 'help' => t('Provides a link to send the simplenews newsletter if not sent yet.'),
  281. 'handler' => 'simplenews_handler_field_newsletter_send',
  282. ),
  283. );
  284. /* ------------ Definitions for Simplenews subscriber ----------------------*/
  285. $data['simplenews_subscriber']['table'] = array(
  286. 'base' => array(
  287. 'field' => 'snid',
  288. 'title' => t('Simplenews subscriber'),
  289. 'help' => t('Contains subscribers of Simplenews Newsletters.'),
  290. 'weight' => 10,
  291. 'database' => 'default',
  292. ),
  293. 'group' => t('Simplenews subscriber'),
  294. );
  295. // Joins
  296. $data['simplenews_subscriber']['table']['join'] = array(
  297. 'users' => array(
  298. 'left_field' => 'uid',
  299. 'field' => 'uid',
  300. ),
  301. );
  302. $data['simplenews_subscriber']['snid'] = array(
  303. 'title' => t('Subscriber ID'),
  304. 'help' => t('Primary key: Unique subsciber ID.'),
  305. 'field' => array(
  306. 'handler' => 'views_handler_field_numeric',
  307. 'click sortable' => TRUE,
  308. ),
  309. 'filter' => array(
  310. 'handler' => 'views_handler_filter_numeric',
  311. 'allow empty' => TRUE,
  312. ),
  313. 'argument' => array(
  314. 'handler' => 'views_handler_argument_numeric',
  315. ),
  316. 'sort' => array(
  317. 'handler' => 'views_handler_sort',
  318. ),
  319. );
  320. $data['simplenews_subscriber']['activated'] = array(
  321. 'title' => t('Activated'),
  322. 'help' => t('Boolean indicating the status of the subscription.'),
  323. 'field' => array(
  324. 'handler' => 'views_handler_field_boolean',
  325. 'click sortable' => TRUE,
  326. ),
  327. 'filter' => array(
  328. 'handler' => 'views_handler_filter_boolean',
  329. 'allow empty' => TRUE,
  330. ),
  331. 'argument' => array(
  332. 'handler' => 'views_handler_argument_numeric',
  333. ),
  334. 'sort' => array(
  335. 'handler' => 'views_handler_sort',
  336. ),
  337. );
  338. $data['simplenews_subscriber']['mail'] = array(
  339. 'title' => t('Subscriber'),
  340. 'help' => t('The subscription email address.'),
  341. 'field' => array(
  342. 'handler' => 'views_handler_field',
  343. 'click sortable' => TRUE,
  344. ),
  345. 'filter' => array(
  346. 'handler' => 'views_handler_filter_string',
  347. 'allow empty' => TRUE,
  348. ),
  349. 'argument' => array(
  350. 'handler' => 'views_handler_argument_string',
  351. ),
  352. 'sort' => array(
  353. 'handler' => 'views_handler_sort',
  354. ),
  355. );
  356. $data['simplenews_subscriber']['uid'] = array(
  357. 'title' => t('User'),
  358. 'help' => t('The {users}.uid that has the same email address.'),
  359. 'field' => array(
  360. 'handler' => 'views_handler_field_numeric',
  361. 'click sortable' => TRUE,
  362. ),
  363. 'filter' => array(
  364. 'handler' => 'views_handler_filter_numeric',
  365. 'allow empty' => TRUE,
  366. ),
  367. 'argument' => array(
  368. 'handler' => 'views_handler_argument_numeric',
  369. ),
  370. 'sort' => array(
  371. 'handler' => 'views_handler_sort',
  372. ),
  373. 'relationship' => array(
  374. 'handler' => 'views_handler_relationship',
  375. 'base' => 'users',
  376. 'base field' => 'uid',
  377. 'label' => t('user'),
  378. ),
  379. );
  380. $data['simplenews_subscriber']['language'] = array(
  381. 'title' => t('Language'),
  382. 'help' => t('Anonymous subscriber preferred language. Empty for authenticated users.'),
  383. 'field' => array(
  384. 'handler' => 'views_handler_field',
  385. 'click sortable' => TRUE,
  386. ),
  387. 'filter' => array(
  388. 'handler' => 'views_handler_filter_string',
  389. 'allow empty' => TRUE,
  390. ),
  391. 'argument' => array(
  392. 'handler' => 'views_handler_argument_string',
  393. ),
  394. 'sort' => array(
  395. 'handler' => 'views_handler_sort',
  396. ),
  397. );
  398. $data['simplenews_subscriber']['timestamp'] = array(
  399. 'title' => t('Timestamp'),
  400. 'help' => t('UNIX timestamp of when the user first subscribed to a newsletter.'),
  401. 'field' => array(
  402. 'handler' => 'views_handler_field_date',
  403. 'click sortable' => TRUE,
  404. ),
  405. 'filter' => array(
  406. 'handler' => 'views_handler_filter_date',
  407. 'allow empty' => TRUE,
  408. ),
  409. 'argument' => array(
  410. 'handler' => 'views_handler_argument_date',
  411. ),
  412. 'sort' => array(
  413. 'handler' => 'views_handler_sort_date',
  414. ),
  415. );
  416. /* ------------ Definitions for Simplenews subscription ----------------------*/
  417. $data['simplenews_subscription']['table'] = array(
  418. 'base' => array(
  419. 'field' => 'snid',
  420. 'title' => t('Simplenews subscription'),
  421. 'help' => t('Contains all Subscriptions of every Simplenews Newsletters.'),
  422. 'weight' => 10,
  423. 'database' => 'default',
  424. ),
  425. 'group' => t('Simplenews subscription'),
  426. );
  427. $data['simplenews_subscription']['table']['join'] = array(
  428. 'taxonomy_term_data' => array(
  429. 'left_field' => 'tid',
  430. 'field' => 'tid',
  431. ),
  432. 'simplenews_subscriber' => array(
  433. 'left_field' => 'snid',
  434. 'field' => 'snid',
  435. ),
  436. );
  437. $data['simplenews_subscription']['snid'] = array(
  438. 'title' => t('Subscriber ID'),
  439. 'help' => t('The {simplenews_subscriptions}.snid who is subscribed.'),
  440. 'field' => array(
  441. 'label' => 'TEST',
  442. 'handler' => 'views_handler_field_numeric',
  443. 'click sortable' => TRUE,
  444. ),
  445. 'filter' => array(
  446. 'handler' => 'views_handler_filter_numeric',
  447. 'allow empty' => TRUE,
  448. ),
  449. 'argument' => array(
  450. 'handler' => 'views_handler_argument_numeric',
  451. ),
  452. 'sort' => array(
  453. 'handler' => 'views_handler_sort',
  454. ),
  455. 'relationship' => array(
  456. 'handler' => 'views_handler_relationship',
  457. 'base' => 'simplenews_subscriber',
  458. 'base field' => 'snid',
  459. 'label' => t('Subscriber'),
  460. ),
  461. );
  462. $data['simplenews_subscription']['tid'] = array(
  463. 'title' => t('Term ID'),
  464. 'help' => t('The newsletter series ({term_data}.tid) the subscriber is subscribed to.'),
  465. 'field' => array(
  466. 'handler' => 'views_handler_field_numeric',
  467. 'click sortable' => TRUE,
  468. ),
  469. 'filter' => array(
  470. 'handler' => 'views_handler_filter_numeric',
  471. 'allow empty' => TRUE,
  472. ),
  473. 'argument' => array(
  474. 'handler' => 'views_handler_argument_numeric',
  475. ),
  476. 'sort' => array(
  477. 'handler' => 'views_handler_sort',
  478. ),
  479. 'relationship' => array(
  480. 'handler' => 'views_handler_relationship',
  481. 'base' => 'taxonomy_term_data',
  482. 'base field' => 'tid',
  483. 'label' => t('Term (Newsletter series)'),
  484. ),
  485. );
  486. $data['simplenews_subscription']['status'] = array(
  487. 'title' => t('Status'),
  488. 'help' => t('A flag indicating whether the user is subscribed (1) or unsubscribed (0).'),
  489. 'field' => array(
  490. 'handler' => 'views_handler_field_boolean',
  491. 'click sortable' => TRUE,
  492. ),
  493. 'filter' => array(
  494. 'handler' => 'views_handler_filter_boolean_operator',
  495. 'allow empty' => TRUE,
  496. ),
  497. 'argument' => array(
  498. 'handler' => 'views_handler_argument_numeric',
  499. ),
  500. 'sort' => array(
  501. 'handler' => 'views_handler_sort',
  502. ),
  503. );
  504. $data['simplenews_subscription']['timestamp'] = array(
  505. 'title' => t('Timestamp'),
  506. 'help' => t('UNIX timestamp of when the user is (un)subscribed.'),
  507. 'field' => array(
  508. 'handler' => 'views_handler_field_date',
  509. 'click sortable' => TRUE,
  510. ),
  511. 'filter' => array(
  512. 'handler' => 'views_handler_filter_date',
  513. 'allow empty' => TRUE,
  514. ),
  515. 'argument' => array(
  516. 'handler' => 'views_handler_argument_date',
  517. ),
  518. 'sort' => array(
  519. 'handler' => 'views_handler_sort_date',
  520. ),
  521. );
  522. $data['simplenews_subscription']['source'] = array(
  523. 'title' => t('Source'),
  524. 'help' => t('The source via which the user is (un)subscribed.'),
  525. 'field' => array(
  526. 'handler' => 'views_handler_field',
  527. 'click sortable' => TRUE,
  528. ),
  529. 'filter' => array(
  530. 'handler' => 'views_handler_filter_string',
  531. 'allow empty' => TRUE,
  532. ),
  533. 'argument' => array(
  534. 'handler' => 'views_handler_argument_string',
  535. ),
  536. 'sort' => array(
  537. 'handler' => 'views_handler_sort',
  538. ),
  539. );
  540. /* ------------ Definitions for Simplenews category ----------------------*/
  541. // Define the base group of this table. Fields that don't
  542. // have a group defined will go into this field by default.
  543. $data['simplenews_category']['table'] = array(
  544. 'group' => t('Simplenews category'),
  545. );
  546. // Joins
  547. $data['simplenews_category']['table']['join'] = array(
  548. // Category links directly to taxonomy via tid.
  549. 'taxonomy_term_data' => array(
  550. 'left_field' => 'tid',
  551. 'field' => 'tid',
  552. ),
  553. );
  554. // Fields
  555. $data['simplenews_category']['tid'] = array(
  556. 'title' => t('Term ID'),
  557. 'help' => t('The newsletter series ({term_data}.tid) the subscriber is subscribed to.'),
  558. 'field' => array(
  559. 'handler' => 'views_handler_field_numeric',
  560. 'click sortable' => TRUE,
  561. ),
  562. 'filter' => array(
  563. 'handler' => 'views_handler_filter_numeric',
  564. 'allow empty' => TRUE,
  565. ),
  566. 'argument' => array(
  567. 'handler' => 'views_handler_argument_numeric',
  568. ),
  569. 'sort' => array(
  570. 'handler' => 'views_handler_sort',
  571. ),
  572. 'relationship' => array(
  573. 'handler' => 'views_handler_relationship',
  574. 'base' => 'taxonomy_term_data',
  575. 'base field' => 'tid',
  576. 'label' => t('Term (Newsletter series)'),
  577. ),
  578. );
  579. $data['simplenews_category']['format'] = array(
  580. 'title' => t('Format'),
  581. 'help' => t('Format of the newsletter (plain or html).'),
  582. 'field' => array(
  583. 'handler' => 'views_handler_field',
  584. 'click sortable' => TRUE,
  585. ),
  586. 'filter' => array(
  587. 'handler' => 'views_handler_filter_string',
  588. 'allow empty' => TRUE,
  589. ),
  590. 'argument' => array(
  591. 'handler' => 'views_handler_argument_string',
  592. ),
  593. 'sort' => array(
  594. 'handler' => 'views_handler_sort',
  595. ),
  596. );
  597. $data['simplenews_category']['priority'] = array(
  598. 'title' => t('Priority'),
  599. 'help' => t('Email priority according to RFC 2156 and RFC 5231 (0 = none; 1 = highest; 2 = high; 3 = normal; 4 = low; 5 = lowest).'),
  600. 'field' => array(
  601. 'handler' => 'simplenews_handler_field_newsletter_priority',
  602. 'click sortable' => TRUE,
  603. ),
  604. 'filter' => array(
  605. 'handler' => 'simplenews_handler_filter_newsletter_priority',
  606. 'allow empty' => TRUE,
  607. ),
  608. 'argument' => array(
  609. 'handler' => 'views_handler_argument_numeric',
  610. ),
  611. 'sort' => array(
  612. 'handler' => 'views_handler_sort',
  613. ),
  614. );
  615. $data['simplenews_newsletter']['receipt'] = array(
  616. 'title' => t('Receipt'),
  617. 'help' => t('Boolean indicating request for email receipt confirmation according to RFC 2822.'),
  618. 'field' => array(
  619. 'handler' => 'views_handler_field_boolean',
  620. 'click sortable' => TRUE,
  621. ),
  622. 'filter' => array(
  623. 'handler' => 'views_handler_filter_boolean_operator',
  624. 'allow empty' => TRUE,
  625. ),
  626. 'argument' => array(
  627. 'handler' => 'views_handler_argument_numeric',
  628. ),
  629. 'sort' => array(
  630. 'handler' => 'views_handler_sort',
  631. ),
  632. );
  633. $data['simplenews_category']['from_name'] = array(
  634. 'title' => t('From name'),
  635. 'help' => t('Sender name for newsletter emails.'),
  636. 'field' => array(
  637. 'handler' => 'views_handler_field',
  638. 'click sortable' => TRUE,
  639. ),
  640. 'filter' => array(
  641. 'handler' => 'views_handler_filter_string',
  642. ),
  643. 'argument' => array(
  644. 'handler' => 'views_handler_argument_string',
  645. ),
  646. 'sort' => array(
  647. 'handler' => 'views_handler_sort',
  648. ),
  649. );
  650. $data['simplenews_category']['email_subject'] = array(
  651. 'title' => t('Email Subject'),
  652. 'help' => t('Subject of newsletter email. May contain tokens.'),
  653. 'field' => array(
  654. 'handler' => 'views_handler_field',
  655. 'click sortable' => TRUE,
  656. ),
  657. 'filter' => array(
  658. 'handler' => 'views_handler_filter_string',
  659. ),
  660. 'argument' => array(
  661. 'handler' => 'views_handler_argument_string',
  662. ),
  663. 'sort' => array(
  664. 'handler' => 'views_handler_sort',
  665. ),
  666. );
  667. $data['simplenews_category']['from_address'] = array(
  668. 'title' => t('From address'),
  669. 'help' => t('Sender address for newsletter emails'),
  670. 'field' => array(
  671. 'handler' => 'views_handler_field',
  672. 'click_sortable' => TRUE,
  673. ),
  674. 'filter' => array(
  675. 'handler' => 'views_handler_filter_string'
  676. ),
  677. 'argument' => array(
  678. 'handler' => 'views_handler_argument_srting',
  679. ),
  680. 'sort' => array(
  681. 'handler' => 'views_handler_sort',
  682. ),
  683. );
  684. $data['simplenews_category']['hyperlinks'] = array(
  685. 'title' => t('Hyperlinks displaymode'),
  686. 'help' => t('Flag indicating type of hyperlink conversion (1 = hyperlinks are in-line; 0 = hyperlinks are placed at email bottom).'),
  687. 'field' => array(
  688. 'handler' => 'simplenews_handler_field_category_hyperlinks',
  689. 'click_sortable' => TRUE,
  690. ),
  691. 'filter' => array(
  692. 'handler' => 'simplenews_handler_filter_category_hyperlinks'
  693. ),
  694. 'argument' => array(
  695. 'handler' => 'views_handler_argument_numeric'
  696. ),
  697. 'sort' => array(
  698. 'handler' => 'views_handler_sort',
  699. ),
  700. );
  701. $data['simplenews_category']['new_account'] = array(
  702. 'title' => t('New account'),
  703. 'help' => t('How to treat subscription at account creation (none = None; on = Default on; off = Default off; silent = Invisible subscription).'),
  704. 'field' => array(
  705. 'handler' => 'simplenews_handler_field_category_new_account',
  706. 'click_sortable' => TRUE,
  707. ),
  708. 'filter' => array(
  709. 'handler' => 'simplenews_handler_filter_category_new_account'
  710. ),
  711. 'argument' => array(
  712. 'handler' => 'views_handler_argument_string',
  713. ),
  714. 'sort' => array(
  715. 'handler' => 'views_handler_sort',
  716. ),
  717. );
  718. $data['simplenews_category']['opt_inout'] = array(
  719. 'title' => t('Confirmation displaymode'),
  720. 'help' => t('How to treat subscription confirmation (hidden = Newsletter is hidden from the user; single = Single opt-in; double = Double opt-in).'),
  721. 'field' => array(
  722. 'handler' => 'simplenews_handler_field_category_opt_inout',
  723. 'click_sortable' => TRUE,
  724. ),
  725. 'filter' => array(
  726. 'handler' => 'simplenews_handler_filter_category_opt_inout'
  727. ),
  728. 'argument' => array(
  729. 'handler' => 'views_handler_argument_string',
  730. ),
  731. 'sort' => array(
  732. 'handler' => 'views_handler_sort',
  733. ),
  734. );
  735. $data['simplenews_category']['block'] = array(
  736. 'title' => t('Block'),
  737. 'help' => t('Indicates wether a subscription block is available for this category'),
  738. 'field' => array(
  739. 'handler' => 'views_handler_field_numeric',
  740. 'click_sortable' => TRUE,
  741. ),
  742. 'filter' => array(
  743. 'handler' => 'views_handler_filter_numeric',
  744. ),
  745. 'argument' => array(
  746. 'handler' => 'views_handler_argument_numeric',
  747. ),
  748. 'sort' => array(
  749. 'handler' => 'views_handler_sort',
  750. ),
  751. );
  752. return $data;
  753. }