This file contains hidden or 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($doc = $modx->getObject('modResource', $ResId)){ | |
| $data = $doc->toArray(); | |
| $data['content'] = $content; | |
| $response = $modx->runProcessor('resource/update', $data); | |
| $modx->cacheManager->clearCache(); | |
| } |
This file contains hidden or 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
| http { | |
| # ... | |
| # Указываем папку для хранения кэша и ограничиваем его размер | |
| proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=cache:30m max_size=1g; | |
| # Кэширующий хост | |
| server { | |
| listen 80; |
This file contains hidden or 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 | |
| $response = $modx->runProcessor('resource/create', array( | |
| 'class_key' => 'msProduct', | |
| 'pagetitle' => 'Товар', | |
| 'parent' => 55, | |
| 'template' => 11, | |
| 'show_in_tree' => 1, | |
| //Данные | |
| 'price' => 100, |
This file contains hidden or 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 | |
| // Устанавливаем ТВ параметру mytv значение new у ресурса с id = 15 | |
| if ($resource = $modx->getObject('modResource', 15)) { | |
| $resource->setTVValue('mytv', 'new'); | |
| } |
This file contains hidden or 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
| .bg { | |
| background-image: url('img/img.jpg'); | |
| background-repeat: no-repeat; | |
| background-position: top center; | |
| background-size: cover; | |
| height: 100vh; | |
| width: 100%; | |
| position: relative; | |
| -webkit-transition: all 0.4s; | |
| -moz-transition: all 0.4s; |
This file contains hidden or 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
| {var $rows = ID | resource : 'elements' | fromJSON} | |
| {foreach $rows as $idx => $row} | |
| {$row.image} | |
| {/foreach} |
This file contains hidden or 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 | |
| //set_time_limit(00); | |
| define('MODX_API_MODE', true); | |
| require 'index.php'; | |
| $basePath = getcwd(); | |
| $modx->getService('error', 'error.modError'); | |
| $modx->setLogLevel(modX::LOG_LEVEL_ERROR); | |
| $modx->setLogTarget(array | |
| ( |
This file contains hidden or 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
| <? | |
| if ($_GET['url'] != ""){?> | |
| <iframe src="http://docs.google.com/gview?url=http://site.ru<?=$_GET['url']?> | |
| &embedded=true" width="100%" height="98%" frameborder="0">Ваш браузер не поддерживает фреймы | |
| </iframe><? | |
| } else { | |
| }?> |
This file contains hidden or 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
| $('#id').load(location.href+' #id>*',''); |
This file contains hidden or 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', ''); |