From 2ee58ff196d8657a272aca5aaa1520dec1fe1a4c Mon Sep 17 00:00:00 2001 From: Sonny Le Date: Fri, 1 Dec 2023 16:12:49 +0700 Subject: [PATCH] Add feature support SVG logo #484 --- framework/frontend/header/sticky.php | 2 +- framework/frontend/logo.php | 125 +++++++++++++++++++++++---- framework/options/header.xml | 8 +- language/en-GB/en-GB.astroid.ini | 32 ++++++- 4 files changed, 145 insertions(+), 22 deletions(-) diff --git a/framework/frontend/header/sticky.php b/framework/frontend/header/sticky.php index b9715d36..b474752e 100644 --- a/framework/frontend/header/sticky.php +++ b/framework/frontend/header/sticky.php @@ -68,7 +68,7 @@ include('offcanvas.trigger', ['offcanvas' => '#astroid-offcanvas', 'visibility' => $offcanvas_togglevisibility, 'effect' => $offcanvas_animation, 'direction' => $offcanvas_direction]); ?> '; ?> - include('logo'); ?> + include('logo', ['position' => 'sticky']); ?> @@ -82,26 +84,111 @@ - - <?php echo $sitename; ?> - - - <?php echo $sitename; ?> - + get('default_logo_width', ''); + $default_logo_height = $params->get('default_logo_height', '60px'); + $default_logo_style = !empty($default_logo_width) ? ' width="'.$default_logo_width.'"' : ''; + $default_logo_style .= !empty($default_logo_height) ? ' height="'.$default_logo_height.'"' : ''; + + // Mobile logo + $mobile_logo_width = $params->get('mobile_logo_width', ''); + $mobile_logo_height = $params->get('mobile_logo_height', '60px'); + $mobile_logo_style = !empty($mobile_logo_width) ? ' width="'.$mobile_logo_width.'"' : ''; + $mobile_logo_style .= !empty($mobile_logo_height) ? ' height="'.$mobile_logo_height.'"' : ''; - - <?php echo $sitename; ?> - - - <?php echo $sitename; ?> - + // Set style for image logo + $style = new Style('.astroid-logo'); + if (!empty($default_logo_width)) { + $style->child('> .astroid-logo-default')->addCss('max-width', $default_logo_width); + } + if (!empty($default_logo_height)) { + $style->child('> .astroid-logo-default')->addCss('max-height', $default_logo_height); + } + if (!empty($mobile_logo_width)) { + $style->child('> .astroid-logo-mobile')->addCss('max-width', $mobile_logo_width); + } + if (!empty($mobile_logo_height)) { + $style->child('> .astroid-logo-mobile')->addCss('max-height', $mobile_logo_height); + } + $style->render(); + ?> + <?php echo $sitename; ?>/i', '', $logo_svg); + echo $logo_svg; + } + } ?> + <?php echo $sitename; ?>/i', '', $logo_svg); + echo $logo_svg; + } + } ?> + <?php echo $sitename; ?>/i', '', $logo_svg); + echo $logo_svg; + } + } ?> + <?php echo $sitename; ?>/i', '', $logo_svg); + echo $logo_svg; + } + } ?> + + get('sticky_logo_width', ''); + $sticky_logo_height = $params->get('sticky_logo_height', '60px'); + $sticky_logo_style = !empty($sticky_logo_width) ? ' width="'.$sticky_logo_width.'"' : ''; + $sticky_logo_style .= !empty($sticky_logo_height) ? ' height="'.$sticky_logo_height.'"' : ''; - - <?php echo $sitename; ?> - - - <?php echo $sitename; ?> - + // Set style for image logo + $style = new Style('.astroid-logo > .astroid-logo-sticky'); + if (!empty($sticky_logo_width)) { + $style->addCss('max-width', $sticky_logo_width); + } + if (!empty($sticky_logo_height)) { + $style->addCss('max-height', $sticky_logo_height); + } + $style->render(); + ?> + <?php echo $sitename; ?>/i', '', $logo_svg); + echo $logo_svg; + } + } ?> + <?php echo $sitename; ?>/i', '', $logo_svg); + echo $logo_svg; + } + } ?> + diff --git a/framework/options/header.xml b/framework/options/header.xml index 5ee87537..9835a70c 100644 --- a/framework/options/header.xml +++ b/framework/options/header.xml @@ -187,17 +187,21 @@ - + + + + + @@ -212,6 +216,8 @@ + + diff --git a/language/en-GB/en-GB.astroid.ini b/language/en-GB/en-GB.astroid.ini index fc8ae8fc..c1f91e67 100644 --- a/language/en-GB/en-GB.astroid.ini +++ b/language/en-GB/en-GB.astroid.ini @@ -239,6 +239,7 @@ TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_LABEL="Background Type" TPL_ASTROID_ADVANCED_POPUUP_LAYOUT_SELECT_DESC="" TPL_ASTROID_BOOTSTRAP_JS_LABEL="Bootstrap JS Libraries" TPL_ASTROID_BOOTSTRAP_JS_DESC="Select Bootstrap JS Libraries which will be load in default" +TPL_ASTROID_BOOTSTRAP_JS_HINT_LABEL="Select Bootstrap libraries" ; Header Tab TPL_ASTROID_HEADER_ENABLE_HEADER_LABEL="Header Element" @@ -304,14 +305,26 @@ TPL_ASTROID_BASIC_DEFULT_LOGO_LABEL="Default Logo" TPL_ASTROID_BASIC_DEFULT_LOGO_DESC="Select an image for your logo." TPL_ASTROID_BASIC_DEFAULT_LOGO_DARK_LABEL="Default Logo (Dark Mode)" TPL_ASTROID_BASIC_DEFAULT_LOGO_DARK_DESC="Select an image for your logo in the dark mode." +TPL_ASTROID_BASIC_DEFAULT_LOGO_WIDTH_LABEL="Default Logo Width" +TPL_ASTROID_BASIC_DEFAULT_LOGO_WIDTH_DESC="Set max-width of Default Logo" +TPL_ASTROID_BASIC_DEFAULT_LOGO_HEIGHT_LABEL="Default Logo Height" +TPL_ASTROID_BASIC_DEFAULT_LOGO_HEIGHT_DESC="Set max-height of Default Logo" TPL_ASTROID_BASIC_MOBILE_LOGO_LABEL="Mobile Logo" TPL_ASTROID_BASIC_MOBILE_LOGO_DESC="Select an image for your mobile logo." TPL_ASTROID_BASIC_MOBILE_LOGO_DARK_LABEL="Mobile Logo (Dark Mode)" TPL_ASTROID_BASIC_MOBILE_LOGO_DARK_DESC="Select an image for your mobile logo in the dark mode." +TPL_ASTROID_BASIC_MOBILE_LOGO_WIDTH_LABEL="Mobile Logo Width" +TPL_ASTROID_BASIC_MOBILE_LOGO_WIDTH_DESC="Set max-width of Mobile Logo" +TPL_ASTROID_BASIC_MOBILE_LOGO_HEIGHT_LABEL="Mobile Logo Height" +TPL_ASTROID_BASIC_MOBILE_LOGO_HEIGHT_DESC="Set max-height of Mobile Logo" TPL_ASTROID_HEADER_STICKY_HEADER_LABEL="Sticky Header" TPL_ASTROID_HEADER_STICKY_HEADER_DESC="Here you can select the type of the Sticky Header for desktop view, tablet view and mobile view." TPL_ASTROID_BASIC_STICKY_HEADER_LOGO_LABEL="Sticky Header Logo" TPL_ASTROID_BASIC_STICKY_HEADER_LOGO_DESC="Select an image for your sticky header logo." +TPL_ASTROID_BASIC_STICKY_LOGO_WIDTH_LABEL="Sticky Logo Width" +TPL_ASTROID_BASIC_STICKY_LOGO_WIDTH_DESC="Set max-width of Sticky Logo" +TPL_ASTROID_BASIC_STICKY_LOGO_HEIGHT_LABEL="Sticky Logo Height" +TPL_ASTROID_BASIC_STICKY_LOGO_HEIGHT_DESC="Set max-height of Sticky Logo" TPL_ASTROID_BASIC_STICKY_HEADER_LOGO_DARK_LABEL="Sticky Header Logo (Dark Mode)" TPL_ASTROID_BASIC_STICKY_HEADER_LOGO_DARK_DESC="Select an image for your sticky header logo in the dark mode." TPL_ASTROID_HEADER_STICKY_HEADER_ENABLE_LABEL="Sticky Header" @@ -662,7 +675,7 @@ ASTROID_COLUMN_TITLE_LABEL="Column Title" ASTROID_COLUMN_SIZE_LABEL="Column Size" ASTROID_COLUMN_BREAKPOINT="Column Breakpoint" ASTROID_ELEMENT_CUSTOM_BACKGROUND_LABEL="Custom Background" -ASTROID_ELEMENT_CUSTOM_COLORS_LABEL="

