當前位置: 首頁>>代碼示例>>PHP>>正文


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怎麽用?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.'));
     }
 }
開發者ID:neclimdul,項目名稱:panels,代碼行數:10,代碼來源:panels_mini_ui.class.php

示例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);
     }
 }
開發者ID:ehazell,項目名稱:AWBA,代碼行數:13,代碼來源:delta_export_ui.class.php

示例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.');
     }
 }
開發者ID:redponey,項目名稱:openatrium-7.x-2.51,代碼行數:16,代碼來源:mailhandler_mailbox_ui.class.php

示例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)));
     }
 }
開發者ID:ayavuzerdogan,項目名稱:thinkloud,代碼行數:18,代碼來源:ctools_export_ui_heartbeat_plugin.class.php

示例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!!!');
         }
     }
 }
開發者ID:vermauv,項目名稱:movieza,代碼行數:18,代碼來源:ZMTemplateUI.class.php

示例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);
 }
開發者ID:EarthTeam,項目名稱:earthteam.net,代碼行數:22,代碼來源:openlayers_layers_ui.class.php

示例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.'));
         }
     }
 }
開發者ID:ayavuzerdogan,項目名稱:thinkloud,代碼行數:14,代碼來源:ctools_export_ui_heartbeat_stream.class.php

示例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);
 }
開發者ID:padmanabhan-developer,項目名稱:Norway-GO,代碼行數:6,代碼來源:panels_layouts_ui.class.php

示例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.'));
         }
     }
 }
開發者ID:anatolic,項目名稱:vintage,代碼行數:10,代碼來源:panels_frame_ui.class.php


注:本文中的ctools_export_ui::edit_form_validate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。