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 | |
/** | |
* 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 | |
$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
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 | |
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
<?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. |
NewerOlder