| 1 |
<?php |
| 2 |
namespace MBSocial; |
| 3 |
|
| 4 |
use \MaxButtons\maxField as maxField; |
| 5 |
use \MaxButtons\maxBlocks as maxBlocks; |
| 6 |
|
| 7 |
$networks = MBSocial()->networks()->get(); |
| 8 |
|
| 9 |
|
| 10 |
$network_array = array(); |
| 11 |
$networkBlock = collections::getBlock('networkBlock'); |
| 12 |
|
| 13 |
foreach($networks as $network) |
| 14 |
{ |
| 15 |
$name = $network->get('network'); |
| 16 |
$native = $network->get('is_native'); |
| 17 |
|
| 18 |
if (! $network->get('is_editable')) |
| 19 |
{ |
| 20 |
continue; |
| 21 |
} |
| 22 |
|
| 23 |
$label = $network->get_nice_name(); |
| 24 |
$icon_args = array( |
| 25 |
'icon' => $network->get('icon'), |
| 26 |
'icon_type' => $network->get('icon_type'), |
| 27 |
); |
| 28 |
if ($icon_args['icon_type'] == 'image') |
| 29 |
{ |
| 30 |
$icon_args['image_id'] = $network->get('icon_image_id'); |
| 31 |
$icon_args['image_size'] = $network->get('icon_image_size'); |
| 32 |
$icon_args['image_url'] = $network->get('icon_image_url'); |
| 33 |
} |
| 34 |
|
| 35 |
$icon = MBSocial()->admin()->renderIcon($icon_args); //$networkBlock->renderIcon($network); |
| 36 |
|
| 37 |
$network_array[$name] = array( |
| 38 |
'label' => $label, |
| 39 |
'icon' => $icon, |
| 40 |
); |
| 41 |
|
| 42 |
} |
| 43 |
|
| 44 |
ksort($network_array); |
| 45 |
|
| 46 |
?> |
| 47 |
|
| 48 |
<div class='network_selection'> |
| 49 |
<a href='#add' class='add-custom-network button mb-ajax-action' data-action='show-customnetworks'><?php _e('Add Other Networks', 'mbsocial'); ?></a> |
| 50 |
|
| 51 |
<ul> |
| 52 |
<?php foreach ($network_array as $name => $item): |
| 53 |
|
| 54 |
?> |
| 55 |
|
| 56 |
<li class='mb-ajax-action' data-action='network-settings' data-param='<?php echo $name ?>'> |
| 57 |
<?php echo $item['icon'] ?> <span class='label'><?php echo $item['label']; ?></span> |
| 58 |
|
| 59 |
</li> |
| 60 |
|
| 61 |
<?php endforeach; ?> |
| 62 |
</ul> |
| 63 |
|
| 64 |
</div> |
| 65 |
|
| 66 |
<form method="POST" class="mb-ajax-form" data-action="network-save"> |
| 67 |
<div class='network_editor option-container'> |
| 68 |
<div class='title'><?php _e("Settings", 'mbsocial'); ?> </div> |
| 69 |
<div class='inside'> |
| 70 |
|
| 71 |
<h4><?php _e("Welcome to the Network Editor!", 'mbsocial'); ?></h4> |
| 72 |
<p>You can change default Network Options using the selection on the left hand</p> |
| 73 |
<p>You can select additional networks with the 'add other networks' button</p> |
| 74 |
|
| 75 |
</div> |
| 76 |
|
| 77 |
</div> |
| 78 |
</form> |
| 79 |
|