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 | |
/** | |
* Checks current users group membership | |
* | |
* @var modX $modx | |
* @var array $scriptProperties | |
*/ | |
/* set default properties */ | |
$usergroup = $modx->getOption('usergroup',$scriptProperties); | |
$sendError = $modx->getOption('sendError',$scriptProperties) == 1 || null; |
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
padding-top: padding-top:calc( ([[+height]]% / [[+width]]) * 100 ); |
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
$c->where("CAST(width AS DECIMAL(5,3)) = {$_REQUEST['width']}"); |
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
$query = $this->modx->newQuery('modUser'); | |
//checks | |
$query->where(array( | |
'active' => 1, | |
'Profile.blocked' => 0 | |
)); | |
//by usergroup | |
$query->where(array('primary_group:IN' => array(1,2,3))); | |
//by id | |
$query->where(array('id:IN' => array(1,2,3)),xPDOQuery::SQL_OR); //<-- uses OR condition |
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
$query = $this->modx->newQuery('modUser'); | |
$query->innerJoin('modUserProfile','Profile'); | |
//Select ALL fields from both tables | |
$query->select(array('modUser.*, Profile.*')); | |
--- | |
$query->select(array('modUser.*')); | |
$query->select($this->modx->getSelectColumns('modUserProfile','Profile','profile_')); | |
//Select SPECIFIC fields from both tables |
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
public function render() { | |
//$this->modx->controller->addLexiconTopic('core:dashboard'); | |
$this->controller->addJavascript($this->modx->getOption('manager_url').'assets/modext/widgets/security/modx.grid.user.online.js'); | |
$this->controller->addHtml(' | |
<script type="text/javascript"> | |
Ext.applyIf(MODx.lang, '. $this->modx->toJSON($this->modx->lexicon->loadCache('core', 'dashboard')) .'); | |
Ext.onReady(function() { | |
MODx.load({ | |
xtype: "modx-grid-user-online" |
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
$query = $this->modx->newQuery('ClassName'); | |
$query->where(array( | |
'project_id' => x | |
,'unit_id' => y | |
)); | |
$query->select(array( | |
'ClassName.*', | |
'array_node' => 'GROUP_CONCAT(DISTINCT colname_from_joined_table SEPARATOR " , ")' | |
)); |
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
$this->modx->log(xPDO::LOG_LEVEL_ERROR,'Label: ' . print_r($my_output, true)); |
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
public function process() { | |
$beforeQuery = $this->beforeQuery(); | |
if ($beforeQuery !== true) { | |
return $this->failure($beforeQuery); | |
} | |
$data = $this->getData(); | |
$list = $this->iterate($data); | |
$datetime = new DateTime('Europe/London'); | |
$curtime = $datetime->format('Y\-m\-d\ H:i:s'); |
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
MERGE PR - Have issued pr to upstream branch: | |
1. Open target repo in cmd | |
2. git checkout develop | |
3. git checkout -b test-branch-name develop | |
*create and switch to a new branch, from develop to test the pr changes | |
4. git pull https://github.com/account/fork-repo.git pr-branch-name | |
*pull the whole pr branch into test branch | |
5. Review changes in test branch | |
6. git checkout develop |
NewerOlder