Code

Updated the info Page
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Nov 2010 08:36:17 +0000 (08:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Nov 2010 08:36:17 +0000 (08:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20397 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/ihtml/themes/default/infoPage.tpl
gosa-core/include/class_pluglist.inc
gosa-core/include/class_tabs.inc
gosa-core/plugins/generic/infoPage/class_infoPage.inc

index 2954864368eefc9e6010bd63492f9eba4456370b..780e3d958c608b66f5426f84c69ed15610b68478 100644 (file)
             {/if}
         </tr>
     </table>
-                
 
 {/if}
 
+{if $plugins != ""}
 <hr>
-
-
 <h3>{t}Management shortcuts{/t}</h3>
+    {$plugins}
+    <div class="clear"></div>
+{/if}
 
-[aus gosa.conf, Ansicht wie im icon-Menu, max. 4 Icons nebeneinander]
-
-<hr>
-
-<h3>{t}If you need assistance with this interface, please contact your administrative contact{/t}:</h3>
-
-<pre>
-[liste von uids aus gosa.conf, die aufgelöst wird nach:]
- * Hugo Verwalter
-   Mail:  verwalter@where.com
-   Phone: 771
+{if $managersCnt != 0}
+    <hr>
+    <h3>{t}If you need assistance with this interface, please contact your administrative contact{/t}:</h3>
 
- * Gundula Ver-Walter
-   Mail:  gundula@where.com
-   Phone: 772
-</pre>
+    {foreach from=$managers item=item}
+        {$item.str}
+    {/foreach}
+{/if}
 <hr>
index 857e98a31e1a026b97b49934fa0369050c40ba1b..80d64680e96903f8e9f1fe35c7a5416c6d2c2242 100644 (file)
@@ -291,9 +291,9 @@ class pluglist
             // We do it in here to get the string translated.
             $this->menu .=  
                 "\n      <script language='javascript' type='text/javascript'>".
-                "\n        function openPlugin(id){".
+                "\n        function openPlugin(id, plugin){".
                 "\n          return question(\""._("You are currently editing a database entry. Do you want to discard the changes?")."\",".
-                "\n            \"main.php?plug=\" + id + \"&reset=1\");".
+                "\n            \"main.php?plug=\" + id + \"&reset=1&pluginTab=\" + plugin);".
                 "\n        }".
                 "\n      </script>\n"; 
         }
index da8dc9d76a1f9e4041f91cfc00b60ed4a43904d0..7affa029d2235b3763948b383256b3a35346f255 100644 (file)
@@ -84,6 +84,12 @@ class tabs
       $this->by_object[$tab['CLASS']]->parent= &$this;
       $this->by_object[$tab['CLASS']]->set_acl_category($this->acl_category);
     }
+
+    // Try to set the current tab to the posted value
+    if(isset($_GET['pluginTab'])){
+        $tab = $_GET['pluginTab'];
+        if(isset($this->by_name[$tab])) $this->current = $tab;
+    } 
   }
 
  
index f33c657ad673d050970c457f717f9a5bfe26687e..146dd553cc05b5e0ef10164a88e04bbe4d48aa2c 100644 (file)
@@ -14,7 +14,29 @@ class infoPage extends plugin
 
         // Detect managers for the current user.
         $this->managers = $this->detectManagers();
+
+        // Get plugin list
+        $this->plugins = $this->getPluginList();
+    }
+
+    function getPluginList()
+    {
+        $plist = session::get('plist');
+        $myAccountID = array_search('MyAccount',$plist->pluginList);
+        $str = "";
+        foreach($this->config->data['TABS']['MYACCOUNTTABS'] as $pluginData){
+            $plugin = $pluginData['CLASS'];
+            $plInfo = call_user_func(array($plugin,'plInfo'));
+
+
+            $str .= "<div style='width:20%;height:40px; background-color: grey; float: left'
+                        onClick='openPlugin(\"{$myAccountID}\", \"{$plugin}\");'>";
+            $str .= $plugin;
+            $str .= "</div>";
+        }
+        return($str);
     }
+    
 
     function detectManagers()
     {
@@ -53,6 +75,7 @@ class infoPage extends plugin
 
     function execute()
     {
+        $this->plugins = $this->getPluginList();
         $smarty = get_smarty();
         $personalInfoAllowed = FALSE;
         foreach(array("uid","sn","givenName","street","l","o","ou","jpegPhoto","personalTitle",
@@ -72,6 +95,7 @@ class infoPage extends plugin
         $smarty->assign("personalInfoAllowed", $personalInfoAllowed);
         $smarty->assign("attrs", $this->attrs);
         $smarty->assign("managers", $this->managers);
+        $smarty->assign("plugins", $this->plugins);
         $smarty->assign("managersCnt", count($this->managers));
         return($smarty->fetch(get_template_path("infoPage.tpl")));
     }