diff --git a/administrator/language/en-GB/plg_sampledata_blog.ini b/administrator/language/en-GB/plg_sampledata_blog.ini index f24fbec679672..6613a8ebcc6f4 100644 --- a/administrator/language/en-GB/plg_sampledata_blog.ini +++ b/administrator/language/en-GB/plg_sampledata_blog.ini @@ -10,22 +10,45 @@ PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_0_FULLTEXT="" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_0_INTROTEXT="

This tells you a bit about this blog and the person who writes it.

When you are logged in you will be able to edit this page by selecting the edit icon.

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_0_TITLE="About" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_FULLTEXT="" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_INTROTEXT="

Here are some basic tips for working on your site.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_INTROTEXT="

Here are some basic tips for working on your site.

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_TITLE="Working on Your Site" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_10_FULLTEXT="" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_10_INTROTEXT="

Colour Scheme

secondary primary info success warning danger

text-secondary text-primary text-info text-success text-warning text-danger

Typography (h1)

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)

Lorem Ipsum Dolor Sit Amet (h2)

Lorem ipsum dolor sit amet, consectetuer adipiscing elit (strong), sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)

Lorem Ipsum Dolor Sit Amet (h3)

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)

Lorem Ipsum Dolor Sit Amet (h4)

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)

Lorem Ipsum Dolor Sit Amet (h5)

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex. (p)

Lorem ipsum dolor (a)

Lists

(ol)(li)

  1. Lorem ipsum dolor sit amet consectetur
  2. Lorem ipsum dolor sit amet consectetur

(ul)(li)

Displays

Lorem (display-1)

Lorem (display-2)

Lorem ipsum (display-3)

Lorem ipsum (display-4)

Lorem ipsum arma virumque cano (lead)

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_10_TITLE="Typography" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_FULLTEXT="" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_INTROIMAGE_ALT="Amazing Andromeda Galaxy" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_INTROTEXT="

This is a sample blog posting.

If you log in to the site (the Author Login link is on the very bottom of this page) you will be able to edit it and all of the other existing articles. You will also be able to create a new article and make other changes to the site.

As you add and modify articles you will see how your site changes and also how you can customise it in various ways.

Go ahead, you can't break it.

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_TITLE="Welcome to your blog" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_FULLTEXT="

On the full page you will see both the introductory content and the rest of the article. You can change the settings to hide the introduction if you want.

" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_INTROTEXT="

Your home page is set to display the four most recent articles from the blog category in a column. Then there are links to the next two oldest articles. You can change those numbers by editing the content options settings in the blog tab in your site administrator. There is a link to your site administrator in the top menu.

If you want to have your blog post broken into two parts, an introduction and then a full length separate page, use the Read More button to insert a break.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_FIELD_0="Uurnip greens yarrow ricebean endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado daikon napa cabbage asparagus winter purslane kale." +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_FULLTEXT="

On the full page you will see both the introductory content and the rest of the article. You can change the settings to hide the introduction if you want.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_INTROTEXT="

Your home page is set to display the four most recent articles from the blog category in a column. Then there are links to the next two oldest articles. You can change those numbers by editing the content options settings in the blog tab in your site administrator. There is a link to your site administrator in the top menu.

If you want to have your blog post broken into two parts, an introduction and then a full length separate page, use the Read More span to insert a break.

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_TITLE="About your home page" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_4_FULLTEXT="" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_4_INTROTEXT="

Your site has some commonly used modules already preconfigured. These include:

Each of these modules has many options which you can experiment with in the Module Manager in your site Administrator. Moving your mouse over a module and selecting the edit icon will take you to an edit screen for that module. Always be sure to save and close any module you edit.

Joomla! also includes many other modules you can incorporate in your site. As you develop your site you may want to add more module that you can find at the Joomla Extensions Directory.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_4_FULLTEXTIMAGE_ALT="Crab Nebula" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_4_INTROTEXT="

Your site has some commonly used modules already preconfigured.

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_4_TITLE="Your Modules" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_5_FULLTEXT="" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_5_INTROTEXT="

Templates control the look and feel of your website.

This blog is installed with the Protostar template.

You can edit the options by selecting the Working on Your Site, Template Settings link in the top menu (visible when you login).

For example you can change the site background colour, highlights colour, site title, site description and title font used.

More options are available in the site administrator. You may also install a new template using the extension manager.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_5_INTROTEXT="

Templates control the look and feel of your website.

This blog is installed with the Cassiopeia template.

You can edit the options by selecting the Working on Your Site, Template Settings link in the top menu (visible when you login).

For example you can change the site background colour, highlights colour, site title, site description and title font used.

More options are available in the site administrator. You may also install a new template using the extension manager.

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_5_TITLE="Your Template" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_6_FULLTEXT="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est " +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_6_INTROTEXT="

Millions of Websites are built on Joomla!

Learn more about beautiful blog presentation.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_6_TITLE="Millions" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_7_FULLTEXT="

Uurnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado daikon napa cabbage asparagus winter purslane kale. Celery potato scallion desert raisin horseradish spinach carrot soko. Lotus root water spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin onion chickpea gram corn pea. Brussels sprout coriander water chestnut gourd swiss chard wakame kohlrabi beetroot carrot watercress. Corn amaranth salsify bunya nuts nori azuki bean chickweed potato bell pepper artichoke.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_7_INTROTEXT="

We love Joomla to the moon and back!

Thank you to all volunteers who have contributed!

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_7_TITLE="Love" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_8_FULLTEXT="

Cupcake ipsum dolor. Sit amet cotton candy ice cream sesame snaps cake marshmallow powder. Ice cream chocolate cake marshmallow halvah bonbon. Dragée carrot cake danish candy muffin brownie. Candy sugar plum ice cream chupa chups macaroon tiramisu soufflé oat cake. Topping cheesecake lollipop gummi bears icing sweet roll donut liquorice. Pie jelly-o candy donut oat cake cotton candy.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_8_INTROTEXT="

We proudly present Joomla Version 4!

Learn more about workflows in Joomla.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_8_TITLE="Joomla" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_9_FIELD_0="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_9_FULLTEXT="" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_9_INTROTEXT="

Workflows manage the stages your articles must go through until they are published.
We have activated a workflow for the sample data blog.
In the administration process your articles through the different stages.

" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_9_TITLE="New feature: Workflows" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_0_TITLE="Blog" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_1_TITLE="Help" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_2_TITLE="Joomla" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_3_TITLE="Typography" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_FIELDS_FIELD_0_TITLE="About the Author" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_FIELDS_GROUP_TITLE="The Author" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_SAMPLE_DESCRIPTION="Blog writing workflow from idea until published and online. Roles: Content Strategist, Copywriter, Graphic Designer, Subject Expert, Content Editor." PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_SAMPLE_TITLE="Blog Workflow" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE1_DESCRIPTION="Basic stage. Every newly submitted article for Blog." @@ -73,19 +96,23 @@ PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_TRANSITION9_DESCRIPTION="An arti PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_TRANSITION9_TITLE="Resume Idea" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_0_TITLE="Blog" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_10_TITLE="Template Settings" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_11_TITLE="Sample Layouts" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_12_TITLE="Category List" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_13_TITLE="Articles" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_14_TITLE="Typography" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_1_TITLE="About" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_2_TITLE="Author Login" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_2_TITLE="Login" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_3_TITLE="Create a Post" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_4_TITLE="Working on Your Site" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_5_TITLE="Site Administrator" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_6_TITLE="Change Password" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_7_TITLE="Log out" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_8_TITLE="Author Login" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_8_TITLE="Login" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_9_TITLE="Site Settings" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_0_DESCRIPTION="The main menu for the site" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_0_TITLE="Main Menu Blog" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_1_DESCRIPTION="" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_1_TITLE="Author Menu" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_1_TITLE="Admin Menu" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_2_DESCRIPTION="" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_2_TITLE="Bottom Menu" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_0_TITLE="Main Menu Blog" @@ -95,13 +122,18 @@ PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_12_TITLE="Release News" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_1_TITLE="Author Menu" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_2_TITLE="Syndication" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_3_TITLE="Archived Articles" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_4_TITLE="Most Read Posts" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_4_TITLE="Latest Posts" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_5_TITLE="Older Posts" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_6_TITLE="Bottom Menu" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_7_TITLE="Search" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_8_CONTENT="

Welcome to Joomla on Cassiopeia!

You have chosen one of the most powerful CMS Systems in the world.

Cassiopeia is the multi-purpose frontend template for Joomla 4.

