[Chameleon] upgradeing

bartvde at xs4all.nl bartvde at xs4all.nl
Tue May 11 03:29:02 EDT 2004


Hi Paul,

1) get the CVS version of Chameleon
2) get the CVS version of php_utils and copy the src part into common

If you have existing widgets created by yourself, it takes a little bit of
upgrading. If you have existing templates, you will need to do some little
upgrading as well.

I have attached my rough notes of this process.

Best regards,
Bart

> Sorry,
>    I seem to have missed the instructions for upgradeing to 1.99,  is it
> enough to replace the chameleon directory with the cvs release and
> reconfigure?
> thx,
> Paul
> ----- Original Message -----
> From: "Paul Dymecki" <pdymecki at sympatico.ca>
> To: <spencer at dmsolutions.ca>
> Cc: <chameleon at lists.maptools.org>
> Sent: Monday, May 10, 2004 1:38 PM
> Subject: Re: [Chameleon] zoomin widget
>
>
>> Thanks,
>>     Also i wanted to get my navigation buttons(zoomin,zoomout,query) to
>> be
>> displayed with radio buttons,  and was wondering what the process for
>> that
>> is?
>> thx again,
>> Paul
>> ----- Original Message -----
>> From: "Paul Spencer" <pagameba at magma.ca>
>> To: "Paul Dymecki" <pdymecki at sympatico.ca>
>> Cc: <chameleon at lists.maptools.org>
>> Sent: Monday, May 10, 2004 10:58 AM
>> Subject: Re: [Chameleon] zoomin widget
>>
>>
>> > Paul,
>> >
>> > it should work in single click mode as is (i.e. if you click and
>> release
>> > it will zoom in by a zoom factor at the clicked location).  Zoom
>> factor
>> > is normally defaulted to 2, I think you can provide a different one in
>> > the widget, and you can also use a ZoomFactor widget to allow the user
>> > to specify a zoom factor (affects zoom in and out)
>> >
>> > If you want no fancy dhtml effects on the map at all, then you could
>> use
>> > the MapImageStatic widget
>> >
>> > Cheers,
>> >
>> > Paul
>> >
>> > Paul Dymecki wrote:
>> >
>> > > Hello,
>> > >    I was wondering if there is a way to make the zoomin widget, work
>> without
>> > > the bounding box?  ie just by clicking on a point..
>> > > thx,
>> > > Paul
>> > > ----- Original Message -----
>> > > From: "Paul Spencer" <pagameba at magma.ca>
>> > > To: <bartvde at xs4all.nl>
>> > > Cc: <chameleon at lists.maptools.org>
>> > > Sent: Monday, May 10, 2004 7:51 AM
>> > > Subject: Re: [Chameleon] waitimage and button width
>> > >
>> > >
>> > >
>> > >>Bart,
>> > >>
>> > >>bartvde at xs4all.nl wrote:
>> > >>
>> > >>
>> > >>>Hi Paul (cc list),
>> > >>>
>> > >>>-- 1 --
>> > >>>I found one difference between Chameleon 1.1 and 1.99 with regard
>> to
>> the
>> > >>>WaitImage.
>> > >>>
>> > >>>This is what I used to use:
>> > >>><waitimage language="nl-NL"
>> waitimage="/chameleon_images/spinner_nl.gif"
>> > >>>waitimagewidth="246" waitimageheight="50"/>
>> > >>>
>> > >>>chameleon_images was an alias to chameleon/htdocs/images
>> > >>>
>> > >>>Now I have to use:
>> > >>><waitimage language="nl-NL" waitimage="images/spinner_nl.gif"
>> > >>>waitimagewidth="246" waitimageheight="50"/>
>> > >>>
>> > >>>Probably the same kind of change as with the popup.css ...
>> > >>
>> > >>yes this is probably the same problem.
>> > >>
>> > >>
>> > >>>-- 2 --
>> > >>>I have one issue with the button width, but this is not specific
>> for
>> > >>>version 1.99 of Chameleon.
>> > >>>
>> > >>>When internationalizing a Chameleon application, some text
> s on the
>> > >
>> > > buttons
>> > >
>> > >>>become significantly larger than in the English version, which
>> means
> I
>> > >>>have to change the source code to provide a different width in the
>> > >>>MakeButton function.
>> > >>>
>> > >>>It would be great if something automagically could be arranged in
> which
>> > >>>buttons would estimate their width needed. But I know this will be
>> > >>>difficult if not impossible to implement because of font
>> differences
>> > >
>> > > etc.
>> > >
>> > >>>and it could mess up HTML layouts etc.
>> > >>>
>> > >>>But maybe something else could be invented so that this would not
>> > >
>> > > involve
>> > >
>> > >>>changing source code. This makes things difficult to maintain.
>> > >>>
>> > >>>Any thoughts?
>> > >>
>> > >>we talked about this already, we were thinking of having a mechanism
> for
>> > >>wildcarding the widget (and posssibly height) to allow the button to
>> > >>stretch.  The current thoughts are:
>> > >>
>> > >>width="*" - button is drawn just wide enough to accomodate the icon
> and
>> > >>text and padding
>> > >>
>> > >>width="100*" - the button is drawn at least 100 px wide but will be
>> > >>stretched to allow for longer text if required
>> > >>
>> > >>width="100" - the button is exactly 100 px regardless of text
>> > >>
>> > >>Same logic could probably be used for height
>> > >>
>> > >>I haven't investigated this yet.
>> > >>
>> > >>Cheers,
>> > >>
>> > >>Paul
>> > >>
>> > >>
>> > >>>Best regards,
>> > >>>Bart
>> > >>>_______________________________________________
>> > >>>Chameleon mailing list
>> > >>>Chameleon at lists.maptools.org
>> > >>>http://lists.maptools.org/mailman/listinfo/chameleon
>> > >>>
>> > >>
>> > >>--
>> > >>  -----------------------------------------------------------------
>> > >>|Paul Spencer                           pspencer at dmsolutions.ca   |
>> > >>|-----------------------------------------------------------------|
>> > >>|Applications & Software Development                              |
>> > >>|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
>> > >>  -----------------------------------------------------------------
>> > >>
>> > >>_______________________________________________
>> > >>Chameleon mailing list
>> > >>Chameleon at lists.maptools.org
>> > >>http://lists.maptools.org/mailman/listinfo/chameleon
>> > >
>> > >
>> > > _______________________________________________
>> > > Chameleon mailing list
>> > > Chameleon at lists.maptools.org
>> > > http://lists.maptools.org/mailman/listinfo/chameleon
>> > >
>> >
>> > --
>> >   -----------------------------------------------------------------
>> > |Paul Spencer                           pspencer at dmsolutions.ca   |
>> > |-----------------------------------------------------------------|
>> > |Applications & Software Development                              |
>> > |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
>> >   -----------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Chameleon mailing list
>> > Chameleon at lists.maptools.org
>> > http://lists.maptools.org/mailman/listinfo/chameleon
>>
>> _______________________________________________
>> Chameleon mailing list
>> Chameleon at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/chameleon
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
-------------- next part --------------
Upgrade Chameleon 1.1 to 1.99
-----------------------------

