本文整理汇总了PHP中ctools_export_ui类的典型用法代码示例。如果您正苦于以下问题:PHP ctools_export_ui类的具体用法?PHP ctools_export_ui怎么用?PHP ctools_export_ui使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ctools_export_ui类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Overrides ctools_export_ui::edit_save_form().
*
* Clear menu cache in case the SPARQL endpoint path was modified.
*/
function edit_save_form($form_state)
{
parent::edit_save_form($form_state);
if (!empty($form_state['plugin']['schema']) && $form_state['plugin']['schema'] == 'arc2_store_settings') {
menu_rebuild();
}
}
示例2:
/**
* Overrides ctools_export_ui::list_form().
*
* Simplifies the form similar to how the Context module does it.
*/
function list_form(&$form, &$form_state)
{
parent::list_form($form, $form_state);
$form['top row']['submit'] = $form['bottom row']['submit'];
$form['top row']['reset'] = $form['bottom row']['reset'];
$form['bottom row']['#access'] = FALSE;
return;
}
示例3: edit_form
/**
* Include some ctools stuff required for drupal ajax to work properly.
* @see ctools_export_ui::edit_form()
*/
public function edit_form(&$form, &$form_state)
{
// This is needed in order to get the ajax working in the ctools form.
ctools_include('plugins');
ctools_include('export');
ctools_get_plugins('ctools', 'export_ui', 'entity_collection');
parent::edit_form($form, $form_state);
// We need to define our own function, the one provided by ctools does not
// work with the Drupal ajax API.
$form['info']['name']['#machine_name']['exists'] = 'entity_collection_bundle_exists';
}
示例4:
function list_filter($form_state, $item)
{
if ($form_state['values']['category'] != 'all' && $form_state['values']['category'] != $item->category) {
return TRUE;
}
return parent::list_filter($form_state, $item);
}
示例5: array
/**
* Adding or editing snippet
* @param $form
* @param $form_state
*/
function edit_form(&$form, &$form_state)
{
// this is to show the preview
$form['snippet_preview_wrapper'] = array('#prefix' => '<div id="snippet_preview">', '#suffix' => '</div>', '#markup' => '');
// adding parent element
parent::edit_form($form, $form_state);
if ($form_state['form type'] == 'clone') {
$default_snippet = $this->load_item($form_state['original name']);
} elseif ($form_state['form type'] == 'add') {
$default_snippet = $form_state['item'];
$default_snippet->rid = NULL;
$default_snippet->content = '';
} else {
$default_snippet = $form_state['item'];
}
// Needs to disable the admin_tile and name (machine name) fields
// and delete button for editing snippet
if ($form_state['op'] == 'edit') {
$form['info']['admin_title']['#disabled'] = TRUE;
$form['info']['name']['#disabled'] = TRUE;
$form['buttons']['delete']['#access'] = FALSE;
}
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#description' => t('Title for the textarea-exportible.'), '#default_value' => $default_snippet->rid ? $default_snippet->title_revision : $default_snippet->title);
$form['content'] = array('#type' => 'text_format', '#title' => t('Content'), '#description' => t('Description of this snippet.'), '#default_value' => $default_snippet->content, '#format' => @$default_snippet->content_format);
$form['preview'] = array('#type' => 'button', '#limit_validation_errors' => array(), '#value' => t('Preview'), '#submit' => array('snippet_build_preview'), '#ajax' => array('callback' => 'snippet_form_build_preview_callback', 'wrapper' => 'snippet_preview'), '#weight' => 101);
}
示例6: array
/**
* Provide the actual editing form.
*/
function edit_form(&$form, &$form_state)
{
parent::edit_form($form, $form_state);
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#description' => t('A human-readable title for the provider.'), '#size' => 32, '#maxlength' => 255, '#required' => TRUE, '#default_value' => $form_state['item']->title);
$form['endpoint'] = array('#type' => 'textfield', '#title' => t('Endpoint'), '#description' => t('The endpoint where OEmbed requests are going to be sent.'), '#size' => 32, '#maxlength' => 255, '#required' => TRUE, '#default_value' => $form_state['item']->endpoint);
$form['scheme'] = array('#type' => 'textarea', '#title' => t('Schemes'), '#description' => t('Newline separated list of schemes like !example', array('!example' => 'http://*.revision3.com/*')), '#required' => TRUE, '#default_value' => $form_state['item']->scheme);
}
示例7:
function hook_menu(&$items)
{
// Change the item to a tab on the fb_social configuration page.
$this->plugin['menu']['items']['list callback']['type'] = MENU_LOCAL_TASK;
$this->plugin['menu']['items']['list callback']['weight'] = 10;
parent::hook_menu($items);
}
示例8:
/**
* Create the filter/sort form at the top of a list of exports.
*/
function list_form(&$form, &$form_state)
{
// Put a wrapper around the form so it can be hidden. Unsetting the form
// rows or doing nothing here doesn't seem to do the trick.
parent::list_form($form, $form_state);
$form['#prefix'] = '<div class="finder-ui-list-wrapper">' . $form['#prefix'];
$form['#suffix'] = $form['#prefix'] . '</div>';
}
示例9:
/**
* Remove fields associated to bundles that are being deleted.
*/
function delete_form_submit(&$form_state)
{
parent::delete_form_submit($form_state);
if ($form_state['op'] == 'delete') {
field_attach_delete_bundle('fieldable_panels_pane', $form_state['item']->name);
entity_info_cache_clear();
}
}
示例10: time
function edit_form_submit(&$form, &$form_state)
{
$form_state["values"]['changed'] = time();
parent::edit_form_submit($form, $form_state);
$template_code = $form_state["values"]['html'];
$item = $form_state['item'];
zm_template_save_template($template_code, $item->name);
}
示例11: serialize
/**
* Prepare the tag values before they are added to the database.
*/
function edit_form_submit(&$form, &$form_state)
{
$settings = $form_state['values']['settings'];
// Since the targeting form is reusable it isn't already in the settings
// array so we grab it here.
$settings['targeting'] = $form_state['values']['targeting'];
$form_state['values']['settings'] = serialize($settings);
parent::edit_form_submit($form, $form_state);
}
示例12: array
function edit_form_submit(&$form, &$form_state)
{
parent::edit_form_submit($form, $form_state);
if (module_exists('mailhandler_default')) {
drupal_set_message(t("Now that you've created a mailbox, send it a test email and try to <a href='@import-page'>create a source node</a> to start importing messages.", array('@import-page' => url('node/add/mailhandler-source'))));
} else {
drupal_set_message(t("Now that you've created a mailbox, you'll need to <a href='@importer-add'>create a Feeds importer</a> or <a href='@import-page'>run an existing importer</a>. Consider <a href='@module-page'>enabling the Mailhandler quick-start</a> module.", array('@importer-add' => url(MAILHANDLER_MENU_PREFIX . '/feeds/add'), '@import-page' => url('import'), '@module-page' => url('admin/modules'))));
}
}
示例13:
function list_form(&$form, &$form_state)
{
parent::list_form($form, $form_state);
$form['top row']['submit'] = $form['bottom row']['submit'];
$form['top row']['reset'] = $form['bottom row']['reset'];
$form['bottom row']['#access'] = FALSE;
// Invalidate the context cache.
context_invalidate_cache();
return;
}
示例14: substr
function edit_form_submit($form, &$form_state) {
parent::edit_form_submit($form, $form_state);
$type = substr($form_state['values']['service_charge'], -1) == '%' ? 'percentage' : 'price';
$amount = str_replace(array('%', '='), '', $form_state['values']['service_charge']);
$form_state['item']->data = array(
'service_charge' => trim($amount),
'service_charge_type' => $type,
'service_charge_title' => $form_state['values']['service_charge_title'],
);
}
示例15: array
/**
* Provide a list of sort options.
*/
function list_sort_options() {
$options = parent::list_sort_options();
$options += array(
'width' => t('Width'),
'height' => t('Height'),
);
return $options;
}