├── .gitignore ├── README.md ├── assets ├── .DS_Store ├── css │ ├── .DS_Store │ ├── colorbox.css │ ├── dropzone.css │ ├── images │ │ ├── controls.png │ │ └── loading.gif │ ├── jquery-ui.css │ └── mgr.css ├── images │ ├── close-dialog.png │ ├── edit-icon.png │ ├── gif-load.gif │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ ├── sort.png │ ├── trash-over.png │ └── trash.png └── js │ ├── .DS_Store │ ├── app.js │ ├── bootstrap.js │ ├── dropzone.js │ ├── form2js.js │ ├── handlebars.js │ ├── jcrop.js │ ├── jquery-ui.js │ ├── jquery.colorbox.js │ ├── jquery.js │ ├── jquery.min.js │ ├── jquery.quicksand.js │ ├── jquery.tabify.js │ └── multisortable.js ├── composer.json ├── controllers ├── .DS_Store ├── APIController.php ├── AssetController.php ├── BaseController.php ├── ErrorController.php ├── PageController.php ├── PageassetController.php └── index.class.php ├── docs ├── changelog.txt ├── license.txt └── readme.txt ├── elements ├── .DS_Store ├── plugins │ └── assetmanager.plugin.php └── snippets │ ├── .DS_Store │ ├── asset.php │ ├── getPageAssets.php │ ├── resize.php │ ├── scale2h.php │ ├── scale2w.php │ └── src.php ├── lexicon ├── .DS_Store └── en │ └── default.inc.php ├── model ├── .DS_Store ├── Snippet.php ├── assman │ ├── asset.class.php │ ├── metadata.mysql.php │ ├── mysql │ │ ├── asset.class.php │ │ ├── asset.map.inc.php │ │ ├── pageasset.class.php │ │ └── pageasset.map.inc.php │ └── pageasset.class.php ├── migrations │ ├── install.php │ └── uninstall.php ├── schema │ └── assman.mysql.schema.xml └── seeds │ ├── base │ ├── modContentType.php │ ├── modMenu.php │ └── modSystemSetting.php │ └── test │ └── Asset.php ├── phpunit.xml ├── tests ├── assetTest.php ├── assets │ └── image.jpg └── bootstrap.php └── views ├── error └── 404.php ├── footer.php ├── group └── manage.php ├── header.php └── main ├── assets.php ├── index.php ├── pageassets.tpl ├── pageassets_new.tpl ├── settings.php ├── test.html └── verify.php /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.lock 3 | *.DS_Store 4 | *.swp 5 | *.out 6 | composer.phar 7 | phpunit.phar 8 | vendor/ 9 | .idea/ 10 | .DS_Store 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Asset Manager 2 | ============= 3 | 4 | This Repository is no longer maintained. 5 | 6 | Asset Manager Media Library for MODX Revolution 7 | 8 | This package adds asset management functionality to MODX Revolution so you can easily upload and edit images and other assets and attach them to any MODX page. Because it stores all asset data in a custom database table, you can easily search for assets by complex criteria or manipulate the search queries for custom reporting. 9 | 10 | The end result of using the Asset Manager can be similar to adding multiple image Template Variables to a template (e.g. using MIGX), but the user interface and backend data model is cleaner. 11 | 12 | Requires PHP 5.3 or greater and MODX 2.3 (version 1.0 was compatible with MODX 2.2.14). 13 | 14 | 15 | ## Features: 16 | 17 | - Drag and drop images to upload them using Dropzone 18 | - Automatic detection of MIME-type and creation of MODX content types. 19 | - Galleries of Images 20 | - Output filters for easy image resizing (like pThumb, but better), including scale-to-width, scale-to-height, thumbnails and cropping. 21 | - Relies on standard Packagist packages to conduct image manipulation 22 | 23 | ![The Asset Manager in Action](https://raw.githubusercontent.com/wiki/craftsmancoding/assetmanager/images/asset-manager-tab-w-images.jpg "The Asset Manager in Action") 24 | 25 | 26 | 27 | ## Thanks To 28 | 29 | This package would not be possible without the beautiful and brilliant work of other coders. 30 | 31 | - [Dropzone](https://www.dropzonejs.com/) -- a brilliant drag and drop file uploader with image previews. 32 | - [Quicksand](http://razorjack.net/quicksand/) -- a great sorting/animation jQuery library. 33 | - [jCrop](http://deepliquid.com/content/Jcrop.html) -- provides image cropping functionality. 34 | - [Placehold.it](https://placehold.it/) -- a quick and simple image placeholding service. 35 | 36 | 37 | ## Technical Note: 38 | 39 | The Asset Manager helps maintain an ordered folder structure for your images and other assets while 40 | keeping database records on those file assets. Images are not stored as binary data in the database, 41 | so it is critical that the database and the filesystem be kept in sync. Do not meddle around with the 42 | files on the filesystem that have been put in place by the Asset Manager! Doing so may break the URLs 43 | to your images. 44 | 45 | You are forced to use the UI to upload assets so that the database "knows" about the assets you have added. The Asset 46 | Manager won't "know" about an asset if you upload it manually (e.g. using SFTP). 47 | 48 | 49 | Author: everett@craftsmancoding.com 50 | -------------------------------------------------------------------------------- /assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/.DS_Store -------------------------------------------------------------------------------- /assets/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/css/.DS_Store -------------------------------------------------------------------------------- /assets/css/colorbox.css: -------------------------------------------------------------------------------- 1 | /* 2 | Colorbox Core Style: 3 | The following CSS is consistent between example themes and should not be altered. 4 | */ 5 | #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} 6 | #cboxWrapper {max-width:none;} 7 | #cboxOverlay{position:fixed; width:100%; height:100%;} 8 | #cboxMiddleLeft, #cboxBottomLeft{clear:left;} 9 | #cboxContent{position:relative;} 10 | #cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} 11 | #cboxTitle{margin:0;} 12 | #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} 13 | #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} 14 | .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} 15 | .cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} 16 | #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} 17 | 18 | /* 19 | User Style: 20 | Change the following styles to modify the appearance of Colorbox. They are 21 | ordered & tabbed in a way that represents the nesting of the generated HTML. 22 | */ 23 | #cboxOverlay{background:#29292c;opacity: 0.6 !important;} 24 | #colorbox{outline:0;} 25 | #cboxContent{margin-top:32px; overflow:visible; background:#000;} 26 | .cboxIframe{background:#fff;} 27 | #cboxError{padding:50px; border:1px solid #ccc;} 28 | #cboxLoadedContent{background:#000; padding:1px;} 29 | #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} 30 | #cboxLoadingOverlay{background:#000;} 31 | #cboxTitle{position:absolute; top:-22px; left:0; color:#000;} 32 | #cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;} 33 | 34 | /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ 35 | #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;} 36 | 37 | /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ 38 | #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} 39 | 40 | #cboxPrevious{background-position:0px 0px; right:44px;} 41 | #cboxPrevious:hover{background-position:0px -25px;} 42 | #cboxNext{background-position:-25px 0px; right:22px;} 43 | #cboxNext:hover{background-position:-25px -25px;} 44 | #cboxClose{background-position:-50px 0px;right: 0px;} 45 | #cboxClose:hover{background-position:-50px -25px;} 46 | .cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;} 47 | .cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;} 48 | .cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;} 49 | .cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;} 50 | .cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;} 51 | -------------------------------------------------------------------------------- /assets/css/dropzone.css: -------------------------------------------------------------------------------- 1 | /* The MIT License */ 2 | .dropzone-wrap { 3 | background: rgba(0,0,0,0.02); 4 | } 5 | .dropzone-previews, 6 | .dropzone-previews * { 7 | -webkit-box-sizing: border-box; 8 | -moz-box-sizing: border-box; 9 | box-sizing: border-box; 10 | } 11 | .dz-label { 12 | text-align: center; 13 | font-size: 16px; 14 | margin-top: 10px; 15 | color: #c7c7c7; 16 | font-size: 20px; 17 | display: block; 18 | float: left; 19 | font-weight: normal; 20 | } 21 | 22 | .dz-default{ 23 | color: #555; 24 | border: 1px solid #ccc; 25 | background: #fff; 26 | vertical-align: top; 27 | display: block; 28 | float: left; 29 | padding: 5px 20px; 30 | cursor: pointer; 31 | margin-left: 15px; 32 | border-radius: 3px; 33 | -moz-border-radius: 3px; 34 | -webkit-border-radius: 3px; 35 | margin-top: 4px; 36 | } 37 | 38 | .dz-default:hover { 39 | -webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); 40 | box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08); 41 | } 42 | 43 | .dropzone-wrap .dz-preview, 44 | .dropzone-previews .dz-preview { 45 | background: rgba(255,255,255,0.8); 46 | position: relative; 47 | display: inline-block; 48 | margin: 17px; 49 | vertical-align: top; 50 | border: 1px solid #acacac; 51 | padding: 6px 6px 6px 6px; 52 | } 53 | .dropzone-wrap .dz-preview.dz-file-preview [data-dz-thumbnail], 54 | .dropzone-previews .dz-preview.dz-file-preview [data-dz-thumbnail] { 55 | display: none; 56 | } 57 | .dropzone-wrap .dz-preview .dz-details, 58 | .dropzone-previews .dz-preview .dz-details { 59 | width: 100px; 60 | height: 100px; 61 | position: relative; 62 | background: #ebebeb; 63 | padding: 5px; 64 | margin-bottom: 22px; 65 | } 66 | .dropzone-wrap .dz-preview .dz-details .dz-filename, 67 | .dropzone-previews .dz-preview .dz-details .dz-filename { 68 | overflow: hidden; 69 | height: 100%; 70 | } 71 | .dropzone-wrap .dz-preview .dz-details img, 72 | .dropzone-previews .dz-preview .dz-details img { 73 | position: absolute; 74 | top: 0; 75 | left: 0; 76 | width: 100px; 77 | height: 100px; 78 | } 79 | .dropzone-wrap .dz-preview .dz-details .dz-size, 80 | .dropzone-previews .dz-preview .dz-details .dz-size { 81 | position: absolute; 82 | bottom: -28px; 83 | left: 3px; 84 | height: 28px; 85 | line-height: 28px; 86 | } 87 | .dropzone-wrap .dz-preview.dz-error .dz-error-mark, 88 | .dropzone-previews .dz-preview.dz-error .dz-error-mark { 89 | display: block; 90 | } 91 | .dropzone-wrap .dz-preview.dz-success .dz-success-mark, 92 | .dropzone-previews .dz-preview.dz-success .dz-success-mark { 93 | display: block; 94 | } 95 | .dropzone-wrap .dz-preview:hover .dz-details img, 96 | .dropzone-previews .dz-preview:hover .dz-details img { 97 | display: none; 98 | } 99 | .dropzone-wrap .dz-preview .dz-success-mark, 100 | .dropzone-previews .dz-preview .dz-success-mark, 101 | .dropzone-wrap .dz-preview .dz-error-mark, 102 | .dropzone-previews .dz-preview .dz-error-mark { 103 | display: none; 104 | position: absolute; 105 | width: 40px; 106 | height: 40px; 107 | font-size: 30px; 108 | text-align: center; 109 | right: -10px; 110 | top: -10px; 111 | } 112 | .dropzone-wrap .dz-preview .dz-success-mark, 113 | .dropzone-previews .dz-preview .dz-success-mark { 114 | color: #8cc657; 115 | } 116 | .dropzone-wrap .dz-preview .dz-error-mark, 117 | .dropzone-previews .dz-preview .dz-error-mark { 118 | color: #ee162d; 119 | } 120 | .dropzone-wrap .dz-preview .dz-progress, 121 | .dropzone-previews .dz-preview .dz-progress { 122 | position: absolute; 123 | top: 100px; 124 | left: 6px; 125 | right: 6px; 126 | height: 6px; 127 | background: #d7d7d7; 128 | display: none; 129 | } 130 | .dropzone-wrap .dz-preview .dz-progress .dz-upload, 131 | .dropzone-previews .dz-preview .dz-progress .dz-upload { 132 | position: absolute; 133 | top: 0; 134 | bottom: 0; 135 | left: 0; 136 | width: 0%; 137 | background-color: #8cc657; 138 | } 139 | .dropzone-wrap .dz-preview.dz-processing .dz-progress, 140 | .dropzone-previews .dz-preview.dz-processing .dz-progress { 141 | display: block; 142 | } 143 | .dropzone-wrap .dz-preview .dz-error-message, 144 | .dropzone-previews .dz-preview .dz-error-message { 145 | display: none; 146 | position: absolute; 147 | top: -5px; 148 | left: -20px; 149 | background: rgba(245,245,245,0.8); 150 | padding: 8px 10px; 151 | color: #800; 152 | min-width: 140px; 153 | max-width: 500px; 154 | z-index: 500; 155 | } 156 | .dropzone-wrap .dz-preview:hover.dz-error .dz-error-message, 157 | .dropzone-previews .dz-preview:hover.dz-error .dz-error-message { 158 | display: block; 159 | } 160 | -------------------------------------------------------------------------------- /assets/css/images/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/css/images/controls.png -------------------------------------------------------------------------------- /assets/css/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/css/images/loading.gif -------------------------------------------------------------------------------- /assets/css/mgr.css: -------------------------------------------------------------------------------- 1 | #assman_header a, 2 | #assman_canvas a, 3 | .assman_nav_item a { 4 | color: #3697cd; 5 | text-decoration: none; 6 | } 7 | 8 | 9 | 10 | #assman_header a:hover, 11 | #assman_canvas a:hover, 12 | .assman_nav_item a:hover { 13 | color: #3697cd; 14 | } 15 | 16 | /** 17 | * CMPs 18 | */ 19 | #assman_canvas { 20 | background: #fff; 21 | margin: 0px 10px 0px; 22 | padding-bottom: 20px; 23 | -webkit-box-shadow: 0px 0px 3px -1px rgba(181,179,181,1); 24 | -moz-box-shadow: 0px 0px 3px -1px rgba(181,179,181,1); 25 | box-shadow: 0px 0px 3px -1px rgba(181,179,181,1); 26 | } 27 | 28 | .assman_canvas_inner { 29 | padding: 20px 20px 0 20px; 30 | } 31 | 32 | h2.assman_cmp_heading { 33 | margin-bottom: 0px; 34 | } 35 | 36 | #assman_nav { 37 | list-style-type:none; 38 | padding:0; 39 | list-style-type: none; 40 | padding: 0; 41 | float: right; 42 | margin: 40px 10px 5px 10px; 43 | font-size: 12px; 44 | } 45 | 46 | .assman_nav_item { 47 | display:inline; 48 | padding: 10px; 49 | color: #3697cd; 50 | font-size: 13px; 51 | } 52 | 53 | .assman_nav_item a.current { 54 | background: #fff; 55 | padding: 7px 10px; 56 | border-top: 3px solid #3697cd; 57 | } 58 | /* not sure if we need this... */ 59 | .assman_nav_home { 60 | 61 | } 62 | 63 | #assman_footer { 64 | text-align: center; 65 | display: block; 66 | margin-top: 20px; 67 | } 68 | .assman_donation_link { 69 | 70 | } 71 | .assman_bug_link { 72 | 73 | } 74 | .assman_wiki_link { 75 | 76 | } 77 | 78 | #assman_copyright { 79 | color: #727272; 80 | margin-top: 15px; 81 | font-style: italic; 82 | text-align: center; 83 | } 84 | 85 | #assman_buttons { 86 | width: 100%; 87 | } 88 | #assman_buttons ul:before, 89 | #assman_buttons ul:after { 90 | content: " "; 91 | display: table; 92 | } 93 | #assman_buttons ul:after { 94 | clear: both; 95 | } 96 | #assman_buttons ul { 97 | width: 102%; 98 | margin: -1% 0 0 -1%; 99 | /* clearfix */ 100 | *zoom: 1; 101 | } 102 | #assman_buttons ul li { 103 | display: table; 104 | position: relative; 105 | float: left; 106 | width: 32%; 107 | margin: 0; 108 | padding: 1% 0 0 1%; 109 | } 110 | 111 | 112 | /* #assets_tab { 113 | margin-top: 10px; 114 | } 115 | */ 116 | #assets_tab li.li_page_image { 117 | float: left; 118 | border: 1px solid #eee; 119 | /* padding: 5px; */ 120 | margin: 5px 0px 20px 20px; 121 | position: relative; 122 | -webkit-box-shadow: 0 8px 6px -6px #ddd; 123 | -moz-box-shadow: 0 8px 6px -6px #ddd; 124 | box-shadow: 0 8px 6px -6px #ddd 125 | } 126 | 127 | .assman_nav_item a.current { 128 | font-weight: bold; 129 | } 130 | 131 | 132 | 133 | .btn, 134 | .assman-btn { 135 | background: #fff; 136 | border: 1px solid #e4e4e4; 137 | border-radius: 4px; 138 | -webkit-border-radius: 4px; 139 | -moz-border-radius: 4px; 140 | padding: 7px 15px; 141 | color: #6a6a6a !important; 142 | font-weight: normal; 143 | font-size: 14px; 144 | text-shadow: none !important; 145 | cursor: pointer !important; 146 | } 147 | 148 | .btn-primary { 149 | background: #2aa798; 150 | color: #fff !important; 151 | border: 1px solid #2aa798; 152 | } 153 | 154 | .btn-info { 155 | background: #556c88; 156 | color: #fff !important; 157 | border: 1px solid #556c88; 158 | } 159 | 160 | .btn-primary:hover { 161 | background: #02958f; 162 | } 163 | 164 | .btn-large { 165 | padding: 15px 25px !important; 166 | font-size: 16px; 167 | } 168 | 169 | .btn-mini { 170 | padding: 5px 10px !important; 171 | font-size: 10px; 172 | } 173 | 174 | 175 | 176 | .icon-trash { 177 | background-position: -456px 0; 178 | } 179 | 180 | .drop-delete { 181 | margin-top: 15px; 182 | border: 1px dashed #a7a7a7; 183 | display: block; 184 | font-weight: bold; 185 | font-size: 16px; 186 | text-align: center; 187 | padding: 15px; 188 | } 189 | 190 | .dz-link-wrap { 191 | width: 380px; 192 | margin: 0 auto; 193 | } 194 | 195 | .selected { 196 | background: #eae9eb; 197 | } 198 | 199 | .li-to-be-removed { 200 | width: 30px !important; 201 | height: auto !important; 202 | } 203 | 204 | .img-to-be-removed { 205 | width: 30px; 206 | } 207 | 208 | div > label.x-form-cb-label { 209 | display: inline; 210 | } 211 | 212 | 213 | .state { 214 | margin-bottom: 0px !important; 215 | } 216 | 217 | 218 | #page_images li.inactive { 219 | border: 1px solid #ddd; 220 | } 221 | 222 | .img-info-wrap { 223 | position: relative; 224 | min-height:180px; 225 | } 226 | 227 | .img-info-inner { 228 | position: absolute; 229 | bottom: 0px; 230 | background: #000; 231 | background-color: rgba(0,0,0,0.3); 232 | width: 100%; 233 | color: #fff; 234 | } 235 | 236 | .img-info-inner p { 237 | margin: 3px 5px; 238 | } 239 | #page_images li.inactive .img-info-wrap a img { 240 | filter: url("data:image/svg+xml;utf8,#grayscale"); /* Firefox 10+, Firefox on Android */ 241 | filter: gray; /* IE6-9 */ 242 | -webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */ 243 | opacity:0.4; 244 | filter:alpha(opacity=40); /* For IE8 and earlier */ 245 | } 246 | 247 | #image_upload { 248 | position: relative; 249 | } 250 | 251 | 252 | .image-nav { 253 | display: none; 254 | } 255 | 256 | 257 | .li_page_image .remove-img { 258 | position: absolute; 259 | top: -5px; 260 | right: -5px; 261 | width: 15px; 262 | height: 15px; 263 | /* background: url('../images/remove-icon.png') no-repeat; */ 264 | text-indent: -999999px; 265 | display: none; 266 | } 267 | 268 | .asset-edit-inner { 269 | width: 800px; 270 | margin: 15px auto; 271 | } 272 | .row-input { 273 | display: block; 274 | margin-bottom: 10px; 275 | 276 | } 277 | 278 | .row-input .row-lbl { 279 | font-weight: bold; 280 | font-size: 12px; 281 | color: #707070; 282 | width: 120px; 283 | float: left; 284 | margin-right: 20px; 285 | text-align: right; 286 | } 287 | 288 | .row-input .row-field, 289 | select { 290 | border: 1px solid; 291 | -moz-border-radius: 2px; 292 | -webkit-border-radius: 2px; 293 | -o-border-radius: 2px; 294 | -ms-border-radius: 2px; 295 | -khtml-border-radius: 2px; 296 | border-radius: 2px; 297 | position: relative; 298 | background-color: #fbfbfb; 299 | background-image: none; 300 | border-color: #CCCCCC; 301 | padding: 5px; 302 | width: 70%; 303 | } 304 | 305 | select { 306 | width: 50%; 307 | height: 28px; 308 | padding: 0px; 309 | } 310 | 311 | .row-input .non-input { 312 | font-weight: bold; 313 | } 314 | 315 | .row-input input[type="checkbox"] { 316 | width: auto; 317 | } 318 | 319 | .ui-dialog-titlebar-close { 320 | /* background: #ddd url('../images/close-dialog.png') 4px 5px no-repeat; */ 321 | border: 1px solid #bbb; 322 | border-radius: 2px; 323 | -moz-border-radius: 2px; 324 | -webkit-border-radius: 2px; 325 | } 326 | 327 | 328 | /**** Alerts*****/ 329 | .danger { 330 | margin: 10px; 331 | padding: 5px; 332 | background: #ffddde; 333 | border: 1px solid #9b0004; 334 | color: #9b0004; 335 | border-radius: 3px; 336 | -webkit-border-radius: 3px; 337 | -moz-border-radius: 3px; 338 | } 339 | 340 | .success { 341 | margin: 10px; 342 | padding: 5px; 343 | background: #dae8bf; 344 | border: 1px solid #64812e; 345 | color: #4e6424; 346 | border-radius: 3px; 347 | -webkit-border-radius: 3px; 348 | -moz-border-radius: 3px; 349 | } 350 | 351 | .asset_category_modal { 352 | padding: 5px 0px; 353 | width: 75%; 354 | float: right; 355 | } 356 | 357 | .asset_category_modal li { 358 | float: left; 359 | margin: 7px 2px; 360 | } 361 | 362 | #asset_category_filters li { 363 | display: inline-block; 364 | margin-bottom: 20px; 365 | } 366 | 367 | .asset_category_modal li a, 368 | #asset_category_filters li a { 369 | padding: 5px 10px; 370 | border: 1px solid #d8d8d8; 371 | background: #e4e4e4; 372 | color: #7c7c7c; 373 | text-decoration: none; 374 | } 375 | 376 | #asset_category_filters li.current a, 377 | #asset_category_filters li.first a { 378 | border: 1px solid #444444; 379 | background: #444444; 380 | font-weight: bold; 381 | color: #fff; 382 | } 383 | 384 | 385 | table.classy-assetmgr { 386 | width: 100%; 387 | } 388 | 389 | table.classy-assetmgr thead tr { 390 | background: #e4e9ee !important; 391 | } 392 | 393 | table.classy-assetmgr thead tr th { 394 | padding: 12px 5px; 395 | color: #696969; 396 | font-weight: bold; 397 | font-size: 12px; 398 | } 399 | 400 | table.classy-assetmgr thead a { 401 | color: #fff; 402 | } 403 | 404 | table thead a:hover { 405 | color: #fff; 406 | text-decoration: underline; 407 | } 408 | 409 | table.classy-assetmgr tr:nth-child(even) {background: #f5f6f9} 410 | table.classy-assetmgr tr:nth-child(odd) {background: #fff} 411 | 412 | .span70 { 413 | width: 70%; 414 | } 415 | 416 | .span20 { 417 | width: 20%; 418 | } 419 | 420 | .span100 { 421 | width: 100%; 422 | display: block; 423 | } 424 | .pull-right { 425 | float: right; 426 | } 427 | .pull-left { 428 | float: left; 429 | } 430 | 431 | #assman_msg { 432 | position: absolute; 433 | top: 5px; 434 | right: 10px; 435 | } 436 | #cboxContent { 437 | background: #fff !important; 438 | } 439 | #cboxLoadedContent { 440 | padding: 20px; 441 | background: #fff !important; 442 | } 443 | 444 | .asset-modal-controls { 445 | position: absolute; 446 | bottom: 0px; 447 | background: #fff; 448 | padding: 10px; 449 | border-top: 1px solid #ddd; 450 | display: block; 451 | width: 100%; 452 | } 453 | 454 | #asset_modal_form-inner { 455 | margin: 20px; 456 | margin-bottom: 70px; 457 | } 458 | #asset_groups { 459 | margin: 20px 0px; 460 | } 461 | #asset_groups li { 462 | margin: 5px 0px; 463 | background: url('../images/sort.png') 0px 6px no-repeat; 464 | } 465 | 466 | #asset_groups .row-field { 467 | width: 50%; 468 | margin-left: 20px; 469 | } 470 | 471 | #modal_asset_img img { 472 | max-width: 100%; 473 | } 474 | 475 | .fback-dz { 476 | display: none; 477 | } 478 | 479 | 480 | .fa-assmam-trash-icon { 481 | display: inline-block; 482 | font-family: FontAwesome; 483 | font-style: normal; 484 | font-weight: 400; 485 | line-height: 1; 486 | -webkit-font-smoothing: antialiased; 487 | font-size: 26px; 488 | float: left; 489 | 490 | } 491 | 492 | .over-trash .fa-assmam-trash-icon { 493 | color: red; 494 | } 495 | 496 | 497 | .fa-assmam-trash-icon:before { 498 | content: "\f1f8"; 499 | } 500 | /* The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements. 501 | j.mp/bestclearfix */ 502 | .clear:before, .clear:after, 503 | .clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; visibility: hidden; } 504 | .clear:after, 505 | .clearfix:after { clear: both; } 506 | /* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */ 507 | .clear, 508 | .clearfix { zoom: 1; } -------------------------------------------------------------------------------- /assets/images/close-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/close-dialog.png -------------------------------------------------------------------------------- /assets/images/edit-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/edit-icon.png -------------------------------------------------------------------------------- /assets/images/gif-load.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/gif-load.gif -------------------------------------------------------------------------------- /assets/images/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /assets/images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /assets/images/sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/sort.png -------------------------------------------------------------------------------- /assets/images/trash-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/trash-over.png -------------------------------------------------------------------------------- /assets/images/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/images/trash.png -------------------------------------------------------------------------------- /assets/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/craftsmancoding/assetmanager/44013717eff2a3c8f3ad35565a8a42fe00406caf/assets/js/.DS_Store -------------------------------------------------------------------------------- /assets/js/form2js.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2010 Maxim Vasiliev 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | * @author Maxim Vasiliev 23 | * Date: 09.09.2010 24 | * Time: 19:02:33 25 | */ 26 | 27 | 28 | (function (root, factory) 29 | { 30 | if (typeof define === 'function' && define.amd) 31 | { 32 | // AMD. Register as an anonymous module. 33 | define(factory); 34 | } 35 | else 36 | { 37 | // Browser globals 38 | root.form2js = factory(); 39 | } 40 | }(this, function () 41 | { 42 | "use strict"; 43 | 44 | /** 45 | * Returns form values represented as Javascript object 46 | * "name" attribute defines structure of resulting object 47 | * 48 | * @param rootNode {Element|String} root form element (or it's id) or array of root elements 49 | * @param delimiter {String} structure parts delimiter defaults to '.' 50 | * @param skipEmpty {Boolean} should skip empty text values, defaults to true 51 | * @param nodeCallback {Function} custom function to get node value 52 | * @param useIdIfEmptyName {Boolean} if true value of id attribute of field will be used if name of field is empty 53 | */ 54 | function form2js(rootNode, delimiter, skipEmpty, nodeCallback, useIdIfEmptyName, getDisabled) 55 | { 56 | getDisabled = getDisabled ? true : false; 57 | if (typeof skipEmpty == 'undefined' || skipEmpty == null) skipEmpty = true; 58 | if (typeof delimiter == 'undefined' || delimiter == null) delimiter = '.'; 59 | if (arguments.length < 5) useIdIfEmptyName = false; 60 | 61 | rootNode = typeof rootNode == 'string' ? document.getElementById(rootNode) : rootNode; 62 | 63 | var formValues = [], 64 | currNode, 65 | i = 0; 66 | 67 | /* If rootNode is array - combine values */ 68 | if (rootNode.constructor == Array || (typeof NodeList != "undefined" && rootNode.constructor == NodeList)) 69 | { 70 | while(currNode = rootNode[i++]) 71 | { 72 | formValues = formValues.concat(getFormValues(currNode, nodeCallback, useIdIfEmptyName, getDisabled)); 73 | } 74 | } 75 | else 76 | { 77 | formValues = getFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled); 78 | } 79 | 80 | return processNameValues(formValues, skipEmpty, delimiter); 81 | } 82 | 83 | /** 84 | * Processes collection of { name: 'name', value: 'value' } objects. 85 | * @param nameValues 86 | * @param skipEmpty if true skips elements with value == '' or value == null 87 | * @param delimiter 88 | */ 89 | function processNameValues(nameValues, skipEmpty, delimiter) 90 | { 91 | var result = {}, 92 | arrays = {}, 93 | i, j, k, l, 94 | value, 95 | nameParts, 96 | currResult, 97 | arrNameFull, 98 | arrName, 99 | arrIdx, 100 | namePart, 101 | name, 102 | _nameParts; 103 | 104 | for (i = 0; i < nameValues.length; i++) 105 | { 106 | value = nameValues[i].value; 107 | 108 | if (skipEmpty && (value === '' || value === null)) continue; 109 | 110 | name = nameValues[i].name; 111 | _nameParts = name.split(delimiter); 112 | nameParts = []; 113 | currResult = result; 114 | arrNameFull = ''; 115 | 116 | for(j = 0; j < _nameParts.length; j++) 117 | { 118 | namePart = _nameParts[j].split(']['); 119 | if (namePart.length > 1) 120 | { 121 | for(k = 0; k < namePart.length; k++) 122 | { 123 | if (k == 0) 124 | { 125 | namePart[k] = namePart[k] + ']'; 126 | } 127 | else if (k == namePart.length - 1) 128 | { 129 | namePart[k] = '[' + namePart[k]; 130 | } 131 | else 132 | { 133 | namePart[k] = '[' + namePart[k] + ']'; 134 | } 135 | 136 | arrIdx = namePart[k].match(/([a-z_]+)?\[([a-z_][a-z0-9_]+?)\]/i); 137 | if (arrIdx) 138 | { 139 | for(l = 1; l < arrIdx.length; l++) 140 | { 141 | if (arrIdx[l]) nameParts.push(arrIdx[l]); 142 | } 143 | } 144 | else{ 145 | nameParts.push(namePart[k]); 146 | } 147 | } 148 | } 149 | else 150 | nameParts = nameParts.concat(namePart); 151 | } 152 | 153 | for (j = 0; j < nameParts.length; j++) 154 | { 155 | namePart = nameParts[j]; 156 | 157 | if (namePart.indexOf('[]') > -1 && j == nameParts.length - 1) 158 | { 159 | arrName = namePart.substr(0, namePart.indexOf('[')); 160 | arrNameFull += arrName; 161 | 162 | if (!currResult[arrName]) currResult[arrName] = []; 163 | currResult[arrName].push(value); 164 | } 165 | else if (namePart.indexOf('[') > -1) 166 | { 167 | arrName = namePart.substr(0, namePart.indexOf('[')); 168 | arrIdx = namePart.replace(/(^([a-z_]+)?\[)|(\]$)/gi, ''); 169 | 170 | /* Unique array name */ 171 | arrNameFull += '_' + arrName + '_' + arrIdx; 172 | 173 | /* 174 | * Because arrIdx in field name can be not zero-based and step can be 175 | * other than 1, we can't use them in target array directly. 176 | * Instead we're making a hash where key is arrIdx and value is a reference to 177 | * added array element 178 | */ 179 | 180 | if (!arrays[arrNameFull]) arrays[arrNameFull] = {}; 181 | if (arrName != '' && !currResult[arrName]) currResult[arrName] = []; 182 | 183 | if (j == nameParts.length - 1) 184 | { 185 | if (arrName == '') 186 | { 187 | currResult.push(value); 188 | arrays[arrNameFull][arrIdx] = currResult[currResult.length - 1]; 189 | } 190 | else 191 | { 192 | currResult[arrName].push(value); 193 | arrays[arrNameFull][arrIdx] = currResult[arrName][currResult[arrName].length - 1]; 194 | } 195 | } 196 | else 197 | { 198 | if (!arrays[arrNameFull][arrIdx]) 199 | { 200 | if ((/^[0-9a-z_]+\[?/i).test(nameParts[j+1])) currResult[arrName].push({}); 201 | else currResult[arrName].push([]); 202 | 203 | arrays[arrNameFull][arrIdx] = currResult[arrName][currResult[arrName].length - 1]; 204 | } 205 | } 206 | 207 | currResult = arrays[arrNameFull][arrIdx]; 208 | } 209 | else 210 | { 211 | arrNameFull += namePart; 212 | 213 | if (j < nameParts.length - 1) /* Not the last part of name - means object */ 214 | { 215 | if (!currResult[namePart]) currResult[namePart] = {}; 216 | currResult = currResult[namePart]; 217 | } 218 | else 219 | { 220 | currResult[namePart] = value; 221 | } 222 | } 223 | } 224 | } 225 | 226 | return result; 227 | } 228 | 229 | function getFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled) 230 | { 231 | var result = extractNodeValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled); 232 | return result.length > 0 ? result : getSubFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled); 233 | } 234 | 235 | function getSubFormValues(rootNode, nodeCallback, useIdIfEmptyName, getDisabled) 236 | { 237 | var result = [], 238 | currentNode = rootNode.firstChild; 239 | 240 | while (currentNode) 241 | { 242 | result = result.concat(extractNodeValues(currentNode, nodeCallback, useIdIfEmptyName, getDisabled)); 243 | currentNode = currentNode.nextSibling; 244 | } 245 | 246 | return result; 247 | } 248 | 249 | function extractNodeValues(node, nodeCallback, useIdIfEmptyName, getDisabled) { 250 | if (node.disabled && !getDisabled) return []; 251 | 252 | var callbackResult, fieldValue, result, fieldName = getFieldName(node, useIdIfEmptyName); 253 | 254 | callbackResult = nodeCallback && nodeCallback(node); 255 | 256 | if (callbackResult && callbackResult.name) { 257 | result = [callbackResult]; 258 | } 259 | else if (fieldName != '' && node.nodeName.match(/INPUT|TEXTAREA/i)) { 260 | fieldValue = getFieldValue(node, getDisabled); 261 | if (null === fieldValue) { 262 | result = []; 263 | } else { 264 | result = [ { name: fieldName, value: fieldValue} ]; 265 | } 266 | } 267 | else if (fieldName != '' && node.nodeName.match(/SELECT/i)) { 268 | fieldValue = getFieldValue(node, getDisabled); 269 | result = [ { name: fieldName.replace(/\[\]$/, ''), value: fieldValue } ]; 270 | } 271 | else { 272 | result = getSubFormValues(node, nodeCallback, useIdIfEmptyName, getDisabled); 273 | } 274 | 275 | return result; 276 | } 277 | 278 | function getFieldName(node, useIdIfEmptyName) 279 | { 280 | if (node.name && node.name != '') return node.name; 281 | else if (useIdIfEmptyName && node.id && node.id != '') return node.id; 282 | else return ''; 283 | } 284 | 285 | 286 | function getFieldValue(fieldNode, getDisabled) 287 | { 288 | if (fieldNode.disabled && !getDisabled) return null; 289 | 290 | switch (fieldNode.nodeName) { 291 | case 'INPUT': 292 | case 'TEXTAREA': 293 | switch (fieldNode.type.toLowerCase()) { 294 | case 'radio': 295 | if (fieldNode.checked && fieldNode.value === "false") return false; 296 | case 'checkbox': 297 | if (fieldNode.checked && fieldNode.value === "true") return true; 298 | if (!fieldNode.checked && fieldNode.value === "true") return false; 299 | if (fieldNode.checked) return fieldNode.value; 300 | break; 301 | 302 | case 'button': 303 | case 'reset': 304 | case 'submit': 305 | case 'image': 306 | return ''; 307 | break; 308 | 309 | default: 310 | return fieldNode.value; 311 | break; 312 | } 313 | break; 314 | 315 | case 'SELECT': 316 | return getSelectedOptionValue(fieldNode); 317 | break; 318 | 319 | default: 320 | break; 321 | } 322 | 323 | return null; 324 | } 325 | 326 | function getSelectedOptionValue(selectNode) 327 | { 328 | var multiple = selectNode.multiple, 329 | result = [], 330 | options, 331 | i, l; 332 | 333 | if (!multiple) return selectNode.value; 334 | 335 | for (options = selectNode.getElementsByTagName("option"), i = 0, l = options.length; i < l; i++) 336 | { 337 | if (options[i].selected) result.push(options[i].value); 338 | } 339 | 340 | return result; 341 | } 342 | 343 | return form2js; 344 | 345 | })); 346 | -------------------------------------------------------------------------------- /assets/js/jcrop.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jquery.Jcrop.min.js v0.9.12 (build:20130202) 3 | * jQuery Image Cropping Plugin - released under MIT License 4 | * Copyright (c) 2008-2013 Tapmodo Interactive LLC 5 | * https://github.com/tapmodo/Jcrop 6 | */ 7 | (function(a){a.Jcrop=function(b,c){function i(a){return Math.round(a)+"px"}function j(a){return d.baseClass+"-"+a}function k(){return a.fx.step.hasOwnProperty("backgroundColor")}function l(b){var c=a(b).offset();return[c.left,c.top]}function m(a){return[a.pageX-e[0],a.pageY-e[1]]}function n(b){typeof b!="object"&&(b={}),d=a.extend(d,b),a.each(["onChange","onSelect","onRelease","onDblClick"],function(a,b){typeof d[b]!="function"&&(d[b]=function(){})})}function o(a,b,c){e=l(D),bc.setCursor(a==="move"?a:a+"-resize");if(a==="move")return bc.activateHandlers(q(b),v,c);var d=_.getFixed(),f=r(a),g=_.getCorner(r(f));_.setPressed(_.getCorner(f)),_.setCurrent(g),bc.activateHandlers(p(a,d),v,c)}function p(a,b){return function(c){if(!d.aspectRatio)switch(a){case"e":c[1]=b.y2;break;case"w":c[1]=b.y2;break;case"n":c[0]=b.x2;break;case"s":c[0]=b.x2}else switch(a){case"e":c[1]=b.y+1;break;case"w":c[1]=b.y+1;break;case"n":c[0]=b.x+1;break;case"s":c[0]=b.x+1}_.setCurrent(c),bb.update()}}function q(a){var b=a;return bd.watchKeys 8 | (),function(a){_.moveOffset([a[0]-b[0],a[1]-b[1]]),b=a,bb.update()}}function r(a){switch(a){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function s(a){return function(b){return d.disabled?!1:a==="move"&&!d.allowMove?!1:(e=l(D),W=!0,o(a,m(b)),b.stopPropagation(),b.preventDefault(),!1)}}function t(a,b,c){var d=a.width(),e=a.height();d>b&&b>0&&(d=b,e=b/a.width()*a.height()),e>c&&c>0&&(e=c,d=c/a.height()*a.width()),T=a.width()/d,U=a.height()/e,a.width(d).height(e)}function u(a){return{x:a.x*T,y:a.y*U,x2:a.x2*T,y2:a.y2*U,w:a.w*T,h:a.h*U}}function v(a){var b=_.getFixed();b.w>d.minSelect[0]&&b.h>d.minSelect[1]?(bb.enableHandles(),bb.done()):bb.release(),bc.setCursor(d.allowSelect?"crosshair":"default")}function w(a){if(d.disabled)return!1;if(!d.allowSelect)return!1;W=!0,e=l(D),bb.disableHandles(),bc.setCursor("crosshair");var b=m(a);return _.setPressed(b),bb.update(),bc.activateHandlers(x,v,a.type.substring 9 | (0,5)==="touch"),bd.watchKeys(),a.stopPropagation(),a.preventDefault(),!1}function x(a){_.setCurrent(a),bb.update()}function y(){var b=a("
").addClass(j("tracker"));return g&&b.css({opacity:0,backgroundColor:"white"}),b}function be(a){G.removeClass().addClass(j("holder")).addClass(a)}function bf(a,b){function t(){window.setTimeout(u,l)}var c=a[0]/T,e=a[1]/U,f=a[2]/T,g=a[3]/U;if(X)return;var h=_.flipCoords(c,e,f,g),i=_.getFixed(),j=[i.x,i.y,i.x2,i.y2],k=j,l=d.animationDelay,m=h[0]-j[0],n=h[1]-j[1],o=h[2]-j[2],p=h[3]-j[3],q=0,r=d.swingSpeed;c=k[0],e=k[1],f=k[2],g=k[3],bb.animMode(!0);var s,u=function(){return function(){q+=(100-q)/r,k[0]=Math.round(c+q/100*m),k[1]=Math.round(e+q/100*n),k[2]=Math.round(f+q/100*o),k[3]=Math.round(g+q/100*p),q>=99.8&&(q=100),q<100?(bh(k),t()):(bb.done(),bb.animMode(!1),typeof b=="function"&&b.call(bs))}}();t()}function bg(a){bh([a[0]/T,a[1]/U,a[2]/T,a[3]/U]),d.onSelect.call(bs,u(_.getFixed())),bb.enableHandles()}function bh(a){_.setPressed([a[0],a[1]]),_.setCurrent([a[2], 10 | a[3]]),bb.update()}function bi(){return u(_.getFixed())}function bj(){return _.getFixed()}function bk(a){n(a),br()}function bl(){d.disabled=!0,bb.disableHandles(),bb.setCursor("default"),bc.setCursor("default")}function bm(){d.disabled=!1,br()}function bn(){bb.done(),bc.activateHandlers(null,null)}function bo(){G.remove(),A.show(),A.css("visibility","visible"),a(b).removeData("Jcrop")}function bp(a,b){bb.release(),bl();var c=new Image;c.onload=function(){var e=c.width,f=c.height,g=d.boxWidth,h=d.boxHeight;D.width(e).height(f),D.attr("src",a),H.attr("src",a),t(D,g,h),E=D.width(),F=D.height(),H.width(E).height(F),M.width(E+L*2).height(F+L*2),G.width(E).height(F),ba.resize(E,F),bm(),typeof b=="function"&&b.call(bs)},c.src=a}function bq(a,b,c){var e=b||d.bgColor;d.bgFade&&k()&&d.fadeTime&&!c?a.animate({backgroundColor:e},{queue:!1,duration:d.fadeTime}):a.css("backgroundColor",e)}function br(a){d.allowResize?a?bb.enableOnly():bb.enableHandles():bb.disableHandles(),bc.setCursor(d.allowSelect?"crosshair":"default"),bb 11 | .setCursor(d.allowMove?"move":"default"),d.hasOwnProperty("trueSize")&&(T=d.trueSize[0]/E,U=d.trueSize[1]/F),d.hasOwnProperty("setSelect")&&(bg(d.setSelect),bb.done(),delete d.setSelect),ba.refresh(),d.bgColor!=N&&(bq(d.shade?ba.getShades():G,d.shade?d.shadeColor||d.bgColor:d.bgColor),N=d.bgColor),O!=d.bgOpacity&&(O=d.bgOpacity,d.shade?ba.refresh():bb.setBgOpacity(O)),P=d.maxSize[0]||0,Q=d.maxSize[1]||0,R=d.minSize[0]||0,S=d.minSize[1]||0,d.hasOwnProperty("outerImage")&&(D.attr("src",d.outerImage),delete d.outerImage),bb.refresh()}var d=a.extend({},a.Jcrop.defaults),e,f=navigator.userAgent.toLowerCase(),g=/msie/.test(f),h=/msie [1-6]\./.test(f);typeof b!="object"&&(b=a(b)[0]),typeof c!="object"&&(c={}),n(c);var z={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},A=a(b),B=!0;if(b.tagName=="IMG"){if(A[0].width!=0&&A[0].height!=0)A.width(A[0].width),A.height(A[0].height);else{var C=new Image;C.src=A[0].src,A.width(C.width),A.height(C.height)}var D=A.clone().removeAttr("id"). 12 | css(z).show();D.width(A.width()),D.height(A.height()),A.after(D).hide()}else D=A.css(z).show(),B=!1,d.shade===null&&(d.shade=!0);t(D,d.boxWidth,d.boxHeight);var E=D.width(),F=D.height(),G=a("
").width(E).height(F).addClass(j("holder")).css({position:"relative",backgroundColor:d.bgColor}).insertAfter(A).append(D);d.addClass&&G.addClass(d.addClass);var H=a("
"),I=a("
").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),J=a("
").width("100%").height("100%").css("zIndex",320),K=a("
").css({position:"absolute",zIndex:600}).dblclick(function(){var a=_.getFixed();d.onDblClick.call(bs,a)}).insertBefore(D).append(I,J);B&&(H=a("").attr("src",D.attr("src")).css(z).width(E).height(F),I.append(H)),h&&K.css({overflowY:"hidden"});var L=d.boundary,M=y().width(E+L*2).height(F+L*2).css({position:"absolute",top:i(-L),left:i(-L),zIndex:290}).mousedown(w),N=d.bgColor,O=d.bgOpacity,P,Q,R,S,T,U,V=!0,W,X,Y;e=l(D);var Z=function(){function a(){var a={},b=["touchstart" 13 | ,"touchmove","touchend"],c=document.createElement("div"),d;try{for(d=0;da+f&&(f-=f+a),0>b+g&&(g-=g+b),FE&&(r=E,u=Math.abs((r-a)/f),s=k<0?b-u:u+b)):(r=c,u=l/f,s=k<0?b-u:b+u,s<0?(s=0,t=Math.abs((s-b)*f),r=j<0?a-t:t+a):s>F&&(s=F,t=Math.abs(s-b)*f,r=j<0?a-t:t+a)),r>a?(r-ah&&(r=a+h),s>b?s=b+(r-a)/f:s=b-(r-a)/f):rh&&(r=a-h),s>b?s=b+(a-r)/f:s=b-(a-r)/f),r<0?(a-=r,r=0):r>E&&(a-=r-E,r=E),s<0?(b-=s,s=0):s>F&&(b-=s-F,s=F),q(o(a,b,r,s))}function n(a){return a[0]<0&&(a[0]=0),a[1]<0&&(a[1]=0),a[0]>E&&(a[0]=E),a[1]>F&&(a[1]=F),[Math.round(a[0]),Math.round(a[1])]}function o(a,b,c,d){var e=a,f=c,g=b,h=d;return cP&&(c=d>0?a+P:a-P),Q&&Math.abs 15 | (f)>Q&&(e=f>0?b+Q:b-Q),S/U&&Math.abs(f)0?b+S/U:b-S/U),R/T&&Math.abs(d)0?a+R/T:a-R/T),a<0&&(c-=a,a-=a),b<0&&(e-=b,b-=b),c<0&&(a-=c,c-=c),e<0&&(b-=e,e-=e),c>E&&(g=c-E,a-=g,c-=g),e>F&&(g=e-F,b-=g,e-=g),a>E&&(g=a-F,e-=g,b-=g),b>F&&(g=b-F,e-=g,b-=g),q(o(a,b,c,e))}function q(a){return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]}}var a=0,b=0,c=0,e=0,f,g;return{flipCoords:o,setPressed:h,setCurrent:i,getOffset:j,moveOffset:k,getCorner:l,getFixed:m}}(),ba=function(){function f(a,b){e.left.css({height:i(b)}),e.right.css({height:i(b)})}function g(){return h(_.getFixed())}function h(a){e.top.css({left:i(a.x),width:i(a.w),height:i(a.y)}),e.bottom.css({top:i(a.y2),left:i(a.x),width:i(a.w),height:i(F-a.y2)}),e.right.css({left:i(a.x2),width:i(E-a.x2)}),e.left.css({width:i(a.x)})}function j(){return a("
").css({position:"absolute",backgroundColor:d.shadeColor||d.bgColor}).appendTo(c)}function k(){b||(b=!0,c.insertBefore(D),g(),bb.setBgOpacity(1,0,1),H.hide(),l(d.shadeColor||d.bgColor,1),bb. 16 | isAwake()?n(d.bgOpacity,1):n(1,1))}function l(a,b){bq(p(),a,b)}function m(){b&&(c.remove(),H.show(),b=!1,bb.isAwake()?bb.setBgOpacity(d.bgOpacity,1,1):(bb.setBgOpacity(1,1,1),bb.disableHandles()),bq(G,0,1))}function n(a,e){b&&(d.bgFade&&!e?c.animate({opacity:1-a},{queue:!1,duration:d.fadeTime}):c.css({opacity:1-a}))}function o(){d.shade?k():m(),bb.isAwake()&&n(d.bgOpacity)}function p(){return c.children()}var b=!1,c=a("
").css({position:"absolute",zIndex:240,opacity:0}),e={top:j(),left:j().height(F),right:j().height(F),bottom:j()};return{update:g,updateRaw:h,getShades:p,setBgColor:l,enable:k,disable:m,resize:f,refresh:o,opacity:n}}(),bb=function(){function k(b){var c=a("
").css({position:"absolute",opacity:d.borderOpacity}).addClass(j(b));return I.append(c),c}function l(b,c){var d=a("
").mousedown(s(b)).css({cursor:b+"-resize",position:"absolute",zIndex:c}).addClass("ord-"+b);return Z.support&&d.bind("touchstart.jcrop",Z.createDragger(b)),J.append(d),d}function m(a){var b=d.handleSize,e=l(a,c++ 17 | ).css({opacity:d.handleOpacity}).addClass(j("handle"));return b&&e.width(b).height(b),e}function n(a){return l(a,c++).addClass("jcrop-dragbar")}function o(a){var b;for(b=0;b').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),c=a("
").css({position:"absolute",overflow:"hidden"}).append(b);return d.keySupport&&(b.keydown(i).blur(f),h||!d.fixedSupport?(b.css({position:"absolute",left:"-20px"}),c.append(b).insertBefore(D)):b.insertBefore(D)),{watchKeys:e}}();Z.support&&M.bind("touchstart.jcrop",Z.newSelection),J.hide(),br(!0);var bs={setImage:bp,animateTo:bf,setSelect:bg,setOptions:bk,tellSelect:bi,tellScaled:bj,setClass:be,disable:bl,enable:bm,cancel:bn,release:bb.release,destroy:bo,focus:bd.watchKeys,getBounds:function(){return[E*T,F*U]},getWidgetSize:function(){return[E,F]},getScaleFactor:function(){return[T,U]},getOptions:function(){return d},ui:{holder:G,selection:K}};return g&&G.bind("selectstart",function(){return!1}),A.data("Jcrop",bs),bs},a.fn.Jcrop=function(b,c){var d;return this.each(function(){if(a(this).data("Jcrop")){if( 21 | b==="api")return a(this).data("Jcrop");a(this).data("Jcrop").setOptions(b)}else this.tagName=="IMG"?a.Jcrop.Loader(this,function(){a(this).css({display:"block",visibility:"hidden"}),d=a.Jcrop(this,b),a.isFunction(c)&&c.call(d)}):(a(this).css({display:"block",visibility:"hidden"}),d=a.Jcrop(this,b),a.isFunction(c)&&c.call(d))}),this},a.Jcrop.Loader=function(b,c,d){function g(){f.complete?(e.unbind(".jcloader"),a.isFunction(c)&&c.call(f)):window.setTimeout(g,50)}var e=a(b),f=e[0];e.bind("load.jcloader",g).bind("error.jcloader",function(b){e.unbind(".jcloader"),a.isFunction(d)&&d.call(f)}),f.complete&&a.isFunction(c)&&(e.unbind(".jcloader"),c.call(f))},a.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges 22 | :!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}})(jQuery); -------------------------------------------------------------------------------- /assets/js/jquery.colorbox.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Colorbox v1.5.9 - 2014-04-25 3 | jQuery lightbox and modal window plugin 4 | (c) 2014 Jack Moore - http://www.jacklmoore.com/colorbox 5 | license: http://www.opensource.org/licenses/mit-license.php 6 | */ 7 | (function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(z+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){z=0,e&&e!==!1?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),z=W.index(_.el),-1===z&&(W=W.add(_.el),z=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data("colorbox"),_=new r(i,o),g(_.get("rel")),!$){$=q=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),L=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(L),D=T.height()+k.height()+b.outerHeight(!0)-b.height(),j=C.width()+H.width()+b.outerWidth(!0)-b.width(),A=L.outerHeight(!0),N=L.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=(l!==!1?Math.min(h,a(l,"x")):h)-N-j,_.h=(f!==!1?Math.min(s,a(f,"y")):s)-A-D,L.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(I).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}v.css({opacity:parseFloat(_.get("opacity"))||"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("
"),w()}}function p(){!x&&e.body&&(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),S=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(I=n(se,"Title"),R=n(se,"Current"),P=t('
17 |
18 |
19 |
-------------------------------------------------------------------------------- /views/group/manage.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | 33 | 34 |
35 |

modx->lexicon('assman.groups.pagetitle') ?>

36 |
37 | 38 | 39 | 40 |

modx->lexicon('assman.groups.subtitle'); ?>

41 | 42 |
43 | 44 |
-------------------------------------------------------------------------------- /views/header.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 31 | 32 |
33 | 34 |
35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /views/main/assets.php: -------------------------------------------------------------------------------- 1 | 7 |
8 |

9 |
10 | 11 |

12 | 13 |
14 | 15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | modx->lexicon('assman.btn.showall'); ?> 24 |
25 | 26 |
27 |
28 | 29 | 30 | 31 | 32 | 33 | 36 | 39 | 42 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | 60 | 64 | 65 | 66 | 67 |
34 | modx->lexicon('assman.lbl.thumbnail'); ?> 35 | 37 | modx->lexicon('assman.lbl.title'); ?> 38 | 40 | modx->lexicon('assman.lbl.alt'); ?> 41 | 43 | modx->lexicon('assman.lbl.size'); ?> 44 | modx->lexicon('assman.lbl.action'); ?>
get('path'); 53 | print $this->modx->runSnippet('Asset', array('asset_id'=>$r->get('asset_id'),'width'=>$this->modx->getOption('assman.thumbnail_width'),'tpl'=>'')); 54 | ?> 55 | get('title'); ?>get('alt'); ?>get('size'); ?> 59 | 61 | modx->lexicon('assman.btn.edit'); ?> 62 | modx->lexicon('assman.btn.delete'); ?> 63 |
68 | 69 | 70 | 71 |
modx->lexicon('assman.no_results'); ?>
72 | 73 | 74 | 75 | modx->getOption('assman.default_per_page','',$this->modx->getOption('default_per_page')); 79 | print \Pagination\Pager::links($data['count'], $offset, $results_per_page) 80 | ->setBaseUrl($data['baseurl']); 81 | ?> 82 |
83 | 84 | 85 | 86 |
87 |

Deleting the asset will remove it permanently from your site.

88 |

Deleting cannot be undone!

89 |
90 | -------------------------------------------------------------------------------- /views/main/index.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |

modx->lexicon('assman.index.pagetitle') ?>

4 |
5 | 6 |
7 |

modx->lexicon('assman.index.subtitle') ?>

8 |
-------------------------------------------------------------------------------- /views/main/pageassets.tpl: -------------------------------------------------------------------------------- 1 | 6 | 21 | 22 | 23 | 26 | 27 | 28 | 108 | 109 | 110 | 111 | 112 |
113 |
114 | 115 |
    116 |
  • All
  • 117 |
118 | 119 | 120 |
121 | 122 |
 
123 |
    124 | 125 | 129 | 130 | 133 | 134 |
    135 | 136 |
    137 | 138 | Drag Image Here to Delete 139 |
    140 | 141 | 142 |
    143 |

    This asset might be used by other pages!

    144 |

    You can remove the image from this page,
    145 | or you can delete the asset.

    146 |

    Deleting cannot be undone!

    147 |
    148 | 149 | 160 | 161 | 162 |
    -------------------------------------------------------------------------------- /views/main/pageassets_new.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 | 6 |
    7 |

    Welcome to the Asset Manager! Please save your page before adding assets to it. 8 | Once your page has been saved, you can upload your assets here.

    9 |
    10 | 11 | 22 | 23 | 24 |
    -------------------------------------------------------------------------------- /views/main/settings.php: -------------------------------------------------------------------------------- 1 |
    2 |

    3 |
    4 | 5 |
    6 | 7 | 8 | 9 |
    10 | 11 | 12 | 13 |

    Upload Max Size (php.ini and modx System Setting)

    14 |
    15 |

    post_max_size(php.ini) :

    16 |

    upload_max_size(php.ini) :

    17 |

    upload_maxsize (modx system setting) : modx->getOption('upload_maxsize')/1024)/1024; ?>M

    18 |
    19 |
    20 | 21 |

    modx->lexicon('assman.settings.thumbnail.title'); ?>

    22 |

    modx->lexicon('assman.settings.thumbnail.desc'); ?>

    23 | $this->modx->lexicon('assman.lbl.thumbwidth'))); 25 | ?> 26 | $this->modx->lexicon('assman.lbl.thumbheight'))); 28 | ?> 29 |
    30 |
    31 | 32 |

    modx->lexicon('assman.settings.resourcetype.title'); ?>

    33 | 34 |

    modx->lexicon('assman.settings.resourcetype.desc'); ?>

    35 | $this->modx->lexicon('assman.lbl.classkeys'),'size'=>'200')); 37 | ?> 38 |
    39 |
    40 | 41 |

    modx->lexicon('assman.settings.storage.title'); ?>

    42 |

    modx->lexicon('assman.settings.storage.path.desc'); ?>

    43 | $this->modx->lexicon('assman.lbl.librarypath'),'description'=>$this->modx->lexicon('assman.settings.storage.path.note'))); 45 | ?> 46 | $this->modx->lexicon('setting_assman.url_override'))); 48 | ?> 49 |

    modx->lexicon('assman.settings.storage.override.desc'); ?>

    50 | 51 | $this->modx->lexicon('assman.lbl.override'),'description'=>$this->modx->lexicon('assman.settings.storage.override.note'))); 53 | ?> 54 | 55 |
    56 |
    57 | 58 |

    modx->lexicon('assman.settings.contenttype.title'); ?>

    59 |

    modx->lexicon('assman.settings.contenttype.desc'); ?>

    60 | modx->lexicon('assman.lbl.autocreate'), array('label' => $this->modx->lexicon('assman.lbl.autocreate'))); 62 | ?> 63 |
    64 |
    65 | 66 | 67 |
    68 | 69 |
    70 | 71 | modx->lexicon('assman.btn.seesettings'); ?> 72 | 73 |
    -------------------------------------------------------------------------------- /views/main/test.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |
    5 | 6 |
    7 |
    8 |
    9 |
    -------------------------------------------------------------------------------- /views/main/verify.php: -------------------------------------------------------------------------------- 1 |
    2 |

    modx->lexicon('assman.verify.pagetitle'); ?>

    3 |
    4 |
    5 |

    modx->lexicon('assman.verify.subtitle'); ?>

    6 |
    7 | 8 |
    9 | 10 |
    11 | 12 |
    13 | 14 |
    15 | 16 | 17 | 18 |

    Congratulations! Your asset library matches with what's in the database!

    19 | 20 | 21 | 22 |
    23 |             
    24 |                 
    25 |             
    26 |             
    27 | 28 | 29 | 30 |
    31 |
    --------------------------------------------------------------------------------