commit 7e1279f72fa85aa502a373eb095751e5992e7f12 Author: root Date: Mon Oct 6 11:52:28 2025 +0200 Fix PHP 8.4 compatibility issues in Sensational theme - Fixed deprecated WP_Widget constructors in all widget files - Changed $this->WP_Widget() to parent::__construct() in: * widget-social.php * widget-fblikebox.php * widget-googleplus.php * widget-tabs.php - Fixed old-style constructor methods to __construct() in: * widget-ad125.php (mts_Ad_Widget -> __construct) * widget-ad300.php (mts_ad_300_Widget -> __construct) - Fixed for loop syntax error in widget-tweets.php (for(i; -> for($i = 1;) - Enabled registration for ad125 and ad300 widgets - Added new 'After First Paragraph' widget area for in-content ads All widgets now compatible with PHP 8.4 and editable in WordPress admin. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude diff --git a/404.php b/404.php new file mode 100644 index 0000000..81408b5 --- /dev/null +++ b/404.php @@ -0,0 +1,25 @@ + +
+ + + + +
+
+
+
+

+
+
+
+


+

+ +
+
+
+ + \ No newline at end of file diff --git a/apple-touch-icon.png b/apple-touch-icon.png new file mode 100644 index 0000000..5ba2402 Binary files /dev/null and b/apple-touch-icon.png differ diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..e0cc97f --- /dev/null +++ b/archive.php @@ -0,0 +1,67 @@ + + +
+ + + + +
+
+

+ + + + + + nickname; _e(" Archive", "mythemeshop"); ?> + + + + : + + : + +

+ +
'; ?> + + +
+ +
+
+ + + + + + + + + +
+
+ + \ No newline at end of file diff --git a/backup-bfeb.php.suspected b/backup-bfeb.php.suspected new file mode 100644 index 0000000..e69de29 diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..4fdd8b2 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,80 @@ +v2.0.1 (November 6, 2013) +---------------------------- +Added Schema for Breadcrumbs. +Added Option to control thumbnail quality. +Theme will show new update notification on dashboard. +Added Option to disable Theme update notification. +Added Floating social sharing buttons. +Added Styling for Single Post tags. + +v2.0 (October 22, 2013) +---------------------------- +New framework implementation, code and speed optimization. +Theme is now WooCommerce Ready. +New improved Options Panel. +Added Option to disable Responsiveness. +Added brand new Typography Options with all Google Fonts. +Added Option to show latest posts from perticular categories. +Added Async loading for social sharing buttons to reduce loading time. +Added 20 new background patterns. +Removed Options to enable thumbnails on homepage. +Added Related Posts Widget +Added Google Plus Badge Widget. +Improved Recent Posts, Category posts, Popular Posts and Tabbed widget. +Added new Tweets Widget compatible with latest API. +Added HTML Prefetching for lightning fast site loading. +Better Scripts and CSS files loading. +Improved tag widget design. +Improved calender widget design. +Fixed double title issue in Feed +Shortcodes will work in feed. +New social profile widget added. +Upload any size of logo without modifying code. +Now column shortcodes are responsive on small screens. +Added Option to select multiple categories for Slider. +Added Option to show widget titles for left sidebar. +Added exclusive MyThemeShop Dashboard Design Option. +Related posts will show random posts from same category. +Added Option to hide post meta on homepage. +Removed Twitter, Facebook & RSS counter widget. (Reason: FeedBurner deprecated APIs) +Added Option to hide thumbnails for Recent, Category & Popular Posts Widgets +Added Option to hide Date, Comment count and Thumbs for Tabbed Widget. +In Author box now author name is linked to Author Archive. +Added Option to make navigation Floating/Sticky. +Fixed Small bugs. +Small design improvements. +Made a few SEO improvements. +Replaced icon images with Font icons. +Added more than 350 font icons. +Optimized code for faster loading. +Added few words in .po file for translation. +Removed No Preview image from homepage excerpts. + +v1.1 (June 6th, 2012) +---------------------------- +Added new and improved options panel. +Theme is now fluid, HTML5. +Unlimited color schemes. +New shortcode tabs with one extra shortcode: Toggle. +Enabled thumbnails on homepage for mobile screens. +Fixed error in social counter widget. +New back to top floating button. +New lightweight Pinterest button. +Added top border for active navigation tab. +Left sidebar is now widgetized. +Fixed 'read more' button for tag. +Now you can choose category for featured post. +New icons for social counter widget. +Added image sprites to reduce HTTP callbacks. +Added tabbed widget for random and recent posts. +Made a few SEO improvements. +Optimized code for faster loading. +Removed hover effect from related posts. +Improved dropdown menus. +New shortcode buttons. +Now you can Import/Export Options Panel settings. +Now you can upload a custom background from options panel. + +v1.0 +---------------------------- +Theme Released \ No newline at end of file diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..d215154 --- /dev/null +++ b/comments.php @@ -0,0 +1,60 @@ + +

+ + + +
+
One Response', '% Responses' );?>
+
    + + + +
+
+ +comment_status) : ?> + + + +

+ + + +comment_status) : ?> +
+
+ '

'.__('Leave a Reply','mythemeshop').'

', + 'comment_notes_after' => '', + 'label_submit' => 'Submit Comment', + 'comment_field' => '

', + 'fields' => apply_filters( 'comment_form_default_fields', + array( + 'author' => '

' + .'' + .( $req ? '' : '' ).'

', + 'email' => '', + 'url' => '

' . + '

