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 | |
namespace ExportPackage; | |
class SimpleBuilder | |
{ | |
const MS2_ALIAS_TABLE = 'ms2'; | |
const SITE_CONTENT_ALIAS_TABLE = 'resource'; | |
protected $ms2 = []; |
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
# Generated by Powerlevel10k configuration wizard on 2020-09-24 at 00:49 UTC. | |
# Based on romkatv/powerlevel10k/config/p10k-lean-8colors.zsh, checksum 36327. | |
# Wizard options: nerdfont-complete + powerline, small icons, lean_8colors, unicode, | |
# 24h time, 1 line, sparse, many icons, concise, transient_prompt, | |
# instant_prompt=verbose. | |
# Type `p10k configure` to generate another config. | |
# | |
# Config for Powerlevel10k with 8-color lean prompt style. Type `p10k configure` to generate | |
# your own config based on it. | |
# |
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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
## Options section | |
setopt correct # Auto correct mistakes | |
setopt extendedglob # Extended globbing. Allows using regular expressions with * |
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 | |
/** | |
* parse_csv | |
* parse CSV file into big array | |
* | |
* @param string $file | |
* @param string $separator | |
* @param array $meta | |
* @return array | |
*/ |
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
{'!pdoResources' | snippet: [ | |
'parents' => $_modx->resource.id, | |
'limit' => 0, | |
'tvPrefix' => '', | |
'tpl' => '', | |
'leftJoin' => [ | |
'UF' => [ | |
'class' => 'UserFile', | |
'on' => 'UF.parent = modResource.id AND UF.rank = 0' | |
] |
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 | |
class rpCountryGetListProcessor extends modProcessor | |
{ | |
public function process() | |
{ | |
$countryList = $this->getCountryList(); | |
$countries = array(); |
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 | |
switch ($modx->event->name) { | |
//Работа с контентом | |
case 'OnLoadWebDocument': | |
$content = $modx->resource->content; | |
$content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'); //исправляем ошибки кодировки | |
$dom = new DOMDocument; | |
$dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); |
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 | |
switch ($modx->event->name) { | |
case 'OnLoadWebDocument': | |
$content = $modx->resource->content; | |
$content = $content; | |
$dom = new DOMDocument; | |
$dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); | |
$imgs = $dom->getElementsByTagName('img'); |
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 | |
function getParents($id) { | |
global $modx; | |
$out = ''; | |
$arr = array(); | |
for ($i=0; $i<99; $i++) { | |
$parId = $modx->getObject('modResource', $id)->get('parent'); |
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 | |
$pdo = $modx->getService('pdoFetch'); | |
//$filds = 'id, pagetitle, longtitle, description, alias, introtext, content, parent, article, price, old_price, weight, image, made_in' | |
$pdo->setConfig(array( | |
'parents' => 0, | |
'limit' => 0, | |
'depth' => 999, | |
'return' => 'data', |
NewerOlder