public function __construct()
 {
     $guid = pageArray(2);
     adminGateKeeper();
     $plugin = getEntity($guid);
     Setting::updateSettingsTable();
     clearCache();
     Cache::clear();
     Cache::clear();
     if ($plugin->enable()) {
         new SystemMessage("Plugin Enabled");
         new Cache("enabled_plugins_", false, "site");
         new Cache("enabled_plugins_reversed", false, "site");
         Systemvariable::set("setup_complete", false);
         forward("admin/plugins");
     }
     Setting::updateSettingsTable();
     clearCache();
     Cache::clear();
     Cache::clear();
     Admintab::deleteAll();
     $translations = getEntities(array("type" => "Translationentity"));
     if ($translations) {
         foreach ($translations as $translation) {
             $translation->delete();
         }
     }
     new SystemMessage("Your plugin can't be enabled.  Check requirements");
     forward("admin/plugins");
 }
 public function __construct()
 {
     if (!pageArray(2)) {
         forward("admin/plugins");
     }
     $guid = pageArray(2);
     adminGateKeeper();
     $plugin = getEntity($guid);
     classGateKeeper($plugin, "Plugin");
     $plugin->status = "disabled";
     $plugin->save();
     Cache::clear();
     Cache::clear();
     Admintab::deleteAll();
     Setting::updateSettingsTable();
     clearCache();
     Cache::clear();
     Systemvariable::set("setup_complete", false);
     $translations = getEntities(array("type" => "Translationentity"));
     if ($translations) {
         foreach ($translations as $translation) {
             $translation->delete();
         }
     }
     new SystemMessage("Your plugin has been disabled.");
     forward("admin/plugins");
 }
 public function __construct()
 {
     adminGateKeeper();
     Admintab::deleteAll();
     Cache::clear();
     Cache::clear();
     $plugins = Plugin::getAll();
     if ($plugins) {
         foreach ($plugins as $plugin) {
             $plugin->enable();
         }
         Cache::clear();
         Cache::clear();
         Cache::clear();
         new SystemMessage("All possible plugins have been enabled.");
     }
     Systemvariable::set("setup_complete", false);
     $translations = getEntities(array("type" => "Translationentity"));
     if ($translations) {
         foreach ($translations as $translation) {
             $translation->delete();
         }
     }
     forward("admin/plugins");
 }
 public function __construct()
 {
     adminGateKeeper();
     Cache::clear();
     Cache::clear();
     $plugins = Plugin::getAll();
     foreach ($plugins as $plugin) {
         $plugin->disable();
     }
     Admintab::deleteAll();
     Setting::updateSettingsTable();
     clearCache();
     Cache::clear();
     Cache::clear();
     Cache::clear();
     Systemvariable::set("setup_complete", false);
     $translations = getEntities(array("type" => "Translationentity"));
     if ($translations) {
         foreach ($translations as $translation) {
             $translation->delete();
         }
     }
     forward("admin/plugins");
 }
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
adminGateKeeper();
$admin_tabs = Admintab::get();
$tab = pageArray(1);
if (!$tab) {
    $tab = "general";
}
$url = getSiteURL();
$button = "";
$page_body = "<ul class='nav nav-pills nav-stacked'>";
foreach ($admin_tabs as $admin_tab) {
    $name = $admin_tab->name;
    $class = $tab == $name ? "active" : "";
    $page_body .= "<li role='presentation' class='{$class}'>";
    $page_body .= "<a href='{$url}admin/{$name}'>" . translate("admin_panel:" . $admin_tab->name) . "</a>";
    $page_body .= "</li>";
    if ($admin_tab->name == $tab) {
        if ($admin_tab->buttons) {
function removeAdmintab($name)
{
    return Admintab::removeAdmintab($name);
}