admin-settings-icons.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <div id="fl-icons-form" class="fl-settings-form">
  2. <h3 class="fl-settings-form-header"><?php _e('Icon Settings', 'fl-builder'); ?></h3>
  3. <?php
  4. if ( FLBuilderAdminSettings::multisite_support() && ! is_network_admin() ) {
  5. global $blog_id;
  6. if ( BLOG_ID_CURRENT_SITE == $blog_id ) {
  7. ?>
  8. <p><?php _e( 'Icons for the main site must be managed in the network admin.', 'fl-builder' ); ?></p>
  9. </div>
  10. <?php
  11. return;
  12. }
  13. }
  14. ?>
  15. <form id="icons-form" action="<?php FLBuilderAdminSettings::render_form_action( 'icons' ); ?>" method="post">
  16. <?php if ( FLBuilderAdminSettings::multisite_support() && ! is_network_admin() ) : ?>
  17. <label>
  18. <input class="fl-override-ms-cb" type="checkbox" name="fl-override-ms" value="1" <?php if(get_option('_fl_builder_enabled_icons')) echo 'checked="checked"'; ?> />
  19. <?php _e('Override network settings?', 'fl-builder'); ?>
  20. </label>
  21. <?php endif; ?>
  22. <div class="fl-settings-form-content">
  23. <p><?php printf( __( 'Enable or disable icon sets using the options below or upload a custom icon set from either <a%s>Icomoon</a> or <a%s>Fontello</a>.', 'fl-builder' ), ' href="https://icomoon.io/" target="_blank"', ' href="http://fontello.com/" target="_blank"' ); ?></p>
  24. <?php
  25. $enabled_icons = FLBuilderModel::get_enabled_icons();
  26. $icon_sets = FLBuilderIcons::get_sets_for_current_site();
  27. foreach ( $icon_sets as $key => $set ) {
  28. $checked = in_array( $key, $enabled_icons ) ? ' checked' : '';
  29. ?>
  30. <p>
  31. <label>
  32. <input type="checkbox" name="fl-enabled-icons[]" value="<?php echo $key; ?>" <?php echo $checked; ?>>
  33. <?php echo ' ' . $set['name']; ?>
  34. <?php if ( 'core' != $set['type'] && strpos( $key, 'vamtam-' ) === false ) : ?>
  35. <a href="javascript:void(0);" class="fl-delete-icon-set" data-set="<?php echo $key; ?>"><?php _ex( 'Delete', 'Plugin setup page: Delete icon set.', 'fl-builder' ) ?></a>
  36. <?php endif; ?>
  37. </label>
  38. </p>
  39. <?php
  40. }
  41. ?>
  42. </div>
  43. <p class="submit">
  44. <input type="button" name="fl-upload-icon" class="button" value="<?php esc_attr_e( 'Upload Icon Set', 'fl-builder' ); ?>" />
  45. <input type="submit" name="fl-save-icons" class="button-primary" value="<?php esc_attr_e( 'Save Icon Settings', 'fl-builder' ); ?>" />
  46. <input type="hidden" name="fl-new-icon-set" value="" />
  47. <input type="hidden" name="fl-delete-icon-set" value="" />
  48. <?php wp_nonce_field('icons', 'fl-icons-nonce'); ?>
  49. </p>
  50. </form>
  51. </div>