本文整理匯總了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')) {