From 070ec5f32df8819bd58f391c2113cbadb62eb0c1 Mon Sep 17 00:00:00 2001 From: Justin Sternberg Date: Wed, 4 May 2016 15:24:04 -0400 Subject: [PATCH] Begin rewrite --- .bowerrc | 3 + .editorconfig | 21 + .gitignore | 82 ++ .jshintrc | 20 + Gruntfile.js | 31 + assets/css/readme.md | 3 + assets/css/sass/gathercontent-importer.scss | 7 + assets/js/src/gathercontent-importer.js | 13 + bootstrap.php.dist | 31 + bower.json | 23 + composer.json | 27 + css/bootstrap.min.css | 150 --- css/items.css | 70 -- css/main.css | 47 - curl.php | 1011 ------------------- functions.php | 328 ------ gathercontent-importer.php | 53 + gathercontent.php | 741 -------------- {img => images}/logo-big.png | Bin images/readme.md | 3 + images/src/readme.md | 3 + img/ajax-loader-grey.gif | Bin 847 -> 0 bytes img/ajax-loader.gif | Bin 847 -> 0 bytes img/ajax_loader_blue.gif | Bin 2670 -> 0 bytes img/glyphicons-halflings-white.png | Bin 8777 -> 0 bytes img/glyphicons-halflings.png | Bin 12799 -> 0 bytes img/help.png | Bin 1345 -> 0 bytes img/sort_field.png | Bin 1030 -> 0 bytes includes/functions/core.php | 74 ++ includes/readme.md | 3 + js/bootstrap.min.js | 7 - js/item_import.js | 499 --------- js/main.js | 73 -- js/media.js | 64 -- package.json | 38 + phpunit.xml.dist | 21 + readme.txt | 21 +- tasks/_template.js | 3 + tasks/build.js | 3 + tasks/css.js | 3 + tasks/default.js | 3 + tasks/js.js | 3 + tasks/options/_template.js | 3 + tasks/options/clean.js | 3 + tasks/options/compress.js | 12 + tasks/options/concat.js | 16 + tasks/options/copy.js | 28 + tasks/options/cssmin.js | 18 + tasks/options/jshint.js | 7 + tasks/options/mocha.js | 11 + tasks/options/phpunit.js | 11 + tasks/options/postcss.js | 12 + tasks/options/sass.js | 11 + tasks/options/uglify.js | 17 + tasks/options/watch.js | 22 + tasks/test.js | 3 + tests/mocha/gathercontent-importer.html | 27 + tests/mocha/tests/gathercontent-importer.js | 9 + tests/phpunit/Core_Tests.php | 113 +++ tests/phpunit/test-tools/TestCase.php | 75 ++ view/curl-error.php | 11 - view/finished.php | 15 - view/item-import.php | 64 -- view/items.php | 43 - view/login.php | 23 - view/media.php | 27 - view/projects.php | 36 - 67 files changed, 881 insertions(+), 3218 deletions(-) create mode 100644 .bowerrc create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .jshintrc create mode 100644 Gruntfile.js create mode 100644 assets/css/readme.md create mode 100644 assets/css/sass/gathercontent-importer.scss create mode 100644 assets/js/src/gathercontent-importer.js create mode 100644 bootstrap.php.dist create mode 100644 bower.json create mode 100644 composer.json delete mode 100644 css/bootstrap.min.css delete mode 100644 css/items.css delete mode 100644 css/main.css delete mode 100644 curl.php delete mode 100644 functions.php create mode 100644 gathercontent-importer.php delete mode 100644 gathercontent.php rename {img => images}/logo-big.png (100%) create mode 100644 images/readme.md create mode 100644 images/src/readme.md delete mode 100644 img/ajax-loader-grey.gif delete mode 100644 img/ajax-loader.gif delete mode 100644 img/ajax_loader_blue.gif delete mode 100644 img/glyphicons-halflings-white.png delete mode 100644 img/glyphicons-halflings.png delete mode 100644 img/help.png delete mode 100644 img/sort_field.png create mode 100644 includes/functions/core.php create mode 100644 includes/readme.md delete mode 100644 js/bootstrap.min.js delete mode 100644 js/item_import.js delete mode 100644 js/main.js delete mode 100644 js/media.js create mode 100644 package.json create mode 100644 phpunit.xml.dist create mode 100644 tasks/_template.js create mode 100644 tasks/build.js create mode 100644 tasks/css.js create mode 100644 tasks/default.js create mode 100644 tasks/js.js create mode 100644 tasks/options/_template.js create mode 100644 tasks/options/clean.js create mode 100644 tasks/options/compress.js create mode 100644 tasks/options/concat.js create mode 100644 tasks/options/copy.js create mode 100644 tasks/options/cssmin.js create mode 100644 tasks/options/jshint.js create mode 100644 tasks/options/mocha.js create mode 100644 tasks/options/phpunit.js create mode 100644 tasks/options/postcss.js create mode 100644 tasks/options/sass.js create mode 100644 tasks/options/uglify.js create mode 100644 tasks/options/watch.js create mode 100644 tasks/test.js create mode 100644 tests/mocha/gathercontent-importer.html create mode 100644 tests/mocha/tests/gathercontent-importer.js create mode 100644 tests/phpunit/Core_Tests.php create mode 100644 tests/phpunit/test-tools/TestCase.php delete mode 100644 view/curl-error.php delete mode 100644 view/finished.php delete mode 100644 view/item-import.php delete mode 100644 view/items.php delete mode 100644 view/login.php delete mode 100644 view/media.php delete mode 100644 view/projects.php diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 00000000..69fad358 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..e4c2c706 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# http://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab + +[*.json] +indent_style = space +indent_size = 2 + +[*.txt,wp-config-sample.php] +end_of_line = crlf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..86e45e42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,82 @@ +node_modules +release +vendor +composer.lock +phpunit.xml +.idea +# Created by https://www.gitignore.io/api/osx,node,grunt + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Node ### +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + + +### grunt ### +# Grunt usually compiles files inside this directory +dist/ + +# Grunt usually preprocesses files such as coffeescript, compass... inside the .tmp directory +.tmp/ + diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 00000000..bb3ff632 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,20 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "sub": true, + "undef": true, + "boss": true, + "eqnull": true, + "validthis": true, + "globals": { + "exports": true, + "module": false, + "console": true, + "document": true, + "window": true, + } +} diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 00000000..51216e10 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,31 @@ +module.exports = function (grunt) { + + // require `load-grunt-tasks`, which loads all grunt tasks defined in package.json + require('load-grunt-tasks')(grunt); + // load tasks defined in the `/tasks` folder + grunt.loadTasks('tasks'); + + // Function to load the options for each grunt module + var loadConfig = function (path) { + var glob = require('glob'); + var object = {}; + var key; + + glob.sync('*', {cwd: path}).forEach(function(option) { + key = option.replace(/\.js$/,''); + object[key] = require(path + option); + }); + + return object; + }; + + var config = { + pkg: grunt.file.readJSON('package.json'), + env: process.env + }; + + grunt.util._.extend(config, loadConfig('./tasks/options/')); + + grunt.initConfig(config); + +}; diff --git a/assets/css/readme.md b/assets/css/readme.md new file mode 100644 index 00000000..1c34ddda --- /dev/null +++ b/assets/css/readme.md @@ -0,0 +1,3 @@ +# Styles + +Only final CSS styles should exist in this folder. If you are using SASS, LESS, autoprefixer, or some other pre-processor, please place your raw source files in a subdirectory. diff --git a/assets/css/sass/gathercontent-importer.scss b/assets/css/sass/gathercontent-importer.scss new file mode 100644 index 00000000..77b39fb2 --- /dev/null +++ b/assets/css/sass/gathercontent-importer.scss @@ -0,0 +1,7 @@ +/** + * GatherContent Importer + * http://www.gathercontent.com + * + * Copyright (c) 2016 GatherContent + * Licensed under the GPL-2.0+ license. + */ diff --git a/assets/js/src/gathercontent-importer.js b/assets/js/src/gathercontent-importer.js new file mode 100644 index 00000000..c0848836 --- /dev/null +++ b/assets/js/src/gathercontent-importer.js @@ -0,0 +1,13 @@ +/** + * GatherContent Importer + * http://www.gathercontent.com + * + * Copyright (c) 2016 GatherContent + * }Licensed under the GPL-2.0+ license. + */ + +( function( window, undefined ) { + 'use strict'; + + +} )( this ); diff --git a/bootstrap.php.dist b/bootstrap.php.dist new file mode 100644 index 00000000..53068ca4 --- /dev/null +++ b/bootstrap.php.dist @@ -0,0 +1,31 @@ +=5.6" + }, + "require-dev": { + "antecedent/patchwork": "1.2.*", + "phpunit/phpunit" : "*@stable", + "brianium/paratest" : "dev-master", + "10up/wp_mock" : "dev-master" + } +} diff --git a/css/bootstrap.min.css b/css/bootstrap.min.css deleted file mode 100644 index 99778d9b..00000000 --- a/css/bootstrap.min.css +++ /dev/null @@ -1,150 +0,0 @@ -/*! - * Bootstrap v2.3.2 - * - * Copyright 2013 Twitter, Inc - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Designed and built with all the love in the world @twitter by @mdo and @fat. - */ -.gc_cf{*zoom:1;}.gc_cf:before,.gc_cf:after{display:table;content:"";line-height:0;} -.gc_cf:after{clear:both;} -.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;} -.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} -.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333333;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(to bottom, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #cccccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333333;background-color:#e6e6e6;*background-color:#d9d9d9;} -.btn:active,.btn.active{background-color:#cccccc \9;} -.btn:first-child{*margin-left:0;} -.btn:hover,.btn:focus{color:#333333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;} -.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} -.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);} -.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} -.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} -.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px;} -.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} -.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0;} -.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px;} -.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} -.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} -.btn-block+.btn-block{margin-top:5px;} -input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%;} -.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);} -.btn-primary{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #0088cc, #0044cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));background-image:-webkit-linear-gradient(top, #0088cc, #0044cc);background-image:-o-linear-gradient(top, #0088cc, #0044cc);background-image:linear-gradient(to bottom, #0088cc, #0044cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);border-color:#0044cc #0044cc #002a80;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#0044cc;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#ffffff;background-color:#0044cc;*background-color:#003bb3;} -.btn-primary:active,.btn-primary.active{background-color:#003399 \9;} -.btn-warning{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#ffffff;background-color:#f89406;*background-color:#df8505;} -.btn-warning:active,.btn-warning.active{background-color:#c67605 \9;} -.btn-danger{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#ffffff;background-color:#bd362f;*background-color:#a9302a;} -.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;} -.btn-success{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(to bottom, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#ffffff;background-color:#51a351;*background-color:#499249;} -.btn-success:active,.btn-success.active{background-color:#408140 \9;} -.btn-info{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(to bottom, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#ffffff;background-color:#2f96b4;*background-color:#2a85a0;} -.btn-info:active,.btn-info.active{background-color:#24748c \9;} -.btn-inverse{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#363636;background-image:-moz-linear-gradient(top, #444444, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));background-image:-webkit-linear-gradient(top, #444444, #222222);background-image:-o-linear-gradient(top, #444444, #222222);background-image:linear-gradient(to bottom, #444444, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#222222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#ffffff;background-color:#222222;*background-color:#151515;} -.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;} -button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;} -button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;} -button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;} -button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;} -.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} -.btn-link{border-color:transparent;cursor:pointer;color:#0088cc;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} -.btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent;} -.btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333333;text-decoration:none;} -.btn-group{position:relative;display:inline-block;*display:inline;*zoom:1;font-size:0;vertical-align:middle;white-space:nowrap;*margin-left:.3em;}.btn-group:first-child{*margin-left:0;} -.btn-group+.btn-group{margin-left:5px;} -.btn-toolbar{font-size:0;margin-top:10px;margin-bottom:10px;}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px;} -.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} -.btn-group>.btn+.btn{margin-left:-1px;} -.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px;} -.btn-group>.btn-mini{font-size:10.5px;} -.btn-group>.btn-small{font-size:11.9px;} -.btn-group>.btn-large{font-size:17.5px;} -.btn-group>.btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} -.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;padding:2px 8px 3px; position: relative; top: -1px} -.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} -.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;} -.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2;} -.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} -.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);*padding-top:5px;*padding-bottom:5px;} -.btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:2px;*padding-bottom:2px;} -.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px;} -.btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px;*padding-top:7px;*padding-bottom:7px;} -.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);} -.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6;} -.btn-group.open .btn-primary.dropdown-toggle{background-color:#0044cc;} -.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406;} -.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f;} -.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351;} -.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4;} -.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222222;} -.btn .caret{margin-top:8px;margin-left:0;} -.btn-large .caret{margin-top:6px;} -.btn-large .caret{border-left-width:5px;border-right-width:5px;border-top-width:5px;} -.btn-mini .caret,.btn-small .caret{margin-top:8px;} -.dropup .btn-large .caret{border-bottom-width:5px;} -.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} -.btn-group-vertical{display:inline-block;*display:inline;*zoom:1;} -.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} -.btn-group-vertical>.btn+.btn{margin-left:0;margin-top:-1px;} -.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;} -.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;} -.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0;} -.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;} -.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} -.tooltip.top{margin-top:-3px;padding:5px 0;} -.tooltip.right{margin-left:3px;padding:0 5px;} -.tooltip.bottom{margin-top:3px;padding:5px 0;} -.tooltip.left{margin-left:-3px;padding:0 5px;} -.tooltip-inner{max-width:200px;padding:8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} -.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid;} -.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000;} -.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000;} -.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000;} -.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000;} -.dropup,.dropdown{position:relative;} -.dropdown-toggle{*margin-bottom:-3px;} -.dropdown-toggle:active,.open .dropdown-toggle{outline:0;} -.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000000;border-right:4px solid transparent;border-left:4px solid transparent;content:"";opacity: 0.3;filter: alpha(opacity=30);} -.dropdown-toggle:hover .caret,.open .caret {opacity:1;filter:alpha(opacity=100);} -.dropdown .caret{margin-top:8px;margin-left:2px;} -.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#ffffff;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;}.dropdown-menu.pull-right{right:0;left:auto;} -.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;} -.dropdown-menu>li>a{display:block;padding:3px 15px;clear:both;font-weight:normal;line-height:20px;color:#333333;white-space:nowrap;text-align:left;} -.dropdown-menu>li>a:hover,.dropdown-submenu:hover>a{text-decoration:none;color:#ffffff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #0088cc, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);background-image:-o-linear-gradient(top, #0088cc, #0077b3);background-image:linear-gradient(to bottom, #0088cc, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);} -.dropdown-menu>li a.active,.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#0081c2;background-image:-moz-linear-gradient(top, #0088cc, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);background-image:-o-linear-gradient(top, #0088cc, #0077b3);background-image:linear-gradient(to bottom, #0088cc, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);} -.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999999;} -.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:default;} -.open{*z-index:1000;}.open>.dropdown-menu{display:block;} -.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990;} -.pull-right>.dropdown-menu{right:0;left:auto;} -.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"";} -.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;} -.dropdown-submenu{position:relative;} -.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} -.dropdown-submenu:hover>.dropdown-menu{display:block;} -.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0;} -.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} -.dropdown-submenu:hover>a:after{border-left-color:#ffffff;} -.dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} -.dropdown .dropdown-menu .nav-header{padding-left:20px;padding-right:20px;} -.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} -.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} -[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;margin-top:1px;} -.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:focus>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>li>a:focus>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:focus>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"],.dropdown-submenu:focus>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png");} -.icon-ok{background-position:-288px 0;} -.icon-filter{background-position:-408px -144px;} -.btn img { display: none; } -.btn-wait,.btn-wait:hover,.btn-wait:focus{background:#fff;border-color:#ccc;color:#aaa;box-shadow:none;text-shadow:none;cursor:default;font-style:italic;} -.btn-wait i{opacity:0.3;filter:alpha(opacity=30);} -.btn-wait img{opacity:0.3;filter:alpha(opacity=30);margin-right:2px;position:relative;top:3px;width:16px;height:16px;display:inline-block} -.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;text-align:left;} -.alert,.alert h4{color:#c09853;} -.alert h4{margin:0;} -.alert .close{position:relative;top:-2px;right:-21px;line-height:20px;} -.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;} -.alert-success h4{color:#468847;} -.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;} -.alert-danger h4,.alert-error h4{color:#b94a48;} -.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;} -.alert-info h4{color:#3a87ad;} -.alert-block{padding-top:14px;padding-bottom:14px;} -.alert-block>p,.alert-block>ul{margin-bottom:0;} -.alert-block p+p{margin-top:5px;} diff --git a/css/items.css b/css/items.css deleted file mode 100644 index 3ea8122b..00000000 --- a/css/items.css +++ /dev/null @@ -1,70 +0,0 @@ -.item-status{display:inline-block;width:15px;height:15px;position:relative;-webkit-border-radius: 2px;-moz-border-radius: 2px;border-radius: 2px;}.item-state-color-1{background-color:#C5C5C5;background-image:-moz-linear-gradient(top,#DBDBDB,#C5C5C5);background-image:-ms-linear-gradient(top,#DBDBDB,#C5C5C5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#DBDBDB),to(#C5C5C5));background-image:-webkit-linear-gradient(top,#DBDBDB,#C5C5C5);background-image:-o-linear-gradient(top,#DBDBDB,#C5C5C5);background-image:linear-gradient(top,#DBDBDB,#C5C5C5);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#DBDBDB', endColorstr='#C5C5C5', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.item-state-color-2{background-color:#FAA732;background-image:-moz-linear-gradient(top,#FBB450,#F89406);background-image:-ms-linear-gradient(top,#FBB450,#F89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#FBB450),to(#F89406));background-image:-webkit-linear-gradient(top,#FBB450,#F89406);background-image:-o-linear-gradient(top,#FBB450,#F89406);background-image:linear-gradient(top,#FBB450,#F89406);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0)}.item-state-color-3{background-color:#5EB95E;background-image:-moz-linear-gradient(top,#62C462,#57A957);background-image:-ms-linear-gradient(top,#62C462,#57A957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62C462),to(#57A957));background-image:-webkit-linear-gradient(top,#62C462,#57A957);background-image:-o-linear-gradient(top,#62C462,#57A957);background-image:linear-gradient(top,#62C462,#57A957);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0)}.item-state-color-4{background-color:#0E90D2;background-image:-moz-linear-gradient(top,#149BDF,#0480BE);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149BDF),to(#0480BE));background-image:-webkit-linear-gradient(top,#149BDF,#0480BE);background-image:-o-linear-gradient(top,#149BDF,#0480BE);background-image:linear-gradient(to bottom,#149BDF,#0480BE);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0)}.item-state-color-5{background-color:#ECD815;background-image:-moz-linear-gradient(top,#ECD815,#D8C616);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ECD815),to(#D8C616));background-image:-webkit-linear-gradient(top,#ECD815,#D8C616);background-image:-o-linear-gradient(top,#ECD815,#D8C616);background-image:linear-gradient(to bottom,#ECD815,#D8C616);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffecd815', endColorstr='#ffd8c616', GradientType=0)}.item-state-color-6{background-color:#DD4398;background-image:-moz-linear-gradient(top,#DD4398,#C93D8A);background-image:-webkit-gradient(linear,0 0,0 100%,from(#DD4398),to(#C93D8A));background-image:-webkit-linear-gradient(top,#DD4398,#C93D8A);background-image:-o-linear-gradient(top,#DD4398,#C93D8A);background-image:linear-gradient(to bottom,#DD4398,#C93D8A);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffdd4398', endColorstr='#ffc93d8a', GradientType=0)}.item-state-color-7{background-color:#954F99;background-image:-moz-linear-gradient(top,#954F99,#7A387E);background-image:-webkit-gradient(linear,0 0,0 100%,from(#954F99),to(#7A387E));background-image:-webkit-linear-gradient(top,#954F99,#7A387E);background-image:-o-linear-gradient(top,#954F99,#7A387E);background-image:linear-gradient(to bottom,#954F99,#7A387E);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff954f99', endColorstr='#ff7a387e', GradientType=0)}.item-state-color-2,.item-state-color-3,.item-state-color-4,.item-state-color-5,.item-state-color-6,.item-state-color-7{-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box} -.gc_wide{width: 932px;} -.gc_wide .gc_container-header{text-align: left; padding-left: 20px;} -table{margin-top: 20px; -webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;} -th:first-child{-webkit-border-radius: 6px 0 0 0;-moz-border-radius: 6px 0 0 0;border-radius: 6px 0 0 0; border-left:none} -th:last-child{-webkit-border-radius: 0 6px 0 0;-moz-border-radius: 0 6px 0 0;border-radius: 0 6px 0 0;border-right:none} - -th{width: 40px; padding: 12px 0; background-color: #f5f5f5} -th.gc_th_item_name{width: 912px; text-align: left;} -td{text-align: center; border-top: 1px solid #ddd} -td.gc_status{padding: 12px 0 8px;} -td.gc_itemname{text-align: left;} - -.gc_wide form{padding: 0} -.gc_main_content{padding: 20px; border-bottom: 1px solid #ddd; margin-bottom: 1px;} - -.gc_subfooter{background-color: #f5f5f5; padding: 20px} - -.gc_search_items{display: block; padding: 20px 20px 14px; background-color: #f5f5f5; border: 1px solid #e9e9e9; -webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;} -#gc_importer_step_items_import .gc_search_items{padding-bottom: 19px;} -.gc_search_items input{display: inline-block; padding: 5px; width: 208px;} -#gc_itemlist_container .gc_search_items button{display: none; margin-left: 16px; white-space: nowrap; margin-top: -2px;} -#gc_itemlist_container .gc_subfooter{display: none;} -#gc_itemlist_container .gc_main_content{border-bottom: 0 none} -#gc_itemlist_container.checked .gc_main_content{border-bottom: 1px solid #DDD;} - -.gc_search_items .gc_right .dropdown-menu a{padding-left: 8px;} -.gc_search_items .gc_right .dropdown-menu .item-status{height: 13px; margin-right: 2px; position: relative; top: 1px; width: 13px;} - - -.gc_search_items .gc_left .btn-group > .btn:last-child, .gc_search_items .gc_left .btn-group > .dropdown-toggle{top: -7px;} - -#gc_importer_step_items_import .gc_table_title{width: 712px;} -.gc_settings_container{border-top: 0 none;} -.gc_settings_container > div{background-color: #555;padding: 10px;color: #fff;-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;} - -.gc_settings_col a span.caret{position: relative;top: 7px;border-bottom: 0 none;} -.gc_settings_col a span.caret{border-top: 4px solid #000000;} -.gc_settings_col a span.caret-up{border-bottom: 4px solid #000000;border-top: 0 none;top: 6px;} - - -.gc_settings_header .gc_setting{float: left; display: inline-block; margin-right: 20px; margin-top: 5px;} -.gc_settings_header{padding: 10px} -.gc_setting label{font-weight: bold; font-size: 14px; margin-right: 5px} -.hidden-item{display: none;} -.gc_settings_header .repeat_config{padding-top: 4px;float: right;margin-right: 0;margin: 0;} -.repeat_config input{margin-left: 5px;position: relative;top: 1px;} - - -.gc_settings_field{font-size: 14px;font-weight: bold;margin-top: 5px;background-color: #474747;-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;padding: 7px 10px 7px 30px;position: relative;} -.gc_move_field{height: 14px;width: 6px;background: url('../img/sort_field.png') no-repeat scroll left top transparent;position: absolute;top: 12px;left: 14px;cursor: pointer;} -.gc_settings_field .gc_left{padding-top: 4px;font-style: italic;} -.gc_settings_field .btn-group{font-weight: normal;margin-left: 20px;} -.gc_settings_field > div, .not-moved > div, .moved:hover > div{color: #fff;} -.moved > div{color: #b3b3b3;} -.moved .gc_move_field{background-position: left bottom;} -.moved:hover .gc_move_field{background-position: left top;} -.gc_settings_field .btn, .not-moved .btn, .moved:hover .btn{opacity:1;filter:alpha(opacity=100);background-color: #f5f5f5;background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);background-repeat: repeat-x;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);*background-color: #e6e6e6;filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);} -.moved .btn{background-image:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} -.dropdown-menu > li.inputting, .dropdown-menu > li.live_filter{padding: 3px 15px} -.dropdown-menu > li input{width: 100%;} -.gc_settings_container .open > .dropdown-menu, .gc_search_items .open > .dropdown-menu{max-height: 300px;overflow-x: hidden;overflow-y: auto;} -.gc_search_items .gc_left .open > .dropdown-menu{top: 80%;} -.gc_itemlist tr.checked td{background-color: #FFFDBF;} -.gc_itemlist tr:hover td{background-color: #BFD9F5;} - -.gc_modal{text-align: center;padding: 0 20px 20px;position: fixed;z-index: 100;background-color: #fff;left: 50%;margin-left:-148px;top:50%;margin-top:-40px;display: none;} -.gc_overlay{display: none;bottom: 0;left: 0;position: fixed;right: 0;top: 0;background-color: #000;z-index: 90;opacity:0.65;filter:alpha(opacity=65);} - -#gc_items .gc_tab_name{display: inline-block; font-size: 12px; background: #000; padding: 1px 5px; margin-right: 5px; -webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px} diff --git a/css/main.css b/css/main.css deleted file mode 100644 index d1595bca..00000000 --- a/css/main.css +++ /dev/null @@ -1,47 +0,0 @@ -@import url('bootstrap.min.css'); -.gc_container h2{font-size: 20px; margin: 16px 0;} -.gc_container a{text-decoration: none; position: relative;} -.gc_left{float: left; padding-top: 8px;} - -.gc_right{float: right;} - -.gc_center{text-align: center;} -.gc_logo{background: url('../img/logo-big.png') 50% 50% no-repeat; height: 29px; width: 215px; margin: 30px auto;} -.gc_logo span{display: none} - -.gc_container{width: 414px; background-color: #fff; border: 1px solid #d5d5d5;-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;margin:0 auto;box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.4);} -.gc_container-header{text-align: center; border-bottom: 1px solid #eee} -.gc_container form, .gc_finished{padding: 0 20px 20px; position: relative;} -.gc_container .curl_error{padding: 0 20px;} -#gc_media{padding:20px; position: relative;} -.gc_finished{text-align: center;} -.gc_container .gc_message{font-size: 14px; padding: 20px 0; margin: 0;} -#gc_importer_step_auth > div{margin-top: 20px;} -#gc_importer_step_auth label, #gc_media label, .gc_modal label{color: #a97d13; font-weight: bold; font-size: 14px; display: block;} -#gc_media label, .gc_modal label{padding-bottom: 6px; text-align: left;} -#gc_importer_step_auth .gc_domain, #gc_importer_step_auth .gc_domainprefix{position: absolute; top: 31px; right: 32px; font-size: 12px;} -#gc_importer_step_auth .gc_domainprefix{left: 32px; right: 0; width: 35px;} - -#gc_importer_step_auth input[type="text"]{margin-top: 7px; border: 1px solid #BBB; border-bottom: 1px solid #EAEAEA; border-right: 1px solid #EAEAEA; -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1) inset; -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1) inset; box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1) inset; display: block; font-size: 12px; padding: 5px 10px; width: 374px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border-radius: 0;} - -#gc_importer_step_auth #gc_api_url{padding-right: 120px; padding-left: 50px;} -#gc_importer_step_auth .btn{float: right;} - -.gc-ajax-tooltip{display: inline-block; width: 16px; height: 16px; background: url('../img/help.png') no-repeat; position: relative; top: 2px; left: 10px;} - -.gc_error{text-align: center; color: #d90000; font-size: 16px;} -.gc_left a.gc_option, .gc_error a, .gc_blue_link{border-bottom: 1px dotted #2591c3; color: #2591c3; text-decoration: none;} - - -.progress{background-color: #e9e9e9; height: 10px; margin-bottom: 20px;} -.progress .bar{height: 10px; background-color: #5ab800;} -.progress, .progress .bar{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;} - -.gc_list{margin: 13px 0; padding: 0;} -.gc_list span{color: #999;} - -.gc_container-header h2 a.gc_blue_link{font-size: 12px; font-weight: normal; margin-right: 20px;} -#gc_item_title{font-weight: normal; color: #999;} -#gc_media img, .gc_importing_modal img{float: right; display: none} - -.dropdown-menu>li>a{margin: 0;} diff --git a/curl.php b/curl.php deleted file mode 100644 index 9e50b25b..00000000 --- a/curl.php +++ /dev/null @@ -1,1011 +0,0 @@ -config != '' ) { - $config = json_decode( base64_decode( $obj->config ) ); - $new_config = array(); - $total_fields = 0; - if ( $this->foreach_safe( $config ) ) { - foreach ( $config as $tab_pane ) { - $new_fields = array(); - - if ( $this->foreach_safe( $tab_pane->elements ) ) { - foreach ( $tab_pane->elements as $element ) { - switch ( $element->type ) { - case 'text': - $val = $element->value; - $val = trim(str_replace("\xE2\x80\x8B", '', $val)); - if ( !$element->plain_text ) { - $val = preg_replace_callback( - '#\(.+?)\<\/p\>#s', - create_function( - '$matches', - 'return "

