public static function GetDashletCreationForm($sOQL = null)
 {
     $oForm = new DesignerForm();
     // Get the list of all 'dashboard' menus in which we can insert a dashlet
     $aAllMenus = ApplicationMenu::ReflectionMenuNodes();
     $aAllowedDashboards = array();
     foreach ($aAllMenus as $idx => $aMenu) {
         $oMenu = $aMenu['node'];
         $sParentId = $aMenu['parent'];
         if ($oMenu instanceof DashboardMenuNode) {
             $sMenuLabel = $oMenu->GetTitle();
             $sParentLabel = Dict::S('Menu:' . $sParentId);
             if ($sParentLabel != $sMenuLabel) {
                 $aAllowedDashboards[$oMenu->GetMenuId()] = $sParentLabel . ' - ' . $sMenuLabel;
             } else {
                 $aAllowedDashboards[$oMenu->GetMenuId()] = $sMenuLabel;
             }
         }
     }
     asort($aAllowedDashboards);
     $aKeys = array_keys($aAllowedDashboards);
     // Select the first one by default
     $sDefaultDashboard = $aKeys[0];
     $oField = new DesignerComboField('menu_id', Dict::S('UI:DashletCreation:Dashboard'), $sDefaultDashboard);
     $oField->SetAllowedValues($aAllowedDashboards);
     $oField->SetMandatory(true);
     $oForm->AddField($oField);
     // Get the list of possible dashlets that support a creation from
     // an OQL
     $aDashlets = array();
     foreach (get_declared_classes() as $sDashletClass) {
         if (is_subclass_of($sDashletClass, 'Dashlet')) {
             $oReflection = new ReflectionClass($sDashletClass);
             if (!$oReflection->isAbstract()) {
                 $aCallSpec = array($sDashletClass, 'CanCreateFromOQL');
                 $bShorcutMode = call_user_func($aCallSpec);
                 if ($bShorcutMode) {
                     $aCallSpec = array($sDashletClass, 'GetInfo');
                     $aInfo = call_user_func($aCallSpec);
                     $aDashlets[$sDashletClass] = array('label' => $aInfo['label'], 'class' => $sDashletClass, 'icon' => $aInfo['icon']);
                 }
             }
         }
     }
     $oSelectorField = new DesignerFormSelectorField('dashlet_class', Dict::S('UI:DashletCreation:DashletType'), '');
     $oForm->AddField($oSelectorField);
     foreach ($aDashlets as $sDashletClass => $aDashletInfo) {
         $oSubForm = new DesignerForm();
         $oMetaModel = new ModelReflectionRuntime();
         $oDashlet = new $sDashletClass($oMetaModel, 0);
         $oDashlet->GetPropertiesFieldsFromOQL($oSubForm, $sOQL);
         $oSelectorField->AddSubForm($oSubForm, $aDashletInfo['label'], $aDashletInfo['class']);
     }
     $oField = new DesignerBooleanField('open_editor', Dict::S('UI:DashletCreation:EditNow'), true);
     $oForm->AddField($oField);
     return $oForm;
 }