/** * Shows installed plugins. */ public function showPlugins($data) { $this->setState('START_SHOWING_PLUGINS'); //Get the text for above the table of plugins $out = $this->openFile("core/fragments/listTop.phtml"); $out = $this->setTabActive(2, $out); //Create new Table item $t = new Table(); //Create new Table $t->createTable("Modules"); $t->addID("moduleTable"); //Sets intial row as headings $t->setHead(true); $titles = array($this->localize("Module Name"), $this->localize("Change Status"), $this->localize("Updates"), $this->localize("Uninstall")); //Adds a row as titles. $t->addRow($titles); //Loop Through each page for ($i = 0; $i < count($data); $i++) { $link = ""; $uninstall = ""; //Ensure the disabling of plugin is allowed. if (!$data[$i][2]) { $link = "<a href='index.php?system=Modules&page=deactivate&req=" . $data[$i][0] . "'>" . $this->localize("Deactivate") . "</a>"; } if (!$data[$i][1]) { $link = "<a href='index.php?system=ModulesInstall&page=activate&active=" . $data[$i][0] . "'>" . $this->localize("Activate") . "</a>"; } if ($this->getController()->getModel()->checkModForUpdates($data[$i][0])) { $update = "<a style='color: red;' href='index.php?system=Modules&page=updateCheck&req=" . $data[$i][0] . "'>" . $this->localize("Updates Available") . "</a>"; } else { $update = "<a style='color: green;' href='index.php?system=Modules&page=updateCheck&req=" . $data[$i][0] . "'>" . $this->localize("Up to Date") . "</a>"; } if (!$data[$i][2]) { $uninstall = "<a href='index.php?system=Modules&page=uninstall&req=" . $data[$i][0] . "'>" . $this->localize("Uninstall") . "</a>"; } //Create a row $row = array($this->localize($data[$i][0]), $link, $update, $uninstall); //Add Page data for each row. $t->addRow($row); } //Creates a table from inserted data $t->runTable(); //Returns the created table. $out .= $t->getTable(); //Sets the generated content as output $this->setContent($out); //Localise Title $this->setContentTitle($this->localize("Module Manager")); $this->setState('END_SHOWING_PLUGINS'); }