/** * 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; }
/** * 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 } }
<?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
/** */ protected function get_file_contents($filename) { // run parent to get content $content = parent::get_file_contents($filename); // get content? if ($content) { // new file info instance $fi = new ICE_File($filename); // save last filename $this->last_dirname = $fi->getPath(); // handle any pre-processing switch ($fi->getExtension()) { // its a LESS CSS file case 'less': // load less parser ICE_Loader::load('parsers/less'); // parse it $content = ICE_Less::parse($content, $fi->getPath()); // done with less break; } // replace all CSS url() values return preg_replace_callback('/url\\s*\\([\'\\"\\s]*([^\'\\"\\s]*)[\'\\"\\s]*\\)/', array($this, 'fix_url_path'), $content); } }
<?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 =
<?php /** * Infinity Theme: scheme initilization 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 * @since 1.0 */ ICE_Loader::load('schemes'); /** * Initialize and load the scheme for the active theme * * @package Infinity-api * @return boolean */ function infinity_scheme_init() { // initialize the scheme ICE_Scheme::instance()->set_config_file(INFINITY_SLUG)->set_config_dir(INFINITY_ENGINE_DIR . '/config')->set_docs_dir(INFINITY_ENGINE_DIR . '/documents')->set_exts_dir(INFINITY_ENGINE_DIR . '/extensions')->init(INFINITY_NAME); // initialize policies (the order is important here) Infinity_Sections_Policy::instance(); Infinity_Options_Policy::instance(); Infinity_Features_Policy::instance(); Infinity_Screens_Policy::instance(); Infinity_Widgets_Policy::instance(); Infinity_Shortcodes_Policy::instance(); return true;
<?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(); } /**
/** * 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; }
<?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
<?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');
<?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) *
<?php /** * ICE API: base positionable 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('ui/position'); /** * Make positioning implementation easy * * @package ICE * @subpackage ui */ interface ICE_Positionable { /** * Set/Return the position * * @param ICE_Position $position * @return ICE_Position */ public function position(ICE_Position $position = null); }
<?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 { }
<?php /** * ICE API: options option 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 options * @since 1.0 */ ICE_Loader::load('base/component', 'utils/docs', 'schemes'); /** * Make an option easy * * @package ICE-components * @subpackage options */ abstract class ICE_Option extends ICE_Component { /** * The string on which to split field option key => values */ const FIELD_OPTION_DELIM = '='; /** * If true, a POST value will override the real option value * * @var boolean */
<?php /** * ICE API: base asset abstract 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('base/exportable', 'base/recursable'); /** * Make assets for components easy * * @package ICE * @subpackage dom * @property-read string $name */ abstract class ICE_Asset extends ICE_Base implements ICE_Exportable, ICE_Recursable { /** * @var ICE_Component */ private $component; /** * Stack of sections * * @var ICE_Map
/** * Initialize ICE * * You must tell ICE at what URL its root directory is located * * @param string $ice_url The absolute URL to ICE root */ public static final function init($ice_url) { // new instance if necessary if (!self::$instance instanceof self) { // define api ext prefixes define('ICE_EXT_PREFIX', 'ICE_Ext'); // define ICE urls define('ICE_URL', $ice_url); define('ICE_ASSETS_URL', ICE_URL . '/assets'); define('ICE_CSS_URL', ICE_ASSETS_URL . '/css'); define('ICE_ERRORS_URL', ICE_ASSETS_URL . '/errors'); define('ICE_IMAGES_URL', ICE_ASSETS_URL . '/images'); define('ICE_JS_URL', ICE_ASSETS_URL . '/js'); // is this an AJAX request? define('ICE_AJAX_REQUEST', defined('DOING_AJAX')); // create singleton instance self::$instance = new self(); // load really important classes self::$instance->load('collections', 'utils/files', 'utils/enqueue'); } }
<?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';
<?php /** * ICE API: widget extensions, theme picker widget 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 widgets * @since 1.0 */ ICE_Loader::load('components/widgets/component'); /** * Theme picker widget * * @package ICE-extensions * @subpackage widgets */ class ICE_Ext_Widget_Theme_Picker extends ICE_Widget { /** * Current theme data * * @var array */ private $__wp_theme__; /** * Allowed themes data *
<?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 *
<?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 *
<?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
<?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
<?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 = '_'; /**
<?php /** * Infinity Theme: sections 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 sections * @since 1.0 */ ICE_Loader::load('components/sections'); /** * Infinity Theme: sections policy * * @package Infinity-api * @subpackage sections */ class Infinity_Sections_Policy extends ICE_Section_Policy { /** * @return ICE_Section_Policy */ public static function instance() { self::$calling_class = __CLASS__; return parent::instance(); } /**
<?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 { }
<?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 { }
<?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 { }
<?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 *
<?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(); }
<?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 { }