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
[[!mFilter2? | |
&parents=`7` | |
&element=`msProducts` | |
&tpl=`_tpl.msProducts.row` | |
&filters=` | |
parent:categories | |
,ms|price:number | |
` | |
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 | |
/** | |
* The base class for modModX. | |
*/ | |
class modModX extends modX | |
{ | |
/** @var SubdomainsFolder $SubdomainsFolder */ | |
public $SubdomainsFolder; | |
public $domains; |
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 (empty($_REQUEST['action'])) { | |
@session_write_close(); | |
die('Access denied'); | |
} | |
$_REQUEST['action'] = strtolower(ltrim($_REQUEST['action'], '/')); | |
define('MODX_API_MODE', true); | |
$productionIndex = dirname(dirname(dirname(dirname(__FILE__)))) . '/index.php'; | |
$developmentIndex = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/index.php'; |
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 | |
$table = $modx->getTableName('modResource'); | |
$sql = "SELECT id,content FROM {$table};"; | |
$stmt = $modx->prepare($sql); | |
$stmt->execute(); | |
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC); | |
$sql = ''; | |
$ids = 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
<?php | |
$id =1; | |
$q = $modx->newQuery('modUserGroupMember', array('member' => $id)); | |
$q->leftJoin('modUserGroup', 'modUserGroup', 'modUserGroup.id = modUserGroupMember.user_group'); | |
$q->select('modUserGroupMember.user_group,modUserGroup.name'); | |
$q->sortby('modUserGroupMember.user_group'); | |
if ($q->prepare() && $q->stmt->execute()) { | |
$row = $q->stmt->fetch(PDO::FETCH_ASSOC); | |
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 = 1; | |
if ($User = $modx->getObject('modUser', $id) AND $Profile = $User->getOne('Profile')) { | |
$Profile->set('comment', 'comment'); | |
$Profile->set('zip', 'zip' ); | |
$Profile->save(); | |
} |
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 == 'msOnSubmitOrder') { | |
if ($data['email'] != $data['confirm_email']) { | |
$modx->event->output('wrong email'); | |
} | |
} |
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 | |
$Tickets = $modx->getService('tickets', 'Tickets', $modx->getOption('tickets.core_path', null, $modx->getOption('core_path') . 'components/tickets/') . 'model/tickets/', $scriptProperties); | |
$Tickets->initialize($modx->context->key, $scriptProperties); | |
/** @var pdoFetch $pdoFetch */ | |
$fqn = $modx->getOption('pdoFetch.class', null, 'pdotools.pdofetch', true); | |
if ($pdoClass = $modx->loadClass($fqn, '', false, true)) { | |
$pdoFetch = new $pdoClass($modx, $scriptProperties); | |
} elseif ($pdoClass = $modx->loadClass($fqn, MODX_CORE_PATH . 'components/pdotools/model/', false, true)) { | |
$pdoFetch = new $pdoClass($modx, $scriptProperties); |
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 array $scriptProperties */ | |
$context = $scriptProperties['context'] = $modx->getOption('context', $scriptProperties, $modx->context->key, true); | |
$class = $scriptProperties['class'] = $modx->getOption('class', $scriptProperties, 'glCity', true); | |
$objectName = $scriptProperties['objectName'] = $modx->getOption('objectName', $scriptProperties, 'gl', true); | |
$modalShow = $scriptProperties['modalShow'] = (boolean)$modx->getOption('modalShow', $scriptProperties, true, true); | |
/** @var gl $gl */ | |
if (!$gl = $modx->getService('gl', 'gl', $modx->getOption('gl_core_path', null, $modx->getOption('core_path') . 'components/gl/') . 'model/gl/', $scriptProperties)) { | |
return 'Could not load gl class!'; |
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
[[-!111? | |
]] | |
<p> | |
Ваш город: | |
<span class="gl-current-select">[[!+gl.current.city.name_ru]]</span> | |
</p> | |
[[!gl.modal? | |
&class=`glCity` | |
]] |