Ferreteria/v0.5/@cls/cDropinLink: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.5‎ | @cls
Jump to navigation Jump to search
(Created page with "{{fmt/title|Ferreteria class <code>ferret\cDropinLink</code>}} {| style="border: solid 1px grey; background: #eef;" |- | align=right | {{l/ver/class|caDynamicLink}} &r...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 9: Line 9:
|}
|}
* '''File''': {{l/ferreteria/code|layout/page/menu/DropinLink.php}}
* '''File''': {{l/ferreteria/code|layout/page/menu/DropinLink.php}}
==About==
Each DropinLink object connects to a Feature object. It uses the {{l/ver/meth|layout/event|OnRunCalculations}} method in {{l/ver/class|tRequiresPermit}} to calculate whether or not the current user has permission to access that Feature, and sets <code>SetIsAuthorized()</code> accordingly. <code>GetIsAuthorized()</code> returns the value of that flag.
* {{l/ver/meth|layout/event|ShouldDoTwigs}} (defined in {{l/ver/class|tRequiresPermit}}) returns the return value of <code>GetIsAuthorized()</code>.
* {{l/ver/meth|layout/event|GetShouldDisplay}} returns TRUE iff <code>GetIsSelected()</code> and <code>GetIsAuthorized()</code> are both TRUE.
==Methods==
===events: general===
* {{l/ver/meth|layout|OnRunCalculations}} comes from {{l/ver/class|tRequiresPermit}}
* {{l/ver/meth|layout|OnEventLocal}}: if GetIsSelected() and GetIsAuthorized(), then InvokeFeature()
** ...and also $oe->SetDoTwigs(FALSE), which is no longer supported and will generate an error if this code is actually run.
===events: render===
* {{l/ver/meth|layout/event|OnRender}} '''overrides''' {{l/ver/class|caNavElement}} by adding conditions (GetIsSelected() and GetIsAuthorized()) before calling {{l/ver/meth|layout/event|RenderOutput}} (shouldn't we just be modifying {{l/ver/meth|layout/event|GetShouldDisplay}}?)
* {{l/ver/meth|layout/event|GetShouldDisplay}} returns TRUE iff GetIsSelected() and GetIsAuthorized() are set
* RenderSelf() - this isn't a thing anymore; needs renaming/refactoring
* {{l/ver/meth|layout/event|RenderOutput}} '''overrides''' {{l/ver/class|caNavElement}}; revision incomplete as of 2022-07-18
* {{l/ver/meth|layout/event|RenderDisplay}} comes from {{l/ver/class|caNavElement}}
* {{l/ver/meth|layout/event|RenderValue}} comes from {{l/ver/class|cElement}}
* {{l/ver/meth|layout/event|RenderBranch}} comes from {{l/ver/class|cElement}}
* {{l/ver/meth|layout/event|RenderTwigs}} comes from {{l/ver/class|cElement}}

Latest revision as of 21:59, 18 July 2022

Ferreteria class ferret\cDropinLink

caDynamicLink
tRequiresPermit

cDropinLink cDropinAction

About

Each DropinLink object connects to a Feature object. It uses the OnRunCalculations() method in tRequiresPermit to calculate whether or not the current user has permission to access that Feature, and sets SetIsAuthorized() accordingly. GetIsAuthorized() returns the value of that flag.

Methods

events: general

  • OnRunCalculations() comes from tRequiresPermit
  • OnEventLocal(): if GetIsSelected() and GetIsAuthorized(), then InvokeFeature()
    • ...and also $oe->SetDoTwigs(FALSE), which is no longer supported and will generate an error if this code is actually run.

events: render