Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Sentinel-7/820a7deeaaddb40e1d11fed9d53e33cd to your computer and use it in GitHub Desktop.
Save Sentinel-7/820a7deeaaddb40e1d11fed9d53e33cd to your computer and use it in GitHub Desktop.
BannerY + description
// начиная с 367 строке
{
xtype: 'bannery-filter-resources'
,fieldLabel: _('bannery.ads.url')
,name: 'url'
,description: _('bannery.ads.url.description')
,anchor: '99%'
,allowBlank: true
},{
xtype: 'textarea'
,fieldLabel: _('bannery.ads.description')
,name: 'description'
,anchor: '99%'
,height: 75
,allowBlank: true
,resize: true
,id: 'bannery-window-ad-description'
,listeners: {
render: function () {
if (MODx.loadRTE) {
window.setTimeout(function() {
MODx.loadRTE('bannery-window-ad-description'); // id поля
}, 300);
}
Ext.getCmp('bannery-window-ad').setWidth('1100');
}
}
}]
<?php
class BanneryHomeManagerController extends BanneryManagerController {
public function process(array $scriptProperties = array()) {}
public function getPageTitle() { return $this->modx->lexicon('bannery'); }
public function loadCustomCssJs() {
// OnRichTextEditorRegister оно
$event_output = $this->modx->invokeEvent("OnRichTextEditorRegister");
if(is_array($event_output)) {
$editor = $event_output[0];
$event_output = $this->modx->invokeEvent("OnRichTextEditorInit", array('editor'=>$editor, 'elements'=>array()));
}
$modx23 = !empty($this->modx->version) && version_compare($this->modx->version['full_version'], '2.3.0', '>=');
$this->modx->controller->addHtml('<script type="text/javascript">
Ext.onReady(function() {
MODx.modx23 = '.(int)$modx23.';
});
</script>');
if (!$modx23) {
$this->addCss($this->bannery->config['cssUrl'] . 'mgr/font-awesome.min.css');
}
$this->addCss($this->bannery->config['cssUrl']. 'mgr/main.css');
$this->addLastJavascript($this->bannery->config['jsUrl'].'mgr/plugins/dragdropgrid.js');
$this->addLastJavascript($this->bannery->config['jsUrl'].'mgr/widgets/banners.grid.js');
$this->addLastJavascript($this->bannery->config['jsUrl'].'mgr/widgets/positions.grid.js');
$this->addLastJavascript($this->bannery->config['jsUrl'].'mgr/widgets/referrers.grid.js');
$this->addLastJavascript($this->bannery->config['jsUrl'].'mgr/widgets/stats.panel.js');
$this->addLastJavascript($this->bannery->config['jsUrl'].'mgr/widgets/home.panel.js');
$this->addLastJavascript($this->bannery->config['jsUrl'].'mgr/sections/index.js');
$this->addLastJavascript(MODX_MANAGER_URL . 'assets/modext/util/datetime.js');
}
public function getTemplateFile() {
return $this->bannery->config['templatesPath'].'home.tpl';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment