/** * Define a constant so that it can be exposed to the JS front-end. * @param $name string * @param $value mixed */ static function defineExposedConstant($name, $value) { define($name, $value); assert(preg_match('/^[a-zA-Z_]+$/', $name)); $constants =& PKPApplication::getExposedConstants(); // Ref req'd $constants[$name] = $value; }