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


PHP panels_get_layout函数代码示例

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


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

示例1: init

 function init($plugin, &$display) {
   $this->plugin = $plugin;
   $this->plugins['layout'] = panels_get_layout($display->layout);
   if (empty($this->plugins['layout'])) {
     watchdog('panels', "Layout: @layout couldn't been found, maybe the theme is disabled.", array('@layout' => $display->layout));
   }
   $this->display = &$display;
 }
开发者ID:neil-chen,项目名称:NeilChen,代码行数:8,代码来源:panels_renderer_legacy.class.php

示例2: ajax_set_layout

 function ajax_set_layout($layout)
 {
     ctools_include('context');
     ctools_include('display-layout', 'panels');
     $form_state = array('layout' => $layout, 'display' => $this->display, 'finish' => t('Save'), 'no_redirect' => TRUE);
     // Reset the $_POST['ajax_html_ids'] values to preserve
     // proper IDs on form elements when they are rebuilt
     // by the Panels IPE without refreshing the page
     $_POST['ajax_html_ids'] = array();
     $output = drupal_build_form('panels_change_layout', $form_state);
     $output = drupal_render($output);
     if (!empty($form_state['executed'])) {
         if (isset($form_state['back'])) {
             return $this->ajax_change_layout();
         }
         if (!empty($form_state['clicked_button']['#save-display'])) {
             // Saved. Save the cache.
             panels_edit_cache_save($this->cache);
             $this->display->skip_cache;
             // Since the layout changed, we have to update these things in the
             // renderer in order to get the right settings.
             $layout = panels_get_layout($this->display->layout);
             $this->plugins['layout'] = $layout;
             if (!isset($layout['regions'])) {
                 $this->plugins['layout']['regions'] = panels_get_regions($layout, $this->display);
             }
             $this->meta_location = 'inline';
             $this->commands[] = ajax_command_replace("#panels-ipe-display-{$this->clean_key}", panels_render_display($this->display, $this));
             $this->commands[] = ctools_modal_command_dismiss();
             return;
         }
     }
     $this->commands[] = ctools_modal_command_display(t('Change layout'), $output);
 }
开发者ID:rexxllabore,项目名称:acme,代码行数:34,代码来源:panels_renderer_ipe.class.php

示例3: panels_ipe_edit_control_form

/**
 * FAPI callback to create the Save/Cancel form for the IPE.
 */
function panels_ipe_edit_control_form(&$form_state)
{
    $display =& $form_state['display'];
    // @todo -- this should be unnecessary as we ensure cache_key is set in add_meta()
    //  $display->cache_key = isset($display->cache_key) ? $display->cache_key : $display->did;
    // Annoyingly, theme doesn't have access to form_state so we have to do this.
    $form['#display'] = $display;
    $layout = panels_get_layout($display->layout);
    $layout_panels = panels_get_regions($layout, $display);
    $form['panel'] = array('#tree' => TRUE);
    $form['panel']['pane'] = array('#tree' => TRUE);
    foreach ($layout_panels as $panel_id => $title) {
        // Make sure we at least have an empty array for all possible locations.
        if (!isset($display->panels[$panel_id])) {
            $display->panels[$panel_id] = array();
        }
        $form['panel']['pane'][$panel_id] = array('#type' => 'hidden', '#default_value' => implode(',', (array) $display->panels[$panel_id]));
    }
    $form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save'), '#id' => 'panels-ipe-save', '#submit' => array('panels_edit_display_form_submit'), '#save-display' => TRUE);
    $form['buttons']['cancel'] = array('#type' => 'submit', '#value' => t('Cancel'), '#id' => 'panels-ipe-cancel');
    return $form;
}
开发者ID:CalvinZhu,项目名称:boinc,代码行数:25,代码来源:panels_renderer_ipe.class.php

示例4: init

 /**
  * Receive and store the display object to be rendered.
  *
  * This is a psuedo-constructor that should typically be called immediately
  * after object construction.
  *
  * @param array $plugin
  *   The definition of the renderer plugin.
  * @param panels_display $display
  *   The panels display object to be rendered.
  */
 function init($plugin, &$display)
 {
     $this->plugin = $plugin;
     $layout = panels_get_layout($display->layout);
     $this->display =& $display;
     $this->plugins['layout'] = $layout;
     if (!isset($layout['regions'])) {
         $this->plugins['layout']['regions'] = panels_get_regions($layout, $display);
     }
     if (empty($this->plugins['layout'])) {
         watchdog('panels', "Layout: @layout couldn't been found, maybe the theme is disabled.", array('@layout' => $display->layout));
     }
 }
