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')) {