diff --git a/bl-kernel/admin/views/edit-user.php b/bl-kernel/admin/views/edit-user.php index ab46a39e..05c3b434 100644 --- a/bl-kernel/admin/views/edit-user.php +++ b/bl-kernel/admin/views/edit-user.php @@ -1,13 +1,13 @@ -'jsform', 'class'=>'tab-content')); ?> + 'jsform', 'class' => 'tab-content')); ?>
- p('Cancel') ?> + p('Cancel') ?>
- $L->g('Edit user'), 'icon'=>'user')); ?> + $L->g('Edit user'), 'icon' => 'user')); ?>
@@ -21,81 +21,81 @@ 'tokenCSRF', - 'value'=>$security->getTokenCSRF() - )); +// Token CSRF +echo Bootstrap::formInputHidden(array( + 'name' => 'tokenCSRF', + 'value' => $security->getTokenCSRF() +)); - // Username - echo Bootstrap::formInputHidden(array( - 'name'=>'username', - 'value'=>$user->username() - )); +// Username +echo Bootstrap::formInputHidden(array( + 'name' => 'username', + 'value' => $user->username() +)); ?>
- Profile picture preview + Profile picture preview
- $L->g('Password'))); + $L->g('Password'))); echo '
- '.$L->g('Change password').' + ' . $L->g('Change password') . '
'; - echo Bootstrap::formTitle(array('title'=>$L->g('Authentication Token'))); + echo Bootstrap::formTitle(array('title' => $L->g('Authentication Token'))); echo Bootstrap::formInputText(array( - 'name'=>'tokenAuth', - 'label'=>$L->g('Token'), - 'value'=>$user->tokenAuth(), - 'class'=>'', - 'tip'=>$L->g('this-token-is-similar-to-a-password-it-should-not-be-shared') + 'name' => 'tokenAuth', + 'label' => $L->g('Token'), + 'value' => $user->tokenAuth(), + 'class' => '', + 'tip' => $L->g('this-token-is-similar-to-a-password-it-should-not-be-shared') )); - if (checkRole(array('admin'),false)) { - echo Bootstrap::formTitle(array('title'=>$L->g('Status'))); + if (checkRole(array('admin'), false)) { + echo Bootstrap::formTitle(array('title' => $L->g('Status'))); echo Bootstrap::formInputText(array( - 'name'=>'status', - 'label'=>$L->g('Current status'), - 'value'=>$user->enabled()?$L->g('Enabled'):$L->g('Disabled'), - 'class'=>'', - 'disabled'=>true, - 'tip'=>$user->enabled()?'':$L->g('To enable the user you must set a new password') + 'name' => 'status', + 'label' => $L->g('Current status'), + 'value' => $user->enabled() ? $L->g('Enabled') : $L->g('Disabled'), + 'class' => '', + 'disabled' => true, + 'tip' => $user->enabled() ? '' : $L->g('To enable the user you must set a new password') )); if ($user->enabled()) { @@ -182,110 +182,119 @@
- - - + + +
'; } } - ?> + ?>
- 'twitter', - 'label'=>'Twitter', - 'value'=>$user->twitter(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'twitter', + 'label' => 'Twitter', + 'value' => $user->twitter(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'facebook', - 'label'=>'Facebook', - 'value'=>$user->facebook(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'facebook', + 'label' => 'Facebook', + 'value' => $user->facebook(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'codepen', - 'label'=>'CodePen', - 'value'=>$user->codepen(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'codepen', + 'label' => 'CodePen', + 'value' => $user->codepen(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'instagram', - 'label'=>'Instagram', - 'value'=>$user->instagram(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'instagram', + 'label' => 'Instagram', + 'value' => $user->instagram(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'gitlab', - 'label'=>'GitLab', - 'value'=>$user->gitlab(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'gitlab', + 'label' => 'GitLab', + 'value' => $user->gitlab(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'github', - 'label'=>'GitHub', - 'value'=>$user->github(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'github', + 'label' => 'GitHub', + 'value' => $user->github(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'linkedin', - 'label'=>'LinkedIn', - 'value'=>$user->linkedin(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'linkedin', + 'label' => 'LinkedIn', + 'value' => $user->linkedin(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'xing', - 'label'=>'Xing', - 'value'=>$user->xing(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'xing', + 'label' => 'Xing', + 'value' => $user->xing(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'mastodon', - 'label'=>'Mastodon', - 'value'=>$user->mastodon(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'telegram', + 'label' => 'Telegram', + 'value' => $user->telegram(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); echo Bootstrap::formInputText(array( - 'name'=>'vk', - 'label'=>'VK', - 'value'=>$user->vk(), - 'class'=>'', - 'placeholder'=>'', - 'tip'=>'' + 'name' => 'mastodon', + 'label' => 'Mastodon', + 'value' => $user->mastodon(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' )); - ?> + + echo Bootstrap::formInputText(array( + 'name' => 'vk', + 'label' => 'VK', + 'value' => $user->vk(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' + )); + ?>
@@ -304,4 +313,4 @@ //window.localStorage.removeItem("activeTab"); } }); - \ No newline at end of file + diff --git a/bl-kernel/admin/views/login.php b/bl-kernel/admin/views/login.php index 16d98970..22262cf7 100644 --- a/bl-kernel/admin/views/login.php +++ b/bl-kernel/admin/views/login.php @@ -34,4 +34,4 @@ echo ' echo ''; -echo '

' . $L->g('Powered by Bludit') . ((defined('BLUDIT_PRO')) ? ' PRO' : '') . '

' +echo '

' . $L->g('Powered by Bludit') . ((defined('BLUDIT_PRO')) ? ' PRO' : '') . '

'; diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index 5f5c5f79..76e3777a 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -415,6 +415,15 @@ echo Bootstrap::formInputHidden(array( 'tip' => '' )); + echo Bootstrap::formInputText(array( + 'name' => 'telegram', + 'label' => 'Telegram', + 'value' => $site->telegram(), + 'class' => '', + 'placeholder' => '', + 'tip' => '' + )); + echo Bootstrap::formInputText(array( 'name' => 'mastodon', 'label' => 'Mastodon', diff --git a/bl-kernel/helpers/theme.class.php b/bl-kernel/helpers/theme.class.php index 6140a440..28dc8f09 100644 --- a/bl-kernel/helpers/theme.class.php +++ b/bl-kernel/helpers/theme.class.php @@ -1,25 +1,27 @@ 'Github', - 'gitlab'=>'GitLab', - 'twitter'=>'Twitter', - 'facebook'=>'Facebook', - 'instagram'=>'Instagram', - 'codepen'=>'Codepen', - 'linkedin'=>'Linkedin', - 'xing'=>'Xing', - 'mastodon'=>'Mastodon', - 'vk'=>'VK', - 'dribbble'=>'Dribbble' + 'github' => 'Github', + 'gitlab' => 'GitLab', + 'twitter' => 'Twitter', + 'facebook' => 'Facebook', + 'instagram' => 'Instagram', + 'codepen' => 'Codepen', + 'linkedin' => 'Linkedin', + 'xing' => 'Xing', + 'telegram' => 'Telegram', + 'mastodon' => 'Mastodon', + 'vk' => 'VK', + 'dribbble' => 'Dribbble' ); - foreach ($socialNetworks as $key=>$label) { + foreach ($socialNetworks as $key => $label) { if (!$site->{$key}()) { unset($socialNetworks[$key]); } @@ -60,7 +62,7 @@ class Theme { public static function rssUrl() { if (pluginActivated('pluginRSS')) { - return DOMAIN_BASE.'rss.xml'; + return DOMAIN_BASE . 'rss.xml'; } return false; } @@ -68,7 +70,7 @@ class Theme { public static function sitemapUrl() { if (pluginActivated('pluginSitemap')) { - return DOMAIN_BASE.'sitemap.xml'; + return DOMAIN_BASE . 'sitemap.xml'; } return false; } @@ -91,9 +93,9 @@ class Theme { public static function metaTags($tag) { - if ($tag=='title') { + if ($tag == 'title') { return self::metaTagTitle(); - } elseif ($tag=='description') { + } elseif ($tag == 'description') { return self::metaTagDescription(); } } @@ -107,11 +109,11 @@ class Theme { global $WHERE_AM_I; global $page; - if ($WHERE_AM_I=='page') { + if ($WHERE_AM_I == 'page') { $format = $site->titleFormatPages(); $format = Text::replace('{{page-title}}', $page->title(), $format); $format = Text::replace('{{page-description}}', $page->description(), $format); - } elseif ($WHERE_AM_I=='tag') { + } elseif ($WHERE_AM_I == 'tag') { try { $tagKey = $url->slug(); $tag = new Tag($tagKey); @@ -120,8 +122,7 @@ class Theme { } catch (Exception $e) { // Tag doesn't exist } - - } elseif ($WHERE_AM_I=='category') { + } elseif ($WHERE_AM_I == 'category') { try { $categoryKey = $url->slug(); $category = new Category($categoryKey); @@ -138,7 +139,7 @@ class Theme { $format = Text::replace('{{site-slogan}}', $site->slogan(), $format); $format = Text::replace('{{site-description}}', $site->description(), $format); - return ''.$format.''.PHP_EOL; + return '' . $format . '' . PHP_EOL; } public static function metaTagDescription() @@ -150,9 +151,9 @@ class Theme { $description = $site->description(); - if ($WHERE_AM_I=='page') { + if ($WHERE_AM_I == 'page') { $description = $page->description(); - } elseif ($WHERE_AM_I=='category') { + } elseif ($WHERE_AM_I == 'category') { try { $categoryKey = $url->slug(); $category = new Category($categoryKey); @@ -162,7 +163,7 @@ class Theme { } } - return ''.PHP_EOL; + return '' . PHP_EOL; } // DEPRECATED v3.0.0 @@ -181,48 +182,48 @@ class Theme { public static function charset($charset) { - return ''.PHP_EOL; + return '' . PHP_EOL; } public static function viewport($content) { - return ''.PHP_EOL; + return '' . PHP_EOL; } - public static function src($file, $base=DOMAIN_THEME) + public static function src($file, $base = DOMAIN_THEME) { - return $base.$file; + return $base . $file; } - public static function css($files, $base=DOMAIN_THEME) + public static function css($files, $base = DOMAIN_THEME) { - if( !is_array($files) ) { + if (!is_array($files)) { $files = array($files); } $links = ''; - foreach($files as $file) { - $links .= ''.PHP_EOL; + foreach ($files as $file) { + $links .= '' . PHP_EOL; } return $links; } - public static function javascript($files, $base=DOMAIN_THEME, $attributes='') + public static function javascript($files, $base = DOMAIN_THEME, $attributes = '') { - if( !is_array($files) ) { + if (!is_array($files)) { $files = array($files); } $scripts = ''; - foreach($files as $file) { - $scripts .= ''.PHP_EOL; + foreach ($files as $file) { + $scripts .= '' . PHP_EOL; } return $scripts; } - public static function js($files, $base=DOMAIN_THEME, $attributes='') + public static function js($files, $base = DOMAIN_THEME, $attributes = '') { return self::javascript($files, $base, $attributes); } @@ -235,9 +236,9 @@ class Theme { } } - public static function favicon($file='favicon.png', $typeIcon='image/png') + public static function favicon($file = 'favicon.png', $typeIcon = 'image/png') { - return ''.PHP_EOL; + return '' . PHP_EOL; } public static function keywords($keywords) @@ -245,39 +246,38 @@ class Theme { if (is_array($keywords)) { $keywords = implode(',', $keywords); } - return ''.PHP_EOL; + return '' . PHP_EOL; } public static function jquery() { - return ''.PHP_EOL; + return '' . PHP_EOL; } - public static function jsBootstrap($attributes='') + public static function jsBootstrap($attributes = '') { - return ''.PHP_EOL; + return '' . PHP_EOL; } public static function cssBootstrap() { - return ''.PHP_EOL; + return '' . PHP_EOL; } public static function cssBootstrapIcons() { // https://icons.getbootstrap.com/ - return ''.PHP_EOL; + return '' . PHP_EOL; } public static function cssLineAwesome() { - return ''.PHP_EOL; + return '' . PHP_EOL; } - public static function jsSortable($attributes='') + public static function jsSortable($attributes = '') { // https://github.com/psfpro/bootstrap-html5sortable - return ''.PHP_EOL; + return '' . PHP_EOL; } - } diff --git a/bl-kernel/site.class.php b/bl-kernel/site.class.php index 25575e13..be916bbc 100644 --- a/bl-kernel/site.class.php +++ b/bl-kernel/site.class.php @@ -32,6 +32,7 @@ class Site extends dbJSON 'gitlab' => '', 'linkedin' => '', 'xing' => '', + 'telegram' => '', 'mastodon' => '', 'dribbble' => '', 'vk' => '', @@ -193,6 +194,11 @@ class Site extends dbJSON return $this->getField('xing'); } + public function telegram() + { + return $this->getField('telegram'); + } + public function mastodon() { return $this->getField('mastodon'); diff --git a/bl-kernel/user.class.php b/bl-kernel/user.class.php index e737c5da..66d834c4 100644 --- a/bl-kernel/user.class.php +++ b/bl-kernel/user.class.php @@ -1,6 +1,7 @@ vars['username'] = $username; - if ($username===false) { + if ($username === false) { $row = $users->getDefaultFields(); } else { if (Text::isEmpty($username) || !$users->exists($username)) { - $errorMessage = 'User not found in the database by username ['.$username.']'; - Log::set(__METHOD__.LOG_SEP.$errorMessage); + $errorMessage = 'User not found in the database by username [' . $username . ']'; + Log::set(__METHOD__ . LOG_SEP . $errorMessage); throw new Exception($errorMessage); } $row = $users->getUserDB($username); } - foreach ($row as $field=>$value) { + foreach ($row as $field => $value) { $this->setField($field, $value); } } @@ -145,6 +146,11 @@ class User { return $this->getValue('xing'); } + public function telegram() + { + return $this->getValue('xing'); + } + public function mastodon() { return $this->getValue('mastodon'); @@ -157,14 +163,14 @@ class User { public function profilePicture() { - $filename = $this->getValue('username').'.png'; - if (!file_exists(PATH_UPLOADS_PROFILES.$filename)) { + $filename = $this->getValue('username') . '.png'; + if (!file_exists(PATH_UPLOADS_PROFILES . $filename)) { return false; } - return DOMAIN_UPLOADS_PROFILES.$filename; + return DOMAIN_UPLOADS_PROFILES . $filename; } - public function json($returnsArray=false) + public function json($returnsArray = false) { $tmp['username'] = $this->username(); $tmp['firstName'] = $this->firstName(); @@ -179,6 +185,7 @@ class User { $tmp['gitlab'] = $this->gitlab(); $tmp['linkedin'] = $this->linkedin(); $tmp['xing'] = $this->xing(); + $tmp['telegram'] = $this->telegram(); $tmp['mastodon'] = $this->mastodon(); $tmp['vk'] = $this->vk(); $tmp['profilePicture'] = $this->profilePicture(); @@ -189,5 +196,4 @@ class User { return json_encode($tmp); } - -} \ No newline at end of file +} diff --git a/bl-themes/alternative/img/telegram.svg b/bl-themes/alternative/img/telegram.svg new file mode 100644 index 00000000..cc122b35 --- /dev/null +++ b/bl-themes/alternative/img/telegram.svg @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/bl-themes/blogx/img/telegram.svg b/bl-themes/blogx/img/telegram.svg new file mode 100644 index 00000000..cc122b35 --- /dev/null +++ b/bl-themes/blogx/img/telegram.svg @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/bl-themes/blogx/php/navbar.php b/bl-themes/blogx/php/navbar.php index da1a61e9..aef9c696 100644 --- a/bl-themes/blogx/php/navbar.php +++ b/bl-themes/blogx/php/navbar.php @@ -10,20 +10,20 @@ diff --git a/install.php b/install.php index 2a788b9d..b7896000 100644 --- a/install.php +++ b/install.php @@ -396,6 +396,7 @@ function install($adminPassword, $timezone) 'gitlab' => '', 'linkedin' => '', 'xing' => '', + 'telegram' => '', 'dateFormat' => 'F j, Y', 'extremeFriendly' => true, 'autosaveInterval' => 2, @@ -432,6 +433,7 @@ function install($adminPassword, $timezone) 'codepen' => '', 'linkedin' => '', 'xing' => '', + 'telegram' => '', 'github' => '', 'gitlab' => '' )