示例#1
0
        saveModule($option, $client, $task);
        break;
    case 'remove':
        removeModule($cid, $option, $client);
        break;
    case 'cancel':
        cancelModule($option, $client);
        break;
    case 'publish':
    case 'unpublish':
        mosCache::cleanCache('com_content');
        publishModule($cid, $task == 'publish' ? 1 : 0, $option, $client);
        break;
    case 'orderup':
    case 'orderdown':
        orderModule($cid[0], $task == 'orderup' ? -1 : 1, $option, $client);
        break;
    case 'accesspublic':
    case 'accessregistered':
    case 'accessspecial':
        accessMenu($cid[0], $task, $option, $client);
        break;
    case 'saveorder':
        saveOrder($cid, $client);
        break;
    default:
        viewModules($option, $client);
        break;
}
/**
* Compiles a list of installed or defined modules
示例#2
0
    case 'apply':
        saveModule($option, $client, $task);
        break;
    case 'remove':
        removeModule($cid, $option, $client);
        break;
    case 'cancel':
        cancelModule($option, $client);
        break;
    case 'publish':
    case 'unpublish':
        publishModule($cid, $task == 'publish', $option, $client);
        break;
    case 'orderup':
    case 'orderdown':
        orderModule(intval($cid[0]), $task == 'orderup' ? -1 : 1, $option);
        break;
    case 'accesspublic':
    case 'accessregistered':
    case 'accessspecial':
        accessMenu(intval($cid[0]), $task, $option, $client);
        break;
    case 'saveorder':
        saveOrder($cid, $client);
        break;
    default:
        viewModules($option, $client);
        break;
}
/**
* Compiles a list of installed or defined modules
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
//include_once dirname(__FILE__) . DS.'modules.html.php';
$moduleid = JRequest::getInt('moduleid', null);
$mainframe = JFactory::getApplication();
$client = strval(JRequest::getCmd('client', 'admin'));
JArrayHelper::toInteger($cid);
switch ($task) {
    case 'publish':
    case 'unpublish':
        publishModule(array($moduleid), $task == 'publish', $option, $client);
        break;
    case 'orderup':
    case 'orderdown':
        orderModule($moduleid, $task == 'orderup' ? -1 : 1, $option, $client);
        break;
    default:
        $mainframe->redirect('index.php?option=com_docman');
        break;
}
function publishModule($cid = null, $publish = 1, $option, $client = 'admin')
{
    $database = JFactory::getDBO();
    $my = JFactory::getUser();
    $mainframe = JFactory::getApplication();
    if (count($cid) < 1) {
        $action = $publish ? 'publish' : 'unpublish';
        echo "<script> alert('Select a module to {$action}'); window.history.go(-1);</script>\n";
        exit;
    }