本文整理汇总了PHP中ctools_export_ui::build_operations方法的典型用法代码示例。如果您正苦于以下问题:PHP ctools_export_ui::build_operations方法的具体用法?PHP ctools_export_ui::build_operations怎么用?PHP ctools_export_ui::build_operations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctools_export_ui
的用法示例。
在下文中一共展示了ctools_export_ui::build_operations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Add some additional operations for handling entities.
*/
function build_operations($item)
{
$base_path = ctools_export_ui_plugin_base_path($this->plugin);
$name = $item->{$this->plugin['export']['key']};
$operations['list'] = array('title' => t('List'), 'href' => $base_path . '/' . $name . '/list');
$operations['add_entity'] = array('title' => t('Add Entity'), 'href' => $base_path . '/' . $name . '/add');
$operations += parent::build_operations($item);
$operations['field'] = array('title' => t('Manage Fields'), 'href' => $base_path . '/' . $name . '/fields');
$operations['display'] = array('title' => t('Manage Display'), 'href' => $base_path . '/' . $name . '/display');
return $operations;
}
示例2: build_operations
/**
* Ensure that we cannot clone from the operations link list.
*/
public function build_operations($item)
{
$item->lock_id = isset($item->lock_id) ? $item->lock_id : $item->isLocked();
$allowed_operations = parent::build_operations($item);
unset($allowed_operations['clone']);
if ($item->lock_id) {
unset($allowed_operations['run']);
$allowed_operations['unlock']['href'] .= '/' . $item->lock_id;
} else {
unset($allowed_operations['unlock']);
}
if (!empty($item->hook['configure'])) {
$allowed_operations['configure'] = array('title' => t('Configure'), 'href' => $item->hook['configure']);
}
if (!empty($item->hook['immutable'])) {
unset($allowed_operations['edit']);
unset($allowed_operations['disable']);
unset($allowed_operations['enable']);
unset($allowed_operations['export']);
}
if (variable_get('maintenance_mode', 0)) {
unset($allowed_operations['run']);
}
$item->build_operations_alter($allowed_operations);
$default_sort = array('logs' => -10, 'edit' => -2, 'enable' => -1, 'disable' => -1, 'run' => 0, 'unlock' => 0, 'export' => 1, 'configure' => 1);
$weight = 0;
$this->notoken = TRUE;
foreach ($allowed_operations as $name => &$operation) {
if (!$this->access($name, $item)) {
unset($allowed_operations[$name]);
continue;
}
$operation += array('sort' => array(isset($default_sort[$name]) ? $default_sort[$name] : 0), 'alias' => TRUE);
$operation['sort'][] = $weight++;
}
unset($this->notoken);
uasort($allowed_operations, '_ultimate_cron_multi_column_sort');
return $allowed_operations;
}