本文整理汇总了PHP中ctools_export_crud_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP ctools_export_crud_delete函数的具体用法?PHP ctools_export_crud_delete怎么用?PHP ctools_export_crud_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ctools_export_crud_delete函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveToActiveStore
/**
* Implements Drupal\configuration\Config\Configuration::saveToActiveStore().
*/
public function saveToActiveStore(ConfigIteratorSettings &$settings)
{
ctools_include('export');
$object = ctools_export_crud_load($this->getComponent(), $this->getIdentifier());
if ($object) {
ctools_export_crud_delete($this->getComponent(), $object);
}
$data = $this->getData();
$data->export_type = NULL;
// get title_pane key if configured.
if (isset($data->conf['display']->title_pane)) {
$title_pane = $data->conf['display']->title_pane;
}
$display = panels_save_display($data->conf['display']);
// title_pane configuration workaround.
if (isset($display->content[$title_pane])) {
$pid = $display->content[$title_pane]->pid;
$display->{$title_pane} = $pid;
db_update('panels_display')->fields(array('title_pane' => $pid))->condition('did', $display->did)->execute();
}
$data->conf['did'] = $data->conf['display']->did;
unset($data->conf['display']);
ctools_export_crud_save($this->getComponent(), $data);
$settings->addInfo('imported', $this->getUniqueId());
}
示例2: saveToActiveStore
/**
* Implements Drupal\configuration\Config\Configuration::saveToActiveStore().
*/
public function saveToActiveStore(ConfigIteratorSettings &$settings)
{
ctools_include('export');
$object = ctools_export_crud_load($this->getComponent(), $this->getIdentifier());
if ($object) {
ctools_export_crud_delete($this->getComponent(), $object);
}
$data = $this->getData();
$data->export_type = NULL;
$group = field_group_unpack($data);
ctools_export_crud_save($this->getComponent(), $group);
$settings->addInfo('imported', $this->getUniqueId());
}
示例3: saveToActiveStore
/**
* Implements Drupal\configuration\Config\Configuration::saveToActiveStore().
*/
public function saveToActiveStore(ConfigIteratorSettings &$settings)
{
ctools_include('export');
$object = ctools_export_crud_load($this->getComponent(), $this->getIdentifier());
if ($object) {
ctools_export_crud_delete($this->getComponent(), $object);
}
$data = $this->getData();
$data->export_type = NULL;
panels_save_display($data->conf['display']);
$data->conf['did'] = $data->conf['display']->did;
unset($data->conf['display']);
ctools_export_crud_save($this->getComponent(), $data);
$settings->addInfo('imported', $this->getUniqueId());
}
示例4: delete_page
function delete_page($js, $input, $item)
{
$clone = clone $item;
// Change the name into the title so the form shows the right value.
// @todo file a bug against CTools to use admin title if available.
$clone->name = $clone->title;
$form_state = array('plugin' => $this->plugin, 'object' => &$this, 'ajax' => $js, 'item' => $clone, 'op' => $item->export_type & EXPORT_IN_CODE ? 'revert' : 'delete', 'rerender' => TRUE, 'no_redirect' => TRUE);
$output = drupal_build_form('ctools_export_ui_delete_confirm_form', $form_state);
if (!empty($form_state['executed'])) {
ctools_export_crud_delete($this->plugin['schema'], $item);
$export_key = $this->plugin['export']['key'];
drupal_set_message(t($this->plugin['strings']['confirmation'][$form_state['op']]['success'], array('%title' => $item->title)));
drupal_goto(ctools_export_ui_plugin_base_path($this->plugin));
}
return $output;
}
示例5: delete_form_submit
/**
* Deletes exportable items from the database.
*/
function delete_form_submit(&$form_state)
{
$item = $form_state['item'];
ctools_export_crud_delete($this->plugin['schema'], $item);
$export_key = $this->plugin['export']['key'];
$message = str_replace('%title', check_plain($item->{$export_key}), $this->plugin['strings']['confirmation'][$form_state['op']]['success']);
drupal_set_message($message);
}
示例6: delete_page
/**
* Page callback to delete an exportable item.
*/
function delete_page($js, $input, $item)
{
$form_state = array('plugin' => $this->plugin, 'object' => &$this, 'ajax' => $js, 'item' => $item, 'op' => $item->export_type & EXPORT_IN_CODE ? 'revert' : 'delete', 'rerender' => TRUE, 'no_redirect' => TRUE);
ctools_include('form');
$output = ctools_build_form('ctools_export_ui_delete_confirm_form', $form_state);
if (!empty($form_state['executed'])) {
ctools_export_crud_delete($this->plugin['schema'], $item);
$export_key = $this->plugin['export']['key'];
$message = str_replace('%title', check_plain($item->{$export_key}), $this->plugin['strings']['confirmation'][$form_state['op']]['success']);
drupal_set_message($message);
drupal_goto(ctools_export_ui_plugin_base_path($this->plugin));
}
return $output;
}
示例7: delete_page
/**
* Page callback to delete an exportable item.
*/
function delete_page($js, $input, $item)
{
$form_state = array('plugin' => $this->plugin, 'object' => &$this, 'ajax' => $js, 'item' => $item, 'op' => $item->export_type & EXPORT_IN_CODE ? 'revert' : 'delete', 'rerender' => TRUE, 'no_redirect' => TRUE);
$output = drupal_build_form('ctools_export_ui_delete_confirm_form', $form_state);
if (!empty($form_state['executed'])) {
// Cleanup the stream config and stream from static caches.
heartbeat_stream_config_reset($item);
ctools_export_crud_delete($this->plugin['schema'], $item);
$message = str_replace('%title', check_plain($item->{$this->plugin['export']['key']}), $this->plugin['strings']['confirmation'][$form_state['op']]['success']);
drupal_set_message($message);
// Cleanup the blocks that might be in use.
db_delete('block')->condition('module', 'heartbeat')->condition('delta', $item->class)->execute();
drupal_goto(ctools_export_ui_plugin_base_path($this->plugin));
}
return $output;
}
示例8: revert
/**
* Revert the bean type to code defaults.
*/
public function revert()
{
ctools_include('export');
ctools_export_crud_delete('bean_type', $this->type);
bean_reset();
}