| @@ 175-199 (lines=25) @@ | ||
| 172 | * |
|
| 173 | * @return string |
|
| 174 | */ |
|
| 175 | public function getUserRateSave($moduleDirname, $fields, $tableName, $language) |
|
| 176 | { |
|
| 177 | $ucfTableName = ucfirst($tableName); |
|
| 178 | $ret = $this->phpcode->getPhpCodeCommentLine('Security Check'); |
|
| 179 | $xoopsSecurityCheck = $this->xoopscode->getXoopsCodeSecurityCheck(); |
|
| 180 | $securityError = $this->xoopscode->getXoopsCodeSecurityErrors(); |
|
| 181 | $implode = $this->phpcode->getPhpCodeImplode(',', $securityError); |
|
| 182 | $redirectError = $this->xoopscode->getXoopsCodeRedirectHeader($tableName, '', '3', $implode); |
|
| 183 | $ret .= $this->phpcode->getPhpCodeConditions($xoopsSecurityCheck, '', '', $redirectError, false, "\t"); |
|
| 184 | $ret .= $this->xoopscode->getXoopsCodeObjHandlerCreate($tableName); |
|
| 185 | ||
| 186 | $ret .= $this->xoopscode->getXoopsCodeSaveElements($moduleDirname, $tableName, $fields); |
|
| 187 | ||
| 188 | $ret .= $this->getCommentLine('Insert Data'); |
|
| 189 | $insert = $this->xoopscode->getXoopsCodeInsert($tableName, $tableName, 'Obj', true); |
|
| 190 | $confirmOk = $this->xoopscode->getXoopsCodeRedirectHeader('index', '', '2', "{$language}FORM_OK"); |
|
| 191 | $ret .= $this->phpcode->getPhpCodeConditions($insert, '', '', $confirmOk, false, "\t"); |
|
| 192 | ||
| 193 | $ret .= $this->getCommentLine('Get Form Error'); |
|
| 194 | $ret .= $this->xoopscode->getXoopsCodeTplAssign('error', "\${$tableName}Obj->getHtmlErrors()"); |
|
| 195 | $ret .= $this->xoopscode->getXoopsCodeGetForm('form', $tableName, 'Obj'); |
|
| 196 | $ret .= $this->xoopscode->getXoopsCodeTplAssign('form', '$form->display()'); |
|
| 197 | ||
| 198 | return $ret; |
|
| 199 | } |
|
| 200 | ||
| 201 | /* |
|
| 202 | * @public function getUserRateFooter |
|
| @@ 160-184 (lines=25) @@ | ||
| 157 | * |
|
| 158 | * @return string |
|
| 159 | */ |
|
| 160 | public function getUserSubmitSave($moduleDirname, $fields, $tableName, $language) |
|
| 161 | { |
|
| 162 | $ucfTableName = ucfirst($tableName); |
|
| 163 | $ret = $this->phpcode->getPhpCodeCommentLine('Security Check'); |
|
| 164 | $xoopsSecurityCheck = $this->xoopscode->getXoopsCodeSecurityCheck(); |
|
| 165 | $securityError = $this->xoopscode->getXoopsCodeSecurityErrors(); |
|
| 166 | $implode = $this->phpcode->getPhpCodeImplode(',', $securityError); |
|
| 167 | $redirectError = $this->xoopscode->getXoopsCodeRedirectHeader($tableName, '', '3', $implode); |
|
| 168 | $ret .= $this->phpcode->getPhpCodeConditions($xoopsSecurityCheck, '', '', $redirectError, false, "\t"); |
|
| 169 | $ret .= $this->xoopscode->getXoopsCodeObjHandlerCreate($tableName); |
|
| 170 | ||
| 171 | $ret .= $this->xoopscode->getXoopsCodeSaveElements($moduleDirname, $tableName, $fields); |
|
| 172 | ||
| 173 | $ret .= $this->getCommentLine('Insert Data'); |
|
| 174 | $insert = $this->xoopscode->getXoopsCodeInsert($tableName, $tableName, 'Obj', true); |
|
| 175 | $confirmOk = $this->xoopscode->getXoopsCodeRedirectHeader('index', '', '2', "{$language}FORM_OK"); |
|
| 176 | $ret .= $this->phpcode->getPhpCodeConditions($insert, '', '', $confirmOk, false, "\t"); |
|
| 177 | ||
| 178 | $ret .= $this->getCommentLine('Get Form Error'); |
|
| 179 | $ret .= $this->xoopscode->getXoopsCodeTplAssign('error', "\${$tableName}Obj->getHtmlErrors()"); |
|
| 180 | $ret .= $this->xoopscode->getXoopsCodeGetForm('form', $tableName, 'Obj'); |
|
| 181 | $ret .= $this->xoopscode->getXoopsCodeTplAssign('form', '$form->display()'); |
|
| 182 | ||
| 183 | return $ret; |
|
| 184 | } |
|
| 185 | ||
| 186 | /* |
|
| 187 | * @public function getUserSubmitFooter |
|