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 | |
switch ($modx->event->name) { | |
case 'OnManagerPageBeforeRender': | |
$msoptionscolor = $modx->getService('msoptionscolor', 'msoptionscolor', $modx->getOption('msoptionscolor_core_path', null, $modx->getOption('core_path') . 'components/msoptionscolor/') . 'model/msoptionscolor/'); | |
if (!($msoptionscolor instanceof msoptionscolor)) { | |
return ''; | |
} | |
if (!$config = $controller->config) { | |
return ''; |
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 | |
/* OnDocFormPrerender */ | |
switch ($modx->event->name) { | |
case 'OnDocFormPrerender': | |
if ($mode !== 'upd') { | |
return ''; | |
} | |
$modx->controller->addHtml('<script type="text/javascript"> | |
Ext.ComponentMgr.onAvailable("minishop2-product-settings-panel", function() { | |
this.on("afterrender", function() { |
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 | |
switch ($modx->event->name) { | |
case 'psOnBeforeOrderSubmit': | |
$payandsee = $modx->getService('payandsee'); | |
$list = $payandsee->ListGet(); | |
$user = $modx->user->id; | |
foreach($list as $key => $subscription) { | |
if ($subscription['pas_price'] != 0) { | |
continue; | |
} |
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 | |
$msop2 = $modx->getService('msop2', 'msop2', $modx->getOption('msop2_core_path', null, $modx->getOption('core_path') . 'components/msop2/') . 'model/msop2/', $scriptProperties); | |
if (!($msop2 instanceof msop2)) return ''; | |
$msop2Option = 0; | |
if(!$msop2Option = $modx->getObject('msop2Option', $name)) { | |
$msop2Option = $msop2Option->get('id'); | |
} | |
$miniShop2 = $modx->getService('minishop2'); | |
/* @var array $scriptProperties */ | |
/* @var pdoFetch $pdoFetch */ |
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 msDiscount $msDiscount */ | |
/** @var pdoTools $pdoTools */ | |
$pdoTools = $modx->getService('pdoTools'); | |
$msDiscount = $modx->getService('msDiscount'); | |
$date = $pdoTools->getStore('msd_date'); | |
$usergroups = array_keys($msDiscount->getUserGroups($modx->user->id)); | |
$sales = !empty($date) | |
? $msDiscount->getSales($date, true) | |
: $msDiscount->getSales(); |
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 psAccount extends xPDOSimpleObject | |
{ | |
public $_validated = array(); | |
protected $isSetFields = false; | |
protected $closedFields = array('user', 'method', 'identifier', 'balance', 'incoming', 'outcoming', 'active'); |
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 | |
// Add RTE for introtext if richtext option is enabled for the resource | |
// check "OnDocFormRender" event | |
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() { | |
if(MODx.loadRTE) MODx.loadRTE("modx-resource-introtext"); | |
});</script>'); |
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
public function getUser() { | |
$userId = $_SESSION['easyauth']['userId']; | |
$userObject = $this->modx->runProcessor('mgr/user/get', array('id'=>$userId), array('processors_path' => $this->getOption('processorsPath'))); | |
$user = $userObject->response['object']; | |
return $user; | |
} | |
public function getUser() { | |
$userId = $_SESSION['easyauth']['userId']; | |
$response = $this->modx->runProcessor('mgr/user/get', |
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
public function save($cacheFlag = false) | |
{ | |
$isNew = $this->isNew(); | |
if ($isNew) { | |
$this->set('num', $this->getnum()); | |
$this->set('createdon', date('Y-m-d H:i:s')); | |
} else { | |
$this->set('updatedon', date('Y-m-d H:i:s')); | |
} |
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 | |
$msop2 = $modx->getService('msop2', 'msop2', $modx->getOption('msop2_core_path', null, $modx->getOption('core_path') . 'components/msop2/') . 'model/msop2/', $scriptProperties); | |
if (!($msop2 instanceof msop2)) return ''; | |
/* @var array $scriptProperties */ | |
/* @var pdoFetch $pdoFetch */ | |
if (!$modx->loadClass('pdofetch', MODX_CORE_PATH . 'components/pdotools/model/pdotools/', false, true)) {return false;} | |
$pdoFetch = new pdoFetch($modx, $scriptProperties); | |
if (empty($product) && !empty($input)) {$product = $input;} | |
if (empty($selected)) {$selected = '';} | |
if (empty($outputSeparator)) {$outputSeparator = "\n";} |