| @@ 234-254 (lines=21) @@ | ||
| 231 | $button_tray -> addElement( $hidden ); |
|
| 232 | ||
| 233 | // No ID for column -- then it's new column, button says 'Create' |
|
| 234 | if ( !$categoryID ) { |
|
| 235 | $butt_create = new XoopsFormButton( '', '', _AM_LEXIKON_CREATE, 'submit' ); |
|
| 236 | $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"'); |
|
| 237 | $button_tray->addElement( $butt_create ); |
|
| 238 | ||
| 239 | $butt_clear = new XoopsFormButton( '', '', _AM_LEXIKON_CLEAR, 'reset' ); |
|
| 240 | $button_tray->addElement( $butt_clear ); |
|
| 241 | ||
| 242 | $butt_cancel = new XoopsFormButton( '', '', _AM_LEXIKON_CANCEL, 'button' ); |
|
| 243 | $butt_cancel->setExtra('onclick="history.go(-1)"'); |
|
| 244 | $button_tray->addElement( $butt_cancel ); |
|
| 245 | } else // button says 'Update' |
|
| 246 | { |
|
| 247 | $butt_create = new XoopsFormButton( '', '', _AM_LEXIKON_MODIFY, 'submit' ); |
|
| 248 | $butt_create->setExtra('onclick="this.form.elements.op.value=\'addcategory\'"'); |
|
| 249 | $button_tray->addElement( $butt_create ); |
|
| 250 | ||
| 251 | $butt_cancel = new XoopsFormButton( '', '', _AM_LEXIKON_CANCEL, 'button' ); |
|
| 252 | $butt_cancel->setExtra('onclick="history.go(-1)"'); |
|
| 253 | $button_tray->addElement( $butt_cancel ); |
|
| 254 | } |
|
| 255 | ||
| 256 | $sform -> addElement( $button_tray ); |
|
| 257 | $sform -> display(); |
|
| @@ 303-325 (lines=23) @@ | ||
| 300 | $hidden = new XoopsFormHidden( 'op', 'addentry' ); |
|
| 301 | $button_tray -> addElement( $hidden ); |
|
| 302 | ||
| 303 | if ( !$entryID ) // there's no entryID? Then it's a new entry |
|
| 304 | { |
|
| 305 | ||
| 306 | $butt_create = new XoopsFormButton( '', '', _AM_LEXIKON_CREATE, 'submit' ); |
|
| 307 | $butt_create->setExtra('onclick="this.form.elements.op.value=\'addentry\'"'); |
|
| 308 | $button_tray->addElement( $butt_create ); |
|
| 309 | ||
| 310 | $butt_clear = new XoopsFormButton( '', '', _AM_LEXIKON_CLEAR, 'reset' ); |
|
| 311 | $button_tray->addElement( $butt_clear ); |
|
| 312 | ||
| 313 | $butt_cancel = new XoopsFormButton( '', '', _AM_LEXIKON_CANCEL, 'button' ); |
|
| 314 | $butt_cancel->setExtra('onclick="history.go(-1)"'); |
|
| 315 | $button_tray->addElement( $butt_cancel ); |
|
| 316 | } else // else, we're editing an existing entry |
|
| 317 | { |
|
| 318 | $butt_create = new XoopsFormButton( '', '', _AM_LEXIKON_MODIFY, 'submit' ); |
|
| 319 | $butt_create->setExtra('onclick="this.form.elements.op.value=\'addentry\'"'); |
|
| 320 | $button_tray->addElement( $butt_create ); |
|
| 321 | ||
| 322 | $butt_cancel = new XoopsFormButton( '', '', _AM_LEXIKON_CANCEL, 'button' ); |
|
| 323 | $butt_cancel->setExtra('onclick="history.go(-1)"'); |
|
| 324 | $button_tray->addElement( $butt_cancel ); |
|
| 325 | } |
|
| 326 | ||
| 327 | $sform -> addElement( $button_tray ); |
|
| 328 | $sform -> display(); |
|