New logo and new page for P4A
Feb 22, 2008 -
3 Comments
Click on the new logo to view the new splash page and access the old website.
Filed in: CreaLabs, P4A, PHP, Things I do
Feb 22, 2008 -
3 Comments
Click on the new logo to view the new splash page and access the old website.
Filed in: CreaLabs, P4A, PHP, Things I do
Feb 21, 2008 -
25 Comments
This week I’ve been damn busy, we got so many feedback after the first P4A 3 preview release that I fixed some things and worked on some others.
Three important issues:
I think we all need a new preview to work on the most updated software, here you have the changelog:
- a bug with “preview” button within P4A_Field file upload was solved
- a bug with file download was fixed
- P4A::inAjaxCall() method was rewritten
- P4A_Redirect_To_File() global function was added
- a bug with images preview on ie/opera was solved
- README was updated
- P4A_Output_File() global function was added, it has to be used when you want to creare a file at run-time and make users download it
- Chainability support was added for P4A_Simple_Toolbar, P4A_Navigation_Toolbar, P4A_Full_Toolbar and P4A_Actions_Toolbar
- P4A_Tab_Pane padding was changed a bit
- P4A_Sheet was re-created
Now you can Download P4A 2.99.1, please help us with translations and report us all the bugs you find! Thank you so much!
Filed in: CreaLabs, P4A, PHP, Things I do
Feb 18, 2008 -
22 Comments
It’s been a hard developing week, I had to do a close some big tasks before the preview release, there are 4 most important points since the last commit digest:
Here you have the changelog for this digest:
- P4A_DB_Source::load() method now autodetect schema name
- P4A_DB::nextSequenceId now automatically creates sequences on oracle too
- jQuery color picker was removed
- getId3 was dropped, we went back to getimagesize() PHP function to extract images information but we can’t retrieve video files information anymore
- phpThumb was removed
- P4A_Thumbnail_Generator was added
- P4A_DB::nextSequenceId now automatically creates sequences on postgreSQL too
- P4A_DB_Source compose count query was changed a bit to support PostgreSQL syntax
- P4A_Field does not preview images if GD are not installed
- P4A_Login_Mask was added, it should be used if your application needs a login system, it does not display the “download application source” link in the footer zone
- products_catalogue sample now uses the P4A_Login_Mask to show how to use this new feature
- P4A_Object::implementMethod() method was renamed to implement()
- P4A::getBrowserOS() method was added
- default and popup templates now add to #p4a_body a new CSS class containing the browser platform (windows, linux etc…)
- P4A_Error was removed because outdated, it will be replaced by exception objects
- README was updated
- P4A_Tab_Pane::getActivePageName() method was refactored, if empty returns the first page name
- P4A_Tab_Pane::getAsString() method now calls getActivePageName() to avoid the possibility to render a tab pane without any active page
- P4A_Mask_Preview was renamed to P4A_Preview_Mask
- P4A_Mask_Error was renamed to P4A_Error_Mask
- P4A_Canvas now is rendered inside a container div to have id/class/properties/actions
- all P4A objects now support chainability
- P4A_Image::setSource() and getSource() methods were removed
- P4A_Mask::addTempCss(), dropTempCss(), clearTempCss(), addJavascript(), dropJavascript(), addTempJavascript(), dropTempJavascript(), clearTempJavascript(), addCSS(), dropCSS() were removed
- default and popup mask templates were broken in 3 files, now header and footer and manager by P4A and templates have only the body part
- P4A::getPopupMaskName() and getPopupMask() methods were removed
- P4A_Mask::getP4AJavascript() method was moved to P4A::getJavascriptInitializations()
- ajax manager was completely reworked and now, if you have ajax enabled, you won’t see no refreshes at all, every action will be managed by ajax call with automatic redesign
and now… right on time… do you want to try it? here you go:
DOWNLOAD P4A 3 PREVIEW
It’s been an hard work, something like 500 commits and most of the code rewritten, now we need your help, please:
Filed in: CreaLabs, P4A, PHP, Things I do
Feb 14, 2008 -
10 Comments
We kept this feature secret ’till now… let’s unveil the power of P4A 3 chainability:

