PluginProbe
Social Share Buttons / 1.6
Social Share Buttons v1.6
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
share-button / classes / network / custom.php

custom.php in Social Share Buttons 1.6, at classes/network/custom.php

61 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MBSocial;
3
4 class customNetwork extends mbNetwork
5 {
6
7 protected $priority = 'readmore';
8 protected $is_native = false;
9
10
11 /** Function to set default for custom networks to the data that was imported from remote.
12 *
13 * Start state of custom network is all these defaults, but no save on the main settings branch
14 */
15 public function get_all_defaults()
16 {
17 $network = MBSocial()->networks()->getNetworkSettings();
18 //var_dump($network); var_dump($this->network);
19 if (isset($network['custom'][$this->network]))
20 {
21
22 $settings = $network['custom'][$this->network];
23
24 $all_options = $this->get_all_options();
25 // echo "<PRE>"; print_R($settings); print_r($all_options);
26 foreach($all_options as $option => $value)
27 {
28 if (isset($settings[$option]))
29 {
30 $all_options[$option] = $settings[$option];
31 }
32 }
33 }
34 return $all_options;
35 }
36
37 public function load_settings($settings)
38 {
39 parent::load_settings($settings);
40
41 if (isset($settings['name']))
42 {
43 $this->network = $settings['name'];
44 }
45
46 /* foreach($fields as $name => $value)
47 {
48 if ($name == 'name')
49 $name = 'network';
50 if ($name == 'popup')
51 $name = 'is_popup';
52
53 echo " $name - $value <BR>";
54
55 if ($value && strlen($value) > 0)
56 $this->{$name} = $value;
57 }
58 */
59 }
60 }
61