Esempio n. 1
0
		function wm_price_cp_init() {
			global $cpMenuPosition;

			$role = ( wm_option( 'cp-role-pricing' ) ) ? ( wm_option( 'cp-role-pricing' ) ) : ( 'page' );
			$slug = ( wm_option( 'cp-permalink-price' ) ) ? ( wm_option( 'cp-permalink-price' ) ) : ( 'price' );

			$args = array(
				'query_var'           => 'price',
				'capability_type'     => $role,
				'public'              => true,
				'show_in_nav_menus'   => false,
				'show_ui'             => true,
				'exclude_from_search' => true,
				'hierarchical'        => false,
				'rewrite'             => array( 'slug' => $slug ),
				'menu_position'       => $cpMenuPosition['prices'],
				'menu_icon'           => WM_ASSETS_ADMIN . 'img/icons/custom-posts/ico-price.png',
				'supports'            => array( 'title', 'editor', 'author' ),
				'labels'              => array(
					'name'               => __( 'Prices', 'lespaul_domain_adm' ),
					'singular_name'      => __( 'Price', 'lespaul_domain_adm' ),
					'add_new'            => __( 'Add new price', 'lespaul_domain_adm' ),
					'add_new_item'       => __( 'Add new price', 'lespaul_domain_adm' ),
					'new_item'           => __( 'Add new price', 'lespaul_domain_adm' ),
					'edit_item'          => __( 'Edit price', 'lespaul_domain_adm' ),
					'view_item'          => __( 'View price', 'lespaul_domain_adm' ),
					'search_items'       => __( 'Search price', 'lespaul_domain_adm' ),
					'not_found'          => __( 'No price found', 'lespaul_domain_adm' ),
					'not_found_in_trash' => __( 'No price found in trash', 'lespaul_domain_adm' ),
					'parent_item_colon'  => ''
				)
			);
			register_post_type( 'wm_price' , $args );
		}
Esempio n. 2
0
	function __construct() {
		$id     = 'wm-posts-list';
		$prefix = ( wm_option( 'branding-panel-no-logo' ) || ! strpos( wm_option( 'branding-panel-logo' ), 'logo-' . WM_THEME_SHORTNAME . '-admin.png' ) ) ? ( '' ) : ( WM_THEME_NAME . ' ' );
		$name   = '<span>' . $prefix . __( 'Posts', 'lespaul_domain_adm' ) . '</span>';
		$widget_ops = array(
			'classname'   => 'wm-posts-list',
			'description' => __( 'List of recent, popular, random or upcoming posts with thumbnail images', 'lespaul_domain_adm' )
			);
		$control_ops = array();

		//$this->WP_Widget( $id, $name, $widget_ops, $control_ops );
		parent::__construct( $id, $name, $widget_ops, $control_ops );
	} // /__construct
Esempio n. 3
0
	function __construct() {
		$id     = 'wm-contact-info';
		$prefix = ( wm_option( 'branding-panel-no-logo' ) || ! strpos( wm_option( 'branding-panel-logo' ), 'logo-' . WM_THEME_SHORTNAME . '-admin.png' ) ) ? ( '' ) : ( WM_THEME_NAME . ' ' );
		$name   = '<span>' . $prefix . __( 'Contact', 'lespaul_domain_adm' ) . '</span>';
		$widget_ops = array(
			'classname'   => 'wm-contact-info',
			'description' => __( 'Contact information', 'lespaul_domain_adm' )
			);
		$control_ops = array();

		//$this->WP_Widget( $id, $name, $widget_ops, $control_ops );
		parent::__construct( $id, $name, $widget_ops, $control_ops );
	} // /__construct
Esempio n. 4
0
		function wm_staff_cp_init() {
			global $cpMenuPosition;

			$role     = ( wm_option( 'cp-role-staff' ) ) ? ( wm_option( 'cp-role-staff' ) ) : ( 'page' );
			$slug     = ( wm_option( 'cp-permalink-staff' ) ) ? ( wm_option( 'cp-permalink-staff' ) ) : ( 'staff' );
			$supports = array( 'title', 'editor', 'thumbnail', 'author' );

			if ( wm_option( 'cp-staff-rich' ) )
				$supports[] = 'excerpt';
			if ( wm_option( 'cp-staff-revisions' ) )
				$supports[] = 'revisions';

			$args = array(
				'query_var'           => 'staff',
				'capability_type'     => $role,
				'public'              => true,
				'show_in_nav_menus'   => false,
				'show_ui'             => true,
				'exclude_from_search' => true,
				'hierarchical'        => false,
				'rewrite'             => array( 'slug' => $slug ),
				'menu_position'       => $cpMenuPosition['staff'],
				'menu_icon'           => WM_ASSETS_ADMIN . 'img/icons/custom-posts/ico-team.png',
				'supports'            => $supports,
				'labels'              => array(
					'name'               => __( 'Staff', 'lespaul_domain_adm' ),
					'singular_name'      => __( 'Staff member', 'lespaul_domain_adm' ),
					'add_new'            => __( 'Add new member', 'lespaul_domain_adm' ),
					'add_new_item'       => __( 'Add new member', 'lespaul_domain_adm' ),
					'new_item'           => __( 'Add new member', 'lespaul_domain_adm' ),
					'edit_item'          => __( 'Edit member', 'lespaul_domain_adm' ),
					'view_item'          => __( 'View member', 'lespaul_domain_adm' ),
					'search_items'       => __( 'Search members', 'lespaul_domain_adm' ),
					'not_found'          => __( 'No member found', 'lespaul_domain_adm' ),
					'not_found_in_trash' => __( 'No members found in trash', 'lespaul_domain_adm' ),
					'parent_item_colon'  => ''
				)
			);
			register_post_type( 'wm_staff' , $args );
		}
Esempio n. 5
0
		function wm_faq_cp_init() {
			global $cpMenuPosition;

			$role     = ( wm_option( 'cp-role-faq' ) ) ? ( wm_option( 'cp-role-faq' ) ) : ( 'post' );
			$slug     = ( wm_option( 'cp-permalink-faq' ) ) ? ( wm_option( 'cp-permalink-faq' ) ) : ( 'faq' );
			$supports = array( 'title', 'editor', 'author' );

			if ( wm_option( 'cp-faq-revisions' ) )
				$supports[] = 'revisions';

			$args = array(
				'query_var'           => 'faq',
				'capability_type'     => $role,
				'public'              => true,
				'show_in_nav_menus'   => false,
				'show_ui'             => true,
				'exclude_from_search' => true,
				'hierarchical'        => false,
				'rewrite'             => array( 'slug' => $slug ),
				'menu_position'       => $cpMenuPosition['faq'],
				'menu_icon'           => WM_ASSETS_ADMIN . 'img/icons/custom-posts/ico-faq.png',
				'supports'            => $supports,
				'labels'              => array(
					'name'               => __( 'FAQ', 'lespaul_domain_adm' ),
					'singular_name'      => __( 'Answer', 'lespaul_domain_adm' ),
					'add_new'            => __( 'Add new answer', 'lespaul_domain_adm' ),
					'add_new_item'       => __( 'Add new answer', 'lespaul_domain_adm' ),
					'new_item'           => __( 'Add new answer', 'lespaul_domain_adm' ),
					'edit_item'          => __( 'Edit answer', 'lespaul_domain_adm' ),
					'view_item'          => __( 'View answer', 'lespaul_domain_adm' ),
					'search_items'       => __( 'Search question', 'lespaul_domain_adm' ),
					'not_found'          => __( 'No question found', 'lespaul_domain_adm' ),
					'not_found_in_trash' => __( 'No question found in trash', 'lespaul_domain_adm' ),
					'parent_item_colon'  => ''
				)
			);
			register_post_type( 'wm_faq' , $args );
		}
Esempio n. 6
0
		function wm_head_styles( $classes ) {
			global $post;

			//variables needed
				//post ID
				$postId = ( is_home() ) ? ( get_option( 'page_for_posts' ) ) : ( null );

			//custom in-header styles
				$inHeaderStyles = '';

				//page background image
					if (
							( isset( $post ) || is_home() ) &&
							! is_search() && ! is_archive() &&
							wm_css_background_meta( 'background-' )
						) {
						$inHeaderStyles .= ( wm_meta_option( 'background-bg-img-fit-window', $postId ) ) ? ( "\t" . 'body {background: none}' . "\r\n" ) : ( "\t" . 'body {background: ' . wm_css_background_meta( 'background-' ) . '}' . "\r\n" );
						$inHeaderStyles .= ( ! wm_meta_option( 'background-bg-color', $postId ) ) ? ( '' ) : ( "\t" . 'html {background: none}' . "\r\n" );
					}

				//main heading area background
					if (
							( isset( $post ) || is_home() ) &&
							( wm_css_background_meta( 'heading-background-' ) || wm_meta_option( 'heading-background-padding' ) )
						) {
						$inHeaderStyles .= ( wm_meta_option( 'heading-background-padding' ) ) ? ( "\t" . '.main-heading .twelve.pane {padding-top: ' . absint( wm_meta_option( 'heading-background-padding' ) ) . 'px; padding-bottom: ' . absint( wm_meta_option( 'heading-background-padding' ) ) . 'px;}' . "\r\n" ) : ( '' );
						$inHeaderStyles .= ( wm_css_background_meta( 'heading-background-' ) ) ? ( "\t" . '.main-heading {background: ' . wm_css_background_meta( 'heading-background-' ) . '}' . "\r\n" ) : ( '' );
						$inHeaderStyles .= ( ! wm_meta_option( 'heading-background-color', $postId ) ) ? ( '' ) : ( "\t" . '.main-heading h1, .main-heading h2, .main-heading i[class^="icon-"] {color: ' . wm_meta_option( 'heading-background-color', $postId, 'color' ) . ';}' . "\r\n" );
					}

				//wrapper padding when fixed header used
					if ( in_array( 'header-fixed', get_body_class() ) && 0 < wm_option( 'header-height' ) )
						$inHeaderStyles .= "\t" . '@media only screen and (min-width: 1020px) { body.header-fixed { padding-top: ' . absint( wm_option( 'header-height' ) ) . 'px; } body.top-bar-enabled.header-fixed { padding-top: ' . absint( wm_option( 'header-height' ) + 50 ) . 'px; } }' . "\r\n";

			//output
			if ( $inHeaderStyles )
				$inHeaderStyles = "\r\n<!-- Custom header styles -->\r\n" . '<style type="text/css">' . "\r\n" . $inHeaderStyles . '</style>' . "\r\n";

			echo $inHeaderStyles;
		}
