Database connection / query management object. operates as a singleton collection, so an instance of a connection to a given database can be invoked from anywhere in the dotAdmin codebase.
The default database connection $this->obj_db exists in all controllers, and the majority of supporting objects.
Public static method of the InvDB singleton. Attempts to make a connection using the parameters specified and returns a database connection object, or returns false on failure.
Public static method of the InvDB singleton object used to get an instance of a database connection object anywhere in the code. $this->inv_db exists in most contollers, so this would normally be used to either obtain an instance of the default database in a supporting class, or for getting a connetion to a different database.
Fetch a result from the array of results from the last query, then move the pointer one to the next result.
Returns an array containing the entire result set from the last executed query.
Get a file object of type $type from the database. For example: getFileModel('document') would return a document file object. Returns false on fail.
Get a list object of type $type from the database. For example: getListModel('document') would return a document list object. Returns false on fail.
Exectue a prepared statement consisting of $query interposed with $params. Results will then become a property of the database object accesible by InvDB::fetch() and InvDB::fetchAll().
Standard object type for a dotAdmin page. Inherits from InvFile
Check the url path $path is valid for this document. Return true or false.
Object of type InvNodeFile: describes the current node which the user is accessing this document via.
Returns an array of breadcrumb trail items. This allows the template to build a breadcrumb trail to the current document.
Returns an array of InvNavLinks for the breadcrumb trail items. This allows the template to build a breadcrumb trail to the current document.
Return the full canonical URL (including the primary web domain) for this document. Primarily for use in a <link rel="canonical" href="[canonicalurl]" /> tag for SEO purposes.
Returns the id of the home node for the current document.
Fetch value of file variable $name encoded for html output. If the original value is a plain text string, it will be returned HTML escaped and with newlines replaced with <br> tags. If value is not set or does not exist, the method will return null. If $tag is passed, and the original value is a plain text string, it will be wrapped in the $tag as follows <$tag>$response</$tag>
Fetch value of file variable $name. Will be returned as a plain text string or and array. If value is not set or does not exist, will return null.
Fetch value of $index in the array file property $name. Will be returned as a plain text string. If value is not set or does not exist, will return null.
Object of type InvNode: describes the current node which the user is accessing this document via, and provides accessor methods for traversing the node hierarchy.
If the current document is a child of document $document_id, this method will return true.
If the current document is a child of node $node_id, this method will return true.
If the current document is a child of the URL path $path, this method will return true.
If the current document in the node index for the node which the user is currently viewing, this method will return true.
This method is designed for use in website templates to allow the template to modify its content when a node index is viewed by the user.
Opens a file of id $id. On success, returns true, If no such file exists, or on error, returns false.
Publishes document to website. On success, returns true, On error, returns false.
The InvFile object is the standard object wrapper for all database records. The InvFile class is extended by other file types (such as InvDocument for example) to add the necessary database tables and field descriptions, and to optionally add new methods or properties where required. As such, the majority of dotAdmin database interactions and accompanying template code will be implemented though a child of the InvFile class.
Creates a new blank file. On success returns true. On error returns false.
Deletes current open file. On success returns true. On error returns false.
Returns a $key=>$value array of all filedata properties of the current file object
Fetch value of file variable $name encoded for html output. If the original value is a plain text string, it will be returned HTML escaped and with newlines replaced with <br> tags. If value is not set or does not exist, the method will return null. If $tag is passed, and the original value is a plain text string, it will be wrapped in the $tag as follows <$tag>$response</$tag>
Fieldgroup type values in a file will be returned by the getValue() as an array of arrays contain the values. Using getObjects instead returns the data as an array of objects, with each object having getValue() and getHTML() methods of its own for accessing the properties of that fieldset. This is better suited to HTML output in a template.
Fetch value of file variable $name. Will be returned as a plain text string or and array. If value is not set or does not exist, will return null.
Opens a file of id $id. On success, returns true, If no such file exists, or on error, returns false.
Opens a file where field name $name = value $value. When a single result is found returns true, otherwise returns false.
This method can be used to find documents by more than one SELECT condition by passing arrays of fields and values to the method.
Saves current open file. On success returns id of saved document. On error returns false.
Update value of file variable $name to $value. Returns true on success or false on error.
The InvList object is the standard object wrapper for all pginated lists database records. The InvList class is extended by other list types (such as InvDocument for example) to add the necessary database tables and field descriptions, and to optionally add new methods or properties where required. As such, the majority of dotAdmin table list interactions and accompanying template code will be implemented through a child of the InvList class.
Add a conditional join to your list query, eg: LEFT JOIN `user` ON (`user`.`user_id` = `document`.`owner_id`)
The will allow you to query your list object in more involved ways, filtering on text in tables joined to the primary by foreign keys.
Add another expected file type to the result set. This allows the list object to return an array of arrays of file objects, rather than just an array of objects
Fetch unpaginated list of all matching results from the table, using paramaterised WHERE clause $where and ordered by the $order param.
Fetch page $page_from list of results from the table, using paramaterised WHERE clause $where and $params_array.
Return the result set form the last getList() call as a collection of File Objects.
If more than one FileType is expected in the result set, this method eturns an array of arrays of file objects
Default behavour:
[
]
Multi Object Type behaviour:
[
]
Return result of the last getList() call as a collection of arrays representing the results
Fetch an arry containing all of the variables required to provide pagination links on your result set.
Number of pagination link to show in the pagination widget. Defaults to 10 eg:
1 2 3 4 5 6 7 8 9 0
Number of results to show per page.
A collection of links which has been created via the dotAdmin nav management interface.
Describes an item in a collection of links within a nav. Extends InvDocument
Returns the URL for this link.
Returns the correct caption for this link. By default, this will use the title of the document being linked to, but this may be substituted in the CMS for a dedicated link caption in the case of selective navs.
if $escaped == true, the title is returned ready escaped for HTML use. If escaped == false, this is returned as an unescaped plaintext string.
Object describing the website node hierarchy with methods for traversing and describing the hierarchy.
Returns an array describing the breadcrumb trail to node $id, or false on error.
Returns an array of direct child nodes of node $id, or false if none exist.
Returns an array describing node $id, or false if none exist.
Returns an array describing node whose index document_path is $path, or false if none exist.
Returns an array describing the node hierarchy for the entire site. If $refresh=true, the method refreshes the node object's internal cache from the database first.
Returns an array describing parent node of node $id, or false if none exist.
The node object describes a specific Node on the tree. Extends InvFile.
Get a document file object representing the document index of this node.
Lazy loaded and cached in the object. If $refresh == true, the object will reload the document object from the database.
Get URL parth to this node.
The id of the open node. Can be accessed via $this->id or $this->getValue('id');
The id of the index document for the open node.
The access level for the current node.
The ID of the documenttype which should be selected by default when adding a new document to this node.
Should this node be displayed in site nav elements or not?
Open a node object from its document index URL path.
The id of the parent node for the open node.
The current status of this node. Published, deleted, pending, etc.
An object describing the contents of a node, allowing the creation of various different collections of links from that node downwards, and thereby creating navigational components of a given node on the website hierarchy.
Returns an array for page $page of nav links for the period $monthyear. Sorted in publication date order, latest first. Each array item will be an InvNavLink object.
Returns an array of year / month links for navigating an archive nav. Each array Item will be an array describing that nav link.
Returns an array for page $page of nav links. Each array item will be an InvNavLink object.
InvPublicController is controller used by all dotAdmin documents. When writing code in templates, $this refers to the InvPublicController object. The methods and properties can be accessed therein.
Object of type InvDocument describing the current document being viewed.
Returns an InvNav object of $id, or null on error.
Returns an InvNodeNav object for node $id, or null on error.
$params may contain an array of conditions by which to filter the nav results, eg:
array( 'tags'=>array('tag1,'tag2'),'documenttype_id'=>array(1,2) )
Return only documents tagged with "tag1' or 'tag2' and of documenttype 1 or 2.
If $params['recursive'] == true the nav will fetch not just direct children of the current nav, but any child anywhere in the node hierarchy within the current node.
When fetching a node nav, specify $params('haschildren' => true) to only get back nodes which have content pages within them.
Returns an InvNodeNav object for node whose index document_path is $path, or null on error.
$params may contain an array of conditions by which to filter the nav results. Functionally identical to the $params argument passed to getNodeNav()
Creates a resized image based upon the inputs sent and returns the URL of created image (eg: '/myimage.100_100_crop_FFFFFF.jpg').
Detailed examples of usage can be found here.
The InvSession object is instantiated early on in any dotAdmin request. It can be accessed from any controller as $this->obj_session
This carries information about the user, session properties, and any login information associated with a logged in user.
InvSession is scoped to Controllers, public website document, and templates or views as $this->obj_session. However, you may need to access it from other objects which do not have it pre-scoped.
The normal way to access InvSession would be to fetch its singleton object using InvSession::getInstance()
Fetch session value of variable $name. Will be returned as a plain text string. If value is not set or does not exist, will return null.
Is this an admin user with privileges to use the dotAdmin CMS?
Is the user logged in or not?
I the user permitted to access the node $node?
Customer object containing details of the current logged in customer.
User object containing details of the current logged in user.
Set a value in the session to be retrieved in later page requests.
Unset the value $name in the current session.
The SiteSettings object accesses the settings properties for the current site. These are organised into settings groups, with methods for loading both a group of settings, or an individual setting. Settings are lazy-loaded from the database and cached for best performance
SiteSettings is scoped to Controllers, public website document, and templates or views as $this->sitesettings. However, you may need to access it from other objects which do not have it pre-scoped.
The normal way to access SiteSettings would be to fetch its singleton object using SiteSettings::getInstance()
Loads setting $name from group $group and returns the result as a string.
Loads a group of settings and returns the results as an array.
Returns the complete site URL, including protocol as a string. Eg: 'http://www.example.com'.