Exemplo n.º 1
0
 public static function save_google_fonts()
 {
     $data = array();
     parse_str($_REQUEST['values'], $data);
     TMM::update_option('saved_google_fonts', $data);
     exit;
 }
Exemplo n.º 2
0
 public static function get_cat_head_seo_data($cat)
 {
     $data = array();
     $data['meta_title'] = "";
     $data['meta_keywords'] = "";
     $data['meta_description'] = "";
     if (!$cat) {
         return $data;
     }
     $seo_groups = TMM::get_option("seo_groups");
     if (!empty($seo_groups)) {
         foreach ($seo_groups as $key => $group) {
             if (!empty($group['cat'])) {
                 foreach ($group['cat'] as $category) {
                     if ($category == $cat) {
                         $data['meta_title'] = $group['title'];
                         $data['meta_keywords'] = $group['keywords'];
                         $data['meta_description'] = $group['description'];
                         return $data;
                     }
                 }
             }
         }
     }
     return $data;
 }
Exemplo n.º 3
0
 public static function testimonials_credits_meta()
 {
     global $post;
     $data = array();
     $custom = get_post_custom($post->ID);
     $data['position'] = @$custom["position"][0];
     echo TMM::draw_html('testimonials/credits_meta', $data);
 }
 function form($instance)
 {
     //Defaults
     $defaults = array('boxtitle' => __('Soonest Event', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'show_title' => 0, 'month_deep' => 1, 'show_time_zone' => 1);
     $instance = wp_parse_args((array) $instance, $defaults);
     $args = array();
     $args['instance'] = $instance;
     $args['widget'] = $this;
     echo TMM::draw_free_page(TMM_EVENTS_PLUGIN_PATH . 'views/widgets/soonest_event_form.php', $args);
 }
Exemplo n.º 5
0
 public static function credits_meta()
 {
     global $post;
     $data = array();
     $custom = get_post_custom($post->ID);
     $data['twitter'] = @$custom["twitter"][0];
     $data['facebook'] = @$custom["facebook"][0];
     $data['dribble'] = @$custom["dribble"][0];
     echo TMM::draw_html('staff/credits_meta', $data);
 }
 function form($instance)
 {
     //Defaults
     $defaults = array('title' => __('Events Calendar', TMM_EVENTS_PLUGIN_TEXTDOMAIN));
     $instance = wp_parse_args((array) $instance, $defaults);
     $args = array();
     $args['instance'] = $instance;
     $args['widget'] = $this;
     echo TMM::draw_free_page(TMM_EVENTS_PLUGIN_PATH . 'views/widgets/calendar_form.php', $args);
 }
 function form($instance)
 {
     //Defaults
     $defaults = array('title' => __('Upcoming Events', TMM_EVENTS_PLUGIN_TEXTDOMAIN), 'count' => 3, 'month_deep' => 1);
     $instance = wp_parse_args((array) $instance, $defaults);
     $args = array();
     $args['instance'] = $instance;
     $args['widget'] = $this;
     echo TMM::draw_free_page(TMM_EVENTS_PLUGIN_PATH . 'views/widgets/upcoming_events_form.php', $args);
 }
Exemplo n.º 8
0
    public static function wp_head()
    {
        if (TMM::get_option('hide_layout_front_popup')) {
            return;
        }
        wp_enqueue_script('tmm_ext_demo_js', TMM_EXT_URI . '/demo/js/front.js', array('jquery'));
        wp_enqueue_style('tmm_ext_demo_css', TMM_EXT_URI . '/demo/css/styles.css');
        ?>
		<script type="text/javascript">
		<?php 
        $data = self::get_theme_schemes();
        ?>

			var tmm_demo_styles_list = {
		<?php 
        if (!empty($data)) {
            ?>
			<?php 
            foreach ($data as $key => $value) {
                ?>
				<?php 
                if ($key > 0) {
                    echo ',';
                }
                ?>
				<?php 
                echo $key;
                ?>
 : {
					className:'style_<?php 
                echo $key;
                ?>
',
					css_file_link : '<?php 
                echo TMM_Helper::get_upload_folder_uri() . 'almera' . '/' . 'theme_schemes/' . strtolower($value['key']) . '.css';
                ?>
',
                                        icon_type : 'color',
					color : '<?php 
                echo $value['color'];
                ?>
',
					image_file : '',
					}
			<?php 
            }
            ?>
		<?php 
        }
        ?>
			};
		</script>

		<?php 
    }
Exemplo n.º 9
0
/**
 * Add Settings tab.
 */
function tmm_migrate_add_settings_tab()
{
    if (current_user_can('manage_options')) {
        if (class_exists('TMM_OptionsHelper')) {
            $content = array();
            $tmpl_path = TMM_MIGRATE_PATH . '/views/theme_options_tab.php';
            $content[TMM_MIGRATE_TEXTDOMAIN] = array('title' => '', 'type' => 'custom', 'custom_html' => TMM::draw_free_page($tmpl_path), 'show_title' => false);
            $sections = array('name' => __("Import / Export", TMM_MIGRATE_TEXTDOMAIN), 'css_class' => 'shortcut-plugins', 'show_general_page' => true, 'content' => $content, 'child_sections' => array(), 'menu_icon' => 'dashicons-admin-tools');
            TMM_OptionsHelper::$sections[TMM_MIGRATE_TEXTDOMAIN] = $sections;
        }
    }
}
 public static function draw_front($post_id, $row_displaying)
 {
     $tmm_layout_constructor = get_post_meta($post_id, 'thememakers_layout_constructor', true);
     if (!empty($tmm_layout_constructor)) {
         $data = array();
         $data['row_displaying'] = $row_displaying;
         $data['tmm_layout_constructor'] = $tmm_layout_constructor;
         $data['tmm_layout_constructor_row'] = get_post_meta($post_id, 'thememakers_layout_constructor_row', true);
         if (!is_array($data['tmm_layout_constructor_row'])) {
             $data['tmm_layout_constructor_row'] = array();
         }
         echo TMM::draw_free_page(TMM_CC_DIR . '/views/front_output.php', $data);
     }
 }
Exemplo n.º 11
0
 public static function get_forms_names()
 {
     $contact_forms = TMM::get_option('contact_form');
     $result = array();
     if (!empty($contact_forms)) {
         //after import
         if (!empty($contact_forms) and is_string($contact_forms)) {
             $contact_forms = unserialize($contact_forms);
         }
         foreach ($contact_forms as $form) {
             $result[@$form['title']] = @$form['title'];
         }
     }
     return $result;
 }
Exemplo n.º 12
0
 public static function addthis_shortcode($atts, $content = '')
 {
     if (!isset($atts['buttons_type'])) {
         $atts['buttons_type'] = TMM::get_option('buttons_type');
     }
     if (!isset($atts['add_buttons'])) {
         $atts['add_buttons'] = TMM::get_option('add_buttons');
     }
     $show_buttons = TMM::get_option('show_buttons');
     $post_type = get_post_type();
     if ($post_type === 'post') {
         if (isset($show_buttons['single_blog']) && $show_buttons['single_blog'] === '0') {
             return '';
         }
     }
     if (class_exists('TMM_Ext_PostType_Car') && $post_type === TMM_Ext_PostType_Car::$slug) {
         if (isset($show_buttons['single_car']) && $show_buttons['single_car'] === '0') {
             return '';
         }
     }
     echo TMM_AddThis_Controller::draw_free_page(TMM_AddThis_Controller::get_application_path() . '/views/output.php', $atts);
 }
Exemplo n.º 13
0
 public static function change_options()
 {
     $action_type = $_REQUEST['type'];
     $data = array();
     parse_str($_REQUEST['values'], $data);
     $data = TMM_Helper::db_quotes_shield($data);
     switch ($action_type) {
         case 'save':
             if (!empty($data)) {
                 foreach ($data as $option => $newvalue) {
                     if ($option == "sidebars") {
                         unset($newvalue[0]);
                         TMM::update_option('sidebars', $newvalue);
                         continue;
                     }
                     if ($option == "seo_group") {
                         unset($newvalue[0]);
                         TMM::update_option('seo_groups', $newvalue);
                         continue;
                     }
                     if ($option == "contact_form") {
                         if (!empty($newvalue)) {
                             foreach ($newvalue as $key => $form) {
                                 if (!isset($newvalue[$key]['title'])) {
                                     unset($newvalue[$key]);
                                 }
                                 if (empty($newvalue[$key]['title'])) {
                                     unset($newvalue[$key]);
                                 }
                             }
                         }
                         TMM_Contact_Form::save($newvalue);
                         continue;
                     }
                     if (is_array($newvalue)) {
                         self::update_option($option, $newvalue);
                     } else {
                         $newvalue = stripcslashes($newvalue);
                         $newvalue = str_replace('\\"', '"', $newvalue);
                         $newvalue = str_replace("\\'", "'", $newvalue);
                         self::update_option($option, $newvalue);
                     }
                 }
             }
             _e('Options have been updated.', 'almera');
             break;
         case 'reset':
             if (!empty($data)) {
                 foreach ($data as $option => $newvalue) {
                     if ($option == "sidebars") {
                         continue;
                     }
                     if ($option == "contact_form") {
                         continue;
                     }
                     self::update_option($option, $newvalue);
                 }
             }
             _e('Options have been reset.', 'almera');
             break;
         default:
             break;
     }
     //**** CSS REGENERATION
     $custom_css1 = self::draw_free_page(TMM_THEME_PATH . '/admin/theme_options/custom_css1.php');
     $custom_css2 = self::draw_free_page(TMM_THEME_PATH . '/admin/theme_options/custom_css2.php');
     $handle = fopen(TMM_THEME_PATH . '/css/custom1.css', 'w');
     fwrite($handle, $custom_css1);
     fclose($handle);
     $handle = fopen(TMM_THEME_PATH . '/css/custom2.css', 'w');
     fwrite($handle, $custom_css2);
     fclose($handle);
     exit;
 }
Exemplo n.º 14
0
 public static function draw_group_slider($post_id, $page_slider_type, $alias = 0)
 {
     if (!isset(self::$slider_options[$page_slider_type])) {
         return "";
     }
     $data = array();
     $data['post_id'] = $post_id;
     $data['slides'] = self::get_page_slides($post_id);
     $data['options'] = self::get_slider_js_options($page_slider_type);
     $data['alias'] = $alias;
     $_REQUEST['page_slider_activated'] = TRUE;
     //if I need to know is page slider activated
     return TMM::draw_free_page(self::get_application_path() . '/items/' . $page_slider_type . '/views/page_output.php', $data);
 }
Exemplo n.º 15
0
    public static function show_custom_sidebars()
    {
        //set areas
        $sidebars = TMM::get_option('sidebars');
        //get current page id
        $type = "page";
        $current_id = 0;
        wp_reset_query();
        global $post;
        if (is_category()) {
            $type = 'cat';
            $current_id = get_query_var('cat');
        } else {
            if (is_page()) {
                $type = 'page';
                $current_id = $post->ID;
            }
        }
        //open wigitised areas
        $show_default_sidebar = true;
        if (is_array($sidebars)) {
            //show custom sidebar
            foreach ($sidebars as $area) {
                if ($type == "cat") {
                    $cat_id = $current_id;
                    if (in_array($cat_id, $area['cat'])) {
                        if ($cat_id != 0) {
                            $show_default_sidebar = false;
                            dynamic_sidebar($area['name']);
                        }
                    }
                } else {
                    $post_id = $current_id;
                    if (in_array($post_id, $area['page'])) {
                        if ($post_id != 0) {
                            $show_default_sidebar = false;
                            dynamic_sidebar($area['name']);
                        }
                    }
                }
            }
        }
        //show default sidebar
        if ($show_default_sidebar) {
            if (function_exists('dynamic_sidebar') and dynamic_sidebar('Thememakers Default Sidebar')) {
            } else {
                ?>
				<div class="widget widget_categories">
					<h3 class="widget-title"><?php 
                _e('Categories', 'almera');
                ?>
</h3>
					<ul class="categories">
						<?php 
                wp_list_categories('sort_column=name&optioncount=1&hierarchical=0&title_li=0');
                ?>
					</ul>                    
				</div>
				<div class="widget widget_calendar">
					<h3 class="widget-title"><?php 
                _e('Calendar', 'almera');
                ?>
</h3>
					<?php 
                get_calendar();
                ?>
				</div>

				<div class="widget widget_meta">
					<h3 class="widget-title"><?php 
                _e('Meta', 'almera');
                ?>
</h3>
					<ul>
						<?php 
                wp_register();
                ?>
						<li>
							<?php 
                wp_loginout();
                ?>
						</li>
						<?php 
                wp_meta();
                ?>
					</ul>

				</div>				

			<?php 
            }
        }
    }
								</label>
							</th>
							<td>
								<p><a href="#" class="add-images-to-page button"><?php 
            _e('Add Images', 'almera');
            ?>
</a></p>
								<ul id="post_pod_gallery">
									<?php 
            if (!empty($post_type_values[$post_pod_type]) and is_array($post_type_values[$post_pod_type])) {
                ?>
										<?php 
                foreach ($post_type_values[$post_pod_type] as $imgurl) {
                    ?>
											<?php 
                    echo TMM::draw_html('page/draw_post_podtype_gallery_image', array('imgurl' => $imgurl));
                    ?>
										<?php 
                }
                ?>
									<?php 
            }
            ?>
								</ul>
								<div class="clear"></div>
							</td>
						</tr>
					</table>
					<?php 
            break;
        default:
Exemplo n.º 17
0
 public static function add_post_podtype_gallery_image()
 {
     $data = array();
     $data['imgurl'] = $_REQUEST['imgurl'];
     echo TMM::draw_html('page/draw_post_podtype_gallery_image', $data);
     exit;
 }
Exemplo n.º 18
0
                </article>

                    
            <?php 
        }
    }
} else {
    if (!empty($posts_array)) {
        wp_enqueue_style('tmm_mediaelement');
        wp_enqueue_script('mediaelement');
        for ($i = 0; $i < $posts_per_load; $i++) {
            $post = $posts_array[$i];
            $data = array();
            $data['post_key'] = $i;
            $data['title_symbols'] = $title_symbols;
            echo TMM::draw_html('post/masonry_piece', $data);
        }
    }
}
?>
       
            
	</div><!--/ .post-area-->

	<?php 
