Esempio n. 1
0
<?php

$sectionFunction = array('description' => mobilize_template_chamada, 'socialnetworks' => mobilize_template_social, 'banners' => mobilize_template_banners, 'sticker' => mobilize_template_adesive, 'share' => mobilize_template_enviar, 'contribute' => mobilize_template_contribua, 'links' => mobilize_template_links);
get_header();
$smartView = new smartView(INC_MOBILIZE . '/views/template.php');
$layout = Mobilize::getPageLayout(get_the_ID());
$content = array();
if ($layout === false) {
    $content[] = mobilize_template_chamada();
    $content[] = mobilize_shortag();
} else {
    foreach ($layout as $item) {
        if (array_key_exists($item, $sectionFunction)) {
            $content[] = $sectionFunction[$item]();
        }
    }
}
$smartView->content = implode("\n", $content);
$smartView->locale = get_locale();
$smartView->display(true);
get_footer();
/**
 * [mobilize_template_social description]
 * @return [type] [description]
 */
function mobilize_template_social()
{
    if (Mobilize::isActive('redes')) {
        $options = Mobilize::getOption();
        $optionsRedesSociais = Mobilize::optionRedesSociais();
        $smartView = new smartView(INC_MOBILIZE . '/views/redes-sociais.php');
        $smartView->padding = isset($options['general']['espacamento_lateral']) ? $options['general']['espacamento_lateral'] : '';
        $smartView->socialTitle = __('Redes sociais', 'mobilize');
        $smartView->socialDescription = $options['redes']['description'];
        if (!is_null($optionsRedesSociais['redes_facebook_page']) && !empty($optionsRedesSociais['redes_facebook_page'])) {
            $smartView->socialFacebook = '<a class="mobilize-button mobilize-facebook" target="_blank" href="' . $optionsRedesSociais['redes_facebook_page'] . '">Facebook</a>';
        }
        if (!is_null($optionsRedesSociais['redes_twitter']) && !empty($optionsRedesSociais['redes_twitter'])) {
            $smartView->socialTwitter = '<a class="mobilize-button mobilize-twitter" target="_blank" href="' . $optionsRedesSociais['redes_twitter'] . '">Twitter</a>';
        }
        if (!is_null($optionsRedesSociais['redes_google']) && !empty($optionsRedesSociais['redes_google'])) {
            $smartView->socialGoogle = '<a class="mobilize-button mobilize-google" target="_blank" href="' . $optionsRedesSociais['redes_google'] . '">Google +</a>';
        }
        if (!is_null($optionsRedesSociais['redes_youtube']) && !empty($optionsRedesSociais['redes_youtube'])) {
            $smartView->socialYoutube = '<a class="mobilize-button mobilize-youtube" target="_blank" href="' . $optionsRedesSociais['redes_youtube'] . '">Youtube</a>';
        }
        return $smartView->display();
    }
}