summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChristian Fowler <cfowler2@wcpss.net>2014-08-01 15:06:51 -0400
committerChristian Fowler <cfowler2@wcpss.net>2014-08-01 15:06:51 -0400
commit1609052f169ba177d0c2de5a4694f046f144f43e (patch)
tree3b7cdad950d934ab2a99470a07674ea1e794c98c /templates
parent35fae44dd47c669a8ff93d6468399fcbf334b7ee (diff)
parentc6f2e0073a7f269b45a284c08e923056e721208c (diff)
downloadliberty-1609052f169ba177d0c2de5a4694f046f144f43e.tar.gz
liberty-1609052f169ba177d0c2de5a4694f046f144f43e.tar.bz2
liberty-1609052f169ba177d0c2de5a4694f046f144f43e.zip
Merge branch 'master' of github.com:bitweaver/liberty
Diffstat (limited to 'templates')
-rw-r--r--templates/add_structure_content.tpl56
-rw-r--r--templates/comments.tpl4
-rw-r--r--templates/comments_post_inc.tpl8
-rw-r--r--templates/display_comment.tpl2
-rw-r--r--templates/edit_format.tpl2
-rw-r--r--templates/edit_structure.tpl163
-rw-r--r--templates/edit_structure_alias.tpl45
-rw-r--r--templates/edit_structure_inc.tpl60
-rw-r--r--templates/html_head_inc.tpl2
-rw-r--r--templates/service_content_icon_inc.tpl6
-rwxr-xr-xtemplates/structure_toc.tpl2
-rwxr-xr-xtemplates/structure_toc_endul.tpl2
-rwxr-xr-xtemplates/structure_toc_leaf.tpl14
-rwxr-xr-xtemplates/structure_toc_level.tpl2
-rwxr-xr-xtemplates/structure_toc_startul.tpl2
15 files changed, 197 insertions, 173 deletions
diff --git a/templates/add_structure_content.tpl b/templates/add_structure_content.tpl
index db90560..1d047f7 100644
--- a/templates/add_structure_content.tpl
+++ b/templates/add_structure_content.tpl
@@ -1,10 +1,7 @@
{literal}
-<script type="text/javascript">/* <![CDATA[ */
-function submitStructure(pForm,pContentId,pMode) {
- var req = getXMLHttpRequest();
- req.open("POST", {/literal}'{$smarty.const.LIBERTY_PKG_URL}add_structure_content.php'{literal}, true);
- var data = queryString(pForm)+"&content[]="+pContentId+"&ajax_xml=1";
-
+<script type="text/javascript">
+function addStructure(pContentId) {
+ var data = $("#structureaddform").serialize()+"&content[]="+pContentId+"&ajax_xml=1&action=add";
var ajax = new BitBase.SimpleAjax();
var donefn = function (r) {
var responseHash = BitBase.evalJSON( r.responseText );
@@ -15,13 +12,11 @@ function submitStructure(pForm,pContentId,pMode) {
BitBase.showById( responseHash.content_id+"remove" );
BitBase.fade( responseHash.content_id+"add" );
};
-
ajax.connect( "{/literal}{$smarty.const.LIBERTY_PKG_URL}add_structure_content.php{literal}", data, donefn, "GET" );
-
return false;
}
-/* ]]> */</script>
+</script>
{/literal}
{strip}
@@ -31,18 +26,20 @@ function submitStructure(pForm,pContentId,pMode) {
<div class="edit structurecontent">
<div class="header">
- <h1>{tr}Structure Content{/tr}</h1>
+ <h1>{$gContent->getTitle()|escape} {tr}Table of Contents{/tr}</h1>
</div>
{form legend="Add Content" id="structureaddform"}
<input type="hidden" name="structure_id" value="{$structureInfo.structure_id}" />
<input type="hidden" name="tab" value="content" />
+ <div class="row">
+ <div class="col-sm-4">
{if $subtree}
<div class="form-group">
{formlabel label="After page" for="after_ref_id"}
{forminput}
- <select name="after_ref_id" id="after_ref_id">
+ <select class="form-control" name="after_ref_id" id="after_ref_id">
{section name=iy loop=$subtree}
<option value="{$subtree[iy].structure_id}" {if $insert_after eq $subtree[iy].structure_id}selected="selected"{/if}>{$subtree[iy].pos} - {$subtree[iy].title|escape}</option>
{/section}
@@ -51,31 +48,40 @@ function submitStructure(pForm,pContentId,pMode) {
{/forminput}
</div>
{/if}
-
+ </div>
+ <div class="col-sm-3">
{minifind}
{* disable until it can be sorted }
<div class="form-group">
{formlabel label="Search" for="lib-content"}
{forminput}
- <input autocomplete="off" id="contact_name" name="contact[name]" size="30" type="text" value="" />
+ <input class="form-control" autocomplete="off" id="contact_name" name="contact[name]" type="text" value="" />
<div class="auto_complete" id="contact_name_auto_complete"></div>
<script type="text/javascript">new Ajax.Autocompleter('contact_name', 'contact_name_auto_complete', '/presentations/foo.php', {ldelim}{rdelim})</script>
{formhelp note=""}
{/forminput}
</div>
{ *}
+ </div>
+ <div class="col-sm-3">
+ <div class="form-group">
+ {formlabel label="Content Type" for="content_type_guid"}
+ {forminput}
+ {html_options class="form-control" onchange="submit();" options=$contentTypes name=content_type_guid selected=$contentSelect}
+ {/forminput}
- <div class="form-group">
- {formlabel label="Content type" for="content_type_guid"}
- {forminput}
- {html_options onchange="submit();" options=$contentTypes name=content_type_guid selected=$contentSelect}
- {/forminput}
-
- {* forminput}
- {html_options multiple="multiple" id="lib-content" size="12" name="content[]" values=$contentList options=$contentList}
- {/forminput *}
+ {* forminput}
+ {html_options class="form-control" multiple="multiple" id="lib-content" size="12" name="content[]" values=$contentList options=$contentList}
+ {/forminput *}
+ </div>
+ </div>
+ <div class="col-sm-1">
+ <a class="btn btn-primary" href="{$smarty.const.BIT_ROOT_URL}index.php?structure_id={$gStructure->mStructureId}">Done</a>
+ </div>
+ </div>
+ <div class="form-group">
{forminput}
<table class="table data">
<thead>
@@ -91,12 +97,12 @@ function submitStructure(pForm,pContentId,pMode) {
<tr class="item {cycle values="even,odd"}" id="{$contentListHash[cx].content_id}li">
<td>
- {assign var=inStructure value=$gStructure->isInStructure($contentListHash[cx].content_id)}
- <div class="icon" {if empty($inStructure)}style="display:none"{/if} id="{$contentListHash[cx].content_id}remove" onclick="submitStructure(document.getElementById('structureaddform'),{$contentListHash[cx].content_id},'remove')">
+ {assign var=inStructureId value=$gStructure->isInStructure($contentListHash[cx].content_id)}
+ <div class="icon" {if empty($inStructureId)}style="display:none"{/if} id="{$contentListHash[cx].content_id}remove" onclick="removeStructure({$inStructureId})">
{booticon iname="icon-minus-sign" ipackage="icons" iexplain="Remove"}
</div>
- <div class="icon" {if $inStructure}style="display:none"{/if} id="{$contentListHash[cx].content_id}add" onclick="submitStructure(document.getElementById('structureaddform'),{$contentListHash[cx].content_id},'add')">
+ <div class="icon" {if $inStructureId}style="display:none"{/if} id="{$contentListHash[cx].content_id}add" onclick="addStructure({$contentListHash[cx].content_id})">
{booticon iname="icon-plus-sign" ipackage="icons" iexplain="Add to structure"}
</div>
diff --git a/templates/comments.tpl b/templates/comments.tpl
index a9d8dbf..92f1605 100644
--- a/templates/comments.tpl
+++ b/templates/comments.tpl
@@ -8,13 +8,13 @@
{/if}
<div class="body"{if !( $post_comment_request || $post_comment_preview )} id="editcomments"{/if}>
- <div id="edit_comments" {if $comments_ajax}style="display:none"{/if}>
+ <div id="edit_comments" {if $gBitSystem->isFeatureActive('comments_ajax')}style="display:none"{/if}>
{include file="bitpackage:liberty/comments_post_inc.tpl" post_title="Post Comment"}
</div>
{include file="bitpackage:liberty/comments_display_option_bar.tpl"}
- {if $comments_ajax && $gBitUser->hasPermission( 'p_liberty_post_comments' )}
+ {if $gBitSystem->isFeatureActive('comments_ajax') && $gBitUser->hasPermission( 'p_liberty_post_comments' )}
<div class="form-group">
<input type="submit" class="btn btn-default" name="post_comment_request" value="{tr}Add Comment{/tr}" onclick="LibertyComment.attachForm('comment_{$gContent->mContentId}', '{$gContent->mContentId}', {if $gContent->mContentId}{$gContent->mContentId}{elseif $commentsParentId}{$commentsParentId}{else}null{/if})"/>
</div>
diff --git a/templates/comments_post_inc.tpl b/templates/comments_post_inc.tpl
index feaa70d..8452276 100644
--- a/templates/comments_post_inc.tpl
+++ b/templates/comments_post_inc.tpl
@@ -12,7 +12,7 @@
{formfeedback hash=$formfeedback}
- {if $post_comment_request || $smarty.request.post_comment_preview || $comments_ajax}
+ {if $post_comment_request || $smarty.request.post_comment_preview || $gBitSystem->isFeatureActive('comments_ajax')}
{legend legend=$post_title}
<input type="hidden" name="post_comment_reply_id" value="{$post_comment_reply_id}" />
<input type="hidden" name="post_comment_id" value="{$post_comment_id}" />
@@ -76,9 +76,9 @@
{/if}
<div class="form-group submit">
- <input type="submit" class="btn btn-default" name="post_comment_preview" value="{tr}Preview{/tr}" {if $comments_ajax}onclick="LibertyComment.previewComment(); return false;"{/if}/>&nbsp;
- <input type="submit" class="btn btn-default" name="post_comment_submit" value="{tr}Post{/tr}" {if $comments_ajax}onclick="LibertyComment.postComment(); return false;"{/if}/>&nbsp;
- <input type="submit" class="btn btn-default" name="post_comment_cancel" value="{tr}Cancel{/tr}" {if $comments_ajax}onclick="LibertyComment.cancelComment(true); return false;"{/if}/>
+ <input type="submit" class="btn btn-default" name="post_comment_preview" value="{tr}Preview{/tr}" {if $gBitSystem->isFeatureActive('comments_ajax')}onclick="LibertyComment.previewComment(); return false;"{/if}/>&nbsp;
+ <input type="submit" class="btn btn-default" name="post_comment_submit" value="{tr}Post{/tr}" {if $gBitSystem->isFeatureActive('comments_ajax')}onclick="LibertyComment.postComment(); return false;"{/if}/>&nbsp;
+ <input type="submit" class="btn btn-default" name="post_comment_cancel" value="{tr}Cancel{/tr}" {if $gBitSystem->isFeatureActive('comments_ajax')}onclick="LibertyComment.cancelComment(true); return false;"{/if}/>
</div>
{/legend}
{elseif $gBitUser->hasPermission( 'p_liberty_post_comments' )}
diff --git a/templates/display_comment.tpl b/templates/display_comment.tpl
index 699d08f..70c554c 100644
--- a/templates/display_comment.tpl
+++ b/templates/display_comment.tpl
@@ -7,7 +7,7 @@
<div class="post" id="comment_{$comment.content_id}">
<div class="floaticon">
{if $gBitUser->hasPermission( 'p_liberty_post_comments' )}
- {if $comments_ajax }
+ {if $gBitSystem->isFeatureActive('comments_ajax') }
<a href="javascript:void(0);" onclick="LibertyComment.attachForm('comment_{$comment.content_id}', '{$comment.content_id}', '{$comment.root_id}')">{booticon iname="icon-comment-alt" ipackage="icons" iexplain="Reply to this comment"}</a>
{else}
<a href="#">{booticon iname="icon-comment-alt" class="icon" onclick="window.location='`$comments_return_url`&amp;post_comment_reply_id=`$comment.content_id`&amp;post_comment_request=1#editcomments';" iexplain="Reply to this comment" }</a>
diff --git a/templates/edit_format.tpl b/templates/edit_format.tpl
index 99b2152..1f9922c 100644
--- a/templates/edit_format.tpl
+++ b/templates/edit_format.tpl
@@ -1,6 +1,6 @@
{strip}
{* comment or content @TODO pass in as a var in includes *}
-{if ( $post_comment_request || $post_comment_preview || $comments_ajax ) && $gComment}
+{if ( $post_comment_request || $post_comment_preview || $gBitSystem->isFeatureActive('comments_ajax') ) && $gComment}
{assign var=contentObject value=$gComment}
{else}
{assign var=contentObject value=$gContent}
diff --git a/templates/edit_structure.tpl b/templates/edit_structure.tpl
index 8e7521a..4c29aa1 100644
--- a/templates/edit_structure.tpl
+++ b/templates/edit_structure.tpl
@@ -6,32 +6,149 @@
{assign var=structureName value="Structure"}
{/if}
-{if $gBitThemes->isAjaxLib('mochikit')}
+<script type="text/javascript" src="{$smarty.const.UTIL_PKG_URL}javascript/jquery-acisortable/jquery.aciPlugin.min.js"></script>
+<script type="text/javascript" src="{$smarty.const.UTIL_PKG_URL}javascript/jquery-acisortable/jquery.aciSortable.js"></script>
- <div class="form-group">
- <div class="formlabel">
- {$gContent->getContentTypeName()} {tr}Structure{/tr}
- <br/>
- <a href="{$smarty.const.LIBERTY_PKG_URL}add_structure_content.php?structure_id={$smarty.request.structure_id}&amp;content_type_guid={$smarty.request.content_type_guid}" title="Add Content to {$gContent->getTitle()}" title="Add Content">Add Content</a>
- </div>
- {forminput}
- {include file="bitpackage:liberty/edit_structure_inc.tpl"}
- {/forminput}
- </div>
+{$structureToc}
-{else}
+<script type="text/javascript">
+$.fn.aciSortable.defaults.container = 'ol';
+$('#structure-{$structureTocId}').aciSortable( {literal}{
+ child: 50,
+ draggable: true,
+ childHolder: '<ol class="structure-toc"></ol>',
+ childHolderSelector: '.structure-toc',
+ exclude: '.exclude',
+ handle: '.structure-sort-handle',
+ helper: '<div class="structure-sort-helper"></div>',
+ helperSelector: '.structure-sort-helper',
+ start: function(item, placeholder, helper) {
+ // show item inside helper
+ helper.css({
+ opacity: 0.8
+ }).html(item.html());
+ // do not fadeIn helper if the item is from other sortable
+ if (this.hasItem(item)) {
+ helper.fadeIn();
+ }
+ item.slideUp();
+ },
+ end: function(item, hover, placeholder, helper) {
+ if (placeholder.parent().length) {
+ // add item after placeholder
+ placeholder.after(item).detach();
+ }
+ item.slideDown();
+ var top = $(window).scrollTop();
+ var left = $(window).scrollLeft();
+ var rect = item.get(0).getBoundingClientRect();
+ // animate helper to item position
+ helper.animate({
+ top: rect.top + top,
+ left: rect.left + left,
+ opacity: 0
+ },
+ {
+ complete: function() {
+ // when completed detach the helper
+ helper.detach();
+ }
+ });
+ }
+}{/literal} );
- {jstabs}
- {jstab title="`$structureName` Organization"}
- {include file="bitpackage:liberty/edit_structure_inc.tpl"}
- {/jstab}
- {if !$gBitSystem->isFeatureActive( 'wikibook_hide_add_content' )}
- {jstab title="`$structureName` Content"}
- {include file="bitpackage:liberty/edit_structure_content.tpl"}
- {/jstab}
- {/if}
- {/jstabs}
+{literal}
+// Changes XML to JSON
+function structureTocToJson(xml) {
+ if (xml.nodeName == 'LI') { // element
+ if( xml.attributes.length == 0 ) {
+ // do children
+ if (xml.hasChildNodes()) {
+ for(var i = 0; i < xml.childNodes.length; i++) {
+ var childNode = xml.childNodes.item(i);
+console.log( childNode );
+ return structureTocToJson(childNode);
+ }
+ }
+ } else {
+ var obj = {};
-{/if}
+ // do attributes
+ if (xml.attributes.length > 0) {
+ for (var j = 0; j < xml.attributes.length; j++) {
+ var attribute = xml.attributes.item(j);
+ if( attribute.nodeName == "structure_id" || attribute.nodeName == "content_id" ) {
+ obj[attribute.nodeName] = attribute.value;
+ }
+ }
+ }
+ // do children
+ if (xml.hasChildNodes()) {
+ var children = null;
+ childObjects = [];
+ for(var i = 0; i < xml.childNodes.length; i++) {
+ var childNode = xml.childNodes.item(i);
+ if( childNode.nodeName == "OL" ) {
+ children = structureTocToJson(childNode);
+ if( children ) {
+ obj["children"] = children;
+ }
+ }
+ }
+ }
+ return obj;
+ }
+ } else if( xml.nodeName == 'OL' ) {
+ var obj = [];
+ // do children
+ if (xml.hasChildNodes()) {
+ for(var i = 0; i < xml.childNodes.length; i++) {
+ var childNode = xml.childNodes.item(i);
+ if( childNode.nodeName == "LI" ) {
+ var children = structureTocToJson(childNode);
+ if( children ) {
+ obj.push(children);
+ }
+ }
+ }
+ }
+ return obj;
+ }
+ return null;
+
+};
+
+function saveStructure( pStructureId ) {
+ // var json = structureTocToJson(document.getElementById('structure-branch-'+pStructureId));$('#pre-tree').html(JSON.stringify(json,null,2));
+ $.ajax({
+ url: {/literal}"{$smarty.const.LIBERTY_PKG_URL}edit_structure_inc.php?tk={$gBitUser->mTicket}&submit_structure=1&structure_id="+pStructureId,{literal}
+ type: 'POST',
+ context: document.body,
+ data: { 'structure_json': structureTocToJson(document.getElementById('structure-branch-'+pStructureId)) }
+ })
+ .done(function( response ) {
+ $("#structure-feedback").html( response );
+ });
+}
+
+var undoHash = [];
+
+function deleteStructureNode( pStructureId, pStructureText ) {
+ if( confirm( "Are you sure you want to delete the following item, and all of its children? This cannot be undone."+"\n\nDELETE: "+pStructureText) ) {
+ var eleId = '#structure-node-'+pStructureId;
+ $(eleId).detach();
+ // One day undoHash could be popped for undo
+ undoHash.push( $(eleId) );
+ }
+}
+{/literal}
+
+</script>
+
+ <div class="btn btn-primary" onclick="saveStructure('{$gStructure->mInfo.root_structure_id}');">{tr}Save Changes{/tr}</div> <a href="{$smart.const.BIT_ROOT_URL}index.php?structure_id={$gStructure->mInfo.root_structure_id}" class="btn btn-default"">{tr}Back{/tr}</a> <a class="btn btn-default" href="{$smarty.const.LIBERTY_PKG_URL}add_structure_content.php?structure_id={$smarty.request.structure_id}&amp;content_type_guid={$smarty.request.content_type_guid}" title="Add Content to {$gContent->getTitle()}" title="Add Content">Add Content</a>
+<div id="structure-feedback">
+</div>
+
+{*<pre id="pre-tree"></pre>*}
{/strip}
diff --git a/templates/edit_structure_alias.tpl b/templates/edit_structure_alias.tpl
deleted file mode 100644
index e7b67e3..0000000
--- a/templates/edit_structure_alias.tpl
+++ /dev/null
@@ -1,45 +0,0 @@
-{strip}
-<div>
- {form legend="Update Page Alias"}
- <input type="hidden" name="structure_id" value="{$structureInfo.structure_id}" />
- <input type="hidden" name="tab" value="alias" />
-
- <div class="form-group">
- {formlabel label="Page Alias" for="pageAlias"}
- {forminput}
- <input type="text" name="pageAlias" id="pageAlias" value="{$structureInfo.page_alias}" size="30" maxlength="240"/>
- {formhelp note=""}
- {/forminput}
- </div>
-
- <div class="form-group submit">
- <input type="submit" class="btn btn-default" name="create" value="{tr}Update{/tr}"/>
- </div>
- {/form}
-</div>
-
-<div class="structuretoc">
- <ul class="toc">
- <li>
- {section name=ix loop=$subtree}
- {if $subtree[ix].pos eq ''}
- {if $structureInfo.structure_id eq $subtree[ix].structure_id}<div class="highlight">{/if}
- <a href="{$smarty.server.SCRIPT_NAME}?structure_id={$subtree[ix].structure_id}&amp;tab=alias">{$subtree[ix].title|escape}</a>
- {if $structureInfo.structure_id eq $subtree[ix].structure_id}</div>{/if}
- {else}
- {if $subtree[ix].first}<ul>{else}</li>{/if}
- {if $subtree[ix].last}</ul>{else}
- <li>
- {if $structureInfo.structure_id eq $subtree[ix].structure_id}<div class="highlight">{/if}
- <strong>{$subtree[ix].pos}</strong>
- <a href="{$smarty.server.SCRIPT_NAME}?structure_id={$subtree[ix].structure_id}&amp;tab=alias">{$subtree[ix].title|escape}</a>
- {if $structureInfo.structure_id eq $subtree[ix].structure_id}</div>{/if}
- {/if}
- {/if}
- {/section}
- </li>
- </ul><!-- end outermost .toc -->
-</div>
-<div class="clear"></div>
-
-{/strip}
diff --git a/templates/edit_structure_inc.tpl b/templates/edit_structure_inc.tpl
deleted file mode 100644
index fc8169c..0000000
--- a/templates/edit_structure_inc.tpl
+++ /dev/null
@@ -1,60 +0,0 @@
-{strip}
-<div class="DynamicTree">
- <div class="tree-wrapper1">
- {section name=ix loop=$subtree}
- {if $subtree[ix].pos eq ''}
- <h2>{$subtree[ix].title|escape} {if $subtree[ix].page_alias}({/if}{$subtree[ix].page_alias}{if $subtree[ix].page_alias}){/if}</h2>
- {/if}
- {/section}
-
- <div class="tree-wrapper2" id="tree">
- {section name=ix loop=$subtree}
- {if $subtree[ix].pos ne ''}
- {if $subtree[ix].first}{else}</div>{/if}
- {if $subtree[ix].last}{else}
- <div class="{if $subtree[ix].has_children}folder{else}doc{/if}">
- <a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$subtree[ix].structure_id}" target="{$subtree[ix].content_id}" title="{$subtree[ix].structure_id}">{$subtree[ix].title|escape}{if $subtree[ix].page_alias} ({$subtree[ix].page_alias}){/if}</a>
- {/if}
- {/if}
- {/section}
- </div>
- </div>
-
- <ul class="list-inline">
- <li><a id="tree-moveUp" href="javascript:void(0)">{booticon iname="icon-arrow-up" ipackage="icons" iexplain="Up"}</a></li>
- <li><a id="tree-moveDown" href="javascript:void(0)">{booticon iname="icon-arrow-down" ipackage="icons" iexplain="Down"}</a></li>
- <li><a id="tree-moveLeft" href="javascript:void(0)">{booticon iname="icon-arrow-left" ipackage="icons" iexplain="Left"}</a></li>
- <li><a id="tree-moveRight" href="javascript:void(0)">{booticon iname="icon-arrow-right" ipackage="icons" iexplain="Right"}</a></li>
- {if !$no_delete}
- <li><a id="tree-remove" href="javascript:void(0)">{booticon iname="icon-trash" ipackage="icons" iexplain="Remove"}</a></li>
- {else}
- <input id="tree-remove" type="hidden" value="dummy">
- {/if}
- <li><a id="tree-convert" href="javascript:void(0)">{booticon ipackage=liberty iname="icon-folder-close" iexplain="Folder"} &larr; &rarr; {booticon iname="icon-file-alt" iexplain="Document"}</a></li>
- <li><small id="tree-tooltip"></small></li>
- </ul>
-</div>
-
-{form id="tree-store"}
- <input type="hidden" name="structure_string" id="structure_string" value="" />
- <input type="hidden" name="structure_id" value="{$gStructure->mInfo.structure_id}" />
- <input type="hidden" name="root_structure_id" value="{$gStructure->mInfo.root_structure_id}" />
- <div class="form-group submit">
- <noscript>
- <p class="warning">{tr}The Structure organisation system only works with javascript turned on{/tr}</p>
- </noscript>
- <input type="submit" class="btn btn-default" name="submit_structure" value="Save Changes" />
- </div>
- {formhelp note="To nest items, you first need to convert a page to a folder and then insert at least one item into the new folder before saving."}
- {if !$no_delete}
- {formhelp note="You can only delete a folder when it is empty."}
- {/if}
-{/form}
-{/strip}
-
-<script type="text/javascript">//<![CDATA[
- var tree = new DynamicTreeBuilder("tree");
- tree.init();
- DynamicTreePlugins.call(tree);
-//]]></script>
-<script type="text/javascript" src="{$smarty.const.UTIL_PKG_URL}javascript/libs/mygosu/actions.js"></script>
diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl
index 9b45694..ace495e 100644
--- a/templates/html_head_inc.tpl
+++ b/templates/html_head_inc.tpl
@@ -15,7 +15,7 @@
{* perhaps we can remove this as well at some point and load it using
$gBitThemes->loadJavascript(); *}
-{if $comments_ajax}
+{if $gBitSystem->isFeatureActive('comments_ajax')}
<script src="{$smarty.const.LIBERTY_PKG_URL}scripts/LibertyComment.js" type="text/javascript"></script>
<script type="text/javascript">
LibertyComment.ROOT_ID = {if $gContent->mContentId}{$gContent->mContentId}{elseif $commentsParentId}{$commentsParentId}{else}null{/if}; {* this is the content id - would be better as part of something in kernel but here it is until that day *}
diff --git a/templates/service_content_icon_inc.tpl b/templates/service_content_icon_inc.tpl
index 574c773..bb402f1 100644
--- a/templates/service_content_icon_inc.tpl
+++ b/templates/service_content_icon_inc.tpl
@@ -15,10 +15,10 @@
{if $gContent->hasUserPermissions()}
{assign var=iconClass value="highlight"}
{/if}
- {if $role_model }
- {smartlink ipackage=liberty ifile="content_role_permissions.php" ititle="Assign Permissions" booticon="icon-key" class=$iconClass ipackage=liberty ifile="content_permissions.php" content_id="$serviceHash.content_id"}
+ {if $smarty.const.ROLE_MODEL }
+ {smartlink ipackage=liberty ifile="content_role_permissions.php" ititle="Assign Permissions" booticon="icon-key" class=$iconClass ipackage=liberty ifile="content_permissions.php" content_id=$serviceHash.content_id}
{else}
- {smartlink ipackage=liberty ifile="content_permissions.php" ititle="Assign Permissions" booticon="icon-key" class=$iconClass ipackage=liberty ifile="content_permissions.php" content_id="$serviceHash.content_id"}
+ {smartlink ipackage=liberty ifile="content_permissions.php" ititle="Assign Permissions" booticon="icon-key" class=$iconClass ipackage=liberty ifile="content_permissions.php" content_id=$serviceHash.content_id}
{/if}
{/if}
{/if}
diff --git a/templates/structure_toc.tpl b/templates/structure_toc.tpl
index cd7c434..800580b 100755
--- a/templates/structure_toc.tpl
+++ b/templates/structure_toc.tpl
@@ -1 +1 @@
-<ul class="toc">{section name=sitem loop=$structure_tree}{include file="structures_toc_level.tpl" that=$structure_tree[sitem]}{/section}</ul>
+<ol class="structure-toc" id="structure-branch">{section name=sitem loop=$structure_tree}{include file="bitpackage:liberty/structure_toc_level.tpl" that=$structure_tree[sitem]}{/section}</ul>
diff --git a/templates/structure_toc_endul.tpl b/templates/structure_toc_endul.tpl
index 3d3a44c..8de35c6 100755
--- a/templates/structure_toc_endul.tpl
+++ b/templates/structure_toc_endul.tpl
@@ -1 +1 @@
-</ul>
+</ol>
diff --git a/templates/structure_toc_leaf.tpl b/templates/structure_toc_leaf.tpl
index 271edaa..45c63e4 100755
--- a/templates/structure_toc_leaf.tpl
+++ b/templates/structure_toc_leaf.tpl
@@ -1,4 +1,10 @@
-<li {if $structure_tree.structure_id==$smarty.request.structure_id}class="highlight"{/if}>
- {if $numbering && $structure_tree.prefix}<span class="numbering">{$structure_tree.prefix}</span>{/if}
- <a href="{$structure_tree.display_url|default:"`$smarty.const.WIKI_PKG_URL`index.php?structure_id=`$structure_tree.structure_id`"}">{$structure_tree.title|escape}</a>
-</li>
+{strip}
+<li {if $editingStructure}id="structure-node-{$structure_tree.structure_id}" content_id="{$structure_tree.content_id}" structure_id="{$structure_tree.structure_id}"{/if} {if $structure_tree.structure_id==$smarty.request.structure_id}class="highlight"{/if}>
+ {if $editingStructure}
+ <div class="inline-block">
+ <div class="btn btn-default btn-xs" onclick="deleteStructureNode('{$structure_tree.structure_id}','{$structure_tree.title|escape:javascript}')">{booticon iname="icon-trash" class="icon"}</div>
+ <span class="inline-block" style="padding:5px;">{booticon iname="icon-move" class="structure-sort-handle"}</span>
+ </div>
+ {/if}
+ <a href="{$structure_tree.display_url|default:"`$smarty.const.WIKI_PKG_URL`index.php?structure_id=`$structure_tree.structure_id`"}">{$structure_tree.title|escape}</a>
+{/strip}
diff --git a/templates/structure_toc_level.tpl b/templates/structure_toc_level.tpl
index 6c369f3..697d2dc 100755
--- a/templates/structure_toc_level.tpl
+++ b/templates/structure_toc_level.tpl
@@ -1 +1 @@
-<li {if $that.structure_id==$smarty.request.structure_id}class="highlight"{/if}><a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$that.structure_id}">{$that.title|escape}</a></li>{if $that.sub}<li><ul>{section name=xitem loop=$that.sub}{include file="structures_toc_level.tpl" that=$that.sub[xitem]}{/section}</ul></li>{/if}
+<li id="structure-node-{$that.structure_id}" content_id="{$that.content_id}" structure_id="{$that.structure_id}">{if $that.structure_id==$smarty.request.structure_id}class="highlight"{/if}><a href="{$smarty.const.WIKI_PKG_URL}index.php?structure_id={$that.structure_id}">{$that.title|escape}</a></li>{if $that.sub}<li><ul id="structure-branch-{$that.structure_id}">{section name=xitem loop=$that.sub}{include file="bitpackage:liberty/structure_toc_level.tpl" that=$that.sub[xitem]}{/section}</ul></li>{/if}
diff --git a/templates/structure_toc_startul.tpl b/templates/structure_toc_startul.tpl
index be10942..cb6eeee 100755
--- a/templates/structure_toc_startul.tpl
+++ b/templates/structure_toc_startul.tpl
@@ -1 +1 @@
-<ul class="toc">
+<ol class="structure-toc" id="structure-branch-{$structureId}" structure_id="{$structureId}">