"36",
"textarea_height"=>"150",
"textarea_width"=>"450",
"select_width"=>"240",
"upload_size" => "30",
"upload_filetype" => "image",
);
$this->params=$this->merge_params($defaults,$initial_params);
}
/**
* Displays a single button for toggling some other elements onclick
*
* @param $element['show'] = array('name_of _element_to_hide')
* @param $element['hide'] = array('name_of _element_to_show')
*/
public function button($element, $context = 'option', $opt_val = '', $meta=array()){
global $wdwt_options;
?>
params["input_size"];
?>
params["input_size"];
$min = isset($element["min"]) ? $element["min"] : 1;
$max = isset($element["max"]) ? $element["max"] : 100;
$step = isset($element["step"]) ? $element["step"] : 1;
?>
array('title'=>'value', 'description'=>'value'))
* @param $option['default']: one of the keys from 'valid options' as default value ttt!!!
*/
public function radio($element, $context = 'option', $opt_val = '', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. ']';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. ']';
$opt_val = $wdwt_options[$element['name']];
}
?>
$option ) {
?>
"value") or array("key" => array("value","valeu2"))
* @param $element['hide'] = array("key" => "value")
*/
public function radio_open($element,$context = 'option', $opt_val = '', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. ']';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. ']';
$opt_val = $wdwt_options[$element['name']];
}
?>
$option ) {
?>
0, title'=>'value', 'description'=>'value'))
* @param $element['default']: one of the indices from 'valid options' as default value
* @param $element['img_src']:
* @param $element['img_height']:
* @param $element['img_width']:
*/
public function radio_images($element, $context='meta', $opt_val='', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. ']';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. ']';
$opt_val = $wdwt_options[$element['name']];
}
?>
0, title'=>'value', 'description'=>'value'))
* @param $element['default']: one of the indices from 'valid options' as default value
* @param $element['img_src']:
* @param $element['img_height']:
* @param $element['img_width']:
* @param $element['show'] = array("key" => "value") or array("key" => array("value","valeu2"))
* @param $element['hide'] = array("key" => "value")
*
*/
public function radio_images_open($element, $context='option', $opt_val ='', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. ']';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. ']';
$opt_val = $wdwt_options[$element['name']];
}
?>
element
*
* @param $select['valid options']: ($key => $value)
* @param $select['default']: one of the keys from 'valid options' as default value
*/
public function select($element, $context='option', $opt_val = array(), $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. '][]';
if(!is_array($opt_val)){
/*old format*/
$opt_val = $this->get_old_posts_cats($opt_val);
}
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. '][]';
$opt_val = $wdwt_options[$element['name']];
}
$opt_val = is_array($opt_val) ? $opt_val : array($opt_val);
$multiple = isset($element["multiple"]) ? true : false;
$width = isset($element["width"]) ? intval($element["width"]) : $this->params["select_width"];
$disabled = isset($element["disabled"]) ? $element["disabled"] : array();
?>
"value") or array("key" => array("value","valeu2"))
* @param $element['hide'] = array("key" => "value")
*/
public function select_open($element, $context='option', $opt_val ='', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. '][]';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. '][]';
$opt_val = $wdwt_options[$element['name']];
}
$opt_val = is_array($opt_val) ? $opt_val : array($opt_val);
$multiple = isset($element["multiple"]) ? true : false;
$width = isset($element["width"]) ? intval($element["width"]) : $this->params["select_width"];
?>
"1 em")
*/
public function select_style($element, $context='option', $opt_val='', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. '][]';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. '][]';
$opt_val = $wdwt_options[$element['name']];
}
$width = isset($element["width"]) ? $element["width"] : $this->params["select_width"];
?>
state === 'original') {
$this->state = 'changed';
?>
params["textarea_width"];
$textarea_h = isset($element["height"]) ? $element["height"] : $this->params["textarea_height"];
/*var_dump(wp_kses_allowed_html( 'entities ' ));*/ /*ttt!!! correct this*/
?>
'font-weight')
*
*/
public function text_preview($element, $context='option', $opt_val='', $meta=array()){
global $wdwt_options;
?>
params["upload_size"];
$filetype = (isset($element["filetype"]) && $element["filetype"] != '') ? $element["filetype"] : $this->params["upload_filetype"];
?>
params["upload_size"];
$filetype = (isset($element["filetype"]) && $element["filetype"] != '') ? $element["filetype"] : $this->params["upload_filetype"];
?>
0,
* 'themes' => array(array('name'=>'theme_1', "title" =>'')),
* 'colors'=> array(
* array('color_name => 'array('value'=>'#cccccc', 'default'=>'#000000')))
* )
*
*/
public function select_theme($element, $context='option', $opt_val='', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. ']';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. ']';
$opt_val = $wdwt_options[$element['name']];
}
$current = $opt_val['active'];
$width = isset($element["width"]) ? $element["width"] : $this->params["select_width"];
?>
'color_scheme', 'active' => 0,
* 'colors' => array('color_name'=>array('value'=>'#cccccc', 'value'=>'#000000')))
*/
public function colors($element, $context='option', $opt_val='', $meta=array()){
if($context== 'meta'){
$optionname = WDWT_META.'[' .$element['name']. ']';
}
else{
global $wdwt_options;
$optionname = WDWT_OPT.'[' .$element['name']. ']';
$opt_val = $wdwt_options[$element['name']];
}
$select_theme = $opt_val['select_theme'];
?>
$value){
if(isset($param_last_high_priorete[$key])){
$new_param[$key]=$param_last_high_priorete[$key];
}
else{
$new_param[$key]=$value;
}
}
return $new_param;
}
private function custom_attrs($element = array()){
$attrs_array = isset($element['custom_attrs']) ? $element['custom_attrs'] : array();
foreach ($attrs_array as $attr => $value) {
echo esc_html($attr).'="'.esc_attr($value).'" ';
}
}
/**
* get posts and categories createdwith checkboxes
*/
protected function get_old_posts_cats($val){
$value = $val;
$val = json_decode( $val , true );
$result = array();
if( is_null($val) ){
if(is_string($value)){
$result = explode(",", $value);
}
if(is_integer($value)){
$value = array($value);
}
} else {
$new_val = array();
foreach ($val as $key => $value) {
array_push($new_val, $value);
}
$result = $val;
}
return $result;
}
}
?>