add customMenuHTML

This commit is contained in:
tablatronix
2022-03-29 13:34:58 -05:00
parent 88b97c7caa
commit 6a85acdf85
4 changed files with 40 additions and 12 deletions
+17 -3
View File
@@ -1383,6 +1383,10 @@ String WiFiManager::getMenuOut(){
for(auto menuId :_menuIds ){
if((String)_menutokens[menuId] == "param" && _paramsCount == 0) continue; // no params set, omit params from menu, @todo this may be undesired by someone, use only menu to force?
if((String)_menutokens[menuId] == "custom" && _customMenuHTML!=NULL){
page += _customMenuHTML;
continue;
}
page += HTTP_PORTAL_MENU[menuId];
}
@@ -2733,12 +2737,22 @@ void WiFiManager::setPreOtaUpdateCallback( std::function<void()> func ) {
/**
* set custom head html
* custom element will be added to head, eg. new style tag etc.
* custom element will be added to head, eg. new meta,style,script tag etc.
* @access public
* @param char element
*/
void WiFiManager::setCustomHeadElement(const char* element) {
_customHeadElement = element;
void WiFiManager::setCustomHeadElement(const char* html) {
_customHeadElement = html;
}
/**
* set custom menu html
* custom element will be added to menu under custom menu item.
* @access public
* @param char element
*/
void WiFiManager::setCustomMenuHTML(const char* html) {
_customMenuHTML = html;
}
/**