if ($blog_type == 'masonry') {
    tmm_enqueue_script('owlcarousel');
    tmm_enqueue_style('owlcarousel');
    tmm_enqueue_style('owltheme');
    tmm_enqueue_style('owltransitions');
    $next_posts = "";
Exemplo n.º 19
0
<?php

$now = current_time('timestamp');
$start = strtotime(date("Y", $now) . '-' . date("m", $now) . '-' . 01, $now);
$end = mktime(0, 0, 0, date("m", $start) + 1, 1, date("Y", $start));
?>

<h3 class="widget-title"><span id="events_listing_month"></span>&nbsp;<span id="events_listing_year"></span></h3>

<?php 
if (TMM::get_option("events_listing_show_categories") == 1) {
    $args = array('orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(), 'fields' => 'all', 'hierarchical' => true);
    $categories = get_terms(array('events-categories'), $args);
    ?>
	<div class="sel">
		<select id="app_event_listing_categories" autocomplete="off">
			<option value="0"><?php 
    _e('All categories', TMM_EVENTS_PLUGIN_TEXTDOMAIN);
    ?>
</option>
				<?php 
    if (!empty($categories)) {
        foreach ($categories as $cat) {
            ?>
						<option value="<?php 
            echo $cat->term_taxonomy_id;
            ?>
"><?php 
            echo $cat->name;
            ?>
</option>
Exemplo n.º 20
0
        } else {
            $video_icon = '';
            $th_url = get_grid_image_url($images[$i]);
        }
    }
    ?>
                    <?php 
    $t = implode('', $title);
    ?>
                                        
                    <figure class="gr-figure">
                        <a class="gr-lightbox single-image <?php 
    echo $video_icon;
    ?>
 plus-icon animTop" title="<?php 
    echo $t = TMM::get_option('hide_image_titles') == '0' ? $t : '';
    ?>
" 
                           href="<?php 
    echo get_grid_image_url($images[$i], true);
    ?>
" data-fancybox-group="grid">
                            <img <?php 
    if ($slideup == '1') {
        ?>
 class="slideup" <?php 
    }
    ?>
 src="<?php 
    echo TMM_Helper::resize_image($th_url, '995*995');
    ?>
Exemplo n.º 21
0
        if (is_object($post)) {
            switch ($post->post_type) {
                case 'post':
                    $meta_title = TMM::get_option("meta_title_post_listing");
                    $meta_keywords = TMM::get_option("meta_keywords_post_listing");
                    $meta_description = TMM::get_option("meta_description_post_listing");
                    break;
                case TMM_Portfolio::$slug:
                    $meta_title = TMM::get_option("meta_title_portfolio_listing");
                    $meta_keywords = TMM::get_option("meta_keywords_portfolio_listing");
                    $meta_description = TMM::get_option("meta_description_portfolio_listing");
                    break;
                case TMM_Gallery::$slug:
                    $meta_title = TMM::get_option("meta_title_gallery_listing");
                    $meta_keywords = TMM::get_option("meta_keywords_gallery_listing");
                    $meta_description = TMM::get_option("meta_description_gallery_listing");
                    break;
                default:
                    break;
            }
        }
        //***
        global $cat;
        $cat_head_seo_data = TMM_SEO_Group::get_cat_head_seo_data($cat);
        if (!empty($cat_head_seo_data['meta_title'])) {
            $meta_title = $cat_head_seo_data['meta_title'];
            $meta_keywords = $cat_head_seo_data['meta_keywords'];
            $meta_description = $cat_head_seo_data['meta_description'];
        }
    }
}
Exemplo n.º 22
0
    die('No direct access allowed');
}
/*
 Template Name: Folio Layout 1(Grid)
*/
get_header('folio');
$folio_post_id = 0;
?>

