| @@ 465-483 (lines=19) @@ | ||
| 462 | * @param string $fieldMain |
|
| 463 | * @return string |
|
| 464 | */ |
|
| 465 | public function getAdminPhpCodeUpdate($moduleDirname, $tableName, $language, $fieldId, $fieldMain) |
|
| 466 | { |
|
| 467 | $upModuleName = strtoupper($moduleDirname); |
|
| 468 | $ret = <<<EOT |
|
| 469 | case 'update': |
|
| 470 | if (isset(\${$fieldId})) { |
|
| 471 | \${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId}); |
|
| 472 | } |
|
| 473 | \${$tableName}Obj->setVar("\${$tableName}_display", \$_POST["\${$tableName}_display"]); |
|
| 474 | ||
| 475 | if (\${$tableName}Handler->insert(\${$tableName}Obj)) { |
|
| 476 | redirect_header("\${$tableName}.php", 3, _AM_{$upModuleName}_FORMOK); |
|
| 477 | } |
|
| 478 | echo \${$tableName}Obj->getHtmlErrors(); |
|
| 479 | break;\n |
|
| 480 | EOT; |
|
| 481 | ||
| 482 | return $ret; |
|
| 483 | } |
|
| 484 | ||
| 485 | /** |
|
| 486 | * @public function getAdminPhpCodeGetDisplayTpl |
|
| @@ 510-525 (lines=16) @@ | ||
| 507 | * |
|
| 508 | * @return string |
|
| 509 | */ |
|
| 510 | private function getXoopsVersionTypeBlocks($moduleDirname, $tableName, $language, $type) |
|
| 511 | { |
|
| 512 | $stuTableName = strtoupper($tableName); |
|
| 513 | $ret = <<<EOT |
|
| 514 | \$modversion['blocks'][] = array( |
|
| 515 | 'file' => '{$tableName}.php', |
|
| 516 | 'name' => {$language}{$stuTableName}_BLOCK, |
|
| 517 | 'description' => {$language}{$stuTableName}_BLOCK_DESC, |
|
| 518 | 'show_func' => 'b_{$moduleDirname}_{$tableName}_show', |
|
| 519 | 'edit_func' => 'b_{$moduleDirname}_{$tableName}_edit', |
|
| 520 | 'options' => '{$type}|5|25|0', |
|
| 521 | 'template' => '{$moduleDirname}_block_{$tableName}.tpl');\n\n |
|
| 522 | EOT; |
|
| 523 | ||
| 524 | return $ret; |
|
| 525 | } |
|
| 526 | ||
| 527 | /* |
|
| 528 | * @private function getXoopsVersionConfig |
|