function show_portfolio_recently_viewed()
    {
        global $post;
        $result_html = '';
        $current_lang = '';
        if (class_exists('SitePress')) {
            $current_lang = ICL_LANGUAGE_CODE;
        }
        do_action('a3_portfolio_before_recently_widget');
        if (isset($_COOKIE['portfolio_recentviews' . $current_lang]) && is_array(json_decode($_COOKIE['portfolio_recentviews' . $current_lang])) && count(json_decode($_COOKIE['portfolio_recentviews' . $current_lang])) > 0) {
            $result_html .= '<div class="portfolio_recently_viewed_container">
			<div class="blockui-waiting"></div>
			<ul class="portfolio_recently_viewed">';
            $portfolio_recently_viewed = array_reverse(json_decode($_COOKIE['portfolio_recentviews' . $current_lang]));
            foreach ($portfolio_recently_viewed as $portfolio_id) {
                $_blank = a3_portfolio_get_image_blank();
                $portfolio_gallery = a3_portfolio_get_gallery($portfolio_id);
                if ($portfolio_gallery) {
                    $thumb = wp_get_attachment_image_src($portfolio_gallery[0], 'thumbnail', true);
                    $img = '<img class="a3_porfolio_thumb_widget_lazy thumbnail" src="' . $_blank . '" data-original="' . $thumb[0] . '" />';
                } else {
                    $thumb = a3_portfolio_no_image();
                    $img = '<img class="a3_porfolio_thumb_widget_lazy thumbnail" src="' . $_blank . '" data-original="' . $thumb . '" />';
                }
                $result_html .= '<li class="portfolio_recently_item portfolio_recently_item_' . $portfolio_id . '"><a href="' . get_permalink($portfolio_id) . '">' . $img . '</a><div class="portfolio_name"><a href="' . get_permalink($portfolio_id) . '">' . get_the_title($portfolio_id) . '</a></div><span class="remove_portfolio_item" data-id="' . $portfolio_id . '"><i class="a3-portfolio-icon-close"></i></span></li>';
            }
            $result_html .= '</ul>';
            $result_html .= '<div style="clear:both"></div><div class="portfolio_recently_button_container"><a href="#" class="clear_all_portfolio_recently">' . a3_portfolio_ei_ict_t__('Recently Widget - Clear All', __('Clear All', 'a3_portfolios')) . '</a></div><div style="clear:both"></div>';
            $result_html .= '</div>';
        } else {
            $result_html = '<div class="portfolio_recently_viewed_container">' . a3_portfolio_ei_ict_t__('Recently Widget - No Portfolio', __('No Portfolio Recently Viewed !', 'a3_portfolios')) . '</div>';
        }
        do_action('a3_portfolio_after_recently_widget');
        return $result_html;
    }
Пример #2
0
    // Exit if accessed directly
}
global $post;
$comma = '';
?>

