Thursday, November 20, 2008 ..:: Forums ::.. Register  Login
 Forums Minimize
SearchForum Home
     
  Mainstream Forums  Bugs  Creating & Edit...
 Creating & Editing Users Theme
 
spacecowboy
176 posts
5th
Joined
11/21/2007

Creating & Editing Users Theme
Posted: 04 Dec 07 9:30 AM Modified By spacecowboy  on 12/4/2007 9:32:39 AM)
On the Users/edit page an option appears to select a theme. When you save the page it doesn't appear in the "User Settings" section on the view page - also doesn't update the database because all users appear to default to the default theme as set in the "System Settings" page.

This is only really a problem if you have users who log in with different themes - for example you may have a standard theme and a mobile theme for mobile users - I suspect that it has probably just been overlooked as the themes haven't been fully implemented in 1.4

Would add that it does retain individual user's language preferences so I may be able to fix this - will report back
spacecowboy
176 posts
5th
Joined
11/21/2007

Re: Creating & Editing Users Theme
Posted: 04 Dec 07 10:48 AM

Ok sorted:

in Users/DetailView.ascx add above the row that has LBL_LANGUAGE (around line 100):

<tr>
   
<td class="tabDetailViewDL"><%= L10n.Term("Users.LBL_THEME") %>&nbsp;</td>
   
<td class="tabDetailViewDF"><asp:Label ID="txtTHEME" Runat="server" /></td>
   
<td class="tabDetailViewDF"><%= L10n.Term("Users.LBL_THEME_TEXT") %>&nbsp;</td>
</tr>

in Users/EditView.acsx around line 98 add:

AutoPostBack="true"

to the Theme dropdown

Now the tricky bit... in Users/DetailView.ascx.cs add the following just under //User Settings at around line 250:

// hacked by SP by copying the Language one and changing the fields

txtTHEME.Text = L10N.NormalizeCulture(XmlUtil.SelectSingleNode(xml, "theme"));

try

{

DataView vwThemes = new DataView(SplendidCache.Themes());

vwThemes.RowFilter = "NAME = '" + txtTHEME.Text + "'";

if (vwThemes.Count > 0)

txtLANGUAGE.Text = Sql.ToString(vwThemes[0]["THEME_NAME"]);

}

catch (Exception ex)

{

SplendidError.SystemWarning(new StackTrace(true).GetFrame(0), ex.Message);

}

// end of hack

and finally add

protected Label txtTHEME;

at about line 55.

Works for me, but comes with no warranty of any kind!


 

spacecowboy
176 posts
5th
Joined
11/21/2007

Re: Creating & Editing Users Theme
Posted: 04 Dec 07 10:55 AM
Pants.

It works insofar as it saves the preference in the DB - but when you log in it doesn't retain it, just defaults to the default which was the original problem...

Well at least that's half the battle anyway. Must be something to do with when the user logs in it doesn't grab the preference for theme like it does for language... hmm maybe thats the place to look...
  Mainstream Forums  Bugs  Creating & Edit...

Forum Home  Search       

Copyright (c) 2006-2008 SplendidCRM Software, Inc. All Rights Reserved.   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2008 by Perpetual Motion Interactive Systems Inc.
SplendidCRM and SplendidCRM Software are trademarks of SplendidCRM Software, Inc. SugarCRM is a trademark of SugarCRM Inc. in the United States, the European Union and other countries. All other trademarks used in this web site are the property of their respective owners.