lapsing has-emoji"> 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3351 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3379 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3380 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3381 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3394 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3394_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3394_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3395 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3429 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3430 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3431 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3433 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3439 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3440 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3455 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3456 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3456_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3456_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3466 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3467 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3468 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3501 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3502 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3503 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3534 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3541 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3541_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3541_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3542 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3574 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3575 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3576 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3596 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3597 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3598 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3599 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3600 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3600_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3600_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3601 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3601_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3601_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3602 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3602_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3602_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3603 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3603_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3603_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3604 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3605 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3606 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3607 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3608 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3609 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3712 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3764 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3764_fsm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3764_vm 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3766 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3767 058f31828c first commit %!s(int64=2) %!d(string=před) roky 3997 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4143 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4144 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4145 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4146 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4147 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4148 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4149 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4150 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4151 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4152 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4153 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4154 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4155 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4156 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4157 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4158 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4159 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4160 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4161 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4162 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4163 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4164 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4165 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4166 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4167 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4168 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4169 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4170 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4171 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4172 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4173 058f31828c first commit %!s(int64=2) %!d(string=před) roky 4174 058f31828c first commit %!s(int64=2) %!d(string=před) roky 5002 058f31828c first commit %!s(int64=2) %!d(string=před) roky 548 058f31828c first commit %!s(int64=2) %!d(string=před) roky 549 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6102 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6104 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6106 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6110 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6111 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6112 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6113 058f31828c first commit %!s(int64=2) %!d(string=před) roky 6117 058f31828c first commit %!s(int64=2) %!d(string=před) roky 826 058f31828c first commit %!s(int64=2) %!d(string=před) roky 827 058f31828c first commit %!s(int64=2) %!d(string=před) roky 828 058f31828c first commit %!s(int64=2) %!d(string=před) roky PG_VERSION 058f31828c first commit %!s(int64=2) %!d(string=před) roky pg_filenode.map 058f31828c first commit %!s(int64=2) %!d(string=před) roky tum/whitesports - Gogs: Simplico Git Service

暂无描述

class-settings.php 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. class NextendSocialLoginSettings {
  3. protected $optionKey;
  4. protected $settings = array(
  5. 'default' => array(),
  6. 'stored' => array(),
  7. 'final' => array()
  8. );
  9. /**
  10. * NextendSocialLoginSettings constructor.
  11. *
  12. * @param $optionKey string
  13. * @param $defaultSettings array
  14. */
  15. public function __construct($optionKey, $defaultSettings) {
  16. $this->optionKey = $optionKey;
  17. $this->settings['default'] = $defaultSettings;
  18. $storedSettings = get_option($this->optionKey);
  19. if ($storedSettings !== false) {
  20. $storedSettings = (array)maybe_unserialize($storedSettings);
  21. } else {
  22. $storedSettings = array();
  23. }
  24. $this->settings['stored'] = array_merge($this->settings['default'], $storedSettings);
  25. $this->settings['final'] = apply_filters('nsl_finalize_settings_' . $optionKey, $this->settings['stored']);
  26. }
  27. public function get($key, $storage = 'final') {
  28. if (!isset($this->settings[$storage][$key])) {
  29. return false;
  30. }
  31. return $this->settings[$storage][$key];
  32. }
  33. public function set($key, $value) {
  34. $this->settings['stored'][$key] = $value;
  35. $this->storeSettings();
  36. }
  37. public function getAll($storage = 'final') {
  38. return $this->settings[$storage];
  39. }
  40. /**
  41. * @param array $postedData
  42. *
  43. * @return bool
  44. */
  45. public function update($postedData) {
  46. if (is_array($postedData)) {
  47. $newData = array();
  48. $newData = apply_filters('nsl_update_settings_validate_' . $this->optionKey, $newData, $postedData);
  49. if (count($newData)) {
  50. $isChanged = false;
  51. foreach ($newData AS $key => $value) {
  52. if ($this->settings['stored'][$key] != $value) {
  53. $this->settings['stored'][$key] = $value;
  54. $isChanged = true;
  55. }
  56. }
  57. if ($isChanged) {
  58. $allowedKeys = array_keys($this->settings['default']);
  59. $this->settings['stored'] = array_intersect_key($this->settings['stored'], array_flip($allowedKeys));
  60. $this->storeSettings();
  61. return true;
  62. }
  63. }
  64. }
  65. return false;
  66. }
  67. protected function storeSettings() {
  68. update_option($this->optionKey, maybe_serialize($this->settings['stored']));
  69. $this->settings['final'] = apply_filters('nsl_finalize_settings_' . $this->optionKey, $this->settings['stored']);
  70. }
  71. }