Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
Put back the possiblity to use dashboad authentication views/layouts …
Browse files Browse the repository at this point in the history
…if the active theme does not provide them.
  • Loading branch information
bkader committed Jun 17, 2018
1 parent 771dd51 commit 7956c23
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions skeleton/controllers/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,24 @@ public function __construct()
* @since 2.0.0
*/
$default_styles = array(
'font-awesome' => $this->theme->common_url('css/font-awesome.min.css'),
'bootstrap' => $this->theme->common_url('css/bootstrap.min.css'),
'admin' => $this->theme->common_url('css/admin.min.css'),
'fontawesome' => $this->theme->common_url('css/font-awesome.min.css'),
'bootstrap' => $this->theme->common_url('css/bootstrap.min.css'),
'admin' => $this->theme->common_url('css/admin.min.css'),
);

// RTL languages.
if ('rtl' === $this->lang->lang('direction'))
{
$default_styles['bootstrap'] = $this->theme->common_url('css/bootstrap-rtl.min.css');
$default_styles['admin-rtl'] = $this->theme->common_url('css/admin-rtl.min.css');
}

$login_styles = apply_filters('login_styles', array());
if (empty($login_styles) OR ! is_array($login_styles)) {
if (empty($login_styles) OR ! is_array($login_styles))
{
$login_styles = $default_styles;
} else {
}
else
{
$login_styles = array_merge($default_styles, $login_styles);
}
$this->theme->add('css', $login_styles);
Expand All @@ -144,9 +146,11 @@ public function __construct()
'admin' => $this->theme->common_url('js/admin.min.js'),
);
$login_scripts = apply_filters('login_scripts', array());
if (empty($login_scripts) OR ! is_array($login_scripts)) {
if (empty($login_scripts) OR ! is_array($login_scripts))
{
$login_scripts = $default_scripts;
} else {
} else
{
$login_scripts = array_merge($default_scripts, $login_scripts);
}
$this->theme->add('js', $login_scripts);
Expand All @@ -161,6 +165,18 @@ public function __construct()
$login_body_class .= ' '.$default_class;
}
$this->theme->body_class($login_body_class);

/**
* Fixed views and layouts if theme doesn't have theme.
* @since 2.1.5
*/
add_filter('theme_layouts_path', function($path) {
return KBPATH.'views/layouts';
});

add_filter('theme_views_path', function($path) {
return KBPATH.'views';
});
}
}

Expand Down

0 comments on commit 7956c23

Please sign in to comment.