\Stigma
This class allow cast abstract stigmatization of random objects placed in random scopes.
Synopsis
class Stigma
{
- // constants
- const ICON_EXT = '.png';
- const ICON_PATH = 'skins/stigma/';
- const CONFIG_PATH = 'config/stigma/';
- const CUSTOM_CONFIG_PATH = 'content/documents/mystigma/confs/';
- const CUSTOM_ICON_PATH = 'content/documents/mystigma/icons/';
- const CONFIG_EXT = '.ini';
- const TABLE_DATASOURCE = 'stigma';
- const DELIMITER = '|';
- const RENDERER_PREFIX = 'renderer';
- const ROUTE_SCOPE = 'stscope';
- const ROUTE_ITEMID = 'stitemid';
- const ROUTE_STATE = 'stchstate';
- const ROUTE_ICONSIZE = 'stis';
- // members
- protected string $scope = '';
- protected string $type = 'radiolist';
- protected string $renderer = 'iconic';
- protected array $icons = ;
- protected array $states = ;
- protected string $myLogin = '';
- protected $stigmaDb = '';
- protected string $allStigmas = '';
- protected string $baseUrl = '';
- protected string $activeClass = 'todaysig';
- protected string $baseClass = 'dashtask';
- protected bool $animated = true;
- protected string $taskmanLogging = '';
- protected string $systemLogging = '';
- protected string $customLogging = '';
- // methods
- public void __construct()
- protected void setScope()
- protected void setBaseUrl()
- protected void setAdminLogin()
- protected void initDatabase()
- public void setTaskmanLogging()
- public void setSystemLogging()
- public void setCustomLogging()
- protected void loadConfig()
- protected void loadStigmas()
- public string getStateIcon()
- protected string rendererIconic()
- protected string rendererSelector()
- protected string rendererTextlink()
- protected string rendererImagelink()
- public string render()
- public string/void renderItemStates()
- public string textRender()
- public array getItemStates()
- public void stigmaController()
- protected void createState()
- protected void setState()
- public void saveState()
- protected void logStigmaChange()
- public bool haveState()
- public array getAllStates()
- public array getAllScopes()
- public array getReportData()
- public string renderBasicReport()
Constants
Name | Value |
---|---|
ICON_EXT | '.png' |
ICON_PATH | 'skins/stigma/' |
CONFIG_PATH | 'config/stigma/' |
CUSTOM_CONFIG_PATH | 'content/documents/mystigma/confs/' |
CUSTOM_ICON_PATH | 'content/documents/mystigma/icons/' |
CONFIG_EXT | '.ini' |
TABLE_DATASOURCE | 'stigma' |
DELIMITER | '|' |
RENDERER_PREFIX | 'renderer' |
ROUTE_SCOPE | 'stscope' |
ROUTE_ITEMID | 'stitemid' |
ROUTE_STATE | 'stchstate' |
ROUTE_ICONSIZE | 'stis' |
Members
protected
- $activeClass
—
string
Configurable active-state class - $allStigmas
—
array
Contains all of available stigmas from database as itemid=>data - $animated
—
bool
Stigma content update animation - $baseClass
—
string
Configurable base-state controls class - $baseUrl
—
string
Contains controller callbacks URL - $customLogging
—
string
System custom logging flag/table name. Disabled if empty. - $icons
—
array
Contains available stigma type icons as state=>iconname - $myLogin
—
string
Contains current administrator login - $renderer
—
string
Stigma controller renderer type: iconic, selector, textlink, etc... - $scope
—
string
Contains current instance stigma-scope - $states
—
array
Contains all of states available in current scope as state=>name - $stigmaDb
—
Database abstraction layer placeholder - $systemLogging
—
string
System weblogs logging flag/parameter name. Disabled if empty. - $taskmanLogging
—
string
Taskman logging flag/parameter name. Disabled if empty. - $type
—
string
Contains current instance type: checklist or radiolist
Methods
protected
- createState() — Creates new stigma in database
- initDatabase() — Creates protected database abstraction layer
- loadConfig() — Preloads current scope settings from config file
- loadStigmas() — Loads all states from database for current scope
- logStigmaChange() — Put logs data into database if required
- rendererIconic() — Returns default iconic renderer controls
- rendererImagelink() — Returns text links and small images renderer controls
- rendererSelector() — Returns selector renderer controls
- rendererTextlink() — Returns text links renderer controls
- setAdminLogin() — Sets current administrator login property
- setBaseUrl() — Sets current instance base URL
- setScope() — Sets current instance scope
- setState() — Sets some state string to selected item in current scope
public
- __construct() — Creates new stigma on selected scope
- getAllScopes() — Returns all scopes for which stigmas available in database
- getAllStates() — Returns array of all available states text labels as stateId=>textLabel
- getItemStates() — Returns array of all item states as is (for isset checks)
- getReportData() — Returns report data by states in selected time range
- getStateIcon() — Returns some stateId icon if available or default icon if not.
- haveState() — Checks for available states for some itemId in scope
- render() — Renders stigma current state and editing interface for some item
- renderBasicReport() — Renders basic report on states applied on current scope
- renderItemStates() — Renders stigma states list or void if not set for some item
- saveState() — Saves some new stigma state into database
- setCustomLogging() — System custom database table logging flag/name public setter
- setSystemLogging() — System weblogs logging flag/name public setter
- setTaskmanLogging() — Taskman logging flag/name public setter
- stigmaController() — AJAX callbacks processing controller
- textRender() — Renders stigma current states as text string