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
| [ | |
| { | |
| "renderer": "this.renderImage", | |
| "sourceFrom": "migx", | |
| "header": "Картинка", | |
| "dataIndex": "slide" | |
| }, | |
| { | |
| "header": "Описание", | |
| "dataIndex": "alt_text" |
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
| [ | |
| { | |
| "caption": "Заголовок", | |
| "fields": [ | |
| { | |
| "field": "slide", | |
| "caption": "Картинка", | |
| "inputTVtype": "image", | |
| "sourceFrom": "migx" | |
| } |
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' && $mode == 'new') || ($modx->event->name == 'OnDocFormRender' && $mode == 'upd')) { | |
| switch ($resource->get('template')) { | |
| //ID шаблонов страниц | |
| case 1: | |
| case 2: | |
| case 3: | |
| //ID источника файлов | |
| $source = 1; | |
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
| in terminal from sudo | |
| sudo defaults delete /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled | |
| rebot system |
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 | |
| class clearGetParams extends Middlewares\Middleware | |
| { | |
| public $contexts = ['web']; | |
| public function onRequest() | |
| { | |
| if ($gets = request()->query()) { | |
| $white_list = array_fill_keys(explode(',', config('get_params')), null); | |
| if ($diff = array_diff_key($gets, $white_list)) { |
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
| //Очистить источники файлов на вкладке файлы. | |
| //1)Создаём в нужном источнике параметр - hideSource (булев) - значение 1 | |
| //2)Создаём плагин на событие - OnMediaSourceGetProperties | |
| <?php | |
| $properties = json_decode($properties, true); | |
| if (!empty($properties['hideSource']) AND !empty($properties['hideSource']['value']) AND $_REQUEST['node'] == '/') { | |
| die('{}'); | |
| } |
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 | |
| for ($i=0; $i<=15; $i++){ | |
| $res = $modx->newObject('modResource'); | |
| $res->set('template', 10); | |
| $res->set('isfolder', 0); | |
| $res->set('published', 1); | |
| $res->set('publishedon', time()); | |
| $res->set('createdon', time()); | |
| $res->set('pagetitle', 'СКУД '.$i); | |
| $res->set('alias', 'skud'.$i); |
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
| mysqldump --all-databases -u User -p Pass > dumpfile.sql | |
| обратно | |
| mysql -u User -p Pass < dumpfile.sql |
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
| 1)В таблицах для картинок лучше указывать width:100% а не max-width:100% | |
| 2)При модели расчёта box-sizing:border-box; лучше картинкам задавать не margin для отступов, а padding, таким образом не произойдёт выпадание контента | |
| 3)Блокировка прокрутки элемента - position:fixed;overflow:hidden; |
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 | |
| /** @var modx $modx */ | |
| switch ($modx->event->name) { | |
| case 'pdoToolsOnFenomInit': | |
| $fenom->addBlockFunction('master', function (array $params, $content) use ($modx) { | |
| if ($modx->user->isMember('Administrator')) { | |
| return $content; | |
| } | |
| }); | |
| break; |