Ferreteria/v0.3/class/fcrDropInModule: Difference between revisions
< Ferreteria | v0.3 | class
Jump to navigation
Jump to search
m (Woozle moved page Ferreteria/v3/class/fcrDropInModule to Ferreteria/v0.3/class/fcrDropInModule: version renumbering) |
m (5 revisions imported: moving this project here) |
(No difference)
|
Latest revision as of 16:43, 22 May 2022
/*::::
FIELDS:
[name]: short name for module
[descr]: one-line description
[version]: version number (can be non-numeric)
[date]: release date in YYYY/MM/DD format
[URL]: URL for more information about the module
*/
class fcrDropInModule extends ferreteria\data\cIORow_sourced {
// ++ SETUP ++ //
// ACTION: Load specs array and do any additional per-module processing.
public function SetSpecs(array $arSpecs) {
$this->SetValues($arSpecs);
$this->RegisterClasses();
}
/*----
ACTION: register any classes defined within the dropin.
*/
protected function RegisterClasses() {
$arCls = $this->ClassArray();
foreach ($arCls as $sFile => $sClasses) {
$om = new fcCodeModule(__FILE__, $sFile);
if (is_array($sClasses)) {
// value is an array of class names for file $sFile
foreach ($sClasses as $sClass) {
$om->AddClass($sClass);
}
} else {
// assume value is a single class name
$om->AddClass($sClasses);
}
}
}
// -- SETUP -- //
// ++ FIELD VALUES ++ //
public function Name() {
return $this->GetValue('name');
}
protected function ClassArray() {
return $this->GetValue('classes');
}
// -- FIELD VALUES -- //
}
- file: Template:L/ferreteria/file
- extends: Template:L/ferreteria/class
- table class: Template:L/ferreteria/class