This feature is already available for every P4A 3 component. It is inspired by the jQuery chainability and for the first time (AFAIK) comes to a PHP framework. I’m sure it will revolution the way everyone of us writes code, producing cleaner and much more readable code.
What did you say? Do you want a P4A 3 preview release? humm let me think… can you wait ’till monday? :-)
UPDATE: before writing this post I haven’t checked everyone of the 100,000 PHP frameworks out there thus I’m not sure P4A is the real first, the title is just a nice claim for a nice feature, nothing more. :)
Filed in: CreaLabs, P4A, PHP, Things I do
Feb 11, 2008 -
7 Comments
The most of the work of this week was focused on the license switch (from GPL2 to AGPL3), that forced me to a mass commit today changing the header of all P4A files. Actually I was hoping to receive more feedback on the new license model post but anyway we feel that AGPL3 is the right choice for P4A.
Due to the new license we added a link in the footer zone:
you’ve to set the target of the link using a new constant (P4A_APPLICATION_SOURCE_DOWNLOAD_URL).
The other big part of the work was rebuilding all the CSS from scratch, I changed all the class names and id to be more consistent and we’ve a new class added to the template’s body which identifies the browser thus to little tricks is now much more friendly. A great work was done on jQuery plugins too, removing some old ones and adding new and lighter ones.
I think that next week could be a nice goal to release the first 3.0 alpha, be sure to check it out!
Here you’ve the raw changelog:
- P4A_Field::setError() methods now fires a redesign event for the field
- jQuery::UI::datepicker was updated to 3.3
- jQuery::interface was removed
- jQuery::jqModal was removed
- a simple javascript trick was implemented to avoid concurrent clicks on the interface
- jQuery::bgiframe plugin was added and implemented (only for ie6) for tooltips and system messages
- P4A is now released under AFFERO GPL 3
- P4A_Label::setType(), getType(), setValue() and getValue() methods were removed ’cause unused
- P4A_Widget::addCSSClass() and getCSSClasses() methods were added
- tooltip HTML/javascript was rewritten to be simpler
- P4A_Box::setHTML() and getHTML() methods were added
- P4A_Box::setValue() and getValue() methods were marked as deprecated
- all widgets now use the composeStringClass() method, which now use the getCSSClasses() method
- CSS hacks for internet explorer were removed cause not needed anymore
- jQuery was updated to 1.2.3
- P4A_Table has no more container div thus can be styled much more efficently
- P4A_Field::setDefaultVisualizationProperties() method was removed
- P4A_Field::getVisualizedDataType() method was added and called during getAsString(), used to generate the data_type CSS class
- masks and widgets templates were renamed to “.php”
- P4A::isAjaxEnabled() method was removed
- P4A::isGecko(), isOpera, isSafari() and getBrowser() methods were added
- masks templates now add a class to the body (p4a_browser_ie, p4a_browser_gecko, p4a_browser_opera, p4a_browser_safari, p4a_browser_handheld) depending on brower
- P4A_Navigation_Bar buttons names were changed to be a bit better
- handheld CSS/Javascript management was changed, now we outputs all CSS/Javascript plus a basic handheld CSS
- P4A_Table’s action cols CSS now handles images much better
- thumbnails cache was enabled (stored in P4A_UPLOADS_TMP_DIR with “cache_” prefix)
- P4A_APPLICATION_SOURCE_DOWNLOAD_URL constant was added, you’ve to set it for every project, it must point to somewhere users can download the source code of the application
- default template now has a “download source code” link in the footer
- if P4A_APPLICATION_SOURCE_DOWNLOAD_URL is not set, the “download source” link on the default template will take user to an error page showing the right to receive the source code
Filed in: CreaLabs, P4A, PHP, Things I do
Feb 6, 2008 -
11 Comments
Now P4A 2 is released under GPL 2, why? Because we think that when you use free software you have to give back something. GPL 2 was actually chosen because the developer using P4A would not have to publish the source code to the public audience, but only give the full source to his customer (and release it under GPL 2 too).
We all know that GPL 2 is not the right license for network based software, because it only talks about software distribution, something like “when you give the software to your customer, you’ve to give the source code too”. Here comes the problem, developers never give their software to the customer, but install it on a server, thus they actually don’t have to give the source code to the customer because they didn’t give him the binary code… This is a way to bypass the GPL license and do closed source software.
That’s why we need a new license, everyone should respect the same rules and the same ideals.
P4A 3 will be released under the AFFERO GPL 3
Why AFFERO GPL 3?
What about commercial software?
We know someone may not want to release his source code thus we’re thinking about releasing P4A 3 also under a commercial license. The commercial release would be sold for a small fee (see “pricing ideas”) that will be used to continue and improve the development of P4A itself.
Will the commercial release be different/better than the open source one?
Absolutely not! Both version will always be identical!
What would you buy?
Pricing idea:
100 Eur + VAT for every developer involved in the process of creating a commercial software based on P4A.
Example: if 2 analysts and 3 developers work together on a commercial software based on P4A, than you should buy 3 licenses.
Commercial license limitations
Note that this is not the real license, it’s just a draft idea, please let me have your feedback about that!
Filed in: CreaLabs, P4A, Things I do
Feb 4, 2008 -
0 Comments
This is one on the biggest commit ever done in the world :-) There are a lot of changes “under the hood”, please read the changelog because it’s really important for you to know what is changed.
I’m really in hurry thus this digest is not as beautiful as I would but…
One of the most important thing is the new field validation infrastructure, you can simply do a $field->addValidator(new P4A_Validate_GreaterThan(5)) and you’ll know that your field won’t be valid until its value won’t be greater than 5. We’ve a lot of validators ’cause we subclass every Zend_Validate class (we need to subclass because Zend_Validate doesn’t support translatable error messages). P4A_Mask::saveRow() now automatically validates every field highlights the errors on the mask.
Another important point is that I rewrote the popup management, now we don’t have 2 masks opened at the same time (this has a few engineering problems) and opening a popup will cause a complete redesign of the mask (solving some other jquery related bugs we had). Wait, popup management is not complete, we already have new ideas to bring the ajax experience to a new level but I need time to write code…
oh how I would need time…
Here’s the changelog:
- PEAR::Net_Useragent_Detect was updated to 2.4.0
- P4A_Object, P4A_Widget and P4A_Data_Source are now declared as abstract
- the “eval” call within P4A_Object::actionHandler() method was changed to a call_user_func_array which seems to be faster
- all “function &function_name” declarations were changed to “function function_name”, removing the & symbol
- many ‘&’ symbols were removed cause of the new PHP5 reference management
- P4A_Table and P4A_DB_Navigator were php5ized
- P4A_Table_Col::setFormatted() and unsetFormatted() methods were removed, use isFormatted(null/true/false) instead
- P4A_Table_Col::setFormat() and unsetFormat() methods were removed
- P4A_Table_Col now has the “onformat” event that can be triggered to do custom format operations (same as P4A_Field)
- P4A_DB_Source::getFieldName() method was removed
- P4A_Data_Field::getSchemaTableField() method was added, it will return “schema.table.field”
- P4A_Data_Field::setReadOnly() method was removed, use isReadOnly(null/true/false)
- P4A_Quote_SQL_Value() global function was added
- a bug with P4A_DB was fixed to allow sqlite to work the right way with sequences
- PEAR repository was removed
- PEAR::validate module was renamed to pear_validate.php and moved to p4a/libraries/ directory
- PEAR::Net_Useragent_Detect module was renamed to pear_net_useragent_detect.php and moved to p4a/libraries/ directory
- P4A_Mkdir_Recursive() global function was added to P4A standard library
- All System::mkdir calls were changed to use the new P4A_Mkdir_Recursive() function
- a bunch of unuseful referenced were removed from core helpers
- GetId3 library was updated to 2.0.0b4 (which is php5 only), helper apps for windows servers were removed, they’ve to be installed in the system path thus we cannot ship them with p4a package ’cause they would be unuseful
- P4A_Field::setType(’image’) now causes a fatal error, image is not a recognized type anymore, always use file, it will render images/video/audio preview if it’s possible
- P4A_DEFAULT_ERROR_REPORTING, P4A_EXTENDED_ERROR_REPORTING, P4A_MINIMAL_ERROR_REPORTING constants were added
- P4A now sets error_reporting to P4A_MINIMAL_ERROR_REPORTING before using getid3() and then restore the error_reporting to the previous value
- P4A_Validate and PEAR::Validate classes were removed
- P4A_Field::addValidator() method was added, you can pass it Zend_Validate_* obejects
- P4A_Field::isValid() method was added to check if the validators chain is respected or not
- P4A_Base_Mask::setRequiredField() method now relies on Zend_Validator_NotEmpty
- P4A_Base_Mask::checkRequiredFields() method was renamed to validateFields() and now checks all validators chains for all fields and not only required fields
- all javascripts were refactored
- javascript/css popup management was reworked
- P4A_Base_Mask::setRequiredField(), validateFields(), warning(), error() and info() methods were moved to P4A_Mask
- P4A_Validate_Alnum, P4A_Validate_Alpha, P4A_Validate_Between, P4A_Validate_Ccnum, P4A_Validate_Date, P4A_Validate_Digits, P4A_Validate_EmailAddress, P4A_Validate_Float, P4A_Validate_GreaterThan, P4A_Validate_Hex,
P4A_Validate_Hostname, P4A_Validate_InArray, P4A_Validate_Int, P4A_Validate_Ip, P4A_Validate_LessThan, P4A_Validate_NotEmpty, P4A_Validate_Regex and P4A_Validate_StringLength classes were added.
These classes rely on Zend_Validate_* classes but we need them to allow translation of error messages
- P4A::isPopupOpened() and getFocusedObjectId() methods are now marked as deprecated
- popup system was completely rewritten
- when generating image thumbnails now we pass by the application’s index file instead of directly linking phpthumb
- phpThumb was updated to 1.7.8
- jQuery::form was updated to 2.0.3
- ajax upload was enabled again
- a bug with getID3 was solved, now we catch the exception triggered when file is not recognized and simply go on
- YAHOO YUI CSS reset was added
- P4A_Mask::validateFields() method is now automatically called by P4A_Mask::saveRow()
- P4A_Table::setTitle() and getTitle() methods were removed, use setLabel() and getLabel() instead
Filed in: CreaLabs, P4A, PHP, Things I do
Jan 28, 2008 -
10 Comments
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 :-)
Filed in: CreaLabs, P4A, PHP, Things I do
Jan 21, 2008 -
2 Comments
First technical post on the new blog, as usual 10% of the code take 90% of work, for this commit I spent a lot of time trying to get a final solution for a cross browser message rendering issue (we wanted an icon with a text on the right, both vertically centered). I also unified the generated HTML code for buttons, P4A_Message and system messages. Then I moved my attention on a better pngfix routine for explorer 6, port some P4A elements to PHP 5 and clean up the API a bit (removing some methods with really weird names)
Here you have a screenshot of the new button with a long label (note that the accesskey is underlined):

