Get available translated content for object in PHP

Author Message

Lex 007

Wednesday 27 April 2005 12:50:38 am

Hi,

I'm trying to get available translations for an object in PHP.

I tried :

$translations = $object->translationList();
foreach ( $RCDtranslations as $translation )
        {
        echo $translation->attribute("locale_code");
        }

but this code gives me all available languages for the whole site, not the available translated content for the object.

Please help !

Thx,

Lex

Lex 007

Wednesday 27 April 2005 1:15:33 am

Made it :

$objVersion      = &$RCDobject->currentVersion();
    $RCDtranslations = $objVersion->attribute("language_list");
    foreach ( $RCDtranslations as $translation )
        {
        echo $translation->attribute("language_code");
        echo "\n";
        }

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 19 2025 05:08:14
Script start
Timing: Jan 19 2025 05:08:14
Module start 'layout'
Timing: Jan 19 2025 05:08:14
Module start 'content'
Timing: Jan 19 2025 05:08:15
Module end 'content'
Timing: Jan 19 2025 05:08:16
Script end

Main resources:

Total runtime1.1062 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.2891152.6406
Module start 'layout' 0.00540.0031 741.929739.4922
Module start 'content' 0.00851.0963 781.4219458.3203
Module end 'content' 1.10480.0014 1,239.74228.1250
Script end 1.1061  1,247.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2876160.0002
Check MTime0.00130.1204160.0001
Mysql Total
Database connection0.00060.058210.0006
Mysqli_queries1.058695.6972520.0204
Looping result0.00050.0410500.0000
Template Total1.071496.920.5357
Template load0.00210.185520.0010
Template processing1.069496.671120.5347
Template load and register function0.00020.014110.0002
states
state_id_array0.00110.096410.0011
state_identifier_array0.00300.269420.0015
Override
Cache load0.00170.1520160.0001
Sytem overhead
Fetch class attribute can translate value0.00050.043810.0005
Fetch class attribute name0.00180.165930.0006
XML
Image XML parsing0.00150.133610.0015
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00170.1550160.0001
String conversion0.00000.000740.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs