r20160214

This commit is contained in:
flash 2016-02-14 23:46:07 +01:00
parent 9b135ba9b6
commit ee0fa1906c
9 changed files with 32 additions and 33 deletions

View file

@ -17,7 +17,7 @@ use Sakura\Template;
*/
class Auth
{
public static function login()
public function login()
{
return Template::render('main/login');
}

View file

@ -29,7 +29,7 @@ class Forums
*
* @return mixed HTML for the forum index.
*/
public static function index()
public function index()
{
// Merge index specific stuff with the global render data
Template::vars([
@ -51,7 +51,7 @@ class Forums
return Template::render('forum/index');
}
public static function forum($id = 0)
public function forum($id = 0)
{
global $currentUser;

View file

@ -28,7 +28,7 @@ class Meta
*
* @return mixed HTML for the index.
*/
public static function index()
public function index()
{
// Merge index specific stuff with the global render data
Template::vars([
@ -56,7 +56,7 @@ class Meta
*
* @return mixed HTML for the correct news section.
*/
public static function news()
public function news()
{
// Get arguments
$args = func_get_args();
@ -85,7 +85,7 @@ class Meta
*
* @return mixed HTML for the FAQ.
*/
public static function faq()
public function faq()
{
// Set parse variables
Template::vars([
@ -106,7 +106,7 @@ class Meta
*
* @return mixed HTML for the info page.
*/
public static function infoPage($id = null)
public function infoPage($id = null)
{
// Set default variables
$renderData['page'] = [
@ -138,7 +138,7 @@ class Meta
*
* @return mixed HTML for the search page.
*/
public static function search()
public function search()
{
// Set parse variables
Template::vars([

View file

@ -25,7 +25,7 @@ use Sakura\Perms\Site;
*/
class Premium
{
public static function index()
public function index()
{
global $currentUser, $urls;
@ -155,7 +155,7 @@ class Premium
return Template::render('main/support');
}
public static function tracker()
public function tracker()
{
// Set parse variables
Template::vars([

View file

@ -29,7 +29,7 @@ class User
*
* @return bool|string The profile page.
*/
public static function profile($id = 0)
public function profile($id = 0)
{
global $currentUser;
@ -93,7 +93,7 @@ class User
*
* @return bool|string The memberlist.
*/
public static function members($rank = 0)
public function members($rank = 0)
{
global $currentUser;
@ -106,8 +106,8 @@ class User
Template::vars([
'memberlist' => [
'ranks' => ($_MEMBERLIST_RANKS = \Sakura\Users::getAllRanks()),
'active' => ($_MEMBERLIST_ACTIVE = (array_key_exists($rank, $_MEMBERLIST_RANKS) ? $rank : 0)),
'users' => ($_MEMBERLIST_ACTIVE ? Rank::construct($_MEMBERLIST_ACTIVE)->users() : \Sakura\Users::getAllUsers(false)),
'active' => ($_MEMBERLIST_ACTIVE = (array_key_exists($rank, $_MEMBERLIST_RANKS) ? $rank : 2)),
'users' => Rank::construct($_MEMBERLIST_ACTIVE)->users(),
'membersPerPage' => Config::get('members_per_page'),
]
]);

View file

@ -67,7 +67,7 @@ class Router
// Check if the method exists
if (in_array($name = strtoupper($name), self::$methods)) {
$path = isset($args[2]) && $args !== null ? [$args[0], $args[2]] : $args[0];
$handler = is_callable($args[1]) || is_array($args[1]) ? $args[1] : explode('@', $args[1]);
$handler = is_callable($args[1]) || is_array($args[1]) ? $args[1] : explode('@', ('Sakura\Controllers\\' . $args[1]));
$filter = isset($args[3]) ? $args[3] : [];
self::$router->addRoute($name, $path, $handler, $filter);

View file

@ -7,33 +7,33 @@
namespace Sakura;
// Meta pages
Router::get('/', 'Sakura\Controllers\Meta@index', 'main.index');
Router::get('/faq', 'Sakura\Controllers\Meta@faq', 'main.faq');
Router::get('/search', 'Sakura\Controllers\Meta@search', 'main.search');
Router::get('/p/{id}', 'Sakura\Controllers\Meta@infoPage', 'main.infopage');
Router::get('/', 'Meta@index', 'main.index');
Router::get('/faq', 'Meta@faq', 'main.faq');
Router::get('/search', 'Meta@search', 'main.search');
Router::get('/p/{id}', 'Meta@infoPage', 'main.infopage');
// Auth
Router::get('/login', 'Sakura\Controllers\Auth@login', 'auth.login');
Router::get('/login', 'Auth@login', 'auth.login');
// News
Router::get('/news', 'Sakura\Controllers\Meta@news', 'news.index');
Router::get('/news/{category}', 'Sakura\Controllers\Meta@news', 'news.category');
Router::get('/news/{category}/{id}', 'Sakura\Controllers\Meta@news', 'news.post');
Router::get('/news', 'Meta@news', 'news.index');
Router::get('/news/{category}', 'Meta@news', 'news.category');
Router::get('/news/{category}/{id}', 'Meta@news', 'news.post');
// Forum
Router::get('/forum', 'Sakura\Controllers\Forums@index', 'forums.index');
Router::get('/forum/{id}', 'Sakura\Controllers\Forums@forum', 'forums.forum');
Router::get('/forum', 'Forums@index', 'forums.index');
Router::get('/forum/{id}', 'Forums@forum', 'forums.forum');
// Members
Router::get('/members', 'Sakura\Controllers\User@members', 'members.all');
Router::get('/members/{rank}', 'Sakura\Controllers\User@members', 'members.rank');
Router::get('/members', 'User@members', 'members.all');
Router::get('/members/{rank}', 'User@members', 'members.rank');
// User
Router::get('/u/{id}', 'Sakura\Controllers\User@profile', 'user.profile');
Router::get('/u/{id}', 'User@profile', 'user.profile');
// Premium
Router::get('/support', 'Sakura\Controllers\Premium@index', 'premium.index');
Router::get('/support/tracker', 'Sakura\Controllers\Premium@tracker', 'premium.tracker');
Router::get('/support', 'Premium@index', 'premium.index');
Router::get('/support/tracker', 'Premium@tracker', 'premium.tracker');
// Redirections
Router::any('/index.php', function () {

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20160213');
define('SAKURA_VERSION', '20160214');
define('SAKURA_VLABEL', 'Amethyst');
define('SAKURA_COLOUR', '#9966CC');

View file

@ -31,10 +31,9 @@
<div class="dropDown" style="margin: 0 auto; font-size: 1.5em; line-height: 1.5em; height: 30px;">
<div class="dropDownInner" style="float: left; color: #FFF;">
<a class="dropDownDesc">Rank:</a>
<a href="{% if sort %}{{ urls.format('MEMBERLIST_SORT', [sort]) }}{% else %}{{ urls.format('MEMBERLIST_INDEX') }}{% endif %}"{% if not memberlist.active %} class="dropDownSelected"{% endif %}>All members</a>
{% for rank in memberlist.ranks %}
{% if not rank.hidden or (rank.hidden and memberlist.active == rank.id) %}
<a href="{% if sort %}{{ urls.format('MEMBERLIST_ALL', [sort, rank.id]) }}{% else %}{{ urls.format('MEMBERLIST_RANK', [rank.id]) }}{% endif %}" style="color: {{ rank.colour }};"{% if memberlist.active == rank.id %} class="dropDownSelected"{% endif %}>{{ rank.name(true) }}</a>
<a href="{{ urls.format('MEMBERLIST_RANK', [rank.id]) }}" style="color: {{ rank.colour }};"{% if memberlist.active == rank.id %} class="dropDownSelected"{% endif %}>{{ rank.name(true) }}</a>
{% endif %}
{% endfor %}
</div>