Typography »

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_8_TITLE="Image" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_9_TITLE="Popular Tags" -PLG_SAMPLEDATA_BLOG_STEP1_SUCCESS="Step 1: Articles done!" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_TAG_0_TITLE="Millions" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_TAG_1_TITLE="Love" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_TAG_2_TITLE="Joomla V4" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_TAG_3_TITLE="New Feature Workflow" +PLG_SAMPLEDATA_BLOG_STEP1_SUCCESS="Step 1: Tags, Articles, Fields and Workflow done!" PLG_SAMPLEDATA_BLOG_STEP2_SUCCESS="Step 2: Menus done!" PLG_SAMPLEDATA_BLOG_STEP3_SUCCESS="Step 3: Modules done!" PLG_SAMPLEDATA_BLOG_STEP4_SUCCESS="Blog Sample Data has been installed!" diff --git a/build/build-modules-js/compilecss.es6.js b/build/build-modules-js/compilecss.es6.js index 645791afa680e..252a6e4fc38f7 100644 --- a/build/build-modules-js/compilecss.es6.js +++ b/build/build-modules-js/compilecss.es6.js @@ -44,6 +44,11 @@ module.exports.compile = (options, path) => { `${RootPath}/templates/cassiopeia/scss/offline.scss`, `${RootPath}/templates/cassiopeia/scss/template.scss`, `${RootPath}/templates/cassiopeia/scss/template-rtl.scss`, + `${RootPath}/templates/cassiopeia/scss/global/fonts-local_roboto.scss`, + `${RootPath}/templates/cassiopeia/scss/global/fonts-web_fira-sans.scss`, + `${RootPath}/templates/cassiopeia/scss/global/fonts-web_roboto+noto-sans.scss`, + `${RootPath}/templates/cassiopeia/scss/global/colors_standard.scss`, + `${RootPath}/templates/cassiopeia/scss/global/colors_alternative.scss`, `${RootPath}/templates/cassiopeia/scss/system/searchtools/searchtools.scss`, `${RootPath}/templates/cassiopeia/scss/vendor/choicesjs/choices.scss`, `${RootPath}/templates/cassiopeia/scss/vendor/joomla-custom-elements/joomla-alert.scss`, diff --git a/build/media_source/templates/cassiopeia/js/mod_menu/menu-metismenu.es6.js b/build/media_source/templates/cassiopeia/js/mod_menu/menu-metismenu.es6.js new file mode 100644 index 0000000000000..9aa0c90df8e2d --- /dev/null +++ b/build/media_source/templates/cassiopeia/js/mod_menu/menu-metismenu.es6.js @@ -0,0 +1,25 @@ +/** + * @package Joomla.Site + * @subpackage Templates.cassiopeia + * @copyright (C) 2020 Open Source Matters, Inc. + * @license GNU General Public License version 2 or later; see LICENSE.txt + * @since 4.0 + */ + +document.addEventListener('DOMContentLoaded', () => { + const allMenus = document.querySelectorAll('ul.mod-menu_dropdown-metismenu'); + + allMenus.forEach((menu) => { + // eslint-disable-next-line no-new, no-undef + const mm = new MetisMenu(menu, { + triggerElement: 'button.mm-toggler', + }).on('shown.metisMenu', (event) => { + window.addEventListener('click', function mmClick(e) { + if (!event.target.contains(e.target)) { + mm.hide(event.detail.shownElement); + window.removeEventListener('click', mmClick); + } + }); + }); + }); +}); diff --git a/images/sampledata/cassiopeia/nasa1-1200.jpg b/images/sampledata/cassiopeia/nasa1-1200.jpg new file mode 100644 index 0000000000000..4ed2784a30b7e Binary files /dev/null and b/images/sampledata/cassiopeia/nasa1-1200.jpg differ diff --git a/images/sampledata/cassiopeia/nasa1-400.jpg b/images/sampledata/cassiopeia/nasa1-400.jpg new file mode 100644 index 0000000000000..b3f9a8ec66232 Binary files /dev/null and b/images/sampledata/cassiopeia/nasa1-400.jpg differ diff --git a/images/sampledata/cassiopeia/nasa1-640.jpg b/images/sampledata/cassiopeia/nasa1-640.jpg new file mode 100644 index 0000000000000..10ae0f4aaecc3 Binary files /dev/null and b/images/sampledata/cassiopeia/nasa1-640.jpg differ diff --git a/images/sampledata/cassiopeia/nasa2-1200.jpg b/images/sampledata/cassiopeia/nasa2-1200.jpg new file mode 100644 index 0000000000000..fffc8eda31178 Binary files /dev/null and b/images/sampledata/cassiopeia/nasa2-1200.jpg differ diff --git a/images/sampledata/cassiopeia/nasa2-400.jpg b/images/sampledata/cassiopeia/nasa2-400.jpg new file mode 100644 index 0000000000000..4f9faf2cbf81d Binary files /dev/null and b/images/sampledata/cassiopeia/nasa2-400.jpg differ diff --git a/images/sampledata/cassiopeia/nasa2-640.jpg b/images/sampledata/cassiopeia/nasa2-640.jpg new file mode 100644 index 0000000000000..832ac2cb1229d Binary files /dev/null and b/images/sampledata/cassiopeia/nasa2-640.jpg differ diff --git a/images/sampledata/cassiopeia/nasa3-1200.jpg b/images/sampledata/cassiopeia/nasa3-1200.jpg new file mode 100644 index 0000000000000..be88461c7b554 Binary files /dev/null and b/images/sampledata/cassiopeia/nasa3-1200.jpg differ diff --git a/images/sampledata/cassiopeia/nasa3-400.jpg b/images/sampledata/cassiopeia/nasa3-400.jpg new file mode 100644 index 0000000000000..0bc077ca20b3e Binary files /dev/null and b/images/sampledata/cassiopeia/nasa3-400.jpg differ diff --git a/images/sampledata/cassiopeia/nasa3-640.jpg b/images/sampledata/cassiopeia/nasa3-640.jpg new file mode 100644 index 0000000000000..168c0e6d496b0 Binary files /dev/null and b/images/sampledata/cassiopeia/nasa3-640.jpg differ diff --git a/images/sampledata/cassiopeia/nasa4-1200.jpg b/images/sampledata/cassiopeia/nasa4-1200.jpg new file mode 100644 index 0000000000000..c5a4f8c9e4331 Binary files /dev/null and b/images/sampledata/cassiopeia/nasa4-1200.jpg differ diff --git a/images/sampledata/cassiopeia/nasa4-400.jpg b/images/sampledata/cassiopeia/nasa4-400.jpg new file mode 100644 index 0000000000000..d12623880896c Binary files /dev/null and b/images/sampledata/cassiopeia/nasa4-400.jpg differ diff --git a/images/sampledata/cassiopeia/nasa5-400.jpg b/images/sampledata/cassiopeia/nasa5-400.jpg new file mode 100644 index 0000000000000..7b1332a01004f Binary files /dev/null and b/images/sampledata/cassiopeia/nasa5-400.jpg differ diff --git a/language/en-GB/tpl_cassiopeia.ini b/language/en-GB/tpl_cassiopeia.ini index dc8eb3ebec1be..3065cbbb665d6 100644 --- a/language/en-GB/tpl_cassiopeia.ini +++ b/language/en-GB/tpl_cassiopeia.ini @@ -6,11 +6,19 @@ CASSIOPEIA="Cassiopeia Site template" TPL_CASSIOPEIA_BACKTOTOP="Back to Top" TPL_CASSIOPEIA_BACKTOTOP_LABEL="Back-to-top Link" +TPL_CASSIOPEIA_COLOR_NAME_ALTERNATIVE="Alternative" +TPL_CASSIOPEIA_COLOR_NAME_LABEL="Colour Theme" +TPL_CASSIOPEIA_COLOR_NAME_STANDARD="Standard" TPL_CASSIOPEIA_FLUID="Fluid" TPL_CASSIOPEIA_FLUID_LABEL="Layout" +TPL_CASSIOPEIA_FONT_GROUP_LOCAL="Fonts from Folder" +TPL_CASSIOPEIA_FONT_GROUP_WEB="Fonts from Web" +TPL_CASSIOPEIA_FONT_LABEL="Fonts Scheme" +TPL_CASSIOPEIA_FONT_NOTE_TEXT="Loading fonts from external sources might be against privacy regulations in some countries.
Loading fonts from a local folder might have a performance impact on your site." TPL_CASSIOPEIA_LOGO_LABEL="Logo" TPL_CASSIOPEIA_STATIC="Static" TPL_CASSIOPEIA_STICKY_LABEL="Sticky Header" +TPL_CASSIOPEIA_TAGLINE="Tagline" TPL_CASSIOPEIA_TITLE="Title (alternative to logo)" TPL_CASSIOPEIA_TOGGLE="Toggle Navigation" TPL_CASSIOPEIA_XML_DESCRIPTION="Continuing the space theme (Solarflare from 1.0, Milkyway from 1.5 and Protostar from 3.0), Cassiopeia is the Joomla 4 site template based on Bootstrap 4." diff --git a/language/en-GB/tpl_cassiopeia.sys.ini b/language/en-GB/tpl_cassiopeia.sys.ini index 8e1e0f21041bf..7ffa329fc51a5 100644 --- a/language/en-GB/tpl_cassiopeia.sys.ini +++ b/language/en-GB/tpl_cassiopeia.sys.ini @@ -4,6 +4,7 @@ ; Note : All ini files need to be saved as UTF-8 CASSIOPEIA="Cassiopeia Site template" +TPL_CASSIOPEIA_MOD_MENU_LAYOUT_DROPDOWN-METISMENU="Dropdown" TPL_CASSIOPEIA_POSITION_BANNER="Banner" TPL_CASSIOPEIA_POSITION_BOTTOM-A="Bottom-a" TPL_CASSIOPEIA_POSITION_BOTTOM-B="Bottom-b" diff --git a/plugins/sampledata/blog/blog.php b/plugins/sampledata/blog/blog.php index edcaf18b4fcbf..91602a5a6560d 100644 --- a/plugins/sampledata/blog/blog.php +++ b/plugins/sampledata/blog/blog.php @@ -101,12 +101,11 @@ public function onAjaxSampledataApplyStep1() return; } - if (!ComponentHelper::isEnabled('com_content') || !Factory::getUser()->authorise('core.create', 'com_content') - || !ComponentHelper::isEnabled('com_workflow') || !Factory::getUser()->authorise('core.create', 'com_workflow')) + if (!ComponentHelper::isEnabled('com_tags')) { $response = array(); $response['success'] = true; - $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_SKIPPED', 1, 'com_content'); + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_SKIPPED', 1, 'com_tags'); return $response; } @@ -119,339 +118,581 @@ public function onAjaxSampledataApplyStep1() $language = Multilanguage::isEnabled() ? Factory::getLanguage()->getTag() : '*'; $langSuffix = ($language !== '*') ? ' (' . $language . ')' : ''; - // Create workflow - $workflowTable = new \Joomla\Component\Workflow\Administrator\Table\WorkflowTable($this->db); + /** @var \Joomla\Component\Tags\Administrator\Model\TagModel $model */ + $modelTag = $this->app->bootComponent('com_tags')->getMVCFactory()->createModel('Tag', 'Administrator', ['ignore_request' => true]); + + $tagIds = array(); + + // Create first three tags. + for ($i = 0; $i <= 3; $i++) + { + $title = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_TAG_' . $i . '_TITLE') . $langSuffix; + + $tag = array( + 'id' => 0, + 'title' => $title, + 'alias' => ApplicationHelper::stringURLSafe($title), + // Parent is root, except for the 4th tag. The 4th is child of the 3rd + 'parent_id' => $i === 3 ? $tagIds[2] : 1, + 'published' => 1, + 'access' => $access, + 'created_user_id' => $user->id, + 'language' => $language, + 'description' => '', + ); + + try + { + if (!$modelTag->save($tag)) + { + Factory::getLanguage()->load('com_tags'); + throw new Exception(Text::_($modelTag->getError())); + } + } + catch (Exception $e) + { + $response = array(); + $response['success'] = false; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); + + return $response; + } - $workflowTable->default = 0; - $workflowTable->title = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_SAMPLE_TITLE'); - $workflowTable->description = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_SAMPLE_DESCRIPTION'); - $workflowTable->published = 1; - $workflowTable->access = $access; - $workflowTable->created_user_id = $user->id; - $workflowTable->extension = 'com_content.article'; + $tagIds[] = $modelTag->getItem()->id; + } - if (!$workflowTable->store()) + if (!ComponentHelper::isEnabled('com_content') || !Factory::getUser()->authorise('core.create', 'com_content')) { - Factory::getLanguage()->load('com_content'); $response = array(); - $response['success'] = false; - $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, Text::_($stageTable->getError())); + $response['success'] = true; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_SKIPPED', 1, 'com_content'); return $response; } - // Get ID from workflow we just added - $workflowId = $workflowTable->id; + if (ComponentHelper::isEnabled('com_fields') && $user->authorise('core.create', 'com_fields')) + { + Factory::getLanguage()->load('com_fields'); + + $mvcFactory = $this->app->bootComponent('com_fields')->getMVCFactory(); + + $groupModel = $mvcFactory->createModel('Group', 'Administrator', ['ignore_request' => true]); + + $group = [ + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_FIELDS_GROUP_TITLE') . $langSuffix, + 'id' => 0, + 'published' => 1, + 'ordering' => 0, + 'note' => '', + 'state' => 1, + 'access' => $access, + 'created_user_id' => $user->id, + 'context' => 'com_content.article', + 'description' => '', + 'language' => $language, + 'params' => '{"display_readonly":"1"}', + ]; + + try + { + if (!$groupModel->save($group)) + { + throw new Exception($groupModel->getError()); + } + } + catch (Exception $e) + { + $response = array(); + $response['success'] = false; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); + + return $response; + } - // Create Stages. - for ($i = 1; $i <= 9; $i++) + $groupId = $groupModel->getItem()->id; + + // Add fields + $fieldIds = []; + + $articleFields = [ + [ + 'type' => 'textarea', + 'fieldparams' => [ + 'rows' => 3, + 'cols' => 80, + 'maxlength' => 400, + 'filter' => '' + ] + ], + ]; + + $fieldModel = $mvcFactory->createModel('Field', 'Administrator', ['ignore_request' => true]); + + foreach ($articleFields as $i => $cf) + { + // Set values from language strings. + $cfTitle = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_FIELDS_FIELD_' . $i . '_TITLE') . $langSuffix; + + $cf['id'] = 0; + $cf['name'] = $cfTitle; + $cf['label'] = $cfTitle; + $cf['title'] = $cfTitle; + $cf['description'] = ''; + $cf['note'] = ''; + $cf['default_value'] = ''; + $cf['group_id'] = $groupId; + $cf['ordering'] = 0; + $cf['state'] = 1; + $cf['language'] = $language; + $cf['access'] = $access; + $cf['context'] = 'com_content.article'; + $cf['params'] = [ + 'hint' => '', + 'class' => '', + 'label_class' => '', + 'show_on' => '', + 'render_class' => '', + 'showlabel' => '1', + 'label_render_class' => '', + 'display' => '3', + 'prefix' => '', + 'suffix' => '', + 'layout' => '', + 'display_readonly' => '2' + ]; + + try + { + if (!$fieldModel->save($cf)) + { + throw new Exception($fieldModel->getError()); + } + } + catch (Exception $e) + { + $response = array(); + $response['success'] = false; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); + + return $response; + } + + // Get ID from the field we just added + $fieldIds[] = $fieldModel->getItem()->id; + } + } + + if (ComponentHelper::isEnabled('com_workflow') && Factory::getUser()->authorise('core.create', 'com_workflow')) { - $stageTable = new \Joomla\Component\Workflow\Administrator\Table\StageTable($this->db); + $this->app->bootComponent('com_workflow'); - // Set values from language strings. - $stageTable->title = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE' . $i . '_TITLE'); - $stageTable->description = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE' . $i . '_DESCRIPTION'); + // Create workflow + $workflowTable = new \Joomla\Component\Workflow\Administrator\Table\WorkflowTable($this->db); - // Set values which are always the same. - $stageTable->id = 0; - $stageTable->published = 1; - $stageTable->ordering = 0; - $stageTable->default = $i == 1 ? 1 : 0; - $stageTable->workflow_id = $workflowId; + $workflowTable->default = 0; + $workflowTable->title = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_SAMPLE_TITLE') . $langSuffix; + $workflowTable->description = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_SAMPLE_DESCRIPTION'); + $workflowTable->published = 1; + $workflowTable->access = $access; + $workflowTable->created_user_id = $user->id; + $workflowTable->extension = 'com_content.article'; - if (!$stageTable->store()) + if (!$workflowTable->store()) { - Factory::getLanguage()->load('com_content'); $response = array(); $response['success'] = false; $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, Text::_($stageTable->getError())); return $response; } - } - // Get the stage Ids of the new stages - $query = $this->db->getQuery(true); + // Get ID from workflow we just added + $workflowId = $workflowTable->id; - $query->select([$this->db->quoteName('title'), $this->db->quoteName('id')]) - ->from($this->db->quoteName('#__workflow_stages')) - ->where($this->db->quoteName('workflow_id') . ' = :workflow_id') - ->bind(':workflow_id', $workflowId, ParameterType::INTEGER); + // Create Stages. + for ($i = 1; $i <= 9; $i++) + { + $stageTable = new \Joomla\Component\Workflow\Administrator\Table\StageTable($this->db); - $stages = $this->db->setQuery($query)->loadAssocList('title', 'id'); + // Set values from language strings. + $stageTable->title = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE' . $i . '_TITLE'); + $stageTable->description = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE' . $i . '_DESCRIPTION'); - // Prepare Transitions + // Set values which are always the same. + $stageTable->id = 0; + $stageTable->published = 1; + $stageTable->ordering = 0; + $stageTable->default = $i == 6 ? 1 : 0; + $stageTable->workflow_id = $workflowId; - $defaultOptions = json_encode( - [ - 'publishing' => 0, - 'featuring' => 0, - 'notification_send_mail' => false, - ] - ); + if (!$stageTable->store()) + { + $response = array(); + $response['success'] = false; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, Text::_($stageTable->getError())); - $fromTo = array( - array( - // Idea to Copywriting - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE1_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE2_TITLE')], - 'options' => $defaultOptions, - ), - array( - // Copywriting to Graphic Design - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE2_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE3_TITLE')], - 'options' => $defaultOptions, - ), - array( - // Graphic Design to Fact Check - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE3_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE4_TITLE')], - 'options' => $defaultOptions, - ), - array( - // Fact Check to Review - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE4_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE5_TITLE')], - 'options' => $defaultOptions, - ), - array( - // Edit article - revision to copy writer - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE5_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE2_TITLE')], - 'options' => $defaultOptions, - ), - array( - // Revision to published and featured - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE5_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], - 'options' => json_encode( - array( - 'publishing' => 1, - 'featuring' => 1, - 'notification_send_mail' => true, - 'notification_text' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TEXT'), - 'notification_groups' => ["7"] - ) + return $response; + } + } + + // Get the stage Ids of the new stages + $query = $this->db->getQuery(true); + + $query->select([$this->db->quoteName('title'), $this->db->quoteName('id')]) + ->from($this->db->quoteName('#__workflow_stages')) + ->where($this->db->quoteName('workflow_id') . ' = :workflow_id') + ->bind(':workflow_id', $workflowId, ParameterType::INTEGER); + + $stages = $this->db->setQuery($query)->loadAssocList('title', 'id'); + + // Prepare Transitions + + $defaultOptions = json_encode( + [ + 'publishing' => 0, + 'featuring' => 0, + 'notification_send_mail' => false, + ] + ); + + $fromTo = array( + array( + // Idea to Copywriting + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE1_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE2_TITLE')], + 'options' => $defaultOptions, ), - ), - array( - // All to on Hold - 'from_stage_id' => -1, - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE7_TITLE')], - 'options' => json_encode( - array( - 'publishing' => 2, - 'featuring' => 0, - 'notification_send_mail' => false, - ) + array( + // Copywriting to Graphic Design + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE2_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE3_TITLE')], + 'options' => $defaultOptions, ), - ), - array( - // Idea to trash - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE1_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE8_TITLE')], - 'options' => json_encode( - array( - 'publishing' => -2, - 'featuring' => 0, - 'notification_send_mail' => false, - ) + array( + // Graphic Design to Fact Check + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE3_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE4_TITLE')], + 'options' => $defaultOptions, ), - ), - array( - // On Hold to Idea (Re-activate an idea) - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE7_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE1_TITLE')], - 'options' => $defaultOptions, - ), - array( - // Unpublish a published article - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE9_TITLE')], - 'options' => $defaultOptions, - ), - array( - // Trash a published article - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE8_TITLE')], - 'options' => $defaultOptions, - ), - array( - // From unpublished back to published - 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE9_TITLE')], - 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], - 'options' => json_encode( - array( - 'publishing' => 1, - 'featuring' => 0, - 'notification_send_mail' => true, - 'notification_text' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TEXT'), - 'notification_groups' => ["7"] - ) + array( + // Fact Check to Review + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE4_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE5_TITLE')], + 'options' => $defaultOptions, ), - ), - ); + array( + // Edit article - revision to copy writer + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE5_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE2_TITLE')], + 'options' => $defaultOptions, + ), + array( + // Revision to published and featured + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE5_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], + 'options' => json_encode( + array( + 'publishing' => 1, + 'featuring' => 1, + 'notification_send_mail' => true, + 'notification_text' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TEXT'), + 'notification_groups' => ["7"] + ) + ), + ), + array( + // All to on Hold + 'from_stage_id' => -1, + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE7_TITLE')], + 'options' => json_encode( + array( + 'publishing' => 2, + 'featuring' => 0, + 'notification_send_mail' => false, + ) + ), + ), + array( + // Idea to trash + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE1_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE8_TITLE')], + 'options' => json_encode( + array( + 'publishing' => -2, + 'featuring' => 0, + 'notification_send_mail' => false, + ) + ), + ), + array( + // On Hold to Idea (Re-activate an idea) + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE7_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE1_TITLE')], + 'options' => $defaultOptions, + ), + array( + // Unpublish a published article + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE9_TITLE')], + 'options' => $defaultOptions, + ), + array( + // Trash a published article + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE8_TITLE')], + 'options' => $defaultOptions, + ), + array( + // From unpublished back to published + 'from_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE9_TITLE')], + 'to_stage_id' => $stages[Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TITLE')], + 'options' => json_encode( + array( + 'publishing' => 1, + 'featuring' => 0, + 'notification_send_mail' => true, + 'notification_text' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_STAGE6_TEXT'), + 'notification_groups' => ["7"] + ) + ), + ), + ); - // Create Transitions. - for ($i = 0; $i < count($fromTo); $i++) - { - $trTable = new \Joomla\Component\Workflow\Administrator\Table\TransitionTable($this->db); + // Create Transitions. + for ($i = 0; $i < count($fromTo); $i++) + { + $trTable = new \Joomla\Component\Workflow\Administrator\Table\TransitionTable($this->db); - $trTable->from_stage_id = $fromTo[$i]['from_stage_id']; - $trTable->to_stage_id = $fromTo[$i]['to_stage_id']; - $trTable->options = $fromTo[$i]['options']; + $trTable->from_stage_id = $fromTo[$i]['from_stage_id']; + $trTable->to_stage_id = $fromTo[$i]['to_stage_id']; + $trTable->options = $fromTo[$i]['options']; - // Set values from language strings. - $trTable->title = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_TRANSITION' . ($i + 1) . '_TITLE'); - $trTable->description = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_TRANSITION' . ($i + 1) . '_DESCRIPTION'); + // Set values from language strings. + $trTable->title = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_TRANSITION' . ($i + 1) . '_TITLE'); + $trTable->description = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_WORKFLOW_TRANSITION' . ($i + 1) . '_DESCRIPTION'); - // Set values which are always the same. - $trTable->id = 0; - $trTable->published = 1; - $trTable->ordering = 0; - $trTable->workflow_id = $workflowId; + // Set values which are always the same. + $trTable->id = 0; + $trTable->published = 1; + $trTable->ordering = 0; + $trTable->workflow_id = $workflowId; - if (!$trTable->store()) - { - Factory::getLanguage()->load('com_content'); - $response = array(); - $response['success'] = false; - $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, Text::_($trTable->getError())); + if (!$trTable->store()) + { + $response = array(); + $response['success'] = false; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, Text::_($trTable->getError())); - return $response; + return $response; + } } } - // Create "blog" category. - $categoryModel = $this->app->bootComponent('com_categories') - ->getMVCFactory()->createModel('Category', 'Administrator'); + // Store the categories $catIds = array(); - $categoryTitle = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_0_TITLE'); - $alias = ApplicationHelper::stringURLSafe($categoryTitle); - // Set unicodeslugs if alias is empty - if (trim(str_replace('-', '', $alias) == '')) + for ($i = 0; $i <= 3; $i++) { - $unicode = $this->app->set('unicodeslugs', 1); - $alias = ApplicationHelper::stringURLSafe($categoryTitle); - $this->app->set('unicodeslugs', $unicode); - } + $categoryModel = $this->app->bootComponent('com_categories') + ->getMVCFactory()->createModel('Category', 'Administrator'); - $category = array( - 'title' => $categoryTitle . $langSuffix, - 'parent_id' => 1, - 'id' => 0, - 'published' => 1, - 'access' => $access, - 'created_user_id' => $user->id, - 'extension' => 'com_content', - 'level' => 1, - 'alias' => $alias . $langSuffix, - 'associations' => array(), - 'description' => '', - 'language' => $language, - 'params' => '{"workflow_id":"' . $workflowId . '"}', - ); + $categoryTitle = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_' . $i . '_TITLE'); + $categoryAlias = ApplicationHelper::stringURLSafe($categoryTitle); - try - { - if (!$categoryModel->save($category)) + // Set unicodeslugs if alias is empty + if (trim(str_replace('-', '', $categoryAlias) == '')) { - throw new Exception($categoryModel->getError()); + $unicode = $this->app->set('unicodeslugs', 1); + $categoryAlias = ApplicationHelper::stringURLSafe($categoryTitle); + $this->app->set('unicodeslugs', $unicode); } - } - catch (Exception $e) - { - $response = array(); - $response['success'] = false; - $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); - - return $response; - } - - // Get ID from category we just added - $catIds[] = $categoryModel->getItem()->id; - // Create "help" category. - $categoryTitle = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_1_TITLE'); - $alias = ApplicationHelper::stringURLSafe($categoryTitle); - - // Set unicodeslugs if alias is empty - if (trim(str_replace('-', '', $alias) == '')) - { - $unicode = $this->app->set('unicodeslugs', 1); - $alias = ApplicationHelper::stringURLSafe($categoryTitle); - $this->app->set('unicodeslugs', $unicode); - } + if (ComponentHelper::isEnabled('com_workflow') && $user->authorise('core.create', 'com_workflow') && $workflowId) + { + // Category 0 gets the workflow from above + $params = $i == 0 ? '{"workflow_id":"' . $workflowId . '"}' : '{}'; + } - $category = array( - 'title' => $categoryTitle . $langSuffix, - 'parent_id' => 1, - 'id' => 0, - 'published' => 1, - 'access' => $access, - 'created_user_id' => $user->id, - 'extension' => 'com_content', - 'level' => 1, - 'alias' => $alias . $langSuffix, - 'associations' => array(), - 'description' => '', - 'language' => $language, - 'params' => '{}', - ); + $category = [ + 'title' => $categoryTitle . $langSuffix, + 'parent_id' => 1, + 'id' => 0, + 'published' => 1, + 'access' => $access, + 'created_user_id' => $user->id, + 'extension' => 'com_content', + 'level' => 1, + 'alias' => $categoryAlias . $langSuffix, + 'associations' => array(), + 'description' => '', + 'language' => $language, + 'params' => $params + ]; - try - { - if (!$categoryModel->save($category)) + try { - throw new Exception($categoryModel->getError()); + if (!$categoryModel->save($category)) + { + Factory::getLanguage()->load('com_categories'); + throw new Exception($categoryModel->getError()); + } } - } - catch (Exception $e) - { - $response = array(); - $response['success'] = false; - $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); + catch (Exception $e) + { + $response = array(); + $response['success'] = false; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); - return $response; - } + return $response; + } - // Get ID from category we just added - $catIds[] = $categoryModel->getItem()->id; + // Get ID from category we just added + $catIds[] = $categoryModel->getItem()->id; + } // Create Articles. - $articles = array( + $articles = array( + + // Category 1 = Help array( + // Article 0 - About 'catid' => $catIds[1], - 'ordering' => 2, - 'state' => 1, ), array( + // Article 1 - Working on Your Site 'catid' => $catIds[1], - 'ordering' => 1, 'access' => 3, - 'state' => 1, ), + + // Category 0 = Blog array( + // Article 2 - Welcome to your blog 'catid' => $catIds[0], - 'ordering' => 2, - 'state' => 0, + 'featured' => 1, + 'tags' => array_map('strval', $tagIds), + 'images' => array( + 'image_intro' => 'images/sampledata/cassiopeia/nasa1-1200.jpg', + 'float_intro' => '', + 'image_intro_alt' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_INTROIMAGE_ALT'), + 'image_intro_alt_empty' => '', + 'image_intro_caption' => '', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa1-400.jpg', + 'float_fulltext' => 'float-left', + 'image_fulltext_alt' => '', + 'image_fulltext_alt_empty' => 1, + 'image_fulltext_caption' => 'www.nasa.gov/multimedia/imagegallery' + ) ), array( + // Article 3 - About your home page 'catid' => $catIds[0], - 'ordering' => 1, - 'state' => 0, + 'featured' => 1, + 'tags' => array_map('strval', $tagIds), + 'images' => array( + 'image_intro' => 'images/sampledata/cassiopeia/nasa2-1200.jpg', + 'float_intro' => '', + 'image_intro_alt' => '', + 'image_intro_alt_empty' => 1, + 'image_intro_caption' => '', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa2-400.jpg', + 'float_fulltext' => 'float-left', + 'image_fulltext_alt' => '', + 'image_fulltext_alt_empty' => 1, + 'image_fulltext_caption' => 'www.nasa.gov/multimedia/imagegallery' + ), + 'authorValue' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_FIELD_0'), ), array( + // Article 4 - Your Modules 'catid' => $catIds[0], - 'ordering' => 0, - 'state' => 0, + 'featured' => 1, + 'tags' => array_map('strval', $tagIds), + 'images' => array( + 'image_intro' => 'images/sampledata/cassiopeia/nasa3-1200.jpg', + 'float_intro' => '', + 'image_intro_alt' => '', + 'image_intro_alt_empty' => 1, + 'image_intro_caption' => '', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa3-400.jpg', + 'float_fulltext' => 'float-left', + 'image_fulltext_alt' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_4_FULLTEXTIMAGE_ALT'), + 'image_fulltext_alt_empty' => '', + 'image_fulltext_caption' => 'www.nasa.gov/multimedia/imagegallery' + ) ), array( + // Article 5 - Your Template 'catid' => $catIds[0], - 'ordering' => 0, - 'state' => 0, + 'featured' => 1, + 'tags' => array_map('strval', $tagIds), + 'images' => array( + 'image_intro' => 'images/sampledata/cassiopeia/nasa4-1200.jpg', + 'float_intro' => '', + 'image_intro_alt' => '', + 'image_intro_alt_empty' => 1, + 'image_intro_caption' => '', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa4-400.jpg', + 'float_fulltext' => 'float-left', + 'image_fulltext_alt' => '', + 'image_fulltext_alt_empty' => 1, + 'image_fulltext_caption' => 'www.nasa.gov/multimedia/imagegallery' + ) + ), + // Category 2 = Joomla - marketing texts + array( + // Article 6 - Millions + 'catid' => $catIds[2], + 'images' => array( + 'image_intro' => 'images/sampledata/cassiopeia/nasa1-640.jpg', + 'float_intro' => '', + 'image_intro_alt' => '', + 'image_intro_alt_empty' => 1, + 'image_intro_caption' => '', + ) + ), + array( + // Article 7 - Love + 'catid' => $catIds[2], + 'images' => array( + 'image_intro' => 'images/sampledata/cassiopeia/nasa2-640.jpg', + 'float_intro' => '', + 'image_intro_alt' => '', + 'image_intro_alt_empty' => 1, + 'image_intro_caption' => '', + ) + ), + array( + // Article 8 - Joomla + 'catid' => $catIds[2], + 'images' => array( + 'image_intro' => 'images/sampledata/cassiopeia/nasa3-640.jpg', + 'float_intro' => '', + 'image_intro_alt' => '', + 'image_intro_alt_empty' => 1, + 'image_intro_caption' => '', + ) + ), + array( + // Article 9 - Workflows + 'catid' => $catIds[1], + 'images' => array( + 'image_intro' => '', + 'float_intro' => '', + 'image_intro_alt' => '', + 'image_intro_alt_empty' => '', + 'image_intro_caption' => '', + 'image_fulltext' => 'images/sampledata/cassiopeia/nasa4-400.jpg', + 'float_fulltext' => 'float-right', + 'image_fulltext_alt' => '', + 'image_fulltext_alt_empty' => 1, + 'image_fulltext_caption' => 'www.nasa.gov/multimedia/imagegallery' + ), + 'authorValue' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_9_FIELD_0'), + ), + // Category 3 - Typography + array( + // Article 10 - Typography + 'catid' => $catIds[3], ), ); @@ -482,9 +723,11 @@ public function onAjaxSampledataApplyStep1() $article['fulltext'] = Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_' . $i . '_FULLTEXT'); // Set values which are always the same. - $article['id'] = 0; - $article['created_user_id'] = $user->id; - $article['alias'] = ApplicationHelper::stringURLSafe($article['title']); + $article['id'] = 0; + $article['ordering'] = 0; + $article['created_user_id'] = $user->id; + $article['created_by_alias'] = 'Joomla'; + $article['alias'] = ApplicationHelper::stringURLSafe($article['title']); // Set unicodeslugs if alias is empty if (trim(str_replace('-', '', $alias) == '')) @@ -496,11 +739,24 @@ public function onAjaxSampledataApplyStep1() $article['language'] = $language; $article['associations'] = array(); - $article['featured'] = 0; - $article['images'] = ''; $article['metakey'] = ''; $article['metadesc'] = ''; + if (!isset($article['featured'])) + { + $article['featured'] = 0; + } + + if (!isset($article['state'])) + { + $article['state'] = 1; + } + + if (!isset($article['images'])) + { + $article['images'] = ''; + } + if (!isset($article['access'])) { $article['access'] = $access; @@ -508,7 +764,6 @@ public function onAjaxSampledataApplyStep1() if (!$articleModel->save($article)) { - Factory::getLanguage()->load('com_content'); $response = array(); $response['success'] = false; $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, Text::_($articleModel->getError())); @@ -518,6 +773,39 @@ public function onAjaxSampledataApplyStep1() // Get ID from article we just added $ids[] = $articleModel->getItem()->id; + + if ($article['featured']) + { + // Set the article featured in #__content_frontpage + $query = $this->db->getQuery(true); + + $featuredItem = (object) [ + 'content_id' => $articleModel->getItem()->id, + 'ordering' => 0, + 'featured_up' => null, + 'featured_down' => null + ]; + + $this->db->insertObject('#__content_frontpage', $featuredItem); + } + + // Add a value to the custom field if a value is given + if (ComponentHelper::isEnabled('com_fields') && Factory::getUser()->authorise('core.create', 'com_fields')) + { + if (!empty($article['authorValue'])) + { + // Store a field value + $query = $this->db->getQuery(true); + + $valueAuthor = (object) [ + 'item_id' => $articleModel->getItem()->id, + 'field_id' => $fieldIds[0], + 'value' => $article['authorValue'], + ]; + + $this->db->insertObject('#__fields_values', $valueAuthor); + } + } } $this->app->setUserState('sampledata.blog.articles', $ids); @@ -581,6 +869,7 @@ public function onAjaxSampledataApplyStep2() if (!$menuTable->check()) { + Factory::getLanguage()->load('com_menu'); throw new Exception($menuTable->getError()); } @@ -588,7 +877,6 @@ public function onAjaxSampledataApplyStep2() } catch (Exception $e) { - Factory::getLanguage()->load('com_menus'); $response = array(); $response['success'] = false; $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 2, $e->getMessage()); @@ -614,6 +902,7 @@ public function onAjaxSampledataApplyStep2() // Insert menuitems level 1. $menuItems = array( array( + // Blog 'menutype' => $menuTypes[0], 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_0_TITLE'), 'link' => 'index.php?option=com_content&view=category&layout=blog&id=' . $catids[0], @@ -622,41 +911,53 @@ public function onAjaxSampledataApplyStep2() 'layout_type' => 'blog', 'show_category_title' => 0, 'num_leading_articles' => 4, - 'num_intro_articles' => 0, - 'num_links' => 2, + 'num_intro_articles' => 4, + 'num_links' => 0, 'orderby_sec' => 'rdate', 'order_date' => 'published', + 'blog_class_leading' => 'boxed columns-2', 'show_pagination' => 2, - 'show_pagination_results' => 1, - 'show_category' => 0, - 'info_bloc_position' => 0, - 'show_publish_date' => 0, - 'show_hits' => 0, - 'show_feed_link' => 1, - 'menu_text' => 1, - 'show_page_heading' => 0, 'secure' => 0, + 'show_page_heading' => 1, ), ), array( + // Help 'menutype' => $menuTypes[0], - 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_1_TITLE'), - 'link' => 'index.php?option=com_content&view=article&id=' . $articleIds[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_1_TITLE'), + 'link' => 'index.php?option=com_content&view=category&layout=blog&id=' . $catids[1], 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, 'params' => array( - 'info_block_position' => 0, - 'show_category' => 0, - 'link_category' => 0, - 'show_author' => 0, - 'show_create_date' => 0, - 'show_publish_date' => 0, - 'show_hits' => 0, - 'menu_text' => 1, - 'show_page_heading' => 0, - 'secure' => 0, + 'blog_class_leading' => '', + 'blog_class' => 'boxed', + 'num_leading_articles' => 0, + 'num_intro_articles' => 4, + 'num_links' => 0, + 'orderby_sec' => 'rdate', + 'order_date' => 'published', + 'show_pagination' => 4, + 'show_pagination_results' => 1, + 'article_layout' => '_:default', + 'link_titles' => 0, + 'info_block_show_title' => '', + 'show_category' => 0, + 'link_category' => '', + 'show_parent_category' => '', + 'link_parent_category' => '', + 'show_author' => 0, + 'link_author' => '', + 'show_create_date' => 0, + 'show_modify_date' => '', + 'show_publish_date' => 0, + 'show_hits' => 0, + 'menu_text' => 1, + 'menu_show' => 1, + 'show_page_heading' => 1, + 'secure' => 0, ), ), array( + // Author Login 'menutype' => $menuTypes[0], 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_2_TITLE'), 'link' => 'index.php?option=com_users&view=login', @@ -669,6 +970,46 @@ public function onAjaxSampledataApplyStep2() 'secure' => 0, ), ), + array( + // Sample metismenu (heading) + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_11_TITLE'), + 'type' => 'heading', + 'link' => '', + 'component_id' => 0, + 'params' => array( + 'layout_type' => 'heading', + 'menu_text' => 1, + 'show_page_heading' => 0, + 'secure' => 0, + ), + ), + array( + // Typography + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_14_TITLE'), + 'link' => 'index.php?option=com_content&view=article&id=&id=' . (int) $articleIds[10], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'show_title' => 0, + 'link_titles' => 0, + 'show_intro' => 1, + 'info_block_position' => '', + 'info_block_show_title' => 0, + 'show_category' => 0, + 'show_author' => 0, + 'show_create_date' => 0, + 'show_modify_date' => 0, + 'show_publish_date' => 0, + 'show_item_navigation' => 0, + 'show_hits' => 0, + 'show_tags' => 0, + 'menu_text' => 1, + 'menu_show' => 1, + 'page_title' => '', + 'secure' => 0, + ), + ), array( 'menutype' => $menuTypes[1], 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_3_TITLE'), @@ -704,6 +1045,7 @@ public function onAjaxSampledataApplyStep2() 'access' => 3, 'params' => array( 'menu_text' => 1, + 'secure' => 0, ), ), array( @@ -746,20 +1088,23 @@ public function onAjaxSampledataApplyStep2() return $response; } - // Insert another level 1. + // Insert level 1 (Link in the footer as alias) $menuItems = array( array( 'menutype' => $menuTypes[2], 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_8_TITLE'), - 'link' => 'index.php?option=com_users&view=login', - 'component_id' => ExtensionHelper::getExtensionRecord('com_users', 'component')->extension_id, + 'link' => 'index.php?Itemid=', + 'type' => 'alias', 'params' => array( - 'login_redirect_url' => 'index.php?Itemid=' . $menuIdsLevel1[0], - 'logindescription_show' => 1, - 'logoutdescription_show' => 1, - 'menu_text' => 1, - 'show_page_heading' => 0, - 'secure' => 0, + 'aliasoptions' => $menuIdsLevel1[2], + 'alias_redirect' => 0, + 'menu-anchor_title' => '', + 'menu-anchor_css' => '', + 'menu_image' => '', + 'menu_image_css' => '', + 'menu_text' => 1, + 'menu_show' => 1, + 'secure' => 0, ), ), ); @@ -783,7 +1128,7 @@ public function onAjaxSampledataApplyStep2() 'menutype' => $menuTypes[1], 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_9_TITLE'), 'link' => 'index.php?option=com_config&view=config', - 'parent_id' => $menuIdsLevel1[4], + 'parent_id' => $menuIdsLevel1[5], 'component_id' => ExtensionHelper::getExtensionRecord('com_config', 'component')->extension_id, 'access' => 6, 'params' => array( @@ -796,7 +1141,7 @@ public function onAjaxSampledataApplyStep2() 'menutype' => $menuTypes[1], 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_10_TITLE'), 'link' => 'index.php?option=com_config&view=templates', - 'parent_id' => $menuIdsLevel1[4], + 'parent_id' => $menuIdsLevel1[5], 'component_id' => ExtensionHelper::getExtensionRecord('com_config', 'component')->extension_id, 'params' => array( 'menu_text' => 1, @@ -804,11 +1149,156 @@ public function onAjaxSampledataApplyStep2() 'secure' => 0, ), ), + array( + // Blog + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_0_TITLE'), + 'link' => 'index.php?option=com_content&view=category&layout=blog&id=' . $catids[0], + 'parent_id' => $menuIdsLevel1[3], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'layout_type' => 'blog', + 'show_category_title' => 0, + 'num_leading_articles' => 1, + 'num_intro_articles' => 2, + 'num_links' => 2, + 'orderby_sec' => 'front', + 'order_date' => 'published', + 'blog_class_leading' => 'boxed columns-1', + 'blog_class' => 'columns-2', + 'show_pagination' => 2, + 'show_pagination_results' => 1, + 'show_category' => 0, + 'info_bloc_position' => 0, + 'show_publish_date' => 0, + 'show_hits' => 0, + 'show_feed_link' => 0, + 'menu_text' => 1, + 'show_page_heading' => 0, + 'secure' => 0, + ), + ), + array( + // Category List + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_12_TITLE'), + 'link' => 'index.php?option=com_content&view=category&id=' . $catids[0], + 'parent_id' => $menuIdsLevel1[3], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'menu_text' => 1, + 'show_page_heading' => 1, + 'secure' => 0, + ), + ), + array( + // Articles (menu header) + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_13_TITLE'), + 'link' => 'index.php?option=com_content&view=category&layout=blog&id=' . $catids[2], + 'parent_id' => $menuIdsLevel1[3], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'layout_type' => 'blog', + 'show_category_title' => 0, + 'num_leading_articles' => 3, + 'num_intro_articles' => 0, + 'num_links' => 2, + 'orderby_sec' => 'front', + 'order_date' => 'published', + 'blog_class_leading' => 'boxed columns-3', + 'blog_class' => '', + 'show_pagination' => 2, + 'show_pagination_results' => 1, + 'show_category' => 0, + 'info_bloc_position' => 0, + 'show_publish_date' => 0, + 'show_hits' => 0, + 'show_feed_link' => 0, + 'menu_text' => 1, + 'show_page_heading' => 0, + 'secure' => 0, + ), + ), + array( + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_3_TITLE'), + 'link' => 'index.php?option=com_content&view=article&id=&id=' . (int) $articleIds[3], + 'parent_id' => $menuIdsLevel1[1], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'menu_show' => 1, + 'show_page_heading' => 0, + 'secure' => 0, + ), + ), + array( + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_9_TITLE'), + 'link' => 'index.php?option=com_content&view=article&id=' . (int) $articleIds[9], + 'parent_id' => $menuIdsLevel1[1], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'menu_show' => 1, + 'show_page_heading' => 0, + 'secure' => 0, + ), + ), + ); + + try + { + $menuIdsLevel2 = $this->addMenuItems($menuItems, 2); + } + catch (Exception $e) + { + $response = array(); + $response['success'] = false; + $response['message'] = Text::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 2, $e->getMessage()); + + return $response; + } + + // Add a third level of menuItems - use article title also for menuItem title + $menuItems = array( + array( + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_6_TITLE'), + 'link' => 'index.php?option=com_content&view=article&id=&id=' . (int) $articleIds[6], + 'parent_id' => $menuIdsLevel2[4], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'menu_show' => 1, + 'secure' => 0, + ), + ), + array( + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_7_TITLE'), + 'link' => 'index.php?option=com_content&view=article&id=&id=' . (int) $articleIds[7], + 'parent_id' => $menuIdsLevel2[4], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'menu_show' => 1, + 'secure' => 0, + ), + ), + array( + 'menutype' => $menuTypes[0], + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_8_TITLE'), + 'link' => 'index.php?option=com_content&view=article&id=' . (int) $articleIds[8], + 'parent_id' => $menuIdsLevel2[4], + 'component_id' => ExtensionHelper::getExtensionRecord('com_content', 'component')->extension_id, + 'params' => array( + 'menu_show' => 1, + 'secure' => 0, + ), + ), ); try { - $this->addMenuItems($menuItems, 2); + $this->addMenuItems($menuItems, 3); } catch (Exception $e) { @@ -835,6 +1325,8 @@ public function onAjaxSampledataApplyStep2() */ public function onAjaxSampledataApplyStep3() { + $app = Factory::getApplication(); + if (!Session::checkToken('get') || $this->app->input->get('type') != $this->_name) { return; @@ -860,35 +1352,41 @@ public function onAjaxSampledataApplyStep3() // Get previously entered Data from UserStates $menuTypes = $this->app->getUserState('sampledata.blog.menutypes'); - $catids = $this->app->getUserState('sampledata.blog.articles.catids'); + $catids = $this->app->getUserState('sampledata.blog.articles.catids'); + $articleIds = $this->app->getUserState('sampledata.blog.articles'); + + // Link to article "typography" in banner module + $headerLink = 'index.php?option=com_content&view=article&id=' . $articleIds[10]; $modules = array( array( + // The main menu Blog 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_0_TITLE'), 'ordering' => 1, - 'position' => 'top-a', + 'position' => 'menu', 'module' => 'mod_menu', 'showtitle' => 0, 'params' => array( 'menutype' => $menuTypes[0], + 'layout' => 'cassiopeia:dropdown-metismenu', 'startLevel' => 1, 'endLevel' => 0, - 'showAllChildren' => 0, + 'showAllChildren' => 1, 'class_sfx' => '', - 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'itemid', - 'module_tag' => 'div', + 'module_tag' => 'nav', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( + // The author Menu, for registered users 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_1_TITLE'), 'ordering' => 1, - 'position' => 'top-a', + 'position' => 'sidebar-right', 'module' => 'mod_menu', 'access' => 3, 'showtitle' => 0, @@ -902,13 +1400,14 @@ public function onAjaxSampledataApplyStep3() 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'itemid', - 'module_tag' => 'div', + 'module_tag' => 'aside', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( + // Syndication 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_2_TITLE'), 'ordering' => 6, 'position' => 'sidebar-right', @@ -920,9 +1419,11 @@ public function onAjaxSampledataApplyStep3() 'format' => 'rss', 'layout' => '_:default', 'cache' => 0, + 'module_tag' => 'section', ), ), array( + // Archived Articles 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_3_TITLE'), 'ordering' => 4, 'position' => 'sidebar-right', @@ -932,28 +1433,52 @@ public function onAjaxSampledataApplyStep3() 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, + 'module_tag' => 'div', 'cachemode' => 'static', ), ), array( - 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_4_TITLE'), - 'ordering' => 5, - 'position' => 'sidebar-right', - 'module' => 'mod_articles_popular', + // Latest Posts + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_4_TITLE'), + 'ordering' => 6, + 'position' => 'top-a', + 'module' => 'mod_articles_news', + // Assignment 1 means here - only on the homepage + 'assignment' => 1, + 'showtitle' => 0, 'params' => array( - 'catid' => $catids[0], - 'count' => 5, - 'show_front' => 1, - 'layout' => '_:default', - 'cache' => 1, - 'cache_time' => 900, - 'cachemode' => 'static', + 'catid' => $catids[2], + 'image' => 1, + 'img_intro_full' => 'intro', + 'item_title' => 0, + 'link_titles' => '', + 'item_heading' => 'h4', + 'triggerevents' => 1, + 'showLastSeparator' => 1, + 'show_introtext' => 1, + 'readmore' => 1, + 'count' => 3, + 'show_featured' => '', + 'exclude_current' => 0, + 'ordering' => 'a.publish_up', + 'direction' => 1, + 'layout' => '_:horizontal', + 'moduleclass_sfx' => '', + 'cache' => 1, + 'cache_time' => 900, + 'cachemode' => 'itemid', + 'style' => 'Cassiopeia-noCard', + 'module_tag' => 'div', + 'bootstrap_size' => '0', + 'header_tag' => 'h3', + 'header_class' => '' ), ), array( + // Older Posts (from category 0 = blog) 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_5_TITLE'), 'ordering' => 2, - 'position' => 'sidebar-right', + 'position' => 'bottom-b', 'module' => 'mod_articles_category', 'params' => array( 'mode' => 'normal', @@ -991,12 +1516,13 @@ public function onAjaxSampledataApplyStep3() 'owncache' => 1, 'cache_time' => 900, 'module_tag' => 'div', - 'bootstrap_size' => 0, + 'bootstrap_size' => 4, 'header_tag' => 'h3', 'style' => 0, ), ), array( + // Bottom Menu 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_6_TITLE'), 'ordering' => 1, 'position' => 'footer', @@ -1018,78 +1544,93 @@ public function onAjaxSampledataApplyStep3() ), ), array( + // Search 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_7_TITLE'), 'ordering' => 1, 'position' => 'search', - 'module' => 'mod_search', + 'module' => 'mod_finder', 'params' => array( - 'width' => 20, - 'button_pos' => 'right', - 'opensearch' => 1, - 'layout' => '_:default', - 'cache' => 1, - 'cache_time' => 900, - 'cachemode' => 'itemid', + 'searchfilter' => '', + 'show_autosuggest' => 1, + 'show_advanced' => 0, + 'show_label' => 0, + 'alt_label' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_7_TITLE'), + 'show_button' => 1, + 'opensearch' => 1, + 'opensearch_name' => '', + 'set_itemid' => 0, + 'layout' => '_:default', + 'module_tag' => 'search', ), ), array( - 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_8_TITLE'), - 'content' => '

', - 'ordering' => 1, - 'position' => 'main-top', - 'module' => 'mod_custom', - 'showtitle' => 0, - 'params' => array( - 'prepare_content' => 1, - 'layout' => '_:default', + // Header image + 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_8_TITLE'), + 'content' => '

' . Text::sprintf('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_8_CONTENT', $headerLink) . '

', + 'ordering' => 1, + 'position' => 'banner', + 'module' => 'mod_custom', + // Assignment 1 means here - only on the homepage + 'assignment' => 1, + 'showtitle' => 0, + 'params' => array( + 'prepare_content' => 0, + 'backgroundimage' => 'images/banners/banner.jpg', + 'layout' => 'cassiopeia:banner', + 'moduleclass_sfx' => '', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'static', + 'style' => '0', 'module_tag' => 'div', - 'bootstrap_size' => 0, + 'bootstrap_size' => '0', 'header_tag' => 'h3', - 'style' => 0, + 'header_class' => '' ), ), array( + // Popular Tags 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_9_TITLE'), 'ordering' => 1, - 'position' => 'sidebar-right', + 'position' => 'bottom-b', 'module' => 'mod_tags_popular', 'params' => array( 'maximum' => 8, 'timeframe' => 'alltime', 'order_value' => 'count', 'order_direction' => 1, - 'display_count' => 0, + 'display_count' => 1, 'no_results_text' => 0, 'minsize' => 1, 'maxsize' => 2, - 'layout' => '_:default', + 'layout' => '_:cloud', 'owncache' => 1, - 'module_tag' => 'div', - 'bootstrap_size' => 0, + 'module_tag' => 'aside', + 'bootstrap_size' => 4, 'header_tag' => 'h3', 'style' => 0, ), ), array( + // Similiar Items 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_10_TITLE'), 'ordering' => 0, 'position' => '', 'module' => 'mod_tags_similar', + 'position' => 'bottom-b', 'params' => array( 'maximum' => 5, 'matchtype' => 'any', 'layout' => '_:default', 'owncache' => 1, 'module_tag' => 'div', - 'bootstrap_size' => 0, + 'bootstrap_size' => 4, 'header_tag' => 'h3', 'style' => 0, ), ), array( + // Backend - Site Information 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_11_TITLE'), 'ordering' => 4, 'position' => 'cpanel', @@ -1112,6 +1653,7 @@ public function onAjaxSampledataApplyStep3() ), ), array( + // Backend - Release News 'title' => Text::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_12_TITLE'), 'ordering' => 1, 'position' => 'postinstall', @@ -1148,7 +1690,31 @@ public function onAjaxSampledataApplyStep3() $module['language'] = $language; $module['note'] = ''; $module['published'] = 1; - $module['assignment'] = 0; + + if (!isset($module['assignment'])) + { + $module['assignment'] = 0; + } + else + { + // Assignment means always "only on the homepage". + if (Multilanguage::isEnabled()) + { + $homes = Multilanguage::getSiteHomePages(); + + if (isset($homes[$language])) + { + $home = $homes[$language]->id; + } + } + + if (!isset($home)) + { + $home = $app->getMenu('site')->getDefault()->id; + } + + $module['assigned'] = [$home]; + } if (!isset($module['content'])) { diff --git a/templates/cassiopeia/error.php b/templates/cassiopeia/error.php index cc9e761beb189..ac5c5273bf396 100644 --- a/templates/cassiopeia/error.php +++ b/templates/cassiopeia/error.php @@ -29,6 +29,29 @@ $menu = $app->getMenu()->getActive(); $pageclass = $menu !== null ? $menu->getParams()->get('pageclass_sfx', '') : ''; +// Getting params from template +$params = $app->getTemplate(true)->params; + +// Template path +$templatePath = 'templates/' . $this->template; + +// Color Theme +$paramsColorName = $params->get('colorName', 'colors_standard'); +$assetColorName = 'theme.' . $paramsColorName; +$wa->registerAndUseStyle($assetColorName, $templatePath . '/css/global/' . $paramsColorName . '.css'); +$this->getPreloadManager()->prefetch($wa->getAsset('style', $assetColorName)->getUri(), ['as' => 'style']); + +// Use a font scheme if set in the template style options +$paramsFontScheme = $params->get('useFontScheme', false); + +if ($paramsFontScheme) +{ + // Prefetch the stylesheet for the font scheme, actually we need to prefetch the font(s) + $assetFontScheme = 'fontscheme.' . $paramsFontScheme; + $wa->registerAndUseStyle($assetFontScheme, $templatePath . '/css/global/' . $paramsFontScheme . '.css'); + $this->getPreloadManager()->prefetch($wa->getAsset('style', $assetFontScheme)->getUri(), ['as' => 'style']); +} + // Enable assets $wa->usePreset('template.cassiopeia.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')) ->useStyle('template.active.language') @@ -46,22 +69,19 @@ // Logo file or site title param if ($this->params->get('logoFile')) { - $logo = '' . $sitename . ''; + $logo = '' . $sitename . ''; } elseif ($this->params->get('siteTitle')) { - $logo = '' . htmlspecialchars($this->params->get('siteTitle'), ENT_COMPAT, 'UTF-8') . ''; + $logo = '' . htmlspecialchars($params->get('siteTitle'), ENT_COMPAT, 'UTF-8') . ''; } else { - $logo = ''; + $logo = ''; } -// Header bottom margin -$headerMargin = !$this->countModules('banner') ? ' mb-4' : ''; - // Container -$wrapper = $this->params->get('fluidContainer') ? 'wrapper-fluid' : 'wrapper-static'; +$wrapper = $params->get('fluidContainer') ? 'wrapper-fluid' : 'wrapper-static'; $this->setMetaData('viewport', 'width=device-width, initial-scale=1'); ?> @@ -73,7 +93,7 @@ -direction == 'rtl' ? ' rtl' : ''); ?>"> -
- - countModules('banner')) : ?> -
- -
+ + +
- countModules('top-a')) : ?> -
- -
- - - countModules('top-b')) : ?> -
- -
- - -
- - countModules('sidebar-left')) : ?> -
- -
- - -
-

-
-
- -

-

-
    -
  • -
  • -
  • -
  • -
-

-

-
-

-
- error->getCode(); ?> error->getMessage(), ENT_QUOTES, 'UTF-8'); ?> -
- debug) : ?> -
- renderBacktrace(); ?> - - error->getPrevious()) : ?> - - _error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?> - - setError($this->_error->getPrevious()); ?> - -

-

_error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>

- renderBacktrace(); ?> - setError($this->_error->getPrevious()); ?> - - - setError($this->error); ?> - -
- -
+
+

+
+
+ +

+

+
    +
  • +
  • +
  • +
  • +
+

+

+
+

+
+ error->getCode(); ?> error->getMessage(), ENT_QUOTES, 'UTF-8'); ?> +
+ debug) : ?> +
+ renderBacktrace(); ?> + + error->getPrevious()) : ?> + + _error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?> + + setError($this->_error->getPrevious()); ?> + +

+

_error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>

+ renderBacktrace(); ?> + setError($this->_error->getPrevious()); ?> + + + setError($this->error); ?> + +
+
- - countModules('sidebar-right')) : ?> -
- -
- -
- countModules('bottom-a')) : ?> -
- -
- - - countModules('bottom-b')) : ?> -
- -
- - countModules('footer')) : ?> -