Esempio n. 7
0
			$menuLocationName = 'main-navigation';
			if ( is_page() && is_page_template( 'page-template/landing.php' ) )
				$menuLocationName = 'menu-landing-page-' . get_the_ID();

			//If no menu assigned, falls back to page list menu
			wp_nav_menu( array(
					'theme_location'  => $menuLocationName,
					'menu'            => null,
					'container'       => null,
					'container_class' => null,
					'container_id'    => null,
					'menu_class'      => 'menu',
					'menu_id'         => null,
					'echo'            => true,
					'fallback_cb'     => 'wm_menu_callback',
					'before'          => null,
					'after'           => null,
					'link_before'     => '',
					'link_after'      => '',
					'items_wrap'      => '<ul class="%2$s">%3$s</ul>',
					'depth'           => 0,
					'walker'          => ( has_nav_menu( $menuLocationName ) ) ? ( new wm_main_walker() ) : ( null )
				) );
			?>
		</nav>

	<?php
	if ( ! in_array( wm_option( 'header-navigation-position' ), array( ' nav-left', ' nav-right' ) ) )
		echo '</div></div>';
	?>
</div> <!-- /wrap-inner -->
Esempio n. 8
0
	//Add manually written styles from admin panel
		$out .= ( wm_option( 'design-custom-css-enable' ) && wm_option( 'design-custom-css' ) ) ? ( "\r\n\r\n\r\n/* Custom CSS textarea styles */\r\n" . wm_option( 'design-custom-css' ) ) : ( '' );

	$out .= "\r\n\r\n" . '/* End of file */';





