[Chameleon] Language Functionality in 2.4

Pascoe,Tim [Burlington] Tim.Pascoe at ec.gc.ca
Thu Jul 13 16:03:34 EDT 2006


I'm attempting to implement the MLT option in Chameleon 2.4. I have an application which has been successfully migrated to 2.4 for a while, but now requires both French and English. I looked at the bilingual example in the Chameleon samples, and modified my .phtml file accordingly. However, now get the following error when trying to open a map.

PHP Fatal error: Call to a member function set() on a non-object in C:\Mapserver\chameleon\htdocs\widgets\KeyMap\KeyMap.widget.php on line 197

Are there further changes I need to make to the map template as well, or am I missing something else? Any pointer to documentation on this would be great. I looked through the Chameleon pages on Maptools, but it's pretty thin :-)

The phtml file is below

Thanks,


<?php
/*
 * this is a sample of a minimal application script required to
 * get a chameleon application running with a template and a
 * local map file.  Most applications should actually just
 * copy this file and modify the template and mapfile
 * parts and should not need to do a lot more here.
 */

$gszAppPath = dirname(__FILE__);

include( "/Mapserver/chameleon/htdocs/chameleon.php" );

$szMapFile = dirname(__FILE__)."/../map/cabinbase.map";

class CabinApp extends Chameleon
{
  function CabinApp()
  {
    parent::Chameleon();
    $this->moMapSession = new MapSession_RW;
    $this->moMapSession->setTempDir( getSessionSavePath());
  }
}

$oApp =  new CabinApp();
$oApp->mnMinimumMaturityLevel = MATURITY_ALPHA;
$oApp->registerSkin( 'skins/sample' );

/** Setting Variable for Return Page of Application
*/

if( isset( $_REQUEST['txtreturnpage'] ) )
     $oApp->setVar( 'HISTORYPAGE', $_REQUEST['txtreturnpage'] );
else {
     if( isset( $_REQUEST['historypage'] ) )
         $oApp->setVar( 'HISTORYPAGE', $_REQUEST['historypage'] );
     else
         $oApp->setVar( 'HISTORYPAGE', 'null' );
}

$oApp->CWCAddRegionalTemplate( 'en-CA', dirname(__FILE__).'/cabin_data_map_en.html', dirname(__FILE__).'/cabin_data_map_en.php' );
$oApp->CWCAddRegionalTemplate( 'fr-CA', dirname(__FILE__).'/cabin_data_map_fr.html', dirname(__FILE__).'/cabin_data_map_fr.php' );
$oApp->CWCInitialize( dirname(__FILE__).'/cabin_data_map_en.html', $szMapFile  );

$oApp->CWCExecute();
?>

Timothy Pascoe

Environment Canada / Environnement Canada
Canada Centre for Inland Waters / Centre Canadien des Eaux Intérieures
867 Lakeshore Road / 867, chemin Lakeshore
Burlington, Ontario / Burlington (Ontario)
L7R 4A6

Tel/Tél: (905) 336-6239
Fax/Téléc: (905) 336-4699
E-mail/C. élec: tim.pascoe at ec.gc.ca
Government of Canada/Gouvernement du Canada
This e-mail represents the opinions and views solely held by its author and in no manner may be considered as representing those of his/her employer.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060713/5cedf32a/attachment.html


More information about the Chameleon mailing list