當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ctools_export_ui::build_operations方法代碼示例

本文整理匯總了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;
 }
開發者ID:michael-wojcik,項目名稱:open_eggheads,代碼行數:14,代碼來源:fieldable_panels_pane.class.php

示例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;
 }
開發者ID:ehallarsis,項目名稱:smvp,代碼行數:42,代碼來源:ultimate_cron_job_ctools_export_ui.class.php


注:本文中的ctools_export_ui::build_operations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。