Check String in String and push content to end file
$menu_data = @file_get_contents('layouts/v7/modules/Vtiger/partials/SidebarAppMenu.tpl');
$txt = "\n <script type=\"text/javascript\"> jQuery(document).ready(function () { var app_menu = jQuery(\"#app-menu\"); var hrm_menu = app_menu.find(\"#HRM_modules_dropdownMenu\"); hrm_menu.attr('data-default-url','index.php?module=Employee&view=Index&app=HRM'); });</script>";
if(strpos($menu_data,$txt) === false){
$myfile = @file_put_contents('layouts/v7/modules/Vtiger/partials/SidebarAppMenu.tpl', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);
echo "Push ok !";
}
Comments
Post a Comment