Beispiel #1
0
function xr_make_portfolio_modal($modal = null, $id = null)
{
    $is_ajax = false;
    if (isset($_REQUEST['ajax_object'])) {
        $is_ajax = true;
        $modal_obj = $_REQUEST['ajax_object'];
        $id = $modal_obj['id'];
    }
    $image_sizes = isset($modal['modal']['data']['data']['imageSize']) ? $modal['modal']['data']['data']['imageSize'] : '';
    $totalProducts = isset($modal['modal']['data']['data']['total']) ? $modal['modal']['data']['data']['total'] : 18;
    $chosenCategory = isset($modal['modal']['data']['data']['category']) ? $modal['modal']['data']['data']['category'] : '';
    $chosenPostType = isset($modal['modal']['data']['data']['postType']) ? $modal['modal']['data']['data']['postType'] : '';
    $header_title = isset($modal['modal']['data']['data']['header_title']) ? $modal['modal']['data']['data']['header_title'] : "";
    $activate_hover_box = checked("true", isset($modal['modal']['data']['data']['activate_hover_box']) ? $modal['modal']['data']['data']['activate_hover_box'] : false, false);
    $activate_hover = checked("true", isset($modal['modal']['data']['data']['activate_hover']) ? $modal['modal']['data']['data']['activate_hover'] : false, false);
    $disable_hover_link = checked("true", isset($modal['modal']['data']['data']['disable_hover_link']) ? $modal['modal']['data']['data']['disable_hover_link'] : false, false);
    $boxed_layout = checked("true", isset($modal['modal']['data']['data']['boxed_layout']) ? $modal['modal']['data']['data']['boxed_layout'] : false, false);
    $excerpt_title_option = isset($modal['modal']['data']['data']['excerpt_title_option']) ? $modal['modal']['data']['data']['excerpt_title_option'] : '';
    $excerpt_length = isset($modal['modal']['data']['data']['excerpt_length']) ? $modal['modal']['data']['data']['excerpt_length'] : 18;
    $pagination = checked("true", isset($modal['modal']['data']['data']['pagination']) ? $modal['modal']['data']['data']['pagination'] : false, false);
    $portfolio_model = isset($modal['modal']['data']['data']['portfolio_model']) ? $modal['modal']['data']['data']['portfolio_model'] : "";
    $portfolio_model_switch = isset($modal['modal']['data']['data']['portfolio_model_switch']) ? $modal['modal']['data']['data']['portfolio_model_switch'] : "";
    $activate_category_link = isset($modal['modal']['data']['data']['activate_category_link']) ? $modal['modal']['data']['data']['activate_category_link'] : "";
    $activate_header_link = isset($modal['modal']['data']['data']['activate_header_link']) ? $modal['modal']['data']['data']['activate_header_link'] : "";
    $use_shadow = checked("true", isset($modal['modal']['data']['data']['use_shadow']) ? $modal['modal']['data']['data']['use_shadow'] : false, false);
    $excerpt_length_html = '<select class="excerpt_length" autocomplete="off">';
    for ($e = 0; $e < 150; $e++) {
        if ($e == $excerpt_length) {
            $excerpt_length_html .= '<option value="' . $e . '" selected="selected">' . $e . '</option>';
        } else {
            $excerpt_length_html .= '<option value="' . $e . '">' . $e . '</option>';
        }
    }
    $excerpt_length_html .= '</select>';
    $totalItemsToShow = '<div class="total_show_holder"><h4>Select Total Item To Show</h4><select class="total_show" autocomplete="off">';
    for ($i = 1; $i < 100; $i++) {
        if ($totalProducts == $i) {
            $totalItemsToShow .= '<option value="' . $i . '" selected>' . $i . '</option>';
        } else {
            $totalItemsToShow .= '<option value="' . $i . '">' . $i . '</option>';
        }
    }
    $totalItemsToShow .= '</select></div>';
    $return = '
	<div id="' . $id . '" class="modal container hide fade" tabindex="-1" role="dialog" aria-labelledby="Portfolio" aria-hidden="true">
		<div class="modal-header">
			<div class="close builder-close"><i class="fa fa-times"></i></div>
			<h3>Portfolio</h3>
		</div>
		<div class="modal-body" data-saved="false">
			<div class="row-fluid">
				<div class="span6 image_sizes_column"  bind="' . $id . '" calc="true">
					' . rock_builder_get_image_sizes($image_sizes, $id, '') . '
				</div>
				<div class="span6">
					<strong>Choose image size</strong><br/>
					<p>You can choose any image sizes for Portfolio. But we recommend using cropped image sizes.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid post_type_tax_holder">
				<div class="span6">
					' . rock_builder_get_customposttypes($chosenPostType, $id, '') . '
					' . rock_builder_get_taxonomies($chosenCategory, $chosenPostType, '') . '
				</div>
				<div class="span6">
					<strong>Choose A Post Type</strong></br>
					<p>Choose the post type</p><br/>
					<strong>Choose Taxonomies/Categories to Display</strong></br>
					<p>Choose categories/taxonomies. You can choose multiple categories/taxonomies or just single taxonomy/category. You can also choose all categories/taxonomies by choosing the "All".</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<select class="portfolio_model" autocomplete="off">
						<option value="grid" ' . ($portfolio_model == 'grid' ? 'selected' : '') . ' >Portfolio Grid</option>
						<option value="list" ' . ($portfolio_model == 'list' ? 'selected' : '') . ' >Portfolio List</option>
					</select>
				</div>
				<div class="span6">
					<strong>Portfolio Model</strong>
					<p>You can choose grid or list model for the portfolio.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<select class="portfolio_model_switch" autocomplete="off">
						<option value="true" ' . ($portfolio_model_switch == 'true' ? 'selected' : '') . ' >Switch Portfolio Models</option>
						<option value="false" ' . ($portfolio_model_switch == 'false' ? 'selected' : '') . ' >Do not Switch Portfolio Models</option>
					</select>
				</div>
				<div class="span6">
					<strong>Switch Between Portfolio Models</strong>
					<p>If you choose "Switch Portfolio Models" there will be buttons at the top of the portfoliio to switch between list and grid model.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					' . rockthemes_excerpt_title_option($excerpt_title_option) . '
				</div>
				<div class="span6">
					<strong>Description</strong>
					<p>You can choose the description details. This will only effect to the grid model. List model will always display all details.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					' . $excerpt_length_html . '
				</div>
				<div class="span6">
					<strong>Excerpt Length</strong>
					<p>You can adjust the excerpt length in words. Which means if you choose 10, your excerpt will show up to 10 words from your originial excerpt.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<input autocomplete="off" type="text" class="header_title" value="' . $header_title . '" />
				</div>
				<div class="span6">
					<strong>Header Title</strong>
					<p>You can choose to use a header title for portfolio. If you leave this area empty, header title will not be displayed.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<select class="activate_header_link" autocomplete="off">
						<option value="true" ' . ($activate_header_link === 'true' ? 'selected' : '') . '>Activate Header Link</option>
						<option value="false" ' . ($activate_header_link === 'false' ? 'selected' : '') . '>Deactivate Header Link</option>
					</select>
				</div>
				<div class="span6">
					<strong>Activate Header Link</strong>
					<p>If you activate header link, header will link to the product.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<select class="activate_category_link" autocomplete="off">
						<option value="true" ' . ($activate_category_link === 'true' ? 'selected' : '') . '>Activate Category Link</option>
						<option value="false" ' . ($activate_category_link === 'false' ? 'selected' : '') . '>Deactivate Category Link</option>
					</select>
				</div>
				<div class="span6">
					<strong>Category Links</strong>
					<p>You can activate the category link under the title. This will show the links of the categories for the product.</p>
				</div>
			</div>
			<hr/>
			' . rock_builder_get_block_grid_list(isset($modal['modal']['data']['data']['block_grid_large']) ? intval($modal['modal']['data']['data']['block_grid_large']) : '', isset($modal['modal']['data']['data']['block_grid_medium']) ? intval($modal['modal']['data']['data']['block_grid_medium']) : '', isset($modal['modal']['data']['data']['block_grid_small']) ? intval($modal['modal']['data']['data']['block_grid_small']) : '') . '
			<div class="row-fluid">
				<div class="span6">
					' . $totalItemsToShow . '
				</div>
				<div class="span6">
					<strong>Total Products to Show</strong></br>
					<p>This will set up the total products per page. If you choose 18, you will be showing 18 products for each page.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<div class="pagination_holder">
						<input autocomplete="off" class="pagination" type="checkbox" value="true" name="pagination" ' . $pagination . ' /><label for="activate_hover_box"> Activate Pagination</label>
					</div>
				</div>
				<div class="span6">
					<strong>Activate Pagination</strong></br>
					<p>You can activate / deactivate the pagination. If you want to activate the pagination check this option.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<div class="activate_hover_holder">
						<input autocomplete="off" class="activate_hover" type="checkbox" value="true" name="activate_hover" ' . $activate_hover . ' /><label for="activate_hover"> Activate Hover Effect</label>
					</div>
				</div>
				<div class="span6">
					<strong>Activate Regular Hover Effect</strong></br>
					<p>This option will show the regular hover effect with PrettyPhoto (lightbox). If you activate this option, you can not activate the hover box option. Two option can not be activated.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<div class="disable_hover_link_holder">
						<input autocomplete="off" autocomplete="off" class="disable_hover_link" type="checkbox" value="true" name="disable_hover_link" ' . $disable_hover_link . ' /><label for="activate_hover"> Disable Hover Link</label>
					</div>
				</div>
				<div class="span6">
					<strong>Disable Hover Link</strong></br>
					<p>If you want to disable the link in the hover effect check this option.</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<div class="boxed_layout_holder">
						<input autocomplete="off" class="boxed_layout" type="checkbox" value="true" name="boxed_layout" ' . $boxed_layout . ' /><label for="boxed_layout"> Use Boxed Layout</label>
					</div>
				</div>
				<div class="span6">
					<strong>Activate Boxed Layout</strong></br>
					<p>You can easily activate/deactivate boxed layout. If you choose "No Description" for description boxed layout will not be active for "Grid Model"</p>
				</div>
			</div>
			<hr/>
			<div class="row-fluid">
				<div class="span6">
					<div class="use_shadow_holder">
						<input autocomplete="off" class="use_shadow" type="checkbox" value="true" name="use_shadow" ' . $use_shadow . ' /><label for="use_shadow"> Use Shadow</label>
					</div>
				</div>
				<div class="span6">
					<strong>Activate Shadow</strong></br>
					<p>If you activate shadow, there will be a shadow under images.</p>
				</div>
			</div>
			<hr/>
		</div>
		<div class="modal-footer">
			<div class="btn builder-close">Close</div>
			<div class="btn btn-primary hr-modal-save builder-close" ref="' . $id . '">Save changes</div>
		</div>
	</div>';
    /*
    	TO DO : Hover Box effect for regular portfolio
    		<div class="row-fluid">
    				<div class="span6">
    					<div class="activate_hover_box_holder">
    						<input autocomplete="off" class="activate_hover_box" type="checkbox" value="true" name="activate_hover_box" '.$activate_hover_box.' /><label for="activate_hover_box"> Activate Hover Box</label>
    					</div>
    				</div>
    				<div class="span6">
    					<strong>Activate Hover Box Effect</strong></br>
    					<p>If you activate hover box effect, your thumbnails will show a bigger image with excerpt when hovered</p>
    				</div>
    			</div>
    			<hr/>
    */
    return $return;
}
function rock_builder_get_block_grid_list_ajax()
{
    echo rock_builder_get_block_grid_list();
    exit;
}