本文整理匯總了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);
}