function defaultData() { $oManager = new OX_Plugin_ComponentGroupManager(); if (!array_key_exists('testPlugin', $GLOBALS['_MAX']['CONF']['pluginGroupComponents'])) { $oManager->disableComponentGroup('testPlugin'); } $this->oManager->enableComponentGroup('testPlugin'); $oTestPluginTable = OA_Dal::factoryDO('testplugin_table'); if (!$oTestPluginTable) { OA::debug('Failed to instantiate DataObject for testplugin_table'); return false; } $oTestPluginTable->myplugin_desc = 'Hello World'; $aSettings[0]['data'] = $oTestPluginTable->insert(); $aSettings[0]['section'] = 'myPlugin'; $aSettings[0]['key'] = 'english'; $oTestPluginTable->myplugin_desc = 'Hola Mundo'; $aSettings[1]['data'] = $oTestPluginTable->insert(); $aSettings[1]['section'] = 'myPlugin'; $aSettings[1]['key'] = 'spanish'; $oTestPluginTable->myplugin_desc = 'Look Simon, you\'re just making it up now'; $aSettings[2]['data'] = $oTestPluginTable->insert(); $aSettings[2]['section'] = 'myPlugin'; $aSettings[2]['key'] = 'russian'; $oManager->_registerSettings($aSettings); $oManager->disableComponentGroup('testPlugin'); return true; }
} } else { if ('enable' == $action) { if ($plugin) { $oPluginManager->enablePackage($plugin); } if (!($oPluginManager->countErrors() || $oPluginManager->countWarnings())) { OX_Admin_Redirect::redirect('plugin-index.php'); } } else { if ('disable' == $action) { if ($plugin) { $oPluginManager->disablePackage($plugin); } else { if ($group) { $oComponentGroupManager->disableComponentGroup($group); } } if (!($oPluginManager->countErrors() || $oPluginManager->countWarnings())) { require_once LIB_PATH . '/Admin/Redirect.php'; OX_Admin_Redirect::redirect('plugin-index.php'); } } else { if ('info' == $action) { if ($plugin) { if (!isset($GLOBALS['_MAX']['CONF']['plugins'][$plugin])) { require_once LIB_PATH . '/Admin/Redirect.php'; OX_Admin_Redirect::redirect('plugin-index.php'); } $oTpl = new OA_Admin_Template('plugin-view.html'); $aPackageInfo = $oPluginManager->getPackageInfo($plugin);