EOL; $window['html'] .= "<div style='max-height: 500px;max-width:750;overflow: auto;padding: 5px;'>"; if (!is_writable($conf['plugin_dir'])) { $window['html'] .= "<br><img src='{$images}/silk/error.png' border='0'><font color=\"red\"> ERROR=> The plugin directory '{$conf['plugin_dir']}' is not writable by the web server!</font><br> You might execute the command: <font color='orange'>chown -R {$_ENV['APACHE_RUN_USER']} {$conf['plugin_dir']}</font><br>"; $stat++; } // If we have defined modules, process them if (count($pmodules) > 0) { $window['html'] .= <<<EOL <br><b>Installing new DCM modules:</b><br> EOL; // Get list of existing DCM modules to see if they are already installed, Use cache if possible if (!is_array($self['cache']['modules']) or !array_key_exists('get_module_list', $self['cache']['modules'])) { require_once $conf['dcm_module_dir'] . '/get_module_list.inc.php'; list($status, $self['cache']['modules']) = get_module_list('type=array'); } // If the new module does not already exist, add it foreach ($pmodules as $modname => $attributes) { if (!array_key_exists($modname, $self['cache']['modules'])) { // default the file location if it is not set to use the main lugin file if (!$attributes['file']) { $attributes['file'] = "..{$plugindir}/{$plugin_name}.inc.php"; } list($status, $output) = run_module('add_module', array('name' => $modname, 'desc' => $attributes['desc'], 'file' => $attributes['file'])); if ($status) { $stat++; $window['html'] .= " <img src='{$images}/silk/error.png' border='0'> {$modname} failed to install.<br>"; } else { printmsg("DEBUG => Plugin install for {$plugin_name} created new DCM module {$modname}.", 2); $window['html'] .= " <img src='{$images}/silk/accept.png' border='0'> {$modname}<br>";
function load_module($name = '') { global $conf, $self, $onadb; if (!$name) { $self['error'] = "ERROR => load_module() No module specified!"; return 1; } // If the module is already loaded, return success if (function_exists($name)) { return 0; } // Make sure we're connected to the DB // require_once($conf['inc_functions_db']); // Use cache if possible if (!is_array($self['cache']['modules']) or !array_key_exists('get_module_list', $self['cache']['modules'])) { // Get a list of the valid "modules" and their descriptions. require_once $conf['dcm_module_dir'] . '/get_module_list.inc.php'; list($status, $self['cache']['modules']) = get_module_list('type=array'); } // Make sure the user requested a valid "module" if (!array_key_exists($name, $self['cache']['modules'])) { // Otherwise print an error $self['error'] = "ERROR => The requested module is not valid!"; return 1; } // Make sure the include file containing the function(s)/module(s) requested exists.. // We have to find out which file it's in. list($status, $rows, $module) = db_get_record($onadb, 'dcm_module_list', array('name' => $name)); if ($status or $rows != 1) { $self['error'] = 'ERROR => The specified module does not exist'; return 1; } $file = $conf['dcm_module_dir'] . '/' . $module['file']; if (!is_file($file)) { // Otherwise print an error $self['error'] = "ERROR => The include file ({$file}) for the {$name} module doesn't exist!"; return 1; } // Include the file // The file should define a function called generate_config() to which we pass a node-name, // and receive a configuration file. require_once $file; // Test that the module function existed in the file we just loaded if (!function_exists($name)) { $self['error'] = "ERROR => The module function {$name} doesn't exist in file: {$file}"; return 1; } return 0; }
</div> </div> <div class="form-group"> <label for="inputMail" class="col-sm-2 control-label">Mail</label> <div class="col-sm-9"> <input type="text" name="mail" class="form-control" id="inputMail" placeholder="Your E-mail"> </div> </div> </div> </div> <div class="main-item-single-right main-item-single-addproj-module pull-left"> <div class="add-proj-item add-proj-item-4 add-proj-item-module"> <?php $mods = get_module_list(); foreach ($mods as $mod) { ?> <div class="module-item" only="<?php echo esc_html($mod['only']); ?> " id="<?php echo esc_html($mod['id']); ?> " url="<?php echo pmx_getapiurl_modconfig($mod['id']); ?> ">
//Одобряем if (@$_REQUEST['act'] == "approve") { approve_module(1, $_REQUEST['name']); } //Неодобряем if (@$_REQUEST['act'] == "unapprove") { approve_module(0, $_REQUEST['name']); } //Ранжирование if (@$_REQUEST['act'] == "up") { module_rank_up($_REQUEST['id']); } //Получаем список модулейчаем $db = get_modules(); //активные - в бд $list = get_module_list(); //папка mod - все доступные /* $r=clear_module_list ($db, $list); echo '<pre>'; print_r($r); echo '</pre>'; */ foreach ($db as $db_m) { foreach ($list as $key => $value) { if ($value == $db_m['name']) { $active[] = $db_m; unset($list[$key]); } } } //echo '<pre>'; print_r($list); echo '</pre>'; //массив $active - активные модули, $list - неактивные (в бд не записаны). echo '<p class="mes">Модули</p>'; echo '<br><table border=1 cellpadding=0 cellspacing=0 valign=top style="direction:ltr; border-collapse:collapse;border-style:solid;border-color:#A3A3A3;border-width: 1pt">';