本文整理汇总了PHP中js::closeWindow方法的典型用法代码示例。如果您正苦于以下问题:PHP js::closeWindow方法的具体用法?PHP js::closeWindow怎么用?PHP js::closeWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类js
的用法示例。
在下文中一共展示了js::closeWindow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runCase
/**
* Run case.
*
* @param int $runID
* @param String $extras others params, forexample, caseID=10, version=3
* @access public
* @return void
*/
public function runCase($runID, $caseID = 0, $version = 0)
{
if (!empty($_POST)) {
$this->testtask->createResult($runID);
if (dao::isError()) {
die(js::error(dao::getError()));
}
echo js::reload('parent');
die(js::closeWindow());
}
if (!$caseID) {
$run = $this->testtask->getRunById($runID);
}
if ($caseID) {
$run->case = $this->loadModel('testcase')->getById($caseID, $version);
}
$this->view->run = $run;
die($this->display());
}
示例2: runCase
/**
* Run case.
*
* @param int $runID
* @param String $extras others params, forexample, caseID=10, version=3
* @access public
* @return void
*/
public function runCase($runID, $caseID = 0, $version = 0)
{
if ($caseID) {
$run = new stdclass();
$run->case = $this->loadModel('testcase')->getById($caseID, $version);
} else {
$run = $this->testtask->getRunById($runID);
}
$caseID = $caseID ? $caseID : $run->case->id;
$preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID);
if (!empty($_POST)) {
$this->testtask->createResult($runID);
if (dao::isError()) {
die(js::error(dao::getError()));
}
if ($preAndNext->next) {
$nextRunID = $runID ? $preAndNext->next->id : 0;
$nextCaseID = $runID ? $preAndNext->next->case : $preAndNext->next->id;
$nextVersion = $preAndNext->next->version;
die(js::locate(inlink('runCase', "runID={$nextRunID}&caseID={$nextCaseID}&version={$nextVersion}")));
} else {
echo js::reload('parent');
die(js::closeWindow());
}
}
$preCase = '';
$nextCase = '';
if ($preAndNext->pre) {
$preCase['runID'] = $runID ? $preAndNext->pre->id : 0;
$preCase['caseID'] = $runID ? $preAndNext->pre->case : $preAndNext->pre->id;
$preCase['version'] = $preAndNext->pre->version;
}
if ($preAndNext->next) {
$nextCase['runID'] = $runID ? $preAndNext->next->id : 0;
$nextCase['caseID'] = $runID ? $preAndNext->next->case : $preAndNext->next->id;
$nextCase['version'] = $preAndNext->next->version;
}
$this->view->run = $run;
$this->view->preCase = $preCase;
$this->view->nextCase = $nextCase;
$this->view->results = $this->testtask->getResults(0, $caseID);
$this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter');
die($this->display());
}