P4A 3 commit digest

Hi to all and welcome to the P4A 3 commit digest of this week :-)

Let’s start saying that I worked a lot porting to PHP5 all P4A core objects and widgets (the only one left behind is the db_navigator, I’ll work on it soon) so now we finally have a full PHP5 code, I still need to work on strict validation but most of the work is done. Having a full PHP5 code raised some bugs, cause we sometimes used to access to private variables from outside an object and this is not possible anymore, so I’ve added a few methods and patched some code, now everything is a lot more clean. I also fixed some small graphical issues with P4A_Buttons within toolbars. I also worked a bit on making P4A work with oracle, we’re almost there :) Then I added a new and improved version of P4A_Base_Mask (which uses system messages instead of P4A_Messages) to the core and ported the products_catalogue application to it, doing that made me remove a lot of code, all now is clean and much more readable. I also put a definitive fix to the addslashes issue, we add some getSQLvalue() methods within P4A, now they use the “double single quote” instead of addslashes, this is the right SQL behaviour and anyway addslashes has been marked deprecated within PHP.

These were a few things I wanted to point out, now let’s take a look at the changelog:

– P4A::init() method was removed
– helpers, P4A_Box, P4A_Object, P4A_Button, P4A_Collection, P4A_Field, P4A_Array_Source, P4A_DB_Source, P4A_Widget, P4A_Mask, P4A, P4A_Frame, P4A_Fieldset, P4A_Label, P4A_Line, P4A_Link, P4A_Menu, P4A_Menu_Item and P4A_Canvas were php5ized
– P4A_Widget::composeStringClassStyle() was rewritten and renamed to composeStringClass()
– P4A_Toolbar default size is now 32
– P4A_Button now inherits height from toolbar (just done via CSS)
– P4A_Mask::setIcon() now supports a path to an image instead of the icon name
– P4A_Fieldset::setTitle() and getTitle() methods were removed cause deprecated, use setLabel() and getLabel() instead
– P4A::getPopupMask() and getPopupMaskName() methods were added
– P4A_Mask::getFocusedObjectId() method was added
– P4A_Link::setLabel() method was removed ’cause inherited from P4A_Widget
– P4A_Menu_Item::setAccessKey() and getAccessKey() methods were removed ’cause inherited from P4A_Widget
– P4A_Table::addToolbar() and newToolbar() methods were removed ’cause not implemented
– P4A_Table::addNavigationBar() method was removed
– P4A_Menu_Item::setIcon() now supports a path to an image instead of the icon name
P4A_Sheet was removed ’cause had too many performance issues and it should be rewritten
FCKEditor was updated to 2.5.1
– “oracle” was renamed to “oci” within P4A_DB to reflect PDO naming
P4A_DB_Source::setSchema() and getSchema() methods were added
– some minor bugfixes to P4A_DB_Source were applied in order to make oracle work
– P4A_Generate_Default_Label() global function now turns the original label lowercase before applying the default rules, this is due for databases which returns uppercase field names
a new version of P4A_Base_Mask was added to the core
– “products catalogue” sample app was ported to P4A_Base_Mask
– sample_en, sample_it and sample_i18n applications were removed
– some minor enhancements were made to products_catalogue sample
– P4A_Widget::intercept() and implementMethod() methods now automatically call the addAction() method when the event is recognized as a browser event
P4A_Data_Field::getSQLValue() and getSQLNewValue() now returns data quoted with “double single quote” instead using addslashes (which is deprecated and not working for oracle)
– P4A_Object::dropIntercept() method was removed
– P4A_Object::dropMethod() method was added
– P4A_Object::destroy() method now does not unset the variable from parent but sets it to null
– a bug with P4A_Object::destroy() was solved, it happened when destroying an object directly stored in the $p4a object

Now, my TODO is getting thinner and, if I’ll have time, we could have a sort of preview release in a few weeks, anyway:

– implement application level translations
– port products_catalogue to the new translation system
– change p4a_table_col image handling, we’ve to pass by index.php and not phpthumb.php
– implement p4a_table::addCheckboxCol
– p4a_table action col should also support html (for images)
– implement errors with exceptions
– redo the css
– check if p4a_validate can be ported to ZF, maybe drop p4a_validate, add a valitator to p4a_field, user could add a ZF validator object to the field
– php5ize db_navigator

as you can see, some things are new features, some others are tasks for the sample applications… this means we’ve almost completed our work also if I know I got to check other few things within the P4A 3 core programming. Anyway see you next week with a new digest :-)

10 thoughts on “P4A 3 commit digest

  1. Fabrizio Balliano Post author

    I wrote P4A_Base_Mask, not application :-) anyway i think that base_application should remain outside the core at the moment and anyway we’ll have to port it to the new translation system (wich currently is finished for the core but not for applications…) need more time :-((

  2. Fabrizio Balliano Post author

    @BES: why do you use sheet? you should use frame instead which performs much better, sheet was removed now but was unsupported since long time and was too much resource consuming.

  3. BES

    I use sheet to include HTML. Been using it successfully for a long time. I missed the mention of its obsolescence in the forum. The is nothing in the P4A Reference about it being obsolete — that certainly would have been valuable, as I use the reference a lot.

  4. BES

    Ooop! This software uses the HTML tags! I use <br>, <b>, etc. in p4a_sheet to provide formatted instructions to users.

  5. Fabrizio Balliano Post author

    @BES: I edited your post to fix the html code :-) about all other things we know about all p4a’s problems but what p4a 3 need is to be the most tested and functional possible. sheets were not compatible with that design so we removed it. you can still use it copying it inside your application but it would not be a part of p4a3 becuase we want to solve once and for all the obsolescence of some components and some API. The major release change has been choosen also for that, and we’re sorry for the porting problems but we can’t be tied to 4 years old API if we want to be on the edge. :-)

  6. BES

    This is all I was doing with p4a_sheet – just using it as a way to drop in text (which could include HTML tags).

    After setting the mask title …

    $this->intro =& $this->build(“p4a_sheet”,”intro”);
    $this->intro->setWidth($this->frameWidth);
    $this->intro->setStyleProperty(“float”,”center”);
    $this->intro->anchorText(“blah blah blah about what this mask is for”);
    $this->main->anchor($this->intro);

    Nothing fancy, just the only way I could figure out how to get HTML content on the mask about a year and a half ago.

    I don’t really care about p4a_sheet, just need to figure out the easiest way to put HTML on the mask and change my codebase.

    Onward!!!

Leave a Reply

Your email address will not be published. Required fields are marked *