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 | |
$modx->setLogTarget('HTML'); | |
print '<pre>'; | |
$topic = $modx->modblog->getTopic(289); | |
$blogs = $modx->modblog->getBlogs(); // Получаем все блоги | |
$blogtopics = array(); | |
foreach($blogs as $blog){ | |
// Создаем объект Топик-Блог (еще не сохраняем) |
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
<? | |
$rt = false; /* $rt will be an array if the event fires */ | |
if ($mgrEvents) { | |
$rt = $modx->invokeEvent("OnBeforeManagerLogin", $onBeforeLoginParams); | |
} else { | |
$rt = $modx->invokeEvent("OnBeforeWebLogin", $onBeforeLoginParams); | |
} | |
/* If the event fired, loop through the event array and fail if there's an error message */ | |
if (is_array($rt)) { | |
foreach ($rt as $key => $value) { /* php4 compatible */ |
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 YleyCompaniesUsersGetListProcessor extends modProcessor{ | |
public static function getInstance(modX &$modx,$className,$properties = array()) { | |
switch($properties['type']){ | |
case 'company__': | |
$className = require_once dirname(__FILE__).'/users/getlist.class.php'; | |
break; |
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 'OnManagerPageInit': | |
$JS = <<<JS | |
<script type="text/javascript"> | |
Ext.onReady(function(){ | |
// Получаем дерево | |
var tree = Ext.getCmp('modx-resource-tree'); |
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 | |
$memory = round(memory_get_usage()/1024/1024, 4).' Mb'; | |
print "<div>Memory: {$memory}</div>"; | |
$totalTime= ($modx->getMicroTime() - $modx->startTime); | |
$queryTime= $modx->queryTime; | |
$queryTime= sprintf("%2.4f s", $queryTime); | |
$queries= isset ($modx->executedQueries) ? $modx->executedQueries : 0; | |
$totalTime= sprintf("%2.4f s", $totalTime); |
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 | |
abstract class ShopmodxObjectGetListProcessor extends modObjectGetListProcessor{ | |
function prepareQueryBeforeCount(xPDOQuery $c) { | |
$this->addDerivativeCriteria($c); | |
return parent::prepareQueryBeforeCount($c); | |
} | |
protected function addDerivativeCriteria(xPDOQuery $c){ | |
$this->modx->addDerivativeCriteria($this->classKey, $c); |
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 | |
/** | |
* Smarty plugin | |
* | |
* @package Smarty | |
* @subpackage PluginsFunction | |
*/ | |
function smarty_function_processor($params, & $smarty) |
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 | |
$properties = $modx->resource->getOne('Template')->getProperties(); | |
if(!empty($properties['tpl'])){ | |
$tpl = $properties['tpl']; | |
} | |
else{ | |
$tpl = 'index.tpl'; | |
} |
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 | |
$manager = $modx->getManager(); | |
// Создаем таблицы | |
$objects = array( | |
'Order', | |
'OrderProduct', | |
'OrderStatus', |
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 | |
$q = $modx->newQuery('modResource'); | |
$q->innerJoin('ShopmodxProduct', 'Product'); | |
$q->leftJoin('modTemplateVarResource', 'tv', 'tv.contentid=modResource.id and tv.tmplvarid=29'); | |
$q->where(array( | |
"tv.id" => null, | |
)); | |
print $modx->getCount('modResource', $q); |