/*
*****************************************************
*      CSS FINAL OUTPUT (AND FILE HEADER)
*****************************************************
*/

	$expireTime = ( wm_option( 'general-no-css-cache' ) ) ? ( 0 ) : ( WM_CSS_EXPIRATION );

	header( 'content-type: text/css; charset: UTF-8' );
	header( 'expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expireTime ) . ' GMT' );
	header( 'cache-control: public, max-age=' . $expireTime );

	if ( ! isset( $_GET['noc'] ) && ( wm_option( 'design-minimize-css' ) ) )
		$out = wm_minimize_css( $out );

	if ( wm_option( 'general-gzip' ) || wm_option( 'design-gzip-cssonly' ) )
		ob_start( 'ob_gzhandler' ); //Enable GZIP

	echo $out;

?>
Esempio n. 9
0
/**
 * Posts shortcode default image size
 *
 * @version  1.1
 */
function wm_shortcode_image_size()
{
    //Requirements check
    if (!function_exists('wm_option')) {
        return $size;
    }
    //Output
    return 'mobile-' . wm_option('skin-image-posts');
}
Esempio n. 10
0
		function wm_default_content( $content ) {
			global $current_screen;

			$iconShortcodes = ( ! file_exists( WM_FONT . 'custom/config.json' ) ) ? ( '<li>[icon type="icon-check" /]</li><li>[icon type="icon-cancel" /]</li>' ) : ( '' );

			if ( ! ( 'add' === $current_screen->action && 'post' === $current_screen->base ) )
				return $content;

			if ( 'wm_price' === $current_screen->id )
				$content = '
					<ul>
						<li>' . __( '<strong>Your feature</strong> goes here', 'lespaul_domain_adm' ) . '</li>
						<li>' . __( '<strong>Another feature</strong> on separate list item', 'lespaul_domain_adm' ) . '</li>
						<li>' . __( 'Will be automatically centered', 'lespaul_domain_adm' ) . '</li>'
						. $iconShortcodes . '
					</ul>
					';

			if ( 'wm_faq' === $current_screen->id )
				$content = '<p>' . __( 'Your answer goes here...', 'lespaul_domain_adm' ) . '</p>';

			if ( 'wm_staff' === $current_screen->id )
				$content = ( wm_option( 'cp-staff-rich' ) ) ? ( '<p>' . __( 'Rich staff member info goes here, place the short description into excerpt field below...', 'lespaul_domain_adm' ) . '</p>' ) : ( '<p>' . __( 'Staff member info goes here...', 'lespaul_domain_adm' ) . '</p>' );

			return $content;
		}
Esempio n. 11
0
	function wm_meta_post_options() {
		global $sidebarPosition;

		$prefix          = '';
		$prefixBg        = 'background-';
		$prefixBgHeading = 'heading-background-';
		$fontFile        = ( ! file_exists( WM_FONT . 'custom/config.json' ) ) ? ( WM_FONT . 'fontello/config.json' ) : ( WM_FONT . 'custom/config.json' );
		$fontIcons       = wm_fontello_classes( $fontFile );

		//Get icons
		$menuIcons = array();
		$menuIcons[''] = __( '- select icon -', 'lespaul_domain_adm' );
		foreach ( $fontIcons as $icon ) {
			$menuIcons[$icon] = ucwords( str_replace( '-', ' ', substr( $icon, 4 ) ) );
		}

		$widgetsButtons = ( current_user_can( 'switch_themes' ) ) ? ( '<a class="button confirm" href="' . get_admin_url() . 'widgets.php">' . __( 'Manage widget areas', 'lespaul_domain_adm' ) . '</a> <a class="button confirm" href="' . get_admin_url() . 'admin.php?page=' . WM_THEME_SHORTNAME . '-options">' . __( 'Create new widget areas', 'lespaul_domain_adm' ) . '</a>' ) : ( '' );

		$metaPostOptions = array(

			//General settings
			array(
				"type" => "section-open",
				"section-id" => "general-section",
				"title" => __( 'General', 'lespaul_domain_adm' )
			),
				array(
					"type" => "checkbox",
					"id" => $prefix."no-heading",
					"label" => __( 'Disable main heading', 'lespaul_domain_adm' ),
					"desc" => __( 'Hides post/page main heading - the title', 'lespaul_domain_adm' ),
					"value" => "true"
				),
					array(
						"type" => "space"
					),
					array(
						"type" => "textarea",
						"id" => $prefix."subheading",
						"label" => __( 'Subtitle', 'lespaul_domain_adm' ),
						"desc" => __( 'If defined, the specially styled subtitle will be displayed', 'lespaul_domain_adm' ),
						"default" => "",
						"validate" => "lineBreakHTML",
						"rows" => 2,
						"cols" => 57
					),
					array(
						"type" => "select",
						"id" => $prefix."main-heading-alignment",
						"label" => __( 'Main heading alignment', 'lespaul_domain_adm' ),
						"desc" => __( 'Set the text alignment in main heading area', 'lespaul_domain_adm' ),
						"options" => array(
								""       => __( 'Default', 'lespaul_domain_adm' ),
								"left"   => __( 'Left', 'lespaul_domain_adm' ),
								"center" => __( 'Center', 'lespaul_domain_adm' ),
								"right"  => __( 'Right', 'lespaul_domain_adm' ),
							),
						"default" => ""
					),
					array(
						"type" => "select",
						"id" => $prefix."main-heading-icon",
						"label" => __( 'Main heading icon', 'lespaul_domain_adm' ),
						"desc" => __( 'Select an icon to display in main heading area', 'lespaul_domain_adm' ),
						"options" => $menuIcons,
						"icons" => true
					)
			);

			if ( ! wm_option( 'blog-disable-featured-image' ) || is_active_sidebar( 'top-bar-widgets' ) || ! wm_option( 'blog-disable-bio' ) )
				array_push( $metaPostOptions,
					array(
						"type" => "hr"
					)
				);

			if ( ! wm_option( 'blog-disable-featured-image' ) )
				array_push( $metaPostOptions,
					array(
						"type" => "checkbox",
						"id" => $prefix."disable-featured-image",
						"label" => __( 'Disable featured image for this post', 'lespaul_domain_adm' ),
						"desc" => __( 'Disables featured image on single post view', 'lespaul_domain_adm' ),
						"value" => "true"
					)
				);

			if ( is_active_sidebar( 'top-bar-widgets' ) )
				array_push( $metaPostOptions,
					array(
						"type" => "checkbox",
						"id" => $prefix."no-top-bar",
						"label" => __( 'Disable top bar', 'lespaul_domain_adm' ),
						"desc" => __( 'Disables top bar widget area on this post', 'lespaul_domain_adm' ),
						"value" => "true"
					)
				);

			if ( ! wm_option( 'blog-disable-bio' ) )
				array_push( $metaPostOptions,
					array(
						"type" => "checkbox",
						"id" => $prefix."author",
						"label" => __( 'Disable author details', 'lespaul_domain_adm' ),
						"desc" => __( 'Disables author information below the post content', 'lespaul_domain_adm' ),
						"value" => "true"
					)
				);

			array_push( $metaPostOptions,
				array(
					"type" => "hr"
				),

				array(
					"type" => "checkbox",
					"id" => "attachments-list",
					"label" => __( 'Display post attachments list', 'lespaul_domain_adm' ),
					"desc" => __( 'Displays links to download all post attachments except images', 'lespaul_domain_adm' ),
					"value" => "true"
				),
			array(
				"type" => "section-close"
			),



			//Sidebar settings
			array(
				"type" => "section-open",
				"section-id" => "sidebar-section",
				"title" => __( 'Sidebar', 'lespaul_domain_adm' )
			),
				array(
					"type" => "box",
					"content" => '<h4>' . __( 'Choose a sidebar and its position on the post/page', 'lespaul_domain_adm' ) . '</h4>' . $widgetsButtons,
				),

				array(
					"type" => "layouts",
					"id" => $prefix."layout",
					"label" => __( 'Sidebar position', 'lespaul_domain_adm' ),
					"desc" => __( 'Choose a sidebar position on the post/page (set the first one to use the theme default settings)', 'lespaul_domain_adm' ),
					"options" => $sidebarPosition,
					"default" => ""
				),
				array(
					"type" => "select",
					"id" => $prefix."sidebar",
					"label" => __( 'Choose a sidebar', 'lespaul_domain_adm' ),
					"desc" => __( 'Select a widget area used as a sidebar for this post/page (if not set, the dafault theme settings will apply)', 'lespaul_domain_adm' ),
					"options" => wm_widget_areas(),
					"default" => ""
				),
			array(
				"type" => "section-close"
			),



			//Design - website background settings
			array(
				"type" => "section-open",
				"section-id" => "background-settings",
				"title" => __( 'Backgrounds', 'lespaul_domain_adm' ),
				"exclude" => array()
			),
				array(
					"type" => "heading4",
					"content" => __( 'Main heading area background', 'lespaul_domain_panel' )
				),
				array(
					"id" => $prefix."bg-heading",
					"type" => "inside-wrapper-open",
					"class" => "toggle box"
				),
					array(
						"type" => "slider",
						"id" => $prefixBgHeading."padding",
						"label" => __( 'Section padding', 'lespaul_domain_adm' ),
						"desc" => __( 'Top and bottom padding size applied on the section (leave zero for default)', 'lespaul_domain_adm' ),
						"default" => 0,
						"min" => 1,
						"max" => 100,
						"step" => 1,
						"validate" => "absint"
					),
					array(
						"type" => "color",
						"id" => $prefixBgHeading."color",
						"label" => __( 'Text color', 'lespaul_domain_adm' ),
						"desc" => __( 'Sets the custom main heading text color', 'lespaul_domain_adm' ),
						"default" => "",
						"validate" => "color"
					),
					array(
						"type" => "color",
						"id" => $prefixBgHeading."bg-color",
						"label" => __( 'Background color', 'lespaul_domain_adm' ),
						"desc" => __( 'Sets the custom main heading background color', 'lespaul_domain_adm' ),
						"default" => "",
						"validate" => "color"
					),
					array(
						"type" => "image",
						"id" => $prefixBgHeading."bg-img-url",
						"label" => __( 'Custom background image', 'lespaul_domain_adm' ),
						"desc" => __( 'To upload a new image, press the [+] button and use the Media Uploader as you would be adding an image into post', 'lespaul_domain_adm' ),
						"default" => "",
						"readonly" => true,
						"imgsize" => 'mobile'
					),
					array(
						"type" => "select",
						"id" => $prefixBgHeading."bg-img-position",
						"label" => __( 'Background image position', 'lespaul_domain_adm' ),
						"desc" => __( 'Set background image position', 'lespaul_domain_adm' ),
						"options" => array(
							'50% 50%'   => __( 'Center', 'lespaul_domain_adm' ),
							'50% 0'     => __( 'Center horizontally, top', 'lespaul_domain_adm' ),
							'50% 100%'  => __( 'Center horizontally, bottom', 'lespaul_domain_adm' ),
							'0 0'       => __( 'Left, top', 'lespaul_domain_adm' ),
							'0 50%'     => __( 'Left, center vertically', 'lespaul_domain_adm' ),
							'0 100%'    => __( 'Left, bottom', 'lespaul_domain_adm' ),
							'100% 0'    => __( 'Right, top', 'lespaul_domain_adm' ),
							'100% 50%'  => __( 'Right, center vertically', 'lespaul_domain_adm' ),
							'100% 100%' => __( 'Right, bottom', 'lespaul_domain_adm' ),
							),
						"default" => '50% 0'
					),
					array(
						"type" => "select",
						"id" => $prefixBgHeading."bg-img-repeat",
						"label" => __( 'Background image repeat', 'lespaul_domain_adm' ),
						"desc" => __( 'Set background image repeating', 'lespaul_domain_adm' ),
						"options" => array(
							'no-repeat' => __( 'Do not repeat', 'lespaul_domain_adm' ),
							'repeat'    => __( 'Repeat', 'lespaul_domain_adm' ),
							'repeat-x'  => __( 'Repeat horizontally', 'lespaul_domain_adm' ),
							'repeat-y'  => __( 'Repeat vertically', 'lespaul_domain_adm' )
							),
						"default" => 'no-repeat'
					),
				array(
					"id" => $prefix."bg-heading",
					"type" => "inside-wrapper-close"
				)
		);

		if ( 'fullwidth' == wm_option( 'general-boxed' ) ) {
			array_push( $metaPostOptions,
				array(
					"type" => "section-close"
				)
			);
			return $metaPostOptions;
		}

		array_push( $metaPostOptions,

				array(
					"type" => "heading4",
					"content" => __( 'Page background', 'lespaul_domain_panel' )
				),
				array(
					"id" => $prefix."bg",
					"type" => "inside-wrapper-open",
					"class" => "toggle box"
				),
					array(
						"type" => "color",
						"id" => $prefixBg."bg-color",
						"label" => __( 'Background color', 'lespaul_domain_adm' ),
						"desc" => __( 'Sets the custom website background color.', 'lespaul_domain_adm' ) . '<br />' . __( 'Please always set this to reset any possible background styles applied on main HTML element.', 'lespaul_domain_adm' ),
						"default" => "",
						"validate" => "color"
					),
					array(
						"type" => "image",
						"id" => $prefixBg."bg-img-url",
						"label" => __( 'Custom background image', 'lespaul_domain_adm' ),
						"desc" => __( 'To upload a new image, press the [+] button and use the Media Uploader as you would be adding an image into post', 'lespaul_domain_adm' ),
						"default" => "",
						"readonly" => true,
						"imgsize" => 'mobile'
					),
					array(
						"type" => "select",
						"id" => $prefixBg."bg-img-position",
						"label" => __( 'Background image position', 'lespaul_domain_adm' ),
						"desc" => __( 'Set background image position', 'lespaul_domain_adm' ),
						"options" => array(
							'50% 50%'   => __( 'Center', 'lespaul_domain_adm' ),
							'50% 0'     => __( 'Center horizontally, top', 'lespaul_domain_adm' ),
							'50% 100%'  => __( 'Center horizontally, bottom', 'lespaul_domain_adm' ),
							'0 0'       => __( 'Left, top', 'lespaul_domain_adm' ),
							'0 50%'     => __( 'Left, center vertically', 'lespaul_domain_adm' ),
							'0 100%'    => __( 'Left, bottom', 'lespaul_domain_adm' ),
							'100% 0'    => __( 'Right, top', 'lespaul_domain_adm' ),
							'100% 50%'  => __( 'Right, center vertically', 'lespaul_domain_adm' ),
							'100% 100%' => __( 'Right, bottom', 'lespaul_domain_adm' ),
							),
						"default" => '50% 0'
					),
					array(
						"type" => "select",
						"id" => $prefixBg."bg-img-repeat",
						"label" => __( 'Background image repeat', 'lespaul_domain_adm' ),
						"desc" => __( 'Set background image repeating', 'lespaul_domain_adm' ),
						"options" => array(
							'no-repeat' => __( 'Do not repeat', 'lespaul_domain_adm' ),
							'repeat'    => __( 'Repeat', 'lespaul_domain_adm' ),
							'repeat-x'  => __( 'Repeat horizontally', 'lespaul_domain_adm' ),
							'repeat-y'  => __( 'Repeat vertically', 'lespaul_domain_adm' )
							),
						"default" => 'no-repeat'
					),
					array(
						"type" => "radio",
						"id" => $prefixBg."bg-img-attachment",
						"label" => __( 'Background image attachment', 'lespaul_domain_adm' ),
						"desc" => __( 'Set background image attachment', 'lespaul_domain_adm' ),
						"options" => array(
							'fixed'  => __( 'Fixed position', 'lespaul_domain_adm' ),
							'scroll' => __( 'Move on scrolling', 'lespaul_domain_adm' )
							),
						"default" => 'fixed'
					),
					array(
						"type" => "checkbox",
						"id" => $prefixBg."bg-img-fit-window",
						"label" => __( 'Fit browser window width', 'lespaul_domain_adm' ),
						"desc" => __( 'Makes the image to scale to browser window width. Note that background image position and repeat options does not apply when this is checked.', 'lespaul_domain_adm' ),
						"value" => "true"
					),
				array(
					"id" => $prefix."bg",
					"type" => "inside-wrapper-close"
				),
			array(
				"type" => "section-close"
			)

		);

		return $metaPostOptions;
	}
Esempio n. 12
0
 function wm_css_background($args = array())
 {
     //Helper variables
     $args = wp_parse_args($args, apply_filters('wmhook_wm_css_background_defaults', array('option_base' => '', 'high_dpi' => false, 'post' => null, 'return' => 'output')));
     $args = apply_filters('wmhook_wm_css_background_args', $args);
     if ($args['post'] && is_object($args['post']) && isset($args['post']->ID)) {
         $args['post'] = $args['post']->ID;
     } else {
         $args['post'] = absint($args['post']);
     }
     //Requirements check
     if ($args['post'] && !function_exists('wma_meta_option')) {
         return;
     }
     $output = $output_defaults = array('attachment' => '', 'color' => '', 'image' => '', 'output' => '', 'position' => '', 'repeat' => '', 'size' => '');
     //Preparing output
     //Background color
     $output['color'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-color') : wma_meta_option($args['option_base'] . 'bg-color', $args['post']);
     if ($output['color']) {
         $output['color'] = '#' . str_replace('#', '', $output['color']);
     }
     //Background image
     $output['image'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-url') : wma_meta_option($args['option_base'] . 'bg-url', $args['post']);
     if (is_array($output['image']) && isset($output['image']['id'])) {
         $attachment = (array) wp_get_attachment_image_src($output['image']['id'], 'full');
         $output['image'] = isset($attachment[0]) ? $attachment[0] : '';
         $output['size'] = isset($attachment[1]) ? $attachment[1] . 'px' : '';
         $output['size'] .= isset($attachment[2]) ? ' ' . $attachment[2] . 'px' : '';
         if ($args['high_dpi']) {
             $attachment = !$args['post'] ? wm_option($args['option_base'] . 'bg-url-hidpi') : wma_meta_option($args['option_base'] . 'bg-url-hidpi', $args['post']);
             $attachment = $attachment && isset($attachment['id']) ? (array) wp_get_attachment_image_src($attachment['id'], 'full') : false;
             if ($attachment && isset($attachment[0])) {
                 $output['image'] = $attachment[0];
             }
         }
     } elseif ($output['image']) {
         $attachment_id = wm_get_image_id_from_url($output['image']);
         if ($attachment_id) {
             $attachment = (array) wp_get_attachment_image_src($attachment_id, 'full');
             $output['size'] = isset($attachment[1]) ? $attachment[1] . 'px' : '';
             $output['size'] .= isset($attachment[2]) ? ' ' . $attachment[2] . 'px' : '';
         }
         if ($args['high_dpi']) {
             $output['image'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-url-hidpi') : wma_meta_option($args['option_base'] . 'bg-url-hidpi', $args['post']);
         }
     }
     if ($output['image']) {
         $output['image'] = ' url(' . trim($output['image']) . ')';
     }
     //Background repeat
     if ($output['image']) {
         $output['repeat'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-repeat') : wma_meta_option($args['option_base'] . 'bg-repeat', $args['post']);
         if (trim($output['repeat'])) {
             $output['repeat'] = ' ' . trim($output['repeat']);
         }
     }
     //Background attachment
     if ($output['image']) {
         $output['attachment'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-attachment') : wma_meta_option($args['option_base'] . 'bg-attachment', $args['post']);
         if (trim($output['attachment'])) {
             $output['attachment'] = ' ' . trim($output['attachment']);
         }
     }
     //Background position
     if ($output['image']) {
         $output['position'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-position') : wma_meta_option($args['option_base'] . 'bg-position', $args['post']);
         if (trim($output['position'])) {
             $output['position'] = ' ' . trim($output['position']);
         }
     }
     //Background size
     if ($output['image']) {
         $image_size = !$args['post'] ? wm_option($args['option_base'] . 'bg-size') : wma_meta_option($args['option_base'] . 'bg-size', $args['post']);
         if ($image_size) {
             $output['size'] = $image_size;
         }
     }
     $output['size'] = trim($output['size']);
     if ($output['size']) {
         $output['size'] = '; background-size: ' . $output['size'];
     }
     //Output string setup
     $output['output'] = $output['color'] . $output['image'] . $output['repeat'] . $output['attachment'] . $output['position'] . $output['size'];
     //If outputing high DPI image, check if image set, if not output nothing (not even background-size)!
     if ($args['high_dpi'] && !$output['image']) {
         $output = $output_defaults;
     }
     //Filter $output array
     $output = apply_filters('wmhook_wm_css_background_output_array', $output, $args);
     //Output
     return apply_filters('wmhook_wm_css_background_output', $output[$args['return']], $args);
 }
Esempio n. 13
0
			function wm_form_datepicker( $value, $isMeta = null ) {
				if ( 'meta' == $isMeta )
					$val = wm_meta_option( $value['id'] );
				else
					$val = wm_option( $value['id'] );
				$valId = WM_THEME_SETTINGS_PREFIX . $value['id'];

				$default  = ( isset( $value['default'] ) ) ? ( intval( $value['default'] ) ) : ( null );
				$class    = ( isset( $value['class'] ) && $value['class'] ) ? ( ' class="' . $value['class'] . '"' ) : ( null );
				$setValue = ( $val ) ? ( $val ) : ( $default );
				?>
				<div class="option" data-option="<?php echo $valId; ?>">
				<p>
					<?php if ( $default ) echo '<a data-default="' . $valId . '" class="btn btn-default" title="' . __( 'Use default value', 'lespaul_domain_adm' ) . '">' . __( 'Default value', 'lespaul_domain_adm' ) . '<span>' . $default . '</span></a>'; ?>
					<label for="<?php echo $valId; ?>"><?php echo strip_tags( $value['label'] ); ?></label>
				</p>
				<?php if ( isset( $value['desc'] ) && $value['desc'] ) echo '<p class="desc">' . $value['desc'] . '</p>'; ?>
				<p>
					<input type="text" data-type="date" name="<?php echo $valId; ?>" id="<?php echo $valId; ?>" value="<?php echo esc_attr( $setValue ); ?>"<?php echo $class; ?> />
				</p>
				</div> <!-- /option -->
				<?php
				wm_conditional_show( $value, $valId );
			}
Esempio n. 14
0
		function wm_shortcode_simple_slideshow( $atts, $content = null ) {
			extract( shortcode_atts( array(
				'ids'  => '',
				'link' => '',
				'size' => 'ratio-169',
				'time' => 5000,
				), $atts )
				);

			$ids = explode( ',', trim( preg_replace( '/\s+/', '', $ids ) ) );

			if ( empty( $ids ) )
				return;

			$out = '';

			foreach ( $ids as $imageId ) {
				$fullImage = wp_get_attachment_image_src( $imageId, wm_option( 'general-lightbox-img' ) );

				if ( '1' == $link )
					$out .= '<a href="' . $fullImage[0] . '">';
				elseif( $link )
					$out .= '<a href="' . esc_url( $link ) . '">';

				$out .= wp_get_attachment_image( $imageId, $size );
				$out .= ( $link ) ? ( '</a>' ) : ( '' );
			}

			if ( $out )
				wp_enqueue_script( 'bxslider' );

			//output
			return ( $out ) ? ( '<div class="simple-slider" data-time="' . absint( $time ) . '">' . $out . '</div>' ) : ( '' );
		}
Esempio n. 15
0
		function wm_search_form( $form ) {
			$form = '
				<form method="get" class="form-search" action="' . home_url( '/' ) . '">
				<fieldset>
					<label class="assistive-text invisible">' . __( 'Search for:', 'lespaul_domain' ) . '</label>
					<input type="text" class="text" name="s" placeholder="' . wm_option( 'general-search-placeholder' ) . '" />
					<input type="submit" class="submit" value="' . __( 'Submit', 'lespaul_domain' ) . '" />
					<i class="wmicon-search"></i>
				</fieldset>
				</form>
				';

			return $form;
		}
Esempio n. 16
0
	function start_el( &$output, $element, $depth, $args ) {
		global $wp_query;
		$class_names = '';

		$indent  = ( $depth ) ? ( str_repeat( "\t", $depth ) ) : ( '' );
		$classes = ( empty( $element->classes ) ) ? ( array() ) : ( (array) $element->classes );

		$classes = implode( ' ', $classes );
		$classes = str_replace( array( 'alignleft', 'alignright' ), '', $classes );
		$classes = explode( ' ', $classes );

		if ( 1 === $element->menu_order )
			$classes[] = 'first';

		$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $element ) );

		$class_names = ' class="'. esc_attr( str_replace( 'icon-', 'iconnav-', $class_names ) ) . '"';

		//Link attributes
		$attributes  = ( ! empty( $element->attr_title ) ) ? ( ' title="' . esc_attr( $element->attr_title ) . '"' ) : ( '' );
		$attributes .= ( ! empty( $element->target ) ) ? ( ' target="' . esc_attr( $element->target ) . '"' ) : ( '' );
		$attributes .= ( ! empty( $element->xfn ) ) ? ( ' rel="' . esc_attr( $element->xfn ) . '"' ) : ( '' );
		$attributes .= ( ! empty( $element->url ) ) ? ( ' href="' . esc_attr( $element->url ) . '"' ) : ( '' );

		//Display desciption
		$mainItemStart = '';
		$mainItemEnd   = '';

		$outItem = $args->before;
		if ( ! empty( $element->url ) && 'http://' != $element->url && 'http://-' != $element->url && '-' != $element->url )
			$outItem .= '<a'. $attributes .' class="inner">';
		else
			$outItem .= '<span class="inner ' . esc_attr( $class_names ) . '">';
		$outItem .= $args->link_before . $mainItemStart . apply_filters( 'the_title', do_shortcode( $element->title ), $element->ID ) . $mainItemEnd . $args->link_after;
		if ( ! empty( $element->url ) && 'http://' != $element->url && 'http://-' != $element->url && '-' != $element->url )
			$outItem .= '</a>';
		else
			$outItem .= '</span>';
		$outItem .= $args->after;

		if ( wm_option( 'access-client-area' ) ) {
			$pageId  = ( isset( $element->object_id ) && $element->object_id ) ? ( $element->object_id ) : ( 0 );
			$allowed = wm_restriction_page( $pageId );
		} else {
			$allowed = true;
		}

		if ( $allowed )
			$output .= $indent . '<li' . $class_names .'>' . apply_filters( 'walker_nav_menu_start_el', $outItem, $element, $depth, $args );
		else
			$output .= '<li class="hide">';
	} // /start_el
Esempio n. 17
0
/**
 * Helper variables
 */
$output = '';
$wm_css_content = array();
$wm_theme_css_files = array(10 => 'reset', 20 => 'icons-basic', 30 => 'core', 40 => 'columns', 50 => 'typography', 60 => 'wp-styles', 70 => 'forms', 80 => 'headings', 90 => 'header', 100 => 'slider', 110 => 'content', 120 => 'comments', 130 => 'sidebar', 140 => 'footer', 150 => 'prettyphoto', 160 => 'plugins', 170 => 'shortcodes', 180 => 'borders', 190 => 'ltr-borders', 200 => 'animate', 210 => 'specials', 400 => 'responsive', 1000 => 'high-dpi');
//RTL languages support
if (is_rtl()) {
    $wm_theme_css_files[190] = 'rtl-borders';
}
//Disable PrettyPhoto
if (wm_option('skin-disable-lightbox')) {
    unset($wm_theme_css_files[150]);
}
//Disable Animate.css
if (wm_option('skin-disable-animatecss')) {
    unset($wm_theme_css_files[200]);
}
/**
 * Modify the CSS files array upon plugins installed
 */
/**
 * @since  Mustang Lite (WooCommerce and bbPress stylesheets removed)
 */
/**
 * Allow filtering of the CSS files array
 */
$wm_theme_css_files = apply_filters('wmhook_wm_theme_css_files', $wm_theme_css_files);
ksort($wm_theme_css_files);
/**
 * Preparing output
Esempio n. 18
0
				if ( $selectorStyles )
					$outStyles .= $selector['selector'] . ' {' . $selectorStyles . '}' . "\r\n";
			}
		}

		if ( $outStyles )
			$out .= "\r\n\r\n\r\n/* Custom styles */\r\n" . $outStyles;
	}





/*
*****************************************************
*      CSS HEADER
*****************************************************
*/

	$expireTime = ( wm_option( 'general-no-css-cache' ) ) ? ( 0 ) : ( WM_CSS_EXPIRATION );

	header( 'content-type: text/css; charset: UTF-8' );
	header( 'expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expireTime ) . ' GMT' );
	header( 'cache-control: public, max-age=' . $expireTime );

	$out = wm_minimize_css( $out );

	echo $out;

?>
Esempio n. 19
0
$postId               = ( is_archive() && get_option( 'page_for_posts' ) ) ? ( get_option( 'page_for_posts' ) ) : ( null );
$sidebarLayoutDefault = ( wm_option( 'contents-sidebar-position' ) ) ? ( esc_attr( wm_option( 'contents-sidebar-position' ) ) ) : ( WM_SIDEBAR_DEFAULT_POSITION );
$sidebarLayout        = ( wm_meta_option( 'layout', $postId ) ) ? ( wm_meta_option( 'layout', $postId ) ) : ( $sidebarLayoutDefault );
$overrideSidebar      = ( wm_meta_option( 'sidebar', $postId ) && -1 != wm_meta_option( 'sidebar', $postId ) ) ? ( wm_meta_option( 'sidebar', $postId ) ) : ( WM_SIDEBAR_FALLBACK );

if ( is_active_sidebar( $overrideSidebar ) && 'none' != $sidebarLayout ) {
	$sidebarPanes = ( wm_option( 'contents-sidebar-width' ) ) ? ( esc_attr( wm_option( 'contents-sidebar-width' ) ) ) : ( WM_SIDEBAR_WIDTH );
	$sidebarPanes = ( 2 == count( explode( ';', $sidebarPanes ) ) ) ? ( explode( ';', $sidebarPanes ) ) : ( explode( ';', WM_SIDEBAR_WIDTH ) );

	if ( 'left' == $sidebarLayout )
		$sidebarPanes[1] .= ' sidebar-left';
} else {
	$sidebarPanes = array( '', ' twelve pane' );
}

if ( is_archive() && wm_option( 'blog-archive-no-sidebar' ) )
	$sidebarPanes[1] = ' twelve pane';
?>
<div class="wrap-inner">

<section class="main<?php echo $sidebarPanes[1]; ?>">

	<?php do_action( 'wm_start_main_content' ); ?>

	<?php
	$catDesc = category_description();
	if ( ! empty( $catDesc ) )
		echo '<div class="cat-desc">' . apply_filters( 'the_content', category_description() ) . '</div>';
	?>

	<?php get_template_part( 'inc/loop/loop', 'index' ); ?>
Esempio n. 20
0
						'container_id'    => null,
						'menu_class'      => 'menu-footer',
						'menu_id'         => null,
						'echo'            => true,
						'fallback_cb'     => null,
						'before'          => null,
						'after'           => null,
						'link_before'     => null,
						'link_after'      => null,
						'items_wrap'      => '<div class="%2$s"><ul>%3$s</ul></div>',
						'depth'           => 1,
						'walker'          => ( has_nav_menu( $menuLocationName ) ) ? ( new wm_widget_walker() ) : ( null )
					) );

			$class = ( is_page_template( 'page-template/construction.php' ) ) ? ( 'text-center clearfix' ) : ( 'clearfix' );

			wm_credits( $class );
			?>
		</div>
	</div></section> <!-- /bottom-wrap -->
<!-- /footer --></footer>

<?php do_action( 'wm_after_website' ); ?>

<!-- wp_footer() -->
<?php wp_footer(); //WordPress footer hook ?>
</body>

<?php if ( ! wm_option( 'general-website-author' ) ) echo '<!-- ' . wm_static_option( 'static-webdesigner' ) . ' -->'; ?>

</html>
Esempio n. 21
0
		function wm_theme_options_page() {
			global $options, $options_ei, $wp_version, $current_user;

			$import = '';

			if ( WM_THEME_SHORTNAME . '-import' === $_GET['page'] ) {
				$options = $options_ei;
				$import  = '-import';
			}

			$wp_version_class = substr( str_replace( '.', '', $wp_version ), 0, 2 );

			//Theme options page
			?>
		<div class="wm-wrap wm-options-panel wp-<?php echo $wp_version_class; ?> <?php echo $current_user->admin_color; if ( is_rtl() && wm_option( 'general-admin-ltr' ) ) echo ' force-ltr'; ?>">
			<?php
			//Status messages
				$msg       = array();
				$delayLong = '';

				if ( $wp_version < WM_WP_COMPATIBILITY ) {
					$msg[]     = __( 'THIS THEME IS NOT COMPATIBLE WITH YOUR WORDPRESS VERSION. PLEASE UPGRADE YOUR WORDPRESS INSTALLATION.', 'lespaul_domain_panel' );
					$delayLong = ' class="delay-long warning"';
				}
				if ( isset( $_GET['saved'] ) && ! empty( $_GET['saved'] ) && $_GET['saved'] )
					$msg[] = __( 'Settings were updated successfully.', 'lespaul_domain_panel' );
				if ( isset( $_GET['reset'] ) && ! empty( $_GET['reset'] ) && $_GET['reset'] )
					$msg[] = __( 'Settings were reset.', 'lespaul_domain_panel' );

				//Display message box if any message sent
				if ( ! empty( $msg ) ) {
					$msgOut = '<div id="message"' . $delayLong . ' class="wm-message"><p>';
					$msgOut .=  implode( '<br /><br />', $msg );
					$msgOut .= '</p></div>';
					echo $msgOut;
				}
			?>

			<!-- SIDE PANEL -->
			<div id="nav">
				<!-- Logo -->
				<?php
				$whiteLabel       = ( wm_option( 'branding-panel-logo' ) || wm_option( 'branding-panel-no-logo' ) ) ? ( 'white-label/' ) : ( 'default/' );
				$panelLogoURL     = ( wm_option( 'branding-panel-logo' ) || wm_option( 'branding-panel-no-logo' ) ) ? ( '#' ) : ( 'http://www.webmandesign.eu' );

				if ( wm_option( 'branding-panel-logo' ) && ! wm_option( 'branding-panel-no-logo' ) )
					$panelLogoImage = '<img src="' . esc_url( wm_option( 'branding-panel-logo' ) ) . '" alt="" />';
				elseif ( wm_option( 'branding-panel-no-logo' ) )
					$panelLogoImage = '';
				else
					$panelLogoImage = '<img src="' . WM_ASSETS_ADMIN . 'img/logo-webman-adminpanel.png" alt="WebMan Design" />';

				echo '<a href="' . $panelLogoURL . '" title="WebMan Design" class="logo">' . $panelLogoImage . '</a>';
				?>

				<!-- Main tabs -->
				<ul class="tabs">
					<?php
					if ( is_array( $options ) ) {
						$i = 0;
						foreach ( $options as $value ) {
							if ( 'section-open' == $value['type'] ) {
								++$i;
								$out = '<li class="item-' . $i . ' ' . $value['section-id'] . '"><a href="#set-' . $value['section-id'] . '">';
								$out .= '<span class="icon"><img src="' . WM_ASSETS_ADMIN . 'img/icons/' . $whiteLabel . 'ico-settings-' . $value['section-id'] . '.png" alt="" /></span>';
								$out .= '<strong>' . $value['title'] . '</strong>';
								$out .= '</a></li>';
								echo $out;
							}
						}
					}
					?>
				</ul> <!-- /tabs -->
			</div> <!-- /nav -->


			<!-- CONTENT -->
			<form id="wm-theme-options<?php echo $import; ?>-form" class="content no-js" method="post" action="<?php echo admin_url( 'themes.php?page=' . WM_THEME_SHORTNAME . '-options' ); ?>">

				<!-- HEADER -->
				<h2>
					<?php
					$panelTitle = WM_THEME_NAME . ' ' . WM_THEME_VERSION;

					if ( wm_option( 'branding-panel-logo' ) || wm_option( 'branding-panel-no-logo' ) )
						$panelTitle = '';
					if ( ! wm_option( 'branding-panel-no-logo' ) && strpos( wm_option( 'branding-panel-logo' ), 'logo-' . WM_THEME_SHORTNAME . '-admin.png' ) )
						$panelTitle = sprintf( '<small>' . __( 'Using %1$s theme, version %2$s', 'lespaul_domain_panel' ) . '</small>', WM_THEME_NAME, WM_THEME_VERSION );

					echo $panelTitle;
					?>
					<input name="primary-submit" type="submit" value="<?php _e( 'Save', 'lespaul_domain_panel' ) ?>" class="btn submit" id="primary-submit" />
				</h2>

				<!-- MAIN CONTENT -->
				<fieldset id="main">
					<?php wm_render_form( $options ); ?>
				</fieldset> <!-- /main -->

				<!-- FOOTER -->
				<div id="wrap-footer">
					<p>&copy; WebMan | Version 4.0<br /><a href="http://support.webmandesign.eu" target="_blank">WebMan Support</a></p>
					<?php wp_nonce_field( 'wm-theme-options-form' ); ?>
					<input type="hidden" name="action" value="wm-saving-options" />
				</div> <!-- /footer -->

			</form> <!-- /content -->

		</div> <!-- /wm-wrap -->
			<?php
		}
Esempio n. 22
0
		function wm_staff_meta_fields() {
			global $sidebarPosition;

			$skin            = ( ! wm_option( 'design-skin' ) ) ? ( 'default.css' ) : ( wm_option( 'design-skin' ) );
			$prefix          = 'staff-';
			$prefixBg        = 'background-';
			$prefixBgHeading = 'heading-background-';
			$fontFile        = ( ! file_exists( WM_FONT . 'custom/config.json' ) ) ? ( WM_FONT . 'fontello/config.json' ) : ( WM_FONT . 'custom/config.json' );
			$fontIcons       = wm_fontello_classes( $fontFile );

			//Get icons
			$icons = array();
			$icons[''] = __( '- select icon -', 'lespaul_domain_adm' );
			foreach ( $fontIcons as $icon ) {
				$icons[$icon] = ucwords( str_replace( '-', ' ', substr( $icon, 4 ) ) );
			}

			$widgetsButtons = ( current_user_can( 'switch_themes' ) ) ? ( '<a class="button confirm" href="' . get_admin_url() . 'widgets.php">' . __( 'Manage widget areas', 'lespaul_domain_adm' ) . '</a> <a class="button confirm" href="' . get_admin_url() . 'admin.php?page=' . WM_THEME_SHORTNAME . '-options">' . __( 'Create new widget areas', 'lespaul_domain_adm' ) . '</a>' ) : ( '' );

			$metaFields = array(

				//Position settings
				array(
					"type" => "section-open",
					"section-id" => "position",
					"title" => __( 'General', 'lespaul_domain_adm' )
				),
					array(
						"type" => "text",
						"id" => $prefix."position",
						"label" => __( 'Position', 'lespaul_domain_adm' ),
						"desc" => __( 'Staff member position', 'lespaul_domain_adm' )
					)
			);

			if ( wm_option( 'cp-staff-rich' ) )
				array_push( $metaFields,
					array(
						"type" => "checkbox",
						"id" => "staff-no-rich",
						"label" => __( 'Disable rich staff profile', 'lespaul_domain_adm' ),
						"desc" => __( 'Disables rich staff profile page for this staff member only (use theme admin panel to disable this globally).<br />Only excerpt content will be displayed in staff members list.', 'lespaul_domain_adm' )
					)
				);

			array_push( $metaFields,
				array(
					"type" => "section-close"
				),



				//Contacts settings
				array(
					"type" => "section-open",
					"section-id" => "contact",
					"title" => __( 'Contact', 'lespaul_domain_adm' )
				),
					array(
						"type" => "text",
						"id" => $prefix."phone",
						"label" => __( 'Phone', 'lespaul_domain_adm' ),
						"desc" => __( 'Phone number', 'lespaul_domain_adm' )
					),
					array(
						"type" => "text",
						"id" => $prefix."email",
						"label" => __( 'E-mail', 'lespaul_domain_adm' ),
						"desc" => __( 'E-mail (spam protection will be applied)', 'lespaul_domain_adm' )
					),
					array(
						"type" => "text",
						"id" => $prefix."linkedin",
						"label" => __( 'LinkedIn', 'lespaul_domain_adm' ),
						"desc" => __( 'LinkedIn account URL', 'lespaul_domain_adm' )
					),
					array(
						"type" => "text",
						"id" => $prefix."skype",
						"label" => __( 'Skype username', 'lespaul_domain_adm' ),
						"desc" => __( 'Skype username', 'lespaul_domain_adm' )
					),
					array(
						"type" => "additems",
						"id" => $prefix."custom-contacts",
						"label" => __( 'Custom contacts', 'lespaul_domain_adm' ),
						"desc" => __( 'Press [+] button to add new custom contact info', 'lespaul_domain_adm' ),
						"field" => "attributes-selectable",
						"options-attr" => $icons,
					),
				array(
					"type" => "section-close"
				)

			);

			if ( wm_option( 'cp-staff-rich' ) ) {
				array_push( $metaFields,
					//Sidebar settings
					array(
						"type" => "section-open",
						"section-id" => "sidebar-section",
						"title" => __( 'Sidebar', 'lespaul_domain_adm' )
					),
						array(
							"type" => "box",
							"content" => '<h4>' . __( 'Choose a sidebar and its position on the post/page', 'lespaul_domain_adm' ) . '</h4>' . $widgetsButtons,
						),

						array(
							"type" => "layouts",
							"id" => "layout",
							"label" => __( 'Sidebar position', 'lespaul_domain_adm' ),
							"desc" => __( 'Choose a sidebar position on the post/page (set the first one to use the theme default settings)', 'lespaul_domain_adm' ),
							"options" => $sidebarPosition,
							"default" => ""
						),
						array(
							"type" => "select",
							"id" => "sidebar",
							"label" => __( 'Choose a sidebar', 'lespaul_domain_adm' ),
							"desc" => __( 'Select a widget area used as a sidebar for this post/page (if not set, the dafault theme settings will apply)', 'lespaul_domain_adm' ),
							"options" => wm_widget_areas(),
							"default" => ""
						),
					array(
						"type" => "section-close"
					),



					//Design - website background settings
					array(
						"type" => "section-open",
						"section-id" => "background-settings",
						"title" => __( 'Backgrounds', 'lespaul_domain_adm' )
					),
						array(
							"type" => "heading4",
							"content" => __( 'Main heading area background', 'lespaul_domain_panel' )
						),
						array(
							"id" => $prefix."bg-heading",
							"type" => "inside-wrapper-open",
							"class" => "toggle box"
						),
							array(
								"type" => "slider",
								"id" => $prefixBgHeading."padding",
								"label" => __( 'Section padding', 'lespaul_domain_adm' ),
								"desc" => __( 'Top and bottom padding size applied on the section (leave zero for default)', 'lespaul_domain_adm' ),
								"default" => 0,
								"min" => 1,
								"max" => 100,
								"step" => 1,
								"validate" => "absint"
							),
							array(
								"type" => "color",
								"id" => $prefixBgHeading."color",
								"label" => __( 'Text color', 'lespaul_domain_adm' ),
								"desc" => __( 'Sets the custom main heading text color', 'lespaul_domain_adm' ),
								"default" => "",
								"validate" => "color"
							),
							array(
								"type" => "color",
								"id" => $prefixBgHeading."bg-color",
								"label" => __( 'Background color', 'lespaul_domain_adm' ),
								"desc" => __( 'Sets the custom main heading background color', 'lespaul_domain_adm' ),
								"default" => "",
								"validate" => "color"
							),
							array(
								"type" => "image",
								"id" => $prefixBgHeading."bg-img-url",
								"label" => __( 'Custom background image', 'lespaul_domain_adm' ),
								"desc" => __( 'To upload a new image, press the [+] button and use the Media Uploader as you would be adding an image into post', 'lespaul_domain_adm' ),
								"default" => "",
								"readonly" => true,
								"imgsize" => 'mobile'
							),
							array(
								"type" => "select",
								"id" => $prefixBgHeading."bg-img-position",
								"label" => __( 'Background image position', 'lespaul_domain_adm' ),
								"desc" => __( 'Set background image position', 'lespaul_domain_adm' ),
								"options" => array(
									'50% 50%'   => __( 'Center', 'lespaul_domain_adm' ),
									'50% 0'     => __( 'Center horizontally, top', 'lespaul_domain_adm' ),
									'50% 100%'  => __( 'Center horizontally, bottom', 'lespaul_domain_adm' ),
									'0 0'       => __( 'Left, top', 'lespaul_domain_adm' ),
									'0 50%'     => __( 'Left, center vertically', 'lespaul_domain_adm' ),
									'0 100%'    => __( 'Left, bottom', 'lespaul_domain_adm' ),
									'100% 0'    => __( 'Right, top', 'lespaul_domain_adm' ),
									'100% 50%'  => __( 'Right, center vertically', 'lespaul_domain_adm' ),
									'100% 100%' => __( 'Right, bottom', 'lespaul_domain_adm' ),
									),
								"default" => '50% 0'
							),
							array(
								"type" => "select",
								"id" => $prefixBgHeading."bg-img-repeat",
								"label" => __( 'Background image repeat', 'lespaul_domain_adm' ),
								"desc" => __( 'Set background image repeating', 'lespaul_domain_adm' ),
								"options" => array(
									'no-repeat' => __( 'Do not repeat', 'lespaul_domain_adm' ),
									'repeat'    => __( 'Repeat', 'lespaul_domain_adm' ),
									'repeat-x'  => __( 'Repeat horizontally', 'lespaul_domain_adm' ),
									'repeat-y'  => __( 'Repeat vertically', 'lespaul_domain_adm' )
									),
								"default" => 'no-repeat'
							),
						array(
							"id" => $prefix."bg-heading",
							"type" => "inside-wrapper-close"
						)
				);

				if ( 'fullwidth' == wm_option( 'general-boxed' ) ) {
					array_push( $metaFields,
						array(
							"type" => "section-close"
						)
					);
					return $metaFields;
				}

				array_push( $metaFields,

						array(
							"type" => "heading4",
							"content" => __( 'Page background', 'lespaul_domain_panel' )
						),
						array(
							"id" => $prefix."bg",
							"type" => "inside-wrapper-open",
							"class" => "toggle box"
						),
							array(
								"type" => "color",
								"id" => $prefixBg."bg-color",
								"label" => __( 'Background color', 'lespaul_domain_adm' ),
								"desc" => __( 'Sets the custom website background color.', 'lespaul_domain_adm' ) . '<br />' . __( 'Please always set this to reset any possible background styles applied on main HTML element.', 'lespaul_domain_adm' ),
								"default" => "",
								"validate" => "color"
							),
							array(
								"type" => "image",
								"id" => $prefixBg."bg-img-url",
								"label" => __( 'Custom background image', 'lespaul_domain_adm' ),
								"desc" => __( 'To upload a new image, press the [+] button and use the Media Uploader as you would be adding an image into post', 'lespaul_domain_adm' ),
								"default" => "",
								"readonly" => true,
								"imgsize" => 'mobile'
							),
							array(
								"type" => "select",
								"id" => $prefixBg."bg-img-position",
								"label" => __( 'Background image position', 'lespaul_domain_adm' ),
								"desc" => __( 'Set background image position', 'lespaul_domain_adm' ),
								"options" => array(
									'50% 50%'   => __( 'Center', 'lespaul_domain_adm' ),
									'50% 0'     => __( 'Center horizontally, top', 'lespaul_domain_adm' ),
									'50% 100%'  => __( 'Center horizontally, bottom', 'lespaul_domain_adm' ),
									'0 0'       => __( 'Left, top', 'lespaul_domain_adm' ),
									'0 50%'     => __( 'Left, center vertically', 'lespaul_domain_adm' ),
									'0 100%'    => __( 'Left, bottom', 'lespaul_domain_adm' ),
									'100% 0'    => __( 'Right, top', 'lespaul_domain_adm' ),
									'100% 50%'  => __( 'Right, center vertically', 'lespaul_domain_adm' ),
									'100% 100%' => __( 'Right, bottom', 'lespaul_domain_adm' ),
									),
								"default" => '50% 0'
							),
							array(
								"type" => "select",
								"id" => $prefixBg."bg-img-repeat",
								"label" => __( 'Background image repeat', 'lespaul_domain_adm' ),
								"desc" => __( 'Set background image repeating', 'lespaul_domain_adm' ),
								"options" => array(
									'no-repeat' => __( 'Do not repeat', 'lespaul_domain_adm' ),
									'repeat'    => __( 'Repeat', 'lespaul_domain_adm' ),
									'repeat-x'  => __( 'Repeat horizontally', 'lespaul_domain_adm' ),
									'repeat-y'  => __( 'Repeat vertically', 'lespaul_domain_adm' )
									),
								"default" => 'no-repeat'
							),
							array(
								"type" => "radio",
								"id" => $prefixBg."bg-img-attachment",
								"label" => __( 'Background image attachment', 'lespaul_domain_adm' ),
								"desc" => __( 'Set background image attachment', 'lespaul_domain_adm' ),
								"options" => array(
									'fixed'  => __( 'Fixed position', 'lespaul_domain_adm' ),
									'scroll' => __( 'Move on scrolling', 'lespaul_domain_adm' )
									),
								"default" => 'fixed'
							),
							array(
								"type" => "checkbox",
								"id" => $prefixBg."bg-img-fit-window",
								"label" => __( 'Fit browser window width', 'lespaul_domain_adm' ),
								"desc" => __( 'Makes the image to scale to browser window width. Note that background image position and repeat options does not apply when this is checked.', 'lespaul_domain_adm' ),
								"value" => "true"
							),
						array(
							"id" => $prefix."bg",
							"type" => "inside-wrapper-close"
						),
					array(
						"type" => "section-close"
					)

				);
			}

			return $metaFields;
		}
Esempio n. 23
0
			'after_widget'  => $widgetArea['after_widget'],
			'before_title'  => $widgetArea['before_title'],
			'after_title'   => $widgetArea['after_title']
			) );
	}



