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 xPDOSimpleTemplatingObject extends xPDOSimpleObject { | |
function __construct(& $xpdo) { | |
parent :: __construct($xpdo); | |
} | |
/** | |
* Load a collection of xPDOObject instances. | |
* | |
* @static | |
* @param xPDO &$xpdo A valid xPDO instance. |
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 | |
require_once dirname(dirname(__FILE__)) . '/inc/sys.inc'; | |
require_once XPDO_PATH . '/xpdo.class.php'; | |
session_start(); | |
$xpdo= new xPDO(XPDO_DSN,XPDO_DBUSER,XPDO_DBPW, array( | |
xPDO::OPT_CACHE_DB=> true, | |
xPDO::OPT_CACHE_DB_COLLECTIONS=> true, | |
xPDO::OPT_CACHE_PATH=> CACHE_PATH, |
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
regexp = /(\[\[[^\]]*)&([^\[]*\]\])/g; | |
tests = [ | |
"", | |
"no modx tags", | |
"[[something?&foo=`bar`]]", | |
"[[something? &foo=`[[$bar &baz=`fuz`]]`]]", | |
"[[something? &replace=`yes`]] & don't replace", | |
"[[something? &replace=`yes`]] & don't replace [[something? &replace=`yes`]]", | |
"[[line1? &foo=`bar`]] & don't replace\n[[line2? &bar=`baz`]]" | |
]; |
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 | |
$return = ''; | |
if(isset ($_SESSION['mgrValidated'])){ | |
$return = $modx->getChunk($chunk); | |
} | |
return $return; | |
?> |
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 | |
/** | |
* plugin to map subdomain requests to contexts | |
* @setting event OnHandleRequest | |
* @todo currently, subdomains and context names are bound together.. remove this constraint through some mapping/lookup | |
* @todo currently, assumes first name in host (name before first dot) is what maps to the context | |
*/ | |
$context = 'web'; |
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 | |
/** | |
* emulate @DIRECTORY binding, from base_path of Resource's context | |
* | |
* usage: | |
* a) create context settings named 'base_path' for each context (not neccessary for web context) | |
* (note: you may also want assets_path and/or other settings in your contexts as well) | |
* b) call with @EVAL in TV's Input Options field, e.g. | |
* @EVAL $dir='assets/images/'; return(include '/path/to/this/file/context_directory_binding.php'); | |
*/ |
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 | |
if ($modx->event->name == 'OnManagerPageInit') { | |
$script = <<<SCRIPT | |
<script type="text/javascript"> | |
Ext.ComponentMgr.onAvailable('modx-panel-resource', function(){ | |
Ext.getCmp('modx-panel-resource').on('ready', function(){ | |
window.setTimeout(function(){Ext.getCmp('modx-panel-resource').markDirty()}, 250); | |
}) | |
}) | |
</script> |
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
--------------- core/components/migx/elements/tv/input/migx.php --------------- | |
index 11a9c2d..53370a5 100644 | |
@@ -133,6 +133,7 @@ $lang = $this->xpdo->lexicon->fetch(); | |
$lang['mig_add'] = !empty($properties['btntext'])?$properties['btntext']:$lang['mig_add']; | |
$modx->smarty->assign('i18n', $lang); | |
$this->xpdo->smarty->assign('properties', $properties); | |
+$this->xpdo->smarty->assign('resource', is_object($this->xpdo->resource) ? $this->xpdo->resource->toArray() : array()); | |
$this->xpdo->smarty->assign('pathconfigs', $this->xpdo->toJSON($pathconfigs)); | |
$this->xpdo->smarty->assign('columns', $this->xpdo->toJSON($cols)); | |
$this->xpdo->smarty->assign('fields', $this->xpdo->toJSON($fields)); |
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
<select name="mySelect" id="mySelectId" onchange="el=document.getElementById('mySelectId');u=el.options[el.selectedIndex].value;if(u!=''){window.location.href=u;}"> | |
[[getResources? &parents=`0` &tpl=`selectOption.tpl`]] | |
</select> |
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 | |
/** | |
* plugin fragment for setting width of MODX Manager left panel | |
*/ | |
if($modx->event->name == 'OnBeforeManagerPageInit') { | |
// update layout manager state | |
$state = $modx->controller->getDefaultState(); | |
$state['modx-leftbar-tabs']['width'] = 525; | |
$response = $modx->runProcessor('system/registry/register/send',array( | |
'register' => 'state', |
OlderNewer