/** * The singleton method. * * @return Muut_Admin_Settings The instance. * @author Paul Hughes * @since 3.0.1 */ public static function instance() { if (!is_a(self::$instance, __CLASS__)) { self::$instance = new self(); } return self::$instance; }
/** * Initializes the Admin Settings class. * * @return void * @author Paul Hughes * @since 3.0.1 */ public function initAdminSettings() { $class = 'Muut_Admin_Settings'; if (!in_array($class, $this->alreadyInit)) { require_once muut()->getPluginPath() . 'lib/admin/admin-settings.class.php'; if (class_exists($class)) { Muut_Admin_Settings::instance(); } $this->alreadyInit[] = $class; } }
<?php /** * The Muut settings page. * * @package Muut * @copyright 2014 Muut Inc */ add_thickbox(); $languages = muut()->getLanguages(); $current_language = muut()->getOption('language', 'en'); $error_queue = Muut_Admin_Settings::instance()->getErrorQueue(); $error_values = array(); foreach ($error_queue as $error) { $error_values[$error['name']] = $error['new_value']; } $current_values = array('forum_name' => muut()->getForumName(), 'replace_comments' => muut()->getOption('replace_comments', '1'), 'override_all_comments' => muut()->getOption('override_all_comments', '0'), 'enable_proxy_rewrites' => muut()->getOption('enable_proxy_rewrites', '1'), 'use_custom_s3_bucket' => muut()->getOption('use_custom_s3_bucket', '0'), 'custom_s3_bucket_name' => muut()->getOption('custom_s3_bucket_name', ''), 'subscription_use_signed_setup' => muut()->getOption('subscription_use_signed_setup', '0'), 'subscription_use_sso' => muut()->getOption('subscription_use_sso', '0'), 'subscription_api_key' => muut()->getOption('subscription_api_key', ''), 'subscription_secret_key' => muut()->getOption('subscription_secret_key', ''), 'website_uses_caching' => muut()->getOption('website_uses_caching', '0'), 'use_webhooks' => muut()->getOption('use_webhooks', ''), 'webhooks_secret' => muut()->getOption('webhooks_secret', '')); $display_values = wp_parse_args($error_values, $current_values); ?> <div class="wrap"> <h2><?php _e('Muut', 'muut'); ?> <span class="admin-subheader-to-right"><?php _e('Forums and commenting re-imagined.', 'muut'); ?> </span></h2> <form method="post" id="muut_settings_form"> <input type="hidden" name="muut_settings_save" value="true" /> <?php wp_nonce_field('muut_settings_save', 'muut_settings_nonce');