<div class="ajax">

	<?php 
if (TMM::get_option('folio_tpl_show_folios_bar')) {
    ?>
		<?php 
    $folios = TMM::get_option('folio_template1_items');
    ?>
		<?php 
    if (!empty($folios)) {
        ?>
			<ul class="scroll-box-nav" id="folio_categories_bar">
				<?php 
        foreach ($folios as $post_id) {
            ?>
					<?php 
            if ($folio_post_id == 0) {
                $folio_post_id = $post_id;
            }
            ?>
					<li><a href="#" data-post-id="<?php 
            echo $post_id;
Exemplo n.º 23
0
 public static function get_masonry_piece()
 {
     $post_key = (int) $_REQUEST['post_key'];
     $posts = $_REQUEST['posts'];
     if (!isset($posts[$post_key])) {
         echo "";
         exit;
     } else {
         $data = array();
         $data['folioposts'] = $posts;
         $data['foliopost_key'] = $post_key;
         $data['foliopost'] = $posts[$post_key];
         $data['current_col_algoritm'] = $_REQUEST['current_col_algoritm'];
         echo TMM::draw_html('portfolio/shortcodes/masonry_piece', $data);
     }
     exit;
 }
            </div><!--/ .bordered-->
            
            <?php 
        }
        ?>

			<?php 
        $event_allday = get_post_meta($post->ID, 'event_allday', true);
        $hide_event_place = get_post_meta($post->ID, 'hide_event_place', true);
        $event_place_address = get_post_meta($post->ID, 'event_place_address', true);
        $ev_mktime = (int) get_post_meta($post->ID, 'ev_mktime', true);
        $event_date = TMM_Event::get_event_date($ev_mktime);
        $ev_end_mktime = (int) get_post_meta($post->ID, 'ev_end_mktime', true);
        $event_end_date = TMM_Event::get_event_date($ev_end_mktime);
        $repeats_every = get_post_meta($post->ID, 'event_repeating', true);
        $events_show_duration = TMM::get_option('events_show_duration');
        if ($events_show_duration) {
            $event_duration_sec = TMM_Event::get_event_duration($ev_mktime, $ev_end_mktime);
            $duration_hh = $event_duration_sec[0];
            $duration_mm = $event_duration_sec[1];
        }
        if ($event_allday == 1) {
            $event_start_time = '';
            $event_end_time = '';
        } else {
            $event_start_time = TMM_Event::get_event_time($ev_mktime);
            $event_end_time = TMM_Event::get_event_time($ev_end_mktime);
        }
        $e_category = get_the_term_list($post->ID, 'events-categories', '', ', ', '');
        ?>
Exemplo n.º 25
0
	<div class="entry-meta">
		
		<?php 
    if (TMM::get_option("blog_listing_show_date")) {
        ?>
			<span class="date"><a href="#"><?php 
        echo mysql2date(get_option('date_format'), $post->post_date, false);
        ?>
</a></span>
		<?php 
    }
    ?>
	
			
		<?php 
    if (!TMM::get_option("blog_listing_show_comments")) {
        ?>
	
			<span class="comments"><a href="<?php 
        echo $post_link;
        ?>
#comments"><?php 
        echo get_comments_number($post->ID);
        ?>
</a>&nbsp;<?php 
        _e('Comments', 'tmm_shortcodes');
        ?>
</span>
		<?php 
    }
    ?>
    <label for="<?php 
echo $widget->get_field_id('form');
?>
"><?php 
_e('Form', 'almera');
?>
:</label>
    <select id="<?php 
echo $widget->get_field_id('form');
?>
" name="<?php 
echo $widget->get_field_name('form');
?>
" class="widefat">
		<?php 
$contact_forms = TMM::get_option('contact_form');
$current_form = $instance['form'];
?>
		<?php 
if (!empty($contact_forms)) {
    ?>
			<?php 
    foreach ($contact_forms as $contact_form) {
        ?>
				<option <?php 
        echo $current_form == $contact_form['title'] ? "selected" : "";
        ?>
 value="<?php 
        echo $contact_form['title'];
        ?>
"><?php 
Exemplo n.º 27
0
        } else {
            $sidebar_position = TMM::get_option("sidebar_position");
        }
        if (!$sidebar_position) {
            $sidebar_position = "sbr";
        }
        //*****
    } else {
        $sidebar_position = 'no_sidebar';
    }
}
//***
//is portfolio archive
if (is_archive()) {
    if (is_post_type_archive(TMM_Portfolio::$slug)) {
        $sidebar_position = TMM::get_option('folio_archive_sidebar');
        if (empty($sidebar_position)) {
            $sidebar_position = 'no_sidebar';
        }
    }
}
$_REQUEST['sidebar_position'] = $sidebar_position;
if (is_post_type_archive() == TMM_Portfolio::$slug) {
    if (is_archive()) {
        $_REQUEST['sidebar_position'] = 'sbr';
        $sidebar_position = 'sbr';
    }
}
?>

		<!-- - - - - - - - - - - - - - - - Dynamic Content - - - - - - - - - - - - - - - - -->
Exemplo n.º 28
0
 public static function draw_wrapper_bg()
 {
     $disable_body_bg = TMM::get_option('disable_body_bg');
     if (!$disable_body_bg) {
         $body_pattern = TMM::get_option('body_pattern');
         $body_pattern_custom_color = TMM::get_option('body_pattern_custom_color');
         $body_pattern_selected = (int) TMM::get_option('body_pattern_selected');
         $body_bg_color_selected = TMM::get_option('body_bg_color');
         if ($body_pattern_selected == 0 or $body_pattern_selected == 1) {
             if (!empty($body_pattern)) {
                 return "background: url(" . $body_pattern . ") repeat 0 0 " . $body_bg_color_selected . ";";
             } else {
                 return "";
             }
         } else {
             if (!empty($body_pattern_custom_color)) {
                 return "background: " . $body_pattern_custom_color;
             } else {
                 return '';
             }
         }
     }
 }
Exemplo n.º 29
0
    echo $video_icon;
    ?>
" data-video-youtube="<?php 
    echo $data_youtube;
    ?>
" data-video-vimeo="<?php 
    echo $data_vimeo;
    ?>
" src="<?php 
    echo $th_url;
    ?>
" alt="" data-title="#caption-<?php 
    echo $i;
    ?>
" title="<?php 
    echo $t = TMM::get_option('hide_image_titles') == '0' ? '#caption-' . $i : '';
    ?>
" />
				<?php 
}
?>
			</div><!--/ #slides-->

			<?php 
