Example #1
0
 private static function getFancyLanguageUrl($slug, $parent, $lang = null, $type = 'full')
 {
     global $SITEURL, $PERMALINK, $PERMALINK_ORIG, $language;
     if (!isset($PERMALINK_ORIG)) {
         $PERMALINK_ORIG = $PERMALINK;
     }
     if ($type == 'full') {
         $full = $SITEURL;
     } else {
         $full = '/';
     }
     if (!$lang) {
         $lang = @$_GET[I18N_LANGUAGE_PARAM] ? $_GET[I18N_LANGUAGE_PARAM] : $language;
     }
     $plink = $PERMALINK_ORIG;
     if ($lang && $lang != self::getDefaultLanguage()) {
         $plink = str_replace('%nondefaultlanguage%', $lang, $plink);
     } else {
         $plink = str_replace('%nondefaultlanguage%/', '', $plink);
         $plink = str_replace('%nondefaultlanguage%', '', $plink);
     }
     $plink = str_replace('%language%', $lang, $plink);
     $parent = (string) $parent;
     if ($parent && (string) $slug && $slug != 'index') {
         // no parent for index page
         $plink = str_replace('%parent%', $parent, $plink);
         if (strpos($plink, '%parents%') !== false) {
             $parents = $parent;
             if (function_exists('return_i18n_pages')) {
                 $pages = return_i18n_pages();
                 while ($parent = @$pages[$parent]['parent']) {
                     $parents = $parent . '/' . $parents;
                 }
             } elseif (function_exists('getPageField')) {
                 while ($parent = getPageField($parent, 'parent')) {
                     $parents = $parent . '/' . $parents;
                 }
             }
             $plink = str_replace('%parents%', $parents, $plink);
         }
     } else {
         $plink = str_replace('%parent%/', '', $plink);
         $plink = str_replace('%parent%', '', $plink);
         $plink = str_replace('%parents%/', '', $plink);
         $plink = str_replace('%parents%', '', $plink);
     }
     if ((string) $slug && $slug != 'index') {
         $plink = str_replace('%slug%', $slug, $plink);
     } else {
         $plink = preg_replace('/%slug%\\.[a-zA-Z]+/', '', $plink);
         // support for file extensions
         $plink = str_replace('%slug%/', '', $plink);
         $plink = str_replace('%slug%', '', $plink);
     }
     return (string) $full . $plink;
 }
/**
 * alias for getPageField()
 */
function echoPageField($page, $field)
{
    getPageField($page, $field);
}
Example #3
0
?>
</h3>
                    <p><?php 
getPageContent('presentation-legende-personnelle');
?>
</p>
                </article>
                <article>
                <h3><?php 
getPageField('presentation-coaching-relationnel', 'title');
?>
</h3>
                    <p><?php 
getPageContent('presentation-coaching-relationnel');
?>
</p>
                </article>
                <article>
                <h3><?php 
getPageField('presentation-bilan-competence', 'title');
?>
</h3>
                    <p><?php 
getPageContent('presentation-bilan-competence');
?>
</p>
                </article> 
                </div>
        <!--</section>-->
        </div><!-- .content -->
    </div><!--.main -->