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


PHP panels_get_style函数代码示例

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


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

示例1: render_pane

 /**
  * Render a pane using its designated style.
  *
  * This method also manages 'title pane' functionality, where the title from
  * an individual pane can be bubbled up to take over the title for the entire
  * display.
  *
  * @param stdClass $pane
  *  A Panels pane object, as loaded from the database.
  */
 function render_pane(&$pane)
 {
     $content = $this->render_pane_content($pane);
     if ($this->display->hide_title == PANELS_TITLE_PANE && !empty($this->display->title_pane) && $this->display->title_pane == $pane->pid) {
         // If the user selected to override the title with nothing, and selected
         // this as the title pane, assume the user actually wanted the original
         // title to bubble up to the top but not actually be used on the pane.
         if (empty($content->title) && !empty($content->original_title)) {
             $this->display->stored_pane_title = $content->original_title;
         } else {
             $this->display->stored_pane_title = !empty($content->title) ? $content->title : '';
         }
     }
     if (!empty($content->content)) {
         if (!empty($pane->style['style'])) {
             $style = panels_get_style($pane->style['style']);
             if (isset($style) && isset($style['render pane'])) {
                 $output = theme($style['render pane'], $content, $pane, $this->display, $style);
                 // This could be null if no theme function existed.
                 if (isset($output)) {
                     return $output;
                 }
             }
         }
         // fallback
         return theme('panels_pane', $content, $pane, $this->display);
     }
 }
开发者ID:nvaidyan,项目名称:Physics-main,代码行数:38,代码来源:panels_renderer_standard.class.php

示例2: get_style

  /**
   * Get the appropriate style from the panel in the cache.
   *
   * Since we have styles for regions, panes and the display itself, and
   * they are stored differently, we use this method to simplify getting
   * style information into a way that's easy to cope with.
   */
  function get_style($type, $pid = '') {
    if (isset($this->cache->style)) {
      $style = panels_get_style($this->cache->style);
      $defaults = isset($style['defaults']) ? $style['defaults'] : array();
      // Get the &$conf variable based upon whose style we're editing.
      switch ($type) {
        case 'display':
          $this->display->panel_settings['style'] = $this->cache->style;
          $this->display->panel_settings['style_settings']['default'] = $defaults;
          break;

        case 'region':
          $this->display->panel_settings[$pid]['style'] = $this->cache->style;
          $this->display->panel_settings['style_settings'][$pid] = $defaults;
          break;

        case 'pane':
          $pane = &$this->display->content[$pid];
          $pane->style['style'] = $this->cache->style;
          $pane->style['settings'] = $defaults;
          $conf = &$pane->style['settings'];
          break;
      }
    }
    else {
      switch ($type) {
        case 'display':
          $style = panels_get_style((!empty($this->display->panel_settings['style'])) ? $this->display->panel_settings['style'] : 'default');
          break;

        case 'region':
          $style = panels_get_style((!empty($this->display->panel_settings[$pid]['style'])) ? $this->display->panel_settings[$pid]['style'] : '-1');
          break;

        case 'pane':
          $pane = &$this->display->content[$pid];
          $style = panels_get_style(!empty($pane->style['style']) ? $pane->style['style'] : 'default');
          break;
      }
    }

    // Set up our $conf reference.
    switch ($type) {
      case 'display':
        $conf = &$this->display->panel_settings['style_settings']['default'];
        break;

      case 'region':
        $conf = &$this->display->panel_settings['style_settings'][$pid];
        break;

      case 'pane':
        ctools_include('content');
        $pane = &$this->display->content[$pid];
        $conf = &$pane->style['settings'];
        break;
    }

    // Backward compatibility: Translate old-style stylizer to new style
    // stylizer.
    if ($style['name'] == 'stylizer' && !empty($conf['style']) && $conf['style'] != '$') {
      $style = panels_get_style('stylizer:' . $conf['style']);
    }

    return array($style, &$conf);
  }
开发者ID:north-central-college,项目名称:hrjobs,代码行数:73,代码来源:panels_renderer_editor.class.php


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