├── .gitignore
└── themifyflow
├── buddypress.php
├── comments.php
├── footer.php
├── functions.php
├── header.php
├── includes
├── author-box.php
├── loop.php
├── pagination.php
└── post-nav.php
├── index.php
├── media-queries.css
├── page.php
├── screenshot.png
├── searchform.php
├── sidebar.php
├── single.php
├── style.css
├── tf
├── assets
│ ├── css
│ │ ├── fontawesome
│ │ │ ├── css
│ │ │ │ ├── font-awesome.css
│ │ │ │ └── font-awesome.min.css
│ │ │ ├── fonts
│ │ │ │ ├── FontAwesome.otf
│ │ │ │ ├── fontawesome-webfont.eot
│ │ │ │ ├── fontawesome-webfont.svg
│ │ │ │ ├── fontawesome-webfont.ttf
│ │ │ │ ├── fontawesome-webfont.woff
│ │ │ │ └── fontawesome-webfont.woff2
│ │ │ └── list.html
│ │ ├── jquery.minicolors.css
│ │ ├── tf-admin.css
│ │ ├── tf-updater.css
│ │ └── themify-icons
│ │ │ ├── themify-icons.css
│ │ │ ├── themify.eot
│ │ │ ├── themify.svg
│ │ │ ├── themify.ttf
│ │ │ └── themify.woff
│ ├── img
│ │ ├── builder
│ │ │ ├── 1-col.png
│ │ │ ├── 1.3_2.3.png
│ │ │ ├── 1.4_1.4_2.4.png
│ │ │ ├── 1.4_2.4_1.4.png
│ │ │ ├── 1.4_3.4.png
│ │ │ ├── 2-col.png
│ │ │ ├── 2.3_1.3.png
│ │ │ ├── 2.4_1.4_1.4.png
│ │ │ ├── 3-col.png
│ │ │ ├── 3.4_1.4.png
│ │ │ ├── 4-col.png
│ │ │ ├── 5-col.png
│ │ │ ├── 6-col.png
│ │ │ ├── dashed.png
│ │ │ ├── dotted.png
│ │ │ ├── double.png
│ │ │ ├── fullwidth.png
│ │ │ ├── grid2.png
│ │ │ ├── grid3.png
│ │ │ ├── grid4.png
│ │ │ ├── image-center.png
│ │ │ ├── image-left.png
│ │ │ ├── image-overlay.png
│ │ │ ├── image-right.png
│ │ │ ├── image-top.png
│ │ │ ├── list-post.png
│ │ │ ├── solid.png
│ │ │ ├── video-left.png
│ │ │ ├── video-overlay.png
│ │ │ ├── video-right.png
│ │ │ └── video-top.png
│ │ ├── favicon.png
│ │ ├── flow-wheel.png
│ │ ├── jquery.minicolors.png
│ │ └── layout-icons
│ │ │ ├── footer.png
│ │ │ ├── header.png
│ │ │ ├── none.png
│ │ │ ├── sidebar1-left.png
│ │ │ ├── sidebar1.png
│ │ │ └── sidebar2.png
│ └── js
│ │ ├── google-fonts-recommended.json
│ │ ├── google-fonts.json
│ │ ├── tf-admin.js
│ │ ├── tf-updater.js
│ │ ├── tf
│ │ ├── admin-setup.js
│ │ ├── collections
│ │ │ ├── controls.js
│ │ │ └── elementstyles.js
│ │ ├── mixins
│ │ │ ├── builder.js
│ │ │ └── stylingcontrolfield.js
│ │ ├── models
│ │ │ ├── control.js
│ │ │ ├── elementstyle.js
│ │ │ ├── style.js
│ │ │ ├── template.js
│ │ │ └── utility.js
│ │ ├── setup.js
│ │ ├── tf-updater.js
│ │ ├── tf.js
│ │ ├── theme.js
│ │ ├── utils.js
│ │ └── views
│ │ │ ├── builder.js
│ │ │ ├── builderelement.js
│ │ │ ├── lightbox.js
│ │ │ ├── loader.js
│ │ │ ├── stylingcontrol.js
│ │ │ └── templatepart.js
│ │ ├── themify.dropdown.js
│ │ ├── themify.scroll-highlight.js
│ │ └── vendor
│ │ ├── jquery.minicolors.js
│ │ ├── jquery.nicescroll.js
│ │ └── jquery.tipsy.js
├── classes
│ ├── class-tf-admin.php
│ ├── class-tf-ajax.php
│ ├── class-tf-backend.php
│ ├── class-tf-content-builder.php
│ ├── class-tf-duplicate.php
│ ├── class-tf-editor-ui.php
│ ├── class-tf-form.php
│ ├── class-tf-frontend.php
│ ├── class-tf-layout.php
│ ├── class-tf-menu-icons.php
│ ├── class-tf-model.php
│ ├── class-tf-settings.php
│ ├── class-tf-shortcodes.php
│ ├── class-tf-template-options.php
│ ├── class-tf-updater.php
│ ├── class-tf-validator.php
│ ├── class-tf-walker-nav-menu-edit.php
│ ├── engine
│ │ ├── class-tf-engine-style-loader.php
│ │ ├── class-tf-engine-theme-loader.php
│ │ └── class-tf-engine.php
│ ├── import-export
│ │ ├── class-tf-export.php
│ │ └── class-tf-import.php
│ ├── modules
│ │ ├── class-tf-module-element-loader.php
│ │ ├── class-tf-module-element.php
│ │ ├── class-tf-module-loader.php
│ │ └── class-tf-module.php
│ ├── theme-elements
│ │ ├── class-tf-interface.php
│ │ ├── class-tf-styling-control.php
│ │ ├── class-tf-styling-panel.php
│ │ ├── class-tf-template-part.php
│ │ ├── class-tf-template.php
│ │ └── class-tf-theme.php
│ └── updater
│ │ ├── class-tf-update-check.php
│ │ └── class-tf-upgrader.php
├── includes
│ ├── data
│ │ └── theme-base.zip
│ ├── functions
│ │ └── tf-core-functions.php
│ ├── modules
│ │ ├── archive-loop
│ │ │ ├── class-tf-module-archive-loop.php
│ │ │ ├── class-tf-module-single-loop.php
│ │ │ ├── elements
│ │ │ │ ├── featured-image.php
│ │ │ │ ├── post-excerpt-content.php
│ │ │ │ ├── post-meta.php
│ │ │ │ ├── post-text.php
│ │ │ │ └── post-title.php
│ │ │ └── module.php
│ │ ├── author-box
│ │ │ └── module.php
│ │ ├── category-description
│ │ │ └── module.php
│ │ ├── category-image
│ │ │ └── module.php
│ │ ├── category-title
│ │ │ └── module.php
│ │ ├── comments
│ │ │ └── module.php
│ │ ├── divider
│ │ │ └── module.php
│ │ ├── icon
│ │ │ └── module.php
│ │ ├── image
│ │ │ └── module.php
│ │ ├── list-posts
│ │ │ ├── class-tf-module-list-posts.php
│ │ │ └── module.php
│ │ ├── menu
│ │ │ ├── class-menu-dropdown.php
│ │ │ └── module.php
│ │ ├── next-prev-post
│ │ │ └── module.php
│ │ ├── page-content
│ │ │ └── module.php
│ │ ├── page-featured-image
│ │ │ └── module.php
│ │ ├── page-title
│ │ │ └── module.php
│ │ ├── searchform
│ │ │ └── module.php
│ │ ├── site-logo
│ │ │ └── module.php
│ │ ├── site-tagline
│ │ │ └── module.php
│ │ ├── template_part
│ │ │ └── module.php
│ │ ├── text
│ │ │ └── module.php
│ │ ├── video
│ │ │ └── module.php
│ │ ├── widget-area
│ │ │ └── module.php
│ │ └── widget
│ │ │ └── module.php
│ ├── templates
│ │ ├── template-admin-about.php
│ │ ├── template-admin-themes.php
│ │ ├── template-backend-builder.php
│ │ ├── template-content-builder.php
│ │ ├── template-frontend-menu.php
│ │ ├── template-module-panel.php
│ │ ├── template-part-edit.php
│ │ ├── template-part.php
│ │ ├── template-region-edit.php
│ │ ├── template-region.php
│ │ ├── template-render-body.php
│ │ ├── template-render-footer.php
│ │ └── template-render-header.php
│ ├── tmpl
│ │ ├── tmpl-backend.php
│ │ └── tmpl-styling-panel.php
│ └── utilities
│ │ ├── class-wp-cli.php
│ │ ├── export.php
│ │ └── parsers.php
├── languages
│ └── index.php
├── styling-config.php
├── tf-hooks.php
└── tf.php
├── theme-functions.php
└── woocommerce.php
/.gitignore:
--------------------------------------------------------------------------------
1 | *.log
2 | .htaccess
3 | sitemap.xml
4 | sitemap.xml.gz
5 | wp-config.php
6 | wp-content/advanced-cache.php
7 | wp-content/backup-db/
8 | wp-content/backups/
9 | wp-content/blogs.dir/
10 | wp-content/cache/
11 | wp-content/upgrade/
12 | wp-content/uploads/
13 | wp-content/wp-cache-config.php
14 | .DS_Store
--------------------------------------------------------------------------------
/themifyflow/buddypress.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/themifyflow/footer.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | →
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/themifyflow/includes/loop.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 | >
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | [', ']'); ?>
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/themifyflow/includes/pagination.php:
--------------------------------------------------------------------------------
1 | ' : '';
9 | $in_same_cat = ( isset( $in_same_cat ) && '1' == $in_same_cat ) ? true : false;
10 | $next_post_label = ( ! empty( $next_post_label ) ) ? '' . $next_post_label . ' ' : '';
11 | $prev_post_label = ( ! empty( $prev_post_label ) ) ? '' . $prev_post_label . ' ' : '';
12 | ?>
13 |
14 |
15 |
16 | %link', $arrow . $prev_post_label . ' %title', $in_same_cat ) ?>
17 |
18 | %link', $arrow . $next_post_label . ' %title', $in_same_cat ) ?>
19 |
20 |
21 |
--------------------------------------------------------------------------------
/themifyflow/index.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | '
'.__('Pages:','themify-flow').' ', 'after' => '
', 'next_or_number' => 'number')); ?>
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
9 |
--------------------------------------------------------------------------------
/themifyflow/sidebar.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/themifyflow/single.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 | '' . __('Pages:', 'themify-flow') . ' ', 'after' => '
', 'next_or_number' => 'number')); ?>
16 |
17 |
18 |
19 |
20 |
21 | ' + tfUpdater.invalid_login + '');
14 | }
15 | } else {
16 | $('.prompt-box .prompt-error').remove();
17 | }
18 | $('.prompt-box').addClass( 'update-theme' );
19 | $('.overlay, .prompt-box').fadeIn(500);
20 | }
21 | function hideLogin(){
22 | $('.overlay, .prompt-box').fadeOut(500);
23 | }
24 | function showAlert(){
25 | $('.alert').addClass('busy').fadeIn(800);
26 | }
27 | function hideAlert(status){
28 | if(status == 'error'){
29 | status = 'error';
30 | showErrors();
31 | } else {
32 | status = 'done';
33 | }
34 | $('.alert').removeClass('busy').addClass(status).delay(800).fadeOut(800, function(){
35 | $(this).removeClass(status);
36 | });
37 | }
38 | function showErrors(verbose){
39 | $('.overlay, .prompt-box').delay(900).fadeIn(500);
40 | $('.prompt-box .show-error').show();
41 | $('.prompt-box .show-error p').remove();
42 | $('.prompt-box .error-msg').after('' + verbose + '
');
43 | $('.prompt-box .show-login').hide();
44 | }
45 |
46 | //
47 | // Upgrade Theme / Framework
48 | //
49 | $('.tf-upgrade-theme').on('click', function(e){
50 | e.preventDefault();
51 | _updater_el = $(this);
52 | if ( confirm( tfUpdater.confirm_update ) ) {
53 | if ( $(this).parent().hasClass( 'login' ) ) {
54 | showLogin();
55 | } else {
56 | $('#themify_update_form').append( ' ' ).submit();
57 |
58 | }
59 | }
60 | });
61 |
62 | //
63 | // Login Validation
64 | //
65 | $('.tf-upgrade-login').on('click', function(e){
66 | e.preventDefault();
67 | if ( $('.prompt-box').hasClass( 'update-theme' ) ) {
68 | var el = $(this),
69 | username = el.parent().parent().find('.username').val(),
70 | password = el.parent().parent().find('.password').val(),
71 | login = el.closest( '.notifications' ).find( '.update' ).hasClass('login');
72 | if(username != "" && password != ""){
73 | hideLogin();
74 | showAlert();
75 | $.post(
76 | ajaxurl,
77 | {
78 | 'action':'tf_validate_login',
79 | 'type':'theme',
80 | 'login':login,
81 | 'username':username,
82 | 'password':password,
83 | 'nicename_short': _updater_el.data( 'nicename_short' ),
84 | 'update_type': _updater_el.data( 'update_type' )
85 | },
86 | function(data){
87 | data = $.trim(data);
88 | if(data == 'true'){
89 | hideAlert();
90 | $('#themify_update_form').append( ' ' ).submit();
91 | } else if(data == 'false') {
92 | hideAlert('error');
93 | showLogin('error');
94 | }
95 | }
96 | );
97 | } else {
98 | hideAlert('error');
99 | showLogin('error');
100 | }
101 | }
102 | });
103 | //
104 | // Hide Overlay
105 | //
106 | $('.overlay').on('click', function(){
107 | hideLogin();
108 | });
109 |
110 | $('.themify_changelogs').on('click', function(e){
111 | e.preventDefault();
112 | var $self = $(this),
113 | url = $self.data('changelog');
114 | $('.show-login, .show-error').hide();
115 | $('.alert').addClass('busy').fadeIn(300);
116 | $('.overlay, .prompt-box').fadeIn(300);
117 | var $iframe = $('');
118 | $iframe.on('load', function(){
119 | $('.alert').removeClass('busy').fadeOut(300);
120 | }).prependTo( '.prompt-box' );
121 | $('.prompt-box').addClass('show-changelog');
122 |
123 | });
124 |
125 | }(jQuery, window, document));
--------------------------------------------------------------------------------
/themifyflow/tf/assets/js/tf/utils.js:
--------------------------------------------------------------------------------
1 | (function($){
2 |
3 | 'use strict';
4 |
5 | TF.Utils.plupload = function( params, callback ) {
6 | params = params || {};
7 | callback = callback || function(){
8 | $('.tf_close_lightbox').trigger('click');
9 | window.location.reload();
10 | };
11 |
12 | var $builderPluploadUpload = $(".tf-plupload-upload-uic");
13 |
14 | if($builderPluploadUpload.length > 0) {
15 | var pconfig = false;
16 | $builderPluploadUpload.each(function() {
17 | var $this = $(this),
18 | id1 = $this.attr("id"),
19 | imgId = id1.replace("tf-plupload-upload-ui", "");
20 |
21 | pconfig = JSON.parse( JSON.stringify( _tf_app_plupload ) );
22 |
23 | pconfig["browse_button"] = imgId + pconfig["browse_button"];
24 | pconfig["container"] = imgId + pconfig["container"];
25 | pconfig["drop_element"] = imgId + pconfig["drop_element"];
26 | pconfig["file_data_name"] = imgId + pconfig["file_data_name"];
27 | pconfig["multipart_params"]["imgid"] = imgId;
28 | pconfig["multipart_params"]["nonce"] = _tf_app.nonce;
29 | pconfig["multipart_params"] = _.extend( params, pconfig["multipart_params"] );
30 |
31 | var uploader = new plupload.Uploader( pconfig );
32 |
33 | uploader.bind('Init', function(up){});
34 |
35 | uploader.init();
36 |
37 | // a file was added in the queue
38 | uploader.bind('FilesAdded', function(up, files){
39 | up.refresh();
40 | up.start();
41 | // show loader
42 | if ( ! _.isUndefined( TF.Instance.loader ) ) {
43 | TF.Instance.loader.show();
44 | }
45 | });
46 |
47 | uploader.bind('Error', function(up, error){
48 | var $promptError = $('.prompt-box .show-error');
49 | $('.prompt-box .show-login').hide();
50 | $promptError.show();
51 |
52 | if($promptError.length > 0){
53 | $promptError.html('' + error.message + '
');
54 | }
55 | $(".overlay, .prompt-box").fadeIn(500);
56 | if ( ! _.isUndefined( TF.Instance.loader ) ) {
57 | TF.Instance.loader.hide();
58 | }
59 | });
60 |
61 | // a file was uploaded
62 | uploader.bind('FileUploaded', function(up, file, response) {
63 | var json = JSON.parse(response['response']), status;
64 |
65 | if('200' == response['status'] && !json.error) {
66 | status = 'done';
67 | } else {
68 | status = 'error';
69 | }
70 |
71 | $("#themify_builder_alert").removeClass("busy").addClass(status).delay(800).fadeOut(800, function() {
72 | $(this).removeClass(status);
73 | });
74 |
75 | if(json.error){
76 | alert(json.error.replace(/\\n/g,"\n"));
77 | if ( ! _.isUndefined( TF.Instance.loader ) ) {
78 | TF.Instance.loader.hide();
79 | }
80 | return;
81 | }
82 |
83 | if ( _.isFunction( callback ) ) {
84 | callback.call(this, json);
85 | }
86 |
87 | });
88 |
89 | });
90 | }
91 | };
92 | })(jQuery);
--------------------------------------------------------------------------------
/themifyflow/tf/assets/js/tf/views/lightbox.js:
--------------------------------------------------------------------------------
1 | (function($){
2 |
3 | 'use strict';
4 |
5 | // Lightbox View
6 | TF.Views.Lightbox = Backbone.View.extend({
7 |
8 | tagName: 'div',
9 |
10 | className: 'tf_overlay',
11 |
12 | template: wp.template('tf_lightbox'),
13 |
14 | ensureClose: true,
15 |
16 | initialize: function( options ) {
17 | this.options = options || {};
18 | this.render();
19 | },
20 |
21 | events: {
22 | 'click .tf_close_lightbox' : 'close',
23 | 'click .tf_cancel_lightbox' : 'cancel'
24 | },
25 |
26 | render: function() {
27 | var lightboxParams = { title: this.options.title, lightboxClass: this.options.lightboxClass || 'builder-lightbox', closeBtn: this.options.closeBtn || 'yes' };
28 | this.$el.html( this.template(lightboxParams) ).appendTo('body');
29 | },
30 |
31 | close: function( event ) {
32 | event.preventDefault();
33 | this.trigger('remove');
34 |
35 | if ( this.ensureClose ) {
36 | this.remove();
37 | }
38 | },
39 |
40 | cancel: function( event ) {
41 | event.preventDefault();
42 | this.trigger('cancel');
43 |
44 | if ( this.ensureClose ) {
45 | this.remove();
46 | }
47 | },
48 |
49 | load: function( $html ) {
50 | this.$el.find('.tf_lightbox_container').html( $html );
51 | },
52 |
53 | append: function( $html ) {
54 | this.$el.find('.tf_lightbox_container').append( $html );
55 | }
56 | });
57 | })(jQuery);
--------------------------------------------------------------------------------
/themifyflow/tf/assets/js/tf/views/loader.js:
--------------------------------------------------------------------------------
1 | (function($){
2 |
3 | 'use strict';
4 |
5 | TF.Views.Loader = Backbone.View.extend({
6 | id: 'tf_routine_loader',
7 |
8 | className: 'tf_interface',
9 |
10 | template: wp.template('tf_routine_loader'),
11 |
12 | initialize: function() {
13 | if ( ! $('#tf_routine_loader').length ) {
14 | this.render();
15 | }
16 | },
17 |
18 | render: function() {
19 | this.$el.html( this.template() ).appendTo('body');
20 | },
21 |
22 | show: function(){
23 | this.$el.show();
24 | },
25 |
26 | hide: function(){
27 | this.$el.hide();
28 | }
29 | });
30 |
31 | // code
32 | })(jQuery);
--------------------------------------------------------------------------------
/themifyflow/tf/assets/js/tf/views/templatepart.js:
--------------------------------------------------------------------------------
1 | (function($){
2 |
3 | 'use strict';
4 |
5 | TF.Views.TemplatePart = Backbone.View.extend({
6 | initialize: function() {
7 | this.render();
8 | },
9 |
10 | render: function() {
11 | this.$el.each(function(){
12 | if ( $.trim( $(this).find('.tf_template_part_region_render_content').html() ).length ) {
13 | $(this).find('.tf_template_region_button').hide();
14 | }
15 | });
16 | },
17 |
18 | events: {
19 | 'click .tf_template_region_button-add' : 'regionAdd',
20 | 'click .tf_lightbox_link_region-swap' : 'regionSwap',
21 | 'click .tf_lightbox_link_region-edit' : 'regionEdit',
22 | 'click .tf_lightbox_link_region-delete' : 'regionDelete',
23 | 'dblclick .tf_active_block_overlay' : 'regionEditDouble'
24 | },
25 |
26 | regionAdd: function( event ) {
27 | event.preventDefault();
28 |
29 | // Run an AJAX request.
30 | var region = $(event.currentTarget).data('region'),
31 | jqxhr = wp.ajax.post( 'tf_lightbox', {
32 | method: 'add',
33 | type: 'region_template_part',
34 | template_id: _tf_app.post_id,
35 | region: region,
36 | nonce: _tf_app.nonce
37 | }),
38 | lightbox = new TF.Views.Lightbox();
39 | jqxhr.done(function(data){
40 | lightbox.load( data );
41 |
42 | // Trigger event
43 | $('body').trigger( 'tf_on_lightbox_opened', [ lightbox.$el ] );
44 | });
45 | },
46 |
47 | regionSwap: function( event ) {
48 | event.preventDefault();
49 | var region = $(event.currentTarget).closest('[data-region-area]').data('region-area');
50 |
51 | // Run an AJAX request.
52 | var jqxhr = wp.ajax.post( 'tf_lightbox', {
53 | method: 'edit',
54 | type: 'region_template_part',
55 | template_id: _tf_app.post_id,
56 | region: region,
57 | slug: TF.Instance.templateModel.get( region ),
58 | nonce: _tf_app.nonce
59 | }),
60 | lightbox = new TF.Views.Lightbox();
61 | jqxhr.done(function(data){
62 | lightbox.load( data );
63 |
64 | // Trigger event
65 | $('body').trigger( 'tf_on_lightbox_opened', [ lightbox.$el ] );
66 | });
67 | },
68 |
69 | regionDelete: function( event ) {
70 | event.preventDefault();
71 |
72 | if ( confirm( _tf_app.template_part_delete ) ) {
73 | var $parent = $(event.currentTarget).closest('[data-region-area]'),
74 | region = $parent.data('region-area');
75 |
76 | $parent.find('.tf_template_part_region_render_content').html('')
77 | .end().find('.tf_template_region_button').show();
78 |
79 | // Update Model
80 | TF.Instance.templateModel.set( region, '' );
81 | }
82 | },
83 |
84 | regionEdit: function( event ) {
85 | event.preventDefault();
86 |
87 | var lightbox = new TF.Views.Lightbox({lightboxClass: 'template-part-lightbox builder-lightbox', closeBtn: 'yes'}),
88 | url = $(event.currentTarget).data('edit-url');
89 |
90 | var iframe = $('', {id: 'template-part-iframe', src: url, frameborder: 0, scrolling: 'yes'})
91 | .load(function( response ){
92 | lightbox.$el.find('.tf_loader').remove();
93 | $(this).show();
94 |
95 | TF.Instance.builder._makeEqual( $(this).contents().find('.tf_sub_row'), '.tf_sub_row_content');
96 | TF.Instance.builder._makeEqual( $(this).contents().find('.tf_row'), '.tf_row_content');
97 |
98 | lightbox.on('remove cancel', function(){
99 | var $self = this;
100 | if ( ! iframe.get(0).contentWindow.TF.Instance.builder.saved ) {
101 | if ( ! confirm( _tf_app.leaving_template_lightbox ) ) {
102 | $self.ensureClose = false;
103 | } else {
104 | $self.ensureClose = true;
105 | }
106 | } else {
107 | $self.ensureClose = true;
108 | }
109 | });
110 |
111 | }).hide();
112 | lightbox.append( iframe );
113 | },
114 |
115 | regionEditDouble: function( event ) {
116 | event.preventDefault();
117 | $(event.currentTarget).parent().find('.tf_lightbox_link_region-edit').trigger('click');
118 | }
119 | });
120 |
121 | })(jQuery);
--------------------------------------------------------------------------------
/themifyflow/tf/assets/js/themify.dropdown.js:
--------------------------------------------------------------------------------
1 | ;(function ( $, window, document, undefined ) {
2 |
3 | 'use strict';
4 |
5 | $.fn.themifyDropdown = function( options ) {
6 |
7 | var settings = $.extend( { }, options );
8 |
9 | return this.each(function(){
10 | if( $(this).hasClass( 'with-sub-arrow' ) )
11 | return;
12 |
13 | $(this).addClass( 'with-sub-arrow' )
14 | .find( 'li.menu-item-has-children > a:not(.lightbox)' )
15 | .append( ' ' );
16 | });
17 | };
18 |
19 | $( 'body' ).on( 'click touchstart', '.sub-arrow', function(e){
20 | e.stopPropagation();
21 |
22 | var menu_item = $( this ).closest( 'li' );
23 | var active_tree = $( this ).parents( '.dropdown-open' );
24 | $( this ).closest( '.with-sub-arrow' ) // get the menu container
25 | .find( 'li.dropdown-open' ).not( active_tree ) // find open (if any) dropdowns
26 | .each(function(){
27 | close_dropdown( $( this ) );
28 | });
29 |
30 | if( menu_item.hasClass( 'dropdown-open' ) ) {
31 | close_dropdown( menu_item );
32 | } else {
33 | open_dropdown( menu_item );
34 | }
35 |
36 | return false;
37 | } )
38 | // clicking menu items where the URL is only "#" is the same as clicking the dropdown arrow
39 | .on( 'click touchstart', '.with-sub-arrow a', function(e){
40 | if( $( this ).attr( 'href' ) === '#' ) {
41 | e.stopPropagation();
42 | $( this ).find( '> .sub-arrow' ).click();
43 | return false;
44 | }
45 | } );
46 |
47 | function open_dropdown( $li ) {
48 | var dropdown = $li.find( '.sub-menu' ).first()
49 | .show().css( 'visibility', 'visible' );
50 |
51 | $li.addClass( 'dropdown-open' );
52 | $li.find( '> a .sub-arrow' ).removeClass( 'closed' ).addClass( 'open' );
53 | }
54 |
55 | function close_dropdown( $li ) {
56 | var dropdown = $li.find( '.sub-menu' ).first()
57 | .hide().css( 'visibility', 'hidden' );
58 |
59 | $li.removeClass( 'dropdown-open' );
60 | $li.find( '> a .sub-arrow' ).removeClass( 'open' ).addClass( 'closed' );
61 | }
62 | })( jQuery, window, document );
--------------------------------------------------------------------------------
/themifyflow/tf/assets/js/vendor/jquery.tipsy.js:
--------------------------------------------------------------------------------
1 | /* tipsy, facebook style tooltips for jquery version 1.0.0a (c) 2008-2010 jason frame [jason@onehackoranother.com]
2 | released under the MIT license */
3 | !function($){function t(t,i){return"function"==typeof t?t.call(i):t}function i(t){for(;t=t.parentNode;)if(t==document)return!0;return!1}function e(t,i){this.$element=$(t),this.options=i,this.enabled=!0,this.fixTitle()}e.prototype={show:function(){var i=this.getTitle();if(i&&this.enabled){var e=this.tip();e.find(".tipsy-inner")[this.options.html?"html":"text"](i),e[0].className="tipsy",e.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var s=$.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),n=e[0].offsetWidth,o=e[0].offsetHeight,l=t(this.options.gravity,this.$element[0]),a;switch(l.charAt(0)){case"n":a={top:s.top+s.height+this.options.offset,left:s.left+s.width/2-n/2};break;case"s":a={top:s.top-o-this.options.offset,left:s.left+s.width/2-n/2};break;case"e":a={top:s.top+s.height/2-o/2,left:s.left-n-this.options.offset};break;case"w":a={top:s.top+s.height/2-o/2,left:s.left+s.width+this.options.offset}}2==l.length&&("w"==l.charAt(1)?a.left=s.left+s.width/2-15:a.left=s.left+s.width/2-n+15),e.css(a).addClass("tipsy-"+l),e.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+l.charAt(0),this.options.className&&e.addClass(t(this.options.className,this.$element[0])),this.options.fade?e.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):e.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){$(this).remove()}):this.tip().remove()},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("original-title"))&&t.attr("original-title",t.attr("title")||"").removeAttr("title")},getTitle:function(){var t,i=this.$element,e=this.options;this.fixTitle();var t,e=this.options;return"string"==typeof e.title?t=i.attr("title"==e.title?"original-title":e.title):"function"==typeof e.title&&(t=e.title.call(i[0])),t=(""+t).replace(/(^\s*|\s*$)/,""),t||e.fallback},tip:function(){return this.$tip||(this.$tip=$('
').html('
'),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},$.fn.tipsy=function(t){function i(i){var s=$.data(i,"tipsy");return s||(s=new e(i,$.fn.tipsy.elementOptions(i,t)),$.data(i,"tipsy",s)),s}function s(){var e=i(this);e.hoverState="in",0==t.delayIn?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},t.delayIn))}function n(){var e=i(this);e.hoverState="out",0==t.delayOut?e.hide():setTimeout(function(){"out"==e.hoverState&&e.hide()},t.delayOut)}if(t===!0)return this.data("tipsy");if("string"==typeof t){var o=this.data("tipsy");return o&&o[t](),this}if(t=$.extend({},$.fn.tipsy.defaults,t),t.live||this.each(function(){i(this)}),"manual"!=t.trigger){var l=t.live?"live":"bind",a="hover"==t.trigger?"mouseenter":"focus",f="hover"==t.trigger?"mouseleave":"blur";this[l](a,s)[l](f,n)}return this},$.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},$.fn.tipsy.revalidate=function(){$(".tipsy").each(function(){var t=$.data(this,"tipsy-pointee");t&&i(t)||$(this).remove()})},$.fn.tipsy.elementOptions=function(t,i){return $.metadata?$.extend({},i,$(t).metadata()):i},$.fn.tipsy.autoNS=function(){return $(this).offset().top>$(document).scrollTop()+$(window).height()/2?"s":"n"},$.fn.tipsy.autoWE=function(){return $(this).offset().left>$(document).scrollLeft()+$(window).width()/2?"e":"w"},$.fn.tipsy.autoBounds=function(t,i){return function(){var e={ns:i[0],ew:i.length>1?i[1]:!1},s=$(document).scrollTop()+t,n=$(document).scrollLeft()+t,o=$(this);return o.offset().topframework_path() ) );
65 | }
66 |
67 | public function get_bootstrap_styles( $post_id, $args = array() ) {
68 | $make_data = array();
69 | $styles = TF_Model::get_custom_styling( $post_id, $args );
70 |
71 | if ( ! empty( $styles ) && is_array( $styles ) ) {
72 | foreach( $styles as $uniqid => $setting ) {
73 | $temp_data = array(
74 | 'ID' => $uniqid,
75 | 'module' => $setting['module']
76 | );
77 | if ( isset( $setting['settings'] ) && count( $setting['settings'] ) > 0 ) {
78 | $temp_data['settings'] = array();
79 | foreach( $setting['settings'] as $selector_key => $properties ) {
80 | $temp_setting = array( 'SettingKey' => $selector_key );
81 | $temp_props = array();
82 | foreach( $properties as $property => $value ) {
83 | $temp_props[ $property ] = $value;
84 | }
85 | $temp_data['settings'][] = array_merge( $temp_setting, $temp_props );
86 | }
87 | }
88 | $make_data[] = $temp_data;
89 | }
90 | }
91 |
92 | return $make_data;
93 | }
94 |
95 | /**
96 | * Force single column layouts.
97 | *
98 | * @since 1.0.0
99 | * @access public
100 | * @return int
101 | */
102 | public function force_single_column_layout_post() {
103 | return 1;
104 | }
105 | }
106 |
107 | new TF_Backend();
--------------------------------------------------------------------------------
/themifyflow/tf/classes/class-tf-content-builder.php:
--------------------------------------------------------------------------------
1 | true ) );
63 | if ( isset( $content_post_types['attachment'] ) )
64 | unset( $content_post_types['attachment'] );
65 | $post_types = array_merge( $post_types, array_keys( $content_post_types ) );
66 | return $post_types;
67 | }
68 |
69 | /**
70 | * Return true when current page is admin content edit.
71 | *
72 | * @since 1.0.0
73 | * @access public
74 | * @param boolean $return
75 | * @param string $hook_suffix
76 | */
77 | public function register_app_scripts( $return, $hook_suffix ) {
78 | $screen = get_current_screen();
79 | $post_types = get_post_types( array( 'public' => true ) );
80 | if ( in_array( $screen->id, array_keys( $post_types ) ) )
81 | return true;
82 |
83 | return $return;
84 | }
85 |
86 | /**
87 | * Output builder data to content.
88 | *
89 | * @since 1.0.0
90 | * @access public
91 | * @param string $content
92 | */
93 | public function output_builder_content( $content ) {
94 | global $post;
95 | $builder = get_post_meta( $post->ID, 'tf_builder_content', true );
96 | if ( $builder ) {
97 | $content .= do_shortcode( $builder );
98 | }
99 | return $content;
100 | }
101 |
102 | /**
103 | * Custom page for content builder edit frontend.
104 | *
105 | * @since 1.0.0
106 | * @access public
107 | * @param string $original_template
108 | */
109 | public function render_template_content_builder( $original_template ) {
110 | if ( ! TF_Model::is_tf_styling_active() && TF_Model::is_tf_editor_active() && is_singular() && ! is_singular( array( 'tf_template', 'tf_template_part' ) ) ) {
111 | global $TF;
112 | return $TF->framework_path() . '/includes/templates/template-content-builder.php' ;
113 | } else {
114 | return $original_template;
115 | }
116 | }
117 |
118 | /**
119 | * Register frontend menu.
120 | *
121 | * @since 1.0.0
122 | * @access public
123 | * @param array $menus
124 | */
125 | public function register_menu( $menus ) {
126 | $content_menus = array();
127 |
128 | if ( is_singular() && ! is_singular( array( 'tf_template', 'tf_template_part' ) ) && TF_Model::is_tf_editor_active() && ! TF_Model::is_tf_styling_active() ) {
129 | $content_menus['content_builder_view'] = array(
130 | 'label' => __('View the post/page', 'themify-flow'),
131 | 'href' => get_permalink()
132 | );
133 | $content_menus['content_builder_import'] = array(
134 | 'label' => __('Import Content', 'themify-flow'),
135 | 'href' => '#',
136 | 'meta' => array( 'class' => 'tf_content_builder_import' )
137 | );
138 | $content_menus['content_builder_export'] = array(
139 | 'label' => __('Export Content', 'themify-flow'),
140 | 'href' => wp_nonce_url( admin_url( 'post.php?post=' . get_the_ID() . '&action=export_tf_content_builder' ), 'export_tf_nonce' )
141 | );
142 | $menus = $content_menus;
143 | } else if ( is_singular() && ! is_singular( array( 'tf_template', 'tf_template_part' ) ) ) {
144 | $content_menus['content_builder_list'] = array(
145 | 'label' => __('Content Builder', 'themify-flow'),
146 | 'href' =>esc_url( add_query_arg( 'tf', 1, get_permalink() ) )
147 | );
148 | $menus = array_merge( $content_menus, $menus );
149 | }
150 | return $menus;
151 | }
152 |
153 | /**
154 | * Save builder content data.
155 | *
156 | * @since 1.0.0
157 | * @access public
158 | * @param int $post_id
159 | * @param array $post_data
160 | */
161 | public function save_builder_content( $post_id, $post_data ) {
162 | $post_type = get_post_type( $post_id );
163 | $reserved_post_types = array( 'tf_template', 'tf_template_part' );
164 |
165 | // Save to post_meta
166 | if ( ! in_array( $post_type, $reserved_post_types ) ) {
167 | $post_content = TF_Model::array_to_shortcode( $post_data['content'] );
168 | update_post_meta( $post_id, 'tf_builder_content', $post_content );
169 | }
170 | }
171 | }
172 | add_action( 'tf_loaded', array( 'TF_Content_Builder', 'get_instance' ) );
--------------------------------------------------------------------------------
/themifyflow/tf/classes/class-tf-menu-icons.php:
--------------------------------------------------------------------------------
1 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | ' . $title;
114 | }
115 | }
116 |
117 | return $title;
118 | }
119 | }
120 | TF_Menu_Icons::get_instance();
121 |
122 |
123 | /**
124 | * Returns the icon name chosen for a given menu item
125 | *
126 | * @return string|null
127 | * @since 1.0.5
128 | */
129 | function themifyflow_get_menu_icon( $item_id ) {
130 | return get_post_meta( $item_id, '_menu_item_icon', true );
131 | }
132 |
--------------------------------------------------------------------------------
/themifyflow/tf/classes/class-tf-validator.php:
--------------------------------------------------------------------------------
1 | $option ) {
32 | $input = isset( $inputs[ $field ] ) ? $inputs[ $field ] : '';
33 |
34 | if ( method_exists( $this, $option['rule'] ) && call_user_func_array( array( $this, $option['rule'] ), array( $input ) ) ) {
35 | $this->errors[ $field ] = $option['error_msg'];
36 | }
37 | }
38 | }
39 |
40 | /**
41 | * Check if validator failed.
42 | *
43 | * @since 1.0.0
44 | * @access public
45 | * @return boolean
46 | */
47 | public function fails() {
48 | if ( count( $this->errors ) > 0 )
49 | return true;
50 | return false;
51 | }
52 |
53 | /**
54 | * Get error messages.
55 | *
56 | * @since 1.0.0
57 | * @access public
58 | * @return array
59 | */
60 | public function get_error_messages() {
61 | return $this->errors;
62 | }
63 |
64 | /**
65 | * Check input empty.
66 | *
67 | * @since 1.0.0
68 | * @access private
69 | * @param string $input
70 | * @return boolean
71 | */
72 | private function notEmpty( $input ) {
73 | return ! empty( $input ) ? false : true;
74 | }
75 |
76 | /**
77 | * TODO LATER:
78 | * - Add more validation function below
79 | */
80 | }
--------------------------------------------------------------------------------
/themifyflow/tf/classes/engine/class-tf-engine-theme-loader.php:
--------------------------------------------------------------------------------
1 | 'tf_theme',
60 | 'post_status' => 'publish',
61 | 'numberposts' => 1,
62 | 'meta_query' => array(
63 | array(
64 | 'key' => 'tf_active_theme',
65 | 'value' => 'true'
66 | )
67 | )
68 | );
69 | $query = new WP_Query( $args );
70 | $theme = $query->get_posts();
71 | set_transient( 'tf_cached_active_theme', $theme, 0 );
72 | }
73 |
74 | if ( $theme ) {
75 | $this->theme_founded = true;
76 | $this->theme_id = $theme[0]->ID;
77 | $this->name = $theme[0]->post_title;
78 | $this->slug = $theme[0]->post_name;
79 | } else {
80 | $this->theme_founded = false;
81 | $this->name = __('Base', 'themify-flow');
82 | $this->slug = 'base';
83 | }
84 |
85 | // Add slug prefix based on active theme for Template and Template Part post types
86 | add_filter( 'wp_unique_post_slug', array( $this, 'add_prefix_post_slug' ), 10, 6 );
87 | add_action( 'tf_import_before_insert_post', array( $this, 'remove_prefix_post_slug'), 10, 2 );
88 |
89 | }
90 |
91 | /**
92 | * Get theme info.
93 | *
94 | * @since 1.0.0
95 | * @access public
96 | * @return array
97 | */
98 | public function get_theme_info() {
99 | if ( $this->theme_founded ) {
100 | $theme_info = get_post_meta( $this->theme_id, 'theme_info', true );
101 | if ( ! empty( $theme_info ) ) {
102 | return $theme_info;
103 | }
104 | }
105 | return $this->default_theme_info();
106 | }
107 |
108 | /**
109 | * Default theme info.
110 | *
111 | * @since 1.0.0
112 | * @access protected
113 | * @return array
114 | */
115 | protected function default_theme_info() {
116 | return apply_filters( 'tf_default_theme_info', array(
117 | 'tf_theme_description' => __('Base theme is the default Themify Flow theme', 'themify-flow'),
118 | 'tf_theme_author' => 'Themify',
119 | 'tf_theme_author_link' => 'http://themifyflow.com',
120 | 'tf_theme_version' => '1.0.0'
121 | ) );
122 | }
123 |
124 | /**
125 | * Rewrite slug to add theme prefix {theme-name}-slug.
126 | *
127 | * @since 1.0.0
128 | * @access public
129 | * @param string $slug
130 | * @param int $post_ID
131 | * @param string $post_status
132 | * @param string $post_type
133 | * @param string $post_parent
134 | * @param string $original_slug
135 | * @return string
136 | */
137 | public function add_prefix_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
138 | if ( 'tf_template' == $post_type || 'tf_template_part' == $post_type ) {
139 | if ( ! preg_match( '/^' . $this->slug . '/', $slug ) ) {
140 | $slug = $this->slug . '-' . $slug;
141 | }
142 | }
143 | // Change dash to underscore for theme post type slug
144 | if ( 'tf_theme' == $post_type )
145 | $slug = str_replace( '-', '_', $slug );
146 |
147 | return $slug;
148 | }
149 |
150 | public function remove_prefix_post_slug( $postdata, $source ) {
151 | if ( 'theme' == $source ) {
152 | remove_filter( 'wp_unique_post_slug', array( $this, 'add_prefix_post_slug' ), 10, 6 );
153 | }
154 | }
155 | }
--------------------------------------------------------------------------------
/themifyflow/tf/classes/modules/class-tf-module-element-loader.php:
--------------------------------------------------------------------------------
1 | elements[ $module->slug ] = &$module;
44 | }
45 |
46 | /**
47 | * Get all modules.
48 | *
49 | * @since 1.0.0
50 | * @access public
51 | * @return array
52 | */
53 | public function get_elements() {
54 | return $this->elements;
55 | }
56 |
57 | /**
58 | * Get a module object.
59 | *
60 | * @since 1.0.0
61 | * @access public
62 | * @param string $slug
63 | * @return object
64 | */
65 | public function get_element( $slug ) {
66 | if ( isset( $this->elements[ $slug ] ) ) {
67 | return $this->elements[ $slug ];
68 | } else {
69 | return false;
70 | }
71 | }
72 |
73 | /**
74 | * Get all modules shortcode name.
75 | *
76 | * @since 1.0.0
77 | * @access public
78 | * @return array
79 | */
80 | public function get_element_shortcodes() {
81 | $shortcodes = array();
82 | foreach( $this->elements as $element ) {
83 | $shortcodes[] = $element->shortcode;
84 | }
85 | return $shortcodes;
86 | }
87 |
88 | public function get_elements_by_category( $category ) {
89 | $categories = $this->group_by_category();
90 | if ( isset( $categories[ $category ] ) ) {
91 | return $categories[ $category ];
92 | } else {
93 | return array();
94 | }
95 | }
96 |
97 | public function group_by_category() {
98 | $categories = array();
99 | foreach( $this->get_elements() as $element ) {
100 | $categories[ $element->category ][] = $element;
101 | }
102 | return $categories;
103 | }
104 |
105 | public function load_tmpl() {
106 | if ( TF_Model::is_tf_editor_active() || is_admin() ) {
107 | foreach( $this->elements as $element ) { ?>
108 |
128 | '',
78 | 'slug' => '',
79 | 'description' => '',
80 | 'shortcode' => '',
81 | 'category' => 'loop',
82 | 'close_type' => TF_Shortcodes::SELF_CLOSED
83 | ) );
84 |
85 | $this->name = $params['name'];
86 | $this->slug = $params['slug'];
87 | $this->shortcode = $params['shortcode'];
88 | $this->close_type = $params['close_type'];
89 | $this->description = $params['description'];
90 | $this->category = $params['category'];
91 |
92 | add_action( 'tf_register_module_elements', array( &$this, 'register' ) );
93 |
94 | if ( false !== $content_field = TF_Model::get_shortcode_content_field( $this->fields() ) ) {
95 | $this->content_field = $content_field;
96 | }
97 | }
98 |
99 | /**
100 | * Register Module.
101 | *
102 | * @since 1.0.0
103 | * @access public
104 | */
105 | public function register() {
106 | global $tf_module_elements;
107 |
108 | $tf_module_elements->register_element( $this );
109 | }
110 |
111 | /**
112 | * Module fields parameters.
113 | *
114 | * @since 1.0.0
115 | * @access public
116 | * @return array
117 | */
118 | public function fields() {
119 | return array();
120 | }
121 |
122 | /**
123 | * Return attributes to shortcode string.
124 | *
125 | * @since 1.0.0
126 | * @access public
127 | * @param array $atts
128 | * @param string $content
129 | * @return string
130 | */
131 | public function to_shortcode( $atts, $content = null ) {
132 | $shortcode = sprintf( '[%s', $this->shortcode );
133 | $shortcode .= count( $atts ) > 0 ? $this->parse_attr( $atts ) : '';
134 | $shortcode .= ']';
135 | $shortcode .= $this->close_type == TF_Shortcodes::ENCLOSED ? $content . sprintf( '[/%s]', $this->shortcode ) : '';
136 | return $shortcode;
137 | }
138 |
139 | /**
140 | * Get close type shortcode.
141 | *
142 | * @since 1.0.0
143 | * @access public
144 | * @return string
145 | */
146 | public function get_close_type() {
147 | return $this->close_type;
148 | }
149 |
150 | /**
151 | * Return attributes array to shortcode params string.
152 | *
153 | * @since 1.0.0
154 | * @access protected
155 | * @param array $attributes
156 | * @return string
157 | */
158 | protected function parse_attr( $attributes ) {
159 | if ( is_string( $attributes ) ) {
160 | return ( ! empty( $attributes ) ) ? ' ' . trim( $attributes ) : '';
161 | }
162 |
163 | if ( is_array( $attributes ) ) {
164 | $attr = '';
165 |
166 | foreach ( $attributes as $key => $val ) {
167 | $attr .= ' ' . $key . '="' . $val . '"';
168 | }
169 |
170 | return $attr;
171 | }
172 | }
173 |
174 | public function get_content_field() {
175 | return $this->content_field;
176 | }
177 | }
--------------------------------------------------------------------------------
/themifyflow/tf/classes/modules/class-tf-module-loader.php:
--------------------------------------------------------------------------------
1 | load_modules();
29 |
30 | /** Adding custom css class to all modules */
31 | add_filter( 'tf_module_fields', array( $this, 'display_inline_field' ), 10, 2 );
32 | add_filter( 'tf_module_fields', array( $this, 'custom_css_field' ), 10, 2 );
33 | add_filter( 'tf_module_classes', array( $this, 'output_css_class' ), 10, 2 );
34 | add_filter( 'tf_module_classes', array( $this, 'display_inline_field_class' ), 10, 2 );
35 | }
36 |
37 | /**
38 | * Register module.
39 | *
40 | * @since 1.0.0
41 | * @access public
42 | * @param object &$module
43 | */
44 | public function register_module( &$module ) {
45 | $this->modules[ $module->slug ] = &$module;
46 | }
47 |
48 | /**
49 | * Get all modules.
50 | *
51 | * @since 1.0.0
52 | * @access public
53 | * @return array
54 | */
55 | public function get_modules() {
56 | return $this->modules;
57 | }
58 |
59 | /**
60 | * Get a module object.
61 | *
62 | * @since 1.0.0
63 | * @access public
64 | * @param string $slug
65 | * @return object
66 | */
67 | public function get_module( $slug ) {
68 | if ( isset( $this->modules[ $slug ] ) ) {
69 | return $this->modules[ $slug ];
70 | } else {
71 | return false;
72 | }
73 | }
74 |
75 | /**
76 | * Get all modules shortcode name.
77 | *
78 | * @since 1.0.0
79 | * @access public
80 | * @return array
81 | */
82 | public function get_module_shortcodes() {
83 | $shortcodes = array();
84 | foreach( $this->modules as $module ) {
85 | $shortcodes[] = $module->shortcode;
86 | }
87 | return $shortcodes;
88 | }
89 |
90 | /**
91 | * Load modules.
92 | *
93 | * @since 1.0.0
94 | * @access protected
95 | */
96 | protected function load_modules() {
97 |
98 | $dir = get_template_directory() . '/tf/includes/modules';
99 |
100 | // Any core modules please list here
101 | $lists = array( 'site-logo', 'site-tagline', 'menu', 'searchform', 'author-box', 'category-title', 'category-description', 'category-image', 'archive-loop','list-posts', 'page-title', 'page-content','page-featured-image', 'next-prev-post', 'comments', 'icon', 'text', 'widget-area', 'widget', 'video', 'divider', 'image', 'template_part');
102 |
103 | foreach( $lists as $list ) {
104 | require_once( sprintf( '%s/%s/module.php', $dir, $list ) );
105 | }
106 |
107 | do_action( 'tf_modules_loaded' );
108 | }
109 |
110 | /**
111 | * Custom CSS Fields.
112 | *
113 | * @since 1.0.0
114 | * @access public
115 | * @param array $fields
116 | * @param object $instance
117 | * @return array
118 | */
119 | public function custom_css_field( $fields, $instance ) {
120 | $fields['tf_module_custom_css_separator'] = array(
121 | 'type' => 'separator'
122 | );
123 | $fields['tf_module_custom_css_class'] = array(
124 | 'type' => 'text',
125 | 'class' => 'tf_input_width_80',
126 | 'label' => __('Custom CSS Class', 'themify-flow')
127 | );
128 | return $fields;
129 | }
130 |
131 | /**
132 | * Display inline block field
133 | *
134 | * @since 1.0.0
135 | * @access public
136 | * @param array $fields
137 | * @param object $instance
138 | * @return array
139 | */
140 | public function display_inline_field( $fields, $instance ) {
141 | $fields['tf_module_display_inline_block_separator'] = array(
142 | 'type' => 'separator'
143 | );
144 | $fields['tf_module_display_inline_block'] = array(
145 | 'type' => 'checkbox',
146 | 'label' => __( 'Display Inline', 'themify-flow' ),
147 | 'text' => __( 'Display this module inline (float left)', 'themify-flow' ),
148 | );
149 | return $fields;
150 | }
151 |
152 |
153 | /**
154 | * Output the custom css in the module wrapper.
155 | *
156 | * @since 1.0.0
157 | * @access public
158 | * @param array $classes
159 | * @param array $atts
160 | * @return array
161 | */
162 | public function output_css_class( $classes, $atts ) {
163 | if ( isset( $atts['tf_module_custom_css_class'] ) && ! empty( $atts['tf_module_custom_css_class'] ) ) {
164 | $custom = explode( ' ', $atts['tf_module_custom_css_class'] );
165 | foreach( $custom as $class ) {
166 | $classes[] = sanitize_html_class( $class );
167 | }
168 | }
169 | return $classes;
170 | }
171 |
172 | /**
173 | * Output the display inline block css class in the module wrapper.
174 | *
175 | * @since 1.0.0
176 | * @access public
177 | * @param array $classes
178 | * @param array $atts
179 | * @return array
180 | */
181 | public function display_inline_field_class( $classes, $atts ) {
182 | if ( isset( $atts['tf_module_display_inline_block'] ) && $atts['tf_module_display_inline_block'] ) {
183 | $classes[] = 'tf_module_inline_block';
184 | }
185 | return $classes;
186 | }
187 | }
188 |
189 | /** Initialize class */
190 | $GLOBALS['tf_modules'] = new TF_Module_Loader();
191 |
192 | /**
193 | * Register module hook.
194 | *
195 | * Hook the module object when initialize so it can be accessible by module loader.
196 | *
197 | * @since 1.0.0
198 | */
199 | do_action( 'tf_register_modules' );
--------------------------------------------------------------------------------
/themifyflow/tf/classes/theme-elements/class-tf-interface.php:
--------------------------------------------------------------------------------
1 |
20 |
21 | get_elements_by_category( $category ) ) > 0 ): ?>
22 | get_elements_by_category( $category ) as $element ): ?>
23 |
24 |
name ); ?>
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
43 |
44 | force_editable_shortcode();
51 | echo do_shortcode( $content ); ?>
52 |
53 |
54 | array(
8 | 'font_family' => array(
9 | 'type' => ''
10 | )
11 | )
12 | ) );
13 | }
14 |
15 | public static function control_selector_render( $module ) {
16 | ob_start();
17 | self::build_selectors( $module );
18 | $html = ob_get_contents();
19 | ob_end_clean();
20 | return $html;
21 | }
22 |
23 | public static function build_selectors( $module ) {
24 | global $tf_styles;
25 | $tf_styling_selectors = $tf_styles->get_style( $module ); // param: module slug
26 | if ( count( $tf_styling_selectors ) > 0 ): ?>
27 |
28 | $param ):
29 | $li_state_class = count( $param['children'] ) > 0 ? ' tf_list_has_child': '';
30 | $basic_styling = isset( $param['basic_styling'] ) ? ' data-tf-basic-styling="' . implode( ',', $param['basic_styling'] ) . '"' : '';
31 | $parent_attr = isset( $param['selector'] ) && ! empty( $param['selector'])
32 | ? ' data-tf-style-selector="'. esc_attr( $param['selector'] ).'" data-tf-style-selector-key="'.$key.'"'
33 | : '';
34 | $chain = isset( $param['chain_with_context'] ) && $param['chain_with_context'] ? ' data-tf-chain-with-context="chain"' : '';
35 | ?>
36 |
37 | >
38 |
39 | 0 ): ?>
40 |
41 | $child_param ): ?>
42 |
43 |
50 | >
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | strings['up_to_date'] = __('The theme is at the latest version.', 'themify-flow');
11 | $this->strings['no_package'] = __('Update package not available.', 'themify-flow');
12 | $this->strings['downloading_package'] = __('Downloading update from %s …', 'themify-flow');
13 | $this->strings['unpack_package'] = __('Unpacking the update…', 'themify-flow');
14 | $this->strings['remove_old'] = __('Removing the old version of the theme…', 'themify-flow');
15 | $this->strings['remove_old_failed'] = __('Could not remove the old theme.', 'themify-flow');
16 | $this->strings['process_failed'] = __('Theme update failed.', 'themify-flow');
17 | $this->strings['process_success'] = __('Theme updated successfully.', 'themify-flow');
18 | }
19 |
20 | function show_message() { }
21 |
22 | function upgrade( $theme, $url, $cookies ) {
23 | $this->cookies = $cookies;
24 |
25 | $this->init();
26 | $this->upgrade_strings();
27 |
28 | add_filter( 'upgrader_pre_install', array( $this, 'tf_upgrader_pre_install' ), 10, 2 );
29 | add_filter( 'upgrader_clear_destination', array( $this, 'tf_upgrader_clear_destination' ), 10, 4 );
30 |
31 | $this->run( array(
32 | 'package' => $url,
33 | 'destination' => WP_CONTENT_DIR . "/themes/$theme/",
34 | 'clear_destination' => true,
35 | 'clear_working' => true,
36 | 'hook_extra' => array( 'theme' => $theme )
37 | ) );
38 |
39 | // Cleanup our hooks, in case something else does a upgrade on this connection.
40 | remove_filter( 'upgrader_pre_install', array( $this, 'tf_upgrader_pre_install' ) );
41 | remove_filter( 'upgrader_clear_destination', array( $this, 'tf_upgrader_clear_destination' ) );
42 |
43 | if ( ! $this->result || is_wp_error($this->result) )
44 | return $this->result;
45 | }
46 |
47 | function download_package($package) {
48 |
49 | if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote?
50 | return $package; //must be a local file..
51 |
52 | if ( empty($package) )
53 | return new WP_Error('no_package', $this->strings['no_package']);
54 |
55 | $this->skin->feedback('downloading_package', $package);
56 |
57 | $download_file = $this->download_url($package);
58 |
59 | if ( is_wp_error($download_file) )
60 | return new WP_Error('download_failed', $this->strings['download_failed'], $download_file->get_error_message());
61 |
62 | return $download_file;
63 | }
64 |
65 | function download_url( $url, $timeout = 300 ) {
66 | //WARNING: The file is not automatically deleted, The script must unlink() the file.
67 | if ( ! $url )
68 | return new WP_Error( 'http_no_url', __( 'Invalid URL Provided.', 'themify-flow' ) );
69 |
70 | $tmpfname = wp_tempnam($url);
71 | if ( ! $tmpfname )
72 | return new WP_Error( 'http_no_file', __( 'Could not create Temporary file.', 'themify-flow' ) );
73 |
74 | $response = wp_safe_remote_get( $url, array( 'cookies' => $this->cookies, 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname ) );
75 |
76 | if ( is_wp_error( $response ) ) {
77 | unlink( $tmpfname );
78 | return $response;
79 | }
80 |
81 | if ( 200 != wp_remote_retrieve_response_code( $response ) ){
82 | unlink( $tmpfname );
83 | return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) );
84 | }
85 |
86 | return $tmpfname;
87 | }
88 |
89 | //Hooked to pre_install
90 | function tf_upgrader_pre_install( $return, $theme ) {
91 |
92 | if ( is_wp_error( $return ) ) { //Bypass.
93 | return $return;
94 | }
95 |
96 | $theme = isset( $theme['theme']) ? $theme['theme'] : '';
97 | if ( empty( $theme ) ) {
98 | return new WP_Error('bad_request', $this->strings['bad_request']);
99 | }
100 |
101 | }
102 |
103 | //Hooked to upgrade_clear_destination
104 | function tf_upgrader_clear_destination($removed, $local_destination, $remote_destination, $theme) {
105 | global $wp_filesystem;
106 |
107 | if ( is_wp_error( $removed ) ) {
108 | return $removed; //Pass errors through.
109 | }
110 |
111 | $theme = isset($theme['theme']) ? $theme['theme'] : '';
112 | if ( empty( $theme ) ) {
113 | return new WP_Error( 'bad_request', $this->strings['bad_request'] );
114 | }
115 |
116 | $themes_dir = $wp_filesystem->wp_themes_dir();
117 | $this_theme_dir = trailingslashit( dirname( $themes_dir . $theme ) );
118 |
119 | if ( ! $wp_filesystem->exists($this_theme_dir) ) {//If it's already vanished.
120 | return $removed;
121 | }
122 |
123 | // If theme is in its own directory, recursively delete the directory.
124 | if ( strpos($theme, '/') && $this_theme_dir != $themes_dir ) { //base check on if theme includes directory separator AND that it's not the root theme folder
125 | $deleted = $wp_filesystem->delete($this_theme_dir, true);
126 | } else {
127 | $deleted = $wp_filesystem->delete($themes_dir . $theme);
128 | }
129 |
130 | if ( ! $deleted ) {
131 | return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
132 | }
133 |
134 | return true;
135 | }
136 |
137 | }
138 | ?>
--------------------------------------------------------------------------------
/themifyflow/tf/includes/data/theme-base.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/themify/themifyflow/07f5ec59ca8f72894e3297861c05affa68ffd5e3/themifyflow/tf/includes/data/theme-base.zip
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/archive-loop/elements/featured-image.php:
--------------------------------------------------------------------------------
1 | __('Featured Image', 'themify-flow'),
16 | 'slug' => 'featured-image',
17 | 'shortcode' => 'tf_featured_image',
18 | 'description' => 'Featured Image',
19 | 'category' => 'loop'
20 | ));
21 |
22 | // Register shortcode
23 | add_shortcode( $this->shortcode, array( $this, 'render_shortcode' ) );
24 | }
25 |
26 | /**
27 | * Module settings field
28 | *
29 | * @since 1.0.0
30 | * @access public
31 | * @return array
32 | */
33 | public function fields() {
34 | return apply_filters( 'tf_element_featured_image_fields', array(
35 | 'image_size' => array(
36 | 'type' => 'select',
37 | 'label' => __('Image Size', 'themify-flow'),
38 | 'options' => tf_get_image_sizes_list()
39 | ),
40 | 'image_dimension' => array(
41 | 'type' => 'multi',
42 | 'label' => __('Dimensions', 'themify-flow'),
43 | 'fields' => array(
44 | 'image_width' => array(
45 | 'type' => 'text',
46 | 'class' => 'tf_input_width_20',
47 | 'wrapper' => 'no',
48 | 'description' => 'x'
49 | ),
50 | 'image_height' => array(
51 | 'type' => 'text',
52 | 'class' => 'tf_input_width_20',
53 | 'wrapper' => 'no',
54 | 'description' => 'px'
55 | )
56 | )
57 | ),
58 | 'image_link_to_post' => array(
59 | 'type' => 'radio',
60 | 'label' => __( 'Link to post', 'themify-flow'),
61 | 'options' => array(
62 | array( 'name' => 'Yes', 'value' => 'yes', 'selected' => true ),
63 | array( 'name' => 'No', 'value' => 'no' )
64 | )
65 | ),
66 | 'display_inline_block'=> array(
67 | 'type' => 'checkbox',
68 | 'label' => __( 'Display Inline', 'themify-flow' ),
69 | 'text' => __( 'Display this module inline (float left)', 'themify-flow' ),
70 | )
71 | ) );
72 | }
73 |
74 | /**
75 | * Render main shortcode.
76 | *
77 | * Should be returned with apply_filters('tf_shortcode_module_render') so it can be editable in Builder.
78 | *
79 | * @since 1.0.0
80 | * @access public
81 | * @param array $atts
82 | * @param string $content
83 | * @return string
84 | */
85 | public function render_shortcode( $atts, $content = null ) {
86 | $atts = shortcode_atts( array(
87 | 'image_size' => 'blank',
88 | 'image_width' => '',
89 | 'image_height' => '',
90 | 'image_link_to_post' => 'yes',
91 | 'display_inline_block'=>false
92 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
93 | $output = '';
94 | $image_size = 'blank' != $atts['image_size'] ? $atts['image_size'] : 'large';
95 |
96 | if ( has_post_thumbnail( get_the_ID() ) ) {
97 | $post_thumbnail = get_post_thumbnail_id( get_the_ID() );
98 | $post_thumbnail_object = get_post( $post_thumbnail );
99 | $thumbnail_title = is_object( $post_thumbnail_object ) ? $post_thumbnail_object->post_title : '';
100 | $image_attribute = wp_get_attachment_image_src( $post_thumbnail, $image_size );
101 | $post_image = sprintf( ' ',
102 | esc_url( $image_attribute[0] ),
103 | esc_attr( $thumbnail_title ),
104 | esc_attr( $atts['image_width'] ),
105 | esc_attr( $atts['image_height'] )
106 | );
107 |
108 | $class = isset($atts['display_inline_block']) && $atts['display_inline_block']?' tf_element_inline_block':'';
109 | $output = '';
110 | if ( 'no' == $atts['image_link_to_post'] ) {
111 | $output.=$post_image;
112 | }
113 | else{
114 | $output.= sprintf( '%s ',
115 | get_permalink(),
116 | $post_image
117 | );
118 | }
119 | $output.=' ';
120 | }
121 |
122 | return apply_filters( 'tf_shortcode_element_render', $output, $this->slug, $atts, $content );
123 | }
124 | }
125 |
126 | new TF_Element_Featured_Image();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/archive-loop/elements/post-excerpt-content.php:
--------------------------------------------------------------------------------
1 | __('Excerpt/Content', 'themify-flow'),
16 | 'slug' => 'post-excerpt-content',
17 | 'shortcode' => 'tf_post_excerpt_content',
18 | 'description' => 'Display excerpt / content',
19 | 'category' => 'loop'
20 | ));
21 |
22 | // Register shortcode
23 | add_shortcode( $this->shortcode, array( $this, 'render_shortcode' ) );
24 | }
25 |
26 | /**
27 | * Module settings field
28 | *
29 | * @since 1.0.0
30 | * @access public
31 | * @return array
32 | */
33 | public function fields() {
34 | return apply_filters( 'tf_element_post_excerpt_fields', array(
35 | 'post_display' => array(
36 | 'type' => 'radio',
37 | 'label' => __( 'Excerpt/Content', 'themify-flow'),
38 | 'options' => array(
39 | array( 'name' => __('Content', 'themify-flow'), 'value' => 'content', 'selected' => true ),
40 | array( 'name' => __('Excerpt', 'themify-flow'), 'value' => 'excerpt' )
41 | )
42 | ),
43 | 'display_inline_block'=> array(
44 | 'type' => 'checkbox',
45 | 'label' => __( 'Display Inline', 'themify-flow' ),
46 | 'text' => __( 'Display this module inline (float left)', 'themify-flow' )
47 |
48 | )
49 | ) );
50 | }
51 |
52 | /**
53 | * Render main shortcode.
54 | *
55 | * Should be returned with apply_filters('tf_shortcode_module_render') so it can be editable in Builder.
56 | *
57 | * @since 1.0.0
58 | * @access public
59 | * @param array $atts
60 | * @param string $content
61 | * @return string
62 | */
63 | public function render_shortcode( $atts, $content = null ) {
64 | $atts = shortcode_atts( array(
65 | 'post_display' => 'content',
66 | 'display_inline_block'=>false
67 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
68 | $class = isset($atts['display_inline_block']) && $atts['display_inline_block']?' tf_element_inline_block':'';
69 | $output = '';
70 | ob_start();
71 | global $post;
72 | if ( 'content' == $atts['post_display'] ) {
73 | if ( is_object( $post ) ) {
74 | the_content( __('More →', 'themify-flow') );
75 | edit_post_link(__('Edit', 'themify-flow'), '[', '] ');
76 | }
77 | } else {
78 | if ( is_object( $post ) ) {
79 | the_excerpt();
80 | }
81 | }
82 | $output .= ob_get_contents();
83 | ob_end_clean();
84 | $output .= '
';
85 |
86 | return apply_filters( 'tf_shortcode_element_render', $output, $this->slug, $atts, $content );
87 | }
88 | }
89 |
90 | new TF_Element_Post_Excerpt_Content();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/archive-loop/elements/post-meta.php:
--------------------------------------------------------------------------------
1 | __('Post Meta', 'themify-flow'),
16 | 'slug' => 'post-meta',
17 | 'shortcode' => 'tf_post_meta',
18 | 'close_type' => TF_Shortcodes::ENCLOSED,
19 | 'description' => 'Display post meta',
20 | 'category' => 'loop'
21 | ));
22 |
23 | // Register shortcode
24 | add_shortcode( $this->shortcode, array( $this, 'render_shortcode' ) );
25 |
26 | // Additional shortcodes
27 | $shortcodes = array( 'post_date', 'post_author', 'post_category', 'post_tag', 'post_comment_count' );
28 | foreach( $shortcodes as $shortcode ) {
29 | add_shortcode( 'tf_' . $shortcode, array( $this, $shortcode ) );
30 | }
31 | }
32 |
33 | /**
34 | * Module settings field
35 | *
36 | * @since 1.0.0
37 | * @access public
38 | * @return array
39 | */
40 | public function fields() {
41 | return apply_filters( 'tf_element_post_meta_fields', array(
42 | 'info' => array(
43 | 'type' => 'html',
44 | 'html' => __( 'Use the following shortcodes to form post meta (HTML tags support):
45 | [tf_post_date] = Post Date
46 | [tf_post_author] = Post Author
47 | [tf_post_tag] = Post Tags
48 | [tf_post_category] = Post Categories
49 | [tf_post_comment_count] = Post Comment Count ', 'themify-flow'),
50 | ),
51 | 'post_meta_content' => array(
52 | 'set_as_content' => 'true',
53 | 'type' => 'text',
54 | 'default' => sprintf( __('Posted on %s by %s in %s %s'),
55 | '[tf_post_date]',
56 | '[tf_post_author]',
57 | '[tf_post_category]',
58 | '[tf_post_comment_count]'
59 | ),
60 | 'class' => 'tf_input_width_100',
61 | 'wrapper' => 'no'
62 | ),
63 | 'display_inline_block'=> array(
64 | 'type' => 'checkbox',
65 | 'label' => __( 'Display Inline', 'themify-flow' ),
66 | 'text' => __( 'Display this module inline (float left)', 'themify-flow' ),
67 | )
68 | ) );
69 | }
70 |
71 | /**
72 | * Render main shortcode.
73 | *
74 | * Should be returned with apply_filters('tf_shortcode_module_render') so it can be editable in Builder.
75 | *
76 | * @since 1.0.0
77 | * @access public
78 | * @param array $atts
79 | * @param string $content
80 | * @return string
81 | */
82 | public function render_shortcode( $atts, $content = null ) {
83 | $atts = shortcode_atts( array(
84 | 'display_inline_block'=>false
85 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
86 | $class = isset($atts['display_inline_block']) && $atts['display_inline_block']?' tf_element_inline_block':'';
87 | $output = '';
88 | $output .= do_shortcode( $content );
89 | $output .= '
';
90 |
91 | return apply_filters( 'tf_shortcode_element_render', $output, $this->slug, $atts, $content );
92 | }
93 |
94 | public function post_date( $atts ) {
95 | return sprintf( '%s ',
96 | get_the_time( 'o-m-d' ),
97 | get_the_date( apply_filters('tf_post_meta_loop_date', '') )
98 | );
99 | }
100 |
101 | public function post_author( $atts ) {
102 | return sprintf( '%s ', tf_get_author_link() );
103 | }
104 |
105 | public function post_category( $atts ) {
106 | ob_start();
107 | the_category(', ');
108 | $category = ob_get_contents();
109 | ob_end_clean();
110 |
111 | return sprintf( '%s ', $category );
112 | }
113 |
114 | public function post_tag( $atts ) {
115 | ob_start();
116 | the_tags(' ', ', ', ' ');
117 | $output = ob_get_contents();
118 | ob_end_clean();
119 | return $output;
120 | }
121 |
122 | public function post_comment_count( $atts ) {
123 | $output = '';
124 |
125 | if ( get_the_ID() && comments_open() ) {
126 | ob_start();
127 | comments_popup_link( __( '0 Comments', 'themify-flow' ), __( '1 Comment', 'themify-flow' ), __( '% Comments', 'themify-flow' ) );
128 | $comment = ob_get_contents();
129 | ob_end_clean();
130 | $output = sprintf( '', $comment );
131 | }
132 | return $output;
133 | }
134 | }
135 |
136 | new TF_Element_Post_Meta();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/archive-loop/elements/post-text.php:
--------------------------------------------------------------------------------
1 | __('Text', 'themify-flow'),
16 | 'slug' => 'post-text',
17 | 'shortcode' => 'tf_post_text',
18 | 'close_type' => TF_Shortcodes::ENCLOSED,
19 | 'description' => 'Post Text',
20 | 'category' => 'loop'
21 | ));
22 |
23 | // Register shortcode
24 | add_shortcode( $this->shortcode, array( $this, 'render_shortcode' ) );
25 | }
26 |
27 | /**
28 | * Module settings field
29 | *
30 | * @since 1.0.0
31 | * @access public
32 | * @return array
33 | */
34 | public function fields() {
35 | return apply_filters( 'tf_element_post_text_fields', array(
36 | 'post_text_content' => array(
37 | 'type' => 'wp_editor',
38 | 'wrapper' => 'no',
39 | 'set_as_content' => 'true'
40 | ),
41 | 'display_inline_block'=> array(
42 | 'type' => 'checkbox',
43 | 'label' => __( 'Display Inline', 'themify-flow' ),
44 | 'text' => __( 'Display this module inline (float left)', 'themify-flow' ),
45 | )
46 | ) );
47 | }
48 |
49 | /**
50 | * Render main shortcode.
51 | *
52 | * Should be returned with apply_filters('tf_shortcode_module_render') so it can be editable in Builder.
53 | *
54 | * @since 1.0.0
55 | * @access public
56 | * @param array $atts
57 | * @param string $content
58 | * @return string
59 | */
60 | public function render_shortcode( $atts, $content = null ) {
61 | $atts = shortcode_atts( array(
62 | 'display_inline_block'=>false
63 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
64 | $class = isset($atts['display_inline_block']) && $atts['display_inline_block']?' tf_element_inline_block':'';
65 | $output = sprintf( '%s
',$class, do_shortcode( $content ) );
66 | return apply_filters( 'tf_shortcode_element_render', $output, $this->slug, $atts, $content );
67 | }
68 | }
69 |
70 | new TF_Element_Post_Text();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/archive-loop/elements/post-title.php:
--------------------------------------------------------------------------------
1 | __('Post Title', 'themify-flow'),
16 | 'slug' => 'post-title',
17 | 'shortcode' => 'tf_post_title',
18 | 'description' => 'Post Title',
19 | 'category' => 'loop'
20 | ));
21 |
22 | // Register shortcode
23 | add_shortcode( $this->shortcode, array( $this, 'render_shortcode' ) );
24 | }
25 |
26 | /**
27 | * Module settings field
28 | *
29 | * @since 1.0.0
30 | * @access public
31 | * @return array
32 | */
33 | public function fields() {
34 | return apply_filters( 'tf_element_post_title_fields', array(
35 | 'post_title_tag' => array(
36 | 'type' => 'select',
37 | 'label' => __('Tag', 'themify-flow'),
38 | 'options' => array(
39 | array( 'name' => 'H1', 'value' => 'h1' ),
40 | array( 'name' => 'H2', 'value' => 'h2' ),
41 | array( 'name' => 'H3', 'value' => 'h3' ),
42 | array( 'name' => 'H4', 'value' => 'h4' ),
43 | array( 'name' => 'H5', 'value' => 'h5' ),
44 | array( 'name' => 'H6', 'value' => 'h6' ),
45 | )
46 | ),
47 | 'post_title_link_to_post' => array(
48 | 'type' => 'radio',
49 | 'label' => __( 'Link to post', 'themify-flow'),
50 | 'options' => array(
51 | array( 'name' => 'Yes', 'value' => 'yes', 'selected' => true ),
52 | array( 'name' => 'No', 'value' => 'no' )
53 | )
54 | ),
55 | 'display_inline_block'=> array(
56 | 'type' => 'checkbox',
57 | 'label' => __( 'Display Inline', 'themify-flow' ),
58 | 'text' => __( 'Display this module inline (float left)', 'themify-flow' ),
59 | )
60 | ) );
61 | }
62 |
63 | /**
64 | * Render main shortcode.
65 | *
66 | * Should be returned with apply_filters('tf_shortcode_module_render') so it can be editable in Builder.
67 | *
68 | * @since 1.0.0
69 | * @access public
70 | * @param array $atts
71 | * @param string $content
72 | * @return string
73 | */
74 | public function render_shortcode( $atts, $content = null ) {
75 | $atts = shortcode_atts( array(
76 | 'post_title_tag' => 'h1',
77 | 'post_title_link_to_post' => 'yes',
78 | 'display_inline_block'=>false
79 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
80 | $class = isset($atts['display_inline_block']) && $atts['display_inline_block']?' tf_element_inline_block':'';
81 | if ( 'no' == $atts['post_title_link_to_post'] ) {
82 | $output = sprintf( '<%1$s itemprop="headline" class="tf_post_title%3$s">%2$s%1$s>',
83 | $atts['post_title_tag'],
84 | get_the_title(),
85 | $class
86 | );
87 | } else {
88 | $output = sprintf( '<%1$s class="tf_post_title%5$s">%4$s %1$s>',
89 | $atts['post_title_tag'],
90 | get_permalink(),
91 | the_title_attribute( array( 'echo' => false ) ),
92 | get_the_title(),
93 | $class
94 | );
95 | }
96 |
97 | return apply_filters( 'tf_shortcode_element_render', $output, $this->slug, $atts, $content );
98 | }
99 | }
100 |
101 | new TF_Element_Post_Title();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/archive-loop/module.php:
--------------------------------------------------------------------------------
1 | load_modules();
11 | add_action( 'tf_module_elements_loaded', array( $this, 'load_elements' ) );
12 | }
13 |
14 | public function load_modules() {
15 | include_once( dirname( __FILE__ ) . '/class-tf-module-archive-loop.php' );
16 | include_once( dirname( __FILE__ ) . '/class-tf-module-single-loop.php' );
17 | }
18 |
19 | public function load_elements() {
20 | $dir = dirname( __FILE__ ) . '/elements';
21 |
22 | // Any core modules please list here
23 | $lists = array( 'post-title', 'post-excerpt-content', 'post-meta', 'featured-image', 'post-text' );
24 |
25 | foreach( $lists as $list ) {
26 | include_once( sprintf( '%s/%s.php', $dir, $list ) );
27 | }
28 | }
29 | }
30 |
31 | /** Initialize class */
32 | new TF_Archive_Loop();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/author-box/module.php:
--------------------------------------------------------------------------------
1 | __( 'Author Box', 'themify-flow' ),
18 | 'slug' => 'author-box',
19 | 'shortcode' => 'tf_author_box',
20 | 'description' => __( 'Author Box', 'themify-flow' ),
21 | 'category' => 'single'
22 | // 'category' => array( 'single', 'page' )
23 | ) );
24 | }
25 |
26 | /**
27 | * Module settings field.
28 | *
29 | * Display module options.
30 | *
31 | * @since 1.0.0
32 | * @access public
33 | * @return array
34 | */
35 | public function fields() {
36 | return apply_filters( 'tf_module_author_box_fields', array(
37 | 'avatar_size' => array(
38 | 'type' => 'text',
39 | 'label' => __( 'Author Avatar Size', 'themify-flow' ),
40 | 'class' => 'tf_input_width_10',
41 | 'description' => 'px'
42 | )
43 | ) );
44 | }
45 |
46 | /**
47 | * Module style selectors.
48 | *
49 | * Hold module stye selectors to be used in Styling Panel.
50 | *
51 | * @since 1.0.0
52 | * @access public
53 | * @return array
54 | */
55 | public function styles() {
56 | return apply_filters( 'tf_module_author_box_styles', array(
57 | 'tf_module_author_box_container' => array(
58 | 'label' => __( 'Author Box Container', 'themify-flow' ),
59 | 'selector' => '.tf_author_box',
60 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
61 | ),
62 | 'tf_module_author_box_avatar' => array(
63 | 'label' => __( 'Author Avatar', 'themify-flow' ),
64 | 'selector' => '.tf_author_avatar',
65 | 'basic_styling' => array( 'border', 'font', 'margin', 'background' ),
66 | ),
67 | 'tf_module_author_box_name' => array(
68 | 'label' => __( 'Author Name', 'themify-flow' ),
69 | 'selector' => '.tf_author_name',
70 | 'basic_styling' => array( 'border', 'font', 'margin' ),
71 | ),
72 | 'tf_module_author_box_bio' => array(
73 | 'label' => __( 'Author Bio', 'themify-flow' ),
74 | 'selector' => '.tf_author_bio',
75 | 'basic_styling' => array( 'border', 'font', 'margin' ),
76 | ),
77 | ) );
78 | }
79 |
80 | /**
81 | * Render main shortcode.
82 | *
83 | * @since 1.0.0
84 | * @access public
85 | * @param array $atts
86 | * @param string $content
87 | * @return string
88 | */
89 | public function render_shortcode( $atts, $content = null ) {
90 | extract( $atts = shortcode_atts( array(
91 | 'avatar_size' => 50
92 | ), array_filter( $atts ), $this->shortcode ) );
93 |
94 | // call the action hook used for get_template_part
95 | do_action( 'get_template_part_includes/author-box' );
96 |
97 | $template = locate_template( array( 'includes/author-box.php' ), false );
98 | ob_start();
99 | include( $template );
100 | $output = ob_get_clean();
101 |
102 | return $output;
103 | }
104 | }
105 |
106 | /** Initialize module */
107 | new TF_Module_Author_Box();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/category-description/module.php:
--------------------------------------------------------------------------------
1 | __( 'Category Description', 'themify-flow' ),
16 | 'slug' => 'category-description',
17 | 'shortcode' => 'tf_category_description',
18 | 'description' => __( 'Category Description', 'themify-flow' ),
19 | 'category' => 'archive'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field.
25 | *
26 | * Display module options.
27 | *
28 | * @since 1.0.0
29 | * @access public
30 | * @return array
31 | */
32 | public function fields() {
33 | return apply_filters( 'tf_module_category_description_fields', array(
34 | 'first_page_only' => array(
35 | 'label' => __( 'First Page Only', 'themify-flow' ),
36 | 'type' => 'radio',
37 | 'options' => array(
38 | array( 'name' => __( 'Yes', 'themify-flow' ), 'value' => 'yes', 'selected' => true ),
39 | array( 'name' => __( 'No', 'themify-flow' ), 'value' => 'no' ),
40 | ),
41 | 'description' => ' ' . __( 'Display category description on the first category page only', 'themify-flow' )
42 | )
43 | ) );
44 | }
45 |
46 | /**
47 | * Module style selectors.
48 | *
49 | * Hold module stye selectors to be used in Styling Panel.
50 | *
51 | * @since 1.0.0
52 | * @access public
53 | * @return array
54 | */
55 | public function styles() {
56 | return apply_filters( 'tf_module_category_description_styles', array(
57 | 'tf_module_category_description' => array(
58 | 'label' => __( 'Category Description', 'themify-flow' ),
59 | 'selector' => '.tf_category_description',
60 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
61 | )
62 | ) );
63 | }
64 |
65 | /**
66 | * Render main shortcode.
67 | *
68 | * @since 1.0.0
69 | * @access public
70 | * @param array $atts
71 | * @param string $content
72 | * @return string
73 | */
74 | public function render_shortcode( $atts, $content = null ) {
75 | extract( shortcode_atts( array(
76 | 'first_page_only' => 'yes'
77 | ), $atts, $this->shortcode ) );
78 | if ( ! TF_Model::is_template_page() ) {
79 | if( 'yes' == $first_page_only && is_paged() ) {
80 | return '';
81 | }
82 |
83 | ob_start(); ?>
84 |
85 | ', '' ); ?>
86 |
87 | %s', __('This is only preview text. The text content here will be replaced with actual category description when viewing the real page.', 'themify-flow') );
92 | }
93 | return $output;
94 | }
95 | }
96 |
97 | /** Initialize module */
98 | new TF_Module_Category_Description();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/divider/module.php:
--------------------------------------------------------------------------------
1 | __( 'Divider', 'themify-flow' ),
16 | 'slug' => 'divider',
17 | 'shortcode' => 'tf_divider',
18 | 'description' => 'Divider module',
19 | 'category' => 'content'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field
25 | *
26 | * @since 1.0.0
27 | * @access public
28 | * @return array
29 | */
30 | public function fields() {
31 | global $TF;
32 |
33 | $image_base = $TF->framework_uri() . '/assets/img/builder';
34 |
35 | return apply_filters( 'tf_module_divider_fields', array(
36 | 'layout' => array(
37 | 'type' => 'layout',
38 | 'label' => __( 'Divider Layout', 'themify-flow' ),
39 | 'options' => array(
40 | array( 'img' => $image_base . '/solid.png', 'value' => 'solid', 'label' => __( 'Solid', 'themify-flow' ), 'selected' => true ),
41 | array( 'img' => $image_base . '/dashed.png', 'value' => 'dashed', 'label' => __( 'Dashed', 'themify-flow' ) ),
42 | array( 'img' => $image_base . '/dotted.png', 'value' => 'dotted', 'label' => __( 'Dotted', 'themify-flow' ) ),
43 | array( 'img' => $image_base . '/double.png', 'value' => 'double', 'label' => __( 'Double', 'themify-flow' ) ),
44 | )
45 | ),
46 | 'thinkness' => array(
47 | 'type' => 'number',
48 | 'label' => __( 'Stroke Thickness', 'themify-flow' ),
49 | 'class' => 'tf_input_width_10',
50 | 'description' => ' px',
51 | 'default' => '1'
52 | ),
53 | 'divider_color' => array(
54 | 'type' => 'color',
55 | 'label' => __( 'Divider Color', 'themify-flow' ),
56 | )
57 | ) );
58 | }
59 |
60 | /**
61 | * Module style selectors.
62 | *
63 | * Hold module style selectors to be used in Styling Panel.
64 | *
65 | * @since 1.0.0
66 | * @access public
67 | * @return array
68 | */
69 | public function styles() {
70 | return apply_filters( 'tf_module_divider_styles', array(
71 | 'tf_divider' => array(
72 | 'label' => __( 'Divider', 'themify-flow' ),
73 | 'selector' => '.tf_divider',
74 | 'basic_styling' => array( 'margin' ),
75 | ),
76 | ) );
77 | }
78 |
79 | /**
80 | * Render main shortcode.
81 | *
82 | * @since 1.0.0
83 | * @access public
84 | * @param array $atts
85 | * @param string $content
86 | * @return string
87 | */
88 | public function render_shortcode( $atts, $content = null ) {
89 | extract( shortcode_atts( array(
90 | 'layout' => 'solid',
91 | 'thinkness' => '',
92 | 'divider_color' => '',
93 | ), $atts, $this->shortcode ) );
94 |
95 | ob_start(); ?>
96 |
97 |
100 |
101 | __( 'Icon', 'themify-flow' ),
8 | 'slug' => 'icon',
9 | 'description' => __( 'Icon', 'themify-flow' ),
10 | 'shortcode' => 'tf_icon',
11 | 'category' => array( 'content', 'global' )
12 | ) );
13 | }
14 |
15 | /**
16 | * Module options.
17 | *
18 | * @since 1.0.0
19 | * @access public
20 | * @return array
21 | */
22 | public function fields() {
23 | return apply_filters( 'tf_module_icon_fields', array(
24 | 'size' => array(
25 | 'type' => 'radio',
26 | 'label' => __( 'Size', 'themify-flow' ),
27 | 'options' => array(
28 | array( 'name' => __( 'Normal', 'themify-flow' ), 'value' => 'normal', 'selected' => true ),
29 | array( 'name' => __( 'Small', 'themify-flow' ), 'value' => 'small' ),
30 | array( 'name' => __( 'Large', 'themify-flow' ), 'value' => 'large' ),
31 | array( 'name' => __( 'xLarge', 'themify-flow' ), 'value' => 'xlarge' ),
32 | ),
33 | ),
34 | 'style' => array(
35 | 'type' => 'radio',
36 | 'label' => __( 'Icon Background Style', 'themify-flow' ),
37 | 'options' => array(
38 | array( 'name' => __( 'Circle', 'themify-flow' ), 'value' => 'circle', 'selected' => true ),
39 | array( 'name' => __( 'Rounded', 'themify-flow' ), 'value' => 'rounded' ),
40 | array( 'name' => __( 'Squared', 'themify-flow' ), 'value' => 'squared' ),
41 | array( 'name' => __( 'None', 'themify-flow' ), 'value' => 'none' ),
42 | ),
43 | ),
44 | 'icons' => array(
45 | 'type' => 'repeater',
46 | 'fields' => array(
47 | 'icon_def' => array(
48 | 'type' => 'multi',
49 | 'label' => __( 'Icon', 'themify-flow' ),
50 | 'fields' => array(
51 | 'icon' => array(
52 | 'type' => 'icon',
53 | 'label' => __( 'Icon', 'themify-flow' ),
54 | ),
55 | 'icon_color' => array(
56 | 'type' => 'color',
57 | 'label' => __( 'Color', 'themify-flow' ),
58 | ),
59 | 'icon_bg' => array(
60 | 'type' => 'color',
61 | 'label' => __( 'Background', 'themify-flow' ),
62 | ),
63 | ),
64 | ),
65 | 'label' => array(
66 | 'type' => 'text',
67 | 'label' => __( 'Label', 'themify-flow' ),
68 | 'class' => 'tf_input_width_70',
69 | ),
70 | 'link' => array(
71 | 'type' => 'text',
72 | 'label' => __( 'Link', 'themify-flow' ),
73 | 'class' => 'tf_input_width_70',
74 | ),
75 | ),
76 | 'new_row_text' => __( '+ Add New', 'themify-flow' ),
77 | '_temp' => array( 'icon', 'icon_color', 'icon_bg', 'label', 'link' ) // this should be removed
78 | ),
79 | ) );
80 | }
81 |
82 | /**
83 | * Module style selectors.
84 | *
85 | * Hold module stye selectors to be used in Styling Panel.
86 | *
87 | * @since 1.0.0
88 | * @access public
89 | * @return array
90 | */
91 | public function styles() {
92 | return apply_filters( 'tf_module_icon_styles', array(
93 | 'tf_module_icon_container' => array(
94 | 'label' => __( 'Icons Container', 'themify-flow' ),
95 | 'selector' => '.tf_icons',
96 | 'basic_styling' => array( 'background', 'padding', 'margin', 'border' ),
97 | ),
98 | 'tf_module_icon_icon' => array(
99 | 'label' => __( 'Icon', 'themify-flow' ),
100 | 'selector' => '.none .tf_icon .tf_icon_icon, .small .tf_icon .tf_icon_icon, .large .tf_icon .tf_icon_icon, .xlarge .tf_icon .tf_icon_icon',
101 | 'basic_styling' => array( 'font' ),
102 | ),
103 | 'tf_module_icon_link' => array(
104 | 'label' => __( 'Icon Link', 'themify-flow' ),
105 | 'selector' => '.tf_icon_link',
106 | 'basic_styling' => array( 'background', 'padding', 'margin' ),
107 | ),
108 | 'tf_module_icon_link_hover' => array(
109 | 'label' => __( 'Icon Link Hover', 'themify-flow' ),
110 | 'selector' => '.tf_icon_link:hover',
111 | 'basic_styling' => array( 'background' ),
112 | ),
113 | 'tf_module_icon_label' => array(
114 | 'label' => __( 'Icon Label', 'themify-flow' ),
115 | 'selector' => '.tf_icon_label',
116 | 'basic_styling' => array( 'font' ),
117 | ),
118 | ) );
119 | }
120 |
121 | /**
122 | * Render main shortcode.
123 | *
124 | * @since 1.0.0
125 | * @access public
126 | * @param array $atts
127 | * @param string $content
128 | * @return string
129 | */
130 | public function render_shortcode( $atts, $content = null ) {
131 | extract( shortcode_atts( array(
132 | 'size' => 'normal',
133 | 'style' => 'circle',
134 | 'icons' => 0
135 | ), array_filter( $atts ) ) );
136 |
137 | // Begin building markup for icon.
138 | $output = '';
139 |
140 | if( $icons > 0 && ! empty( $atts['icons_order'] ) ) {
141 | $output .= sprintf( '';
180 | }
181 |
182 | return $output;
183 | }
184 |
185 | public function has_shortcode_content() {
186 | return true;
187 | }
188 | }
189 |
190 | new TF_Module_Icon();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/list-posts/module.php:
--------------------------------------------------------------------------------
1 | load_modules();
11 | add_action( 'tf_module_elements_loaded', array( $this, 'load_elements' ) );
12 | }
13 |
14 | public function load_modules() {
15 | include_once( dirname( __FILE__ ) . '/class-tf-module-list-posts.php' );
16 | }
17 |
18 | public function load_elements() {
19 | $dir = dirname(dirname( __FILE__ )).'/archive-loop/elements';
20 |
21 | // Any core modules please list here
22 | $lists = array( 'post-title', 'post-excerpt-content', 'post-meta', 'featured-image', 'post-text' );
23 |
24 | foreach( $lists as $list ) {
25 | include_once( sprintf( '%s/%s.php', $dir, $list ) );
26 | }
27 | }
28 | }
29 |
30 | /** Initialize class */
31 | new TF_List_Posts();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/menu/class-menu-dropdown.php:
--------------------------------------------------------------------------------
1 | `)
12 | }
13 |
14 | function end_lvl( &$output, $depth = 0, $args = array() ) {
15 | $indent = str_repeat("\t", $depth); // don't output children closing tag
16 | }
17 |
18 | /**
19 | * Start the element output.
20 | *
21 | * @param string $output Passed by reference. Used to append additional content.
22 | * @param object $item Menu item data object.
23 | * @param int $depth Depth of menu item. May be used for padding.
24 | * @param array $args Additional strings.
25 | * @return void
26 | */
27 | function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
28 | $url = '#' !== $item->url ? $item->url : '';
29 | $output .= '' . str_repeat( ' ', $depth ) . $item->title;
30 | }
31 |
32 | function end_el( &$output, $item, $depth = 0, $args = array() ) {
33 | $output .= " \n"; // replace closing with the option tag
34 | }
35 | }
36 |
37 | /**
38 | * Create HTML dropdown list of pages.
39 | *
40 | * @since 1.0.0
41 | * @uses Walker
42 | */
43 | class Walker_TF_PageDropdown extends Walker {
44 | /**
45 | * @see Walker::$tree_type
46 | * @since 2.1.0
47 | * @var string
48 | */
49 | public $tree_type = 'page';
50 |
51 | /**
52 | * @see Walker::$db_fields
53 | * @since 2.1.0
54 | * @todo Decouple this
55 | * @var array
56 | */
57 | public $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
58 |
59 | /**
60 | * @see Walker::start_el()
61 | * @since 2.1.0
62 | *
63 | * @param string $output Passed by reference. Used to append additional content.
64 | * @param object $page Page data object.
65 | * @param int $depth Depth of page in reference to parent pages. Used for padding.
66 | * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
67 | * @param int $id
68 | */
69 | public function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
70 | $pad = str_repeat(' ', $depth * 3);
71 |
72 | $output .= "\tID ) . '\"';
73 | if ( $page->ID == $args['selected'] )
74 | $output .= ' selected="selected"';
75 | $output .= '>';
76 |
77 | $title = $page->post_title;
78 | if ( '' === $title ) {
79 | $title = sprintf( __( '#%d (no title)' ), $page->ID );
80 | }
81 |
82 | /**
83 | * Filter the page title when creating an HTML drop-down list of pages.
84 | *
85 | * @since 3.1.0
86 | *
87 | * @param string $title Page title.
88 | * @param object $page Page data object.
89 | */
90 | $title = apply_filters( 'list_pages', $title, $page );
91 | $output .= $pad . esc_html( $title );
92 | $output .= " \n";
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/next-prev-post/module.php:
--------------------------------------------------------------------------------
1 | __( 'Next/Prev Post', 'themify-flow' ),
16 | 'slug' => 'next_prev_post',
17 | 'shortcode' => 'tf_next_prev_post',
18 | 'description' => __( 'Display Post Navigation.', 'themify-flow' ),
19 | 'category' => 'single'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field.
25 | *
26 | * Display module options.
27 | *
28 | * @since 1.0.0
29 | * @access public
30 | * @return array
31 | */
32 | public function fields() {
33 | return apply_filters( 'tf_module_prev_next_post_fields', array(
34 | 'prev_post_label' => array(
35 | 'type' => 'text',
36 | 'label' => __( 'Prev Post Label', 'themify-flow' ),
37 | 'class' => 'tf_input_width_70',
38 | ),
39 | 'next_post_label' => array(
40 | 'type' => 'text',
41 | 'label' => __( 'Next Post Label', 'themify-flow' ),
42 | 'class' => 'tf_input_width_70',
43 | ),
44 | 'show_arrow' => array(
45 | 'type' => 'radio',
46 | 'label' => __( 'Show Arrow Icon', 'themify-flow' ),
47 | 'options' => array(
48 | array( 'name' => __( 'Yes', 'themify-flow' ), 'value' => 'yes', 'selected' => true ),
49 | array( 'name' => __( 'No', 'themify-flow' ), 'value' => 'no' ),
50 | ),
51 | ),
52 | 'in_same_cat' => array(
53 | 'type' => 'checkbox',
54 | 'label' => __( 'Same Category', 'themify-flow' ),
55 | 'text' => __( 'Show only from the same category', 'themify-flow' ),
56 | ),
57 | ) );
58 | }
59 |
60 | /**
61 | * Module style selectors.
62 | *
63 | * Hold module stye selectors to be used in Styling Panel.
64 | *
65 | * @since 1.0.0
66 | * @access public
67 | * @return array
68 | */
69 | public function styles() {
70 | return apply_filters( 'tf_module_prev_next_post_styles', array(
71 | 'tf_module_prev_next_post_container' => array(
72 | 'label' => __( 'Next/Prev Container', 'themify-flow' ),
73 | 'selector' => '.tf_post_nav',
74 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
75 | ),
76 | 'tf_module_prev_next_post_link' => array(
77 | 'label' => __( 'Next/Prev Link', 'themify-flow' ),
78 | 'selector' => '.tf_post_nav a',
79 | 'basic_styling' => array( 'border', 'font', 'margin' ),
80 | ),
81 | 'tf_module_prev_next_post_link_hover' => array(
82 | 'label' => __( 'Next/Prev Link Hover', 'themify-flow' ),
83 | 'selector' => '.tf_post_nav a:hover',
84 | 'basic_styling' => array( 'font' ),
85 | ),
86 | 'tf_module_prev_next_post_arrow' => array(
87 | 'label' => __( 'Next/Prev Arrow', 'themify-flow' ),
88 | 'selector' => '.tf_post_nav .prev .arrow:before, .tf_post_nav .next .arrow:before',
89 | 'basic_styling' => array( 'background', 'border', 'font', 'padding' ),
90 | ),
91 | 'tf_module_prev_next_post_label' => array(
92 | 'label' => __( 'Next/Prev Post Label', 'themify-flow' ),
93 | 'selector' => '.tf_post_nav .next_prev_post_label',
94 | 'basic_styling' => array( 'font' ),
95 | ),
96 | ) );
97 | }
98 |
99 | /**
100 | * Render main shortcode.
101 | *
102 | * @since 1.0.0
103 | * @access public
104 | * @param array $atts
105 | * @param string $content
106 | * @return string
107 | */
108 | public function render_shortcode( $atts, $content = null ) {
109 | extract( shortcode_atts( array(
110 | 'prev_post_label' => '',
111 | 'next_post_label' => '',
112 | 'show_arrow' => 'yes',
113 | 'in_same_cat' => 0,
114 | ), $atts, $this->shortcode ) );
115 |
116 | ob_start();
117 |
118 | // call the action hook used for get_template_part
119 | do_action( 'get_template_part_includes/post-nav' );
120 |
121 | $template = locate_template( array( 'includes/post-nav.php' ), false );
122 | ob_start();
123 | include( $template );
124 | $output = ob_get_clean();
125 |
126 | return $output;
127 | }
128 | }
129 |
130 | /** Initialize module */
131 | new TF_Module_Next_Prev_Post();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/page-content/module.php:
--------------------------------------------------------------------------------
1 | __( 'Page Content', 'themify-flow' ),
16 | 'slug' => 'page-content',
17 | 'shortcode' => 'tf_page_content',
18 | 'description' => __( 'Display the content of the page.', 'themify-flow' ),
19 | 'category' => 'page'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field.
25 | *
26 | * Display module options.
27 | *
28 | * @since 1.0.0
29 | * @access public
30 | * @return array
31 | */
32 | public function fields() {
33 | return apply_filters( 'tf_module_page_content_fields', array(
34 | // No options for this module.
35 | ) );
36 | }
37 |
38 | /**
39 | * Module style selectors.
40 | *
41 | * Hold module stye selectors to be used in Styling Panel.
42 | *
43 | * @since 1.0.0
44 | * @access public
45 | * @return array
46 | */
47 | public function styles() {
48 | return apply_filters( 'tf_module_page_content_styles', array(
49 | 'tf_module_page_content_container' => array(
50 | 'label' => __( 'Page Content Container', 'themify-flow' ),
51 | 'selector' => '.tf_page_content',
52 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
53 | ),
54 | ) );
55 | }
56 |
57 | /**
58 | * Render main shortcode.
59 | *
60 | * @since 1.0.0
61 | * @access public
62 | * @param array $atts
63 | * @param string $content
64 | * @return string
65 | */
66 | public function render_shortcode( $atts, $content = null ) {
67 | /** Use condition here to prevent infinite loop issue that cause memory limit error */
68 | /** If viewing template page (view/frontend editor) echo preview text since the actual the_content is the builder data in a bunch of shortcodes */
69 | $output = '';
70 | if ( ! TF_Model::is_template_page() ) {
71 | // make sure $post exist
72 | global $post;
73 | if ( is_object( $post ) && ! is_admin() ) {
74 | $output = apply_filters( 'the_content', $post->post_content );
75 | $output = str_replace( ']]>', ']]>', $output );
76 | }
77 | } else {
78 | $output = sprintf('%s
', __('This is only preview text. The text content here will be replaced with actual page content when viewing the real page.', 'themify-flow') );
79 | }
80 |
81 | return '' . $output . '
';
82 | }
83 | }
84 |
85 | /** Initialize module */
86 | new TF_Module_Page_Content();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/page-featured-image/module.php:
--------------------------------------------------------------------------------
1 | __('Page Featured Image', 'themify-flow' ),
16 | 'slug' => 'page_featured_image',
17 | 'shortcode' => 'tf_page_featured_image',
18 | 'description' => 'Page Featured Image module',
19 | 'category' => 'page'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field
25 | *
26 | * @since 1.0.0
27 | * @access public
28 | * @return array
29 | */
30 | public function fields() {
31 |
32 | return apply_filters( 'tf_page_featured_image_fields', array(
33 | 'image_size' => array(
34 | 'type' => 'select',
35 | 'label' => __('Image Size', 'themify-flow'),
36 | 'options' => tf_get_image_sizes_list()
37 | ),
38 | 'image_dimension' => array(
39 | 'type' => 'multi',
40 | 'label' => __('Dimensions', 'themify-flow'),
41 | 'fields' => array(
42 | 'image_width' => array(
43 | 'type' => 'text',
44 | 'class' => 'tf_input_width_20',
45 | 'wrapper' => 'no',
46 | 'description' => 'x'
47 | ),
48 | 'image_height' => array(
49 | 'type' => 'text',
50 | 'class' => 'tf_input_width_20',
51 | 'wrapper' => 'no',
52 | 'description' => 'px'
53 | )
54 | )
55 | )
56 | ) );
57 | }
58 |
59 | /**
60 | * Module style selectors.
61 | *
62 | * Hold module style selectors to be used in Styling Panel.
63 | *
64 | * @since 1.0.0
65 | * @access public
66 | * @return array
67 | */
68 | public function styles() {
69 | return apply_filters( 'tf_module_page_featured_image_styles', array(
70 | 'tf_module_page_featured_image_container' => array(
71 | 'label' => __( 'Image Container', 'themify-flow' ),
72 | 'selector' => '.tf_page_featured_image',
73 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
74 | ),
75 | 'tf_module_page_featured_image_image' => array(
76 | 'label' => __( 'Image', 'themify-flow' ),
77 | 'selector' => '.tf_page_featured_image img',
78 | )
79 | ) );
80 | }
81 |
82 | /**
83 | * Render main shortcode.
84 | *
85 | * @since 1.0.0
86 | * @access public
87 | * @param array $atts
88 | * @param string $content
89 | * @return string
90 | */
91 | public function render_shortcode( $atts, $content = null ) {
92 | $atts = shortcode_atts( array(
93 | 'image_size' => 'blank',
94 | 'image_width' => '',
95 | 'image_height' => ''
96 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
97 | if ( ! TF_Model::is_template_page() ) {
98 | $output = '';
99 | $image_size = 'blank' != $atts['image_size'] ? $atts['image_size'] : 'large';
100 |
101 | if (has_post_thumbnail( get_the_ID() ) ) {
102 | $post_thumbnail = get_post_thumbnail_id( get_the_ID() );
103 | $post_thumbnail_object = get_post( $post_thumbnail );
104 | $thumbnail_title = is_object( $post_thumbnail_object ) ? $post_thumbnail_object->post_title : '';
105 | $image_attribute = wp_get_attachment_image_src( $post_thumbnail, $image_size );
106 | $post_image = sprintf( ' ',
107 | esc_url( $image_attribute[0] ),
108 | esc_attr( $thumbnail_title ),
109 | esc_attr( $atts['image_width'] ),
110 | esc_attr( $atts['image_height'] )
111 | );
112 | $output = ''.$post_image.' ';
113 |
114 | }
115 | }
116 | else{
117 | if(!$atts['image_width']){
118 | $atts['image_width'] = '350';
119 | }
120 | if(!$atts['image_height']){
121 | $atts['image_height'] = '150';
122 | }
123 | $output = ' ';
124 | }
125 | return apply_filters( 'tf_shortcode_element_render', $output, $this->slug, $atts, $content );
126 | }
127 | }
128 |
129 | new TF_Module_Page_Featured_Image();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/page-title/module.php:
--------------------------------------------------------------------------------
1 | __('Page Title', 'themify-flow'),
16 | 'slug' => 'page-title',
17 | 'shortcode' => 'tf_page_title',
18 | 'description' => __('Display page title on the page', 'themify-flow'),
19 | 'category' => 'page'
20 | ));
21 | }
22 |
23 | /**
24 | * Module settings field.
25 | *
26 | * Display module options.
27 | *
28 | * @since 1.0.0
29 | * @access public
30 | * @return array
31 | */
32 | public function fields() {
33 | return apply_filters( 'tf_module_page_title_fields', array(
34 | 'title_tag' => array(
35 | 'type' => 'select',
36 | 'label' => __('HTML Tag', 'themify-flow'),
37 | 'options' => array(
38 | array( 'name' => 'H1', 'value' => 'h1' ),
39 | array( 'name' => 'H2', 'value' => 'h2' ),
40 | array( 'name' => 'H3', 'value' => 'h3' ),
41 | array( 'name' => 'H4', 'value' => 'h4' ),
42 | array( 'name' => 'H5', 'value' => 'h5' ),
43 | array( 'name' => 'H6', 'value' => 'h6' ),
44 | )
45 | )
46 | ) );
47 | }
48 |
49 | /**
50 | * Module style selectors.
51 | *
52 | * Hold module stye selectors to be used in Styling Panel.
53 | *
54 | * @since 1.0.0
55 | * @access public
56 | * @return array
57 | */
58 | public function styles() {
59 | return apply_filters( 'tf_module_text_styles', array(
60 | 'tf_module_page_title' => array(
61 | 'label' => __( 'Page Title', 'themify-flow'),
62 | 'selector' => '.tf_page_title',
63 | 'basic_styling' => array( 'font', 'margin' ),
64 | )
65 | ) );
66 | }
67 |
68 | /**
69 | * Render main shortcode.
70 | *
71 | * @since 1.0.0
72 | * @access public
73 | * @param array $atts
74 | * @param string $content
75 | * @return string
76 | */
77 | public function render_shortcode( $atts, $content = null ) {
78 | $atts = shortcode_atts( array(
79 | 'title_tag' => ''
80 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
81 | if ( ! TF_Model::is_template_page() ) {
82 | /** We can separate the module markup in separated template file later */
83 | $output = sprintf( '<%1$s class="tf_page_title">%2$s%1$s>',
84 | $atts['title_tag'],
85 | get_the_title()
86 | );
87 | }
88 | else{
89 | $output = sprintf('%s
', __('Page Title ', 'themify-flow') );
90 | }
91 | return $output;
92 | }
93 | }
94 |
95 | /** Initialize module */
96 | new TF_Module_Page_Title();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/searchform/module.php:
--------------------------------------------------------------------------------
1 | __( 'Search Form', 'themify-flow' ),
16 | 'slug' => 'searchform',
17 | 'shortcode' => 'tf_searchform',
18 | 'description' => __( 'Display WordPress search form.', 'themify-flow' ),
19 | 'category' => 'global'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field.
25 | *
26 | * Display module options.
27 | *
28 | * @since 1.0.0
29 | * @access public
30 | * @return array
31 | */
32 | public function fields() {
33 | return apply_filters( 'tf_module_searchform_fields', array(
34 | // no options
35 | ) );
36 | }
37 |
38 | /**
39 | * Module style selectors.
40 | *
41 | * Hold module stye selectors to be used in Styling Panel.
42 | *
43 | * @since 1.0.0
44 | * @access public
45 | * @return array
46 | */
47 | public function styles() {
48 | return apply_filters( 'tf_module_searchform_styles', array(
49 | 'tf_module_searchform_container' => array(
50 | 'label' => __( 'Search Container', 'themify-flow' ),
51 | 'selector' => '.tf_searchform',
52 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
53 | ),
54 | 'tf_module_searchform_input' => array(
55 | 'label' => __( 'Search Input', 'themify-flow' ),
56 | 'selector' => '.tf_searchform input[type=text]',
57 | 'basic_styling' => array( 'border', 'font', 'margin', 'background' ),
58 | )
59 | ) );
60 | }
61 |
62 | /**
63 | * Render main shortcode.
64 | *
65 | * @since 1.0.0
66 | * @access public
67 | * @param array $atts
68 | * @param string $content
69 | * @return string
70 | */
71 | public function render_shortcode( $atts, $content = null ) {
72 | ob_start(); ?>
73 |
74 |
75 |
76 | __( 'Site Logo', 'themify-flow' ),
8 | 'slug' => 'site-logo',
9 | 'description' => __( 'Site logo module', 'themify-flow' ),
10 | 'shortcode' => 'tf_site_logo',
11 | 'category' => 'global'
12 | ));
13 | }
14 |
15 | public function fields() {
16 | return apply_filters( 'tf_module_site_logo_fields', array(
17 | 'logo_type' => array(
18 | 'type' => 'radio',
19 | 'label' => ' ',
20 | 'options' => array(
21 | array( 'name' => __( 'Text', 'themify-flow' ), 'value' => 'text', 'selected' => true ),
22 | array( 'name' => __( 'Image', 'themify-flow' ), 'value' => 'image' ),
23 | ),
24 | 'toggleable' => array( 'target_class' => 'logo_type' )
25 | ),
26 | 'title_tag' => array(
27 | 'type' => 'select',
28 | 'label' => __( 'HTML Tag', 'themify-flow' ),
29 | 'options' => array(
30 | array( 'name' => __( 'Paragraph', 'themify-flow' ), 'value' => 'p' ),
31 | array( 'name' => 'H1', 'value' => 'h1' ),
32 | array( 'name' => 'H2', 'value' => 'h2' ),
33 | array( 'name' => 'H3', 'value' => 'h3' ),
34 | array( 'name' => 'H4', 'value' => 'h4' ),
35 | array( 'name' => 'H5', 'value' => 'h5' ),
36 | array( 'name' => 'H6', 'value' => 'h6' ),
37 | ),
38 | 'row_class' => 'logo_type logo_type-text',
39 | ),
40 | 'logo_text' => array(
41 | 'type' => 'text',
42 | 'label' => __( 'Logo Text', 'themify-flow' ),
43 | 'class' => 'tf_input_width_70',
44 | 'description' => ' ' . sprintf( __( 'Leave blank to use the Site Title in WP > Settings ', 'themify-flow' ), admin_url( 'options-general.php' ) ),
45 | 'row_class' => 'logo_type logo_type-text',
46 | ),
47 | 'logo_image' => array(
48 | 'type' => 'image',
49 | 'label' => __( 'Image', 'themify-flow' ),
50 | 'class' => 'tf_input_width_70',
51 | 'row_class' => 'logo_type logo_type-image',
52 | ),
53 | 'image_dimensions' => array(
54 | 'type' => 'multi',
55 | 'label' => __( 'Image Dimensions', 'themify-flow' ),
56 | 'fields' => array(
57 | 'width' => array(
58 | 'type' => 'text',
59 | 'label' => __( '', 'themify-flow' ),
60 | 'class' => 'tf_input_width_10',
61 | 'description' => ' X ',
62 | ),
63 | 'height' => array(
64 | 'type' => 'text',
65 | 'label' => __( '', 'themify-flow' ),
66 | 'class' => 'tf_input_width_10',
67 | 'description' => 'px',
68 | ),
69 | ),
70 | 'row_class' => 'logo_type logo_type-image',
71 | ),
72 | 'logo_link' => array(
73 | 'type' => 'text',
74 | 'label' => __( 'Logo Link', 'themify-flow' ),
75 | 'class' => 'tf_input_width_70', // this is not working
76 | 'description' => ' ' . __( 'Leave blank to use the Site URL', 'themify-flow' ),
77 | )
78 | ) );
79 | }
80 |
81 | /**
82 | * Module style selectors.
83 | *
84 | * Hold module stye selectors to be used in Styling Panel.
85 | *
86 | * @since 1.0.0
87 | * @access public
88 | * @return array
89 | */
90 | public function styles() {
91 | return apply_filters( 'tf_module_site_logo_styles', array(
92 | 'tf_module_site_logo_container' => array(
93 | 'label' => __( 'Site Logo Container', 'themify-flow' ),
94 | 'selector' => '.tf_site_logo',
95 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
96 | ),
97 | 'tf_module_site_logo' => array(
98 | 'label' => __( 'Site Logo Text', 'themify-flow' ),
99 | 'selector' => '.tf_site_logo a',
100 | 'basic_styling' => array( 'font' ),
101 | )
102 | ) );
103 | }
104 |
105 | /**
106 | * Render main shortcode.
107 | *
108 | * @since 1.0.0
109 | * @access public
110 | * @param array $atts
111 | * @param string $content
112 | * @return string
113 | */
114 | public function render_shortcode( $atts, $content = null ) {
115 | extract( wp_parse_args( $atts, array(
116 | 'logo_type' => 'text',
117 | 'title_tag' => 'p',
118 | 'logo_text' => '',
119 | 'logo_image' => '',
120 | 'width' => '',
121 | 'height' => '',
122 | 'logo_link' => ''
123 | ) ) );
124 | if( '' == $logo_text ) $logo_text = get_bloginfo( 'name' );
125 | if( '' == $logo_link ) $logo_link = home_url();
126 |
127 | ob_start(); ?>
128 |
129 |
130 | < class="tf_site_logo">
131 |
132 | >
133 |
134 |
135 |
136 |
137 |
138 |
139 | __( 'Site Tagline', 'themify-flow' ),
8 | 'slug' => 'site-tagline',
9 | 'description' => __( 'Site tagline module', 'themify-flow' ),
10 | 'shortcode' => 'tf_site_tagline',
11 | 'category' => 'global'
12 | ));
13 | }
14 |
15 | public function fields() {
16 | return apply_filters( 'tf_module_site_tagline_fields', array(
17 | 'tag' => array(
18 | 'type' => 'select',
19 | 'label' => __( 'HTML Tag', 'themify-flow' ),
20 | 'options' => array(
21 | array( 'name' => __( 'Paragraph', 'themify-flow' ), 'value' => 'p' ),
22 | array( 'name' => 'H1', 'value' => 'h1' ),
23 | array( 'name' => 'H2', 'value' => 'h2' ),
24 | array( 'name' => 'H3', 'value' => 'h3' ),
25 | array( 'name' => 'H4', 'value' => 'h4' ),
26 | array( 'name' => 'H5', 'value' => 'h5' ),
27 | array( 'name' => 'H6', 'value' => 'h6' ),
28 | )
29 | ),
30 | 'tagline_text' => array(
31 | 'type' => 'text',
32 | 'label' => __( 'Tagline Text', 'themify-flow' ),
33 | 'class' => 'tf_input_width_70',
34 | 'description' => ' ' . sprintf( __( 'Leave blank to use the Tagline in WP > Settings ', 'themify-flow' ), admin_url( 'options-general.php' ) ),
35 | )
36 | ) );
37 | }
38 |
39 | /**
40 | * Module style selectors.
41 | *
42 | * Hold module stye selectors to be used in Styling Panel.
43 | *
44 | * @since 1.0.0
45 | * @access public
46 | * @return array
47 | */
48 | public function styles() {
49 | return apply_filters( 'tf_module_site_logo_styles', array(
50 | 'tf_module_site_tagline' => array(
51 | 'label' => __( 'Site Tagline', 'themify-flow' ),
52 | 'selector' => '.tf_site_tagline',
53 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
54 | ),
55 | ) );
56 | }
57 |
58 | /**
59 | * Render main shortcode.
60 | *
61 | * @since 1.0.0
62 | * @access public
63 | * @param array $atts
64 | * @param string $content
65 | * @return string
66 | */
67 | public function render_shortcode( $atts, $content = null ) {
68 | extract( $atts = shortcode_atts( array(
69 | 'tag' => 'p',
70 | 'tagline_text' => ''
71 | ), $atts, $this->shortcode ) );
72 |
73 | if( $tagline_text == '' ) $tagline_text = get_bloginfo( 'description' );
74 | ob_start(); ?>
75 |
76 | < class="tf_site_tagline">
77 |
78 | >
79 |
80 | __( 'Template Part', 'themify-flow' ),
16 | 'slug' => 'template-part',
17 | 'shortcode' => 'tf_module_template_part',
18 | 'description' => __( 'Show content of selected Template Part', 'themify-flow' ),
19 | 'category' => 'global'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field
25 | *
26 | * @since 1.0.0
27 | * @access public
28 | * @return array
29 | */
30 | public function fields() {
31 | $template_parts = TF_Model::get_posts( 'tf_template_part' );
32 | if(!empty($template_parts)){
33 | $options = array();
34 | foreach ($template_parts as $t){
35 | if(!isset($_REQUEST['template_id']) || $_REQUEST['template_id']!=$t->ID){
36 | $options[] =array('name'=>$t->post_title,'value'=>$t->ID);
37 | }
38 | }
39 | if(!empty($options)){
40 | return apply_filters( 'tf_module_template_part_fields', array(
41 | 'part' => array(
42 | 'type' => 'select',
43 | 'label' => __( 'Template_Part', 'themify-flow' ),
44 | 'options' => $options,
45 | )
46 |
47 | ) );
48 | }
49 | }
50 | return apply_filters( 'tf_module_template_part_fields', array() );
51 |
52 | }
53 |
54 | /**
55 | * Module style selectors.
56 | *
57 | * Hold module stye selectors to be used in Styling Panel.
58 | *
59 | * @since 1.0.0
60 | * @access public
61 | * @return array
62 | */
63 | public function styles() {
64 | return apply_filters( 'tf_module_template_part_styles', array(
65 | 'tf_module_template_part_container' => array(
66 | 'label' => __( 'Template Part Container', 'themify-flow' ),
67 | 'selector' => '.tf_module_template-part',
68 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
69 | ),
70 | ) );
71 | }
72 |
73 | /**
74 | * Render main shortcode.
75 | *
76 | * @since 1.0.0
77 | * @access public
78 | * @param array $atts
79 | * @param string $content
80 | * @return string
81 | */
82 | public function render_shortcode( $atts, $content = null ) {
83 | extract( $atts = shortcode_atts( array(
84 | 'part' => ''
85 | ), $atts, $this->shortcode ) );
86 | if(!isset($atts['part']) || !$atts['part'] || is_admin()){
87 | return '';
88 | }
89 | global $TF_Template_Part;
90 | return $TF_Template_Part->template_part_shortcode(array('id'=>$atts['part']));
91 |
92 | }
93 | }
94 |
95 | /** Initialize module */
96 | new TF_Module_Template_Part();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/text/module.php:
--------------------------------------------------------------------------------
1 | __('Text', 'themify-flow'),
16 | 'slug' => 'text',
17 | 'shortcode' => 'tf_text',
18 | 'description' => 'Text module',
19 | 'category' => 'content'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field
25 | *
26 | * @since 1.0.0
27 | * @access public
28 | * @return array
29 | */
30 | public function fields() {
31 | return apply_filters( 'tf_module_text_fields', array(
32 | 'content' => array(
33 | 'type' => 'wp_editor',
34 | 'wrapper' => 'no',
35 | 'rows' => 16
36 | )
37 | ) );
38 | }
39 |
40 | /**
41 | * Module style selectors.
42 | *
43 | * Hold module stye selectors to be used in Styling Panel.
44 | *
45 | * @since 1.0.0
46 | * @access public
47 | * @return array
48 | */
49 | public function styles() {
50 | return apply_filters( 'tf_module_text_styles', array(
51 | 'tf_module_text_container' => array(
52 | 'label' => __('Text Container', 'themify-flow'),
53 | 'selector' => '.tf_module_text',
54 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
55 | ),
56 | 'tf_module_text_p' => array(
57 | 'label' => __( 'Paragraph', 'themify-flow' ),
58 | 'selector' => '.tf_module_text p',
59 | 'basic_styling' => array( 'border', 'font', 'margin' ),
60 | ),
61 | 'tf_module_text_a' => array(
62 | 'label' => __( 'Link', 'themify-flow' ),
63 | 'selector' => '.tf_module_text a',
64 | 'basic_styling' => array( 'border', 'font', 'margin' ),
65 | ),
66 | 'tf_module_text_h1' => array(
67 | 'label' => __( 'H1', 'themify-flow' ),
68 | 'selector' => '.tf_module_text h1',
69 | 'basic_styling' => array( 'font', 'margin' ),
70 | ),
71 | 'tf_module_text_h2' => array(
72 | 'label' => __( 'H2', 'themify-flow' ),
73 | 'selector' => '.tf_module_text h2',
74 | 'basic_styling' => array( 'font', 'margin' ),
75 | ),
76 | 'tf_module_text_h3' => array(
77 | 'label' => __( 'H3', 'themify-flow' ),
78 | 'selector' => '.tf_module_text h3',
79 | 'basic_styling' => array( 'font', 'margin' ),
80 | ),
81 | 'tf_module_text_h4' => array(
82 | 'label' => __( 'H4', 'themify-flow' ),
83 | 'selector' => '.tf_module_text h4',
84 | 'basic_styling' => array( 'font', 'margin' ),
85 | ),
86 | 'tf_module_text_h5' => array(
87 | 'label' => __( 'H5', 'themify-flow' ),
88 | 'selector' => '.tf_module_text h5',
89 | 'basic_styling' => array( 'font', 'margin' ),
90 | ),
91 | 'tf_module_text_h6' => array(
92 | 'label' => __( 'H6', 'themify-flow' ),
93 | 'selector' => '.tf_module_text h6',
94 | 'basic_styling' => array( 'font', 'margin' ),
95 | ),
96 | ) );
97 | }
98 |
99 | /**
100 | * Render main shortcode.
101 | *
102 | * @since 1.0.0
103 | * @access public
104 | * @param array $atts
105 | * @param string $content
106 | * @return string
107 | */
108 | public function render_shortcode( $atts, $content = null ) {
109 | $atts = shortcode_atts( array(
110 | ), $atts, $this->shortcode ); // must add the third params $this->shortcode, for builder shortcode rendering
111 |
112 | /** We can separate the module markup in separated template file later */
113 | $output = '';
114 | $output .= apply_filters( 'tf_module_content', $content );
115 | $output .= '
';
116 |
117 | return $output;
118 | }
119 | }
120 |
121 | new TF_Module_Text();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/modules/widget-area/module.php:
--------------------------------------------------------------------------------
1 | __( 'Widget Area', 'themify-flow' ),
16 | 'slug' => 'widget_area',
17 | 'shortcode' => 'tf_widget_area',
18 | 'description' => __( 'Display widget area.', 'themify-flow' ),
19 | 'category' => 'global'
20 | ) );
21 | }
22 |
23 | /**
24 | * Module settings field.
25 | *
26 | * Display module options.
27 | *
28 | * @since 1.0.0
29 | * @access public
30 | * @return array
31 | */
32 | public function fields() {
33 | return apply_filters( 'tf_module_widget_area_fields', array(
34 | 'area' => array(
35 | 'type' => 'widget_area',
36 | 'label' => __( 'Area', 'themify-flow' ),
37 | ),
38 | ) );
39 | }
40 |
41 | /**
42 | * Module style selectors.
43 | *
44 | * Hold module stye selectors to be used in Styling Panel.
45 | *
46 | * @since 1.0.0
47 | * @access public
48 | * @return array
49 | */
50 | public function styles() {
51 | return apply_filters( 'tf_module_widget_area_styles', array(
52 | 'tf_module_widget_area_container' => array(
53 | 'label' => __( 'Widget Area Container', 'themify-flow' ),
54 | 'selector' => '.tf_widget_area',
55 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
56 | ),
57 | 'tf_module_widget_area_widget_container' => array(
58 | 'label' => __( 'Widget Container', 'themify-flow' ),
59 | 'selector' => '.tf_widget',
60 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
61 | ),
62 | 'tf_module_widget_area_widget_title' => array(
63 | 'label' => __( 'Widget Title', 'themify-flow' ),
64 | 'selector' => '.tf_widget_title',
65 | 'basic_styling' => array( 'font', 'margin', 'padding', 'border' ),
66 | ),
67 | 'tf_module_widget_area_link' => array(
68 | 'label' => __( 'Widget Link', 'themify-flow' ),
69 | 'selector' => '.tf_widget a',
70 | 'basic_styling' => array( 'font' ),
71 | ),
72 | 'tf_module_widget_area_link_hover' => array(
73 | 'label' => __( 'Widget Link Hover', 'themify-flow' ),
74 | 'selector' => '.tf_widget a:hover',
75 | 'basic_styling' => array( 'font' ),
76 | )
77 | ) );
78 | }
79 |
80 | /**
81 | * Render main shortcode.
82 | *
83 | * @since 1.0.0
84 | * @access public
85 | * @param array $atts
86 | * @param string $content
87 | * @return string
88 | */
89 | public function render_shortcode( $atts, $content = null ) {
90 | extract( wp_parse_args( $atts, array(
91 | 'area' => ''
92 | ) ) );
93 | ob_start(); ?>
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | __( 'Widget', 'themify-flow' ),
16 | 'slug' => 'widget',
17 | 'shortcode' => 'tf_widget',
18 | 'description' => __( 'Display widget.', 'themify-flow' ),
19 | 'category' => array('content','global')
20 | ) );
21 |
22 | add_action( 'wp_ajax_tf_builder_get_widget_form', array( $this, 'ajax_get_form' ) );
23 | }
24 |
25 | /**
26 | * Module settings field.
27 | *
28 | * Display module options.
29 | *
30 | * @since 1.0.0
31 | * @access public
32 | * @return array
33 | */
34 | public function fields() {
35 | return apply_filters( 'tf_module_widget_fields', array(
36 | 'widget' => array(
37 | 'type' => 'widget',
38 | 'label' => __( 'Widget', 'themify-flow' ),
39 | ),
40 | 'widget_data' => array( // dummy field, just to store the data from widgets
41 | 'type' => 'html',
42 | 'html' => '',
43 | 'is_array' => true // signal to Flow that the data should be saved as an array (serialized string)
44 | )
45 | ) );
46 | }
47 |
48 | /**
49 | * Module style selectors.
50 | *
51 | * Hold module stye selectors to be used in Styling Panel.
52 | *
53 | * @since 1.0.0
54 | * @access public
55 | * @return array
56 | */
57 | public function styles() {
58 | return apply_filters( 'tf_module_widget_styles', array(
59 | 'tf_module_widget_container' => array(
60 | 'label' => __( 'Widget Container', 'themify-flow' ),
61 | 'selector' => '.tf_widget',
62 | 'basic_styling' => array( 'background', 'font', 'padding', 'margin', 'border' ),
63 | ),
64 | 'tf_module_widget_widget_title' => array(
65 | 'label' => __( 'Widget Title', 'themify-flow' ),
66 | 'selector' => '.tf_widget_title',
67 | 'basic_styling' => array( 'font', 'margin', 'padding', 'border' ),
68 | ),
69 | 'tf_module_widget_link' => array(
70 | 'label' => __( 'Widget Link', 'themify-flow' ),
71 | 'selector' => '.tf_widget a',
72 | 'basic_styling' => array( 'font' ),
73 | ),
74 | 'tf_module_widget_link_hover' => array(
75 | 'label' => __( 'Widget Link Hover', 'themify-flow' ),
76 | 'selector' => '.tf_widget a:hover',
77 | 'basic_styling' => array( 'font' ),
78 | )
79 | ) );
80 | }
81 |
82 | /**
83 | * Render main shortcode.
84 | *
85 | * @since 1.0.0
86 | * @access public
87 | * @param array $atts
88 | * @param string $content
89 | * @return string
90 | */
91 | public function render_shortcode( $atts, $content = null ) {
92 | global $wp_widget_factory;
93 |
94 | extract( wp_parse_args( $atts, array(
95 | 'widget' => '',
96 | 'widget_data' => '',
97 | ) ) );
98 | if( $widget == '' || ! isset( $wp_widget_factory->widgets[$widget] ) ) {
99 | return;
100 | }
101 | ob_start();
102 |
103 | the_widget( $widget, unserialize( html_entity_decode( $widget_data ) ), array(
104 | 'before_widget' => sprintf( '', $wp_widget_factory->widgets[$widget]->widget_options['classname'] ),
105 | 'after_widget' => '
',
106 | 'before_title' => '',
108 | ) );
109 |
110 | $output = ob_get_clean();
111 | return $output;
112 | }
113 |
114 | public function ajax_get_form() {
115 | global $wp_widget_factory;
116 | require_once ABSPATH . 'wp-admin/includes/widgets.php';
117 |
118 | if( ! isset( $_POST['widget_class'] ) || empty( $_POST['widget_class'] ) ) {
119 | return '';
120 | }
121 | $options = ( isset( $_POST['widget_data'] ) && ! empty( $_POST['widget_data'] ) ) ? unserialize( stripslashes( $_POST['widget_data'] ) ) : array();
122 |
123 | echo $this->get_widget_form(
124 | $_POST['widget_class'],
125 | 'widget_data', // field name to send widget fields to server
126 | $options
127 | );
128 |
129 | echo ' ';
130 | die();
131 | }
132 |
133 | /**
134 | * Generates the widget form
135 | *
136 | * @since 1.0
137 | * @return string
138 | */
139 | function get_widget_form( $widget, $name, $options = array() ) {
140 | global $wp_widget_factory;
141 |
142 | require_once ABSPATH . 'wp-admin/includes/widgets.php';
143 | if(!is_array($options)){
144 | $options = array();
145 | }
146 | $options = array_merge( $options, array(
147 | 'number' => next_widget_id_number( 0 ),
148 | ) );
149 | ob_start();
150 | $wp_widget_factory->widgets[$widget]->form( $options );
151 | do_action_ref_array( 'in_widget_form', array( $wp_widget_factory->widgets[$widget], null, $options ) );
152 | $form = ob_get_clean();
153 | $base_name = 'widget-' . $wp_widget_factory->widgets[$widget]->id_base . '\[' . $wp_widget_factory->widgets[$widget]->number . '\]';
154 | $form = preg_replace( "/{$base_name}/", $name, $form );
155 |
156 | return $form;
157 | }
158 |
159 | public function has_shortcode_content() {
160 | return true;
161 | }
162 | }
163 |
164 | /** Initialize module */
165 | new TF_Module_Widget();
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-admin-about.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
get_version() ); ?>
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Flow Themes
17 |
Themify Flow allows you to switch, import, export, and create your own Flow themes with drag & drop.
18 |
Go to Themes
19 |
20 |
21 |
Flow Templates
22 |
Templates are used to render the page layout on the frontend. You can edit and design your own templates.
23 |
Go to Templates
24 |
25 |
30 |
31 |
Global Styling Panel
32 |
Global Styling panel allows you to customize the general styling of the theme elements (body, font, background, headings, etc.).
33 |
Go to Styling
34 |
35 |
36 |
37 |
Settings
38 |
In Settings page, you can specify the favicon, header code, footer code, and other framework options.
39 |
Go to Settings
40 |
41 |
42 |
Using Builder
43 |
If you need help with the drag & drop Builder, refer to the Builder Documentation .
44 |
45 |
46 |
47 |
48 |
49 |
50 |
58 |
59 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-backend-builder.php:
--------------------------------------------------------------------------------
1 | post_type, array( 'tf_template', 'tf_template_part' ) ) ? get_post_meta( $post->ID, 'tf_template_type', true ) : 'content';
9 | $current_template_type = '' == $current_template_type ? 'global' : $current_template_type;
10 | $tabs_exclude = array(
11 | 'archive' => array( 'single', 'page' ),
12 | 'single' => array( 'archive', 'page' ),
13 | 'page' => array( 'archive', 'single' ),
14 | 'global' => array( 'archive', 'single', 'page'),
15 | 'content' => array( 'archive', 'single', 'page', 'global')
16 | );
17 | ?>
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | post_type!='tf_template_part' && in_array( $type['value'], $tabs_exclude[ $current_template_type ] ) ) continue; ?>
27 |
28 |
29 |
30 |
31 | post_type!='tf_template_part' && in_array( $type['value'], $tabs_exclude[ $current_template_type ] ) ) continue;
33 | ?>
34 |
35 |
38 | slug}"; ?>
39 |
40 |
41 |
name ); ?>
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s", $post->ID, 'tf_builder_content') );
61 | $value = $value?current($value):false;
62 | $builder_content = in_array( $post->post_type, array( 'tf_template', 'tf_template_part' ) ) ? $post->post_content : ($value?$value->meta_value:false);
63 | echo do_shortcode( $builder_content );
64 | ?>
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-content-builder.php:
--------------------------------------------------------------------------------
1 |
2 | >
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | >
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-frontend-menu.php:
--------------------------------------------------------------------------------
1 |
34 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-module-panel.php:
--------------------------------------------------------------------------------
1 | type ) ? 'global' : $TF_Layout->type;
15 | }
16 | $tabs_exclude = array(
17 | 'archive' => array( 'single', 'page' ),
18 | 'single' => array( 'archive', 'page' ),
19 | 'page' => array( 'archive', 'single' ),
20 | 'global' => array( 'archive', 'single', 'page'),
21 | 'content' => array( 'archive', 'single', 'page', 'global')
22 | );
23 | ?>
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | post_type!='tf_template_part' && in_array( $type['value'], $tabs_exclude[ $current_template_type ] ) ) continue;
36 | ?>
37 |
38 |
39 |
40 |
41 | post_type!='tf_template_part' && in_array( $type['value'], $tabs_exclude[ $current_template_type ] ) ) continue;
43 | ?>
44 |
45 |
48 | slug}"; ?>
49 |
50 |
51 |
name ); ?>
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-part-edit.php:
--------------------------------------------------------------------------------
1 |
2 | >
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 | >
16 |
17 |
18 |
19 |
20 |
21 |
22 | Template Part: %s', 'themify-flow') : __('Content: %s', 'themify-flow');
24 | echo sprintf( $title, get_the_title() ); ?>
25 |
26 |
27 |
28 |
render( get_the_content() ); ?>
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-part.php:
--------------------------------------------------------------------------------
1 |
2 | >
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
15 | >
16 |
17 |
18 |
19 |
20 |
21 |
22 | Template Part: %s', 'themify-flow'), get_the_title() ); ?>
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-region.php:
--------------------------------------------------------------------------------
1 | %s', __('This is Content Section', 'themify-flow') );
12 | echo sprintf( '%s
', __('If you would like to add content to this section, you may do so by editing active TF Template > Add Modules', 'themify-flow') );
13 | }
14 | }
15 | include_once( 'template-render-header.php' );
16 | include_once( 'template-render-body.php' );
17 | include_once( 'template-render-footer.php' );
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-render-body.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | layout_content ) ) {
10 | do_action( 'tf_template_render_content' );
11 | } else {
12 | do_action( 'tf_template_before_layout_content_render' );
13 | echo $TF_Layout->render( $TF_Layout->layout_content );
14 | do_action( 'tf_template_after_layout_content_render' );
15 | }
16 | ?>
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | sidebar ): ?>
25 |
26 |
27 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/themifyflow/tf/includes/templates/template-render-footer.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | footer ): ?>
12 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
35 | 36 |
37 | 38 | 1 && get_option( 'page_comments' ) ) : ?> 40 |' . 55 | '' . 57 | ' ' . 58 | ( $req ? '*' : '' ) . 59 | '
', 60 | 'email' => '' . 61 | '' . 62 | ' ' . 63 | ( $req ? '*' : '' ) . 64 | '
', 65 | 'url' => '' . 66 | '' . 67 | ' ' . 68 | '
') ), 69 | 'comment_field' => '' . 70 | '' . 71 | '
', 72 | 'logged_in_as' => '' . sprintf( __( 'Logged in as %s. Log out?', 'themify-flow' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( get_the_ID() ) ) ) ) . '
', 73 | 'comment_notes_before' => '', 74 | 'comment_notes_after' => '', 75 | 'cancel_reply_link' => __( 'Cancel' , 'themify-flow' ), 76 | 'label_submit' => __( 'Post Comment' , 'themify-flow' ), 77 | ); 78 | comment_form($custom_comment_form); 79 | ?> 80 | 81 | 82 | 83 | 84 | 85 |