--
I'm currently using CMSMS 1.8.2 and am planning my upgrade to 1.9.2. I notice from the release notes that $gCms will no longer be accessible. My site currently relies on $gCms in 4 ways, all from within (pretty complex) UDTs. For each, what is the correct replacement code to achieve the same end?
1) Getting a page URL from the page alias
I used to use...
Code: Select all
global $gCms;
$manager = &$gCms->GetHierarchyManager();
$page_url = $manager->sureGetNodeByAlias('page-alias')->GetContent()->GetUrl();
2) Testing whether the logged on user is a member of a particular group
I used to use...
Code: Select all
global $gCms;
$modFEU = $gCms->modules['FrontEndUsers']['object'];
$is_in_group1 = $modFEU->MemberOfGroup($modFEU->LoggedInId(),$modFEU->GetGroupID('group1'));
3) Retrieving smarty variables
I used to use...
Code: Select all
global $gCms;
$smarty = &$gCms->GetSmarty();
$our_ref = $smarty->get_template_vars('ccuser')->property('our_ref');
4) Screening FEU passwords against a default
Code: Select all
global $gCms;
$modFEU = $gCms->modules['FrontEndUsers']['object'];
$is_using_default_password = $modFEU->CheckPassword($modFEU->LoggedInName(), 'default_password');
Answers to any or all of the above would be much appreciated. (And if your solution works in 1.8.2, please mention it because it means I can change the offending code before doing the migration rather than trying to do it all at once.)
Many thanks,
Andrew