本文整理汇总了PHP中ctools_export_ui::list_form_submit方法的典型用法代码示例。如果您正苦于以下问题:PHP ctools_export_ui::list_form_submit方法的具体用法?PHP ctools_export_ui::list_form_submit怎么用?PHP ctools_export_ui::list_form_submit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctools_export_ui
的用法示例。
在下文中一共展示了ctools_export_ui::list_form_submit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
/**
* Overrides ctools_export_ui::list_form_submit().
*/
function list_form_submit(&$form, &$form_state)
{
// Add the subqueue_id and the number of items for 'single' queues, and the
// number of subqueues for the rest.
// @todo This is quite inefficient to do here but ctools_export_load_object()
// doesn't help us.
if (!empty($this->items)) {
foreach ($this->items as $name => $queue) {
$this->items[$name]->subitems = 0;
}
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', $this->entityType)->entityCondition('bundle', array_keys($this->items), 'IN');
$result = $query->execute();
if (!empty($result[$this->entityType])) {
$handlers = ctools_get_plugins('entityqueue', 'handler');
$subqueues_to_load = array();
foreach ($result[$this->entityType] as $name => $subqueue) {
// Add the number of subqueues first.
$this->items[$subqueue->queue]->subitems += 1;
// If this subqueue's bundle is a 'single' queue, load it so we can get
// its number of items.
if ($handlers[$this->items[$subqueue->queue]->handler]['queue type'] == 'single') {
$subqueues_to_load[] = $subqueue->subqueue_id;
}
}
if (!empty($subqueues_to_load)) {
$subqueues = entity_load($this->entityType, $subqueues_to_load);
foreach ($subqueues as $subqueue) {
$field_items = field_get_items($this->entityType, $subqueue, _entityqueue_get_target_field_name($this->items[$subqueue->queue]->target_type));
$this->items[$subqueue->queue]->subitems = $field_items ? count($field_items) : 0;
$this->items[$subqueue->queue]->subqueue_id = $subqueue->subqueue_id;
}
}
}
}
parent::list_form_submit($form, $form_state);
}