/*
*****************************************************
*      3) CUSTOM WIDGET AREAS REGISTRATION
*****************************************************
*/
	$widgetAreasCustom      = array();
	$sidebarArraysCheck     = array();
	$widgetAreasCustomNames = wm_option( 'widgets-sidebars' );
	$sidebarDescription     = sprintf( __( 'Custom widget area created in %s admin panel. Flexible layout, maximum 5 widgets (when displayed horizontally).', 'lespaul_domain_adm' ), WM_THEME_NAME );

	if ( is_array( $widgetAreasCustomNames ) && ! empty( $widgetAreasCustomNames ) ) {
		foreach ( $widgetAreasCustomNames as $sidebarName ) {

			$sidebarID = 'wmcs-' . sanitize_title( $sidebarName ); //creating sidebar ID

			//creating custom sidebars array
			if ( 'wmcs-' != $sidebarID && ! in_array( $sidebarID, $sidebarArraysCheck ) ) {
				$newSidebar = array(
						'name' => esc_attr( preg_replace( '/\s+/', ' ', $sidebarName ) ), //remove spaces
						'id'   => $sidebarID
					);
				array_push( $widgetAreasCustom, $newSidebar ); //add a sidebar at the end of all sidebars array
				array_push( $sidebarArraysCheck, $sidebarID ); //add a sidebar at the end of all sidebars array
Esempio n. 24
0
    function wm_comments_off()
    {
        //Helper variables
        global $current_screen;
        $output = '';
        $post_types = apply_filters('wmhook_admin_comments', wm_option('general-comments'));
        if (!is_array($post_types)) {
            $post_types = explode(',', $post_types);
        }
        $post_types = apply_filters('wmhook_wm_comments_off_post_types', array_filter($post_types));
        //Requirements check
        if (empty($post_types) || !isset($current_screen->post_type) || !isset($current_screen->action)) {
            return;
        }
        //Preparing output
        if (in_array($current_screen->post_type, $post_types) && 'add' == $current_screen->action) {
            $output .= '<script><!--
						if ( document.post ) {
							var the_comment = document.post.comment_status,
							    the_ping    = document.post.ping_status;
							if ( the_comment && the_ping ) {
								the_comment.checked = false;
								the_ping.checked    = false;
							}
						}
						//--></script>';
        }
        //Output
        echo apply_filters('wmhook_wm_comments_off_output', $output);
    }
Esempio n. 25
0
 function wm_sidebar_setup($return = false, $atts = array())
 {
     //Helper variables
     $output = apply_filters('wmhook_wm_sidebar_setup_output_defaults', array('class_main' => ' twelve pane', 'class_sidebar' => '', 'output' => '', 'position' => 'none'));
     //Requirements check
     if (!function_exists('wma_sidebar')) {
         if (!$return) {
             return $output;
         } else {
             if (isset($output[$return])) {
                 return $output[$return];
             } else {
                 return;
             }
         }
     }
     $defaults = array('page_id' => null, 'position' => wm_option('skin-sidebar-position') ? wm_option('skin-sidebar-position') : WM_DEFAULT_SIDEBAR_POSITION);
     $sidebar_none_posts = apply_filters('wmhook_sidebar_none_posts', array('wm_projects', 'page'));
     if (is_archive() && apply_filters('wmhook_archive_disable_sidebar', false) || is_singular($sidebar_none_posts) && !is_page_template('home.php')) {
         $defaults['position'] = 'none';
     }
     $defaults = apply_filters('wmhook_wm_sidebar_setup_defaults', $defaults);
     $atts = wp_parse_args($atts, $defaults);
     if ((is_home() || is_singular() || class_exists('WooCommerce') && is_shop()) && function_exists('wma_meta_option') && wma_meta_option('sidebar', $atts['page_id'])) {
         $atts['position'] = wma_meta_option('sidebar', $atts['page_id']);
     }
     if (is_singular() && 'sections' == wma_meta_option('sidebar', $atts['page_id'])) {
         $defaults['position'] = 'none';
     }
     $atts = apply_filters('wmhook_wm_sidebar_setup_atts', $atts);
     //Preparing output
     if ('none' !== $atts['position']) {
         $classes = wm_option('skin-sidebar-width') ? wm_option('skin-sidebar-width') : WM_DEFAULT_SIDEBAR_WIDTH;
         //First array value is for sidebar width, the second for content width
         $classes = explode(';', $classes);
         if (isset($classes[0])) {
             $output['class_sidebar'] = $classes[0];
         }
         if (isset($classes[1])) {
             if ('left' === $atts['position']) {
                 $classes[1] .= ' sidebar-left';
             }
             $output['class_main'] = $classes[1];
         }
     }
     $output['position'] = $atts['position'];
     //Actuall sidebar HTML output
     if ('none' !== $output['position']) {
         $output['output'] = wma_sidebar(apply_filters('wmhook_wm_sidebar_setup_sidebar_atts', array('attributes' => ' role="complementary"', 'class' => 'sidebar widget-area clearfix sidebar-' . esc_attr($output['position'] . $output['class_sidebar']), 'sidebar' => 'general'), $atts));
     }
     //If no sidebar to output, set fullwidth layout
     if (!$output['output']) {
         $output = array('class_main' => ' twelve pane', 'class_sidebar' => '', 'output' => '', 'position' => 'none');
     }
     //Output
     $output = apply_filters('wmhook_wm_sidebar_setup_output', $output, $atts);
     if (!$return) {
         return $output;
     } else {
         if (isset($output[$return])) {
             return $output[$return];
         } else {
             return;
         }
     }
 }
Esempio n. 26
0
 * 1) Required files
 */
//Widgets areas
if (file_exists(WM_SETUP . 'widgets.php') || file_exists(WM_SETUP_CHILD . 'widgets.php')) {
    locate_template(WM_SETUP_DIR . 'widgets.php', true);
}
//Load the theme introduction page
if (is_admin() && (file_exists(WM_SETUP . 'about/about.php') || file_exists(WM_SETUP_CHILD . 'about/about.php'))) {
    locate_template(WM_SETUP_DIR . 'about/about.php', true);
}
//Skinning functionality
if (function_exists('wma_amplifier')) {
    locate_template(WM_LIBRARY_DIR . 'skinning.php', true);
}
//Theme updater
if (is_admin() && !(wm_option('general-disable-update-notifier') || apply_filters('wmhook_disable_update_notifier', false))) {
    locate_template(WM_LIBRARY_DIR . 'updater/update-notifier.php', true);
}
/**
 * 10) Actions and filters
 */
/**
 * Actions
 */
//Admin customization
add_action('admin_enqueue_scripts', 'wm_admin_include', 998);
//Display admin notice
add_action('admin_notices', 'wm_admin_notice');
/**
 * Filters
 */
Esempio n. 27
0
/*
Template Name: Blog
*/

get_header();
?>
<div class="wrap-inner">

<?php
$postId               = ( is_home() ) ? ( get_option( 'page_for_posts' ) ) : ( null );
$sidebarLayoutDefault = ( wm_option( 'contents-sidebar-position' ) ) ? ( esc_attr( wm_option( 'contents-sidebar-position' ) ) ) : ( WM_SIDEBAR_DEFAULT_POSITION );
$sidebarLayout        = ( wm_meta_option( 'layout', $postId ) ) ? ( wm_meta_option( 'layout', $postId ) ) : ( $sidebarLayoutDefault );
$overrideSidebar      = ( wm_meta_option( 'sidebar', $postId ) && -1 != wm_meta_option( 'sidebar', $postId ) ) ? ( wm_meta_option( 'sidebar', $postId ) ) : ( WM_SIDEBAR_FALLBACK );

if ( is_active_sidebar( $overrideSidebar ) && 'none' != $sidebarLayout ) {
	$sidebarPanes = ( wm_option( 'contents-sidebar-width' ) ) ? ( esc_attr( wm_option( 'contents-sidebar-width' ) ) ) : ( WM_SIDEBAR_WIDTH );
	$sidebarPanes = ( 2 == count( explode( ';', $sidebarPanes ) ) ) ? ( explode( ';', $sidebarPanes ) ) : ( explode( ';', WM_SIDEBAR_WIDTH ) );

	if ( 'left' == $sidebarLayout )
		$sidebarPanes[1] .= ' sidebar-left';
} else {
	$sidebarPanes = array( '', ' twelve pane' );
}
?>

<section class="main clearfix<?php echo $sidebarPanes[1]; ?>">

	<?php do_action( 'wm_start_main_content' ); ?>

	<?php
	//Blog page content
 * Main RTL CSS Stylesheet Generator
 *
 * @package     WebMan WordPress Theme Framework
 * @subpackage  Main CSS Stylesheet Generator
 * @copyright   2014 WebMan - Oliver Juhas
 * @since       1.0
 * @version     1.2
 * @uses        Custom CSS Styles Generator
 * @uses        require() instead of require_once() due to previous inclusion of files when building global CSS stylesheet
 */
/**
 * Helper variables
 */
$output = '';
$wm_css_content = array();
$wm_theme_responsive = !wm_option('skin-disable-responsive') ? 'responsive' : 'static';
$wm_theme_css_files = array(10 => 'rtl', 20 => 'rtl-responsive');
//Responsive support
if ('static' === $wm_theme_responsive) {
    unset($wm_theme_css_files[20]);
}
/**
 * @since  Mustang Lite (WooCommerce and bbPress stylesheets removed)
 */
/**
 * Allow filtering of the CSS files array
 */
$wm_theme_css_files = apply_filters('wmhook_wm_theme_css_files_rtl', $wm_theme_css_files);
ksort($wm_theme_css_files);
/**
 * Preparing output
Esempio n. 29
0
		elseif ( ! is_single() )
			echo wm_thumb( array( 'size' => $imageSize ) );

	}
	?>
</div>

<div <?php post_class( 'article-content' ); ?>>

	<?php
	if ( ! is_single() )
		wm_heading( 'list' );
	?>

	<?php
	if ( is_single() || wm_option( 'blog-full-posts' ) ) {
		if ( is_single() )
			wm_meta();

		if ( has_excerpt() && ! post_password_required() )
			echo '<div class="article-excerpt">' . apply_filters( 'wm_default_content_filters', get_the_excerpt() ) . '</div>';

		the_content();

		do_action( 'wm_end_post' );
	} else {
		echo wm_content_or_excerpt( $post );
	}
	?>
</div>
Esempio n. 30
0
			),
			array(
				"type" => "hr"
			),

			array(
				"type" => "checkbox",
				"id" => $prefix."custom-css-enable",
				"label" => __( 'Enable custom CSS textarea', 'lespaul_domain_panel' ),
				"desc" => __( 'Please note that you should really use <strong>child theme</strong> to apply your custom CSS styles. That is the WordPress default, recommended and preffered approach to tweak CSS styles. You can use this additional textarea for fast fixes or prototyping. Save the settings after you check the field to make the textarea visible.', 'lespaul_domain_panel' ),
				"default" => "true"
			)

);

if ( wm_option( $prefix . 'custom-css-enable' ) )
	array_push( $options,
				array(
					"type" => "space"
				),
				array(
					"type" => "textarea",
					"id" => $prefix."custom-css",
					"label" => __( 'Custom CSS', 'lespaul_domain_panel' ),
					"desc" => __( 'Type in custom CSS styles. These styles will be added to the end of the main CSS stylesheet file.<br />Please note that you should use <strong>child theme</strong> for this purpose.', 'lespaul_domain_panel' ),
					"default" => "",
					"cols" => 200,
					"rows" => 15,
					"class" => "code"
				)
	);