The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding Folders to Permission Handler
#5
I think the quick way to do that would be to add this function to the us_helpers.php file

function getMoreFiles($location) {
$directory = "../$location";
$pages = glob($directory . "*.php");
foreach ($pages as $page){
$fixed = str_replace('../$location','',$page);
$row[$fixed] = $fixed;
}
return $row;
}

Then on your admin_pages file you would do something like...
$newFolder="myfolder"; //no beginning slash needed

then below that you would call...
$extraPages = getMoreFiles($newFolder);

Then it's just a matter of adding that $extraPages to the array.
$pages = array_merge($rootpages, $uspages,$extrapages);

I haven't tested it, but that makes sense off the top of my head.
  Reply


Messages In This Thread
Adding Folders to Permission Handler - by brian - 02-24-2016, 01:54 PM
Adding Folders to Permission Handler - by mudmin - 02-24-2016, 03:30 PM
Adding Folders to Permission Handler - by brian - 02-24-2016, 03:59 PM
Adding Folders to Permission Handler - by mudmin - 02-24-2016, 04:45 PM
Adding Folders to Permission Handler - by mudmin - 02-24-2016, 04:58 PM
Adding Folders to Permission Handler - by brian - 02-24-2016, 06:39 PM
Adding Folders to Permission Handler - by mudmin - 02-24-2016, 09:03 PM
Adding Folders to Permission Handler - by brian - 02-24-2016, 09:19 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)