for ($i = 0; $i < count($images); $i++) {
    ?>
				<?php 
    if (!empty($images[$i]['title'])) {
        ?>
					<div id="caption-<?php 
        echo $i;
Exemplo n.º 30
0
    public static function draw_theme_option($data, $prefix = TMM_THEME_PREFIX)
    {
        $value = "";
        //sometimes I have value or cant get in by TMM::get_option
        if (isset($data['value'])) {
            $value = $data['value'];
        } else {
            $value = TMM::get_option($data['name'], $prefix);
        }
        if (empty($value) && '0' != $value) {
            $value = @$data['default_value'];
        }
        $pl = $value;
        if ($data['name'] == 'admin_social_links[twitter]' || $data['name'] == 'admin_social_links[facebook]' || $data['name'] == 'admin_social_links[dribbble]' || $data['name'] == 'admin_social_links[vimeo]' || $data['name'] == 'admin_social_links[youtube]' || $data['name'] == 'admin_social_links[pinterest]' || $data['name'] == 'admin_social_links[instagram]' || $data['name'] == 'admin_social_links[linkedin]' || $data['name'] == 'admin_social_links[flickr]' || $data['name'] == 'admin_social_links[gplus]' || $data['name'] == 'admin_social_links[behance]' || $data['name'] == 'admin_social_links[rss]') {
            $value_name = explode('[', $data['name']);
            $value_name = $value_name['1'];
            $value_name = explode(']', $value_name);
            $value_name = $value_name['0'];
            $value = TMM::get_option('admin_social_links');
            $value = $value[$value_name];
            $pl = @$data['default_value'];
        }
        switch ($data['type']) {
            case 'slider':
                ?>
				<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
					<div class="clearfix ">
						<div class="admin-one-half">
							<p>
							<?php 
                }
                ?>
							<input data-default-value="<?php 
                echo @$data['default_value'];
                ?>
" type="text" name="<?php 
                echo $data['name'];
                ?>
" value="<?php 
                echo $value;
                ?>
" min-value="<?php 
                echo $data['min'];
                ?>
" max-value="<?php 
                echo $data['max'];
                ?>
" class="ui_slider_item" />
							<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
							</p>
						</div>

						<div class="admin-one-half last">
              
							<p class="admin-info">
								<?php 
                    echo $data['description'];
                    ?>
							</p>
						</div>
					</div>
				<?php 
                }
                ?>
				<?php 
                break;
            case 'text':
                ?>
				<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
					<div class="clearfix ">
						<div class="admin-one-half">
							<p>
							<?php 
                }
                ?>
                                                            <input placeholder="<?php 
                echo $pl;
                ?>
" data-default-value="<?php 
                echo @$data['default_value'];
                ?>
" type="text" class="<?php 
                echo @$data['css_class'];
                ?>
" name="<?php 
                echo $data['name'];
                ?>
" value="<?php 
                echo $value;
                ?>
">
							<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
							</p>
						</div>

						<div class="admin-one-half last">
                                                    <p class="admin-info">
								<?php 
                    echo $data['description'];
                    ?>
                                                    </p>
                                                    <?php 
                    if ($data['name'] == 'admin_social_links[twitter]' || $data['name'] == 'admin_social_links[facebook]' || $data['name'] == 'admin_social_links[dribbble]' || $data['name'] == 'admin_social_links[vimeo]' || $data['name'] == 'admin_social_links[youtube]' || $data['name'] == 'admin_social_links[pinterest]' || $data['name'] == 'admin_social_links[instagram]' || $data['name'] == 'admin_social_links[linkedin]' || $data['name'] == 'admin_social_links[flickr]' || $data['name'] == 'admin_social_links[google]' || $data['name'] == 'admin_social_links[behance]' || $data['name'] == 'admin_social_links[rss]') {
                        ?>
                                                            <div class="row-mover"></div>
                                                            <?php 
                    }
                    ?>
							
						</div>
					</div>
				<?php 
                }
                ?>
				<?php 
                break;
            case 'textarea':
                ?>
				<?php 
                if (!@$data['hide_item_html']) {
                    ?>
					<div class="clearfix ">
						<div class="admin-one-half">
							<p>
							<?php 
                }
                ?>
							<textarea data-default-value="<?php 
                echo @$data['default_value'];
                ?>
