当前位置: 首页>>代码示例>>PHP>>正文


PHP ctools_export_get_schema函数代码示例

本文整理汇总了PHP中ctools_export_get_schema函数的典型用法代码示例。如果您正苦于以下问题:PHP ctools_export_get_schema函数的具体用法?PHP ctools_export_get_schema怎么用?PHP ctools_export_get_schema使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ctools_export_get_schema函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     $this->rows[$name]['data'][] = array('data' => check_plain($item->name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->size), 'class' => array('ctools-export-ui-size'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->block) ? t('Yes') : t('No'), 'class' => array('ctools-export-ui-block'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
 }
开发者ID:pchop2,项目名称:drupal_dfp,代码行数:32,代码来源:dfp_tag_ui.class.php

示例2: list_build_row

 public function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->name;
     $schema = ctools_export_get_schema($this->plugin['schema']);
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = $item->weight;
             break;
         case 'disabled_title':
             $this->sorts[$name] = empty($item->disabled) . $item->admin_title;
             break;
         case 'title':
             $this->sorts[$name] = $item->admin_title;
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $role_list = $this->buildRoleList($item->role_rids);
     $this->rows[$name] = array('data' => array(array('data' => check_plain($item->admin_title), 'class' => array('ctools-export-ui-title')), array('data' => check_plain($name), 'class' => array('ctools-export-ui-name')), array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage')), array('data' => check_plain($role_list), 'class' => array('ctools-export-ui-roles')), array('data' => check_plain($item->weight), 'class' => array('ctools-export-ui-weight')), array('data' => $ops, 'class' => array('ctools-export-ui-operations'))), 'class' => array(!empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled'));
 }
开发者ID:Probo-Demos,项目名称:drupal_github,代码行数:26,代码来源:linkit_profiles_ui.class.php

