Home     ReadMe   Plans You need to log in --> login


This is a special class instantiated automatically in all HTML Widgets. It dramatically simplifies creating user portals with Podio data. In it's simplest form, you can use: $PFUI->html("<p>hello world</p>"); $PFUI->render(); Then just iframe the resulting html widget's URL on your website. Want to show a table of a view? Do this: $PFUI->table(["type"=>"view", "app_id"=>1234, "view_id"=>789]); $PFUI->render(); Want to add click-through to detail on that table? Do this: if ( $PFUI->context == "detail" ) { $PFUI->item(["mode"=>"view", "app_id"=>1234]); $PFUI->render(); } $PFUI->table(["type"=>"view", "app_id"=>1234, "view_id"=>789, "onclick"="detail"]); $PFUI->render(); Want to password protect this with a simple password? Do this: $PFUI->requireAuth("type"=>"simple", "password"=>"mypass"); if ( $PFUI->context == "detail" ) { $PFUI->item(["mode"=>"view", "app_id"=>1234]); $PFUI->render(); } $PFUI->table(["type"=>"view", "app_id"=>1234, "view_id"=>789, "onclick"="detail"]); $PFUI->render();

Implementation Notes

The best way to get a PFUI widget onto your website is via a simple iframe. You should also include the iframe fixer javascript library to make the iframe respond more natively: <iframe src="https://procfuwidgets.b-cdn.net/html/widget_id"></iframe> <script src="https://procfuwidgets.b-cdn.net/pfui/pf_iframe_fixer.js"></script> The iframe source is to the CDN to reduce calls for non-active sessions, and PFUI will redirect to the direct URLs with any forms or links. Note that if you don't require authentication right away and need session data from the first screen ("Not Authorized" errors), you will need to bypass the CDN: <iframe src="https://procfu.com/widgets/html/widget_id"></iframe> <script src="https://procfuwidgets.b-cdn.net/pfui/pf_iframe_fixer.js"></script>

$PFUI Basic Methods

$PFUI->render() output what's been buffered so far and stop executing further code $PFUI->html(string $html) add $html to the output buffer as HTML $PFUI->button(array $options) add add an html button with options array: - title : name on button - onclick : context when clicked $PFUI->link(array $options) add add an html <a> link with options array: - title : name on button - onclick : context when clicked

$PFUI Podio Data Methods

$PFUI->table(array $options) add html table of Podio data with options array: - type : "view" or "related" - item_id : if type=related, the ID of the item to be related to - app_id : ID of Podio app - view_id : if type=view, the ID of the view - fields[] : optional array of fields to show - onclick : optional context on click / select of row - filters[] : optional key/value array to filter on (eg: "filters"=>["status"=>"Open"]) - sort : optional field name to sort by $PFUI->item(array $options) add form with data from an item with options array: - app_id : ID of Podio app - item_id : optional ID of Podio item - DO NOT SET if using context from table with onclick - mode : "view", "edit", or "new" - onsubmit : optional new context on save - fields[] : optional array of fields to show - readonly[] : optional array of fields to lock read only - hidden[] : optional array of fields to hide - values[] : if type=new optional array of values to preset on item create - showfiles : optional bool to show files - allowfiles : optional bool to allow attaching files to item - showcomments : optional bool to show comments - allowcomment : optional bool to allow creation of new comment - allowcommentfiles : optional bool to allow attaching files to new comment

$PFUI Authentication Methods

$PFUI->requireAuth(array $options) require authentication with options array: - method : "password", "link", or "simple" - app_id : id of app that has users - user_field_id : field with username - pass_field_id : field with password - pass_type : "plain" or "md5" - link_field_id : if method=link field that has the link - link_url_param : if method=link URL parameter that will have the link - password : if method=simple password to require - html_after : optional html to add to the login page string $PFUI->getLoggedInUsername() returns username of logged in user if auth method is password or link if auth method is link integer $PFUI->getLoggedInItemId() returns item_id of Podio item if auth method is password or link array $PFUI->getLoggedInItem() returns full raw payload of Podio item if auth method is password or link array $PFUI->getCurrentItem() returns current (clicked-on) item or false $PFUI->clearSession() reset the current session and log out

$PFUI Properties

$PFUI->context current context. "" on start, or value supplied by previous button onclick, table onclick or item onsubmit options.

$PFUI Advanced Methods

$PFUI->openWrapper(string $dom_id) start a new DIV with id $dom_id $PFUI->closeWrapper() close most recently opened DIV $PFUI->startDelayed(string $arbitrary_unique_id) buffer what's next into a separate ajax load and show animated loader in place while loading $PFUI->endDelayed() close current open delayed buffer section array $PFUI->getSession() array $PFUI->setSession(string $key, mixed $value)
Documentation Sections:
Code Editor
Special PF functions
PFUI Portal Class
more coming soon ...