Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Text Widget, Improve modal style
- Loading branch information
Showing
11 changed files
with
125 additions
and
32 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* @package Astroid Framework | ||
* @author Astroid Framework Team https://astroidframe.work | ||
* @copyright Copyright (C) 2023 AstroidFrame.work. | ||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later | ||
* DO NOT MODIFY THIS FILE DIRECTLY AS IT WILL BE OVERWRITTEN IN THE NEXT UPDATE | ||
* You can easily override all files under /astroid/ folder. | ||
* Just copy the file to JROOT/templates/YOUR_ASTROID_TEMPLATE/astroid/elements/module_position/module_position.php folder to create and override | ||
*/ | ||
|
||
// No direct access. | ||
defined('_JEXEC') or die; | ||
use Astroid\Helper\Style; | ||
extract($displayData); | ||
$title = $params->get('heading', ''); | ||
$html_element = $params->get('html_element', 'h2'); | ||
$font_style = $params->get('font_style', null); | ||
$heading_margin = $params->get('heading_margin', ''); | ||
$content = $params->get('content', ''); | ||
$content_font_style= $params->get('content_font_style', null); | ||
|
||
if (!empty($title)) { | ||
echo '<'.$html_element.' class="astroid-content-heading">'. $title . '</'.$html_element.'>'; | ||
} | ||
if (!empty($content)) { | ||
echo '<div class="astroid-content-text">'. $content . '</div>'; | ||
} | ||
|
||
if (!empty($font_style)) { | ||
Style::renderTypography('#'.$element->id.' > .astroid-content-heading', $font_style); | ||
} | ||
if (!empty($heading_margin)) { | ||
$heading_style = new Style('#'.$element->id.' > .astroid-content-heading'); | ||
$margin = \json_decode($heading_margin, false); | ||
foreach ($margin as $device => $props) { | ||
$heading_style->addStyle(Style::spacingValue($props, "margin"), $device); | ||
} | ||
$heading_style->render(); | ||
} | ||
|
||
if (!empty($content_font_style)) { | ||
Style::renderTypography('#'.$element->id.' > .astroid-content-text', $content_font_style); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<element> | ||
<title>ASTROID_WIDGET_TEXT_LABEL</title> | ||
<description>ASTROID_WIDGET_TEXT_DESC</description> | ||
<icon>fa-solid fa-font</icon> | ||
<category>Widgets</category> | ||
<form> | ||
<fields> | ||
<fieldset name="general-settings" label="TPL_ASTROID_GENERAL_SETTINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields"> | ||
<field type="astroidgroup" name="content_options" title="ASTROID_WIDGET_CONTENT_OPTIONS_LABEL"/> | ||
<field astroidgroup="general" type="astroidtext" label="ASTROID_WIDGET_HEADING_LABEL" description="ASTROID_WIDGET_HEADING_CONTENT_DESC" name="heading"/> | ||
<field astroidgroup="general" ngShow="[heading]!==''" name="html_element" type="astroidlist" label="ASTROID_WIDGET_HTML_ELEMENT_LABEL" default="h2"> | ||
<option value="h1">h1</option> | ||
<option value="h2">h2</option> | ||
<option value="h3">h3</option> | ||
<option value="h4">h4</option> | ||
<option value="h5">h5</option> | ||
<option value="h6">h6</option> | ||
<option value="div">div</option> | ||
</field> | ||
<field astroidgroup="general" ngShow="[heading]!==''" name="font_style" label="ASTROID_WIDGET_FONT_STYLES_LABEL" type="astroidtypography" columns="1" preview="false"/> | ||
<field astroidgroup="general" ngShow="[heading]!==''" name="heading_margin" type="astroidspacing" label="ASTROID_WIDGET_MARGIN_LABEL" /> | ||
|
||
<field astroidgroup="content_options" code="html" name="content" type="astroidtextarea" label="ASTROID_WIDGET_CONTENT_LABEL"/> | ||
<field astroidgroup="content_options" ngShow="[content]!==''" name="content_font_style" label="ASTROID_WIDGET_FONT_STYLES_LABEL" type="astroidtypography" columns="1" preview="false"/> | ||
</fieldset> | ||
</fields> | ||
</form> | ||
</element> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters