SetClientIp(GetClientIp()); $cred->SetClientAgent(GetClientAgent()); //Connect to the site $site = new MgSiteConnection(); $site->Open($cred); //Get the MgWebLayout object $resourceSrvc = $site->CreateService(MgServiceType::ResourceService); $webLayoutResId = new MgResourceIdentifier($webLayoutId); $webLayout = new MgWebLayout($resourceSrvc, $webLayoutResId); $taskPane = $webLayout->GetTaskPane(); $taskPaneUrl = $taskPane->GetInitialTaskUrl(); $vpath = GetSurroundVirtualPath(); if ($taskPaneUrl == null || strlen($taskPaneUrl) == 0) { $taskPaneUrl = "gettingstarted.php"; } $templ = file_get_contents("../viewerfiles/taskframe.templ"); print sprintf($templ, $vpath . "tasklist.php", $locale, $taskPaneUrl, $sessionId, urlencode($webLayoutId), $dwf, $locale); } catch(MgException $e) { OnError(GetLocalizedString( "TASKS", $locale ), $e->GetDetails()); return; } catch(Exception $ne) { OnError(GetLocalizedString( "TASKS", $locale ), $ne->getMessage()); return; } function GetParameters($params) { global $taskPane, $sessionId, $webLayoutId, $dwf, $locale; $sessionId = ValidateSessionId(GetParameter($params, 'SESSION')); $locale = ValidateLocaleString(GetParameter($params, 'LOCALE')); $webLayoutId = ValidateResourceId(GetParameter($params, 'WEBLAYOUT')); $dwf = GetIntParameter($params, 'DWF'); } function GetRequestParameters() { if($_SERVER['REQUEST_METHOD'] == "POST") GetParameters($_POST); else GetParameters($_GET); } function OnError($title, $msg) { global $target; $templ = Localize(file_get_contents("../viewerfiles/errorpage.templ"), $locale, GetClientOS()); print sprintf($templ, "0", $title, $msg); } ?>