Skip to content

Instantly share code, notes, and snippets.

kosherMap.combo.Class = function (config) {
config = config || {};
Ext.applyIf(config, {
name: 'class',
hiddenName: 'class',
editable: true,
store: new Ext.data.ArrayStore({
id: 0,
fields: ['id','name','src'],
data: [[1, 'Stadium', 'ball_rus.png'], [2, 'Mikva', 'mikva.png'], [3, 'Shabbat', 'shabat.png'], [4, 'Shop', 'shop.png'], [5, 'Synagogue', 'sinagoga.png']]
// $this->addJavascript(MODX_ASSETS_URL . 'components/tinymcerte/js/vendor/tinymce/tinymce.min.js');
// $this->addJavascript(MODX_ASSETS_URL . 'components/tinymcerte/js/vendor/autocomplete.js');
// $this->addJavascript(MODX_ASSETS_URL . 'components/tinymcerte/js/mgr/tinymcerte.js');
// TinyMCERTE.editorConfig = {"plugins":"advlist autolink lists modximage charmap print preview anchor visualblocks searchreplace code fullscreen insertdatetime media table contextmenu paste modxlink","toolbar1":"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image","toolbar2":"","toolbar3":"","modxlinkSearch":"\/assets\/components\/tinymcerte\/js\/vendor\/tinymce\/plugins\/modxlink\/search.php","language":"ru","directionality":"ltr","menubar":"file edit insert view format table tools","statusbar":true,"image_advtab":true,"paste_as_text":false,"style_formats_merge":false,"object_resizing":true,"link_class_list":"","browser_spellcheck":false,"content_css
.btn-ar
border: 5px solid #ffc42a
border-image-source: repeating-linear-gradient(-45deg,#ffc42a,#ffc42a 10px,#575757 0,#575757 20px)
border-image-slice: 5
padding: 0.3em
<?php
$url = 'http://feed.com/export/main/database/?data=objects&format=yandex&v=yandex&key=link_feed=xml';
$file = MODX_ASSETS_PATH.'components/name/file/filename.xml';
if (!copy($url, $file)) {
echo "не удалось скопировать $file...\n";
}
$xml = new XMLReader();
$doc = new DOMDocument;
<?php
class Xml2Json {
public function Parse ($url) {
$fileContents= file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
return $json;
<?php
$gallery = array(
'id' => $rid,
'name' => '',
'rank' => 0,
'file' => MODX_BASE_PATH.$arr[7]
);
$upload = $modx->runProcessor('gallery/upload', $gallery, array(
'processors_path' => MODX_CORE_PATH.'components/minishop2/processors/mgr/'
));
{'pdoCrumbs' | snippet : [
'showHome' => 1,
'tpl'=> '@INLINE <li class="breadcrumb-item" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a href="{{+link}}" itemscope itemtype="http://schema.org/Thing" itemprop="item">
<span itemprop="name">{{+menutitle}}</span>
</a>
<meta itemprop="position" content="{{+idx}}" />
</li>',
'tplCurrent' => '@INLINE <li class="breadcrumb-item active" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<span itemscope itemtype="http://schema.org/Thing" itemprop="item">
// lg
@media screen and (max-width: 1199px)
.catalogItem
height: 210px
margin-bottom: 20px
// md
@media screen and (max-width: 991px)
.catalogItem
height: 155px
// православный способ обработки "Fatal error: Call to a member function ..."
$res = $modx->getObject('className', 5);
if (is_object($res) && $res->get('id')) {
echo '1';
} else {
echo '0';
}
Ext.onReady(function() {
MODx.Ajax.request({
url: Component.config.connector_url,
params: {
action: 'mgr/getlist',
},
listeners: {
success: {fn:function(r) {
console.log(r);
} }