' + ) ) + ); + comment_form($comments_args); ?> +
+
+ \ No newline at end of file diff --git a/css/addons.css b/css/addons.css new file mode 100644 index 0000000..9adb099 --- /dev/null +++ b/css/addons.css @@ -0,0 +1,274 @@ +/* + * "Install Plugins" page styles + */ + .mts-addons-tabs-wrap { + text-align: center; +} +.mts-addons-tabs { + list-style: none; + border: 1px solid #ddd; + border-radius: 4px; + margin: 40px auto 0; + overflow: hidden; + display: inline-block; +} +.mts-addons-tabs li { + float: left; + width: 200px; + border-right: 1px solid #ddd; + margin: 0!important; + background: #fff; +} +.mts-addons-tabs li:last-child { + border-right: 0; +} +.mts-addons-tabs li a { + font-size: 14px; + font-weight: bold; + color: #5a5a5a; + text-transform: uppercase; + display: block; + padding: 15px 10px; + text-decoration: none; + outline: none!important; + transition: all .25s ease-in-out; +} +.mts-addons-tabs li a:hover { + color: #51B4D3; +} +.mts-addons-tabs li.active { + background: #51B4D3; +} +.mts-addons-tabs li.active a { + color: #fff!important; +} +.mts-addons-header { + margin: 25px 6.5% 30px; + text-align: center; +} +.mts-addons-header h2 { + margin: 0 0 15px; + padding: 0; + font-size: 48px; + font-weight: 400; + letter-spacing: -0.05em; + line-height: 1.1; +} +.mts-addons-header > p { + margin: 0; + padding: 0; + font-size: 21px; + font-weight: 300; + line-height: 1.3; + color: #777; +} +.mts-addons-header a { + text-decoration: none; +} +.mts-addons-list { + max-width: 1400px; + margin: 0 auto; + list-style: none; +} +li.mts-addon { + border: 5px solid #c5c5c5; + background-color: #fff; + box-sizing: border-box; + width: calc(33.3333% - 14px); + margin: 0 20px 20px 0; + float: left; +} +li.mts-addon.visible { + display: block; +} +li.mts-addon:nth-child(3n) { + margin-right: 0; +} +li.mts-addon:nth-child(3n+1) { + clear: left; +} +.mts-addon.active { + border-color: #7ad03a; +} +.mts-addon .top { + position: relative; + padding: 20px; + text-align: center; +} +li.mts-addon .top { + min-height: 345px; +} +.mts-addon .img { + width: 100px; + margin: 0 0 1em; + border-radius: 3px; +} +.mts-addon .info { + margin: 0; +} +.mts-addon .title { + margin: 0; + font-size: 1.5em; + line-height: 1.2; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.mts-addon .status { + display: inline-block; + margin: 1em 0 0; + border: 1px solid; + padding: 6px 7px; + line-height: 1; + border-radius: 3px; + text-decoration: none; +} +.mts-addon .status.active { + color: #fff; + border-color: #7ad03a; + background-color: #7ad03a; +} +.mts-addon .status.inactive { + color: #fff; + border-color: #ffba00; + background-color: #ffba00; +} +.mts-addon .status.not-installed { + color: #fff; + border-color: #a00; + background-color: #a00; +} +div.mts-addon .desc { + max-width: 350px; + margin-left: auto; + margin-right: auto; +} +.mts-addon .author { + margin-bottom: 0; +} +.mts-addon .bottom { + clear: both; + overflow: hidden; + border-top: 1px solid #e5e5e5; + padding: 10px; + text-align: center; + background-color: #fafafa; +} +.mts-addon .bottom > .button { + margin-bottom: 0; +} +.tgmpa .subsubsub { float: none; } +@media (max-width: 1200px) { + li.mts-addon { + width: calc(50% - 10px); + margin: 0 20px 20px 0; + } + li.mts-addon:nth-child(3n) { + margin-right: 20px; + } + li.mts-addon:nth-child(3n+1) { + clear: none; + } + li.mts-addon:nth-child(2n) { + margin-right: 0; + } + li.mts-addon:nth-child(2n+1) { + clear: left; + } +} + +@media (max-width: 700px) { + + .mts-addons-tabs li { + clear: left; + border-right: 0; + border-bottom: 1px solid #ddd; + } + .mts-addons-tabs li:last-child { + border-bottom: 0; + } + li.mts-addon .top { + min-height: 1px; + } + li.mts-addon { + float: none!important; + width: 100%!important; + max-width: 450px!important; + margin: 0 auto 10px!important; + } +} + +@media screen and (max-width: 500px) { + .mts-addons-header h2 { + font-size: 36px; + } +} + +.loader { + margin: 200px auto; + font-size: 25px; + width: 1em; + height: 1em; + border-radius: 50%; + position: relative; + text-indent: -9999em; + -webkit-animation: load5 1.1s infinite ease; + animation: load5 1.1s infinite ease; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); +} +@-webkit-keyframes load5 { + 0%, + 100% { + box-shadow: 0em -2.6em 0em 0em #000000, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.5), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.7); + } + 12.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.7), 1.8em -1.8em 0 0em #000000, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.5); + } + 25% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.5), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.7), 2.5em 0em 0 0em #000000, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 37.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.5), 2.5em 0em 0 0em rgba(0, 0, 0, 0.7), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 50% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.5), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.7), 0em 2.5em 0 0em #000000, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 62.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.5), 0em 2.5em 0 0em rgba(0, 0, 0, 0.7), -1.8em 1.8em 0 0em #000000, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 75% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.5), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.7), -2.6em 0em 0 0em #000000, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 87.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.5), -2.6em 0em 0 0em rgba(0, 0, 0, 0.7), -1.8em -1.8em 0 0em #000000; + } +} +@keyframes load5 { + 0%, + 100% { + box-shadow: 0em -2.6em 0em 0em #000000, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.5), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.7); + } + 12.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.7), 1.8em -1.8em 0 0em #000000, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.5); + } + 25% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.5), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.7), 2.5em 0em 0 0em #000000, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 37.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.5), 2.5em 0em 0 0em rgba(0, 0, 0, 0.7), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 50% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.5), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.7), 0em 2.5em 0 0em #000000, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 62.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.5), 0em 2.5em 0 0em rgba(0, 0, 0, 0.7), -1.8em 1.8em 0 0em #000000, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 75% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.5), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.7), -2.6em 0em 0 0em #000000, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2); + } + 87.5% { + box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.5), -2.6em 0em 0 0em rgba(0, 0, 0, 0.7), -1.8em -1.8em 0 0em #000000; + } +} diff --git a/css/admin.css b/css/admin.css new file mode 100644 index 0000000..e4288bb --- /dev/null +++ b/css/admin.css @@ -0,0 +1,255 @@ +/*-------------------------------------------------------- + + Custom Admin Skin for WP Dashboard by MyThemeShop.com + Available with MyThemeShop Themes only. + Copyrights Mythemeshop.com 2012-13 + +--------------------------------------------------------*/ +a { + -moz-transition: .2s ease-in-out; + -webkit-transition: .2s ease-in-out; + transition: .2s ease-in-out; +} +.welcome-panel { + background: white; + background-image: none; + border-color: #CAC8C2; +} +#wpwrap { background: #FBFBFB;} +html.wp-toolbar { padding-top: 35px } +html { background: transparent; } +#adminmenuback, #adminmenuwrap { + background-color: #F8F6F0!important; + border-color: #C7C6C4; + z-index: 1; +} +#adminmenu a.menu-top, #adminmenu .wp-submenu .wp-submenu-head { + border-top-color: transparent; + border-bottom-color: #D8D6D2; + padding: 8px; +} +#adminmenu li.menu-top:hover, #adminmenu li.opensub > a.menu-top, #adminmenu li > a.menu-top:focus { + color: #FFFFFF; + background-color: #6C96C5; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0); + border-bottom-color: #5D80A7; +} +#adminmenu a:hover { + color: #fff; + -moz-transition: .2s ease-in-out; + -webkit-transition: .2s ease-in-out; + transition: .2s ease-in-out; +} +#adminmenu li.wp-not-current-submenu .wp-menu-arrow { + border-top-color: #6C96C5; + border-bottom-color: #6C96C5; + background: #6C96C5; +} +#adminmenu li.wp-not-current-submenu .wp-menu-arrow div { + background: #6C96C5; + border-color: #6C96C5; +} +a, #adminmenu a, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-items a.delete, #media-items a.delete-permanently, .plugins a.delete, .ui-tabs-nav a { color: #797774 } +#adminmenu li.menu-top > a:focus, #adminmenu .wp-submenu a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, #media-upload a.del-link:hover, div.dashboard-widget-submit input:hover, .subsubsub a:hover, .subsubsub a.current:hover, .ui-tabs-nav a:hover, .plugins .inactive a:hover, #all-plugins-table .plugins .inactive a:hover, #search-plugins-table .plugins .inactive a:hover, #wpadminbar .quicklinks .menupop ul li a, #wpadminbar .quicklinks .menupop ul li a strong, #wpadminbar .quicklinks .menupop.hover ul li a, #wpadminbar.nojs .quicklinks .menupop:hover ul li a { color: #4D4A47 } +#adminmenu .wp-menu-arrow div { + background: #6C96C5; + background-image: none; + left: -4px; + width: 18px; + height: 17px; + top: 10px; +} +#adminmenu .wp-not-current-submenu .wp-menu-arrow div { + width: 18px; + height: 17px; + top: 8px; +} +#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu li.current a.menu-top, .folded #adminmenu li.wp-has-current-submenu, .folded #adminmenu li.current.menu-top, #adminmenu .wp-menu-arrow, #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { + background: #6C96C5; + background-image: none; +} +#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu li.current a.menu-top, #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { + text-shadow: 0 1px 0 rgba(51, 51, 51, 0.38); + color: white; + border-top-color: #5D80A7; + border-bottom-color: #5D80A7; +} +#wpadminbar { + background: #F1F1F1; + background-image: none; + border-bottom: 1px solid #D8D8D8; + height: 34px; +} +#wpadminbar * { + color: #555; + text-shadow: #FFFFFF 0 1px 0; + line-height: 2.7; +} +#wpadminbar .ab-top-secondary { + background: transparent; + background-image: none; +} +#wpadminbar .quicklinks > ul > li { border-right: 1px solid #D8D8D8;} +#wpadminbar .quicklinks > ul > li > a, #wpadminbar .quicklinks > ul > li > .ab-empty-item { border-right: 0 } +#wpadminbar .ab-icon, #wp-admin-bar-wp-logo > .ab-item .ab-icon { margin-top: 9px } +#wpadminbar .quicklinks a, #wpadminbar .quicklinks .ab-empty-item, #wpadminbar .shortlink-input { height: 34px } +#wpadminbar .quicklinks .ab-top-secondary > li > a, #wpadminbar .quicklinks .ab-top-secondary > li > .ab-empty-item { border-left: 0 } +#wpadminbar .quicklinks .ab-top-secondary > li { border-left: 1px solid #D8D8D8 } +#wpadminbar .ab-icon { + width: 16px; + height: 17px; +} +#wp-admin-bar-comments > .ab-item .ab-icon { + background-image: url(images/mtscomments.png); + background-position: 0; + background-repeat: no-repeat; +} +#wpadminbar .ab-top-menu > li:hover > .ab-item, #wpadminbar .ab-top-menu > li.hover > .ab-item, #wpadminbar .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus { + color: #555; + background: #F1F0ED; +} +#wp-admin-bar-wp-logo > .ab-item .ab-icon { + width: 32px; + height: 32px; + margin-top: 2px!important; + background-image: url(images/mtsWordpress.png); + background-position: 0; + background-repeat: no-repeat; + opacity: 0.6; +} +#wpadminbar.nojs #wp-admin-bar-wp-logo:hover > .ab-item .ab-icon, #wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon { + background-position: 0; + opacity: 1; +} +#wpadminbar #wp-admin-bar-new-content > .ab-item .ab-icon { + background-image: url(images/mtsplus.png); + background-position: 0; + background-repeat: no-repeat; + opacity: 0.6; + margin-right: 3px; + margin-top: 8px; +} +#wpadminbar.nojs #wp-admin-bar-new-content:hover > .ab-item .ab-icon, #wpadminbar #wp-admin-bar-new-content.hover > .ab-item .ab-icon { + background-position: 0; + opacity: 1; +} +#adminmenu div.wp-menu-name { padding: 0 } +.widget .widget-top, .postbox h3, .stuffbox h3 { + border-bottom-color: #CAC8C2; + text-shadow: white 0 1px 0; + -webkit-box-shadow: 0 1px 0 white; + box-shadow: 0 1px 0 white; + background: #F1F1F1; + background-image: -webkit-gradient(linear,left bottom,left top,from(#E4E3DC),to(#FEFEFE)); + background-image: -webkit-linear-gradient(bottom,#E4E3DC,#FEFEFE); + background-image: -moz-linear-gradient(bottom,#E4E3DC,#FEFEFE); + background-image: -o-linear-gradient(bottom,#E4E3DC,#FEFEFE); + background-image: linear-gradient(to top,#E4E3DC,#FEFEFE); +} +.widget .widget-top, .postbox h3, .stuffbox h3, .widefat thead tr th, .widefat tfoot tr th, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, .sidebar-name, #nav-menu-header, #nav-menu-footer, .menu-item-handle { + background: #F1F1F1; + background-image: -webkit-gradient(linear,left bottom,left top,from(#E4E3DC),to(#FEFEFE)); + background-image: -webkit-linear-gradient(bottom,#E4E3DC,#FEFEFE); + background-image: -moz-linear-gradient(bottom,#E4E3DC,#FEFEFE); + background-image: -o-linear-gradient(bottom,#E4E3DC,#FEFEFE); + background-image: linear-gradient(to top,#E4E3DC,#FEFEFE); +} +.widefat { border-color: #CAC8C2 } +.widget, #widget-list .widget-top, .postbox, .menu-item-settings { + background: white; + background-image: none; +} +.widget, #widget-list .widget-top, .postbox, #titlediv, #poststuff .postarea, .stuffbox { + border-color: #CAC8C2; + -webkit-box-shadow: none; + box-shadow: none; +} +.postbox .inside { + margin: 20px 0; + position: relative; +} +#poststuff h3, .metabox-holder h3 { padding: 10px } +#wpadminbar .menupop li:hover, #wpadminbar .menupop li.hover, #wpadminbar .quicklinks .menupop .ab-item:focus, #wpadminbar .quicklinks .ab-top-menu .menupop .ab-item:focus { + background-color: #A39E8D; + color: white; + border-color: #A39E8D!important; +} +#wpadminbar .quicklinks .menupop.hover ul li a:hover { color: #fff } +#wpadminbar .quicklinks .menupop ul li { + padding: 3px 0; + border-bottom: 1px solid #CDCDCB; +} +#wpadminbar .quicklinks ul { + text-align: left; + padding-bottom: 0; + padding-top: 0; +} +#wpadminbar .menupop .ab-sub-wrapper, #wpadminbar .shortlink-input { border: 1px solid #D8D8D8; -webkit-box-shadow: none; box-shadow: none; border-top: 0;} +#screen-meta, #screen-options-link-wrap, #contextual-help-link-wrap { background: #fff } +#wpadminbar #wp-admin-bar-user-info, #wpadminbar #wp-admin-bar-user-actions > li { border-bottom: 0 } +#adminmenu div.wp-menu-image { margin-top: -6px } +.folded #adminmenu a.menu-top { + padding-left: 0; + padding-bottom: 0px; +} +#adminmenu .wp-submenu a:hover, #adminmenu .wp-submenu a:focus { + background-color: #A39E8D; + color: white!important; + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.33); +} +#adminmenu li.wp-not-current-submenu .wp-menu-arrow { height: 32px } +.tablenav .tablenav-pages a { + border-color: #CAC8C2; + background: white; + padding: 2px 6px 4px 6px; +} +.wp_themeSkin iframe { background: white!important } +.wp-core-ui .button-primary { + background-color: #6C96C5; + background-image: none; + border-color: #5B7DA3; + border-bottom-color: #517092; +} +.wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:hover, .wp-core-ui .button-primary.focus, .wp-core-ui .button-primary:focus { + background-color: #77A2D1; + background-image: none; + border-color: #5B7DA3; +} +#wpadminbar .quicklinks .menupop ul.ab-sub-secondary { background: #FAF9F7 } +#wpadminbar .quicklinks .menupop .ab-sub-secondary > li:hover, #wpadminbar .quicklinks .menupop .ab-sub-secondary > li.hover, #wpadminbar .quicklinks .menupop .ab-sub-secondary > li .ab-item:focus { background-color: #A39E8D } +#adminmenu .awaiting-mod, #adminmenu .update-plugins, #sidemenu a .update-plugins, #rightnow .reallynow { background-color: #F03C03 } +#adminmenu .wp-submenu, .folded #adminmenu a.wp-has-current-submenu:focus + .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu { + background-color: white; + border-color: #DDDBD6; + -webkit-box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.12); + box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.12); +} +.drag-drop #drag-drop-area, #template textarea { background: #fff } +.wp-pointer-content { border-top: 0; } +.wp-pointer-content h3 { + background: #6C96C5; + background-image: none; +} +.wrap .add-new-h2, .wrap .add-new-h2:active { + background: #6DAEE0; + color: white; + text-shadow: 0 0 0; +} +#wp-admin-bar-updates > .ab-item .ab-icon { + background-image: url(images/mtsloop.png); + background-position: 0; + background-repeat: no-repeat; + opacity: 0.6; +} +textarea, input[type="text"], input[type="password"], input[type="file"], input[type="email"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], select { + -moz-transition: .2s ease-in-out; + -webkit-transition: .2s ease-in-out; + transition: .2s ease-in-out; +} +textarea:hover, input[type="text"]:hover, input[type="password"]:hover, input[type="file"]:hover, input[type="email"]:hover, input[type="number"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="url"]:hover, select:hover { + border-color: #42ADFE!important; + outline: none; + -moz-box-shadow: 0 1px 0 #FFFFFF inset, 0 1px 5px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 1px 0 #FFFFFF inset, 0 1px 5px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 0 #FFFFFF inset, 0 1px 5px rgba(0, 0, 0, 0.1); +} \ No newline at end of file diff --git a/css/flexslider.css b/css/flexslider.css new file mode 100644 index 0000000..df49226 --- /dev/null +++ b/css/flexslider.css @@ -0,0 +1,79 @@ +/* + * jQuery FlexSlider v2.0 + * http://www.woothemes.com/flexslider/ + * Copyright 2012 WooThemes + * Free to use under the GPLv2 license. + * http://www.gnu.org/licenses/gpl-2.0.html + * Contributing author:Tyler Smith (@mbmufffin) + */ +/* Browser Resets */ +.flex-container a:active,.flexslider a:active,.flex-container a:focus,.flexslider a:focus{outline:none} +.slides,.flex-control-nav,.flex-direction-nav{margin:0;padding:0;list-style:none !important} + +/* FlexSlider Necessary Styles +*********************************/ +.flexslider {width: 98%; margin: 28px 2% 0 0; padding: 0; max-width: 630px;} +.flexslider .slides > li{display:none;list-style:none;position:relative;} /* Hide the slides before the JS is loaded. Avoids image jumping */ +.flexslider .slides img {max-width: 95%; display: block; margin:0; width: 600px; background: #f8f8f8; padding: 2.5% } +.flex-pauseplay span{text-transform:capitalize} + +/* Clearfix for the .slides element */ +.slides:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0} +html[xmlns] .slides{display:block} +* html .slides{height:1%} + +/* No JavaScript Fallback */ +/* If you are not using another script, such as Modernizr, make sure you + * include js that eliminates this class on page load */ +.no-js .slides > li:first-child{display:block} + +/* FlexSlider Default Theme +*********************************/ +.flexslider {position: relative; -webkit-border-radius: 5px; -moz-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; zoom: 1;} +.flex-container{ margin-bottom:20px} +.flex-viewport{max-height:2000px;-webkit-transition:all 1s ease;-moz-transition:all 1s ease;transition:all 1s ease} +.loading .flex-viewport{max-height:300px} +.slider-container.loading .flex-container { opacity: 0; height: 0px; margin: 0;} +.loading:before { content: 'Loading Slider...'; display: block; margin: 15px 0 0 0; text-align: center; color: #444; font-weight: bold; font-size: 16px;} +.slider-container.loading .flexslider { display: none; } +.flexslider .slides{zoom:1;margin:0;} +.slidertitle{color:#fff;float:left;font-size:14px; font-weight:normal;padding:0;margin-bottom: 0;} +.sliderAuthor{float:left;margin-bottom:10px;} +.sliderAuthor span{color:#8a8a8a} +.carousel{ position:relative;margin-bottom:20px} +.carousel .slides{ margin:0} +.carouseltitle{ font-size:12px;color:#575757;font-weight:700} +.carousel li{margin-right:15px} +.carousel-thumbnail{ margin-bottom:8px;overflow:hidden} + +/* Direction Nav */ +.flex-direction-nav{*height:0;margin:0 !important;} +.flex-direction-nav a{width:52px;height:52px;padding:0;margin:-13px 0 0;display:block;position:absolute;top: 46%;cursor:pointer;text-indent:-9999px;opacity:0.3;-webkit-transition: opacity 0.5s linear; +-moz-transition: opacity 0.5s linear; +transition: opacity 0.5s linear;} +.flex-direction-nav .flex-prev{ background: url(theme/scroll_left.png) no-repeat; left: 0;} +.flex-direction-nav .flex-next{ background: url(theme/scroll_right.png) no-repeat; right: 0;} +.slider-container .flexslider .flex-direction-nav .flex-next{ } +.slider-container .flex-direction-nav .flex-prev{ } +.flexslider:hover .flex-next,.flexslider:hover .flex-prev{opacity:1} +.flex-direction-nav .flex-disabled{opacity:.8!important;filter:alpha(opacity=30);cursor:default} +.carousel .flex-direction-nav a{ top:0;right:0;margin:0;margin-top:-4px} +.carousel .flex-direction-nav .flex-next{ background:#f09a2b url(../images/next.png) no-repeat center center;right:0%} +.carousel .flex-direction-nav .flex-prev{ background:#f09a2b url(../images/prev.png) no-repeat center center;right:5.5%} +.carousel .flex-disabled{ background-color:#dedede} +.slider-thumbnail{ width:49%;float:left;margin:0 2% 0 0} +.flex-caption {padding: 2%; margin: 0; position: absolute; left: 20px; bottom: 20px; background: rgba(0,0,0,.3); color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,.3); font-size: 14px; line-height: 18px; margin-bottom:10px;} + +/* Control Nav */ +.flex-control-nav{ position:absolute; margin: 8px auto!important;width: 100%;padding: 0 5px;text-align: center;} +.flex-control-nav li{margin: 0 0 0 5px;zoom:1;*display:inline;display:inline-block} +.flex-control-nav li:first-child {margin: 0;} +.flex-control-paging li a{width:11px;height:11px;display:block;background: url(theme/normal.png) no-repeat;cursor:pointer;text-indent:-9999px;-webkit-border-radius:20px;-moz-border-radius:20px;-o-border-radius:20px;border-radius:20px;} +.flex-control-paging li a:hover{ background: #FFF;} +.flex-control-nav li a:hover {background:url(theme/active.png) no-repeat;} +.flex-control-paging li a.flex-active{ background:url(theme/active.png) no-repeat;cursor:default} +.flex-control-thumbs{margin:5px 0 0;position:static;overflow:hidden} +.flex-control-thumbs li{width:25%;margin:0} +.flex-control-thumbs img{width:100%;display:block;opacity:.7;cursor:pointer} +.flex-control-thumbs img:hover{opacity:1} +.flex-control-thumbs .flex-active{opacity:1;cursor:default} \ No newline at end of file diff --git a/css/font-awesome-ie7.min.css b/css/font-awesome-ie7.min.css new file mode 100644 index 0000000..d3dae63 --- /dev/null +++ b/css/font-awesome-ie7.min.css @@ -0,0 +1,384 @@ +.icon-large{font-size:1.3333333333333333em;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;vertical-align:middle;} +.nav [class^="icon-"],.nav [class*=" icon-"]{vertical-align:inherit;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;}.nav [class^="icon-"].icon-large,.nav [class*=" icon-"].icon-large{vertical-align:-25%;} +.nav-pills [class^="icon-"].icon-large,.nav-tabs [class^="icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large{line-height:.75em;margin-top:-7px;padding-top:5px;margin-bottom:-5px;padding-bottom:4px;} +.btn [class^="icon-"].pull-left,.btn [class*=" icon-"].pull-left,.btn [class^="icon-"].pull-right,.btn [class*=" icon-"].pull-right{vertical-align:inherit;} +.btn [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large{margin-top:-0.5em;} +a [class^="icon-"],a [class*=" icon-"]{cursor:pointer;} +.icon-glass{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-music{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-search{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-envelope-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-heart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-user{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-film{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-th-large{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-th{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-th-list{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ok{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-remove{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-zoom-in{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-zoom-out{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-power-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-signal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cog{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gear{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-trash{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-home{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-time{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-road{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-download-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-download{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-upload{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-inbox{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-play-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-repeat{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rotate-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-refresh{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-lock{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flag{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-headphones{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-volume-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-volume-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-volume-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-qrcode{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-barcode{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tag{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tags{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-book{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bookmark{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-print{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-camera{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-font{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bold{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-italic{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-text-height{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-text-width{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-center{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-align-justify{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-indent-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-indent-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-facetime-video{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-picture{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pencil{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-map-marker{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-adjust{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tint{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-edit{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-share{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-move{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-step-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fast-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-play{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pause{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-stop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fast-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-step-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eject{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-minus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-remove-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ok-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-question-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-info-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-screenshot{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-remove-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ok-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ban-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-share-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mail-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-full{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-small{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-minus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-asterisk{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-exclamation-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gift{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-leaf{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fire{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eye-open{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eye-close{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-warning-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plane{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-calendar{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-random{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comment{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-magnet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-retweet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-shopping-cart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-close{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-open{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-vertical{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-resize-horizontal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bar-chart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-twitter-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-facebook-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-camera-retro{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-key{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cogs{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gears{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comments{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-up-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-down-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-half{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-heart-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-signout{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-linkedin-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pushpin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-external-link{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-signin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-trophy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-github-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-upload-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-lemon{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-phone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unchecked{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bookmark-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-phone-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-twitter{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-facebook{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-github{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unlock{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-credit-card{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rss{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hdd{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bullhorn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bell{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-certificate{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hand-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-globe{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-wrench{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tasks{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-filter{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-briefcase{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fullscreen{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-group{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-link{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cloud{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-beaker{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cut{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-copy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-paper-clip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-paperclip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-save{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sign-blank{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-reorder{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list-ul{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-list-ol{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-strikethrough{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-underline{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-table{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-magic{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-truck{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pinterest{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-pinterest-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-google-plus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-google-plus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-money{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-caret-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-columns{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-envelope{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-linkedin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-undo{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rotate-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-legal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dashboard{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comment-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-comments-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bolt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sitemap{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-umbrella{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-paste{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-lightbulb{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-exchange{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cloud-download{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cloud-upload{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-user-md{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-stethoscope{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-suitcase{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bell-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-coffee{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-food{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file-text-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-building{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-hospital{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ambulance{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-medkit{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fighter-jet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-beer{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-h-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-plus-sign-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-double-angle-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-angle-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-desktop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-laptop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tablet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mobile-phone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle-blank{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-quote-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-quote-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-spinner{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-reply{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mail-reply{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-github-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-close-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-folder-open-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-expand-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-collapse-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-smile{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-frown{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-meh{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gamepad{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-keyboard{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flag-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flag-checkered{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-terminal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-code{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-mail-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-half-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-star-half-full{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-location-arrow{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-crop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-code-fork{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unlink{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-question{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-info{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-exclamation{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-superscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-subscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eraser{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-puzzle-piece{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-microphone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-microphone-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-shield{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-calendar-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-fire-extinguisher{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rocket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-maxcdn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-chevron-sign-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-html5{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-css3{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-anchor{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-unlock-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bullseye{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ellipsis-horizontal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ellipsis-vertical{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rss-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-play-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-ticket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-minus-sign-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check-minus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-level-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-level-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-check-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-edit-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-external-link-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-share-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-compass{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-collapse{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-collapse-top{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-expand{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-eur{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-euro{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gbp{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-usd{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dollar{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-inr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-rupee{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-jpy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-yen{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-cny{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-renminbi{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-krw{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-won{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-btc{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bitcoin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-file-text{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-alphabet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-alphabet-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-attributes{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-attributes-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-order{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sort-by-order-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-thumbs-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-youtube-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-youtube{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-xing{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-xing-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-youtube-play{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dropbox{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-stackexchange{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-instagram{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-flickr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-adn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bitbucket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bitbucket-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tumblr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-tumblr-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-long-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-apple{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-windows{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-android{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-linux{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-dribbble{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-skype{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-foursquare{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-trello{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-female{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-male{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-gittip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-sun{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-moon{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-archive{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-bug{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-vk{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-weibo{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} +.icon-renren{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');} diff --git a/css/font-awesome.min.css b/css/font-awesome.min.css new file mode 100644 index 0000000..866437f --- /dev/null +++ b/css/font-awesome.min.css @@ -0,0 +1,403 @@ +@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot?v=3.2.1');src:url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.2.1') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.2.1') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;} +[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;} +.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;} +a [class^="icon-"],a [class*=" icon-"]{display:inline;} +[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;} +.icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;} +.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;} +[class^="icon-"].hide,[class*=" icon-"].hide{display:none;} +.icon-muted{color:#eeeeee;} +.icon-light{color:#ffffff;} +.icon-dark{color:#333333;} +.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;} +.pull-right{float:right;} +.pull-left{float:left;} +[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;} +[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;} +[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;} +.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:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;} +.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;} +.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;} +.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;} +.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;} +.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;} +.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;} +.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;} +.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;} +.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;} +.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;} +.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;} +.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;} +.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;} +a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;} +@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);} +.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);} +.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);} +.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);} +.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);} +a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;} +.icon-glass:before{content:"\f000";} +.icon-music:before{content:"\f001";} +.icon-search:before{content:"\f002";} +.icon-envelope-alt:before{content:"\f003";} +.icon-heart:before{content:"\f004";} +.icon-star:before{content:"\f005";} +.icon-star-empty:before{content:"\f006";} +.icon-user:before{content:"\f007";} +.icon-film:before{content:"\f008";} +.icon-th-large:before{content:"\f009";} +.icon-th:before{content:"\f00a";} +.icon-th-list:before{content:"\f00b";} +.icon-ok:before{content:"\f00c";} +.icon-remove:before{content:"\f00d";} +.icon-zoom-in:before{content:"\f00e";} +.icon-zoom-out:before{content:"\f010";} +.icon-power-off:before,.icon-off:before{content:"\f011";} +.icon-signal:before{content:"\f012";} +.icon-gear:before,.icon-cog:before{content:"\f013";} +.icon-trash:before{content:"\f014";} +.icon-home:before{content:"\f015";} +.icon-file-alt:before{content:"\f016";} +.icon-time:before{content:"\f017";} +.icon-road:before{content:"\f018";} +.icon-download-alt:before{content:"\f019";} +.icon-download:before{content:"\f01a";} +.icon-upload:before{content:"\f01b";} +.icon-inbox:before{content:"\f01c";} +.icon-play-circle:before{content:"\f01d";} +.icon-rotate-right:before,.icon-repeat:before{content:"\f01e";} +.icon-refresh:before{content:"\f021";} +.icon-list-alt:before{content:"\f022";} +.icon-lock:before{content:"\f023";} +.icon-flag:before{content:"\f024";} +.icon-headphones:before{content:"\f025";} +.icon-volume-off:before{content:"\f026";} +.icon-volume-down:before{content:"\f027";} +.icon-volume-up:before{content:"\f028";} +.icon-qrcode:before{content:"\f029";} +.icon-barcode:before{content:"\f02a";} +.icon-tag:before{content:"\f02b";} +.icon-tags:before{content:"\f02c";} +.icon-book:before{content:"\f02d";} +.icon-bookmark:before{content:"\f02e";} +.icon-print:before{content:"\f02f";} +.icon-camera:before{content:"\f030";} +.icon-font:before{content:"\f031";} +.icon-bold:before{content:"\f032";} +.icon-italic:before{content:"\f033";} +.icon-text-height:before{content:"\f034";} +.icon-text-width:before{content:"\f035";} +.icon-align-left:before{content:"\f036";} +.icon-align-center:before{content:"\f037";} +.icon-align-right:before{content:"\f038";} +.icon-align-justify:before{content:"\f039";} +.icon-list:before{content:"\f03a";} +.icon-indent-left:before{content:"\f03b";} +.icon-indent-right:before{content:"\f03c";} +.icon-facetime-video:before{content:"\f03d";} +.icon-picture:before{content:"\f03e";} +.icon-pencil:before{content:"\f040";} +.icon-map-marker:before{content:"\f041";} +.icon-adjust:before{content:"\f042";} +.icon-tint:before{content:"\f043";} +.icon-edit:before{content:"\f044";} +.icon-share:before{content:"\f045";} +.icon-check:before{content:"\f046";} +.icon-move:before{content:"\f047";} +.icon-step-backward:before{content:"\f048";} +.icon-fast-backward:before{content:"\f049";} +.icon-backward:before{content:"\f04a";} +.icon-play:before{content:"\f04b";} +.icon-pause:before{content:"\f04c";} +.icon-stop:before{content:"\f04d";} +.icon-forward:before{content:"\f04e";} +.icon-fast-forward:before{content:"\f050";} +.icon-step-forward:before{content:"\f051";} +.icon-eject:before{content:"\f052";} +.icon-chevron-left:before{content:"\f053";} +.icon-chevron-right:before{content:"\f054";} +.icon-plus-sign:before{content:"\f055";} +.icon-minus-sign:before{content:"\f056";} +.icon-remove-sign:before{content:"\f057";} +.icon-ok-sign:before{content:"\f058";} +.icon-question-sign:before{content:"\f059";} +.icon-info-sign:before{content:"\f05a";} +.icon-screenshot:before{content:"\f05b";} +.icon-remove-circle:before{content:"\f05c";} +.icon-ok-circle:before{content:"\f05d";} +.icon-ban-circle:before{content:"\f05e";} +.icon-arrow-left:before{content:"\f060";} +.icon-arrow-right:before{content:"\f061";} +.icon-arrow-up:before{content:"\f062";} +.icon-arrow-down:before{content:"\f063";} +.icon-mail-forward:before,.icon-share-alt:before{content:"\f064";} +.icon-resize-full:before{content:"\f065";} +.icon-resize-small:before{content:"\f066";} +.icon-plus:before{content:"\f067";} +.icon-minus:before{content:"\f068";} +.icon-asterisk:before{content:"\f069";} +.icon-exclamation-sign:before{content:"\f06a";} +.icon-gift:before{content:"\f06b";} +.icon-leaf:before{content:"\f06c";} +.icon-fire:before{content:"\f06d";} +.icon-eye-open:before{content:"\f06e";} +.icon-eye-close:before{content:"\f070";} +.icon-warning-sign:before{content:"\f071";} +.icon-plane:before{content:"\f072";} +.icon-calendar:before{content:"\f073";} +.icon-random:before{content:"\f074";} +.icon-comment:before{content:"\f075";} +.icon-magnet:before{content:"\f076";} +.icon-chevron-up:before{content:"\f077";} +.icon-chevron-down:before{content:"\f078";} +.icon-retweet:before{content:"\f079";} +.icon-shopping-cart:before{content:"\f07a";} +.icon-folder-close:before{content:"\f07b";} +.icon-folder-open:before{content:"\f07c";} +.icon-resize-vertical:before{content:"\f07d";} +.icon-resize-horizontal:before{content:"\f07e";} +.icon-bar-chart:before{content:"\f080";} +.icon-twitter-sign:before{content:"\f081";} +.icon-facebook-sign:before{content:"\f082";} +.icon-camera-retro:before{content:"\f083";} +.icon-key:before{content:"\f084";} +.icon-gears:before,.icon-cogs:before{content:"\f085";} +.icon-comments:before{content:"\f086";} +.icon-thumbs-up-alt:before{content:"\f087";} +.icon-thumbs-down-alt:before{content:"\f088";} +.icon-star-half:before{content:"\f089";} +.icon-heart-empty:before{content:"\f08a";} +.icon-signout:before{content:"\f08b";} +.icon-linkedin-sign:before{content:"\f08c";} +.icon-pushpin:before{content:"\f08d";} +.icon-external-link:before{content:"\f08e";} +.icon-signin:before{content:"\f090";} +.icon-trophy:before{content:"\f091";} +.icon-github-sign:before{content:"\f092";} +.icon-upload-alt:before{content:"\f093";} +.icon-lemon:before{content:"\f094";} +.icon-phone:before{content:"\f095";} +.icon-unchecked:before,.icon-check-empty:before{content:"\f096";} +.icon-bookmark-empty:before{content:"\f097";} +.icon-phone-sign:before{content:"\f098";} +.icon-twitter:before{content:"\f099";} +.icon-facebook:before{content:"\f09a";} +.icon-github:before{content:"\f09b";} +.icon-unlock:before{content:"\f09c";} +.icon-credit-card:before{content:"\f09d";} +.icon-rss:before{content:"\f09e";} +.icon-hdd:before{content:"\f0a0";} +.icon-bullhorn:before{content:"\f0a1";} +.icon-bell:before{content:"\f0a2";} +.icon-certificate:before{content:"\f0a3";} +.icon-hand-right:before{content:"\f0a4";} +.icon-hand-left:before{content:"\f0a5";} +.icon-hand-up:before{content:"\f0a6";} +.icon-hand-down:before{content:"\f0a7";} +.icon-circle-arrow-left:before{content:"\f0a8";} +.icon-circle-arrow-right:before{content:"\f0a9";} +.icon-circle-arrow-up:before{content:"\f0aa";} +.icon-circle-arrow-down:before{content:"\f0ab";} +.icon-globe:before{content:"\f0ac";} +.icon-wrench:before{content:"\f0ad";} +.icon-tasks:before{content:"\f0ae";} +.icon-filter:before{content:"\f0b0";} +.icon-briefcase:before{content:"\f0b1";} +.icon-fullscreen:before{content:"\f0b2";} +.icon-group:before{content:"\f0c0";} +.icon-link:before{content:"\f0c1";} +.icon-cloud:before{content:"\f0c2";} +.icon-beaker:before{content:"\f0c3";} +.icon-cut:before{content:"\f0c4";} +.icon-copy:before{content:"\f0c5";} +.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";} +.icon-save:before{content:"\f0c7";} +.icon-sign-blank:before{content:"\f0c8";} +.icon-reorder:before{content:"\f0c9";} +.icon-list-ul:before{content:"\f0ca";} +.icon-list-ol:before{content:"\f0cb";} +.icon-strikethrough:before{content:"\f0cc";} +.icon-underline:before{content:"\f0cd";} +.icon-table:before{content:"\f0ce";} +.icon-magic:before{content:"\f0d0";} +.icon-truck:before{content:"\f0d1";} +.icon-pinterest:before{content:"\f0d2";} +.icon-pinterest-sign:before{content:"\f0d3";} +.icon-google-plus-sign:before{content:"\f0d4";} +.icon-google-plus:before{content:"\f0d5";} +.icon-money:before{content:"\f0d6";} +.icon-caret-down:before{content:"\f0d7";} +.icon-caret-up:before{content:"\f0d8";} +.icon-caret-left:before{content:"\f0d9";} +.icon-caret-right:before{content:"\f0da";} +.icon-columns:before{content:"\f0db";} +.icon-sort:before{content:"\f0dc";} +.icon-sort-down:before{content:"\f0dd";} +.icon-sort-up:before{content:"\f0de";} +.icon-envelope:before{content:"\f0e0";} +.icon-linkedin:before{content:"\f0e1";} +.icon-rotate-left:before,.icon-undo:before{content:"\f0e2";} +.icon-legal:before{content:"\f0e3";} +.icon-dashboard:before{content:"\f0e4";} +.icon-comment-alt:before{content:"\f0e5";} +.icon-comments-alt:before{content:"\f0e6";} +.icon-bolt:before{content:"\f0e7";} +.icon-sitemap:before{content:"\f0e8";} +.icon-umbrella:before{content:"\f0e9";} +.icon-paste:before{content:"\f0ea";} +.icon-lightbulb:before{content:"\f0eb";} +.icon-exchange:before{content:"\f0ec";} +.icon-cloud-download:before{content:"\f0ed";} +.icon-cloud-upload:before{content:"\f0ee";} +.icon-user-md:before{content:"\f0f0";} +.icon-stethoscope:before{content:"\f0f1";} +.icon-suitcase:before{content:"\f0f2";} +.icon-bell-alt:before{content:"\f0f3";} +.icon-coffee:before{content:"\f0f4";} +.icon-food:before{content:"\f0f5";} +.icon-file-text-alt:before{content:"\f0f6";} +.icon-building:before{content:"\f0f7";} +.icon-hospital:before{content:"\f0f8";} +.icon-ambulance:before{content:"\f0f9";} +.icon-medkit:before{content:"\f0fa";} +.icon-fighter-jet:before{content:"\f0fb";} +.icon-beer:before{content:"\f0fc";} +.icon-h-sign:before{content:"\f0fd";} +.icon-plus-sign-alt:before{content:"\f0fe";} +.icon-double-angle-left:before{content:"\f100";} +.icon-double-angle-right:before{content:"\f101";} +.icon-double-angle-up:before{content:"\f102";} +.icon-double-angle-down:before{content:"\f103";} +.icon-angle-left:before{content:"\f104";} +.icon-angle-right:before{content:"\f105";} +.icon-angle-up:before{content:"\f106";} +.icon-angle-down:before{content:"\f107";} +.icon-desktop:before{content:"\f108";} +.icon-laptop:before{content:"\f109";} +.icon-tablet:before{content:"\f10a";} +.icon-mobile-phone:before{content:"\f10b";} +.icon-circle-blank:before{content:"\f10c";} +.icon-quote-left:before{content:"\f10d";} +.icon-quote-right:before{content:"\f10e";} +.icon-spinner:before{content:"\f110";} +.icon-circle:before{content:"\f111";} +.icon-mail-reply:before,.icon-reply:before{content:"\f112";} +.icon-github-alt:before{content:"\f113";} +.icon-folder-close-alt:before{content:"\f114";} +.icon-folder-open-alt:before{content:"\f115";} +.icon-expand-alt:before{content:"\f116";} +.icon-collapse-alt:before{content:"\f117";} +.icon-smile:before{content:"\f118";} +.icon-frown:before{content:"\f119";} +.icon-meh:before{content:"\f11a";} +.icon-gamepad:before{content:"\f11b";} +.icon-keyboard:before{content:"\f11c";} +.icon-flag-alt:before{content:"\f11d";} +.icon-flag-checkered:before{content:"\f11e";} +.icon-terminal:before{content:"\f120";} +.icon-code:before{content:"\f121";} +.icon-reply-all:before{content:"\f122";} +.icon-mail-reply-all:before{content:"\f122";} +.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";} +.icon-location-arrow:before{content:"\f124";} +.icon-crop:before{content:"\f125";} +.icon-code-fork:before{content:"\f126";} +.icon-unlink:before{content:"\f127";} +.icon-question:before{content:"\f128";} +.icon-info:before{content:"\f129";} +.icon-exclamation:before{content:"\f12a";} +.icon-superscript:before{content:"\f12b";} +.icon-subscript:before{content:"\f12c";} +.icon-eraser:before{content:"\f12d";} +.icon-puzzle-piece:before{content:"\f12e";} +.icon-microphone:before{content:"\f130";} +.icon-microphone-off:before{content:"\f131";} +.icon-shield:before{content:"\f132";} +.icon-calendar-empty:before{content:"\f133";} +.icon-fire-extinguisher:before{content:"\f134";} +.icon-rocket:before{content:"\f135";} +.icon-maxcdn:before{content:"\f136";} +.icon-chevron-sign-left:before{content:"\f137";} +.icon-chevron-sign-right:before{content:"\f138";} +.icon-chevron-sign-up:before{content:"\f139";} +.icon-chevron-sign-down:before{content:"\f13a";} +.icon-html5:before{content:"\f13b";} +.icon-css3:before{content:"\f13c";} +.icon-anchor:before{content:"\f13d";} +.icon-unlock-alt:before{content:"\f13e";} +.icon-bullseye:before{content:"\f140";} +.icon-ellipsis-horizontal:before{content:"\f141";} +.icon-ellipsis-vertical:before{content:"\f142";} +.icon-rss-sign:before{content:"\f143";} +.icon-play-sign:before{content:"\f144";} +.icon-ticket:before{content:"\f145";} +.icon-minus-sign-alt:before{content:"\f146";} +.icon-check-minus:before{content:"\f147";} +.icon-level-up:before{content:"\f148";} +.icon-level-down:before{content:"\f149";} +.icon-check-sign:before{content:"\f14a";} +.icon-edit-sign:before{content:"\f14b";} +.icon-external-link-sign:before{content:"\f14c";} +.icon-share-sign:before{content:"\f14d";} +.icon-compass:before{content:"\f14e";} +.icon-collapse:before{content:"\f150";} +.icon-collapse-top:before{content:"\f151";} +.icon-expand:before{content:"\f152";} +.icon-euro:before,.icon-eur:before{content:"\f153";} +.icon-gbp:before{content:"\f154";} +.icon-dollar:before,.icon-usd:before{content:"\f155";} +.icon-rupee:before,.icon-inr:before{content:"\f156";} +.icon-yen:before,.icon-jpy:before{content:"\f157";} +.icon-renminbi:before,.icon-cny:before{content:"\f158";} +.icon-won:before,.icon-krw:before{content:"\f159";} +.icon-bitcoin:before,.icon-btc:before{content:"\f15a";} +.icon-file:before{content:"\f15b";} +.icon-file-text:before{content:"\f15c";} +.icon-sort-by-alphabet:before{content:"\f15d";} +.icon-sort-by-alphabet-alt:before{content:"\f15e";} +.icon-sort-by-attributes:before{content:"\f160";} +.icon-sort-by-attributes-alt:before{content:"\f161";} +.icon-sort-by-order:before{content:"\f162";} +.icon-sort-by-order-alt:before{content:"\f163";} +.icon-thumbs-up:before{content:"\f164";} +.icon-thumbs-down:before{content:"\f165";} +.icon-youtube-sign:before{content:"\f166";} +.icon-youtube:before{content:"\f167";} +.icon-xing:before{content:"\f168";} +.icon-xing-sign:before{content:"\f169";} +.icon-youtube-play:before{content:"\f16a";} +.icon-dropbox:before{content:"\f16b";} +.icon-stackexchange:before{content:"\f16c";} +.icon-instagram:before{content:"\f16d";} +.icon-flickr:before{content:"\f16e";} +.icon-adn:before{content:"\f170";} +.icon-bitbucket:before{content:"\f171";} +.icon-bitbucket-sign:before{content:"\f172";} +.icon-tumblr:before{content:"\f173";} +.icon-tumblr-sign:before{content:"\f174";} +.icon-long-arrow-down:before{content:"\f175";} +.icon-long-arrow-up:before{content:"\f176";} +.icon-long-arrow-left:before{content:"\f177";} +.icon-long-arrow-right:before{content:"\f178";} +.icon-apple:before{content:"\f179";} +.icon-windows:before{content:"\f17a";} +.icon-android:before{content:"\f17b";} +.icon-linux:before{content:"\f17c";} +.icon-dribbble:before{content:"\f17d";} +.icon-skype:before{content:"\f17e";} +.icon-foursquare:before{content:"\f180";} +.icon-trello:before{content:"\f181";} +.icon-female:before{content:"\f182";} +.icon-male:before{content:"\f183";} +.icon-gittip:before{content:"\f184";} +.icon-sun:before{content:"\f185";} +.icon-moon:before{content:"\f186";} +.icon-archive:before{content:"\f187";} +.icon-bug:before{content:"\f188";} +.icon-vk:before{content:"\f189";} +.icon-weibo:before{content:"\f18a";} +.icon-renren:before{content:"\f18b";} diff --git a/css/images/mtsWordpress.png b/css/images/mtsWordpress.png new file mode 100644 index 0000000..ab21859 Binary files /dev/null and b/css/images/mtsWordpress.png differ diff --git a/css/images/mtscomments.png b/css/images/mtscomments.png new file mode 100644 index 0000000..a11f2f4 Binary files /dev/null and b/css/images/mtscomments.png differ diff --git a/css/images/mtsloop.png b/css/images/mtsloop.png new file mode 100644 index 0000000..6a5a933 Binary files /dev/null and b/css/images/mtsloop.png differ diff --git a/css/images/mtsplus.png b/css/images/mtsplus.png new file mode 100644 index 0000000..5e4b1ee Binary files /dev/null and b/css/images/mtsplus.png differ diff --git a/css/images/nav-icon.png b/css/images/nav-icon.png new file mode 100644 index 0000000..618d153 Binary files /dev/null and b/css/images/nav-icon.png differ diff --git a/css/images/sale.png b/css/images/sale.png new file mode 100644 index 0000000..3e15a43 Binary files /dev/null and b/css/images/sale.png differ diff --git a/css/images/single-sale.png b/css/images/single-sale.png new file mode 100644 index 0000000..62a7b85 Binary files /dev/null and b/css/images/single-sale.png differ diff --git a/css/prettyPhoto.css b/css/prettyPhoto.css new file mode 100644 index 0000000..659b7d3 --- /dev/null +++ b/css/prettyPhoto.css @@ -0,0 +1,160 @@ +div.pp_default .pp_top,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_right,div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right{height: 2px;} +div.pp_default .pp_content .ppt{color:#f8f8f8} +div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer} +div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer} +div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;width:28px;height:28px} +div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer} +div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;width:28px;height:28px} +div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer} +div.pp_default .pp_close{width:30px;height:30px;background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer;position: absolute;top: 0;right: -14px;top: -14px;} +div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa} +div.pp_default .pp_social{margin-top:7px} +div.pp_default .pp_gallery a.pp_arrow_previous,div.pp_default .pp_gallery a.pp_arrow_next{position:static;left:auto} +div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px} +div.pp_default .pp_nav .pp_pause{background-position:-51px -29px} +div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;width:20px;margin:4px 0 0} +div.pp_default a.pp_arrow_next{left:52px;background-position:-82px -3px} +div.pp_default .pp_content_container .pp_details{margin-top:5px;position: initial;} +div.pp_default .pp_nav{clear:none;height:30px;width:110px;} +div.pp_default .pp_nav .currentTextHolder{font-family:Georgia;font-style:italic;color:#999;font-size:11px;left:75px;line-height:25px;position:absolute;top:2px;margin:0;padding:0 0 0 10px} +div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_play:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover{opacity:0.7} +div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0} +div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat} +div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat} +div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat} +div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer} +div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer} +div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer} +div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer} +div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer} +div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer} +div.light_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer} +div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px} +div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px} +div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat} +div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat} +div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat} +div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat} +div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat} +div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat} +div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y} +div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y} +div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer} +div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer} +div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer} +div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer} +div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer} +div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer} +div.dark_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer} +div.dark_rounded .pp_description{margin-right:85px;color:#fff} +div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px} +div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px} +div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat} +div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat} +div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat} +div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat} +div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat} +div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right,div.dark_square .pp_content{background:#000} +div.dark_square .pp_description{color:#fff;margin:0 85px 0 0} +div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat} +div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer} +div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer} +div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer} +div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer} +div.dark_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer} +div.dark_square .pp_nav{clear:none} +div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px} +div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px} +div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat} +div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat} +div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer} +div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer} +div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer} +div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer} +div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer} +div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer} +div.light_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer} +div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px} +div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px} +div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat} +div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat} +div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer} +div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer} +div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat} +div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x} +div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat} +div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y} +div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y} +div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer} +div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer} +div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer} +div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer} +div.facebook .pp_close{width:22px;height:22px;background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer} +div.facebook .pp_description{margin:0 37px 0 0} +div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat} +div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px} +div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default} +div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px} +div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default} +div.facebook .pp_nav{margin-top:0} +div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px} +div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px} +div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px} +div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer} +div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer} +div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat} +div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x} +div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat} +div.pp_pic_holder a:focus{outline:none} +div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500} +div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000} +.pp_content{height:40px;min-width:40px} +* html .pp_content{width:40px} +.pp_content_container{position:relative;text-align:left;width:100%} +.pp_content_container .pp_details{float:left;margin:10px 0 2px} +.pp_description{display:none;margin:0} +.pp_social{float:left;margin:0} +.pp_social .facebook{float:left;margin-left:5px;width:55px;overflow:hidden} +.pp_social .twitter{float:left} +.pp_nav{clear:right;float:left;margin:3px 10px 0 0} +.pp_nav p{float:left;white-space:nowrap;margin:2px 4px} +.pp_nav .pp_play,.pp_nav .pp_pause{float:left;margin-right:4px;text-indent:-10000px} +a.pp_arrow_previous,a.pp_arrow_next{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px} +.pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000} +.pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000} +.pp_gallery div{float:left;overflow:hidden;position:relative} +.pp_gallery ul{float:left;height:35px;position:relative;white-space:nowrap;margin:0 0 0 5px;padding:0} +.pp_gallery ul a{border:1px rgba(0,0,0,0.5) solid;display:block;float:left;height:33px;overflow:hidden} +.pp_gallery ul a img{border:0} +.pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0} +.pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;display:block;height:33px;width:50px} +.pp_gallery .pp_arrow_previous,.pp_gallery .pp_arrow_next{margin-top:7px!important} +a.pp_next{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:right;height:100%;text-indent:-10000px;width:49%} +a.pp_previous{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:left;height:100%;text-indent:-10000px;width:49%} +a.pp_expand,a.pp_contract{cursor:pointer;display:none;height:20px;position:absolute;left: 10px;text-indent:-10000px;top:10px;width:20px;z-index:20000} +a.pp_close{position:absolute;right:0;top:0;display:block;line-height:22px;text-indent:-10000px} +.pp_loaderIcon{display:block;height:24px;left:50%;position:absolute;top:50%;width:24px;margin:-12px 0 0 -12px} +#pp_full_res{line-height:1!important;} +#pp_full_res .pp_inline{text-align:left} +#pp_full_res .pp_inline p{margin:0 0 15px} +div.ppt{color:#fff;display:none;font-size:17px;z-index:9999;margin: 0;} +div.pp_default .pp_content,div.light_rounded .pp_content{} +div.pp_default #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.facebook #pp_full_res .pp_inline{color:#000} +div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a,.pp_gallery ul a:hover,.pp_gallery li.selected a{border-color:#fff} +div.pp_default .pp_details,div.light_rounded .pp_details,div.dark_rounded .pp_details,div.dark_square .pp_details,div.light_square .pp_details,div.facebook .pp_details{position:relative} +div.light_rounded .pp_top .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_bottom .pp_middle,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right,div.light_square .pp_content,div.facebook .pp_content{background:#fff} +div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px} +div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next{margin-top:12px!important} +div.light_rounded .pp_arrow_previous.disabled,div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default} +div.light_rounded .pp_arrow_next.disabled,div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default} +div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat} +div.dark_rounded .pp_top .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_bottom .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat} +div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4} +div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff} +.pp_top,.pp_bottom{height:20px;position:relative} +* html .pp_top,* html .pp_bottom{padding:0 20px} +.pp_top .pp_left,.pp_bottom .pp_left{height:20px;left:0;position:absolute;width:20px} +.pp_top .pp_middle,.pp_bottom .pp_middle{height:20px;left:20px;position:absolute;right:20px} +* html .pp_top .pp_middle,* html .pp_bottom .pp_middle{left:0;position:static} +.pp_top .pp_right,.pp_bottom .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px} +.pp_fade,.pp_gallery li.default a img{display:none;position: relative;} \ No newline at end of file diff --git a/css/responsive.css b/css/responsive.css new file mode 100644 index 0000000..6b02bcb --- /dev/null +++ b/css/responsive.css @@ -0,0 +1,301 @@ +/*----------------------------------------------- +/* Responsive +/*---------------------------------------------*/ +@media screen and (max-width:1420px) { + .shareit { + position: relative; + width: 100%; + top: 0; + padding-left: 0; + padding-right: 0; + margin: 0; + padding-top: 0; + border: none; + } +} +@media screen and (max-width:1200px) { + #header { + padding: 0 2.5%; + width: 95%; + } + #page, .footer-widgets { width: 95% } + #sidebars img, #footer img, #content img { height: auto } + #commentform textarea { width: 90%!important } +} +@media screen and (max-width:1024px) { + .article { + padding-left: 2%; + width: 62%; + padding-right: 2%; + } + .single_post, .single_page, .related-posts, .postauthor, #commentsAdd, .latestPost, .flexslider, #comments { + margin-right: 0; + margin-left: 0; + width: 100%; + padding-left: 0; + } + #sidebar-left { display: none } + .threecolumns .sidebar.c-4-12 { width: 30%; } +} +@media screen and (max-width:1000px) { + #move-to-top { + margin-right: 0; + right: 5px; + } +} +@media screen and (max-width:960px) { + .main-navigation { left: 0 } + img { + max-width: 100%; + height: auto!important; + } + .ad-300 img { max-width: 100% } + .ad-125 li { max-width: 40% } + .ad-125 img { + padding: 0; + background: #FAFAFA; + border: 0; + } +} +@media screen and (max-width:900px) { + .widget-header { max-width: 70% } + .main-navigation a { padding: 8px 14px } +} +@media screen and (max-width:865px) { + .main-header { position: relative ; min-height: 42px;} + #page, .container { max-width: 95% } + footer .container { + padding: 0 3%; + max-width: 94%; + } + .footer-widgets { + padding-right: 0; + padding-left: 0; + width: 100%; + } + .mts-cart { + text-align: center!important; + width: 44%; + margin-bottom: 5px; + } + .main-navigation, #navigation { + border: none !important; + background: #283744; + position: absolute; + width: 100%; + } + .main-navigation { + width: 100%; + margin-bottom: 20px; + position: relative!important; + } + #navigation .menu a, #navigation .menu [class^="icon-"] > a, #navigation .menu [class*=" icon-"] > a { + color: #fff!important; + padding-left: 0!important; + padding-right: 0!important; + } + #navigation .menu { + float: none; + background: transparent; + } + #navigation ul ul { + display: block!important; + visibility: visible!important; + opacity: 1!important; + position: relative; + left: 0!important; + border: 0; + top: 0; + width: 100%; + } + #navigation ul li li { + background: transparent; + border: 0; + } + nav { height: auto } + nav ul { + width: 100%; + display: none; + height: auto; + } + #navigation li, #navigation ul li li { + width: 100%!important; + float: left; + position: relative; + } + #navigation ul li:after { background: transparent } + #navigation ul li:before { display: none } + #navigation li a { + border-bottom: 1px solid #576979!important; + width: 100%!important; + } + #navigation a { + text-align: left; + width: 100%; + text-indent: 25px; + } + nav a#pull { + display: block; + background-color: #283744; + color: #fff; + padding: 10px; + text-indent: -999em; + width: 30px; + height: 20px; + text-align: center; + position: absolute; + top: 0; + left: auto; + right: -6%; + } + nav a#pull:after { + content: ""; + background: url('images/nav-icon.png') no-repeat; + width: 21px; + height: 30px; + display: inline-block; + position: absolute; + right: 15px; + top: 10px; + } + .secondary-navigation #navigation ul .sfHover a, .secondary-navigation #navigation ul li:hover, .secondary-navigation #navigation ul .sfHover ul li { background: transparent } +} +@media screen and (max-width:768px) { + .article { width: 96% } + .latestPost .title { font-size: 34px } + .sidebar.c-4-12 { + width: 96.4%; + max-width: 300px; + float: none; + margin: 0 auto; + } +} +@media screen and (max-width:728px) { + #header h1, #header h2, .site-description { + float: none; + text-align: center; + width: 100%; + max-width: 100%; + padding: 0; + } + #header h1, #header h2 { font-size: 40px ; margin: 0; height: 100%;} + .site-description { margin-top: 0 } + #logo a, #logo img { + float: none; + letter-spacing: 0; + + padding: 0; + line-height: 1; +} + .logo-wrap { + margin-bottom: 0; + margin-top: 0; + width: 100%; + } + .mts-cart { width: 100% } + .latestPost .title { font-size: 30px } +} +@media screen and (max-width:720px) { + .secondary-navigation a { + padding-top: 10px!important; + padding-bottom: 10px!important; + } + .article { + width: 94%; + border: 0; + + padding-right: 3%; + padding-left: 3%; +} + .single_post, .single_page, .related-posts, .postauthor, #comments, #commentsAdd { + padding-right: 0; + width: 100%; + margin-right: 0; + } + .latestPost .title, .single-title, .single_page h1 { + font-size: 24px; + line-height: 1.4; + } + .sidebar.c-4-12 { + float: left; + width: 92% !important; + padding-left: 0; + padding-right: 0; + margin-left: 3.8%; + } + .flexslider { margin-left: 0 } + .f-widget { width: 49% } + .f-widget-2 { margin-right: 0 } + .f-widget-3 { clear: left } + .ad-125 li { max-width: 45% } + #comments { margin-right: 0 } + .widget-header .textwidget { + margin-top: 0; + padding-left: 0; + border-left: none; + } +} +@media screen and (max-width:600px) { + .featured-thumbnail img { width: 100% } +} +@media screen and (max-width:550px) { + .latestPost .title { + font-size: 200%; + line-height: 34px; + } + .sbutton { float: right } + .f-widget { + width: 100%; + margin-right: 0; + } +} +@media screen and (max-width:480px) { + nav { border-bottom: 0 } + #navigation { + margin-top: 0; + margin-bottom: 0; + } + .secondary-navigation { + width: 102%; + height: 35px; + } + .related-posts li { + width: 100%; + float: left!important; + max-width: 100%; + } + .related-posts li img { margin-right: 10px; } + .related-posts .relatepostli4 { + padding-bottom: 15px; + border-bottom: 1px solid #CCC; + margin-bottom: 11px; + } + .one_half, .one_third, .two_third, .three_fourth, .one_fourth, .one_fifth, .two_fifth, .three_fifth, .four_fifth, .one_sixth, .five_sixth { + width: 100%; + margin-right: 0; + } + .copyrights { text-align: center } + .top { width: 100% } +} +@media screen and (max-width:400px) { + article header { overflow: hidden } + .post-info .thecategory { clear: left; } + .slidertext { display: none } + #commentform textarea { width: 96% } + .flex-caption { display: none } + #cancel-comment-reply-link { margin-bottom: 0; float: left;} +} +@media screen and (max-width:320px) { + .latestPost { float: none } + .latest-cat-post #featured-thumbnail { + width: 100%; + max-width: 100%; + } + .latest-cat-post #featured-thumbnail .featured-thumbnail { float: none } + #navigation li { + display: block; + float: none; + width: 100%; + } + #navigation li a { border-bottom: 1px solid #576979 } +} \ No newline at end of file diff --git a/css/theme/active.png b/css/theme/active.png new file mode 100644 index 0000000..4dad3bc Binary files /dev/null and b/css/theme/active.png differ diff --git a/css/theme/normal.png b/css/theme/normal.png new file mode 100644 index 0000000..b941392 Binary files /dev/null and b/css/theme/normal.png differ diff --git a/css/theme/scroll_left.png b/css/theme/scroll_left.png new file mode 100644 index 0000000..467f288 Binary files /dev/null and b/css/theme/scroll_left.png differ diff --git a/css/theme/scroll_right.png b/css/theme/scroll_right.png new file mode 100644 index 0000000..3a544ec Binary files /dev/null and b/css/theme/scroll_right.png differ diff --git a/css/woocommerce2.css b/css/woocommerce2.css new file mode 100644 index 0000000..d8c65fa --- /dev/null +++ b/css/woocommerce2.css @@ -0,0 +1,288 @@ +/*-------------------------------------- +WooCommerce Custom CSS template for +MyThemeShop.com Themes. +---------------------------*/ +.woocommerce .woocommerce-ordering, .woocommerce-page .woocommerce-ordering { + margin-top: -2px; + margin-bottom: 20px; +} +.woocommerce .products ul, .woocommerce-page .products ul, .woocommerce ul.products, .woocommerce-page ul.products { + padding-top: 25px; + border-top: 1px solid #eee; +} +.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { width: 30.8% } +.woocommerce a.button, .woocommerce-page a.button, .woocommerce button.button, .woocommerce-page button.button, .woocommerce input.button, .woocommerce-page input.button, .woocommerce #respond input#submit, .woocommerce-page #respond input#submit, .woocommerce #content input.button, .woocommerce-page #content input.button { + background-color: #41b7d8; + color: #fff; + text-shadow: none; + font-weight: normal; + border: 0; + line-height: 1.3; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + -webkit-transition: all 0.25s linear; + -moz-transition: all 0.25s linear; + transition: all 0.25s linear; +} +.woocommerce a.button:hover, .woocommerce-page a.button:hover, .woocommerce button.button:hover, .woocommerce-page button.button:hover, .woocommerce input.button:hover, .woocommerce-page input.button:hover, .woocommerce #respond input#submit:hover, .woocommerce-page #respond input#submit:hover, .woocommerce #content input.button:hover, .woocommerce-page #content input.button:hover { + background: #333; + color: #fff; +} +.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { text-align: center } +.woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3 { + font-size: 18px; + font-weight: normal; +} +.woocommerce ul.products li.product .price del, .woocommerce-page ul.products li.product .price del { font-size: 18px } +.woocommerce ul.products li.product .price ins, .woocommerce-page ul.products li.product .price ins { font-size: 18px } +.woocommerce-main-image.zoom img { margin-bottom: 12px } +.woocommerce ul.products li.product a img, .woocommerce-page ul.products li.product a img, .woocommerce ul.products li.product a:hover img, .woocommerce-page ul.products li.product a:hover img, .woocommerce div.product div.images img, .woocommerce-page div.product div.images img, .woocommerce #content div.product div.images img, .woocommerce-page #content div.product div.images img { + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -o-border-radius: 3px; + -ms-border-radius: 3px; + -khtml-border-radius: 3px; + border-radius: 3px; +} +.woocommerce ul.cart_list li img, .woocommerce-page ul.cart_list li img, .woocommerce ul.product_list_widget li img, .woocommerce-page ul.product_list_widget li img { + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + width: 50px; + float: left; +} +.woocommerce .related ul.products, .woocommerce-page .related ul.products, .woocommerce .upsells.products ul.products, .woocommerce-page .upsells.products ul.products, .woocommerce .related ul, .woocommerce-page .related ul, .woocommerce .upsells.products ul, .woocommerce-page .upsells.products ul { + margin-bottom: 0; + border-top: 1px solid #ebe0d8; + width: 96.6%; +} +.woocommerce .related ul.products li.product, .woocommerce-page .related ul.products li.product, .woocommerce .upsells.products ul.products li.product, .woocommerce-page .upsells.products ul.products li.product, .woocommerce .related ul li.product, .woocommerce-page .related ul li.product, .woocommerce .upsells.products ul li.product, .woocommerce-page .upsells.products ul li.product { + width: 30%; + clear: none; + margin-right: 4.7%; + margin-bottom: 0; + border-bottom: 0; + padding-bottom: 15px; +} +.woocommerce .related ul.products li.product:last-child, .woocommerce-page .related ul.products li.product:last-child, .woocommerce .upsells.products ul.products li.product:last-child, .woocommerce-page .upsells.products ul.products li.product:last-child, .woocommerce .related ul li.product:last-child, .woocommerce-page .related ul li.product:last-child, .woocommerce .upsells.products ul li.product:last-child, .woocommerce-page .upsells.products ul li.product:last-child { margin-right: 0 } +.woocommerce div.product form.cart .button, .woocommerce-page div.product form.cart .button, .woocommerce #content div.product form.cart .button, .woocommerce-page #content div.product form.cart .button { line-height: 1.3 } +.woocommerce form .form-row select, .woocommerce-page form .form-row select, .woocommerce form .form-row input.input-text, .woocommerce-page form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce-page form .form-row textarea { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.woocommerce table.cart input, .woocommerce-page table.cart input, .woocommerce #content table.cart input, .woocommerce-page #content table.cart input { line-height: 1.3 } +.mts-cart > span:first-child { margin-right: 10px } +#coupon_code { padding: 6px 10px } +.checkout_coupon .form-row.form-row-first { margin-bottom: 0 } +.woocommerce div.product div.images div.thumbnails a, .woocommerce-page div.product div.images div.thumbnails a, .woocommerce #content div.product div.images div.thumbnails a, .woocommerce-page #content div.product div.images div.thumbnails a { + width: 22.75%; + margin-right: 3%; +} +.woocommerce .star-rating, .woocommerce-page .star-rating { + margin-top: 12px; + margin-right: 0; + margin-bottom: 30px; +} +.comment-text .star-rating { + margin-top: 0; + margin-right: 0; +} +.product_list_widget .amount { + color: #85AD74; + font-weight: normal; + font-size: 16px; +} +.product_list_widget del .amount { + font-size: 13px; + color: rgba(145, 145, 145, 0.5); + font-weight: normal; +} +.woocommerce ul.cart_list li .star-rating, .woocommerce-page ul.cart_list li .star-rating, .woocommerce ul.product_list_widget li .star-rating, .woocommerce-page ul.product_list_widget li .star-rating { + float: right; + margin-top: 2px; + font-weight: normal; + margin-right: 0; +} +.star-rating { color: #f37324 } +.woocommerce .widget_layered_nav ul li, .woocommerce-page .widget_layered_nav ul li { margin-left: 0 } +.woocommerce .widget_layered_nav ul small.count, .woocommerce-page .widget_layered_nav ul small.count { + font-weight: normal; + background: #222; + color: #fff; + padding: 0; + width: 29px; + text-align: center; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.woocommerce .products .star-rating, .woocommerce-page .products .star-rating { margin: 0 auto .5em } +.woocommerce ul.products li.product .onsale, .woocommerce-page ul.products li.product .onsale, .woocommerce span.onsale, .woocommerce-page span.onsale { + background-image: url(images/sale.png); + background-repeat: no-repeat; + right: 0; + top: 0; + position: absolute; + z-index: 1; + width: 50px; + height: 50px; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + text-indent: -999em; + padding: 0; + margin-top: 0; + margin-right: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.woocommerce span.onsale, .woocommerce-page span.onsale { + background-image: url(images/single-sale.png); + left: 0; + top: 0; +} +.post-type-archive-product .page-title, .post-type-archive-product .woocommerce-breadcrumb { display: none } +.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { + padding-bottom: 25px; + margin-bottom: 26px; +} +.woocommerce ul.products li.product:last-child, .woocommerce-page ul.products li.product:last-child, .woocommerce ul.products li.product:nth-last-child(2), .woocommerce-page ul.products li.product:last-child:nth-last-child(2), .woocommerce ul.products li.product:nth-last-child(3), .woocommerce-page ul.products li.product:nth-last-child(3) { margin-bottom: 0 } +.woocommerce-pagination { + margin-bottom: 15px; + width: 100%; + float: left; +} +.mts-cart { + left: 0px; + top: 5px; + z-index: 1; + float: right; + margin-top: 10px; +} +.mts-cart a { color: #494949 } +.article .woocommerce-error { + margin-top: 0; + margin-left: 0; +} +.woocommerce #reviews #comments ol.commentlist li, .woocommerce-page #reviews #comments ol.commentlist li { + width: 100%!important; + border: 0; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + margin-left: 0; + padding: 0!important; +} +.woocommerce #reviews #comments ol.commentlist li img.avatar, .woocommerce-page #reviews #comments ol.commentlist li img.avatar { + padding: 0; + border: 0; + margin-top: 5px; + width: 10%; +} +.woocommerce #reviews #comments ol.commentlist li .comment-text, .woocommerce-page #reviews #comments ol.commentlist li .comment-text { + padding: 10px 0; + width: 87%; + float: right; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + border: 0; + padding-top: 0; +} +.add_review { float: left } +.woocommerce #comments { + padding-top: 0; + margin-top: 0; + border-top: 0; + margin-right: 0; + width: 100%; +} +.widget.woocommerce .buttons { margin-bottom: 0 } +.woocommerce nav.woocommerce-pagination ul li span.current, .woocommerce-page nav.woocommerce-pagination ul li span.current, .woocommerce #content nav.woocommerce-pagination ul li span.current, .woocommerce-page #content nav.woocommerce-pagination ul li span.current, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce-page nav.woocommerce-pagination ul li a:hover, .woocommerce #content nav.woocommerce-pagination ul li a:hover, .woocommerce-page #content nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce-page nav.woocommerce-pagination ul li a:focus, .woocommerce #content nav.woocommerce-pagination ul li a:focus, .woocommerce-page #content nav.woocommerce-pagination ul li a:focus { + background: #41b7d8; + color: #fff; + border: 0; + padding: 9px 9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.woocommerce nav.woocommerce-pagination ul li, .woocommerce-page nav.woocommerce-pagination ul li, .woocommerce #content nav.woocommerce-pagination ul li, .woocommerce-page #content nav.woocommerce-pagination ul li { + border: 0; + margin-right: 10px; + background: #F5F5F5; + margin-bottom: 10px; + width: auto; +} +.woocommerce nav.woocommerce-pagination ul, .woocommerce-page nav.woocommerce-pagination ul, .woocommerce #content nav.woocommerce-pagination ul, .woocommerce-page #content nav.woocommerce-pagination ul { + border: 0; + display: block; + float: right; + margin: 0; +} +.woocommerce div.product .product_title, .woocommerce-page div.product .product_title, .woocommerce #content div.product .product_title, .woocommerce-page #content div.product .product_title { + font-size: 32px; + line-height: 1; +} +.woocommerce nav.woocommerce-pagination ul li a, .woocommerce-page nav.woocommerce-pagination ul li a, .woocommerce #content nav.woocommerce-pagination ul li a, .woocommerce-page #content nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span, .woocommerce-page nav.woocommerce-pagination ul li span, .woocommerce #content nav.woocommerce-pagination ul li span, .woocommerce-page #content nav.woocommerce-pagination ul li span { + background: #fff; + padding: 9px; + color: #41b7d8; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-transition: background 0.25s linear; + -moz-transition: background 0.25s linear; + transition: background 0.25s linear; +} +.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta, .woocommerce-page #reviews #comments ol.commentlist li .comment-text p.meta { + font-size: 14px; + margin-bottom: 0; +} +.woocommerce div.product div.summary, .woocommerce-page div.product div.summary, .woocommerce #content div.product div.summary, .woocommerce-page #content div.product div.summary { + width: 46%; + padding-right: 2%; +} +.woocommerce div.product .woocommerce-tabs .panel, .woocommerce-page div.product .woocommerce-tabs .panel, .woocommerce #content div.product .woocommerce-tabs .panel, .woocommerce-page #content div.product .woocommerce-tabs .panel { padding-right: 0 } +.woocommerce #content { padding-top: 30px } +.woocommerce div.product .woocommerce-tabs, .woocommerce-page div.product .woocommerce-tabs, .woocommerce #content div.product .woocommerce-tabs, .woocommerce-page #content div.product .woocommerce-tabs { width: 96.6% } +.related.products { margin-bottom: 30px } +.screen-reader-text { display: none } +#searchsubmit { display: none } +.woocommerce ul.cart_list li a, .woocommerce-page ul.cart_list li a, .woocommerce ul.product_list_widget li a, .woocommerce-page ul.product_list_widget li a { font-weight: normal } +.woocommerce .woocommerce-ordering select, .woocommerce-page .woocommerce-ordering select { padding: 3px } +@media screen and (max-width:1024px) { + .woocommerce #content { margin-left: 0!important } +} +@media screen and (max-width:885px) { + .woocommerce div.product div.summary, .woocommerce-page div.product div.summary, .woocommerce #content div.product div.summary, .woocommerce-page #content div.product div.summary { + padding-right: 0; + width: 49%; + } + .woocommerce div.product .woocommerce-tabs, .woocommerce-page div.product .woocommerce-tabs, .woocommerce #content div.product .woocommerce-tabs, .woocommerce-page #content div.product .woocommerce-tabs, .woocommerce .related ul.products, .woocommerce-page .related ul.products { + padding-right: 0; + margin-right: 0; + width: 100%; + } + .woocommerce div.product .woocommerce-tabs .panel, .woocommerce-page div.product .woocommerce-tabs .panel, .woocommerce #content div.product .woocommerce-tabs .panel, .woocommerce-page #content div.product .woocommerce-tabs .panel, .woocommerce #comments { + padding-right: 0; + margin-right: 0; + width: 99%; + } +} +@media screen and (max-width:768px) { + .woocommerce .products ul, .woocommerce-page .products ul, .woocommerce ul.products, .woocommerce-page ul.products { + margin-right: 0; + margin-left: 0; + } +} +@media screen and (max-width:480px) { + .woocommerce div.product div.images, .woocommerce-page div.product div.images, .woocommerce #content div.product div.images, .woocommerce-page #content div.product div.images { width: 100% } + .woocommerce div.product div.summary, .woocommerce-page div.product div.summary, .woocommerce #content div.product div.summary, .woocommerce-page #content div.product div.summary { width: 100% } +} \ No newline at end of file diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..f6f2267 Binary files /dev/null and b/favicon.png differ diff --git a/font/FontAwesome.otf b/font/FontAwesome.otf new file mode 100644 index 0000000..7012545 Binary files /dev/null and b/font/FontAwesome.otf differ diff --git a/font/dbabxele.php b/font/dbabxele.php new file mode 100644 index 0000000..e69de29 diff --git a/font/fontawesome-webfont.eot b/font/fontawesome-webfont.eot new file mode 100644 index 0000000..0662cb9 Binary files /dev/null and b/font/fontawesome-webfont.eot differ diff --git a/font/fontawesome-webfont.svg b/font/fontawesome-webfont.svg new file mode 100644 index 0000000..2edb4ec --- /dev/null +++ b/font/fontawesome-webfont.svg @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/font/fontawesome-webfont.ttf b/font/fontawesome-webfont.ttf new file mode 100644 index 0000000..d365924 Binary files /dev/null and b/font/fontawesome-webfont.ttf differ diff --git a/font/fontawesome-webfont.woff b/font/fontawesome-webfont.woff new file mode 100644 index 0000000..b9bd17e Binary files /dev/null and b/font/fontawesome-webfont.woff differ diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..b15cf02 --- /dev/null +++ b/footer.php @@ -0,0 +1,32 @@ + +
+
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..2de54cb --- /dev/null +++ b/functions.php @@ -0,0 +1,750 @@ + 'Primary Menu' + ) + ); +} + +/*-----------------------------------------------------------------------------------*/ +/* Javascsript +/*-----------------------------------------------------------------------------------*/ +function mts_add_scripts() { + $mts_options = get_option('sensational'); + + wp_enqueue_script('jquery'); + + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } + + wp_register_script('customscript', get_template_directory_uri() . '/js/customscript.js'); + wp_enqueue_script ('customscript'); + + //Slider + if($mts_options['mts_featured_slider'] == '1' && !is_singular()) { + wp_register_script('flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js'); + wp_enqueue_script ('flexslider'); + } + + global $is_IE; + if ($is_IE) { + wp_register_script ('html5shim', "http://html5shim.googlecode.com/svn/trunk/html5.js"); + wp_enqueue_script ('html5shim'); + } +} +add_action('wp_enqueue_scripts','mts_add_scripts'); + +function mts_load_footer_scripts() { + $mts_options = get_option('sensational'); + + // Site wide js + wp_register_script('modernizr', get_template_directory_uri() . '/js/modernizr.min.js', true); + wp_enqueue_script ('modernizr'); + + //Lightbox + if($mts_options['mts_lightbox'] == '1') { + wp_register_script('prettyPhoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', true); + wp_enqueue_script('prettyPhoto'); + } + + //Sticky Nav + if($mts_options['mts_floating_header'] == '1') { + wp_register_script('StickyNav', get_template_directory_uri() . '/js/sticky.js', true); + wp_enqueue_script('StickyNav');; + } +} +add_action('wp_footer', 'mts_load_footer_scripts'); + +/*-----------------------------------------------------------------------------------*/ +/* Enqueue CSS +/*-----------------------------------------------------------------------------------*/ +function mts_enqueue_css() { + $mts_options = get_option('sensational'); + //slider + if($mts_options['mts_featured_slider'] == '1' && !is_singular()) { + wp_register_style('flexslider', get_template_directory_uri() . '/css/flexslider.css', 'style'); + wp_enqueue_style('flexslider'); + } + + if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { + //WooCommerce + wp_register_style('woocommerce', get_template_directory_uri() . '/css/woocommerce2.css', 'style'); + wp_enqueue_style('woocommerce'); + } + + //lightbox + if($mts_options['mts_lightbox'] == '1') { + wp_register_style('prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css', 'style'); + wp_enqueue_style('prettyPhoto'); + } + + //Font Awesome + wp_register_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', 'style'); + wp_enqueue_style('fontawesome'); + global $is_IE; + if ($is_IE) { + wp_register_style('ie7-fontawesome', get_template_directory_uri() . '/css/font-awesome-ie7.min.css', 'style'); + wp_enqueue_style('ie7-fontawesome'); + } + + wp_enqueue_style('stylesheet', get_template_directory_uri() . '/style.css', 'style'); + + //Responsive + if($mts_options['mts_responsive'] == '1') { + wp_enqueue_style('responsive', get_stylesheet_directory_uri() . '/css/responsive.css', 'style'); + } + + if ($mts_options['mts_bg_pattern_upload'] != '') { + $mts_bg = $mts_options['mts_bg_pattern_upload']; + } else { + if($mts_options['mts_bg_pattern'] != '') { + $mts_bg = get_template_directory_uri().'/images/'.$mts_options['mts_bg_pattern'].'.png'; + } + } + $mts_cslayout = ''; + $mts_sclayout = ''; + $mts_shareit_left = ''; + $mts_scclayout = ''; + $mts_2col = ''; + $mts_image_border = ''; + $mts_float_header = ''; + $mts_page_border = ''; + $mts_author = ''; + $mts_header_section = ''; + $mts_left_sidebar_title = ''; + if($mts_options['mts_floating_social'] == '1') { + if($mts_options['mts_layout'] == 'scslayout') { + $mts_shareit_left = '.shareit { background: #fff; top: 282px; left: auto; z-index: 0; margin: 0 0 0 -295px; width: 90px; position: fixed; padding: 5px; border:1px solid #EEE; border-right: 0;} .share-item {margin: 2px;}}'; + } elseif($mts_options['mts_layout'] == 'scclayout') { + $mts_shareit_left = '.shareit { background: #fff; top: 282px; left: auto; z-index: 0; margin: 0 0 0 821px; width: 90px; position: fixed; padding: 5px; border:1px solid #EEE; border-left: 0;} .share-item {margin: 2px;}}'; + } elseif($mts_options['mts_layout'] == 'sclayout') { + $mts_shareit_left = '.shareit { background: #fff; top: 282px!important; left: auto!important; z-index: 0; margin: 0 0 0 651px!important; width: 90px!important; position: fixed!important; padding: 5px!important; border:1px solid #EEE!important; border-left: 0!important;} .share-item {margin: 2px;} + @media screen and (max-width:1210px) { + .shareit { position: relative!important; width: 100%!important; top: 0!important; padding-left: 0!important; padding-right: 0!important; margin: 0!important; padding-top: 0!important; border: none!important; } + }'; + } elseif($mts_options['mts_layout'] == 'cslayout') { + $mts_shareit_left = '.shareit { background: #fff; top: 282px!important; left: auto!important; z-index: 0; margin: 0 0 0 -120px!important; width: 90px!important; position: fixed!important; padding: 5px!important; border:1px solid #EEE!important; border-right: 0!important;} .share-item {margin: 2px;} + @media screen and (max-width:1210px) { + .shareit { position: relative!important; width: 100%!important; top: 0!important; padding-left: 0!important; padding-right: 0!important; margin: 0!important; padding-top: 0!important; border: none!important; } + }'; + } + } + if ($mts_options['mts_layout'] == 'cslayout' || $mts_options['mts_layout'] == 'sclayout') { + $mts_2col = '#page, .container {width: 1008px;} + .flexslider, .latestPost { margin-right: 0; width: 100%; } .woocommerce div.product div.summary, .woocommerce-page div.product div.summary, .woocommerce #content div.product div.summary, .woocommerce-page #content div.product div.summary { width: 48%; padding-right: 0;} .woocommerce div.product .woocommerce-tabs, .woocommerce-page div.product .woocommerce-tabs, .woocommerce #content div.product .woocommerce-tabs, .woocommerce-page #content div.product .woocommerce-tabs, .woocommerce .related ul.products, .woocommerce-page .related ul.products, .woocommerce .upsells.products ul.products, .woocommerce-page .upsells.products ul.products, .woocommerce .related ul, .woocommerce-page .related ul, .woocommerce .upsells.products ul, .woocommerce-page .upsells.products ul { width: 100%; } .related-posts, .postauthor, #comments, #commentsAdd { width: 100%; margin-right: 0; margin-left: 0; } .single_post, .single_page { padding-right: 0; width: 100%; }'; + } + if ($mts_options['mts_layout'] == 'cslayout') { + $mts_cslayout = '.article { padding: 0 2%; width: 62.5%; } + .sidebar.c-4-12 { width: 29%; }'; + } + if ($mts_options['mts_layout'] == 'sclayout') { + $mts_sclayout = '.article { float: right; padding: 0 2%; width: 62.5%; border-right: 0; border-left: 1px #F2F2F2 solid; } .sidebar.c-4-12 { float: left; padding-right: 2.2%; width: 29%; }'; + } + if ($mts_options['mts_layout'] == 'scclayout') { + $mts_scclayout = '.article {border-left: 1px solid #F2F2F2; border-right: 0; float: right; } .latestPost { padding: 20px 0 40px 0; margin-left: 4%; margin-right: 0; } + #sidebar-left {float: right; margin: 30px 14px 0 2%; } .left-menu li { text-align: left; } .left-menu .widget li, .woocommerce .single #content { margin-left: 0; } .single_post { padding: 20px 0 0 3%} .related-posts, .postauthor, #comments, #commentsAdd { margin-right: 0; margin-left: 3%; } .woocommerce #content { margin-left: 4%; } + .left-menu .tagcloud a { float: left; margin-left: 0; margin-right: 5px }.sidebar.c-4-12 { float: left; } .flexslider { margin: 28px 0 0 4%; } .woocommerce div.product div.images, .woocommerce-page div.product div.images, .woocommerce #content div.product div.images, .woocommerce-page #content div.product div.images { width: 48%; padding-left: 0; } + .woocommerce span.onsale, .woocommerce-page span.onsale { left: 2% !important } + .woocommerce .woocommerce-breadcrumb, .woocommerce-page .woocommerce-breadcrumb { padding-left: 2% } + .woocommerce div.product .woocommerce-tabs .panel, .woocommerce-page div.product .woocommerce-tabs .panel, .woocommerce #content div.product .woocommerce-tabs .panel, .woocommerce-page #content div.product .woocommerce-tabs .panel { padding-left: 2% } + .woocommerce .related h2 { padding-left: 2% } + '; + } + if($mts_options['mts_author_comment'] == '1') { + $mts_author = '.bypostauthor {padding: 3%!important; background: #FAFAFA; width: 94%!important;} + .bypostauthor .fn:after { content: "'.__('Author','mythemeshop').'"; position: absolute; margin-left: 10px; top: 1px; padding: 1px 10px; background: #818181; color: #FFF; }'; + } + if ($mts_options['mts_floating_header'] == '1') { + $mts_float_header = '.main-header { border-bottom: 1px solid #EEEEEE; left: 0; opacity: 0.9; position: fixed; top: 0; z-index: 50;} + #content_area {margin-top: 45px; }'; + } + if ($mts_options['mts_bg_pattern_upload'] != '' || $mts_options['mts_bg_pattern'] != 'nobg' || $mts_options['mts_bg_color'] != '#ffffff') { + $mts_page_border = '#page { border: 1px solid #EEE } #content_area { padding-top: 20px; } footer { margin-top: 20px; }'; + } + if ($mts_options['mts_left_sidebar_title'] == '1') { + $mts_left_sidebar_title = '.left-menu h3 { display: block; }'; + } + if ($mts_options['mts_image_border'] == '1') { + $mts_image_border = '.article img.left, .article img.alignleft, .wp-caption.alignleft, .article img.right, .article img.alignright, .wp-caption.alignright, + .article img.center, .article img.aligncenter, .wp-caption.aligncenter, .article img.alignnone { background: #fff; border: 1px solid #d3d3d3; padding: 5px; + max-width: 98%; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; -khtml-border-radius: 4px; + border-radius: 4px; } + .article img.left:hover, .article img.alignleft:hover, .wp-caption.alignlef:hover, article img.right:hover, .article img.alignright:hover, + .wp-caption.alignright:hover, .article img.center:hover, .article img.aligncenter:hover, .wp-caption.aligncenter:hover, .article img.alignnone:hover { + background: #dbd9da; border-color: #bcbcbc } '; + } + $custom_css = " + body {background-color:{$mts_options['mts_bg_color']}; } + body {background-image: url({$mts_bg});} + a:hover, .menu a:hover, #navigation .menu [class^='icon-']:hover:before , .woocommerce .woocommerce-breadcrumb a, .woocommerce-page .woocommerce-breadcrumb a, .menu li.sfHover > a.sf-with-ul { color:{$mts_options['mts_primary_color']}; } + .left-menu li a, .left-menu li .menu a, .reply a { background: {$mts_options['mts_primary_color']}; } + .textwidget a, .pagination a, .related-posts a:hover, .comm, .single .pagination a .currenttext, a { color:{$mts_options['mts_secondary_color']}; } + .pagination .nav-previous a, .pagination .nav-next a, #commentform input#submit, .contactform #submit, .mts-subscribe input[type='submit'], #move-to-top:hover, .currenttext, .pagination a:hover, .woocommerce a.button, .woocommerce-page a.button, .woocommerce button.button, .woocommerce-page button.button, .woocommerce input.button, .woocommerce-page input.button, .woocommerce #respond input#submit, .woocommerce-page #respond input#submit, .woocommerce #content input.button, .woocommerce-page #content input.button, .readMore a, .woocommerce a.button, .woocommerce-page a.button, .woocommerce button.button, .woocommerce-page button.button, .woocommerce input.button, .woocommerce-page input.button, .woocommerce #respond input#submit, .woocommerce-page #respond input#submit, .woocommerce #content input.button, .woocommerce-page #content input.button, .current-menu-item:after, .tagcloud a, .tags a { background:{$mts_options['mts_secondary_color']}; color: #fff; } + .latestPost, .postauthor, #comments, #searchform:hover, .mts-subscribe input[type='text']:hover, input#author:hover, input#email:hover, input#url:hover, #comment:hover { border-color: {$mts_options['mts_secondary_color']}; } + {$mts_cslayout} + {$mts_sclayout} + {$mts_scclayout} + {$mts_2col} + {$mts_author} + {$mts_author} + {$mts_header_section} + {$mts_shareit_left} + {$mts_float_header} + {$mts_left_sidebar_title} + {$mts_image_border} + {$mts_page_border} + {$mts_options['mts_custom_css']} + "; + wp_add_inline_style( 'stylesheet', $custom_css ); +} +add_action('wp_enqueue_scripts', 'mts_enqueue_css', 99); + +/*-----------------------------------------------------------------------------------*/ +/* Enable Widgetized sidebar and Footer +/*-----------------------------------------------------------------------------------*/ +if ( function_exists('register_sidebar') ) + //Left Sidebar Widget + register_sidebar(array('name'=>'Left Sidebar', + 'description' => __('This Widget area can be used for category widget or 125px Ad.', 'mythemeshop'), + 'before_widget' => '
  • ', + 'after_widget' => '
  • ', + 'before_title' => '

    ', + 'after_title' => '

    ', + )); + + // Sidebar Widget + register_sidebar(array('name'=>'Sidebar', + 'before_widget' => '
  • ', + 'after_widget' => '
  • ', + 'before_title' => '

    ', + 'after_title' => '

    ', + )); + + // Footer Widgets + $sidebars = array(1, 2, 3, 4); + foreach($sidebars as $number) { + register_sidebar(array( + 'name' => 'Footer ' . $number, + 'id' => 'footer-' . $number, + 'before_widget' => '', + 'before_title' => '

    ', + 'after_title' => '

    ' + )); + } + +/*-----------------------------------------------------------------------------------*/ +/* Load Widgets & Shortcodes +/*-----------------------------------------------------------------------------------*/ +// Add the 125x125 Ad Block Custom Widget +include("functions/widget-ad125.php"); + +// Add the 300x250 Ad Block Custom Widget +include("functions/widget-ad300.php"); + +// Add the Tabbed Custom Widget +include("functions/widget-tabs.php"); + +// Add the Latest Tweets Custom Widget +include("functions/widget-tweets.php"); + +// Add the Theme Shortcodes +include("functions/theme-shortcodes.php"); + +// Add Recent Posts Widget +include("functions/widget-recentposts.php"); + +// Add Related Posts Widget +include("functions/widget-relatedposts.php"); + +// Add Popular Posts Widget +include("functions/widget-popular.php"); + +// Add Facebook Like box Widget +include("functions/widget-fblikebox.php"); + +// Add Google Plus box Widget +include("functions/widget-googleplus.php"); + +// Add Subscribe Widget +include("functions/widget-subscribe.php"); +include("functions/widget-after-first-paragraph.php"); + +// Add Social Profile Widget +include("functions/widget-social.php"); + +// Add Category Posts Widget +include("functions/widget-catposts.php"); + +// Add Welcome message +include("functions/welcome-message.php"); + +// Theme Functions +include("functions/theme-actions.php"); + +// TGM Plugin Activation. +include_once( "functions/plugin-activation.php" ); + +if($mts_options['mts_theme_update'] == '1') { +// Update Notification +include("functions/update_notifier.php"); +} + +/*-----------------------------------------------------------------------------------*/ +/* Filters customize wp_title +/*-----------------------------------------------------------------------------------*/ +function mts_wp_title( $title, $sep ) { + global $paged, $page; + + if ( is_feed() ) + return $title; + + // Add the site name. + $title .= get_bloginfo( 'name' ); + + // Add the site description for the home/front page. + $site_description = get_bloginfo( 'description', 'display' ); + if ( $site_description && ( is_home() || is_front_page() ) ) + $title = "$title $sep $site_description"; + + // Add a page number if necessary. + if ( $paged >= 2 || $page >= 2 ) + $title = "$title $sep " . sprintf( __( 'Page %s', 'mythemeshop' ), max( $paged, $page ) ); + + return $title; +} +add_filter( 'wp_title', 'mts_wp_title', 10, 2 ); + +/*-----------------------------------------------------------------------------------*/ +/* Thumbnail Quality +/*-----------------------------------------------------------------------------------*/ +if(isset($mts_options['mts_thumb_quality_on']) == '1') { + function thumbnail_quality( $quality ) { + $mts_options = get_option('sensational'); + return $mts_options['mts_thumb_quality']; + } + add_filter( 'jpeg_quality', 'thumbnail_quality' ); + add_filter( 'wp_editor_set_quality', 'thumbnail_quality' ); +} + +/*-----------------------------------------------------------------------------------*/ +/* Filters that allow shortcodes in Text Widgets +/*-----------------------------------------------------------------------------------*/ +add_filter('widget_text', 'shortcode_unautop'); +add_filter('widget_text', 'do_shortcode'); +add_filter('the_content_rss', 'do_shortcode'); + +/*-----------------------------------------------------------------------------------*/ +/* Custom Comments template +/*-----------------------------------------------------------------------------------*/ +function mts_comments($comment, $args, $depth) { + $GLOBALS['comment'] = $comment; ?> +
  • id="li-comment-"> +
    +
    + comment_author_email, 50 ); ?> + %s', 'mythemeshop'), get_comment_author_link()) ?> + + + + + + +
    + comment_approved == '0') : ?> + +
    + + +
    +=$limit) { + array_pop($excerpt); + $excerpt = implode(" ",$excerpt); + } else { + $excerpt = implode(" ",$excerpt); + } + $excerpt = preg_replace('`[[^]]*]`','',$excerpt); + return $excerpt; +} + +/*-----------------------------------------------------------------------------------*/ +/* nofollow to next/previous links +/*-----------------------------------------------------------------------------------*/ +function mts_pagination_add_nofollow($content) { + return 'rel="nofollow"'; +} +add_filter('next_posts_link_attributes', 'mts_pagination_add_nofollow' ); +add_filter('previous_posts_link_attributes', 'mts_pagination_add_nofollow' ); + +/*-----------------------------------------------------------------------------------*/ +/* Nofollow to category links +/*-----------------------------------------------------------------------------------*/ +add_filter( 'the_category', 'mts_add_nofollow_cat' ); +function mts_add_nofollow_cat( $text ) { +$text = str_replace('rel="category tag"', 'rel="nofollow"', $text); return $text; +} + +/*-----------------------------------------------------------------------------------*/ +/* nofollow post author link +/*-----------------------------------------------------------------------------------*/ +add_filter('the_author_posts_link', 'mts_nofollow_the_author_posts_link'); +function mts_nofollow_the_author_posts_link ($link) { +return str_replace('', '")\' rel=\'nofollow\'>', $link ); +} +add_filter( 'comment_reply_link', 'mts_add_nofollow_to_reply_link' ); + +/*-----------------------------------------------------------------------------------*/ +/* removes the WordPress version from your header for security +/*-----------------------------------------------------------------------------------*/ +function wb_remove_version() { + return ''; +} +add_filter('the_generator', 'wb_remove_version'); + +/*-----------------------------------------------------------------------------------*/ +/* Removes Trackbacks from the comment count +/*-----------------------------------------------------------------------------------*/ +add_filter('get_comments_number', 'mts_comment_count', 0); +function mts_comment_count( $count ) { + if ( ! is_admin() ) { + global $id; + $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id)); + return count($comments_by_type['comment']); + } else { + return $count; + } +} + +/*-----------------------------------------------------------------------------------*/ +/* adds a class to the post if there is a thumbnail +/*-----------------------------------------------------------------------------------*/ +function has_thumb_class($classes) { + global $post; + if( has_post_thumbnail($post->ID) ) { $classes[] = 'has_thumb'; } + return $classes; +} +add_filter('post_class', 'has_thumb_class'); + +/*-----------------------------------------------------------------------------------*/ +/* Breadcrumb +/*-----------------------------------------------------------------------------------*/ +function mts_the_breadcrumb() { + echo ' '.__('Home','mythemeshop'); + echo ""; + if (is_category() || is_single()) { + echo " / "; + the_category(' • '); + if (is_single()) { + echo " / "; + the_title(); + } + } elseif (is_page()) { + echo " / "; + echo the_title(); + } elseif (is_search()) { + echo " / ".__('Search Results for','mythemeshop')."... "; + echo '"'; + echo the_search_query(); + echo '"'; + } +} + +/*-----------------------------------------------------------------------------------*/ +/* Pagination +/*-----------------------------------------------------------------------------------*/ +function mts_pagination($pages = '', $range = 3) { + $showitems = ($range * 3)+1; + global $paged; if(empty($paged)) $paged = 1; + if($pages == '') { + global $wp_query; $pages = $wp_query->max_num_pages; + if(!$pages){ $pages = 1; } + } + if(1 != $pages) { + echo ""; + } +} + +/*-----------------------------------------------------------------------------------*/ +/* Redirect feed to feedburner +/*-----------------------------------------------------------------------------------*/ +$mts_options = get_option('sensational'); +if ( isset($mts_options['mts_feedburner']) != '') { +function mts_rss_feed_redirect() { + $mts_options = get_option('sensational'); + global $feed; + $new_feed = $mts_options['mts_feedburner']; + if (!is_feed()) { + return; + } + if (preg_match('/feedburner/i', $_SERVER['HTTP_USER_AGENT'])){ + return; + } + if ($feed != 'comments-rss2') { + if (function_exists('status_header')) status_header( 302 ); + header("Location:" . $new_feed); + header("HTTP/1.1 302 Temporary Redirect"); + exit(); + } +} +add_action('template_redirect', 'mts_rss_feed_redirect'); +} + +$mts_options = get_option('sensational'); +if ( $mts_options['mts_admin_style'] == '1') { +function mts_admin_css() { + wp_enqueue_style( 'mts_admin_css', get_template_directory_uri() . '/css/admin.css' ); +} +add_action('admin_print_styles', 'mts_admin_css' ); +function mts_remove_footer_admin () { + echo "Thank you for creating with WordPress. Dashboard Customization by MyThemeShop."; +} +add_filter('admin_footer_text', 'mts_remove_footer_admin'); +} + +/*-----------------------------------------------------------------------------------*/ +/* Single Post Pagination +/*-----------------------------------------------------------------------------------*/ +function mts_wp_link_pages_args_prevnext_add($args) +{ + global $page, $numpages, $more, $pagenow; + if (!$args['next_or_number'] == 'next_and_number') + return $args; + $args['next_or_number'] = 'number'; + if (!$more) + return $args; + if($page-1) + $args['before'] .= _wp_link_page($page-1) + . $args['link_before']. $args['previouspagelink'] . $args['link_after'] . '' + ; + if ($page<$numpages) + + $args['after'] = _wp_link_page($page+1) + . $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . '' + . $args['after'] + ; + return $args; +} +add_filter('wp_link_pages_args', 'mts_wp_link_pages_args_prevnext_add'); + +/*-----------------------------------------------------------------------------------*/ +/* WooCommerce +/*-----------------------------------------------------------------------------------*/ +if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { +add_theme_support('woocommerce'); + +// Register Shop and Single Product Sidebar +register_sidebar(array( + 'name' => 'Shop Page Sidebar', + 'description' => __( 'Appears on Shop main page and product archive pages.', 'mythemeshop' ), + 'id' => 'shop-sidebar', + 'before_widget' => '
  • ', + 'after_widget' => '
  • ', + 'before_title' => '

    ', + 'after_title' => '

    ', +)); +register_sidebar(array( + 'name' => 'Single Product Sidebar', + 'description' => __( 'Appears on single product pages.', 'mythemeshop' ), + 'id' => 'product-sidebar', + 'before_widget' => '
  • ', + 'after_widget' => '
  • ', + 'before_title' => '

    ', + 'after_title' => '

    ', +)); + +// Change number or products per row to 3 +add_filter('loop_shop_columns', 'loop_columns'); +if (!function_exists('loop_columns')) { + function loop_columns() { + return 3; // 3 products per row + } +} + +// Redefine woocommerce_output_related_products() +function woocommerce_output_related_products() { +woocommerce_related_products(3,1); // Display 3 products in rows of 1 +} + +/*** Hook in on activation */ +global $pagenow; +if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action( 'init', 'mythemeshop_woocommerce_image_dimensions', 1 ); + +/*** Define image sizes */ +function mythemeshop_woocommerce_image_dimensions() { + $catalog = array( + 'width' => '195', // px + 'height' => '195', // px + 'crop' => 1 // true + ); + $single = array( + 'width' => '314', // px + 'height' => '314', // px + 'crop' => 1 // true + ); + $thumbnail = array( + 'width' => '72', // px + 'height' => '72', // px + 'crop' => 1 // false + ); + // Image sizes + update_option( 'shop_catalog_image_size', $catalog ); // Product category thumbs + update_option( 'shop_single_image_size', $single ); // Single product image + update_option( 'shop_thumbnail_image_size', $thumbnail ); // Image gallery thumbs +} + +add_filter ( 'woocommerce_product_thumbnails_columns', 'xx_thumb_cols' ); + function xx_thumb_cols() { + return 4; // .last class applied to every 4th thumbnail + } +} + +// Display 24 products per page. Goes in functions.php +$mts_home_producst = $mts_options['mts_shop_products']; +//add_filter( 'loop_shop_per_page', create_function( '$cols', 'return '.$mts_home_producst.';' ), 20 ); +add_filter('loop_shop_per_page', function($cols){return $mts_home_producst;}); +/*------------[ Cart ]-------------*/ +if ( ! function_exists( 'mts_cart' ) ) { + function mts_cart() { + global $mts_options; +if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { +?> + + + + cart->cart_contents_count, 'mythemeshop'), $woocommerce->cart->cart_contents_count);?> - cart->get_cart_total(); ?> + + button to tinymce +/*-----------------------------------------------------------------------------------*/ +add_filter('mce_buttons','wysiwyg_editor'); +function wysiwyg_editor($mce_buttons) { + $pos = array_search('wp_more',$mce_buttons,true); + if ($pos !== false) { + $tmp_buttons = array_slice($mce_buttons, 0, $pos+1); + $tmp_buttons[] = 'wp_page'; + $mce_buttons = array_merge($tmp_buttons, array_slice($mce_buttons, $pos+1)); + } + return $mce_buttons; +} + +/*-----------------------------------------------------------------------------------*/ +/* Custom Gravatar Support +/*-----------------------------------------------------------------------------------*/ +if( !function_exists( 'mts_custom_gravatar' ) ) { + function mts_custom_gravatar( $avatar_defaults ) { + $mts_avatar = get_bloginfo('template_directory') . '/images/gravatar.png'; + $avatar_defaults[$mts_avatar] = 'Custom Gravatar (/images/gravatar.png)'; + return $avatar_defaults; + } + add_filter( 'avatar_defaults', 'mts_custom_gravatar' ); +} + +/*---------------------------------------------------- +/* Sticky Sidebar +/*---------------------------------------------------*/ +function mts_sticky_sidebar() { +global $mts_options; +if($mts_options['mts_floating_leftside'] == '1') { ?> + + diff --git a/functions/plugin-activation.php b/functions/plugin-activation.php new file mode 100644 index 0000000..5aeb212 --- /dev/null +++ b/functions/plugin-activation.php @@ -0,0 +1,4355 @@ +wp_version = $GLOBALS['wp_version']; + + // Announce that the class is ready, and pass the object (for advanced use). + do_action_ref_array( 'tgmpa_init', array( $this ) ); + + // When the rest of WP has loaded, kick-start the rest of the class. + add_action( 'init', array( $this, 'init' ) ); + } + + /** + * Magic method to (not) set protected properties from outside of this class. + * + * @internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property + * is being assigned rather than tested in a conditional, effectively rendering it useless. + * This 'hack' prevents this from happening. + * + * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593 + * + * @param string $name Name of an inaccessible property. + * @param mixed $value Value to assign to the property. + * @return void Silently fail to set the property when this is tried from outside of this class context. + * (Inside this class context, the __set() method if not used as there is direct access.) + */ + public function __set( $name, $value ) { + return; + } + + /** + * Magic method to get the value of a protected property outside of this class context. + * + * @param string $name Name of an inaccessible property. + * @return mixed The property value. + */ + public function __get( $name ) { + return $this->{$name}; + } + + /** + * Initialise the interactions between this class and WordPress. + * + * Hooks in three new methods for the class: admin_menu, notices and styles. + * + * @since 2.0.0 + * + * @see TGM_Plugin_Activation::admin_menu() + * @see TGM_Plugin_Activation::notices() + * @see TGM_Plugin_Activation::styles() + */ + public function init() { + /** + * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter + * you can overrule that behaviour. + * + * @since 2.5.0 + * + * @param bool $load Whether or not TGMPA should load. + * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`. + */ + if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) { + return; + } + + // Load class strings. + $this->strings = array( + 'page_title' => __( 'Install Required Plugins', 'mythemeshop' ), + 'menu_title' => __( 'Install Plugins', 'mythemeshop' ), + 'installing' => __( 'Installing Plugin: %s', 'mythemeshop' ), + 'oops' => __( 'Something went wrong with the plugin API.', 'mythemeshop' ), + 'notice_can_install_required' => _n_noop( + 'This theme requires the following plugin: %1$s.', + 'This theme requires the following plugins: %1$s.', + 'mythemeshop' + ), + 'notice_can_install_recommended' => _n_noop( + 'This theme recommends the following plugin: %1$s.', + 'This theme recommends the following plugins: %1$s.', + 'mythemeshop' + ), + 'notice_cannot_install' => _n_noop( + 'Sorry, but you do not have the correct permissions to install the %1$s plugin.', + 'Sorry, but you do not have the correct permissions to install the %1$s plugins.', + 'mythemeshop' + ), + 'notice_ask_to_update' => _n_noop( + 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', + 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', + 'mythemeshop' + ), + 'notice_ask_to_update_maybe' => _n_noop( + 'There is an update available for: %1$s.', + 'There are updates available for the following plugins: %1$s.', + 'mythemeshop' + ), + 'notice_cannot_update' => _n_noop( + 'Sorry, but you do not have the correct permissions to update the %1$s plugin.', + 'Sorry, but you do not have the correct permissions to update the %1$s plugins.', + 'mythemeshop' + ), + 'notice_can_activate_required' => _n_noop( + 'The following required plugin is currently inactive: %1$s.', + 'The following required plugins are currently inactive: %1$s.', + 'mythemeshop' + ), + 'notice_can_activate_recommended' => _n_noop( + 'The following recommended plugin is currently inactive: %1$s.', + 'The following recommended plugins are currently inactive: %1$s.', + 'mythemeshop' + ), + 'notice_cannot_activate' => _n_noop( + 'Sorry, but you do not have the correct permissions to activate the %1$s plugin.', + 'Sorry, but you do not have the correct permissions to activate the %1$s plugins.', + 'mythemeshop' + ), + 'install_link' => _n_noop( + 'Begin installing plugin', + 'Begin installing plugins', + 'mythemeshop' + ), + 'update_link' => _n_noop( + 'Begin updating plugin', + 'Begin updating plugins', + 'mythemeshop' + ), + 'activate_link' => _n_noop( + 'Begin activating plugin', + 'Begin activating plugins', + 'mythemeshop' + ), + 'return' => __( 'Return to Required Plugins Installer', 'mythemeshop' ), + 'dashboard' => __( 'Return to the dashboard', 'mythemeshop' ), + 'plugin_activated' => __( 'Plugin activated successfully.', 'mythemeshop' ), + 'activated_successfully' => __( 'The following plugin was activated successfully:', 'mythemeshop' ), + 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'mythemeshop' ), + 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'mythemeshop' ), + 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'mythemeshop' ), + 'dismiss' => __( 'Dismiss this notice', 'mythemeshop' ), + 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'mythemeshop' ), + ); + + do_action( 'tgmpa_register' ); + + /* After this point, the plugins should be registered and the configuration set. */ + + // Proceed only if we have plugins to handle. + if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) { + return; + } + + // Set up the menu and notices if we still have outstanding actions. + if ( true !== $this->is_tgmpa_complete() ) { + // Sort the plugins. + array_multisort( $this->sort_order, SORT_ASC, $this->plugins ); + + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + add_action( 'admin_head', array( $this, 'dismiss' ) ); + + // Prevent the normal links from showing underneath a single install/update page. + add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); + add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) ); + + if ( $this->has_notices ) { + add_action( 'admin_notices', array( $this, 'notices' ) ); + add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); + add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); + } + } + + // If needed, filter plugin action links. + add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 ); + + // Make sure things get reset on switch theme. + add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); + + if ( $this->has_notices ) { + add_action( 'switch_theme', array( $this, 'update_dismiss' ) ); + } + + // Setup the force activation hook. + if ( true === $this->has_forced_activation ) { + add_action( 'admin_init', array( $this, 'force_activation' ) ); + } + + // Setup the force deactivation hook. + if ( true === $this->has_forced_deactivation ) { + add_action( 'switch_theme', array( $this, 'force_deactivation' ) ); + } + } + + /** + * Hook in plugin action link filters for the WP native plugins page. + * + * - Prevent activation of plugins which don't meet the minimum version requirements. + * - Prevent deactivation of force-activated plugins. + * - Add update notice if update available. + * + * @since 2.5.0 + */ + public function add_plugin_action_link_filters() { + foreach ( $this->plugins as $slug => $plugin ) { + if ( false === $this->can_plugin_activate( $slug ) ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 ); + } + + if ( true === $plugin['force_activation'] ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); + } + + if ( false !== $this->does_plugin_require_update( $slug ) ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 ); + } + } + } + + /** + * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the + * minimum version requirements. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_activate( $actions ) { + unset( $actions['activate'] ); + + return $actions; + } + + /** + * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_deactivate( $actions ) { + unset( $actions['deactivate'] ); + + return $actions; + } + + /** + * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the + * minimum version requirements. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_update( $actions ) { + $actions['update'] = sprintf( + '%3$s', + esc_url( $this->get_tgmpa_status_url( 'update' ) ), + esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'mythemeshop' ), + esc_html__( 'Update Required', 'mythemeshop' ) + ); + + return $actions; + } + + /** + * Handles calls to show plugin information via links in the notices. + * + * We get the links in the admin notices to point to the TGMPA page, rather + * than the typical plugin-install.php file, so we can prepare everything + * beforehand. + * + * WP does not make it easy to show the plugin information in the thickbox - + * here we have to require a file that includes a function that does the + * main work of displaying it, enqueue some styles, set up some globals and + * finally call that function before exiting. + * + * Down right easy once you know how... + * + * Returns early if not the TGMPA page. + * + * @since 2.1.0 + * + * @global string $tab Used as iframe div class names, helps with styling + * @global string $body_id Used as the iframe body ID, helps with styling + * + * @return null Returns early if not the TGMPA page. + */ + public function admin_init() { + if ( ! $this->is_tgmpa_page() ) { + return; + } + + if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) { + // Needed for install_plugin_information(). + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + + wp_enqueue_style( 'plugin-install' ); + + global $tab, $body_id; + $body_id = 'plugin-information'; + // @codingStandardsIgnoreStart + $tab = 'plugin-information'; + // @codingStandardsIgnoreEnd + + install_plugin_information(); + + exit; + } + } + + /** + * Enqueue thickbox scripts/styles for plugin info. + * + * Thickbox is not automatically included on all admin pages, so we must + * manually enqueue it for those pages. + * + * Thickbox is only loaded if the user has not dismissed the admin + * notice or if there are any plugins left to install and activate. + * + * @since 2.1.0 + */ + public function thickbox() { + if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { + add_thickbox(); + } + } + + /** + * Adds submenu page if there are plugin actions to take. + * + * This method adds the submenu page letting users know that a required + * plugin needs to be installed. + * + * This page disappears once the plugin has been installed and activated. + * + * @since 1.0.0 + * + * @see TGM_Plugin_Activation::init() + * @see TGM_Plugin_Activation::install_plugins_page() + * + * @return null Return early if user lacks capability to install a plugin. + */ + public function admin_menu() { + // Make sure privileges are correct to see the page. + if ( ! current_user_can( 'install_plugins' ) ) { + return; + } + + $args = apply_filters( + 'tgmpa_admin_menu_args', + array( + 'parent_slug' => $this->parent_slug, // Parent Menu slug. + 'page_title' => $this->strings['page_title'], // Page title. + 'menu_title' => $this->strings['menu_title'], // Menu title. + 'capability' => $this->capability, // Capability. + 'menu_slug' => $this->menu, // Menu slug. + 'function' => array( $this, 'install_plugins_page' ), // Callback. + ) + ); + + $this->add_admin_menu( $args ); + } + + /** + * Add the menu item. + * + * @since 2.5.0 + * + * @param array $args Menu item configuration. + */ + protected function add_admin_menu( array $args ) { + if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) { + _deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'mythemeshop' ) ); + } + + if ( 'themes.php' === $this->parent_slug ) { + $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); + } else { + $type = 'submenu'; + $this->page_hook = call_user_func( "add_{$type}_page", $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); + } + } + + /** + * Echoes plugin installation form. + * + * This method is the callback for the admin_menu method function. + * This displays the admin page and form area where the user can select to install and activate the plugin. + * Aborts early if we're processing a plugin installation action. + * + * @since 1.0.0 + * + * @return null Aborts early if we're processing a plugin installation action. + */ + public function install_plugins_page() { + // Store new instance of plugin table in object. + $plugin_table = new TGMPA_List_Table; + + // Return early if processing a plugin installation action. + if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) { + return; + } + + // Force refresh of available plugin information so we'll know about manual updates/deletes. + wp_clean_plugins_cache( false ); + + ?> +
    +

    + prepare_items(); ?> + + message ) && is_string( $this->message ) ) { + echo wp_kses_post( $this->message ); + } + ?> + views(); ?> + +
    + + + display(); ?> +
    +
    + sanitize_key( urldecode( $_GET['plugin'] ) ); + + if ( ! isset( $this->plugins[ $slug ] ) ) { + return false; + } + + // Was an install or upgrade action link clicked? + if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) { + + $install_type = 'install'; + if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) { + $install_type = 'update'; + } + + check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' ); + + // Pass necessary information via URL if WP_Filesystem is needed. + $url = wp_nonce_url( + add_query_arg( + array( + 'plugin' => urlencode( $slug ), + 'tgmpa-' . $install_type => $install_type . '-plugin', + ), + $this->get_tgmpa_url() + ), + 'tgmpa-' . $install_type, + 'tgmpa-nonce' + ); + + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + + if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) { + return true; + } + + if ( ! WP_Filesystem( $creds ) ) { + request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem. + return true; + } + + /* If we arrive here, we have the filesystem. */ + + // Prep variables for Plugin_Installer_Skin class. + $extra = array(); + $extra['slug'] = $slug; // Needed for potentially renaming of directory name. + $source = $this->get_download_url( $slug ); + $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; + $api = ( false !== $api ) ? $api : null; + + $url = add_query_arg( + array( + 'action' => $install_type . '-plugin', + 'plugin' => urlencode( $slug ), + ), + 'update.php' + ); + + if ( ! class_exists( 'Plugin_Upgrader', false ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + $skin_args = array( + 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', + 'title' => sprintf( $this->strings['installing'], $this->plugins[ $slug ]['name'] ), + 'url' => esc_url_raw( $url ), + 'nonce' => $install_type . '-plugin_' . $slug, + 'plugin' => '', + 'api' => $api, + 'extra' => $extra, + ); + + if ( 'update' === $install_type ) { + $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; + $skin = new Plugin_Upgrader_Skin( $skin_args ); + } else { + $skin = new Plugin_Installer_Skin( $skin_args ); + } + + // Create a new instance of Plugin_Upgrader. + $upgrader = new Plugin_Upgrader( $skin ); + + // Perform the action and install the plugin from the $source urldecode(). + add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); + + if ( 'update' === $install_type ) { + // Inject our info into the update transient. + $to_inject = array( $slug => $this->plugins[ $slug ] ); + $to_inject[ $slug ]['source'] = $source; + $this->inject_update_info( $to_inject ); + + $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); + } else { + $upgrader->install( $source ); + } + + remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); + + // Make sure we have the correct file path now the plugin is installed/updated. + $this->populate_file_path( $slug ); + + // Only activate plugins if the config option is set to true and the plugin isn't + // already active (upgrade). + if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) { + $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method. + if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) { + return true; // Finish execution of the function early as we encountered an error. + } + } + + $this->show_tgmpa_version(); + + // Display message based on if all plugins are now active or not. + if ( $this->is_tgmpa_complete() ) { + echo '

    ', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'mythemeshop' ) . '' ), '

    '; + echo ''; + } else { + echo '

    ', esc_html( $this->strings['return'] ), '

    '; + } + + return true; + } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { + // Activate action link was clicked. + check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); + + if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { + return true; // Finish execution of the function early as we encountered an error. + } + } + + return false; + } + + /** + * Inject information into the 'update_plugins' site transient as WP checks that before running an update. + * + * @since 2.5.0 + * + * @param array $plugins The plugin information for the plugins which are to be updated. + */ + public function inject_update_info( $plugins ) { + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( ! is_object( $repo_updates ) ) { + $repo_updates = new stdClass; + } + + foreach ( $plugins as $slug => $plugin ) { + $file_path = $plugin['file_path']; + + if ( empty( $repo_updates->response[ $file_path ] ) ) { + $repo_updates->response[ $file_path ] = new stdClass; + } + + // We only really need to set package, but let's do all we can in case WP changes something. + $repo_updates->response[ $file_path ]->slug = $slug; + $repo_updates->response[ $file_path ]->plugin = $file_path; + $repo_updates->response[ $file_path ]->new_version = $plugin['version']; + $repo_updates->response[ $file_path ]->package = $plugin['source']; + if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { + $repo_updates->response[ $file_path ]->url = $plugin['external_url']; + } + } + + set_site_transient( 'update_plugins', $repo_updates ); + } + + /** + * Adjust the plugin directory name if necessary. + * + * The final destination directory of a plugin is based on the subdirectory name found in the + * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this + * subdirectory name is not the same as the expected slug and the plugin will not be recognized + * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to + * the expected plugin slug. + * + * @since 2.5.0 + * + * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/. + * @param string $remote_source Path to upgrade/zip-file-name.tmp. + * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin. + * @return string $source + */ + public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) { + if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) { + return $source; + } + + // Check for single file plugins. + $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) ); + if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) { + return $source; + } + + // Multi-file plugin, let's see if the directory is correctly named. + $desired_slug = ''; + + // Figure out what the slug is supposed to be. + if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) { + $desired_slug = $upgrader->skin->options['extra']['slug']; + } else { + // Bulk installer contains less info, so fall back on the info registered here. + foreach ( $this->plugins as $slug => $plugin ) { + if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { + $desired_slug = $slug; + break; + } + } + unset( $slug, $plugin ); + } + + if ( ! empty( $desired_slug ) ) { + $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) ); + + if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) { + $from = untrailingslashit( $source ); + $to = trailingslashit( $remote_source ) . $desired_slug; + + if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) { + return trailingslashit( $to ); + } else { + return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'mythemeshop' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'mythemeshop' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); + } + } elseif ( empty( $subdir_name ) ) { + return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'mythemeshop' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'mythemeshop' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); + } + } + + return $source; + } + + /** + * Activate a single plugin and send feedback about the result to the screen. + * + * @since 2.5.0 + * + * @param string $file_path Path within wp-plugins/ to main plugin file. + * @param string $slug Plugin slug. + * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false. + * This determines the styling of the output messages. + * @return bool False if an error was encountered, true otherwise. + */ + protected function activate_single_plugin( $file_path, $slug, $automatic = false ) { + if ( $this->can_plugin_activate( $slug ) ) { + $activate = activate_plugin( $file_path ); + + if ( is_wp_error( $activate ) ) { + echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    ', + '

    ', esc_html( $this->strings['return'] ), '

    '; + + return false; // End it here if there is an error with activation. + } else { + if ( ! $automatic ) { + // Make sure message doesn't display again if bulk activation is performed + // immediately after a single activation. + if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. + echo '

    ', esc_html( $this->strings['activated_successfully'] ), ' ', esc_html( $this->plugins[ $slug ]['name'] ), '.

    '; + } + } else { + // Simpler message layout for use on the plugin install page. + echo '

    ', esc_html( $this->strings['plugin_activated'] ), '

    '; + } + } + } elseif ( $this->is_plugin_active( $slug ) ) { + // No simpler message format provided as this message should never be encountered + // on the plugin install page. + echo '

    ', + sprintf( + esc_html( $this->strings['plugin_already_active'] ), + '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' + ), + '

    '; + } elseif ( $this->does_plugin_require_update( $slug ) ) { + if ( ! $automatic ) { + // Make sure message doesn't display again if bulk activation is performed + // immediately after a single activation. + if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. + echo '

    ', + sprintf( + esc_html( $this->strings['plugin_needs_higher_version'] ), + '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' + ), + '

    '; + } + } else { + // Simpler message layout for use on the plugin install page. + echo '

    ', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '

    '; + } + } + + return true; + } + + /** + * Echoes required plugin notice. + * + * Outputs a message telling users that a specific plugin is required for + * their theme. If appropriate, it includes a link to the form page where + * users can install and activate the plugin. + * + * Returns early if we're on the Install page. + * + * @since 1.0.0 + * + * @global object $current_screen + * + * @return null Returns early if we're on the Install page. + */ + public function notices() { + // Remove nag on the install page / Return early if the nag message has been dismissed. + if ( $this->is_tgmpa_page() || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { + return; + } + + // Store for the plugin slugs by message type. + $message = array(); + + // Initialize counters used to determine plurality of action link texts. + $install_link_count = 0; + $update_link_count = 0; + $activate_link_count = 0; + + foreach ( $this->plugins as $slug => $plugin ) { + if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) { + continue; + } + + if ( ! $this->is_plugin_installed( $slug ) ) { + if ( current_user_can( 'install_plugins' ) ) { + $install_link_count++; + + if ( true === $plugin['required'] ) { + $message['notice_can_install_required'][] = $slug; + } else { + $message['notice_can_install_recommended'][] = $slug; + } + } else { + // Need higher privileges to install the plugin. + $message['notice_cannot_install'][] = $slug; + } + } else { + if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) { + if ( current_user_can( 'activate_plugins' ) ) { + $activate_link_count++; + + if ( true === $plugin['required'] ) { + $message['notice_can_activate_required'][] = $slug; + } else { + $message['notice_can_activate_recommended'][] = $slug; + } + } else { + // Need higher privileges to activate the plugin. + $message['notice_cannot_activate'][] = $slug; + } + } + + if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { + + if ( current_user_can( 'install_plugins' ) ) { + $update_link_count++; + + if ( $this->does_plugin_require_update( $slug ) ) { + $message['notice_ask_to_update'][] = $slug; + } elseif ( false !== $this->does_plugin_have_update( $slug ) ) { + $message['notice_ask_to_update_maybe'][] = $slug; + } + } else { + // Need higher privileges to update the plugin. + $message['notice_cannot_update'][] = $slug; + } + } + } + } + unset( $slug, $plugin ); + + // If we have notices to display, we move forward. + if ( ! empty( $message ) ) { + krsort( $message ); // Sort messages. + $rendered = ''; + + // As add_settings_error() wraps the final message in a

    and as the final message can't be + // filtered, using

    's in our html would render invalid html output. + $line_template = '%s' . "\n"; + + // If dismissable is false and a message is set, output it now. + if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) { + $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) ); + } + + // Render the individual message lines for the notice. + foreach ( $message as $type => $plugin_group ) { + $linked_plugins = array(); + + // Get the external info link for a plugin if one is available. + foreach ( $plugin_group as $plugin_slug ) { + $linked_plugins[] = $this->get_info_link( $plugin_slug ); + } + unset( $plugin_slug ); + + $count = count( $plugin_group ); + $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); + $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. + $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'mythemeshop' ) . ' ' . $last_plugin ); + + $rendered .= sprintf( + $line_template, + sprintf( + translate_nooped_plural( $this->strings[ $type ], $count, 'mythemeshop' ), + $imploded, + $count + ) + ); + + if ( 0 === strpos( $type, 'notice_cannot' ) ) { + $rendered .= $this->strings['contact_admin']; + } + } + unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded ); + + // Setup action links. + $action_links = array( + 'install' => '', + 'update' => '', + 'activate' => '', + 'dismiss' => $this->dismissable ? '' . esc_html( $this->strings['dismiss'] ) . '' : '', + ); + + $link_template = '%1$s'; + + if ( current_user_can( 'install_plugins' ) ) { + if ( $install_link_count > 0 ) { + $action_links['install'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['install_link'], $install_link_count, 'mythemeshop' ), + esc_url( $this->get_tgmpa_status_url( 'install' ) ) + ); + } + if ( $update_link_count > 0 ) { + $action_links['update'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['update_link'], $update_link_count, 'mythemeshop' ), + esc_url( $this->get_tgmpa_status_url( 'update' ) ) + ); + } + } + + if ( current_user_can( 'activate_plugins' ) && $activate_link_count > 0 ) { + $action_links['activate'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['activate_link'], $activate_link_count, 'mythemeshop' ), + esc_url( $this->get_tgmpa_status_url( 'activate' ) ) + ); + } + + $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links ); + + $action_links = array_filter( (array) $action_links ); // Remove any empty array items. + + if ( ! empty( $action_links ) && is_array( $action_links ) ) { + $action_links = sprintf( $line_template, implode( ' | ', $action_links ) ); + $rendered .= apply_filters( 'tgmpa_notice_rendered_action_links', $action_links ); + } + + // Dismiss with X + if ( $this->dismissable ) { + $rendered .= ''; + } + + // Register the nag messages and prepare them to be processed. + if ( ! empty( $this->strings['nag_type'] ) ) { + add_settings_error( 'tgmpa', 'tgmpa', $rendered, sanitize_html_class( strtolower( $this->strings['nag_type'] ) ) ); + } else { + $nag_class = version_compare( $this->wp_version, '3.8', '<' ) ? 'updated' : 'update-nag'; + add_settings_error( 'tgmpa', 'tgmpa', $rendered, $nag_class ); + } + } + + // Admin options pages already output settings_errors, so this is to avoid duplication. + if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { + $this->display_settings_errors(); + } + } + + /** + * Display settings errors and remove those which have been displayed to avoid duplicate messages showing + * + * @since 2.5.0 + */ + protected function display_settings_errors() { + global $wp_settings_errors; + + settings_errors( 'tgmpa' ); + + foreach ( (array) $wp_settings_errors as $key => $details ) { + if ( 'tgmpa' === $details['setting'] ) { + unset( $wp_settings_errors[ $key ] ); + break; + } + } + } + + /** + * Add dismissable admin notices. + * + * Appends a link to the admin nag messages. If clicked, the admin notice disappears and no longer is visible to users. + * + * @since 2.1.0 + */ + public function dismiss() { + if ( isset( $_GET['tgmpa-dismiss'] ) ) { + update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 ); + } + } + + /** + * Add individual plugin to our collection of plugins. + * + * If the required keys are not set or the plugin has already + * been registered, the plugin is not added. + * + * @since 2.0.0 + * + * @param array|null $plugin Array of plugin arguments or null if invalid argument. + * @return null Return early if incorrect argument. + */ + public function register( $plugin ) { + if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { + return; + } + + if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { + return; + } + + $defaults = array( + 'name' => '', // String + 'slug' => '', // String + 'source' => 'repo', // String + 'required' => false, // Boolean + 'version' => '', // String + 'force_activation' => false, // Boolean + 'force_deactivation' => false, // Boolean + 'external_url' => '', // String + 'is_callable' => '', // String|Array. + ); + + // Prepare the received data. + $plugin = wp_parse_args( $plugin, $defaults ); + + if ( ! empty( $plugin['alt'] ) ) { + $args = array_merge( $plugin, array( + 'name' => $plugin['alt_name'], + 'slug' => $this->sanitize_key( $plugin['alt'] ), + 'available_separately' => true, + 'alt' => '', + 'free' => $this->sanitize_key( $plugin['slug'] ), + 'source_type' => 'external', + 'source' => __( 'MyThemeShop', 'mythemeshop' ), + 'external_url' => $plugin['info_link'], + 'description' => $plugin['alt_description'], + ) ); + $this->register( $args ); + } + + // Standardize the received slug. + $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); + + // Forgive users for using string versions of booleans or floats for version number. + $plugin['version'] = (string) $plugin['version']; + $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; + $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); + $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); + $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); + + // Enrich the received data. + $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); + $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); + + if ( ! empty( $plugin['source'] ) && preg_match( '|^/|', $plugin['source'] ) && !file_exists( $plugin['source'] ) ) { + $plugin['available_separately'] = true; + } + + if ( !empty ( $plugin['available_separately'] ) ) { + $item['source'] = __( 'Available Separately', 'mythemeshop' ); + } + + // Set the class properties. + $this->plugins[ $plugin['slug'] ] = $plugin; + $this->sort_order[ $plugin['slug'] ] = $plugin['name']; + + // Should we add the force activation hook ? + if ( true === $plugin['force_activation'] ) { + $this->has_forced_activation = true; + } + + // Should we add the force deactivation hook ? + if ( true === $plugin['force_deactivation'] ) { + $this->has_forced_deactivation = true; + } + } + + /** + * Determine what type of source the plugin comes from. + * + * @since 2.5.0 + * + * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path + * (= bundled) or an external URL. + * @return string 'repo', 'external', or 'bundled' + */ + protected function get_plugin_source_type( $source ) { + if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) { + return 'repo'; + } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) { + return 'external'; + } else { + return 'bundled'; + } + } + + /** + * Sanitizes a string key. + * + * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are* + * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase + * characters in the plugin directory path/slug. Silly them. + * + * @see https://developer.wordpress.org/reference/hooks/sanitize_key/ + * + * @since 2.5.0 + * + * @param string $key String key. + * @return string Sanitized key + */ + public function sanitize_key( $key ) { + $raw_key = $key; + $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); + + /** + * Filter a sanitized key string. + * + * @since 3.0.0 + * + * @param string $key Sanitized key. + * @param string $raw_key The key prior to sanitization. + */ + return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); + } + + /** + * Amend default configuration settings. + * + * @since 2.0.0 + * + * @param array $config Array of config options to pass as class properties. + */ + public function config( $config ) { + $keys = array( + 'id', + 'default_path', + 'has_notices', + 'dismissable', + 'dismiss_msg', + 'menu', + 'parent_slug', + 'capability', + 'is_automatic', + 'message', + 'strings', + ); + + foreach ( $keys as $key ) { + if ( isset( $config[ $key ] ) ) { + if ( is_array( $config[ $key ] ) ) { + $this->$key = array_merge( $this->$key, $config[ $key ] ); + } else { + $this->$key = $config[ $key ]; + } + } + } + } + + /** + * Amend action link after plugin installation. + * + * @since 2.0.0 + * + * @param array $install_actions Existing array of actions. + * @return array Amended array of actions. + */ + public function actions( $install_actions ) { + // Remove action links on the TGMPA install page. + if ( $this->is_tgmpa_page() ) { + return false; + } + + return $install_actions; + } + + /** + * Flushes the plugins cache on theme switch to prevent stale entries + * from remaining in the plugin table. + * + * @since 2.4.0 + * + * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache. + * Parameter added in v2.5.0. + */ + public function flush_plugins_cache( $clear_update_cache = true ) { + wp_clean_plugins_cache( $clear_update_cache ); + } + + /** + * Set file_path key for each installed plugin. + * + * @since 2.1.0 + * + * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin. + * Parameter added in v2.5.0. + */ + public function populate_file_path( $plugin_slug = '' ) { + if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { + $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); + } else { + // Add file_path key for all plugins. + foreach ( $this->plugins as $slug => $values ) { + $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); + } + } + } + + /** + * Helper function to extract the file path of the plugin file from the + * plugin slug, if the plugin is installed. + * + * @since 2.0.0 + * + * @param string $slug Plugin slug (typically folder name) as provided by the developer. + * @return string Either file path for plugin if installed, or just the plugin slug. + */ + protected function _get_plugin_basename_from_slug( $slug ) { + $keys = array_keys( $this->get_plugins() ); + + foreach ( $keys as $key ) { + if ( preg_match( '|^' . $slug . '/|', $key ) ) { + return $key; + } + } + + return $slug; + } + + /** + * Retrieve plugin data, given the plugin name. + * + * Loops through the registered plugins looking for $name. If it finds it, + * it returns the $data from that plugin. Otherwise, returns false. + * + * @since 2.1.0 + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + public function _get_plugin_data_from_name( $name, $data = 'slug' ) { + foreach ( $this->plugins as $values ) { + if ( $name === $values['name'] && isset( $values[ $data ] ) ) { + return $values[ $data ]; + } + } + + return false; + } + + /** + * Retrieve the download URL for a package. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Plugin download URL or path to local file or empty string if undetermined. + */ + public function get_download_url( $slug ) { + $dl_source = ''; + + switch ( $this->plugins[ $slug ]['source_type'] ) { + case 'repo': + return $this->get_wp_repo_download_url( $slug ); + case 'external': + return $this->plugins[ $slug ]['source']; + case 'bundled': + return $this->default_path . $this->plugins[ $slug ]['source']; + } + + return $dl_source; // Should never happen. + } + + /** + * Retrieve the download URL for a WP repo package. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Plugin download URL. + */ + protected function get_wp_repo_download_url( $slug ) { + $source = ''; + $api = $this->get_plugins_api( $slug ); + + if ( false !== $api && isset( $api->download_link ) ) { + $source = $api->download_link; + } + + return $source; + } + + /** + * Try to grab information from WordPress API. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return object Plugins_api response object on success, WP_Error on failure. + */ + protected function get_plugins_api( $slug ) { + static $api = array(); // Cache received responses. + + if ( ! isset( $api[ $slug ] ) ) { + if ( ! function_exists( 'plugins_api' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + } + + $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); + + $api[ $slug ] = false; + + if ( is_wp_error( $response ) ) { + wp_die( esc_html( $this->strings['oops'] ) ); + } else { + $api[ $slug ] = $response; + } + } + + return $api[ $slug ]; + } + + /** + * Retrieve a link to a plugin information page. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Fully formed html link to a plugin information page if available + * or the plugin name if not. + */ + public function get_info_link( $slug ) { + if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { + $link = sprintf( + '%2$s', + esc_url( $this->plugins[ $slug ]['external_url'] ), + esc_html( $this->plugins[ $slug ]['name'] ) + ); + } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { + $url = add_query_arg( + array( + 'tab' => 'plugin-information', + 'plugin' => urlencode( $slug ), + 'TB_iframe' => 'true', + 'width' => '640', + 'height' => '500', + ), + self_admin_url( 'plugin-install.php' ) + ); + + $link = sprintf( + '%2$s', + esc_url( $url ), + esc_html( $this->plugins[ $slug ]['name'] ) + ); + } else { + $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. + } + + return $link; + } + + /** + * Determine if we're on the TGMPA Install page. + * + * @since 2.1.0 + * + * @return boolean True when on the TGMPA page, false otherwise. + */ + protected function is_tgmpa_page() { + return isset( $_GET['page'] ) && $this->menu === $_GET['page']; + } + + /** + * Retrieve the URL to the TGMPA Install page. + * + * I.e. depending on the config settings passed something along the lines of: + * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins + * + * @since 2.5.0 + * + * @return string Properly encoded URL (not escaped). + */ + public function get_tgmpa_url() { + static $url; + + if ( ! isset( $url ) ) { + $parent = $this->parent_slug; + if ( false === strpos( $parent, '.php' ) ) { + $parent = 'admin.php'; + } + $url = add_query_arg( + array( + 'page' => urlencode( $this->menu ), + ), + self_admin_url( $parent ) + ); + } + + return $url; + } + + /** + * Retrieve the URL to the TGMPA Install page for a specific plugin status (view). + * + * I.e. depending on the config settings passed something along the lines of: + * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install + * + * @since 2.5.0 + * + * @param string $status Plugin status - either 'install', 'update' or 'activate'. + * @return string Properly encoded URL (not escaped). + */ + public function get_tgmpa_status_url( $status ) { + return add_query_arg( + array( + 'plugin_status' => urlencode( $status ), + ), + $this->get_tgmpa_url() + ); + } + + /** + * Determine whether there are open actions for plugins registered with TGMPA. + * + * @since 2.5.0 + * + * @return bool True if complete, i.e. no outstanding actions. False otherwise. + */ + public function is_tgmpa_complete() { + + return false; // we will just return false to prevent the page from disappearing + + $complete = true; + foreach ( $this->plugins as $slug => $plugin ) { + if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { + $complete = false; + break; + } + } + + return $complete; + } + + /** + * Check if a plugin is installed. Does not take must-use plugins into account. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if installed, false otherwise. + */ + public function is_plugin_installed( $slug ) { + $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). + + return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); + } + + /** + * Check if a plugin is active. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if active, false otherwise. + */ + public function is_plugin_active( $slug ) { + return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); + } + + /** + * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required + * available, check whether the current install meets them. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to update, false otherwise. + */ + public function can_plugin_update( $slug ) { + // We currently can't get reliable info on non-WP-repo plugins - issue #380. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + return true; + } + + $api = $this->get_plugins_api( $slug ); + + if ( false !== $api && isset( $api->requires ) ) { + return version_compare( $GLOBALS['wp_version'], $api->requires, '>=' ); + } + + // No usable info received from the plugins API, presume we can update. + return true; + } + + /** + * Check if a plugin can be activated, i.e. is not currently active and meets the minimum + * plugin version requirements set in TGMPA (if any). + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to activate, false otherwise. + */ + public function can_plugin_activate( $slug ) { + return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) ); + } + + /** + * Retrieve the version number of an installed plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Version number as string or an empty string if the plugin is not installed + * or version unknown (plugins which don't comply with the plugin header standard). + */ + public function get_installed_version( $slug ) { + $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). + + if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { + return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; + } + + return ''; + } + + /** + * Check whether a plugin complies with the minimum version requirements. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True when a plugin needs to be updated, otherwise false. + */ + public function does_plugin_require_update( $slug ) { + $installed_version = $this->get_installed_version( $slug ); + $minimum_version = $this->plugins[ $slug ]['version']; + + return version_compare( $minimum_version, $installed_version, '>' ); + } + + /** + * Check whether there is an update available for a plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return false|string Version number string of the available update or false if no update available. + */ + public function does_plugin_have_update( $slug ) { + // Presume bundled and external plugins will point to a package which meets the minimum required version. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + if ( $this->does_plugin_require_update( $slug ) ) { + return $this->plugins[ $slug ]['version']; + } + + return false; + } + + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { + return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; + } + + return false; + } + + /** + * Retrieve potential upgrade notice for a plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string The upgrade notice or an empty string if no message was available or provided. + */ + public function get_upgrade_notice( $slug ) { + // We currently can't get reliable info on non-WP-repo plugins - issue #380. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + return ''; + } + + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { + return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; + } + + return ''; + } + + /** + * Wrapper around the core WP get_plugins function, making sure it's actually available. + * + * @since 2.5.0 + * + * @param string $plugin_folder Optional. Relative path to single plugin folder. + * @return array Array of installed plugins with plugin information. + */ + public function get_plugins( $plugin_folder = '' ) { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + return get_plugins( $plugin_folder ); + } + + /** + * Delete dismissable nag option when theme is switched. + * + * This ensures that the user(s) is/are again reminded via nag of required + * and/or recommended plugins if they re-activate the theme. + * + * @since 2.1.1 + */ + public function update_dismiss() { + delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true ); + } + + /** + * Forces plugin activation if the parameter 'force_activation' is + * set to true. + * + * This allows theme authors to specify certain plugins that must be + * active at all times while using the current theme. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. Setting this parameter + * to true will not allow the specified plugin to be deactivated unless + * the user switches themes. + * + * @since 2.2.0 + */ + public function force_activation() { + foreach ( $this->plugins as $slug => $plugin ) { + if ( true === $plugin['force_activation'] ) { + if ( ! $this->is_plugin_installed( $slug ) ) { + // Oops, plugin isn't there so iterate to next condition. + continue; + } elseif ( $this->can_plugin_activate( $slug ) ) { + // There we go, activate the plugin. + activate_plugin( $plugin['file_path'] ); + } + } + } + } + + /** + * Forces plugin deactivation if the parameter 'force_deactivation' + * is set to true. + * + * This allows theme authors to specify certain plugins that must be + * deactivated upon switching from the current theme to another. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. + * + * @since 2.2.0 + */ + public function force_deactivation() { + foreach ( $this->plugins as $slug => $plugin ) { + // Only proceed forward if the parameter is set to true and plugin is active. + if ( true === $plugin['force_deactivation'] && $this->is_plugin_active( $slug ) ) { + deactivate_plugins( $plugin['file_path'] ); + } + } + } + + /** + * Echo the current TGMPA version number to the page. + */ + public function show_tgmpa_version() { + echo '

    ', + esc_html( sprintf( _x( 'TGMPA v%s', '%s = version number', 'mythemeshop' ), self::TGMPA_VERSION ) ), + '

    '; + } + + /** + * Returns the singleton instance of the class. + * + * @since 2.4.0 + * + * @return object The TGM_Plugin_Activation object. + */ + public static function get_instance() { + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { + self::$instance = new self(); + } + + return self::$instance; + } + } + + if ( ! function_exists( 'load_tgm_plugin_activation' ) ) { + /** + * Ensure only one instance of the class is ever invoked. + */ + function load_tgm_plugin_activation() { + $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance(); + } + } + + if ( did_action( 'plugins_loaded' ) ) { + load_tgm_plugin_activation(); + } else { + add_action( 'plugins_loaded', 'load_tgm_plugin_activation' ); + } +} + +if ( ! function_exists( 'tgmpa' ) ) { + /** + * Helper function to register a collection of required plugins. + * + * @since 2.0.0 + * @api + * + * @param array $plugins An array of plugin arrays. + * @param array $config Optional. An array of configuration values. + */ + function tgmpa( $plugins, $config = array() ) { + $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + foreach ( $plugins as $plugin ) { + call_user_func( array( $instance, 'register' ), $plugin ); + } + + if ( ! empty( $config ) && is_array( $config ) ) { + // Send out notices for deprecated arguments passed. + if ( isset( $config['notices'] ) ) { + _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); + if ( ! isset( $config['has_notices'] ) ) { + $config['has_notices'] = $config['notices']; + } + } + + if ( isset( $config['parent_menu_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + if ( isset( $config['parent_url_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + + call_user_func( array( $instance, 'config' ), $config ); + } + } +} + +/** + * WP_List_Table isn't always available. If it isn't available, + * we load it here. + * + * @since 2.2.0 + */ +if ( ! class_exists( 'WP_List_Table' ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; +} + +if ( ! class_exists( 'TGMPA_List_Table' ) ) { + + /** + * List table class for handling plugins. + * + * Extends the WP_List_Table class to provide a future-compatible + * way of listing out all required/recommended plugins. + * + * Gives users an interface similar to the Plugin Administration + * area with similar (albeit stripped down) capabilities. + * + * This class also allows for the bulk install of plugins. + * + * @since 2.2.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_List_Table extends WP_List_Table { + /** + * TGMPA instance. + * + * @since 2.5.0 + * + * @var TGM_Plugin_Activation + */ + protected $tgmpa; + + /** + * The currently chosen view. + * + * @since 2.5.0 + * + * @var string One of: 'all', 'install', 'update', 'activate' + */ + public $view_context = 'all'; + + /** + * The plugin counts for the various views. + * + * @since 2.5.0 + * + * @var array + */ + protected $view_totals = array( + 'all' => 0, + 'install' => 0, + 'update' => 0, + 'activate' => 0, + ); + + /** + * References parent constructor and sets defaults for class. + * + * @since 2.2.0 + */ + public function __construct() { + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + parent::__construct( + array( + 'singular' => 'plugin', + 'plural' => 'plugins', + 'ajax' => false, + ) + ); + + if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) { + $this->view_context = sanitize_key( $_REQUEST['plugin_status'] ); + } + + add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) ); + } + + /** + * Get a list of CSS classes for the tag. + * + * Overruled to prevent the 'plural' argument from being added. + * + * @since 2.5.0 + * + * @return array CSS classnames. + */ + public function get_table_classes() { + return array( 'widefat', 'plugins' ); + } + + /** + * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table. + * + * @since 2.2.0 + * + * @return array $table_data Information for use in table. + */ + protected function _gather_plugin_data() { + // Load thickbox for plugin links. + $this->tgmpa->admin_init(); + $this->tgmpa->thickbox(); + + // Categorize the plugins which have open actions. + $plugins = $this->categorize_plugins_to_views(); + + // Set the counts for the view links. + $this->set_view_totals( $plugins ); + + // Prep variables for use and grab list of all installed plugins. + $table_data = array(); + $i = 0; + + // Redirect to the 'all' view if no plugins were found for the selected view context. + if ( empty( $plugins[ $this->view_context ] ) ) { + $this->view_context = 'all'; + } + + foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) { + $table_data[ $i ]['sanitized_plugin'] = $plugin['name']; + $table_data[ $i ]['slug'] = $slug; + $table_data[ $i ]['plugin'] = '' . $this->tgmpa->get_info_link( $slug ) . ''; + $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] ); + $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] ); + $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug ); + $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug ); + $table_data[ $i ]['minimum_version'] = $plugin['version']; + $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug ); + + if ( ! empty( $plugin['description'] ) ) { + $table_data[ $i ]['description'] = $plugin['description']; + } + + // Prep the upgrade notice info. + $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug ); + if ( ! empty( $upgrade_notice ) ) { + $table_data[ $i ]['upgrade_notice'] = $upgrade_notice; + + add_action( "tgmpa_after_plugin_row_$slug", array( $this, 'wp_plugin_update_row' ), 10, 2 ); + } + + $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin ); + + $i++; + } + + return $table_data; + } + + /** + * Categorize the plugins which have open actions into views for the TGMPA page. + * + * @since 2.5.0 + */ + protected function categorize_plugins_to_views() { + $plugins = array( + 'all' => array(), // Meaning: all plugins which still have open actions. + 'install' => array(), + 'update' => array(), + 'activate' => array(), + ); + + foreach ( $this->tgmpa->plugins as $slug => $plugin ) { + $plugins['all'][ $slug ] = $plugin; + + if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { + $plugins['install'][ $slug ] = $plugin; + } else { + if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { + $plugins['update'][ $slug ] = $plugin; + } + + if ( $this->tgmpa->can_plugin_activate( $slug ) ) { + $plugins['activate'][ $slug ] = $plugin; + } + } + } + + return $plugins; + } + + /** + * Set the counts for the view links. + * + * @since 2.5.0 + * + * @param array $plugins Plugins order by view. + */ + protected function set_view_totals( $plugins ) { + foreach ( $plugins as $type => $list ) { + $this->view_totals[ $type ] = count( $list ); + } + } + + /** + * Get the plugin required/recommended text string. + * + * @since 2.5.0 + * + * @param string $required Plugin required setting. + * @return string + */ + protected function get_plugin_advise_type_text( $required ) { + if ( true === $required ) { + return __( 'Required', 'mythemeshop' ); + } + + return __( 'Recommended', 'mythemeshop' ); + } + + /** + * Get the plugin source type text string. + * + * @since 2.5.0 + * + * @param string $type Plugin type. + * @return string + */ + protected function get_plugin_source_type_text( $type ) { + $string = ''; + + switch ( $type ) { + case 'repo': + $string = __( 'WordPress Repository', 'mythemeshop' ); + break; + case 'external': + $string = __( 'External Source', 'mythemeshop' ); + break; + case 'bundled': + $string = __( 'Pre-Packaged', 'mythemeshop' ); + break; + } + + return $string; + } + + /** + * Determine the plugin status message. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string + */ + protected function get_plugin_status_text( $slug ) { + if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { + return __( 'Not Installed', 'mythemeshop' ); + } + + if ( ! $this->tgmpa->is_plugin_active( $slug ) ) { + $install_status = __( 'Installed But Not Activated', 'mythemeshop' ); + } else { + $install_status = __( 'Active', 'mythemeshop' ); + } + + $update_status = ''; + + if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { + $update_status = __( 'Required Update not Available', 'mythemeshop' ); + + } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) { + $update_status = __( 'Requires Update', 'mythemeshop' ); + + } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { + $update_status = __( 'Update recommended', 'mythemeshop' ); + } + + if ( '' === $update_status ) { + return $install_status; + } + + return sprintf( + _x( '%1$s, %2$s', '%1$s = install status, %2$s = update status', 'mythemeshop' ), + $install_status, + $update_status + ); + } + + /** + * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type. + * + * @since 2.5.0 + * + * @param array $items Prepared table items. + * @return array Sorted table items. + */ + public function sort_table_items( $items ) { + $type = array(); + $name = array(); + + foreach ( $items as $i => $plugin ) { + $type[ $i ] = $plugin['type']; // Required / recommended. + $name[ $i ] = $plugin['sanitized_plugin']; + } + + array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items ); + + return $items; + } + + /** + * Get an associative array ( id => link ) of the views available on this table. + * + * @since 2.5.0 + * + * @return array + */ + public function get_views() { + $status_links = array(); + + foreach ( $this->view_totals as $type => $count ) { + if ( $count < 1 ) { + continue; + } + + switch ( $type ) { + case 'all': + $text = wp_kses( _nx( 'All (%s)', 'All (%s)', $count, 'plugins', 'mythemeshop' ), array( 'span' ) ); + break; + case 'install': + $text = wp_kses( _n( 'To Install (%s)', 'To Install (%s)', $count, 'mythemeshop' ), array( 'span' ) ); + break; + case 'update': + $text = wp_kses( _n( 'Update Available (%s)', 'Update Available (%s)', $count, 'mythemeshop' ), array( 'span' ) ); + break; + case 'activate': + $text = wp_kses( _n( 'To Activate (%s)', 'To Activate (%s)', $count, 'mythemeshop' ), array( 'span' ) ); + break; + default: + $text = ''; + break; + } + + if ( ! empty( $text ) ) { + + $status_links[ $type ] = sprintf( + '%s', + esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ), + ( $type === $this->view_context ) ? ' class="current"' : '', + sprintf( $text, number_format_i18n( $count ) ) + ); + } + } + + return $status_links; + } + + /** + * Create default columns to display important plugin information + * like type, action and status. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @param string $column_name The name of the column. + * @return string + */ + public function column_default( $item, $column_name ) { + return $item[ $column_name ]; + } + + /** + * Required for bulk installing. + * + * Adds a checkbox for each plugin. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The input checkbox with all necessary info. + */ + public function column_cb( $item ) { + return sprintf( + '', + esc_attr( $this->_args['singular'] ), + esc_attr( $item['slug'] ), + esc_attr( $item['sanitized_plugin'] ) + ); + } + + /** + * Create default title column along with the action links. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The plugin name and action links. + */ + public function column_plugin( $item ) { + return sprintf( + '%1$s %2$s', + $item['plugin'], + $this->row_actions( $this->get_row_actions( $item ), true ) + ); + } + + public function column_description( $item ) + { + $plugins = $this->tgmpa->get_plugins(); + $trimmed = trim( $item['sanitized_plugin'] ); + $description = ''; + + if ( ! empty( $item['description'] ) ) { + $description = $item['description']; + } else { + foreach ( $plugins as $plugin ) { + if ( $trimmed === $plugin['Name'] ) { + $description = $plugin['Description']; + } + } + } + if ( empty( $description ) ) { + $plugin = @json_decode( @file_get_contents( 'https://api.wordpress.org/plugins/info/1.0/' . $item['slug'] . '.json' ), true ); + if ( ! empty( $plugin['short_description'] ) ) { + $description = $plugin['short_description']; + } + } + + if ( ! empty ( $description ) ) { + $description .= '

    '; + } + + $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : __( 'Not Installed', 'mythemeshop' ); + $description .= sprintf( __( 'Version: %s', 'mythemeshop' ), $installed ); + $description .= ' | ' . sprintf( __( 'Source: %s', 'mythemeshop' ), $item['source'] ); + + if ( ! empty( $item['info_link'] ) ) { + $description .= ' | ' . sprintf( '' . __( 'Visit plugin site', 'mythemeshop' ) . '', $item['info_link'] ); + } + + return $description; + } + + /** + * Create version information column. + * + * @since 2.5.0 + * + * @param array $item Array of item data. + * @return string HTML-formatted version information. + */ + public function column_version( $item ) { + $output = array(); + + if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { + $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'mythemeshop' ); + + $color = ''; + if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) { + $color = ' color: #ff0000; font-weight: bold;'; + } + + $output[] = sprintf( + '

    %2$s' . __( 'Installed version:', 'mythemeshop' ) . '

    ', + $color, + $installed + ); + } + + if ( ! empty( $item['minimum_version'] ) ) { + $output[] = sprintf( + '

    %1$s' . __( 'Minimum required version:', 'mythemeshop' ) . '

    ', + $item['minimum_version'] + ); + } + + if ( ! empty( $item['available_version'] ) ) { + $color = ''; + if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) { + $color = ' color: #71C671; font-weight: bold;'; + } + + $output[] = sprintf( + '

    %2$s' . __( 'Available version:', 'mythemeshop' ) . '

    ', + $color, + $item['available_version'] + ); + } + + if ( empty( $output ) ) { + return ' '; // Let's not break the table layout. + } else { + return implode( "\n", $output ); + } + } + + /** + * Sets default message within the plugins table if no plugins + * are left for interaction. + * + * Hides the menu item to prevent the user from clicking and + * getting a permissions error. + * + * @since 2.2.0 + */ + public function no_items() { + printf( wp_kses( __( 'No plugins to install, update or activate. Return to the Dashboard', 'mythemeshop' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( self_admin_url() ) ); + echo ''; + } + + /** + * Output all the column information within the table. + * + * @since 2.2.0 + * + * @return array $columns The column names. + */ + public function get_columns() { + $columns = array( + 'cb' => '', + 'plugin' => __( 'Plugin', 'mythemeshop' ), + 'description' => __( 'Description', 'mythemeshop' ), + ); + + return apply_filters( 'tgmpa_table_columns', $columns ); + } + + /** + * Get name of default primary column + * + * @since 2.5.0 / WP 4.3+ compatibility + * @access protected + * + * @return string + */ + protected function get_default_primary_column_name() { + return 'plugin'; + } + + /** + * Get the name of the primary column. + * + * @since 2.5.0 / WP 4.3+ compatibility + * @access protected + * + * @return string The name of the primary column. + */ + protected function get_primary_column_name() { + if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) { + return parent::get_primary_column_name(); + } else { + return $this->get_default_primary_column_name(); + } + } + + /** + * Get the actions which are relevant for a specific plugin row. + * + * @since 2.5.0 + * + * @param array $item Array of item data. + * @return array Array with relevant action links. + */ + protected function get_row_actions( $item ) { + $actions = array(); + $action_links = array(); + + // Display the 'Install' action link if the plugin is not yet available. + if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { + $actions['install'] = _x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'mythemeshop' ); + } else { + // Display the 'Update' action link if an update is available and WP complies with plugin minimum. + if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) { + $actions['update'] = _x( 'Update %2$s', '%2$s = plugin name in screen reader markup', 'mythemeshop' ); + } + + // Display the 'Activate' action link, but only if the plugin meets the minimum version. + if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) { + $actions['activate'] = _x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'mythemeshop' ); + } + } + + // Create the actual links. + foreach ( $actions as $action => $text ) { + $nonce_url = wp_nonce_url( + add_query_arg( + array( + 'plugin' => urlencode( $item['slug'] ), + 'tgmpa-' . $action => $action . '-plugin', + ), + $this->tgmpa->get_tgmpa_url() + ), + 'tgmpa-' . $action, + 'tgmpa-nonce' + ); + + $action_links[ $action ] = sprintf( + '' . esc_html( $text ) . '', + esc_url( $nonce_url ), + '' . esc_html( $item['sanitized_plugin'] ) . '' + ); + } + + $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : ''; + return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context ); + } + + /** + * Generates content for a single row of the table. + * + * @since 2.5.0 + * + * @param object $item The current item. + */ + public function single_row( $item ) { + echo ''; + $this->single_row_columns( $item ); + echo ''; + + /** + * Fires after each specific row in the TGMPA Plugins list table. + * + * The dynamic portion of the hook name, `$item['slug']`, refers to the slug + * for the plugin. + * + * @since 2.5.0 + */ + do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context ); + } + + /** + * Show the upgrade notice below a plugin row if there is one. + * + * @since 2.5.0 + * + * @see /wp-admin/includes/update.php + * + * @param string $slug Plugin slug. + * @param array $item The information available in this table row. + * @return null Return early if upgrade notice is empty. + */ + public function wp_plugin_update_row( $slug, $item ) { + if ( empty( $item['upgrade_notice'] ) ) { + return; + } + + echo ' + + + '; + } + + /** + * Extra controls to be displayed between bulk actions and pagination. + * + * @since 2.5.0 + * + * @param string $which 'top' or 'bottom' table navigation. + */ + public function extra_tablenav( $which ) { + if ( 'bottom' === $which ) { + $this->tgmpa->show_tgmpa_version(); + } + } + + /** + * Defines the bulk actions for handling registered plugins. + * + * @since 2.2.0 + * + * @return array $actions The bulk actions for the plugin install table. + */ + public function get_bulk_actions() { + + $actions = array(); + + if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) { + if ( current_user_can( 'install_plugins' ) ) { + $actions['tgmpa-bulk-install'] = __( 'Install', 'mythemeshop' ); + } + } + + if ( 'install' !== $this->view_context ) { + if ( current_user_can( 'update_plugins' ) ) { + $actions['tgmpa-bulk-update'] = __( 'Update', 'mythemeshop' ); + } + if ( current_user_can( 'activate_plugins' ) ) { + $actions['tgmpa-bulk-activate'] = __( 'Activate', 'mythemeshop' ); + } + } + + return $actions; + } + + /** + * Processes bulk installation and activation actions. + * + * The bulk installation process looks for the $_POST information and passes that + * through if a user has to use WP_Filesystem to enter their credentials. + * + * @since 2.2.0 + */ + public function process_bulk_actions() { + // Bulk installation process. + if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) { + + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + $install_type = 'install'; + if ( 'tgmpa-bulk-update' === $this->current_action() ) { + $install_type = 'update'; + } + + $plugins_to_install = array(); + + // Did user actually select any plugins to install/update ? + if ( empty( $_POST['plugin'] ) ) { + if ( 'install' === $install_type ) { + $message = __( 'No plugins were selected to be installed. No action taken.', 'mythemeshop' ); + } else { + $message = __( 'No plugins were selected to be updated. No action taken.', 'mythemeshop' ); + } + + echo '

    ', esc_html( $message ), '

    '; + + return false; + } + + if ( is_array( $_POST['plugin'] ) ) { + $plugins_to_install = (array) $_POST['plugin']; + } elseif ( is_string( $_POST['plugin'] ) ) { + // Received via Filesystem page - un-flatten array (WP bug #19643). + $plugins_to_install = explode( ',', $_POST['plugin'] ); + } + + // Sanitize the received input. + $plugins_to_install = array_map( 'urldecode', $plugins_to_install ); + $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install ); + + // Validate the received input. + foreach ( $plugins_to_install as $key => $slug ) { + // Check if the plugin was registered with TGMPA and remove if not. + if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) { + unset( $plugins_to_install[ $key ] ); + continue; + } + + // For updates: make sure this is a plugin we *can* update (update available and WP version ok). + if ( 'update' === $install_type && ( $this->tgmpa->is_plugin_installed( $slug ) && ( false === $this->tgmpa->does_plugin_have_update( $slug ) || ! $this->tgmpa->can_plugin_update( $slug ) ) ) ) { + unset( $plugins_to_install[ $key ] ); + } + } + + // No need to proceed further if we have no plugins to handle. + if ( empty( $plugins_to_install ) ) { + if ( 'install' === $install_type ) { + $message = __( 'No plugins are available to be installed at this time.', 'mythemeshop' ); + } else { + $message = __( 'No plugins are available to be updated at this time.', 'mythemeshop' ); + } + + echo '

    ', esc_html( $message ), '

    '; + + return false; + } + + // Pass all necessary information if WP_Filesystem is needed. + $url = wp_nonce_url( + $this->tgmpa->get_tgmpa_url(), + 'bulk-' . $this->_args['plural'] + ); + + // Give validated data back to $_POST which is the only place the filesystem looks for extra fields. + $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. + + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem. + + if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) { + return true; // Stop the normal page form from displaying, credential request form will be shown. + } + + // Now we have some credentials, setup WP_Filesystem. + if ( ! WP_Filesystem( $creds ) ) { + // Our credentials were no good, ask the user for them again. + request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields ); + + return true; + } + + /* If we arrive here, we have the filesystem */ + + // Store all information in arrays since we are processing a bulk installation. + $names = array(); + $sources = array(); // Needed for installs. + $file_paths = array(); // Needed for upgrades. + $to_inject = array(); // Information to inject into the update_plugins transient. + + // Prepare the data for validated plugins for the install/upgrade. + foreach ( $plugins_to_install as $slug ) { + $name = $this->tgmpa->plugins[ $slug ]['name']; + $source = $this->tgmpa->get_download_url( $slug ); + + if ( ! empty( $name ) && ! empty( $source ) ) { + $names[] = $name; + + switch ( $install_type ) { + + case 'install': + $sources[] = $source; + break; + + case 'update': + $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path']; + $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ]; + $to_inject[ $slug ]['source'] = $source; + break; + } + } + } + unset( $slug, $name, $source ); + + // Create a new instance of TGMPA_Bulk_Installer. + $installer = new TGMPA_Bulk_Installer( + new TGMPA_Bulk_Installer_Skin( + array( + 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), + 'nonce' => 'bulk-' . $this->_args['plural'], + 'names' => $names, + 'install_type' => $install_type, + ) + ) + ); + + // Wrap the install process with the appropriate HTML. + echo '
    ', + '

    ', esc_html( get_admin_page_title() ), '

    '; + + // Process the bulk installation submissions. + add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); + + if ( 'tgmpa-bulk-update' === $this->current_action() ) { + // Inject our info into the update transient. + $this->tgmpa->inject_update_info( $to_inject ); + + $installer->bulk_upgrade( $file_paths ); + } else { + $installer->bulk_install( $sources ); + } + + remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); + + echo '
    '; + + return true; + } + + // Bulk activation process. + if ( 'tgmpa-bulk-activate' === $this->current_action() ) { + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + // Did user actually select any plugins to activate ? + if ( empty( $_POST['plugin'] ) ) { + echo '

    ', esc_html__( 'No plugins were selected to be activated. No action taken.', 'mythemeshop' ), '

    '; + + return false; + } + + // Grab plugin data from $_POST. + $plugins = array(); + if ( isset( $_POST['plugin'] ) ) { + $plugins = array_map( 'urldecode', (array) $_POST['plugin'] ); + $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins ); + } + + $plugins_to_activate = array(); + $plugin_names = array(); + + // Grab the file paths for the selected & inactive plugins from the registration array. + foreach ( $plugins as $slug ) { + if ( $this->tgmpa->can_plugin_activate( $slug ) ) { + $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path']; + $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name']; + } + } + unset( $slug ); + + // Return early if there are no plugins to activate. + if ( empty( $plugins_to_activate ) ) { + echo '

    ', esc_html__( 'No plugins are available to be activated at this time.', 'mythemeshop' ), '

    '; + + return false; + } + + // Now we are good to go - let's start activating plugins. + $activate = activate_plugins( $plugins_to_activate ); + + if ( is_wp_error( $activate ) ) { + echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    '; + } else { + $count = count( $plugin_names ); // Count so we can use _n function. + $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names ); + $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. + $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'mythemeshop' ) . ' ' . $last_plugin ); + + printf( // WPCS: xss ok. + '

    %1$s %2$s.

    ', + esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'mythemeshop' ) ), + $imploded + ); + + // Update recently activated plugins option. + $recent = (array) get_option( 'recently_activated' ); + foreach ( $plugins_to_activate as $plugin => $time ) { + if ( isset( $recent[ $plugin ] ) ) { + unset( $recent[ $plugin ] ); + } + } + update_option( 'recently_activated', $recent ); + } + + unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another. + + return true; + } + + return false; + } + + /** + * Prepares all of our information to be outputted into a usable table. + * + * @since 2.2.0 + */ + public function prepare_items() { + $columns = $this->get_columns(); // Get all necessary column information. + $hidden = array(); // No columns to hide, but we must set as an array. + $sortable = array(); // No reason to make sortable columns. + $primary = $this->get_primary_column_name(); // Column which has the row actions. + $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers. + + // Process our bulk activations here. + if ( 'tgmpa-bulk-activate' === $this->current_action() ) { + $this->process_bulk_actions(); + } + + // Store all of our plugin data into $items array so WP_List_Table can use it. + $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() ); + } + + /* *********** DEPRECATED METHODS *********** */ + + /** + * Retrieve plugin data, given the plugin name. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead. + * @see TGM_Plugin_Activation::_get_plugin_data_from_name() + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' ); + + return $this->tgmpa->_get_plugin_data_from_name( $name, $data ); + } + } +} + + +if ( ! class_exists( 'TGM_Bulk_Installer' ) ) { + + /** + * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+. + */ + class TGM_Bulk_Installer { + } +} +if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) { + + /** + * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+. + */ + class TGM_Bulk_Installer_Skin { + } +} + +/** + * The WP_Upgrader file isn't always available. If it isn't available, + * we load it here. + * + * We check to make sure no action or activation keys are set so that WordPress + * does not try to re-include the class when processing upgrades or installs outside + * of the class. + * + * @since 2.2.0 + */ +add_action( 'admin_init', 'tgmpa_load_bulk_installer' ); +if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) { + /** + * Load bulk installer + */ + function tgmpa_load_bulk_installer() { + // Silently fail if 2.5+ is loaded *after* an older version. + if ( ! isset( $GLOBALS['tgmpa'] ) ) { + return; + } + + // Get TGMPA class instance. + $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) { + if ( ! class_exists( 'Plugin_Upgrader', false ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) { + + /** + * Installer class to handle bulk plugin installations. + * + * Extends WP_Upgrader and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * @internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader + * @internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer. + * This was done to prevent backward compatibility issues with v2.3.6. + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_Bulk_Installer extends Plugin_Upgrader { + /** + * Holds result of bulk plugin installation. + * + * @since 2.2.0 + * + * @var string + */ + public $result; + + /** + * Flag to check if bulk installation is occurring or not. + * + * @since 2.2.0 + * + * @var boolean + */ + public $bulk = false; + + /** + * TGMPA instance + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * Whether or not the destination directory needs to be cleared ( = on update). + * + * @since 2.5.0 + * + * @var bool + */ + protected $clear_destination = false; + + /** + * References parent constructor and sets defaults for class. + * + * @since 2.2.0 + * + * @param \Bulk_Upgrader_Skin|null $skin Installer skin. + */ + public function __construct( $skin = null ) { + // Get TGMPA class instance. + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + parent::__construct( $skin ); + + if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { + $this->clear_destination = true; + } + + if ( $this->tgmpa->is_automatic ) { + $this->activate_strings(); + } + + add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) ); + } + + /** + * Sets the correct activation strings for the installer skin to use. + * + * @since 2.2.0 + */ + public function activate_strings() { + $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'mythemeshop' ); + $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'mythemeshop' ); + } + + /** + * Performs the actual installation of each plugin. + * + * @since 2.2.0 + * + * @see WP_Upgrader::run() + * + * @param array $options The installation config options. + * @return null|array Return early if error, array of installation data on success. + */ + public function run( $options ) { + $result = parent::run( $options ); + + // Reset the strings in case we changed one during automatic activation. + if ( $this->tgmpa->is_automatic ) { + if ( 'update' === $this->skin->options['install_type'] ) { + $this->upgrade_strings(); + } else { + $this->install_strings(); + } + } + + return $result; + } + + /** + * Processes the bulk installation of plugins. + * + * @since 2.2.0 + * + * @internal This is basically a near identical copy of the WP Core Plugin_Upgrader::bulk_upgrade() + * method, with minor adjustments to deal with new installs instead of upgrades. + * For ease of future synchronizations, the adjustments are clearly commented, but no other + * comments are added. Code style has been made to comply. + * + * @see Plugin_Upgrader::bulk_upgrade() + * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838 + * + * @param array $plugins The plugin sources needed for installation. + * @param array $args Arbitrary passed extra arguments. + * @return string|bool Install confirmation messages on success, false on failure. + */ + public function bulk_install( $plugins, $args = array() ) { + // [TGMPA + ] Hook auto-activation in. + add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + $defaults = array( + 'clear_update_cache' => true, + ); + $parsed_args = wp_parse_args( $args, $defaults ); + + $this->init(); + $this->bulk = true; + + $this->install_strings(); // [TGMPA + ] adjusted. + + /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */ + + /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */ + + $this->skin->header(); + + // Connect to the Filesystem first. + $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); + if ( ! $res ) { + $this->skin->footer(); + + return false; + } + + $this->skin->bulk_header(); + + // Only start maintenance mode if: + // - running Multisite and there are one or more plugins specified, OR + // - a plugin with an update available is currently active. + // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. + $maintenance = ( is_multisite() && ! empty( $plugins ) ); + + /* + [TGMPA - ] + foreach ( $plugins as $plugin ) + $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) ); + */ + if ( $maintenance ) { + $this->maintenance_mode( true ); + } + + $results = array(); + + $this->update_count = count( $plugins ); + $this->update_current = 0; + foreach ( $plugins as $plugin ) { + $this->update_current++; + + /* + [TGMPA - ] + $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true); + + if ( !isset( $current->response[ $plugin ] ) ) { + $this->skin->set_result('up_to_date'); + $this->skin->before(); + $this->skin->feedback('up_to_date'); + $this->skin->after(); + $results[$plugin] = true; + continue; + } + + // Get the URL to the zip file + $r = $current->response[ $plugin ]; + + $this->skin->plugin_active = is_plugin_active($plugin); + */ + + $result = $this->run( array( + 'package' => $plugin, // [TGMPA + ] adjusted. + 'destination' => WP_PLUGIN_DIR, + 'clear_destination' => false, // [TGMPA + ] adjusted. + 'clear_working' => true, + 'is_multi' => true, + 'hook_extra' => array( + 'plugin' => $plugin, + ), + ) ); + + $results[ $plugin ] = $this->result; + + // Prevent credentials auth screen from displaying multiple times. + if ( false === $result ) { + break; + } + } //end foreach $plugins + + $this->maintenance_mode( false ); + + /** + * Fires when the bulk upgrader process is complete. + * + * @since WP 3.6.0 / TGMPA 2.5.0 + * + * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might + * be a Theme_Upgrader or Core_Upgrade instance. + * @param array $data { + * Array of bulk item update data. + * + * @type string $action Type of action. Default 'update'. + * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. + * @type bool $bulk Whether the update process is a bulk update. Default true. + * @type array $packages Array of plugin, theme, or core packages to update. + * } + */ + do_action( 'upgrader_process_complete', $this, array( + 'action' => 'install', // [TGMPA + ] adjusted. + 'type' => 'plugin', + 'bulk' => true, + 'plugins' => $plugins, + ) ); + + $this->skin->bulk_footer(); + + $this->skin->footer(); + + // Cleanup our hooks, in case something else does a upgrade on this connection. + /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */ + + // [TGMPA + ] Remove our auto-activation hook. + remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + // Force refresh of plugin update information. + wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); + + return $results; + } + + /** + * Handle a bulk upgrade request. + * + * @since 2.5.0 + * + * @see Plugin_Upgrader::bulk_upgrade() + * + * @param array $plugins The local WP file_path's of the plugins which should be upgraded. + * @param array $args Arbitrary passed extra arguments. + * @return string|bool Install confirmation messages on success, false on failure. + */ + public function bulk_upgrade( $plugins, $args = array() ) { + + add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + $result = parent::bulk_upgrade( $plugins, $args ); + + remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + return $result; + } + + /** + * Abuse a filter to auto-activate plugins after installation. + * + * Hooked into the 'upgrader_post_install' filter hook. + * + * @since 2.5.0 + * + * @param bool $bool The value we need to give back (true). + * @return bool + */ + public function auto_activate( $bool ) { + // Only process the activation of installed plugins if the automatic flag is set to true. + if ( $this->tgmpa->is_automatic ) { + // Flush plugins cache so the headers of the newly installed plugins will be read correctly. + wp_clean_plugins_cache(); + + // Get the installed plugin file. + $plugin_info = $this->plugin_info(); + + // Don't try to activate on upgrade of active plugin as WP will do this already. + if ( ! is_plugin_active( $plugin_info ) ) { + $activate = activate_plugin( $plugin_info ); + + // Adjust the success string based on the activation result. + $this->strings['process_success'] = $this->strings['process_success'] . "
    \n"; + + if ( is_wp_error( $activate ) ) { + $this->skin->error( $activate ); + $this->strings['process_success'] .= $this->strings['activation_failed']; + } else { + $this->strings['process_success'] .= $this->strings['activation_success']; + } + } + } + + return $bool; + } + } + } + + if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) { + + /** + * Installer skin to set strings for the bulk plugin installations.. + * + * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * @internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to + * TGMPA_Bulk_Installer_Skin. + * This was done to prevent backward compatibility issues with v2.3.6. + * + * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin { + /** + * Holds plugin info for each individual plugin installation. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_info = array(); + + /** + * Holds names of plugins that are undergoing bulk installations. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_names = array(); + + /** + * Integer to use for iteration through each plugin installation. + * + * @since 2.2.0 + * + * @var integer + */ + public $i = 0; + + /** + * TGMPA instance + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * Constructor. Parses default args with new ones and extracts them for use. + * + * @since 2.2.0 + * + * @param array $args Arguments to pass for use within the class. + */ + public function __construct( $args = array() ) { + // Get TGMPA class instance. + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + // Parse default and new args. + $defaults = array( + 'url' => '', + 'nonce' => '', + 'names' => array(), + 'install_type' => 'install', + ); + $args = wp_parse_args( $args, $defaults ); + + // Set plugin names to $this->plugin_names property. + $this->plugin_names = $args['names']; + + // Extract the new args. + parent::__construct( $args ); + } + + /** + * Sets install skin strings for each individual plugin. + * + * Checks to see if the automatic activation flag is set and uses the + * the proper strings accordingly. + * + * @since 2.2.0 + */ + public function add_strings() { + if ( 'update' === $this->options['install_type'] ) { + parent::add_strings(); + $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'mythemeshop' ); + } else { + $this->upgrader->strings['skin_update_failed_error'] = wp_kses( __( 'An error occurred while installing %1$s: %2$s.', 'mythemeshop' ), array( 'strong' ) ); + $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'mythemeshop' ); + + if ( $this->tgmpa->is_automatic ) { + // Automatic activation strings. + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'mythemeshop' ); + $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'mythemeshop' ) . ' ' . esc_html__( 'Show Details', 'mythemeshop' ) . '.'; + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'mythemeshop' ); + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'mythemeshop' ); + } else { + // Default installation strings. + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'mythemeshop' ); + $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'mythemeshop' ) . ' ' . esc_html__( 'Show Details', 'mythemeshop' ) . '.'; + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'mythemeshop' ); + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'mythemeshop' ); + } + } + } + + /** + * Outputs the header strings and necessary JS before each plugin installation. + * + * @since 2.2.0 + * + * @param string $title Unused in this implementation. + */ + public function before( $title = '' ) { + if ( empty( $title ) ) { + $title = esc_html( $this->plugin_names[ $this->i ] ); + } + parent::before( $title ); + } + + /** + * Outputs the footer strings and necessary JS after each plugin installation. + * + * Checks for any errors and outputs them if they exist, else output + * success strings. + * + * @since 2.2.0 + * + * @param string $title Unused in this implementation. + */ + public function after( $title = '' ) { + if ( empty( $title ) ) { + $title = esc_html( $this->plugin_names[ $this->i ] ); + } + parent::after( $title ); + + $this->i++; + } + + /** + * Outputs links after bulk plugin installation is complete. + * + * @since 2.2.0 + */ + public function bulk_footer() { + // Serve up the string to say installations (and possibly activations) are complete. + parent::bulk_footer(); + + // Flush plugins cache so we can make sure that the installed plugins list is always up to date. + wp_clean_plugins_cache(); + + $this->tgmpa->show_tgmpa_version(); + + // Display message based on if all plugins are now active or not. + $update_actions = array(); + + if ( $this->tgmpa->is_tgmpa_complete() ) { + // All plugins are active, so we display the complete string and hide the menu to protect users. + echo ''; + $update_actions['dashboard'] = sprintf( + esc_html( $this->tgmpa->strings['complete'] ), + '' . esc_html__( 'Return to the Dashboard', 'mythemeshop' ) . '' + ); + } else { + $update_actions['tgmpa_page'] = '' . esc_html( $this->tgmpa->strings['return'] ) . ''; + } + + /** + * Filter the list of action links available following bulk plugin installs/updates. + * + * @since 2.5.0 + * + * @param array $update_actions Array of plugin action links. + * @param array $plugin_info Array of information for the last-handled plugin. + */ + $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); + + if ( ! empty( $update_actions ) ) { + $this->feedback( implode( ' | ', (array) $update_actions ) ); + } + } + + /* *********** DEPRECATED METHODS *********** */ + + /** + * Flush header output buffer. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead + * @see Bulk_Upgrader_Skin::flush_output() + */ + public function before_flush_output() { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); + $this->flush_output(); + } + + /** + * Flush footer output buffer and iterate $this->i to make sure the + * installation strings reference the correct plugin. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead + * @see Bulk_Upgrader_Skin::flush_output() + */ + public function after_flush_output() { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); + $this->flush_output(); + $this->i++; + } + } + } + } + } +} + +if ( ! class_exists( 'TGMPA_Utils' ) ) { + + /** + * Generic utilities for TGMPA. + * + * All methods are static, poor-dev name-spacing class wrapper. + * + * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy. + * + * @since 2.5.0 + * + * @package TGM-Plugin-Activation + * @author Juliette Reinders Folmer + */ + class TGMPA_Utils { + /** + * Whether the PHP filter extension is enabled. + * + * @see http://php.net/book.filter + * + * @since 2.5.0 + * + * @static + * + * @var bool $has_filters True is the extension is enabled. + */ + public static $has_filters; + + /** + * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). + * + * @since 2.5.0 + * + * @static + * + * @param string $string Text to be wrapped. + * @return string + */ + public static function wrap_in_em( $string ) { + return '' . wp_kses_post( $string ) . ''; + } + + /** + * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). + * + * @since 2.5.0 + * + * @static + * + * @param string $string Text to be wrapped. + * @return string + */ + public static function wrap_in_strong( $string ) { + return '' . wp_kses_post( $string ) . ''; + } + + /** + * Helper function: Validate a value as boolean + * + * @since 2.5.0 + * + * @static + * + * @param mixed $value Arbitrary value. + * @return bool + */ + public static function validate_bool( $value ) { + if ( ! isset( self::$has_filters ) ) { + self::$has_filters = extension_loaded( 'filter' ); + } + + if ( self::$has_filters ) { + return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); + } else { + return self::emulate_filter_bool( $value ); + } + } + + /** + * Helper function: Cast a value to bool + * + * @since 2.5.0 + * + * @static + * + * @param mixed $value Value to cast. + * @return bool + */ + protected static function emulate_filter_bool( $value ) { + // @codingStandardsIgnoreStart + static $true = array( + '1', + 'true', 'True', 'TRUE', + 'y', 'Y', + 'yes', 'Yes', 'YES', + 'on', 'On', 'ON', + ); + static $false = array( + '0', + 'false', 'False', 'FALSE', + 'n', 'N', + 'no', 'No', 'NO', + 'off', 'Off', 'OFF', + ); + // @codingStandardsIgnoreEnd + + if ( is_bool( $value ) ) { + return $value; + } else if ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) { + return (bool) $value; + } else if ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) { + return (bool) $value; + } else if ( is_string( $value ) ) { + $value = trim( $value ); + if ( in_array( $value, $true, true ) ) { + return true; + } else if ( in_array( $value, $false, true ) ) { + return false; + } else { + return false; + } + } + + return false; + } + } // End of class TGMPA_Utils +} // End of class_exists wrapper + +/*-----------------------------------------------------------------------------------*/ +/* Required & recommended plugins for this theme +/*-----------------------------------------------------------------------------------*/ +global $mts_plugins_config_order; +add_action( 'tgmpa_register', 'mts_register_required_plugins' ); +/** + * Register the required plugins for this theme. + */ +function mts_register_required_plugins() { + + /** + * Array of plugin arrays. Required keys are name and slug. + * If the source is NOT from the .org repo, then source is also required. + */ + $plugins = array( + + array( + 'name' => 'WP Shortcode ', + 'slug' => 'wp-shortcode', + 'required' => false, + 'tab' => 'both' + ), + + array( + 'name' => 'MyThemeShop Theme/Plugin Updater ', + 'slug' => 'mythemeshop-connect', + 'description' => __( 'A simple and easy way to update your MyThemeShop themes and plugins to the the latest versions using good old one click method!', 'mythemeshop' ), + 'required' => false, + 'source' => 'https://mythemeshop.com/mythemeshop-connect.zip', + 'tab' => 'both' + ), + + array( + 'name' => 'WP Tab Widget ', + 'slug' => 'wp-tab-widget', + 'required' => false, + 'tab' => 'both' + ), + + array( + 'name' => 'WP Review ', + 'slug' => 'wp-review', + 'alt' => 'wp-review-pro', + 'alt_name' => 'WP Review Pro', + 'alt_description' => __( 'Create reviews! Choose from Stars, Percentages, Circles or Points for review scores. Supports Retina Display, WPMU & Unlimited Color Schemes.', 'mythemeshop' ), + 'info_link' => 'https://mythemeshop.com/plugins/wp-review-pro/', + 'required' => false, + 'tab' => 'both' + ), + + array( + 'name' => 'WP Subscribe ', + 'slug' => 'wp-subscribe', + 'alt' => 'wp-subscribe-pro', + 'alt_name' => 'WP Subscribe Pro', + 'alt_description' => __( 'These days, having an email subscriber list is key to running a successful blog, so we created WP Subscribe Pro. Boost your conversions of traffic to subscribers, and generate more residual traffic and earnings. WP Subscribe Pro supports Feedburner, MailChimp and Aweber and is a must-have plugin for any blog.', 'mythemeshop' ), + 'info_link' => 'https://mythemeshop.com/plugins/wp-subscribe-pro/', + 'required' => false, + 'tab' => 'recommended' + ), + + array( + 'name' => 'WP Notification Bars ', + 'slug' => 'wp-notification-bars', + 'alt' => 'mts-wp-notification-bar', + 'alt_name' => 'WP Notification Bar', + 'alt_description' => __( 'WP Notification Bar is a custom notification and alert bar plugin for WordPress which is perfect for marketing promotions, alerts, increasing click throughs to other pages and so much more.', 'mythemeshop' ), + 'info_link' => 'https://mythemeshop.com/plugins/wp-notification-bar/', + 'required' => false, + 'tab' => 'recommended' + ), + + array( + 'name' => 'WP Mega Menu', + 'slug' => 'wp-mega-menu', + 'description' => __( 'WP Mega Menu is an easy to use plugin for creating beautiful, customized menus for your site. With no setup required, tons of options to choose from, and the ability to show categories, subcategories and posts, WP MegaMenu is a must have plugin that also boosts SEO and user engagement.', 'mythemeshop' ), + 'info_link' => 'https://mythemeshop.com/plugins/wp-mega-menu/', + 'required' => false, + 'pro' => true, + 'tab' => 'recommended' + //'force_activation' => true + ), + + array( + 'name' => 'My WP Translate ', + 'slug' => 'my-wp-translate', + 'required' => false, + 'tab' => 'recommended' + ), + + array( + 'name' => 'My WP Backup ', + 'slug' => 'my-wp-backup', + 'alt' => 'my-wp-backup-pro', + 'alt_name' => 'My WP Backup Pro ', + 'alt_description' => __( 'My WP Backup Pro is the best way to protect your data and website in the event of adverse server events, data corruption, hacking and more. With the option to schedule backups and have them delivered via email, Amazon S3, and lots of other features, you can sleep easy knowing you\'re protected.', 'mythemeshop' ), + 'info_link' => 'https://mythemeshop.com/plugins/my-wp-backup-pro/', + 'required' => false, + 'tab' => 'recommended' + ), + + array( + 'name' => 'Launcher: Coming Soon & Maintenance Mode ', + 'slug' => 'launcher', + 'required' => false, + 'tab' => 'recommended' + ), + + array( + 'name' => 'OTF Regenerate Thumbnails ', + 'slug' => 'otf-regenerate-thumbnails', + 'required' => false, + 'tab' => 'recommended' + ), + + array( + 'name' => 'W3 Total Cache ', + 'slug' => 'w3-total-cache', + 'required' => false, + 'tab' => 'recommended' + ), + + array( + 'name' => 'Yoast SEO ', + 'slug' => 'wordpress-seo', + 'required' => false, + 'tab' => 'recommended' + ), + + ); + + global $mts_plugins_config_order; + foreach ( $plugins as $plugin ) { + $mts_plugins_config_order[] = $plugin['slug']; + if ( array_key_exists( 'alt', $plugin ) ) { + $mts_plugins_config_order[] = $plugin['alt']; + } + } + + /** + * Array of configuration settings. Amend each line as needed. + * If you want the default strings to be available under your own theme domain, + * leave the strings uncommented. + * Some of the strings are added into a sprintf, so see the comments at the + * end of each line for what each argument will be. + */ + $config = array( + 'id' => 'mts-plugins', // Unique ID for hashing notices for multiple instances of TGMPA. + 'default_path' => '', // Default absolute path to pre-packaged plugins. + 'parent_slug' => 'admin.php', // No parent + 'menu' => 'mts-install-plugins', // Menu slug. + 'has_notices' => false, // Show admin notices or not. + 'dismissable' => true, // If false, a user cannot dismiss the nag message. + 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. + 'is_automatic' => false, // Automatically activate plugins after installation or not. + 'message' => '', // Message to output right before the plugins table. + 'strings' => array( + 'page_title' => __( 'Install Required Plugins', 'mythemeshop' ), + 'menu_title' => __( 'Install Plugins', 'mythemeshop' ), + 'installing' => __( 'Installing Plugin: %s', 'mythemeshop' ), // %s = plugin name. + 'oops' => __( 'Something went wrong with the plugin API.', 'mythemeshop' ), + //'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'mythemeshop' ), // %1$s = plugin name(s). + 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'mythemeshop' ), // %1$s = plugin name(s). + //'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'mythemeshop' ), // %1$s = plugin name(s). + //'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'mythemeshop' ), // %1$s = plugin name(s). + 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'mythemeshop' ), // %1$s = plugin name(s). + //'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'mythemeshop' ), // %1$s = plugin name(s). + //'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'mythemeshop' ), // %1$s = plugin name(s). + //'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'mythemeshop' ), // %1$s = plugin name(s). + 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'mythemeshop' ), + 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'mythemeshop' ), + 'return' => __( 'Return to Required Plugins Installer', 'mythemeshop' ), + 'plugin_activated' => __( 'Plugin activated successfully.', 'mythemeshop' ), + 'complete' => __( 'All plugins installed and activated successfully. %s', 'mythemeshop' ), // %s = dashboard link. + 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'. + ) + ); + + tgmpa( $plugins, $config ); + +} + +/** + * Add external link to plugin if available separately. + * @param array $item + * @param array $plugin + * + * @return array + */ +function mts_tgmpba_table_data_item( $item, $plugin ) { + if ( ! empty ( $plugin['available_separately'] ) ) { + $item['source'] = __( 'MyThemeShop', 'mythemeshop' ); + $item['available_separately'] = true; + } + if ( ! empty( $plugin['info_link'] ) ) { + $item['info_link'] = $plugin['info_link']; + } + if ( ! empty( $plugin['tab'] ) ) { + $item['tab'] = $plugin['tab']; + } + return $item; +} +add_filter( 'tgmpa_table_data_item', 'mts_tgmpba_table_data_item', 10, 2 ); + +/** + * Show correct plugins on Essential tab + * @param array $item + * + * @return array + */ +function mts_essential_tab_plugins( $items ) { + + if ( ! isset( $_GET['ptab'] ) || $_GET['ptab'] === 'essential' ) { + $essential = array(); + foreach ( $items as $key => $pl ) { + if ( 'recommended' !== $pl['tab'] && ! isset( $pl['available_separately'] ) ) $essential[] = $pl; + } + $items = $essential; + } + return $items; +} +add_filter( 'tgmpa_table_data_items', 'mts_essential_tab_plugins' ); + + +/** + * Add "Install Plugins" parent menu item which links to tgmpa install plugins page + */ +function mts_addons_add_admin_menu_item() { + add_menu_page( + __('Install Plugins', 'mythemeshop' ), + __('Install Plugins', 'mythemeshop' ), + 'manage_options', + 'mts-install-plugins', // the same page as 'menu' in tgmpa + null, // no callback, it is just a link to other menu page + 'dashicons-admin-generic', + 3 + ); +} +add_action( 'admin_menu', 'mts_addons_add_admin_menu_item' ); + +/** + * Change the callback function for tgmpa "Install Plugins" menu item + * @param array $args + * + * @return array + */ +function mts_tgma_admin_menu_args( $args ) { + $args['function'] = 'mts_addons_page'; + return $args; +} +add_filter( 'tgmpa_admin_menu_args', 'mts_tgma_admin_menu_args' ); + +/** + * Redirect to "Install Plugins" page on activation + */ +function mts_addons_theme_activation_redirect() { + if ( isset( $_GET['activated'] ) ) { + $tgma_instance = TGM_Plugin_Activation::$instance; + if ( ! $tgma_instance->is_tgmpa_complete() ) { + wp_redirect( $tgma_instance->get_tgmpa_url() ); + } + } +} +add_action( 'admin_init', 'mts_addons_theme_activation_redirect' ); + +/** + * Enqueue "Install Plugins" page scripts + */ +function mts_enqueue_addons_scripts( $hook ) { + if ( strpos( $hook, 'mts-install-plugins' ) != false) { + wp_enqueue_style( 'mts-addons', get_template_directory_uri() . '/css/addons.css', NULL, MTS_THEME_VERSION ); + wp_enqueue_script( 'mts-addons', get_template_directory_uri() . '/js/addons.js', array('jquery'), MTS_THEME_VERSION, true ); + } +} +add_action( 'admin_enqueue_scripts', 'mts_enqueue_addons_scripts' ); + +/** + * Display "Install Plugins" page + */ +function mts_addons_page() { + + $tgma_instance = TGM_Plugin_Activation::$instance; + + // Store new instance of plugin table in object. + $plugin_table = new TGMPA_List_Table; + + + // Return early if processing a plugin installation action. + if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $tgma_instance->do_plugin_install() ) { + return; + } + + // Force refresh of available plugin information so we'll know about manual updates/deletes. + wp_clean_plugins_cache( false ); + + $tab = isset( $_GET['ptab'] ) ? $_GET['ptab'] : 'essential'; + + $essential_url = add_query_arg( + array( + 'page' => urlencode( 'mts-install-plugins' ), + 'ptab' => urlencode( 'essential' ), + ), + self_admin_url( 'admin.php' ) + ); + + $recommended_url = add_query_arg( + array( + 'page' => urlencode( 'mts-install-plugins' ), + 'ptab' => urlencode( 'recommended' ), + ), + self_admin_url( 'admin.php' ) + ); + + ?> +
    + +
    + +
    + prepare_items(); + if ( ! empty( $tgma_instance->message ) && is_string( $tgma_instance->message ) ) { + echo wp_kses_post( $this->message ); + } + ?> +
    + + + +
    + get( 'Name' ); + $theme_uri = $current_theme->get( 'ThemeURI' ); + ?> +
    +

    +

    '.$theme_name.'' ); ?>

    +
    + + + +
      + items; + $tgma_plugins = $tgma_instance->plugins; + $new_keys = array_keys( $tgma_plugins ); + $new_items = array_combine( $new_keys, $items ); + $all_data = mts_array_merge_recursive_distinct( $tgma_plugins, $new_items ); + + // Sort + $plugins = mts_sort_plugin_items( $all_data ); + + foreach ( $plugins as $plugin ) : + + // Free/Pro + $go_pro_button = ''; + if ( isset( $plugin['alt'] ) ) { + + // Pro + if ( isset( $plugin['available_separately'] ) ) { + + if ( ! $tgma_instance->is_plugin_installed( $plugin['slug'] ) ) { + + continue; + } + + // Free + } else { + + // Skip if pro version installed + if ( $tgma_instance->is_plugin_installed( $plugin['alt'] ) ) { + + continue; + + } else { + + $go_pro_button = '' . __( 'Get Pro Version!', 'mythemeshop' ) . ''; + } + } + } + + // Might be simplified + if ( $tgma_instance->is_plugin_installed( $plugin['slug'] ) ) { + + if ( is_plugin_active( $plugin['file_path'] ) ) { + + $status = 'active'; + $status_message = __( 'Active', 'mythemeshop' ); + $url = admin_url( 'plugins.php' ); + $button = ''.__('Manage Plugin', 'mythemeshop' ).''; + + } else { + + $status = 'inactive'; + $status_message = __( 'Inactive', 'mythemeshop' ); + $url = wp_nonce_url( + add_query_arg( + array( + 'page' => $tgma_instance->menu, + 'plugin' => urlencode( $plugin['slug'] ), + 'tgmpa-activate' => 'activate-plugin', + ), + admin_url( $tgma_instance->parent_slug ) + ), + 'tgmpa-activate', + 'tgmpa-nonce' + ); + $text = __( 'Activate Plugin', 'mythemeshop' ); + $class = 'mts-addon-button button button-primary'; + $button = '' . $text . ''; + } + + } else { + + if ( !empty( $plugin['available_separately'] ) || isset( $plugin['pro'] ) ) { + + $url = esc_url( $plugin['info_link'] ); + $text = __( 'Get it!', 'mythemeshop' ); + $target = ' target="_blank"'; + + } else { + + $url = wp_nonce_url( + add_query_arg( + array( + 'page' => $tgma_instance->menu, + 'plugin' => urlencode( $plugin['slug'] ), + 'tgmpa-install' => 'install-plugin', + ), + admin_url( $tgma_instance->parent_slug ) + ), + 'tgmpa-install', + 'tgmpa-nonce' + ); + $text = __( 'Install Plugin', 'mythemeshop' ); + $target = ''; + } + + $class = 'mts-addon-button button button-primary'; + $status = 'not-installed'; + $status_message = __( 'Not Installed', 'mythemeshop' ); + $button = '' . $text . ''; + } + + $description = isset( $plugin['alt_description'] ) ? $plugin['alt_description'] : ''; + $description = isset( $plugin['description'] ) ? $plugin['description'] : $description; + $image_src = isset( $plugin['image'] ) && !empty( $plugin['image'] ) ? $plugin['image'] : get_template_directory_uri().'/images/apple-touch-icon.png'; + $author = isset( $plugin['author'] ) ? $plugin['author'] : 'MyThemeShop'; + + $args = array( + 'slug' => $plugin['slug'], + 'fields' => array( + 'icons' => true, + 'short_description' => true + ) + ); + $info = plugins_api( 'plugin_information', $args ); + if ( !is_wp_error( $info ) ) { + if ( is_object( $info ) ) { + $info = (array) $info; + } + if ( !empty( $info['icons']['svg'] ) ) { + $image_src = $info['icons']['svg']; + } elseif ( !empty( $info['icons']['2x'] ) ) { + $image_src = $info['icons']['2x']; + } elseif ( !empty( $info['icons']['1x'] ) ) { + $image_src = $info['icons']['1x']; + } else { + $image_src = $info['icons']['default']; + } + $description = isset( $info['short_description'] ) ? $info['short_description'] : $description; + $author = isset( $info['author'] ) ? $info['author'] : 'MyThemeShop'; + } + ?> +
    • +
      + + + +
      +

      + +

      +

      by

      +

      +
      +
      +
      +
    • + +
    + +
      +
    • +
    + +
    + +
    + +
    + + prepare_items(); ?> + + message ) && is_string( $tgma_instance->message ) ) { + echo wp_kses_post( $tgma_instance->message ); + } + ?> +
    +

    + views(); ?> +
    + +
    + + + display(); ?> + +
    + $plugin ) { + $type[ $i ] = $plugin['type']; // Required / recommended. + $status[ $i ] = $plugin['status']; // Active / Installed But Not Activated / Not Installed. + $name[ $i ] = $plugin['sanitized_plugin']; + if ( !empty( $plugin['installed_version'] ) ) { + $have_installed = true; + } + } + + if ( !$have_installed ) { + + // Sort as it is defined in tgma() + $items = array_merge( array_flip( $mts_plugins_config_order ), $items ); + + } else { + + // Required, Recommended / Not Installed, Installed But Not Activated, Active / By name + array_multisort( $type, SORT_DESC, $status, SORT_DESC, $name, SORT_ASC, $items ); + } + + return $items; +} + +/** + * http://php.net/manual/en/function.array-merge-recursive.php#92195 + * + * @param array $array1 + * @param array $array2 + * + * @return array + */ +function mts_array_merge_recursive_distinct( array &$array1, array &$array2 ) { + $merged = $array1; + foreach ( $array2 as $key => &$value ) { + if ( is_array( $value ) && isset( $merged [$key] ) && is_array( $merged [$key] ) ) { + $merged [$key] = mts_array_merge_recursive_distinct( $merged [$key], $value ); + } else { + $merged [$key] = $value; + } + } + return $merged; +} + + + +/** + * Add MyThemeShop tab to "Add Plugins" Page + * + * @param array $tabs + * + * @return array + */ +function mts_install_plugins_tab( $tabs ) { + $tabs['mts_addons'] = 'MyThemeShop'; + return $tabs; +} +add_filter( 'install_plugins_tabs', 'mts_install_plugins_tab' ); + +/** + * Set args for MyThemeShop tab in "Add Plugins" Page + * + * @param array $args + * + * @return array + */ +function mts_addons_args( $args ) { + $args = array( + 'page' => 1, + 'per_page' => 30, + 'fields' => array( + 'last_updated' => true, + 'icons' => true, + 'active_installs' => true + ), + 'author' => 'MyThemeShop' + ); + + return $args; +} +add_filter( 'install_plugins_table_api_args_mts_addons', 'mts_addons_args' ); + +/** + * List plugins in "Add Plugins" Page under "MyThemeShop" tab + */ +add_action( 'install_plugins_mts_addons', 'display_plugins_table' ); diff --git a/functions/theme-actions.php b/functions/theme-actions.php new file mode 100644 index 0000000..3c2f09a --- /dev/null +++ b/functions/theme-actions.php @@ -0,0 +1,66 @@ + + + + + + + + + + + + have_posts()) : $my_query->the_post(); ?> + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/functions/theme-shortcodes.php b/functions/theme-shortcodes.php new file mode 100644 index 0000000..716934c --- /dev/null +++ b/functions/theme-shortcodes.php @@ -0,0 +1,362 @@ + '#', + 'target' => '_self', + 'position' => 'left' + ), $atts)); + $out = "".do_shortcode($content).""; + return $out; +} +add_shortcode('button-brown', 'mnm_button_brown'); + +function mnm_button_blue( $atts, $content = null ) { + extract(shortcode_atts(array( + 'url' => '#', + 'target' => '_self', + 'position' => 'left' + ), $atts)); + $out = "".do_shortcode($content).""; + return $out; +} +add_shortcode('button-blue', 'mnm_button_blue'); + +function mnm_button_green( $atts, $content = null ) { + extract(shortcode_atts(array( + 'url' => '#', + 'target' => '_self', + 'position' => 'left' + ), $atts)); + $out = "".do_shortcode($content).""; + return $out; +} +add_shortcode('button-green', 'mnm_button_green'); + +function mnm_button_red( $atts, $content = null ) { + extract(shortcode_atts(array( + 'url' => '#', + 'target' => '_self', + 'position' => 'left' + ), $atts)); + $out = "".do_shortcode($content).""; + return $out; +} +add_shortcode('button-red', 'mnm_button_red'); + +function mnm_button_white( $atts, $content = null ) { + extract(shortcode_atts(array( + 'url' => '#', + 'target' => '_self', + 'position' => 'left' + ), $atts)); + $out = "".do_shortcode($content).""; + return $out; +} +add_shortcode('button-white', 'mnm_button_white'); + +function mnm_button_yellow( $atts, $content = null ) { + extract(shortcode_atts(array( + 'url' => '#', + 'target' => '_self', + 'position' => 'left' + ), $atts)); + $out = "".do_shortcode($content).""; + return $out; +} +add_shortcode('button-yellow', 'mnm_button_yellow'); + + +/*-----------------------------------------------------------------------------------*/ +/* Alert Shortcodes +/*-----------------------------------------------------------------------------------*/ + +function mnm_alert_note( $atts, $content = null ) { + extract(shortcode_atts(array( + 'style' => 'note' + ), $atts)); + $out = "

    ".do_shortcode($content)."

    "; + return $out; +} +add_shortcode('alert-note', 'mnm_alert_note'); + +function mnm_alert_announce( $atts, $content = null ) { + extract(shortcode_atts(array( + 'style' => 'announce' + ), $atts)); + $out = "

    ".do_shortcode($content)."

    "; + return $out; +} +add_shortcode('alert-announce', 'mnm_alert_announce'); + +function mnm_alert_success( $atts, $content = null ) { + extract(shortcode_atts(array( + 'style' => 'success' + ), $atts)); + $out = "

    ".do_shortcode($content)."

    "; + return $out; +} +add_shortcode('alert-success', 'mnm_alert_success'); + +function mnm_alert_warning( $atts, $content = null ) { + extract(shortcode_atts(array( + 'style' => 'warning' + ), $atts)); + $out = "

    ".do_shortcode($content)."

    "; + return $out; +} +add_shortcode('alert-warning', 'mnm_alert_warning'); + +/*-----------------------------------------------------------------------------------*/ +/* Column Shortcodes +/*-----------------------------------------------------------------------------------*/ + +function mnm_one_third( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_third', 'mnm_one_third'); + +function mnm_one_third_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_third_last', 'mnm_one_third_last'); + +function mnm_two_third( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('two_third', 'mnm_two_third'); + +function mnm_two_third_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('two_third_last', 'mnm_two_third_last'); + +function mnm_one_half( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_half', 'mnm_one_half'); + +function mnm_one_half_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_half_last', 'mnm_one_half_last'); + +function mnm_one_fourth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_fourth', 'mnm_one_fourth'); + +function mnm_one_fourth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_fourth_last', 'mnm_one_fourth_last'); + +function mnm_three_fourth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('three_fourth', 'mnm_three_fourth'); + +function mnm_three_fourth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('three_fourth_last', 'mnm_three_fourth_last'); + +function mnm_one_fifth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_fifth', 'mnm_one_fifth'); + +function mnm_one_fifth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_fifth_last', 'mnm_one_fifth_last'); + +function mnm_two_fifth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('two_fifth', 'mnm_two_fifth'); + +function mnm_two_fifth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('two_fifth_last', 'mnm_two_fifth_last'); + +function mnm_three_fifth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('three_fifth', 'mnm_three_fifth'); + +function mnm_three_fifth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('three_fifth_last', 'mnm_three_fifth_last'); + +function mnm_four_fifth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('four_fifth', 'mnm_four_fifth'); + +function mnm_four_fifth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('four_fifth_last', 'mnm_four_fifth_last'); + +function mnm_one_sixth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_sixth', 'mnm_one_sixth'); + +function mnm_one_sixth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('one_sixth_last', 'mnm_one_sixth_last'); + +function mnm_five_sixth( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('five_sixth', 'mnm_five_sixth'); + +function mnm_five_sixth_last( $atts, $content = null ) { + return '
    ' . do_shortcode($content) . '
    '; +} +add_shortcode('five_sixth_last', 'mnm_five_sixth_last'); + +/*-----------------------------------------------------------------------------------*/ +/* Video Shortcodes +/*-----------------------------------------------------------------------------------*/ +function mnm_youtube_video( $atts, $content = null ) { + extract(shortcode_atts( array( + 'id' => '', + 'width' => '600', + 'height' => '340', + 'position' => 'left' + ), $atts)); + $out = "
    "; + return $out; +} +add_shortcode('youtube', 'mnm_youtube_video'); + +function mnm_vimeo_video( $atts, $content = null ) { + extract(shortcode_atts( array( + 'id' => '', + 'width' => '600', + 'height' => '340', + 'position' => 'left' + ), $atts)); + $out = "
    "; + return $out; +} +add_shortcode('vimeo', 'mnm_vimeo_video'); + +/*-----------------------------------------------------------------------------------*/ +/* GoogleMaps Shortcode +/*-----------------------------------------------------------------------------------*/ +function mnm_googleMaps($atts, $content = null) { + extract(shortcode_atts(array( + 'width' => '640', + 'height' => '480', + "src" => '', + 'position' => 'left' + ), $atts)); + $out = "
    "; + return $out; +} +add_shortcode("googlemap", "mnm_googleMaps"); + +/*-----------------------------------------------------------------------------------*/ +/* Tabs +/*-----------------------------------------------------------------------------------*/ +function mnm_tabs( $atts, $content = null ) { + + if (!preg_match_all("/(.?)\[(tab)\b(.*?)(?:(\/))?\](?:(.+?)\[\/tab\])?(.?)/s", $content, $matches)) { + return do_shortcode($content); + } else { + for($i = 0; $i < count($matches[0]); $i++) { + $matches[3][$i] = shortcode_parse_atts($matches[3][$i]); + $tabid[$i] = 'tab-'.mt_rand(10, 100000).'-'.strtolower(str_replace(array("!","@","#","$","%","^","&","*",")","(","+","=","[","]","/","\\",";","{","}","|",'"',":","<",">","?","~","`"," "),"",$matches[3][$i]['title'])); + } + $tabnav = ''; + + $tabcontent = '
    '; + for($i = 0; $i < count($matches[0]); $i++) { + $tabcontent .= '
    ' . do_shortcode(trim($matches[5][$i])) . '
    '; + } + $tabcontent .= '
    '; + + $tabwidgetid = 'tabwidget-'.mt_rand(10, 100000); + + $script = ''; + + return '
    ' . $tabnav . $tabcontent . '
    '.$script; + } + +} + +add_shortcode('tabs', 'mnm_tabs'); + +/*-------------------------------------------------------- + Toggles +--------------------------------------------------------*/ + + +function mnm_toggle( $atts, $content = null ) { + + extract(shortcode_atts(array( + 'title' => 'Toggle Title' + ), $atts)); + + return '
    ' . $title . '
    ' . do_shortcode(trim($content)) . '
    '; + +} + +add_shortcode('toggle', 'mnm_toggle'); + +/*-----------------------------------------------------------------------------------*/ +/* Divider with an anchor link to top of page. +/*-----------------------------------------------------------------------------------*/ +// simple divider +function mnm_divider( $atts ) { + return '
    '; +} +add_shortcode('divider', 'mnm_divider'); + +// Divider with an anchor link to top of page. +function mnm_divider_top( $atts ) { + return ''; +} +add_shortcode('divider_top', 'mnm_divider_top'); + +// Used to clear an element of its neighbors, no floating elements are allowed on the left or the right side. +function mnm_clear( $atts ) { + return '
    '; +} +add_shortcode('clear', 'mnm_clear'); + +?> \ No newline at end of file diff --git a/functions/tinymce/editor_plugin.js b/functions/tinymce/editor_plugin.js new file mode 100644 index 0000000..d3e3614 --- /dev/null +++ b/functions/tinymce/editor_plugin.js @@ -0,0 +1,74 @@ +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('mnmpanel'); + + tinymce.create('tinymce.plugins.mnmpanel', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mcemnmpanel', function() { + ed.windowManager.open({ + file : url + '/window_page.php', + width : 450 + ed.getLang('mnmpanel.delta_width', 0), + height : 200 + ed.getLang('mnmpanel.delta_height', 0), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('mnmpanel', { + title : 'Add Custom Shortcode', + cmd : 'mcemnmpanel', + image : url + '/shortcode.png' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('mnmpanel', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'mnmpanel', + author : 'Smashing WP Themes', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('mnmpanel', tinymce.plugins.mnmpanel); +})(); \ No newline at end of file diff --git a/functions/tinymce/editor_plugin_post.js b/functions/tinymce/editor_plugin_post.js new file mode 100644 index 0000000..ff1ab2f --- /dev/null +++ b/functions/tinymce/editor_plugin_post.js @@ -0,0 +1,74 @@ +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('mnmpanel'); + + tinymce.create('tinymce.plugins.mnmpanel', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mcemnmpanel', function() { + ed.windowManager.open({ + file : url + '/window_post.php', + width : 450 + ed.getLang('mnmpanel.delta_width', 0), + height : 200 + ed.getLang('mnmpanel.delta_height', 0), + inline : 1 + }, { + plugin_url : url, // Plugin absolute URL + some_custom_arg : 'custom arg' // Custom argument + }); + }); + + // Register example button + ed.addButton('mnmpanel', { + title : 'Add Custom Shortcode', + cmd : 'mcemnmpanel', + image : url + '/shortcode.png' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('mnmpanel', n.nodeName == 'IMG'); + }); + }, + + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'mnmpanel', + author : 'Smashing WP Themes', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('mnmpanel', tinymce.plugins.mnmpanel); +})(); \ No newline at end of file diff --git a/functions/tinymce/langs.php b/functions/tinymce/langs.php new file mode 100644 index 0000000..8993091 --- /dev/null +++ b/functions/tinymce/langs.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/functions/tinymce/mnm_config.php b/functions/tinymce/mnm_config.php new file mode 100644 index 0000000..eb7f0d0 --- /dev/null +++ b/functions/tinymce/mnm_config.php @@ -0,0 +1,9 @@ +path = get_template_directory_uri() . '/functions/tinymce/'; + + // Modify the version when tinyMCE plugins are changed. + add_filter('tiny_mce_version', array (&$this, 'change_tinymce_version') ); + + // init process for button control + add_action('init', array (&$this, 'addbuttons') ); + } + + function addbuttons() + { + global $page_handle; + + if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) + return; + + // Add only in Rich Editor mode + if ( get_user_option('rich_editing') == 'true') + { + add_filter("mce_external_plugins", array (&$this, 'add_tinymce_plugin' ), 5); + add_filter('mce_buttons', array (&$this, 'register_button' ), 5); + add_filter('mce_external_languages', array (&$this, 'add_tinymce_langs_path')); + } + } + + function register_button($buttons) + { + array_push($buttons, 'separator', $this->pluginname ); + return $buttons; + } + + function add_tinymce_plugin($plugin_array) + { + global $page_handle; + global $post_id; + + if(isset($_GET['post'])) { + $post_id = $_GET['post']; + } + + $post = get_post($post_id); + + $post_type = $post->post_type; + + if($post_type == 'post') + { + $plugin_array[$this->pluginname] = $this->path . 'editor_plugin_post.js'; + } + else + { + $plugin_array[$this->pluginname] = $this->path . 'editor_plugin.js'; + } + + return $plugin_array; + } + + function add_tinymce_langs_path($plugin_array) + { + // Load the TinyMCE language file + $plugin_array[$this->pluginname] = get_template_directory_uri() . '/functions/tinymce/langs.php'; + return $plugin_array; + } + + + /** + * add_nextgen_button::change_tinymce_version() + * A different version will rebuild the cache + * + * @return $versio + */ + function change_tinymce_version($version) + { + $version = $version + $this->internalVersion; + return $version; + } + +} + +// Call it now +$tinymce_button = new add_mnmshortcode_button (); + +?> \ No newline at end of file diff --git a/functions/tinymce/window_page.php b/functions/tinymce/window_page.php new file mode 100644 index 0000000..874b4fe --- /dev/null +++ b/functions/tinymce/window_page.php @@ -0,0 +1,88 @@ + + + +Shortcode Panel + + + + + + + + + + +
    +
    + +
    + +
    + +
    +
    +
    +
    ', + esc_html__( 'Upgrade message from the plugin author:', 'mythemeshop' ), + ' ', wp_kses_data( $item['upgrade_notice'] ), ' +
    +
    + + + + + +
    + + + + + + + +
    +
    + +
    + +
    + +
    +
    + + + \ No newline at end of file diff --git a/functions/tinymce/window_post.php b/functions/tinymce/window_post.php new file mode 100644 index 0000000..874b4fe --- /dev/null +++ b/functions/tinymce/window_post.php @@ -0,0 +1,88 @@ + + + +Shortcode Panel + + + + + + + + + + +
    +
    + +
    + +
    + +
    +
    + + + + + + +
    +
    + +
    + + + + +
    +
    + +
    + +
    + +
    +
    +
    + + \ No newline at end of file diff --git a/functions/twitteroauth.php b/functions/twitteroauth.php new file mode 100644 index 0000000..ca0aece --- /dev/null +++ b/functions/twitteroauth.php @@ -0,0 +1,1050 @@ +key = $key; + $this->secret = $secret; + $this->callback_url = $callback_url; + } + function __toString() { return "OAuthConsumer[key=$this->key,secret=$this->secret]"; } +} +class OAuthToken { + public $key; // access tokens and request tokens + public $secret; + /** * key = the token * secret = the token secret */ + function __construct($key, $secret) { + $this->key = $key; + $this->secret = $secret; + } + /** + * generates the basic string serialization of a token that a server + * would respond to request_token and access_token calls with + */ + function to_string() { + return "oauth_token=".OAuthUtil::urlencode_rfc3986($this->key)."&oauth_token_secret=".OAuthUtil::urlencode_rfc3986($this->secret); } + function __toString() { return $this->to_string(); } + } + /** + * A class for implementing a Signature Method + * See section 9 ("Signing Requests") in the spec + */ +abstract class OAuthSignatureMethod { + /** + * Needs to return the name of the Signature Method (ie HMAC-SHA1) + * @return string + */ + abstract public function get_name(); + /** + * Build up the signature + * NOTE: The output of this function MUST NOT be urlencoded. + * the encoding is handled in OAuthRequest when the final + * request is serialized + * @param OAuthRequest $request + * @param OAuthConsumer $consumer + * @param OAuthToken $token + * @return string + */ + abstract public function build_signature($request, $consumer, $token); + /** + * Verifies that a given signature is correct + * @param OAuthRequest $request + * @param OAuthConsumer $consumer + * @param OAuthToken $token + * @param string $signature + * @return bool + */ + public function check_signature($request, $consumer, $token, $signature) { + $built = $this->build_signature($request, $consumer, $token); + return $built == $signature; + } +} +/** +* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104] +* where the Signature Base String is the text and the key is the concatenated values (each first +* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&' +* character (ASCII code 38) even if empty. +* - Chapter 9.2 ("HMAC-SHA1") +*/ +class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod { + function get_name() { return "HMAC-SHA1"; } + public function build_signature($request, $consumer, $token) { + $base_string = $request->get_signature_base_string(); + $request->base_string = $base_string; + $key_parts = array( $consumer->secret,($token) ? $token->secret : "" ); + $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); + $key = implode('&', $key_parts); + return base64_encode(hash_hmac('sha1', $base_string, $key, true)); + } +} + +/** +* The PLAINTEXT method does not provide any security protection and SHOULD only be used +* over a secure channel such as HTTPS. It does not use the Signature Base String. +* - Chapter 9.4 ("PLAINTEXT") +*/ +class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod { + public function get_name() { return "PLAINTEXT"; } + /** + * oauth_signature is set to the concatenated encoded values of the Consumer Secret and + * Token Secret, separated by a '&' character (ASCII code 38), even if either secret is + * empty. The result MUST be encoded again. + * - Chapter 9.4.1 ("Generating Signatures") + * + * Please note that the second encoding MUST NOT happen in the SignatureMethod, as + * OAuthRequest handles this! + */ + public function build_signature($request, $consumer, $token) { + $key_parts = array( $consumer->secret, ($token) ? $token->secret : "" ); + $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); + $key = implode('&', $key_parts); + $request->base_string = $key; + return $key; + } +} +/** + * The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in + * [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for + * EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a + * verified way to the Service Provider, in a manner which is beyond the scope of this + * specification. + * - Chapter 9.3 ("RSA-SHA1") + */ +abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod { + public function get_name() { return "RSA-SHA1"; } + // Up to the SP to implement this lookup of keys. Possible ideas are: + // (1) do a lookup in a table of trusted certs keyed off of consumer + // (2) fetch via http using a url provided by the requester + // (3) some sort of specific discovery code based on request + // Either way should return a string representation of the certificate + protected abstract function fetch_public_cert(&$request); + // Up to the SP to implement this lookup of keys. Possible ideas are: + // (1) do a lookup in a table of trusted certs keyed off of consumer + // Either way should return a string representation of the certificate + protected abstract function fetch_private_cert(&$request); + public function build_signature($request, $consumer, $token) { + $base_string = $request->get_signature_base_string(); + $request->base_string = $base_string; + // Fetch the private key cert based on the request + $cert = $this->fetch_private_cert($request); + // Pull the private key ID from the certificate + $privatekeyid = openssl_get_privatekey($cert); + // Sign using the key + $ok = openssl_sign($base_string, $signature, $privatekeyid); + // Release the key resource + openssl_free_key($privatekeyid); + return base64_encode($signature); + } + public function check_signature($request, $consumer, $token, $signature) { + $decoded_sig = base64_decode($signature); + $base_string = $request->get_signature_base_string(); + // Fetch the public key cert based on the request + $cert = $this->fetch_public_cert($request); + // Pull the public key ID from the certificate + $publickeyid = openssl_get_publickey($cert); + // Check the computed signature against the one passed in the query + $ok = openssl_verify($base_string, $decoded_sig, $publickeyid); + // Release the key resource + openssl_free_key($publickeyid); + return $ok == 1; + } +} +class OAuthRequest { + private $parameters; + private $http_method; + private $http_url; + // for debug purposes + public $base_string; + public static $version = '1.0'; + public static $POST_INPUT = 'php://input'; + function __construct($http_method, $http_url, $parameters=NULL) { + @$parameters or $parameters = array(); + $parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters); + $this->parameters = $parameters; + $this->http_method = $http_method; + $this->http_url = $http_url; + } + /** * attempt to build up a request from what was passed to the server */ + public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) { + $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") + ? 'http' + : 'https'; + @$http_url or $http_url = $scheme . + '://' . $_SERVER['HTTP_HOST'] . + ':' . + $_SERVER['SERVER_PORT'] . + $_SERVER['REQUEST_URI']; + @$http_method or $http_method = $_SERVER['REQUEST_METHOD']; + + // We weren't handed any parameters, so let's find the ones relevant to + // this request. + // If you run XML-RPC or similar you should use this to provide your own + // parsed parameter-list + if (!$parameters) { + // Find request headers + $request_headers = OAuthUtil::get_headers(); + + // Parse the query-string to find GET parameters + $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']); + + // It's a POST request of the proper content-type, so parse POST + // parameters and add those overriding any duplicates from GET + if ($http_method == "POST" + && @strstr($request_headers["Content-Type"], + "application/x-www-form-urlencoded") + ) { + $post_data = OAuthUtil::parse_parameters( + file_get_contents(self::$POST_INPUT) + ); + $parameters = array_merge($parameters, $post_data); + } + + // We have a Authorization-header with OAuth data. Parse the header + // and add those overriding any duplicates from GET or POST + if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") { + $header_parameters = OAuthUtil::split_header( + $request_headers['Authorization'] + ); + $parameters = array_merge($parameters, $header_parameters); + } + + } + + return new OAuthRequest($http_method, $http_url, $parameters); + } + + /** + * pretty much a helper function to set up the request + */ + public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) { + @$parameters or $parameters = array(); + $defaults = array("oauth_version" => OAuthRequest::$version, + "oauth_nonce" => OAuthRequest::generate_nonce(), + "oauth_timestamp" => OAuthRequest::generate_timestamp(), + "oauth_consumer_key" => $consumer->key); + if ($token) + $defaults['oauth_token'] = $token->key; + + $parameters = array_merge($defaults, $parameters); + + return new OAuthRequest($http_method, $http_url, $parameters); + } + + public function set_parameter($name, $value, $allow_duplicates = true) { + if ($allow_duplicates && isset($this->parameters[$name])) { + // We have already added parameter(s) with this name, so add to the list + if (is_scalar($this->parameters[$name])) { + // This is the first duplicate, so transform scalar (string) + // into an array so we can add the duplicates + $this->parameters[$name] = array($this->parameters[$name]); + } + + $this->parameters[$name][] = $value; + } else { + $this->parameters[$name] = $value; + } + } + + public function get_parameter($name) { + return isset($this->parameters[$name]) ? $this->parameters[$name] : null; + } + + public function get_parameters() { + return $this->parameters; + } + + public function unset_parameter($name) { + unset($this->parameters[$name]); + } + + /** + * The request parameters, sorted and concatenated into a normalized string. + * @return string + */ + public function get_signable_parameters() { + // Grab all parameters + $params = $this->parameters; + + // Remove oauth_signature if present + // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") + if (isset($params['oauth_signature'])) { + unset($params['oauth_signature']); + } + + return OAuthUtil::build_http_query($params); + } + + /** + * Returns the base string of this request + * + * The base string defined as the method, the url + * and the parameters (normalized), each urlencoded + * and the concated with &. + */ + public function get_signature_base_string() { + $parts = array( + $this->get_normalized_http_method(), + $this->get_normalized_http_url(), + $this->get_signable_parameters() + ); + + $parts = OAuthUtil::urlencode_rfc3986($parts); + + return implode('&', $parts); + } + + /** + * just uppercases the http method + */ + public function get_normalized_http_method() { + return strtoupper($this->http_method); + } + + /** + * parses the url and rebuilds it to be + * scheme://host/path + */ + public function get_normalized_http_url() { + $parts = parse_url($this->http_url); + + $port = @$parts['port']; + $scheme = $parts['scheme']; + $host = $parts['host']; + $path = @$parts['path']; + + $port or $port = ($scheme == 'https') ? '443' : '80'; + + if (($scheme == 'https' && $port != '443') + || ($scheme == 'http' && $port != '80')) { + $host = "$host:$port"; + } + return "$scheme://$host$path"; + } + + /** + * builds a url usable for a GET request + */ + public function to_url() { + $post_data = $this->to_postdata(); + $out = $this->get_normalized_http_url(); + if ($post_data) { + $out .= '?'.$post_data; + } + return $out; + } + + /** + * builds the data one would send in a POST request + */ + public function to_postdata() { + return OAuthUtil::build_http_query($this->parameters); + } + + /** + * builds the Authorization: header + */ + public function to_header($realm=null) { + $first = true; + if($realm) { + $out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"'; + $first = false; + } else + $out = 'Authorization: OAuth'; + + $total = array(); + foreach ($this->parameters as $k => $v) { + if (substr($k, 0, 5) != "oauth") continue; + if (is_array($v)) { + throw new OAuthException('Arrays not supported in headers'); + } + $out .= ($first) ? ' ' : ','; + $out .= OAuthUtil::urlencode_rfc3986($k) . + '="' . + OAuthUtil::urlencode_rfc3986($v) . + '"'; + $first = false; + } + return $out; + } + + public function __toString() { + return $this->to_url(); + } + + + public function sign_request($signature_method, $consumer, $token) { + $this->set_parameter( + "oauth_signature_method", + $signature_method->get_name(), + false + ); + $signature = $this->build_signature($signature_method, $consumer, $token); + $this->set_parameter("oauth_signature", $signature, false); + } + + public function build_signature($signature_method, $consumer, $token) { + $signature = $signature_method->build_signature($this, $consumer, $token); + return $signature; + } + + /** + * util function: current timestamp + */ + private static function generate_timestamp() { + return time(); + } + + /** + * util function: current nonce + */ + private static function generate_nonce() { + $mt = microtime(); + $rand = mt_rand(); + + return md5($mt . $rand); // md5s look nicer than numbers + } + } + + class OAuthServer { + protected $timestamp_threshold = 300; // in seconds, five minutes + protected $version = '1.0'; // hi blaine + protected $signature_methods = array(); + + protected $data_store; + + function __construct($data_store) { + $this->data_store = $data_store; + } + + public function add_signature_method($signature_method) { + $this->signature_methods[$signature_method->get_name()] = + $signature_method; + } + + // high level functions + + /** + * process a request_token request + * returns the request token on success + */ + public function fetch_request_token(&$request) { + $this->get_version($request); + + $consumer = $this->get_consumer($request); + + // no token required for the initial token request + $token = NULL; + + $this->check_signature($request, $consumer, $token); + + // Rev A change + $callback = $request->get_parameter('oauth_callback'); + $new_token = $this->data_store->new_request_token($consumer, $callback); + + return $new_token; + } + + /** + * process an access_token request + * returns the access token on success + */ + public function fetch_access_token(&$request) { + $this->get_version($request); + + $consumer = $this->get_consumer($request); + + // requires authorized request token + $token = $this->get_token($request, $consumer, "request"); + + $this->check_signature($request, $consumer, $token); + + // Rev A change + $verifier = $request->get_parameter('oauth_verifier'); + $new_token = $this->data_store->new_access_token($token, $consumer, $verifier); + + return $new_token; + } + + /** + * verify an api call, checks all the parameters + */ + public function verify_request(&$request) { + $this->get_version($request); + $consumer = $this->get_consumer($request); + $token = $this->get_token($request, $consumer, "access"); + $this->check_signature($request, $consumer, $token); + return array($consumer, $token); + } + + // Internals from here + /** + * version 1 + */ + private function get_version(&$request) { + $version = $request->get_parameter("oauth_version"); + if (!$version) { + // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present. + // Chapter 7.0 ("Accessing Protected Ressources") + $version = '1.0'; + } + if ($version !== $this->version) { + throw new OAuthException("OAuth version '$version' not supported"); + } + return $version; + } + + /** + * figure out the signature with some defaults + */ + private function get_signature_method(&$request) { + $signature_method = + @$request->get_parameter("oauth_signature_method"); + + if (!$signature_method) { + // According to chapter 7 ("Accessing Protected Ressources") the signature-method + // parameter is required, and we can't just fallback to PLAINTEXT + throw new OAuthException('No signature method parameter. This parameter is required'); + } + + if (!in_array($signature_method, + array_keys($this->signature_methods))) { + throw new OAuthException( + "Signature method '$signature_method' not supported " . + "try one of the following: " . + implode(", ", array_keys($this->signature_methods)) + ); + } + return $this->signature_methods[$signature_method]; + } + + /** + * try to find the consumer for the provided request's consumer key + */ + private function get_consumer(&$request) { + $consumer_key = @$request->get_parameter("oauth_consumer_key"); + if (!$consumer_key) { + throw new OAuthException("Invalid consumer key"); + } + + $consumer = $this->data_store->lookup_consumer($consumer_key); + if (!$consumer) { + throw new OAuthException("Invalid consumer"); + } + + return $consumer; + } + + /** + * try to find the token for the provided request's token key + */ + private function get_token(&$request, $consumer, $token_type="access") { + $token_field = @$request->get_parameter('oauth_token'); + $token = $this->data_store->lookup_token( + $consumer, $token_type, $token_field + ); + if (!$token) { + throw new OAuthException("Invalid $token_type token: $token_field"); + } + return $token; + } + + /** + * all-in-one function to check the signature on a request + * should guess the signature method appropriately + */ + private function check_signature(&$request, $consumer, $token) { + // this should probably be in a different method + $timestamp = @$request->get_parameter('oauth_timestamp'); + $nonce = @$request->get_parameter('oauth_nonce'); + + $this->check_timestamp($timestamp); + $this->check_nonce($consumer, $token, $nonce, $timestamp); + + $signature_method = $this->get_signature_method($request); + + $signature = $request->get_parameter('oauth_signature'); + $valid_sig = $signature_method->check_signature( + $request, + $consumer, + $token, + $signature + ); + + if (!$valid_sig) { + throw new OAuthException("Invalid signature"); + } + } + + /** + * check that the timestamp is new enough + */ + private function check_timestamp($timestamp) { + if( ! $timestamp ) + throw new OAuthException( + 'Missing timestamp parameter. The parameter is required' + ); + + // verify that timestamp is recentish + $now = time(); + if (abs($now - $timestamp) > $this->timestamp_threshold) { + throw new OAuthException( "Expired timestamp, yours $timestamp, ours $now" ); + } + } + + /** + * check that the nonce is not repeated + */ + private function check_nonce($consumer, $token, $nonce, $timestamp) { + if( ! $nonce ) + throw new OAuthException( + 'Missing nonce parameter. The parameter is required' + ); + + // verify that the nonce is uniqueish + $found = $this->data_store->lookup_nonce( + $consumer, + $token, + $nonce, + $timestamp + ); + if ($found) { + throw new OAuthException("Nonce already used: $nonce"); + } + } + + } + + class OAuthDataStore { + function lookup_consumer($consumer_key) { + // implement me + } + + function lookup_token($consumer, $token_type, $token) { + // implement me + } + + function lookup_nonce($consumer, $token, $nonce, $timestamp) { + // implement me + } + + function new_request_token($consumer, $callback = null) { + // return a new token attached to this consumer + } + + function new_access_token($token, $consumer, $verifier = null) { + // return a new access token attached to this consumer + // for the user associated with this token if the request token + // is authorized + // should also invalidate the request token + } + + } + + class OAuthUtil { + public static function urlencode_rfc3986($input) { + if (is_array($input)) { + return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input); + } else if (is_scalar($input)) { + return str_replace( + '+', + ' ', + str_replace('%7E', '~', rawurlencode($input)) + ); + } else { + return ''; + } + } + + + // This decode function isn't taking into consideration the above + // modifications to the encoding process. However, this method doesn't + // seem to be used anywhere so leaving it as is. + public static function urldecode_rfc3986($string) { + return urldecode($string); + } + + // Utility function for turning the Authorization: header into + // parameters, has to do some unescaping + // Can filter out any non-oauth parameters if needed (default behaviour) + public static function split_header($header, $only_allow_oauth_parameters = true) { + $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/'; + $offset = 0; + $params = array(); + while (preg_match($pattern, $header, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) { + $match = $matches[0]; + $header_name = $matches[2][0]; + $header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0]; + if (preg_match('/^oauth_/', $header_name) || !$only_allow_oauth_parameters) { + $params[$header_name] = OAuthUtil::urldecode_rfc3986($header_content); + } + $offset = $match[1] + strlen($match[0]); + } + + if (isset($params['realm'])) { + unset($params['realm']); + } + + return $params; + } + + // helper to try to sort out headers for people who aren't running apache + public static function get_headers() { + if (function_exists('apache_request_headers')) { + // we need this to get the actual Authorization: header + // because apache tends to tell us it doesn't exist + $headers = apache_request_headers(); + + // sanitize the output of apache_request_headers because + // we always want the keys to be Cased-Like-This and arh() + // returns the headers in the same case as they are in the + // request + $out = array(); + foreach( $headers AS $key => $value ) { + $key = str_replace( + " ", + "-", + ucwords(strtolower(str_replace("-", " ", $key))) + ); + $out[$key] = $value; + } + } else { + // otherwise we don't have apache and are just going to have to hope + // that $_SERVER actually contains what we need + $out = array(); + if( isset($_SERVER['CONTENT_TYPE']) ) + $out['Content-Type'] = $_SERVER['CONTENT_TYPE']; + if( isset($_ENV['CONTENT_TYPE']) ) + $out['Content-Type'] = $_ENV['CONTENT_TYPE']; + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) == "HTTP_") { + // this is chaos, basically it is just there to capitalize the first + // letter of every word that is not an initial HTTP and strip HTTP + // code from przemek + $key = str_replace( + " ", + "-", + ucwords(strtolower(str_replace("_", " ", substr($key, 5)))) + ); + $out[$key] = $value; + } + } + } + return $out; + } + + // This function takes a input like a=b&a=c&d=e and returns the parsed + // parameters like this + // array('a' => array('b','c'), 'd' => 'e') + public static function parse_parameters( $input ) { + if (!isset($input) || !$input) return array(); + + $pairs = explode('&', $input); + + $parsed_parameters = array(); + foreach ($pairs as $pair) { + $split = explode('=', $pair, 2); + $parameter = OAuthUtil::urldecode_rfc3986($split[0]); + $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : ''; + + if (isset($parsed_parameters[$parameter])) { + // We have already recieved parameter(s) with this name, so add to the list + // of parameters with this name + + if (is_scalar($parsed_parameters[$parameter])) { + // This is the first duplicate, so transform scalar (string) into an array + // so we can add the duplicates + $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]); + } + + $parsed_parameters[$parameter][] = $value; + } else { + $parsed_parameters[$parameter] = $value; + } + } + return $parsed_parameters; + } + + public static function build_http_query($params) { + if (!$params) return ''; + + // Urlencode both keys and values + $keys = OAuthUtil::urlencode_rfc3986(array_keys($params)); + $values = OAuthUtil::urlencode_rfc3986(array_values($params)); + $params = array_combine($keys, $values); + + // Parameters are sorted by name, using lexicographical byte value ordering. + // Ref: Spec: 9.1.1 (1) + uksort($params, 'strcmp'); + + $pairs = array(); + foreach ($params as $parameter => $value) { + if (is_array($value)) { + // If two or more parameters share the same name, they are sorted by their value + // Ref: Spec: 9.1.1 (1) + natsort($value); + foreach ($value as $duplicate_value) { + $pairs[] = $parameter . '=' . $duplicate_value; + } + } else { + $pairs[] = $parameter . '=' . $value; + } + } + // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) + // Each name-value pair is separated by an '&' character (ASCII code 38) + return implode('&', $pairs); + } + } + + + + + + + + + + + + + + + + + +/** + * Twitter OAuth class + */ +class TwitterOAuth { + /* Contains the last HTTP status code returned. */ + public $http_code; + /* Contains the last API call. */ + public $url; + /* Set up the API root URL. */ + public $host = "https://api.twitter.com/1/"; + /* Set timeout default. */ + public $timeout = 30; + /* Set connect timeout. */ + public $connecttimeout = 30; + /* Verify SSL Cert. */ + public $ssl_verifypeer = FALSE; + /* Respons format. */ + public $format = 'json'; + /* Decode returned json data. */ + public $decode_json = TRUE; + /* Contains the last HTTP headers returned. */ + public $http_info; + /* Set the useragnet. */ + public $useragent = 'TwitterOAuth v0.2.0-beta2'; + /* Immediately retry the API call if the response was not successful. */ + //public $retry = TRUE; + + + + + /** + * Set API URLS + */ + function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; } + function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; } + function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; } + function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; } + + /** + * Debug helpers + */ + function lastStatusCode() { return $this->http_status; } + function lastAPICall() { return $this->last_api_call; } + + /** + * construct TwitterOAuth object + */ + function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) { + $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); + $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); + if (!empty($oauth_token) && !empty($oauth_token_secret)) { + $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret); + } else { + $this->token = NULL; + } + } + + + /** + * Get a request_token from Twitter + * + * @returns a key/value array containing oauth_token and oauth_token_secret + */ + function getRequestToken($oauth_callback = NULL) { + $parameters = array(); + if (!empty($oauth_callback)) { + $parameters['oauth_callback'] = $oauth_callback; + } + $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters); + $token = OAuthUtil::parse_parameters($request); + $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); + return $token; + } + + /** + * Get the authorize URL + * + * @returns a string + */ + function getAuthorizeURL($token, $sign_in_with_twitter = TRUE) { + if (is_array($token)) { + $token = $token['oauth_token']; + } + if (empty($sign_in_with_twitter)) { + return $this->authorizeURL() . "?oauth_token={$token}"; + } else { + return $this->authenticateURL() . "?oauth_token={$token}"; + } + } + + /** + * Exchange request token and secret for an access token and + * secret, to sign API calls. + * + * @returns array("oauth_token" => "the-access-token", + * "oauth_token_secret" => "the-access-secret", + * "user_id" => "9436992", + * "screen_name" => "abraham") + */ + function getAccessToken($oauth_verifier = FALSE) { + $parameters = array(); + if (!empty($oauth_verifier)) { + $parameters['oauth_verifier'] = $oauth_verifier; + } + $request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters); + $token = OAuthUtil::parse_parameters($request); + $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); + return $token; + } + + /** + * One time exchange of username and password for access token and secret. + * + * @returns array("oauth_token" => "the-access-token", + * "oauth_token_secret" => "the-access-secret", + * "user_id" => "9436992", + * "screen_name" => "abraham", + * "x_auth_expires" => "0") + */ + function getXAuthToken($username, $password) { + $parameters = array(); + $parameters['x_auth_username'] = $username; + $parameters['x_auth_password'] = $password; + $parameters['x_auth_mode'] = 'client_auth'; + $request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters); + $token = OAuthUtil::parse_parameters($request); + $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); + return $token; + } + + /** + * GET wrapper for oAuthRequest. + */ + function get($url, $parameters = array()) { + $response = $this->oAuthRequest($url, 'GET', $parameters); + if ($this->format === 'json' && $this->decode_json) { + return json_decode($response); + } + return $response; + } + + /** + * POST wrapper for oAuthRequest. + */ + function post($url, $parameters = array()) { + $response = $this->oAuthRequest($url, 'POST', $parameters); + if ($this->format === 'json' && $this->decode_json) { + return json_decode($response); + } + return $response; + } + + /** + * DELETE wrapper for oAuthReqeust. + */ + function delete($url, $parameters = array()) { + $response = $this->oAuthRequest($url, 'DELETE', $parameters); + if ($this->format === 'json' && $this->decode_json) { + return json_decode($response); + } + return $response; + } + + /** + * Format and sign an OAuth / API request + */ + function oAuthRequest($url, $method, $parameters) { + if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) { + $url = "{$this->host}{$url}.{$this->format}"; + } + $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters); + $request->sign_request($this->sha1_method, $this->consumer, $this->token); + switch ($method) { + case 'GET': + return $this->http($request->to_url(), 'GET'); + default: + return $this->http($request->get_normalized_http_url(), $method, $request->to_postdata()); + } + } + + /** + * Make an HTTP request + * + * @return API results + */ + function http($url, $method, $postfields = NULL) { + $this->http_info = array(); + $ci = curl_init(); + /* Curl settings */ + curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent); + curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout); + curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout); + curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:')); + curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer); + curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader')); + curl_setopt($ci, CURLOPT_HEADER, FALSE); + + switch ($method) { + case 'POST': + curl_setopt($ci, CURLOPT_POST, TRUE); + if (!empty($postfields)) { + curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); + } + break; + case 'DELETE': + curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE'); + if (!empty($postfields)) { + $url = "{$url}?{$postfields}"; + } + } + + curl_setopt($ci, CURLOPT_URL, $url); + $response = curl_exec($ci); + $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE); + $this->http_info = array_merge($this->http_info, curl_getinfo($ci)); + $this->url = $url; + curl_close ($ci); + return $response; + } + + /** + * Get the header info to store. + */ + function getHeader($ch, $header) { + $i = strpos($header, ':'); + if (!empty($i)) { + $key = str_replace('-', '_', strtolower(substr($header, 0, $i))); + $value = trim(substr($header, $i + 2)); + $this->http_header[$key] = $value; + } + return strlen($header); + } +} diff --git a/functions/update_notifier.php b/functions/update_notifier.php new file mode 100644 index 0000000..36f0e42 --- /dev/null +++ b/functions/update_notifier.php @@ -0,0 +1,84 @@ +latest) == -1) { + add_submenu_page( 'themes.php', __('Theme Update','mythemeshop').''.__('1','mythemeshop').'', __('Theme Update','mythemeshop').''.__('1','mythemeshop').'', 'manage_options', 'mythemeshop-updates', 'mts_update_notifier'); + } +} +add_action('admin_menu', 'mts_update_notifier_menu'); + +function mts_update_notifier() { + $xml = get_latest_theme_version(43200); // Cache the remote call for 43200 seconds (12 hours) + $theme_data = wp_get_theme(); // Get the current version from style.css ?> + + + +
    +

    +

    . latest; ?>.

    + + + +
    +

    +

    : of the Theme inside your WordPress installation folder','mythemeshop'); ?> /wp-content/themes/

    +

    , Active Resources section and re-download the theme like you did when you bought it.','mythemeshop'); ?>

    +

    /wp-content/themes// .

    +

    +
    + +
    + +

    + changelog; ?> + +
    + + $interval) ) { + // cache doesn't exist, or is old, so refresh it + if( function_exists('curl_init') ) { // if cURL is available, use it... + $ch = curl_init($notifier_file_url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); + $cache = curl_exec($ch); + curl_close($ch); + } else { + $cache = file_get_contents($notifier_file_url); // ...if not, use the common file_get_contents() + } + + if ($cache) { + // we got good results + update_option( $db_cache_field, $cache ); + update_option( $db_cache_field_last_updated, time() ); + } + // read from the cache file + $notifier_data = get_option( $db_cache_field ); + } + else { + // cache file is fresh enough, so read from it + $notifier_data = get_option( $db_cache_field ); + } + + $xml = simplexml_load_string($notifier_data); + + return $xml; +} + +?> diff --git a/functions/welcome-message.php b/functions/welcome-message.php new file mode 100644 index 0000000..6b2382c --- /dev/null +++ b/functions/welcome-message.php @@ -0,0 +1,47 @@ +Awesomeness!'; + $pointer_content .= '

    You have just Installed Sensational WordPress Theme by MyThemeShop.

    '; + $pointer_content .= '

    You can Trigger The Awesomeness using Amazing Option Panel in Theme Options.

    '; + $pointer_content .= '

    If you face any problem, head over to Knowledge Base

    '; +?> + + \ No newline at end of file diff --git a/functions/widget-ad125.php b/functions/widget-ad125.php new file mode 100644 index 0000000..12f6423 --- /dev/null +++ b/functions/widget-ad125.php @@ -0,0 +1,291 @@ + 'mts_ad_widget', + 'description' => __('A widget for 125 x 125 ad unit (max 6 ads)', 'mythemeshop') + ); + + // Widget control settings + $control_ops = array ( + 'width' => 300, + 'height' => 350, + 'id_base' => 'mts_ad_widget' + ); + + // Create the widget + parent::__construct( 'mts_ad_widget', __('MyThemeShop: 125x125 Ads', 'mythemeshop'), $widget_ops, $control_ops ); + +} + +/*-----------------------------------------------------------------------------------*/ +/* Display Widget +/*-----------------------------------------------------------------------------------*/ + +function widget( $args, $instance ) { + extract( $args ); + + // variables from the widget settings + $title = apply_filters('widget_title', $instance['title'] ); + $ad1 = $instance['ad1']; + $ad2 = $instance['ad2']; + $ad3 = $instance['ad3']; + $ad4 = $instance['ad4']; + $ad5 = $instance['ad5']; + $ad6 = $instance['ad6']; + $link1 = $instance['link1']; + $link2 = $instance['link2']; + $link3 = $instance['link3']; + $link4 = $instance['link4']; + $link5 = $instance['link5']; + $link6 = $instance['link6']; + $randomize = $instance['random']; + + // Before widget (defined by theme functions file) + echo $before_widget; + + // Display the widget title if one was input + if ( $title ) + echo $before_title . $title . $after_title; + + // Randomize ads order in a new array + $ads = array(); + + // Display a containing div + echo '
    '; + + echo '
      '; + + // Display Ad 1 + if ( $link1 ) + $ads[] = '
    • '; + + elseif ( $ad1 ) + $ads[] = '
    • '; + + // Display Ad 2 + if ( $link2 ) + $ads[] = '
    • '; + + elseif ( $ad2 ) + $ads[] = '
    • '; + + // Display Ad 3 + if ( $link3 ) + $ads[] = '
    • '; + + elseif ( $ad3 ) + $ads[] = '
    • '; + + // Display Ad 4 + if ( $link4 ) + $ads[] = '
    • '; + + elseif ( $ad4 ) + $ads[] = '
    • '; + + // Display Ad 5 + if ( $link5 ) + $ads[] = '
    • '; + + elseif ( $ad5 ) + $ads[] = '
    • '; + + // Display Ad 6 + if ( $link6 ) + $ads[] = '
    • '; + + elseif ( $ad6 ) + $ads[] = '
    • '; + + // Randomize order if selected + if ($randomize){ + shuffle($ads); + } + + //Display ads + foreach($ads as $ad){ + echo $ad; + } + + echo '
    '; + + echo '
    '; + + // After widget (defined by theme functions file) + echo $after_widget; +} + +/*-----------------------------------------------------------------------------------*/ +/* Update Widget +/*-----------------------------------------------------------------------------------*/ + +function update( $new_instance, $old_instance ) { + $instance = $old_instance; + + // Strip tags to remove HTML (important for text inputs) + $instance['title'] = strip_tags( $new_instance['title'] ); + + // No need to strip tags + $instance['ad1'] = $new_instance['ad1']; + $instance['ad2'] = $new_instance['ad2']; + $instance['ad3'] = $new_instance['ad3']; + $instance['ad4'] = $new_instance['ad4']; + $instance['ad5'] = $new_instance['ad5']; + $instance['ad6'] = $new_instance['ad6']; + $instance['link1'] = $new_instance['link1']; + $instance['link2'] = $new_instance['link2']; + $instance['link3'] = $new_instance['link3']; + $instance['link4'] = $new_instance['link4']; + $instance['link5'] = $new_instance['link5']; + $instance['link6'] = $new_instance['link6']; + $instance['random'] = $new_instance['random']; + + return $instance; +} + +/*-----------------------------------------------------------------------------------*/ +/* Widget Settings (Displays the widget settings controls on the widget panel) +/*-----------------------------------------------------------------------------------*/ + +function form( $instance ) { + + // Set up some default widget settings + $defaults = array( + 'title' => 'Our Sponsors', + 'ad1' => get_template_directory_uri()."/images/125x125.gif", + 'link1' => 'http://mythemeshop.com/', + 'ad2' => get_template_directory_uri()."/images/125x125.gif", + 'link2' => 'http://mythemeshop.com/', + 'ad3' => '', + 'link3' => '', + 'ad4' => '', + 'link4' => '', + 'ad5' => '', + 'link5' => '', + 'ad6' => '', + 'link6' => '', + 'random' => false + ); + + $instance = wp_parse_args( (array) $instance, $defaults ); ?> + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + + + + + +

    + + diff --git a/functions/widget-ad300.php b/functions/widget-ad300.php new file mode 100644 index 0000000..027c391 --- /dev/null +++ b/functions/widget-ad300.php @@ -0,0 +1,137 @@ + 'mts_ad_300_widget', + 'description' => __('A widget for 300 x 250 ad (Single banner)', 'mythemeshop') + ); + + // Widget control settings + $control_ops = array( + 'width' => 300, + 'height' => 350, + 'id_base' => 'mts_ad_300_widget' + ); + + // Create the widget + parent::__construct( 'mts_ad_300_widget', __('MyThemeShop: 300x250 Ad', 'mythemeshop'), $widget_ops, $control_ops ); + +} + +/*-----------------------------------------------------------------------------------*/ +/* Display Widget +/*-----------------------------------------------------------------------------------*/ + +function widget( $args, $instance ) { + extract( $args ); + + // Variables from the widget settings + $title = apply_filters('widget_title', $instance['title'] ); + $ad = $instance['ad']; + $link = $instance['link']; + + // Before widget (defined by theme functions file) + echo $before_widget; + + // Display the widget title if one was input + if ( $title ) + echo $before_title . $title . $after_title; + + // Display a containing div + echo '
    '; + + // Display Ad + if ( $link ) + echo ''; + + elseif ( $ad ) + echo ''; + + echo '
    '; + + // After widget (defined by theme functions file) + echo $after_widget; +} + + +/*-----------------------------------------------------------------------------------*/ +/* Update Widget +/*-----------------------------------------------------------------------------------*/ + +function update( $new_instance, $old_instance ) { + $instance = $old_instance; + + // Strip tags to remove HTML (important for text inputs) + $instance['title'] = strip_tags( $new_instance['title'] ); + + // No need to strip tags + $instance['ad'] = $new_instance['ad']; + $instance['link'] = $new_instance['link']; + + return $instance; +} + +/*-----------------------------------------------------------------------------------*/ +/* Widget Settings (Displays the widget settings controls on the widget panel) +/*-----------------------------------------------------------------------------------*/ + +function form( $instance ) { + + // Set up some default widget settings + $defaults = array( + 'title' => '', + 'ad' => get_template_directory_uri()."/images/300x250.gif", + 'link' => 'http://mythemeshop.com/', + ); + + $instance = wp_parse_args( (array) $instance, $defaults ); ?> + + +

    + + +

    + + +

    + + +

    + + +

    + + +

    + + diff --git a/functions/widget-after-first-paragraph.php b/functions/widget-after-first-paragraph.php new file mode 100644 index 0000000..605d3eb --- /dev/null +++ b/functions/widget-after-first-paragraph.php @@ -0,0 +1,53 @@ + __("After First Paragraph", "mythemeshop"), + "id" => "after-first-paragraph", + "description" => __("Widget area that appears after the first paragraph in posts and pages.", "mythemeshop"), + "before_widget" => "
    ", + "after_widget" => "
    ", + "before_title" => "

    ", + "after_title" => "

    ", + )); +} +add_action("widgets_init", "mts_register_after_first_paragraph_widget"); + +// Insert widget content after first paragraph +function mts_insert_after_first_paragraph($content) { + // Only run on single posts and pages + if (!is_single() && !is_page()) { + return $content; + } + + // Check if widget area has active widgets + if (!is_active_sidebar("after-first-paragraph")) { + return $content; + } + + // Get the widget content + ob_start(); + dynamic_sidebar("after-first-paragraph"); + $widget_content = ob_get_clean(); + + // Find the first paragraph + $closing_p = "

    "; + $paragraphs = explode($closing_p, $content); + + // Insert widget after first paragraph if content has paragraphs + if (count($paragraphs) > 1) { + $paragraphs[0] .= $closing_p . $widget_content; + $content = implode($closing_p, $paragraphs); + } + + return $content; +} +add_filter("the_content", "mts_insert_after_first_paragraph"); diff --git a/functions/widget-catposts.php b/functions/widget-catposts.php new file mode 100644 index 0000000..392404d --- /dev/null +++ b/functions/widget-catposts.php @@ -0,0 +1,172 @@ + __( 'Display the most recent posts from a single category','mythemeshop' ) ) + ); + } + + public function form( $instance ) { + $defaults = array( + 'comment_num' => 1, + 'date' => 1, + 'show_thumb1' => 1, + 'show_excerpt' => 1, + 'excerpt_length' => 10 + ); + $instance = wp_parse_args((array) $instance, $defaults); + $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : __( 'Featured Category','mythemeshop' ); + $cat = isset( $instance[ 'cat' ] ) ? intval( $instance[ 'cat' ] ) : 0; + $qty = isset( $instance[ 'qty' ] ) ? intval( $instance[ 'qty' ] ) : 5; + $comment_num = isset( $instance[ 'comment_num' ] ) ? intval( $instance[ 'comment_num' ] ) : 1; + $date = isset( $instance[ 'date' ] ) ? intval( $instance[ 'date' ] ) : 1; + $show_thumb1 = isset( $instance[ 'show_thumb1' ] ) ? intval( $instance[ 'show_thumb1' ] ) : 1; + $show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? esc_attr( $instance[ 'show_excerpt' ] ) : 1; + $excerpt_length = isset( $instance[ 'excerpt_length' ] ) ? intval( $instance[ 'excerpt_length' ] ) : 10; + ?> +

    + + +

    +

    + + 'ID', + 'order' => 'ASC', + 'show_count' => 1, + 'hide_empty' => 1, + 'hide_if_empty' => true, + 'echo' => 1, + 'selected' => $cat, + 'hierarchical' => 1, + 'name' => $this->get_field_name( 'cat' ), + 'id' => $this->get_field_id( 'cat' ), + 'taxonomy' => 'category', + ) ); ?> +

    +

    + + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + + '; + + while ( $posts->have_posts() ) { $posts->the_post(); ?> +
  • + + + + '')); ?> + + <?php the_title(); ?> + + + + +
    + + + + + • + + + % '.__('Comments','mythemeshop'));?> + +
    + +

    + +

    + +
  • + '."\r\n"; + } + +} +//add_action( 'widgets_init', create_function( '', 'register_widget( "single_category_posts_widget" );' ) ); +add_action('widgets_init', function(){return register_widget("single_category_posts_widget");}); diff --git a/functions/widget-fblikebox.php b/functions/widget-fblikebox.php new file mode 100644 index 0000000..6ad6dd9 --- /dev/null +++ b/functions/widget-fblikebox.php @@ -0,0 +1,135 @@ + 'facebook_like', 'description' => __('Add Facebook Like Box.','mythemeshop')); + + $control_ops = array('id_base' => 'facebook-like-widget'); + + parent::__construct('facebook-like-widget', __('MyThemeShop: FB Like Box','mythemeshop'), $widget_ops, $control_ops); + } +*/ + +class Facebook_Like_Widget extends WP_Widget { + public function __construct() { + $widget_ops = array( + 'classname' => 'facebook_like_widget', + 'description' => __('Display a Facebook Like Box.', 'your-text-domain') + ); + parent::__construct('facebook_like_widget', __('Facebook Like Widget', 'your-text-domain'), $widget_ops); + } + + function widget($args, $instance) + { + extract($args); + + $title = apply_filters('widget_title', $instance['title']); + $page_url = $instance['page_url']; + $width = $instance['width']; + $color_scheme = $instance['color_scheme']; + $show_faces = isset($instance['show_faces']) ? 'true' : 'false'; + $show_stream = isset($instance['show_stream']) ? 'true' : 'false'; + $show_header = isset($instance['show_header']) ? 'true' : 'false'; + $height = '65'; + + if($show_faces == 'true') { + $height = '238'; + } + + if($show_stream == 'true') { + $height = '600'; + } + + if($show_header == 'true') { + $height = '600'; + } + + echo $before_widget; + + if($title) { + echo $before_title.$title.$after_title; + } + + if($page_url): ?> + + __('Find us on Facebook','mythemeshop'), 'page_url' => '', 'width' => '292', 'color_scheme' => 'light', 'show_faces' => 'on', 'show_stream' => false, 'show_header' => false); + $instance = wp_parse_args((array) $instance, $defaults); ?> + +

    + + +

    + +

    + + +

    + +

    + + +

    + +

    + + +

    + +

    + id="get_field_id('show_faces'); ?>" name="get_field_name('show_faces'); ?>" /> + +

    + +

    + id="get_field_id('show_stream'); ?>" name="get_field_name('show_stream'); ?>" /> + +

    + +

    + id="get_field_id('show_header'); ?>" name="get_field_name('show_header'); ?>" /> + +

    + diff --git a/functions/widget-googleplus.php b/functions/widget-googleplus.php new file mode 100644 index 0000000..7409014 --- /dev/null +++ b/functions/widget-googleplus.php @@ -0,0 +1,149 @@ + 'mts_googleplus', 'description' => __('Add Google Plus Badge Box.','mythemeshop')); + + $control_ops = array('id_base' => 'google-badge-box'); + + parent::__construct('google-badge-box', __('MyThemeShop: Google Plus Badge Box','mythemeshop'), $widget_ops, $control_ops); + } +*/ + +class mts_googleplus_Widget extends WP_Widget { + public function __construct() { + $widget_ops = array( + 'classname' => 'mts_googleplus_widget', + 'description' => __('Display Google+ Badge.', 'your-text-domain') + ); + parent::__construct('mts_googleplus_widget', __('Google+ Widget', 'your-text-domain'), $widget_ops); + } + + + + function widget($args, $instance) + { + extract($args); + + $title = apply_filters('widget_title', $instance['title']); + $page_type = $instance['page_type']; + $page_url = $instance['page_url']; + $width = $instance['width']; + $color_scheme = $instance['color_scheme']; + $gp_layout = $instance['gp_layout']; + $cover_photo = isset($instance['cover_photo']) ? 'true' : 'false'; + $tagline = isset($instance['tagline']) ? 'true' : 'false'; + echo $before_widget; + + if($title) { + echo $before_title.$title.$after_title; + } + + if($page_url): ?> +
    class="g-person"class="g-page"class="g-community" data-width="" data-href="" data-layout="" data-theme="" data-rel="publisher" data-showtagline="" data-showcoverphoto="">
    + + + __('Find us on Google Plus','mythemeshop'), 'page_url' => '', 'width' => '300', 'color_scheme' => 'light', 'gp_layout' => 'portrait', 'page_type' => 'profile', 'cover_photo' => 'on', 'tagline' => 'on'); + $instance = wp_parse_args((array) $instance, $defaults); ?> + +

    + + +

    +

    + + +

    + +

    + + +

    + +

    + + +

    + +

    + + +

    + +

    + + +

    + +

    + +

    + +

    + id="get_field_id('cover_photo'); ?>" name="get_field_name('cover_photo'); ?>" /> + +

    + +

    + id="get_field_id('tagline'); ?>" name="get_field_name('tagline'); ?>" /> + +

    + diff --git a/functions/widget-popular.php b/functions/widget-popular.php new file mode 100644 index 0000000..fcea7e1 --- /dev/null +++ b/functions/widget-popular.php @@ -0,0 +1,179 @@ + __( 'Displays most Popular Posts with Thumbnail.','mythemeshop' ) ) + ); + } + + public function form( $instance ) { + $defaults = array( + 'comment_num' => 1, + 'date' => 1, + 'days' => 30, + 'show_thumb3' => 1, + 'show_excerpt' => 1, + 'excerpt_length' => 10, + ); + $instance = wp_parse_args((array) $instance, $defaults); + $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : __( 'Popular Posts','mythemeshop' ); + $qty = isset( $instance[ 'qty' ] ) ? intval( $instance[ 'qty' ] ) : 5; + $comment_num = isset( $instance[ 'comment_num' ] ) ? intval( $instance[ 'comment_num' ] ) : 1; + $date = isset( $instance[ 'date' ] ) ? intval( $instance[ 'date' ] ) : 1; + $days = isset( $instance[ 'days' ] ) ? intval( $instance[ 'days' ] ) : 30; + $show_thumb3 = isset( $instance[ 'show_thumb3' ] ) ? intval( $instance[ 'show_thumb3' ] ) : 1; + $show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? esc_attr( $instance[ 'show_excerpt' ] ) : 1; + $excerpt_length = isset( $instance[ 'excerpt_length' ] ) ? intval( $instance[ 'excerpt_length' ] ) : 10; + ?> +

    + + +

    + +

    + +

    + +

    + + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + +

    + '" . date('Y-m-d', strtotime('-'.$popular_days.' days')) . "'"; + return $where; + } + + $popular = get_posts( array( 'suppress_filters' => false, 'ignore_sticky_posts' => 1, 'orderby' => 'comment_count', 'numberposts' => $qty ) ); + echo '