Commit df32edc9 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1599373: Don't print the "share page" or "display page" links for site pages"

parents 61448e52 d6afb35e
......@@ -6367,6 +6367,17 @@ class View {
ArtefactType::update_locked($userid);
db_commit();
}
/**
* Indicates whether this view is a site template. (A site template is a special
* template page which is copied as the starting point whenever a new page is
* created.)
*
* @return boolean
*/
public function is_site_template() {
return ($this->get('template') == View::SITE_TEMPLATE);
}
}
class ViewSubmissionException extends UserException {
......
......@@ -44,7 +44,7 @@
<div id="view-wizard-controls" class="col-collapse-offset col-with-collapse">
{if !$template}
{if !$issitetemplate}
<a class="btn btn-default" href="{$displaylink}">
{str tag=displayview section=view}
<span class="icon icon-arrow-circle-right right" role="presentation" aria-hidden="true"></span>
......
......@@ -25,14 +25,14 @@
<a href="{$displaylink}">
{str tag=displayview section=view}
</a>
{else}
&nbsp;
{/if}
{if $edittitle || $viewtype == 'profile'}
<a href="{$WWWROOT}view/access.php?id={$viewid}{if $collectionid}&collection={$collectionid}{/if}{if $new}&new=1{/if}">
<span class="icon icon-unlock-alt" role="presentation" aria-hidden="true"></span>
{str tag=shareview section=view}
</a>
{/if}
{else}
&nbsp;
{/if}
</div>
......@@ -292,6 +292,6 @@ else {
}
$smarty->assign('issiteview', isset($institution) && ($institution == 'mahara'));
$smarty->assign('issitetemplate', ($view->get('template') == View::SITE_TEMPLATE ? true : false));
$smarty->assign('issitetemplate', $view->is_site_template());
$smarty->assign('PAGEHEADING', $state);
$smarty->display('view/blocks.tpl');
......@@ -253,5 +253,6 @@ $smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('displaylink', $displaylink);
$smarty->assign('new', $new);
$smarty->assign('issiteview', isset($institution) && ($institution == 'mahara'));
$smarty->assign('issitetemplate', $view->is_site_template());
$smarty->assign('PAGEHEADING', $state);
$smarty->display('view/edit.tpl');
......@@ -189,7 +189,7 @@ $smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('displaylink', $view->get_url());
$smarty->assign('new', $new);
$smarty->assign('issiteview', $view->get('institution') == 'mahara');
$smarty->assign('issitetemplate', ($view->get('template') == View::SITE_TEMPLATE ? true : false));
$smarty->assign('issitetemplate', $view->is_site_template());
$smarty->assign('PAGEHEADING', $state);
$smarty->display('view/layout.tpl');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment