<?php class Folders { public function low($file) { $this->file = $file; if($this->file!="." && $this->file!=".." && !eregi("index.html",$this->file) && file_exists($this->getpatch().$this->file."/block.php")) { include $this->getpatch().$this->file."/block.php"; echo "<tr><td class='plug_inst'>".$this->a."</td><td class='plug_inst'><a href='".$this->getpatch().$this->file."/admin.php'>".$titleblock."</a></td> <td class='plug_inst'> <a href='admin.php?co=blocks&id=install&file=".$this->getpatch().$this->file."&fa=yes'>Instaluj</a></td> <td class='plug_inst'>$author</td><td class='plug_inst'>".($add2menu==1 ? 'Tak' : 'Nie')."</td></tr>"; $this->a++; } } } include "includes/php/folders.php"; $new = new Pug; $new->Path = "modules/"; $new->sche(); ?>
folders.php
<?php class Pug extends Folders{ public $Path; public function getpatch() { return $this->Path; } public function sche() { { $a=1; $this->a = $a; { $this->low($file); } } } } ?>
Jest to dość banalnie zrobiona, ale ładnie chodzi.
Pytanie jest następujące:
Chcę stworzyć nową metodę np: install, która będzie odpowiadała za instalację. Tylko nie wiem jak ją wywołać, aby dodać jakiś rekord.