Existing widgets:
-----------------

SetOnClickEvent --> SetOnClick


include_once("Button.php"); instead of TextButton e.g.

var $moPopup;
$this->moButton = new CWCButton( $this );

The SetOnclick should already be called in the InitDefaults function, e.g.:
$this->moButton->SetOnClick("clickServiceSearch");

Add the following interface functions:

    function GetJavascriptInitFunctions()
    {
        return $this->moButton->GetJavascriptInitFunctions();
    }

    function GetJavascriptVariables()
    {
        return $this->moButton->GetJavascriptVariables();
    }

    function GetJavascriptOnLoadFunctions()
    {
        return $this->moButton->GetJavascriptOnLoadFunctions();
    }

    function GetJavascriptIncludeFunctions()
    {
        return $this->moButton->GetJavascriptIncludeFunctions();
    }
    
In the GetJavascriptFunctions function change the following:

$aReturn = array();

to

$aReturn = $this->moButton->GetJavascriptFunctions();

In the GetHTMLHiddenVariables function add in the first line:

$aReturn = $this->moButton->GetHTMLHiddenVariables();

Remove the SetOnClick from the DrawPublish function.

==========================================
In the popups associated with the widgets:

Include the following scripts:

<script language="JavaScript" src="<?php echo $_SESSION['gszCoreWebPath']; ?>/widgets/js/cwc_dhtml.js"></script>
<script language="JavaScript" src="<?php echo $_SESSION['gszCoreWebPath']; ?>/widgets/js/cwc_button.js"></script>

The syntax for MakeButton changed.

Old example:
<a href="javascript:startSearch()"><?php echo makeButton( "../images/icon_servers.png", trim($oMLT->get("13", "Locate Service")), trim($oMLT->get("14", "Locate Place")), getDefaultParams( array() ) ); ?></a>

New example:
<?php echo makeButton( 'startSearch', '', 'CatalogSearch', 'images/icon_servers.png', trim($oMLT->get("13", "Locate Service")), trim($oMLT->get("14", "Locate Place")), array( 'width' => 75 )); ?>