".str_replace(array("\n","\r\n","\r"), " ", $matches[1])."

";' - ), - $val - ); - $val = str_replace( '<', "\n<", $val ); - $val = preg_replace( '/<\/p>\s*

/m', "

\n

", $val ); - $val = preg_replace( '/<\/p>\s*\n<", $val ); - $val = preg_replace( '/

\s*<\/p>/m','

 

',$val ); - $val = str_replace( array(''), array(""), $val ); - - $val = preg_replace( '/]*>/i', '', $val ); - $val = preg_replace( '/<\/mark>/i', '', $val ); - } - break; - - case 'choice_radio': - $val = ''; - foreach ( $element->options as $idx => $option ) { - if ( $option->selected ) { - if ( isset( $option->value ) ) { - $val = $option->value; - } - else { - $val = $option->label; - } - } - } - break; - - case 'choice_checkbox': - $val = array(); - foreach ( $element->options as $option ) { - if ( $option->selected ) { - $val[] = $option->label; - } - } - break; - - case 'files': - $val = $this->val( $files, $element->name, array() ); - break; - - default: - continue 2; - break; - } - $new_fields[$element->name] = array( - 'name' => $element->name, - 'label' => $element->label, - 'type' => $element->type, - 'value' => $val, - ); - } - } - - $total_fields += count($new_fields); - - $new_config[strtolower( $tab_pane->name )] = array( - 'label' => $tab_pane->label, - 'elements' => $new_fields, - ); - } - } - - $new_config['field_count'] = $total_fields; - - return $new_config; - } - return array(); - } - - function get_files( $item_id ) { - $files = $this->get( 'get_files_by_page', array('id' => $item_id) ); - if ( $files && isset( $files->files ) && $this->foreach_safe( $files->files ) ) { - foreach ( $files->files as $file ) { - if ( !isset($this->files[$file->page_id])) - $this->files[$file->page_id] = array(); - if ( !isset($this->files[$file->page_id][$file->field])) - $this->files[$file->page_id][$file->field] = array(); - $file->item_id = $file->page_id; - $this->files[$file->page_id][$file->field][] = $file; - } - } - } - - function get_projects() { - $projects = $this->get( 'get_projects' ); - - $newprojects = array(); - if ( $projects && is_object( $projects ) && is_array( $projects->projects ) ) { - foreach ( $projects->projects as $project ) { - $newprojects[$project->id] = array( - 'name' => $project->name, - 'item_count' => $project->page_count, - ); - } - asort( $newprojects ); - } - $this->data['projects'] = $newprojects; - } - - function get_states() { - $states = $this->get( 'get_custom_states_by_project', array('id' => $this->option( 'project_id' ) ) ); - $new_states = array(); - $count = 5; - if ( $states && $this->foreach_safe( $states->custom_states ) ) { - foreach ( $states->custom_states as $state ) { - $new_states[$state->id] = (object) array( - 'name' => $state->name, - 'color' => $this->custom_state_color($state->color_id, $state->color_custom), - 'position' => $state->position, - ); - $count--; - } - uasort( $new_states, array(&$this, 'sort_items') ); - } - $this->data['states'] = $new_states; - } - - function get_projects_dropdown() { - $html = ''; - $url = $this->url( 'projects', false ); - $nonce = wp_create_nonce( $this->base_name ); - $project_id = $this->option( 'project_id' ); - $title = ''; - if ( $this->foreach_safe( $this->data['projects'] ) ) { - foreach ( $this->data['projects'] as $id => $info ) { - if ( $id == $project_id ) { - $title = $info['name']; - } else { - $html .= ' -
  • - ' . $info['name'] . ' -
  • '; - } - } - if ( $html != '' ) { - $html = $this->dropdown_html( '' . $title . '', $html ); - } - } - $this->data['projects_dropdown'] = $html; - } - - function get_state_dropdown() { - $html = ' -
  • - ' . $this->__( 'All' ) . ' -
  • '; - if ( $this->foreach_safe( $this->data['states'] ) ) { - foreach ( $this->data['states'] as $id => $state ) { - $html .= ' -
  • - ' . $state->name . ' -
  • '; - } - } - $this->data['state_dropdown'] = $this->dropdown_html( ' ' . $this->__( 'All' ) . '', $html ); - } - - function get_post_types() { - $post_types = get_post_types( array( 'public' => true ), 'objects' ); - - $this->_is_acf_enabled(); - - $html = ''; - $new_post_types = array(); - $default = ''; - foreach ( $post_types as $type => $obj ) { - $taxonomies = get_object_taxonomies( $type ); - if ( ( $id = array_search( 'post_tag', $taxonomies ) ) !== false ) { - unset($taxonomies[$id]); - $this->allows_tags[$type] = true; - } - if ( ( $id = array_search( 'post_format', $taxonomies ) ) !== false ) { - unset($taxonomies[$id]); - } - $this->taxonomies[$type] = $taxonomies; - if ( $default == '' ) { - $default = $type; - } - - if ( $obj->hierarchical ) { - $this->hierarchical[$type] = true; - } - - $html .= ' -
  • - ' . $obj->labels->singular_name . ' -
  • '; - $new_post_types[$type] = $obj->labels->singular_name; - } - $this->post_types = $new_post_types; - $this->data['post_types_dropdown'] = $html; - $this->default_post_type = $default; - } - - function get_items( $save_items = false ) { - $project_id = $this->option( 'project_id' ); - $items = $this->get( 'get_pages_by_project', array('id' => $project_id ) ); - $original = array(); - $new_items = array(); - $parent_array = array(); - if ( $items && is_array( $items->pages ) ) { - foreach ( $items->pages as $item ) { - $original[$item->id] = $item; - $parent_id = $item->parent_id; - if ( ! isset( $parent_array[$parent_id] ) ) { - $parent_array[$parent_id] = array(); - } - $parent_array[$parent_id][$item->id] = $item; - - $this->item_count++; - } - foreach ( $parent_array as $parent_id => $item_array ) { - $array = $item_array; - uasort( $array, array(&$this, 'sort_items') ); - $parent_array[$parent_id] = $array; - } - if ( isset( $parent_array[0] ) ) { - foreach ( $parent_array[0] as $id => $item ) { - $new_items[$id] = $item; - $new_items[$id]->children = $this->sort_recursive( $parent_array, $id ); - } - } - else { - foreach ( $parent_array as $parent => $items ) { - $new_items += $items; - } - } - } - $this->items = $new_items; - $this->original_array = $original; - - if ( $save_items ) { - $selected = $this->option( 'selected_items' ); - if ( ! $this->foreach_safe( $selected ) ) { - $selected = array(); - } - - foreach ( $selected as $id ) { - if ( isset( $original[$id] ) ) { - $this->save_gc_item( $id, $project_id, $original[$id] ); - } - } - } - } - - function item_overwrite_dropdown() { - $html = $this->_get_tree_list(); - - if ( $html != '' ) { - $html = ' -
  • ' . $html; - } - - $html = ' -
  • - ' . $this->__( 'New entry' ) . ' -
  • ' . $html; - $this->data['overwrite_select'] = $html; - } - - function parent_dropdown() { - $html = '
  • - ' . $this->__( 'NONE' ) . ' -
  • -
  • - ' . $this->__( 'Parent Being Imported' ) . ' -
  • -
  • ' . $this->_get_tree_list(); - $this->data['parent_select'] = $html; - } - - function _get_tree_list() { - if ( isset( $this->data['tree_list'] ) ) { - return $this->data['tree_list']; - } - - $html = ''; - $walker = new GC_Walker_ItemDropdown(); - foreach ( $this->post_types as $name => $title ) { - $args = array( - 'posts_per_page' => -1, - 'offset' => 0, - 'orderby' => 'title', - 'order' => 'ASC', - 'post_type' => $name, - 'post_status' => 'any', - ); - $this->item_ids[$name] = array(); - $items = get_posts( $args ); - if ( ! empty( $items ) ) { - $html .= call_user_func_array( array($walker, 'walk'), array($items, 0, $args, 0, $this->base_name) ); - foreach ( $items as $item ) { - $this->item_ids[$name][] = $item->ID; - } - } - } - - $this->data['tree_list'] = $html; - - return $this->data['tree_list']; - } - - function _initialize_yoast() { - wpseo_init(); - - wpseo_admin_init(); - - wpseo_load_textdomain(); - - $options = WPSEO_Options::get_all(); - - new WPSEO_Metabox; - WPSEO_Metabox::translate_meta_boxes(); - - if ( $options['opengraph'] === true || $options['twitter'] === true || $options['googleplus'] === true ) { - new WPSEO_Social_Admin; - WPSEO_Social_Admin::translate_meta_boxes(); - } - } - - function _is_acf_enabled() { - - if( function_exists( 'acf_get_field_groups') ) { - $this->has_acf = true; - $this->acf_pro = true; - } - elseif( function_exists( 'api_acf_get_field_groups' ) ) { - $this->has_acf = true; - } - } - - function _acf_get_field_groups($params) { - if( $this->acf_pro ) { - $acf = acf_get_field_groups( $params ); - - $post_ids = array(); - - foreach($acf as $post) { - $post_ids[] = $post['ID']; - } - - return $post_ids; - } - else { - return apply_filters( 'acf/location/match_field_groups', array(), $params ); - } - } - - function map_to_dropdown() { - global $wpdb; - $dont_allow = array('_wp_attachment_image_alt', '_wp_attachment_metadata', '_wp_attached_file', '_edit_lock', '_edit_last', '_wp_page_template'); - $html = ' -
  • - -
  • '; - $field_groups = array(); - $supports_custom = array(); - - $yoast_field_type_array = array('text', 'textarea', 'select', 'upload', 'radio', 'multiselect'); - - $yoast = false; - if( function_exists( 'wpseo_admin_init' ) ) { - $this->_initialize_yoast(); - $yoast = true; - } - - $yoast_prefix = '_yoast_wpseo_'; - $yoast_fields = array(); - - foreach ( $this->post_types as $name => $title ) { - $supports = get_all_post_type_supports( $name ); - if ( isset( $supports['custom-fields'] ) ) { - $supports_custom[] = $name; - } - if ( $name == 'attachment' ) { - $html .= ' -
  • - ' . $this->__( 'Title' ) . ' -
  • -
  • - ' . $this->__( 'Caption' ) . ' -
  • -
  • - ' . $this->__( 'Description' ) . ' -
  • -
  • - ' . $this->__( 'Alt Text' ) . ' -
  • '; - } else { - $labels = array( - 'title' => sprintf( $this->__( '%s Title' ), $title ), - 'editor' => sprintf( $this->__( '%s Content' ), $title ), - 'excerpt' => sprintf( $this->__( '%s Excerpt' ), $title ), - 'thumbnail' => $this->__( 'Featured Image' ), - 'tags' => $this->__( 'Tags' ), - 'cats' => $this->__( 'Category' ), - 'author' => $this->__( 'Author' ), - ); - $fields = array( - 'editor' => 'post_content', - 'title' => 'post_title', - 'excerpt' => 'post_excerpt', - 'thumbnail' => 'gc_featured_image_', - 'author' => 'post_author', - ); - foreach ( $fields as $type => $fieldname ) { - if ( isset( $supports[$type] ) ) { - $html .= ' -
  • - ' . esc_html( $labels[$type] ) . ' -
  • '; - } - } - if ( count( $this->taxonomies[$name] ) > 0 ) { - $html .= ' -
  • - ' . esc_html( $labels['cats'] ) . ' -
  • '; - } - if ( isset( $this->allows_tags[$name] ) ) { - $html .= ' -
  • - ' . esc_html( $labels['tags'] ) . ' -
  • '; - } - } - - if ( $this->has_acf ) { - - $acf = $this->_acf_get_field_groups( array( 'post_type' => $name ) ); - - foreach ( $acf as $post_id ) { - if ( ! isset( $field_groups[$post_id] ) ) { - $field_groups[$post_id] = array('types' => array(), 'posts' => array()); - } - $field_groups[$post_id]['types'][] = $name; - $field_groups[$post_id]['posts'][] = 0; - } - - foreach ( $this->item_ids[$name] as $item_id ) { - - $acf = $this->_acf_get_field_groups( array( 'post_id' => $item_id ) ); - - foreach ( $acf as $post_id ) { - if ( ! isset( $field_groups[$post_id] ) ) { - $field_groups[$post_id] = array( 'posts' => array() ); - } elseif ( ! isset( $field_groups[$post_id]['posts'] ) ) { - $field_groups[$post_id]['posts'] = array(); - } - $field_groups[$post_id]['posts'][] = $item_id; - } - } - } - - if( $yoast ) { - $meta_boxes = array_merge( WPSEO_Meta::get_meta_field_defs( 'general', $name ), WPSEO_Meta::get_meta_field_defs( 'advanced' ), apply_filters( 'wpseo_save_metaboxes', array() ) ); - foreach ( $meta_boxes as $field_name => $meta_box ) { - if(($field_name == 'title' || $field_name == 'metadesc') || (in_array($meta_box['type'], $yoast_field_type_array) && !empty($meta_box['title']))) { - $yoast_fields[$yoast_prefix . $field_name] = true; - - $html .= ' -
  • - ' . esc_html( $meta_box['title'] ) . ' -
  • '; - - } - } - - } - } - - - foreach ( $field_groups as $id => $options ) { - $options['posts'] = array_unique( $options['posts'] ); - - if( $this->acf_pro ) { - $fields = acf_get_fields( $id ); - } - else { - $fields = apply_filters( 'acf/field_group/get_fields', array(), $id ); - } - - if(is_array($fields) && count($fields) > 0) { - - foreach ( $fields as $field ) { - $dont_allow[] = $field['key']; - $text = $field['label']; - if ( strlen( $text ) > 30 ) { - $text = substr( $text, 0, 30 ) . '...'; - } - $ext = ''; - if ( isset( $options['types'] ) && count( $options['types'] ) > 0 ) { - $ext .= ' data-acf-post-types="|' . implode( '|', $options['types'] ) . '|"'; - } - if ( isset( $options['posts'] ) && count( $options['posts'] ) > 0 ) { - $ext .= ' data-acf-post-ids="|' . implode( '|', $options['posts'] ) . '|"'; - } - $html .= ' -
  • - ' . esc_html( $text ) . ' -
  • '; - } - } - } - - - if( $yoast ) { - $yoast_fields[$yoast_prefix . 'linkdex'] = true; - $dont_allow = array_merge( $dont_allow, array_keys( $yoast_fields ) ); - } - - - $dont_allow = "'".implode( "','", $dont_allow )."'"; - $keys = $wpdb->get_col( - "SELECT meta_key FROM $wpdb->postmeta WHERE meta_key NOT IN($dont_allow) GROUP BY meta_key ORDER BY meta_key" - ); - $supports_custom = '|' . implode( '|', $supports_custom ) . '|'; - if ( $keys ) { - natcasesort( $keys ); - foreach ( $keys as $key ) { - $text = $key; - if ( strlen( $key ) > 30 ) { - $text = substr( $key, 0, 30 ) . '...'; - } - $html .= ' -
  • - ' . esc_html( $text ) . ' -
  • '; - } - } - $html .= ' -
  • - ' . $this->__( 'New Custom Field' ) . ' -
  • -
  • -
  • - ' . $this->__( 'Do Not Import' ) . ' -
  • '; - $this->data['map_to_select'] = $html; - } - - function categories_dropdown() { - $html = ''; - foreach ( $this->post_types as $name => $title ) { - $r = array('hide_empty' => false); - - if ( $name != 'post' ) { - $taxonomies = $this->taxonomies[$name]; - if ( count( $taxonomies ) > 0 ) - { - $r['taxonomy'] = $taxonomies; - } else { - continue; - } - } - - $categories = get_categories( $r ); - if ( $categories ) { - $html .= ''; - $r['post_type'] = $name; - $walker = new GC_Walker_CategoryDropdown; - $html .= call_user_func_array( array(&$walker, 'walk'), array($categories, 0, $r) ); - } - } - $this->data['category_select'] = $html; - } - - function publish_dropdown() { - $stati = get_post_stati( array('internal' => false), 'objects' ); - - unset( $stati['future'], $stati['private'] ); - - $html = ''; - - foreach ( $stati as $status => $object ) { - $html .= ' -
  • - ' . $object->label . ' -
  • '; - } - $this->data['publish_select'] = $html; - } - - function format_dropdown() { - $html = ''; - - $supported = array(); - - if ( current_theme_supports( 'post-formats' ) ) { - - foreach ( $this->post_types as $name => $title ) { - - if( post_type_supports( $name, 'post-formats' ) ) { - - $supported[] = $name; - - } - } - } - - $supported_str = implode( '|', $supported ); - - if( count( $supported ) > 0 ) { - - $post_formats = get_theme_support( 'post-formats' ); - - foreach ( $post_formats[0] as $format ) { - $html .= ' -
  • - ' . esc_html( get_post_format_string( $format ) ) . ' -
  • '; - } - } - - if( !empty( $html ) ) { - $html = ' -
  • - ' . get_post_format_string( 'standard' ) . ' -
  • '.$html; - } - - $this->data['post_format'] = $html; - } - - function dropdown_html( $val, $html, $input = false, $real_val = '' ) { - return ' - '; - } - - function get_parent_item_id( $parent_id, $selected_items, $cur_settings ) { - $new_parent_id = 0; - if ( isset( $cur_settings['parent_id'] ) ) { - $new_parent_id = $cur_settings['parent_id']; - } else { - if ( $parent_id > 0 ) { - if ( in_array( $parent_id, $selected_items ) ) { - $new_parent_id = '_imported_item_'; - } else { - $project_id = $this->option( 'project_id' ); - $cur_settings = $this->option( 'saved_settings', array() ); - if ( isset( $cur_settings[$project_id] ) && - isset( $cur_settings[$project_id][$parent_id] ) ) { - $new_parent_id = $cur_settings[$project_id][$parent_id]['overwrite']; - } - } - } - } - - return $new_parent_id; - } - - function generate_settings( $array, $index = -1, $show_settings = false ) { - $out = ''; - $index++; - $selected = $this->option( 'selected_items' ); - if ( ! $this->foreach_safe( $selected ) ) { - $selected = array(); - } - foreach ( $array as $id => $item ) { - if ( $show_settings && ! in_array( $id, $selected ) ) { - if ( isset( $item->children ) && count( $item->children ) > 0 ) { - $out .= $this->generate_settings( $item->children, $index, $show_settings ); - } - continue; - } - $checked = $show_settings; - $cur_settings = array(); - if ( isset( $this->data['saved_settings'][$id] ) ) { - $cur_settings = $this->data['saved_settings'][$id]; - } - $add = ''; - - $parent_id = $item->parent_id; - - $config = $this->get_field_config( $item ); - - $field_count = $this->val($config, 'field_count', 0); - - $show_fields = true; - if ( $show_settings && $field_count == 0 ) { - $show_fields = false; - } - $out .= ' - - - '; - - - if ( $index > 0 ) { - for ( $i = 0; $i < $index; $i++ ) { - $out .= '        '; - } - $out .= '↳'; - } - - $out .= ' - ' . ($show_fields?'':'') . ' - '; - - if ( $show_settings ) { - if ( $show_fields ) { - $parent_id_value = $this->get_parent_item_id( $parent_id, $selected, $cur_settings ); - $add = ' - - -
    -
    -
    -
    - - ' . $this->dropdown_html( '', $this->data['post_types_dropdown'], 'gc[post_type][]', $this->val( $cur_settings, 'post_type' ) ) . ' -
    -
    - - ' . $this->dropdown_html( '', $this->data['overwrite_select'], 'gc[overwrite][]', $this->val( $cur_settings, 'overwrite' ) ) . ' -
    -
    - - ' . $this->dropdown_html( '' . esc_html( $this->__( 'Choose category' ) ) . '', $this->data['category_select'], 'gc[category][]', $this->val( $cur_settings, 'category', '-1' ) ) . ' -
    -
    - - ' . $this->dropdown_html( '', $this->data['parent_select'], 'gc[parent][]', $parent_id_value ) . ' -
    -
    - - ' . $this->dropdown_html( '', $this->data['publish_select'], 'gc[state][]', $this->val( $cur_settings, 'state', 'draft' ) ) . ' -
    -
    - - ' . $this->dropdown_html( '', $this->data['post_format'], 'gc[format][]', $this->val( $cur_settings, 'format', '0' ) ) . ' -
    -
    - -
    -
    -
    -
    '; - - $field_settings = $this->val( $cur_settings, 'fields', array() ); - - if ( count( $field_settings ) > 0 ) { - foreach ( $field_settings as $name => $value ) { - list( $tab, $field_name ) = explode( '_', $name, 2 ); - $val = $acf = $acf_post = ''; - if ( is_array( $value ) ) - { - $val = $value[0]; - $acf = $value[1]; - $acf_post = $value[2]; - } else { - $val = $value; - } - if(isset( $config[$tab] ) && isset( $config[$tab]['elements'][$field_name] ) ) { - $add .= $this->field_settings( $id, $config[$tab]['elements'][$field_name], $tab, $config[$tab]['label'], $val, $acf, $acf_post ); - unset( $config[$tab]['elements'][$field_name] ); - } - } - } - - unset( $config['field_count'] ); - - foreach( $config as $tab_name => $tab ) { - - foreach ( $tab['elements'] as $field ) { - $val = $acf = $acf_post = ''; - $cur = $this->val( $field_settings, $tab_name . '_' . $field['name'] ); - if ( is_array( $cur ) ) { - $val = $cur[0]; - $acf = $cur[1]; - $acf_post = $cur[2]; - } else { - $val = $cur; - } - $add .= $this->field_settings( $id, $field, $tab_name, $tab['label'], $val, $acf, $acf_post ); - } - } - - $add .= ' -
    -
    - - '; - } else { - $message = $this->__( 'This item is empty. You can %sadd some content to this item in GatherContent%s.' ); - $message = sprintf( - $message, - '', - '' - ); - $add = ' - - -
    ' . $message . '
    - - '; - } - } - $out .= $add; - if ( isset( $item->children ) && count( $item->children ) > 0 ) - { - $out .= $this->generate_settings( $item->children, $index, $show_settings ); - } - } - - return $out; - } - - function field_settings( $id, $field, $tab = 'content', $tab_label = '', $val = '', $acf_val = '', $acf_post = '' ) { - if ( $field['type'] == 'section' ) - { - return ''; - } - $fieldid = $id . '_' . md5( $tab . '_' . $field['label'] ); - $counter = 0; - while ( isset( $this->ids_used[$fieldid] ) ) - { - $fieldid = $fieldid.$counter++; - } - $this->ids_used[$fieldid] = true; - $html = ' -
    -
    -
    ' . $tab_label . '
    ' . $field['label'] . '
    -
    - ' . $this->__( 'Map to' ) . ' - ' . $this->dropdown_html( '', $this->data['map_to_select'], 'gc[map_to][' . $id . '][]', $val ) . ' - - -
    - - -
    - '; - return $html; - } - - function _curl( $url, $curl_opts = array() ) { - @set_time_limit( 60 ); - $session = curl_init(); - - curl_setopt( $session, CURLOPT_URL, $url ); - curl_setopt( $session, CURLOPT_HEADER, false ); - curl_setopt( $session, CURLOPT_RETURNTRANSFER, true ); - curl_setopt( $session, CURLOPT_SSL_VERIFYPEER, true ); - curl_setopt( $session, CURLOPT_CAINFO, $this->plugin_path . 'cacert.pem' ); - - // proxy support - $proxy = new WP_HTTP_Proxy(); - - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { - - curl_setopt( $session, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); - curl_setopt( $session, CURLOPT_PROXY, $proxy->host() ); - curl_setopt( $session, CURLOPT_PROXYPORT, $proxy->port() ); - - if ( $proxy->use_authentication() ) { - curl_setopt( $session, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); - curl_setopt( $session, CURLOPT_PROXYUSERPWD, $proxy->authentication() ); - } - } - - $curl_opts = apply_filters( 'gathercontent_curl_opts', $curl_opts ); - curl_setopt_array( $session, $curl_opts ); - $session = apply_filters( 'gathercontent_curl_session', $session, $curl_opts ); - - $response = curl_exec( $session ); - $httpcode = curl_getinfo( $session, CURLINFO_HTTP_CODE ); - curl_close( $session ); - return array('response' => $response, 'httpcode' => $httpcode); - } - - function get( $command = '', $postfields = array() ) { - $api_url = 'https://' . $this->option( 'api_url' ) . '.gathercontent.com/api/0.4/' . $command; - $curl_opts = array( - CURLOPT_HTTPAUTH => CURLAUTH_DIGEST, - CURLOPT_HTTPHEADER => array('Accept: application/json', 'Content-Type: application/x-www-form-urlencoded'), - CURLOPT_USERPWD => $this->option( 'api_key' ) . ':x', - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => http_build_query( $postfields ), - ); - - extract( $this->_curl( $api_url, $curl_opts ) ); - - try { - $resp = json_decode( $response ); - - if ( isset( $resp->success ) && $resp->success === true ) { - return $resp; - } elseif ( isset($resp->error) ) { - $error = $resp->error; - if ( $error == 'You have to log in.' ) - { - $error = $this->auth_error(); - } - $this->error = $this->__( $error ); - } else { - $this->error = $this->auth_error(); - } - } catch(Exception $e) { - $this->error = $this->__( 'There was a problem contacting the API. Please check your server allows it.' ); - } - - return false; - } - - function auth_error() { - return sprintf( $this->__( 'There was a problem contacting the API. Please check your API credentials. %sAuth Settings%s' ), '','' ); - } - - function sort_recursive( $items, $current = 0 ) { - $children = array(); - if ( isset( $items[$current] ) ) { - $children = $items[$current]; - foreach ( $children as $id => $item ) { - $children[$id]->children = $this->sort_recursive( $items, $id ); - } - } - return $children; - } - - function sort_items( $a, $b ) { - if ( $a->position == $b->position ) { - if ( $a->id == $b->id ) { - return 0; - } else { - return ($a->id < $b->id) ? -1 : 1; - } - } - return ($a->position < $b->position) ? -1 : 1; - } -} - -class GC_Walker_ItemDropdown extends Walker { - var $tree_type = 'item'; - var $db_fields = array('parent' => 'post_parent', 'id' => 'ID'); - - function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0, $base_name = 'default' ) { - $pad = str_repeat( ' ', $depth * 3 ); - - $title = apply_filters( 'list_items', $item->post_title, $item ); - if ( empty( $title ) ) { - $title = __( '(no title)', $base_name ); - } - $title_text = $title; - if ( strlen( $title_text ) > 30 ) { - $title_text = substr( $title_text, 0, 30 ) . '...'; - } - - $output .= '
  • '; - $output .= $pad . esc_html( $title_text ); - $output .= "
  • \n"; - } -} -class GC_Walker_CategoryDropdown extends Walker { - var $tree_type = 'category'; - var $db_fields = array('parent' => 'parent', 'id' => 'term_id'); - - function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { - $pad = str_repeat( ' ', $depth * 3 ); - - $output .= '
  • '; - $output .= $pad . esc_html( $category->name ); - $output .= "
  • \n"; - } -} diff --git a/functions.php b/functions.php deleted file mode 100644 index 730d5684..00000000 --- a/functions.php +++ /dev/null @@ -1,328 +0,0 @@ -base_name = dirname( $base_name ); - $this->plugin_url = plugin_dir_url( __FILE__ ); - $this->plugin_path = plugin_dir_path( __FILE__ ); - } - - function get_author_id( $display_name ) { - global $wpdb; - - $user = $wpdb->get_row( $wpdb->prepare( - "SELECT `ID` FROM $wpdb->users WHERE `display_name` = %s", - $display_name - ) ); - - if ( ! $user ) { - return 0; - } - - return $user->ID; - } - - function save_gc_item( $id, $project_id, $config ) { - global $wpdb; - $config = base64_encode( serialize( $config ) ); - $table_name = $wpdb->prefix . 'gathercontent_items'; - if ( $this->get_gc_item( $id ) !== false ) { - return $wpdb->update( $table_name, array('project_id' => $project_id, 'config' => $config), array('item_id' => $id) ); - } - return $wpdb->insert( $table_name, array('item_id' => $id, 'project_id' => $project_id, 'config' => $config) ); - } - - function get_gc_item( $id ) { - global $wpdb; - - $table_name = $wpdb->prefix . 'gathercontent_items'; - - $row = $wpdb->get_row( - $wpdb->prepare( - "SELECT * FROM $table_name WHERE item_id = %d", - $id - ) - ); - - if ( $row === null ) { - return false; - } - - $row->config = unserialize( base64_decode( $row->config ) ); - - return $row; - } - - function delete_gc_item( $id ) { - global $wpdb; - - $table_name = $wpdb->prefix . 'gathercontent_items'; - - $row = $wpdb->query( - $wpdb->prepare( - "DELETE FROM $table_name WHERE item_id = %d", - $id - ) - ); - - } - - function delete_gc_items( $project_id ) { - global $wpdb; - - $table_name = $wpdb->prefix . 'gathercontent_items'; - - $row = $wpdb->query( - $wpdb->prepare( - "DELETE FROM $table_name WHERE project_id = %d", - $project_id - ) - ); - - } - - function get_submit_button( $text, $tag = 'button', $ext = '' ) { - $html = '<' . $tag; - if ( $tag == 'button' ) { - $html .= ' type="submit"'; - } - echo $html . ' class="btn btn-success gc_ajax_submit_button"' . $ext . '> ' . $text . ''; - } - - function get_item_title_array( $post_id ) { - $data = array(); - $post = get_post( $post_id ); - $title = isset($post->post_title) ? $post->post_title : ''; - $title = empty($title) ? '(no title)' : $title; - $data['original_title'] = esc_attr( strip_tags( apply_filters( 'the_title', $title, $post_id ) ) ); - if ( strlen( $title ) > 30 ) { - $title = substr( $title, 0, 27 ) . '...'; - } - $data['item_title'] = apply_filters( 'the_title', $title, $post_id ); - return $data; - } - - function percent( $num, $total ) { - return number_format( ( ( $num / $total ) * 100 ),2 ); - } - - function foreach_safe( $arr ) { - if ( is_array( $arr ) && count( $arr ) > 0 ) { - return true; - } - return false; - } - - function url( $key = '', $echo = true ) { - $url = menu_page_url( $this->base_name, false ); - if ( $key != '' ) { - if ( strpos( $url, '?' ) === false ) { - $url .= '?'; - } else { - $url .= '&'; - } - $url .= 'step=' . $key; - } - if ( ! $echo ) { - return $url; - } - echo $url; - } - - function enqueue( $handle, $type = 'script' ) { - if ( $type == 'script' ) { - wp_enqueue_script( $this->base_name . '-' . $handle ); - } else { - wp_enqueue_style( $this->base_name . '-' . $handle ); - } - } - - function admin_print_scripts() { - $this->enqueue( 'main' ); - $this->enqueue( $this->step() ); - } - - function admin_print_styles() { - $this->enqueue( 'main', 'style' ); - $step = $this->step(); - if ( $step == 'items' || $step == 'item_import' ) - { - $this->enqueue( 'items', 'style' ); - } - } - - function option( $key ) { - return get_option( $this->base_name . '_' . $key ); - } - - function update( $key, $val ) { - update_option( $this->base_name . '_' . $key, $val ); - } - - function _e( $text ) { - _e( $text, $this->base_name ); - } - - function __( $text ) { - return __( $text, $this->base_name ); - } - - function val( $array, $field, $default = '' ) { - if ( is_array( $array ) && isset( $array[$field] ) ) { - return $array[$field]; - } - return $default; - } - - function step() { - if ( isset( $this->step ) ) { - return $this->step; - } - $steps = array( 'login', 'projects', 'items', 'item_import', 'media', 'finished' ); - if ( !( isset( $_GET['step'] ) && in_array( $_GET['step'], $steps ) ) ) { - $step = 'login'; - if ( $this->option( 'api_key' ) != '' && $this->option( 'api_url' ) != '' ) { - $step = 'projects'; - } - } else { - $step = $_GET['step']; - } - $checks = array( - 'projects' => array('fields' => array('api_key', 'api_url'), 'prev' => 'login'), - 'items' => array('fields' => array('project_id'), 'prev' => 'projects'), - 'item_import' => array('fields' => array('project_id'), 'prev' => 'projects'), - 'media' => array('fields' => array('project_id'), 'prev' => 'projects'), - ); - if ( isset( $checks[$step] ) ) { - $error = false; - foreach ( $checks[$step]['fields'] as $chk ) { - if ( $this->option( $chk ) == '' ) { - $error = $this->step_error = true; - break; - } - } - if ( $error ) { - $_GET['step'] = $checks[$step]['prev']; - return $this->step(); - } - } - $this->step = $step; - return $step; - } - - function view( $file, $vars = array() ) { - extract( $this->data ); - extract( $vars ); - include $this->plugin_path . 'view/' . $file . '.php'; - } - - function custom_state_color( $color_id, $color_custom ) { - $colors = array( - 1 => '#C5C5C5', - 2 => '#FAA732', - 3 => '#5EB95E', - 4 => '#0E90D2', - 5 => '#ECD815', - 6 => '#DD4398', - 7 => '#954F99', - 9999 => $this->custom_color_hex( $color_custom ) - ); - return $colors[$color_id]; - } - - function custom_color_hex( $color_custom ) { - - if(empty( $color_custom )) { - $color_custom = '#999999'; - } - - return $color_custom; - } - - function add_media_to_content( $post_id, $file, $more_than_1 = false ) { - $post_fields = array('post_title', 'post_content', 'post_excerpt'); - $image_file = file_is_displayable_image( $file['new_file'] ); - $html = $file['url']; - if ( isset( $file['acf'] ) ) { - update_field( $file['acf']['field_id'], $file['new_id'], $post_id ); - } elseif ( in_array( $file['field'], $post_fields ) ) { - $tag = '#_gc_file_name_' . $file['counter'] . '#'; - $post = get_post( $post_id ); - if ( $image_file ) { - $html = '' . esc_attr( $file['title'] ) . '' . "\n"; - } else { - $html = '' . $file['title'] . '' . "\n"; - } - if ( $more_than_1 ) { - $html .= $tag; - } - $post = (array) $post; - $new_post = array( - 'ID' => $post_id, - $file['field'] => str_replace( $tag, $html, $post[$file['field']] ) - ); - wp_update_post( $new_post ); - } elseif ( $file['field'] == 'gc_featured_image_' ) { - update_post_meta( $post_id, '_thumbnail_id', $file['new_id'] ); - } else { - add_post_meta( $post_id, $file['field'], $html ); - } - - } - - function get_media_ajax_output( $post_id, $media, $cur_post, $item_total, $total, $state = 'draft' ) { - $cur_num = $_GET['cur_num']; - $cur_total = $_GET['cur_total']; - - $next_id = $post_id; - if ( $cur_num == $item_total ) { - $item_percent = 100; - $cur_num = 1; - unset($media[$post_id]); - $next_id = key( $media ); - wp_update_post( - array( - 'ID' => $post_id, - 'post_status' => $state, - ) - ); - } else { - $item_percent = $this->percent( $cur_num, $item_total ); - $cur_num++; - $media[$post_id] = $cur_post; - } - $media['total_files'] = $total; - $this->update( 'media_files', $media ); - if ( $cur_total == $total ) { - $next_id = $post_id; - $item_percent = $overall_percent = '100'; - } else { - $overall_percent = $this->percent( $cur_total, $total ); - } - $cur_total++; - - $data = $this->get_item_title_array( $next_id ); - - if ( $overall_percent == 100 ) { - $this->update( 'media_files', array() ); - } - - $out = array( - 'item_percent' => $item_percent, - 'overall_percent' => $overall_percent, - 'cur_num' => $cur_num, - 'cur_total' => $cur_total, - 'item_title' => $data['item_title'], - 'original_title' => $data['original_title'], - ); - return $out; - } -} diff --git a/gathercontent-importer.php b/gathercontent-importer.php new file mode 100644 index 00000000..5ae95ff5 --- /dev/null +++ b/gathercontent-importer.php @@ -0,0 +1,53 @@ +version ) { - $this->install(true); - } - } - - function install($networkwide) { - global $wpdb; - - if ( $this->multisite_install() ) { - - if($networkwide) { - $old_blog = $wpdb->blogid; - $blogids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" ); - foreach ( $blogids as $blog_id ) { - switch_to_blog( $blog_id ); - $this->_install(); - } - switch_to_blog( $old_blog ); - return; - } - } - - $this->_install(); - } - - function _install() { - global $wpdb; - - $table_name = $wpdb->prefix . 'gathercontent_items'; - - if( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) != $table_name ) { - - $sql = "CREATE TABLE IF NOT EXISTS $table_name ( - `item_id` int(10) NOT NULL, - `project_id` int(10) NOT NULL, - `config` longblob NOT NULL, - UNIQUE KEY `item_id` (`item_id`) - );"; - require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); - dbDelta( $sql ); - update_option( 'gathercontent_version', $this->version ); - } - } - - function uninstall($networkwide) { - global $wpdb; - - if ( $this->multisite_install() ) { - - if($networkwide) { - $old_blog = $wpdb->blogid; - $blogids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" ); - foreach ( $blogids as $blog_id ) { - switch_to_blog( $blog_id ); - $this->_uninstall(); - } - switch_to_blog( $old_blog ); - return; - } - } - - $this->_uninstall(); - } - - function _uninstall() { - global $wpdb; - - $table_name = $wpdb->prefix . 'gathercontent_items'; - - $wpdb->query( "DROP TABLE IF EXISTS $table_name" ); - } - - /** - * Check if GatherContent should be installed all sites in a - * multisite environment or not. Allows a way to override this behavior. - * @return boolean true|false - */ - function multisite_install() { - - $multisite = function_exists( 'is_multisite' ) && is_multisite(); - - return apply_filters( 'gathercontent_multisite_install', $multisite ); - } - - function init() { - - load_plugin_textdomain( $this->base_name, false, $this->base_name . '/languages' ); - - $scripts = array( - 'bootstrap-tooltips' => array( - 'file' => 'bootstrap.min.js', - 'dep' => array('jquery') - ), - 'main' => array( - 'file' => 'main.js', - 'dep' => array($this->base_name . '-bootstrap-tooltips') - ), - 'item_import' => array( - 'file' => 'item_import.js', - 'dep' => array('jquery-ui-sortable') - ), - 'media' => array( - 'file' => 'media.js', - 'dep' => array('jquery') - ) - ); - foreach ($scripts as $handle => $vars) - wp_register_script( $this->base_name . '-' . $handle, $this->plugin_url . 'js/' . $vars['file'], $vars['dep'], $this->version ); - - $styles = array( - 'main' => 'main.css', - 'items' => 'items.css', - ); - foreach ($styles as $handle => $file) - wp_register_style( $this->base_name . '-' . $handle, $this->plugin_url . 'css/' . $file, false, $this->version ); - - } - - function admin_menu() { - $item = add_menu_page( 'GatherContent', 'GatherContent', 'publish_pages', $this->base_name, array(&$this, 'load_screen') ); - add_action( 'admin_print_scripts-' . $item, array($this, 'admin_print_scripts') ); - add_action( 'admin_print_styles-' . $item, array($this, 'admin_print_styles') ); - add_action( 'load-' . $item, array(&$this, 'save_settings') ); - } - - function save_settings() { - $step = $this->step(); - if ( isset($_POST['_wpnonce']) ) { - if ( wp_verify_nonce( $_POST['_wpnonce'],$this->base_name ) ) { - $gc = isset($_POST['gc']) ? $_POST['gc'] : array(); - switch ( $step ) { - case 'projects': - if ( isset($_POST['project_id']) ) { - $this->update( 'project_id', $_POST['project_id'] ); - $step = 'items'; - } - break; - case 'items': - $import = array(); - foreach ( $gc as $key => $val ) { - if ( substr( $key, 0, 7 ) == 'import_' && !empty( $val ) ) { - $import[] = $val; - } - } - if ( count( $import ) > 0 ) { - $this->update( 'selected_items', $import ); - $step = 'item_import'; - } - break; - default: - $url = $this->val( $gc, 'api_url' ); - $this->update( 'api_url', $url ); - $key = $this->val( $gc, 'api_key' ); - $this->update( 'api_key', $key ); - if ( $url != '' && $key != '' ) { - $step = 'projects'; - } - break; - } - wp_redirect( $this->url( $step, false ) ); - } else { - $this->error = $this->__( 'Verification failed, please refreshing the item and try again .' ); - } - } elseif ( $step == 'projects' && isset($_GET['_wpnonce']) && isset($_GET['set_project_id']) ) { - if ( wp_verify_nonce( $_GET['_wpnonce'], $this->base_name ) ) { - $this->update( 'project_id', $_GET['set_project_id'] ); - wp_redirect( $this->url( 'items', false ) ); - } else { - $this->error = $this->__( 'Verification failed, please refreshing the item and try again .' ); - } - } elseif ( $step == 'media' ) { - $media = $this->option( 'media_files' ); - if ( !( is_array( $media ) && isset($media['total_files']) && $media['total_files'] > 0 ) ) { - wp_redirect( $this->url( 'finished', false ) ); - return; - } - } - } - - function download_media() { - global $wpdb; - $out = array('error' => $this->__( 'Verification failed, please refreshing the item and try again .' )); - if ( isset($_GET['_wpnonce']) ) { - if ( wp_verify_nonce( $_GET['_wpnonce'], $this->base_name ) ) { - $cur_num = $_GET['cur_num']; - $cur_total = $_GET['cur_total']; - $retry = $_GET['cur_retry']; - - $media = $this->option( 'media_files' ); - $total = $media['total_files']; - unset($media['total_files']); - - $post_id = key( $media ); - - $state = 'draft'; - - if ( $this->foreach_safe( $media[$post_id]['files'] ) ) { - $cur_post = $media[$post_id]; - $item_total = $cur_post['total_files']; - $more_than_1 = ( count( $cur_post['files'][0] ) > 1 ); - $file = array_shift( $cur_post['files'][0] ); - if ( ! $more_than_1 ) { - array_shift( $cur_post['files'] ); - } - - $cur_settings = $this->option( 'saved_settings' ); - if ( isset( $cur_settings[$file['project_id']] ) && - isset( $cur_settings[$file['project_id']][$file['item_id']] ) ) { - $state = $this->val( $cur_settings[$file['project_id']][$file['item_id']], 'state', 'draft' ); - } - - $id = $wpdb->get_col( - $wpdb->prepare( - "SELECT post_id FROM $wpdb->postmeta WHERE meta_key='gc_file_id' AND meta_value=%s", - $file['id'] - ) - ); - if ( $id ) { - $id = $id[0]; - $file['new_file'] = get_attached_file( $id ); - $file['title'] = get_the_title( $id ); - $file['url'] = wp_get_attachment_url( $id ); - $file['new_id'] = $id; - $this->add_media_to_content( $post_id, $file, $more_than_1 ); - - $out = $this->get_media_ajax_output( $post_id, $media, $cur_post, $item_total, $total, $state ); - $out['success'] = true; - $out['new_file'] = $file['new_file']; - } else { - $uploads = wp_upload_dir(); - $filename = wp_unique_filename( $uploads['path'], $file['original_filename'], null ); - $new_file = $uploads['path'] . '/' . $filename; - $fp = fopen( $new_file, 'w' ); - $resp = $this->_curl( 'https://gathercontent-production-uploads.s3.amazonaws.com/' . $file['filename'], array(CURLOPT_FILE => $fp) ); - fclose( $fp ); - if ( $resp['httpcode'] == 200 ) { - extract( wp_check_filetype( $new_file ) ); - - $name_parts = pathinfo( $filename ); - $name = trim( substr( $filename, 0, -( 1 + strlen( $name_parts['extension'] ) ) ) ); - - $title = $name; - $content = ''; - - if ( $image_meta = @wp_read_image_metadata( $new_file ) ) { - if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) - $title = $image_meta['title']; - if ( trim( $image_meta['caption'] ) ) - $content = $image_meta['caption']; - } - - $object = array( - 'post_mime_type' => $type, - 'guid' => $uploads['url'] . '/' . $filename, - 'post_parent' => $post_id, - 'post_title' => $title, - 'post_content' => $content, - 'post_status' => 'publish', - ); - $id = wp_insert_attachment( $object, $new_file ); - add_post_meta( $id, 'gc_file_id', $file['id'] ); - if ( ! is_wp_error( $id ) ) { - wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $new_file ) ); - - $file['new_file'] = $new_file; - $file['title'] = $title; - $file['url'] = $uploads['url'] . '/' . $filename; - $file['new_id'] = $id; - $this->add_media_to_content( $post_id, $file, $more_than_1 ); - - $out = $this->get_media_ajax_output( $post_id, $media, $cur_post, $item_total, $total, $state ); - $out['success'] = true; - $out['new_file'] = $new_file; - } else { - if ( $retry == '1' ) { - $out = $this->get_media_ajax_output( $post_id, $media, $cur_post, $item_total, $total ); - $out['success'] = false; - $out['error'] = sprintf( $this->__( 'There was an error with the file (%s)' ), $new_file ); - } else { - $out = array( - 'success' => false, - 'retry' => true, - 'msg' => sprintf( $this->__( 'Retrying to download (%s)' ), $file['original_filename'] ) - ); - } - //retry - } - } else { - if ( $retry == '1' ) { - $out = $this->get_media_ajax_output( $post_id, $media, $cur_post, $item_total, $total ); - $out['success'] = false; - $out['error'] = sprintf( $this->__( 'Failed to download the file (%s)' ), $file['original_filename'] ); - } else { - $out = array( - 'success' => false, - 'retry' => true, - 'msg' => sprintf( $this->__( 'Retrying to download (%s)' ), $file['original_filename'] ) - ); - } - //failed - } - } - } - } - } - echo json_encode( $out ); - exit; - } - - function load_screen() { - $data = array(); - if ( ! function_exists( 'curl_init' ) ) { - $this->view( 'curl-error' ); - return; - } - $template = $this->step(); - switch ( $this->step() ) { - case 'projects': - $this->get_projects(); - $data['current'] = $this->option( 'project_id' ); - break; - case 'items': - $this->get_projects(); - $this->get_states(); - $this->get_items(); - $this->get_state_dropdown(); - $this->get_projects_dropdown(); - $data['item_count'] = $this->item_count; - $data['item_settings'] = $this->generate_settings( $this->items ); - break; - case 'item_import': - $this->update( 'media_files', array() ); - $this->get_states(); - $this->get_items( true ); - $this->get_post_types(); - $this->item_overwrite_dropdown(); - $this->map_to_dropdown(); - $this->categories_dropdown(); - $this->parent_dropdown(); - $this->publish_dropdown(); - $this->format_dropdown(); - $cur_settings = $this->option( 'saved_settings' ); - if ( ! is_array( $cur_settings ) ) { - $cur_settings = array(); - } - $this->data['project_id'] = $this->option( 'project_id' ); - $data['item_count'] = $this->item_count; - $this->data['saved_settings'] = $this->val( $cur_settings, $this->option( 'project_id' ), array() ); - $data['item_settings'] = $this->generate_settings( $this->items, -1, true ); - $template = 'item-import'; - break; - case 'media': - $media = $this->option( 'media_files' ); - if ( ! ( is_array( $media ) && isset($media['total_files']) && $media['total_files'] > 0 ) ) { - wp_redirect( $this->url( 'finished', false ) ); - return; - } - unset($media['total_files']); - $post_id = key( $media ); - $data = $this->get_item_title_array( $post_id ); - break; - case 'login': - $data = array( - 'api_url' => $this->option( 'api_url' ), - 'api_key' => $this->option( 'api_key' ), - ); - break; - case 'finished': - $project_id = $this->option( 'project_id' ); - $this->delete_gc_items( $project_id ); - break; - } - $this->view( $template, $data ); - } - - function import_item() { - global $wpdb; - $out = array('error' => $this->__( 'Verification failed, please refreshing the item and try again .' )); - if ( isset($_POST['_wpnonce']) && wp_verify_nonce( $_POST['_wpnonce'], $this->base_name ) ) { - if ( isset($_POST['gc']) && isset($_POST['gc']['item_id']) ) { - $gc = $_POST['gc']; - $item_id = $gc['item_id']; - $this->get_post_types(); - $project_id = $this->option( 'project_id' ); - $item = $this->get_gc_item( $item_id ); - $item = $item->config; - $post_format = '0'; - $file_counter = 0; - $total_files = 0; - $files = array( - 'files' => array(), - 'total_files' => 0, - ); - $save_settings = array(); - - if ( $_POST['cur_counter'] == 0 ) { - $this->update( 'media_files', array() ); - } - if ( $item !== false ) { - $this->get_files( $item_id ); - - $post_fields = array( 'post_title', 'post_content', 'post_excerpt', 'post_author' ); - - $config = $this->get_field_config( $item, $this->val( $this->files, $item_id, array() ) ); - - $fields = $this->val( $gc, 'fields', array() ); - - $parent_id = 0; - if ( is_numeric( $gc['parent_id'] ) ) { - $parent_id = $gc['parent_id']; - } - - $save_settings = array( - 'post_type' => $gc['post_type'], - 'overwrite' => $gc['overwrite'], - 'category' => $gc['category'], - 'format' => $gc['format'], - 'parent_id' => $parent_id, - 'state' => $gc['state'], - 'fields' => array(), - ); - - $post_format = $gc['format']; - - $func = 'wp_insert_post'; - $post = array( - 'post_title' => $item->name, - 'post_type' => $save_settings['post_type'], - 'post_status' => 'draft', - 'post_category' => array(), - 'post_parent' => $parent_id, - ); - - $old_cats = array_filter(explode(',',$save_settings['category'])); - - $cats = array(); - foreach($old_cats as $cat) { - if($cat > 0) { - $cats[] = $cat; - } - } - if(count($cats) > 0) - { - $post['post_category'] = $cats; - } - - - if ( $save_settings['overwrite'] > 0 ) { - $func = 'wp_update_post'; - unset($post['post_title']); - $post['ID'] = $save_settings['overwrite']; - } - $post['ID'] = $func($post); - $save_settings['overwrite'] = $post['ID']; - - $new_post_fields = array(); - $new_meta_fields = array(); - $new_acf_fields = array(); - $post_tags = array(); - $post_cats = array(); - - $chks = array( - 'gc_post_cat_' => 'post_cats', - 'gc_post_tags_' => 'post_tags', - ); - - foreach ( $fields as $info ) { - $acf = $info['acf']; - $acf_post = $info['acf_post']; - $tab = $info['field_tab']; - $map_to = $info['map_to']; - $field_name = $info['field_name']; - - if ( $map_to == '_dont_import_' ) { - $save_settings['fields'][$tab . '_' . $field_name] = $map_to; - continue; - } elseif ( isset( $config[$tab] ) && isset( $config[$tab]['elements'][$field_name] ) ) { - $field = $config[$tab]['elements'][$field_name]; - } else { - continue; - } - - $save_settings['fields'][$tab . '_' . $field_name] = $map_to; - - $special = ($map_to == 'gc_featured_image_' || $map_to == 'gc_media_file_') ? true : false; - - if ( isset($chks[$map_to]) ) { - if ( $field['type'] != 'files' ) { - $values = $field['value']; - if ( ! is_array( $values ) ) { - $values = array_filter( explode( ',', strip_tags( $values ) ) ); - } - foreach ( $values as $val ) { - $val = trim( $val ); - if ( ! empty( $val ) ) { - array_push( $$chks[$map_to], $val ); - } - } - } - continue; - } elseif ( $field['type'] == 'files' ) { - if ( is_array( $field['value'] ) && count( $field['value'] ) > 0 ) { - $new_files = array(); - foreach ( $field['value'] as $file ) { - $file = (array) $file; - $file['post_id'] = $post['ID']; - $file['field'] = $map_to; - $file['special_field'] = $special; - $file['counter'] = $file_counter; - if ( ! empty( $acf ) ) { - $file['acf'] = array( - 'field_id' => $acf, - 'post_id' => $acf_post, - ); - } - $new_files[] = $file; - } - - $total_files += count( $new_files ); - $files['files'][] = $new_files; - $files['total_files'] = $total_files; - - $field['value'] = '#_gc_file_name_' . $file_counter . '#'; - $file_counter++; - } else { - $field['value'] = ''; - } - } - - if ( $special ) { - } elseif ( empty( $acf ) && in_array( $map_to, $post_fields ) ) { - if ( ! isset( $new_post_fields[$map_to] ) ) { - $new_post_fields[$map_to] = array(); - } - if ( $field['type'] == 'choice_checkbox' && is_array( $field['value'] ) ) { - $tmp = '
      '; - foreach ( $field['value'] as $value ) { - $tmp .= '
    • ' . $value . '
    • '; - } - $tmp .= "
    \n\n"; - $field['value'] = $tmp; - } - $new_post_fields[$map_to][] = $field; - } else { - if ( ! empty( $acf ) ) { - $save_settings['fields'][$tab . '_' . $field_name] = array($map_to, $acf, $acf_post); - $acf_field = get_field_object($acf, $acf_post); - if(!empty($field['value'])) { - if($acf_field['type'] == 'date_picker') { - $new_acf_fields[$acf] = date('Ymd', strtotime($field['value'])); - } - else { - $new_acf_fields[$acf] = $field['value']; - } - } - } else { - if ( ! isset( $new_meta_fields[$map_to] ) ) { - $new_meta_fields[$map_to] = ''; - } - if ( $field['type'] != 'files' ) { - $new_meta_fields[$map_to][] = $field['value']; - } - } - } - } - - foreach ( $new_post_fields as $name => $values ) { - if ( count( $values ) > 1 ) { - $post[$name] = ''; - foreach ( $values as $value ) { - if ( $value['value'] != '' ) { - if ( $name == 'post_title' ) { - $post[$name] .= strip_tags( $value['value'] ); - } - elseif ( $name == 'post_author' ) { - $post[$name] = $this->get_author_id( strip_tags( $value['value'] ) ); - } - else { - $post[$name] .= $value['value']."\n\n"; - } - } - } - } else { - if ( $name == 'post_title' ) { - $post[$name] = strip_tags( $values[0]['value'] ); - } - elseif ( $name == 'post_author' ) { - $post[$name] = $this->get_author_id( strip_tags( $values[0]['value'] ) ); - } - else { - $post[$name] = $values[0]['value']; - } - } - } - - if ( $total_files == 0 ){ - $post['post_status'] = $save_settings['state']; - } - - $set_post_terms = false; - - if ( count( $post_cats ) > 0 && count( $this->taxonomies[$post['post_type']] ) > 0 ) { - $taxonomy = $this->taxonomies[$post['post_type']][key( $this->taxonomies[$post['post_type']] )]; - $set_post_terms = true; - foreach ( $post_cats as $cat ) { - $exists = term_exists( $cat, $taxonomy ); - if ( $exists ) { - $post['post_category'][] = $exists['term_id']; - } else { - $term = wp_insert_term( $cat, $taxonomy ); - $post['post_category'][] = $term['term_id']; - } - } - } - - if ( count( $post_tags ) > 0 && isset( $this->allows_tags[$post['post_type']] ) ) { - $post_tag = ''; - foreach ( $post_tags as $tag ) { - $post_tag .= ($post_tag == '' ? '':',').$tag; - } - $post['tax_input'] = array( - 'post_tag' => $post_tag, - ); - } - - wp_update_post( $post ); - - if ( $set_post_terms === true ) { - wp_set_post_terms( $post['ID'], $post['post_category'], $taxonomy ); - } - - if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post['post_type'], 'post-formats' ) ) { - set_post_format( $post['ID'], $post_format ); - } - - if(isset($new_meta_fields['_yoast_wpseo_focuskw_text_input'])) { - $new_meta_fields['_yoast_wpseo_focuskw'] = $new_meta_fields['_yoast_wpseo_focuskw_text_input']; - } - - foreach ( $new_meta_fields as $field => $values ) { - delete_post_meta( $post['ID'], $field ); - if ( is_array( $values ) ) { - foreach ( $values as $value ) { - if ( ! empty( $value ) ) { - if ( is_array( $value ) ) { - foreach ( $value as $value2 ) { - add_post_meta( $post['ID'], $field, maybe_serialize( $value2 ) ); - } - } else { - add_post_meta( $post['ID'], $field, maybe_serialize( $value ) ); - } - } - } - } elseif ( ! empty( $values ) ) { - add_post_meta( $post['ID'], $field, maybe_serialize( $values ) ); - } - } - - foreach ( $new_acf_fields as $acf => $value ) { - update_field( $acf, $value, $post['ID'] ); - } - - $media = $this->option( 'media_files' ); - if ( ! isset( $media['total_files'] ) ) { - $media['total_files'] = 0; - } - - if ( $total_files > 0 ) { - $media[$post['ID']] = $files; - if ( ! isset( $media['total_files'] ) ) { - $media['total_files'] = 0; - } - $media['total_files'] += $total_files; - $this->update( 'media_files', $media ); - } - - $cur_settings = $this->option( 'saved_settings' ); - if ( ! is_array( $cur_settings ) ) { - $cur_settings = array(); - } - if ( ! isset( $cur_settings[$project_id] ) ) { - $cur_settings[$project_id] = array(); - } - - $cur_settings[$project_id][$item_id] = $save_settings; - $this->update( 'saved_settings', $cur_settings ); - - $out = array( - 'total_files' => $total_files, - 'item_id' => $item_id, - 'success' => true, - 'item_percent' => $this->percent( ++$_POST['cur_counter'], $_POST['total'] ), - 'redirect_url' => ($media['total_files'] > 0 ? 'media' : 'finished'), - 'new_item_id' => $post['ID'], - 'new_item_html' => '
  • ' . esc_html( $item->name ) . '
  • ', - ); - } else { - $out = array( - 'error' => $this->__( 'There was a problem importing the item, please refresh and try again .' ), - ); - } - } else { - $out = array( - 'error' => $this->__( 'There was a problem importing the item, please refresh and try again .' ), - ); - } - } - echo json_encode( $out ); - exit; - } -} -if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { - $gc = new GatherContent; - register_activation_hook( __FILE__, array( &$gc, 'install' ) ); - register_deactivation_hook( __FILE__, array( &$gc, 'uninstall' ) ); -} diff --git a/img/logo-big.png b/images/logo-big.png similarity index 100% rename from img/logo-big.png rename to images/logo-big.png diff --git a/images/readme.md b/images/readme.md new file mode 100644 index 00000000..1d13ae24 --- /dev/null +++ b/images/readme.md @@ -0,0 +1,3 @@ +# Project Images + +Only images in-use by the project should be placed in this folder. Wherever possible, combine multiple small images into sprites to be used by CSS. Original (non-sprite) images should be placed in the `/src` subdirectory. \ No newline at end of file diff --git a/images/src/readme.md b/images/src/readme.md new file mode 100644 index 00000000..5d469a9d --- /dev/null +++ b/images/src/readme.md @@ -0,0 +1,3 @@ +# Project Images + +Only source images (i.e. non-sprites, PSDs, raw photos) should be placed in this directory. Source files are meant to serve as a backup for any images that can be edited by an end user. \ No newline at end of file diff --git a/img/ajax-loader-grey.gif b/img/ajax-loader-grey.gif deleted file mode 100644 index 0443387c3e252aeb3cbe90c9631eefc3cc6ac5bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 847 zcmZ?wbhEHb6krfw_`<;O|NsA)GiUz({d@iT^=HqXojrT@iWMu~y?b~2_U(lW7al); z{NTZZpFe-TdiCn_=g+rp-MV}CZU$0-;(u;G*N|Xm#{gF&Jp*P&pkBp)QqD!Gi6yBi z3gww4848J6i4{5di79%Sd1?6!ia%L6xqzy4K(>G!$-o+*pwO3+Id7?fNRFabOTwzP zGenL}lrnAjz;?5vA-b2vhAFc(V4^@PV`uB4zBQUU4W3ay7O5nC*yS;4fdgv-pu5*<>|Hn(-{gjt4u>v0=H?uP};XReTu;fv2}|U_B&<^oL6>a z;I;`cH(Wp`0?>!bpC@SC67kUDIuanlsk@}z@V#*(mzDEr zL+>pfElm&EJoIL$+}v2nz#*{j;u+Q(S=@S!;Vuq$_#zn=8F+Atwdxr3IbGrE%NFo@ z_Le8q-n5*VrA8&2H%616ryHxKL6Bf=P?*AGD00+cMYFRU+Zyp>+1*WZ7!{qKB-k@F zZfDvzLD{v*qRJ^Sq9J*A?xHeoA*F>1FAptFXiRA14Ru>4S#(E|Z)w46&ChB78?agf z@*6PrRygpu8VVdbDUlm1aeSwQN6&?}8yf5aT`VR{3ePokB$l};CVDVL1kd1T%r#xI zl`+Z1V+$L@s-1~RI$V9K4F$$x$w!nosQ=)7qr`4vW*(rX6`|jt(bKDf)zWyVr5-?! zaV&E%VK}tun4^;CM2-!!7AA1m<+ZYU8mM$g^vZdgZ{qdPVL#ZZThgr6)a)uHBCzDJ t?!|-^9SH}RehL_Na!72L?$FQYY@WfPZ^)9y8l&0Wqo&AU4N9J1002!R5v%|J diff --git a/img/ajax-loader.gif b/img/ajax-loader.gif deleted file mode 100644 index e192ca895cd00d6b752ec84619b787188f30ee41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 847 zcmZ?wbhEHb6krfw_`<;O|Nnmm28JI$eppyow6wIav9YPCsa?BvZN-WeVq#)tWo2n; zX-}R!nK5I=v17+PJUqg}!hq_D2a5l>{aizWogD*Qjr0td8G$+#|4BI)r6!i7rYMwW zmSiX-W+hhSNI#p{aB=u^kJ9BqzM)+D@@g7D>_ZH z6>Nk>K2^#dec$hd&5{fSg)a9?JsDb3M<1+M;h^GLd*HyqYe$(ldZsj_W{3#!96X@l zAjsu&py5MupnEfu)0U^(0!(Kp*sL-QO$pql{X%Kq;`Av7E5z0lI$B?E`RzKdsAZ)9=nHHN!5+~JF4SY+VADb}iE(C2i8t1nx?>)BhL zPS>_TA<--6ZN7=uLx=rfr*28JR#UU9l!(BR!@3s} qR&*pBVEQRw*vTQWVY)*bLIMx~ diff --git a/img/ajax_loader_blue.gif b/img/ajax_loader_blue.gif deleted file mode 100644 index fcadd672445ce1a2865f091ade399b7fc0a15a86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2670 zcmb7`c~nzZ9>>GW%OlAnW+Mq9kd2fiB)N6Ec+}1UFNq{!5h1lmp#`LhU@dzsPzNL^ zmQ*oC7Kfn_2q2q<5y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%2{euv5mzKhC??HZnV~>=H}fKi48}#%kHG&^ zdHhxSde}eEf`i}8==&wnG2_}hxV>)A#FuYhO_T5cgIuP^7dy8m~SkP&yS=zRI1EJNvT60K9^nk*tg?W zSwgzW5ySto?4^?z9uz2X=Rw;84#48l0x1yD4`@-D^&Oj@ttde2!nw>k5?|nGYpxSW zy1KiNQ$0PWZAjZ7uhBq$>zo$haJjG(W(^Nh&aE3CW)NY>#=govjiBh|+#6hu8$fgD o?=oNxP51en6C>W8cT(;?1n}LohY!eq0bY;2zJng45aFeN0jh?q{r~^~ diff --git a/img/glyphicons-halflings-white.png b/img/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484a29d8da269f9bc874b25493a45fae3bae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8777 zcmZvC1yGz#v+m*$LXcp=A$ZWB0fL7wNbp_U*$~{_gL`my3oP#L!5tQYy99Ta`+g_q zKlj|KJ2f@c)ARJx{q*bbkhN_!|Wn*Vos8{TEhUT@5e;_WJsIMMcG5%>DiS&dv_N`4@J0cnAQ-#>RjZ z00W5t&tJ^l-QC*ST1-p~00u^9XJ=AUl7oW-;2a+x2k__T=grN{+1c4XK0ZL~^z^i$ zp&>vEhr@4fZWb380S18T&!0cQ3IKpHF)?v=b_NIm0Q>vwY7D0baZ)n z31Fa5sELUQARIVaU0nqf0XzT+fB_63aA;@<$l~wse|mcA;^G1TmX?-)e)jkGPfkuA z92@|!<>h5S_4f8QP-JRq>d&7)^Yin8l7K8gED$&_FaV?gY+wLjpoW%~7NDe=nHfMG z5DO3j{R9kv5GbssrUpO)OyvVrlx>u0UKD0i;Dpm5S5dY16(DL5l{ixz|mhJU@&-OWCTb7_%}8-fE(P~+XIRO zJU|wp1|S>|J3KrLcz^+v1f&BDpd>&MAaibR4#5A_4(MucZwG9E1h4@u0P@C8;oo+g zIVj7kfJi{oV~E(NZ*h(@^-(Q(C`Psb3KZ{N;^GB(a8NE*Vwc715!9 zr-H4Ao|T_c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!V>W^=6Q0}zaubkDn)(lTax0+!+%B}9Vqw6{H zvL|BRM`O<@;eVi1DzM!tXtBrA20Ce@^Jz|>%X-t`vi-%WweXCh_LhI#bUg2*pcP~R z*RuTUzBKLXO~~uMd&o$v3@d0shHfUjC6c539PE6rF&;Ufa(Rw@K1*m7?f5)t`MjH0 z)_V(cajV5Am>f!kWcI@5rE8t6$S>5M=k=aRZROH6fA^jJp~2NlR4;Q2>L$7F#RT#9 z>4@1RhWG`Khy>P2j1Yx^BBL{S`niMaxlSWV-JBU0-T9zZ%>7mR3l$~QV$({o0;jTI ze5=cN^!Bc2bT|BcojXp~K#2cM>OTe*cM{Kg-j*CkiW)EGQot^}s;cy8_1_@JA0Whq zlrNr+R;Efa+`6N)s5rH*|E)nYZ3uqkk2C(E7@A|3YI`ozP~9Lexx#*1(r8luq+YPk z{J}c$s` zPM35Fx(YWB3Z5IYnN+L_4|jaR(5iWJi2~l&xy}aU7kW?o-V*6Av2wyZTG!E2KSW2* zGRLQkQU;Oz##ie-Z4fI)WSRxn$(ZcD;TL+;^r=a4(G~H3ZhK$lSXZj?cvyY8%d9JM zzc3#pD^W_QnWy#rx#;c&N@sqHhrnHRmj#i;s%zLm6SE(n&BWpd&f7>XnjV}OlZntI70fq%8~9<7 zMYaw`E-rp49-oC1N_uZTo)Cu%RR2QWdHpzQIcNsoDp`3xfP+`gI?tVQZ4X={qU?(n zV>0ASES^Xuc;9JBji{)RnFL(Lez;8XbB1uWaMp@p?7xhXk6V#!6B@aP4Rz7-K%a>i z?fvf}va_DGUXlI#4--`A3qK7J?-HwnG7O~H2;zR~RLW)_^#La!=}+>KW#anZ{|^D3 B7G?kd diff --git a/img/glyphicons-halflings.png b/img/glyphicons-halflings.png deleted file mode 100644 index a9969993201f9cee63cf9f49217646347297b643..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12799 zcma*OWmH^Ivn@*S;K3nSf_t!#;0f+&pm7Po8`nk}2q8f5;M%x$SdAkd9FAvl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kdPG1xydiR9@#8m zh27D7GF{p|a{8({Q-Pr-;#jV{2zHR>lGoFtIfIpoMo?exuQyX_A;;l0AP4!)JEM$EwMInZkj+8*IHP4vKRd zKx_l-i*>A*C@{u%ct`y~s6MWAfO{@FPIX&sg8H{GMDc{4M3%$@c8&RAlw0-R<4DO3 trJqdc$mBpWeznn?E0M$F`|3v=`3%T2A17h;rxP7$%JLd=6(2u;`(N3pt&so# diff --git a/img/help.png b/img/help.png deleted file mode 100644 index 4c62162df73e97962e20d87762b9ef9abeb34774..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1345 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+m=!WZB1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%s|1+P|wiV z#N6CmN5ROz&_Lh7NZ-&%*U;R`*vQJjKmiJrfVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8EkR}&8R-I5=oVMzl_XZ^<`pZ$OmImpPAEg{v+u2}(t{7puX=A(aKG z`a!A1`K3k4z=%sz23b{L$o& z6x?pH#Hm*w=oo!av?4__ObD2EKuma|1#;lYJ~a=R){B6N`n-yE1Oo%(c25__kcwMA zlRUeb0(n~AZi^LkaSS-fYi^_Q=;G}Ccbn(A_`jYxY&`U=HJC^6Dhg=G)^h!(s!m*w7`Bz| zo_qP_6r0Yp&7OKwy+XA_>m(ZvsvPe%e3;IbS)l%7&XcaAN`hsV^0sefIczo|%|d1x zgE-eLf$~E<9G7QkbvL&Tud)srpR(q-xF7ch*>h$pUkC2H=%dBK$ zEsIwho()?Y=Dl>1Rz2sVf=?SN@6A5THvjn%>)xYDA5>fZav3nR-{{%6(Emags8I8C L^>bP0l+XkKMR4%U diff --git a/img/sort_field.png b/img/sort_field.png deleted file mode 100644 index 7a9097d8132374491548ffa7dd499920cf8fb431..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1030 zcmaJ=J8aWH7V1*Kv*To{lVKawUPZbM1!m_*G)Mz#%705hD#@QkNKfC_nHJO4qUB*RJ#dXzzR7yt`2(qTS01Hsn8+YErX^QFx zMyZU;%5_0QCZqZo#xrfgrl{!|&sMcXh(QG|7*>-0{&t53hMuJ7q6(+jBCHviRR+W`uHrnx|4`HHqFr2oM}Ge)?3NlfWDC$m%Z^4at~&0AvIWtBDn?ETp`}h0 z^EHH#TSGPwi%~FVSURe^EwrKtS)@BmX%T^Z@=>E;9#adwtIK) z7WM8V^(nA-{P*~7-`2%i)6UB0r{+gwJZ0a^UE3JQFwJc%kUR0>%8d))EA=wCaZGx0 zI+!0BoX9j+GWV-n^QT^kZ`OjF566Cd9M~TIybbK3r`q7X^@*XMpuhAe@c2Ol2l_^+ X(J$J$+h_Kl`7bk@&PmT_=bL{3ytzaI diff --git a/includes/functions/core.php b/includes/functions/core.php new file mode 100644 index 00000000..ae9ad940 --- /dev/null +++ b/includes/functions/core.php @@ -0,0 +1,74 @@ +').insertBefore(a(this)).on("click",d),f.toggleClass("open")),c.focus(),!1},keydown:function(c){var d,f,g,h,i,j;if(!/(38|40|27)/.test(c.keyCode))return;d=a(this),c.preventDefault(),c.stopPropagation();if(d.is(".disabled, :disabled"))return;h=e(d),i=h.hasClass("open");if(!i||i&&c.keyCode==27)return c.which==27&&h.find(b).focus(),d.click();f=a("[role=menu] li:not(.divider):visible a",h);if(!f.length)return;j=f.index(f.filter(":focus")),c.keyCode==38&&j>0&&j--,c.keyCode==40&&j
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery) diff --git a/js/item_import.js b/js/item_import.js deleted file mode 100644 index ca73904f..00000000 --- a/js/item_import.js +++ /dev/null @@ -1,499 +0,0 @@ -;(function($){ - var item_loaded = false, submit_text = ''; - $(document).ready(function(){ - submit_text = $('.gc_ajax_submit_button:first span').text(); - - $('.gc_tooltip').tooltip(); - - $('.gc_table_row').each(function(){ - var parent_id = $(this).attr('data-parent-id'), - item_id = $(this).attr('data-item-id'), - parent_field = $('#gc_parent_' + item_id), - import_as = $('#gc_import_as_' + item_id + ' input'), - remove = true; - - if(parent_id > 0) { - if($('.gc_table_row[data-item-id="' + parent_id + '"]').length > 0) { - remove = false; - } - } - - if($('.gc_table_row[data-parent-id="' + item_id + '"]').length > 0 && import_as.val() == '') { - import_as.val('item'); - } - - - if(remove === true) { - parent_field.find('.imported-item').remove(); - } - set_value(parent_field); - }); - - $('td.gc_checkbox :checkbox').change(function() { - var value = $(this).val(), - type = $('#gc_import_as_' + value + ' input').val(), - func = 'addClass'; - - if($(this).is(':checked')) { - if(typeof hierarchical_post_types[type] != 'undefined') { - func = 'removeClass'; - } - } - - hide_imported_parent(value, func); - }); - - - $('.repeat_config input').change(function(){ - var $t = $(this); - if($t.is(':checked')){ - $('.gc_overlay,.gc_repeating_modal').show(); - setTimeout(function(){ - repeat_config($t); - },500); - } - }); - - - $('#gc_importer_step_items_import').submit(submit_item_import); - - - $('.gc_field_map input.live_filter').click(function(e){ - e.preventDefault(); - e.stopImmediatePropagation(); - }).keyup(function(e){ - var v = $(this).val(), - lis = $(this).parent().siblings('li:not(.hidden-item):not(.divider)'); - if(!v || v == ''){ - lis.show(); - } else { - lis.hide().filter(':icontains_searchable('+$(this).val()+')').show(); - } - }).focus(function(){ - $(this).trigger('keyup'); - }); - - - $('.gc_field_map').find('a[data-value="_new_custom_field_"]').click(function(e){ - e.preventDefault(); - e.stopImmediatePropagation(); - var parent = $(this).parent(); - parent.before('
  • '); - parent.prev().find('input').focus(); - }).end().find('ul.dropdown-menu a:not([data-value="_new_custom_field_"])').click(function(){ - var $t = $(this), acf = '', acf_post = ''; - if($t.hasClass('acf-field')){ - acf = $t.attr('data-acf-field'); - acf_post = $t.attr('data-acf-post'); - } - var field = $t.closest('.gc_field_map').find('input.acf-field').val(acf).end().find('input.acf-post').val(acf_post).end(), - tr = field.closest('tr'), - item_id= tr.attr('data-item-id'); - if($('#gc_repeat_'+item_id).is(':checked')){ - var rows = tr.parent().find('tr.gc_table_row[data-item-id]'), - idx = rows.index(tr), - field_id = field.attr('id').split('_')[4], - val = $t.attr('data-value'); - rows.filter(':gt('+idx+')').each(function(){ - var item_id = $(this).attr('data-item-id'); - if(!$('#gc_repeat_'+item_id).is(':checked')){ - $('#gc_field_map_'+item_id+'_'+field_id+' li:not(.hidden-item) a[data-value="'+val+'"]').trigger('click'); - } else { - return false; - } - }); - } - }); - - - $('.gc_field_map').on('keydown','li.inputting input', function(e){ - var key = e.keyCode || e.which; - if(key == 13){ - $(this).trigger('blur'); - } - }).on('blur','li.inputting input',function(e){ - var v = $(this).val(), - li = $(this).parent(), - prev = li.prev(); - if(!v || v == ''){ - li.remove(); - } else { - $(this).parent().attr('data-post-type','normal').removeClass('inputting').html('').find('a').attr('data-value',v).text(v).trigger('click'); - } - }); - - $('.gc_settings_container .gc_setting:not(.gc_category) .has_input, .gc_field_map .has_input').on('click','ul a',function(e){ - e.preventDefault(); - $(this).closest('.has_input').find('a:first span:first').html($(this).html()).siblings('input').val($(this).attr('data-value')).trigger('change'); - }); - $('.gc_category').on('click','ul li:not(.disabled) a:not([data-value="-1"])', function(e){ - e.preventDefault(); - e.stopImmediatePropagation(); - var $t = $(this), - c = $t.closest('.btn-group'), - lis = c.find('li:not(.hidden-item)'), - v = ''; - $t.toggleClass('active'); - lis.find('a.active').each(function(){ - v += ','+$(this).attr('data-value'); - }); - c.find('input').val(v); - }); - - - $('.gc_import_as').on('change', 'input', function(){ - - var value = $(this).val(), - row = $(this).closest('tr'), - item_id = row.attr('data-item-id'), - to = $('#gc_import_to_'+item_id), - parent = $('#gc_parent_'+item_id), - cat = $('#gc_category_'+item_id), - state = $('#gc_state_'+item_id), - format = $('#gc_format_'+item_id), - parent_func = '', - length = 0; - - to.add(parent).find('li[data-post-type]').filter('[data-post-type!="' + value + '"]').hide().addClass('hidden-item').end().filter('[data-post-type="' + value +'"]').show().removeClass('hidden-item'); - set_value(to); - - if(typeof hierarchical_post_types[value] != 'undefined') { - parent.show(); - set_value(parent); - parent_func = 'show'; - } - else { - parent.hide(); - parent_func = 'hide'; - } - - hide_imported_parent(item_id, parent_func); - - set_map_to_fields(row, value, item_id); - - length = cat.find('li').filter('[data-post-type!="' + value + '"]').hide().addClass('hidden-item').end().filter('[data-post-type="' + value + '"]').show().removeClass('hidden-item').length; - set_cat_value(cat); - if(length > 0) { - cat.show(); - } - else { - cat.hide(); - } - - length = format.find('li').filter(':not([data-post-type*="|' + value + '|"])').hide().addClass('hidden-item').end().filter('[data-post-type*="|' + value + '|"]').show().removeClass('hidden-item').length; - set_value(format); - if(length > 0) { - format.show(); - } - else { - format.hide(); - } - - set_value(state); - - }).each(function(){ - set_value($(this).find('.btn-group')); - }); - - - $('.gc_import_to').on('change', 'input', function(){ - var elem = $(this).closest('.gc_settings_container'); - set_map_to_fields(elem,$('#gc_import_as_'+elem.attr('data-item-id')+' input').val()); - }); - - - $('.gc_settings_fields').sortable({ - handle: '.gc_move_field', - update: function(e, ui) { - var tr = ui.item.closest('tr'), - item_id = tr.attr('data-item-id'); - if($('#gc_repeat_'+item_id).is(':checked')){ - var rows = tr.parent().find('tr.gc_table_row[data-item-id]'), - idx = rows.index(tr), - new_index = ui.item.index(); - rows.filter(':gt('+idx+')').each(function(){ - var item_id = $(this).attr('data-item-id'); - if(!$('#gc_repeat_'+item_id).is(':checked')){ - var field_id = ui.item.attr('id').split('_')[2], - item = $('#field_'+item_id+'_'+field_id); - if(item.length > 0){ - if(new_index > 0){ - item.parent().find('> .gc_settings_field:eq('+(new_index > item.index() ? new_index : (new_index-1))+')').after(item); - } else { - item.parent().prepend(item); - } - } - } else { - return false; - } - }); - - } - } - }); - item_loaded = true; - }); - - function hide_imported_parent(item_id, func){ - - var display = func == 'addClass' ? 'none' : 'list-item'; - - $('.gc_table_row[data-parent-id="' + item_id + '"]').each(function() { - $(this).find('.imported-item')[func]('hidden-item').css('display', display); - set_value($('#gc_parent_' + $(this).attr('data-item-id'))); - }); - } - - function set_cat_value(elem){ - var v = elem.find('input:first').val(), - lis = elem.find('li:not(.hidden-item):not(.disabled)'), - el, - str = ''; - v = v.split(','); - for(var i=0,il=v.length;i .gc_settings_field').removeClass('moved').addClass('not-moved'); - $('#gc_import_as_'+item_id+' a[data-value="'+import_as+'"]').trigger('click'); - for(var i in fields){ - if(fields.hasOwnProperty(i)){ - $('#gc_field_map_'+item_id+'_'+fields[i][1]+' li:not(.hidden-item) a[data-value="'+fields[i][0]+'"]').trigger('click'); - var field = $('#field_'+item_id+'_'+fields[i][1]).removeClass('not-moved').addClass('moved'); - if(i > 0){ - c.find('> .gc_settings_field:eq('+(i-1)+')').after(field); - } else { - c.prepend(field); - } - } - }; - } else { - return false; - } - }); - $('.gc_overlay,.gc_repeating_modal').hide(); - }; - - var save = { - "total": 0, - "cur_counter": 0, - "els": null, - "waiting": null, - "progressbar": null, - "title": null, - "cur_retry": 0 - }; - - function reset_submit_button(){ - $('.gc_ajax_submit_button').removeClass('btn-wait').addClass('btn-success').find('span').text(submit_text); - }; - - function submit_item_import(e){ - e.preventDefault(); - save.els = $('#gc_items td.gc_checkbox :checkbox:checked'); - save.total = save.els.length; - save.cur_counter = 0; - save.waiting = $('.gc_importing_modal img'); - save.progressbar = $('#current_item .bar'); - save.title = $('#gc_item_title'); - if(save.total > 0){ - $('.gc_overlay,.gc_importing_modal').show(); - save_item(); - } - return false; - }; - - function save_item(){ - $.ajax({ - url: ajaxurl, - data: get_item_data(save.els.filter(':eq('+save.cur_counter+')')), - dataType: 'json', - type: 'POST', - timeout: 120000, - beforeSend: function(){ - save.waiting.show(); - }, - error: function(){ - save.waiting.hide(); - if(save.cur_retry == 0){ - save.cur_retry++; - save_item(); - } else { - reset_submit_button(); - $('.gc_overlay,.gc_importing_modal').hide(); - } - }, - success: function(data){ - save.waiting.hide(); - if(typeof data.error != 'undefined'){ - save.cur_retry++; - alert(data.error); - reset_submit_button(); - $('.gc_overlay,.gc_importing_modal').hide(); - } - if(typeof data.success != 'undefined'){ - save.cur_retry--; - if(typeof data.new_item_html != 'undefined') { - - $('#gc_items tr[data-parent-id="'+data.item_id+'"]').each(function(){ - var el = $('#gc_parent_'+$(this).attr('data-item-id')), - input = el.find('input'); - - if($(this).find('a[data-value="'+data.new_item_id+'"]').length == 0) - { - el.find('ul').append(data.new_item_html); - } - if(input.val() == '_imported_item_') { - input.val(data.new_item_id); - set_value(el); - } - }); - } - save.cur_retry = 0; - save.cur_counter++; - save.progressbar.css('width',data.item_percent+'%'); - if(save.cur_counter == save.total){ - setTimeout(function(){ - window.location.href = redirect_url[data.redirect_url]; - },1000); - } else { - setTimeout(save_item,1000); - } - } - } - }); - }; - - function get_item_data($t){ - var tr = $t.closest('tr'), - title = tr.find('td.gc_itemname label').text(), - item_id = $t.val(), - settings = $('#gc_fields_'+item_id), - data = { - "_wpnonce": $('#_wpnonce').val(), - "action": "gathercontent_import_item", - "cur_retry": save.cur_retry, - "cur_counter": save.cur_counter, - "total": save.total - }, - title_text = title; - if(title_text.length > 30){ - title_text = title_text.substring(0,27)+'...'; - } - save.title.attr('title',title).text(title_text); - if(settings.length > 0){ - data.gc = { - "item_id": item_id, - "post_type": $('#gc_import_as_'+item_id+' input').val(), - "overwrite": $('#gc_import_to_'+item_id+' input').val(), - "category": $('#gc_category_'+item_id+' input').val(), - "parent_id": $('#gc_parent_'+item_id+' input').val(), - "state": $('#gc_state_'+item_id+' input').val(), - "format": $('#gc_format_'+item_id+' input').val(), - "fields": [] - }; - settings.find('> .gc_settings_field').each(function(){ - var $t = $(this), - input = $t.find('> input'), - map_to = $t.find('> .gc_field_map input'), - field = { - "field_tab": input.filter('[name^="gc[field_tab]"]').val(), - "field_name": input.filter('[name^="gc[field_name]"]').val(), - "map_to": map_to.filter('[name^="gc[map_to]"]').val(), - "acf": map_to.filter('.acf-field').val(), - "acf_post": map_to.filter('.acf-post').val() - }; - data.gc.fields.push(field); - }); - } - return data; - }; - - jQuery.expr[":"].icontains_searchable = jQuery.expr.createPseudo(function(arg) { - return function( elem ) { - return jQuery(elem).attr('data-search').toUpperCase().indexOf(arg.toUpperCase()) >= 0; - }; - }); -})(jQuery); diff --git a/js/main.js b/js/main.js deleted file mode 100644 index 42f7a972..00000000 --- a/js/main.js +++ /dev/null @@ -1,73 +0,0 @@ -;(function($){ - var itemlist, itemlist_c; - $(document).ready(function() { - $('.gc_ajax_submit_button').click(function() { - $('.gc_ajax_submit_button').addClass('btn-wait').removeClass('btn-success').find('img').show().end().find('span').text('Please wait...'); - }); - $('.gc-ajax-tooltip').tooltip().click(function(e){ - e.preventDefault(); - return false; - }); - $('#toggle_all').change(function(){ - var checked = $(this).is(':checked'); - $('.gc_checkbox :checkbox').attr('checked',false).filter(':visible').attr('checked',checked).trigger('change'); - }); - $('.gc_search_items .gc_right .dropdown-menu a').click(function(e){ - e.preventDefault(); - if($(this).attr('data-custom-state-name') == 'All'){ - $('table tbody tr:not(:visible)').show(); - } else { - var selector = '[data-item-state="'+$(this).attr('data-custom-state-id')+'"]'; - $('table tbody tr').filter(':not('+selector+')').hide().end().filter(selector).show(); - } - $(this).closest('.btn-group').find('> a span:first').text($(this).attr('data-custom-state-name')); - }); - $('#gc_live_filter').keyup(function(){ - var v = $.trim($(this).val()), items = $('table tbody tr'); - if(!v || v == ''){ - items.show(); - } else { - v = v.toLowerCase(); - items.find('.gc_itemname label').each(function(){ - var e = $(this), t = e.text().toLowerCase(), - show = (t.indexOf(v) > -1), func = (show?'show':'hide'); - e.closest('tr')[func](); - }); - } - }).change(function(){$(this).trigger('keyup')}); - - itemlist = $('.gc_itemlist tr td'); - itemlist_c = $('#gc_itemlist_container'); - itemlist.click(function(e){ - if(!$(e.target).is(':checkbox,label')){ - var el = $(this).closest('tr').find(':checkbox'); - el.attr('checked',(el.is(':checked')?false:true)).trigger('change'); - } - }); - - itemlist.find(':checkbox').change(function(){ - var el = $(this).closest('tr'), - checked = $(this).is(':checked'); - el[(checked?'addClass':'removeClass')]('checked'); - show_hide((itemlist.find(':checkbox:checked').length > 0)); - }).trigger('change'); - }); - - function show_hide(show){ - if(!show && itemlist_c.hasClass('checked')){ - itemlist_c.removeClass('checked') - .find('.gc_subfooter').slideUp('fast').fadeOut('fast').end() - .find('.gc_search_items button').animate({ - 'opacity': 0, - 'width': 'hide' - },400); - } else if(show && !itemlist_c.hasClass('checked')){ - itemlist_c.addClass('checked') - .find('.gc_subfooter').slideDown('fast').fadeIn('fast').end() - .find('.gc_search_items button').animate({ - 'opacity': 1, - 'width': 'show' - },400); - } - }; -})(jQuery); diff --git a/js/media.js b/js/media.js deleted file mode 100644 index b39a03b0..00000000 --- a/js/media.js +++ /dev/null @@ -1,64 +0,0 @@ -;(function($){ - var progressbar1, progressbar2, cur_num = 1, cur_total = 1, cur_retry = 0, title; - $(document).ready(function(){ - progressbar1 = $('#current_item .bar'); - progressbar2 = $('#overall_files .bar'); - waiting = $('#gc_media img'); - - title = $('#gc_item_title'); - - get_image(); - }); - function get_image(){ - $.ajax({ - url: ajaxurl, - data: { - '_wpnonce': $('#_wpnonce').val(), - 'action': 'gathercontent_download_media', - 'cur_num': cur_num, - 'cur_total': cur_total, - 'cur_retry': cur_retry - }, - dataType: 'json', - timeout: 120000, - beforeSend: function(){ - waiting.show(); - }, - error: function(){ - waiting.hide(); - get_image(); - }, - success: function(data){ - waiting.hide(); - if(typeof data.error != 'undefined'){ - alert(data.error); - } - if(typeof data.success != 'undefined'){ - cur_retry = 0; - if(typeof data.retry != 'undefined'){ - cur_retry = cur_retry++; - setTimeout(get_image,1000); - } else { - progressbar1.css('width',data.item_percent+'%'); - progressbar2.css('width',data.overall_percent+'%'); - cur_num = data.cur_num; - cur_total = data.cur_total; - if(data.item_percent == '100' && data.overall_percent != '100'){ - setTimeout(function(){ - progressbar1.css('width','0%'); - title.html(data.item_title).attr('title',data.original_title); - },1000); - } - if(data.overall_percent == '100'){ - setTimeout(function(){ - window.location.href = redirect_url; - },1000); - } else { - setTimeout(get_image,1000); - } - } - } - } - }); - }; -})(jQuery); diff --git a/package.json b/package.json new file mode 100644 index 00000000..39bafb1a --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "gathercontent-importer", + "title": "GatherContent Importer", + "description": "Imports items from GatherContent to your wordpress site", + "version": "3.0.0", + "homepage": "http://www.gathercontent.com", + "repository": { + "type": "git", + "url": "" + }, + "author": { + "name": "GatherContent", + "email": "support@gathercontent.com", + "url": "http://www.gathercontent.com" + }, + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-concat": "^0.5.1", + "grunt-contrib-uglify": "^0.9.1", + "grunt-sass": "^1.0.0", + "autoprefixer": "^6.0.0", + "grunt-postcss": "^0.6.0", + "grunt-contrib-cssmin": "^0.12.3", + "grunt-contrib-jshint": "^0.11.2", + "grunt-contrib-watch": "^0.6.1", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-copy": "^0.8.0", + "grunt-contrib-compress": "^0.13.0", + "grunt-phpunit": "^0.3.6", + "load-grunt-config": "~0.17.2", + "load-grunt-tasks": "^3.3.0", + "glob": "~5.0.15", + "grunt-wp-readme-to-markdown": "^0.9.0", + "chai": "^3.5.0", + "grunt-mocha": "^1.0.0" + }, + "keywords": [] +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 00000000..a444c41d --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,21 @@ + + + + ./tests/phpunit + + + + + ./includes + + + + + + + + diff --git a/readme.txt b/readme.txt index a78a977d..2a965777 100644 --- a/readme.txt +++ b/readme.txt @@ -1,11 +1,12 @@ -=== GatherContent Import === -Contributors: Mathew Chapman, namshee -Tags: structured content, gather content, gathercontent, import, migrate, export, mapping, production, writing, collaboration, platform, connect, link, gather, client, word, production -Requires at least: 3.5.0 -Tested up to: 4.4 -Stable tag: 2.6.47 -License: GPLv2 or later -License URI: http://www.gnu.org/licenses/gpl-2.0.html +=== GatherContent Importer === +Contributors: gathercontent, mathew-chapman, namshee, justinsainton, jtsternberg +Donate link: http://www.gathercontent.com +Tags structured content, gather content, gathercontent, import, migrate, export, mapping, production, writing, collaboration, platform, connect, link, gather, client, word, production +Requires at least: 3.8 +Tested up to: 4.5 +Stable tag: 2.6.47 +License: GPL-2.0+ +License URI: https://opensource.org/licenses/GPL-2.0 The GatherContent Import plugin allows you to quickly import structured content from your GatherContent projects into your WordPress site. @@ -30,8 +31,10 @@ This section describes how to install the plugin and get it working. 3. Click on the menu item "GatherContent" 3. Link your accounts. You will need to enter your GatherContent account URL (e.g. http://mywebsite.gathercontent.com) and your personal GatherContent Legacy API key. You can find your Legacy API key in your Settings area within GatherContent, by opening the Legacy API tab. -== Screenshots == +== Frequently Asked Questions == + +== Screenshots == 1. Quickly find your items using filters and live search. 2. Import GatherContent items as Pages, Posts, Media and various Custom Post Types. 3. Map individual fields to a huge range of places in WordPress. diff --git a/tasks/_template.js b/tasks/_template.js new file mode 100644 index 00000000..e0ea49a9 --- /dev/null +++ b/tasks/_template.js @@ -0,0 +1,3 @@ +module.exports = function (grunt) { + //grunt tasks here +}; \ No newline at end of file diff --git a/tasks/build.js b/tasks/build.js new file mode 100644 index 00000000..8ce0b445 --- /dev/null +++ b/tasks/build.js @@ -0,0 +1,3 @@ +module.exports = function (grunt) { + grunt.registerTask( 'build', ['default', 'clean', 'copy', 'compress'] ); +}; \ No newline at end of file diff --git a/tasks/css.js b/tasks/css.js new file mode 100644 index 00000000..79ecfa1d --- /dev/null +++ b/tasks/css.js @@ -0,0 +1,3 @@ +module.exports = function (grunt) { + grunt.registerTask( 'css', ['sass', 'postcss', 'cssmin'] ); +}; \ No newline at end of file diff --git a/tasks/default.js b/tasks/default.js new file mode 100644 index 00000000..72bbdffb --- /dev/null +++ b/tasks/default.js @@ -0,0 +1,3 @@ +module.exports = function (grunt) { + grunt.registerTask( 'default', ['css', 'js'] ); +}; \ No newline at end of file diff --git a/tasks/js.js b/tasks/js.js new file mode 100644 index 00000000..df47d63f --- /dev/null +++ b/tasks/js.js @@ -0,0 +1,3 @@ +module.exports = function (grunt) { + grunt.registerTask( 'js', ['jshint', 'concat', 'uglify'] ); +}; \ No newline at end of file diff --git a/tasks/options/_template.js b/tasks/options/_template.js new file mode 100644 index 00000000..1e95e9b6 --- /dev/null +++ b/tasks/options/_template.js @@ -0,0 +1,3 @@ +module.exports = { + // options go here +}; \ No newline at end of file diff --git a/tasks/options/clean.js b/tasks/options/clean.js new file mode 100644 index 00000000..6f1e3e4e --- /dev/null +++ b/tasks/options/clean.js @@ -0,0 +1,3 @@ +module.exports = { + main: ['release/<%= pkg.version %>'] +}; \ No newline at end of file diff --git a/tasks/options/compress.js b/tasks/options/compress.js new file mode 100644 index 00000000..3e101fd6 --- /dev/null +++ b/tasks/options/compress.js @@ -0,0 +1,12 @@ +module.exports = { + main: { + options: { + mode: 'zip', + archive: './release/gathercontent.<%= pkg.version %>.zip' + }, + expand: true, + cwd: 'release/<%= pkg.version %>/', + src: ['**/*'], + dest: 'gathercontent/' + } +}; \ No newline at end of file diff --git a/tasks/options/concat.js b/tasks/options/concat.js new file mode 100644 index 00000000..37597331 --- /dev/null +++ b/tasks/options/concat.js @@ -0,0 +1,16 @@ +module.exports = { + options: { + stripBanners: true, + banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' + + ' * <%= pkg.homepage %>\n' + + ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' + + }' * Licensed GPL-2.0+' + + ' */\n' + }, + main: { + src: [ + 'assets/js/src/gathercontent-importer.js' + ], + dest: 'assets/js/gathercontent-importer.js' + } +}; \ No newline at end of file diff --git a/tasks/options/copy.js b/tasks/options/copy.js new file mode 100644 index 00000000..7f6ed819 --- /dev/null +++ b/tasks/options/copy.js @@ -0,0 +1,28 @@ +module.exports = { + // Copy the theme to a versioned release directory + main: { + expand: true, + src: [ + '**', + '!**/.*', + '!**/readme.md', + '!node_modules/**', + '!vendor/**', + '!tests/**', + '!release/**', + '!assets/css/sass/**', + '!assets/css/src/**', + '!assets/js/src/**', + '!images/src/**', + '!bootstrap.php', + '!bower.json', + '!composer.json', + '!composer.lock', + '!Gruntfile.js', + '!package.json', + '!phpunit.xml', + '!phpunit.xml.dist' + ], + dest: 'release/<%= pkg.version %>/' + } +}; \ No newline at end of file diff --git a/tasks/options/cssmin.js b/tasks/options/cssmin.js new file mode 100644 index 00000000..7c9dcc34 --- /dev/null +++ b/tasks/options/cssmin.js @@ -0,0 +1,18 @@ +module.exports = { + options: { + banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' + + ' * <%=pkg.homepage %>\n' + + ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' + + }' * Licensed GPL-2.0+' + + ' */\n' + }, + minify: { + expand: true, + + cwd: 'assets/css/', + src: ['gathercontent-importer.css'], + + dest: 'assets/css/', + ext: '.min.css' + } +}; \ No newline at end of file diff --git a/tasks/options/jshint.js b/tasks/options/jshint.js new file mode 100644 index 00000000..30ea9acd --- /dev/null +++ b/tasks/options/jshint.js @@ -0,0 +1,7 @@ +module.exports = { + all: [ + 'Gruntfile.js', + 'assets/js/src/**/*.js', + 'assets/js/test/**/*.js' + ] +}; \ No newline at end of file diff --git a/tasks/options/mocha.js b/tasks/options/mocha.js new file mode 100644 index 00000000..760c85e8 --- /dev/null +++ b/tasks/options/mocha.js @@ -0,0 +1,11 @@ +var mochaPath = 'tests/mocha/'; + +module.exports = { + test: { + src: [ mochaPath + '**/*.html' ], + options: { + run: true, + timeout: 10000 + } + } +}; diff --git a/tasks/options/phpunit.js b/tasks/options/phpunit.js new file mode 100644 index 00000000..7209c877 --- /dev/null +++ b/tasks/options/phpunit.js @@ -0,0 +1,11 @@ +module.exports = { + classes: { + dir: 'tests/phpunit/' + }, + options: { + bin: 'vendor/bin/phpunit', + bootstrap: 'bootstrap.php.dist', + colors: true, + testSuffix: 'Tests.php' + } +}; \ No newline at end of file diff --git a/tasks/options/postcss.js b/tasks/options/postcss.js new file mode 100644 index 00000000..b0501206 --- /dev/null +++ b/tasks/options/postcss.js @@ -0,0 +1,12 @@ +module.exports = { + dist: { + options: { + processors: [ + require('autoprefixer')({browsers: 'last 2 versions'}) + ] + }, + files: { + 'assets/css/gathercontent-importer.css': [ 'assets/css/gathercontent-importer.css' ] + } + } +}; \ No newline at end of file diff --git a/tasks/options/sass.js b/tasks/options/sass.js new file mode 100644 index 00000000..67621d35 --- /dev/null +++ b/tasks/options/sass.js @@ -0,0 +1,11 @@ +module.exports = { + all: { + options: { + precision: 2, + sourceMap: true + }, + files: { + 'assets/css/gathercontent-importer.css': 'assets/css/sass/gathercontent-importer.scss' + } + } +}; \ No newline at end of file diff --git a/tasks/options/uglify.js b/tasks/options/uglify.js new file mode 100644 index 00000000..99125982 --- /dev/null +++ b/tasks/options/uglify.js @@ -0,0 +1,17 @@ +module.exports = { + all: { + files: { + 'assets/js/gathercontent-importer.min.js': ['assets/js/gathercontent-importer.js'] + }, + options: { + banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' + + ' * <%= pkg.homepage %>\n' + + ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' + + }' * Licensed GPL-2.0+' + + ' */\n', + mangle: { + except: ['jQuery'] + } + } + } +}; \ No newline at end of file diff --git a/tasks/options/watch.js b/tasks/options/watch.js new file mode 100644 index 00000000..d95fdbc7 --- /dev/null +++ b/tasks/options/watch.js @@ -0,0 +1,22 @@ +module.exports = { + livereload: { + files: ['assets/css/*.css'], + options: { + livereload: true + } + }, + css: { + files: ['assets/css/sass/**/*.scss'], + tasks: ['css'], + options: { + debounceDelay: 500 + } + }, + js: { + files: ['assets/js/src/**/*.js', 'assets/js/vendor/**/*.js'], + tasks: ['js'], + options: { + debounceDelay: 500 + } + } +}; diff --git a/tasks/test.js b/tasks/test.js new file mode 100644 index 00000000..a92c7e3d --- /dev/null +++ b/tasks/test.js @@ -0,0 +1,3 @@ +module.exports = function (grunt) { + grunt.registerTask( 'test', ['phpunit', 'mocha'] ); +}; diff --git a/tests/mocha/gathercontent-importer.html b/tests/mocha/gathercontent-importer.html new file mode 100644 index 00000000..3e73202e --- /dev/null +++ b/tests/mocha/gathercontent-importer.html @@ -0,0 +1,27 @@ + + + + Mocha Tests + + + + +
    + + + + + + + + + + + + + + diff --git a/tests/mocha/tests/gathercontent-importer.js b/tests/mocha/tests/gathercontent-importer.js new file mode 100644 index 00000000..78a4e766 --- /dev/null +++ b/tests/mocha/tests/gathercontent-importer.js @@ -0,0 +1,9 @@ +var assert = chai.assert; + +describe( 'Array', function() { + it( 'should start empty', function() { + var arr = []; + + assert.equal( arr.length, 0 ); + } ); +} ); diff --git a/tests/phpunit/Core_Tests.php b/tests/phpunit/Core_Tests.php new file mode 100644 index 00000000..8e3dcb1e --- /dev/null +++ b/tests/phpunit/Core_Tests.php @@ -0,0 +1,113 @@ +assertConditionsMet(); + } + + /** + * Test internationalization integration. + */ + public function test_i18n() { + // Setup + \WP_Mock::wpFunction( 'get_locale', array( + 'times' => 1, + 'args' => array(), + 'return' => 'en_US', + ) ); + \WP_Mock::onFilter( 'plugin_locale' )->with( 'en_US', 'gathercontent' )->reply( 'en_US' ); + \WP_Mock::wpFunction( 'load_textdomain', array( + 'times' => 1, + 'args' => array( 'gathercontent', 'lang_dir/gathercontent/gathercontent-en_US.mo' ), + ) ); + \WP_Mock::wpFunction( 'plugin_basename', array( + 'times' => 1, + 'args' => array( 'path' ), + 'return' => 'path', + ) ); + \WP_Mock::wpFunction( 'load_plugin_textdomain', array( + 'times' => 1, + 'args' => array( 'gathercontent', false, 'path/languages/' ), + ) ); + + // Act + i18n(); + + // Verify + $this->assertConditionsMet(); + } + + /** + * Test initialization method. + */ + public function test_init() { + // Setup + \WP_Mock::expectAction( 'gathercontent_init' ); + + // Act + init(); + + // Verify + $this->assertConditionsMet(); + } + + /** + * Test activation routine. + */ + public function test_activate() { + // Setup + \WP_Mock::wpFunction( 'flush_rewrite_rules', array( + 'times' => 1 + ) ); + + // Act + activate(); + + // Verify + $this->assertConditionsMet(); + } + + /** + * Test deactivation routine. + */ + public function test_deactivate() { + // Setup + + // Act + deactivate(); + + // Verify + } +} \ No newline at end of file diff --git a/tests/phpunit/test-tools/TestCase.php b/tests/phpunit/test-tools/TestCase.php new file mode 100644 index 00000000..44b2674b --- /dev/null +++ b/tests/phpunit/test-tools/TestCase.php @@ -0,0 +1,75 @@ +setPreserveGlobalState( false ); + return parent::run( $result ); + } + + protected $testFiles = array(); + + public function setUp() { + if ( ! empty( $this->testFiles ) ) { + foreach ( $this->testFiles as $file ) { + if ( file_exists( PROJECT . $file ) ) { + require_once( PROJECT . $file ); + } + } + } + + parent::setUp(); + } + + public function assertActionsCalled() { + $actions_not_added = $expected_actions = 0; + try { + WP_Mock::assertActionsCalled(); + } catch ( \Exception $e ) { + $actions_not_added = 1; + $expected_actions = $e->getMessage(); + } + $this->assertEmpty( $actions_not_added, $expected_actions ); + } + + public function ns( $function ) { + if ( ! is_string( $function ) || false !== strpos( $function, '\\' ) ) { + return $function; + } + + $thisClassName = trim( get_class( $this ), '\\' ); + + if ( ! strpos( $thisClassName, '\\' ) ) { + return $function; + } + + // $thisNamespace is constructed by exploding the current class name on + // namespace separators, running array_slice on that array starting at 0 + // and ending one element from the end (chops the class name off) and + // imploding that using namespace separators as the glue. + $thisNamespace = implode( '\\', array_slice( explode( '\\', $thisClassName ), 0, - 1 ) ); + + return "$thisNamespace\\$function"; + } + + /** + * Define constants after requires/includes + * + * See http://kpayne.me/2012/07/02/phpunit-process-isolation-and-constant-already-defined/ + * for more details + * + * @param \Text_Template $template + */ + public function prepareTemplate( \Text_Template $template ) { + $template->setVar( [ + 'globals' => '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = \'' . $GLOBALS['__PHPUNIT_BOOTSTRAP'] . '\';', + ] ); + parent::prepareTemplate( $template ); + } +} \ No newline at end of file diff --git a/view/curl-error.php b/view/curl-error.php deleted file mode 100644 index 95c7965f..00000000 --- a/view/curl-error.php +++ /dev/null @@ -1,11 +0,0 @@ - - -
    diff --git a/view/finished.php b/view/finished.php deleted file mode 100644 index 194aec5f..00000000 --- a/view/finished.php +++ /dev/null @@ -1,15 +0,0 @@ - - -
    -
    -

    _e( 'Success!' ) ?>

    -
    -
    -

    - _e( 'All of your selected content has been imported.' ) ?> -

    - -
    -
    diff --git a/view/item-import.php b/view/item-import.php deleted file mode 100644 index e67fd48e..00000000 --- a/view/item-import.php +++ /dev/null @@ -1,64 +0,0 @@ - -error != '' ){ - echo '

    '.$this->error.'

    '; -} -?> -
    -
    -
    -

    _e( 'Importing items and text content...' ) ?>

    - -
    -
    -
    -
    -
    -

    _e( 'Repeating configuration...' ) ?>

    - -
    -
    -

    _e( 'Choose items to import' ) ?>_e( 'Choose account' ) ?>

    -
    -
    -
    -
    - -
    - 0 && $this->get_submit_button( $this->__( 'Import selected items' ) ) ?> -
    -
    - - - - - - - - - - - -
    __( 'Items' ); ?>
    -
    -
    -
    - 0 && $this->get_submit_button( $this->__( 'Import selected items' ) ) ?> -
    -
    - base_name ) ?> -
    -
    - diff --git a/view/items.php b/view/items.php deleted file mode 100644 index cbb09c33..00000000 --- a/view/items.php +++ /dev/null @@ -1,43 +0,0 @@ - -error != '' ) { - echo '

    ' . $this->error . '

    '; -} -?> -
    -
    -

    _e( 'Choose items to import' ) ?>_e( 'Choose account' ) ?>

    -
    -
    -
    -
    -
    - -
    -
    - - - 0 && $this->get_submit_button( $this->__( 'Configure selected items' ) ) ?> -
    -
    - - - - - - - - - - - -
    __( 'Items' ); ?>
    -
    -
    -
    - 0 && $this->get_submit_button( $this->__( 'Configure selected items' ) ) ?> -
    -
    - base_name ) ?> -
    -
    diff --git a/view/login.php b/view/login.php deleted file mode 100644 index 8a8bc09b..00000000 --- a/view/login.php +++ /dev/null @@ -1,23 +0,0 @@ - - -
    -
    -

    _e( 'Connect to your GatherContent account' ) ?>

    -
    -
    -
    - - https:// - - .gathercontent.com -
    -
    - - -
    -
    - get_submit_button( $this->__( 'Connect account' ) ) ?> -
    - base_name ) ?> -
    -
    diff --git a/view/media.php b/view/media.php deleted file mode 100644 index df8aa646..00000000 --- a/view/media.php +++ /dev/null @@ -1,27 +0,0 @@ - - -
    -
    -

    _e( 'Importing files' ) ?>

    -
    -
    -
    - _e( 'Heads up! This process can take a while, it depends on how many files you have attached to your items. Just think how much time you\'re saving.' ) ?> -
    - -
    -
    -
    - -
    -
    -
    - - base_name ) ?> -
    -
    - diff --git a/view/projects.php b/view/projects.php deleted file mode 100644 index 48d8813f..00000000 --- a/view/projects.php +++ /dev/null @@ -1,36 +0,0 @@ - -error != '' ) { - echo '

    '.$this->error.'

    '; -} -?> -
    -
    -

    _e( 'Choose a project to import content from' ) ?>

    -
    -
    - 0 ): ?> -
      - $info ): $fieldid = 'gc_project_'.$id; ?> -
    • - /> - -
    • - -
    - -

    _e( 'No projects found' ) ?>

    - -
    - - 0 ): ?> -
    - get_submit_button( $this->__( 'Import content' ) ) ?> -
    - -
    - base_name ) ?> -
    -