Skip to content

Commit a1ecef7

Browse files
committed
add the new UI
1 parent 3c70af5 commit a1ecef7

File tree

18 files changed

+235
-73
lines changed

18 files changed

+235
-73
lines changed

docs/USER_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The component will automatically create the required database tables upon instal
4242
3. Update the CMS details:
4343
- **Name**: Descriptive name for the CMS
4444
- **URL**: Base URL of the source CMS
45-
- **Credentials**: API keys or authentication details
45+
- **Credentials**: API keys or authentication details. Refer to [Auth Guidance](AUTHENTICATION_GUIDE.md).
4646

4747
### 2. Obtaining CMS Credentials
4848

src/administrator/components/com_ccm/ccm.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
<language tag="en-GB">language/en-GB/com_ccm.ini</language>
4444
<language tag="en-GB">language/en-GB/com_ccm.sys.ini</language>
4545
</languages>
46-
<menu link="option=com_ccm" img="class:default">COM_CCM_MENU_BACKEND</menu>
46+
<menu link="option=com_ccm&amp;view=cmss" img="class:default">COM_CCM_MENU_BACKEND</menu>
47+
<submenu>
48+
<menu link="option=com_ccm&amp;view=cmss" img="class:default">COM_CCM_SUBMENU_CMS</menu>
49+
<menu link="option=com_ccm&amp;view=migration" img="class:default">COM_CCM_SUBMENU_MIGRATION</menu>
50+
</submenu>
4751
</administration>
4852
</extension>

src/administrator/components/com_ccm/language/en-GB/com_ccm.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
COM_CCM_DESCRIPTION="CONTENT MIGRATION COMPONENT"
2-
COM_CCM_MENU_BACKEND="CCM BACKEND"
2+
COM_CCM_MENU_BACKEND="CMSs"
33
COM_CCM_CONFIGURATION="CCM Migration Configuration"
44
COM_CCM_OPTIONS="Options"
55
COM_CCM_CONFIG_CMS_NAME_DESCRIPTION="The name of the CMS to migrate from."
@@ -18,9 +18,12 @@ COM_CCM_CONFIG_CCM_MAPPED_FIELDS_LABEL="CCM Mapped Fields"
1818
COM_CCM_CONFIG_CCM_UNMAPPED_FIELDS_LABEL="CCM Unmapped Fields"
1919
COM_CCM_CONFIG_MIGRATION_LABEL="Select CMS you want to migrate with"
2020
COM_CCM_CMS_NAME_LIST="CMS Names List"
21+
COM_CCM_CMS_NAME_ADD="Add new CMS"
22+
COM_CCM_SUBMENU_CMS="CMS Management"
23+
COM_CCM_SUBMENU_MIGRATION="Migration"
24+
COM_CCM_TITLE_CMS="Content Management Systems"
25+
COM_CCM_TITLE_MIGRATION="Content Migration"
2126
APPLY_MIGRATION_BTN="Apply Migration"
2227
MIGRATION_SOURCE_CMS="Source CMS"
2328
MIGRATION_TARGET_CMS="Target CMS"
24-
MIGRATION_SOURCE_CMS_OBJECT_TYPE="Choose the object type you need to migrate from the source CMS"
25-
MIGRATION_TARGET_CMS_OBJECT_TYPE="Choose the object type you need to migrate to the target CMS"
2629
COM_CCM_MIGRATION_FIELDSET_LABEL="Migration Settings"

src/administrator/components/com_ccm/language/en-GB/com_ccm.sys.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
COM_CCM_DESCRIPTION="CONTENT MIGRATION COMPONENT"
2-
COM_CCM_MENU_BACKEND="CCM BACKEND"
2+
COM_CCM_MENU_BACKEND="CMSs"
33
COM_CCM_CONFIGURATION="CCM Migration Configuration"
44
COM_CCM_OPTIONS="Options"
55
COM_CCM_CONFIG_CMS_NAME_DESCRIPTION="The name of the CMS to migrate from."
@@ -17,9 +17,12 @@ COM_CCM_CONFIG_CCM_MAPPED_FIELDS_LABEL="CCM Mapped Fields"
1717
COM_CCM_CONFIG_CCM_UNMAPPED_FIELDS_LABEL="CCM Unmapped Fields"
1818
COM_CCM_CONFIG_MIGRATION_LABEL="Select CMS you want to migrate with"
1919
COM_CCM_CMS_NAME_LIST="CMS Names List"
20+
COM_CCM_CMS_NAME_ADD="Add new CMS"
21+
COM_CCM_SUBMENU_CMS="CMS Management"
22+
COM_CCM_SUBMENU_MIGRATION="Migration"
23+
COM_CCM_TITLE_CMS="Content Management Systems"
24+
COM_CCM_TITLE_MIGRATION="Content Migration"
2025
APPLY_MIGRATION_BTN="Apply Migration"
2126
MIGRATION_SOURCE_CMS="Source CMS"
2227
MIGRATION_TARGET_CMS="Target CMS"
23-
MIGRATION_SOURCE_CMS_OBJECT_TYPE="Choose the object type you need to migrate from the source CMS"
24-
MIGRATION_TARGET_CMS_OBJECT_TYPE="Choose the object type you need to migrate to the target CMS"
2528
COM_CCM_MIGRATION_FIELDSET_LABEL="Migration Settings"

