Code

Update gosa regenerates guide.xml
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Apr 2008 09:17:56 +0000 (09:17 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Apr 2008 09:17:56 +0000 (09:17 +0000)
Updated header in master guide.xml

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10106 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/update-gosa
gosa-core/update-online-help

index 94249c47d1edc14b2c7f85b07809e3d867c7ab28..616817d12eeec87b3f9fb5bde381405a22dc6e99 100755 (executable)
@@ -191,6 +191,56 @@ function rescan_i18n()
 }
 
 
+function rescan_guide()
+{
+       $master_guide= "doc/guide.xml";
+       echo "Updating Online Help Index...\n";
+       $master_guide_content="<?xml version=\"1.0\"?>\n".
+               "<!--\n".
+               "\tWARNING:\n".
+               "\tThis file is automatically generated by update-online-help.\n".
+               "\tIf you want to add entries, use doc/core/guide.xml or doc/plugins/\"Appropriate Plugin Directory\"/guide.xml.\n".
+               "\tThen execute update-online-help to merge them into this file.\n".
+               "-->\n\n".
+               "<!--\n".
+               "\tThis xml file specifies which class is documented in which help file.\n".
+               "\tIf isset ( \$_SESSION['current_class_for_help'] ) then open the helpfile which is\n".
+               "\tspecified for this class below.\n".
+               "-->\n\n".
+               "<!--\n".
+               "\t<ENTRY NAME='class name' VALUE='displayed text' PATH='path to helpfiles' FILE='path to htmlfile' />\n".
+               "\tLeave blank to display message \"There is no helpfile specified for this class.\"\n".
+               "-->\n".
+               "<ENTRIES>\n";
+
+       $guide= 'doc/core/guide.xml';
+       if(file_exists($guide) && is_readable($guide)) {
+               $master_guide_content.= file_get_contents($guide);
+       }
+       
+       $plugins= scandir('doc/plugins');
+       foreach($plugins as $key => $plugin) {
+               if($plugin != '.' && $plugin != '..') {
+                       if(is_dir('doc/plugins/'.$plugin)) {
+                               $guide= 'doc/plugins/'.$plugin.'/guide.xml';
+                               if(file_exists($guide) && is_readable($guide)) {
+                                       $master_guide_content.= file_get_contents($guide);
+                               }
+                       }
+               }
+       }
+
+       $master_guide_content.= "</ENTRIES>";
+       
+       $master_guide_content= preg_replace("/[ \t][ \t]*/", " ", $master_guide_content);
+
+       if(is_writable($master_guide)) {
+               file_put_contents($master_guide, $master_guide_content);
+       }
+
+}
+
+
 function parse_ini($file)
 {
        global $description, $provides, $depends, $versions, $conflicts;
@@ -401,6 +451,7 @@ function install_plugin($file)
        /* Update caches */
        rescan_classes();
        rescan_i18n();
+       rescan_guide();
 }
 
 
@@ -458,6 +509,7 @@ function remove_plugin($name)
        /* Update caches */
        rescan_classes();
        rescan_i18n();
+       rescan_guide();
 }
 
 
@@ -469,6 +521,7 @@ $description= $provides= $depends= $versions= $conflicts= array();
 if ($argc < 2){
        rescan_classes();
        rescan_i18n();
+       rescan_guide();
         exit (0);
 }
 
index 7f7cfee9fbe8dee0f191a4ad5e86aa5f51632674..cb3fd98ac174d7fc83359cc0b4af29d1c73319d0 100755 (executable)
@@ -35,7 +35,8 @@ cat << EOF > doc/guide.xml
                specified for this class below.
        -->
        
-       <!-- name="class name" value="displayed text" path="path to helpfiles" 
+       <!--
+               <ENTRY NAME="class name" VALUE="displayed text" PATH="path to helpfiles" FILE="path to htmlfile" />
                 Leave blank to display message "There is no helpfile specified for this class."        
        -->
 <ENTRIES>