From 6ba8f3f7deb4ef68fe2a89ae24dabcd1d32ad3f7 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 22 Jul 2013 18:30:45 -0400 Subject: [PATCH] Add custom links to dashboard --- inc/config.php | 12 ++++++++++++ templates/mod/dashboard.html | 30 +++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/inc/config.php b/inc/config.php index 721cff41..987777ef 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1089,6 +1089,18 @@ // Connection timeout, in seconds $config['purge_timeout'] = 3; + // Additional mod.php?/ pages (for developers). Look in inc/mod/pages.php for help. + //$config['mod']['custom_pages']['/something/(\d+)'] = function($id) { + // global $config; + // if (!hasPermission($config['mod']['something'])) + // error($config['error']['noaccess']); + // // ... + //}; + + // Add links to dashboard (will all be in "Other" category) + $config['mod']['dashboard_links'] = array(); + // $config['mod']['dashboard_links']['Something'] = '?/something'; + // Remote servers // http://tinyboard.org/wiki/index.php?title=Multiple_Servers //$config['remote']['static'] = array( diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html index 619663f5..5f6585fc 100644 --- a/templates/mod/dashboard.html +++ b/templates/mod/dashboard.html @@ -102,17 +102,29 @@ {% if mod|hasPermission(config.mod.search) %} -
- {% trans 'Search' %} - - -
+
+ {% trans 'Search' %} + + +
{% endif %} +{% if config.mod.dashboard_links|count %} +
+ {% trans 'Other' %} + + +
+{% endif %} + {% if config.debug %}
{% trans 'Debug' %}