@@ -127,6 +127,10 @@ discard block |
||
| 127 | 127 | * @param $fieldMain |
| 128 | 128 | * @return string |
| 129 | 129 | */ |
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * @param string $language |
|
| 133 | + */ |
|
| 130 | 134 | private function getAdminPagesList($moduleDirname, $table, $language, $fields, $fieldId, $fieldInForm, $fieldMain) |
| 131 | 135 | { |
| 132 | 136 | $stuModuleDirname = strtoupper($moduleDirname); |
@@ -392,7 +396,7 @@ discard block |
||
| 392 | 396 | * @param null |
| 393 | 397 | */ |
| 394 | 398 | /** |
| 395 | - * @param $filename |
|
| 399 | + * @param string $filename |
|
| 396 | 400 | * |
| 397 | 401 | * @return bool|string |
| 398 | 402 | */ |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | private $adminxoopscode; |
| 34 | 34 | |
| 35 | - /* |
|
| 35 | + /* |
|
| 36 | 36 | * @var string |
| 37 | 37 | */ |
| 38 | 38 | private $t2 = "\t\t"; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | parent::__construct(); |
| 50 | 50 | $this->tdmcfile = TDMCreateFile::getInstance(); |
| 51 | 51 | $this->phpcode = TDMCreatePhpCode::getInstance(); |
| 52 | - $this->xoopscode = TDMCreateXoopsCode::getInstance(); |
|
| 52 | + $this->xoopscode = TDMCreateXoopsCode::getInstance(); |
|
| 53 | 53 | $this->adminxoopscode = AdminXoopsCode::getInstance(); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -95,9 +95,9 @@ discard block |
||
| 95 | 95 | $ccFieldId = $this->getCamelCase($fieldId, false, true); |
| 96 | 96 | $ret = $this->getInclude(); |
| 97 | 97 | $ret .= $this->getCommentLine('It recovered the value of argument op in URL$'); |
| 98 | - $ret .= $this->xoopscode->getXoopsCodeXoopsRequest('op', 'op', 'list'); |
|
| 98 | + $ret .= $this->xoopscode->getXoopsCodeXoopsRequest('op', 'op', 'list'); |
|
| 99 | 99 | $ret .= $this->getCommentLine("Request {$fieldId}"); |
| 100 | - $ret .= $this->xoopscode->getXoopsCodeXoopsRequest($ccFieldId, $fieldId, '', 'Int'); |
|
| 100 | + $ret .= $this->xoopscode->getXoopsCodeXoopsRequest($ccFieldId, $fieldId, '', 'Int'); |
|
| 101 | 101 | |
| 102 | 102 | return $ret; |
| 103 | 103 | } |
@@ -139,25 +139,25 @@ discard block |
||
| 139 | 139 | $stuTableFieldname = strtoupper($tableFieldname); |
| 140 | 140 | $tableAutoincrement = $table->getVar('table_autoincrement'); |
| 141 | 141 | |
| 142 | - $ret = $this->xoopscode->getXoopsCodeXoopsRequest('start', 'start', '0', 'Int'); |
|
| 143 | - $adminpager = $this->xoopscode->getXoopsCodeGetConfig($moduleDirname, 'adminpager'); |
|
| 144 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeXoopsRequest('limit', 'limit', $adminpager, 'Int'); |
|
| 145 | - $ret .= $this->t2.$this->adminxoopscode->getAdminTemplateMain($moduleDirname, $tableName); |
|
| 146 | - $navigation = $this->adminxoopscode->getAdminAddNavigation($tableName); |
|
| 147 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('navigation', $navigation); |
|
| 142 | + $ret = $this->xoopscode->getXoopsCodeXoopsRequest('start', 'start', '0', 'Int'); |
|
| 143 | + $adminpager = $this->xoopscode->getXoopsCodeGetConfig($moduleDirname, 'adminpager'); |
|
| 144 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeXoopsRequest('limit', 'limit', $adminpager, 'Int'); |
|
| 145 | + $ret .= $this->t2.$this->adminxoopscode->getAdminTemplateMain($moduleDirname, $tableName); |
|
| 146 | + $navigation = $this->adminxoopscode->getAdminAddNavigation($tableName); |
|
| 147 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('navigation', $navigation); |
|
| 148 | 148 | |
| 149 | 149 | if (1 == $fieldInForm) { |
| 150 | - $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '?op=new', 'add'); |
|
| 151 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('buttons', "\$adminMenu->renderButton()"); |
|
| 150 | + $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '?op=new', 'add'); |
|
| 151 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('buttons', "\$adminMenu->renderButton()"); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $ret .= $this->t2.$this->xoopscode->getXoopsCodeObjHandlerCount($tableName); |
| 155 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeObjHandlerAll($tableName, '', "\$start", "\$limit"); |
|
| 156 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign("{$tableName}_count", "\${$tableName}Count"); |
|
| 157 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign("{$moduleDirname}_url", "{$stuModuleDirname}_URL"); |
|
| 158 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign("{$moduleDirname}_upload_url", "{$stuModuleDirname}_UPLOAD_URL"); |
|
| 155 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeObjHandlerAll($tableName, '', "\$start", "\$limit"); |
|
| 156 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign("{$tableName}_count", "\${$tableName}Count"); |
|
| 157 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign("{$moduleDirname}_url", "{$stuModuleDirname}_URL"); |
|
| 158 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign("{$moduleDirname}_upload_url", "{$stuModuleDirname}_UPLOAD_URL"); |
|
| 159 | 159 | |
| 160 | - $ret .= <<<EOT |
|
| 160 | + $ret .= <<<EOT |
|
| 161 | 161 | // Table view |
| 162 | 162 | if (\${$tableName}Count > 0) |
| 163 | 163 | { |
@@ -191,16 +191,16 @@ discard block |
||
| 191 | 191 | private function getAdminPagesNew($moduleDirname, $tableName, $tableSoleName, $fieldInForm, $language) |
| 192 | 192 | { |
| 193 | 193 | $stuTableName = strtoupper($tableName); |
| 194 | - $stuTableSoleName = strtoupper($tableSoleName); |
|
| 194 | + $stuTableSoleName = strtoupper($tableSoleName); |
|
| 195 | 195 | $ucfTableName = ucfirst($tableName); |
| 196 | 196 | |
| 197 | - $ret = $this->t2.$this->adminxoopscode->getAdminTemplateMain($moduleDirname, $tableName); |
|
| 198 | - $navigation = $this->adminxoopscode->getAdminAddNavigation($tableName); |
|
| 199 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('navigation', $navigation); |
|
| 197 | + $ret = $this->t2.$this->adminxoopscode->getAdminTemplateMain($moduleDirname, $tableName); |
|
| 198 | + $navigation = $this->adminxoopscode->getAdminAddNavigation($tableName); |
|
| 199 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('navigation', $navigation); |
|
| 200 | 200 | |
| 201 | 201 | if (1 == $fieldInForm) { |
| 202 | - $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '', 'list'); |
|
| 203 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('buttons', "\$adminMenu->renderButton()"); |
|
| 202 | + $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '', 'list'); |
|
| 203 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('buttons', "\$adminMenu->renderButton()"); |
|
| 204 | 204 | } |
| 205 | 205 | $ret .= <<<EOT |
| 206 | 206 | // Get Form |
@@ -227,17 +227,17 @@ discard block |
||
| 227 | 227 | $ccFieldId = $this->getCamelCase($fieldId, false, true); |
| 228 | 228 | $ucfTableName = ucfirst($tableName); |
| 229 | 229 | |
| 230 | - $ret = $this->phpcode->getPhpCodeCommentLine('Set Vars'); |
|
| 231 | - $xoopsSecurityCheck = $this->xoopscode->getXoopsCodeSecurityCheck(); |
|
| 232 | - $securityError = $this->xoopscode->getXoopsCodeSecurityGetError(); |
|
| 233 | - $implode = $this->phpcode->getPhpCodeImplode(',', $securityError); |
|
| 234 | - $redirectError = $this->xoopscode->getXoopsCodeRedirectHeader($tableName, '', '3', $implode); |
|
| 235 | - $ret .= $this->phpcode->getPhpCodeConditions($xoopsSecurityCheck, '', '', $redirectError, false, "\t"); |
|
| 230 | + $ret = $this->phpcode->getPhpCodeCommentLine('Set Vars'); |
|
| 231 | + $xoopsSecurityCheck = $this->xoopscode->getXoopsCodeSecurityCheck(); |
|
| 232 | + $securityError = $this->xoopscode->getXoopsCodeSecurityGetError(); |
|
| 233 | + $implode = $this->phpcode->getPhpCodeImplode(',', $securityError); |
|
| 234 | + $redirectError = $this->xoopscode->getXoopsCodeRedirectHeader($tableName, '', '3', $implode); |
|
| 235 | + $ret .= $this->phpcode->getPhpCodeConditions($xoopsSecurityCheck, '', '', $redirectError, false, "\t"); |
|
| 236 | 236 | |
| 237 | - $isset = $this->phpcode->getPhpCodeIsset($ccFieldId); |
|
| 238 | - $contentIf = $this->xoopscode->getXoopsCodeGet($tableName, $ccFieldId, 'Obj', true); |
|
| 239 | - $contentElse = $this->xoopscode->getXoopsCodeObjHandlerCreate($tableName); |
|
| 240 | - $ret .= $this->phpcode->getPhpCodeConditions($isset, '', '', $contentIf, $contentElse, "\t"); |
|
| 237 | + $isset = $this->phpcode->getPhpCodeIsset($ccFieldId); |
|
| 238 | + $contentIf = $this->xoopscode->getXoopsCodeGet($tableName, $ccFieldId, 'Obj', true); |
|
| 239 | + $contentElse = $this->xoopscode->getXoopsCodeObjHandlerCreate($tableName); |
|
| 240 | + $ret .= $this->phpcode->getPhpCodeConditions($isset, '', '', $contentIf, $contentElse, "\t"); |
|
| 241 | 241 | |
| 242 | 242 | foreach (array_keys($fields) as $f) { |
| 243 | 243 | $fieldName = $fields[$f]->getVar('field_name'); |
@@ -312,16 +312,16 @@ discard block |
||
| 312 | 312 | $stuTableFieldname = strtoupper($tableFieldname); |
| 313 | 313 | $ccFieldId = $this->getCamelCase($fieldId, false, true); |
| 314 | 314 | |
| 315 | - $ret = $this->t2.$this->adminxoopscode->getAdminTemplateMain($moduleDirname, $tableName); |
|
| 316 | - $navigation = $this->adminxoopscode->getAdminAddNavigation($tableName); |
|
| 317 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('navigation', $navigation); |
|
| 315 | + $ret = $this->t2.$this->adminxoopscode->getAdminTemplateMain($moduleDirname, $tableName); |
|
| 316 | + $navigation = $this->adminxoopscode->getAdminAddNavigation($tableName); |
|
| 317 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('navigation', $navigation); |
|
| 318 | 318 | |
| 319 | 319 | if (1 == $fieldInForm) { |
| 320 | - $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '?op=new', 'add'); |
|
| 321 | - $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '', 'list'); |
|
| 322 | - $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('buttons', "\$adminMenu->renderButton()"); |
|
| 320 | + $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '?op=new', 'add'); |
|
| 321 | + $ret .= $this->t2.$this->adminxoopscode->getAdminItemButton($language, $tableName, $stuTableSoleName, '', 'list'); |
|
| 322 | + $ret .= $this->t2.$this->xoopscode->getXoopsCodeTplAssign('buttons', "\$adminMenu->renderButton()"); |
|
| 323 | 323 | } |
| 324 | - $ret .= <<<EOT |
|
| 324 | + $ret .= <<<EOT |
|
| 325 | 325 | // Get Form |
| 326 | 326 | \${$tableName}Obj = \${$tableName}Handler->get(\${$ccFieldId}); |
| 327 | 327 | \$form = \${$tableName}Obj->getForm{$ucfTableName}(); |
@@ -425,11 +425,11 @@ discard block |
||
| 425 | 425 | } |
| 426 | 426 | $delete = $this->getAdminPagesDelete($tableName, $language, $fieldId, $fieldMain); |
| 427 | 427 | |
| 428 | - $cases = array('list' => array($list), |
|
| 429 | - 'new' => array($new), |
|
| 430 | - 'save' => array($save), |
|
| 431 | - 'edit' => array($edit), |
|
| 432 | - 'delete' => array($delete)); |
|
| 428 | + $cases = array('list' => array($list), |
|
| 429 | + 'new' => array($new), |
|
| 430 | + 'save' => array($save), |
|
| 431 | + 'edit' => array($edit), |
|
| 432 | + 'delete' => array($delete)); |
|
| 433 | 433 | $content .= $this->getAdminPagesSwitch($cases); |
| 434 | 434 | $content .= $this->getInclude('footer'); |
| 435 | 435 | // |
@@ -243,6 +243,10 @@ discard block |
||
| 243 | 243 | * @param $name |
| 244 | 244 | * @return string |
| 245 | 245 | */ |
| 246 | + |
|
| 247 | + /** |
|
| 248 | + * @param string $name |
|
| 249 | + */ |
|
| 246 | 250 | public function getXoopsCodeGetConfig($moduleDirname, $name) |
| 247 | 251 | { |
| 248 | 252 | return "\${$moduleDirname}->getConfig('{$name}')"; |
@@ -844,6 +848,13 @@ discard block |
||
| 844 | 848 | * |
| 845 | 849 | * @return string |
| 846 | 850 | */ |
| 851 | + |
|
| 852 | + /** |
|
| 853 | + * @param string $tableName |
|
| 854 | + * @param string $language |
|
| 855 | + * @param string $fieldId |
|
| 856 | + * @param string $fieldMain |
|
| 857 | + */ |
|
| 847 | 858 | public function getXoopsCodeXoopsConfirm($tableName, $language, $fieldId, $fieldMain, $options = 'delete') |
| 848 | 859 | { |
| 849 | 860 | $stuOptions = strtoupper($options); |
@@ -875,7 +886,7 @@ discard block |
||
| 875 | 886 | /** |
| 876 | 887 | * @public function getXoopsCodeGetHtmlErrors |
| 877 | 888 | * |
| 878 | - * @param $tableName |
|
| 889 | + * @param string $tableName |
|
| 879 | 890 | * @param $isParam |
| 880 | 891 | * @param $obj |
| 881 | 892 | * |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | return $this->getXoopsCodeSetVar($tableName, $fieldName, "((1 == \$_REQUEST['{$fieldName}']) ? '1' : '0')"); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | - /* |
|
| 224 | + /* |
|
| 225 | 225 | * @public function getXoopsCodeXoopsMediaUploader |
| 226 | 226 | * @param $var |
| 227 | 227 | * @param $dirPath |
@@ -232,9 +232,9 @@ discard block |
||
| 232 | 232 | public function getXoopsCodeXoopsMediaUploader($var = '', $dirPath, $tableName, $moduleDirname) |
| 233 | 233 | { |
| 234 | 234 | $mimetypes = $this->getXoopsCodeGetConfig($moduleDirname, 'mimetypes'); |
| 235 | - $maxsize = $this->getXoopsCodeGetConfig($moduleDirname, 'maxsize'); |
|
| 235 | + $maxsize = $this->getXoopsCodeGetConfig($moduleDirname, 'maxsize'); |
|
| 236 | 236 | |
| 237 | - return "\${$var} = new XoopsMediaUploader({$dirPath} . '/{$tableName}', {$mimetypes}, {$maxsize}, null, null);\n"; |
|
| 237 | + return "\${$var} = new XoopsMediaUploader({$dirPath} . '/{$tableName}', {$mimetypes}, {$maxsize}, null, null);\n"; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /* |
@@ -591,11 +591,11 @@ discard block |
||
| 591 | 591 | public function getXoopsCodeXoopsRequest($left = '', $var1 = '', $var2 = '', $type = 'String', $metod = false) |
| 592 | 592 | { |
| 593 | 593 | $ret = ''; |
| 594 | - $intVars = ($var2 != '') ? "'{$var1}', {$var2}" : "'{$var1}'"; |
|
| 595 | - if ($type == 'String') { |
|
| 594 | + $intVars = ($var2 != '') ? "'{$var1}', {$var2}" : "'{$var1}'"; |
|
| 595 | + if ($type == 'String') { |
|
| 596 | 596 | $ret .= "\${$left} = XoopsRequest::getString('{$var1}', '{$var2}');\n"; |
| 597 | 597 | } elseif ($type == 'Int') { |
| 598 | - $ret .= "\${$left} = XoopsRequest::getInt({$intVars});\n"; |
|
| 598 | + $ret .= "\${$left} = XoopsRequest::getInt({$intVars});\n"; |
|
| 599 | 599 | } elseif ($type == 'Int' && $metod !== false) { |
| 600 | 600 | $ret .= "\${$left} = XoopsRequest::getInt({$intVars}, '{$metod}');\n"; |
| 601 | 601 | } |
@@ -727,15 +727,15 @@ discard block |
||
| 727 | 727 | * |
| 728 | 728 | * @param string $tableName |
| 729 | 729 | * @param string $fieldMain |
| 730 | - * @param string $start |
|
| 731 | - * @param string $limit |
|
| 730 | + * @param string $start |
|
| 731 | + * @param string $limit |
|
| 732 | 732 | * |
| 733 | 733 | * @return string |
| 734 | 734 | */ |
| 735 | 735 | public function getXoopsCodeObjHandlerAll($tableName, $fieldMain, $start = '0', $limit = '0') |
| 736 | 736 | { |
| 737 | 737 | $ucfTableName = ucfirst($tableName); |
| 738 | - $param = ($fieldMain != '') ? "{$start}, {$limit}, '{$fieldMain}'" : "{$start}, {$limit}"; |
|
| 738 | + $param = ($fieldMain != '') ? "{$start}, {$limit}, '{$fieldMain}'" : "{$start}, {$limit}"; |
|
| 739 | 739 | $ret = "\${$tableName}All = \${$tableName}Handler->getAll{$ucfTableName}({$param});\n"; |
| 740 | 740 | |
| 741 | 741 | return $ret; |
@@ -872,33 +872,33 @@ discard block |
||
| 872 | 872 | return "\$GLOBALS['xoopsSecurity']->getErrors()"; |
| 873 | 873 | } |
| 874 | 874 | |
| 875 | - /** |
|
| 875 | + /** |
|
| 876 | 876 | * @public function getXoopsCodeGetHtmlErrors |
| 877 | 877 | * |
| 878 | 878 | * @param $tableName |
| 879 | - * @param $isParam |
|
| 880 | - * @param $obj |
|
| 879 | + * @param $isParam |
|
| 880 | + * @param $obj |
|
| 881 | 881 | * |
| 882 | 882 | * @return string |
| 883 | 883 | */ |
| 884 | 884 | public function getXoopsCodeGetHtmlErrors($tableName, $isParam = false, $obj = 'Obj') |
| 885 | 885 | { |
| 886 | 886 | $ret = ''; |
| 887 | - if ($isParam) { |
|
| 888 | - $ret = "\${$tableName}{$obj}->getHtmlErrors()"; |
|
| 889 | - } else { |
|
| 890 | - $ret = "\${$tableName}{$obj} =& \${$tableName}->getHtmlErrors();"; |
|
| 891 | - } |
|
| 887 | + if ($isParam) { |
|
| 888 | + $ret = "\${$tableName}{$obj}->getHtmlErrors()"; |
|
| 889 | + } else { |
|
| 890 | + $ret = "\${$tableName}{$obj} =& \${$tableName}->getHtmlErrors();"; |
|
| 891 | + } |
|
| 892 | 892 | |
| 893 | 893 | return $ret; |
| 894 | 894 | } |
| 895 | 895 | |
| 896 | - /** |
|
| 896 | + /** |
|
| 897 | 897 | * @public function getXoopsCodeObjHandlerCount |
| 898 | 898 | * |
| 899 | 899 | * @param $left |
| 900 | - * @param $tableName |
|
| 901 | - * @param $obj |
|
| 900 | + * @param $tableName |
|
| 901 | + * @param $obj |
|
| 902 | 902 | * |
| 903 | 903 | * @return string |
| 904 | 904 | */ |
@@ -912,8 +912,8 @@ discard block |
||
| 912 | 912 | * |
| 913 | 913 | * @param string $tableName |
| 914 | 914 | * @param string $var |
| 915 | - * @param string $obj |
|
| 916 | - * @param string $isHandler |
|
| 915 | + * @param string $obj |
|
| 916 | + * @param string $isHandler |
|
| 917 | 917 | * @param string $isParam |
| 918 | 918 | * |
| 919 | 919 | * @return string |
@@ -922,27 +922,27 @@ discard block |
||
| 922 | 922 | { |
| 923 | 923 | if ($isParam) { |
| 924 | 924 | if ($isHandler) { |
| 925 | - $ret = "\${$tableName}Handler->get(\${$var});"; |
|
| 926 | - } else { |
|
| 927 | - $ret = "\${$tableName}->get(\${$var});"; |
|
| 928 | - } |
|
| 929 | - } else { |
|
| 925 | + $ret = "\${$tableName}Handler->get(\${$var});"; |
|
| 926 | + } else { |
|
| 927 | + $ret = "\${$tableName}->get(\${$var});"; |
|
| 928 | + } |
|
| 929 | + } else { |
|
| 930 | 930 | if ($isHandler) { |
| 931 | - $ret = "\${$tableName}{$obj} =& \${$tableName}Handler->get(\${$var});"; |
|
| 932 | - } else { |
|
| 933 | - $ret = "\${$tableName}{$obj} =& \${$tableName}->get(\${$var});"; |
|
| 934 | - } |
|
| 935 | - } |
|
| 931 | + $ret = "\${$tableName}{$obj} =& \${$tableName}Handler->get(\${$var});"; |
|
| 932 | + } else { |
|
| 933 | + $ret = "\${$tableName}{$obj} =& \${$tableName}->get(\${$var});"; |
|
| 934 | + } |
|
| 935 | + } |
|
| 936 | 936 | |
| 937 | 937 | return $ret; |
| 938 | 938 | } |
| 939 | 939 | |
| 940 | - /** |
|
| 940 | + /** |
|
| 941 | 941 | * @public function getXoopsCodeHandler |
| 942 | 942 | * |
| 943 | 943 | * @param string $tableName |
| 944 | 944 | * @param string $var |
| 945 | - * @param string $obj |
|
| 945 | + * @param string $obj |
|
| 946 | 946 | * |
| 947 | 947 | * @return string |
| 948 | 948 | */ |
@@ -957,35 +957,35 @@ discard block |
||
| 957 | 957 | return $ret; |
| 958 | 958 | } |
| 959 | 959 | |
| 960 | - /** |
|
| 960 | + /** |
|
| 961 | 961 | * @public function getXoopsCodeDelete |
| 962 | 962 | * |
| 963 | 963 | * @param string $tableName |
| 964 | 964 | * @param string $var |
| 965 | - * @param string $obj |
|
| 966 | - * @param string $isHandler |
|
| 965 | + * @param string $obj |
|
| 966 | + * @param string $isHandler |
|
| 967 | 967 | * |
| 968 | 968 | * @return string |
| 969 | 969 | */ |
| 970 | 970 | public function getXoopsCodeDelete($tableName, $var, $obj = '', $isHandler = false) |
| 971 | 971 | { |
| 972 | 972 | if ($isHandler) { |
| 973 | - if ($obj != '') { |
|
| 974 | - $ret = "\${$tableName}Handler->delete(\${$var}{$obj});"; |
|
| 975 | - } else { |
|
| 976 | - $ret = "\${$tableName}Handler->delete(\${$var});"; |
|
| 977 | - } |
|
| 978 | - } else { |
|
| 979 | - if ($obj != '') { |
|
| 980 | - $ret = "\${$tableName}->delete(\${$var}{$obj});"; |
|
| 981 | - } else { |
|
| 982 | - $ret = "\${$tableName}->delete(\${$var});"; |
|
| 983 | - } |
|
| 984 | - } |
|
| 973 | + if ($obj != '') { |
|
| 974 | + $ret = "\${$tableName}Handler->delete(\${$var}{$obj});"; |
|
| 975 | + } else { |
|
| 976 | + $ret = "\${$tableName}Handler->delete(\${$var});"; |
|
| 977 | + } |
|
| 978 | + } else { |
|
| 979 | + if ($obj != '') { |
|
| 980 | + $ret = "\${$tableName}->delete(\${$var}{$obj});"; |
|
| 981 | + } else { |
|
| 982 | + $ret = "\${$tableName}->delete(\${$var});"; |
|
| 983 | + } |
|
| 984 | + } |
|
| 985 | 985 | return $ret; |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | - /** |
|
| 988 | + /** |
|
| 989 | 989 | * @public function getXoopsCodeHandler |
| 990 | 990 | * |
| 991 | 991 | * @param string $tableName |
@@ -1018,28 +1018,28 @@ discard block |
||
| 1018 | 1018 | { |
| 1019 | 1019 | $ret = $this->getXoopsCodeGet($tableName, $fieldId, 'Obj', true); |
| 1020 | 1020 | |
| 1021 | - $reqOk = "\$_REQUEST['ok']"; |
|
| 1022 | - $isset = $this->phpcode->getPhpCodeIsset($reqOk); |
|
| 1023 | - $xoopsSecurityCheck = $this->getXoopsCodeSecurityCheck(); |
|
| 1021 | + $reqOk = "\$_REQUEST['ok']"; |
|
| 1022 | + $isset = $this->phpcode->getPhpCodeIsset($reqOk); |
|
| 1023 | + $xoopsSecurityCheck = $this->getXoopsCodeSecurityCheck(); |
|
| 1024 | 1024 | $xoopsSecurityErrors = $this->getXoopsCodeSecurityErrors(); |
| 1025 | - $implode = $this->phpcode->getPhpCodeImplode(', ', $xoopsSecurityErrors); |
|
| 1026 | - $redirectHeaderErrors = $this->getXoopsCodeRedirectHeader($tableName, '', '3', $implode); |
|
| 1025 | + $implode = $this->phpcode->getPhpCodeImplode(', ', $xoopsSecurityErrors); |
|
| 1026 | + $redirectHeaderErrors = $this->getXoopsCodeRedirectHeader($tableName, '', '3', $implode); |
|
| 1027 | 1027 | |
| 1028 | - $delete = $this->getXoopsCodeDelete($tableName, $tableName, 'Obj', true); |
|
| 1028 | + $delete = $this->getXoopsCodeDelete($tableName, $tableName, 'Obj', true); |
|
| 1029 | 1029 | $condition = $this->phpcode->getPhpCodeConditions('!'.$xoopsSecurityCheck, '', '', $redirectHeaderErrors); |
| 1030 | 1030 | |
| 1031 | - $redirectHeaderLanguage = $this->getXoopsCodeRedirectHeader($tableName, '', '3', "{$language}FORM_DELETE_OK"); |
|
| 1032 | - $htmlErrors = $this->getXoopsCodeGetHtmlErrors($tableName, true); |
|
| 1033 | - $internalElse = $this->getXoopsCodeTplAssign('error', $htmlErrors); |
|
| 1034 | - $condition .= $this->phpcode->getPhpCodeConditions($delete, '', '', $redirectHeaderLanguage, $internalElse); |
|
| 1031 | + $redirectHeaderLanguage = $this->getXoopsCodeRedirectHeader($tableName, '', '3', "{$language}FORM_DELETE_OK"); |
|
| 1032 | + $htmlErrors = $this->getXoopsCodeGetHtmlErrors($tableName, true); |
|
| 1033 | + $internalElse = $this->getXoopsCodeTplAssign('error', $htmlErrors); |
|
| 1034 | + $condition .= $this->phpcode->getPhpCodeConditions($delete, '', '', $redirectHeaderLanguage, $internalElse); |
|
| 1035 | 1035 | |
| 1036 | - $mainElse = $this->getXoopsCodeXoopsConfirm($tableName, $language, $fieldId, $fieldMain); |
|
| 1037 | - $ret .= $this->phpcode->getPhpCodeConditions($isset, ' && ', "1 == {$reqOk}", $condition, $mainElse); |
|
| 1036 | + $mainElse = $this->getXoopsCodeXoopsConfirm($tableName, $language, $fieldId, $fieldMain); |
|
| 1037 | + $ret .= $this->phpcode->getPhpCodeConditions($isset, ' && ', "1 == {$reqOk}", $condition, $mainElse); |
|
| 1038 | 1038 | |
| 1039 | 1039 | return $ret; |
| 1040 | 1040 | } |
| 1041 | 1041 | |
| 1042 | - /* |
|
| 1042 | + /* |
|
| 1043 | 1043 | * @public function getTopicGetVar |
| 1044 | 1044 | * @param string $lpFieldName |
| 1045 | 1045 | * @param string $rpFieldName |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | return $ret; |
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | - /* |
|
| 1063 | + /* |
|
| 1064 | 1064 | * @public function getUploadImageGetVar |
| 1065 | 1065 | * @param string $lpFieldName |
| 1066 | 1066 | * @param string $rpFieldName |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | return $this->phpcode->getPhpCodeCaseSwitch('update', $content); |
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | - /** |
|
| 1106 | + /** |
|
| 1107 | 1107 | * @public function getXoopsCodeSaveFieldId |
| 1108 | 1108 | * |
| 1109 | 1109 | * @param $fields |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | * @param null |
| 52 | 52 | */ |
| 53 | 53 | /** |
| 54 | - * @return UserObjects |
|
| 54 | + * @return UserXoopsCode |
|
| 55 | 55 | */ |
| 56 | 56 | public static function &getInstance() |
| 57 | 57 | { |
@@ -71,6 +71,6 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function getUserHeaderTpl($moduleDirname, $tableName = 'index') |
| 73 | 73 | { |
| 74 | - return "\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_{$tableName}.tpl'\n;"; |
|
| 74 | + return "\$GLOBALS['xoopsOption']['template_main'] = '{$moduleDirname}_{$tableName}.tpl'\n;"; |
|
| 75 | 75 | } |
| 76 | 76 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return $ret; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - /* |
|
| 106 | + /* |
|
| 107 | 107 | * @public function getPhpCodeRemoveCarriageReturn |
| 108 | 108 | * @param $string |
| 109 | 109 | * |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * |
| 262 | 262 | * @param $op |
| 263 | 263 | * @param $content |
| 264 | - * @param $t |
|
| 264 | + * @param $t |
|
| 265 | 265 | * |
| 266 | 266 | * @return string |
| 267 | 267 | */ |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | * @param $cases |
| 284 | 284 | * @param $defaultAfterCase |
| 285 | 285 | * @param $default |
| 286 | - * @param $t |
|
| 286 | + * @param $t |
|
| 287 | 287 | * |
| 288 | 288 | * @return string |
| 289 | 289 | */ |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $ret .= $this->xoopscode->getXoopsCodeXoopsRequest('op', 'op', 'global'); |
| 104 | 104 | $ret .= $this->xoopscode->getXoopsCodeLoad('XoopsFormLoader'); |
| 105 | 105 | $optionsSelect = array('global' => "{$language}PERMISSIONS_GLOBAL", 'approve' => "{$language}PERMISSIONS_APPROVE", |
| 106 | - 'submit' => "{$language}PERMISSIONS_SUBMIT", 'view' => "{$language}PERMISSIONS_VIEW", ); |
|
| 106 | + 'submit' => "{$language}PERMISSIONS_SUBMIT", 'view' => "{$language}PERMISSIONS_VIEW",); |
|
| 107 | 107 | $formSelect = $this->xoopscode->getXoopsFormSelect('formSelect', '\'\'', 'op', $optionsSelect, 'onchange="document.fselperm.submit()"'); |
| 108 | 108 | $ret .= $this->xoopscode->getXoopsSimpleForm('permTableForm', 'formSelect', $formSelect, '\'\'', 'fselperm', 'permissions'); |
| 109 | 109 | |
@@ -122,16 +122,16 @@ discard block |
||
| 122 | 122 | $cases = array('global' => array("\$formTitle = {$language}PERMISSIONS_GLOBAL;", |
| 123 | 123 | "\$permName = '{$moduleDirname}_ac';", |
| 124 | 124 | "\$permDesc = {$language}PERMISSIONS_GLOBAL_DESC;", |
| 125 | - "\$globalPerms = array( '4' => {$language}PERMISSIONS_GLOBAL_4, '8' => {$language}PERMISSIONS_GLOBAL_8, '16' => {$language}PERMISSIONS_GLOBAL_16 );", ), |
|
| 125 | + "\$globalPerms = array( '4' => {$language}PERMISSIONS_GLOBAL_4, '8' => {$language}PERMISSIONS_GLOBAL_8, '16' => {$language}PERMISSIONS_GLOBAL_16 );",), |
|
| 126 | 126 | 'approve' => array("\$formTitle = {$language}PERMISSIONS_APPROVE;", |
| 127 | 127 | "\$permName = '{$moduleDirname}_approve';", |
| 128 | - "\$permDesc = {$language}PERMISSIONS_APPROVE_DESC;", ), |
|
| 128 | + "\$permDesc = {$language}PERMISSIONS_APPROVE_DESC;",), |
|
| 129 | 129 | 'submit' => array("\$formTitle = {$language}PERMISSIONS_SUBMIT;", |
| 130 | 130 | "\$permName = '{$moduleDirname}_submit';", |
| 131 | - "\$permDesc = {$language}PERMISSIONS_SUBMIT_DESC;", ), |
|
| 131 | + "\$permDesc = {$language}PERMISSIONS_SUBMIT_DESC;",), |
|
| 132 | 132 | 'view' => array("\$formTitle = {$language}PERMISSIONS_VIEW;", |
| 133 | 133 | "\$permName = '{$moduleDirname}_view';", |
| 134 | - "\$permDesc = {$language}PERMISSIONS_VIEW_DESC;", ), ); |
|
| 134 | + "\$permDesc = {$language}PERMISSIONS_VIEW_DESC;",),); |
|
| 135 | 135 | |
| 136 | 136 | $contentSwitch = $this->phpcode->getPhpCodeCaseSwitch($cases, true, false, "\t"); |
| 137 | 137 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $getVar1 = $this->xoopscode->getXoopsCodeGetVar('', "{$tableName}All[\$i]", $fieldId, true); |
| 184 | 184 | $getVar2 = $this->xoopscode->getXoopsCodeGetVar('', "{$tableName}All[\$i]", $fieldMain, true); |
| 185 | 185 | $foreach2 = $this->xoopscode->getXoopsCodeAddItem('permform', $getVar1, $getVar2)."\r"; |
| 186 | - $else .= $this->phpcode->getPhpCodeForeach("{$tableName}All", true, false, 'i', $foreach2, "\t"); |
|
| 186 | + $else .= $this->phpcode->getPhpCodeForeach("{$tableName}All", true, false, 'i', $foreach2, "\t"); |
|
| 187 | 187 | $if2 = $this->xoopscode->getXoopsCodeTplAssign('form', '$permform->render()'); |
| 188 | 188 | $elseInter = $this->xoopscode->getXoopsCodeRedirectHeader($tableName, '?op=new', '3', "{$language}NO_PERMISSIONS_SET"); |
| 189 | 189 | $elseInter .= $this->getSimpleString("\texit();"); |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | class AdminXoopsCode |
| 29 | 29 | { |
| 30 | - /* |
|
| 30 | + /* |
|
| 31 | 31 | * @var string |
| 32 | 32 | */ |
| 33 | 33 | private $xoopscode; |
| 34 | 34 | |
| 35 | - /* |
|
| 35 | + /* |
|
| 36 | 36 | * @public function constructor |
| 37 | 37 | * @param null |
| 38 | 38 | */ |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | public function __construct() |
| 43 | 43 | { |
| 44 | 44 | $this->phpcode = TDMCreatePhpCode::getInstance(); |
| 45 | - $this->xoopscode = TDMCreateXoopsCode::getInstance(); |
|
| 45 | + $this->xoopscode = TDMCreateXoopsCode::getInstance(); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /* |
@@ -86,12 +86,12 @@ discard block |
||
| 86 | 86 | public function getAdminItemButton($language, $tableName, $stuTableSoleName, $op = '?op=new', $type = 'add') |
| 87 | 87 | { |
| 88 | 88 | $stuType = strtoupper($type); |
| 89 | - $adminMenu = '$adminMenu->addItemButton('; |
|
| 90 | - if($type === 'add') { |
|
| 91 | - $ret = $adminMenu."{$language}ADD_{$stuTableSoleName}, '{$tableName}.php{$op}', '{$type}');\n"; |
|
| 92 | - } else { |
|
| 93 | - $ret = $adminMenu."{$language}{$stuTableSoleName}_{$stuType}, '{$tableName}.php{$op}', '{$type}');\n"; |
|
| 94 | - } |
|
| 89 | + $adminMenu = '$adminMenu->addItemButton('; |
|
| 90 | + if($type === 'add') { |
|
| 91 | + $ret = $adminMenu."{$language}ADD_{$stuTableSoleName}, '{$tableName}.php{$op}', '{$type}');\n"; |
|
| 92 | + } else { |
|
| 93 | + $ret = $adminMenu."{$language}{$stuTableSoleName}_{$stuType}, '{$tableName}.php{$op}', '{$type}');\n"; |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | 96 | return $ret; |
| 97 | 97 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function getXoopsCodeAddInfoBoxLine($language, $label = '', $var = '') |
| 147 | 147 | { |
| 148 | 148 | $aMenu = '$adminMenu->addInfoBoxLine('; |
| 149 | - if ($var != '') { |
|
| 149 | + if ($var != '') { |
|
| 150 | 150 | $ret = $aMenu."{$language}, '<label>'.{$label}.'</label>', {$var});\n"; |
| 151 | 151 | } else { |
| 152 | 152 | $ret = $aMenu."{$language}, '<label>'.{$label}.'</label>');\n"; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | public function getXoopsCodeAddConfigBoxLine($language, $label = '', $var = '') |
| 167 | 167 | { |
| 168 | 168 | $aMenu = '$adminMenu->addConfigBoxLine('; |
| 169 | - if ($var != '') { |
|
| 169 | + if ($var != '') { |
|
| 170 | 170 | $ret = $aMenu."{$language}, '{$label}', {$var});\n"; |
| 171 | 171 | } else { |
| 172 | 172 | $ret = $aMenu."{$language}, '{$label}');\n"; |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | { |
| 88 | 88 | $stuType = strtoupper($type); |
| 89 | 89 | $adminMenu = '$adminMenu->addItemButton('; |
| 90 | - if($type === 'add') { |
|
| 90 | + if ($type === 'add') { |
|
| 91 | 91 | $ret = $adminMenu."{$language}ADD_{$stuTableSoleName}, '{$tableName}.php{$op}', '{$type}');\n"; |
| 92 | 92 | } else { |
| 93 | 93 | $ret = $adminMenu."{$language}{$stuTableSoleName}_{$stuType}, '{$tableName}.php{$op}', '{$type}');\n"; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | protected $phpcode; |
| 35 | 35 | |
| 36 | - /* |
|
| 36 | + /* |
|
| 37 | 37 | * @public function constructor |
| 38 | 38 | * @param null |
| 39 | 39 | */ |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | parent::__construct(); |
| 46 | 46 | $this->tdmcfile = TDMCreateFile::getInstance(); |
| 47 | - $this->phpcode = TDMCreatePhpCode::getInstance(); |
|
| 47 | + $this->phpcode = TDMCreatePhpCode::getInstance(); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /* |