From: Kevin Day Date: Fri, 26 May 2017 04:02:25 +0000 (-0500) Subject: Progress: work on user administration pages X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=6efcbe2c1abea0ca3d50b6eac7b50ba49207ae1e;p=koopa Progress: work on user administration pages --- diff --git a/common/standard/classes/standard_index.php b/common/standard/classes/standard_index.php index 28e9edd..92ba4e5 100644 --- a/common/standard/classes/standard_index.php +++ b/common/standard/classes/standard_index.php @@ -68,8 +68,8 @@ class c_standard_index extends c_base_return { $this->settings['cookie_secure'] = TRUE; $this->settings['session_socket'] = '/programs/sockets/sessionize_accounts/'; $this->settings['session_system'] = 'standard'; - $this->settings['session_expire'] = 600; // 10 minutes - $this->settings['session_max'] = 1800; // 30 minutes + $this->settings['session_expire'] = 1200; // 20 minutes + $this->settings['session_max'] = 7200; // 120 minutes / 2 hours // ldap information $this->settings['ldap_server'] = NULL; // 'ldaps://127.0.0.1:1636/'; diff --git a/common/standard/classes/standard_path.php b/common/standard/classes/standard_path.php index c93d20f..f911b1c 100644 --- a/common/standard/classes/standard_path.php +++ b/common/standard/classes/standard_path.php @@ -28,13 +28,22 @@ class c_standard_path extends c_base_path { protected const CSS_AS_LINK_BLOCK_LINK = 'as-link_block-link'; protected const CSS_AS_LINK_BLOCK_DESCRIPTION = 'as-link_block-description'; protected const CSS_AS_HEADER = 'as-header'; + protected const CSS_AS_HEADER_TEXT = 'as-header-text'; protected const CSS_AS_HEADERS = 'as-headers'; protected const CSS_AS_FIELD_SET = 'as-field_set'; protected const CSS_AS_FIELD_SET_LEGEND = 'as-field_set-legend'; protected const CSS_AS_FIELD_SET_CONTENT = 'as-field_set-content'; - protected const CSS_IS_JAVASCRIPT_ENABLED = 'javascript-enabled'; - protected const CSS_IS_JAVASCRIPT_DISABLED = 'javascript-disabled'; - protected const CSS_IS_CONTENT_TYPE = 'is-html_5'; + protected const CSS_AS_FIELD_ROW = 'as-field_row'; + protected const CSS_AS_FIELD_ROW_NAME = 'as-field_row-name'; + protected const CSS_AS_FIELD_ROW_VALUE = 'as-field_row-value'; + protected const CSS_AS_ROW = 'as-row'; + protected const CSS_AS_ROW_EVEN = 'as-row-even'; + protected const CSS_AS_ROW_ODD = 'as-row-odd'; + protected const CSS_AS_SPACER = 'as-spacer'; + + protected const CSS_IS_JAVASCRIPT_ENABLED = 'javascript-enabled'; + protected const CSS_IS_JAVASCRIPT_DISABLED = 'javascript-disabled'; + protected const CSS_IS_CONTENT_TYPE = 'is-html_5'; protected const CSS_SYSTEM_PREFIX = 'system-'; @@ -381,8 +390,9 @@ class c_standard_path extends c_base_path { * @param string|null $id * (optional) An ID attribute to assign. * If NULL, then this is not assigned. - * @param string|null $extra_class + * @param string|array||null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -393,6 +403,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SECTION, $id, $classes); unset($classes); @@ -414,6 +430,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -424,6 +441,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); } @@ -436,6 +459,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -446,6 +470,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } return c_theme_html::s_create_tag(c_base_markup_tag::TYPE_BREAK, $id, $classes); } @@ -462,6 +492,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -472,6 +503,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } if (is_int($text)) { return c_theme_html::s_create_tag($this->text_type, $id, $classes, $this->pr_get_text($text, $arguments)); @@ -495,16 +532,25 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. + * @param c_base_markup_tag|null $prepend + * If not NULL, then a markup tag to prepend inside of the header tag block. * * @return c_base_markup_tag * The generated markup tag. */ - protected function pr_create_tag_header($text, $header, $arguments = array(), $id = NULL, $extra_class = NULL) { + protected function pr_create_tag_header($text, $header, $arguments = array(), $id = NULL, $extra_class = NULL, $prepend = NULL) { $classes = array($this->settings['base_css'] . self::CSS_AS_HEADER, self::CSS_AS_HEADER, self::CSS_AS_HEADER . '-' . $header); if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } if ($header == 1) { $type = c_base_markup_tag::TYPE_H1; @@ -528,13 +574,16 @@ class c_standard_path extends c_base_path { $type = c_base_markup_tag::TYPE_HX; } - if (is_int($text)) { - $tag = c_theme_html::s_create_tag($type, $id, $classes, $this->pr_get_text($text, $arguments)); - } - else { - $tag = c_theme_html::s_create_tag($type, $id, $classes, $text); + $tag = c_theme_html::s_create_tag($type, $id, $classes); + + if ($prepend instanceof c_base_markup_tag) { + $tag->set_tag($prepend); } + $tag_text = $this->pr_create_tag_text($text, $arguments, $id, self::CSS_AS_HEADER_TEXT); + $tag->set_tag($tag_text); + unset($tag_text); + if ($header > 6) { $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, 'text-text-heading_' . ((int) $header)); } @@ -549,6 +598,16 @@ class c_standard_path extends c_base_path { * * @param array|null $headers * An array of headers, whose keys are the header number and values are the header names. + * Header values may also be an array with the following structure: + * - prepend-outside: A c_base_markup_tag to prepend outside of the header tag, but inside the headers tag. + * May be NULL for undefined. + * - append-outside: A c_base_markup_tag to append outside of the header tag, but inside the headers tag. + * May be NULL for undefined. + * - prepend-inside: A c_base_markup_tag to prepend inside of the header tag, but inside the headers tag. + * May be NULL for undefined. + * - append-inside: A c_base_markup_tag to append inside of the header tag, but inside the headers tag. + * May be NULL for undefined. + * - text: The header name value string or integer. * If NULL, then the headers are not assigned. * @param array $arguments * (optional) An array of arguments to convert into text. @@ -557,6 +616,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -567,13 +627,50 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_HEADER, $id, $classes); unset($classes); if (is_array($headers)) { foreach ($headers as $header_id => $header_text) { + if (is_array($header_text)) { + if (!isset($header_text['text'])) { + continue; + } + + if (isset($header_text['prepend-outside']) && $header_text['prepend-outside'] instanceof c_base_markup_tag) { + $tag->set_tag($header_text['prepend-outside']); + } + + if (isset($header_text['prepend-inside'])) { + $header = $this->pr_create_tag_header($header_text['text'], $header_id, $arguments, NULL, NULL, $header_text['prepend-inside']); + } + else { + $header = $this->pr_create_tag_header($header_text['text'], $header_id, $arguments); + } + + if (isset($header_text['append-inside'])) { + $header->set_tag($header_text['append-inside']); + } + + $tag->set_tag($header); + unset($header); + + if (isset($header_text['append-outside']) && $header_text['append-outside'] instanceof c_base_markup_tag) { + $tag->set_tag($header_text['append-outside']); + } + + continue; + } + $header = $this->pr_create_tag_header($header_text, $header_id, $arguments); + $tag->set_tag($header); unset($header); } @@ -596,6 +693,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -606,6 +704,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } if (is_int($text)) { return c_theme_html::s_create_tag($this->text_type, $id, $classes, $this->pr_get_text($text, $arguments)); @@ -627,6 +731,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -637,6 +742,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } $block = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); unset($classes); @@ -671,6 +782,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -681,6 +793,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } $block = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); unset($classes); @@ -720,6 +838,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -730,6 +849,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } $block = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); unset($classes); @@ -789,6 +914,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -799,6 +925,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } $block = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); unset($classes); @@ -876,6 +1008,7 @@ class c_standard_path extends c_base_path { * If NULL, then this is not assigned. * @param string|null $extra_class * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. * If NULL, then this is not assigned. * * @return c_base_markup_tag @@ -886,6 +1019,12 @@ class c_standard_path extends c_base_path { if (is_string($extra_class)) { $classes[] = $extra_class; } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } $block = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_FIELD_SET, $id, $classes); unset($classes); @@ -906,12 +1045,77 @@ class c_standard_path extends c_base_path { } /** + * Creates the standard "field row". + * + * @param string|null $field_name + * If not NULL, then is text used to be displayed as the field name or label. + * @param string|null $field_value + * If not NULL, then is text used to be displayed as the field value or description. + * @param array $arguments + * (optional) An array of arguments to convert into text. + * @param string|null $id + * (optional) An ID attribute to assign. + * If NULL, then this is not assigned. + * @param string|null $extra_class + * (optional) An additional css class to append to the wrapping block. + * May be an array of classes to append. + * If NULL, then this is not assigned. + * @param int|null $row + * (optional) If not NULL, then is a row number to append as an additional class. + * @param bool $spacer + * (optional) If TRUE, then a special spacing class string is added between field name and value. + * This is intended to provide a way to have spacing if CSS is not used (unthemed/raw page). + * If a theme is then used, it can then set the spacer tab to be not displayed. + * If FALSE, this spacer tag is omitted. + * + * @return c_base_markup_tag + * The generated markup tag. + */ + protected function pr_create_tag_field_row($field_name = NULL, $field_value = NULL, $arguments = array(), $id = NULL, $extra_class = NULL, $row = NULL, $spacer = FALSE) { + $classes = array($this->settings['base_css'] . self::CSS_AS_FIELD_ROW, self::CSS_AS_FIELD_ROW); + if (is_string($extra_class)) { + $classes[] = $extra_class; + } + elseif (is_array($extra_class)) { + foreach ($extra_class as $class) { + $classes[] = $class; + } + unset($class); + } + + if (is_int($row)) { + $classes[] = self::CSS_AS_ROW . '-' . $row; + } + + $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, $id, $classes); + unset($classes); + + $tag_text = $this->pr_create_tag_text($field_name, $arguments, $id, self::CSS_AS_FIELD_ROW_NAME); + $tag->set_tag($tag_text); + unset($tag_text); + + if ($spacer) { + $this->pr_create_tag_spacer($tag); + } + + $tag_text = $this->pr_create_tag_text($field_value, $arguments, $id, self::CSS_AS_FIELD_ROW_VALUE); + $tag->set_tag($tag_text); + unset($tag_text); + + return $tag; + } + + /** * Create a new HTML markup class with default settings populated. * * @param bool $real_page * (optional) A real page is a page where content is being provided. * Examples of non-real pages are 404 pages. * Certain headers and settings are discluded on non-real pages, such as canonical urls. + * @param array $arguments_title + * (optional) An array of arguments to convert into text, passed to the title handling functions. + * @param array $arguments_script + * (optional) An array of arguments to convert into text, passed to the script handling functions. * * @return c_base_return_status * TRUE on success. @@ -927,13 +1131,13 @@ class c_standard_path extends c_base_path { * @see: self::pr_create_html_add_header_link_shortlink() * @see: self::pr_create_html_add_header_script() */ - protected function pr_create_html($real_page = TRUE) { + protected function pr_create_html($real_page = TRUE, $arguments_title = array(), $arguments_script = array()) { $this->html = new c_base_html(); $this->pr_create_html_add_primary_ids(); $this->pr_create_html_add_primary_classes(); $this->pr_create_html_add_lanaguages(); - $this->pr_create_html_add_title(); + $this->pr_create_html_add_title($arguments_title); $this->pr_create_html_add_header_base(); $this->pr_create_html_add_header_meta(); @@ -943,7 +1147,7 @@ class c_standard_path extends c_base_path { $this->pr_create_html_add_header_link_shortlink(); } - $this->pr_create_html_add_header_script(); + $this->pr_create_html_add_header_script($arguments_script); return new c_base_return_true(); } @@ -1034,10 +1238,13 @@ class c_standard_path extends c_base_path { /** * Create an HTML title tag. * + * @param array $arguments + * (optional) An array of arguments to convert into text. + * * @see: self::pr_create_html() */ - protected function pr_create_html_add_title() { - $title = $this->pr_get_text_title(); + protected function pr_create_html_add_title($arguments = array()) { + $title = $this->pr_get_text_title($arguments); if (is_string($title)) { $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_TITLE); @@ -1187,9 +1394,12 @@ class c_standard_path extends c_base_path { /** * Create an HTML script header tags. * + * @param array $arguments + * (optional) An array of arguments to convert into text. + * * @see: self::pr_create_html() */ - protected function pr_create_html_add_header_script() { + protected function pr_create_html_add_header_script($arguments = array()) { // provide a custom javascript for detecting if javascript is enabled and storing in a css class name. $tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_SCRIPT, 'f_standard_paths_hmtl_javascript_detection'); $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_TYPE, c_base_mime::TYPE_TEXT_JS); @@ -1207,6 +1417,20 @@ class c_standard_path extends c_base_path { } /** + * Appends a spacer to the specified tag. + * + * This is provided so that languages that do not use spacing may override this accordingly. + * + * @param c_base_markup_tag &$tag + * The markup tag to assign the spacer to. + */ + protected function pr_create_tag_spacer(&$tag) { + $tag_text = $this->pr_create_tag_text(' ', array(), NULL, self::CSS_AS_SPACER); + $tag->set_tag($tag_text); + unset($tag_text); + } + + /** * Add all menus to the page. */ protected function pr_add_menus() { diff --git a/common/standard/paths/u/ja/user_create.php b/common/standard/paths/u/ja/user_create.php index 3cd6368..6012cd2 100644 --- a/common/standard/paths/u/ja/user_create.php +++ b/common/standard/paths/u/ja/user_create.php @@ -15,8 +15,12 @@ class c_standard_path_user_create_ja extends c_standard_path_user_create { protected function pr_get_text($code, $arguments = array()) { $string = ''; switch ($code) { - case 0: - $string = ''; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'ユーザーをコピー:{user_name}'; + } + else { + $string = 'ユーザーを作成する'; + } break; } diff --git a/common/standard/paths/u/ja/user_delete.php b/common/standard/paths/u/ja/user_delete.php index 9140879..01b6023 100644 --- a/common/standard/paths/u/ja/user_delete.php +++ b/common/standard/paths/u/ja/user_delete.php @@ -16,7 +16,12 @@ class c_standard_path_user_delete_ja extends c_standard_path_user_delete { $string = ''; switch ($code) { case 0: - $string = ''; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'ユーザーを削除:{user_name}'; + } + else { + $string = 'ユーザーを削除する'; + } break; } diff --git a/common/standard/paths/u/ja/user_edit.php b/common/standard/paths/u/ja/user_edit.php index e7dc4cb..a8edae3 100644 --- a/common/standard/paths/u/ja/user_edit.php +++ b/common/standard/paths/u/ja/user_edit.php @@ -15,112 +15,11 @@ class c_standard_path_user_edit_ja extends c_standard_path_user_edit { protected function pr_get_text($code, $arguments = array()) { $string = ''; switch ($code) { - case 0: - $string = 'ダッシュボード'; - break; - case 1: - $string = ''; - break; - case 2: - $string = ''; - break; - case 3: - $string = ''; - break; - case 4: - $string = 'パブリック'; - break; - case 5: - $string = 'ユーザー'; - break; - case 6: - $string = 'リクエスタ'; - break; - case 7: - $string = 'ドレイター'; - break; - case 8: - $string = '編集者'; - break; - case 9: - $string = 'レビューア'; - break; - case 10: - $string = 'ファイナンサー'; - break; - case 11: - $string = '保険会社'; - break; - case 12: - $string = '出版社'; - break; - case 13: - $string = '審査員'; - break; - case 14: - $string = 'マネージャー'; - break; - case 15: - $string = '管理者'; - break; - case 16: - $string = 'Account Information'; - break; - case 17: - $string = 'Personal Information'; - break; - case 18: - $string = 'Access Information'; - break; - case 19: - $string = 'History Information'; - break; - case 20: - if (array_key_exists(':{user_name}', $arguments)) { - $string = 'ユーザーを表示 :{user_name}'; - } - else { - $string = 'ユーザーを表示'; - } - break; - case 21: - if (array_key_exists(':{user_name}', $arguments)) { - $string = 'ユーザーの編集 :{user_name}'; - } - else { - $string = 'ユーザーの編集'; - } - break; - case 22: - if (array_key_exists(':{user_name}', $arguments)) { - $string = 'ユーザーをキャンセルする :{user_name}'; - } - else { - $string = 'ユーザーをキャンセルする'; - } - break; - case 23: - if (array_key_exists(':{user_name}', $arguments)) { - $string = 'ユーザーを削除 :{user_name}'; - } - else { - $string = 'ユーザーを削除'; - } - break; - case 24: - if (array_key_exists(':{user_name}', $arguments)) { - $string = 'ユーザーを確認する :{user_name}'; - } - else { - $string = 'ユーザーを確認する'; - } - break; - case 25: if (array_key_exists(':{user_name}', $arguments)) { - $string = 'ユーザーを更新する :{user_name}'; + $string = 'ユーザーを編集:{user_name}'; } else { - $string = 'ユーザーを更新する'; + $string = 'ユーザーを編集する'; } break; } diff --git a/common/standard/paths/u/ja/user_lock.php b/common/standard/paths/u/ja/user_lock.php index ef2303e..77b552b 100644 --- a/common/standard/paths/u/ja/user_lock.php +++ b/common/standard/paths/u/ja/user_lock.php @@ -16,7 +16,12 @@ class c_standard_path_user_lock_ja extends c_standard_path_user_lock { $string = ''; switch ($code) { case 0: - $string = ''; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'ユーザーをロック:{user_name}'; + } + else { + $string = 'ユーザーをロックする'; + } break; } diff --git a/common/standard/paths/u/ja/user_unlock.php b/common/standard/paths/u/ja/user_unlock.php index 5bacc6a..95dece4 100644 --- a/common/standard/paths/u/ja/user_unlock.php +++ b/common/standard/paths/u/ja/user_unlock.php @@ -16,7 +16,12 @@ class c_standard_path_user_unlock_ja extends c_standard_path_user_unlock { $string = ''; switch ($code) { case 0: - $string = ''; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'ユーザーをロック解除:{user_name}'; + } + else { + $string = 'ユーザーをロック解除する'; + } break; } diff --git a/common/standard/paths/u/ja/user_view.php b/common/standard/paths/u/ja/user_view.php index 4f682d4..3ed6ec8 100644 --- a/common/standard/paths/u/ja/user_view.php +++ b/common/standard/paths/u/ja/user_view.php @@ -10,6 +10,12 @@ class c_standard_path_user_view_ja extends c_standard_path_user_view { /** + * Implements pr_create_tag_spacer(). + */ + protected function pr_create_tag_spacer(&$tag) { + } + + /** * Implements pr_get_text(). */ protected function pr_get_text($code, $arguments = array()) { @@ -17,7 +23,7 @@ class c_standard_path_user_view_ja extends c_standard_path_user_view { switch ($code) { case 0: if (array_key_exists(':{user_name}', $arguments)) { - $string = 'ユーザーを表示 :{user_name}'; + $string = 'ユーザーを表示:{user_name}'; } else { $string = 'ユーザーを表示'; @@ -59,6 +65,78 @@ class c_standard_path_user_view_ja extends c_standard_path_user_view { case 12: $string = '管理者'; break; + case 13: + $string = '口座情報'; + break; + case 14: + $string = '個人情報'; + break; + case 15: + $string = 'アクセス情報'; + break; + case 16: + $string = '履歴情報'; + break; + case 17: + $string = '身元'; + break; + case 18: + $string = '外部身元'; + break; + case 19: + $string = '名'; + break; + case 20: + $string = 'Eメール'; + break; + case 21: + $string = 'ロール'; + break; + case 22: + $string = 'ロール管理'; + break; + case 23: + $string = 'ロックされている'; + break; + case 24: + $string = '削除されました'; + break; + case 25: + $string = 'パブリックです'; + break; + case 26: + $string = 'プライベートです'; + break; + case 27: + $string = 'システム'; + break; + case 28: + $string = '作成日'; + break; + case 29: + $string = '日付変更'; + break; + case 30: + $string = '日付同期'; + break; + case 31: + $string = 'ロックされた日付'; + break; + case 32: + $string = '削除された日付'; + break; + case 33: + $string = 'はい'; + break; + case 34: + $string = 'いいえ'; + break; + case 35: + $string = '有効'; + break; + case 36: + $string = '無効'; + break; } if (!empty($arguments)) { diff --git a/common/standard/paths/u/login.php b/common/standard/paths/u/login.php index 889385a..79fad31 100644 --- a/common/standard/paths/u/login.php +++ b/common/standard/paths/u/login.php @@ -87,6 +87,8 @@ class c_standard_path_user_login extends c_standard_path { $this->html->set_tag($wrapper); unset($wrapper); + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); @@ -287,6 +289,8 @@ class c_standard_path_user_login extends c_standard_path { $this->html->set_tag($wrapper); unset($wrapper); + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); diff --git a/common/standard/paths/u/logout.php b/common/standard/paths/u/logout.php index c7537c3..9239b13 100644 --- a/common/standard/paths/u/logout.php +++ b/common/standard/paths/u/logout.php @@ -46,6 +46,8 @@ class c_standard_path_user_logout extends c_standard_path { $this->html->set_tag($wrapper); unset($wrapper); + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); diff --git a/common/standard/paths/u/user_create.php b/common/standard/paths/u/user_create.php index 8aaaae1..2417caa 100644 --- a/common/standard/paths/u/user_create.php +++ b/common/standard/paths/u/user_create.php @@ -34,6 +34,8 @@ class c_standard_path_user_create extends c_standard_path { $this->html->set_tag($wrapper); unset($wrapper); + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); @@ -66,7 +68,12 @@ class c_standard_path_user_create extends c_standard_path { $string = ''; switch ($code) { case 0: - $string = 'Create User'; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'Copy User: :{user_name}'; + } + else { + $string = 'Create User'; + } break; } diff --git a/common/standard/paths/u/user_delete.php b/common/standard/paths/u/user_delete.php index 0845b46..107766c 100644 --- a/common/standard/paths/u/user_delete.php +++ b/common/standard/paths/u/user_delete.php @@ -34,6 +34,8 @@ class c_standard_path_user_delete extends c_standard_path { $this->html->set_tag($wrapper); unset($wrapper); + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); @@ -66,7 +68,12 @@ class c_standard_path_user_delete extends c_standard_path { $string = ''; switch ($code) { case 0: - $string = 'Delete User'; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'Delete User: :{user_name}'; + } + else { + $string = 'Delete User'; + } break; } diff --git a/common/standard/paths/u/user_edit.php b/common/standard/paths/u/user_edit.php index e403f68..9a755f4 100644 --- a/common/standard/paths/u/user_edit.php +++ b/common/standard/paths/u/user_edit.php @@ -45,67 +45,17 @@ class c_standard_path_user_edit extends c_standard_path { $this->pr_assign_defaults($http, $database, $session, $settings); - $id_user = NULL; - $arguments = $this->pr_get_path_arguments(self::PATH_SELF); - if (!empty($arguments)) { - $arguments_total = count($arguments); - $argument = reset($arguments); - - if (is_numeric($argument)) { - $id_user = (int) $argument; - } - else { - unset($arguments_total); - unset($argument); - unset($id_user); - - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => self::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); - $executed->set_error($error); - - unset($error); - unset($arguments); - - return $executed; - } - - if ($arguments_total > 1) { - $argument = next($arguments); + $wrapper = $this->pr_create_tag_section(array(1 => 0)); - if ($argument == 'print') { - // @todo: execute custom print function and then return. - } - elseif ($argument == 'pdf') { - // @todo: execute custom pdf function and then return. - } - elseif ($argument == 'ps') { - // @todo: execute custom postscript function and then return. - } - } - unset($arguments_total); - unset($argument); - unset($id_user); + // initialize the content as HTML. + $this->pr_create_html(); + $this->html->set_tag($wrapper); + unset($wrapper); - $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => self::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH); - $executed->set_error($error); + $this->pr_add_menus(); - unset($error); - unset($arguments); - - return $executed; - } - unset($arguments); - - if (is_null($id_user)) { - // load current user - } - else { - // @todo: validate if user exists.unset($arguments_total); - - // @todo: on not found, provide page not found. - } - - $this->p_do_execute_view($executed, $this->p_get_user_id_current()); - unset($id_user); + $executed->set_output($this->html); + unset($this->html); return $executed; } @@ -136,71 +86,11 @@ class c_standard_path_user_edit extends c_standard_path { $string = ''; switch ($code) { case 0: - $string = 'User Settings'; - break; - case 1: - $string = ''; - break; - case 2: - $string = ''; - break; - case 3: - $string = ''; - break; - case 4: - $string = 'Public'; - break; - case 5: - $string = 'User'; - break; - case 6: - $string = 'Requester'; - break; - case 7: - $string = 'Drafter'; - break; - case 8: - $string = 'Editor'; - break; - case 9: - $string = 'Reviewer'; - break; - case 10: - $string = 'Financer'; - break; - case 11: - $string = 'Insurer'; - break; - case 12: - $string = 'Publisher'; - break; - case 13: - $string = 'Auditor'; - break; - case 14: - $string = 'Manager'; - break; - case 15: - $string = 'Administer'; - break; - case 16: - $string = 'Account Information'; - break; - case 17: - $string = 'Personal Information'; - break; - case 18: - $string = 'Access Information'; - break; - case 19: - $string = 'History Information'; - break; - case 20: if (array_key_exists(':{user_name}', $arguments)) { - $string = 'View User: :{user_name}'; + $string = 'Edit User: :{user_name}'; } else { - $string = 'View User'; + $string = 'Edit User'; } break; } @@ -211,42 +101,4 @@ class c_standard_path_user_edit extends c_standard_path { return $string; } - - /** - * Load and return the user argument - * - * @param array &$arguments - * The array of arguments to process. - * @param int $arguments_total - * The total number of arguments. - * @param bool &$found - * Boolean designating if the path is valid, otherwise page not found is returned. - * - * @return int - * The user id integer. - */ - private function p_get_argument_user(&$arguments, $arguments_total, &$found) { - $argument = 0; - if ($arguments_total == 1) { - // @todo: load current user id. - } - else { - $argument = next($arguments); - if (is_numeric($argument)) { - $argument = (int) $argument; - } - else { - $found = FALSE; - } - - // @todo: check the user id in the database. - } - - // if user id is 0, invalid, or a special case, then provide page not found. - if ($argument == 0) { - $found = FALSE; - } - - return $argument; - } } diff --git a/common/standard/paths/u/user_lock.php b/common/standard/paths/u/user_lock.php index f962a0f..daa9780 100644 --- a/common/standard/paths/u/user_lock.php +++ b/common/standard/paths/u/user_lock.php @@ -34,6 +34,8 @@ class c_standard_path_user_lock extends c_standard_path { $this->html->set_tag($wrapper); unset($wrapper); + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); @@ -66,7 +68,12 @@ class c_standard_path_user_lock extends c_standard_path { $string = ''; switch ($code) { case 0: - $string = 'Lock User'; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'Lock User: :{user_name}'; + } + else { + $string = 'Lock User'; + } break; } diff --git a/common/standard/paths/u/user_unlock.php b/common/standard/paths/u/user_unlock.php index d07d53a..d87bdfa 100644 --- a/common/standard/paths/u/user_unlock.php +++ b/common/standard/paths/u/user_unlock.php @@ -34,6 +34,8 @@ class c_standard_path_user_unlock extends c_standard_path { $this->html->set_tag($wrapper); unset($wrapper); + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); @@ -66,7 +68,12 @@ class c_standard_path_user_unlock extends c_standard_path { $string = ''; switch ($code) { case 0: - $string = 'Unlock User'; + if (array_key_exists(':{user_name}', $arguments)) { + $string = 'Unlock User: :{user_name}'; + } + else { + $string = 'Unlock User'; + } break; } diff --git a/common/standard/paths/u/user_view.php b/common/standard/paths/u/user_view.php index a4ef884..7f5362e 100644 --- a/common/standard/paths/u/user_view.php +++ b/common/standard/paths/u/user_view.php @@ -22,6 +22,9 @@ class c_standard_path_user_view extends c_standard_path { protected const CLASS_USER_VIEW_ACCESS = 'user_settings-access'; protected const CLASS_USER_VIEW_HISTORY = 'user_settings-history'; + protected const CLASS_ID_USER = 'id-user'; + protected const CLASS_ID_USER_EXTERNAL = 'id-user-external'; + /** * Implements do_execute(). */ @@ -215,6 +218,66 @@ class c_standard_path_user_view extends c_standard_path { case 16: $string = 'History Information'; break; + case 17: + $string = 'ID'; + break; + case 18: + $string = 'External ID'; + break; + case 19: + $string = 'Name'; + break; + case 20: + $string = 'E-mail'; + break; + case 21: + $string = 'Roles'; + break; + case 22: + $string = 'Role Management'; + break; + case 23: + $string = 'Is Locked'; + break; + case 24: + $string = 'Is Deleted'; + break; + case 25: + $string = 'Is Public'; + break; + case 26: + $string = 'Is Private'; + break; + case 27: + $string = 'Is System'; + break; + case 28: + $string = 'Date Created'; + break; + case 29: + $string = 'Date Changed'; + break; + case 30: + $string = 'Date Synchronized'; + break; + case 31: + $string = 'Date Locked'; + break; + case 32: + $string = 'Date Deleted'; + break; + case 33: + $string = 'Yes'; + break; + case 34: + $string = 'No'; + break; + case 35: + $string = 'Enabled'; + break; + case 36: + $string = 'Disabled'; + break; } if (!empty($arguments)) { @@ -239,24 +302,38 @@ class c_standard_path_user_view extends c_standard_path { unset($arguments[':{user_name}']); } - $wrapper = $this->pr_create_tag_section(array(1 => 0), $arguments); - unset($arguments); + $id_user = $user->get_id()->get_value(); + if (is_int($id_user)) { + $text_id_user = $this->pr_create_tag_text('[id: ' . $id_user . ']', array(), NULL, self::CLASS_ID_USER); + $wrapper = $this->pr_create_tag_section(array(1 => array('text' => 0, 'append-inside' => $text_id_user)), $arguments); + unset($text_id_user); + } + else { + $wrapper = $this->pr_create_tag_section(array(1 => 0), $arguments); + } + // initialize the content as HTML. - $this->pr_create_html(); + $this->pr_create_html(TRUE, $arguments); $this->html->set_tag($wrapper); unset($wrapper); + unset($arguments); // account information $fieldset = $this->pr_create_tag_fieldset(13, array(), self::CLASS_USER_VIEW_ACCOUNT, self::CLASS_USER_VIEW_ACCOUNT); $content = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_DIVIDER, self::CSS_AS_FIELD_SET_CONTENT, array(self::CSS_AS_FIELD_SET_CONTENT)); + $row = $this->pr_create_tag_field_row(17, '' . $id_user, array(), NULL, NULL, 0, TRUE); + $content->set_tag($row); + unset($row); + $fieldset->set_tag($content); unset($content); $this->html->set_tag($fieldset); unset($fieldset); + unset($id_user); // personal information @@ -295,6 +372,8 @@ class c_standard_path_user_view extends c_standard_path { // @todo add edit, cancel, etc.. links. + $this->pr_add_menus(); + $executed->set_output($this->html); unset($this->html); }