<?php 
if ($portfolio_tags) {
    ?>

	<div class="clear"></div>

	<div class="portfolio_item_tags">

		<span class="label"><?php 
    echo a3_portfolio_ei_ict_t__('Tags field', __('Tags', 'a3_portfolios'));
    ?>
 : </span>

		<?php 
    foreach ($portfolio_tags as $term) {
        ?>

		<span class="item-block">
			<?php 
        echo $comma;
        ?>
			<a href="<?php 
        echo get_term_link($term, $term->slug);
        ?>
"><?php 
Пример #3
0
    // Exit if accessed directly
}
global $post;
$comma = '';
?>

<?php 
if ($portfolio_categories) {
    ?>

	<div class="clear"></div>

	<div class="portfolio_item_categories">

		<span class="label"><?php 
    echo a3_portfolio_ei_ict_t__('Categories field', __('Categories', 'a3_portfolios'));
    ?>
 : </span>

		<?php 
    foreach ($portfolio_categories as $term) {
        ?>

		<span class="item-block">
			<?php 
        echo $comma;
        ?>
			<a href="<?php 
        echo get_term_link($term, $term->slug);
        ?>
"><?php 
/**
 * a3_portfolio_get_launch_button()
 *
 * @return void
 */
function a3_portfolio_get_launch_button($portfolio_id = 0)
{
    if ($portfolio_id < 1) {
        $portfolio_id = get_the_ID();
    }
    $button_class = 'portfolio_button';
    $button_text = get_post_meta($portfolio_id, '_a3_portfolio_launch_button_text', true);
    $button_link = get_post_meta($portfolio_id, '_a3_portfolio_launch_site_url', true);
    $open_type = get_post_meta($portfolio_id, '_a3_portfolio_launch_open_type', true);
    if (empty($button_text) || $button_text == '') {
        $button_text = a3_portfolio_ei_ict_t__('Launch Site Button Text', __('LAUNCH SITE', 'a3_portfolios'));
    }
    $button_class = apply_filters('a3_portfolio_launch_button_class', $button_class, $portfolio_id);
    $button_text = apply_filters('a3_portfolio_launch_button_text', $button_text, $portfolio_id);
    $button_link = apply_filters('a3_portfolio_launch_site_url', $button_link, $portfolio_id);
    $open_type = apply_filters('a3_portfolio_launch_open_type', $open_type, $portfolio_id);
    a3_portfolio_get_template('expander/launch-button.php', array('launch_site_url' => $button_link, 'button_text' => $button_text, 'open_type' => $open_type, 'button_class' => $button_class));
}
 /**
  * Localize scripts only when enqueued
  */
 public function localize_printed_scripts()
 {
     global $wp;
     $rtl = is_rtl() ? 1 : 0;
     $current_lang = '';
     if (class_exists('SitePress')) {
         $current_lang = ICL_LANGUAGE_CODE;
     }
     if (wp_script_is('a3-portfolio-widgets-script')) {
         wp_localize_script('a3-portfolio-widgets-script', 'a3_portfolio_widgets_script_params', apply_filters('a3_portfolio_widgets_script_params', array('ajax_url' => admin_url('admin-ajax.php'), 'no_porfolio_text' => a3_portfolio_ei_ict_t__('Recently Widget - No Portfolio', __('No Portfolio Recently Viewed !', 'a3_portfolios')), 'lang' => $current_lang)));
     }
     if (wp_script_is('a3-portfolio-script')) {
         $number_columns = a3_portfolio_get_col_per_row();
         wp_localize_script('a3-portfolio-script', 'a3_portfolio_script_params', apply_filters('a3_portfolio_script_params', array('ajax_url' => admin_url('admin-ajax.php'), 'have_filters_script' => false, 'number_columns' => $number_columns, 'expander_template' => a3_portfolio_expander_template(), 'rtl' => $rtl, 'lang' => $current_lang)));
     }
     if (wp_script_is('a3-portfolio-single-script')) {
         wp_localize_script('a3-portfolio-single-script', 'a3_portfolio_single_script_params', apply_filters('a3_portfolio_single_script_params', array('ajax_url' => admin_url('admin-ajax.php'), 'lang' => $current_lang)));
     }
 }
Пример #6
0
echo a3_portfolio_ei_ict_t__('Mobile Navigation', __('Navigation', 'a3_portfolios'));
?>
</span>
</div>

<div style="clear:both"></div>

<div class="a3-portfolio-menus-container">

    <div style="clear:both"></div>

    <ul class="filter">

        <li>
            <a rel="*" href="#" class="filter-m active"><?php 
echo a3_portfolio_ei_ict_t__('All Filter', __('All', 'a3_portfolios'));
?>
</a>
        </li>

        <?php 
if (is_array($menus) && count($menus) > 0) {
    foreach ($menus as $menu_slug => $menu_name) {
        ?>
                <li class="_<?php 
        echo $menu_slug;
        ?>
">
                    <a rel="<?php 
        echo $menu_slug;
        ?>
Пример #7
0
	</span>

	<span class="social-action social-action-pinterest_mod">

		<a onclick="window.open('http://pinterest.com/pin/create/button/?url=<?php 
echo $postlink;
?>
&media=<?php 
echo urlencode($postimage);
?>
&description=<?php 
echo get_the_title($portfolio_id);
?>
', 'popupwindow', 'width=670,height=300,scrollbars,resizable'); return false;"
			href="#"><?php 
echo a3_portfolio_ei_ict_t__('Social - Pinterest', __('Pinterest', 'a3_portfolios'));
?>
</a>

	</span>

	<?php 
do_action('a3_portfolio_after_social_icons', $portfolio_id);
?>

	<div style="clear:both"></div>

</div>

<div style="clear:both"></div>
    /**
     * Output the metabox
     */
    public function output($post)
    {
        global $a3_portfolio_item_posts_settings;
        $thepostid = $post->ID;
        $this->include_js();
        $wide = trim(get_post_meta($thepostid, '_a3_portfolio_meta_gallery_wide', true));
        if ('' == $wide) {
            $wide = $a3_portfolio_item_posts_settings['portfolio_inner_container_single_main_image_width'];
        }
        if ('' == $wide) {
            $wide = 70;
        }
        $thumb_pos = trim(get_post_meta($thepostid, '_a3_portfolio_meta_thumb_position', true));
        if ('' == $thumb_pos) {
            $thumb_pos = $a3_portfolio_item_posts_settings['portfolio_inner_container_single_thumb_position'];
        }
        $button_visit = trim(get_post_meta($thepostid, '_a3_portfolio_launch_site_url', true));
        $button_text = trim(esc_attr(get_post_meta($thepostid, '_a3_portfolio_launch_button_text', true)));
        $button_text = apply_filters('a3_portfolio_backend_launch_button_text', $button_text, $thepostid);
        if ('' == $button_text) {
            $button_text = a3_portfolio_ei_ict_t__('Launch Site Button Text', __('LAUNCH SITE', 'a3_portfolios'));
        }
        $launch_open_type = trim(esc_attr(get_post_meta($thepostid, '_a3_portfolio_launch_open_type', true)));
        ?>
		<div class="a3rev_panel_container a3-metabox-panel-wrap">

			<div class="a3-metabox-tabs-back"></div>

			<ul class="a3-metabox-data-tabs" style="display:none;">
				<?php 
        $portfolio_data_tabs = apply_filters('a3_portfolio_metabox_data_tabs', array('portfolio_gallery' => array('label' => __('Portfolio Gallery', 'a3_portfolios'), 'target' => 'portfolio_gallery_panel', 'class' => array()), 'single_layout' => array('label' => __('Layout', 'a3_portfolios'), 'target' => 'portfolio_single_layout_panel', 'class' => array()), 'featue_data' => array('label' => __('Feature Data', 'a3_portfolios'), 'target' => 'portfolio_featue_data_panel', 'class' => array()), 'portfolio_button' => array('label' => __('Button', 'a3_portfolios'), 'target' => 'portfolio_button_panel', 'class' => array())), $post);
        foreach ($portfolio_data_tabs as $key => $tab) {
            ?>
<li class="<?php 
            echo $key;
            ?>
_options <?php 
            echo $key;
            ?>
_tab <?php 
            echo implode(' ', $tab['class']);
            ?>
">
							<a class="a3-portfolio-metabox-icon" href="#<?php 
            echo $tab['target'];
            ?>
"><?php 
            echo esc_html($tab['label']);
            ?>
</a>
						</li><?php 
        }
        do_action('a3_portfolio_metabox_write_panel_tabs', $post);
        ?>
			</ul>
			<div id="portfolio_gallery_panel" class="a3-metabox-panel a3-metabox-options-panel">
				<div id="portfolio_images_container">
					<ul class="portfolio_images">
						<?php 
        $portfolio_gallery = a3_portfolio_get_gallery($thepostid);
        if ($portfolio_gallery) {
            $portfolio_gallery = array_diff($portfolio_gallery, array(get_post_thumbnail_id()));
            foreach ($portfolio_gallery as $attachment_id) {
                ?>
						<li class="image" data-attachment_id="<?php 
                echo $attachment_id;
                ?>
 ">
							<?php 
                echo wp_get_attachment_image($attachment_id, 'thumbnail');
                ?>
							<ul class="actions">
								<li><a href="#" class="delete tips" data-tip="<?php 
                echo __('Delete image', 'a3_portfolios');
                ?>
"><?php 
                echo __('Delete image', 'a3_portfolios');
                ?>
</a></li>
							</ul>
						</li>
						<?php 
            }
        }
        ?>
					</ul>

					<input type="hidden" id="portfolio_image_gallery" name="portfolio_image_gallery" value="<?php 
        if ($portfolio_gallery) {
            echo esc_attr(implode(',', $portfolio_gallery));
        }
        ?>
" />

				</div>
				<?php 
        do_action('a3_portfolio_metabox_portfolio_gallery_panel', $post);
        ?>
				<p class="add_portfolio_images hide-if-no-js">
					<a href="#" data-choose="<?php 
        _e('Add Images to Portfolio Gallery', 'a3_portfolios');
        ?>
" data-update="<?php 
        _e('Add to gallery', 'a3_portfolios');
        ?>
" data-delete="<?php 
        _e('Delete image', 'a3_portfolios');
        ?>
" data-text="<?php 
        _e('Delete', 'a3_portfolios');
        ?>
"><?php 
        _e('Add portfolio gallery images', 'a3_portfolios');
        ?>
</a>
				</p>
			</div>
			<div id="portfolio_single_layout_panel" class="a3-metabox-panel a3-metabox-options-panel">
				<div class="options_group">
					<table class="form-table">
						<tr>
							<td>
								<label for="_a3_portfolio_meta_gallery_wide"><?php 
        echo __('Main Image Width', 'a3_portfolios');
        ?>
</label>
							</td>
							<td class="forminp forminp-slider">
	                        <div class="a3rev-ui-slide-container">
	                            <div class="a3rev-ui-slide-container-start"><div class="a3rev-ui-slide-container-end">
	                                <div class="a3rev-ui-slide" id="_a3_portfolio_meta_gallery_wide_id_div" min="30" max="80" inc="1"></div>
	                            </div></div>
	                            <div class="a3rev-ui-slide-result-container">
	                                <input
	                                    readonly="readonly"
	                                    name="_a3_portfolio_meta_gallery_wide"
	                                    id="_a3_portfolio_meta_gallery_wide_id"
	                                    type="text"
	                                    value="<?php 
        echo esc_attr($wide);
        ?>
"
	                                    class="a3rev-ui-slider"
	                                    /> %
								</div>
	                        </div>
	                        </td>
						</tr>
						<tr valign="top">
							<td>
								<label for="_a3_portfolio_meta_thumb_position"><?php 
        echo __('Gallery Thumbnail Position', 'a3_portfolios');
        ?>
</label>
							</td>
							<td class="forminp forminp-select">
								<select
									name="_a3_portfolio_meta_thumb_position"
									id="_a3_portfolio_meta_thumb_position"
									style="width: 100px;"
									class="a3rev-ui-select chzn-select"
									>
									<option value="right" selected="selected"><?php 
        echo __('Right', 'a3_portfolios');
        ?>
</option>
									<option value="below" <?php 
        selected($thumb_pos, 'below');
        ?>
><?php 
        echo __('Below', 'a3_portfolios');
        ?>
</option>
							   </select>
							</td>
						</tr>
						<?php 
        do_action('a3_portfolio_metabox_single_layout_options', $post);
        ?>
					</table>
					<?php 
        do_action('a3_portfolio_metabox_single_layout_panel', $post);
        ?>
				</div>
			</div>

			<div id="portfolio_featue_data_panel" class="a3-metabox-panel a3-metabox-wrapper">
				<?php 
        global $a3_portfolio_feature_data;
        $all_features = $a3_portfolio_feature_data->get_all_features();
        if ($all_features && is_array($all_features) && count($all_features) > 0) {
            ?>
				<p class="toolbar">
					<a href="#" class="a3-metabox-icon close_all"><?php 
            _e('Close all', 'a3_portfolios');
            ?>
</a><a href="#" class="a3-metabox-icon expand_all"><?php 
            _e('Expand all', 'a3_portfolios');
            ?>
</a>
				</p>
				<div class="a3-metabox-items">
				<?php 
            $all_tags = get_terms(array('portfolio_tag'), array('hide_empty' => false));
            foreach ($all_features as $p_feature) {
                $portfolio_feature_data = get_post_meta($thepostid, '_a3_portfolio_meta_feature_' . $p_feature->id, true);
                ?>
						<div class="a3-metabox-item closed">
							<h3>
								<div class="a3-metabox-icon handlediv" title="<?php 
                _e('Click to toggle', 'a3_portfolios');
                ?>
"></div>
								<table class="form-table">
									<tr>
										<td>
											<?php 
                echo $p_feature->feature_name;
                ?>
										</td>
										<td class="forminp forminp-text">
											<input
												name="portfolio_meta_value_<?php 
                echo $p_feature->id;
                ?>
"
												id="portfolio_meta_value_<?php 
                echo $p_feature->id;
                ?>
"
												type="text"
												value="<?php 
                if (isset($portfolio_feature_data['meta_value'])) {
                    echo esc_attr($portfolio_feature_data['meta_value']);
                }
                ?>
"
												class="a3rev-ui-text"
												/>
										</td>
									</tr>
								</table>
							</h3>
							<table class="a3-metabox-item-content form-table">
								<tr>
									<td>
										<label for="portfolio_meta_tag_link_<?php 
                echo $p_feature->id;
                ?>
"><?php 
                echo __('Link to Tag', 'a3_portfolios');
                ?>
</label>
									</td>
									<td class="forminp forminp-select">
										<select
											name="portfolio_meta_tag_link_<?php 
                echo $p_feature->id;
                ?>
"
											id="portfolio_meta_tag_link_<?php 
                echo $p_feature->id;
                ?>
"
											style="width: 300px;"
											class="a3-portfolio-meta-tag-link a3rev-ui-select chzn-select"
											>
											<option value="0" selected="selected"><?php 
                echo __('Select Option', 'a3_portfolios');
                ?>
</option>
											<?php 
                if ($all_tags && count($all_tags) > 0) {
                    foreach ($all_tags as $portfolio_tag) {
                        ?>
											<option value="<?php 
                        echo $portfolio_tag->term_id;
                        ?>
" <?php 
                        if (isset($portfolio_feature_data['tag_link'])) {
                            selected($portfolio_feature_data['tag_link'], $portfolio_tag->term_id);
                        }
                        ?>
><?php 
                        echo $portfolio_tag->name;
                        ?>
</option>
											<?php 
                    }
                }
                ?>
									   </select>
									</td>
								</tr>
								<tr valign="top">
									<td>
										<div class="portfolio_meta_link_url_row" style="<?php 
                if (isset($portfolio_feature_data['tag_link']) && '0' != $portfolio_feature_data['tag_link']) {
                    echo 'display:none;';
                }
                ?>
"><label for="portfolio_meta_link_url_<?php 
                echo $p_feature->id;
                ?>
"><?php 
                echo __('Link URL', 'a3_portfolios');
                ?>
</label></div>
									</td>
									<td class="forminp forminp-text">
										<div class="portfolio_meta_link_url_row" style="<?php 
                if (isset($portfolio_feature_data['tag_link']) && '0' != $portfolio_feature_data['tag_link']) {
                    echo 'display:none;';
                }
                ?>
">
										<input
											name="portfolio_meta_link_url_<?php 
                echo $p_feature->id;
                ?>
"
											id="portfolio_meta_link_url_<?php 
                echo $p_feature->id;
                ?>
"
											type="text"
											value="<?php 
                if (isset($portfolio_feature_data['meta_link'])) {
                    echo esc_url($portfolio_feature_data['meta_link']);
                }
                ?>
"
											class="a3rev-ui-text"
											placeholder="http://"
											/>
										</div>
									</td>
								</tr>
								<tr valign="top">
									<td>
										<label for="portfolio_meta_open_type_<?php 
                echo $p_feature->id;
                ?>
"><?php 
                echo __('Open Type', 'a3_portfolios');
                ?>
</label>
									</td>
									<td class="forminp forminp-onoff_checkbox">
										<label>
											<input
												name="portfolio_meta_open_type_<?php 
                echo $p_feature->id;
                ?>
"
				                                id="portfolio_meta_open_type_<?php 
                echo $p_feature->id;
                ?>
"
				                                checked_label="<?php 
                echo __('ON', 'a3_portfolios');
                ?>
"
				                                unchecked_label="<?php 
                echo __('OFF', 'a3_portfolios');
                ?>
"
				                                type="checkbox"
												value="_blank"
												<?php 
                if (isset($portfolio_feature_data['open_type'])) {
                    checked($portfolio_feature_data['open_type'], '_blank');
                }
                ?>
												/> <span class="description" style="margin-left:5px;"><?php 
                echo __('Open in new tab', 'a3_portfolios');
                ?>
</span>
			                        	</label>
			                        </td>
								</tr>
								<?php 
                do_action('a3_portfolio_metabox_portfolio_featue_data_item', $post, $p_feature->id);
                ?>
							</table>
						</div>
						<?php 
            }
            ?>
				</div>
				<?php 
        } else {
            ?>
				<div class="a3-metabox-items"><p class=""><?php 
            echo __('Please add Meta for', 'a3_portfolios');
            ?>
 <a href="<?php 
            echo admin_url('edit.php?post_type=a3-portfolio&page=portfolio-feature-data');
            ?>
" target="_blank"><?php 
            echo __('Feature Data', 'a3_portfolios');
            ?>
</a></p></div>
				<?php 
        }
        ?>
				<?php 
        do_action('a3_portfolio_metabox_portfolio_featue_data_panel');
        ?>
			</div>

			<div id="portfolio_button_panel" class="a3-metabox-panel a3-metabox-options-panel">
				<div class="options_group">
					<table class="form-table">
						<tr>
							<td>
								<label for="_a3_portfolio_launch_site_url"><?php 
        echo __('Link URL', 'a3_portfolios');
        ?>
</label>
							</td>
							<td class="forminp forminp-text">
		                        <input
									name="_a3_portfolio_launch_site_url"
									id="_a3_portfolio_launch_site_url"
									type="text"
									value="<?php 
        echo esc_attr($button_visit);
        ?>
"
									class="a3rev-ui-text"
	                                placeholder="http://"
									/>
	                        </td>
						</tr>
						<tr valign="top">
							<td>
								<label for="_a3_portfolio_launch_button_text"><?php 
        echo __('Link Text', 'a3_portfolios');
        ?>
</label>
							</td>
							<td class="forminp forminp-text">
		                        <input
									name="_a3_portfolio_launch_button_text"
									id="_a3_portfolio_launch_button_text"
									type="text"
									value="<?php 
        echo esc_attr($button_text);
        ?>
"
									class="a3rev-ui-text"
									/>
	                        </td>
						</tr>
						<tr valign="top">
							<td>
								<label for="_a3_portfolio_launch_open_type"><?php 
        echo __('Open Type', 'a3_portfolios');
        ?>
</label>
							</td>
							<td class="forminp forminp-onoff_checkbox">
								<label>
									<input
										name="_a3_portfolio_launch_open_type"
		                                id="_a3_portfolio_launch_open_type"
		                                checked_label="<?php 
        echo __('ON', 'a3_portfolios');
        ?>
"
		                                unchecked_label="<?php 
        echo __('OFF', 'a3_portfolios');
        ?>
"
		                                type="checkbox"
										value="_blank"
										<?php 
        checked($launch_open_type, '_blank');
        ?>
										/> <span class="description" style="margin-left:5px;"><?php 
        echo __('Open in new window', 'a3_portfolios');
        ?>
</span>
								</label>
	                        </td>
						</tr>
						<?php 
        do_action('a3_portfolio_metabox_portfolio_button_options');
        ?>
					</table>
					<?php 
        do_action('a3_portfolio_metabox_portfolio_button_panel');
        ?>
				</div>
			</div>

			<?php 
        do_action('a3_portfolio_metabox_panels', $post);
        ?>
			<?php 
        // Add an nonce field so we can check for it later.
        wp_nonce_field('a3_portfolio_metabox_action', 'a3_portfolio_metabox_nonce_field');
        ?>
			<div class="clear"></div>

		</div>
		<?php 
    }