Class atkNode

Description

The atkNode class represents a piece of information that is part of an application. This class provides standard functionality for adding, editing and deleting nodes.

This class must be seen as an abstract base class: For every piece of information in an application, a class must be derived from this class with specific implementations for that type of node.

Located in /class.atknode.inc (line 280)


	
			
Direct descendents
Class Description
atkFileEditor File editing node.
atkMetaNode The ATK Meta Node class.
atkTreeNode Extension on the atkNode class. Here you will find all functions for the tree view. If you want to use the treeview, you must define the atkTreeNode instead of atkNode.
test The atkNode class represents a piece of information that is part of an application. This class provides standard functionality for adding, editing and deleting nodes.
atkMockNode The atkMockNode class is an atkNode mock object for testing purposes
atkDataNode The ATK data node can be used to create nodes that don't retrieve their data from the database.
Variable Summary
Method Summary
atkNode atkNode ([String $type = ""], [int $flags = 0])
String actionTitle (String $action, [array $record = ""])
atkAttribute &add (atkAttribute $attribute, [ $sections = NULL], [int $order = 0], mixed $tab)
void addAllowedAction (String $action)
boolean addDb ( &$record, [boolean $exectrigger = true], [ $mode = "add"], [array $excludelist = array()], array $record)
void addDialogMRA (String $action)
void addFilter (String $filter, [String $value = ""])
void addFlag (int $flag)
void addListener ( &$listener, atkActionListener $listener)
void addSecurityMap (Mixed $action, [String $mapped = ""])
void addStyle (String $style)
void addToQuery ( &$query, [String $alias = ""], [int $level = 0], [boolean $allfields = false], [ $mode = "select"], [ $includes = array()], atkQuery $query)
void addUniqueFieldset (array $fieldArr)
boolean allowed (String $action, [array $record = ""])
void applySearchCriteria ( &$query, array $searchArray, atkQuery $query)
void applySmartSearchCriteria ( &$query, Array $criteria, atkQuery $query)
String atknodetype ()
void attribSort ()
array buildTabs ([String $action = ""])
void callHandler (String $action)
void changeMapping (string $oldmapped, string $newmapped)
void checkAttributeSecurity (string $mode, [array $record = NULL])
array checkEmptyTabs (array $list)
array checkTabRights ( &$tablist, array $tablist)
String confirmAction (mixed $atkselector, String $action, [boolean $locked = false], [boolean $checkoverride = true], [boolean $mergeSelectors = true])
String confirmActionText ([String $atkselector = ""], [String $action = "delete"], [boolean $checkoverride = TRUE])
boolean copyDb ( &$record, [ $mode = "copy"], array $record)
int countDb ([String $selector = ""], [array $excludeList = ""], [array $includeList = ""], [String $mode = ""], [boolean $distinct = false])
array defaultActions (String $mode, [array $params = array()])
boolean deleteDb (String $selector, [bool $exectrigger = true], [bool $failwhenempty = false])
String descriptor ([array $rec = ""])
array descriptorFields ()
void dispatch (array $postvars, [int $flags = NULL])
array editArray ([String $mode = "add"], [array $record = NULL], [ $forceList = ""], [ $suppressList = ""], [String $fieldprefix = ""], [boolean $ignoreTab = false], [ $injectSections = true], array $forcelist, array $suppresslist)
array edit_values (array $record)
bool executeTrigger (string $trigger,  &$record, [string $mode = null], array $record)
String feedbackUrl (String $action, int $status, [array $record = ""], [String $message = ""], [ $levelskip = 1])
boolean. &filledInForm (- 0)
String genericPage (String $title, mixed $content)
void getActiveSections (string $tab, string $mode)
String getActiveTab ()
atkAttribute &getAttribute (String $name)
void getAttributeOrder ( $name)
array &getAttributes ()
array getDefaultActionParams ([boolean $locked = false])
void getDialogMRA ()
Integer getFlags ()
array getFormButtons (String $mode, array $record)
atkActionHandler &getHandler (String $action)
String getHelp ()
String getLockStatusIcon (boolean $lockstatus)
Integer getMRASelectionMode ()
mixed getNumbering ()
String getOrder ()
unknown getSearchCondition ( &$query, unknown_type $table, unknown_type $alias, unknown_type $value, unknown_type $searchmode, atkQuery $query)
mixed getSearchMode ()
array getSections (String $action)
string getSecurityAlias ()
void getTabFromSection ( $section)
string getTable ()
array getTabs (String $action)
void getTabsFromSections (mixed $sections, string $str)
String getTemplate (String $action, [array $record = NULL], [String $tab = ""])
atkUi &getUi ()
void groupFieldsBySection ( &$fields, array $fields)
boolean hasFlag (int $flag)
String helpUrl ()
String hideForm ([String $mode = "add"], [array $record = NULL], [ $forceList = ""], [String $fieldprefix = ""], array $forcelist)
void init ()
array initial_values ()
void injectSections ( &$fields, array $fields)
bool isAllowedQueryList (mixed $attribname, [mixed $excludeList = ""], [mixed $includeList = ""])
boolean isPartial ()
String lockPage ()
void modifyRecord ( &$record, array $vars, array $record)
void notify (String $action, array $record)
boolean postAdd (array $record, [String $mode = "add"])
bool postDel (array $record)
bool postDelete (array $record)
boolean postUpdate (array $record)
void preAdd ( &$record, array $record)
void preAddToEditArray ( &$record, [string $mode = "add"], array $record)
void preCopy (mixed &$record)
void preDelete (array $record)
void preNotify (String $action,  &$record, array $record)
bool preUpdate ( &$record, array $record)
String primaryKey (array $rec)
String primaryKeyField ()
String primaryKeyTpl ()
void recordActions (array $record, mixed &$actions, mixed &$mraactions)
void redirect ([String $location = ""], [array $recordOrExit = array()], [boolean $exit = false], [int $levelskip = 1])
void remove (String $attribname)
TRUE removeFilter (String $filter, [String $value = ""])
void removeFlag (int $flag)
String renderActionPage (String $action, [mixed $blocks = array()])
void resolveNodeTypeAndAction ( &$alias,  &$action, string $alias, string $action)
resolved resolveSection (mixed $section)
array resolveSections (array $sections)
void resolveSectionsTabsOrder ( &$sections,  &$tabs,  &$order, mixed $sections, mixed $tabs, mixed $order)
array searchDb ( $expression, [ $searchmethod = "OR"], String $epxression)
String securityKey (String $action)
atkSelector select ([string $selector = ''])
array selectDb ([String $selector = ""], [String $order = ""], [array $limit = ""], [array $excludeList = ""], [array $includeList = ""], [String $mode = ""], [boolean $distinct = false])
void setAttribSizes ()
void setAttributeOrder ( $name,  $order)
void setDefaultTab ([String $tab = "default"])
void setDescriptorHandler ( &$handler, Object $handler)
void setDescriptorTemplate (String $template)
void setEditableListAttributes (mixed $attrs)
void setExtendedSearchAction (mixed $action)
void setFeedback (mixed $action, int $statusmask)
void setIndex (String $attribname)
void setMRASelectionMode (mixed $mode)
void setNumbering ([mixed $number = 1])
void setOrder (String $orderby)
void setPriorityActions (array $actions)
void setPriorityRange ([int $min = 1], [int $max = 0])
void setSearchAction (String $action)
void setSecurityAlias (String $alias)
void setTabIndex (string $tabname, int $index, [string $action = ""])
void setTable (String $tablename, [String $seq = ""], [mixed $db = NULL])
void statusbar ([boolean $locked = FALSE])
String tabulate (String $action, String $content)
void text ( $string, [ $module = NULL], [ $lng = ""], [ $firstfallback = ""], [ $nodefaulttext = false])
boolean updateDb ( &$record, [mixed $exectrigger = true], [array $excludes = ""], [array $includes = ""], array $record)
array updateRecord ([array $vars = ""], [array $includes = NULL], [array $excludes = NULL], [array $postedOnly = false])
void validate ( &$record, mixed $mode, [mixed $ignoreList = array()], array $record)
String validateFilter (String $filter)
array viewArray (String $mode, array $record, [ $injectSections = true])
string __toString ()
Variables
String $m_action (line 438)

