function yiw_css_color($name, $prop, $important = '', $echo = true) { if (substr($name, 0, 1) == '#') { $color = $name; } else { $color = yiw_get_color($name, false); } if ($important === true) { $important = '!important'; } if ($prop == '' || $color == '') { return ''; } //echo $prop, ':', $color, ';'; $r = "{$prop}:{$color}{$important};"; if ($echo) { echo $r; } return $r; }
function yiw_retrieve_customizable_options($c_options, $type) { $options = array(); switch ($type) { case 'colors': $options = $GLOBALS['yiw_colors']; $type_option = 'color-picker'; break; case 'fonts': $options = $GLOBALS['yiw_sizes']; $type_option = 'slider_control'; break; } foreach ($options as $section => $the_) { $c_options[$section][] = array('type' => 'section', 'name' => $the_['name-section']); $c_options[$section][] = array('type' => 'open'); foreach ($the_['options'] as $id => $args) { $c_options[$section][] = array('name' => $args['panel_title'], 'desc' => $args['panel_desc'], 'id' => $type . '_' . $id, 'type' => $type_option, 'std' => $type == 'colors' ? yiw_get_color($id, false, true) : $args['default'], 'min' => 1, 'max' => 50); } $c_options[$section][] = array('type' => 'close'); } return $c_options; }