开发者ID:nickveenhof,项目名称:drupalcamp-2015,代码行数:24,代码来源:panels_renderer_standard.class.php

示例5: edit_form

 function edit_form(&$form, &$form_state)
 {
     ctools_include('plugins', 'panels');
     // If the plugin is not set, then it should be provided as an argument:
     if (!isset($form_state['item']->plugin)) {
         $form_state['item']->plugin = $form_state['function args'][2];
     }
     parent::edit_form($form, $form_state);
     $form['category'] = array('#type' => 'textfield', '#title' => t('Category'), '#description' => t('What category this layout should appear in. If left blank the category will be "Miscellaneous".'), '#default_value' => $form_state['item']->category);
     ctools_include('context');
     ctools_include('display-edit', 'panels');
     ctools_include('content');
     // Provide actual layout admin UI here.
     // Create a display for editing:
     $cache_key = 'builder-' . $form_state['item']->name;
     // Load the display being edited from cache, if possible.
     if (!empty($_POST) && is_object($cache = panels_edit_cache_get($cache_key))) {
         $display =& $cache->display;
     } else {
         $content_types = ctools_content_get_available_types();
         panels_cache_clear('display', $cache_key);
         $cache = new stdClass();
         $display = panels_new_display();
         $display->did = $form_state['item']->name;
         $display->layout = $form_state['item']->plugin;
         $display->layout_settings = $form_state['item']->settings;
         $display->cache_key = $cache_key;
         $display->editing_layout = TRUE;
         $cache->display = $display;
         $cache->content_types = $content_types;
         $cache->display_title = FALSE;
         panels_edit_cache_set($cache);
     }
     // Set up lipsum content in all of the existing panel regions:
     $display->content = array();
     $display->panels = array();
     $custom = ctools_get_content_type('custom');
     $layout = panels_get_layout($display->layout);
     $regions = panels_get_regions($layout, $display);
     foreach ($regions as $id => $title) {
         $pane = panels_new_pane('custom', 'custom');
         $pane->pid = $id;
         $pane->panel = $id;
         $pane->configuration = ctools_content_get_defaults($custom, 'custom');
         $pane->configuration['title'] = 'Lorem Ipsum';
         $pane->configuration['body'] = $this->lipsum;
         $display->content[$id] = $pane;
         $display->panels[$id] = array($id);
     }
     $form_state['display'] =& $display;
     // Tell the Panels form not to display buttons.
     $form_state['no buttons'] = TRUE;
     $form_state['no display settings'] = TRUE;
     $form_state['cache_key'] = $cache_key;
     $form_state['content_types'] = $cache->content_types;
     $form_state['display_title'] = FALSE;
     $form_state['renderer'] = panels_get_renderer_handler('editor', $cache->display);
     $form_state['renderer']->cache =& $cache;
     $form = panels_edit_display_form($form, $form_state);
     // If we leave the standard submit handler, it'll try to reconcile
     // content from the input, but we've not exposed that to the user. This
     // makes previews work with the content we forced in.
     $form['preview']['button']['#submit'] = array('panels_edit_display_form_preview');
 }
开发者ID:odsherred,项目名称:subsites.odsherred.dk,代码行数:64,代码来源:panels_layouts_ui.class.php

示例6: panels_edit_configure_pane_lock_form

/**
 * Configure lock on a pane form.
 */
function panels_edit_configure_pane_lock_form($form, &$form_state)
{
    ctools_form_include($form_state, 'plugins', 'panels');
    form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class');
    $display =& $form_state['display'];
    $pane =& $form_state['pane'];
    if (empty($pane->locks)) {
        $pane->locks = array('type' => 'none', 'regions' => array());
    }
    $form['type'] = array('#type' => 'radios', '#title' => t('Lock type'), '#options' => array('none' => t('No lock'), 'immovable' => t('Immovable'), 'regions' => t('Regions')), '#default_value' => $pane->locks['type']);
    $layout = panels_get_layout($display->layout);
    $regions = panels_get_regions($layout, $display);
    $form['regions'] = array('#type' => 'checkboxes', '#title' => t('Regions'), '#options' => $regions, '#description' => t('Select which regions this pane can be moved to.'), '#dependency' => array('radio:type' => array('regions')), '#default_value' => $pane->locks['regions']);
    $form['#after_build'][] = 'panels_edit_configure_pane_lock_form_after_build';
    $form['next'] = array('#type' => 'submit', '#value' => t('Save'));
    return $form;
}
开发者ID:casivaagustin,项目名称:drupal-services,代码行数:20,代码来源:panels_renderer_editor.class.php


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