" name="<?php 
                echo $data['name'];
                ?>
" class="<?php 
                echo $data['css_class'];
                ?>
"><?php 
                echo $value;
                ?>
</textarea>
							<?php 
                if (!@$data['hide_item_html']) {
                    ?>
							</p>
						</div>
						<div class="admin-one-half last">
							<p class="admin-info">
								<?php 
                    echo $data['description'];
                    ?>
							</p>
						</div>
					</div>
				<?php 
                }
                ?>
				<?php 
                break;
            case 'select':
                ?>
				<?php 
                if (!@$data['hide_item_html']) {
                    ?>
					<div class="clearfix ">
						<div class="admin-one-half">
						<?php 
                }
                ?>
						<select data-default-value="<?php 
                echo @$data['default_value'];
                ?>
" name="<?php 
                echo $data['name'];
                ?>
" class="<?php 
                echo $data['css_class'];
                ?>
">
							<?php 
                if (!empty($data['values'])) {
                    ?>
								<?php 
                    foreach ($data['values'] as $key => $option_text) {
                        ?>
									<option value="<?php 
                        echo $key;
                        ?>
" <?php 
                        echo $value == $key ? 'selected=""' : "";
                        ?>
><?php 
                        echo $option_text;
                        ?>
</option>
								<?php 
                    }
                    ?>
							<?php 
                }
                ?>
						</select>
						<?php 
                if (!@$data['hide_item_html']) {
                    ?>
						</div>
						<div class="admin-one-half last">
							<p class="admin-info">
								<?php 
                    echo $data['description'];
                    ?>
							</p>
						</div>
					</div>
				<?php 
                }
                ?>
				<?php 
                break;
            case 'checkbox':
                ?>
				<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
					<div class="clearfix">
						<div class="admin-one-half">
							<p>
							<?php 
                }
                ?>
							<input data-default-value="<?php 
                echo @$data['default_value'];
                ?>
