MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mcomponent.class
Ir para a documentação deste ficheiro.
1<?php
2abstract class MComponent
3{
7 public $manager;
8
12 public $page;
13
14 var $owner;
17 var $name;
18 var $className; // name of control's class_
19
20 function __construct($name = NULL)
21 {
22 global $MIOLO;
23
24 $this->manager = $MIOLO;
25 $this->page = $this->manager->page;
26 $this->className = strtolower(get_class($this));
27 $this->name = $name;
28 $this->owner = $this;
29 $this->components = array();
30 $this->componentCount = 0;
31 }
32
33 function SetName($name)
34 {
35 $this->name = $name;
36 }
37
38 function GetName()
39 {
40 return $this->name;
41 }
42
43 private function Add($component, $pos)
44 {
45 $this->components[$pos] = $component;
46 $component->owner = $this;
47 $this->componentCount++;
48 }
49
50 function AddComponent($component)
51 {
52 $this->Add($component, $this->componentCount);
53 }
54
55 function InsertComponent($component, $pos = 0)
56 {
57 if ($pos < $this->componentCount)
58 {
59 for ($i = $this->componentCount; $i >= $pos; $i--)
60 $this->components[$i + 1] = $this->components[$i];
61 }
62 else
63 {
64 $pos = $this->componentCount + 1;
65 }
66
67 $this->Add($component, $pos);
68 }
69
70 function SetComponent($component, $pos)
71 {
72 if ($pos < $this->componentCount)
73 {
74 $this->component[$pos] = $component;
75 $component->owner = self;
76 }
77 }
78
80 {
81 $this->components = $components;
82 }
83
84 function GetComponents()
85 {
86 return $this->components;
87 }
88
89 function GetComponent($pos)
90 {
91 return $this->components[$pos];
92 }
93
94 function ClearComponents()
95 {
96 $this->components = array
97 (
98 );
99
100 $this->componentCount = 0;
101 }
102}
103?>
GetComponent($pos)
__construct($name=NULL)
SetComponents($components)
SetComponent($component, $pos)
SetName($name)
AddComponent($component)
InsertComponent($component, $pos=0)