| 1 | <mt:unless name="json"> |
|---|
| 2 | <$mt:setvar name="screen_type" value="dialog-screen insert-asset-dialog"$> |
|---|
| 3 | <mt:setvarblock name="page_title"><mt:if name="is_image"><__trans phrase="Insert Image"><mt:else><__trans phrase="Insert Asset"></mt:if></mt:setvarblock> |
|---|
| 4 | <mt:setvarblock name="html_head" append="1"> |
|---|
| 5 | <script type="text/javascript" src="<mt:var name="static_uri">js/tc/client.js?v=<mt:var name="mt_version_id" escape="url">"></script> |
|---|
| 6 | <script type="text/javascript" src="<mt:var name="static_uri">js/tc/json.js?v=<mt:var name="mt_version_id" escape="url">"></script> |
|---|
| 7 | <script type="text/javascript" src="<mt:var name="static_uri">js/dialog.js?v=<mt:var name="mt_version_id" escape="url">"></script> |
|---|
| 8 | <script type="text/javascript" src="<mt:var name="static_uri">js/assetdetail.js?v=<mt:var name="mt_version_id" escape="url">"></script> |
|---|
| 9 | |
|---|
| 10 | <script type="text/javascript"> |
|---|
| 11 | /* <![CDATA[ */ |
|---|
| 12 | function dialogClose(data) { |
|---|
| 13 | if (!data) { |
|---|
| 14 | closeDialog(); |
|---|
| 15 | return; |
|---|
| 16 | } |
|---|
| 17 | // user made a selection and clicked insert... |
|---|
| 18 | var f = document.forms['select_asset']; |
|---|
| 19 | var sel = dlg.panel.tableSelect.selected(); |
|---|
| 20 | f['id'].value = sel[0].value; |
|---|
| 21 | f.submit(); |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | function viewChange(ds, fn) { |
|---|
| 25 | checkOpened(); |
|---|
| 26 | if (fn) fn(ds); |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | var tableSelect; |
|---|
| 30 | var dlg; |
|---|
| 31 | function init() { |
|---|
| 32 | // setup |
|---|
| 33 | // assign isModal variable which is declared in assetdetail.js: |
|---|
| 34 | isModal = getByID("list-assets-dialog"); |
|---|
| 35 | |
|---|
| 36 | dlg = new Dialog.Simple("list-assets"); |
|---|
| 37 | var panel = new ListingPanel("asset"); |
|---|
| 38 | dlg.panel = panel; |
|---|
| 39 | |
|---|
| 40 | // hook into view updates so we can close any opened detail panel |
|---|
| 41 | var old_update = panel.datasource.onUpdate; |
|---|
| 42 | panel.datasource.onUpdate = function(ds) { viewChange(ds, old_update) }; |
|---|
| 43 | |
|---|
| 44 | panel.pager.setState(<mt:var name="pager_json">); |
|---|
| 45 | panel.parent = dlg; |
|---|
| 46 | dlg.open({}, dialogClose); |
|---|
| 47 | } |
|---|
| 48 | TC.attachLoadEvent( init ); |
|---|
| 49 | /* ]]> */ |
|---|
| 50 | </script> |
|---|
| 51 | </mt:setvarblock> |
|---|
| 52 | <mt:include name="dialog/header.tmpl"> |
|---|
| 53 | |
|---|
| 54 | <div id="list-assets-dialog"> |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | <div class="panel-header"> |
|---|
| 58 | <mt:setvarblock name="upload_new_file_link"> |
|---|
| 59 | <img src="<mt:var name="static_uri">images/status_icons/create.gif" alt="<__trans phrase="Upload New File">" width="9" height="9" /> |
|---|
| 60 | <mt:unless name="asset_select"><mt:setvar name="entry_insert" value="1"></mt:unless> |
|---|
| 61 | <a href="<mt:var name="script_url">?__mode=start_upload&_type=asset&blog_id=<mt:var name="blog_id">&dialog_view=1&<mt:if name="asset_select">asset_select=1&<mt:else>entry_insert=1&</mt:if>edit_field=<mt:var name="edit_field">&upload_mode=<mt:var name="upload_mode" escape="url">&<mt:if name="require_type">require_type=<mt:var name="require_type">&</mt:if>return_args=<mt:var name="return_args" escape="url"><mt:if name="user_id">&user_id=<mt:var name="user_id"></mt:if>" onclick="toggleHidden('list-assets-dialog'); toggleHidden('upload-asset-dialog'); return false"><mt:if name="is_image"><__trans phrase="Upload New Image"><mt:else><__trans phrase="Upload New File"></mt:if></a> |
|---|
| 62 | </mt:setvarblock> |
|---|
| 63 | <mt:if name="edit_blog_id"> |
|---|
| 64 | <mt:if name="can_upload"> |
|---|
| 65 | <mt:var name="upload_new_file_link"> |
|---|
| 66 | </mt:if> |
|---|
| 67 | <mt:else> |
|---|
| 68 | <mt:var name="upload_new_file_link"> |
|---|
| 69 | </mt:if> |
|---|
| 70 | </div> |
|---|
| 71 | <div class="listing-filter"> |
|---|
| 72 | <div class="listing-filter-inner inner pkg"> |
|---|
| 73 | <mt:if name="panel_searchable"> |
|---|
| 74 | <form action="" method="get" id="modal-search"> |
|---|
| 75 | <input type="text" value="<__trans phrase="Search">" class="search-input search-query" onblur="if(this.value==''){this.style.color=''; this.form.reset()}" onfocus="this.value = ''; this.style.color = '#000';" /> |
|---|
| 76 | <input type="image" class="search-command search-submit" src="<$mt:var name="static_uri"$>images/search-submit<mt:unless name="blog_id">-system</mt:unless>.gif" title="<__trans phrase="Search">" /> |
|---|
| 77 | <a href="javascript:void(0)" class="search-reset hidden"><__trans phrase="Reset"></a> |
|---|
| 78 | </form> |
|---|
| 79 | </mt:if> |
|---|
| 80 | </div> |
|---|
| 81 | </div> |
|---|
| 82 | |
|---|
| 83 | </mt:unless> |
|---|
| 84 | <mt:if name="object_loop"> |
|---|
| 85 | <mt:unless name="json"> |
|---|
| 86 | <form method="post" action="<mt:var name="script_url">" name="select_asset"> |
|---|
| 87 | <input type="hidden" name="__mode" value="<mt:if name="next_mode"><mt:var name="next_mode" escape="html"><mt:else>complete_insert</mt:if>" /> |
|---|
| 88 | <input type="hidden" name="_type" value="asset" /> |
|---|
| 89 | <input type="hidden" name="return_args" value="<mt:var name="return_args" escape="html">" /> |
|---|
| 90 | <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" /> |
|---|
| 91 | <input type="hidden" name="dialog_view" value="1" /> |
|---|
| 92 | <input type="hidden" name="id" value="" /> |
|---|
| 93 | <input type="hidden" name="edit_field" value="<mt:var name="edit_field">" /> |
|---|
| 94 | <mt:if name="edit_blog_id"> |
|---|
| 95 | <input type="hidden" name="blog_id" value="<mt:var name="edit_blog_id">" /> |
|---|
| 96 | <input type="hidden" name="direct_asset_insert" value="1" /> |
|---|
| 97 | <mt:unless name="asset_select"> |
|---|
| 98 | <input type="hidden" name="entry_insert" value="1" /> |
|---|
| 99 | </mt:unless> |
|---|
| 100 | </mt:if> |
|---|
| 101 | <mt:if name="asset_select"> |
|---|
| 102 | <input type="hidden" name="asset_select" value="1" /> |
|---|
| 103 | </mt:if><mt:if name="user_id"> |
|---|
| 104 | <input type="hidden" name="user_id" value="<mt:var name="user_id">" /> |
|---|
| 105 | </mt:if> |
|---|
| 106 | </form> |
|---|
| 107 | |
|---|
| 108 | <div class="list-wrapper" style="position: relative;"> |
|---|
| 109 | <div class="selector listing" id="selector"> |
|---|
| 110 | <form action="" method="get" onsubmit="return false"> |
|---|
| 111 | <table cellspacing="0" class="list-heading <mt:unless name="edit_blog_id">show-weblog </mt:unless><mt:if name="view_expanded">expanded<mt:else>compact</mt:if>"> |
|---|
| 112 | <thead> |
|---|
| 113 | <tr> |
|---|
| 114 | <th class="cb"><img src="<mt:var name="static_uri">images/spacer.gif" width="15" height="1"></th> |
|---|
| 115 | <th id="as-file-status"><img src="<mt:var name="static_uri">images/status_icons/invert-flag.gif" alt="<__trans phrase="Status">" title="<__trans phrase="Status">" width="9" height="9" /></th> |
|---|
| 116 | <th class="panel-label"><__trans phrase="Asset Name"></th> |
|---|
| 117 | <mt:unless name="edit_blog_id"> |
|---|
| 118 | <th id="as-weblog"><__trans phrase="Blog"></th> |
|---|
| 119 | </mt:unless> |
|---|
| 120 | <th class="panel-description"><span class="detail"><__trans phrase="Size"></span></th> |
|---|
| 121 | </tr> |
|---|
| 122 | </thead> |
|---|
| 123 | </table> |
|---|
| 124 | |
|---|
| 125 | <div class="list-data-wrapper-modal list-data"> |
|---|
| 126 | </mt:unless> |
|---|
| 127 | <div class="list-data-layout-modal"> |
|---|
| 128 | <table cellspacing="0" class="list-data scrollable" id="assetDisplay"> |
|---|
| 129 | <tbody> |
|---|
| 130 | <mt:loop name="object_loop"> |
|---|
| 131 | <tr id="asset-<mt:var name="id">" class="<mt:if name="__odd__">odd<mt:else>even</mt:if>"> |
|---|
| 132 | <td class="cb"><input type="hidden" id="asset-<mt:var name="id">-json" value="<mt:var name="metadata_json" escape="html">" /><input type="radio" name="id" value="<mt:var name="id">" class="select" id="asset-radio-<mt:var name="id">" /></td> |
|---|
| 133 | <td class="status-<mt:if name="file_is_missing">missing<mt:else>publish</mt:if>"><img src="<mt:var name="static_uri">images/spacer.gif" <mt:if name="file_is_missing">alt="<__trans phrase="Pending">"<mt:else>alt="<__trans phrase="Published">"</mt:if> width="9" height="9" /></td> |
|---|
| 134 | <td class="panel-label"> |
|---|
| 135 | |
|---|
| 136 | <mt:if name="has_thumbnail"> |
|---|
| 137 | <a href="javascript:void(0)" onclick="return toggleAssetDetails('<mt:var name="id">');" title="<$mt:var name="file_name"$>"><$mt:var name="label" escape="html"$></a> |
|---|
| 138 | <mt:else> |
|---|
| 139 | <$mt:var name="label" escape="html"$> |
|---|
| 140 | </mt:if> |
|---|
| 141 | <div id="asset-<mt:var name="id">-preview" class="asset-preview"> |
|---|
| 142 | <div id="asset-<mt:var name="id">-preview-inner" class="asset-preview-inner"></div> |
|---|
| 143 | </div> |
|---|
| 144 | </td> |
|---|
| 145 | <mt:unless name="edit_blog_id"> |
|---|
| 146 | <td class="detail"><a href="<mt:var name="script_url">?__mode=list_assets&blog_id=<mt:var name="blog_id">"><mt:var name="blog_name" escape="html"></a></td> |
|---|
| 147 | </mt:unless> |
|---|
| 148 | <td class="panel-description"> |
|---|
| 149 | <span class="detail"> |
|---|
| 150 | <mt:if name="file_size_formatted"> |
|---|
| 151 | <span class="float_desc" title="<mt:var name="file_size">"><mt:var name="file_size_formatted"></span> |
|---|
| 152 | <mt:else> |
|---|
| 153 | <span class="float_desc"><mt:var name="file_size"></span> |
|---|
| 154 | </mt:if> |
|---|
| 155 | <span class="link"> |
|---|
| 156 | <mt:if name="url"><a href="<mt:var name="url">" target="view_uploaded" title="<__trans phrase="View Asset">"><img src="<mt:var name="static_uri">images/spacer.gif" alt="<__trans phrase="View Asset">" width="13" height="9" /></a><mt:else> </mt:if> |
|---|
| 157 | </span> |
|---|
| 158 | </span> |
|---|
| 159 | </td> |
|---|
| 160 | </tr> |
|---|
| 161 | </mt:loop> |
|---|
| 162 | <tbody> |
|---|
| 163 | </table> |
|---|
| 164 | </div> |
|---|
| 165 | <mt:unless name="json"> |
|---|
| 166 | </div> |
|---|
| 167 | </form> |
|---|
| 168 | </div> |
|---|
| 169 | </div> |
|---|
| 170 | |
|---|
| 171 | <div class="pagination"></div> |
|---|
| 172 | |
|---|
| 173 | <div class="insert_button_spacing"> </div> |
|---|
| 174 | |
|---|
| 175 | <div class="actions-bar"> |
|---|
| 176 | <div class="actions-bar-inner pkg actions"> |
|---|
| 177 | <form action="" method="get" onsubmit="return false"> |
|---|
| 178 | <button |
|---|
| 179 | type="submit" |
|---|
| 180 | accesskey="s" |
|---|
| 181 | title="<mt:if name="is_image"><__trans phrase="Next (s)"><mt:else><__trans phrase="Insert (s)"></mt:if>" |
|---|
| 182 | class="primary-button close disabled-button" |
|---|
| 183 | disabled="true" |
|---|
| 184 | ><mt:if name="is_image"><__trans phrase="Continue"><mt:else><__trans phrase="Insert"></mt:if></button> |
|---|
| 185 | <button |
|---|
| 186 | onclick="closeDialog(); return false" |
|---|
| 187 | type="submit" |
|---|
| 188 | accesskey="x" |
|---|
| 189 | class="cancel" |
|---|
| 190 | title="<__trans phrase="Cancel (x)">" |
|---|
| 191 | ><__trans phrase="Cancel"></button> |
|---|
| 192 | </form> |
|---|
| 193 | </div> |
|---|
| 194 | </div> |
|---|
| 195 | |
|---|
| 196 | </mt:unless> |
|---|
| 197 | <mt:else> |
|---|
| 198 | <mtapp:statusmsg |
|---|
| 199 | id="no-assets" |
|---|
| 200 | class="info"> |
|---|
| 201 | <__trans phrase="No assets could be found."> |
|---|
| 202 | </mtapp:statusmsg> |
|---|
| 203 | <mt:unless name="json"> |
|---|
| 204 | <div class="actions-bar"> |
|---|
| 205 | <div class="actions-bar-inner pkg actions"> |
|---|
| 206 | <form action="" method="get" onsubmit="return false"> |
|---|
| 207 | <button |
|---|
| 208 | onclick="closeDialog(); return false" |
|---|
| 209 | type="submit" |
|---|
| 210 | accesskey="x" |
|---|
| 211 | class="cancel" |
|---|
| 212 | title="<__trans phrase="Cancel (x)">" |
|---|
| 213 | ><__trans phrase="Cancel"></button> |
|---|
| 214 | </form> |
|---|
| 215 | </div> |
|---|
| 216 | </div> |
|---|
| 217 | </mt:unless> |
|---|
| 218 | </mt:if> |
|---|
| 219 | |
|---|
| 220 | <mt:unless name="json"> |
|---|
| 221 | |
|---|
| 222 | |
|---|
| 223 | </div> |
|---|
| 224 | |
|---|
| 225 | <div id="upload-asset-dialog" class="hidden"> |
|---|
| 226 | <mt:setvar name="included_upload_asset" value="1"> |
|---|
| 227 | |
|---|
| 228 | <mt:include name="include/asset_upload.tmpl"> |
|---|
| 229 | |
|---|
| 230 | </div> |
|---|
| 231 | |
|---|
| 232 | <mt:include name="dialog/footer.tmpl"> |
|---|
| 233 | </mt:unless> |
|---|