Ferreteria/v0.3/class/fcrDropInModule: Difference between revisions
< Ferreteria | v0.3 | class
Jump to navigation
Jump to search
(updated name of an extended class) |
m (5 revisions imported: moving this project here) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 50: | Line 50: | ||
} | } | ||
</source> | </source> | ||
* '''file''': | * '''file''': {{l/ferreteria/file|dropin.php}} | ||
* '''extends''': {{l/ferreteria/class|cFieldRow_sourced}} | * '''extends''': {{l/ferreteria/class|cFieldRow_sourced}} | ||
* '''table class''': {{l/ferreteria/class|fcDropInManager}} | * '''table class''': {{l/ferreteria/class|fcDropInManager}} |
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