Big Bach

© 2013 Contact

OCT 28-NOV 3

Promo
  • Ft. Lauderdale[+]
    // CMS Interface by Joe Workman function cms_register($page = null) { global $page_id; global $cms_elements; $content_page = $page !== null ? $page : $_SERVER["PHP_SELF"]; if ($page_id != null) { return; } if (!empty($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'])) { #GoDaddy Hackery $_SERVER['DOCUMENT_ROOT'] = $_SERVER['SUBDOMAIN_DOCUMENT_ROOT']; } $pages_path = "/cms-assets/xml/pages.xml"; if (file_exists($_SERVER["DOCUMENT_ROOT"].$pages_path)) { $xml = new DOMDocument; $xml->preserveWhiteSpace = false; if ($xml->load($_SERVER["DOCUMENT_ROOT"].$pages_path)) { $xpath = new DOMXPath($xml); $query = '//Pages/Page[@Path="'.$content_page.'"]'; $entries = $xpath->query($query); if ($entries->item(0) != null) { $page_id = $entries->item(0)->getAttribute("ID"); } } } $page_id_path = "/cms-assets/xml/pages/$page_id.xml"; if (file_exists($_SERVER["DOCUMENT_ROOT"].$page_id_path)) { $xml = new DOMDocument; $xml->preserveWhiteSpace = false; if ($xml->load($_SERVER["DOCUMENT_ROOT"].$page_id_path)) { $xpath = new DOMXPath($xml); $element_query = '//EditableAreas/EditableRegion'; $elements = $xpath->query($element_query); foreach ($elements as $element) { $element_id = $element->getAttribute("ElementID"); $html_query = '//EditableAreas/EditableRegion[@ElementID="'.$element_id.'"]/Html'; $html_entries = $xpath->query($html_query); $html = $html_entries->item(0)->textContent; $cms_elements[$element_id]['html'] = $html; $repeat_query = '//EditableAreas/EditableRegion[@ElementID="'.$element_id.'"]/IsPartOfRepeat'; $repeat_entries = $xpath->query($repeat_query); $repeat = $repeat_entries->item(0)->textContent; $cms_elements[$element_id]['repeat'] = $repeat; if ($repeat === 'true') { $region_query = '//EditableAreas/EditableRegion[@ElementID="'.$element_id.'"]/PreviousRepeatRegionClientID'; $region_entries = $xpath->query($region_query); $prev_region = $region_entries->item(0)->textContent; $cms_elements[$element_id]['prev_region'] = $prev_region; } } } } } function get_repeat($parent_element_id) { global $cms_elements; $html = $cms_elements[$parent_element_id]['html']; foreach(array_keys($cms_elements) as $element_id){ if ( $cms_elements[$element_id]['prev_region'] == $parent_element_id ) { $html .= get_repeat($element_id); } } return $html; } function get_html($element_id) { global $cms_elements; if ($cms_elements[$element_id]['repeat'] === 'true') { return get_repeat($element_id); } return ( isset($cms_elements[$element_id]['html']) ? $cms_elements[$element_id]['html'] : false ); } ?>