parent
b0382da5fe
commit
28e406565b
application/forms/Dashboard
|
@ -74,15 +74,21 @@ class ComponentForm extends Form
|
||||||
'text',
|
'text',
|
||||||
'component',
|
'component',
|
||||||
array(
|
array(
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'label' => t('Dashlet Title'),
|
'label' => t('Dashlet Title'),
|
||||||
'description' => t('Enter a title for the dashlet.')
|
'description' => t('Enter a title for the dashlet.')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (empty($panes) ||
|
$this->addElement(
|
||||||
((isset($formData['create_new_pane']) && $formData['create_new_pane'] != false) &&
|
'note',
|
||||||
(false === isset($formData['use_existing_dashboard']) || $formData['use_existing_dashboard'] != true))
|
'note',
|
||||||
) {
|
array(
|
||||||
|
'decorators' => array(
|
||||||
|
array('HtmlTag', array('tag' => 'hr'))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (empty($panes) || ((isset($formData['create_new_pane']) && $formData['create_new_pane'] != false))) {
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'text',
|
'text',
|
||||||
'pane',
|
'pane',
|
||||||
|
@ -93,26 +99,6 @@ class ComponentForm extends Form
|
||||||
t('Enter a title for the new pane.')
|
t('Enter a title for the new pane.')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->addElement( // Prevent the button from being displayed again on validation errors
|
|
||||||
'hidden',
|
|
||||||
'create_new_pane',
|
|
||||||
array(
|
|
||||||
'value' => 1
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (false === empty($panes)) {
|
|
||||||
$buttonExistingPane = $this->createElement(
|
|
||||||
'submit',
|
|
||||||
'use_existing_dashboard',
|
|
||||||
array(
|
|
||||||
'ignore' => true,
|
|
||||||
'label' => t('Use An Existing Dashboard'),
|
|
||||||
'class' => 'link-like'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$buttonExistingPane->removeDecorator('Label');
|
|
||||||
$this->addElement($buttonExistingPane);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'select',
|
'select',
|
||||||
|
@ -125,18 +111,18 @@ class ComponentForm extends Form
|
||||||
t('Select a pane you want to add the dashlet.')
|
t('Select a pane you want to add the dashlet.')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$buttonNewPane = $this->createElement(
|
|
||||||
'submit',
|
|
||||||
'create_new_pane',
|
|
||||||
array(
|
|
||||||
'ignore' => true,
|
|
||||||
'label' => t('Create A New Dashboard'),
|
|
||||||
'class' => 'link-like',
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$buttonNewPane->removeDecorator('Label');
|
|
||||||
$this->addElement($buttonNewPane);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->addElement(
|
||||||
|
'checkbox',
|
||||||
|
'create_new_pane',
|
||||||
|
array(
|
||||||
|
'required' => false,
|
||||||
|
'label' => t('New dashboard'),
|
||||||
|
'class' => 'autosubmit',
|
||||||
|
'description' => t('Check this box if you want to add the dashlet to a new dashboard')
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue