コード例 #1
0
 /**
  * Return an instance of this class.
  *
  * @return	object	A single instance of this class.
  *
  * @since 1.2
  * @version 1.3.1
  *
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
        /**
         * Get Font Family Control
         *
         * Gets the font family select control. Will only show
         * the fonts from the applicable subset if it has been
         * selected.
         *
         * @uses EGF_Font_Utilities::get_google_fonts() 	defined in includes\class-egf-font-utilities
         * @uses EGF_Font_Utilities::get_default_fonts() 	defined in includes\class-egf-font-utilities
         *
         * @since 1.2
         * @version 1.3.1
         *
         */
        public function get_font_family_control()
        {
            // Get defaults and current value
            $this_value = $this->value('font_id');
            $default_value = $this->default['font_id'];
            $current_value = empty($this_value) ? '' : $this_value;
            // Get all font families
            $all_fonts = PootlePage_Font_Utility::get_all_fonts();
            // Get control view
            ?>
			<label><?php 
            _e('Font Family', 'scratch');
            ?>
				<select class='sc-font-family-list' <?php 
            $this->link('font_id');
            ?>
 data-default-value="<?php 
            echo $default_value;
            ?>
" autocomplete="off">
					<option value="" <?php 
            selected($current_value, '');
            ?>
 ><?php 
            _e('&mdash; Default &mdash;', 'scratch');
            ?>
</option>

					<?php 
            if (function_exists('wf_get_system_fonts_test_cases')) {
                $test_cases = wf_get_system_fonts_test_cases();
            } else {
                $test_cases = array();
            }
            //Font Options for select
            echo output_font_select_options($all_fonts, $test_cases, $current_value);
            ?>
				</select>
			</label>
		<?php 
        }