Using the user preferences system ?

Author Message

H-Works Agency

Thursday 17 June 2010 5:29:12 am

Hello,

How can we use the "/user/preferences/set/" system ?

Can we pass arrays with this system ? What are the related php functions in ezpublish api to retrieve a user preferences ?

Thank !

EZP is Great

Bruce Morrison

Thursday 17 June 2010 7:12:12 pm

Hi Martin

Have you seen these?

The following methods can be used to retrieve user preferences

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

André R.

Friday 18 June 2010 1:58:35 am

The value can not be an array, it must be a string, but you can of course use a string to represent an array as long as it is legal to put into an url.

Alternatively it also supports values by post, if you want to post value as json or some other format. But I suspect that was added in 4.3 together with 'set_and_exit' which is to be able to use it in ajax calls without regenerating a full page in the background.

Note: value & name has a limit of 100 chars each, I suspect this is because preferences are cached to session, and thus can't be of unlimited size.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

H-Works Agency

Friday 18 June 2010 4:35:30 am

Thanks for your answers, i got it now.

It seems that variables stored with this system are recorded in session too.

I didn't knew there were an API documentation website...will be very useful for me.

EZP is Great

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:16:50
Script start
Timing: Jan 18 2025 02:16:50
Module start 'layout'
Timing: Jan 18 2025 02:16:50
Module start 'content'
Timing: Jan 18 2025 02:16:52
Module end 'content'
Timing: Jan 18 2025 02:16:52
Script end

Main resources:

Total runtime1.4871 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.9219152.6250
Module start 'layout' 0.00630.0030 740.546939.4609
Module start 'content' 0.00931.4764 780.0078603.5781
Module end 'content' 1.48570.0014 1,383.585912.1563
Script end 1.4871  1,395.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2440160.0002
Check MTime0.00160.1069160.0001
Mysql Total
Database connection0.00100.065610.0010
Mysqli_queries1.425295.8347630.0226
Looping result0.00070.0438610.0000
Template Total1.450997.620.7254
Template load0.00240.159620.0012
Template processing1.448597.404020.7243
Template load and register function0.00010.007110.0001
states
state_id_array0.00130.084110.0013
state_identifier_array0.00130.088420.0007
Override
Cache load0.00190.1290350.0001
Sytem overhead
Fetch class attribute can translate value0.00070.047430.0002
Fetch class attribute name0.00120.079970.0002
XML
Image XML parsing0.00170.114930.0006
class_abstraction
Instantiating content class attribute0.00000.000880.0000
General
dbfile0.00120.0795300.0000
String conversion0.00000.000440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
4content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
2content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs