From f3ba69c1d67c425ffa180d082a373e5cce0c86ce Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 14 Jan 2009 04:12:02 +0000 Subject: Make sure that helper functions are all static. Add new File_Structure_Test to make sure we don't regress. According to the PHP docs, the "public" keyword is implied on static functions, so remove it. Also, require private static functions to start with an _. http://php.net/manual/en/language.oop5.visibility.php --- core/helpers/dashboard.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/helpers/dashboard.php') diff --git a/core/helpers/dashboard.php b/core/helpers/dashboard.php index 1c46b218..8e6f6aaa 100644 --- a/core/helpers/dashboard.php +++ b/core/helpers/dashboard.php @@ -18,24 +18,24 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class dashboard_Core { - public static function get_active() { + static function get_active() { return unserialize(module::get_var("core", "dashboard_blocks", "a:0:{}")); } - public static function add_block($location, $module_name, $block_id) { + static function add_block($location, $module_name, $block_id) { $blocks = self::get_active(); $blocks[$location][rand()] = array($module_name, $block_id); module::set_var("core", "dashboard_blocks", serialize($blocks)); } - public static function remove_block($location, $block_id) { + static function remove_block($location, $block_id) { $blocks = self::get_active(); unset($blocks[$location][$block_id]); unset($blocks[$location][$block_id]); module::set_var("core", "dashboard_blocks", serialize($blocks)); } - public static function get_available() { + static function get_available() { $blocks = array(); foreach (module::installed() as $module) { @@ -48,7 +48,7 @@ class dashboard_Core { return $blocks; } - public static function get_blocks($blocks) { + static function get_blocks($blocks) { $result = ""; foreach ($blocks as $id => $desc) { if (method_exists("$desc[0]_dashboard", "get_block")) { -- cgit v1.2.3