if (!defined('SYS_SORTING')) {
     require_once BASE . 'subsystems/sorting.php';
 }
 usort($policies, 'exponent_sorting_byNameAscending');
 $template = new template('workflow', '_policymanager', $loc);
 $template->assign('policies', $policies);
 $template->output();
 // NOW do the defaultassociations
 $policies = array();
 foreach ($db->selectObjects('approvalpolicy') as $pol) {
     $policies[$pol->id] = $pol;
 }
 $modules = array();
 $names = array();
 $defaults = array();
 foreach (exponent_modules_list() as $mod) {
     $m = new $mod();
     if (!$m->supportsWorkflow()) {
         continue;
     }
     $names[$mod] = $m->name();
     $modules[$mod] = array();
     // Grab all policies
     $assocs = array();
     foreach ($db->selectObjects('approvalpolicyassociation', "module='{$mod}' AND is_global=0") as $assoc) {
         $assocs[$assoc->source] = $assoc->policy_id;
     }
     $default = $db->selectObject('approvalpolicyassociation', "module='{$mod}' AND is_global=1");
     $defaults[$mod] = $default->policy_id;
     // Now grab all the sources.
     foreach ($db->selectObjects('locationref', "module='{$mod}'") as $ref) {
function exponent_modules_moduleManagerFormTemplate($template)
{
    $modules = exponent_modules_list();
    natsort($modules);
    global $db;
    $moduleInfo = array();
    foreach ($modules as $module) {
        $mod = new $module();
        $modstate = $db->selectObject("modstate", "module='{$module}'");
        $moduleInfo[$module] = null;
        $moduleInfo[$module]->class = $module;
        $moduleInfo[$module]->name = $mod->name();
        $moduleInfo[$module]->author = $mod->author();
        $moduleInfo[$module]->description = $mod->description();
        $moduleInfo[$module]->active = $modstate != null ? $modstate->active : 0;
    }
    if (!defined('SYS_SORTING')) {
        include_once BASE . 'subsystems/sorting.php';
    }
    uasort($moduleInfo, "exponent_sorting_byNameAscending");
    $template->assign("modules", $moduleInfo);
    return $template;
}
示例#3
0
 if (isset($_SESSION['containers_cache'])) {
     unset($_SESSION['containers_cache']);
 }
 $template = new template('containermodule', '_form_edit', $loc);
 $template->assign('rerank', isset($_GET['rerank']) ? 1 : 0);
 $template->assign('container', $container);
 $template->assign('locref', $locref);
 $template->assign('is_edit', isset($container->id) ? 1 : 0);
 $template->assign('can_activate_modules', $user->is_acting_admin);
 $template->assign('current_section', exponent_sessions_get('last_section'));
 if (!defined('SYS_JAVASCRIPT')) {
     include_once BASE . 'subsystems/javascript.php';
 }
 $haveclass = false;
 $mods = array();
 $modules_list = isset($container->id) ? exponent_modules_list() : exponent_modules_listActive();
 if (!count($modules_list)) {
     // No active modules
     $template->assign('nomodules', 1);
 } else {
     $template->assign('nomodules', 0);
 }
 if (!defined('SYS_SORTING')) {
     include_once BASE . 'subsystems/sorting.php';
 }
 usort($modules_list, 'exponent_sorting_moduleClassByNameAscending');
 $js_init = '<script type="text/javascript">';
 foreach ($modules_list as $moduleclass) {
     $module = new $moduleclass();
     $mod = null;
     // Get basic module meta info