Home « Server software «
Documentation: behaviors/behavior.php
class Behavior - Programmable extensions of sections, articles, and files
Behaviors are software extensions used from within sections to change YACS basic behavior on key event, such as:- Content creation - to allow for controlled article creation or file attachment (tel2pay, etc.)
- Content access - to allow for controlled access (tel2pay, license agreement, etc.)
- Content change - the main goal is to implement workflows on approvals
What are member functions?
Behavior has one single constructor, that supports run-time parameters:
Behavior()
-- create an instance from scratch
The interface itself is made of following member functions, that have to be overloaded into derivated classes:
allow()
-- check access permission
How do behaviors compare to overlays?
Overlays are aiming to store additional structured data in articles, where behaviors are stateless, and apply equally to all pages of some kind.
This script is a reference file of this system.
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
behaviors/behavior.php - Parameters specific to this behavior
allow() - Check access rights
function allow($script, $anchor = NULL)
- $script - string script name
- $anchor = NULL -
- returns boolean FALSE if access is denied, TRUE otherwise
Behavior() - Initialize one behavior instance
function Behavior($parameters='')
- $parameters='' - string behavior parameter
To be overloaded in derivated class.