コード例 #1
0
ファイル: index.php プロジェクト: rayangc/platform
    }
    // with a real user but no template we redirect to the admin
    if ($template) {
        $element_embeds = false;
        // i know we don't technically need this, but the immaculate variable in preg_match_all freaks me out
        $found_elements = preg_match_all('/{{{element_(.*?)}}}/', $template, $element_embeds, PREG_PATTERN_ORDER);
        if ($found_elements) {
            foreach ($element_embeds[1] as $element_id) {
                ob_start();
                CASHSystem::embedElement($element_id);
                $page_vars['element_' . $element_id] = ob_get_contents();
                ob_end_clean();
            }
        }
        // render out the page itself
        echo CASHSystem::renderMustache($template, $page_vars);
        exit;
    } else {
        // redirect to the admin
        header('Location: ./admin/');
    }
}
/***************************************
 *
 *  ADD PUBLIC PAGE BELOW CLOSING "?>"
 *
 ***************************************/
?>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->