and here you can see the new system message, with icons and long descriptions (you can’t see it but it has a nice fade-in fade-out effect):

Time for the raw changelog:
- P4A_DB_Source::setQuery() was rewritten and now it’s works again
- jQuery was updated to 1.2.2
- javascript code for P4A system messages was rewritten from scratch
- P4A_Message and P4A_Tab_Pane were php5ized
- P4A_Tab_Pane::setActivePage() method now returns the active page
- P4A_Tab_Pane::nextPage() method now returns the active page
- P4A_Message::setIcon() now supports a path to an image instead of the icon name
- P4A_Message and p4a->message HTML/CSS was unified
- jQuery UI datepicker CSS was reworked
- P4A_Generate_Widget_Layout_Table() global function was added to P4A’s standard library, this creates an HTML table (1row, 2cols) useful when you’ve to output an image on a col and a text on the other col
- HTML output for P4A_Message, P4A system messages and P4A_Button was rewritten using HTML tables because we need users to have the same browsing experience on all browsers
- P4A’s javascript PNG fix routine was dropped
- jQuery::iFixPng 1.7 was introduced
- P4A_THEMES_PATH and P4A_THEMES_DIR constants were dropped
- P4A_Field::noAllowNull() method was removed
- P4A_Field::allowNull() method now supports passing the “false” value to disable the feature
- P4A_Field::unsetUploadSubpath() method was removed, use setUploadSubpath(null) to disable the feature
- P4A_Field::unsetMaxThumbnailSize() method was removed, use setMaxThumbnailSize(null) to disable the feature
- P4A_Field::setRichTextareaToolbar(), getRichTextareaToolbar() and getRichTextareaToolbars() were removed because unsupported by fckeditor
- P4A_Field was php5ized
See you at the next digest :-)
Filed in: CreaLabs, P4A, PHP, Things I do
Jan 21, 2008 -
0 Comments
My blog finally have a new home :-)
I decided to move ’cause I wanted to change the graphic theme and to be able to modify it a bit to fit my few specific needs. I could also install the addthis plugin, at least I won’t have to generate/copy/paste the “digg this” HTML code for every post… little things that can bring a lot of satisfaction :-)
Working on the new blog took me a few days, that’s why I haven’t post anything last week, now I still have to fix something but I’ll restart posting about the usual things (actually will be p4a).
ok, back to work, see you soon!
Filed in: Things I do, This blog