simplenews.views.inc 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  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_operator',
  329. 'label' => t('Activated'),
  330. 'type' => 'yes-no',
  331. 'accept null' => TRUE,
  332. ),
  333. 'argument' => array(
  334. 'handler' => 'views_handler_argument_numeric',
  335. ),
  336. 'sort' => array(
  337. 'handler' => 'views_handler_sort',
  338. ),
  339. );
  340. $data['simplenews_subscriber']['mail'] = array(
  341. 'title' => t('Subscriber'),
  342. 'help' => t('The subscription email address.'),
  343. 'field' => array(
  344. 'handler' => 'views_handler_field',
  345. 'click sortable' => TRUE,
  346. ),
  347. 'filter' => array(
  348. 'handler' => 'views_handler_filter_string',
  349. 'allow empty' => TRUE,
  350. ),
  351. 'argument' => array(
  352. 'handler' => 'views_handler_argument_string',
  353. ),
  354. 'sort' => array(
  355. 'handler' => 'views_handler_sort',
  356. ),
  357. );
  358. $data['simplenews_subscriber']['uid'] = array(
  359. 'title' => t('User'),
  360. 'help' => t('The {users}.uid that has the same email address.'),
  361. 'field' => array(
  362. 'handler' => 'views_handler_field_numeric',
  363. 'click sortable' => TRUE,
  364. ),
  365. 'filter' => array(
  366. 'handler' => 'views_handler_filter_numeric',
  367. 'allow empty' => TRUE,
  368. ),
  369. 'argument' => array(
  370. 'handler' => 'views_handler_argument_numeric',
  371. ),
  372. 'sort' => array(
  373. 'handler' => 'views_handler_sort',
  374. ),
  375. 'relationship' => array(
  376. 'handler' => 'views_handler_relationship',
  377. 'base' => 'users',
  378. 'base field' => 'uid',
  379. 'label' => t('user'),
  380. ),
  381. );
  382. $data['simplenews_subscriber']['language'] = array(
  383. 'title' => t('Language'),
  384. 'help' => t('Anonymous subscriber preferred language. Empty for authenticated users.'),
  385. 'field' => array(
  386. 'handler' => 'views_handler_field',
  387. 'click sortable' => TRUE,
  388. ),
  389. 'filter' => array(
  390. 'handler' => 'views_handler_filter_string',
  391. 'allow empty' => TRUE,
  392. ),
  393. 'argument' => array(
  394. 'handler' => 'views_handler_argument_string',
  395. ),
  396. 'sort' => array(
  397. 'handler' => 'views_handler_sort',
  398. ),
  399. );
  400. $data['simplenews_subscriber']['timestamp'] = array(
  401. 'title' => t('Timestamp'),
  402. 'help' => t('UNIX timestamp of when the user first subscribed to a newsletter.'),
  403. 'field' => array(
  404. 'handler' => 'views_handler_field_date',
  405. 'click sortable' => TRUE,
  406. ),
  407. 'filter' => array(
  408. 'handler' => 'views_handler_filter_date',
  409. 'allow empty' => TRUE,
  410. ),
  411. 'argument' => array(
  412. 'handler' => 'views_handler_argument_date',
  413. ),
  414. 'sort' => array(
  415. 'handler' => 'views_handler_sort_date',
  416. ),
  417. );
  418. /* ------------ Definitions for Simplenews subscription ---------------------- */
  419. $data['simplenews_subscription']['table'] = array(
  420. 'base' => array(
  421. 'field' => 'snid',
  422. 'title' => t('Simplenews subscription'),
  423. 'help' => t('Contains all Subscriptions of every Simplenews Newsletters.'),
  424. 'weight' => 10,
  425. 'database' => 'default',
  426. ),
  427. 'group' => t('Simplenews subscription'),
  428. );
  429. $data['simplenews_subscription']['table']['join'] = array(
  430. 'taxonomy_term_data' => array(
  431. 'left_field' => 'tid',
  432. 'field' => 'tid',
  433. ),
  434. 'simplenews_subscriber' => array(
  435. 'left_field' => 'snid',
  436. 'field' => 'snid',
  437. ),
  438. );
  439. $data['simplenews_subscription']['snid'] = array(
  440. 'title' => t('Subscriber ID'),
  441. 'help' => t('The {simplenews_subscriptions}.snid who is subscribed.'),
  442. 'field' => array(
  443. 'label' => 'TEST',
  444. 'handler' => 'views_handler_field_numeric',
  445. 'click sortable' => TRUE,
  446. ),
  447. 'filter' => array(
  448. 'handler' => 'views_handler_filter_numeric',
  449. 'allow empty' => TRUE,
  450. ),
  451. 'argument' => array(
  452. 'handler' => 'views_handler_argument_numeric',
  453. ),
  454. 'sort' => array(
  455. 'handler' => 'views_handler_sort',
  456. ),
  457. 'relationship' => array(
  458. 'handler' => 'views_handler_relationship',
  459. 'base' => 'simplenews_subscriber',
  460. 'base field' => 'snid',
  461. 'label' => t('Subscriber'),
  462. ),
  463. );
  464. $data['simplenews_subscription']['tid'] = array(
  465. 'title' => t('Term ID'),
  466. 'help' => t('The newsletter series ({term_data}.tid) the subscriber is subscribed to.'),
  467. 'field' => array(
  468. 'handler' => 'views_handler_field_numeric',
  469. 'click sortable' => TRUE,
  470. ),
  471. 'filter' => array(
  472. 'handler' => 'views_handler_filter_numeric',
  473. 'allow empty' => TRUE,
  474. ),
  475. 'argument' => array(
  476. 'handler' => 'views_handler_argument_numeric',
  477. ),
  478. 'sort' => array(
  479. 'handler' => 'views_handler_sort',
  480. ),
  481. 'relationship' => array(
  482. 'handler' => 'views_handler_relationship',
  483. 'base' => 'taxonomy_term_data',
  484. 'base field' => 'tid',
  485. 'label' => t('Term (Newsletter series)'),
  486. ),
  487. );
  488. $data['simplenews_subscription']['status'] = array(
  489. 'title' => t('Status'),
  490. 'help' => t('A flag indicating whether the user is subscribed (1) or unsubscribed (0).'),
  491. 'field' => array(
  492. 'handler' => 'views_handler_field_boolean',
  493. 'click sortable' => TRUE,
  494. ),
  495. 'filter' => array(
  496. 'handler' => 'views_handler_filter_boolean_operator',
  497. 'allow empty' => TRUE,
  498. ),
  499. 'argument' => array(
  500. 'handler' => 'views_handler_argument_numeric',
  501. ),
  502. 'sort' => array(
  503. 'handler' => 'views_handler_sort',
  504. ),
  505. );
  506. $data['simplenews_subscription']['timestamp'] = array(
  507. 'title' => t('Timestamp'),
  508. 'help' => t('UNIX timestamp of when the user is (un)subscribed.'),
  509. 'field' => array(
  510. 'handler' => 'views_handler_field_date',
  511. 'click sortable' => TRUE,
  512. ),
  513. 'filter' => array(
  514. 'handler' => 'views_handler_filter_date',
  515. 'allow empty' => TRUE,
  516. ),
  517. 'argument' => array(
  518. 'handler' => 'views_handler_argument_date',
  519. ),
  520. 'sort' => array(
  521. 'handler' => 'views_handler_sort_date',
  522. ),
  523. );
  524. $data['simplenews_subscription']['source'] = array(
  525. 'title' => t('Source'),
  526. 'help' => t('The source via which the user is (un)subscribed.'),
  527. 'field' => array(
  528. 'handler' => 'views_handler_field',
  529. 'click sortable' => TRUE,
  530. ),
  531. 'filter' => array(
  532. 'handler' => 'views_handler_filter_string',
  533. 'allow empty' => TRUE,
  534. ),
  535. 'argument' => array(
  536. 'handler' => 'views_handler_argument_string',
  537. ),
  538. 'sort' => array(
  539. 'handler' => 'views_handler_sort',
  540. ),
  541. );
  542. /* ------------ Definitions for Simplenews category ---------------------- */
  543. // Define the base group of this table. Fields that don't
  544. // have a group defined will go into this field by default.
  545. $data['simplenews_category']['table'] = array(
  546. 'group' => t('Simplenews category'),
  547. );
  548. // Joins
  549. $data['simplenews_category']['table']['join'] = array(
  550. // Category links directly to taxonomy via tid.
  551. 'taxonomy_term_data' => array(
  552. 'left_field' => 'tid',
  553. 'field' => 'tid',
  554. ),
  555. );
  556. // Fields
  557. $data['simplenews_category']['tid'] = array(
  558. 'title' => t('Term ID'),
  559. 'help' => t('The newsletter series ({term_data}.tid) the subscriber is subscribed to.'),
  560. 'field' => array(
  561. 'handler' => 'views_handler_field_numeric',
  562. 'click sortable' => TRUE,
  563. ),
  564. 'filter' => array(
  565. 'handler' => 'views_handler_filter_numeric',
  566. 'allow empty' => TRUE,
  567. ),
  568. 'argument' => array(
  569. 'handler' => 'views_handler_argument_numeric',
  570. ),
  571. 'sort' => array(
  572. 'handler' => 'views_handler_sort',
  573. ),
  574. 'relationship' => array(
  575. 'handler' => 'views_handler_relationship',
  576. 'base' => 'taxonomy_term_data',
  577. 'base field' => 'tid',
  578. 'label' => t('Term (Newsletter series)'),
  579. ),
  580. );
  581. $data['simplenews_category']['format'] = array(
  582. 'title' => t('Format'),
  583. 'help' => t('Format of the newsletter (plain or html).'),
  584. 'field' => array(
  585. 'handler' => 'views_handler_field',
  586. 'click sortable' => TRUE,
  587. ),
  588. 'filter' => array(
  589. 'handler' => 'views_handler_filter_string',
  590. 'allow empty' => TRUE,
  591. ),
  592. 'argument' => array(
  593. 'handler' => 'views_handler_argument_string',
  594. ),
  595. 'sort' => array(
  596. 'handler' => 'views_handler_sort',
  597. ),
  598. );
  599. $data['simplenews_category']['priority'] = array(
  600. 'title' => t('Priority'),
  601. 'help' => t('Email priority according to RFC 2156 and RFC 5231 (0 = none; 1 = highest; 2 = high; 3 = normal; 4 = low; 5 = lowest).'),
  602. 'field' => array(
  603. 'handler' => 'simplenews_handler_field_newsletter_priority',
  604. 'click sortable' => TRUE,
  605. ),
  606. 'filter' => array(
  607. 'handler' => 'simplenews_handler_filter_newsletter_priority',
  608. 'allow empty' => TRUE,
  609. ),
  610. 'argument' => array(
  611. 'handler' => 'views_handler_argument_numeric',
  612. ),
  613. 'sort' => array(
  614. 'handler' => 'views_handler_sort',
  615. ),
  616. );
  617. $data['simplenews_newsletter']['receipt'] = array(
  618. 'title' => t('Receipt'),
  619. 'help' => t('Boolean indicating request for email receipt confirmation according to RFC 2822.'),
  620. 'field' => array(
  621. 'handler' => 'views_handler_field_boolean',
  622. 'click sortable' => TRUE,
  623. ),
  624. 'filter' => array(
  625. 'handler' => 'views_handler_filter_boolean_operator',
  626. 'allow empty' => TRUE,
  627. ),
  628. 'argument' => array(
  629. 'handler' => 'views_handler_argument_numeric',
  630. ),
  631. 'sort' => array(
  632. 'handler' => 'views_handler_sort',
  633. ),
  634. );
  635. $data['simplenews_category']['from_name'] = array(
  636. 'title' => t('From name'),
  637. 'help' => t('Sender name for newsletter emails.'),
  638. 'field' => array(
  639. 'handler' => 'views_handler_field',
  640. 'click sortable' => TRUE,
  641. ),
  642. 'filter' => array(
  643. 'handler' => 'views_handler_filter_string',
  644. ),
  645. 'argument' => array(
  646. 'handler' => 'views_handler_argument_string',
  647. ),
  648. 'sort' => array(
  649. 'handler' => 'views_handler_sort',
  650. ),
  651. );
  652. $data['simplenews_category']['email_subject'] = array(
  653. 'title' => t('Email Subject'),
  654. 'help' => t('Subject of newsletter email. May contain tokens.'),
  655. 'field' => array(
  656. 'handler' => 'views_handler_field',
  657. 'click sortable' => TRUE,
  658. ),
  659. 'filter' => array(
  660. 'handler' => 'views_handler_filter_string',
  661. ),
  662. 'argument' => array(
  663. 'handler' => 'views_handler_argument_string',
  664. ),
  665. 'sort' => array(
  666. 'handler' => 'views_handler_sort',
  667. ),
  668. );
  669. $data['simplenews_category']['from_address'] = array(
  670. 'title' => t('From address'),
  671. 'help' => t('Sender address for newsletter emails'),
  672. 'field' => array(
  673. 'handler' => 'views_handler_field',
  674. 'click_sortable' => TRUE,
  675. ),
  676. 'filter' => array(
  677. 'handler' => 'views_handler_filter_string'
  678. ),
  679. 'argument' => array(
  680. 'handler' => 'views_handler_argument_srting',
  681. ),
  682. 'sort' => array(
  683. 'handler' => 'views_handler_sort',
  684. ),
  685. );
  686. $data['simplenews_category']['hyperlinks'] = array(
  687. 'title' => t('Hyperlinks displaymode'),
  688. 'help' => t('Flag indicating type of hyperlink conversion (1 = hyperlinks are in-line; 0 = hyperlinks are placed at email bottom).'),
  689. 'field' => array(
  690. 'handler' => 'simplenews_handler_field_category_hyperlinks',
  691. 'click_sortable' => TRUE,
  692. ),
  693. 'filter' => array(
  694. 'handler' => 'simplenews_handler_filter_category_hyperlinks'
  695. ),
  696. 'argument' => array(
  697. 'handler' => 'views_handler_argument_numeric'
  698. ),
  699. 'sort' => array(
  700. 'handler' => 'views_handler_sort',
  701. ),
  702. );
  703. $data['simplenews_category']['new_account'] = array(
  704. 'title' => t('New account'),
  705. 'help' => t('How to treat subscription at account creation (none = None; on = Default on; off = Default off; silent = Invisible subscription).'),
  706. 'field' => array(
  707. 'handler' => 'simplenews_handler_field_category_new_account',
  708. 'click_sortable' => TRUE,
  709. ),
  710. 'filter' => array(
  711. 'handler' => 'simplenews_handler_filter_category_new_account'
  712. ),
  713. 'argument' => array(
  714. 'handler' => 'views_handler_argument_string',
  715. ),
  716. 'sort' => array(
  717. 'handler' => 'views_handler_sort',
  718. ),
  719. );
  720. $data['simplenews_category']['opt_inout'] = array(
  721. 'title' => t('Confirmation displaymode'),
  722. 'help' => t('How to treat subscription confirmation (hidden = Newsletter is hidden from the user; single = Single opt-in; double = Double opt-in).'),
  723. 'field' => array(
  724. 'handler' => 'simplenews_handler_field_category_opt_inout',
  725. 'click_sortable' => TRUE,
  726. ),
  727. 'filter' => array(
  728. 'handler' => 'simplenews_handler_filter_category_opt_inout'
  729. ),
  730. 'argument' => array(
  731. 'handler' => 'views_handler_argument_string',
  732. ),
  733. 'sort' => array(
  734. 'handler' => 'views_handler_sort',
  735. ),
  736. );
  737. $data['simplenews_category']['block'] = array(
  738. 'title' => t('Block'),
  739. 'help' => t('Indicates wether a subscription block is available for this category'),
  740. 'field' => array(
  741. 'handler' => 'views_handler_field_numeric',
  742. 'click_sortable' => TRUE,
  743. ),
  744. 'filter' => array(
  745. 'handler' => 'views_handler_filter_numeric',
  746. ),
  747. 'argument' => array(
  748. 'handler' => 'views_handler_argument_numeric',
  749. ),
  750. 'sort' => array(
  751. 'handler' => 'views_handler_sort',
  752. ),
  753. );
  754. return $data;
  755. }