Custom Colors

" +ASTROID_ELEMENT_CUSTOM_COLORS_LABEL="Custom Colors" ASTROID_ELEMENT_LAYOUT_CUSTOM_CLASS_LABEL="Layout Custom Class" ASTROID_ELEMENT_LAYOUT_SECTION_LAYOUT_LABEL="Section Layout" ASTROID_CONTAINER="Container" @@ -893,6 +906,14 @@ ASTROID_ADDTHIS_CODE_DESC="Paste your AddThis code to display sharing button on ASTROID_SHARETHIS_LBL="ShareThis" ASTROID_SHARETHIS_PID_LBL="Property ID" ASTROID_SHARETHIS_PID_DESC="Paste your ShareThis Property ID to display sharing button on the articles" +ASTROID_SHARE_DEFAULT_LBL="Default" +ASTROID_SHARE_BUTTONS_LBL="Social Buttons" +ASTROID_SHARE_BUTTONS_DESC="Select social share buttons for your article" +ASTROID_SHARE_BUTTONS_PLACEHOLDER_LBL="Select Social Buttons" +ASTROID_SHARE_FACEBOOK_LBL="Facebook" +ASTROID_SHARE_X_LBL="X" +ASTROID_SHARE_LINKEDIN_LBL="LinkedIn" +ASTROID_SHARE_PINTEREST_LBL="Pinterest" ASTROID_VIDEO_TYPE="Video Type" ASTROID_VIDEO_TYPE_DESC="Select between YouTube and Vimeo to use video on an article." @@ -1066,3 +1087,12 @@ ASTROID_TABS_FRONTEND_VISIBILTY="Frontend Visibility of Astroid tabs" TPL_ASTROID_MINIFYJS_EXCLUDES_LABEL="Exclude JS Files" TPL_ASTROID_MINIFYJS_EXCLUDES_DESC="Add comma separated filesnames to exclude files from JS minification. You can add filename directly or use available filename patterns:
*.min.js
jquery.*
*bootstrap*" + +; Widgets +ASTROID_WIDGET_HEADING_LABEL="Heading" +ASTROID_WIDGET_HEADING_DESC="Define different styles for headings" +ASTROID_WIDGET_STYLES_LABEL="Widget Styles" +ASTROID_WIDGET_HTML_ELEMENT_LABEL="HTML Element" +ASTROID_WIDGET_FONT_STYLES_LABEL="Font Styles" +ASTROID_WIDGET_HEADING_USE_LINK_LABEL="Use Link" +ASTROID_WIDGET_HEADING_USE_LINK_DESC="Add link to your heading" \ No newline at end of file