This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
MatritumCantat_Web/www/components/com_sef/sef_ext/com_registration.php
2012-09-18 20:02:43 +00:00

93 lines
3.4 KiB
PHP

<?php
/**
* sh404SEF support for com_registration component.
* Copyright Yannick Gaultier (shumisha) - 2007
* shumisha@gmail.com
* @version $Id: com_registration.php 229 2008-01-21 19:53:39Z silianacom-svn $
* {shSourceVersionTag: Version x - 2007-09-20}
*/
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
// ------------------ standard plugin initialize function - don't change ---------------------------
global $sh_LANG, $sefConfig;
$shLangName = '';
$shLangIso = '';
$title = array();
$shItemidString = '';
$dosef = shInitializePlugin( $lang, $shLangName, $shLangIso, $option);
if ($dosef == false) return;
// ------------------ standard plugin initialize function - don't change ---------------------------
// ------------------ load language file - adjust as needed ----------------------------------------
$shLangIso = shLoadPluginLanguage( 'com_registration', $shLangIso, '_COM_SEF_SH_LOST_PASSWORD');
// ------------------ load language file - adjust as needed ----------------------------------------
// do something about that Itemid thing
if (eregi('Itemid=[0-9]+', $string) === false) { // if no Itemid in non-sef URL
//global $Itemid;
if ($sefConfig->shInsertGlobalItemidIfNone && !empty($shCurrentItemid)) {
$string .= '&Itemid='.$shCurrentItemid; // append current Itemid
$Itemid = $shCurrentItemid;
shAddToGETVarsList('Itemid', $Itemid); // V 1.2.4.m
}
if ($sefConfig->shInsertTitleIfNoItemid)
$title[] = $sefConfig->shDefaultMenuItemName ?
$sefConfig->shDefaultMenuItemName : getMenuTitle($option, null, $shCurrentItemid, null, $shLangName );
$shItemidString = $sefConfig->shAlwaysInsertItemid ?
_COM_SEF_SH_ALWAYS_INSERT_ITEMID_PREFIX.$sefConfig->replacement.$shCurrentItemid
: '';
} else { // if Itemid in non-sef URL
$shItemidString = $sefConfig->shAlwaysInsertItemid ?
_COM_SEF_SH_ALWAYS_INSERT_ITEMID_PREFIX.$sefConfig->replacement.$Itemid
: '';
}
// optional first part of URL, to be set in language file
if (!empty($sh_LANG[$shLangIso]['_COM_SEF_SH_REGISTRATION']))
$title[] = $sh_LANG[$shLangIso]['_COM_SEF_SH_REGISTRATION'];
$task = isset($task) ? @$task : null;
switch ($task) {
case 'register':
$title[] = $sh_LANG[$shLangIso]['_COM_SEF_SH_REGISTER'];
break;
case 'lostPassword':
$title[] = $sh_LANG[$shLangIso]['_COM_SEF_SH_LOST_PASSWORD'];
break;
case 'activate':
$title[] = $sh_LANG[$shLangIso]['_COM_SEF_SH_ACTIVATE'];
break;
default:
$dosef = false;
break;
}
if (!empty($title))
if (!empty($sefConfig->suffix)) {
$title[count($title)-1] .= $sefConfig->suffix;
}
else {
$title[] = '/';
}
shRemoveFromGETVarsList('option');
if (!empty($Itemid))
shRemoveFromGETVarsList('Itemid');
shRemoveFromGETVarsList('lang');
if (!empty($task))
shRemoveFromGETVarsList('task');
// ------------------ standard plugin finalize function - don't change ---------------------------
if ($dosef){
$string = shFinalizePlugin( $string, $title, $shAppendString, $shItemidString,
(isset($limit) ? @$limit : null), (isset($limitstart) ? @$limitstart : null),
(isset($shLangName) ? @$shLangName : null));
}
// ------------------ standard plugin finalize function - don't change ---------------------------
?>