本文整理汇总了PHP中ctools_export_ui::edit_form_validate方法的典型用法代码示例。如果您正苦于以下问题:PHP ctools_export_ui::edit_form_validate方法的具体用法?PHP ctools_export_ui::edit_form_validate怎么用?PHP ctools_export_ui::edit_form_validate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctools_export_ui
的用法示例。
在下文中一共展示了ctools_export_ui::edit_form_validate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: t
/**
* Validate submission of the mini panel edit form.
*/
function edit_form_basic_validate($form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
if (preg_match("/[^A-Za-z0-9 ]/", $form_state['values']['category'])) {
form_error($form['category'], t('Categories may contain only alphanumerics or spaces.'));
}
}
示例2: array
/**
* @todo
*/
function edit_form_validate(&$form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
$values = $form_state['values'];
if ($values['parent'] == '_none') {
form_set_value(array('#parents' => array('parent')), '', $form_state);
} else {
form_set_value(array('#parents' => array('mode')), DELTA_PRESERVE, $form_state);
}
}
示例3:
/**
* Implements ctools_export_ui::edit_form_validate().
*/
function edit_form_validate(&$form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
// If POP3 mailbox is chosen, messages should be deleted after processing.
// Do not set an actual error because this is helpful for testing purposes.
if ($form_state['values']['settings']['type'] == 'pop3' && $form_state['values']['settings']['delete_after_read'] == 0) {
mailhandler_report('warning', 'Unless you check off "Delete messages after they are processed" when using a POP3 mailbox, old emails will be re-imported each time the mailbox is processed. You can partially prevent this by mapping Message ID to a unique target in the processor configuration - see INSTALL.txt or advanced help for more information');
}
// Dummy library is only for testing.
if ($form_state['values']['settings']['retrieve'] == 'MailhandlerRetrieveDummy') {
mailhandler_report('warning', 'Because you selected the dummy retrieval library, Mailhandler will not import any messages. Please select another retrieval library, such as the PHP IMAP library.');
}
}
示例4: t
/**
* Validate callback for the edit form.
*/
function edit_form_validate(&$form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
$pluginName = $form_state['values']['plugin_name'];
if (empty($pluginName)) {
form_set_error('plugin_name', t('No valid plugin name given. The plugin needs to be a valid class as extension of iHeartbeatPlugin.'));
}
$pluginWrapper = heartbeat_plugins_get_plugin($pluginName);
if ($pluginWrapper instanceof iHeartbeatPluginWrapper) {
$plugin = $pluginWrapper->getPlugin();
}
if (!$plugin instanceof HeartbeatBasePlugin) {
form_set_error('plugin_name', t('Class @class does not implement HeartbeatBasePlugin.', array('@class' => $pluginName)));
}
}
示例5:
/**
* Validate callback for the edit form.
*/
function edit_form_validate(&$form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
if (!empty($form_state['values']['html'])) {
if ($validate = zm_template_engine_validate_template($form_state['values']['html'])) {
$current_item = $this->load_item($form_state['item']->name);
if ($current_item && ($engine = zm_template_engine_load())) {
$filename = $engine->getCacheFilename($current_item->name);
$engine->clearCacheFiles();
}
} else {
form_set_error('html', 'HTML template code error, please check again!!!');
}
}
}
示例6: foreach
function edit_form_validate(&$form, &$form_state)
{
ctools_get_plugins('openlayers', 'layer_types');
$layer = openlayers_layer_type_load($form_state['values']['layer_type']);
$form_state['values']['data'] = $form_state['values'][$form_state['values']['layer_type']];
if (empty($form_state['values']['layer_type'])) {
form_set_error('layer_type', 'Layer type cannot be empty.');
}
$parent = get_parent_class($layer);
$parent_object = new $parent();
$form_state['values']['data'] += $layer->options_init();
$form_state['values']['data'] += $parent_object->options_init();
$layer_types = openlayers_layer_types();
foreach ($layer_types as $layer_type) {
unset($form_state['values'][$layer_type['name']]);
}
unset($form_state['values']['layer_type']);
if (method_exists($layer, 'options_form_validate')) {
$layer->options_form_validate($form, $form_state['values']);
}
parent::edit_form_validate($form, $form_state);
}
示例7: array
/**
* Implements edit_form_submit().
*/
function edit_form_validate(&$form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
if (isset($form_state['values']['stream_op']) && $form_state['values']['stream_op'] == 'add_clone') {
if (empty($form_state['values']['stream_original'])) {
$export_key = $this->plugin['export']['key'];
$element = array('#value' => $form_state['item']->{$export_key}, '#parents' => array($export_key));
form_error($element, t('You need to select a stream to clone from.'));
}
}
}
示例8:
function edit_form_validate(&$form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
// While we short circuited the main validate hook, we need to keep this one.
panels_edit_display_settings_form_validate($form, $form_state);
}
示例9: t
function edit_form_validate(&$form, &$form_state)
{
parent::edit_form_validate($form, $form_state);
// Validate Categories to make sure they don't contain illegal characters.
if (isset($form_state['values']['category'])) {
if (preg_match("/[^A-Za-z0-9 ]/", $form_state['values']['category'])) {
form_error($form['category'], t('Categories may contain only alphanumerics or spaces.'));
}
}
}