Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added class based processors and some other improvements #192

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions assets/components/mxcalendars/connector.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
<?php
/**
* mcCalendars Connector
*
* @package mcCalendars
*/
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config.core.php';
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CONNECTORS_PATH . 'index.php';

$corePath = $modx->getOption('mxcalendars.core_path', null, $modx->getOption('core_path') . 'components/mxcalendars/');

$modx->mxcalendars = $modx->getService(
'mxCalendars',
'mxCalendars',
$corePath . 'model/mxcalendars/',
array(
'core_path' => $corePath
)
);

require_once dirname(dirname(dirname(dirname(__FILE__)))).'/config.core.php';
require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';
require_once MODX_CONNECTORS_PATH.'index.php';

$corePath = $modx->getOption('mxcalendars.core_path',null,$modx->getOption('core_path').'components/mxcalendars/');
require_once $corePath.'model/mxcalendars/mxcalendars.class.php';
$modx->mxcalendars = new mxCalendars($modx);

$modx->lexicon->load('mxcalendars:default');

/* handle request */
$path = $modx->getOption('processorsPath',$modx->mxcalendars->config,$corePath.'processors/');
$modx->request->handleRequest(array(
'processors_path' => $path,
'location' => '',
));
$modx->request->handleRequest(
array(
'processors_path' => $modx->getOption('processorsPath', null, $corePath . 'processors/'),
'location' => '',
)
);

?>
$modx->lexicon->load('mxcalendars:default');
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
Ext.onReady(function() {
MODx.load({ xtype: 'mxcalendars-page-home'});

// Load the datastore for the chunks
//mxcCore.stores.chunks.load();
});

mxcCore.page.Home = function(config) {
config = config || {};
Ext.applyIf(config,{
components: [{
xtype: 'mxcalendars-panel-home'
,renderTo: 'mxcalendars-panel-home-div'
xtype: 'mxcalendars-panel-home',
renderTo: 'mxcalendars-panel-home-div'
}]
});
mxcCore.page.Home.superclass.constructor.call(this,config);
};
Ext.extend(mxcCore.page.Home,MODx.Component);
Ext.reg('mxcalendars-page-home',mxcCore.page.Home);
Ext.extend(mxcCore.page.Home, MODx.Component);
Ext.reg('mxcalendars-page-home', mxcCore.page.Home);
137 changes: 77 additions & 60 deletions assets/components/mxcalendars/js/mgr/widgets/home.panel.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,84 @@
mxcCore.panel.Home = function(config) {
config = config || {};
Ext.apply(config,{
border: false
,baseCls: 'modx-formpanel'
,items: [{
html: '<img src="'+mxcCore.config.assetsUrl+'images/mxcalendar.png" alt="'+_('mxcalendars.management')+'" />'
,border: false
,cls: 'modx-page-header'
},{
xtype: 'modx-tabs'
,bodyStyle: 'padding: 10px'
,defaults: { border: false,autoHeight: true }
,border: true
,items: [{
//-- Events Tab
title: _('mxcalendars.tab_events')
,defaults: { autoHeight: true }
,items: [
// ADD DESCRIPTION INFORMATION
{
html: '<p>'+_('mxcalendars.management_desc')+'</p><br />'
,border: false
},
// ADD THE GRID CONTROLLER
{
xtype: 'mxcalendars-grid-events'
,preventRender: true
}
border: false,
baseCls: 'modx-formpanel',
cls: 'container',
items: [
{
html: '<h2>' + _('mxcalendars.component_title') + '</h2>',
border: false,
cls: 'modx-page-header'
},
{
xtype: 'modx-tabs',
bodyStyle: 'padding: 10px',
defaults: { border: false,autoHeight: true },
border: true,
items: [
{
//-- Events Tab
title: _('mxcalendars.tab_events'),
defaults: { autoHeight: true },
items: [
// ADD DESCRIPTION INFORMATION
{
html: '<p>' + _('mxcalendars.management_desc') + '</p><br />',
border: false
},
// ADD THE GRID CONTROLLER
{
xtype: 'mxcalendars-grid-events',
preventRender: true
}
]
},{
//-- Categories Tab
title: _('mxcalendars.tab_categories')
,defaults: { autoHeight: true }
,items: [{
html: '<p>'+_('mxcalendars.category_desc')+'</p><br />'
,border: false
},{
xtype: 'mxcalendars-grid-categories'
,preventRender: true
}]
},{
//-- Calendars Tab
title: _('mxcalendars.tab_calendars')
,items: [{
html: '<p>'+_('mxcalendars.calendar_desc')+'</p><br />'
,border: false
},{
xtype: 'mxcalendars-grid-calendars'
,preventRender: true
}]
},{
//-- Feeds Tab
title: _('mxcalendars.tab_feed')
,items: [{
html: '<p>'+_('mxcalendars.feed_desc')+'</p><br />'
,border: false
},{
xtype: 'mxcalendars-grid-feeds'
,preventRender: true
}]
}
]
}]
},
{
//-- Categories Tab
title: _('mxcalendars.tab_categories'),
defaults: { autoHeight: true },
items: [
{
html: '<p>' + _('mxcalendars.category_desc') + '</p><br />',
border: false
},
{
xtype: 'mxcalendars-grid-categories',
preventRender: true
}
]
},
{
//-- Calendars Tab
title: _('mxcalendars.tab_calendars'),
items: [
{
html: '<p>' + _('mxcalendars.calendar_desc') + '</p><br />',
border: false
},
{
xtype: 'mxcalendars-grid-calendars',
preventRender: true
}
]
},
{
//-- Feeds Tab
title: _('mxcalendars.tab_feed'),
items: [
{
html: '<p>' + _('mxcalendars.feed_desc') + '</p><br />',
border: false
},
{
xtype: 'mxcalendars-grid-feeds',
preventRender: true
}
]
}
]
}
]
});
mxcCore.panel.Home.superclass.constructor.call(this,config);
};
Expand Down
Loading