Exemplo n.º 1
0
/**
 * Return Page Field
 *
 * Retrieve the requested field from the given page. 
 * If the field is "content" it will call returnPageContent()
 *
 * @since 3.1
 * @param $page - slug of the page to retrieve content
 * @param $field - the Field to display
 * 
 */
function returnPageField($page, $field)
{
    $pagesArray = getPagesXmlValues();
    if ($field == "content") {
        $ret = returnPageContent($page);
    } else {
        if (array_key_exists($field, $pagesArray[(string) $page])) {
            $ret = strip_decode($pagesArray[(string) $page][(string) $field]);
        } else {
            $ret = returnPageContent($page, $field);
        }
    }
    return $ret;
}
/**
 * Get Page Content
 *
 * Retrieve and display the content of the requested page. 
 * As the Content is not cached the file is read in.
 *
 * @since 2.0
 * @param $page - slug of the page to retrieve content
 *
 */
function getPageContent($page, $field = 'content')
{
    echo returnPageContent($page, $field);
}
function sc_get_component($page)
{
    $content = returnPageContent(return_page_slug(), 'content', false, true);
    $content = strip_decode($content);
    if (!preg_match('#\\[sc_form(.*)\\]#', $content)) {
        getPageContent($page);
    }
}
/**
 * Get Page Field
 *
 * Retrieve and display the requested field from the given page. 
 * If the field is "content" it will call returnPageContent()
 *
 * @since 3.1
 * @param $page - slug of the page to retrieve content
 * @param $field - the Field to display
 * 
 */
function returnPageField($page, $field)
{
    global $pagesArray;
    if (!$pagesArray) {
        getPagesXmlValues();
    }
    if ($field == "content") {
        $ret = returnPageContent($page);
    } else {
        if (isset($pagesArray[(string) $page]) && array_key_exists($field, $pagesArray[(string) $page])) {
            $ret = strip_decode(@$pagesArray[(string) $page][(string) $field]);
        } else {
            $ret = returnPageContent($page, $field);
        }
    }
    return $ret;
}