/** * Активирует плагин. * @return boolean */ public function activatePlugin() { $this->messageSucces = $this->lang['ACTIVE_PLUG'] . ' "' . $_POST['pluginTitle'] . '"'; $pluginFolder = $_POST['pluginFolder']; $res = DB::query("\n SELECT *\n FROM `" . PREFIX . "plugins`\n WHERE folderName = '%s'\n ", $pluginFolder); if (!DB::numRows($res)) { $result = DB::query("\n INSERT INTO `" . PREFIX . "plugins`\n VALUES ('%s', '1')", $pluginFolder); MG::createActivationHook($pluginFolder); $this->data['havePage'] = PM::isHookInReg($pluginFolder); return true; } if ($result = DB::query("\n UPDATE `" . PREFIX . "plugins`\n SET active = '1'\n WHERE `folderName` = '%s'\n ", $pluginFolder)) { MG::createActivationHook($pluginFolder); $this->data['havePage'] = PM::isHookInReg($pluginFolder); $this->data['newInformer'] = MG::createInformerPanel(); return true; } return false; }
} ?> <li><a id="plugins" href="javascript:void(0);" title="<?php echo $lang['T_TIP_PLUG']; ?> " class="tool-tip-top"><span class="plugins-icon"></span><?php echo $lang['PLUGINS']; ?> <p class="white-arrow-down"></p></a> <div class="plugins-menu-wrapper"> <ul class="plugins-dropdown-menu"> <?php foreach ($pluginsList as $item) { ?> <?php if (PM::isHookInReg($item['folderName']) && $item['Active']) { ?> <li><a href="#" class="<?php echo $item['folderName']; ?> "><?php echo $item['PluginName']; ?> </a></li> <?php } ?> <?php } ?> <li class="go-to-plugins-settings"><a href="javascript:void(0);" class="all-plugins-settings"><?php
</th> <th class="actions"><?php echo $lang['ACTIONS']; ?> </th> </tr> </thead> <tbody> <?php if (!empty($pluginsList)) { foreach ($pluginsList as $item) { ?> <?php $class = 'plugin-settings-off'; if (PM::isHookInReg($item['folderName'])) { $class = 'plugin-settings-on'; } ?> <tr id="<?php echo $item['folderName']; ?> " class="<?php echo $class; ?> "> <td class="plugins-active" active="<?php echo $item['Active']; ?> ">