diff --git a/source/packages/com_mokoog/access.xml b/source/packages/com_mokoog/access.xml new file mode 100644 index 0000000..2aa21c2 --- /dev/null +++ b/source/packages/com_mokoog/access.xml @@ -0,0 +1,20 @@ + + + +
+ + + + + + + + +
+
diff --git a/source/packages/com_mokoog/config.xml b/source/packages/com_mokoog/config.xml new file mode 100644 index 0000000..03202c4 --- /dev/null +++ b/source/packages/com_mokoog/config.xml @@ -0,0 +1,33 @@ + + + +
+ +
+
+ +
+
diff --git a/source/packages/com_mokoog/language/en-GB/com_mokoog.ini b/source/packages/com_mokoog/language/en-GB/com_mokoog.ini index ae9e73d..b920280 100644 --- a/source/packages/com_mokoog/language/en-GB/com_mokoog.ini +++ b/source/packages/com_mokoog/language/en-GB/com_mokoog.ini @@ -82,3 +82,11 @@ COM_MOKOOG_FIELD_ROBOTS="Robots" COM_MOKOOG_FIELD_ROBOTS_DESC="Per-page robots directive, e.g. noindex, nofollow." COM_MOKOOG_FIELD_CANONICAL_URL="Canonical URL" COM_MOKOOG_FIELD_CANONICAL_URL_DESC="Overrides the canonical URL for this content item (http/https only)." + +; ACL actions (access.xml) and component options (config.xml) +COM_MOKOOG_ACTION_BATCH="Batch Generate OG Tags" +COM_MOKOOG_ACTION_BATCH_DESC="Allows users in this group to run batch OG tag generation." +COM_MOKOOG_ACTION_IMPORT="Import / Export OG Tags" +COM_MOKOOG_ACTION_IMPORT_DESC="Allows users in this group to import and export OG tags via CSV." +COM_MOKOOG_CONFIG_NOTE_LABEL="Where are the settings?" +COM_MOKOOG_CONFIG_NOTE_DESC="Open Graph and SEO settings are configured in the System - MokoSuiteOpenGraph plugin (Extensions → Plugins). This screen manages component permissions only." diff --git a/source/packages/com_mokoog/language/en-US/com_mokoog.ini b/source/packages/com_mokoog/language/en-US/com_mokoog.ini index ae9e73d..b920280 100644 --- a/source/packages/com_mokoog/language/en-US/com_mokoog.ini +++ b/source/packages/com_mokoog/language/en-US/com_mokoog.ini @@ -82,3 +82,11 @@ COM_MOKOOG_FIELD_ROBOTS="Robots" COM_MOKOOG_FIELD_ROBOTS_DESC="Per-page robots directive, e.g. noindex, nofollow." COM_MOKOOG_FIELD_CANONICAL_URL="Canonical URL" COM_MOKOOG_FIELD_CANONICAL_URL_DESC="Overrides the canonical URL for this content item (http/https only)." + +; ACL actions (access.xml) and component options (config.xml) +COM_MOKOOG_ACTION_BATCH="Batch Generate OG Tags" +COM_MOKOOG_ACTION_BATCH_DESC="Allows users in this group to run batch OG tag generation." +COM_MOKOOG_ACTION_IMPORT="Import / Export OG Tags" +COM_MOKOOG_ACTION_IMPORT_DESC="Allows users in this group to import and export OG tags via CSV." +COM_MOKOOG_CONFIG_NOTE_LABEL="Where are the settings?" +COM_MOKOOG_CONFIG_NOTE_DESC="Open Graph and SEO settings are configured in the System - MokoSuiteOpenGraph plugin (Extensions → Plugins). This screen manages component permissions only." diff --git a/source/packages/com_mokoog/mokoog.xml b/source/packages/com_mokoog/mokoog.xml index 19fc76c..1fa979d 100644 --- a/source/packages/com_mokoog/mokoog.xml +++ b/source/packages/com_mokoog/mokoog.xml @@ -64,6 +64,11 @@ en-GB + en-US + + + access.xml + config.xml COM_MOKOOG diff --git a/source/packages/com_mokoog/src/Controller/BatchController.php b/source/packages/com_mokoog/src/Controller/BatchController.php index c07cba1..ee2aff8 100644 --- a/source/packages/com_mokoog/src/Controller/BatchController.php +++ b/source/packages/com_mokoog/src/Controller/BatchController.php @@ -29,7 +29,10 @@ class BatchController extends BaseController { Session::checkToken('get') || throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403); - if (!Factory::getApplication()->getIdentity()->authorise('core.create', 'com_mokoog')) { + $identity = Factory::getApplication()->getIdentity(); + + if (!$identity->authorise('mokoog.batch', 'com_mokoog') + && !$identity->authorise('core.create', 'com_mokoog')) { throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } @@ -62,7 +65,10 @@ class BatchController extends BaseController { Session::checkToken('get') || throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403); - if (!Factory::getApplication()->getIdentity()->authorise('core.create', 'com_mokoog')) { + $identity = Factory::getApplication()->getIdentity(); + + if (!$identity->authorise('mokoog.batch', 'com_mokoog') + && !$identity->authorise('core.create', 'com_mokoog')) { throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } diff --git a/source/packages/com_mokoog/src/Controller/ImportExportController.php b/source/packages/com_mokoog/src/Controller/ImportExportController.php index befda03..336d744 100644 --- a/source/packages/com_mokoog/src/Controller/ImportExportController.php +++ b/source/packages/com_mokoog/src/Controller/ImportExportController.php @@ -110,7 +110,8 @@ class ImportExportController extends BaseController $identity = Factory::getApplication()->getIdentity(); - if (!$identity->authorise('core.create', 'com_mokoog') || !$identity->authorise('core.edit', 'com_mokoog')) { + if (!$identity->authorise('mokoog.import', 'com_mokoog') + && !($identity->authorise('core.create', 'com_mokoog') && $identity->authorise('core.edit', 'com_mokoog'))) { throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); } diff --git a/source/packages/com_mokoog/src/Field/index.html b/source/packages/com_mokoog/src/Field/index.html deleted file mode 100644 index 94906bc..0000000 --- a/source/packages/com_mokoog/src/Field/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/source/packages/com_mokoog/src/Service/index.html b/source/packages/com_mokoog/src/Service/index.html deleted file mode 100644 index 94906bc..0000000 --- a/source/packages/com_mokoog/src/Service/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/source/packages/com_mokoog/src/View/Tags/HtmlView.php b/source/packages/com_mokoog/src/View/Tags/HtmlView.php index e80d0ae..f0ae838 100644 --- a/source/packages/com_mokoog/src/View/Tags/HtmlView.php +++ b/source/packages/com_mokoog/src/View/Tags/HtmlView.php @@ -85,6 +85,7 @@ class HtmlView extends BaseHtmlView ToolbarHelper::editList('tag.edit'); ToolbarHelper::custom('batch.generate', 'refresh', '', 'COM_MOKOOG_TOOLBAR_BATCH_GENERATE', false); ToolbarHelper::custom('importexport.export', 'download', '', 'COM_MOKOOG_TOOLBAR_EXPORT', false); + ToolbarHelper::custom('mokoog.showimport', 'upload', '', 'COM_MOKOOG_TOOLBAR_IMPORT', false); ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'tags.delete'); ToolbarHelper::preferences('com_mokoog'); } diff --git a/source/packages/com_mokoog/tmpl/tags/default.php b/source/packages/com_mokoog/tmpl/tags/default.php index bf6a82b..81b4d49 100644 --- a/source/packages/com_mokoog/tmpl/tags/default.php +++ b/source/packages/com_mokoog/tmpl/tags/default.php @@ -173,6 +173,23 @@ $token = Session::getFormToken(); + + +