Exemplo n.º 1
0
 public final function _option_page_scripts($hook)
 {
     global $wp_version;
     // options CSS. May be required by other stylesheets
     wp_register_style('icit-options', icit_core::instance()->url . 'css/options.css');
     if ($hook !== $this->option_page_settings['hook']) {
         return;
     }
     // metabox handling
     wp_enqueue_script('post');
     wp_enqueue_style('postbox');
     // admin page CSS
     wp_enqueue_style('icit-options');
 }
Exemplo n.º 2
0
        /**
         * Outputs a branded theme meta box on an options page
         *
         * @return string 	HTML metabox output
         */
        public function get_theme_meta_box()
        {
            global $icit_core;
            $icit_core = icit_core::instance();
            // This is quite heavy so we want it in a plce where it only runs once and only when needed.
            if (!isset($this->_theme)) {
                $this->_theme = wp_get_theme();
            }
            $theme_data = '
				<div class="postbox icit-branding">
					<div class="icit-logo">interconnect<span>/</span><strong>it</strong></div>
					<div class="icit-info">
						<h3>' . $this->_theme->get('Name') . '</h3>
						<div class="icit-version">v<strong>' . $this->_theme->get('Version') . '</strong></div>
						<p class="icit-description">' . $this->_theme->get('Description') . '</p>
						<div class="icit-url"><a href="' . $this->_theme->get('ThemeURI') . '">' . __('Visit theme home page', self::DOM) . '</a></div>
						<div class="icit-credit">by <a href="' . $this->_theme->get('AuthorURI') . '">' . $this->_theme->get('Author') . '</a></div>';
            if (is_super_admin()) {
                $theme_data .= '
					<div class="core-location">v' . $icit_core::VERSION . ':<a href="' . esc_attr($icit_core->url) . '">' . __('Core files', self::DOM) . '</a></div>';
            }
            $theme_data .= '
					</div>
				</div>';
            return $theme_data;
        }
Exemplo n.º 3
0
        /**
         * Generic colour picker for use with the settings api calls
         *
         * @param array $args An array of parameters used within this method.
         * 			field:: The name and id of the option
         * 			description:: Message shown next to the field
         * 			default:: Default colour hex value
         * 			palettes:: Whether to show common palettes on the wp3.5 picker
         * 			hide:: Whether to show the colour picker by default or wait for a click
         *
         * @return null
         */
        public static function field_colour($args = array())
        {
            global $wp_version;
            $defaults = array('name' => 'colour', 'description' => '', 'palettes' => true, 'hide' => true, 'default' => '#ffffff');
            $r = wp_parse_args($args, $defaults);
            extract($r, EXTR_SKIP);
            // Get the value from the db
            $option_args['default'] = !empty($default) ? $default : null;
            $value = isset($value) ? $value : self::get_current_value($name, $option_args);
            $data = '';
            $data .= ' data-default="' . $default . '"';
            $data .= ' data-palettes="' . ($palettes ? 1 : 0) . '"';
            $data .= ' data-hide="' . ($hide ? 1 : 0) . '"';
            ?>
			<input class="color-picker" name="<?php 
            echo esc_attr($name);
            ?>
" id="<?php 
            esc_attr_e(self::the_id($name));
            ?>
" type="text" value="<?php 
            echo esc_attr($value);
            ?>
" <?php 
            echo $data;
            ?>
 /><?php 
            if (!empty($description)) {
                echo ' <span class="description">' . $description . '</span>';
            }
            if (version_compare($wp_version, '3.5', '<')) {
                // Antiquated colour picker
                wp_enqueue_script('icitcolourselect', icit_core::instance()->url . '/js/colour.old.js', array('jquery', 'farbtastic'), 1, true);
                wp_enqueue_style('farbtastic');
            } else {
                wp_enqueue_script('icitcolourselect', icit_core::instance()->url . '/js/colour.js', array('jquery', 'wp-color-picker'), 1, true);
                wp_enqueue_style('wp-color-picker');
            }
        }
Exemplo n.º 4
0
 /**
  * Create and/or return an instance of this object.
  *
  * @return icit_core The singleton instance of icit_crosspromote
  */
 public static function instance($args = array())
 {
     null === self::$instance && (self::$instance = new self($args));
     return self::$instance;
 }
Exemplo n.º 5
0
 Plugin URI: http://interconnectit.com
 Description: Quizzlestick wrapper plugin to make creating quizzes within WordPress easy
 Version: 1.0.1
 Author: interconnect/it
 Author URI: http://interconnectit.com
*/
if (!defined('QUIZZLESTICK_DIR')) {
    define('QUIZZLESTICK_DIR', dirname(__FILE__));
}
if (!defined('QUIZZLESTICK_URL')) {
    define('QUIZZLESTICK_URL', plugins_url('', __FILE__));
}
// Load ICIT core
require_once 'core/core.php';
// Make sure core knows where core is.
icit_core::instance()->set_core_url(QUIZZLESTICK_URL . '/core/');
if (!class_exists('quizzlestick') && class_exists('icit_plugin')) {
    add_action('plugins_loaded', array('quizzlestick', 'instance'));
    class quizzlestick extends icit_plugin
    {
        const DOM = __CLASS__;
        const FILE = __FILE__;
        /**
         * @var string Post type for quizzes
         */
        public $post_type = 'quiz';
        /**
         * @var bool
         */
        public $doing_excerpt = false;
        /**