Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TAction
Structure to encapsulate an action Methods public function __construct($action) Class Constructor $action : Callback to be executed public function setParameter($param, $value) Adds a parameter to the action $param : = parameter name $value : = parameter value public function getParameter($param) Returns a parameter $param : = parameter name public function getAction() Returns the current calback public function serialize($format_action = TRUE) Converts the action into an URL $format_action : = format action with document or javascript (ajax=no)
TAdiantiCoreTranslator
Framework translation class for internal messages Methods public static function getInstance() Returns the singleton instance public static function setLanguage($lang) Define the target language $lang : Target language index public static function getLanguage() Returns the target language public static function translate($word, $param1 = NULL, $param2 = NULL, $param3 = NULL) Translate a word to the target language $word : Word to be translated
TAdiantiLoader
Framework class autoloader Methods static function autoload_web($class) autoloader for web toolkit $class : classname static function autoload_gtk($class) autoloader for gtk toolkit $class : classname
1/29
Adianti Framework
static function autoload($class, $toolkit = 'web') autoloader $class : classname $toolkit : tookit (web,gtk)
2/29
Adianti Framework
3/29
Adianti Framework
public function addItems($items) Add items to the combo box $items : An indexed array containing the combo options public function show() Shows the widget
TConnection
Singleton manager for database connections Methods public static function open($database) Opens a database connection $database : Name of the database (an INI file).
4/29
Adianti Framework
$key : table field to be used as key in the combo $value : table field to be listed in the combo
5/29
Adianti Framework
public function getWidth() Returns the DataGrid's width function show() Shows the DataGrid function setPageNavigation($pageNavigation) Assign a PageNavigation object $pageNavigation : object function getPageNavigation() Return the assigned PageNavigation object
TDataGridColumn
Representes a DataGrid column Methods public function __construct($name, $label, $align, $width = NULL) Class Constructor $name : = Name of the column in the database $label : = Text label that will be shown in the header $align : = Column align (left, center, right) $width : = Column Width (pixels) public function getName() Returns the database column's name public function getLabel() Returns the column's label public function setLabel($label) Set the column's label
6/29
Adianti Framework
$label : column label public function getAlign() Returns the column's align public function getWidth() Returns the column's width public function setAction(TAction $action) Define the action to be executed when the user clicks over the column header $action : A TAction object public function getAction() Returns the action defined by set_action() method public function setTransformer($callback) Define a callback function to be applyed over the column's data $callback : A function name of a method of an object public function getTransformer() Returns the callback defined by the setTransformer()
TElement
Base class for all HTML Elements Methods public function __construct($name) Class Constructor $name : tag name public function add($child) Add an child element $child : Any object that implements the show() method public function setUseLineBreaks($linebreaks)
7/29
Adianti Framework
Set the use of linebreaks $linebreaks : boolean public function setUseSingleQuotes($singlequotes) Set the use of single quotes $singlequotes : boolean public function del($object) Del an child element $child : Any object that implements the show() method public function getChildren() public function show() Shows the tag
8/29
Adianti Framework
TExpression
Base class for TCriteria and TFilter (composite pattern implementation) Methods abstract public function dump(); Base class for TCriteria and TFilter (composite pattern implementation)
TField
Base class to construct all the widgets Methods public function __construct($name) Class Constructor $name : name of the field public function setName($name) Define the field's name $name : A string containing the field's name public function getName() Returns the field's name public function setValue($value) Define the field's value $value : A string containing the field's value public function getValue() Returns the field's value public function getPostData() Return the post data public function setEditable($editable) Define if the field is editable $editable : A boolean public function getEditable() Returns if the field is editable public function setProperty($name, $value) Define a field property $name : Property Name $value : Property Value public function setSize($width, $height = NULL) Define the Field's width $width : Field's width in pixels public function addValidation($label, TFieldValidator $validator, $parameters = NULL) Add a field validator $label : Field name $validator : TFieldValidator object $parameters : Aditional parameters public function validate() Validate a field
9/29
Adianti Framework
TFieldValidator
TFieldValidator abstract validation class Methods abstract public function validate($label, $value, $parameters = NULL); Validate a given value $label : Identifies the value to be validated in case of exception $value : Value to be validated $parameters : aditional parameters for validation
TFileUploader
File uploader listener Methods function show() File uploader listener
TForm
Wrapper class to deal with forms Methods public function __construct($name = 'my_form') Class Constructor $name : Form Name public function setName($name) Define the form name $name : A string containing the form name public function getName() Returns the form name
10/29
Adianti Framework
public static function sendData($form_name, $object, $aggregate = FALSE) Send data for a form located in the parent window $form_name : Form Name $object : An Object containing the form data public function setEditable($bool) Define if the form will be editable $bool : A Boolean public function addField($field) Add a Form Field $field : Object public function setFields($fields) Define wich are the form fields $fields : An array containing a collection of TField objects public function getField($name) Returns a form field by its name $name : A string containing the field's name public function clear() clear the form Data public function setData($object) Define the data of the form $object : An Active Record object public function getData($class = 'StdClass') Returns the form data as an object $class : A string containing the class for the returning object public function validate() Validate form public function add($object) Add a container to the form (usually a table of panel) $object : Any Object that implements the show() method public function show() Shows the form at the screen
11/29
Adianti Framework
THtmlRenderer
Html Renderer Methods public function __construct($path) Constructor method $path : HTML resource path public function enableSection($sectionName, $replacements = NULL, $repeat = FALSE) Enable a HTML section to show $sectionName : Section name $replacements : Array of replacements for this section $repeat : Define if the section is repeatable public function show() Show the HTML and the enabled sections
12/29
Adianti Framework
$bool : booleano public function setTitle($title) Define o t-tulo do dilogo $title : t-tulo do dilogo public function getId() Retorna o ID public function setSize($width, $height) Define o tamanho do dilogo $width : largura $height : altura public function addAction($label, $action) Adiciona um boto de ao JS ao dilogo $label : rtulo do boto $action : ao JS do boto public function show() Shows the widget at the screen public function close() Closes the dialog public static function closeAll() Close all TJQueryDialog
13/29
Adianti Framework
TLogger
Provides an abstract interface to register LOG files Methods public function __construct($filename) Class Constructor $filename : path for LOG file abstract function write($message);
14/29
Adianti Framework
public function validate($label, $value, $parameters = NULL) Validate a given value $label : Identifies the value to be validated in case of exception $value : Value to be validated $parameters : aditional parameters for validation (max value)
TMessage
15/29
Adianti Framework
Message Dialog Methods public function __construct($type, $message) Class Constructor $type : Type of the message (info, error) $message : Message to be shown
16/29
Adianti Framework
public function getPostData() Return the post data public function setHeight($height) Define the MultiField height $height : Height in pixels public function show() Show the widget at the screen
TNotebook
Notebook Widget: A container area with tabs that allows you to append pages and put any element inside each page Methods public function __construct($width = 500, $height = 650) Class Constructor $width : Notebook's width $height : Notebook's height public function setSize($width, $height) Set the notebook size $width : Notebook's width $height : Notebook's height public function setCurrentPage($i) Define the current page to be shown $i : An integer representing the page number (start at 0) public function appendPage($title, $object) Add a tab to the notebook $title : tab's title $object : tab's content public function getPageCount() Return the Page count public function show() Show the notebook at the screen
17/29
Adianti Framework
$css : Cascading Stylesheet static public function register_css($cssname, $csscode) Register a specific Cascading Stylesheet to this page $cssname : Cascading Stylesheet Name $csscode : Cascading Stylesheet Code static public function openFile($file) Open a File Dialog $file : File Name static public function isMobile() Discover if the browser is mobile device public function show() Decide wich action to take and show the page
TPageNavigation
Page Navigation provides navigation for a datagrid Methods public function setLimit($limit) Set the Amount of displayed records $limit : An integer public function setWidth($width) Define the PageNavigation's width $width : PageNavigation's width public function setCount($count) Define the total count of records $count : An integer (the total count of records) public function setPage($page) Define the current page $page : An integer (the current page) public function setFirstPage($first_page) Define the first page $page : An integer (the first page) public function setOrder($order) Define the ordering $order : A string containint the column name public function setProperties($properties) Set the page navigation properties $properties : array of properties public function setAction($action) Define the PageNavigation action $action : TAction object (fired when the user navigates) public function show() Show the PageNavigation widget
18/29
Adianti Framework
Panel Container: Allows to organize the widgets using fixed (absolute) positions Methods public function __construct($width, $height) Class Constructor $width : Panel's width $height : Panel's height public function put($widget, $col, $row) Put a widget inside the panel $widget : = widget to be shown $col : = column in pixels. $row : = row in pixels.
TQuestion
Question Dialog Methods public function __construct($message, TAction $action_yes = NULL, TAction $action_no = NULL) Class Constructor $message : A string containint the question $action_yes : Action taken for YES response $action_no : Action taken for NO response
19/29
Adianti Framework
TRecord
Base class for Active Records Methods public function __construct($id = NULL) Class Constructor Instantiates the Active Record [$id] : Optional Object ID, if passed, load this object protected function getEntity() Returns the name of database entity public function mergeObject(TRecord $object) Fill the Active Record properties from another Active Record $object : An Active Record
20/29
Adianti Framework
public function fromArray($data) Fill the Active Record properties from an indexed array $data : An indexed array containing the object properties public function toArray() Return the Active Record properties as an indexed array public function addAttribute($attribute) Limit the attributes that will be stored in the Active Record public function store() Store the objects into the database public function reload() ReLoad an Active Record Object from the database public function load($id) Load an Active Record Object from the database $id : The object ID public function delete($id = NULL) Delete an Active Record object from the database [$id] : The Object ID
TRepository
Implements the Repository Pattern to deal with collections of Active Records Methods public function __construct($class) Class Constructor $class : = Active Record class name protected function getEntity() Returns the name of database entity public function load(TCriteria $criteria) Load a collection of objects from database using a criteria $criteria : An TCriteria object, specifiyng the filters public function delete(TCriteria $criteria) Delete a collection of Active Records from database $criteria : An TCriteria object, specifiyng the filters public function count(TCriteria $criteria) Return the amount of objects that satisfy a given criteria $criteria : An TCriteria object, specifiyng the filters
21/29
Adianti Framework
TSession
Session Data Handler (Registry Pattern) Methods public function __construct() Class Constructor static public function setValue($var, $value) Define the value for a variable $var : Variable Name $value : Variable Value static public function getValue($var) Returns the value for a variable $var : Variable Name static public function freeSession() Destroy the session data
22/29
Adianti Framework
TSourceCode
SourceCode View Methods public function loadFile($file) Load a PHP file $file : Path to the PHP file public function show() Show the highlighted source code
23/29
Adianti Framework
TSqlStatement
Provides an abstract Interface to create a SQL statement Methods final public function setEntity($entity) defines the database entity name $entity : Name of the database entity final public function getEntity() Returns the database entity name public function setCriteria(TCriteria $criteria) Define a select criteria $criteria : An TCriteria object, specifiyng the filters abstract function getInstruction();
24/29
Adianti Framework
function setLimit($limit) method setLimit() Define the record limit function setActiveRecord($activeRecord) method setActiveRecord() Define wich Active Record class will be used function setFilterField($filterField) method setFilterField() Define wich field will be used for filtering function onSearch() method onSearch() Register the filter in the session when the user performs a search function onReload($param = NULL) method onReload() Load the datagrid with the database objects function onSave() method onSave() Executed whenever the user clicks at the save button function onDelete($param) method onDelete() executed whenever the user clicks at the delete button Ask if the user really wants to delete the record function Delete($param) method Delete() Delete a record function onEdit($param) method onEdit() Executed whenever the user clicks at the edit button da datagrid function show() method show() Shows the page
25/29
Adianti Framework
method Delete() Delete a record function show() method show() Shows the page
TStyle
StyleSheet Manager Methods public function __construct($name) Class Constructor $mame : Name of the style public static function findStyle($object) Find a style by its properties public function getContent() Returns the style content public function show() Show the style
26/29
Adianti Framework
TTransaction
Manage Database transactions Methods public static function open($database) Open a connection and Initiates a transaction $database : Name of the database (an INI file). public static function get() Returns the current active connection public static function rollback() Rollback all pending operations public static function close() Commit all the pending operations public static function setLogger(TLogger $logger) Assign a Logger strategy
27/29
Adianti Framework
$logger : A TLogger child object public static function log($message) Write a message in the LOG file, using the user strategy $message : Message to be logged public static function getDatabase() Return the Database Name
28/29
Adianti Framework
Defines the Parent Form $object : TForm public function getFields() Return the UI widgets (form fields) public function getWidgets() Return the parsed widgets public function getWidget($name) Return the widget by name $name : Widget name
29/29