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


PHP panels_pane_access函数代码示例

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


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

示例1: pane_should_be_rendered

 /**
  * Test if a pane (or ESI tag) should be rendered. Normal panes are checked
  * for visibility and access-control rules. Panes rendered by ESI are just
  * checked for visibility.
  */
 function pane_should_be_rendered($pane)
 {
     if (!$pane->shown) {
         return FALSE;
     } elseif (!empty($pane->cache) && $pane->cache['method'] == 'esi') {
         // ESI panes are always rendered (access callbacks)
         return TRUE;
     }
     return panels_pane_access($pane, $this->display);
 }
开发者ID:johnedelatorre,项目名称:fusion,代码行数:15,代码来源:esi_panels_renderer_esi.class.php

示例2: render_pane_content

 function render_pane_content(&$pane)
 {
     if (!empty($pane->shown) && panels_pane_access($pane, $this->display)) {
         $content = parent::render_pane_content($pane);
     }
     // Ensure that empty panes have some content.
     if (empty($content) || empty($content->content)) {
         if (empty($content)) {
             $content = new stdClass();
         }
         // Get the administrative title.
         $content_type = ctools_get_content_type($pane->type);
         $title = ctools_content_admin_title($content_type, $pane->subtype, $pane->configuration, $this->display->context);
         $content->content = t('Placeholder for empty or inaccessible "@title"', array('@title' => html_entity_decode($title, ENT_QUOTES)));
         // Add these to prevent notices.
         $content->type = 'panels_ipe';
         $content->subtype = 'panels_ipe';
         $pane->IPE_empty = TRUE;
     }
     return $content;
 }
开发者ID:rexxllabore,项目名称:acme,代码行数:21,代码来源:panels_renderer_ipe.class.php

示例3: prepare_panes

 /**
  * Prepare the list of panes to be rendered, accounting for visibility/access
  * settings and rendering order.
  *
  * This method represents the standard approach for determining the list of
  * panes to be rendered that is compatible with all parts of the Panels
  * architecture. It first applies visibility & access checks, then sorts panes
  * into their proper rendering order, and returns the result as an array.
  *
  * Inheriting classes should override this method if that renderer needs to
  * regularly make additions to the set of panes that will be rendered.
  *
  * @param array $panes
  *  An associative array of pane data (stdClass objects), keyed on pane id.
  * @return array
  *  An associative array of panes to be rendered, keyed on pane id and sorted
  *  into proper rendering order.
  */
 function prepare_panes($panes)
 {
     ctools_include('content');
     // Use local variables as writing to them is very slightly faster
     $first = $normal = $last = array();
     // Prepare the list of panes to be rendered
     foreach ($panes as $pid => $pane) {
         if (empty($this->admin)) {
             // TODO remove in 7.x and ensure the upgrade path weeds out any stragglers; it's been long enough
             $pane->shown = !empty($pane->shown);
             // guarantee this field exists.
             // If this pane is not visible to the user, skip out and do the next one
             if (!$pane->shown || !panels_pane_access($pane, $this->display)) {
                 continue;
             }
         }
         $content_type = ctools_get_content_type($pane->type);
         // If this pane wants to render last, add it to the $last array. We allow
         // this because some panes need to be rendered after other panes,
         // primarily so they can do things like the leftovers of forms.
         if (!empty($content_type['render last'])) {
             $last[$pid] = $pane;
         } else {
             if (!empty($content_type['render first'])) {
                 $first[$pid] = $pane;
             } else {
                 $normal[$pid] = $pane;
             }
         }
     }
     $this->prepared['panes'] = $first + $normal + $last;
     return $this->prepared['panes'];
 }
开发者ID:nvaidyan,项目名称:Physics-main,代码行数:51,代码来源:panels_renderer_standard.class.php

示例4: render_regions

 /**
  * Render all panes in the attached display into their panel regions, then
  * render those regions.
  *
  * @return array $content
  *    An array of rendered panel regions, keyed on the region name.
  */
 function render_regions()
 {
     ctools_include('content');
     // First, render all the panes into little boxes. We do this here because
     // some panes request to be rendered after other panes (primarily so they
     // can do the leftovers of forms).
     $panes = $first = $normal = $last = array();
     foreach ($this->display->content as $pid => $pane) {
         $pane->shown = !empty($pane->shown);
         // guarantee this field exists.
         // If the user can't see this pane, do not render it.
         if (!$pane->shown || !panels_pane_access($pane, $this->display)) {
             continue;
         }
         $content_type = ctools_get_content_type($pane->type);
         // If this pane wants to render last, add it to the $last array. We allow
         // this because some panes need to be rendered after other panes,
         // primarily so they can do things like the leftovers of forms.
         if (!empty($content_type['render last'])) {
             $last[$pid] = $pane;
         } else {
             if (!empty($content_type['render first'])) {
                 $first[$pid] = $pane;
             } else {
                 $normal[$pid] = $pane;
             }
         }
     }
     foreach ($first + $normal + $last as $pid => $pane) {
         $panes[$pid] = $this->render_pane($pane);
     }
     // Loop through all panels, put all panes that belong to the current panel
     // in an array, then render the panel. Primarily this ensures that the
     // panes are in the proper order.
     $content = array();
     foreach ($this->display->panels as $panel_name => $pids) {
         $panel_panes = array();
         foreach ($pids as $pid) {
             if (!empty($panes[$pid])) {
                 $panel_panes[$pid] = $panes[$pid];
             }
         }
         $content[$panel_name] = $this->render_region($panel_name, $panel_panes);
     }
     // Prevent notices by making sure that all panels at least have an entry:
     $panels = panels_get_regions($this->plugins['layout'], $this->display);
     foreach ($panels as $id => $panel) {
         if (!isset($content[$id])) {
             $content[$id] = NULL;
         }
     }
     return $content;
 }
开发者ID:ChristianBeer,项目名称:boinc,代码行数:60,代码来源:panels_renderer_legacy.class.php


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