//<?php
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
exit;
}
class hook72 extends _HOOK_CLASS_
{
/**
* Get elements for add/edit form
*
* @param \IPS\Content\Item|NULL $item The current item if editing or NULL if creating
* @param \IPS\Node\Model|NULL $container Container (e.g. forum), if appropriate
* @return array
*/
public static function formElements( $item=NULL, \IPS\Node\Model $container=NULL )
{
if ( \count( $options ) or \count( $toggles ) )
{
$formElements['create_record_state'] = new \IPS\Helpers\Form\CheckboxSet( 'create_record_state', $values, FALSE, array(
'options' => $options,
'toggles' => $toggles,
'multiple' => TRUE
) );
}
$formElements['field_124']->value = isset( \IPS\Request::i()->pole ) ? \IPS\Request::i()->pole : NULL;
return $formElements;
}
}
Niestety nie działa mi to, przy kliknięciu w link formularza wywala błąd:
Przy tworzeniu hooka rozszerzam klasę: \IPS\cms\Records. U mnie te pola input są dziwne, podzielona na parę innych. Część z nich ukryta. Niżej screen jak to wygląda, do tych dwóch inputów potrzebuję wstawić dwie różne wartości.