The action that the node is currently performing.

  • access: protected
Array $m_actionListeners = array() (line 681)

List of action listeners

  • access: protected
mixed $m_db = NULL (line 393)

The database that the node is using for storing and loading its data.

  • access: protected
String $m_defaultlanguage = "" (line 653)

Default language used by Multilanguage Nodes.

  • access: protected
String $m_default_order = "" (line 458)

Default order by statement.

  • access: protected
Object $m_descHandler = NULL (line 674)

Descriptor handler.

  • access: protected
String $m_descTemplate = NULL (line 667)

Descriptor template.

  • access: protected
array $m_dialog_mra = null (line 732)

A list of mra actions that need to be accessed through a dialog.

  • todo: This code needs to be removed/replaced when we have support for all MRA actions for using dialogs. In which case we could make all the actions in a MRA dropdown open an atkDialog.
int $m_flags (line 474)

Bitwise mask of node flags (NF_* flags).

atkActionHandler $m_handler = NULL (line 451)

The active action handler.

  • access: protected
mixed $m_index = "" (line 482)
array $m_listExcludes = array() (line 518)

For speed, we keep track of a list of attributes that we don't have to load in recordlists.

  • access: protected
atkLock $m_lock = NULL (line 639)

The lock instance

  • access: protected
String $m_module (line 386)

The module of the node.

  • access: protected
mixed $m_numbering = null (line 660)

Number to use with numbering

  • access: protected
mixed $m_partial = NULL (line 444)

Contains the definition of what needs to rendered partially.

If set to NULL not in partial rendering mode.

array $m_postvars = array() (line 431)

The postvars (or getvars) that are passed to a page will be passed to the class using the dispatch function. We store them in a member variable for easy access.

  • access: protected
array $m_primaryKey = array() (line 422)

List of names of the attributes that form this node's primary key.

  • access: protected
array $m_securityImplied = array("view"=>"admin") (line 569)

The right to execute certain actions can be implied by the fact that you

have some other right. For example, if you have the right to access a feature (admin right), you may also view that record, and don't need explicit rights to view it. So the 'view' right is said to be 'implied' by the 'admin' right. This is a subtle difference with m_securityMap.

  • access: protected
array $m_securityMap = array("save"=>"add",
"update"=>"edit",
"copy"=>"add",
"import"=>"add",
"editcopy"=>"add",
"search"=>"admin",
"smartsearch"=>"admin")
(line 551)

Actions are mapped to security units.

For example, both actions "save" and "add" require access "add". If an item is not in this list, it's treated 'as-is'. Derived nodes may add more mappings to tell the systems that some custom actions require the same privilege as others. Structure: array($action=>$requiredPrivilege)

  • access: protected
String $m_seq (line 407)

The name of the sequence used for autoincrement fields.

  • access: protected
mixed $m_statusbarDone = false (line 601)
String $m_table (line 400)

The table to use for data storage.

  • access: protected
Array $m_triggerListeners = array() (line 688)

List of trigger listeners

  • access: protected
String $m_type (line 379)

The nodetype.

  • access: protected
mixed $m_unsecuredActions = array("select", "multiselect", "feedback") (line 591)
array $m_viewExcludes = array() (line 527)

For speed, we keep track of a list of attributes that we don't have to load when in view pages.

  • access: protected
  • todo: This can probably be moved to the view handler.
Methods
Constructor atkNode (line 746)

Constructor.

