Exemplo n.º 1
0
function pathos_modules_moduleManagerFormTemplate($template)
{
    $modules = pathos_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')) {
        require_once BASE . 'subsystems/sorting.php';
    }
    uasort($moduleInfo, "pathos_sorting_byNameAscending");
    $template->assign("modules", $moduleInfo);
    return $template;
}
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: manage_assocs.php,v 1.5 2005/04/18 15:23:19 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
// PERM CHECK
pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION);
if (!defined("SYS_MODULES")) {
    require_once BASE . "subsystems/modules.php";
}
//$mods = array_flip(pathos_modules_list());
foreach (pathos_modules_list() as $mod) {
    if (call_user_func(array($mod, "hasContent")) == true) {
        $mods[$mod] = null;
        $mods[$mod]->name = call_user_func(array($mod, "name"));
        $mods[$mod]->associated = $db->selectObjects("htmltemplateassociation", "module='{$mod}'");
    }
}
$template = new template("htmltemplatemodule", "_viewassocs", $loc);
$template->assign("modules", $mods);
$template->assign("templates", $db->selectObjectsIndexedArray("htmltemplate"));
$template->assign("template_count", $db->countObjects("htmltemplate"));
$template->assign("globals", $db->selectObjectsIndexedArray("htmltemplateassociations", "is_global = 1"));
$template->output();
// END PERM CHECK
Exemplo n.º 3
0
     $container->internal = unserialize($container->internal);
     $locref = $db->selectObject('locationref', "module='" . $container->internal->mod . "' AND source='" . $container->internal->src . "'");
 }
 $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));
 $template->assign('can_activate_modules', $user->is_acting_admin);
 $template->assign('current_section', pathos_sessions_get('last_section'));
 if (!defined('SYS_JAVASCRIPT')) {
     require_once BASE . 'subsystems/javascript.php';
 }
 $haveclass = false;
 $mods = array();
 $modules_list = isset($container->id) ? pathos_modules_list() : pathos_modules_listActive();
 if (!count($modules_list)) {
     // No active modules
     $template->assign('nomodules', 1);
 } else {
     $template->assign('nomodules', 0);
 }
 if (!defined('SYS_SORTING')) {
     require_once BASE . 'subsystems/sorting.php';
 }
 usort($modules_list, 'pathos_sorting_moduleClassByNameAscending');
 $js_init = '<script type="text/javascript">';
 foreach ($modules_list as $moduleclass) {
     $module = new $moduleclass();
     $mod = null;
     // Get basic module meta info