Need Help in social engine signup process - socialengine

HI please help me in the sign up process of social engine,
I need to add a country/state/city cascading dropdowns on my signup process.
I know how to do it in PHP ajax but finding the hard time to do it in this social engine framework.
Can any one help me in this!!
Thanks

You can use admin panel. You need menuitem Settings > Profile Questions. Then choose needed profiletype and add question with type 'selectbox'.
If you need cascading dropdown in wider meaning, you may use jxlib putting all code into application/modules/User/views/scripts/signup/form/fields.tpl

I have also solved this by using jquery.
You could get the id of the two field involved and then use jquery to add the options of the select field.

Related

Use Piranha CMS Manager editor in application for other users

I am trying to create some dynamic forms using Piranha CMS. As far as I managed to learn it is not supported right now, so I'm looking for work arounds or alternatives.
What I want to do now is use the editor from the manager for other users. To be more precise: this is how the editor looks like inside my manager when I want to edit a page
I have a text input and a select, both are Fields and there are many more fields to be used.
I want the sys admin to create a page with a list of inputs like this, which right now are usable only by the admin. BUT make this list of inputs available for edit to other users as well. Is it possible?
I'm not sure how to extract this editor or behavior or even if it is possible. The problem is we really need the admin to be able to configure different form inputs for users as it is the main core of our functionality.
Any help/advice is highly appreciated, thank you!
The components in the management UI is not designed to be reused in the front-end application in any way. The edit models in the manager contains a lot of extra meta data since the UI is completely generic. If you want to build an edit UI in your front end application, and you're using MVC or Razor Pages, the simplest way is to.
Get the generic model instead of your strongly typed model, for example api.Pages.GetById(...) instead of api.Pages.GetById<T>(...).
Loop the available fields in your selected region (a region is an ExpandObject which can be casted to an IDictionary<string, object>).
Use the built in support in Razor by calling #Html.EditorFor(...) for the fields.
Using this approach you can easily create your own EditorTemplates for the different types of fields you use that will match the rendering in your client application.
Best regards
HÃ¥kan

Change Theme based on user roles Liferay

I want such a mechanism that will provide different themes depends on different user roles in Liferay.Is there a way that provide me a solution that i can change theme on User roles.
Secondly i want to know that is this is possible programatically or Liferay provides custom supports with this.
any help will be greatly appreciated.
Bad choice
The right way is not to change the theme but to inject something in the page to alter the style.
It's a bad idea to change the theme at runtime depending on the user session. Poor performance due to the invalidated cache every request.
Build a custom portlet and inject it into the theme for every page. Depending on user logic that portlet can inject some javascript to alter css class of html tag.
Is it clear?
Theme is associated with layout (i.e. page). This can be observed in Layout table of liferay. So, even it can be changed using API, but not something that is different at user level, but its associated at page level.
For your requirement, If you have some fixed number of themes, then having different Sites each having one particular theme been applied.
Using Post login hook, you can check for user role and redirect to appropriate site.
Having this approach you can have completely different layout and pages as well depending on user role if you wish you.
We can also use velocity variables such $is_male, $is_female, $time_zone, $language.. to identify user group and can load different CSS file or a parent class in body tag.
Answer might be not useful for Mark who has raised this but future reader might find this useful.
Thanks

How to impliment search in openerp web framework

I created a module which displays filenames,size,time created etc of files in a directory . I showed this in table using openerp web framework. now i want search and group by options for this data. How can i achive this? I am not saving any data in db. Any one please help!!
Well Anuradha,
I see that you have done the thing purely using the web (qWeb) so you will be needing separate widget to enable the search facility over your view, similler example can be found on chatter wall i.e. messaging menu.
Thank You

Is there an existing concept for handling permission in a vaadin JPAContainer?

I have a vaadin application using JPAContainer an want to implement some sort of access control. The container should filter all entities that the user is not allowed to read and restricts modification to those users explicitly allowed.
My question is now if there is an existing solution to help implementing this. I searched for it and didn't find anything. Not even a discussion or description of a concept. So i assume the answer is "No" and I'm basically asking to provide a better search result for the next one looking for this.
Nevertheless would I be happy if someone points me to something that helps me implementing this properly.
Thanks
Raffael
There is no such a thing in jpacontainer nor in vaadin.
Vaadin applications are secure and safe if say, the "Edit" or "delete" button is not visible, there is no way to hack it. Or you can have the button disabled only, but do not attach a click listener to it if the user has no permission to do it.

Rails 3: Support form that auto Find Users OS and Browser info

I'm building a support form for my application. I'd like the user to include their Operating System and Browser they are using, catch is the general users either don't care to look this stuff up or don't know how. I'd like to add a text-input that automatically grabs this information for the user and displays it in the text field. Not sure how to go about doing this as I'm new to rails. I'm assuming I'd have to tie this in with javascript or a model that is attached to the form.
Any ideas would be appreciated.
you can read it on the server side so there is no need to bother the users.
request.env['HTTP_USER_AGENT'] should do the trick. You can also read some more information like the accept language or accept encoding. Just look at the keys like this: request.env.keys and check what could be of use to you.