Created
April 30, 2018 16:01
-
-
Save pavel-one/edfb408d25673f0c47885d75bfe5429d to your computer and use it in GitHub Desktop.
MODX Extjs Интересные методы
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$eventName = $modx->event->name; | |
switch($eventName) { | |
case 'OnDocFormPrerender': | |
// Для ресурсов с индетификатором шаблона 2 | |
// а также для всех новых ресурсов ( $resource == null ) | |
if( $resource && $resource->get('template') == 2 || !$resource){ | |
$modx->regClientStartupHTMLBlock('<script> | |
Ext.onReady(function() { | |
// Добавляем вкладку | |
MODx.addTab("modx-resource-tabs",{title:"SEO",id:"seo"}); | |
// Прячем ненужные вкладки | |
MODx.hideRegion("modx-resource-tabs", "modx-panel-resource-tv"); | |
MODx.hideRegion("modx-resource-tabs", "modx-resource-access-permissions"); | |
// Прячем ненужные поля | |
MODx.hideField("modx-panel-resource", ["modx-resource-content","description"]); | |
// Переносим TV на вкладку | |
MODx.moveTV(["tv32"], "seo"); | |
}); | |
</script>'); | |
} | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment