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


PHP render_skin函数代码示例

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


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

示例1: allow

 /**
  * check access rights
  *
  * @param string script name
  * @paral string target anchor, if any
  * @return boolean FALSE if access is denied, TRUE otherwise
  */
 function allow($script, $anchor = NULL)
 {
     global $context;
     // limit the scope of our check
     if ($script != 'files/view.php' && $script != 'files/fetch.php' && $script != 'files/fetch_all.php' && $script != 'files/stream.php') {
         return TRUE;
     }
     // sanity check
     if (!$anchor) {
         die(i18n::s('No anchor has been found.'));
     }
     // stop here if the agreement has been gathered previously
     if (isset($_SESSION['agreements']) && is_array($agreements = $_SESSION['agreements'])) {
         foreach ($agreements as $agreement) {
             if ($agreement == $anchor) {
                 return TRUE;
             }
         }
     }
     // which agreement?
     if (!$this->parameters) {
         die(sprintf(i18n::s('No parameter has been provided to %s'), 'behaviors/agree_on_file_access'));
     }
     // do we have a related file to display?
     if (!is_readable($context['path_to_root'] . 'behaviors/agreements/' . $this->parameters)) {
         die(sprintf(i18n::s('Bad parameter to behavior <code>%s %s</code>'), 'agree_on_file_access', $this->parameters));
     }
     // splash message
     $context['text'] .= '<p class="agreement">' . i18n::s('Before moving forward, please read following text and express yourself at the end of the page.') . '</p><hr/>' . "\n";
     // load and display the file to be displayed
     $context['text'] .= Codes::beautify(Safe::file_get_contents($context['path_to_root'] . 'behaviors/agreements/' . $this->parameters));
     // target link to record agreement
     if ($context['with_friendly_urls'] == 'Y') {
         $agree_link = 'behaviors/agreements/agree.php/' . rawurlencode($anchor);
     } else {
         $agree_link = 'behaviors/agreements/agree.php?id=' . urlencode($anchor);
     }
     // display confirmation buttons at the end of the agreement
     $context['text'] .= '<hr/><p class="agreement">' . i18n::s('Do you agree?');
     $context['text'] .= ' ' . Skin::build_link($agree_link, i18n::s('Yes'), 'button');
     $context['text'] .= ' ' . Skin::build_link('behaviors/agreements/deny.php', i18n::s('No'), 'button') . '</p>' . "\n";
     // render the skin based only on text provided by this behavior
     render_skin();
     exit;
 }
开发者ID:rair,项目名称:yacs,代码行数:52,代码来源:agree_on_file_access.php

示例2: AND

            }
            // only consider live categories
            $where = '(' . $where . ')' . ' AND ((categories.expiry_date is NULL)' . "\tOR (categories.expiry_date <= '" . NULL_DATE . "') OR (categories.expiry_date > '" . $context['now'] . "'))";
            // limit the query to top level only
            $query = "SELECT categories.id, categories.title " . " FROM " . SQL::table_name('categories') . " AS categories " . " WHERE (" . $where . ") AND (categories.anchor='category:" . $category_id . "')" . " ORDER BY categories.title";
            $result = SQL::query($query);
            $sub_categories = array();
            while ($result && ($option = SQL::fetch($result))) {
                $sub_categories['category:' . $option['id']] = $option['title'];
            }
            if (count($sub_categories)) {
                $suffix .= '<form method="post" action="' . $context['script_url'] . '"><div>' . i18n::s('More specific:') . ' <select name="anchor">';
                foreach ($sub_categories as $option_reference => $option_label) {
                    $suffix .= '<option value="' . $option_reference . '">' . $option_label . "</option>\n";
                }
                $suffix .= '</select>' . ' ' . Skin::build_submit_button(" >> ") . '<input type="hidden" name="member" value="' . $member . '">' . '<input type="hidden" name="father" value="category:' . $category_id . '">' . '</div></form>' . "\n";
            }
            // format the item
            $new_categories[$url] = array($prefix, $label, $suffix, $type, $icon);
        }
        // display attached categories with unlink buttons
        $context['text'] .= Skin::build_list($new_categories, 'decorated');
    }
    // insert anchor suffix
    if (is_object($anchor)) {
        $context['text'] .= $anchor->get_suffix();
    }
}
// render the skin
render_skin();
开发者ID:rair,项目名称:yacs,代码行数:30,代码来源:select.php

示例3: join

        $context['components']['channels'] = Skin::build_box(i18n::s('Monitor'), join(BR, $lines), 'channels', 'feed');
    }
    // categories attached to this item, if not at another follow-up page
    if (!$zoom_type || $zoom_type == 'categories') {
        // build a complete box
        $box = array();
        $box['bar'] = array();
        $box['text'] = '';
        // list categories by title
        $items =& Members::list_categories_by_title_for_member('user:' . $item['id'], 0, COMPACT_LIST_SIZE, 'sidebar');
        // the command to change categories assignments
        if (Categories::allow_assign($item)) {
            $items = array_merge($items, array(Categories::get_url('user:' . $item['id'], 'select') => i18n::s('Assign categories')));
        }
        // actually render the html for the section
        if (is_array($box['bar'])) {
            $box['text'] .= Skin::build_list($box['bar'], 'menu_bar');
        }
        if (is_array($items)) {
            $box['text'] .= Skin::build_list($items, 'compact');
        }
        if ($box['text']) {
            $context['components']['categories'] = Skin::build_box(i18n::s('See also'), $box['text'], 'categories', 'categories');
        }
    }
    // referrals, if any
    $context['components']['referrals'] =& Skin::build_referrals(Users::get_url($item['id']));
}
// render the skin -- do not provide Last-Modified header
render_skin(FALSE);
开发者ID:rair,项目名称:yacs,代码行数:30,代码来源:view.php


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