Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_Module class

• Introduction

Module class used to describe options, properies and interface to change options (rules).

• Class synopsis

AMI_Module {
/* Constants */
// Lazy option flag
const AMI_Module::OPT_LAZY =  0x01;
// Empty value for enumerated list
const AMI_Module::RLC_EMPTY =  -222222;
// No rule data
const AMI_Module::RLC_NONE =  -1;
// Boolean
const AMI_Module::RLT_BOOL =  10;
// Date interval
const AMI_Module::RLT_DATE_INTERVAL =  130;
// Negative date interval
const AMI_Module::RLT_DATE_INTERVAL_NEG =  150;
// Positive date interval
const AMI_Module::RLT_DATE_INTERVAL_POS =  140;
// E-mail
const AMI_Module::RLT_EMAIL =  50;
// Enumerated list
const AMI_Module::RLT_ENUM =  60;
// Multiselectable enumerated list
const AMI_Module::RLT_ENUM_MULTI =  70;
// Float
const AMI_Module::RLT_FLOAT =  40;
// Signed int
const AMI_Module::RLT_SINT =  25;
// Splitter
const AMI_Module::RLT_SPLITTER =  20010;
// String
const AMI_Module::RLT_STRING =  30;
// Text (multiline string)
const AMI_Module::RLT_TEXT =  45;
// Unsigned int
const AMI_Module::RLT_UINT =  20;
/* Methods */
// Adds module rule to manage oprions.
public addRule ( string $name, int $type, [ mixed $aOptions = AMI_Module::RLC_NONE ], [ mixed $defaultValue = NULL ], [ mixed $aGroups = array() ] ) returns AMI_Module;
// Finalizes rules description.
public finalize ( ) returns void;
// Sets module option.
public setOption ( string $name, mixed $value, [ int $flags = 0 ] ) returns AMI_Module;
// Sets module property.
public setProperty ( string $name, mixed $value ) returns AMI_Module;
}
Tags:
since 5.14.4

• Class Constants

OPT_LAZY

Lazy option flag

RLC_EMPTY

Empty value for enumerated list

Rule data

RLC_NONE

No rule data

Rule data

RLT_BOOL

Boolean

Rule type

RLT_DATE_INTERVAL

Date interval

Rule type

RLT_DATE_INTERVAL_NEG

Negative date interval

Rule type

RLT_DATE_INTERVAL_POS

Positive date interval

Rule type

RLT_EMAIL

E-mail

Rule type

RLT_ENUM

Enumerated list

Rule type

RLT_ENUM_MULTI

Multiselectable enumerated list

Rule type

RLT_FLOAT

Float

Rule type

RLT_SINT

Signed int

Rule type

RLT_SPLITTER

Splitter

Rule type

RLT_STRING

String

Rule type

RLT_TEXT

Text (multiline string)

Rule type

RLT_UINT

Unsigned int

Rule type

• Class Methods

// Adds module rule to manage oprions.
public addRule ( string $name, int $type, [ mixed $aOptions = AMI_Module::RLC_NONE ], [ mixed $defaultValue = NULL ], [ mixed $aGroups = array() ] ) returns AMI_Module;
  • string $name
    Option name
  • int $type
    Rule type
    Possible values:
    AMI_Module::RLT_BOOL, AMI_Module::RLT_UINT,
    AMI_Module::RLT_SINT, AMI_Module::RLT_FLOAT,
    AMI_Module::RLT_STRING, AMI_Module::RLT_TEXT,
    AMI_Module::RLT_EMAIL, AMI_Module::RLT_ENUM,
    AMI_Module::RLT_ENUM_MULTI_ARRAY,
    AMI_Module::RLT_DATE_PERIOD,
    AMI_Module::RLT_DATE_PERIOD_POSITIVE,
    AMI_Module::RLT_DATE_PERIOD_NEGATIVE,
    AMI_Module::RLT_SPLITTER
  • mixed $aOptions
    Module rule options
  • mixed $defaultValue
    Module default rule value
  • mixed $aGroups
    Module rule groups
Tags:
todo Specblock rules support
todo Complex rules (callbacks, etc)
// Finalizes rules description.
public finalize ( ) returns void;
// Sets module option.
public setOption ( string $name, mixed $value, [ int $flags = 0 ] ) returns AMI_Module;
  • string $name
    Option name
  • mixed $value
    Option value
  • int $flags
    Option flags (since 7.0.0) I. e. self::OPT_LAZY
// Sets module property.
public setProperty ( string $name, mixed $value ) returns AMI_Module;
  • string $name
    Property name
  • mixed $value
    Property value