';
$t_object_mu .= '<%8$s class="%9$s %4$s---%9$s"%10$s>';
$t_object_mu .= '';
$t_object_mu .= '%1$s';
$t_object_mu .= '';
$t_object_mu .= '%8$s>';
$t_object_mu .= '';
// Text Markup Structure Template
// 1: Text Content
// 2: Text CSS
$t_text_mu = '';
$t_text_mu .= '';
$t_text_mu .= '%1$s';
$t_text_mu .= ' ';
//------------ Arrays
// Name
if ( ! empty( $r['name'] ) ) {
$r_name = substr( preg_replace( $pat_space, $rep_space, trim( $r['name'] ) ), $substr_start, $substr_end );
$clean_name = sanitize_title( $r_name );
// Processed
$p_name = $r_name;
$p_clean_name = $clean_name;
}
// Description
if ( ! empty( $r['description'] ) ) {
$r_description = substr( preg_replace( $pat_space, $rep_space, trim( $r['description'] ) ), $substr_start, $substr_end );
// Processed
$p_description = $r_description;
$o_structure_description = ' '. 'data-description="'. $p_description. '"';
}
// Purpose
if ( ! empty( $r['purpose'] ) ) {
$r_purpose = substr( preg_replace( $pat_space, $rep_space, trim( $r['purpose'] ) ), $substr_start, $substr_end );
// Processed
$p_purpose = $r_purpose;
$o_structure_purpose = ' '. 'data-purpose="'. $p_purpose. '"';
}
// CSS (one class name only)
if ( ! empty( $r['css'] ) ) {
$r_css = substr( sanitize_title( preg_replace( $pat_no_space, $rep_no_space, trim( $r['css'] ) ) ), $substr_start, $substr_end );
}
// Root CSS (single or multiple class names placed at the root)
if ( ! empty( $r['root_css'] ) ) {
$r_root_css = preg_replace( $pat_space, $rep_space, trim( $r['root_css'] ) );
$p_root_css = ' '.$r_root_css;
}
// ID Attribute
if ( ! empty( $r['id'] ) ) {
$r_id = substr( preg_replace( $pat_no_space, $rep_no_space, trim( $r['id'] ) ), $substr_start, $substr_end );
$p_id_attr = ' '.'id="'.$r_id.'"';
}
// Title Attribute
if ( ! empty( $r['title'] ) ) {
$r_title_attr = substr( preg_replace( $pat_space, $rep_space, trim( $r['title'] ) ), $substr_start, $substr_end );
$p_title_attr = ' '.'title="'.$r_title_attr.'"';
}
// Subtype
if ( ! empty( $r['structure']['subtype'] ) ) {
$r_subtype = substr( strtolower( preg_replace( $pat_space, $rep_space, trim( $r['structure']['subtype'] ) ) ), $substr_start, $substr_end );
}
// WordPress Generated Content (boolean)
if ( ! empty( $r['structure']['wpg'] ) ) {
$r_wpg = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['wpg'] ) ) ), $substr_start, $substr_end );
}
// Created Element (boolean)
if ( ! empty( $r['structure']['ce'] ) ) {
$r_ce = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['ce'] ) ) ), $substr_start, $substr_end );
}
// Heading Name
if ( ! empty( $r['structure']['h_name'] ) ) {
$r_h_name = substr( preg_replace( $pat_space, $rep_space, trim( $r['structure']['h_name'] ) ), $substr_start, $substr_end );
$p_name = $r_h_name;
}
// Header Structure (boolean)
if ( ! empty( $r['structure']['hr_structure'] ) ) {
$r_hr_structure = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['hr_structure'] ) ) ), $substr_start, $substr_end );
}
// Constructor Structure (boolean)
if ( ! empty( $r['structure']['cn_structure'] ) ) {
$r_cn_structure = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['cn_structure'] ) ) ), $substr_start, $substr_end );
}
// Version
if ( ! empty( $r['version'] ) ) {
$r_version = substr( preg_replace( $pat_space, $rep_space, trim( $r['version'] ) ), $substr_start, $substr_end );
}
// Echo (boolean)
if ( ! empty( $r['echo'] ) ) {
$r_echo = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['echo'] ) ) ), $substr_start, $substr_end );
}
// Structure (controlled vocabulary)
if ( ! empty( $r['structure']['type'] ) ) {
$r_structure = substr( strtolower( preg_replace( $pat_space, $rep_space, trim( $r['structure']['type'] ) ) ), $substr_start, $substr_end );
// ------------------------ Constructor Structure
if ( in_array( $r_structure, $structure_constructor_terms, true ) ) {
$structure_name = 'Constructor';
$structure_name_abbr = 'CN';
//------------------------ Subtypes
// Main Header Subtype
if ( in_array( $r_subtype, $subtype_main_header_terms, true ) ) {
$subtype_elem = 'header';
$p_custom_attr = ' '.'role="banner"';
}
// Main Header Subtype
elseif ( in_array( $r_subtype, $subtype_main_footer_terms, true ) ) {
$subtype_elem = 'footer';
$p_custom_attr = ' '.'role="contentinfo"';
}
// Aside Subtype
elseif ( in_array( $r_subtype, $subtype_aside_terms, true ) ) {
$subtype_name = 'Aside';
$subtype_name_abbr = 'aside';
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_name = ' '.$subtype_name;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
}
// ------------------------ Component Structure
elseif ( in_array( $r_structure, $structure_component_terms, true ) ) {
$structure_name = 'Component';
$structure_name_abbr = 'CP';
//------------------------ Subtypes
// Navigation Subtype
if ( in_array( $r_subtype, $subtype_nav_terms, true ) ) {
$subtype_name = 'Navigation';
$subtype_name_abbr = 'nav';
$p_custom_attr = ' '.'role="navigation"';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Fieldset Item Subtype
elseif ( in_array( $r_subtype, $subtype_fieldset_item_terms, true ) ) {
$subtype_name = 'Fieldset Item';
$subtype_name_abbr = 'fs-item';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Form Subtype
elseif ( in_array( $r_subtype, $subtype_form_terms, true ) ) {
$subtype_name = 'Form';
$subtype_name_abbr = 'form';
$subtype_elem = 'form';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Article Subtype
elseif ( in_array( $r_subtype, $subtype_article_terms, true ) ) {
$subtype_name = 'Article';
$subtype_name_abbr = 'article';
$subtype_elem = 'article';
$p_subtype_css = ' '.$subtype_name_abbr;
}
// Module Subtype
elseif ( in_array( $r_subtype, $subtype_module_terms, true ) ) {
$subtype_name = 'Module';
$subtype_name_abbr = 'md';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
}
// ------------------------ Object Structure
elseif ( in_array( $r_structure, $structure_object_terms, true ) ) {
$structure_name = 'Object';
$structure_name_abbr = 'OBJ';
// Layout
if ( ! empty( $r['structure']['layout'] ) ) {
$r_obj_layout = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['layout'] ) ) ), $substr_start, $substr_end );
if ( in_array( $r_obj_layout, $layout_inline_terms, true ) ) {
$layout_elem = 'span';
}
$subtype_elem = $layout_elem;
$obj_elem = $layout_elem;
$txt_layout_elem = $layout_elem;
}
// Linked
if ( ! empty( $r['structure']['linked'] ) ) {
$r_linked = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['linked'] ) ) ), $substr_start, $substr_end );
}
// Object ID Attribute
if ( ! empty( $r['structure']['id'] ) ) {
$r_obj_a_id = substr( preg_replace( $pat_space, $rep_space, trim( $r['structure']['id'] ) ), $substr_start, $substr_end );
$p_obj_a_id_attr = ' '.'id="'.$r_obj_a_id.'"';
}
// Object Element CSS
if ( ! empty( $r['structure']['root_css'] ) ) {
$r_obj_elem_root_css = $r['structure']['root_css'];
$p_obj_elem_root_css_val = '';
foreach ( ( array ) $r_obj_elem_root_css as $val ) {
$p_obj_elem_root_css_val .= ' '. trim( $val );
}
}
// Object Element Title Attribute
if ( ! empty( $r['structure']['title'] ) ) {
$r_obj_elem_root_title = preg_replace( $pat_space, $rep_space, trim( $r['structure']['title'] ) );
// Default
$p_obj_elem_root_title = ' '.'title="'.$r_obj_elem_root_title.'"';
}
//------------------------ Subtypes
// WordPress Generated Content Subtype
if ( in_array( $r_subtype, $subtype_wpg_terms, true ) ) {
$subtype_name = 'WordPress Generated Content';
$subtype_name_abbr = 'wpg';
$p_subtype_css = ' '.$subtype_name_abbr;
}
// Heading Subtype
elseif ( in_array( $r_subtype, $subtype_heading_terms, true ) ) {
$subtype_name = 'Heading';
$subtype_name_abbr = 'heading';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Time Subtype
elseif ( in_array( $r_subtype, $subtype_time_terms, true ) ) {
$subtype_name = 'Stamp';
$subtype_name_abbr = 'dtstamp';
$obj_elem = 'time';
$obj_elem_css = $obj_elem;
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Navigation Subtype
elseif ( in_array( $r_subtype, $subtype_navi_terms, true ) ) {
$subtype_name = 'Navigation Item';
$subtype_name_abbr = 'navi';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Action Item Subtype
elseif ( in_array( $r_subtype, $subtype_axn_terms, true ) ) {
$subtype_name = 'Action';
$subtype_name_abbr = 'axn';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Note Subtype
elseif ( in_array( $r_subtype, $subtype_note_terms, true ) ) {
$subtype_name = 'Note';
$subtype_name_abbr = 'note';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
$subtype_elem = $layout_elem;
$obj_elem = $layout_elem;
$txt_layout_elem = $layout_elem;
}
// Generic Label Subtype
elseif ( in_array( $r_subtype, $subtype_generic_label_terms, true ) ) {
$subtype_name = 'Generic Label';
$subtype_name_abbr = 'glabel';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Form Label Subtype
elseif ( in_array( $r_subtype, $subtype_form_label_terms, true ) ) {
$subtype_name = 'Form Label';
$subtype_name_abbr = 'flabel';
$obj_elem = 'label';
$obj_elem_css = $obj_elem;
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
$p_subtype_postfix_css = '-'.$subtype_name_abbr;
}
// Form Element Subtype
elseif ( in_array( $r_subtype, $subtype_form_element_terms, true ) ) {
$subtype_name = 'Form Element';
$subtype_name_abbr = 'felem';
$p_subtype_name = ' '.$subtype_name;
$p_subtype_css = ' '.$subtype_name_abbr;
}
// Generic Subtype
else {
$subtype_name = 'Generic';
$subtype_name_abbr = 'gen';
$p_subtype_name = ' '.$subtype_name;
}
}
}
// Structure Element (HTML element)
if ( ! empty( $r['structure']['elem'] ) ) {
$r_elem = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['elem'] ) ) ), $substr_start, $substr_end );
if ( in_array( $r_structure, $structure_constructor_terms, true ) || in_array( $r_structure, $structure_component_terms, true ) ) {
$subtype_elem = $r_elem;
}
elseif ( in_array( $r_structure, $structure_object_terms, true ) ) {
$obj_elem = $r_elem;
if ( in_array( $r_elem, $heading_level_terms, true ) ) {
$obj_elem_css = 'h';
}
}
}
// Object Element
if ( ! empty( $r['structure']['root_obj_elem'] ) ) {
$r_root_obj_elem = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['root_obj_elem'] ) ) ), $substr_start, $substr_end );
if ( in_array( $r_structure, $structure_object_terms, true ) ) {
$subtype_elem = $r_root_obj_elem;
}
if ( 'li' == $r_root_obj_elem ) {
$p_nature_css = ' '.'item';
}
}
// Heading Element
if ( ! empty( $r['structure']['h_elem'] ) ) {
$r_h_elem = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $r['structure']['h_elem'] ) ) ), $substr_start, $substr_end );
if ( in_array( $r_h_elem, $heading_level_terms, true ) ) {
$p_h_elem = $r_h_elem;
}
}
// Attributes of Element
if ( ! empty( $r['structure']['attr']['elem'] ) ) {
$r_attr_elem = $r['structure']['attr']['elem'];
$p_attr = '';
foreach ( ( array ) $r_attr_elem as $key => $val ) {
$clean_key = '';
$clean_val = '';
$clean_key = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $key ) ) ), $substr_start, $substr_end );
$clean_val = trim( $val );
$p_attr .= ' '.$clean_key.'="'.$clean_val.'"';
}
}
// Attributes of Anchor
if ( ! empty( $r['structure']['attr']['a'] ) ) {
$r_attr_a = $r['structure']['attr']['a'];
$p_obj_a_elem_attr = '';
foreach ( ( array ) $r_attr_a as $key => $val ) {
$clean_key = '';
$clean_val = '';
$clean_key = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $key ) ) ), $substr_start, $substr_end );
$clean_val = trim( $val );
$p_obj_a_elem_attr .= ' '.$clean_key.'="'.$clean_val.'"';
}
}
// Attributes of Element Label (h_l, g_l, a_l)
if ( ! empty( $r['structure']['attr']['elem_label'] ) ) {
$r_attr_elem_label = $r['structure']['attr']['elem_label'];
$p_elem_label_attr = '';
foreach ( ( array ) $r_attr_elem_label as $key => $val ) {
$clean_key = '';
$clean_val = '';
$clean_key = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $key ) ) ), $substr_start, $substr_end );
$clean_val = trim( $val );
$p_elem_label_attr .= ' '.$clean_key.'="'.$clean_val.'"';
}
}
// Root Element CSS
$p_root_elem_css = $subtype_elem;
if ( $subtype_elem == $subtype_name_abbr || 'div' == $subtype_elem || 'span' == $subtype_elem ) {
$p_root_elem_css = '';
$string_sep = '';
} else {
$string_sep = ' ';
}
// Structure CSS
$p_structure_css = $string_sep. strtolower( $structure_name_abbr );
// Structure Name
$p_structure_name_abbr = ' '.$structure_name_abbr;
// Name CSS
$p_name_css = ' '.$p_clean_name. $p_subtype_postfix_css;
// Root CSS
if ( ! empty( $r['css'] ) ) {
$p_css = ' ' .$r_css .$p_subtype_postfix_css;
}
// Branch CSS
if ( ! empty( $r['css'] ) ) {
$p_branch_name_css = ' '.$r_css. $p_subtype_postfix_css;
} else {
$p_branch_name_css = ' '.$p_clean_name. $p_subtype_postfix_css;
}
// All class names in root
// class="nav cp main-nav custom-css-nav custom-root-css"
$o_css = $p_root_elem_css. $p_nature_css. $p_structure_css. $p_subtype_css. $p_name_css. $p_css. $p_root_css;
// Displayed in data-name
$o_structure_name = $p_name. $p_subtype_name. $p_structure_name_abbr;
// Displayed in headings
$o_heading_name = $p_name. $p_subtype_name;
$o_h_elem = $p_h_elem;
$o_id_attr = $p_id_attr;
// Attributes
if ( in_array( $r_structure, $structure_object_terms, true ) ) {
$o_obj_attr = $p_attr;
}
else {
$o_attr = $p_attr. $p_custom_attr;
}
$o_branch_css = $p_branch_name_css;
// Processed
$p_root_elem = $subtype_elem;
// Output
$o_root_elem = $p_root_elem;
$o_title_attr = $p_title_attr;
$p_obj_elem = $obj_elem;
$p_obj_attr = $obj_attr;
$p_obj_label_elem = $obj_label_elem;
// Object Element CSS
$obj_elem_postfix_css = '---'.$obj_elem_css;
// Processed
// CSS
if ( ! empty( $r['css'] ) ) {
$p_obj_elem_combo_css = ' '.$r_css. $p_subtype_postfix_css. $obj_elem_postfix_css;
$p_obj_label_elem_css = ' '.$r_css. $p_subtype_postfix_css. $obj_elem_postfix_css.'_l';
$p_obj_label_l_elem_css = ' '.$r_css. $p_subtype_postfix_css. '---l';
} else {
$p_obj_elem_combo_css = ' '.$p_clean_name. $p_subtype_postfix_css. $obj_elem_postfix_css;
$p_obj_label_elem_css = ' '.$p_clean_name. $p_subtype_postfix_css. $obj_elem_postfix_css.'_l';
$p_obj_label_l_elem_css = ' '.$p_clean_name. $p_subtype_postfix_css. '---l';
}
$p_obj_elem_css = $obj_elem_css;
$p_obj_generic_label_elem_css = $obj_elem_css.'_l';
$p_obj_generic_label_l_elem_css = 'l';
// Output
$o_obj_elem = $p_obj_elem;
$o_elem_label_attr = $p_elem_label_attr;
$o_obj_label_elem = $p_obj_label_elem;
$o_obj_elem_css = $p_obj_elem_css. $p_obj_elem_combo_css;
$o_obj_label_elem_css = $p_obj_generic_label_elem_css. $p_obj_label_elem_css;
$o_obj_label_l_elem_css = $p_obj_generic_label_l_elem_css. $p_obj_label_l_elem_css;
// Anchor Element
$o_obj_a_elem_css = $p_branch_name_css;
$o_obj_a_elem_attr = $p_obj_a_elem_attr;
$o_obj_a_root_css = $p_obj_elem_root_css_val;
$o_obj_a_id_attr = $p_obj_a_id_attr;
$p_obj_elem_root_title = $p_obj_elem_root_title;
//------------------------ CONTENT ------------------------//
//------------------------ Header Content
if ( ! empty( $r['hr_content'] ) ) {
$r_hr_content = $r['hr_content'];
$hr_content_val = '';
foreach ( ( array ) $r_hr_content as $val ) {
$hr_content_val .= trim( $val );
}
// Output
$o_hr_content_val = $hr_content_val;
}
//------------------------ Footer Content
if ( ! empty( $r['fr_content'] ) ) {
$r_fr_content = $r['fr_content'];
$fr_content_val = '';
foreach ( ( array ) $r_fr_content as $val ) {
$fr_content_val .= trim( $val );
}
// Output
$o_fr_content_val = $fr_content_val;
}
//------------------------ Constructor Content
if ( in_array( $r_structure, $structure_constructor_terms, true ) ) {
if ( ! empty( $r['content']['constructor'] ) ) {
$r_content = $r['content']['constructor'];
$content_val = '';
foreach ( ( array ) $r_content as $val ) {
$content_val .= trim( $val );
}
}
}
//------------------------ Component Content
if ( in_array( $r_structure, $structure_component_terms, true ) ) {
if ( ! empty( $r['content']['component'] ) ) {
$r_content = $r['content']['component'];
$content_val = '';
foreach ( ( array ) $r_content as $val ) {
$content_val .= trim( $val );
}
}
}
//------------------------ Content Before
if ( ! empty( $r['content']['before'] ) ) {
$r_content_before = preg_replace( $pat_space, $rep_space, trim( $r['content']['before'] ) );
$o_content_before = $r_content_before;
}
//------------------------ Content After
if ( ! empty( $r['content']['after'] ) ) {
$r_content_after = preg_replace( $pat_space, $rep_space, trim( $r['content']['after'] ) );
$o_content_after = $r_content_after;
}
if ( ! empty( $r['content']['compound'] ) ) {
$r_content_compound = $r['content']['compound'];
$content_val = '';
$actions_content_val = '';
foreach ( ( array ) $r_content_compound as $val ) {
// Initialize
$p_content_compound_name = '';
$p_clean_content_compound_name = '';
$p_content_compound_branch_name_css = '';
$p_content_compound_css = '';
$p_content_compound_branch_css = '';
// Name
if ( ! empty( $val['name'] ) ) {
$r_content_compound_name = substr( preg_replace( $pat_space, $rep_space, trim( $val['name'] ) ), $substr_start, $substr_end );
$clean_content_compound_name = sanitize_title( $r_content_compound_name );
// Processed
$p_content_compound_name = $r_content_compound_name;
$p_clean_content_compound_name = ' '.$clean_content_compound_name;
$p_content_compound_branch_name_css = $p_clean_content_compound_name;
}
// CSS
if ( ! empty( $val['css'] ) ) {
$r_content_compound_css = $val['css'];
// Processed
$p_content_compound_css = ' '.$r_content_compound_css;
$p_content_compound_branch_css = $p_content_compound_css;
}
else {
// Processed
$p_content_compound_branch_css = $p_content_compound_branch_name_css;
}
// Definitions
$o_content_compound_css = $p_clean_content_compound_name. $p_content_compound_css;
$o_content_compound_branch_css = $p_content_compound_branch_css;
$o_content_compound_name = $p_content_compound_name;
// Output: Fieldset Item
$content_val .= '
';
$content_val .= '
';
$content_val .= '
';
}
}
//------------------------ Object Content
if ( ! empty( $r['content']['object'] ) ) {
$r_obj_content = $r['content']['object'];
$content_val = '';
foreach ( ( array ) $r_obj_content as $val ) {
$txt_auto_css = '';
$txt_css = '';
$r_content_obj_sep = '';
// Text Content
if ( ! empty( $val['txt'] ) )
{
$r_content_obj_txt = preg_replace( $pat_space, $rep_space, trim( $val['txt'] ) );
$clean_txt = substr( sanitize_title( $r_content_obj_txt ), $substr_start, $substr_end );
// If characters can't be converted
if ( '' == $clean_txt )
{
$txt_auto_css = '';
}
else
{
$txt_auto_css = ' '.$clean_txt.'---txt';
}
// CSS
if ( ! empty( $val['css'] ) )
{
$r_content_obj_css = preg_replace( $pat_space, $rep_space, trim( $val['css'] ) );
$txt_css = ' '.$r_content_obj_css.'---txt';
}
// Numeric Text
if ( is_numeric( $r_content_obj_txt[0] ) )
{
$txt_auto_css = ' '.'num'.' '.'n-'.$clean_txt.'---txt';
}
// Separator
if ( ! empty( $val['sep'] ) )
{
$r_content_obj_sep = preg_replace( $pat_space, $rep_space, $val['sep'] );
}
// Value
$content_val .= $r_content_obj_sep.'<'.$txt_layout_elem.' class="txt'.$txt_css. $txt_auto_css.'">'.$r_content_obj_txt.''.$txt_layout_elem.'>';
}
// Lines
elseif ( ! empty( $val['line'] ) )
{
$r_content_obj_line = $val['line'];
foreach ( (array) $r_content_obj_line as $line_val ) {
$line_css = '';
if ( ! empty( $line_val['css'] ) ) {
$r_line_css = preg_replace( $pat_space, $rep_space, trim( $line_val['css'] ) );
$line_css = ' '.$r_line_css;
}
$content_val .= '<'.$txt_layout_elem.' class="line'.$line_css.'">';
foreach ( (array) $line_val as $line_txt_val ) {
$txt_auto_css = '';
$txt_css = '';
$r_obj_line_sep = '';
// Text Content
if ( ! empty( $line_txt_val['txt'] ) ) {
$r_obj_line_txt = preg_replace( $pat_space, $rep_space, trim( $line_txt_val['txt'] ) );
$clean_line_txt = substr( sanitize_title( $r_obj_line_txt ), $substr_start, $substr_end );
// If characters can't be converted
if ( '' == $clean_line_txt ) {
$txt_auto_css = '';
} else {
$txt_auto_css = ' '.$clean_line_txt.'---txt';
}
// Numeric Text
if ( is_numeric( $r_obj_line_txt[0] ) ) {
$txt_auto_css = ' '.'num'.' '.'n-'.$clean_line_txt.'---txt';
}
// CSS
if ( ! empty( $line_txt_val['css'] ) ) {
$r_content_obj_line_css = preg_replace( $pat_space, $rep_space, trim( $line_txt_val['css'] ) );
$txt_css = ' '.$r_content_obj_line_css;
}
// Separator
if ( ! empty( $line_txt_val['sep'] ) ) {
$r_obj_line_sep = preg_replace( $pat_space, $rep_space, $line_txt_val['sep'] );
}
$a_smu = '';
$a_emu = '';
$p_line_txt_attr_a = '';
// Linked
if ( ! empty( $line_txt_val['linked'] ) ) {
$r_txt_linked = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $line_txt_val['linked'] ) ) ), $substr_start, $substr_end );
if ( $r_txt_linked ) {
// Attributes of Anchor
if ( ! empty( $line_txt_val['attr']['a'] ) ) {
$r_line_txt_attr_a = $line_txt_val['attr']['a'];
$p_line_txt_attr_a = '';
foreach ( ( array ) $r_line_txt_attr_a as $key => $val ) {
$clean_key = '';
$clean_val = '';
$clean_key = substr( strtolower( preg_replace( $pat_no_space, $rep_no_space, trim( $key ) ) ), $substr_start, $substr_end );
$clean_val = trim( $val );
$p_line_txt_attr_a .= ' '.$clean_key.'="'.$clean_val.'"';
}
}
$a_smu = '';
$a_smu .= '';
$a_emu = '';
$a_emu .= '';
}
}
$content_val .= $r_obj_line_sep.'<'.$txt_layout_elem.' class="txt'.$txt_auto_css.$txt_css.'">'.$a_smu. $r_obj_line_txt. $a_emu.''.$txt_layout_elem.'>';
}
}
$content_val .= ''.$txt_layout_elem.'>';
}
}
else
{
$content_val .= trim( $val );
}
}
}
// Content Output
$o_content_val = $content_val;
$o_actions_content_val = $actions_content_val;
//------------------------ Section: Markup Structure Templates
// Generic Container Structure Markup
$cr_smu = '';
$cr_smu .= '';
$cr_smu .= '
';
$cr_emu = '';
$cr_emu .= '
';
$cr_emu .= '
';
// Generic Container Structure Markup for Header Container
$hr_cr_smu = '';
$hr_cr_smu .= '';
$hr_cr_smu .= '
';
// Form Structure Markup
$subtype_form_fieldsets_cr_smu = '';
$subtype_form_fieldsets_cr_smu .= '
';
$subtype_form_fieldsets_cr_smu .= '
';
$subtype_form_fieldsets_cr_emu = '';
$subtype_form_fieldsets_cr_emu .= '
';
$subtype_form_fieldsets_cr_emu .= '
';
// Form Actions Structure Markup
$subtype_form_actions_cr_smu = '';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_smu .= 'Actions';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_smu .= '
';
$subtype_form_actions_cr_emu = '';
$subtype_form_actions_cr_emu .= '
';
$subtype_form_actions_cr_emu .= '
';
$subtype_form_actions_cr_emu .= '
';
$subtype_form_actions_cr_emu .= '
';
// Form Elements Structure Markup
$subtype_form_elements_cr_smu = '';
$subtype_form_elements_cr_smu .= $cr_smu;
$subtype_form_elements_cr_smu .= '
';
$subtype_form_elements_cr_smu .= '
';
$subtype_form_elements_cr_emu .= '
';
$subtype_form_elements_cr_emu .= $cr_emu;
// Anchor Markup
$a_smu = '';
$a_smu .= '
';
$a_smu .= '<'.$o_obj_label_elem.' class="a_l'.$o_obj_a_elem_css.'---a_l"'. $o_elem_label_attr. '>';
$a_smu .= '<'.$o_obj_label_elem.' class="l'.$o_obj_a_elem_css.'---l">';
$a_emu = '';
$a_emu .= ''.$o_obj_label_elem.'>';
$a_emu .= ''.$o_obj_label_elem.'>';
$a_emu .= '';
// Object Container Markup
$obj_cr_smu = '';
$obj_cr_smu .= '<'.$o_obj_elem.' class="'.$o_obj_elem_css.'" '.$o_obj_attr. $o_title_attr.'>';
if ( $r_linked ) {
$obj_cr_smu .= $a_smu;
$obj_cr_emu = '';
$obj_cr_emu = $a_emu;
}
else {
$obj_cr_smu .= '<'.$o_obj_label_elem.' class="'.$o_obj_label_elem_css.'"'. $o_elem_label_attr. '>';
$obj_cr_smu .= '<'.$o_obj_label_elem.' class="'.$o_obj_label_l_elem_css.'">';
$obj_cr_emu = '';
$obj_cr_emu .= ''.$o_obj_label_elem.'>';
$obj_cr_emu .= ''.$o_obj_label_elem.'>';
}
$obj_cr_emu .= ''.$o_obj_elem.'>';
//------------------------ Section: Markup Structure - Header, Content, Footer
//------------------------ Header Markup
$hr_mu = '';
$hr_mu .= sprintf( $hr_cr_smu,
'hr'
);
if ( ! in_array( $r_subtype, $subtype_article_terms, true ) ) {
$hr_mu .= '<'.$o_h_elem.' class="h'.$o_branch_css.'---h" aria-hidden="true">
'.$o_heading_name.''.$o_h_elem.'>';
}
$hr_mu .= $o_hr_content_val;
$hr_mu .= $cr_emu;
//------------------------ Footer Markup
$fr_mu = '';
$fr_mu .= sprintf( $cr_smu,
'fr'
);
$fr_mu .= $o_fr_content_val;
$fr_mu .= $cr_emu;
//------------------------ Constructor, Object Content Markup
if ( in_array( $r_structure, $structure_constructor_terms, true ) ) {
$mn_mu = '';
$mn_mu .= $o_content_val;
}
//------------------------ Component Content Markup
if ( in_array( $r_structure, $structure_component_terms, true ) || in_array( $r_subtype, $subtype_aside_terms, true ) ) {
if ( $r_cn_structure ) {
$mn_mu = '';
$mn_mu .= $o_content_val;
}
else {
$mn_mu = '';
$mn_mu .= sprintf( $cr_smu,
'mn'
);
$mn_mu .= $o_content_val;
$mn_mu .= $cr_emu;
}
}
//------------------------ Form Content Markup
if ( in_array( $r_subtype, $subtype_form_terms, true ) ) {
$mn_mu = '';
$mn_mu .= sprintf( $subtype_form_fieldsets_cr_smu,
'fieldsets'
);
$mn_mu .= $o_content_val;
$mn_mu .= $subtype_form_fieldsets_cr_emu;
$mn_mu .= sprintf( $subtype_form_actions_cr_smu,
'axns'
);
$mn_mu .= $o_actions_content_val;
$mn_mu .= $subtype_form_actions_cr_emu;
}
//------------------------ Object Content Markup
if ( in_array( $r_structure, $structure_object_terms, true ) ) {
$obj_mn_mu = '';
$obj_mn_mu .= $obj_cr_smu;
$obj_mn_mu .= $o_content_val;
$obj_mn_mu .= $obj_cr_emu;
// WordPress Generated Content
if ( in_array( $r_subtype, $subtype_wpg_terms, true ) || $r_ce || $r_wpg ) {
$obj_mn_mu = '';
$obj_mn_mu .= $o_content_val;
}
// Navigation Item or Action Item
elseif ( in_array( $r_subtype, $subtype_navi_terms, true ) || in_array( $r_subtype, $subtype_axn_terms, true ) ) {
if ( $r_wpg ) {
$obj_mn_mu = '';
$obj_mn_mu .= $o_content_val;
}
else {
$obj_mn_mu = '';
$obj_mn_mu .= $a_smu;
$obj_mn_mu .= $o_content_val;
$obj_mn_mu .= $a_emu;
}
}
}
//------------------------ Variable Wiper
// Constructor and Component
if ( ! empty( $r['content']['constructor'] ) || ! empty( $r['content']['component'] ) || ! empty( $r['content']['compound'] ) ) {
$mn_mu = $mn_mu;
} else {
$mn_mu = '';
}
// Object
if ( ! empty( $r['content']['object'] ) ) {
$obj_mn_mu = $obj_mn_mu;
} else {
$obj_mn_mu = '';
}
// Footer Content
if ( ! empty( $r['fr_content'] ) ) {
$fr_mu = $fr_mu;
} else {
$fr_mu = '';
}
//------------------------ Content Output
if ( in_array( $r_structure, $structure_constructor_terms, true ) || in_array( $r_subtype, $subtype_form_terms, true ) ) {
if ( $r_hr_structure ) {
$hr_mu = $hr_mu;
} else {
$hr_mu = '';
}
$o_content = $hr_mu. $mn_mu. $fr_mu;
}
if ( in_array( $r_structure, $structure_component_terms, true ) ) {
if ( $r_cn_structure ) {
$hr_mu = '';
$fr_mu = '';
}
$o_content = $hr_mu. $mn_mu. $fr_mu;
}
if ( in_array( $r_structure, $structure_object_terms, true ) ) {
$o_content = $obj_mn_mu;
}
if ( in_array( $r_subtype, $subtype_header_terms, true ) ) {
$o_content = $hr_mu;
}
//------------ New Version
if ( '0.1' == $r_version ) {
// Initialize
$output = '';
}
//------------ Original Version
else {
// Initialize
$output = '';
$output .= $o_content_before;
$output .= '<'.$o_root_elem. $o_id_attr.' class="'.$o_css.'"'.$o_attr.' data-name="'.$o_structure_name.'"'. $o_structure_description. $o_structure_purpose.'>';
//------------------------ Constructor, Component Structure
if ( in_array( $r_structure, $structure_constructor_terms, true ) || in_array( $r_structure, $structure_component_terms, true ) ) {
$output .= '
';
$output .= $o_content;
$output .= '
';
}
//------------------------ Object Structure
elseif ( in_array( $r_structure, $structure_object_terms, true ) )
{
$output .= $o_content;
}
$output .= ''.$o_root_elem.'>';
$output .= $o_content_after;
}
$html = apply_filters( 'applicator_htmlok', $output, $args );
if ( $r_echo ) {
echo $html;
}
else {
return $html;
}
}