示例3: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Warn users if network id has no value. This can happen immediatly after
     // the module is installed.
     if (variable_get('dfp_network_id', '') == '') {
         drupal_set_message(t('DFP ad tags will not work until you have <a href="/admin/structure/dfp_ads/settings">set your network id</a> as provided by Google.'), 'warning', FALSE);
     }
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     $this->rows[$name]['data'][] = array('data' => check_plain($item->slot), 'class' => array('ctools-export-ui-slot'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->size), 'class' => array('ctools-export-ui-size'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->block) ? t('Yes') : t('No'), 'class' => array('ctools-export-ui-block'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
 }
开发者ID:charlie59,项目名称:etypegoogle2.com,代码行数:37,代码来源:dfp_tag_ui.class.php

示例4: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 public function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting.
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     list($plugin_manager, $plugin_id) = explode(':', $item->factory_service);
     list($module, $plugin_type) = explode('.', $plugin_manager);
     // Note: $item->{$schema['export']['export type string']} should have
     // already been set up by export.inc so we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'class':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     switch ($item->type) {
         case t('Default'):
         default:
             $type = t('In code');
             break;
         case t('Normal'):
             $type = t('In database');
             break;
         case t('Overridden'):
             $type = t('Database overriding code');
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->factory_service), 'class' => array('ctools-export-ui-service'));
     $this->rows[$name]['data'][] = array('data' => $type, 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:akapivo,项目名称:www.dmi.be,代码行数:60,代码来源:OpenlayersObjects.php

示例5: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 public function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting.
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     list($plugin_manager, $plugin_id) = explode(':', $item->factory_service);
     list($module, $plugin_type) = explode('.', $plugin_manager);
     $object = \Drupal\openlayers\Openlayers::load($plugin_type, $item->machine_name);
     // Note: $item->{$schema['export']['export type string']} should have
     // already been set up by export.inc so we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'class':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     // Generate a map and use the style on it to make a preview.
     $map = Openlayers::load('map', 'openlayers_ui_map_style_demo');
     foreach ($map->getCollection()->getFlatList(array('layer')) as $layer) {
         $layer->setStyle($object);
         $map->getCollection()->import(array($layer));
     }
     $map_build = $map->build();
     $map_render = drupal_render($map_build);
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     $this->rows[$name]['data'][] = array('data' => $map_render, 'class' => array('ctools-export-ui-title'));
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->factory_service), 'class' => array('ctools-export-ui-service'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:josemrc,项目名称:ae2web,代码行数:59,代码来源:OpenlayersStyles.php

示例6: save

 /**
  * Save the picture mapping.
  *
  * @return
  *   If the record insert or update failed, returns FALSE. If it succeeded,
  *   returns SAVED_NEW or SAVED_UPDATED, depending on the operation performed.
  */
 public function save()
 {
     $update = array();
     $this->cleanMappings();
     $data = $this->toArray();
     if (isset($this->id) && $this->id) {
         $update = array('id');
         $data['id'] = $this->id;
     }
     $return = drupal_write_record('picture_mapping', $data, $update);
     $this->setValues(ctools_export_get_schema('picture_mapping'), $data);
     $this->loadBreakpointGroup();
     return $return;
 }
开发者ID:ishoj,项目名称:ishoj.dk,代码行数:21,代码来源:PictureMapping.php

示例7: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $layers_types = openlayers_layer_types();
     $this->rows[$name]['data'][] = array('data' => $item->title, 'class' => array('ctools-export-ui-title'));
     $this->rows[$name]['data'][] = array('data' => $layers_types[$item->data['layer_type']]['title'], 'class' => array('ctools-export-ui-layer-type'));
     $this->rows[$name]['data'][] = array('data' => $item->description, 'class' => array('ctools-export-ui-description'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     // This should be in the module openlayers_views, but I'm still looking
     // for a solution to do it properly.
     if ($item->data['layer_type'] == 'openlayers_views_vector') {
         $operations['edit']['href'] = 'admin/structure/views/view/' . $item->data['views']['view'] . '/edit/' . $item->data['views']['display'];
         $operations['disable']['href'] = 'admin/structure/views/view/' . $item->data['views']['view'] . '/disable/' . $item->data['views']['display'];
         $operations['clone']['href'] = 'admin/structure/views/view/' . $item->data['views']['view'] . '/clone/' . $item->data['views']['display'];
         $operations['export']['href'] = 'admin/structure/views/view/' . $item->data['views']['view'] . '/export/' . $item->data['views']['display'];
     }
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:brainsum,项目名称:memosaic,代码行数:54,代码来源:openlayers_layers_ui.class.php

示例8: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     dsm($item);
     $instance = is_object($item->data) ? $item->data : (object) unserialize($item->data);
     $visibility = array(t('Show on every page except the listed pages.'), t('Show on only the listed pages.'));
     $pages = $instance->pages != substr($instance->pages, 0, 40) ? substr($instance->pages, 0, 40) . '...' : substr($instance->pages, 0, 40);
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     // Show element, style, visibility and pages.
     $this->rows[$name]['data'][] = array('data' => check_plain($instance->element));
     $this->rows[$name]['data'][] = array('data' => check_plain($instance->style));
     $this->rows[$name]['data'][] = array('data' => $visibility[$instance->visibility]);
     $this->rows[$name]['data'][] = array('data' => check_plain($pages));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:newswim,项目名称:dkan-drops-7,代码行数:52,代码来源:beautytips_instance_export_ui.class.php

示例9: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     // Load Custom Formatters engines.
     $engines = module_invoke_all('custom_formatters_engine_info');
     // Hide Formatters using missing engines.
     if (!isset($engines[$item->mode])) {
         unset($this->row);
         return;
     }
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($engines[$item->mode]['label']), 'class' => array('ctools-export-ui-format'));
     $this->rows[$name]['data'][] = array('data' => !empty($item->fapi) && drupal_strlen($item->fapi) > 17 ? t('Yes') : t('No'), 'class' => array('ctools-export-ui-fapi'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:kreynen,项目名称:elmsln,代码行数:52,代码来源:custom_formatters_ui.class.php

示例10: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // Add the icon as an image in the row if it exists.
     if (isset($item->data['externalGraphic'])) {
         $style = theme('image', array('path' => $item->data['externalGraphic']));
     } else {
         $style = openlayers_ui_style_preview($item);
     }
     $this->rows[$name]['data'][] = array('data' => $style, 'class' => array('ctools-export-ui-preview'));
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => $item->title, 'class' => array('ctools-export-ui-title'));
     $this->rows[$name]['data'][] = array('data' => $item->description, 'class' => array('ctools-export-ui-description'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:brainsum,项目名称:memosaic,代码行数:51,代码来源:openlayers_styles_ui.class.php

示例11: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $layers = openlayers_layers_load();
     foreach ($item->data['layers'] as $layer) {
         $layers_names[] = empty($layers[$layer]->title) ? $layer : filter_xss_admin($layers[$layer]->title);
     }
     sort($layers_names);
     $layers_names = implode(',', $layers_names);
     $this->rows[$name]['data'][] = array('data' => $item->title, 'class' => array('ctools-export-ui-title'));
     $this->rows[$name]['data'][] = array('data' => $layers_names, 'class' => array('ctools-export-ui-layers'));
     $this->rows[$name]['data'][] = array('data' => $item->description, 'class' => array('ctools-export-ui-description'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:brainsum,项目名称:memosaic,代码行数:51,代码来源:openlayers_maps_ui.class.php

示例12: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'weight':
             $this->sorts[$name] = $item->weight;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     // Add the draggable class.
     $this->rows[$name]['class'] = array('draggable');
     $this->rows[$name]['class'][] = !empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled';
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     $ops = theme('links__ctools_dropbutton', array('links' => $operations, 'attributes' => array('class' => array('links', 'inline'))));
     // Add the order column. This is only a placeholder replaced later in the form theme function.
     $this->rows[$name]['data'][] = array('data' => check_plain($item->weight));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:JacksonRiver,项目名称:springboard_modules,代码行数:50,代码来源:springboard_tag_export_ui.class.php

示例13: list_build_row

 /**
  * Build a row based on the item.
  *
  * By default all of the rows are placed into a table by the render
  * method, so this is building up a row suitable for theme('table').
  * This doesn't have to be true if you override both.
  */
 function list_build_row($item, &$form_state, $operations)
 {
     // Set up sorting
     $name = $item->{$this->plugin['export']['key']};
     $schema = ctools_export_get_schema($this->plugin['schema']);
     // Note: $item->{$schema['export']['export type string']} should have already been set up by export.inc so
     // we can use it safely.
     switch ($form_state['values']['order']) {
         case 'disabled':
             $this->sorts[$name] = empty($item->disabled) . $name;
             break;
         case 'title':
             $this->sorts[$name] = $item->{$this->plugin['export']['admin_title']};
             break;
         case 'name':
             $this->sorts[$name] = $name;
             break;
         case 'storage':
             $this->sorts[$name] = $item->{$schema['export']['export type string']} . $name;
             break;
     }
     $this->rows[$name]['data'] = array();
     $this->rows[$name]['class'] = !empty($item->disabled) ? array('ctools-export-ui-disabled') : array('ctools-export-ui-enabled');
     // If we have an admin title, make it the first row.
     if (!empty($this->plugin['export']['admin_title'])) {
         $this->rows[$name]['data'][] = array('data' => check_plain($item->{$this->plugin['export']['admin_title']}), 'class' => array('ctools-export-ui-title'));
     }
     $this->rows[$name]['data'][] = array('data' => check_plain($name), 'class' => array('ctools-export-ui-name'));
     $this->rows[$name]['data'][] = array('data' => check_plain($item->{$schema['export']['export type string']}), 'class' => array('ctools-export-ui-storage'));
     // To display whether this has any description
     $snippet = $this->load_item($name);
     $label = "No";
     if ($snippet->rid) {
         $label = 'Yes';
     }
     $this->rows[$name]['data'][] = array('data' => $label, 'class' => array('ctools-export-ui-title'));
     // short down the list of operation as per permission
     $snippet_operations = array();
     foreach ($operations as $key => $value) {
         $do_list = $key == 'enable' || $key == 'disable' ? TRUE : $this->access($key, $item);
         if ($do_list) {
             $snippet_operations[$key] = $value;
         }
     }
     $ops = theme('links__ctools_dropbutton', array('links' => $snippet_operations, 'attributes' => array('class' => array('links', 'inline'))));
     $this->rows[$name]['data'][] = array('data' => $ops, 'class' => array('ctools-export-ui-operations'));
     // Add an automatic mouseover of the description if one exists.
     if (!empty($this->plugin['export']['admin_description'])) {
         $this->rows[$name]['title'] = $item->{$this->plugin['export']['admin_description']};
     }
 }
开发者ID:sharprakeshverma,项目名称:LifeStyle,代码行数:58,代码来源:snippet_ctools_export_ui.class.php

示例14: edit_form_submit

 /**
  * Handle the submission of the edit form.
  *
  * At this point, submission is successful. Our only responsibility is
  * to copy anything out of values onto the item that we are able to edit.
  *
  * If the keys all match up to the schema, this method will not need to be
  * overridden.
  */
 function edit_form_submit(&$form, &$form_state)
 {
     if (!empty($this->plugin['form']['submit'])) {
         // Pass $form by reference.
         $this->plugin['form']['submit']($form, $form_state);
     }
     // Transfer data from the form to the $item based upon schema values.
     $schema = ctools_export_get_schema($this->plugin['schema']);
     foreach (array_keys($schema['fields']) as $key) {
         if (isset($form_state['values'][$key])) {
             $form_state['item']->{$key} = $form_state['values'][$key];
         }
     }
 }
开发者ID:kennygrage,项目名称:dynastyDish,代码行数:23,代码来源:ctools_export_ui.class.php

示例15: list_form_submit

 /**
  * Submit the filter/sort form.
  *
  * This submit handler is actually responsible for building up all of the
  * rows that will later be rendered, since it is doing the filtering and
  * sorting.
  *
  * For the most part, you should not need to override this method, as the
  * fiddly bits call through to other functions.
  */
 function list_form_submit(&$form, &$form_state)
 {
     // Filter and re-sort the pages.
     $plugin = $this->plugin;
     $schema = ctools_export_get_schema($this->plugin['schema']);
     $prefix = ctools_export_ui_plugin_base_path($plugin);
     foreach ($this->items as $name => $item) {
         // Call through to the filter and see if we're going to render this
         // row. If it returns TRUE, then this row is filtered out.
         if ($this->list_filter($form_state, $item)) {
             continue;
         }
         // Note: Creating this list seems a little clumsy, but can't think of
         // better ways to do this.
         $allowed_operations = drupal_map_assoc(array_keys($plugin['allowed operations']));
         //Cannot find the code that returns the list of possible operations, so I'm going to add extras here, which is not neat.
         //$allowed_operations['edit terms'] = 'edit terms';
         $not_allowed_operations = array('import');
         if ($item->{$schema['export']['export type string']} == t('Normal')) {
             $not_allowed_operations[] = 'revert';
         } elseif ($item->{$schema['export']['export type string']} == t('Overridden')) {
             $not_allowed_operations[] = 'delete';
         } else {
             $not_allowed_operations[] = 'revert';
             $not_allowed_operations[] = 'delete';
         }
         //$not_allowed_operations[] = empty($item->disabled) ? 'enable' : 'disable';
         //Forcing 'disable' and 'enable' to be disabled always. This should be done in the install schema with 'can disable' => FALSE, but that would
         //mean reinstalling the module and I don't think it works properly.
         $not_allowed_operations[] = 'disable';
         $not_allowed_operations[] = 'enable';
         foreach ($not_allowed_operations as $op) {
             // Remove the operations that are not allowed for the specific
             // exportable.
             unset($allowed_operations[$op]);
         }
         $operations = array();
         foreach ($allowed_operations as $op) {
             $operations[$op] = array('title' => $plugin['allowed operations'][$op]['title'], 'href' => ctools_export_ui_plugin_menu_path($plugin, $op, $name));
             if (!empty($plugin['allowed operations'][$op]['ajax'])) {
                 $operations[$op]['attributes'] = array('class' => array('use-ajax'));
             }
             if (!empty($plugin['allowed operations'][$op]['token'])) {
                 $operations[$op]['query'] = array('token' => drupal_get_token($op));
             }
         }
         $this->list_build_row($item, $form_state, $operations);
     }
     // Now actually sort
     if ($form_state['values']['sort'] == 'desc') {
         arsort($this->sorts);
     } else {
         asort($this->sorts);
     }
     // Nuke the original.
     $rows = $this->rows;
     $this->rows = array();
     // And restore.
     foreach ($this->sorts as $name => $title) {
         $this->rows[$name] = $rows[$name];
     }
 }
开发者ID:johnedelatorre,项目名称:fusion,代码行数:72,代码来源:term_queue_export_ui.class.php


注:本文中的ctools_export_get_schema函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。