From f390d0c09de6a84f6acd0c2f200a3e6694d64675 Mon Sep 17 00:00:00 2001 From: Zhangyu Date: Thu, 24 Oct 2024 06:40:55 +0000 Subject: [PATCH] * [task#131064] initial build function of thinkstepquote. --- lib/zin/wg/thinkstepquote/v1.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/zin/wg/thinkstepquote/v1.php b/lib/zin/wg/thinkstepquote/v1.php index ea926b6f98..0f70b7e33a 100644 --- a/lib/zin/wg/thinkstepquote/v1.php +++ b/lib/zin/wg/thinkstepquote/v1.php @@ -16,4 +16,24 @@ class thinkStepQuote extends wg 'citation?: int=1', // 引用方式 'selectColumn?: string', // 选择列 ); + + public static function getPageJS(): string + { + return file_get_contents(__DIR__ . DS . 'js' . DS . 'v1.js'); + } + protected function build(): array + { + global $lang, $app; + $app->loadLang('thinkstep'); + list($step, $setOption, $quoteTitle, $quoteQuestions, $citation, $selectColumn, $questionType) = $this->prop(array('step', 'setOption', 'quoteTitle', 'quoteQuestions', 'citation', 'selectColumn', 'questionType')); + if($step) + { + $enableOther = $step->options->enableOther ?? 0; + $setOption = isset($step->options->setOption) ? $step->options->setOption : false; + $defaultQuote = !empty($quoteQuestions) ? $quoteQuestions[0]->id : null; + $quoteTitle = isset($step->options->quoteTitle) ? $step->options->quoteTitle : $defaultQuote; + $citation = isset($step->options->citation) ? $step->options->citation : 1; + $selectColumn = isset($step->options->selectColumn) ? $step->options->selectColumn : null; + } + } } \ No newline at end of file