/** * Create the details divs for the SLP themes. * * @param mixed[] $themeArray * @return string the div HTML */ private function setup_ThemeDetails($themeArray) { $this->parent->debugMP('wpcsl.main', 'msg', 'PluginTheme::' . __FUNCTION__); $HTML = ''; $newDetails = false; // Get an array of metadata for each theme present. // $this->themeDetails = get_option($this->prefix . '-theme_details'); // Check all our themes for details // foreach ($themeArray as $label => $theme_slug) { // No details? Read from the CSS File. // if (!isset($this->themeDetails[$theme_slug]) || empty($this->themeDetails[$theme_slug]) || !isset($this->themeDetails[$theme_slug]['label']) || empty($this->themeDetails[$theme_slug]['label'])) { $themeData = $this->get_ThemeInfo($this->css_dir . $theme_slug . '.css'); $themeData['fqfname'] = $this->css_dir . $theme_slug . '.css'; $this->themeDetails[$theme_slug] = $themeData; $newDetails = true; } $this->current_slug = $theme_slug; $HTML .= $this->createstring_ThemeDetails(); } // If we read new details, go save to disk. // if ($newDetails) { update_option($this->prefix . '-theme_details', $this->themeDetails); } return $HTML; }
/** * Take an array of checkbox names and set all the form POSTS if not set and load into equivalent option_array key. * * $_POST['blah'] gets loaded into $option_array['blah'] whether on or off (1 or 0) * * @param $option_array * @param $checkbox_list */ function load_checkboxes_into_options(&$option_array, $checkbox_list) { $this->slplus->debugMP('msg', get_class() . '::' . __FUNCTION__); foreach ($checkbox_list as $checkbox_name) { $this->create_checkbox_post($checkbox_name); $option_array[$checkbox_name] = $_POST[$checkbox_name]; } }
/** * Call parent DebugMP only if parent has been set. * * * @param string $panel - panel name * @param string $type - what type of debugging (msg = simple string, pr = print_r of variable) * @param string $header - the header * @param string $message - what you want to say * @param string $file - file of the call (__FILE__) * @param int $line - line number of the call (__LINE__) * @param boolean $notime - show time? default true = yes. * @return null */ function debugMP($panel = 'main', $type = 'msg', $header = 'wpCSL DMP', $message = '', $file = null, $line = null, $notime = false) { if (is_object($this->parent)) { $this->parent->debugMP($panel, $type, $header, $message, $file, $line, $notime); } }