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


PHP Sections::allow_creation方法代码示例

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


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

示例1: urlencode

    Skin::define_img('ARTICLES_ADD_IMG', 'articles/add.gif');
    $url = 'articles/edit.php?anchor=' . urlencode('section:' . $item['id']);
    if (is_object($content_overlay) && ($label = $content_overlay->get_label('new_command', 'articles'))) {
    } else {
        $label = i18n::s('Add a page');
    }
    $context['page_tools'][] = Skin::build_link($url, ARTICLES_ADD_IMG . $label, 'basic', i18n::s('Add new content to this section'));
    // the command to create a new poll, if no overlay nor template has been defined for content of this section
    if ((!isset($item['content_overlay']) || !trim($item['content_overlay'])) && (!isset($item['articles_templates']) || !trim($item['articles_templates'])) && (!is_object($anchor) || !$anchor->get_templates_for('article'))) {
        Skin::define_img('ARTICLES_POLL_IMG', 'articles/poll.gif');
        $url = 'articles/edit.php?anchor=' . urlencode('section:' . $item['id']) . '&variant=poll';
        $context['page_tools'][] = Skin::build_link($url, ARTICLES_POLL_IMG . i18n::s('Add a poll'), 'basic', i18n::s('Add new content to this section'));
    }
}
// add a section
if (Sections::allow_creation($item, $anchor)) {
    Skin::define_img('SECTIONS_ADD_IMG', 'sections/add.gif');
    $context['page_tools'][] = Skin::build_link('sections/edit.php?anchor=' . urlencode('section:' . $item['id']), SECTIONS_ADD_IMG . i18n::s('Add a section'), 'basic', i18n::s('Add a section'));
}
// comment this page if anchor does not prevent it
if (Comments::allow_creation($item, $anchor, 'section')) {
    Skin::define_img('COMMENTS_ADD_IMG', 'comments/add.gif');
    $context['page_tools'][] = Skin::build_link(Comments::get_url('section:' . $item['id'], 'comment'), COMMENTS_ADD_IMG . i18n::s('Post a comment'), 'basic', i18n::s('Express yourself, and say what you think.'));
}
// add a file, if upload is allowed
if (Files::allow_creation($item, $anchor, 'section')) {
    Skin::define_img('FILES_UPLOAD_IMG', 'files/upload.gif');
    $context['page_tools'][] = Skin::build_link('files/edit.php?anchor=' . urlencode('section:' . $item['id']), FILES_UPLOAD_IMG . i18n::s('Add a file'), 'basic', i18n::s('Attach related files.'));
}
// add a link
if (Links::allow_creation($item, $anchor, 'section')) {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:view_as_tabs.php


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