Esempio n. 1
0
/**
 * Initialize a control panel instance
 *
 * @package Infinity
 * @subpackage dashboard
 * @return ICE_Ui_Cpanel
 */
function infinity_dashboard_cpanel_factory()
{
    ICE_Loader::load('ui/cpanel');
    // new control panel instance using screens policy
    $cpanel = new ICE_Ui_Cpanel(Infinity_Screens_Policy::instance());
    return $cpanel;
}
Esempio n. 2
0
 /**
  * Load all themes information into local properties
  * 
  * @todo only list themes which implement the scheme
  */
 protected function load_theme_data()
 {
     ICE_Loader::load_wpadmin_lib('ms');
     ICE_Loader::load_wpadmin_lib('theme');
     // get current theme
     $ct = current_theme_info();
     // get all themes
     $this->__wp_themes__ = get_allowed_themes();
     // extract current theme
     $this->__wp_theme__ = $this->__wp_themes__[$ct->name];
 }
Esempio n. 3
0
/**
 * Theme update notification/nag helper
 */
function infinity_dashboard_update_nag($args)
{
    // get stylesheet name
    $stylesheet = get_stylesheet();
    // default settings
    $defaults = array('package_file' => null, 'package_id' => $stylesheet, 'theme_slug' => $stylesheet, 'theme_name' => ucfirst($stylesheet));
    // merge args and defaults
    $settings = wp_parse_args($args, $defaults);
    // load notifier class
    ICE_Loader::load('parsers/packages');
    // new packages instance
    $packages = new ICE_Packages($settings['package_file']);
    // check if update needed
    $update = $packages->theme_needs_update($settings['theme_slug'], $settings['package_id']);
    // spit out nag message if update needed
    if ($update) {
        // render markup
        ?>
		<div class="update-nag">
			There is a new version of the <?php 
        echo $settings['theme_name'];
        ?>
 theme available.
			<?php 
        if (current_user_can('update_themes')) {
            ?>
				Please <a href="<?php 
            echo $update->download;
            ?>
">download</a> it now!
			<?php 
        } else {
            ?>
				Please notify the site administrator!
			<?php 
        }
        ?>
		</div><?php 
    }
}
Esempio n. 4
0
 /**
  * Parse and return formatted contents of page file
  *
  * @return string Valid HTML markup
  */
 public function parse()
 {
     // grab entire contents of file
     $contents = file_get_contents($this->page_file);
     // call pre parse filter if exists
     if ($this->pre_parse_callback) {
         $contents = call_user_func($this->pre_parse_callback, $contents);
     }
     // parse content based on markup format
     switch ($this->page_markup) {
         // HTML
         case self::MARKUP_HTML:
             break;
             // Markdown
         // Markdown
         case self::MARKUP_MARKDOWN:
         case self::MARKUP_MARKDOWN_LONG:
             ICE_Loader::load('parsers/markdown');
             $contents = ICE_Markdown::parse($contents);
             break;
             // Textile
         // Textile
         case self::MARKUP_TEXTILE:
         case self::MARKUP_TEXTILE_LONG:
             ICE_Loader::load('parsers/textile');
             $contents = ICE_Textile::parse($contents);
             break;
             // Invalid
         // Invalid
         default:
             throw new Exception(sprintf('The markup format "%s" is not valid', $this->page_markup));
     }
     // call post parse filter if exists
     if ($this->post_parse_callback) {
         $contents = call_user_func($this->post_parse_callback, $contents);
     }
     return $contents;
 }
Esempio n. 5
0
<?php

/**
 * Infinity Theme: option extensions, CSS overlay image class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package Infinity-extensions
 * @subpackage options
 * @since 1.0
 */
ICE_Loader::load_ext('options/ui/overlay-picker');
/**
 * CSS overlay image
 *
 * @package Infinity-extensions
 * @subpackage options
 */
