本文整理汇总了PHP中Module::disableByName方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::disableByName方法的具体用法?PHP Module::disableByName怎么用?PHP Module::disableByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::disableByName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: desactivate_custom_modules
function desactivate_custom_modules()
{
$arrNonNative = Module::getNonNativeModuleList();
$uninstallMe = array("undefined-modules");
if (is_array($arrNonNative)) {
foreach ($arrNonNative as $aModule) {
$uninstallMe[] = $aModule['name'];
}
}
return Module::disableByName($uninstallMe);
}
示例2: upgrade_module_1_1_0
function upgrade_module_1_1_0($module)
{
$old_module = 'zzcleanurls';
if (Module::isInstalled($old_module)) {
Module::disableByName($this->name);
die(Tools::displayError('You must first un-install module "ZiZuu Clean URLs"'));
}
Db::getInstance()->delete('module', "`name` = '{$old_module}'", 1);
Db::getInstance()->delete('module_preference', "`module` = '{$old_module}'");
Db::getInstance()->delete('configuration', "`name` LIKE '{$old_module}%'");
Db::getInstance()->delete('quick_access', "`link` LIKE '%module_name={$old_module}%'");
return true;
}
示例3: install
/**
* Don't forget to create update methods if needed:
* http://doc.prestashop.com/display/PS16/Enabling+the+Auto-Update
*/
public function install()
{
//instalacion del modulo
if (Module::isInstalled('botondepago')) {
Module::disableByName($this->name);
//note during testing if this is not done, your module will show as installed in modules
die(Tools::displayError('Primero debe desinstalar la version anterior del modulo.'));
}
$this->createConfigVariables();
include dirname(__FILE__) . '/sql/install.php';
//script sql con la creacion de la tabla transaction
return parent::install() && $this->registerHook('displayPayment') && $this->registerHook('displayPaymentReturn') && $this->registerHook('displayBackOfficeHeader') && $this->registerHook('displayHeader') && $this->registerHook('displayAdminProductsExtra') && $this->registerHook('actionProductUpdate') && $this->registerHook('displayAdminOrderContentOrder') && $this->registerHook('displayAdminOrderTabOrder') && $this->unregisterHook('displayAdminProductsExtra');
//muestra una tab en el detalle de la orden
}
示例4: desactivate_custom_modules
function desactivate_custom_modules()
{
// Get all modules then select only payment ones
$arrInstalledModules = Module::getModulesInstalled();
// get native module list
$module_list_xml = INSTALL_PATH . '/../config/modules_list.xml';
$nativeModules = simplexml_load_file($module_list_xml);
$nativeModules = $nativeModules->modules;
if ($nativeModules['type'] == 'native') {
foreach ($nativeModules->module as $module) {
$arrNativeModules[] = $module['name'] . '';
}
}
$uninstallMe = array("rien");
foreach ($arrInstalledModules as $aModule) {
if (!in_array($aModule['name'], $arrNativeModules)) {
$uninstallMe[] = $aModule['name'];
}
}
Module::disableByName($uninstallMe);
foreach ($aModule as $module) {
$file = _PS_MODULE_DIR_ . $module['name'] . '/' . $module['name'] . '.php';
if (!file_exists($file)) {
continue;
}
$fd = fopen($file, 'r');
if (!$fd) {
continue;
}
$content = fread($fd, filesize($file));
if (preg_match_all('/extends PaymentModule/U', $content, $matches)) {
Db::getInstance()->Execute('
INSERT INTO `' . _DB_PREFIX_ . 'module_country` (id_module, id_country)
SELECT ' . (int) $module['id_module'] . ', id_country FROM `' . _DB_PREFIX_ . 'country` WHERE active = 1');
Db::getInstance()->Execute('
INSERT INTO `' . _DB_PREFIX_ . 'module_currency` (id_module, id_currency)
SELECT ' . (int) $module['id_module'] . ', id_currency FROM `' . _DB_PREFIX_ . 'currency` WHERE deleted = 0');
}
fclose($fd);
}
}
示例5: disable
/**
* Called when module is set to deactive
*/
public function disable()
{
return Module::disableByName($this->name);
}
示例6: removeBlocknewsletterBlock
/**
* Remove the default newsletter block so that we can accomodate the
* newsletter block of SendinBlue
*/
public function removeBlocknewsletterBlock()
{
if (_PS_VERSION_ <= '1.4.1.0') {
Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'module` SET active = 0 WHERE name = "blocknewsletter"');
} else {
Module::disableByName('blocknewsletter');
}
}
示例7: setPosition
protected function setPosition()
{
$position = 0;
$blocksearch = Module::getInstanceByName('blocksearch');
/**
* If 'blocksearch' is not installed the module requires
* A manual position update
*/
if ($blocksearch !== false) {
$hook_top = Hook::getIdByName('displayTop');
$position = $blocksearch->getPosition($hook_top);
if (is_null($position) == false) {
/* Disable the default 'blocksearch' module */
Module::disableByName('blocksearch');
$this->updatePosition($hook_top, 0, $position);
}
}
/* Register configuration key so we know the position has been updated */
Configuration::updateValue('ALGOLIA_POSITION_FIXED', $position);
}
示例8: disableOtherSearch
public function disableOtherSearch()
{
if (Module::isEnabled('blocksearch')) {
Module::disableByName('blocksearch');
}
if (Module::isEnabled('searchsuggestions')) {
Module::disableByName('searchsuggestions');
}
if (Module::isEnabled('powersearch')) {
Module::disableByName('powersearch');
}
return true;
}