/** * Finalize scheme for the active theme * * @package Infinity-api * @return boolean */ function infinity_scheme_finalize() { // finalize registries Infinity_Sections_Policy::instance()->registry()->finalize(); Infinity_Options_Policy::instance()->registry()->finalize(); Infinity_Features_Policy::instance()->registry()->finalize(); Infinity_Screens_Policy::instance()->registry()->finalize(); Infinity_Widgets_Policy::instance()->registry()->finalize(); Infinity_Shortcodes_Policy::instance()->registry()->finalize(); return true; }
/** * @return ICE_Section_Policy */ public static function instance() { self::$calling_class = __CLASS__; return parent::instance(); }
/** * Render options according to the option name POST var * * @package Infinity-api * @subpackage options */ function infinity_options_render_options_screen() { // section $load_section = null; if (!empty($_POST['load_section'])) { $load_section = $_POST['load_section']; } else { ICE_Ajax::responseStd(false, 'Missing required "load_section" parameter'); } // option $load_option = null; if (!empty($_POST['load_option'])) { $load_option = $_POST['load_option']; } // options to render $options = array(); // look up section $section = Infinity_Sections_Policy::instance()->registry()->get($load_section); // did we get a valid section? if ($section instanceof ICE_Section) { // load specific option? if ($load_option) { // look up the single option $option = Infinity_Options_Policy::instance()->registry()->get($load_option); // did we get a valid option? if ($option instanceof ICE_Option) { // add it to options to array $options[] = $option; } } else { // get all options for the section $options = Infinity_Options_Policy::instance()->registry()->get_menu_options($section); } } // content to return $content = null; // option content $option_content = null; // loop through all options and render each one foreach ($options as $option_to_render) { // enable post override $option_to_render->enable_post_override(); // try to render the option $section->add_component($option_to_render); } // render the section $content = $section->render(false); // respond if (strlen($content)) { ICE_Ajax::responseStd(true, null, $content); } else { ICE_Ajax::responseStd(false, __('Failed to render options', infinity_text_domain)); } }