Last active
April 5, 2017 07:50
-
-
Save alexsoin/43f60d054d49de6902e228dfaeb1b461 to your computer and use it in GitHub Desktop.
Запретить Tickets заполнять introtext. Плагин на событие OnDocFormSave
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 | |
if ($modx->event->name == "OnDocFormSave") { | |
if ($resource->class_key != 'Ticket') return; | |
$introtext = $resource->get('introtext'); | |
$generateIntrotext = $resource->getIntroText($resource->get('content'), false); | |
if (empty($resource->getProperty('disable_jevix'))) { | |
$generateIntrotext = $resource->Jevix($generateIntrotext); | |
} | |
if ($introtext == $generateIntrotext) { | |
$resource->set('introtext', ''); | |
$resource->save(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment