Old_school_prefs.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. // This file is part of GNU social - https://www.gnu.org/software/social
  3. //
  4. // GNU social is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Affero General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // GNU social is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Affero General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Affero General Public License
  15. // along with GNU social. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * Older-style UI preferences
  18. *
  19. * PHP version 5
  20. *
  21. * This program is free software: you can redistribute it and/or modify
  22. * it under the terms of the GNU Affero General Public License as published by
  23. * the Free Software Foundation, either version 3 of the License, or
  24. * (at your option) any later version.
  25. *
  26. * This program is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU Affero General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU Affero General Public License
  32. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  33. *
  34. * @category UI
  35. * @package GNUsocial
  36. * @author Evan Prodromou <evan@status.net>
  37. * @copyright 2011 StatusNet, Inc.
  38. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  39. */
  40. defined('GNUSOCIAL') || die();
  41. /**
  42. * Separate table for storing UI preferences
  43. *
  44. * @copyright 2011 StatusNet, Inc.
  45. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  46. */
  47. class Old_school_prefs extends Managed_DataObject
  48. {
  49. public $__table = 'old_school_prefs'; // table name
  50. public $user_id;
  51. public $stream_mode_only;
  52. public $conversation_tree;
  53. public $stream_nicknames;
  54. public $created;
  55. public $modified;
  56. public static function schemaDef()
  57. {
  58. return array(
  59. 'fields' => array(
  60. 'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user who has the preference'),
  61. 'stream_mode_only' => array('type' => 'int',
  62. 'size' => 'tiny',
  63. 'default' => 1,
  64. 'description' => 'No conversation streams'),
  65. 'conversation_tree' => array('type' => 'int',
  66. 'size' => 'tiny',
  67. 'default' => 1,
  68. 'description' => 'Hierarchical tree view for conversations'),
  69. 'stream_nicknames' => array('type' => 'int',
  70. 'size' => 'tiny',
  71. 'default' => 1,
  72. 'description' => 'Show nicknames for authors and addressees in streams'),
  73. 'created' => array('type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'),
  74. 'modified' => array('type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'),
  75. ),
  76. 'primary key' => array('user_id'),
  77. 'foreign keys' => array(
  78. 'old_school_prefs_user_id_fkey' => array('user', array('user_id' => 'id')),
  79. ),
  80. );
  81. }
  82. }