private CmsHttpContext cmsContext;
private Template originalTemplate;
private void Page_Load(object sender, System.EventArgs e)
{
cmsContext = CmsHttpContext.Current;
// Clear all error messages, if any.
lblErrorMessage.Text = String.Empty;
// Get an instance of the original template
string cmsObjectGuid = String.Empty;
if (Request.QueryString["CMSObjectGuid"] != null)
{
cmsObjectGuid = Request.QueryString["CMSObjectGuid"];
originalTemplate = cmsContext.Searches.GetByGuid(cmsObjectGuid)
as Template;
if (originalTemplate != null)
{
// Display the template's path
litOriginalTemplate.Text = originalTemplate.Path;
if (originalTemplate.CanMove)
{
btnMove.Enabled = true;
}
else
{
// we can't move this template.
lblErrorMessage.Text = "You do not have rights to "
+ "move this template.";
btnMove.Enabled = false;
}
}
else
{
// Uh-oh we can't get an instance of the template.
lblErrorMessage.Text = "Original Template not found!";
}
}
}