===========================================
In the HTML template:

<cwc2 type="SharedResource" name="TextButton">
    <textbuttonbackgroundimage value=""/>
    <imagewidth value="90"/>
    <imageheight value="24"/>
    <textbuttonpadding value="2"/>
    <textbuttonnudge value="0"/>
    <labelcolor value="111111"/>
    <labelfont value="../etc/Vera.ttf"/>
    <labelalign value="left"/>
    <labelfontsize value="8"/>
    <labelantialias value="true"/>
    <usetextbuttoncache value="true"/>
    <state value="normal">
        <textbuttoncolor value="d9d9d9"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_normal.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_normal.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_normal.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_normal.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_normal.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_normal.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_normal.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_normal.png"/>
    </state>
    <state value="hover">
        <textbuttoncolor value="d9d9d9"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_hover.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_hover.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_hover.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_hover.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_hover.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_hover.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_hover.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_hover.png"/>
    </state>
    <state value="selected">
        <textbuttoncolor value="f0f0f0"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_clicked.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_clicked.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_clicked.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_clicked.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_clicked.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_clicked.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_clicked.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_clicked.png"/>
    </state>
    <state value="disabled">
        <textbuttoncolor value="d9d9d9"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_disabled.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_disabled.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_disabled.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_disabled.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_disabled.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_disabled.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_disabled.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_disabled.png"/>
    </state>
</cwc2>

<cwc2 type="SharedResource" name="NavButton">
    <textbuttonbackgroundimage value=""/>
    <imagewidth value="24"/>
    <imageheight value="24"/>
    <textbuttonpadding value="2"/>
    <textbuttonnudge value="0"/>
    <labelcolor value="111111"/>
    <labelfont value="../etc/Vera.ttf"/>
    <labelalign value="left"/>
    <labelfontsize value="8"/>
    <labelantialias value="true"/>
    <usetextbuttoncache value="true"/>
    <state value="normal">
        <textbuttoncolor value="d9d9d9"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_normal.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_normal.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_normal.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_normal.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_normal.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_normal.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_normal.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_normal.png"/>
    </state>
    <state value="hover">
        <textbuttoncolor value="d9d9d9"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_hover.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_hover.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_hover.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_hover.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_hover.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_hover.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_hover.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_hover.png"/>
    </state>
    <state value="selected">
        <textbuttoncolor value="f0f0f0"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_clicked.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_clicked.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_clicked.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_clicked.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_clicked.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_clicked.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_clicked.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_clicked.png"/>
    </state>
    <state value="disabled">
        <textbuttoncolor value="d9d9d9"/>
        <textbuttonborder_topleft_image value="skins/flat_grey/bd_tl_disabled.png"/>
        <textbuttonborder_top_image value="skins/flat_grey/bd_t_disabled.png"/>
        <textbuttonborder_topright_image value="skins/flat_grey/bd_tr_disabled.png"/>
        <textbuttonborder_right_image value="skins/flat_grey/bd_r_disabled.png"/>
        <textbuttonborder_bottomright_image value="skins/flat_grey/bd_br_disabled.png"/>
        <textbuttonborder_bottom_image value="skins/flat_grey/bd_b_disabled.png"/>
        <textbuttonborder_bottomleft_image value="skins/flat_grey/bd_bl_disabled.png"/>
        <textbuttonborder_left_image value="skins/flat_grey/bd_l_disabled.png"/>
    </state>
</cwc2>

Old widget style for button type widgets:

<cwc2 type="BoundingBoxPopup" visible="true" image="/chameleon_images/button_zoombounds_2.png" imagetip="Zoom naar coördinaat" imagewidth="24" imageheight="24" popupwidth="500" popupheight="450" toolbar="false" status="false" menubar="false"/>

New style:

<cwc2 type="BoundingBoxPopup" visible="true" styleresource="NavButton" image="skins/flat_grey/icon_zoombounds.png" imagetip="Zoom naar coördinaat" popupwidth="490" popupheight="450" toolbar="false" status="false" menubar="false">
	<image state="normal"/>
	<image state="selected"/>
	<image state="hover"/>
</cwc2>

================
Widget positions
================

include_once("Widget.php");

becomes:

include_once(dirname(__FILE__)."/../Widget.php");

--
$this->moPopup->mszLink = "widgets/ExtractWFSData.phtml";

becomes:
$this->moPopup->mszLink = $_SESSION['gszCoreWebPath'].
  "/widgets/ExtractWFSData/ExtractWFSData.phtml";


More information about the Chameleon mailing list