Old_school_prefs.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. * @category UI
  20. * @package GNUsocial
  21. * @author Evan Prodromou <evan@status.net>
  22. * @copyright 2011 StatusNet, Inc.
  23. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  24. */
  25. defined('GNUSOCIAL') || die();
  26. /**
  27. * Separate table for storing UI preferences
  28. *
  29. * @copyright 2011 StatusNet, Inc.
  30. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
  31. */
  32. class Old_school_prefs extends Managed_DataObject
  33. {
  34. public $__table = 'old_school_prefs'; // table name
  35. public $user_id;
  36. public $stream_mode_only;
  37. public $conversation_tree;
  38. public $stream_nicknames;
  39. public $created;
  40. public $modified;
  41. public static function schemaDef()
  42. {
  43. return array(
  44. 'fields' => array(
  45. 'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user who has the preference'),
  46. 'stream_mode_only' => array('type' => 'bool',
  47. 'default' => true,
  48. 'description' => 'No conversation streams'),
  49. 'conversation_tree' => array('type' => 'bool',
  50. 'default' => true,
  51. 'description' => 'Hierarchical tree view for conversations'),
  52. 'stream_nicknames' => array('type' => 'bool',
  53. 'default' => true,
  54. 'description' => 'Show nicknames for authors and addressees in streams'),
  55. 'created' => array('type' => 'datetime', 'description' => 'date this record was created'),
  56. 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
  57. ),
  58. 'primary key' => array('user_id'),
  59. 'foreign keys' => array(
  60. 'old_school_prefs_user_id_fkey' => array('user', array('user_id' => 'id')),
  61. ),
  62. );
  63. }
  64. }