" type="hidden" value="<?php 
                echo $value == 1 ? "1" : "0";
                ?>
" name="<?php 
                echo $data['name'];
                ?>
">
							<input type="checkbox" id="<?php 
                echo $data['name'];
                ?>
" class="option_checkbox <?php 
                echo $data['css_class'];
                ?>
" <?php 
                echo $value == 1 ? "checked" : "";
                ?>
 />
							<label for="<?php 
                echo $data['name'];
                ?>
"><span></span><?php 
                echo $data['title'];
                ?>
</label>

							<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
							</p>
						</div>
						<div class="admin-one-half last">
							<p class="admin-info">
								<?php 
                    echo $data['description'];
                    ?>
							</p>
						</div>
					</div>
				<?php 
                }
                ?>
				<?php 
                break;
            case 'color':
                ?>
				<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
					<div class="clearfix ">
						<div class="admin-one-half">
						<?php 
                }
                ?>
						<input data-default-value="<?php 
                echo @$data['default_value'];
                ?>
" value-index="0" type="text" class="bg_hex_color text small <?php 
                echo @$data['css_class'];
                ?>
" value="<?php 
                echo $value;
                ?>
" name="<?php 
                echo $data['name'];
                ?>
">
						<div class="bgpicker" style="background-color: <?php 
                echo $value;
                ?>
