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


PHP gpOutput::WhichGadgets方法代码示例

本文整理汇总了PHP中gpOutput::WhichGadgets方法的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput::WhichGadgets方法的具体用法?PHP gpOutput::WhichGadgets怎么用?PHP gpOutput::WhichGadgets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gpOutput的用法示例。


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

示例1: ShowGadgets

 /**
  * Display gadgets and their status for the current layout
  *
  */
 function ShowGadgets()
 {
     global $langmessage, $config;
     $gadget_info = gpOutput::WhichGadgets($this->curr_layout);
     echo '<h2>' . $langmessage['gadgets'] . '</h2>';
     echo '<table class="bordered full_width">';
     echo '<tr><th colspan="2">&nbsp;</th></tr>';
     if (!isset($config['gadgets']) || count($config['gadgets']) == 0) {
         echo '<tr><td colspan="2">';
         echo $langmessage['Empty'];
         echo '</td></tr>';
     } else {
         foreach ($config['gadgets'] as $gadget => $temp) {
             echo '<tr><td>';
             echo str_replace('_', ' ', $gadget);
             echo '</td><td>';
             if (isset($gadget_info[$gadget])) {
                 echo $this->LayoutLink($this->curr_layout, $langmessage['remove'], 'cmd=rmgadget&gadget=' . urlencode($gadget), array('data-cmd' => 'cnreq'));
             } else {
                 echo $langmessage['disabled'];
             }
             echo '</td></tr>';
         }
     }
     echo '</table>';
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:30,代码来源:admin_theme_content.php

示例2: ShowDetails

 /**
  * Show details about the selected layout
  *
  */
 function ShowDetails($layout, $layout_info, $handlers_count)
 {
     global $langmessage, $config;
     echo '<h3>' . $langmessage['details'] . '</h3>';
     //layout options
     echo '<table class="bordered full_width">';
     echo '<tr><th colspan="2">';
     echo $langmessage['layout'];
     echo '</th></tr>';
     echo '<tr><td style="width:40%">';
     echo $langmessage['label'];
     echo '</td><td>';
     echo '<a name="layout_id" title="' . $layout_info['color'] . '" rel="' . $layout_info['color'] . '">';
     echo '<input type="hidden" name="layout" value="' . htmlspecialchars($layout) . '"  /> ';
     echo '<input type="hidden" name="layout_label" value="' . $layout_info['label'] . '"  /> ';
     echo '<span class="layout_color_id" style="background-color:' . $layout_info['color'] . ';"></span>';
     echo '&nbsp;';
     echo $layout_info['label'];
     echo '</a>';
     echo '</td></tr>';
     echo '<tr><td>';
     echo $langmessage['theme'];
     echo '</td><td>';
     echo $layout_info['theme_name'];
     echo '</td></tr>';
     echo '<tr><td>';
     echo $langmessage['usage'];
     echo '</td><td>';
     if ($config['gpLayout'] == $layout) {
         echo $langmessage['default'];
     } elseif (!isset($_GET['show'])) {
         echo common::Link('Admin_Theme_Content/' . rawurlencode($layout), str_replace(' ', '&nbsp;', $langmessage['make_default']), 'cmd=makedefault', ' name="gpabox" title="' . htmlspecialchars($langmessage['make_default']) . '" ');
     } else {
         echo common::Link('Admin_Theme_Content', str_replace(' ', '&nbsp;', $langmessage['default']), 'cmd=makedefault&layout_id=' . rawurlencode($layout), ' name="creq" title="' . htmlspecialchars($langmessage['make_default']) . '" ');
     }
     echo ' &nbsp; ';
     $titles_count = $this->TitlesCount($layout);
     echo sprintf($langmessage['%s Pages'], $titles_count);
     echo '</td></tr>';
     $theme_colors = $this->GetThemeColors($layout_info['dir']);
     echo '<tr><td>';
     echo $langmessage['style'];
     echo '</td><td>';
     if (!isset($_GET['show'])) {
         echo '<form action="' . common::GetUrl('Admin_Theme_Content/' . rawurlencode($layout)) . '" method="post">';
     } else {
         echo '<form action="' . common::GetUrl('Admin_Theme_Content') . '" method="post">';
         echo '<input type="hidden" name="layout" value="' . $layout . '" />';
     }
     echo '<select name="color" class="gpselect">';
     foreach ($theme_colors as $color) {
         if ($color == $layout_info['theme_color']) {
             echo '<option value="' . htmlspecialchars($color) . '" selected="selected">';
         } else {
             echo '<option value="' . htmlspecialchars($color) . '">';
         }
         echo $color;
         echo '</option>';
     }
     echo '</select>';
     echo ' <input type="hidden" name="cmd" value="change_layout_color" />';
     echo ' <input type="submit" name="" value="' . htmlspecialchars($langmessage['save']) . '" class="gpbutton" />';
     echo '</form>';
     echo '</td></tr>';
     echo '<tr><td>';
     echo $langmessage['content_arrangement'];
     echo '</td><td>';
     if ($handlers_count > 0) {
         if (!isset($_GET['show'])) {
             echo common::Link('Admin_Theme_Content/' . rawurlencode($layout), $langmessage['restore_defaults'], 'cmd=restore', ' name="creq" ');
         } else {
             echo common::Link('Admin_Theme_Content', $langmessage['restore_defaults'], 'cmd=restore&layout=' . rawurlencode($layout), ' name="creq" ');
         }
     } else {
         echo $langmessage['default'];
     }
     echo '</td></tr>';
     echo '</table>';
     // gadgets
     echo '<br/>';
     echo '<table class="bordered full_width">';
     $gadget_info = gpOutput::WhichGadgets($this->curr_layout);
     echo '<tr><th style="width:40%">';
     echo $langmessage['gadgets'];
     echo '</th><th>&nbsp;</th></tr>';
     if (!isset($config['gadgets']) || count($config['gadgets']) == 0) {
         echo '<tr><td colspan="2">';
         echo $langmessage['Empty'];
         echo '</td></tr>';
     } else {
         foreach ($config['gadgets'] as $gadget => $temp) {
             echo '<tr><td>';
             echo str_replace('_', ' ', $gadget);
             echo '</td><td>';
             if (isset($gadget_info[$gadget])) {
                 if (!isset($_GET['show'])) {
//.........这里部分代码省略.........
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:101,代码来源:admin_theme_content.php

示例3: PrepGadgetContent

 /**
  * Prepare the gadget content before getting template.php so that gadget functions can add css and js to the head
  * @return null
  */
 static function PrepGadgetContent()
 {
     global $page;
     //not needed for admin pages
     if ($page->pagetype == 'admin_display') {
         return;
     }
     $gadget_info = gpOutput::WhichGadgets($page->gpLayout);
     foreach ($gadget_info as $gpOutCmd => $info) {
         if (!isset(self::$gadget_cache[$gpOutCmd])) {
             ob_start();
             gpOutput::ExecArea($info);
             self::$gadget_cache[$gpOutCmd] = ob_get_clean();
         }
     }
 }
开发者ID:Bomberus,项目名称:gpEasy-CMS,代码行数:20,代码来源:gpOutput.php

示例4: PrepGadgetContent

 /**
  * Prepare the gadget content before getting template.php so that gadget functions can add css and js to the head
  * @return null
  */
 function PrepGadgetContent()
 {
     global $page, $GP_GADGET_CACHE;
     $gadget_info = gpOutput::WhichGadgets($page->gpLayout);
     foreach ($gadget_info as $gpOutCmd => $info) {
         if (!isset($GP_GADGET_CACHE[$gpOutCmd])) {
             ob_start();
             gpOutput::ExecArea($info);
             $GP_GADGET_CACHE[$gpOutCmd] = ob_get_clean();
         }
     }
 }
开发者ID:rizub4u,项目名称:gpEasy-CMS,代码行数:16,代码来源:gpOutput.php


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