示例#1
0
        public function add_slider_option_element()
        {
            $slider_meta_box = $this->slider_meta_box;
            global $post;
            echo '<div id="cp-overlay-wrapper">';
            ?>
 <div class="gallery-option-meta" id="gallery-option-meta"> <?php 
            //set_nonce();
            foreach ($slider_meta_box as $meta_box) {
                //echo '<pre>';print_r($meta_box);die;
                if ($meta_box['type'] == 'sliderpicker') {
                    $xml_string = get_post_meta($post->ID, $meta_box['xml'], true);
                    if (!empty($xml_string)) {
                        $xml_val = new DOMDocument();
                        $xml_val->loadXML($xml_string);
                        $meta_box['value'] = $xml_val->documentElement;
                    }
                    self::print_slider_picker($meta_box);
                } else {
                    $meta_box['value'] = get_post_meta($post->ID, $meta_box['name'], true);
                    print_meta($meta_box);
                }
            }
            ?>
 </div> <?php 
            echo '</div>';
        }
示例#2
0
function add_post_option_element()
{
    global $post, $post_meta_boxes;
    // init array
    $post_meta_boxes['Choose Left Sidebar']['options'] = get_sidebar_name();
    $post_meta_boxes['Choose Right Sidebar']['options'] = $post_meta_boxes['Choose Left Sidebar']['options'];
    echo '<div id="gdl-overlay-wrapper">';
    ?>
 <div class="post-option-meta" id="post-option-meta"> <?php 
    set_nonce();
    foreach ($post_meta_boxes as $meta_box) {
        if ($meta_box['type'] == 'imagepicker') {
            $xml_string = get_post_meta($post->ID, $meta_box['xml'], true);
            if (!empty($xml_string)) {
                $xml_val = new DOMDocument();
                $xml_val->loadXML($xml_string);
                $meta_box['value'] = $xml_val->documentElement;
            }
        } else {
            if ($meta_box['type'] == 'open' || $meta_box['type'] == 'close') {
            } else {
                $meta_box['value'] = get_post_meta($post->ID, $meta_box['name'], true);
            }
        }
        print_meta($meta_box);
        if ($meta_box['type'] != 'open' && $meta_box['type'] != 'close') {
            echo "<div class='clear'></div>";
            echo empty($meta_box['hr']) ? '<hr class="separator mt20">' : '';
        }
    }
    ?>
 </div> <?php 
    echo '</div>';
}
function add_gallery_option_element()
{
    global $post, $gallery_meta_box;
    echo '<div id="gdl-overlay-wrapper">';
    ?>
 <div class="gallery-option-meta" id="gallery-option-meta"> <?php 
    set_nonce();
    foreach ($gallery_meta_box as $meta_box) {
        if ($meta_box['type'] == 'gallerypicker') {
            $xml_string = get_post_meta($post->ID, $meta_box['xml'], true);
            if (!empty($xml_string)) {
                $xml_val = new DOMDocument();
                $xml_val->loadXML($xml_string);
                $meta_box['value'] = $xml_val->documentElement;
            }
            print_gallery_picker($meta_box);
        } else {
            $meta_box['value'] = get_post_meta($post->ID, $meta_box['name'], true);
            print_meta($meta_box);
        }
    }
    ?>
 </div> <?php 
    echo '</div>';
}
示例#4
0
function add_testimonial_option_element()
{
    global $post, $testimonial_meta_boxes;
    echo '<div id="gdl-overlay-wrapper">';
    ?>
 <div class="testimonial-option-meta" id="testimonial-option-meta"> <?php 
    set_nonce();
    foreach ($testimonial_meta_boxes as $meta_box) {
        $meta_box['value'] = get_post_meta($post->ID, $meta_box['name'], true);
        print_meta($meta_box);
    }
    ?>
 </div> <?php 
    echo '</div>';
}
示例#5
0
function add_price_table_option_element()
{
    global $post, $price_table_meta_boxes;
    echo '<div id="gdl-overlay-wrapper">';
    ?>
 <div class="testimonial-option-meta" id="testimonial-option-meta"> <?php 
    set_nonce();
    foreach ($price_table_meta_boxes as $meta_box) {
        $meta_box['value'] = get_post_meta($post->ID, $meta_box['name'], true);
        print_meta($meta_box);
        if (empty($meta_box['hr'])) {
            echo '<hr class="separator mt20" />';
        }
    }
    ?>
 </div> <?php 
    echo '</div>';
}
示例#6
0
function print_header($no_body = 0)
{
    global $doc_name;
    global $css_file;
    print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\n";
    print " \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n";
    print "<html>\n";
    print "<head>\n";
    print "<title>{$doc_name}</title>\n";
    print_meta();
    if ($css_file) {
        print "<link rel=stylesheet type=\"text/css\" href=\"{$css_file}\">";
    } else {
        $style_body = "marginwidth=\"0px\" marginheight=\"0px\" leftmargin=\"0px\" topmargin=\"0px\" " . style_body();
    }
    print "</head>\n";
    if ($no_body == 0) {
        print "<body {$style_body}>\n";
    }
}
示例#7
0
function add_package_option_element()
{
    global $post, $package_meta_boxes;
    // init array
    $package_meta_boxes['Choose Left Sidebar']['options'] = get_sidebar_name();
    $package_meta_boxes['Choose Right Sidebar']['options'] = $package_meta_boxes['Choose Left Sidebar']['options'];
    echo '<div id="gdl-overlay-wrapper">';
    ?>
 <div class="testimonial-option-meta" id="testimonial-option-meta"> <?php 
    set_nonce();
    foreach ($package_meta_boxes as $meta_box) {
        $meta_box['value'] = get_post_meta($post->ID, $meta_box['name'], true);
        print_meta($meta_box);
        if (empty($meta_box['hr'])) {
            echo '<hr class="separator mt20" />';
        }
    }
    ?>
 </div> <?php 
    echo '</div>';
}
示例#8
0
function print_page_elements($args, $xml_val, $item_type)
{
    extract($args);
    $head_type = $item_type;
    if (empty($xml_val)) {
        $head_size = '';
        $head_name = array('item' => $item, 'size' => $size, 'itemname' => '', 'sizename' => '');
    } else {
        $head_size = find_xml_value($xml_val, 'size');
        $head_name = array('item' => $item, 'size' => $size, 'itemname' => $item . '[]', 'sizename' => $size . '[]');
    }
    print_page_item_identical($head_name, $head_size, $head_type);
    ?>
			
			<div class="page-element-edit-box" id="page-element-edit-box">
			
			<?php 
    foreach ($name[$item_type] as $input_key => $input_value) {
        if ($input_key == 'slider-item') {
            $slider_value = find_xml_node($xml_val, 'slider-item');
            print_image_picker(array('name' => $input_value, 'value' => $slider_value));
        } else {
            if ($input_key == 'tab-item') {
                print_box_tab($input_value, find_xml_node($xml_val, 'tab-item'));
            } else {
                $input_value['value'] = find_xml_value($xml_val, $input_key);
                $input_value['name'] = $input_value['name'] . '[]';
                print_meta($input_value);
            }
        }
        if ($input_key != 'open' && $input_key != 'close') {
            echo empty($input_value['hr']) ? '<hr class="separator mt20">' : '';
        }
    }
    ?>
			
			</div>
		</div>
		
		<?php 
}
function add_portfolio_option_element()
{
    global $post, $portfolio_meta_boxes;
    // init array
    $portfolio_meta_boxes['Choose Left Sidebar']['options'] = get_sidebar_name();
    $portfolio_meta_boxes['Choose Right Sidebar']['options'] = $portfolio_meta_boxes['Choose Left Sidebar']['options'];
    if (get_option(THEME_SHORT_NAME . '_use_portfolio_as') == 'portfolio style') {
        unset($portfolio_meta_boxes['Author Infomation']);
        unset($portfolio_meta_boxes['Portfolio Header']);
        unset($portfolio_meta_boxes['Social Sharing']);
    } else {
        unset($portfolio_meta_boxes['Clients Name']);
        unset($portfolio_meta_boxes['Skill Value']);
        unset($portfolio_meta_boxes['Website Url']);
    }
    echo '<div id="gdl-overlay-wrapper">';
    ?>
 <div class="post-option-meta" id="post-option-meta"> <?php 
    set_nonce();
    foreach ($portfolio_meta_boxes as $meta_box) {
        if ($meta_box['type'] == 'imagepicker') {
            $xml_string = get_post_meta($post->ID, $meta_box['xml'], true);
            if (!empty($xml_string)) {
                $xml_val = new DOMDocument();
                $xml_val->loadXML($xml_string);
                $meta_box['value'] = $xml_val->documentElement;
            }
        } else {
            if ($meta_box['type'] == 'open' || $meta_box['type'] == 'close') {
            } else {
                $meta_box['value'] = get_post_meta($post->ID, $meta_box['name'], true);
            }
        }
        print_meta($meta_box);
        if ($meta_box['type'] != 'open' && $meta_box['type'] != 'close') {
            echo "<div class='clear'></div>";
            echo empty($meta_box['hr']) ? '<hr class="separator mt20">' : '';
        }
    }
    ?>
 </div> <?php 
    echo '</div>';
}