Ejemplo n.º 1
0
 private function _find_component()
 {
     // Figure out the component
     $dummy = new $this->type();
     $midcom_dba_classname = midcom::get('dbclassloader')->get_midcom_class_name_for_mgdschema_object($dummy);
     if (!$midcom_dba_classname) {
         throw new midcom_error("Failed to load DBA class for type {$this->type}.");
     }
     $component = midcom::get('dbclassloader')->get_component_for_class($midcom_dba_classname);
     $help_component = $component;
     if ($component == 'midcom') {
         $component = 'midgard';
         $help_component = 'midgard.admin.asgard';
     }
     $help = new midcom_admin_help_help();
     $this->_request_data['help'] = $help->get_help_contents('asgard_' . $this->type, $help_component);
     $this->_request_data['component'] = $component;
 }
        }
        $component_icon = midcom::get('componentloader')->get_component_icon($dependency);
        if (!$component_icon) {
            echo "<li><img src=\"" . MIDCOM_STATIC_URL . "/stock-icons/16x16/cancel.png\" alt=\"\" /> {$dependency} <span class='alert'>Error: This component is not installed!</span></li>\n";
        } else {
            echo "<li><a href=\"{$prefix}__mfa/asgard/components/{$dependency}/\"><img src=\"" . MIDCOM_STATIC_URL . "/" . $component_icon . "\" alt=\"\" /> {$dependency}</a></li>\n";
        }
    }
    echo "</ul>\n";
}
?>
    </div>

    <div class="help">
        <?php 
$help = new midcom_admin_help_help();
$files = $help->list_files($data['component'], true);
if (count($files) > 0) {
    echo "<h3>" . midcom::get('i18n')->get_string('component help', 'midcom.admin.help') . "</h3>\n";
    echo "<ul>\n";
    foreach ($files as $identifier => $filedata) {
        if ($identifier == 'index') {
            $identifier = '';
        }
        echo "<li><a href=\"{$prefix}__ais/help/{$data['component']}/{$identifier}/\" class='target_blank'>{$filedata['subject']}</a></li>\n";
    }
    echo "</ul>\n";
}
?>
    </div>
</div>
Ejemplo n.º 3
0
 function read_url_methods($component)
 {
     $data = array();
     if ($component == 'midcom') {
         $exec_path = MIDCOM_ROOT . '/midcom/exec';
     } else {
         $component_path = str_replace('.', '/', $component);
         $exec_path = MIDCOM_ROOT . '/' . $component_path . '/exec';
     }
     if (!is_dir($exec_path) || !is_readable($exec_path)) {
         // Directory not accessible, skip loading it
         return $data;
     }
     $dir_handle = opendir($exec_path);
     while (false !== ($file = readdir($dir_handle))) {
         if (preg_match('/^\\./', $file)) {
             //Skip hidden files
             continue;
         }
         $data[$file] = array();
         $info_id = "urlmethod_" . str_replace('.php', '', $file);
         $data[$file]['url'] = '/midcom-exec-' . $component . '/' . $file;
         $data[$file]['description'] = midcom_admin_help_help::get_help_contents($info_id, $component);
         if (midcom_admin_help_help::help_exists($info_id, $component)) {
             $data[$file]['handler_help_url'] = $info_id;
         }
     }
     return $data;
 }