function ufront_js() { $variables = array('url' => admin_url('admin-ajax.php')); $themeopt = new uwpqsfclass(); $themeops = $themeopt->uwpqsf_theme(); $themenames = $themeopt->uwpqsf_theme_val(); if (isset($themenames)) { foreach ($themeops as $k) { if (in_array($k['themeid'], $themenames)) { wp_register_style($k['themeid'], $k['link'], array(), 'all'); wp_enqueue_style($k['themeid']); } wp_enqueue_script('uwpqsfscript', plugins_url('/scripts/uwpqsfscript.js', __FILE__), array('jquery'), '1.0', true); wp_localize_script('uwpqsfscript', 'ajax', $variables); } // end foreach } //end if }
<?php add_thickbox(); $html = '<div class="cbox"><h3>' . __("Form's Theme", "UWPQSF") . '</h3>'; $themes = get_post_meta($postid, 'uwpqsf-theme', true); $extheme = ''; $themeopt = new uwpqsfclass(); $themeops = $themeopt->uwpqsf_theme(); if (!empty($themes)) { $extheme = explode('|', $themes); } $html .= '<div class="fullwide">'; $c = 1; foreach ($themeops as $k) { $default = empty($extheme) && $k['themeid'] == 'udefault' ? 'checked="checked"' : ''; $checked = !empty($extheme) && $k['themeid'] == $extheme[0] ? 'checked="checked"' : ''; $value = $k['themeid'] . '|' . $k['link'] . '|' . $k['id'] . '|' . $k['class']; $html .= '<label class="ptheme">'; $html .= '<input type="radio" name="themeopt" value="' . $value . '" ' . $checked . ' ' . $default . '">' . $k['name'] . '<br>'; $html .= '<a href="#TB_inline?width=600&height=600&inlineId=themethumb_' . $c . '" class="thickbox">' . __(" Preview", "UWPQSF") . '</a>'; $html .= '<div class="clear"></div></label>'; $html .= '<div id="themethumb_' . $c . '" style="display:none"><img src="' . $k['thumb'] . '"></div>'; $c++; } $html .= '<div class="clear"></div></div></div><br><br>'; echo $html;