mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 03:07:30 -04:00 
			
		
		
		
	* Update phpunit.yml * Update phpunit.yml * Update .env.ci * Update phpunit.yml * Update .env.ci * Update phpunit.yml * Update phpunit.yml * Update phpunit.yml * Update phpunit.yml * Update .env.ci * Update phpunit.yml * Update phpunit.yml * Update phpunit.yml * Update phpunit.yml * Force /setup if system requirements are not met * Update .env.ci * Update phpunit.yml * Minor changes for github actions" * Fixes for github actions * Fixes for github actions * Fixes for github actions * Fixes for github actions * Fixes for github actions * Fixes for github actions * Fixes for github actions * Fixes for github actions * cs-fixer * cs-fixer * Fixes for github actions * db ports github actions * Refactor the template engine
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| /**
 | |
|  * Invoice Ninja (https://invoiceninja.com)
 | |
|  *
 | |
|  * @link https://github.com/invoiceninja/invoiceninja source repository
 | |
|  *
 | |
|  * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | |
|  *
 | |
|  * @license https://opensource.org/licenses/AAL
 | |
|  */
 | |
| 
 | |
| /**
 | |
|  * Check if passed page is currently active.
 | |
|  *
 | |
|  * @param $page
 | |
|  * @param bool $boolean
 | |
|  * @return bool
 | |
|  */
 | |
| function isActive($page, bool $boolean = false)
 | |
| {
 | |
|     $current_page = Route::currentRouteName();
 | |
| 
 | |
|     if ($page == $current_page && $boolean) {
 | |
|         return true;
 | |
|     }
 | |
| 
 | |
|     if ($page == $current_page) {
 | |
|         return 'active-page';
 | |
|     }
 | |
| 
 | |
|     return false;
 | |
| }
 | |
| 
 | |
| /**
 | |
|  * New render method that works with themes.
 | |
|  *
 | |
|  * @param string $path
 | |
|  * @param array $options
 | |
|  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
 | |
|  */
 | |
| function render(string $path, array $options = [])
 | |
| {
 | |
|     $theme = array_key_exists('theme', $options) ? $options['theme'] : 'ninja2020';
 | |
| 
 | |
|     if (array_key_exists('root', $options)) {
 | |
|         return view(
 | |
|             sprintf('%s.%s.%s', $options['root'], $theme, $path),
 | |
|             $options
 | |
|         );
 | |
|     }
 | |
| 
 | |
|     return view("portal.$theme.$path", $options);
 | |
| }
 |