Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev Merged branch 2.2: Survey rendering via Twig.
- Loading branch information
Showing
924 changed files
with
134,825 additions
and
9,397 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
# Set default behaviour, in case users don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Declare files that will always have LF line endings on checkout. | ||
*.php text eol=lf | ||
*.css text eol=lf | ||
*.js text eol=lf | ||
*.json text eol=lf | ||
*.pstpl text eol=lf | ||
*.html text eol=lf | ||
*.sql text eol=lf | ||
*.txt text eol=lf | ||
*.lss text eol=lf | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
*.jpg binary | ||
*.png binary | ||
*.gif binary | ||
*.ico binary | ||
*.mo binary | ||
# Set default behaviour, in case users don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Declare files that will always have LF line endings on checkout. | ||
*.php text eol=lf | ||
*.css text eol=lf | ||
*.js text eol=lf | ||
*.json text eol=lf | ||
*.pstpl text eol=lf | ||
*.html text eol=lf | ||
*.sql text eol=lf | ||
*.txt text eol=lf | ||
*.lss text eol=lf | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
*.jpg binary | ||
*.png binary | ||
*.gif binary | ||
*.ico binary | ||
*.mo binary |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
.project | ||
/upload/surveys/* | ||
/styles/gringegreen/images/Thumbs.db | ||
/upload/templates/* | ||
/tmp/runtime/HTML | ||
/application/controllers/admin/updater.php | ||
/tmp/*.html | ||
/tmp/*.lss | ||
/tmp/*.png | ||
/tmp/*.xls | ||
/assets/* | ||
/upload/.htaccess | ||
/nbproject/* | ||
.project | ||
/upload/surveys/* | ||
/styles/gringegreen/images/Thumbs.db | ||
/upload/templates/* | ||
/tmp/runtime/HTML | ||
/application/controllers/admin/updater.php | ||
/tmp/*.html | ||
/tmp/*.lss | ||
/tmp/*.png | ||
/tmp/*.xls | ||
/assets/* | ||
/upload/.htaccess | ||
/nbproject/* |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,93 @@ | ||
<?php | ||
|
||
class ConfigController extends LSYii_Controller { | ||
|
||
public function actionScript() | ||
{ | ||
// Retrieve config options that should be available in JS. | ||
$configOptions = array( | ||
// 'DBVersion' | ||
'adminimageurl' | ||
); | ||
$data = array(); | ||
|
||
foreach ($configOptions as $option) { | ||
$data[$option] = Yii::app()->getConfig($option); | ||
} | ||
$data['baseUrl'] = Yii::app()->getBaseUrl(true); | ||
$data['showScriptName'] = Yii::app()->urlManager->showScriptName; | ||
$data['urlFormat'] = Yii::app()->urlManager->urlFormat; | ||
$data['layoutPath'] = Yii::app()->getLayoutPath(); | ||
$data['adminImageUrl'] = Yii::app()->getConfig('adminimageurl'); | ||
$data['replacementFields']['path'] = $this->createUrl("admin/limereplacementfields/sa/index/"); | ||
$this->layout = false; | ||
$this->render('/config/script', compact('data')); | ||
} | ||
|
||
public function actionMap($id) | ||
{ | ||
$array = array(); | ||
while (count($array) < 1000) | ||
{ | ||
$array[] = mt_rand(); | ||
} | ||
|
||
$reps = 0; | ||
srand(123); | ||
$first = $array; | ||
shuffle($first); | ||
|
||
$result = array(); | ||
$start = microtime(true); | ||
$correct = 0; | ||
while ($reps < 10000) | ||
{ | ||
srand(123); | ||
$array2 = $array; | ||
shuffle($array2); | ||
|
||
if ($array2 == $first) | ||
{ | ||
$correct++; | ||
} | ||
unset($array2); | ||
$reps++; | ||
} | ||
debug("Correct: $correct"); | ||
$end = microtime(true); | ||
$time = $end - $start; | ||
debug("Time: $time seconds"); | ||
debug($result); | ||
App()->loadHelper('survey'); | ||
$em = new ExpressionManager(); | ||
$expr = 'Q1.NAOK - Q2.NAOK'; | ||
debug($em->RDP_Evaluate($expr)); | ||
debug($em->GetErrors()); | ||
debug($em->GetJavaScriptEquivalentOfExpression()); | ||
debug($em->GetAllJsVarsUsed()); | ||
//debug(createFieldMap($id, true, false, 'en')); | ||
} | ||
|
||
public function GetVarAttribute($name, $attr, $default) | ||
{ | ||
|
||
|
||
debug('GetVarAttribute'); | ||
debug(func_get_args()); | ||
if ($attr == 'jsName') | ||
{ | ||
return $attr; | ||
} | ||
elseif ($attr == NULL) | ||
{ | ||
return 'null'; | ||
} | ||
elseif ($attr == 'varName') | ||
{ | ||
return 'hippe shit'; | ||
} | ||
return $default; | ||
} | ||
|
||
|
||
} | ||
<?php | ||
|
||
class ConfigController extends LSYii_Controller { | ||
|
||
public function actionScript() | ||
{ | ||
// Retrieve config options that should be available in JS. | ||
$configOptions = array( | ||
// 'DBVersion' | ||
'adminimageurl' | ||
); | ||
$data = array(); | ||
|
||
foreach ($configOptions as $option) { | ||
$data[$option] = Yii::app()->getConfig($option); | ||
} | ||
$data['baseUrl'] = Yii::app()->getBaseUrl(true); | ||
$data['showScriptName'] = Yii::app()->urlManager->showScriptName; | ||
$data['urlFormat'] = Yii::app()->urlManager->urlFormat; | ||
$data['layoutPath'] = Yii::app()->getLayoutPath(); | ||
$data['adminImageUrl'] = Yii::app()->getConfig('adminimageurl'); | ||
$data['replacementFields']['path'] = $this->createUrl("admin/limereplacementfields/sa/index/"); | ||
$this->layout = false; | ||
$this->render('/config/script', compact('data')); | ||
} | ||
|
||
public function actionMap($id) | ||
{ | ||
$array = array(); | ||
while (count($array) < 1000) | ||
{ | ||
$array[] = mt_rand(); | ||
} | ||
|
||
$reps = 0; | ||
srand(123); | ||
$first = $array; | ||
shuffle($first); | ||
|
||
$result = array(); | ||
$start = microtime(true); | ||
$correct = 0; | ||
while ($reps < 10000) | ||
{ | ||
srand(123); | ||
$array2 = $array; | ||
shuffle($array2); | ||
|
||
if ($array2 == $first) | ||
{ | ||
$correct++; | ||
} | ||
unset($array2); | ||
$reps++; | ||
} | ||
debug("Correct: $correct"); | ||
$end = microtime(true); | ||
$time = $end - $start; | ||
debug("Time: $time seconds"); | ||
debug($result); | ||
App()->loadHelper('survey'); | ||
$em = new ExpressionManager(); | ||
$expr = 'Q1.NAOK - Q2.NAOK'; | ||
debug($em->RDP_Evaluate($expr)); | ||
debug($em->GetErrors()); | ||
debug($em->GetJavaScriptEquivalentOfExpression()); | ||
debug($em->GetAllJsVarsUsed()); | ||
//debug(createFieldMap($id, true, false, 'en')); | ||
} | ||
|
||
public function GetVarAttribute($name, $attr, $default) | ||
{ | ||
|
||
|
||
debug('GetVarAttribute'); | ||
debug(func_get_args()); | ||
if ($attr == 'jsName') | ||
{ | ||
return $attr; | ||
} | ||
elseif ($attr == NULL) | ||
{ | ||
return 'null'; | ||
} | ||
elseif ($attr == 'varName') | ||
{ | ||
return 'hippe shit'; | ||
} | ||
return $default; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.