blob: ea3e213fcb09f0360ae9bb9f4cf3394718bd433e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
{literal}
<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 );
var row = document.getElementById( responseHash.content_id+"feedback" );
row.innerHTML = responseHash.feedback;
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>
{/literal}
{strip}
<div id="structureaddresult"></div>
<div class="edit structurecontent">
<div class="header">
<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 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}
</select>
{formhelp note="Format: Position in tree - Title of Content, insert after, structure_id"}
{/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 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}
{* 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>
<tr>
<th></th>
<th>{tr}Title{/tr}</th>
<th>{tr}Type{/tr}</th>
<th>{tr}Author{/tr}</th>
</tr>
</thead>
<tbody>
{section loop=$contentListHash name=cx}
<tr class="item {cycle values="even,odd"}" id="{$contentListHash[cx].content_id}li">
<td>
{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 $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>
<a target="_new" href="{$contentListHash[cx].display_url}">
{booticon ipackage="icons" iname="icon-zoom-in" iexplain="View (in new window)"}
</a>
</td>
<td class="title">
{if $contentListHash[cx].thumbnail_url}
<img class="img-responsive" src="{$contentListHash[cx].thumbnail_url}" alt="{tr}Thumbnail{/tr}" />
{/if}
{$contentListHash[cx].title}
<span id="{$contentListHash[cx].content_id}feedback"></span>
</td>
<td class="description" id="{$contentListHash[cx].content_id}item">
{$contentListHash[cx].content_name}
</td>
<td class="author">
{displayname hash=$contentListHash[cx]}
</td>
</tr>
{/section}
</tbody>
</table>
{/forminput}
</div>
<div class="form-group submit">
<input type="submit" class="btn btn-default" onclick="submitStructure(this.form);return false;" name="create" value="{tr}Add Content{/tr}" />
<input type="submit" class="btn btn-default" name="done" value="{tr}Done{/tr}" />
</div>
{/form}
</div>
{/strip}
|