src/administrator/components/com_ccm/src/Controller/DisplayController.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,22 @@ class DisplayController extends BaseController
1212
* @since __DEV__
1313
*/
1414
protected $default_view = 'Cmss';
15+
16+
/**
17+
* Method to display a view.
18+
*
19+
* @param boolean $cachable If true, the view output will be cached
20+
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}.
21+
*
22+
* @return static This object to support chaining.
23+
*
24+
* @since __DEV__
25+
*/
26+
public function display($cachable = false, $urlparams = [])
27+
{
28+
$view = $this->input->get('view', $this->default_view);
29+
$this->input->set('view', $view);
30+
31+
return parent::display($cachable, $urlparams);
32+
}
1533
}

src/administrator/components/com_ccm/src/Extension/CCMComponent.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use Joomla\CMS\Extension\BootableExtensionInterface;
88
use Joomla\CMS\Extension\MVCComponent;
9+
use Joomla\CMS\HTML\HTMLHelper;
10+
use Joomla\CMS\Language\Text;
911
use Psr\Container\ContainerInterface;
1012

1113
// starting point for the component
@@ -14,4 +16,16 @@ class CCMComponent extends MVCComponent implements BootableExtensionInterface
1416
public function boot(ContainerInterface $container) {
1517
// Initialize your component here
1618
}
19+
20+
/**
21+
* Returns valid contexts
22+
*
23+
* @return array
24+
*
25+
* @since __DEV__
26+
*/
27+
public function getContexts(): array
28+
{
29+
return ['com_ccm.cms', 'com_ccm.migration'];
30+
}
1731
}

src/administrator/components/com_ccm/src/Model/MigrationModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MigrationModel extends FormModel
2727
public function __construct($config = [], $http = null)
2828
{
2929
parent::__construct($config);
30-
$this->migrationMapFile = dirname(__DIR__, 1) . '/Schema/migrationIdMap.json';
30+
$this->migrationMapFile = dirname(__DIR__, 1) . '/Schema/migrationMap.json';
3131

3232
if ($http && !($http instanceof Http)) {
3333
$http = null;

src/administrator/components/com_ccm/src/Schema/joomla-ccm.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,18 @@
216216
},
217217
"parent_id": {
218218
"default": 1
219+
},
220+
"published": {
221+
"ccm": "status",
222+
"map": {
223+
"publish": 1,
224+
"draft": 0,
225+
"pending": 0,
226+
"future": 0,
227+
"private": 0,
228+
"trash": -2
229+
},
230+
"default": 1
219231
}
220232
}
221233
},

src/administrator/components/com_ccm/src/View/Cmss/HtmlView.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ protected function addToolbar()
3636
{
3737
$canDo = ContentHelper::getActions('com_ccm');
3838
$toolbar = $this->getDocument()->getToolbar();
39-
ToolbarHelper::title(Text::_('COM_CCM_CMS_NAME_LIST'), 'ccm');
39+
ToolbarHelper::title(Text::_('COM_CCM_TITLE_CMS'), 'generic');
4040

4141
if ($canDo->get('core.create')) {
4242
$toolbar->addNew('cms.add');
4343
}
44+
45+
if ($canDo->get('core.edit')) {
46+
$toolbar->edit('cms.edit');
47+
}
48+
49+
if ($canDo->get('core.delete')) {
50+
$toolbar->delete('cmss.delete');
51+
}
4452
}
4553
}

0 commit comments

Comments
 (0)