Example #1
0
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$perms =& $AppUI->acl();
if (!canEdit('system')) {
    $AppUI->redirect('m=public&a=access_denied');
}
##
## Activate or move a module entry
##
$cmd = w2PgetParam($_GET, 'cmd', '0');
$mod_id = (int) w2PgetParam($_GET, 'mod_id', '0');
$mod_directory = w2PgetParam($_GET, 'mod_directory', '0');
$obj = new w2p_Core_Module();
if ($mod_id) {
    $obj->load($mod_id);
} else {
    $obj->mod_directory = $mod_directory;
}
$ok = (include_once W2P_BASE_DIR . '/modules/' . $obj->mod_directory . '/setup.php');
if (!$ok) {
    if ($obj->mod_type != 'core') {
        $AppUI->setMsg('Module setup file could not be found', UI_MSG_ERROR);
        if ($cmd == 'remove') {
            $obj->remove();
            $AppUI->setMsg('Module has been removed from the modules list - please check your database for additional tables that may need to be removed', UI_MSG_ERROR);
        }
        $AppUI->redirect();
    }
}
$setupclass = $config['mod_setup_class'];
Example #2
0
<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$perms = $AppUI->acl();
$canEdit = canEdit('system');
if (!$canEdit) {
    $AppUI->redirect('m=public&a=access_denied');
}
$mod_id = (int) w2PgetCleanParam($_POST, 'mod_id');
$module = new w2p_Core_Module();
$module->load($mod_id);
$moduleName = $module->mod_directory;
$configName = w2PgetParam($_POST, 'module_config_name', '');
$displayColumns = w2PgetParam($_POST, 'display', array());
$displayOrder = w2PgetParam($_POST, 'order', array());
$displayFields = w2PgetParam($_POST, 'displayFields', array());
$displayNames = w2PgetParam($_POST, 'displayNames', array());
$result = w2p_Core_Module::saveSettings($moduleName, $configName, $displayColumns, $displayOrder, $displayFields, $displayNames);
$AppUI->redirect('m=system&u=modules&a=addedit&mod_id=' . $mod_id . '&v=' . $configName);