@@ -111,7 +111,7 @@ |
||
| 111 | 111 | if (('.' !== $file) && ('..' !== $file)) { |
| 112 | 112 | if (is_dir($src.'/'.$file)) { |
| 113 | 113 | // Copy the directory itself |
| 114 | - $this->copyDir($src . '/' . $file, $dst . '/' . $file); |
|
| 114 | + $this->copyDir($src.'/'.$file, $dst.'/'.$file); |
|
| 115 | 115 | } else { |
| 116 | 116 | // Make sure you copy the current script |
| 117 | 117 | copy($src.'/'.$file, $dst.'/'.$file); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $ret .= $xCodeImageList->getXcMediaUploader('uploader', $xRootPath, $moduleDirname, $t); |
| 165 | 165 | $post = $pCodeImageList->getPhpCodeGlobalsVariables('xoops_upload_file', 'POST').'[0]'; |
| 166 | 166 | $fetchMedia = $this->getAxcFetchMedia('uploader', $post); |
| 167 | - $ifelse = $t."\t//" . $this->getAxcSetPrefix('uploader', "{$fieldName}_") . ";\n"; |
|
| 167 | + $ifelse = $t."\t//".$this->getAxcSetPrefix('uploader', "{$fieldName}_").";\n"; |
|
| 168 | 168 | $ifelse .= $t."\t//{$fetchMedia};\n"; |
| 169 | 169 | $contentElseInt = $xCodeImageList->getXcSetVar($tableName, $fieldName, '$uploader->getSavedFileName()', $t."\t\t"); |
| 170 | 170 | $contentIf = $xCodeImageList->getXcEqualsOperator('$errors', '$uploader->getErrors()', null, false, $t."\t\t"); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $ifelse = $pCodeUploadImage->getPhpCodePregFunzions('extension', $expr, '', $file, 'replace', false, $t."\t"); |
| 203 | 203 | |
| 204 | 204 | $ifelse .= $t."\t\$imgName = str_replace(' ', '', \$_POST['{$fieldMain}']).'.'.\$extension;\n"; |
| 205 | - $ifelse .= $this->getAxcSetPrefix('uploader', '$imgName', $t . "\t") . ";\n"; |
|
| 205 | + $ifelse .= $this->getAxcSetPrefix('uploader', '$imgName', $t."\t").";\n"; |
|
| 206 | 206 | $ifelse .= $t."\t{$fetchMedia};\n"; |
| 207 | 207 | $contentElseInt = $xCodeUploadImage->getXcSetVar($tableName, $fieldName, '$uploader->getSavedFileName()', $t."\t\t"); |
| 208 | 208 | $contentIf = $xCodeUploadImage->getXcEqualsOperator('$errors', '$uploader->getErrors()', null, false, $t."\t\t"); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | public function getAxcUploadFileSetVar($moduleDirname, $tableName, $fieldName, $formatUrl = false, $t = '') |
| 228 | 228 | { |
| 229 | 229 | $stuModuleDirname = strtoupper($moduleDirname); |
| 230 | - $ret = $this->getAxcImageFileSetVar($moduleDirname, $stuModuleDirname . '_UPLOAD_FILES_PATH', $tableName, $fieldName, $formatUrl, $t); |
|
| 230 | + $ret = $this->getAxcImageFileSetVar($moduleDirname, $stuModuleDirname.'_UPLOAD_FILES_PATH', $tableName, $fieldName, $formatUrl, $t); |
|
| 231 | 231 | |
| 232 | 232 | return $ret; |
| 233 | 233 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | } else { |
| 259 | 259 | $files = '/files'; |
| 260 | 260 | $ret .= $pCodeFileSetVar->getPhpCodeCommentLine('Set Var', $fieldName, $t); |
| 261 | - $ifelse .= $t."\t//" . $this->getAxcSetPrefix('uploader', "'{$fieldName}_'") . ";\n"; |
|
| 261 | + $ifelse .= $t."\t//".$this->getAxcSetPrefix('uploader', "'{$fieldName}_'").";\n"; |
|
| 262 | 262 | $ifelse .= $t."\t//{$fetchMedia};\n"; |
| 263 | 263 | } |
| 264 | 264 | $ret .= $pCodeFileSetVar->getPhpCodeIncludeDir('XOOPS_ROOT_PATH', 'class/uploader', true, false, '', $t); |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $ret .= $pc->getPhpCodeCommentLine('Table view', $tableName, $t); |
| 149 | 149 | $contentForeach = $xc->getXcGetValues($tableName, $tableSoleName, 'i', false, "\t"); |
| 150 | - $contentForeach .= $xc->getXcXoopsTplAppend("{$tableName}_list", "\${$tableSoleName}", $t . "\t\t"); |
|
| 151 | - $contentForeach .= $pc->getPhpCodeUnset($tableSoleName, $t . "\t\t"); |
|
| 152 | - $condIf = $pc->getPhpCodeForeach("{$tableName}All", true, false, 'i', $contentForeach, $t . "\t"); |
|
| 153 | - $condIf .= $xc->getXcPageNav($tableName, $t . "\t"); |
|
| 154 | - $condElse = $xc->getXcTplAssign('error', "{$language}THEREARENT_{$stuTableName}", true, $t . "\t"); |
|
| 150 | + $contentForeach .= $xc->getXcXoopsTplAppend("{$tableName}_list", "\${$tableSoleName}", $t."\t\t"); |
|
| 151 | + $contentForeach .= $pc->getPhpCodeUnset($tableSoleName, $t."\t\t"); |
|
| 152 | + $condIf = $pc->getPhpCodeForeach("{$tableName}All", true, false, 'i', $contentForeach, $t."\t"); |
|
| 153 | + $condIf .= $xc->getXcPageNav($tableName, $t."\t"); |
|
| 154 | + $condElse = $xc->getXcTplAssign('error', "{$language}THEREARENT_{$stuTableName}", true, $t."\t"); |
|
| 155 | 155 | $ret .= $pc->getPhpCodeConditions("\${$tableName}Count", ' > ', '0', $condIf, $condElse, $t); |
| 156 | 156 | |
| 157 | 157 | return $ret; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $stuTableName = strtoupper($tableName); |
| 176 | 176 | $ret = $axc->getAdminTemplateMain($moduleDirname, $tableName); |
| 177 | 177 | $navigation = $axc->getAdminDisplayNavigation($tableName); |
| 178 | - $ret .= $xc->getXcTplAssign('navigation', $navigation, true, $t); |
|
| 178 | + $ret .= $xc->getXcTplAssign('navigation', $navigation, true, $t); |
|
| 179 | 179 | |
| 180 | 180 | if (in_array(1, $fieldInForm)) { |
| 181 | 181 | $ret .= $axc->getAdminItemButton($language, $tableName, $stuTableName, '', 'list', $t); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $ret = $pc->getPhpCodeCommentLine('Permission to', $perm, "\t\t\t"); |
| 208 | 208 | $content = $xc->getXcAddRight('gpermHandler', "{$moduleDirname}_{$perm}", '$permId', '$onegroupId', "\$GLOBALS['xoopsModule']->getVar('mid')", false, "\t"); |
| 209 | 209 | $foreach = $pc->getPhpCodeForeach("_POST['groups_{$perm}']", false, false, 'onegroupId', $content, "\t\t\t\t"); |
| 210 | - $ret .= $pc->getPhpCodeConditions("isset(\$_POST['groups_{$perm}'])", null, null, $foreach, false, "\t\t\t"); |
|
| 210 | + $ret .= $pc->getPhpCodeConditions("isset(\$_POST['groups_{$perm}'])", null, null, $foreach, false, "\t\t\t"); |
|
| 211 | 211 | |
| 212 | 212 | return $ret; |
| 213 | 213 | } |
@@ -236,11 +236,11 @@ discard block |
||
| 236 | 236 | $xoopsSecurityCheck = $xc->getXcSecurityCheck('!'); |
| 237 | 237 | $securityError = $xc->getXcSecurityErrors(); |
| 238 | 238 | $implode = $pc->getPhpCodeImplode(',', $securityError); |
| 239 | - $redirectError = $xc->getXcRedirectHeader($tableName, '', '3', $implode, true, $t . "\t"); |
|
| 240 | - $ret .= $pc->getPhpCodeConditions($xoopsSecurityCheck, '', '', $redirectError, false, $t); |
|
| 239 | + $redirectError = $xc->getXcRedirectHeader($tableName, '', '3', $implode, true, $t."\t"); |
|
| 240 | + $ret .= $pc->getPhpCodeConditions($xoopsSecurityCheck, '', '', $redirectError, false, $t); |
|
| 241 | 241 | |
| 242 | 242 | $isset = $pc->getPhpCodeIsset($ccFieldId); |
| 243 | - $contentIf = $xc->getXcGet($tableName, $ccFieldId, 'Obj', $tableName . 'Handler', false, $t . "\t"); |
|
| 243 | + $contentIf = $xc->getXcGet($tableName, $ccFieldId, 'Obj', $tableName.'Handler', false, $t."\t"); |
|
| 244 | 244 | $contentElse = $xc->getXcObjHandlerCreate($tableName, "\t\t\t"); |
| 245 | 245 | $ret .= $pc->getPhpCodeConditions($isset, '', '', $contentIf, $contentElse, $t); |
| 246 | 246 | $ret .= $pc->getPhpCodeCommentLine('Set Vars', null, "\t\t"); |
@@ -282,20 +282,20 @@ discard block |
||
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | - $ret .= $pc->getPhpCodeCommentLine('Insert Data', null, "\t\t"); |
|
| 285 | + $ret .= $pc->getPhpCodeCommentLine('Insert Data', null, "\t\t"); |
|
| 286 | 286 | $insert = $xc->getXcInsert($tableName, $tableName, 'Obj'); |
| 287 | 287 | $contentInsert = ''; |
| 288 | 288 | if (1 == $tableCategory) { |
| 289 | 289 | $ucfTableName = ucfirst($tableName); |
| 290 | - $contentInsert = $xc->getXcEqualsOperator('$newCatId', "\${$tableName}Obj->getNewInsertedId{$ucfTableName}()", null, false, $t . "\t"); |
|
| 290 | + $contentInsert = $xc->getXcEqualsOperator('$newCatId', "\${$tableName}Obj->getNewInsertedId{$ucfTableName}()", null, false, $t."\t"); |
|
| 291 | 291 | $ucfFieldId = $this->getCamelCase($fieldId, true); |
| 292 | - $contentInsert .= $pc->getPhpCodeTernaryOperator('permId', "isset(\$_REQUEST['{$fieldId}'])", "\${$ccFieldId}", "\$new{$ucfFieldId}", $t . "\t"); |
|
| 293 | - $contentInsert .= $xc->getXcEqualsOperator('$gpermHandler', "xoops_gethandler('groupperm')", null, false, $t . "\t"); |
|
| 294 | - $contentInsert .= $this->getPermissionsSave($moduleDirname, $fieldId, $ccFieldId, 'new' . $ucfFieldId); |
|
| 295 | - $contentInsert .= $this->getPermissionsSave($moduleDirname, $fieldId, $ccFieldId, 'new' . $ucfFieldId, 'submit'); |
|
| 296 | - $contentInsert .= $this->getPermissionsSave($moduleDirname, $fieldId, $ccFieldId, 'new' . $ucfFieldId, 'approve'); |
|
| 292 | + $contentInsert .= $pc->getPhpCodeTernaryOperator('permId', "isset(\$_REQUEST['{$fieldId}'])", "\${$ccFieldId}", "\$new{$ucfFieldId}", $t."\t"); |
|
| 293 | + $contentInsert .= $xc->getXcEqualsOperator('$gpermHandler', "xoops_gethandler('groupperm')", null, false, $t."\t"); |
|
| 294 | + $contentInsert .= $this->getPermissionsSave($moduleDirname, $fieldId, $ccFieldId, 'new'.$ucfFieldId); |
|
| 295 | + $contentInsert .= $this->getPermissionsSave($moduleDirname, $fieldId, $ccFieldId, 'new'.$ucfFieldId, 'submit'); |
|
| 296 | + $contentInsert .= $this->getPermissionsSave($moduleDirname, $fieldId, $ccFieldId, 'new'.$ucfFieldId, 'approve'); |
|
| 297 | 297 | } |
| 298 | - $contentInsert .= $xc->getXcRedirectHeader($tableName . '', '?op=list', '2', "{$language}FORM_OK", true, $t . "\t"); |
|
| 298 | + $contentInsert .= $xc->getXcRedirectHeader($tableName.'', '?op=list', '2', "{$language}FORM_OK", true, $t."\t"); |
|
| 299 | 299 | $ret .= $pc->getPhpCodeConditions($insert, '', '', $contentInsert, false, $t); |
| 300 | 300 | $ret .= $pc->getPhpCodeCommentLine('Get Form', null, "\t\t"); |
| 301 | 301 | $ret .= $xc->getXcTplAssign('error', "\${$tableName}Obj->getHtmlErrors()", true, $t); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | $ret = $axc->getAdminTemplateMain($moduleDirname, $tableName); |
| 334 | 334 | $navigation = $axc->getAdminDisplayNavigation($tableName); |
| 335 | - $ret .= $xc->getXcTplAssign('navigation', $navigation, true, $t); |
|
| 335 | + $ret .= $xc->getXcTplAssign('navigation', $navigation, true, $t); |
|
| 336 | 336 | |
| 337 | 337 | if (in_array(1, $fieldInForm)) { |
| 338 | 338 | $ret .= $axc->getAdminItemButton($language, $tableName, $stuTableSoleName, '?op=new', 'add', $t); |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $ret .= $xc->getXcTplAssign('buttons', '$adminObject->displayButton(\'left\')', true, $t); |
| 341 | 341 | } |
| 342 | 342 | $ret .= $pc->getPhpCodeCommentLine('Get Form', null, "\t\t"); |
| 343 | - $ret .= $xc->getXcGet($tableName, $ccFieldId, 'Obj', $tableName . 'Handler', false, $t); |
|
| 343 | + $ret .= $xc->getXcGet($tableName, $ccFieldId, 'Obj', $tableName.'Handler', false, $t); |
|
| 344 | 344 | $ret .= $xc->getXcGetForm('form', $tableName, 'Obj', $t); |
| 345 | 345 | $ret .= $xc->getXcTplAssign('form', '$form->render()', true, $t); |
| 346 | 346 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | $delete = $this->getAdminPagesDelete($tableName, $language, $fieldId, $fieldMain, "\t\t"); |
| 406 | 406 | |
| 407 | - $cases = [ |
|
| 407 | + $cases = [ |
|
| 408 | 408 | 'list' => [$list], |
| 409 | 409 | 'new' => [$new], |
| 410 | 410 | 'save' => [$save], |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | class TDMCreateXoopsCode |
| 29 | 29 | { |
| 30 | 30 | /** |
| 31 | - * @static function getInstance |
|
| 32 | - * @param null |
|
| 33 | - */ |
|
| 31 | + * @static function getInstance |
|
| 32 | + * @param null |
|
| 33 | + */ |
|
| 34 | 34 | /** |
| 35 | 35 | * @return TDMCreateXoopsCode |
| 36 | 36 | */ |
@@ -63,15 +63,15 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * @public function getXcEqualsOperator |
|
| 67 | - * @param $var |
|
| 68 | - * @param $value |
|
| 69 | - * @param $interlock |
|
| 70 | - * @param $ref |
|
| 71 | - * @param $t - Indentation |
|
| 72 | - * |
|
| 73 | - * @return string |
|
| 74 | - */ |
|
| 66 | + * @public function getXcEqualsOperator |
|
| 67 | + * @param $var |
|
| 68 | + * @param $value |
|
| 69 | + * @param $interlock |
|
| 70 | + * @param $ref |
|
| 71 | + * @param $t - Indentation |
|
| 72 | + * |
|
| 73 | + * @return string |
|
| 74 | + */ |
|
| 75 | 75 | public function getXcEqualsOperator($var, $value, $interlock = null, $ref = false, $t = '') |
| 76 | 76 | { |
| 77 | 77 | if (false === $ref) { |
@@ -84,20 +84,20 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | - * @public function getXcCPHeader |
|
| 88 | - * @param null |
|
| 89 | - * @return string |
|
| 90 | - */ |
|
| 87 | + * @public function getXcCPHeader |
|
| 88 | + * @param null |
|
| 89 | + * @return string |
|
| 90 | + */ |
|
| 91 | 91 | public function getXcCPHeader() |
| 92 | 92 | { |
| 93 | 93 | return "xoops_cp_header();\n"; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | - * @public function getXcCPFooter |
|
| 98 | - * @param null |
|
| 99 | - * @return string |
|
| 100 | - */ |
|
| 97 | + * @public function getXcCPFooter |
|
| 98 | + * @param null |
|
| 99 | + * @return string |
|
| 100 | + */ |
|
| 101 | 101 | public function getXcCPFooter() |
| 102 | 102 | { |
| 103 | 103 | return "xoops_cp_footer();\n"; |
@@ -129,14 +129,14 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * @public function getXcAnchorFunction |
|
| 133 | - * @param $anchor |
|
| 134 | - * @param $name |
|
| 135 | - * @param $vars |
|
| 136 | - * @param $close |
|
| 137 | - * |
|
| 138 | - * @return string |
|
| 139 | - */ |
|
| 132 | + * @public function getXcAnchorFunction |
|
| 133 | + * @param $anchor |
|
| 134 | + * @param $name |
|
| 135 | + * @param $vars |
|
| 136 | + * @param $close |
|
| 137 | + * |
|
| 138 | + * @return string |
|
| 139 | + */ |
|
| 140 | 140 | public function getXcAnchorFunction($anchor, $name, $vars, $close = false) |
| 141 | 141 | { |
| 142 | 142 | $semicolon = false !== $close ? ';' : ''; |
@@ -145,28 +145,28 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | - * @public function getXcSetVar |
|
| 149 | - * @param $tableName |
|
| 150 | - * @param $fieldName |
|
| 151 | - * @param $var |
|
| 148 | + * @public function getXcSetVar |
|
| 149 | + * @param $tableName |
|
| 150 | + * @param $fieldName |
|
| 151 | + * @param $var |
|
| 152 | 152 | * @param $t |
| 153 | - * @return string |
|
| 154 | - */ |
|
| 153 | + * @return string |
|
| 154 | + */ |
|
| 155 | 155 | public function getXcSetVar($tableName, $fieldName, $var, $t = '') |
| 156 | 156 | { |
| 157 | 157 | return "{$t}\${$tableName}Obj->setVar('{$fieldName}', {$var});\n"; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | - * @public function getXcGetVar |
|
| 162 | - * @param $varLeft |
|
| 163 | - * @param $handle |
|
| 164 | - * @param $var |
|
| 165 | - * @param $isParam |
|
| 161 | + * @public function getXcGetVar |
|
| 162 | + * @param $varLeft |
|
| 163 | + * @param $handle |
|
| 164 | + * @param $var |
|
| 165 | + * @param $isParam |
|
| 166 | 166 | * @param $t |
| 167 | - * |
|
| 168 | - * @return string |
|
| 169 | - */ |
|
| 167 | + * |
|
| 168 | + * @return string |
|
| 169 | + */ |
|
| 170 | 170 | public function getXcGetVar($varLeft = '', $handle = '', $var = '', $isParam = false, $t = '') |
| 171 | 171 | { |
| 172 | 172 | if (!$isParam) { |
@@ -179,31 +179,31 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
| 182 | - * @public function getXcGroupPermForm |
|
| 183 | - * @param $varLeft |
|
| 184 | - * @param $formTitle |
|
| 185 | - * @param $moduleId |
|
| 186 | - * @param $permName |
|
| 187 | - * @param $permDesc |
|
| 188 | - * @param $filename |
|
| 182 | + * @public function getXcGroupPermForm |
|
| 183 | + * @param $varLeft |
|
| 184 | + * @param $formTitle |
|
| 185 | + * @param $moduleId |
|
| 186 | + * @param $permName |
|
| 187 | + * @param $permDesc |
|
| 188 | + * @param $filename |
|
| 189 | 189 | * @param $t |
| 190 | - * |
|
| 191 | - * @return string |
|
| 192 | - */ |
|
| 190 | + * |
|
| 191 | + * @return string |
|
| 192 | + */ |
|
| 193 | 193 | public function getXcGroupPermForm($varLeft = '', $formTitle = '', $moduleId = '', $permName = '', $permDesc = '', $filename = '', $t = '') |
| 194 | 194 | { |
| 195 | 195 | return "{$t}\${$varLeft} = new XoopsGroupPermForm({$formTitle}, {$moduleId}, {$permName}, {$permDesc}, {$filename});\n"; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | - * @public function getXcAddItem |
|
| 200 | - * @param $varLeft |
|
| 201 | - * @param $paramLeft |
|
| 202 | - * @param $paramRight |
|
| 203 | - * @param $t |
|
| 204 | - * |
|
| 205 | - * @return string |
|
| 206 | - */ |
|
| 199 | + * @public function getXcAddItem |
|
| 200 | + * @param $varLeft |
|
| 201 | + * @param $paramLeft |
|
| 202 | + * @param $paramRight |
|
| 203 | + * @param $t |
|
| 204 | + * |
|
| 205 | + * @return string |
|
| 206 | + */ |
|
| 207 | 207 | public function getXcAddItem($varLeft = '', $paramLeft = '', $paramRight = '', $t = '') |
| 208 | 208 | { |
| 209 | 209 | return "{$t}\${$varLeft}->addItem({$paramLeft}, {$paramRight});\n"; |
@@ -260,25 +260,25 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
| 263 | - * @public function getXcCheckBoxOrRadioYNSetVar |
|
| 264 | - * @param $tableName |
|
| 265 | - * @param $fieldName |
|
| 263 | + * @public function getXcCheckBoxOrRadioYNSetVar |
|
| 264 | + * @param $tableName |
|
| 265 | + * @param $fieldName |
|
| 266 | 266 | * @param $t |
| 267 | - * @return string |
|
| 268 | - */ |
|
| 267 | + * @return string |
|
| 268 | + */ |
|
| 269 | 269 | public function getXcCheckBoxOrRadioYNSetVar($tableName, $fieldName, $t = '') |
| 270 | 270 | { |
| 271 | 271 | return $this->getXcSetVar($tableName, $fieldName, "((1 == \$_REQUEST['{$fieldName}']) ? '1' : '0')", $t); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
| 275 | - * @public function getXcMediaUploader |
|
| 276 | - * @param $var |
|
| 277 | - * @param $dirPath |
|
| 278 | - * @param $moduleDirname |
|
| 275 | + * @public function getXcMediaUploader |
|
| 276 | + * @param $var |
|
| 277 | + * @param $dirPath |
|
| 278 | + * @param $moduleDirname |
|
| 279 | 279 | * @param $t |
| 280 | - * @return string |
|
| 281 | - */ |
|
| 280 | + * @return string |
|
| 281 | + */ |
|
| 282 | 282 | public function getXcMediaUploader($var, $dirPath, $moduleDirname, $t = '') |
| 283 | 283 | { |
| 284 | 284 | $mimetypes = $this->getXcGetConfig($moduleDirname, 'mimetypes'); |
@@ -290,72 +290,72 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |
| 293 | - * @public function getXcXoopsCaptcha |
|
| 294 | - * @param $var |
|
| 295 | - * @param $instance |
|
| 296 | - * @param $t |
|
| 297 | - * |
|
| 298 | - * @return string |
|
| 299 | - */ |
|
| 293 | + * @public function getXcXoopsCaptcha |
|
| 294 | + * @param $var |
|
| 295 | + * @param $instance |
|
| 296 | + * @param $t |
|
| 297 | + * |
|
| 298 | + * @return string |
|
| 299 | + */ |
|
| 300 | 300 | public function getXcGetInstance($var = '', $instance = '', $t = '') |
| 301 | 301 | { |
| 302 | 302 | return "{$t}\${$var} = {$instance}::getInstance();\n"; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /** |
| 306 | - * @public function getXcXoopsCaptcha |
|
| 307 | - * @param $t |
|
| 308 | - * @return string |
|
| 309 | - */ |
|
| 306 | + * @public function getXcXoopsCaptcha |
|
| 307 | + * @param $t |
|
| 308 | + * @return string |
|
| 309 | + */ |
|
| 310 | 310 | public function getXcXoopsCaptcha($t = '') |
| 311 | 311 | { |
| 312 | 312 | return "{$t}\$xoopsCaptcha = XoopsCaptcha::getInstance();\n"; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
| 316 | - * @public function getXcXoopsImgListArray |
|
| 317 | - * @param $return |
|
| 318 | - * @param $var |
|
| 319 | - * @param $t |
|
| 320 | - * |
|
| 321 | - * @return string |
|
| 322 | - */ |
|
| 316 | + * @public function getXcXoopsImgListArray |
|
| 317 | + * @param $return |
|
| 318 | + * @param $var |
|
| 319 | + * @param $t |
|
| 320 | + * |
|
| 321 | + * @return string |
|
| 322 | + */ |
|
| 323 | 323 | public function getXcXoopsImgListArray($return, $var, $t = '') |
| 324 | 324 | { |
| 325 | 325 | return "{$t}\${$return} = XoopsLists::getImgListAsArray( {$var} );\n"; |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /** |
| 329 | - * @public function getXcGetConfig |
|
| 330 | - * @param $moduleDirname |
|
| 331 | - * @param $name |
|
| 332 | - * @return string |
|
| 333 | - */ |
|
| 329 | + * @public function getXcGetConfig |
|
| 330 | + * @param $moduleDirname |
|
| 331 | + * @param $name |
|
| 332 | + * @return string |
|
| 333 | + */ |
|
| 334 | 334 | public function getXcGetConfig($moduleDirname, $name) |
| 335 | 335 | { |
| 336 | 336 | return "\${$moduleDirname}->getConfig('{$name}')"; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
| 340 | - * @public function getXcIdGetVar |
|
| 341 | - * @param $lpFieldName |
|
| 342 | - * @param $t |
|
| 343 | - * @return string |
|
| 344 | - */ |
|
| 340 | + * @public function getXcIdGetVar |
|
| 341 | + * @param $lpFieldName |
|
| 342 | + * @param $t |
|
| 343 | + * @return string |
|
| 344 | + */ |
|
| 345 | 345 | public function getXcIdGetVar($lpFieldName, $t = '') |
| 346 | 346 | { |
| 347 | 347 | return "{$t}\${$lpFieldName}['id'] = \$i;\n"; |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
| 351 | - * @public function getXcGetVarAll |
|
| 352 | - * @param $lpFieldName |
|
| 353 | - * @param $rpFieldName |
|
| 354 | - * @param $tableName |
|
| 355 | - * @param $fieldName |
|
| 351 | + * @public function getXcGetVarAll |
|
| 352 | + * @param $lpFieldName |
|
| 353 | + * @param $rpFieldName |
|
| 354 | + * @param $tableName |
|
| 355 | + * @param $fieldName |
|
| 356 | 356 | * @param $t |
| 357 | - * @return string |
|
| 358 | - */ |
|
| 357 | + * @return string |
|
| 358 | + */ |
|
| 359 | 359 | public function getXcGetVarAll($lpFieldName, $rpFieldName, $tableName, $fieldName, $t = '') |
| 360 | 360 | { |
| 361 | 361 | return "{$t}\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}All[\$i]->getVar('{$fieldName}');\n"; |
@@ -390,14 +390,14 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | /** |
| 393 | - * @public function getXoopsClearHandler |
|
| 394 | - * @param $left |
|
| 395 | - * @param $anchor |
|
| 396 | - * @param $var |
|
| 393 | + * @public function getXoopsClearHandler |
|
| 394 | + * @param $left |
|
| 395 | + * @param $anchor |
|
| 396 | + * @param $var |
|
| 397 | 397 | * @param $t |
| 398 | 398 | * |
| 399 | - * @return string |
|
| 400 | - */ |
|
| 399 | + * @return string |
|
| 400 | + */ |
|
| 401 | 401 | public function getXoopsClearHandler($left, $anchor, $var, $t = '') |
| 402 | 402 | { |
| 403 | 403 | return "{$t}\${$left}Handler = \${$anchor}->getHandler('{$var}');\n"; |
@@ -539,13 +539,13 @@ discard block |
||
| 539 | 539 | return $ret; |
| 540 | 540 | } |
| 541 | 541 | /** |
| 542 | - * @public function getXcUrlFileGetVar |
|
| 543 | - * @param $lpFieldName |
|
| 544 | - * @param $rpFieldName |
|
| 545 | - * @param $tableName |
|
| 546 | - * @param $fieldName |
|
| 547 | - * @return string |
|
| 548 | - */ |
|
| 542 | + * @public function getXcUrlFileGetVar |
|
| 543 | + * @param $lpFieldName |
|
| 544 | + * @param $rpFieldName |
|
| 545 | + * @param $tableName |
|
| 546 | + * @param $fieldName |
|
| 547 | + * @return string |
|
| 548 | + */ |
|
| 549 | 549 | public function getXcUrlFileGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) |
| 550 | 550 | { |
| 551 | 551 | return $this->getXcGetVarAll($lpFieldName, $rpFieldName, $tableName, $fieldName); |
@@ -609,11 +609,11 @@ discard block |
||
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | /** |
| 612 | - * @public function getXcUserHeader |
|
| 613 | - * @param $moduleDirname |
|
| 614 | - * @param $tableName |
|
| 615 | - * @return string |
|
| 616 | - */ |
|
| 612 | + * @public function getXcUserHeader |
|
| 613 | + * @param $moduleDirname |
|
| 614 | + * @param $tableName |
|
| 615 | + * @return string |
|
| 616 | + */ |
|
| 617 | 617 | public function getXcUserHeader($moduleDirname, $tableName) |
| 618 | 618 | { |
| 619 | 619 | $phpCodeUserHeader = TDMCreatePhpCode::getInstance(); |
@@ -625,8 +625,8 @@ discard block |
||
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | /** |
| 628 | - * @public function getXcPermissionsHeader |
|
| 629 | - * @param null |
|
| 628 | + * @public function getXcPermissionsHeader |
|
| 629 | + * @param null |
|
| 630 | 630 | * @return string |
| 631 | 631 | */ |
| 632 | 632 | public function getXcPermissionsHeader() |
@@ -1165,20 +1165,20 @@ discard block |
||
| 1165 | 1165 | } |
| 1166 | 1166 | |
| 1167 | 1167 | /** |
| 1168 | - * @public function getXcSecurityCheck |
|
| 1169 | - * @param $denial |
|
| 1170 | - * @return boolean |
|
| 1171 | - */ |
|
| 1168 | + * @public function getXcSecurityCheck |
|
| 1169 | + * @param $denial |
|
| 1170 | + * @return boolean |
|
| 1171 | + */ |
|
| 1172 | 1172 | public function getXcSecurityCheck($denial = '') |
| 1173 | 1173 | { |
| 1174 | 1174 | return "{$denial}\$GLOBALS['xoopsSecurity']->check()"; |
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | /** |
| 1178 | - * @public function getXcSecurityErrors |
|
| 1179 | - * @param null |
|
| 1180 | - * @return string |
|
| 1181 | - */ |
|
| 1178 | + * @public function getXcSecurityErrors |
|
| 1179 | + * @param null |
|
| 1180 | + * @return string |
|
| 1181 | + */ |
|
| 1182 | 1182 | public function getXcSecurityErrors() |
| 1183 | 1183 | { |
| 1184 | 1184 | return "\$GLOBALS['xoopsSecurity']->getErrors()"; |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $pTopic = TDMCreatePhpCode::getInstance(); |
| 470 | 470 | $ret = $pTopic->getPhpCodeCommentLine('Get Var', $fieldNameParent, $t); |
| 471 | 471 | $fieldParent = $this->getXcGetVar('', "\${$tableName}All[\$i]", $fieldNameParent, true, ''); |
| 472 | - $ret .= $this->getXcGet($rpFieldName, $fieldParent, '', $tableNameTopic . 'Handler', false, $t); |
|
| 472 | + $ret .= $this->getXcGet($rpFieldName, $fieldParent, '', $tableNameTopic.'Handler', false, $t); |
|
| 473 | 473 | $ret .= $this->getXcGetVar("\${$lpFieldName}['{$rpFieldName}']", "\${$rpFieldName}", $fieldNameTopic, false, $t); |
| 474 | 474 | |
| 475 | 475 | return $ret; |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | { |
| 492 | 492 | $pParentTopic = TDMCreatePhpCode::getInstance(); |
| 493 | 493 | $parentTopic = $pParentTopic->getPhpCodeCommentLine('Get', $tableNameTopic.' Handler', $t."\t"); |
| 494 | - $parentTopic .= $this->getXoopsHandlerLine($moduleDirname, $tableNameTopic, $t . "\t"); |
|
| 494 | + $parentTopic .= $this->getXoopsHandlerLine($moduleDirname, $tableNameTopic, $t."\t"); |
|
| 495 | 495 | $elseGroups = $this->getXcEqualsOperator('$groups', 'XOOPS_GROUP_ANONYMOUS'); |
| 496 | 496 | $ret = $pParentTopic->getPhpCodeConditions("!isset(\${$tableNameTopic}Handler", '', '', $parentTopic, $elseGroups); |
| 497 | 497 | $ret .= $this->getXcGetVarFromID("\${$lpFieldName}['{$rpFieldName}']", $tableNameTopic, $tableSoleNameTopic, $tableName, $fieldNameParent, $t); |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $pVarFromID = TDMCreatePhpCode::getInstance(); |
| 515 | 515 | $ret = $pVarFromID->getPhpCodeCommentLine('Get Var', $fieldName, $t); |
| 516 | 516 | $getVarFromID = $this->getXcGetVar('', "\${$tableName}All[\$i]", $fieldName, true, ''); |
| 517 | - $rightGet = $this->getXcAnchorFunction($anchor . 'Handler', 'get' . $var . 'FromId', $getVarFromID); |
|
| 517 | + $rightGet = $this->getXcAnchorFunction($anchor.'Handler', 'get'.$var.'FromId', $getVarFromID); |
|
| 518 | 518 | $ret .= $this->getXcEqualsOperator($left, $rightGet, null, false, $t); |
| 519 | 519 | |
| 520 | 520 | return $ret; |
@@ -1082,7 +1082,7 @@ discard block |
||
| 1082 | 1082 | $phpCodeSecurity = TDMCreatePhpCode::getInstance(); |
| 1083 | 1083 | $securityError = $this->getXcSecurityErrors(); |
| 1084 | 1084 | $implode = $phpCodeSecurity->getPhpCodeImplode(',', $securityError); |
| 1085 | - $content = "{$t}\t" . $this->getXcRedirectHeader($tableName, '', 3, $implode, $t); |
|
| 1085 | + $content = "{$t}\t".$this->getXcRedirectHeader($tableName, '', 3, $implode, $t); |
|
| 1086 | 1086 | $securityCheck = $this->getXcSecurityCheck(); |
| 1087 | 1087 | |
| 1088 | 1088 | return $phpCodeSecurity->getPhpCodeConditions('!'.$securityCheck, '', '', $content, $t); |
@@ -1098,7 +1098,7 @@ discard block |
||
| 1098 | 1098 | public function getXcInsertData($tableName, $language, $t = '') |
| 1099 | 1099 | { |
| 1100 | 1100 | $phpCodeInsertData = TDMCreatePhpCode::getInstance(); |
| 1101 | - $content = "{$t}\t" . $this->getXcRedirectHeader($tableName, '?op=list', 2, "{$language}FORM_OK"); |
|
| 1101 | + $content = "{$t}\t".$this->getXcRedirectHeader($tableName, '?op=list', 2, "{$language}FORM_OK"); |
|
| 1102 | 1102 | $handlerInsert = $this->getXcHandler($tableName, $tableName, false, true, false, 'Obj'); |
| 1103 | 1103 | |
| 1104 | 1104 | return $phpCodeInsertData->getPhpCodeConditions($handlerInsert, '', '', $content, $t); |
@@ -1145,7 +1145,7 @@ discard block |
||
| 1145 | 1145 | $phpXoopsConfirm = TDMCreatePhpCode::getInstance(); |
| 1146 | 1146 | $array = "array('ok' => 1, '{$fieldId}' => \${$ccFieldId}, 'op' => '{$options}')"; |
| 1147 | 1147 | $server = $phpXoopsConfirm->getPhpCodeGlobalsVariables('REQUEST_URI', 'SERVER'); |
| 1148 | - $getVar = $this->getXcGetVar('', $tableName . 'Obj', $fieldMain, true, ''); |
|
| 1148 | + $getVar = $this->getXcGetVar('', $tableName.'Obj', $fieldMain, true, ''); |
|
| 1149 | 1149 | $sprintf = $phpXoopsConfirm->getPhpCodeSprintf($language.'FORM_SURE_'.$stuOptions, $getVar); |
| 1150 | 1150 | $ret = "{$t}xoops_confirm({$array}, {$server}, {$sprintf});\n"; |
| 1151 | 1151 | |
@@ -1319,7 +1319,7 @@ discard block |
||
| 1319 | 1319 | { |
| 1320 | 1320 | $ret = TDMCreatePhpCode::getInstance()->getPhpCodeCommentLine('Get Var', $fieldNameParent, $t); |
| 1321 | 1321 | $paramGet = $this->getXcGetVar('', "\${$tableName}All[\$i]", $fieldNameParent, true, ''); |
| 1322 | - $ret .= $this->getXcGet($rpFieldName, $paramGet, '', $tableNameTopic . 'Handler', false, $t); |
|
| 1322 | + $ret .= $this->getXcGet($rpFieldName, $paramGet, '', $tableNameTopic.'Handler', false, $t); |
|
| 1323 | 1323 | $ret .= $this->getXcGetVar("\${$lpFieldName}['{$rpFieldName}']", "\${$rpFieldName}", $fieldNameTopic, false, $t); |
| 1324 | 1324 | |
| 1325 | 1325 | return $ret; |
@@ -1407,18 +1407,18 @@ discard block |
||
| 1407 | 1407 | $fieldMain = $fieldName; |
| 1408 | 1408 | } |
| 1409 | 1409 | if ((5 == $fieldElement) || (6 == $fieldElement)) { |
| 1410 | - $ret .= $t . $this->getXcCheckBoxOrRadioYNSetVar($tableName, $fieldName); |
|
| 1410 | + $ret .= $t.$this->getXcCheckBoxOrRadioYNSetVar($tableName, $fieldName); |
|
| 1411 | 1411 | } elseif (13 == $fieldElement) { |
| 1412 | 1412 | $ret .= $axCodeSaveElements->getAxcUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fieldMain); |
| 1413 | 1413 | } elseif (14 == $fieldElement) { |
| 1414 | 1414 | $ret .= $axCodeSaveElements->getAxcUploadFileSetVar($moduleDirname, $tableName, $fieldName); |
| 1415 | 1415 | } elseif (15 == $fieldElement) { |
| 1416 | - $ret .= $t . $this->getXcTextDateSelectSetVar($tableName, $tableSoleName, $fieldName); |
|
| 1416 | + $ret .= $t.$this->getXcTextDateSelectSetVar($tableName, $tableSoleName, $fieldName); |
|
| 1417 | 1417 | } else { |
| 1418 | 1418 | if ((0 != $f) && 1 == $tableAutoincrement) { |
| 1419 | - $ret .= $t . $this->getXcSetVar($tableName, $fieldName, "\$_POST['{$fieldName}']"); |
|
| 1419 | + $ret .= $t.$this->getXcSetVar($tableName, $fieldName, "\$_POST['{$fieldName}']"); |
|
| 1420 | 1420 | } elseif ((0 == $f) && 0 == $tableAutoincrement) { |
| 1421 | - $ret .= $t . $this->getXcSetVar($tableName, $fieldName, "\$_POST['{$fieldName}']"); |
|
| 1421 | + $ret .= $t.$this->getXcSetVar($tableName, $fieldName, "\$_POST['{$fieldName}']"); |
|
| 1422 | 1422 | } |
| 1423 | 1423 | } |
| 1424 | 1424 | } |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | $ret = $phpCodePageNav->getPhpCodeCommentLine('Display Navigation', null, $t); |
| 1441 | 1441 | $condition = $phpCodePageNav->getPhpCodeIncludeDir('XOOPS_ROOT_PATH', 'class/pagenav', true, false, 'include', $t."\t"); |
| 1442 | 1442 | $condition .= $classXCode->getClassXoopsPageNav('pagenav', $tableName.'Count', 'limit', 'start', 'start', "'op=list&limit=' . \$limit", false, $t."\t"); |
| 1443 | - $condition .= $this->getXcTplAssign('pagenav', '$pagenav->renderNav(4)', true, $t . "\t"); |
|
| 1443 | + $condition .= $this->getXcTplAssign('pagenav', '$pagenav->renderNav(4)', true, $t."\t"); |
|
| 1444 | 1444 | $ret .= $phpCodePageNav->getPhpCodeConditions("\${$tableName}Count", ' > ', '$limit', $condition, false, $t); |
| 1445 | 1445 | |
| 1446 | 1446 | return $ret; |