From b8fa0246803dab40cf57d40b45984c53046f2d55 Mon Sep 17 00:00:00 2001 From: "Dzial Techniczny WMW Projekt s.c" Date: Tue, 10 Dec 2019 11:34:53 +0100 Subject: Plugins directory and local modifications --- plugins/Customizer/Helper/DynamicAvatar.php | 59 ++++++++++++++++++++++++++ plugins/Customizer/Helper/ThemeHelper.php | 64 +++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 plugins/Customizer/Helper/DynamicAvatar.php create mode 100644 plugins/Customizer/Helper/ThemeHelper.php (limited to 'plugins/Customizer/Helper') diff --git a/plugins/Customizer/Helper/DynamicAvatar.php b/plugins/Customizer/Helper/DynamicAvatar.php new file mode 100644 index 00000000..cf7ab83f --- /dev/null +++ b/plugins/Customizer/Helper/DynamicAvatar.php @@ -0,0 +1,59 @@ +avatarManager->renderDefault($size); + } else { + $html = $this->avatarManager->render($user_id, $username, $name, $email, $avatar_path, $size); + } + return '
'.$html.'
'; + } + + public function dynamic($user_id, $username, $name, $email, $avatar_path, $css = '', $size) + { + return $this->dynamicRender($user_id, $username, $name, $email, $avatar_path, $css, $size); + } + + public function currentUserDynamic($css = '') + { + $user = $this->userSession->getAll(); + return $this->dynamic($user['id'], $user['username'], $user['name'], $user['email'], $user['avatar_path'], $css, $this->configModel->get('av_size', '20')); + } + + public function boardDynamicRender($user_id, $username, $name, $email, $avatar_path, $css = 'avatar-left', $size = 48) + { + if (empty($user_id) && empty($username)) { + $html = $this->avatarManager->renderDefault($size); + } else { + $html = $this->avatarManager->render($user_id, $username, $name, $email, $avatar_path, $size); + } + return '
'.$html.'
'; + } + + public function boardDynamic($user_id, $username, $name, $email, $avatar_path, $css = '', $size) + { + return $this->boardDynamicRender($user_id, $username, $name, $email, $avatar_path, $css, $size); + } + + public function boardCurrentUserDynamic($css = '') + { + $user = $this->userSession->getAll(); + return $this->boardDynamic($user['id'], $user['username'], $user['name'], $user['email'], $user['avatar_path'], $css, $this->configModel->get('b_av_size', '20')); + } + + + } diff --git a/plugins/Customizer/Helper/ThemeHelper.php b/plugins/Customizer/Helper/ThemeHelper.php new file mode 100644 index 00000000..c2f767d1 --- /dev/null +++ b/plugins/Customizer/Helper/ThemeHelper.php @@ -0,0 +1,64 @@ +'; + foreach ($options as $id => $value) { + $html .= ''; + } + $html .= ''; + $html .= $this->errorList($errors, $name); + return $html; + } + + public function reverseSelectOnChange($name, array $options, array $values = array(), array $errors = array(), array $attributes = array(), $class = '') + { + $html = ''; + $html .= $this->errorList($errors, $name); + return $html; + } + + private function errorClass(array $errors, $name) + { + return ! isset($errors[$name]) ? '' : ' form-error'; + } + + private function errorList(array $errors, $name) + { + $html = ''; + if (isset($errors[$name])) { + $html .= ''; + } + return $html; + } + + } -- cgit v1.2.3