From a8ac9c50d70491fa0a202a438d36f1579cad0cda Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 21 Sep 2017 20:21:33 -0500 Subject: [PATCH] Update: Use PHP namespaces This enables the use of PHP namespaces. The namespaces must be prefixed with 'n_'. The parent namespace for koopa is 'n_koopa'. I intend to only use a single depth namespace of n_koopa to keep it simple. All other names remain unchanged. This introduces a few problems/caveats: 1) Functions being stored as strings to be called dynamically now need to have '/n_koopa/' in front of them. 2) The standard index file in implementing projects, such as reservations, must still use namespace 'n_koopa' even if their project is different. - This is because the base classes will call the c_base_defaults_global class. - All other implementing project files can have their own namespace. 3) Core PHP classes very likely need to have '\' prefixed to them (will update as I encounter them). This introduced new resolutions: 1) Using namespaces revealed a bug in my code where a class function get_roles() is called on an object that may potentially be a c_base_return_false object. - I have to review the code and confirm whether or not the code should always be returning the appropriate class or allow other returns. - For now, I am just adding a quick instance check. --- common/base/classes/base_access.php | 1 + common/base/classes/base_address.php | 2 + common/base/classes/base_ajax.php | 2 + common/base/classes/base_array.php | 2 + common/base/classes/base_ascii.php | 2 + common/base/classes/base_charset.php | 1 + common/base/classes/base_cml.php | 1 + common/base/classes/base_cookie.php | 2 + common/base/classes/base_database.php | 2 + common/base/classes/base_debug.php | 2 + common/base/classes/base_defaults_global.php | 13 +-- common/base/classes/base_email.php | 2 + common/base/classes/base_error.php | 1 + .../base/classes/base_error_messages_english.php | 2 + .../base/classes/base_error_messages_japanese.php | 2 + common/base/classes/base_file.php | 2 + common/base/classes/base_form.php | 2 + common/base/classes/base_html.php | 2 + common/base/classes/base_http.php | 2 + common/base/classes/base_http_status.php | 2 + common/base/classes/base_languages.php | 2 + common/base/classes/base_ldap.php | 2 + common/base/classes/base_log.php | 2 + common/base/classes/base_markup.php | 2 + common/base/classes/base_menu.php | 2 + common/base/classes/base_mime.php | 2 + common/base/classes/base_path.php | 2 + common/base/classes/base_paths.php | 2 + common/base/classes/base_return.php | 2 + common/base/classes/base_rfc_char.php | 2 + common/base/classes/base_rfc_string.php | 2 + common/base/classes/base_roles.php | 2 + common/base/classes/base_session.php | 2 + common/base/classes/base_users.php | 2 + common/base/classes/base_utf8.php | 2 + common/base/classes/base_view.php | 2 + common/base/classes/base_warning.php | 2 + common/standard/classes/standard_database.php | 2 + common/standard/classes/standard_index.php | 2 + common/standard/classes/standard_menu.php | 2 + common/standard/classes/standard_path.php | 12 +-- .../standard/classes/standard_path_exception.php | 2 + common/standard/classes/standard_path_user.php | 1 + common/standard/classes/standard_paths.php | 96 +++++++++++----------- common/standard/classes/standard_users.php | 2 + common/standard/internal/access_denied.php | 1 + common/standard/internal/bad_method.php | 1 + common/standard/internal/index.php | 1 + common/standard/internal/ja/access_denied.php | 1 + common/standard/internal/ja/bad_method.php | 1 + common/standard/internal/ja/index.php | 1 + common/standard/internal/ja/not_found.php | 1 + common/standard/internal/ja/server_error.php | 1 + common/standard/internal/not_found.php | 1 + common/standard/internal/options.php | 1 + common/standard/internal/server_error.php | 1 + common/standard/menus/ja/menu_breadcrumbs.php | 2 + common/standard/menus/ja/menu_content.php | 2 + .../standard/menus/ja/menu_content_user_view.php | 2 + common/standard/menus/ja/menu_footer.php | 2 + common/standard/menus/ja/menu_header.php | 2 + common/standard/menus/ja/menu_utility.php | 2 + common/standard/menus/menu_breadcrumbs.php | 2 + common/standard/menus/menu_content.php | 2 + common/standard/menus/menu_content_user_view.php | 10 ++- common/standard/menus/menu_footer.php | 2 + common/standard/menus/menu_header.php | 2 + common/standard/menus/menu_utility.php | 9 +- common/standard/paths/a/administer_content.php | 3 +- common/standard/paths/a/administer_dashboard.php | 1 + common/standard/paths/a/administer_logs.php | 3 +- common/standard/paths/a/ja/administer_content.php | 1 + .../standard/paths/a/ja/administer_dashboard.php | 1 + common/standard/paths/a/ja/administer_logs.php | 1 + common/standard/paths/c/cache_error.php | 1 + common/standard/paths/c/cache_static.php | 1 + common/standard/paths/c/ja/cache_error.php | 1 + common/standard/paths/c/ja/cache_static.php | 1 + common/standard/paths/f/file_by_checksum.php | 1 + common/standard/paths/f/file_by_id.php | 1 + .../standard/paths/f/file_checksum_by_checksum.php | 1 + common/standard/paths/f/file_checksum_by_id.php | 1 + common/standard/paths/f/ja/file_by_checksum.php | 1 + common/standard/paths/f/ja/file_by_id.php | 1 + .../paths/f/ja/file_checksum_by_checksum.php | 1 + common/standard/paths/f/ja/file_checksum_by_id.php | 1 + common/standard/paths/m/ja/management_content.php | 1 + .../standard/paths/m/ja/management_dashboard.php | 1 + common/standard/paths/m/ja/management_logs.php | 1 + common/standard/paths/m/management_content.php | 3 +- common/standard/paths/m/management_dashboard.php | 1 + common/standard/paths/m/management_logs.php | 3 +- common/standard/paths/s/ja/submit_form_id.php | 1 + common/standard/paths/s/submit_form_id.php | 1 + common/standard/paths/u/ja/user_check.php | 1 + common/standard/paths/u/ja/user_dashboard.php | 1 + common/standard/paths/u/ja/user_delete.php | 1 + common/standard/paths/u/ja/user_edit.php | 1 + common/standard/paths/u/ja/user_lock.php | 1 + common/standard/paths/u/ja/user_login.php | 2 +- common/standard/paths/u/ja/user_logout.php | 2 +- common/standard/paths/u/ja/user_refresh.php | 1 + common/standard/paths/u/ja/user_session.php | 1 + common/standard/paths/u/ja/user_settings.php | 1 + common/standard/paths/u/ja/user_unlock.php | 1 + common/standard/paths/u/ja/user_view.php | 1 + common/standard/paths/u/user_check.php | 3 +- common/standard/paths/u/user_create.php | 1 + common/standard/paths/u/user_dashboard.php | 8 +- common/standard/paths/u/user_delete.php | 3 +- common/standard/paths/u/user_edit.php | 3 +- common/standard/paths/u/user_lock.php | 3 +- common/standard/paths/u/user_login.php | 1 + common/standard/paths/u/user_logout.php | 1 + common/standard/paths/u/user_refresh.php | 3 +- common/standard/paths/u/user_session.php | 1 + common/standard/paths/u/user_settings.php | 3 +- common/standard/paths/u/user_unlock.php | 3 +- common/standard/paths/u/user_view.php | 3 +- common/theme/classes/theme_dom.php | 1 + common/theme/classes/theme_form.php | 1 + common/theme/classes/theme_html.php | 1 + common/theme/classes/theme_markup.php | 1 + common/view/classes/view_log_users_self.php | 2 + documentation/naming.txt | 1 + examples/test.php | 8 +- program/reservation/index.php | 5 +- .../reservation/reservation_defaults_global.php | 15 ++-- 128 files changed, 283 insertions(+), 86 deletions(-) diff --git a/common/base/classes/base_access.php b/common/base/classes/base_access.php index ef47c10..0676856 100644 --- a/common/base/classes/base_access.php +++ b/common/base/classes/base_access.php @@ -3,6 +3,7 @@ * @file * Provides a class for managing system access. */ +namespace n_koopa; // include required files. require_once('common/base/classes/base_error.php'); diff --git a/common/base/classes/base_address.php b/common/base/classes/base_address.php index 291fea3..b856419 100644 --- a/common/base/classes/base_address.php +++ b/common/base/classes/base_address.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing addresses. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_ajax.php b/common/base/classes/base_ajax.php index 0aecb97..0acf835 100644 --- a/common/base/classes/base_ajax.php +++ b/common/base/classes/base_ajax.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing AJAX responses. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_array.php'); diff --git a/common/base/classes/base_array.php b/common/base/classes/base_array.php index dfbd8a8..645cc27 100644 --- a/common/base/classes/base_array.php +++ b/common/base/classes/base_array.php @@ -8,6 +8,8 @@ * - Only the return values of the core c_base_return_* functions return direct/raw values. * - All other functions are expected to return some class or sub-class of c_base_return. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_rfc_string.php'); diff --git a/common/base/classes/base_ascii.php b/common/base/classes/base_ascii.php index e926520..a6cf3a9 100644 --- a/common/base/classes/base_ascii.php +++ b/common/base/classes/base_ascii.php @@ -4,6 +4,8 @@ * Provides a class for managing ASCII. */ +namespace n_koopa; + /** * A class for managing ASCII. */ diff --git a/common/base/classes/base_charset.php b/common/base/classes/base_charset.php index 256130f..767752c 100644 --- a/common/base/classes/base_charset.php +++ b/common/base/classes/base_charset.php @@ -3,6 +3,7 @@ * @file * Provides a class for managing common charsets. */ +namespace n_koopa; /** * A class for managing common rfc character sets. diff --git a/common/base/classes/base_cml.php b/common/base/classes/base_cml.php index c3e9c7b..671daef 100644 --- a/common/base/classes/base_cml.php +++ b/common/base/classes/base_cml.php @@ -10,3 +10,4 @@ * * @see: https://www.w3.org/TR/html5/ */ +namespace n_koopa; diff --git a/common/base/classes/base_cookie.php b/common/base/classes/base_cookie.php index 4d73389..bf00194 100644 --- a/common/base/classes/base_cookie.php +++ b/common/base/classes/base_cookie.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing cookies. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_database.php b/common/base/classes/base_database.php index 45a65d5..b7c83ca 100644 --- a/common/base/classes/base_database.php +++ b/common/base/classes/base_database.php @@ -29,6 +29,8 @@ * * @see: http://php.net/manual/en/features.persistent-connections.php */ +namespace n_koopa; + require_once('common/base/classes/base_warning.php'); require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_debug.php b/common/base/classes/base_debug.php index a29e990..692ae32 100644 --- a/common/base/classes/base_debug.php +++ b/common/base/classes/base_debug.php @@ -3,6 +3,8 @@ * @file * Provides a class for performing debugging. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_defaults_global.php b/common/base/classes/base_defaults_global.php index 54b75ef..a4c693f 100644 --- a/common/base/classes/base_defaults_global.php +++ b/common/base/classes/base_defaults_global.php @@ -14,6 +14,7 @@ * * It is recommended to set PHP precision setting to at least 16 for microtime values. */ +namespace n_koopa; /** @@ -173,7 +174,7 @@ class c_base_defaults_global { $now = self::s_get_timestamp_session()->get_value_exact(); $microseconds = (int) (($now - ((int) $now)) * 1000000); - $date = new DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now)); + $date = new \DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now)); unset($now); } else { @@ -184,18 +185,18 @@ class c_base_defaults_global { $microseconds = 0; } - $date = new DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp)); + $date = new \DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp)); } unset($microseconds); - if (!($date instanceof DateTime)) { + if (!($date instanceof \DateTime)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_null(self::$s_timezone)) { date_default_timezone_set(self::$s_timezone); - $date->setTimeZone(new DateTimeZone(self::$s_timezone)); + $date->setTimeZone(new \DateTimeZone(self::$s_timezone)); } $formatted = $date->format($string); @@ -235,9 +236,9 @@ class c_base_defaults_global { } // To ensure support for microseconds (and milliseconds), datetime must be initialized woth microseconds. - $date = DateTime::createFromFormat($format, $string); + $date = \DateTime::createFromFormat($format, $string); - if (!($date instanceof DateTime)) { + if (!($date instanceof \DateTime)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } diff --git a/common/base/classes/base_email.php b/common/base/classes/base_email.php index 6f22816..27b3cd6 100644 --- a/common/base/classes/base_email.php +++ b/common/base/classes/base_email.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing e-mail related functionality. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_ascii.php'); diff --git a/common/base/classes/base_error.php b/common/base/classes/base_error.php index e00dc4c..e756ff1 100644 --- a/common/base/classes/base_error.php +++ b/common/base/classes/base_error.php @@ -3,6 +3,7 @@ * @file * Provides a class for managing return values. */ +namespace n_koopa; /** * A generic class for managing errors. diff --git a/common/base/classes/base_error_messages_english.php b/common/base/classes/base_error_messages_english.php index 17a7a6d..33fd090 100644 --- a/common/base/classes/base_error_messages_english.php +++ b/common/base/classes/base_error_messages_english.php @@ -3,6 +3,8 @@ * @file * Implements english language support for common error messages. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_languages.php'); diff --git a/common/base/classes/base_error_messages_japanese.php b/common/base/classes/base_error_messages_japanese.php index 933a45e..db9403e 100644 --- a/common/base/classes/base_error_messages_japanese.php +++ b/common/base/classes/base_error_messages_japanese.php @@ -8,6 +8,8 @@ * I have also noticed that the presence of a period '.' at the end of the string changes translation. * This may require a completely different approach to generating than what works with english. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_languages.php'); diff --git a/common/base/classes/base_file.php b/common/base/classes/base_file.php index e72e24f..72e46da 100644 --- a/common/base/classes/base_file.php +++ b/common/base/classes/base_file.php @@ -5,6 +5,8 @@ * * This is primarily intended to be used to store file data (of any format) prior to theme output. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_mime.php'); diff --git a/common/base/classes/base_form.php b/common/base/classes/base_form.php index d305ef9..95ed2f4 100644 --- a/common/base/classes/base_form.php +++ b/common/base/classes/base_form.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing forms. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_html.php b/common/base/classes/base_html.php index cdb883b..95fe604 100644 --- a/common/base/classes/base_html.php +++ b/common/base/classes/base_html.php @@ -7,6 +7,8 @@ * * @see: https://www.w3.org/TR/html5/ */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_markup.php'); diff --git a/common/base/classes/base_http.php b/common/base/classes/base_http.php index aabcd9f..381a052 100644 --- a/common/base/classes/base_http.php +++ b/common/base/classes/base_http.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the HTTP protocol. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_charset.php'); diff --git a/common/base/classes/base_http_status.php b/common/base/classes/base_http_status.php index 5432d13..6dbafcc 100644 --- a/common/base/classes/base_http_status.php +++ b/common/base/classes/base_http_status.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the HTTP protocol status codes. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_languages.php b/common/base/classes/base_languages.php index ee2ffb1..d0b8ace 100644 --- a/common/base/classes/base_languages.php +++ b/common/base/classes/base_languages.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the different supported languages. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_ldap.php b/common/base/classes/base_ldap.php index 55462c8..d3f33d5 100644 --- a/common/base/classes/base_ldap.php +++ b/common/base/classes/base_ldap.php @@ -5,6 +5,8 @@ * * This is initially designed just to select/read from the ldap and not meant to modify or manage ldap databases. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_log.php b/common/base/classes/base_log.php index 6a783f3..f4bc986 100644 --- a/common/base/classes/base_log.php +++ b/common/base/classes/base_log.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the logs. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_markup.php b/common/base/classes/base_markup.php index ae3510b..93b4e42 100644 --- a/common/base/classes/base_markup.php +++ b/common/base/classes/base_markup.php @@ -3,6 +3,8 @@ * @file * Provides a class for html markup. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_mime.php'); diff --git a/common/base/classes/base_menu.php b/common/base/classes/base_menu.php index 099c3ac..9e3a183 100644 --- a/common/base/classes/base_menu.php +++ b/common/base/classes/base_menu.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the menus. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_rfc_string.php'); diff --git a/common/base/classes/base_mime.php b/common/base/classes/base_mime.php index 1c02547..8de2e4c 100644 --- a/common/base/classes/base_mime.php +++ b/common/base/classes/base_mime.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing mime-type information. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_path.php b/common/base/classes/base_path.php index a9cb781..fa4c708 100644 --- a/common/base/classes/base_path.php +++ b/common/base/classes/base_path.php @@ -15,6 +15,8 @@ * Then, for very specific cases, users should then be granted the ability to create path aliases. * However, aliases should not be able to override pre-define paths or the performance gains are lost by requiring loading of the aliases before each static path. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_utf8.php'); diff --git a/common/base/classes/base_paths.php b/common/base/classes/base_paths.php index 80b930b..657849f 100644 --- a/common/base/classes/base_paths.php +++ b/common/base/classes/base_paths.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing hard coded and dynamic paths. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_http.php'); diff --git a/common/base/classes/base_return.php b/common/base/classes/base_return.php index 70554b5..d39965a 100644 --- a/common/base/classes/base_return.php +++ b/common/base/classes/base_return.php @@ -17,6 +17,8 @@ * Functions defined in this class will return the normal TRUE/FALSE and not the class-based TRUE/FALSE as an exception to this rule. * - This is done because this class defines those objects. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); /** diff --git a/common/base/classes/base_rfc_char.php b/common/base/classes/base_rfc_char.php index df672db..bc62980 100644 --- a/common/base/classes/base_rfc_char.php +++ b/common/base/classes/base_rfc_char.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing common rfc character testing cases. */ +namespace n_koopa; + require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_ascii.php'); require_once('common/base/classes/base_utf8.php'); diff --git a/common/base/classes/base_rfc_string.php b/common/base/classes/base_rfc_string.php index 5333f1f..6472b31 100644 --- a/common/base/classes/base_rfc_string.php +++ b/common/base/classes/base_rfc_string.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing common rfc string testing cases. */ +namespace n_koopa; + require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_ascii.php'); require_once('common/base/classes/base_utf8.php'); diff --git a/common/base/classes/base_roles.php b/common/base/classes/base_roles.php index 9dde111..fa08d48 100644 --- a/common/base/classes/base_roles.php +++ b/common/base/classes/base_roles.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing system roles. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_session.php b/common/base/classes/base_session.php index 66d151b..5677cbd 100644 --- a/common/base/classes/base_session.php +++ b/common/base/classes/base_session.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing sessions. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_form.php'); diff --git a/common/base/classes/base_users.php b/common/base/classes/base_users.php index 31d9bc7..a17a96d 100644 --- a/common/base/classes/base_users.php +++ b/common/base/classes/base_users.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing system roles. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_address.php'); diff --git a/common/base/classes/base_utf8.php b/common/base/classes/base_utf8.php index 165f35a..3b79b15 100644 --- a/common/base/classes/base_utf8.php +++ b/common/base/classes/base_utf8.php @@ -3,6 +3,8 @@ * @file * Provides UTF-8 support. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/base/classes/base_view.php b/common/base/classes/base_view.php index a6395d7..1e62487 100644 --- a/common/base/classes/base_view.php +++ b/common/base/classes/base_view.php @@ -5,6 +5,8 @@ * * This is for providing a common api for loading views from the database. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_database.php'); diff --git a/common/base/classes/base_warning.php b/common/base/classes/base_warning.php index e851d91..e635f50 100644 --- a/common/base/classes/base_warning.php +++ b/common/base/classes/base_warning.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing PHP warnings. */ +namespace n_koopa; + require_once('common/base/classes/base_return.php'); /** diff --git a/common/standard/classes/standard_database.php b/common/standard/classes/standard_database.php index a72bb66..c517254 100644 --- a/common/standard/classes/standard_database.php +++ b/common/standard/classes/standard_database.php @@ -3,6 +3,8 @@ * @file * Provides the standard database class. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_database.php'); diff --git a/common/standard/classes/standard_index.php b/common/standard/classes/standard_index.php index 310f981..de90c26 100644 --- a/common/standard/classes/standard_index.php +++ b/common/standard/classes/standard_index.php @@ -3,6 +3,8 @@ * @file * Provides the standard site index class. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_users.php'); diff --git a/common/standard/classes/standard_menu.php b/common/standard/classes/standard_menu.php index ef997df..b6224a6 100644 --- a/common/standard/classes/standard_menu.php +++ b/common/standard/classes/standard_menu.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing the menus. */ +namespace n_koopa; + require_once('common/base/classes/base_menu.php'); /** diff --git a/common/standard/classes/standard_path.php b/common/standard/classes/standard_path.php index cd9683d..389feb2 100644 --- a/common/standard/classes/standard_path.php +++ b/common/standard/classes/standard_path.php @@ -3,6 +3,8 @@ * @file * Provides the standard path handling class. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_menu.php'); @@ -84,11 +86,11 @@ class c_standard_path extends c_base_path { protected const NAME_MENU_CONTENT = 'menu_content'; protected const NAME_MENU_FOOTER = 'menu_footer'; - protected const HANDLER_MENU_HEADER = 'c_standard_menu_header'; - protected const HANDLER_MENU_UTILITY = 'c_standard_menu_utility'; - protected const HANDLER_MENU_BREADCRUMBS = 'c_standard_menu_breadcrumbs'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content'; - protected const HANDLER_MENU_FOOTER = 'c_standard_menu_footer'; + protected const HANDLER_MENU_HEADER = '\n_koopa\c_standard_menu_header'; + protected const HANDLER_MENU_UTILITY = '\n_koopa\c_standard_menu_utility'; + protected const HANDLER_MENU_BREADCRUMBS = '\n_koopa\c_standard_menu_breadcrumbs'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content'; + protected const HANDLER_MENU_FOOTER = '\n_koopa\c_standard_menu_footer'; protected const SCRIPT_EXTENSION = '.php'; diff --git a/common/standard/classes/standard_path_exception.php b/common/standard/classes/standard_path_exception.php index ebed379..80be328 100644 --- a/common/standard/classes/standard_path_exception.php +++ b/common/standard/classes/standard_path_exception.php @@ -3,6 +3,8 @@ * @file * Provides the standard path handling for exceptional cases. */ +namespace n_koopa; + require_once('common/standard/classes/standard_path.php'); /** diff --git a/common/standard/classes/standard_path_user.php b/common/standard/classes/standard_path_user.php index 4598ef5..f84cbfa 100644 --- a/common/standard/classes/standard_path_user.php +++ b/common/standard/classes/standard_path_user.php @@ -3,6 +3,7 @@ * @file * Provides the standard path handling class with user-path specific parts. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/classes/standard_paths.php b/common/standard/classes/standard_paths.php index 6d03402..fb275dd 100644 --- a/common/standard/classes/standard_paths.php +++ b/common/standard/classes/standard_paths.php @@ -3,6 +3,8 @@ * @file * Provides the standard site index class. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_paths.php'); @@ -114,53 +116,53 @@ class c_standard_paths extends c_base_return { protected const NAME_USER_UNLOCK = 'user_unlock'; protected const NAME_USER_VIEW = 'user_view'; - protected const HANDLER_ACCESS_DENIED = 'c_standard_path_access_denied'; - protected const HANDLER_BAD_METHOD = 'c_standard_path_bad_method'; - protected const HANDLER_INDEX = 'c_standard_path_index'; - protected const HANDLER_NOT_FOUND = 'c_standard_path_not_found'; - protected const HANDLER_OPTIONS_METHOD = 'c_standard_path_options_method'; - protected const HANDLER_SERVER_ERROR = 'c_standard_path_server_error'; - - protected const HANDLER_ADMINISTER_DASHBOARD = 'c_standard_administer_dashboard'; - protected const HANDLER_ADMINISTER_CONTENT = 'c_standard_administer_content'; - protected const HANDLER_ADMINISTER_LOGS = 'c_standard_administer_logs'; - - #protected const HANDLER_AJAX = 'c_standard_ajax'; - - protected const HANDLER_CACHE_STATIC = 'c_standard_cache_static'; - protected const HANDLER_CACHE_ERROR = 'c_standard_cache_error'; - - protected const HANDLER_FILE_BY_ID = 'c_standard_file_by_id'; - protected const HANDLER_FILE_BY_CHECKSUM = 'c_standard_file_by_checksum'; - - protected const HANDLER_FILE_CHECKSUM_BY_ID = 'c_standard_file_checksum_by_id'; - protected const HANDLER_FILE_CHECKSUM_BY_CHECKSUM = 'c_standard_file_checksum_by_checksum'; - - protected const HANDLER_MANAGEMENT_DASHBOARD = 'c_standard_management_dashboard'; - protected const HANDLER_MANAGEMENT_CONTENT = 'c_standard_management_content'; - protected const HANDLER_MANAGEMENT_LOGS = 'c_standard_management_logs'; - - protected const HANDLER_SUBMIT_FORM_ID = 'c_standard_submit_form_id'; - - #protected const HANDLER_THEME = 'c_standard_theme'; - - protected const HANDLER_USER_CHECK = 'c_standard_path_user_check'; - protected const HANDLER_USER_CONTACT = 'c_standard_path_user_contact'; - protected const HANDLER_USER_CONTENT = 'c_standard_path_user_content'; - protected const HANDLER_USER_CREATE = 'c_standard_path_user_create'; - protected const HANDLER_USER_DASHBOARD = 'c_standard_path_user_dashboard'; - protected const HANDLER_USER_DELETE = 'c_standard_path_user_delete'; - protected const HANDLER_USER_EDIT = 'c_standard_path_user_edit'; - protected const HANDLER_USER_LOCK = 'c_standard_path_user_lock'; - protected const HANDLER_USER_LOGIN = 'c_standard_path_user_login'; - protected const HANDLER_USER_LOGOUT = 'c_standard_path_user_logout'; - protected const HANDLER_USER_LOGS = 'c_standard_path_user_logs'; - protected const HANDLER_USER_REFRESH = 'c_standard_path_user_refresh'; - protected const HANDLER_USER_RESET = 'c_standard_path_user_reset'; - protected const HANDLER_USER_SESSION = 'c_standard_path_user_session'; - protected const HANDLER_USER_SETTINGS = 'c_standard_path_user_settings'; - protected const HANDLER_USER_UNLOCK = 'c_standard_path_user_unlock'; - protected const HANDLER_USER_VIEW = 'c_standard_path_user_view'; + protected const HANDLER_ACCESS_DENIED = '\n_koopa\c_standard_path_access_denied'; + protected const HANDLER_BAD_METHOD = '\n_koopa\c_standard_path_bad_method'; + protected const HANDLER_INDEX = '\n_koopa\c_standard_path_index'; + protected const HANDLER_NOT_FOUND = '\n_koopa\c_standard_path_not_found'; + protected const HANDLER_OPTIONS_METHOD = '\n_koopa\c_standard_path_options_method'; + protected const HANDLER_SERVER_ERROR = '\n_koopa\c_standard_path_server_error'; + + protected const HANDLER_ADMINISTER_DASHBOARD = '\n_koopa\c_standard_administer_dashboard'; + protected const HANDLER_ADMINISTER_CONTENT = '\n_koopa\c_standard_administer_content'; + protected const HANDLER_ADMINISTER_LOGS = '\n_koopa\c_standard_administer_logs'; + + #protected const HANDLER_AJAX = '\n_koopa\c_standard_ajax'; + + protected const HANDLER_CACHE_STATIC = '\n_koopa\c_standard_cache_static'; + protected const HANDLER_CACHE_ERROR = '\n_koopa\c_standard_cache_error'; + + protected const HANDLER_FILE_BY_ID = '\n_koopa\c_standard_file_by_id'; + protected const HANDLER_FILE_BY_CHECKSUM = '\n_koopa\c_standard_file_by_checksum'; + + protected const HANDLER_FILE_CHECKSUM_BY_ID = '\n_koopa\c_standard_file_checksum_by_id'; + protected const HANDLER_FILE_CHECKSUM_BY_CHECKSUM = '\n_koopa\c_standard_file_checksum_by_checksum'; + + protected const HANDLER_MANAGEMENT_DASHBOARD = '\n_koopa\c_standard_management_dashboard'; + protected const HANDLER_MANAGEMENT_CONTENT = '\n_koopa\c_standard_management_content'; + protected const HANDLER_MANAGEMENT_LOGS = '\n_koopa\c_standard_management_logs'; + + protected const HANDLER_SUBMIT_FORM_ID = '\n_koopa\c_standard_submit_form_id'; + + #protected const HANDLER_THEME = '\n_koopa\c_standard_theme'; + + protected const HANDLER_USER_CHECK = '\n_koopa\c_standard_path_user_check'; + protected const HANDLER_USER_CONTACT = '\n_koopa\c_standard_path_user_contact'; + protected const HANDLER_USER_CONTENT = '\n_koopa\c_standard_path_user_content'; + protected const HANDLER_USER_CREATE = '\n_koopa\c_standard_path_user_create'; + protected const HANDLER_USER_DASHBOARD = '\n_koopa\c_standard_path_user_dashboard'; + protected const HANDLER_USER_DELETE = '\n_koopa\c_standard_path_user_delete'; + protected const HANDLER_USER_EDIT = '\n_koopa\c_standard_path_user_edit'; + protected const HANDLER_USER_LOCK = '\n_koopa\c_standard_path_user_lock'; + protected const HANDLER_USER_LOGIN = '\n_koopa\c_standard_path_user_login'; + protected const HANDLER_USER_LOGOUT = '\n_koopa\c_standard_path_user_logout'; + protected const HANDLER_USER_LOGS = '\n_koopa\c_standard_path_user_logs'; + protected const HANDLER_USER_REFRESH = '\n_koopa\c_standard_path_user_refresh'; + protected const HANDLER_USER_RESET = '\n_koopa\c_standard_path_user_reset'; + protected const HANDLER_USER_SESSION = '\n_koopa\c_standard_path_user_session'; + protected const HANDLER_USER_SETTINGS = '\n_koopa\c_standard_path_user_settings'; + protected const HANDLER_USER_UNLOCK = '\n_koopa\c_standard_path_user_unlock'; + protected const HANDLER_USER_VIEW = '\n_koopa\c_standard_path_user_view'; protected const SCRIPT_EXTENSION = '.php'; protected const WILDCARD_PATH = '/%'; diff --git a/common/standard/classes/standard_users.php b/common/standard/classes/standard_users.php index e4d549d..73ccc80 100644 --- a/common/standard/classes/standard_users.php +++ b/common/standard/classes/standard_users.php @@ -3,6 +3,8 @@ * @file * Provides a class for managing system roles. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_roles.php'); diff --git a/common/standard/internal/access_denied.php b/common/standard/internal/access_denied.php index b358e12..ce65bc6 100644 --- a/common/standard/internal/access_denied.php +++ b/common/standard/internal/access_denied.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the access denied pages. */ +namespace n_koopa; require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_http_status.php'); diff --git a/common/standard/internal/bad_method.php b/common/standard/internal/bad_method.php index 8b2c946..9676af8 100644 --- a/common/standard/internal/bad_method.php +++ b/common/standard/internal/bad_method.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the not found pages. */ +namespace n_koopa; require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_http_status.php'); diff --git a/common/standard/internal/index.php b/common/standard/internal/index.php index 0d0e512..6ec93c6 100644 --- a/common/standard/internal/index.php +++ b/common/standard/internal/index.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the site index. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/internal/ja/access_denied.php b/common/standard/internal/ja/access_denied.php index c8b3eb9..34fb8b4 100644 --- a/common/standard/internal/ja/access_denied.php +++ b/common/standard/internal/ja/access_denied.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the access denied pages. */ +namespace n_koopa; /** * Implements c_standard_path_access_denied(). diff --git a/common/standard/internal/ja/bad_method.php b/common/standard/internal/ja/bad_method.php index 3cb3abb..5b29328 100644 --- a/common/standard/internal/ja/bad_method.php +++ b/common/standard/internal/ja/bad_method.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the not found pages. */ +namespace n_koopa; /** * Implements c_standard_path_bad_method(). diff --git a/common/standard/internal/ja/index.php b/common/standard/internal/ja/index.php index 4f50656..fac2b1e 100644 --- a/common/standard/internal/ja/index.php +++ b/common/standard/internal/ja/index.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the index page. */ +namespace n_koopa; /** * Implements c_standard_path_index(). diff --git a/common/standard/internal/ja/not_found.php b/common/standard/internal/ja/not_found.php index b3a776c..d81a271 100644 --- a/common/standard/internal/ja/not_found.php +++ b/common/standard/internal/ja/not_found.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the not found pages. */ +namespace n_koopa; /** * Implements c_standard_path_not_found(). diff --git a/common/standard/internal/ja/server_error.php b/common/standard/internal/ja/server_error.php index 97f5fe9..51fab44 100644 --- a/common/standard/internal/ja/server_error.php +++ b/common/standard/internal/ja/server_error.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the server error pages. */ +namespace n_koopa; /** * Implements c_standard_path_server_error(). diff --git a/common/standard/internal/not_found.php b/common/standard/internal/not_found.php index 91dc434..8c10cdd 100644 --- a/common/standard/internal/not_found.php +++ b/common/standard/internal/not_found.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the not found pages. */ +namespace n_koopa; require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_http_status.php'); diff --git a/common/standard/internal/options.php b/common/standard/internal/options.php index b8985ef..25b18b5 100644 --- a/common/standard/internal/options.php +++ b/common/standard/internal/options.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the server rror pages. */ +namespace n_koopa; require_once('common/base/classes/base_return.php'); diff --git a/common/standard/internal/server_error.php b/common/standard/internal/server_error.php index 3d9b488..5c49f96 100644 --- a/common/standard/internal/server_error.php +++ b/common/standard/internal/server_error.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the server rror pages. */ +namespace n_koopa; require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_http_status.php'); diff --git a/common/standard/menus/ja/menu_breadcrumbs.php b/common/standard/menus/ja/menu_breadcrumbs.php index 60726b1..64d7e31 100644 --- a/common/standard/menus/ja/menu_breadcrumbs.php +++ b/common/standard/menus/ja/menu_breadcrumbs.php @@ -3,6 +3,8 @@ * @file * Provides a language specific class. */ +namespace n_koopa; + require_once('common/standard/menus/menu_breadcrumbs.php'); /** diff --git a/common/standard/menus/ja/menu_content.php b/common/standard/menus/ja/menu_content.php index 8c77554..778f232 100644 --- a/common/standard/menus/ja/menu_content.php +++ b/common/standard/menus/ja/menu_content.php @@ -3,6 +3,8 @@ * @file * Provides a language specific class. */ +namespace n_koopa; + require_once('common/standard/menus/menu_content.php'); /** diff --git a/common/standard/menus/ja/menu_content_user_view.php b/common/standard/menus/ja/menu_content_user_view.php index dcd4da6..a18079e 100644 --- a/common/standard/menus/ja/menu_content_user_view.php +++ b/common/standard/menus/ja/menu_content_user_view.php @@ -3,6 +3,8 @@ * @file * Provides a language specific class. */ +namespace n_koopa; + require_once('common/standard/menus/menu_content.php'); /** diff --git a/common/standard/menus/ja/menu_footer.php b/common/standard/menus/ja/menu_footer.php index ce1c3c9..d3a353b 100644 --- a/common/standard/menus/ja/menu_footer.php +++ b/common/standard/menus/ja/menu_footer.php @@ -3,6 +3,8 @@ * @file * Provides a language specific class. */ +namespace n_koopa; + require_once('common/standard/menus/menu_footer.php'); /** diff --git a/common/standard/menus/ja/menu_header.php b/common/standard/menus/ja/menu_header.php index 18446d8..e96681a 100644 --- a/common/standard/menus/ja/menu_header.php +++ b/common/standard/menus/ja/menu_header.php @@ -3,6 +3,8 @@ * @file * Provides a language specific class. */ +namespace n_koopa; + require_once('common/standard/menus/menu_header.php'); /** diff --git a/common/standard/menus/ja/menu_utility.php b/common/standard/menus/ja/menu_utility.php index 8f06519..0e1a571 100644 --- a/common/standard/menus/ja/menu_utility.php +++ b/common/standard/menus/ja/menu_utility.php @@ -3,6 +3,8 @@ * @file * Provides a language specific class. */ +namespace n_koopa; + require_once('common/standard/menus/menu_utility.php'); /** diff --git a/common/standard/menus/menu_breadcrumbs.php b/common/standard/menus/menu_breadcrumbs.php index 99928fd..374360e 100644 --- a/common/standard/menus/menu_breadcrumbs.php +++ b/common/standard/menus/menu_breadcrumbs.php @@ -6,6 +6,8 @@ * This is a menu that shows a navigation history on how to get to the current page via links. * This does not have to be a link to every path in the current url. */ +namespace n_koopa; + require_once('common/base/classes/base_markup.php'); require_once('common/standard/classes/standard_menu.php'); diff --git a/common/standard/menus/menu_content.php b/common/standard/menus/menu_content.php index d5e3eec..4a183ff 100644 --- a/common/standard/menus/menu_content.php +++ b/common/standard/menus/menu_content.php @@ -6,6 +6,8 @@ * This is the navigation menu that is intended to be used for navigating the site. * This is (generally) specific to each page or url path. */ +namespace n_koopa; + require_once('common/base/classes/base_markup.php'); require_once('common/standard/classes/standard_menu.php'); diff --git a/common/standard/menus/menu_content_user_view.php b/common/standard/menus/menu_content_user_view.php index 43cd847..c160bbc 100644 --- a/common/standard/menus/menu_content_user_view.php +++ b/common/standard/menus/menu_content_user_view.php @@ -3,6 +3,8 @@ * @file * Provides a class for a path-specific content menu. */ +namespace n_koopa; + require_once('common/base/classes/base_markup.php'); require_once('common/standard/classes/standard_menu.php'); @@ -75,7 +77,13 @@ class c_standard_menu_content_user_view extends c_standard_menu_content { $menu->set_tag($item); unset($item); - $roles = $session->get_user_current()->get_roles()->get_value_exact(); + if ($session->get_user_current() instanceof c_base_users_user) { + $roles = $session->get_user_current()->get_roles()->get_value_exact(); + } + else { + $roles = new c_base_users_user(); + } + if (array_key_exists(c_base_roles::MANAGER, $roles) || array_key_exists(c_base_roles::ADMINISTER, $roles)) { // @todo: only show lock user if account is unlocked. $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(7), $settings['base_path'] . c_standard_paths::URI_USER_LOCK . $path_id_user); diff --git a/common/standard/menus/menu_footer.php b/common/standard/menus/menu_footer.php index 0d92d38..069e61f 100644 --- a/common/standard/menus/menu_footer.php +++ b/common/standard/menus/menu_footer.php @@ -6,6 +6,8 @@ * A footer menu is a menu that is intended to be displayed in the footer of a page. * This is (generally) a global menu that is displayed on most pages. */ +namespace n_koopa; + require_once('common/base/classes/base_markup.php'); require_once('common/standard/classes/standard_menu.php'); diff --git a/common/standard/menus/menu_header.php b/common/standard/menus/menu_header.php index 4376550..104c471 100644 --- a/common/standard/menus/menu_header.php +++ b/common/standard/menus/menu_header.php @@ -6,6 +6,8 @@ * A header menu is a menu that is intended to be displayed in the header of a page. * This is (generally) a global menu that is displayed on most pages. */ +namespace n_koopa; + require_once('common/base/classes/base_markup.php'); require_once('common/standard/classes/standard_menu.php'); diff --git a/common/standard/menus/menu_utility.php b/common/standard/menus/menu_utility.php index 0bc4f8e..4a92a9b 100644 --- a/common/standard/menus/menu_utility.php +++ b/common/standard/menus/menu_utility.php @@ -7,6 +7,8 @@ * This includes dashboard links, profile, links, etc.. * This is not intended for site navigation. */ +namespace n_koopa; + require_once('common/base/classes/base_markup.php'); require_once('common/standard/classes/standard_menu.php'); @@ -36,7 +38,12 @@ class c_standard_menu_utility extends c_standard_menu { } unset($result); - $roles = $session->get_user_current()->get_roles()->get_value_exact(); + if ($session->get_user_current() instanceof c_base_users_user) { + $roles = $session->get_user_current()->get_roles()->get_value_exact(); + } + else { + $roles = new c_base_users_user(); + } $menu = $this->pr_create_html_create_menu($settings['base_css'] . static::CLASS_NAME, $this->pr_get_text(0)); diff --git a/common/standard/paths/a/administer_content.php b/common/standard/paths/a/administer_content.php index 500423a..343f810 100644 --- a/common/standard/paths/a/administer_content.php +++ b/common/standard/paths/a/administer_content.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the administer content. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -22,7 +23,7 @@ class c_standard_path_administer_content extends c_standard_path { public const PATH_SELF = 'a/content'; #protected const NAME_MENU_CONTENT = 'menu_content_administer_content'; - #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_administer_content'; + #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_administer_content'; /** * Implements do_execute(). diff --git a/common/standard/paths/a/administer_dashboard.php b/common/standard/paths/a/administer_dashboard.php index 7f1a08d..8b2dd0a 100644 --- a/common/standard/paths/a/administer_dashboard.php +++ b/common/standard/paths/a/administer_dashboard.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the administer dashboard. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/a/administer_logs.php b/common/standard/paths/a/administer_logs.php index 6231e9a..dd798fe 100644 --- a/common/standard/paths/a/administer_logs.php +++ b/common/standard/paths/a/administer_logs.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the administer logs. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -22,7 +23,7 @@ class c_standard_path_administer_logs extends c_standard_path { public const PATH_SELF = 'a/logs'; #protected const NAME_MENU_CONTENT = 'menu_content_administer_logs'; - #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_administer_logs'; + #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_administer_logs'; /** * Implements do_execute(). diff --git a/common/standard/paths/a/ja/administer_content.php b/common/standard/paths/a/ja/administer_content.php index f2b7feb..47c87df 100644 --- a/common/standard/paths/a/ja/administer_content.php +++ b/common/standard/paths/a/ja/administer_content.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_administer_content(). diff --git a/common/standard/paths/a/ja/administer_dashboard.php b/common/standard/paths/a/ja/administer_dashboard.php index f55d94c..ee7aec8 100644 --- a/common/standard/paths/a/ja/administer_dashboard.php +++ b/common/standard/paths/a/ja/administer_dashboard.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_administer_dashboard(). diff --git a/common/standard/paths/a/ja/administer_logs.php b/common/standard/paths/a/ja/administer_logs.php index 05a286c..5158d7d 100644 --- a/common/standard/paths/a/ja/administer_logs.php +++ b/common/standard/paths/a/ja/administer_logs.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_administer_logs(). diff --git a/common/standard/paths/c/cache_error.php b/common/standard/paths/c/cache_error.php index 0c9d1fc..5bfb6b0 100644 --- a/common/standard/paths/c/cache_error.php +++ b/common/standard/paths/c/cache_error.php @@ -6,6 +6,7 @@ * This could be used to load, alter, and sign (such as via PGP/GPG) a static file before output. * Such a use is not truly static, but it can be used for some amount of optimization. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/c/cache_static.php b/common/standard/paths/c/cache_static.php index 0fd89dc..2d590ce 100644 --- a/common/standard/paths/c/cache_static.php +++ b/common/standard/paths/c/cache_static.php @@ -7,6 +7,7 @@ * Such a use is not truly static, but it can be used for some amount of optimization. * This could also be used for dynamicly generated CSS and JS aggregation static files (as is done in Drupal). */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/c/ja/cache_error.php b/common/standard/paths/c/ja/cache_error.php index 69aa1f1..70dcc3b 100644 --- a/common/standard/paths/c/ja/cache_error.php +++ b/common/standard/paths/c/ja/cache_error.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_cache_error(). diff --git a/common/standard/paths/c/ja/cache_static.php b/common/standard/paths/c/ja/cache_static.php index 0c846a9..4db490e 100644 --- a/common/standard/paths/c/ja/cache_static.php +++ b/common/standard/paths/c/ja/cache_static.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_cache_static(). diff --git a/common/standard/paths/f/file_by_checksum.php b/common/standard/paths/f/file_by_checksum.php index c3cc9d6..24cfe2a 100644 --- a/common/standard/paths/f/file_by_checksum.php +++ b/common/standard/paths/f/file_by_checksum.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the files by checksum. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/f/file_by_id.php b/common/standard/paths/f/file_by_id.php index 3ca25e8..eed1cc4 100644 --- a/common/standard/paths/f/file_by_id.php +++ b/common/standard/paths/f/file_by_id.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the files by id. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/f/file_checksum_by_checksum.php b/common/standard/paths/f/file_checksum_by_checksum.php index 37fe3ae..1ebce3a 100644 --- a/common/standard/paths/f/file_checksum_by_checksum.php +++ b/common/standard/paths/f/file_checksum_by_checksum.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the file checksums by checksum. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/f/file_checksum_by_id.php b/common/standard/paths/f/file_checksum_by_id.php index ae28e73..c576de2 100644 --- a/common/standard/paths/f/file_checksum_by_id.php +++ b/common/standard/paths/f/file_checksum_by_id.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the file checksums by file id. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/f/ja/file_by_checksum.php b/common/standard/paths/f/ja/file_by_checksum.php index 02eaa01..7b91461 100644 --- a/common/standard/paths/f/ja/file_by_checksum.php +++ b/common/standard/paths/f/ja/file_by_checksum.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_file_by_checksum(). diff --git a/common/standard/paths/f/ja/file_by_id.php b/common/standard/paths/f/ja/file_by_id.php index 414056d..6f03d0d 100644 --- a/common/standard/paths/f/ja/file_by_id.php +++ b/common/standard/paths/f/ja/file_by_id.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_file_by_id(). diff --git a/common/standard/paths/f/ja/file_checksum_by_checksum.php b/common/standard/paths/f/ja/file_checksum_by_checksum.php index 2263aa3..202093f 100644 --- a/common/standard/paths/f/ja/file_checksum_by_checksum.php +++ b/common/standard/paths/f/ja/file_checksum_by_checksum.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_file_by_checksum_by_checksum(). diff --git a/common/standard/paths/f/ja/file_checksum_by_id.php b/common/standard/paths/f/ja/file_checksum_by_id.php index 6bf73b8..36d29cd 100644 --- a/common/standard/paths/f/ja/file_checksum_by_id.php +++ b/common/standard/paths/f/ja/file_checksum_by_id.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_file_by_checksum_by_id(). diff --git a/common/standard/paths/m/ja/management_content.php b/common/standard/paths/m/ja/management_content.php index 38ac6c1..233959a 100644 --- a/common/standard/paths/m/ja/management_content.php +++ b/common/standard/paths/m/ja/management_content.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_management_content(). diff --git a/common/standard/paths/m/ja/management_dashboard.php b/common/standard/paths/m/ja/management_dashboard.php index 4629465..b3cac48 100644 --- a/common/standard/paths/m/ja/management_dashboard.php +++ b/common/standard/paths/m/ja/management_dashboard.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_management_dashboard(). diff --git a/common/standard/paths/m/ja/management_logs.php b/common/standard/paths/m/ja/management_logs.php index f133056..5ed6c17 100644 --- a/common/standard/paths/m/ja/management_logs.php +++ b/common/standard/paths/m/ja/management_logs.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_management_logs(). diff --git a/common/standard/paths/m/management_content.php b/common/standard/paths/m/management_content.php index 543bfda..1308fdb 100644 --- a/common/standard/paths/m/management_content.php +++ b/common/standard/paths/m/management_content.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the management content. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -22,7 +23,7 @@ class c_standard_path_management_content extends c_standard_path { public const PATH_SELF = 'm/content'; #protected const NAME_MENU_CONTENT = 'menu_content_management_content'; - #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_management_content'; + #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_management_content'; /** * Implements do_execute(). diff --git a/common/standard/paths/m/management_dashboard.php b/common/standard/paths/m/management_dashboard.php index f361b8e..7e2c34e 100644 --- a/common/standard/paths/m/management_dashboard.php +++ b/common/standard/paths/m/management_dashboard.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the manager dashboard. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/m/management_logs.php b/common/standard/paths/m/management_logs.php index b52bed1..e2ae603 100644 --- a/common/standard/paths/m/management_logs.php +++ b/common/standard/paths/m/management_logs.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the management logs. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -22,7 +23,7 @@ class c_standard_path_management_logs extends c_standard_path { public const PATH_SELF = 'm/logs'; #protected const NAME_MENU_CONTENT = 'menu_content_management_logs'; - #protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_management_logs'; + #protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_management_logs'; /** * Implements do_execute(). diff --git a/common/standard/paths/s/ja/submit_form_id.php b/common/standard/paths/s/ja/submit_form_id.php index 517a7fc..7dcf8d8 100644 --- a/common/standard/paths/s/ja/submit_form_id.php +++ b/common/standard/paths/s/ja/submit_form_id.php @@ -3,6 +3,7 @@ * @file * Provides a language specific class. */ +namespace n_koopa; /** * Implements c_standard_path_submit_form_id(). diff --git a/common/standard/paths/s/submit_form_id.php b/common/standard/paths/s/submit_form_id.php index c5003d1..a443e5c 100644 --- a/common/standard/paths/s/submit_form_id.php +++ b/common/standard/paths/s/submit_form_id.php @@ -3,6 +3,7 @@ * @file * Provides path handler for submit forms. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/u/ja/user_check.php b/common/standard/paths/u/ja/user_check.php index d3d6643..673a6bd 100644 --- a/common/standard/paths/u/ja/user_check.php +++ b/common/standard/paths/u/ja/user_check.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user checks. */ +namespace n_koopa; /** * Implements c_standard_path_user_check(). diff --git a/common/standard/paths/u/ja/user_dashboard.php b/common/standard/paths/u/ja/user_dashboard.php index 27c6f9c..7025ccc 100644 --- a/common/standard/paths/u/ja/user_dashboard.php +++ b/common/standard/paths/u/ja/user_dashboard.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user dashboard. */ +namespace n_koopa; /** * Implements c_standard_path_user_dashboard(). diff --git a/common/standard/paths/u/ja/user_delete.php b/common/standard/paths/u/ja/user_delete.php index 15c135f..607474b 100644 --- a/common/standard/paths/u/ja/user_delete.php +++ b/common/standard/paths/u/ja/user_delete.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user dashboard. */ +namespace n_koopa; /** * Implements c_standard_path_user_delete(). diff --git a/common/standard/paths/u/ja/user_edit.php b/common/standard/paths/u/ja/user_edit.php index 0866841..79e74c8 100644 --- a/common/standard/paths/u/ja/user_edit.php +++ b/common/standard/paths/u/ja/user_edit.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user edit. */ +namespace n_koopa; /** * Implements c_standard_path_user_edit(). diff --git a/common/standard/paths/u/ja/user_lock.php b/common/standard/paths/u/ja/user_lock.php index a8a36f5..f84ec99 100644 --- a/common/standard/paths/u/ja/user_lock.php +++ b/common/standard/paths/u/ja/user_lock.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user dashboard. */ +namespace n_koopa; /** * Implements c_standard_path_user_lock(). diff --git a/common/standard/paths/u/ja/user_login.php b/common/standard/paths/u/ja/user_login.php index a9afc91..689ef3b 100644 --- a/common/standard/paths/u/ja/user_login.php +++ b/common/standard/paths/u/ja/user_login.php @@ -3,7 +3,7 @@ * @file * Provides path handler for the login process. */ - +namespace n_koopa; /** * Implements c_standard_path_user_login(). diff --git a/common/standard/paths/u/ja/user_logout.php b/common/standard/paths/u/ja/user_logout.php index 79adb2c..57ad387 100644 --- a/common/standard/paths/u/ja/user_logout.php +++ b/common/standard/paths/u/ja/user_logout.php @@ -3,7 +3,7 @@ * @file * Provides path handler for the logout process. */ - +namespace n_koopa; /** * Implements c_standard_path_user_logout(). diff --git a/common/standard/paths/u/ja/user_refresh.php b/common/standard/paths/u/ja/user_refresh.php index e0b7ced..0617c58 100644 --- a/common/standard/paths/u/ja/user_refresh.php +++ b/common/standard/paths/u/ja/user_refresh.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user refreshes. */ +namespace n_koopa; /** * Implements c_standard_path_user_refresh(). diff --git a/common/standard/paths/u/ja/user_session.php b/common/standard/paths/u/ja/user_session.php index c45cfb9..5251172 100644 --- a/common/standard/paths/u/ja/user_session.php +++ b/common/standard/paths/u/ja/user_session.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user session actions. */ +namespace n_koopa; /** * Implements c_standard_path_user_session(). diff --git a/common/standard/paths/u/ja/user_settings.php b/common/standard/paths/u/ja/user_settings.php index 5d161e2..0147aab 100644 --- a/common/standard/paths/u/ja/user_settings.php +++ b/common/standard/paths/u/ja/user_settings.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user dashboard. */ +namespace n_koopa; /** * Implements c_standard_path_user_dashboard(). diff --git a/common/standard/paths/u/ja/user_unlock.php b/common/standard/paths/u/ja/user_unlock.php index 8312328..7591066 100644 --- a/common/standard/paths/u/ja/user_unlock.php +++ b/common/standard/paths/u/ja/user_unlock.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user unlock. */ +namespace n_koopa; /** * Implements c_standard_path_user_unlock(). diff --git a/common/standard/paths/u/ja/user_view.php b/common/standard/paths/u/ja/user_view.php index c28f6b9..9dd5f01 100644 --- a/common/standard/paths/u/ja/user_view.php +++ b/common/standard/paths/u/ja/user_view.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user view. */ +namespace n_koopa; /** * Implements c_standard_path_user_dashboard(). diff --git a/common/standard/paths/u/user_check.php b/common/standard/paths/u/user_check.php index 1936783..9d08ea0 100644 --- a/common/standard/paths/u/user_check.php +++ b/common/standard/paths/u/user_check.php @@ -6,6 +6,7 @@ * This is generally intended to be used to trigger one or more checks against a user account or related data. * This could be a simple reaction as is common with ajax but could also be a page containing forms. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -26,7 +27,7 @@ class c_standard_path_user_check extends c_standard_path_user { public const PATH_SELF = 'u/check'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; /** * Implements do_execute(). diff --git a/common/standard/paths/u/user_create.php b/common/standard/paths/u/user_create.php index 0852d9b..ef29942 100644 --- a/common/standard/paths/u/user_create.php +++ b/common/standard/paths/u/user_create.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user create/copy. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/u/user_dashboard.php b/common/standard/paths/u/user_dashboard.php index ec71568..524203e 100644 --- a/common/standard/paths/u/user_dashboard.php +++ b/common/standard/paths/u/user_dashboard.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user dashboard. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -74,7 +75,12 @@ class c_standard_path_user_dashboard extends c_standard_path_user { $wrapper = $this->pr_create_tag_section(array(1 => 0)); $wrapper->set_tag($this->pr_create_tag_text_block(1)); - $roles = $session->get_user_current()->get_roles()->get_value_exact(); + if ($session->get_user_current() instanceof c_base_users_user) { + $roles = $session->get_user_current()->get_roles()->get_value_exact(); + } + else { + $roles = new c_base_users_user(); + } $wrapper->set_tag($this->pr_create_tag_text_block($this->pr_get_text(2, array('@{user}' => $session->get_name()->get_value_exact())))); diff --git a/common/standard/paths/u/user_delete.php b/common/standard/paths/u/user_delete.php index 6c561b8..e8b25a4 100644 --- a/common/standard/paths/u/user_delete.php +++ b/common/standard/paths/u/user_delete.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user delete. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -23,7 +24,7 @@ class c_standard_path_user_delete extends c_standard_path_user { public const PATH_SELF = 'u/delete'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; /** * Implements do_execute(). diff --git a/common/standard/paths/u/user_edit.php b/common/standard/paths/u/user_edit.php index 0955f28..1c11952 100644 --- a/common/standard/paths/u/user_edit.php +++ b/common/standard/paths/u/user_edit.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user edit. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -23,7 +24,7 @@ class c_standard_path_user_edit extends c_standard_path_user { public const PATH_SELF = 'u/edit'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; protected const CLASS_USER_EDIT_ACCOUNT = 'user_settings-account'; protected const CLASS_USER_EDIT_PERSONAL = 'user_settings-personal'; diff --git a/common/standard/paths/u/user_lock.php b/common/standard/paths/u/user_lock.php index d0b5095..2fadf91 100644 --- a/common/standard/paths/u/user_lock.php +++ b/common/standard/paths/u/user_lock.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user lock. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -23,7 +24,7 @@ class c_standard_path_user_lock extends c_standard_path_user { public const PATH_SELF = 'u/lock'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; /** * Implements do_execute(). diff --git a/common/standard/paths/u/user_login.php b/common/standard/paths/u/user_login.php index ca6603b..8eeac63 100644 --- a/common/standard/paths/u/user_login.php +++ b/common/standard/paths/u/user_login.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the login process. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/u/user_logout.php b/common/standard/paths/u/user_logout.php index 4a775a5..1c924b2 100644 --- a/common/standard/paths/u/user_logout.php +++ b/common/standard/paths/u/user_logout.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user logout process. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/u/user_refresh.php b/common/standard/paths/u/user_refresh.php index d2d9d33..7ca3c96 100644 --- a/common/standard/paths/u/user_refresh.php +++ b/common/standard/paths/u/user_refresh.php @@ -6,6 +6,7 @@ * This is generally intended to be used to trigger one or more refreshes against a user account or related data. * This could be a simple reaction as is common with ajax but could also be a page containing forms. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -26,7 +27,7 @@ class c_standard_path_user_refresh extends c_standard_path_user { public const PATH_SELF = 'u/refresh'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; /** * Implements do_execute(). diff --git a/common/standard/paths/u/user_session.php b/common/standard/paths/u/user_session.php index 7a0760b..ec088d7 100644 --- a/common/standard/paths/u/user_session.php +++ b/common/standard/paths/u/user_session.php @@ -6,6 +6,7 @@ * This is generally intended to be used to trigger one or more session actions against a user account or related data. * This could be a simple reaction as is common with ajax but could also be a page containing forms. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); diff --git a/common/standard/paths/u/user_settings.php b/common/standard/paths/u/user_settings.php index ffd98e5..02c391b 100644 --- a/common/standard/paths/u/user_settings.php +++ b/common/standard/paths/u/user_settings.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user settings. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -24,7 +25,7 @@ class c_standard_path_user_settings extends c_standard_path_user { public const PATH_SELF = 'u/settings'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; protected const CLASS_USER_SETTINGS_ACCOUNT = 'user_settings-account'; protected const CLASS_USER_SETTINGS_PERSONAL = 'user_settings-personal'; diff --git a/common/standard/paths/u/user_unlock.php b/common/standard/paths/u/user_unlock.php index 56c9d9f..8609b8f 100644 --- a/common/standard/paths/u/user_unlock.php +++ b/common/standard/paths/u/user_unlock.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user unlock. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -23,7 +24,7 @@ class c_standard_path_user_unlock extends c_standard_path_user { public const PATH_SELF = 'u/unlock'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; /** * Implements do_execute(). diff --git a/common/standard/paths/u/user_view.php b/common/standard/paths/u/user_view.php index ffb5a0a..1348b2d 100644 --- a/common/standard/paths/u/user_view.php +++ b/common/standard/paths/u/user_view.php @@ -3,6 +3,7 @@ * @file * Provides path handler for the user view. */ +namespace n_koopa; require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); @@ -23,7 +24,7 @@ class c_standard_path_user_view extends c_standard_path_user { public const PATH_SELF = 'u/view'; protected const NAME_MENU_CONTENT = 'menu_content_user_view'; - protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view'; + protected const HANDLER_MENU_CONTENT = '\n_koopa\c_standard_menu_content_user_view'; protected const CLASS_USER_VIEW_IMAGE = 'user_view-image'; protected const CLASS_USER_VIEW_INFORMATION = 'user_view-information'; diff --git a/common/theme/classes/theme_dom.php b/common/theme/classes/theme_dom.php index f995d5b..2f05296 100644 --- a/common/theme/classes/theme_dom.php +++ b/common/theme/classes/theme_dom.php @@ -5,6 +5,7 @@ * * This is currently a draft/brainstorm and is subject to be completely rewritten/redesigned. */ +namespace n_koopa; // include required files. require_once('common/base/classes/base_error.php'); diff --git a/common/theme/classes/theme_form.php b/common/theme/classes/theme_form.php index c90e18f..dea3f44 100644 --- a/common/theme/classes/theme_form.php +++ b/common/theme/classes/theme_form.php @@ -7,6 +7,7 @@ * * @see: https://www.w3.org/TR/html5/ */ +namespace n_koopa; // include required files. require_once('common/base/classes/base_error.php'); diff --git a/common/theme/classes/theme_html.php b/common/theme/classes/theme_html.php index 21f1d7f..08fb676 100644 --- a/common/theme/classes/theme_html.php +++ b/common/theme/classes/theme_html.php @@ -5,6 +5,7 @@ * * @see: https://www.w3.org/TR/html5/ */ +namespace n_koopa; // include required files. require_once('common/base/classes/base_error.php'); diff --git a/common/theme/classes/theme_markup.php b/common/theme/classes/theme_markup.php index 1d7d26d..de847a2 100644 --- a/common/theme/classes/theme_markup.php +++ b/common/theme/classes/theme_markup.php @@ -78,6 +78,7 @@ * - May only contain the following tags: . * - example: */ +namespace n_koopa; // include required files. require_once('common/base/classes/base_error.php'); diff --git a/common/view/classes/view_log_users_self.php b/common/view/classes/view_log_users_self.php index 9917c42..e299e21 100644 --- a/common/view/classes/view_log_users_self.php +++ b/common/view/classes/view_log_users_self.php @@ -5,6 +5,8 @@ * * This is for providing a common api for loading views from the database. */ +namespace n_koopa; + require_once('common/base/classes/base_error.php'); require_once('common/base/classes/base_return.php'); require_once('common/base/classes/base_view.php'); diff --git a/documentation/naming.txt b/documentation/naming.txt index 387b99d..7dbe6a0 100644 --- a/documentation/naming.txt +++ b/documentation/naming.txt @@ -8,6 +8,7 @@ The following is the naming scheme used to communicate what a particular name is - f_: This represent a function. - c_: This represents a class name. - t_: This represents a class trait. + - n_: This represents a namespace name. Within a class object, special rules apply: 1) f_ is not prefixed on function names. diff --git a/examples/test.php b/examples/test.php index d359d6d..941aef2 100755 --- a/examples/test.php +++ b/examples/test.php @@ -1,4 +1,6 @@ 'c_base_error_messages_english', - i_base_languages::ENGLISH => 'c_base_error_messages_english', - i_base_languages::JAPANESE => 'c_base_error_messages_japanese', + i_base_languages::ENGLISH_US => '\n_koopa\c_base_error_messages_english', + i_base_languages::ENGLISH => '\n_koopa\c_base_error_messages_english', + i_base_languages::JAPANESE => '\n_koopa\c_base_error_messages_japanese', ); $stuff['http']->set_response_content_language(i_base_languages::ENGLISH_US); diff --git a/program/reservation/index.php b/program/reservation/index.php index 98a65c3..ec98537 100644 --- a/program/reservation/index.php +++ b/program/reservation/index.php @@ -1,4 +1,7 @@ get_value_exact(); $microseconds = (int) (($now - ((int) $now)) * 1000000); - $date = new DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now)); + $date = new \DateTime(date('Y/m/d h:i:s', (int) $now) . '.' . $microseconds . date(' P', (int) $now)); unset($now); } else { @@ -184,18 +185,18 @@ class c_base_defaults_global { $microseconds = 0; } - $date = new DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp)); + $date = new \DateTime(date('Y/m/d h:i:s', (int) $timestamp) . '.' . $microseconds . date(' P', (int) $timestamp)); } unset($microseconds); - if (!($date instanceof DateTime)) { + if (!($date instanceof \DateTime)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value('', 'c_base_return_string', $error); } if (!is_null(self::$s_timezone)) { date_default_timezone_set(self::$s_timezone); - $date->setTimeZone(new DateTimeZone(self::$s_timezone)); + $date->setTimeZone(new \DateTimeZone(self::$s_timezone)); } $formatted = $date->format($string); @@ -235,9 +236,9 @@ class c_base_defaults_global { } // To ensure support for microseconds (and milliseconds), datetime must be initialized woth microseconds. - $date = DateTime::createFromFormat($format, $string); + $date = \DateTime::createFromFormat($format, $string); - if (!($date instanceof DateTime)) { + if (!($date instanceof \DateTime)) { $error = c_base_error::s_log(NULL, array('arguments' => array(':{operation_name}' => 'date', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::OPERATION_FAILURE); return c_base_return_error::s_value(0.0, 'c_base_return_float', $error); } -- 1.8.3.1