當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。