function displayPluginContent() { $curPlugin = new Plugins($_GET['pluginID']); if (file_exists($curPlugin->get_filename())) { include_once $curPlugin->get_filename(); $className = $curPlugin->get_class_name(); $pluginClass = new $className(); return $pluginClass->get_content(); } else { return "The file does not exist."; } /*$phpFile = $curPlugin->get_filename(); $fh = fopen($phpFile, 'r'); $data = fread($fh, filesize($phpFile)); fclose($fh); if (!preg_match("/echo/i", $data) && !preg_match("/print/i", $data) ) { if (class_exists($className)) { $pluginClass = new $className(); } else {return "Your class, \"".$className."\", taken from the database does not exist in your php file.";} if(method_exists($pluginClass, 'get_content')) { if($pluginClass->get_content() !='') { return $pluginClass->get_content(); } } else{return "No Content to retrieve";} } else {return "You cannot echo or print your content out, you must return a value";}*/ }
echo "<div id='controlBar'>"; foreach ($allTabs as $link => $tName) { echo "<ul>"; echo "<a href='" . $link . "'>"; if (preg_match("/" . $link . "/", $_SERVER['REQUEST_URI'])) { echo "<li id='active'>"; } else { echo "<li>"; } echo "<font class='topMenu' icon='" . strtolower($tName) . "'>" . $tName . "</font>"; $name = checkPlugin(strtolower($tName)); if (!empty($name)) { echo "<ul>"; foreach ($name as $id => $value) { $curPlugin = new Plugins($id); $className = $curPlugin->get_class_name(); echo "<a href='pluginTemplate.php?tab=" . $link . "&pluginID=" . $id . "&className=" . $className . "'><li class='topMenuItem'><font class='subTopMenu' icon='plugIcon" . $id . "'>" . $value . "</font></li></a>"; } echo "</ul>"; } echo "</li></a>\n\t\t\t </ul>"; } echo "</div>"; ?> </div> <?php function checkPlugin($location) {
function updatePluginConfig() { global $tool, $propertyForm; if (!isset($_POST['id'])) { echo "The configuration must contain the hidden input type, 'id' with values {$id}. <input type='hidden' name='id' value=\".{$id}.\"></input>"; return false; } else { $curPlugin = new Plugins($_POST['id']); include_once $curPlugin->get_filename(); $className = $curPlugin->get_class_name(); $pluginClass = new $className(); $postValues = $_POST; $values = array(); foreach ($postValues as $id => $value) { $pos = strpos($id, "Plugin_"); if ($pos === 0) { $values = $postValues; } } if ($pluginClass->update_config($values)) { $status = "success"; echo "<script language='javascript'>LoadPage(\"configurations.php?action=plugins&mode=edit&update=" . $status . "\", 'settingsInfo');</script>"; } else { $propertyForm->error("Warning: Failed to update plugins. Reason: plugin update is not returning a true value"); } } }