This initialises the node. Derived classes should always call their parent constructor ($this->atkNode($name, $flags), to initialize the base class.
Example:

  1. $this->atkNode('test',NF_NO_EDIT);

atkNode atkNode ([String $type = ""], int $flags)
  • String $type: The nodetype (by default equal to the classname)
  • int $flags: Bitmask of node flags (NF_*).
actionTitle (line 1756)

Generate a title for a certain action on a certain action.

The default implementation displayes the action name, and the descriptor of the current record between brackets. This can be overridden by derived classes.

  • return: The full title of the action.
String actionTitle (String $action, [array $record = ""])
  • String $action: The action for which the title is generated.
  • array $record: The record for which the title is generated.
add (line 847)

Add an atkAttribute (or one of its derivatives) to the node.

  • return: the attribute just added
atkAttribute &add (atkAttribute $attribute, [ $sections = NULL], int $order, mixed $tab)
  • atkAttribute $attribute: The attribute you want to add
  • mixed $tab: The tab(s) on which the attribute should be displayed. Can be a tabname (String) or a list of tabs (array) or "*" if the attribute should be displayed on all tabs.
  • int $order: The order at which the attribute should be displayed. If ommitted, this defaults to 100 for the first attribute, and 100 more for each next attribute that is added.
  • $sections
addAllowedAction (line 4492)

Disable privilege checking for an action.

This method disables privilege checks for the specified action, for the duration of the current http request.

void addAllowedAction (String $action)
  • String $action: The name of the action for which security is disabled.
addDb (line 4005)

Save a new record to the database.

The record is passed by reference, because any autoincrement field gets its value when stored to the database. The record is updated, so after the call to addDb you can use access the primary key fields.

  • return: True if succesful, false if not.
boolean addDb ( &$record, [boolean $exectrigger = true], [ $mode = "add"], [array $excludelist = array()], array $record)
  • array $record: The record to save.
  • boolean $exectrigger: Indicates whether the postAdd trigger should be fired.
  • array $excludelist: List of attributenames that should be ignored and not stored in the database.
  • &$record
  • $mode

Redefined in descendants as:
addDefaultExpandedSections (line 1498)

Add sections that must be expanded by default.

void addDefaultExpandedSections ()
addDialogMRA (line 5018)

Add an mra action that need to be accessed through a dialog.

  • todo: This code needs to be removed/replaced when we have support for all MRA actions for using dialogs. In which case we could make all the actions in a MRA dropdown open an atkDialog. For now this code just generates another button.
void addDialogMRA (String $action)
  • String $action
addFilter (line 1648)

Add a recordset filter.

void addFilter (String $filter, [String $value = ""])
  • String $filter: The fieldname you want to filter OR a SQL where clause expression.
  • String $value: Required value. (Ommit this parameter if you pass an SQL expression for $filter.)
addFlag (line 1164)

Add a flag to the node.

void addFlag (int $flag)
  • int $flag: The flag to add.
addListener (line 4932)

Add an atkActionListener to the node.

void addListener ( &$listener, atkActionListener $listener)
addSecurityMap (line 4888)

Set the security of one or more actions action the same as other actions.

If $mapped is empty $action has to be an array. The key would be used as action and would be mapped to the value. If $mapped is not empty $action kan be a string containing one action of an array with one or more action. In both cases al actions would be mapped to $mappped

void addSecurityMap (Mixed $action, [String $mapped = ""])
  • Mixed $action: The action that has to be mapped
  • String $mapped: The action on witch $action has to be mapped
addStyle (line 4854)

Add a stylesheet to the page.

The theme engine is used to determine the path, and load the correct stylesheet.

void addStyle (String $style)
  • String $style: The filename of the stylesheet (without path).
addToQuery (line 3873)

Add this node to an existing query.

Framework method, it should not be necessary to call this method directly. This method is used when adding the entire node to an existing query, as part of a join.

  • todo: The allfields parameter is too inflexible.
void addToQuery ( &$query, [String $alias = ""], int $level, [boolean $allfields = false], [ $mode = "select"], [ $includes = array()], atkQuery $query)
  • atkQuery $query: The query statement
  • String $alias: The aliasprefix to use for fields from this node
  • int $level: The recursion level.
  • boolean $allfields: If set to true, all fields from the node are added to the query. If set to false, only the primary key and fields from the desriptor are added.
  • &$query
  • $mode
  • $includes
addUniqueFieldset (line 3148)

Add a unique field set.

When you add a set of attributes using this method, any combination of values for the attributes should be unique. For example, if you pass array("name", "parent_id"), name does not have to be unique, parent_id does not have to be unique, but the combination should be unique.

void addUniqueFieldset (array $fieldArr)
  • array $fieldArr: The list of names of attributes that should be unique in combination.
allowed (line 4406)

This function determines if the user has the privilege to perform a certain action on the node.

  • return: True if the action may be performed, false if not.
boolean allowed (String $action, [array $record = ""])
  • String $action: The action to be checked.
  • array $record: The record on which the action is to be performed. The standard implementation ignores this parameter, but derived classes may override this method to implement their own record based security policy. Keep in mind that a record is not passed in every occasion. The method is called several times without a record, to just see if the user has the privilege for the action regardless of the record being processed.
applySearchCriteria (line 3795)

Apply the given search criteria to the given query object.

void applySearchCriteria ( &$query, array $searchArray, atkQuery $query)
  • atkQuery $query: The query object.
  • array $searchArray: The search criteria.
  • &$query
applySmartSearchCriteria (line 3839)

Apply the given smart search criteria to the given query object.

void applySmartSearchCriteria ( &$query, Array $criteria, atkQuery $query)
  • atkQuery $query: The query object.
  • Array $criteria: The smart search criteria.
  • &$query
atknodetype (line 4384)

Get the full atknodetype of this node (module.nodetype notation).

  • return: The atknodetype of the node.
String atknodetype ()
attribSort (line 4721)

This function resorts the attribIndexList.

This is necessary if you add attributes *after* init() is already called, and you set an order for those attributes.

void attribSort ()
buildTabs (line 2338)

Builds a list of tabs.

This doesn't generate the actual HTML code, but returns the data for the tabs (title, selected, urls that should be loaded upon click of the tab etc).

  • return: List of tabs
  • todo: Make translation of tabs module aware
array buildTabs ([String $action = ""])
  • String $action: The action for which the tabs should be generated.
callHandler (line 4610)

Invoke the handler for an action.

If there is a known registered external handler method for the specified action, this method will call it. If there is no custom external handler, the atkActionHandler object is determined and the actionis invoked on the actionhandler.

void callHandler (String $action)
  • String $action: the node action
changeMapping (line 4918)

change the securitymap that already exist. Where actions are mapped on $oldmapped change it by $newmapped

void changeMapping (string $oldmapped, string $newmapped)
  • string $oldmapped: the old value
  • string $newmapped: the new value with replace the old one
checkAttributeSecurity (line 1860)

Check attribute security.

Makes some attributes read-only, or hides the attribute based on the current mode / record.

void checkAttributeSecurity (string $mode, [array $record = NULL])
  • string $mode: current mode (add, edit, view etc.)
  • array $record: current record (optional)
checkEmptyTabs (line 1579)

Remove tabs without attribs from the tablist

  • return: The list of tabnames without the empty tabs.
array checkEmptyTabs (array $list)
  • array $list: The list of tabnames
checkTabRights (line 1524)

Check if the user has the rights to access existing tabs and removes tabs from the list that may not be accessed

  • return: with disable tabs
array checkTabRights ( &$tablist, array $tablist)
  • array $tablist: Array containing the current tablist
  • &$tablist

Redefined in descendants as:
confirmAction (line 2511)

Function returns a page in which the user is asked if he really wants to perform a certain action.

  • return: Complete html fragment containing a box with the confirmation page, or the output of the custom override if $checkoverride was true.
String confirmAction (mixed $atkselector, String $action, [boolean $locked = false], [boolean $checkoverride = true], [boolean $mergeSelectors = true])
  • mixed $atkselector: Selector of current record on which the action will be performed (String), or an array of selectors when multiple records are processed at once. The method uses the selector(s) to display the current record(s) in the confirmation page.
  • String $action: The action for which confirmation is needed.
  • boolean $locked: Pass true if the current record is locked.
  • boolean $checkoverride: If set to true, this method will try to find a custom method named "confirm".$action."()" (e.g. confirmDelete() and call that method instead.
  • boolean $mergeSelectors: Merge all selectors to one selector string (if more then one)?
confirmActionText (line 2591)

Determine the confirmation message.

  • return: The confirmation text.
String confirmActionText ([String $atkselector = ""], [String $action = "delete"], [boolean $checkoverride = TRUE])
  • String $atkselector: The record(s) on which the action is performed.
  • String $action: The action being performed.
  • boolean $checkoverride: If true, returns the output of a custom method named "confirm".$action."text()"
copyDb (line 3454)

Copy a record in the database.

Primarykeys are automatically regenerated for the copied record. Any detail records (onetomanyrelation) are copied too. Refered records manytoonerelation) are not copied.

  • return: True if succesful, false if not.
boolean copyDb ( &$record, [ $mode = "copy"], array $record)
  • array $record: The record to copy.
  • &$record
  • $mode

Redefined in descendants as:
countDb (line 3314)

Count the number of records in the database that a call to selectDb would return.

  • return: Number of records
int countDb ([String $selector = ""], [array $excludeList = ""], [array $includeList = ""], [String $mode = ""], [boolean $distinct = false])
  • String $selector: Sql expression used as a where-condition, to count only records that match the expression.
  • array $excludeList: List of attributes to be excluded from the query. By default, the attributes that should be loaded are determined by the $mode parameter. Using $excludeList, you can explicitly exclude attributes.
  • array $includeList: List of attributes to include in the query, regardless of the $mode parameter.
  • String $mode: The action for which the selectDb is called. This param is used to determine which attributes to include in the query and which not to include.
  • boolean $distinct: Perform a distinct selection (no duplicate records). Defaults to true.

Redefined in descendants as:
defaultActions (line 2403)

Retrieve an array with the default actions for a certain mode.

This will return a list of actions that can be performed on records of this node in an admin screen. The actions may contain a [pk] template variable to reference a record, so for each record you should run the stringparser on the action.

  • return: List of actions in the form array($action=>$actionurl)
array defaultActions (String $mode, [array $params = array()])
  • String $mode: The mode for which you want a list of actions. Currently available modes for this method:
    • "admin" (for actions in adminscreens)
    • "relation" (for the list of actions when displaying a recordlist in a onetomany-relation)
    • "view" (for actions when viewing only)
    Note: the default implementation of defaultActions makes no difference between "relation" and "admin" and will return the same actions for both, but you might want to override this behaviour in derived classes.
  • array $params: An array of extra parameters to add to all the action urls. You can use this to pass things like an atkfilter for example. The array should be key/value based.
deleteDb (line 4141)

Delete record(s) from the database.

After deletion, the postDel() trigger in the node method is called, and on any attribute that has the AF_CASCADE_DELETE flag set, the delete() method is invoked.

  • return: True if successful, false if not.
  • todo: There's a discrepancy between updateDb, addDb and deleteDb: There should be a deleteDb which accepts a record, instead of a selector.
boolean deleteDb (String $selector, [bool $exectrigger = true], [bool $failwhenempty = false])
  • String $selector: SQL expression used as where-clause that indicates which records to delete.
  • bool $exectrigger: wether to execute the pre/post triggers
  • bool $failwhenempty: determine whether to throw an error if there is nothing to delete

Redefined in descendants as:
descriptor (line 3084)

Determine a descriptor of a record.

The descriptor is a string that describes a record for the user. For person records, this may be the firstname and the lastname, for companies it may be the company name plus the city etc. The descriptor is used when displaying records in a dropdown for example, or in the title of editpages, delete confirmations etc.

The descriptor method calls a method named descriptor_def() on the node to retrieve a template for the descriptor (string with attributenames between blockquotes, for example "[lastname], [firstname]".

If the node has no descriptor_def() method, the first attribute of the node is used as descriptor.

Derived classes may override this method to implement custom descriptor logic.

  • return: The descriptor for the record.
String descriptor ([array $rec = ""])
  • array $rec: The record for which the descriptor is returned.
descriptorFields (line 3022)

Retrieve the list of attributes that are used in the descriptor definition.

  • return: The names of the attributes forming the descriptor.
array descriptorFields ()
dispatch (line 2751)

This is the wrapper method for all http requests on a node.

The method looks at the atkaction from the postvars and determines what should be done. If possible, it instantiates actionHandlers for handling the actual action.

void dispatch (array $postvars, [int $flags = NULL])
  • array $postvars: The request variables for the node.
  • int $flags: Render flags (see class atkPage).
editArray (line 1918)

Function outputs an array with edit fields. For each field the array contains the name, edit HTML code etc. (name, html, obligatory, error, label)

  • return: List of edit fields (per field ( name, html, obligatory, error, label })
  • todo: The editArray method should use a set of classes to build the form, instead of an array with an overly complex structure.
array editArray ([String $mode = "add"], [array $record = NULL], [ $forceList = ""], [ $suppressList = ""], [String $fieldprefix = ""], [boolean $ignoreTab = false], [ $injectSections = true], array $forcelist, array $suppresslist)
  • String $mode: The edit mode ("add" or "edit")
  • array $record: The record currently being edited.
  • array $forcelist: A key-value array used to preset certain fields to a certain value, regardless of the value in the record.
  • array $suppresslist: List of attributenames that you want to hide
  • String $fieldprefix: Of set, each form element is prefixed with the specified prefix (used in embedded form fields)
  • boolean $ignoreTab: Ignore the tabs an attribute should be shown on.
  • $forceList
  • $suppressList
  • $injectSections
edit_values (line 2260)

Retrieve new values for an existing record.

The system calls this method to override the values of a record before editing the record. The default implementation does not do anything to the record, but derived classes may override this method to make modifications to. the record.

  • return: The manipulated record.
array edit_values (array $record)
  • array $record: The record that is about to be edited.
executeTrigger (line 4083)

Executes a trigger on a add,update or delete action

To prevent triggers from executing twice, the method stores an indication in the record when a trigger is executed. ('__executed<triggername>')

  • return: true on case of success or when the trigger isn't returning anything (assumes success)
bool executeTrigger (string $trigger,  &$record, [string $mode = null], array $record)
  • string $trigger: function, such as 'postUpdate'
  • array $record: record on which action is performed
  • string $mode: mode like add or update
  • &$record
feedbackUrl (line 4797)

Determine the url for the feedbackpage.

Output is dependent on the feedback configuration. If feedback is not enabled for the action, this method returns an empty string, so the result of this method can be passed directly to the redirect() method after completing the action.

The $record parameter is ignored by the default implementation, but derived classes may override this method to perform record-specific feedback.

  • return: The feedback url.
String feedbackUrl (String $action, int $status, [array $record = ""], [String $message = ""], [ $levelskip = 1])
  • String $action: The action that was performed
  • int $status: The status of the action.
  • array $record: The record on which the action was performed.
  • String $message: An optional message to pass to the feedbackpage, for example to explain the reason why an action failed.
  • $levelskip
filledInForm (line 1099)

Checks if the user has filled in something: return true if he has, otherwise return false

boolean. &filledInForm (- 0)
  • - 0
genericPage (line 2771)

Render a generic page, with a box, title, stacktrace etc.

  • return: A complete html page with the desired content.
String genericPage (String $title, mixed $content)
  • String $title: The pagetitle and if $content is a string, also the boxtitle.
  • mixed $content: The content to display on the page. This can be:
    • A string which will be the content of a single box on the page.
    • An associative array of $boxtitle=>$boxcontent pairs. Each pair will be rendered as a seperate box.
getActiveSections (line 1627)

Get the active sections.

void getActiveSections (string $tab, string $mode)
  • string $tab: The currently active tab
  • string $mode: The current mode ("edit", "add", etc.)
getActiveTab (line 1608)

Returns the currently active tab.

Note that in themes which use dhtml tabs (tabs without reloads), this method will always return the name of the first tab.

  • return: The name of the currently visible tab.
String getActiveTab ()
getAttribute (line 1085)

Get an attribute by name.

  • return: The attribute.
atkAttribute &getAttribute (String $name)
  • String $name: The name of the attribute to retrieve.
getAttributeNames (line 1128)

Returns a list of attribute names.

  • return: attribute names
array getAttributeNames ()
getAttributeOrder (line 1136)

Gets the attribute order.

void getAttributeOrder ( $name)
  • $name
getAttributes (line 1116)

Gets all the attributes.

  • return: Array with the attributes.
array &getAttributes ()
getColumnConfig (line 4983)

Get the column configuration object

atkColumnConfig &getColumnConfig ()
getDb (line 1335)

Get the database connection for this node.

  • return: Database connection instance
atkDb &getDb ()
getDefaultActionParams (line 1843)

Determine the default form parameters for an action template.

  • return: Default form parameters for action forms (assoc. array)
array getDefaultActionParams ([boolean $locked = false])
  • boolean $locked: If the current record is locked, pass true, so the lockicon can be placed in the params too.
getDescriptorHandler (line 2985)

Get descriptor handler.

  • return: descriptor handler
Object &getDescriptorHandler ()
getDescriptorTemplate (line 3003)

Returns the descriptor template for this node.

  • return: The descriptor Template
String getDescriptorTemplate ()
getDialogMRA (line 5030)

Retrieve the mra actions that need to be accessed through a dialog.

  • todo: This code needs to be removed/replaced when we have support for all MRA actions for using dialogs. In which case we could make all the actions in a MRA dropdown open an atkDialog. For now this code just generates another button.
void getDialogMRA ()
getExtendedSearchAction (line 2472)

Get extended search action.

  • return: search action
extended getExtendedSearchAction ()
getFlags (line 1183)

Returns the node flags.

  • return: node flags
Integer getFlags ()
getFormButtons (line 1706)

Returns the form buttons for a certain page.

Can be overridden by derived classes to define custom buttons.

array getFormButtons (String $mode, array $record)
  • String $mode: The action for which the buttons are retrieved.
  • array $record: The record currently displayed/edited in the form. This param can be used to define record specific buttons.
getHandler (line 4646)

Get the atkActionHandler object for a certain action.

The default implementation returns a default handler for the action, but derived classes may override this to return a custom handler.

  • return: The action handler.
atkActionHandler &getHandler (String $action)
  • String $action: The action for which the handler is retrieved.
getHelp (line 4539)

Retrieve help link for the current node.

  • return: Complete html link, linking to the help popup.
String getHelp ()
getLockStatusIcon (line 4558)

Get img tag for lock icon.

  • return: HTML image tag with the correct lock icon.
String getLockStatusIcon (boolean $lockstatus)
  • boolean $lockstatus: True if the record is locked, false if not.
getMRASelectionMode (line 1228)

Returns the multi-record-action selection mode.

  • return: multi-record-action selection mode
Integer getMRASelectionMode ()
getNumbering (line 4875)

Gets the numbering of the attributes

  • return: the number whith which the numbering starts
mixed getNumbering ()
getOrder (line 1302)

Get default sort order for the node.

  • return: Default order by. Can be an attribute name or a SQL expression.
String getOrder ()
getPage (line 2830)

Get the page instance of the page on which the node can render output.

  • return: The page instance.
atkPage &getPage ()
getSearchCondition (line 3935)

Get search condition for this node.

unknown getSearchCondition ( &$query, unknown_type $table, unknown_type $alias, unknown_type $value, unknown_type $searchmode, atkQuery $query)
  • atkQuery $query
  • unknown_type $table
  • unknown_type $alias
  • unknown_type $value
  • unknown_type $searchmode
  • &$query
getSearchMode (line 3480)

Get the current searchmode.

  • return: If there is one searchmode set for all attributes, this method returns a string. If there are searchmodes per attribute, an array of strings is returned.
mixed getSearchMode ()
getSections (line 1477)

Retrieve the sections for the active tab.

  • return: The active sections.
array getSections (String $action)
  • String $action
getSecurityAlias (line 4479)

Returns the node's security alias (if set).

  • return: security alias
string getSecurityAlias ()
getTabFromSection (line 1021)

Strip section part from a section and return the tab.

If no tab name is provided, the default tab is returned.

void getTabFromSection ( $section)
  • $section
getTable (line 1075)

Returns the table name for this node.

  • return: table name
string getTable ()
getTabs (line 1414)

Get a list of tabs for a certain action.

  • return: The list of tabnames.
array getTabs (String $action)
  • String $action: The action for which you want to retrieve the list of tabs.

Redefined in descendants as:
getTabsFromSections (line 994)

Retrieve the tabnames from the sections string (tab.section).

void getTabsFromSections (mixed $sections, string $str)
  • string $str: A section string.
getTemplate (line 2286)

Get the template to use for a certain action.

The system calls this method to determine which template to use when rendering a certain screen. The default implementation always returns the same template for the same action (it ignores parameter 2 and 3). You can override this method in derived classes however, to determine on the fly which template to use. The action, the current record (if any) and the tab are passed as parameter. By using these params, you can have custom templates per action, and/or per tab, and even per record.

  • return: The filename of the template (without path)
String getTemplate (String $action, [array $record = NULL], [String $tab = ""])
  • String $action: The action for which you wnat to retrieve the template.
  • array $record: The record for which you want to return the template (or NULL if there is no record).
  • String $tab: The name of the tab for which you want to retrieve the template.
getUi (line 1740)

Get the ui instance for drawing and templating purposes.

  • return: An atkUi instance for drawing and templating.
atkUi &getUi ()
groupFieldsBySection (line 2185)

Group fields by section.

void groupFieldsBySection ( &$fields, array $fields)
  • array $fields: fields array (will be modified in-place)
  • &$fields
hasFlag (line 1155)

Checks if the node has a certain flag set.

  • return: True if the node has the flag.
boolean hasFlag (int $flag)
  • int $flag: The flag to check.
helpUrl (line 4575)

Get the help url for this node.

Retrieves the url of the help popup, if there is help available for this node.

  • return: The help url, or an empty string if help is not available.
String helpUrl ()
hideForm (line 2315)

Function outputs a form with all values hidden.

This is probably only useful for the atkOneToOneRelation's hide method.

  • return: HTML fragment containing all hidden elements.
String hideForm ([String $mode = "add"], [array $record = NULL], [ $forceList = ""], [String $fieldprefix = ""], array $forcelist)
  • String $mode: The edit mode ("add" or "edit")
  • array $record: The record that should be hidden.
  • array $forcelist: A key-value array used to preset certain fields to a certain value, regardless of the value in the record.
  • String $fieldprefix: Of set, each form element is prefixed with the specified prefix (used in embedded form fields)
  • $forceList
init (line 2616)

This function initialises certain elements of the node.

This must be called right after the constructor. The function has a check to prevent it from being executed twice. If you construct a node using 'new', you have to call this method. If you construct it with the getNode or newNode method, you don't have to call this method.

void init ()
initial_values (line 2233)

Retrieve the initial values for a new record.

The system calls this method to create a new record. By default this method returns an empty record, but derived nodes may override this method to perform record initialization.

  • return: Array containing an initial value per attribute. Only attributes that are initialized appear in the array.
array initial_values ()

Redefined in descendants as:
injectSections (line 2148)

Add sections to the edit/view fields array.

void injectSections ( &$fields, array $fields)
  • array $fields: fields array (will be modified in-place)
  • &$fields
isAllowedQueryList (line 3283)

Checks if the attribute is needed in a select query

  • return: true in case the attribute needs to be in the select
bool isAllowedQueryList (mixed $attribname, [mixed $excludeList = ""], [mixed $includeList = ""])
isPartial (line 1193)

Is partial request?

  • return: is partial
boolean isPartial ()
lockPage (line 1718)

Generate a box displaying a message that the current record is locked.

  • return: The HTML fragment containing a box with the message and a back-button.
String lockPage ()
modifyRecord (line 2972)

Update a record with variables from a form posting.

Similar to updateRecord(), but here you can pass an existing record (for example loaded from the db), and update it with the the variables from the request. Instead of returning a record, the record you pass is modified directly.

void modifyRecord ( &$record, array $vars, array $record)
  • array $record: The record to update.
  • array $vars: The request variables that were posted from a form.
  • &$record
notify (line 4956)

Notify all listeners of the occurance of a certain action.

void notify (String $action, array $record)
  • String $action: The action that occurred
  • array $record: The record on which the action was performed
postAdd (line 4209)

Function that is called by the framework, right after a new record has been saved to the database.

This function does essentially nothing, but it can be overriden in derived classes if you want to do something special after you saved a record.

  • return: True if succesful, false if not.
boolean postAdd (array $record, [String $mode = "add"])
  • array $record: The record that has just been saved.
  • String $mode: The 'mode' indicates whether the added record was a completely new record ("add") or a copy ("copy").
postDel (line 4294)

Deprecated function that is called by the framework, right after a record has been deleted.

Please use postDelete() instead.

  • return: Wether or not we succeeded in what we wanted to do.
bool postDel (array $record)
  • array $record: The record that has just been deleted.
postDelete (line 4311)

Function that is called by the framework, right after a record has been deleted.

This function does essentially nothing, but it can be overriden in derived classes if you want to do something special after a record is deleted.

  • return: Wether or not we succeeded in what we wanted to do.
bool postDelete (array $record)
  • array $record: The record that has just been deleted.
postUpdate (line 4247)

Function that is called by the framework, right after an existing record has been updated in the database.

This function does essentially nothing, but it can be overriden in derived classes if you want to do something special after the record is updated.

If the NF_TRACK_CHANGES flag is present for the node, both the new and the original record are passed to this method. The original record is stored in the new record, in $record["atkorgrec"].

  • return: True if succesful, false if not.
boolean postUpdate (array $record)
  • array $record: The record that has just been updated in the database.
preAdd (line 4225)

Function that is called by the framework, just before a new record will be saved to the database.

This function does essentially nothing, but it can be overriden in derived classes if you want to modify the record just before it will be saved.

void preAdd ( &$record, array $record)
  • array $record: The record that will be saved to the database.
  • &$record
preAddToEditArray (line 1893)

The preAddToEditArray method is called from within the editArray

method prior to letting the attributes add themselves to the edit array, but after the edit record values have been collected (a combination of the current record, initial/edit values and the forced values). This makes it possible to do some last-minute modifications to the record data and possibily add some last-minute attributes etc.

void preAddToEditArray ( &$record, [string $mode = "add"], array $record)
  • array $record: the edit record
  • string $mode: edit mode (add or edit)
  • &$record
preCopy (line 4333)

Function that is called by the framework, right before a copied record is stored to the database.

This function does nothing, but it can be overriden in derived classes if you want to do some processing on a record before it is being copied. Typical usage would be: Suppose you have a field named 'title' in a record. In the preCopy method, you could change the title field of the record to 'Copy of ..', so the user can distinguish between the original and the copy.

void preCopy (mixed &$record)
preDelete (line 4282)

Function that is called by the framework, right before a record will be deleted. Should this method return false the deleting will halt.

This function does essentially nothing, but it can be overriden in derived classes if you want to do something special after a record is deleted.

If this function returns false the delete action will not continue.

void preDelete (array $record)
  • array $record: The record that will be deleted.
preNotify (line 4970)

Notify all listeners in advance of the occurance of a certain action.

void preNotify (String $action,  &$record, array $record)
  • String $action: The action that will occur
  • array $record: The record on which the action will be performed
  • &$record
preUpdate (line 4264)

Function that is called by the framework, just before an existing record will be saved to the database.

This function does essentially nothing, but it can be overriden in derived classes if you want to modify the record just before it will be saved.

  • return: Wether or not we succeeded in what we wanted to do.
bool preUpdate ( &$record, array $record)
  • array $record: The record that will be updated in the database.
  • &$record
primaryKey (line 1238)

Returns the primary key sql expression of a record.

  • return: the primary key of the record.
String primaryKey (array $rec)
  • array $rec: The record for which the primary key is calculated.
primaryKeyField (line 1259)

Retrieve the name of the primary key attribute.

Note: If a node has a primary key that consists of multiple attributes, this method will retrieve only the first attribute!

  • return: First primary key attribute
String primaryKeyField ()
primaryKeyTpl (line 1274)

Returns a primary key template.

Like primaryKey(), this method returns a sql expression, but in this case, no actual data is used. Instead, template fields are inserted into the expression. This is useful for rendering multiple primary keys later with a record and a template parser.

  • return: Primary key template
String primaryKeyTpl ()
recordActions (line 4359)

Function that is called for each record in a recordlist, to determine what actions may be performed on the record.

This function does nothing, but it can be overriden in derived classes, to make custom actions for certain records. The array with actions (edit, delete, etc.) is passed to the function and can be modified. To create a new action, just do $actions["new_action"]=$url; in the derived function. To disable existing actions, for example the edit action, for a record, use: unset($actions["edit"]);

void recordActions (array $record, mixed &$actions, mixed &$mraactions)
  • array $record: The record for which the actions need to be determined.

Redefined in descendants as:
redirect (line 2862)

Redirect the browser to a different location.

This is usually used at the end of actions that have no output. An example: when the user clicks 'save and close' in an edit screen, the action 'save' is executed. If the save is succesful, this method is called to redirect the user back to the adminpage. When $config_debug is set to 2, redirects are paused and you can click a link to execute the redirect (useful for debugging the action that called the redirect). Note: this method should be called before any output has been sent to the browser, i.e. before any echo or before the call to atkOutput::outputFlush().

void redirect ([String $location = ""], [array $recordOrExit = array()], [boolean $exit = false], [int $levelskip = 1])
  • String $location: The url to which you want to redirect the user. If ommitted, the call automatically redirects to the previous screen of the user. (one level back on the session stack).
  • array $recordOrExit: If you pass a record here, the record is passed as 'atkpkret' to the redirected url. Usually it's not necessary to pass this parameter. If you pass a boolean here we assume it's value must be used for the exit parameter.
  • boolean $exit: Exit script after redirect.
  • int $levelskip: Number of levels to skip
remove (line 1040)

Remove an attribute.

Completely removes an attribute from a node. Note: Since other functionality may already depend on the attribute that you are about to remove, it's often better to just hide an attribute if you don't need it.

void remove (String $attribname)
  • String $attribname: The name of the attribute to remove.
removeDefaultExpandedSections (line 1509)

Remove sections that must be expanded by default.

void removeDefaultExpandedSections ()
removeFilter (line 1668)

Search and remove a recordset filter.

  • return: if the given filter was found and removed, FALSE otherwise.
TRUE removeFilter (String $filter, [String $value = ""])
  • String $filter: The filter to search for
  • String $value: The value to search for in case it is not a fuzzy filter
removeFlag (line 1174)

Removes a flag from the node.

void removeFlag (int $flag)
  • int $flag: The flag to remove from the attribute
renderActionPage (line 2789)

Render a generic action.

Renders actionpage.tpl for the desired action. This includes the given block(s) and a pagetrial, but not a box.

  • return: Piece of HTML containing the given blocks and a pagetrail.
String renderActionPage (String $action, [mixed $blocks = array()])
  • String $action: The action for which the page is rendered.
  • mixed $blocks: Pieces of html content to be rendered. Can be a single string with content, or an array with multiple content blocks.
resolveNodeTypeAndAction (line 4427)

Resolves a possible node / action alias for the given node / action.

The given node alias and action are updated depending on the found mapping.

void resolveNodeTypeAndAction ( &$alias,  &$action, string $alias, string $action)
  • string $alias: node type
  • string $action: action name
  • &$alias
  • &$action
resolveSection (line 763)

Resolve section. If a section is only prefixed by a dot this means we need to add the default tab before the dot.

  • return: section name
resolved resolveSection (mixed $section)
resolveSections (line 781)

Resolve sections.

array resolveSections (array $sections)
  • array $sections: section list
resolveSectionsTabsOrder (line 801)

Resolve sections, tabs and the order based on the given argument to the attribute add method.

void resolveSectionsTabsOrder ( &$sections,  &$tabs,  &$order, mixed $sections, mixed $tabs, mixed $order)
  • mixed $sections
  • mixed $tabs
  • mixed $order
  • &$sections
  • &$tabs
  • &$order
searchDb (line 4747)

Search all records for the occurance of a certain expression.

This function searches in all fields that are not AF_HIDE_SEARCH, for a certain expression (substring match). The search performed is an 'or' search. If any of the fields contains the expression, the record is added to the resultset.\

Currently, searchDb only searches those attributes that are of type string or text.

  • return: Set of records matching the keyword.
array searchDb ( $expression, [ $searchmethod = "OR"], String $epxression)
  • String $epxression: The keyword to search for.
  • $expression
  • $searchmethod
securityKey (line 4374)

Retrieve the security key of an action.

Returns the privilege required to perform a certain action. Usually, the privilege and the action are equal, but in m_securityMap, aliasses may be defined.

  • return: The security privilege required to perform the action.
String securityKey (String $action)
  • String $action: The action for which you want to determine the privilege.
select (line 3502)

Retrieve records from the database using a handy helper class. PHP5 only.

atkSelector select ([string $selector = ''])
  • string $selector: (optional) selector string (will be used in the where clause)
selectDb (line 3538)

Retrieve records from the database.

Note that if 'atksearch' is set in the request vars, the search expressions are automatically added as extra where-clauses.

  • return: Array containing the retrieved records
  • todo: Handling atksearch in this method is dirty, this should be controlable with parameters.
array selectDb ([String $selector = ""], [String $order = ""], [array $limit = ""], [array $excludeList = ""], [array $includeList = ""], [String $mode = ""], [boolean $distinct = false])
  • String $selector: Sql expression used as a where-condition, to retrieve only records that match the expression.
  • String $order: The order in which to retrieve the records.
  • array $limit: Array containing an "offset" and a "limit" to retrieve only part of the resultset. (Pass NULL or an empty string to retrieve all records.)
  • array $excludeList: List of attributes to be excluded from the query. By default, the attributes that should be loaded are determined by the $mode parameter. Using $excludeList, you can explicitly exclude attributes.
  • array $includeList: List of attributes to include in the query, regardless of the $mode parameter.
  • String $mode: The action for which the selectDb is called. This param is used to determine which attributes to include in the query and which not to include.
  • boolean $distinct: Perform a distinct selection (no duplicate records). Defaults to true.

Redefined in descendants as:
setAttribSizes (line 2723)

This function reads meta information from the database and initialises its attributes with the metadata.

This method should be called before rendering a form, if you want the sizes of all the inputs to match the fieldlengths from the database.

void setAttribSizes ()
setAttributeOrder (line 1144)

Sets an attributes order

void setAttributeOrder ( $name,  $order)
  • $name
  • $order
setDefaultTab (line 1402)

Set default tab being displayed in view/add/edit mode.

After calling this method, all attributes which are added after the method call without specification of tab will be placed on the default tab. This means you should use this method before you add any attributes to the node. If you accept the default name for the first tab ("default") you do not need to call this method.

void setDefaultTab ([String $tab = "default"])
  • String $tab: the name of the default tab
setDescriptorHandler (line 2994)

Set descriptor handler.

void setDescriptorHandler ( &$handler, Object $handler)
  • Object $handler: The descriptor handler.
  • &$handler
setDescriptorTemplate (line 3012)

Sets the descriptor template for this node.

void setDescriptorTemplate (String $template)
  • String $template: The descriptor template.
setEditableListAttributes (line 1205)

Sets the editable list attributes. If you supply this method with one or more string arguments, all arguments are collected in an array. Else the first parameter will be used.

void setEditableListAttributes (mixed $attrs)
setExtendedSearchAction (line 2484)

Set extended search action.

void setExtendedSearchAction (mixed $action)
setFeedback (line 2811)

Use this function to enable feedback for one or more actions.

When feedback is enabled, the action does not immediately return to the previous screen, but first displays a message to the user. (e.g. 'The record has been saved').

void setFeedback (mixed $action, int $statusmask)
  • mixed $action: The action for which feedback is enabled. You can either pass one action or an array of actions.
  • int $statusmask: The status(ses) for which feedback is enabled. If for example this is set to ACTION_FAILED, feedback is enabled only when the specified action failed. It is possible to specify more than one status by concatenating with '|'.
setIndex (line 1360)

Create an alphabetical index.

Any string- or textbased attribute can be used to create an alphabetical index in admin- and selectpages.

void setIndex (String $attribname)
  • String $attribname: The name of the attribute for which to create the alphabetical index.
setMRASelectionMode (line 1219)

Sets the multi-record-action selection mode. Can either be MRA_MULTI_SELECT (default), MRA_SINGLE_SELECT or MRA_NO_SELECT.

void setMRASelectionMode (mixed $mode)
setNumbering (line 4866)

Sets numbering of the attributes to begin with the number that was passed to it, or defaults to 1.

void setNumbering ([mixed $number = 1])
  • mixed $number: the number that the first attribute begins with
setOrder (line 1292)

Set default sort order for the node.

void setOrder (String $orderby)
  • String $orderby: Default order by. Can be an attribute name or a SQL expression.
setPriorityActions (line 2461)

Sets the possible multi-record-priority actions.

void setPriorityActions (array $actions)
  • array $actions: list of actions
setPriorityRange (line 2450)

Sets the priority range, for multi-record-priority actions.

void setPriorityRange ([int $min = 1], int $max)
  • int $min: the minimum priority
  • int $max: the maximum priority (0 for auto => min + record count)
setSearchAction (line 4710)

Sets the search action.

The search action is the action that will be performed if only a single record is found after doing a certain search query.

You can specify more then 1 action. If the user isn't allowed to execute the 1st action, the 2nd action will be used, etc. If you want to pass multiple actions, just pass multiple params (function has a variable number of arguments).

  • todo: Using func_get_args is non-standard. It's cleaner to accept an array.
void setSearchAction (String $action)
  • String $action: The name of the action.
setSecurityAlias (line 4469)

Set the security alias of a node.

By default a node has it's own set of privileges. With this method, the privileges of another node can be used. This is useful when you have a master/detail relationship, and people may manipulate details when they have privileges on the master node. Note: When setting an alias for the node, the node no longer has to have a registerNode call in the getNodes method in module.inc.

void setSecurityAlias (String $alias)
  • String $alias: The node (module.nodename) to set as a security alias for this node.
setTabIndex (line 1372)

Set tab index

void setTabIndex (string $tabname, int $index, [string $action = ""])
  • string $tabname: Tabname
  • int $index: Index number
  • string $action: Action name (add,edit,view)
setTable (line 1323)

Set the table that the node should use.

Note: This should be called in the constructor of derived classes, after the base class constructor is called.

void setTable (String $tablename, [String $seq = ""], [mixed $db = NULL])
  • String $tablename: The name of the table to use.
  • String $seq: The name of the sequence to use for autoincrement attributes.
  • mixed $db: The database connection to use. If ommitted, this defaults to the default database connection. So in apps using only one database, it's not necessary to pass this parameter. You can pass either a connection (atkDb instance), or a string containing the name of the connection to use.
statusbar (line 4509)

Display a statusbar with a stacktrace and a help button.

  • deprecated: Use the {statusbar} tag in templates instead.
void statusbar ([boolean $locked = FALSE])
  • boolean $locked: is the currently displayed item locked?
tabulate (line 1799)

Place a set of tabs around content.

  • return: The complete tabset with content.
String tabulate (String $action, String $content)
  • String $action: The action for which the tabs are loaded.
  • String $content: The content that is to be displayed within the tabset.
text (line 4993)

Translate using this node's module and type.

void text ( $string, [ $module = NULL], [ $lng = ""], [ $firstfallback = ""], [ $nodefaulttext = false])
  • $string
  • $module
  • $lng
  • $firstfallback
  • $nodefaulttext
updateDb (line 3166)

Update a record in the database.

The record should already exist in the database, or this method will fail.

  • return: True if succesful, false if not.
boolean updateDb ( &$record, [mixed $exectrigger = true], [array $excludes = ""], [array $includes = ""], array $record)
  • array $record: The record to update in the database.
  • array $excludes: exclude list (these attribute will *not* be updated)
  • array $includes: include list (only these attributes will be updated)
  • &$record

Redefined in descendants as:
updateRecord (line 2937)

Parse a set of url vars into a valid record structure.

When attributes are posted in a formposting, the values may not be valid yet. After posting, a call to updateRecord should be made to translate the html values into the internal values that the attributes work with.

  • return: A valid record.
array updateRecord ([array $vars = ""], [array $includes = NULL], [array $excludes = NULL], [array $postedOnly = false])
  • array $vars: The request variables that were posted from a form.
  • array $includes: Only fetch the value for these attributes.
  • array $excludes: Don't fetch the value for these attributes.
  • array $postedOnly: Only fetch the value for attributes that have really been posted.
validate (line 3125)

Validates a record.

Validates unique fields, required fields, dataformat etc.

void validate ( &$record, mixed $mode, [mixed $ignoreList = array()], array $record)
  • array $record: The record to validate
  • &$record

Redefined in descendants as:
validateFilter (line 4816)

Validates if a filter is valid for this node.

A filter is considered valid if it doesn't contain any fields that are not part of the node.

Why isn't this used more often???

  • return: Returns $filter if the filter is valid or a empty string if not.
String validateFilter (String $filter)
  • String $filter: The filter expression to validate
viewArray (line 2094)

Function outputs an array with view fields. For each field the array contains the name, view HTML code etc.

  • return: List of edit fields (per field ( name, html, obligatory, error, label })
  • todo: The viewArray method should use a set of classes to build the form, instead of an array with an overly complex structure.
array viewArray (String $mode, array $record, [ $injectSections = true])
  • String $mode: The edit mode ("view")
  • array $record: The record currently being viewed.
  • $injectSections
__toString (line 5004)

String representation for this node (PHP5 only).

  • return: ATK node type
string __toString ()

Documentation generated on Thu, 30 Aug 2007 11:22:16 +0200 by phpDocumentor 1.3.0RC6