Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Multiman

Pages: [1]
1
New Modules / Re: How to Build a new module for CentOS Web Panel (CWP)
« on: October 24, 2015, 07:00:40 AM »
Here is another easier way to add new menus.

create /usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php

Code: [Select]
<li>
<script type="text/javascript">
function add_custom_menu($icon_class,$menu_title,$sub_menu_items){
    $the_submenus = "";
    $.each($sub_menu_items,function(ind,itm){
    $the_submenus += "<li><a href='"+itm.link+"'><span class='icon16 icomoon-icon-arrow-right-3'></span>"+itm.link_title+"</a></li>";   
    });
    $(".mainnav > ul").append("<li><a href='#' onmousedown='javascript:return false;'><span class='icon16 "+$icon_class+"'></span>"+$menu_title+"<span class='hasDrop icon16 icomoon-icon-arrow-down-2'></span></a><ul class='sub'>"+$the_submenus+"</ul></li>");
}

//Add your menu items with the add_custom_menu function.

$(function(){
    add_custom_menu("icomoon-icon-hammer","MY NEW MENU 1",[{"link":"index.php?module=example","link_title":"TEST LINK 1"},{"link":"index.php?module=example","link_title":"TEST LINK 2"},{"link":"index.php?module=example","link_title":"TEST LINK 3"}]);
    add_custom_menu("icomoon-icon-hammer","MY NEW MENU 2",[{"link":"index.php?module=example","link_title":"TEST LINK 4"},{"link":"index.php?module=example","link_title":"TEST LINK 5"},{"link":"index.php?module=example","link_title":"TEST LINK 6"}]);

});
</script>
</li>


Him very nice thanks bro.

Pages: [1]