class ICE_Ext_Option_Css_Overlay_Image extends ICE_Ext_Option_Ui_Overlay_Picker
{
    /**
     */
    protected function init()
    {
        // run parent
        parent::init();
        // init directives
        $this->title = __('Overlay Image', infinity_text_domain);
        $this->description = __('Select a texture to use as the background overlay', infinity_text_domain);
Esempio n. 6
0
<?php

/**
 * ICE API: option extensions, enable/disable radio class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-extensions
 * @subpackage options
 * @since 1.0
 */
ICE_Loader::load_ext('options/radio');
/**
 * Enable/Disable radio option
 *
 * @package ICE-extensions
 * @subpackage options
 */
class ICE_Ext_Option_Toggle_Enable_Disable extends ICE_Ext_Option_Radio implements ICE_Option_Auto_Field
{
    /**
     */
    public function load_field_options()
    {
        return array(true => __('Enable', infinity_text_domain), false => __('Disable', infinity_text_domain));
    }
}
Esempio n. 7
0
 */
if (!defined('INFINITY_ERROR_REPORTING')) {
    define('INFINITY_ERROR_REPORTING', INFINITY_ERROR_HANDLING);
}
/**
 * ICE error reporting
 */
if (!defined('ICE_ERROR_REPORTING')) {
    define('ICE_ERROR_REPORTING', INFINITY_ERROR_REPORTING);
}
/**
 * Load the ICE lib loader
 */
require_once INFINITY_ICE_PATH . '/loader.php';
// initialize ICE
ICE_Loader::init(INFINITY_ICE_URL);
// setup translation
load_theme_textdomain(INFINITY_TEXT_DOMAIN, WP_LANG_DIR . '/' . INFINITY_SLUG);
// initialize enqueuer and configure actions
if (is_admin()) {
    ICE_Enqueue::instance()->styles_on_action('load-appearance_page_' . INFINITY_ADMIN_PAGE)->scripts_on_action('load-appearance_page_' . INFINITY_ADMIN_PAGE);
} else {
    ICE_Enqueue::instance()->styles_on_action('wp_enqueue_scripts')->scripts_on_action('wp_enqueue_scripts');
}
// load Infinity API
require_once INFINITY_API_PATH . '/scheme.php';
require_once INFINITY_API_PATH . '/sections.php';
require_once INFINITY_API_PATH . '/options.php';
require_once INFINITY_API_PATH . '/features.php';
require_once INFINITY_API_PATH . '/widgets.php';
require_once INFINITY_API_PATH . '/screens.php';
Esempio n. 8
0
<?php

/**
 * ICE API: options registry
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage options
 * @since 1.0
 */
ICE_Loader::load('base/registry', 'components/options/factory', 'utils/ajax');
/**
 * Make keeping track of options easy
 *
 * @package ICE-components
 * @subpackage options
 */
abstract class ICE_Option_Registry extends ICE_Registry
{
    /**
     * Enqueue required scripts
     */
    public function init_scripts()
    {
        // call parent
        parent::init_scripts();
        // jQuery UI is always needed
        wp_enqueue_script('jquery-ui-accordion');
Esempio n. 9
0
<?php

/**
 * ICE API: option extensions, WP blog description class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-extensions
 * @subpackage options
 * @since 1.0
 */
ICE_Loader::load_ext('options/text');
/**
 * WP blog description option
 *
 * @package ICE-extensions
 * @subpackage options
 */
class ICE_Ext_Option_Wp_Blogdescription extends ICE_Ext_Option_Text
{
    /**
     */
    protected function init()
    {
        // run parent
        parent::init();
        // init directives
        $this->title = __('Tagline');
        $this->description = __('In a few words, explain what this site is about.');
Esempio n. 10
0
<?php

/**
 * ICE API: option extensions, CSS pixels slider class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-extensions
 * @subpackage options
 * @since 1.0
 */
ICE_Loader::load_ext('options/ui/slider');
/**
 * CSS Pixels Slider
 *
 * This option is an extension of the slider for selecting pixels
 *
 * @package ICE-extensions
 * @subpackage options
 */
class ICE_Ext_Option_Css_Length_Px extends ICE_Ext_Option_Ui_Slider
{
    protected function init()
    {
        parent::init();
        // initialize directives
        $this->description = 'Select the number of pixels by moving the slider';
        $this->max = 5;
        $this->min = 0;
Esempio n. 11
0
<?php

/**
 * ICE API: option extensions, tag class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-extensions
 * @subpackage options
 * @since 1.0
 */
ICE_Loader::load_ext('options/select');
/**
 * Tag option
 *
 * @package ICE-extensions
 * @subpackage options
 */
class ICE_Ext_Option_Tag extends ICE_Ext_Option_Select implements ICE_Option_Auto_Field
{
    /**
     */
    public function load_field_options()
    {
        $args = array('hide_empty' => false);
        // get all tags
        $tags = get_tags($args);
        // field options
        $options = array();
Esempio n. 12
0
<?php

/**
 * ICE API: sections factory class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage sections
 * @since 1.0
 */
ICE_Loader::load('base/factory');
/**
 * Make creating section objects easy
 *
 * @package ICE-components
 * @subpackage sections
 */
class ICE_Section_Factory extends ICE_Factory
{
}
Esempio n. 13
0
<?php

/**
 * ICE API: file system file cache class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE
 * @subpackage utils
 * @since 1.0
 */
ICE_Loader::load('utils/file');
/**
 * A basic file cache
 *
 * @package ICE
 * @subpackage utils
 */
final class ICE_File_Cache extends ICE_Map
{
    /**
     * The last filename that was hashed
     *
     * @var string
     */
    private $last_hash_file;
    /**
     * MD5 hash of last file
     *
Esempio n. 14
0
<?php

/**
 * ICE API: base registry
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE
 * @subpackage base
 * @since 1.0
 */
ICE_Loader::load('base/componentable', 'base/visitable', 'init/configuration', 'utils/export');
/**
 * Make keeping track of concrete components
 *
 * @package ICE
 * @subpackage base
 */
abstract class ICE_Registry extends ICE_Componentable implements ICE_Visitable
{
    /**
     * Sub option delimeter
     */
    const SUB_OPTION_DELIM = '.';
    /**
     * Sub option glue
     */
    const SUB_OPTION_GLUE = '_';
    /**
Esempio n. 15
0
<?php

/**
 * ICE API: widgets registry
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage widgets
 * @since 1.0
 */
ICE_Loader::load('base/registry', 'components/widgets/factory');
/**
 * Make keeping track of widgets easy
 *
 * @package ICE-components
 * @subpackage widgets
 */
abstract class ICE_Widget_Registry extends ICE_Registry
{
}
Esempio n. 16
0
<?php

/**
 * ICE API: UI control panel class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE
 * @subpackage ui
 * @since 1.0
 */
ICE_Loader::load('dom/script');
/**
 * Make cool control panels easy
 *
 * @package ICE
 * @subpackage ui
 */
final class ICE_Ui_Cpanel extends ICE_Base
{
    /**
     * The screens policy instance
     *
     * @var ICE_Screen_Policy
     */
    private $policy;
    /**
     * The CSS id of the control panel (also used as a prefix)
     *
Esempio n. 17
0
<?php

/**
 * ICE API: features registry
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage features
 * @since 1.0
 */
ICE_Loader::load('base/registry', 'components/features/factory');
/**
 * Make keeping track of features easy
 *
 * @package ICE-components
 * @subpackage features
 */
abstract class ICE_Feature_Registry extends ICE_Registry
{
    /**
     */
    protected function load_config_section($section_name, $section_array)
    {
        // not a feature option by default
        $feature_option = null;
        // sub option syntax?
        if (strpos($section_name, self::SUB_OPTION_DELIM)) {
            // yes, split at special delim
Esempio n. 18
0
<?php

/**
 * ICE API: base factory class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE
 * @subpackage base
 * @since 1.0
 */
ICE_Loader::load('base/componentable');
/**
 * Make creating concrete components easy
 *
 * @package ICE
 * @subpackage base
 */
abstract class ICE_Factory extends ICE_Componentable
{
    /**
     * Component type to use when none configured
     */
    const DEFAULT_COMPONENT_TYPE = 'default';
    /**
     * Load a component extension
     *
     * Override this class to load component class files which exist outside of ICE's path
     *
Esempio n. 19
0
<?php

/**
 * ICE API: file system helper class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE
 * @subpackage utils
 * @since 1.0
 */
ICE_Loader::load('utils/file_cache');
/**
 * Make the File System Easy
 *
 * @package ICE
 * @subpackage utils
 * @uses ICE_Files_Exception
 */
final class ICE_Files extends ICE_Base
{
    /**
     * File cache instance
     * 
     * @var ICE_File_Cache
     */
    private static $fcache;
    /**
     * Cached doc root
Esempio n. 20
0
<?php

/**
 * ICE API: feature extensions, responsive menu feature class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2012 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-extensions
 * @subpackage features
 * @since 1.0
 */
ICE_Loader::load('components/features/component');
/**
 * Responsive menu feature
 *
 * @link https://github.com/mattkersley/Responsive-Menu
 * @package ICE-extensions
 * @subpackage features
 */
class ICE_Ext_Feature_Responsive_Menu extends ICE_Feature
{
    /**
     * Combine multiple menus into a single select
     *
     * @var boolean
     */
    protected $combine;
    /**
     * optgroup's aren't selectable, make an option for it
Esempio n. 21
0
<?php

/**
 * ICE API: screens registry
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage screens
 * @since 1.0
 */
ICE_Loader::load('base/registry', 'components/screens/factory');
/**
 * Make keeping track of screens easy
 *
 * @package ICE-components
 * @subpackage screens
 */
abstract class ICE_Screen_Registry extends ICE_Registry
{
}
Esempio n. 22
0
<?php

/**
 * Infinity Theme: widgets classes file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package Infinity-api
 * @subpackage widgets
 * @since 1.0
 */
ICE_Loader::load('components/widgets');
/**
 * Infinity Theme: widgets policy
 *
 * @package Infinity-api
 * @subpackage widgets
 */
class Infinity_Widgets_Policy extends ICE_Widget_Policy
{
    /**
     * @return ICE_Widget_Policy
     */
    public static function instance()
    {
        self::$calling_class = __CLASS__;
        return parent::instance();
    }
    /**
Esempio n. 23
0
<?php

/**
 * ICE API: shortcodes registry
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage shortcodes
 * @since 1.0
 */
ICE_Loader::load('base/registry', 'components/shortcodes/factory');
/**
 * Make keeping track of shortcodes easy
 *
 * @package ICE-components
 * @subpackage shortcodes
 */
abstract class ICE_Shortcode_Registry extends ICE_Registry
{
}
Esempio n. 24
0
<?php

ICE_Loader::load('utils/webfont');
?>
<div id="typography-ff"></div>

<script type="text/javascript">
	(function($){
		var options = {};
		// add application options
		options.jsonUrl = '<?php 
print ICE_Webfont::instance(0)->url;
?>
';
		options.slantText = '<?php 
_e('Slant', infinity_text_domain);
?>
';
		options.serviceText = '<?php 
_e('Service', infinity_text_domain);
?>
';
		options.variantText = '<?php 
_e('Thickness', infinity_text_domain);
?>
';
		options.subsetText = '<?php 
_e('Script', infinity_text_domain);
?>
';
		options.match =
Esempio n. 25
0
<?php

/**
 * ICE API: feature renderer class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage features
 * @since 1.0
 */
ICE_Loader::load('base/renderer');
/**
 * Make rendering features easy
 *
 * @package ICE-components
 * @subpackage features
 */
abstract class ICE_Feature_Renderer extends ICE_Renderer
{
}
Esempio n. 26
0
<?php

/**
 * ICE API: option extensions, UI slider class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-extensions
 * @subpackage options
 * @since 1.0
 */
ICE_Loader::load('components/options/component');
/**
 * UI Slider option
 *
 * This option is a wrapper for the jQuery UI slider widget
 *
 * @link http://jqueryui.com/demos/slider/
 * @package ICE-extensions
 * @subpackage options
 */
class ICE_Ext_Option_Ui_Slider extends ICE_Option
{
    /**
     * @var boolean|string|integer
     */
    protected $animate;
    /**
     * @var string
Esempio n. 27
0
<?php

/**
 * Infinity Theme: shortcodes classes file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package Infinity-api
 * @subpackage shortcodes
 * @since 1.0
 */
ICE_Loader::load('components/shortcodes');
/**
 * Infinity Theme: shortcodes policy
 *
 * @package Infinity-api
 * @subpackage shortcodes
 */
class Infinity_Shortcodes_Policy extends ICE_Shortcode_Policy
{
    /**
     * @return ICE_Shortcode_Policy
     */
    public static function instance()
    {
        self::$calling_class = __CLASS__;
        return parent::instance();
    }
    /**
Esempio n. 28
0
<?php

/**
 * ICE API: widgets policy class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage widgets
 * @since 1.0
 */
ICE_Loader::load('base/policy');
/**
 * Make customizing widget implementations easy
 *
 * This object is passed to each widget allowing the implementing API to
 * customize the implementation without confusing hooks and such.
 *
 * @package ICE-components
 * @subpackage widgets
 */
abstract class ICE_Widget_Policy extends ICE_Policy
{
    /**
     * @return string
     */
    public function get_handle($plural = true)
    {
        return $plural ? 'widgets' : 'widget';
Esempio n. 29
0
<?php

/**
 * ICE API: base styleable class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE
 * @subpackage dom
 * @since 1.0
 */
ICE_Loader::load('dom/style');
/**
 * Make style implementation easy
 *
 * @package ICE
 * @subpackage dom
 */
interface ICE_Styleable
{
    /**
     * Return style object
     * 
     * @return ICE_Style
     */
    public function style();
}
Esempio n. 30
0
<?php

/**
 * ICE API: section class file
 *
 * @author Marshall Sorenson <*****@*****.**>
 * @link http://infinity.presscrew.com/
 * @copyright Copyright (C) 2010-2011 Marshall Sorenson
 * @license http://www.gnu.org/licenses/gpl.html GPLv2 or later
 * @package ICE-components
 * @subpackage sections
 * @since 1.0
 */
ICE_Loader::load('base/component');
/**
 * Make an option section easy
 *
 * @package ICE-components
 * @subpackage sections
 */
abstract class ICE_Section extends ICE_Component
{
    /**
     * Components to render
     *
     * @var array
     */
    private $__components__;
    /**
     * The CSS class for the content of this section
     *