Revize 1612
Přidáno uživatelem Ondřej Fibich před více než 12 roky(ů)
freenetis/branches/testing/application/controllers/ifaces.php | ||
---|---|---|
if ($im_connect_to && $im_connect_to->id)
|
||
{
|
||
$roaming = new Link_Model();
|
||
$link_id = $_POST['link_id'];
|
||
$link_id = $form_data['link_id'];
|
||
$roaming_id = $roaming->get_roaming();
|
||
$roaming = $roaming->find($roaming_id);
|
||
$name = $_POST['link_name'];
|
||
$medium = $_POST['medium'];
|
||
$name = $form_data['link_name'];
|
||
$medium = $form_data['medium'];
|
||
|
||
// don not connect to roaming
|
||
if ($link_id == $roaming_id)
|
||
... | ... | |
$lm = new Link_Model($link_id);
|
||
$lm->name = htmlspecialchars($name);
|
||
$lm->medium = intval($medium);
|
||
$lm->comment = htmlspecialchars($_POST['link_comment']);
|
||
$lm->bitrate = network::str2bytes($_POST['bitrate']);
|
||
$lm->duplex = ($_POST['duplex'] == 1);
|
||
$lm->comment = htmlspecialchars($form_data['link_comment']);
|
||
$lm->bitrate = network::str2bytes($form_data['bitrate']);
|
||
$lm->duplex = ($form_data['duplex'] == 1);
|
||
|
||
if ($iface->type == Iface_Model::TYPE_WIRELESS)
|
||
{
|
||
$lm->wireless_ssid = htmlspecialchars($_POST['wireless_ssid']);
|
||
$lm->wireless_norm = intval($_POST['wireless_norm']);
|
||
$lm->wireless_frequency = intval($_POST['wireless_frequency']);
|
||
$lm->wireless_channel = intval($_POST['wireless_channel']);
|
||
$lm->wireless_channel_width = intval($_POST['wireless_channel_width']);
|
||
$lm->wireless_polarization = intval($_POST['wireless_polarization']);
|
||
$lm->wireless_ssid = htmlspecialchars($form_data['wireless_ssid']);
|
||
$lm->wireless_norm = intval($form_data['wireless_norm']);
|
||
$lm->wireless_frequency = intval($form_data['wireless_frequency']);
|
||
$lm->wireless_channel = intval($form_data['wireless_channel']);
|
||
$lm->wireless_channel_width = intval($form_data['wireless_channel_width']);
|
||
$lm->wireless_polarization = intval($form_data['wireless_polarization']);
|
||
}
|
||
|
||
$lm->save_throwable();
|
||
... | ... | |
|
||
$filter_form = Devices_Controller::device_filter_form();
|
||
|
||
$form = new Forge();
|
||
$form = new Forge(url_lang::base() . url_lang::current() . '?sended=1');
|
||
|
||
$base_form = $form->group('Basic data');
|
||
|
||
... | ... | |
}
|
||
|
||
$c_form = $form->group(
|
||
__('Link') . ' ' . form::checkbox('change_link', 1) .
|
||
__('Link') . ' ' .
|
||
form::checkbox('change_link', 1, isset($_POST['change_link'])) .
|
||
' <span style="color: black">' .
|
||
__('Change connected to (link) settings?') .
|
||
'</span>'
|
||
... | ... | |
isset($_POST['change_link']) && $_POST['change_link'])
|
||
{
|
||
$roaming = new Link_Model();
|
||
$link_id = $_POST['link_id'];
|
||
$link_id = $form_data['link_id'];
|
||
$roaming_id = $roaming->get_roaming();
|
||
$roaming = $roaming->find($roaming_id);
|
||
$name = $_POST['link_name'];
|
||
$medium = $_POST['medium'];
|
||
$name = $form_data['link_name'];
|
||
$medium = $form_data['medium'];
|
||
|
||
// don not connect to roaming
|
||
if ($link_id == $roaming_id)
|
||
... | ... | |
$lm = new Link_Model($link_id);
|
||
$lm->name = htmlspecialchars($name);
|
||
$lm->medium = intval($medium);
|
||
$lm->comment = htmlspecialchars($_POST['link_comment']);
|
||
$lm->bitrate = network::str2bytes($_POST['bitrate']);
|
||
$lm->duplex = ($_POST['duplex'] == 1);
|
||
$lm->comment = htmlspecialchars($form_data['link_comment']);
|
||
$lm->bitrate = network::str2bytes($form_data['bitrate']);
|
||
$lm->duplex = ($form_data['duplex'] == 1);
|
||
|
||
if ($iface->type == Iface_Model::TYPE_WIRELESS)
|
||
{
|
||
$lm->wireless_ssid = htmlspecialchars($form_data['wireless_ssid']);
|
||
$lm->wireless_norm = intval($_POST['wireless_norm']);
|
||
$lm->wireless_frequency = intval($_POST['wireless_frequency']);
|
||
$lm->wireless_channel = intval($_POST['wireless_channel']);
|
||
$lm->wireless_channel_width = intval($_POST['wireless_channel_width']);
|
||
$lm->wireless_polarization = intval($_POST['wireless_polarization']);
|
||
$lm->wireless_norm = intval($form_data['wireless_norm']);
|
||
$lm->wireless_frequency = intval($form_data['wireless_frequency']);
|
||
$lm->wireless_channel = intval($form_data['wireless_channel']);
|
||
$lm->wireless_channel_width = intval($form_data['wireless_channel_width']);
|
||
$lm->wireless_polarization = intval($form_data['wireless_polarization']);
|
||
}
|
||
|
||
$lm->save_throwable();
|
freenetis/branches/testing/application/controllers/notifications.php | ||
---|---|---|
|
||
foreach ($messages as $message)
|
||
{
|
||
// handled by cron
|
||
if ($message->type == Message_Model::UNALLOWED_CONNECTING_PLACE_MESSAGE)
|
||
{
|
||
continue;
|
||
}
|
||
|
||
if ($message->type == Message_Model::INTERRUPTED_MEMBERSHIP_MESSAGE ||
|
||
$message->type == Message_Model::DEBTOR_MESSAGE ||
|
||
$message->type == Message_Model::PAYMENT_NOTICE_MESSAGE ||
|
||
$message->type == Message_Model::UNALLOWED_CONNECTING_PLACE_MESSAGE)
|
||
$message->type == Message_Model::PAYMENT_NOTICE_MESSAGE)
|
||
{
|
||
$arr_messages[$message->id] = __($message->name);
|
||
}
|
||
... | ... | |
|
||
$arr_messages = array
|
||
(
|
||
NULL => '----- '.__('select message').' -----'
|
||
NULL => '----- '.__('Select message').' -----'
|
||
) + $arr_messages;
|
||
|
||
$form = new Forge(url::base().url::current());
|
||
|
||
$form->dropdown('message_id')
|
||
->label(__('Message').':')
|
||
->label('Message')
|
||
->options($arr_messages)
|
||
->rules('required');
|
||
|
||
... | ... | |
$order_by_direction = 'DESC';
|
||
break;
|
||
|
||
case Message_Model::UNALLOWED_CONNECTING_PLACE_MESSAGE:
|
||
$order_by = 'allowed';
|
||
$order_by_direction = 'ASC';
|
||
break;
|
||
|
||
default:
|
||
$order_by = 'id';
|
||
$order_by_direction = 'ASC';
|
freenetis/branches/testing/application/controllers/links.php | ||
---|---|---|
->callback(array($this, 'valid_bitrate'));
|
||
|
||
$form->checkbox('duplex')
|
||
->label('Duplex')
|
||
->value('1')
|
||
->checked($link->duplex);
|
||
|
freenetis/branches/testing/application/controllers/devices.php | ||
---|---|---|
{
|
||
$grids['ports']->add_new_button(
|
||
'ifaces/add/'.$device->id.'/'.Iface_Model::TYPE_PORT,
|
||
'Add new port', array
|
||
(
|
||
'title' => __('Add new port'),
|
||
'class' => 'popup_link'
|
||
)
|
||
'Add new port', array('title' => __('Add new port'))
|
||
);
|
||
}
|
||
|
||
... | ... | |
|
||
$actions = $grids['ports']->grouped_action_field();
|
||
|
||
if ($this->acl_check_view(get_class($this),'port',$member_id))
|
||
if ($this->acl_check_view(get_class($this), 'port', $member_id))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('show')
|
freenetis/branches/testing/application/libraries/Forge.php | ||
---|---|---|
public function validate()
|
||
{
|
||
$status = TRUE;
|
||
|
||
// validate inputs
|
||
foreach($this->inputs as $input)
|
||
{
|
||
if ($input->validate() == FALSE)
|
||
... | ... | |
$status = FALSE;
|
||
}
|
||
}
|
||
// validate hidden inputs
|
||
foreach ($this->hidden as $input)
|
||
{
|
||
if ($input->validate() == FALSE)
|
||
{
|
||
$status = FALSE;
|
||
}
|
||
}
|
||
|
||
return $status;
|
||
}
|
||
... | ... | |
$this->load_inputs($input);
|
||
}
|
||
|
||
if (!($input instanceof Form_Group) && $name = $input->name)
|
||
if (!($input instanceof Form_Group) && ($name = $input->name))
|
||
{
|
||
$name = str_replace('[]','', $name);
|
||
$name = str_replace('[]', '', $name);
|
||
// Return only named inputs
|
||
$this->data[$name] = $input->value;
|
||
}
|
||
... | ... | |
{
|
||
foreach($this->hidden as $input)
|
||
{
|
||
$input->validate();
|
||
$hidden[$input->name] = $input->value;
|
||
}
|
||
}
|
freenetis/branches/testing/application/libraries/forge/Form_Hidden.php | ||
---|---|---|
|
||
protected $protect = array('type', 'label');
|
||
|
||
/**
|
||
* Load the value of the input, if form data is present.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function load_value()
|
||
{
|
||
if (is_bool($this->is_valid))
|
||
return;
|
||
|
||
if ($name = $this->name)
|
||
{
|
||
// Load POSTed value, but only for named inputs
|
||
$this->data['value'] = $this->input_value($name);
|
||
}
|
||
|
||
if (is_string($this->data['value']))
|
||
{
|
||
// Trim string values
|
||
$this->data['value'] = trim($this->data['value']);
|
||
}
|
||
}
|
||
|
||
public function html()
|
||
{
|
||
// Make sure validation runs
|
||
$this->validate();
|
||
|
||
$data = $this->data;
|
||
|
||
return form::hidden($data);
|
freenetis/branches/testing/application/views/js/ifaces_add.php | ||
---|---|---|
$('.popup-add[href*="/ifaces/add"]').hide();
|
||
$('.add_detail_to_link').hide();
|
||
}
|
||
<?php if(!isset($_GET['sended'])): ?>
|
||
else
|
||
{
|
||
$('#connected_to').trigger('change', $('#connected_to_interface').val());
|
||
}
|
||
<?php endif ?>
|
||
}
|
||
|
||
// add filter button
|
||
... | ... | |
$('#port_mode', context).trigger('change');
|
||
$('#change_link').trigger('change');
|
||
|
||
<?php endif ?>
|
||
<?php endif ?>
|
||
|
||
<?php if (isset($add_button) && $add_button): ?>
|
||
// if mid-step form opened dialog, on select, just open detailed form
|
Také k dispozici: Unified diff
Upravy:
- uprava spatneho chovani hidden fieldu ve forgi
- drobne upravy v editaci/pridani ifacu
Opravy:
- smazani nefunkcniho presmerovani na nepovolene pripojne misto