This repository has been archived by the owner on Mar 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from GrahamCampbell/psr-2
PSR-2 Coding Style
- Loading branch information
Showing
10 changed files
with
159 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
"providers": [ | ||
"Kmd\Logviewer\LogviewerServiceProvider" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,53 @@ | ||
<?php namespace Kmd\Logviewer; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class LogviewerServiceProvider extends ServiceProvider { | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @access protected | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @access public | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$this->package('kmd/logviewer'); | ||
|
||
include __DIR__ . '/../../routes.php'; | ||
include __DIR__ . '/../../filters.php'; | ||
include __DIR__ . '/../../macros.php'; | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @access public | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app['logviewer'] = $this->app->share(function($app) | ||
{ | ||
return new Logviewer; | ||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @access public | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return array('logviewer'); | ||
} | ||
|
||
} | ||
<?php namespace Kmd\Logviewer; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class LogviewerServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @access protected | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @access public | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$this->package('kmd/logviewer'); | ||
|
||
include __DIR__.'/../../routes.php'; | ||
include __DIR__.'/../../filters.php'; | ||
include __DIR__.'/../../macros.php'; | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @access public | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app['logviewer'] = $this->app->share(function ($app) { | ||
return new Logviewer; | ||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @access public | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return array('logviewer'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?php | ||
|
||
return array( | ||
|
||
'base_url' => 'logviewer', | ||
'filters' => array( | ||
'global' => array(), | ||
'view' => array(), | ||
'delete' => array(), | ||
'delete' => array() | ||
), | ||
'log_dirs' => array('app' => storage_path().'/logs'), | ||
'log_order' => 'asc', // Change to 'desc' for the latest entries first | ||
'per_page' => 10, | ||
'view' => 'logviewer::viewer', | ||
'p_view' => 'pagination::slider', | ||
'p_view' => 'pagination::slider' | ||
|
||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
<?php | ||
|
||
// Inspired by: http://forums.laravel.io/viewtopic.php?id=827 | ||
HTML::macro('nav_item', function($url, $text, $a_attr = array(), $active_class = 'active', $li_attrs = array()) | ||
{ | ||
HTML::macro('nav_item', function ($url, $text, $a_attr = array(), $active_class = 'active', $li_attrs = array()) { | ||
$href = HTML::link($url, $text, $a_attr); | ||
$response = ''; | ||
|
||
if( Request::is($url) || Request::is($url . '/*') ) | ||
{ | ||
if (isset($li_attrs['class'])) | ||
{ | ||
$li_attrs['class'] .= ' ' . $active_class; | ||
} | ||
else | ||
{ | ||
|
||
if (Request::is($url) || Request::is($url.'/*')) { | ||
if (isset($li_attrs['class'])) { | ||
$li_attrs['class'] .= ' '.$active_class; | ||
} else { | ||
$li_attrs['class'] = $active_class; | ||
} | ||
} | ||
return '<li ' . HTML::attributes($li_attrs) . '>' . $href . '</li>'; | ||
|
||
return '<li '.HTML::attributes($li_attrs).'>'.$href.'</li>'; | ||
}); |
Oops, something went wrong.