"></div>
						<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>

							<?php 
                    if (@$_GET['page'] == 'tmm_theme_options') {
                        ?>
								<a href="javascript:void(0);" class="js_picker_val_back" title="Back">back</a>&nbsp;
								<a href="javascript:void(0);" class="js_picker_val_ahead" title="Forward">forward</a>&nbsp;
								<a href="javascript:void(0);" class="js_picker_val_reset" title="Reset">reset</a>
							<?php 
                    }
                    ?>

						</div>
						<div class="admin-one-half last">
							<p class="admin-info">
								<?php 
                    echo $data['description'];
                    ?>
							</p>
						</div>
					</div>
				<?php 
                }
                ?>
				<?php 
                break;
            case 'google_font_select':
                ?>
				<select data-default-value="" name="<?php 
                echo $data['name'];
                ?>
" class="google_font_select">
					<?php 
                foreach ($data['fonts'] as $font_name) {
                    ?>
						<?php 
                    $font_clean_name = explode(":", $font_name);
                    $font_clean_name = $font_clean_name[0];
                    ?>
						<option <?php 
                    echo $font_clean_name == $value ? "selected" : "";
                    ?>
 value="<?php 
                    echo $font_clean_name;
                    ?>
"><?php 
                    echo $font_name;
                    ?>
</option>
					<?php 
                }
                ?>
				</select>&nbsp;<a title="" class="admin-button button-gray button-medium" href="javascript:add_google_font();void(0);"><?php 
                _e('Browse', 'almera');
                ?>
</a>

				<?php 
                break;
            case 'upload':
                ?>
				<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
					<div class="clearfix ">
						<div class="admin-one-half">
						<?php 
                }
                ?>
						<input data-default-value="" id="<?php 
                echo @$data['id'];
                ?>
" class="middle" type="text" name="<?php 
                echo $data['name'];
                ?>
" value="<?php 
                echo $value;
                ?>
">
						<a class="admin-button button-gray button-medium button_upload" href="#"><?php 
                _e('Browse', 'almera');
                ?>
</a>

						<?php 
                if (@(!$data['hide_item_html'])) {
                    ?>
						</div>
						<div class="admin-one-half last">
							<p class="admin-info">
								<?php 
                    echo $data['description'];
                    ?>
							</p>
						</div>
					</div>
				<?php 
                }
                ?>
				<?php 
                break;
            default:
                _e('Option type does not exist!', 'almera');
                break;
        }
    }